| | |
| | | <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">省厅季度</el-menu-item> |
| | | <el-menu-item index="3">市局季度</el-menu-item> |
| | | </el-menu> |
| | | </div> |
| | | |
| | |
| | | </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"> |
| | |
| | | <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> |
| | |
| | | // 检查 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) { |