可以查询到项目列表
This commit is contained in:
parent
c4f875d979
commit
13210249be
|
|
@ -194,18 +194,18 @@ const filterParams = ref({
|
||||||
overdue: '', // ''表示全部, true表示是, false表示否
|
overdue: '', // ''表示全部, true表示是, false表示否
|
||||||
});
|
});
|
||||||
|
|
||||||
// 状态标签
|
// 状态标签(使用字典键值)
|
||||||
const statusTabs = ref([
|
const statusTabs = ref([
|
||||||
{ label: '待开始', value: '1' },
|
{ label: '待开始', value: 'WAIT_START' },
|
||||||
{ label: '开发中', value: '2' },
|
{ label: '开发中', value: 'IN_PROGRESS' },
|
||||||
{ label: '开发完成', value: '4' },
|
{ label: '开发完成', value: 'COMPLETED' },
|
||||||
{ label: '已验收', value: '5' },
|
{ label: '已验收', value: 'ACCEPTED' },
|
||||||
{ label: '维护中', value: '6' },
|
{ label: '维护中', value: 'MAINTENANCE' },
|
||||||
{ label: '维护到期', value: '7' },
|
{ label: '维护到期', value: 'MAINTENANCE_OVERDUE' },
|
||||||
{ label: '开发超期', value: '8' }
|
{ label: '开发超期', value: 'DEVELOPMENT_OVERDUE' }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const activeStatusTab = ref('2'); // 默认选中"开发中"
|
const activeStatusTab = ref('IN_PROGRESS'); // 默认选中"开发中"
|
||||||
|
|
||||||
// 成员选项
|
// 成员选项
|
||||||
const memberOptions = ref([]);
|
const memberOptions = ref([]);
|
||||||
|
|
@ -234,23 +234,15 @@ const {
|
||||||
|
|
||||||
// 添加状态筛选
|
// 添加状态筛选
|
||||||
if (activeStatusTab.value) {
|
if (activeStatusTab.value) {
|
||||||
// 根据选中的状态标签设置statusList
|
// 根据选中的状态标签设置statusList(使用字典键值)
|
||||||
const statusMap = {
|
// if (activeStatusTab.value === 'DEVELOPMENT_OVERDUE') {
|
||||||
'1': [1], // 待开始
|
// // 开发超期需要特殊处理:状态是IN_PROGRESS,但需要overdue=true
|
||||||
'2': [2], // 开发中
|
// requestParams.statusList = ['IN_PROGRESS'];
|
||||||
'4': [4], // 开发完成
|
// requestParams.overdue = true;
|
||||||
'5': [5], // 已验收
|
// } else
|
||||||
'6': [6], // 维护中
|
{
|
||||||
'7': [7], // 维护到期
|
// 其他状态直接使用字典键值
|
||||||
'8': [2] // 开发超期(也是状态2,但需要overdue=true)
|
requestParams.statusList = [activeStatusTab.value];
|
||||||
};
|
|
||||||
|
|
||||||
if (activeStatusTab.value === '8') {
|
|
||||||
// 开发超期需要特殊处理
|
|
||||||
requestParams.statusList = [2];
|
|
||||||
requestParams.overdue = true;
|
|
||||||
} else {
|
|
||||||
requestParams.statusList = statusMap[activeStatusTab.value] || [];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,7 +259,7 @@ const {
|
||||||
if (filterParams.value.memberId) {
|
if (filterParams.value.memberId) {
|
||||||
requestParams.memberId = filterParams.value.memberId;
|
requestParams.memberId = filterParams.value.memberId;
|
||||||
}
|
}
|
||||||
if (filterParams.value.overdue !== '' && activeStatusTab.value !== '8') {
|
if (filterParams.value.overdue !== '' && activeStatusTab.value !== 'DEVELOPMENT_OVERDUE') {
|
||||||
// 如果不是"开发超期"标签,才使用overdue筛选
|
// 如果不是"开发超期"标签,才使用overdue筛选
|
||||||
requestParams.overdue = filterParams.value.overdue;
|
requestParams.overdue = filterParams.value.overdue;
|
||||||
}
|
}
|
||||||
|
|
@ -294,19 +286,28 @@ const projects = computed(() => list.value);
|
||||||
// 获取状态文本
|
// 获取状态文本
|
||||||
const getStatusText = (status) => {
|
const getStatusText = (status) => {
|
||||||
if (!status && status !== 0) return '未知';
|
if (!status && status !== 0) return '未知';
|
||||||
// 优先从字典获取,如果没有则使用默认映射
|
// 优先从字典获取(字典键值作为dictValue)
|
||||||
const dictLabel = getDictLabel('project_status', status);
|
const dictLabel = getDictLabel('project_status', status);
|
||||||
if (dictLabel && dictLabel !== String(status)) {
|
if (dictLabel && dictLabel !== String(status)) {
|
||||||
return dictLabel;
|
return dictLabel;
|
||||||
}
|
}
|
||||||
// 默认映射
|
// 默认映射(兼容字典键值)
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
|
'WAIT_START': '待开始',
|
||||||
|
'IN_PROGRESS': '开发中',
|
||||||
|
'COMPLETED': '开发完成',
|
||||||
|
'ACCEPTED': '已验收',
|
||||||
|
'MAINTENANCE': '维护中',
|
||||||
|
'MAINTENANCE_OVERDUE': '维护到期',
|
||||||
|
'DEVELOPMENT_OVERDUE': '开发超期',
|
||||||
|
// 兼容旧数据(数字状态值)
|
||||||
'1': '待开始',
|
'1': '待开始',
|
||||||
'2': '开发中',
|
'2': '开发中',
|
||||||
'4': '开发完成',
|
'4': '开发完成',
|
||||||
'5': '已验收',
|
'5': '已验收',
|
||||||
'6': '维护中',
|
'6': '维护中',
|
||||||
'7': '维护到期'
|
'7': '维护到期',
|
||||||
|
'8': '开发超期'
|
||||||
};
|
};
|
||||||
return statusMap[String(status)] || `状态${status}`;
|
return statusMap[String(status)] || `状态${status}`;
|
||||||
};
|
};
|
||||||
|
|
@ -315,12 +316,22 @@ const getStatusText = (status) => {
|
||||||
const getStatusType = (status) => {
|
const getStatusType = (status) => {
|
||||||
if (!status && status !== 0) return 'primary';
|
if (!status && status !== 0) return 'primary';
|
||||||
const typeMap = {
|
const typeMap = {
|
||||||
|
// 字典键值映射
|
||||||
|
'WAIT_START': 'primary', // 待开始
|
||||||
|
'IN_PROGRESS': 'warning', // 开发中
|
||||||
|
'COMPLETED': 'success', // 开发完成
|
||||||
|
'ACCEPTED': 'info', // 已验收
|
||||||
|
'MAINTENANCE': 'primary', // 维护中
|
||||||
|
'MAINTENANCE_OVERDUE': 'warning', // 维护到期
|
||||||
|
'DEVELOPMENT_OVERDUE': 'error', // 开发超期
|
||||||
|
// 兼容旧数据(数字状态值)
|
||||||
'1': 'primary', // 待开始
|
'1': 'primary', // 待开始
|
||||||
'2': 'warning', // 开发中
|
'2': 'warning', // 开发中
|
||||||
'4': 'success', // 开发完成
|
'4': 'success', // 开发完成
|
||||||
'5': 'info', // 已验收
|
'5': 'info', // 已验收
|
||||||
'6': 'primary', // 维护中
|
'6': 'primary', // 维护中
|
||||||
'7': 'warning' // 维护到期
|
'7': 'warning', // 维护到期
|
||||||
|
'8': 'error' // 开发超期
|
||||||
};
|
};
|
||||||
return typeMap[String(status)] || 'primary';
|
return typeMap[String(status)] || 'primary';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user