工位下拉功能

This commit is contained in:
weibl
2025-12-31 14:09:48 +08:00
parent 30d695a1c5
commit f6b482cc5a

View File

@@ -71,6 +71,7 @@ import demandTable from '../components/demandTable.vue';
import { getMemberListIds } from '@/utils/task';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import { syncDemandList } from '../taskPage';
import { getChildrenNodeListApi } from '@/api/project/node';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PROJECT;
@@ -324,9 +325,9 @@ const changeFun = async (val: any, type: string) => {
console.log('val', val, type);
const formData = tableFormRef.value.getFormDataFun();
console.log('editFormInfo.value', editFormInfo.value);
editFormInfo.value = { ...formData };
console.log('formData', formData);
if (val.key === 'projectId') {
console.log('changeFun', val);
let nodeType = '';
@@ -350,6 +351,29 @@ const changeFun = async (val: any, type: string) => {
// tableFormRef.value.setFormDataFun({ ...formData, simType: '' });
editFormInfo.value = { ...formData, simType: '' };
}
if (val.key === 'phaseId') {
const res: any = await getChildrenNodeListApi({
current: 1,
size: 999,
nodeId: formData.phaseId,
nodeType: NODE_TYPE.WORKSPACE,
});
if (res.code === 200) {
if (res.data.length === 0) {
ElMessage.warning('该阶段下没有工位,请先做仿真策划!');
} else {
tableFormRef.value.setOptionsFun(
NODE_TYPE.WORKSPACE,
res.data.map((item: { nodeName: string; uuid: string }) => {
return {
label: item.nodeName,
value: item.uuid,
};
})
);
}
}
}
emits('changeForm', { val, type });
};