Commit b6716e91 by chenwq

feat(团队工作台): 优化表格列展示并清理废弃代码

- 为比率类型的表格列添加单位展示功能
- 更新月报已提交状态的颜色为#000000E5
- 重构进度和比率颜色计算逻辑,移除无用参数并调整预警阈值
- 清理未使用的dayjs导入、废弃的方法注释和调试日志
- 调整列值样式以正确对齐单位文本
1 parent 63f0d637
...@@ -42,7 +42,7 @@ export const DAILY_STATUS_MAP = { ...@@ -42,7 +42,7 @@ export const DAILY_STATUS_MAP = {
// 月报状态映射 // 月报状态映射
export const MONTH_STATUS_MAP = { export const MONTH_STATUS_MAP = {
0: { text: '未提交', color: '#F24724', fontSize: '14px' }, 0: { text: '未提交', color: '#F24724', fontSize: '14px' },
1: { text: '已提交', color: '#35C376', fontSize: '14px' } 1: { text: '已提交', color: '#000000E5', fontSize: '14px' }
} }
// 任务状态映射 (兼容其他可能用到的状态) // 任务状态映射 (兼容其他可能用到的状态)
...@@ -54,24 +54,28 @@ export const STATUS_MAP = { ...@@ -54,24 +54,28 @@ export const STATUS_MAP = {
// 统一定义不同 Tab 下的列表字段配置 // 统一定义不同 Tab 下的列表字段配置
export const GRID_CONFIG_MAP = { export const GRID_CONFIG_MAP = {
0: [ // 今日动态 0: [
{ label: '战败复盘', key: 'defeatReviewRate', type: 'rate' }, // 今日动态
{ label: '战败复盘', key: 'defeatReviewRate', type: 'rate', unit: '%' },
{ label: '线上带教', key: 'onlineTeachingCount', type: 'number' },
{ label: '线上带教', key: 'onlineTeachingCount', type: 'number' }, { label: '线上带教', key: 'onlineTeachingCount', type: 'number' },
{ label: '线下带教', key: 'offlineTeachingCount', type: 'number' }, { label: '线下带教', key: 'offlineTeachingCount', type: 'number' },
{ label: '日报', key: 'dailyReportStatus', type: 'dailyStatus' } { label: '日报', key: 'dailyReportStatus', type: 'dailyStatus' }
], ],
1: [ // 本周概览 1: [
// 本周概览
{ label: '日报提交', key: 'dailyReportProgress', type: 'progress' }, { label: '日报提交', key: 'dailyReportProgress', type: 'progress' },
{ label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' }, { label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' },
{ label: '带教任务', key: 'teachingTaskProgress', type: 'progress' }, { label: '带教任务', key: 'teachingTaskProgress', type: 'progress' },
{ label: '录音提报', key: 'excellentCaseProgress', type: 'progress' } { label: '录音提报', key: 'excellentCaseProgress', type: 'progress' }
], ],
2: [ // 月度总览 2: [
// 月度总览
{ label: '日报提交', key: 'dailyReportProgress', type: 'progress' }, { label: '日报提交', key: 'dailyReportProgress', type: 'progress' },
{ label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' }, { label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' },
{ label: '带教任务', key: 'teachingTaskProgress', type: 'progress' }, { label: '带教任务', key: 'teachingTaskProgress', type: 'progress' },
{ label: '录音提报', key: 'excellentCaseProgress', type: 'progress' }, { label: '录音提报', key: 'excellentCaseProgress', type: 'progress' },
{ label: '月报', key: 'monthReportStatus', type: 'monthStatus' }, { label: '月报', key: 'monthReportStatus', type: 'monthStatus' }
] ]
} }
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<div class="item-grid" :class="'cols-' + getGridCols()"> <div class="item-grid" :class="'cols-' + getGridCols()">
<div class="grid-col" v-for="(col, cIndex) in getGridConfig()" :key="cIndex"> <div class="grid-col" v-for="(col, cIndex) in getGridConfig()" :key="cIndex">
<div class="col-label">{{ col.label }}</div> <div class="col-label">{{ col.label }}</div>
<div class="col-value" :style="getColValueStyle(item, col)">{{ getColValue(item, col) }}</div> <div class="col-value" :style="getColValueStyle(item, col)">{{ getColValue(item, col) }}<span v-if="col.unit" style="font-size: 12px;">{{ col.unit }}</span></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
<script> <script>
// 请确保在 Vue 项目中以下依赖及 API 路径有效 // 请确保在 Vue 项目中以下依赖及 API 路径有效
import api from '@/api/teamWork' import api from '@/api/teamWork'
import dayjs from 'dayjs'
import dateSearch from '@/components/dateSearch/dateSearch.vue' import dateSearch from '@/components/dateSearch/dateSearch.vue'
import SearchBar from '@/components/searchBar/index.vue' import SearchBar from '@/components/searchBar/index.vue'
import StaticInfo from '@/components/staticInfo/index.vue' import StaticInfo from '@/components/staticInfo/index.vue'
...@@ -172,21 +171,20 @@ export default { ...@@ -172,21 +171,20 @@ export default {
return { color, fontSize: '20px', fontWeight: '500' } return { color, fontSize: '20px', fontWeight: '500' }
}, },
// 进度预警:如果完成数小于总数,则标红;否则默认黑色(专项督办模式下达标显示绿色) // 进度预警:如果完成数小于总数,则标红;否则默认绿色
getProgressColor(val, isSpecial = false) { getProgressColor(val) {
if (typeof val !== 'string' || !val.includes('/')) return '#333333' if (typeof val !== 'string' || !val.includes('/')) return '#000000E5'
const [num, den] = val.split('/') const [num, den] = val.split('/')
if (Number(num) < Number(den)) return '#FF4D4F' if (Number(num) < Number(den)) return '#F24724'
return isSpecial ? '#35C376' : '#333333' return '#000000E5'
}, },
// 比率预警:低于 80% 标红,否则标绿 // 比率预警:低于 80% 标红,否则标绿
getRateColor(val) { getRateColor(val) {
if (typeof val !== 'string' || !val.includes('%')) return '#333333' return parseFloat(val) < 50 ? '#F24724' : '#35C376'
return parseFloat(val) < 80 ? '#FF4D4F' : '#35C376'
}, },
// 专项督办进度的特殊颜色处理 // 专项督办进度的特殊颜色处理
getSpecialProgressColor(val) { getSpecialProgressColor(val) {
return this.getProgressColor(val, true) return this.getProgressColor(val)
}, },
// 判断是否显示箭头 // 判断是否显示箭头
canShowArrow(item) { canShowArrow(item) {
...@@ -213,19 +211,6 @@ export default { ...@@ -213,19 +211,6 @@ export default {
const res = decPart ? `${intFmt}.${decPart}` : intFmt const res = decPart ? `${intFmt}.${decPart}` : intFmt
return isNeg ? `-${res}` : res return isNeg ? `-${res}` : res
}, },
// getStaticData() {
// api.getMissionData({}).then(res => {
// let { code, data, message } = res
// if (code === 0) {
// data.completedCount = data.completedCount ?? '-'
// data.partialCount = data.partialCount ?? '-'
// data.unfinishedCount = data.unfinishedCount ?? '-'
// this.staticData = data
// } else {
// this.$toast && this.$toast(message)
// }
// })
// },
tabClick(index) { tabClick(index) {
const eventCode = ['supervisor_dayTask_tab', 'supervisor_weeklyTask_tab', 'supervisor_monthlyTask_tab', 'supervisor_specificTask_tab'] const eventCode = ['supervisor_dayTask_tab', 'supervisor_weeklyTask_tab', 'supervisor_monthlyTask_tab', 'supervisor_specificTask_tab']
if (this.$track) { if (this.$track) {
...@@ -234,36 +219,6 @@ export default { ...@@ -234,36 +219,6 @@ export default {
this.tabIndex = index this.tabIndex = index
// this.onRefresh() // this.onRefresh()
}, },
// jump(target) {
// const pageUrl = {
// 3: '/packageIndex/pages/recordingReview/recordingReview',
// 5: '/packageCrew/pages/mentoring/mentoring',
// 0: '/packageIndex/pages/dailySupervisionReport/dailySupervisionReport',
// 1: '/packageIndex/pages/weeklyReview/weeklyReview',
// 2: '/packageIndex/pages/monthlyPlan/monthlyPlan',
// 4: '/packageIndex/pages/specialTask/specialTask'
// }
// const eventCode = {
// 3: { view: 'supervisor_recording_view', execute: 'supervisor_recording_execute' },
// 5: { view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute' },
// 0: { view: 'supervisor_report_view', execute: 'supervisor_report_execute' },
// 1: { view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute' },
// 2: { view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute' },
// 4: { view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute' },
// }
// let status = target.taskStatus != 2 ? 'execute' : 'view'
// if (this.$track) {
// this.$track.setTrackData(0, eventCode[target.taskType][status], {}, '')
// }
// this.$router.push({
// path: pageUrl[target.taskType],
// query: {
// taskStatus: target.taskStatus,
// id: target.id
// }
// })
// },
search(detail) { search(detail) {
this.startStr = detail.startDay?.replace(/\//g, '-') this.startStr = detail.startDay?.replace(/\//g, '-')
this.endStr = detail.endDay?.replace(/\//g, '-') this.endStr = detail.endDay?.replace(/\//g, '-')
...@@ -286,7 +241,6 @@ export default { ...@@ -286,7 +241,6 @@ export default {
this.getList() this.getList()
}, },
setStaticData(data) { setStaticData(data) {
console.log(data, 'data-----')
this.staticData = data.statistics || {} this.staticData = data.statistics || {}
}, },
getList() { getList() {
...@@ -468,6 +422,8 @@ export default { ...@@ -468,6 +422,8 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
.col-value { .col-value {
display: flex;
align-items: center;
/* 默认的 fontSize 和 fontWeight 会被 getColValueStyle 动态覆盖 */ /* 默认的 fontSize 和 fontWeight 会被 getColValueStyle 动态覆盖 */
color: #000000e5; color: #000000e5;
font-size: 20px; font-size: 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!