补充前期中期后期三个项目状态
This commit is contained in:
parent
c26256f098
commit
9797ca3068
|
|
@ -225,19 +225,57 @@ const filterParams = ref({
|
||||||
overdue: '', // ''表示全部, true表示是, false表示否
|
overdue: '', // ''表示全部, true表示是, false表示否
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 默认状态字典(用于字典数据尚未加载时的兜底)
|
||||||
|
const fallbackProjectStatusDict = [
|
||||||
|
{ dictLabel: '前期费用', dictValue: 'DEVELOPMENT_COST', listClass: 'primary', dictSort: 0 },
|
||||||
|
{ dictLabel: '中期费用', dictValue: 'MIDDLE_COST', listClass: 'success', dictSort: 0 },
|
||||||
|
{ dictLabel: '后期费用', dictValue: 'AFTER_COST', listClass: 'warning', dictSort: 0 },
|
||||||
|
{ dictLabel: '待开始', dictValue: 'WAIT_START', listClass: 'info', dictSort: 1 },
|
||||||
|
{ dictLabel: '开发中', dictValue: 'IN_PROGRESS', listClass: 'warning', dictSort: 100 },
|
||||||
|
{ dictLabel: '开发完成', dictValue: 'COMPLETED', listClass: 'primary', dictSort: 200 },
|
||||||
|
{ dictLabel: '已验收', dictValue: 'ACCEPTED', listClass: 'success', dictSort: 300 },
|
||||||
|
{ dictLabel: '维护中', dictValue: 'MAINTENANCE', listClass: 'warning', dictSort: 400 },
|
||||||
|
{ dictLabel: '维护到期', dictValue: 'MAINTENANCE_OVERDUE', listClass: 'warning', dictSort: 500 },
|
||||||
|
{ dictLabel: '开发超期', dictValue: 'DEVELOPMENT_OVERDUE', listClass: 'danger', dictSort: 600 }
|
||||||
|
];
|
||||||
|
|
||||||
// 状态标签(使用字典键值)
|
// 状态标签(使用字典键值)
|
||||||
const statusTabs = ref([
|
const statusTabs = computed(() => {
|
||||||
{ label: '待开始', value: 'WAIT_START' },
|
const dictItems = typeof dictStore.getDictByType === 'function'
|
||||||
{ label: '开发中', value: 'IN_PROGRESS' },
|
? dictStore.getDictByType('project_status')
|
||||||
{ label: '开发完成', value: 'COMPLETED' },
|
: [];
|
||||||
{ label: '已验收', value: 'ACCEPTED' },
|
|
||||||
{ label: '维护中', value: 'MAINTENANCE' },
|
const source = Array.isArray(dictItems) && dictItems.length > 0
|
||||||
{ label: '维护到期', value: 'MAINTENANCE_OVERDUE' },
|
? dictItems
|
||||||
{ label: '开发超期', value: 'DEVELOPMENT_OVERDUE' }
|
: fallbackProjectStatusDict;
|
||||||
]);
|
|
||||||
|
return source
|
||||||
|
.slice()
|
||||||
|
.sort((a, b) => {
|
||||||
|
const sortA = parseInt(a.dictSort) || 0;
|
||||||
|
const sortB = parseInt(b.dictSort) || 0;
|
||||||
|
return sortA - sortB;
|
||||||
|
})
|
||||||
|
.map(item => ({
|
||||||
|
label: item.dictLabel || item.label,
|
||||||
|
value: item.dictValue || item.value,
|
||||||
|
listClass: item.listClass || item.type || 'primary'
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
const activeStatusTab = ref('IN_PROGRESS'); // 默认选中"开发中"
|
const activeStatusTab = ref('IN_PROGRESS'); // 默认选中"开发中"
|
||||||
|
|
||||||
|
// 当字典加载完成后确保当前选中状态仍然存在
|
||||||
|
watch(statusTabs, (tabs) => {
|
||||||
|
if (!Array.isArray(tabs) || tabs.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const exists = tabs.some(tab => tab.value === activeStatusTab.value);
|
||||||
|
if (!exists) {
|
||||||
|
activeStatusTab.value = tabs[0].value;
|
||||||
|
}
|
||||||
|
}, { immediate: true });
|
||||||
|
|
||||||
// 成员选项
|
// 成员选项
|
||||||
const memberOptions = ref([]);
|
const memberOptions = ref([]);
|
||||||
const selectedMemberName = ref('');
|
const selectedMemberName = ref('');
|
||||||
|
|
@ -324,6 +362,9 @@ const getStatusText = (status) => {
|
||||||
}
|
}
|
||||||
// 默认映射(兼容字典键值)
|
// 默认映射(兼容字典键值)
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
|
'DEVELOPMENT_COST': '前期费用',
|
||||||
|
'MIDDLE_COST': '中期费用',
|
||||||
|
'AFTER_COST': '后期费用',
|
||||||
'WAIT_START': '待开始',
|
'WAIT_START': '待开始',
|
||||||
'IN_PROGRESS': '开发中',
|
'IN_PROGRESS': '开发中',
|
||||||
'COMPLETED': '开发完成',
|
'COMPLETED': '开发完成',
|
||||||
|
|
@ -348,6 +389,9 @@ const getStatusType = (status) => {
|
||||||
if (!status && status !== 0) return 'primary';
|
if (!status && status !== 0) return 'primary';
|
||||||
const typeMap = {
|
const typeMap = {
|
||||||
// 字典键值映射
|
// 字典键值映射
|
||||||
|
'DEVELOPMENT_COST': 'primary', // 前期费用
|
||||||
|
'MIDDLE_COST': 'success', // 中期费用
|
||||||
|
'AFTER_COST': 'warning', // 后期费用
|
||||||
'WAIT_START': 'primary', // 待开始
|
'WAIT_START': 'primary', // 待开始
|
||||||
'IN_PROGRESS': 'warning', // 开发中
|
'IN_PROGRESS': 'warning', // 开发中
|
||||||
'COMPLETED': 'success', // 开发完成
|
'COMPLETED': 'success', // 开发完成
|
||||||
|
|
@ -574,10 +618,10 @@ onPullDownRefresh(async () => {
|
||||||
// 跳转到项目详情
|
// 跳转到项目详情
|
||||||
const goToProjectDetail = (project) => {
|
const goToProjectDetail = (project) => {
|
||||||
// TODO: 跳转到项目详情页面
|
// TODO: 跳转到项目详情页面
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '项目详情功能开发中',
|
// title: '项目详情功能开发中',
|
||||||
icon: 'none'
|
// icon: 'none'
|
||||||
});
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加载成员列表
|
// 加载成员列表
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user