龚焕茏
2024-08-01 df55d1700fb6b62317530d9bcd034ad28caa3be9
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) {