项目详情任务树使用当前阶段的数据
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user