From 581a372474fca60bed715b5f0e6bb31bb018d4d2 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 31 七月 2024 13:51:19 +0800
Subject: [PATCH] 数据中心,视频中的指标字段

---
 src/views/system/check/result/index.vue |   47 +++++++++++++++++++++++++++--------------------
 1 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/src/views/system/check/result/index.vue b/src/views/system/check/result/index.vue
index 090956a..7825ca2 100644
--- a/src/views/system/check/result/index.vue
+++ b/src/views/system/check/result/index.vue
@@ -3,8 +3,10 @@
     <div>
       <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
         style="margin-bottom: 10px">
-        <el-menu-item index="0">鐪佸巺鑰冩牳</el-menu-item>
-        <el-menu-item index="1">甯傚眬鑰冩牳</el-menu-item>
+        <el-menu-item index="0">鐪佸巺鏈堝害</el-menu-item>
+        <el-menu-item index="1">甯傚眬鏈堝害</el-menu-item>
+        <el-menu-item index="2">鐪佸巺瀛e害</el-menu-item>
+        <el-menu-item index="3">甯傚眬瀛e害</el-menu-item>
       </el-menu>
     </div>
 
@@ -31,7 +33,7 @@
               </div>
               <div class="score-warp">
                 <div class="score-item">
-                  <div style="font-size: 15px; margin-bottom: 15px">{{ formatCreateDate(city[0].createTime) }}</div>
+                  <div style="font-size: 15px; margin-bottom: 15px">{{ formatCreateDate(city[0]) }}</div>
                 </div>
                 <div v-for="(score, scoreIndex) in city" :key="scoreIndex">
                   <div class="score-item">
@@ -43,10 +45,10 @@
                 </div>
               </div>
               <div class="bottom-publish">
-                <el-button size="medium" :type="isAnyUnpublished(city) ? 'success' : 'danger'" @click="publish(city)">
+                <el-button v-hasPermi="['check:score:publish']" size="medium" :type="isAnyUnpublished(city) ? 'success' : 'danger'" @click="publish(city)">
                   {{ isAnyUnpublished(city) ? '鍙戝竷' : '鍙栨秷' }}
                 </el-button>
-                <el-button size="medium" @click="jumpDetail(index)" type="info">璇︽儏</el-button>
+                <el-button size="medium" @click="jumpDetail(index)" type="primary">璇︽儏</el-button>
               </div>
             </div>
           </div>
@@ -138,6 +140,7 @@
             type: 'bar',
             name: '瑙嗛鑰冩牳',
             data: this.dataList.data1,
+            barWidth: '40',
             itemStyle: {
               color: 'rgba(255, 165, 0, 1)'
             }
@@ -146,6 +149,7 @@
             type: 'bar',
             name: '浜鸿劯鑰冩牳',
             data: this.dataList.data2,
+            barWidth: '40',
             itemStyle: {
               color: 'rgba(85, 192, 191, 1)'
             }
@@ -154,6 +158,7 @@
             type: 'bar',
             name: '杞﹁締鑰冩牳',
             data: this.dataList.data3,
+            barWidth: '40',
             itemStyle: {
               color: 'rgba(62, 144, 247, 1)'
             }
@@ -196,33 +201,37 @@
           axisLabel: {
           },
           data: nameArray
+
         },
         yAxis: {
-          min: 90,
+          min: 60
         },
         series: [
           {
             type: 'bar',
             name: '瑙嗛鑰冩牳',
             data: data1,
+            barWidth: '40',
             itemStyle: {
-              color: 'rgba(255, 165, 0, 1)'
+              color: 'rgba(255, 165, 0, 1)',
             }
           },
           {
             type: 'bar',
             name: '浜鸿劯鑰冩牳',
             data: data2,
+            barWidth: '40',
             itemStyle: {
-              color: 'rgba(85, 192, 191, 1)'
+              color: 'rgba(85, 192, 191, 1)',
             }
           },
           {
             type: 'bar',
             name: '杞﹁締鑰冩牳',
             data: data3,
+            barWidth: '40',
             itemStyle: {
-              color: 'rgba(62, 144, 247, 1)'
+              color: 'rgba(62, 144, 247, 1)',
             }
           },
         ]
@@ -259,17 +268,15 @@
       // 妫�鏌� city 鐨� score 鏁扮粍涓槸鍚︽湁浠讳綍涓�涓殑 publish 灞炴�т负 'UNPUBLISHED'
       return city.some(score => score.publish === 'UNPUBLISHED');
     },
-    formatCreateDate(dateString) {
-      const date = new Date(dateString);
-      const year = date.getFullYear();
-      const month = date.getMonth() + 1; // getMonth() 杩斿洖鐨勬湀浠芥槸浠� 0 寮�濮嬬殑锛屾墍浠ヨ鍔� 1
-      const day = date.getDate();
-
-      // 浣跨敤 padStart 鏂规硶纭繚鏈堜唤鍜屾棩鏈熷缁堟槸涓や綅鏁�
-      const formattedMonth = month.toString().padStart(2, '0');
-      const formattedDay = day.toString().padStart(2, '0');
-
-      return `${year}骞�${formattedMonth}鏈�${formattedDay}鍙穈;
+    formatCreateDate(item) {
+      let date = new Date(item.startDate);
+      let year = date.getFullYear();
+      let startMonth = date.getMonth() + 1;
+      date = new Date(item.endDate);
+      let endMonth = date.getMonth() + 1;
+      let str = `${year}骞�${startMonth}鏈坄;
+      if (startMonth !== endMonth) str += `-${endMonth}鏈坄;
+      return str;
     },
     /** 瀵艰埅鍒囨崲 */
     handleSelect(key) {

--
Gitblit v1.8.0