From ccc970e575ef3f3e5c67af8da210263f4ac549f9 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 10 四月 2026 16:44:55 +0800
Subject: [PATCH] 2026.4.10

---
 src/views/analysis/huanxincode/HuanxinCodeManage.vue |  247 +++----------------------------------------------
 1 files changed, 17 insertions(+), 230 deletions(-)

diff --git a/src/views/analysis/huanxincode/HuanxinCodeManage.vue b/src/views/analysis/huanxincode/HuanxinCodeManage.vue
index 9140d7c..18e8352 100644
--- a/src/views/analysis/huanxincode/HuanxinCodeManage.vue
+++ b/src/views/analysis/huanxincode/HuanxinCodeManage.vue
@@ -31,8 +31,8 @@
       <el-col :span="8">
         <el-card shadow="hover" class="dashboard-card green-card" @click="filterByCode('green')">
           <div class="card-content">
-            <div class="card-title">缁跨爜搴楅摵鏁�</div>
-            <div class="card-value">{{ statistics.greenCount }}</div>
+            <div class="card-title">缁跨爜搴楅摵</div>
+            <div class="card-value">{{ statistics.greenCount }}<el-text>涓�</el-text></div>
             <div class="card-percentage">{{ statistics.greenPercentage }}%</div>
           </div>
         </el-card>
@@ -40,8 +40,8 @@
       <el-col :span="8">
         <el-card shadow="hover" class="dashboard-card yellow-card" @click="filterByCode('yellow')">
           <div class="card-content">
-            <div class="card-title">榛勭爜搴楅摵鏁�</div>
-            <div class="card-value">{{ statistics.yellowCount }}</div>
+            <div class="card-title">榛勭爜搴楅摵</div>
+            <div class="card-value">{{ statistics.yellowCount }}<el-text>涓�</el-text></div>
             <div class="card-percentage">{{ statistics.yellowPercentage }}%</div>
           </div>
         </el-card>
@@ -49,8 +49,8 @@
       <el-col :span="8">
         <el-card shadow="hover" class="dashboard-card red-card" @click="filterByCode('red')">
           <div class="card-content">
-            <div class="card-title">绾㈢爜搴楅摵鏁�</div>
-            <div class="card-value">{{ statistics.redCount }}</div>
+            <div class="card-title">绾㈢爜搴楅摵</div>
+            <div class="card-value">{{ statistics.redCount }}<el-text>涓�</el-text></div>
             <div class="card-percentage">{{ statistics.redPercentage }}%</div>
           </div>
         </el-card>
@@ -67,7 +67,7 @@
 
     <!-- 搴楅摵鍒楄〃 -->
     <div class="shop-list">
-      <el-table :data="pagedShopList" style="width: 100%">
+      <el-table :data="filteredShopList" style="width: 100%" max-height="600px">
         <el-table-column prop="shopName" label="搴楅摵鍚嶇О" />
         <el-table-column prop="district" label="鎵�鍦ㄥ尯鍘�" width="120" />
         <el-table-column prop="town" label="鎵�鍦ㄨ闀�" width="150" />
@@ -107,7 +107,7 @@
           v-model:page-size="pageSize"
           :page-sizes="[10, 20, 50, 100]"
           layout="total, sizes, prev, pager, next, jumper"
-          :total="filteredShopList.length"
+          :total="total"
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
         />
@@ -221,7 +221,7 @@
     label: '椁愰ギ',
     value: '1',
   },
-  time: dayjs('2023-08-01').date(1).toDate(),
+  time: dayjs('2025-08-01').date(1).toDate(),
 })
 // 鐘舵��
 const drawerVisible = ref(false)
@@ -232,6 +232,7 @@
 // 鍒嗛〉鐩稿叧
 const currentPage = ref(1)
 const pageSize = ref(10)
+const total = ref(0)
 // 鐜俊鐮佸浘鐗嘦RL
 const codeImageUrl = ref('')
 
@@ -244,42 +245,6 @@
   redCount: 20,
   redPercentage: 10.5,
 })
