项目详情任务树使用当前阶段的数据

This commit is contained in:
weibl
2026-01-13 15:35:33 +08:00
parent cb137373b2
commit 6e82eb4ff4
5 changed files with 69 additions and 22 deletions

View File

@@ -21,6 +21,10 @@ const props = defineProps({
type: String,
default: '',
},
currentPhase: {
type: String,
default: '',
},
});
const nodeLevel2ListOptions = ref();
@@ -66,8 +70,19 @@ const nodeLevel2ListApi = async () => {
return { label: item.nodeName, value: item.uuid, info: item };
});
if (nodeLevel2ListOptions.value.length) {
let phaseUuid = '';
// changeFun();
emits('change', { phaseUuid: nodeLevel2ListOptions.value[0].value, type: 'change' });
if (props.currentPhase) {
const phase = nodeLevel2ListOptions.value.find(
(item: { label: string }) => item.label === props.currentPhase
)?.value;
if (phase) {
phaseUuid = phase;
}
} else {
phaseUuid = nodeLevel2ListOptions.value[0].value;
}
emits('change', { phaseUuid: phaseUuid, type: 'change' });
}
} else {
nodeLevel2ListOptions.value = [];