Commit c35f9d23 by chenwq

feat(teamWork): 重构团队工作页面,优化多tab列表与常量管理

抽离tab配置、状态映射及列表字段配置至constantData.js统一维护
修复staticInfo组件0值显示异常,使用??替代||优化空值处理
重写团队列表渲染逻辑,适配4个tab的差异化展示
新增动态配色、字段渲染等工具方法,实现进度与比率预警
调整列表项样式,优化布局与视觉细节
修复接口参数与数据处理的部分逻辑问题
1 parent 9d9c1b7b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="static-info"> <div class="static-info">
<div class="static-item" v-for="(item, index) in list" :key="index" :style="{ background: item.background }"> <div class="static-item" v-for="(item, index) in list" :key="index" :style="{ background: item.background }">
<div class="label">{{item.label}}</div> <div class="label">{{item.label}}</div>
<div class="value">{{data[item.key] || '-'}}</div> <div class="value">{{ data[item.key] ?? '-' }}</div>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -7,7 +7,7 @@ export const STATIC_CARD_MAP = { ...@@ -7,7 +7,7 @@ export const STATIC_CARD_MAP = {
}, },
partial: { partial: {
label: '部分完成人数', label: '部分完成人数',
key: 'partialCount', key: 'partialCompletedCount',
background: 'linear-gradient(90deg, #7552FF 0%, #977DFF 100%)' background: 'linear-gradient(90deg, #7552FF 0%, #977DFF 100%)'
}, },
unfinished: { unfinished: {
...@@ -16,3 +16,71 @@ export const STATIC_CARD_MAP = { ...@@ -16,3 +16,71 @@ export const STATIC_CARD_MAP = {
background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)' background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)'
} }
} }
// 顶部 Tab 切换配置
export const TAB_LIST = [
{ text: '今日动态', reportType: 1 },
{ text: '本周概览', reportType: 2 },
{ text: '月度总览', reportType: 3 },
{ text: '专项督办', reportType: 4 }
]
// 完成状态映射 (用于卡片右上角状态徽标)
export const COMPLETION_STATUS_MAP = {
0: { name: '未完成', color: '#FF4D4F', background: '#FF4D4F1A' },
1: { name: '部分完成', color: '#FF9D0A', background: '#FF9D0A1A' },
2: { name: '已完成', color: '#35C376', background: '#35C3761A' }
}
// 日报状态映射
export const DAILY_STATUS_MAP = {
0: { text: '未提交', color: '#FF4D4F' },
1: { text: '在岗', color: '#35C376' },
2: { text: '调休', color: '#FF9D0A' }
}
// 月报状态映射
export const MONTH_STATUS_MAP = {
0: { text: '未提交', color: '#FF4D4F' },
1: { text: '已提交', color: '#35C376' }
}
// 任务状态映射 (兼容其他可能用到的状态)
export const STATUS_MAP = {
0: { name: '待完成', color: '#2C66F7', background: '#2c66f71a' },
1: { name: '进行中', color: '#FF9D0A', background: '#ff9d0a1a' },
2: { name: '已完成', color: '#35C376', background: '#35c3761a' }
}
// 统一定义不同 Tab 下的列表字段配置
export const GRID_CONFIG_MAP = {
0: [ // 今日动态
{ label: '战败复盘', key: 'defeatReviewRate', type: 'rate' },
{ label: '线上带教', key: 'onlineTeachingCount', type: 'number' },
{ label: '线下带教', key: 'offlineTeachingCount', type: 'number' },
{ label: '日报', key: 'dailyReportStatus', type: 'dailyStatus' }
],
1: [ // 本周概览
{ label: '日报提交', key: 'dailyReportProgress', type: 'progress' },
{ label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' },
{ label: '带教任务', key: 'teachingTaskProgress', type: 'progress' },
{ label: '录音提报', key: 'excellentCaseProgress', type: 'progress' }
],
2: [ // 月度总览
{ label: '日报提交', key: 'dailyReportProgress', type: 'progress' },
{ label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' },
{ label: '带教任务', key: 'teachingTaskProgress', type: 'progress' },
{ label: '录音提报', key: 'excellentCaseProgress', type: 'progress' },
{ label: '月报', key: 'monthReportStatus', type: 'monthStatus' }
]
}
export default {
STATIC_CARD_MAP,
TAB_LIST,
COMPLETION_STATUS_MAP,
DAILY_STATUS_MAP,
MONTH_STATUS_MAP,
STATUS_MAP,
GRID_CONFIG_MAP
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!