-
-// 搴楅摵鍚嶇О鍒楄〃
-const shopNames = [
-  '浠樺皬濮愬湪鎴愰兘',
-  '鍚夊埢鑱旂洘',
-  '瀹跺湪濉斿暒',
-  '鐙兼潵浜�',
-  '涔愬嚡鎾掓槦娓稿簵',
-  '棣ㄨ繙缇庨灏忛晣锛堝搱灏肩編椋熷箍鍦猴級',
-  '妫掔害缈�',
-  '寮勫爞鍜亾',
-  '鏉ㄨ榻愰綈鍝堝皵鐑よ倝',
-  '涓婃捣绋斾紶椁愰ギ绠$悊鏈夐檺鍏徃锛堜汉鐢熶竴涓诧級',
-  '缂樺',
-  '娉夌洓椁愰ギ锛堜笂娴凤級鏈夐檺鍏徃锛堥鍏跺锛�',
-  '涓拌寕鐑や覆',
-  '涓婃捣娉扮厡椁愰ギ绠$悊鏈夐檺鍏徃锛堟嘲鐓岄浮锛�',
-  '寰愭眹鍖鸿景鐔欓棣�(灏忛搧鍚涗覆鐑у眳閰掑眿)',
-]
-
-// 寰愭眹鍖鸿闀囧垪琛�
-const xuhuiTowns = [
-  '澶╁钩璺閬�',
-  '婀栧崡璺閬�',
-  '鏂滃湡璺閬�',
-  '鏋灄璺閬�',
-  '闀挎ˉ琛楅亾',
-  '鐢版灄琛楅亾',
-  '铏规璺閬�',
-  '搴峰仴鏂版潙琛楅亾',
-  '寰愬姹囪閬�',
-  '鍑屼簯璺閬�',
-  '榫欏崕琛楅亾',
-  '婕曟渤娉捐閬�',
-  '鍗庢尘闀�',
-]
 
 function onSearch() {
   const f = formSearch.value
@@ -307,9 +272,7 @@
 
   userApi.fetchUser(currentPage.value, pageSize.value, area).then((res) => {
     if (res) {
-      res.data
-      res.head.totalCount
-
+      total.value = res.head.totalCount
       shopList.value = res.data.map((item, index) => {
         const { score, code } = generateRandomScore()
         return {
@@ -336,9 +299,9 @@
   })
 }
 
-// 鐢熸垚2023骞�8鏈堝唴鐨勯殢鏈烘椂闂�
+// 鐢熸垚2025骞�8鏈堝唴鐨勯殢鏈烘椂闂�
 function generateRandomDate() {
-  const year = 2023
+  const year = 2025
   const month = 7 // 0-11锛�8鏈堟槸7
   const day = Math.floor(Math.random() * 31) + 1 // 1-31
   const hour = Math.floor(Math.random() * 24) // 0-23
@@ -346,11 +309,6 @@
 
   const date = new Date(year, month, day, hour, minute)
   return date.toISOString().slice(0, 16).replace('T', ' ')
-}
-
-// 闅忔満閫夋嫨鏁扮粍鍏冪礌
-function getRandomElement(array) {
-  return array[Math.floor(Math.random() * array.length)]
 }
 
 // 鐢熸垚闅忔満璇勫垎鍜屽搴旂幆淇$爜绛夌骇
@@ -376,173 +334,7 @@
 }
 
 // 搴楅摵鏁版嵁
-const shopList = ref([
-  {
-    id: 1,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'green',
-    score: 90,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '鍑�鍖栧櫒杩愯鏃堕暱涓嶈冻',
-        score: 90,
-        handled: true,
-      },
-    ],
-  },
-  {
-    id: 2,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'yellow',
-    score: 75,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '鎶曡瘔娆℃暟杈冨',
-        score: 80,
-        handled: false,
-      },
-    ],
-  },
-  {
-    id: 3,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'red',
-    score: 60,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '鎺掓斁娴撳害瓒呮爣',
-        score: 65,
-        handled: false,
-      },
-      {
-        time: generateRandomDate(),
-        content: '娓呮礂棰戞涓嶈冻',
-        score: 62,
-        handled: false,
-      },
-    ],
-  },
-  {
-    id: 4,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'green',
-    score: 92,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [],
-  },
-  {
-    id: 5,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'yellow',
-    score: 78,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '椋庢満鑱斿姩鐜囦綆',
-        score: 75,
-        handled: true,
-      },
-    ],
-  },
-  {
-    id: 6,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'green',
-    score: 90,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [],
-  },
-  {
-    id: 7,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'red',
-    score: 55,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '鏈畨瑁呮补鐑熷噣鍖栬澶�',
-        score: 60,
-        handled: false,
-      },
-    ],
-  },
-  {
-    id: 8,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'yellow',
-    score: 72,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '鍑�鍖栧櫒娓呮礂涓嶅強鏃�',
-        score: 75,
-        handled: true,
-      },
-    ],
-  },
-  {
-    id: 9,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'green',
-    score: 93,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [],
-  },
-  {
-    id: 10,
-    shopName: getRandomElement(shopNames),
-    district: '寰愭眹鍖�',
-    town: getRandomElement(xuhuiTowns),
-    code: 'yellow',
-    score: 76,
-    trend: generateRandomTrend(),
-    lastUpdate: generateRandomDate(),
-    warnings: [
-      {
-        time: generateRandomDate(),
-        content: '鎺掓斁娴撳害鎺ヨ繎鏍囧噯闄愬��',
-        score: 78,
-        handled: true,
-      },
-    ],
-  },
-])
+const shopList = ref([])
 
 // 杩囨护鍚庣殑搴楅摵鍒楄〃
 const filteredShopList = computed(() => {
@@ -550,13 +342,6 @@
     return shopList.value
   }
   return shopList.value.filter((shop) => shop.code === filterCode.value)
-})
-
-// 鍒嗛〉鍚庣殑搴楅摵鍒楄〃
-const pagedShopList = computed(() => {
-  const start = (currentPage.value - 1) * pageSize.value
-  const end = start + pageSize.value
-  return filteredShopList.value.slice(start, end)
 })
 
 // 鐢熷懡鍛ㄦ湡
@@ -581,10 +366,12 @@
 function handleSizeChange(size) {
   pageSize.value = size
   currentPage.value = 1
+  onSearch()
 }
 
 function handleCurrentChange(current) {
   currentPage.value = current
+  onSearch()
 }
 
 function getCodeType(code) {
@@ -829,7 +616,7 @@
 
 .card-content {
   text-align: center;
-  padding: 20px 0;
+  padding: 0px 0;
 }
 
 .card-title {

--
Gitblit v1.9.3