From df55d1700fb6b62317530d9bcd034ad28caa3be9 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期四, 01 八月 2024 10:54:17 +0800
Subject: [PATCH] feat:考核结果

---
 src/views/system/check/result/index.vue |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/src/views/system/check/result/index.vue b/src/views/system/check/result/index.vue
index 7825ca2..3b5dfac 100644
--- a/src/views/system/check/result/index.vue
+++ b/src/views/system/check/result/index.vue
@@ -35,7 +35,7 @@
                 <div class="score-item">
                   <div style="font-size: 15px; margin-bottom: 15px">{{ formatCreateDate(city[0]) }}</div>
                 </div>
-                <div v-for="(score, scoreIndex) in city" :key="scoreIndex">
+                <div v-for="(score, scoreIndex) in filterRepeat(city)" :key="scoreIndex">
                   <div class="score-item">
                     <div v-if="score.examineCategory == 2">杞﹁締锛�</div>
                     <div v-else-if="score.examineCategory == 3">浜鸿劯锛�</div>
@@ -269,14 +269,27 @@
       return city.some(score => score.publish === 'UNPUBLISHED');
     },
     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;
+      const date = new Date(item.createTime);
+      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}鍙穈;
+    },
+    filterRepeat(city) {
+      let list = [];
+      let examineCategorys = [];
+      city.forEach(item => {
+        if (examineCategorys.indexOf(item.examineCategory) === -1) {
+          examineCategorys.push(item.examineCategory);
+          list.push(item);
+        }
+      });
+      return list;
     },
     /** 瀵艰埅鍒囨崲 */
     handleSelect(key) {

--
Gitblit v1.8.0