fix: [bpm] vben5+ele下面,修复部门负责人等加载不出数据问题

pull/347/head
jason 2026-05-28 17:25:28 +08:00
parent 7ad2d43121
commit 751af9b9af
3 changed files with 20 additions and 12 deletions

View File

@ -399,6 +399,7 @@ onBeforeUnmount(() => {
ref="treeRef" ref="treeRef"
v-model="userTaskForm.candidateParam" v-model="userTaskForm.candidateParam"
:data="deptTreeOptions" :data="deptTreeOptions"
node-key="id"
:props="defaultProps" :props="defaultProps"
placeholder="加载中,请稍后" placeholder="加载中,请稍后"
multiple multiple

View File

@ -59,6 +59,13 @@ const deptLevelLabel = computed(() => {
return label; return label;
}); });
// TreeSelect
const defaultProps = {
children: 'children',
label: 'name',
value: 'id',
};
// //
const [Drawer, drawerApi] = useVbenDrawer({ const [Drawer, drawerApi] = useVbenDrawer({
header: true, header: true,
@ -282,12 +289,8 @@ defineExpose({ showCopyTaskNodeConfig }); // 暴露方法给父组件
<ElTreeSelect <ElTreeSelect
v-model="configForm.deptIds" v-model="configForm.deptIds"
:data="deptTreeOptions" :data="deptTreeOptions"
:props="{ node-key="id"
label: 'name', :props="defaultProps"
// @ts-expect-error: dynamic node config access is narrower than runtime shape
value: 'id',
children: 'children',
}"
empty-text="加载中,请稍候" empty-text="加载中,请稍候"
multiple multiple
:check-strictly="true" :check-strictly="true"

View File

@ -79,6 +79,13 @@ const emits = defineEmits<{
findReturnTaskNodes: [nodeList: SimpleFlowNode[]]; findReturnTaskNodes: [nodeList: SimpleFlowNode[]];
}>(); }>();
// TreeSelect
const defaultProps = {
children: 'children',
label: 'name',
value: 'id',
};
const deptLevelLabel = computed(() => { const deptLevelLabel = computed(() => {
let label = '部门负责人来源'; let label = '部门负责人来源';
if ( if (
@ -694,12 +701,9 @@ onMounted(() => {
> >
<ElTreeSelect <ElTreeSelect
v-model="configForm.deptIds" v-model="configForm.deptIds"
:tree-data="deptTreeOptions" :data="deptTreeOptions"
:field-names="{ node-key="id"
label: 'name', :props="defaultProps"
value: 'id',
children: 'children',
}"
empty-text="加载中,请稍等..." empty-text="加载中,请稍等..."
multiple multiple
:check-strictly="true" :check-strictly="true"