From 91049bfd147ab0af4a81da8ba6cc90dbfc04fc52 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 31 Oct 2024 15:48:28 +0800
Subject: [PATCH] 首页优化

---
 src/views/survey/components/box/fireTrend.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/views/survey/components/box/fireTrend.vue b/src/views/survey/components/box/fireTrend.vue
index c141926..13d2e60 100644
--- a/src/views/survey/components/box/fireTrend.vue
+++ b/src/views/survey/components/box/fireTrend.vue
@@ -10,13 +10,13 @@
 -->
 <script setup>
 import publicContent from './publicContent.vue'
-// import { ref, reactive } from 'vue'
+import { ref, reactive } from 'vue'
 
 import { getPage } from '../../../../api/indParkInfo'
 
-var parkQy = ref([])
+let parkQy = ref([])
 
-var searchQuery = ref('')
+let searchQuery = ref('')
 
 onMounted(() => {
     getPages()
@@ -25,7 +25,16 @@
 
 function getPages() {
     getPage().then(res => {
-        parkQy = res.data.data.records
+        parkQy.value = res.data.data.records
+        console.log(res)
+    }).catch(err => {
+        console.log(err)
+    })
+}
+
+function search() {
+    getPage({ name: searchQuery.value }).then(res => {
+        parkQy.value = res.data.data.records
         console.log(res)
     }).catch(err => {
         console.log(err)
@@ -42,17 +51,14 @@
         <div>
             <div class="search-container">
                 <input type="text" v-model="searchQuery" placeholder="请输入企业名称" class="search-input" />
-                <button class="search-button">搜索</button>
+                <button class="search-button" @click="search">搜索</button>
             </div>
         </div>
 
         <div class="data-content-list">
-            <div v-for="item in parkQy" :key="item.id">
-                <div class="data-content-item">
-                    <div> {{ item.name }}</div>
-                    <el-button size="small" type="primary">{{ item.categoryName }}</el-button>
-                </div>
-
+            <div class="data-content-item" v-for="item in parkQy" :key="item.id">
+                <div> {{ item.name }}</div>
+                <el-button size="small" type="primary">进入园区</el-button>
             </div>
         </div>
     </div>
@@ -73,7 +79,11 @@
 }
 
 .data-content-list {
-    height: auto;
+    height: 50%;
+    overflow: scroll;
+    // 隐藏滚动条
+    scrollbar-width: none;
+    text-indent: 1em;
 }
 
 .search-input {
@@ -101,11 +111,12 @@
 
 .data-content-item {
     display: flex;
-    margin: 2px 2px;
+    margin: 2px 10px;
     padding: 5px 0;
     background-color: #747bff;
     justify-content: space-between;
     // 超过高度自动显示滚动条
     overflow-y: auto;
+    border-radius: 5px;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3