|
|
@ -49,14 +49,12 @@ const actionsMap: ContextMenuActionMap = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const organizationUnits = ref<DataNode[]>([]); |
|
|
const organizationUnits = ref<DataNode[]>([]); |
|
|
const expandedKeys = ref<string[]>([]); |
|
|
|
|
|
const loadedKeys = ref<string[]>([]); |
|
|
const loadedKeys = ref<string[]>([]); |
|
|
const selectedKey = ref<string>(); |
|
|
const selectedKey = ref<string>(); |
|
|
|
|
|
|
|
|
/** 刷新组织机构树 */ |
|
|
/** 刷新组织机构树 */ |
|
|
async function onRefresh() { |
|
|
async function onRefresh() { |
|
|
loadedKeys.value = []; |
|
|
loadedKeys.value = []; |
|
|
expandedKeys.value = []; |
|
|
|
|
|
const { items } = await getRootListApi(); |
|
|
const { items } = await getRootListApi(); |
|
|
organizationUnits.value = items.map((item) => { |
|
|
organizationUnits.value = items.map((item) => { |
|
|
return { |
|
|
return { |
|
|
@ -82,7 +80,6 @@ async function onLoad(node: EventDataNode) { |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
organizationUnits.value = [...organizationUnits.value]; |
|
|
organizationUnits.value = [...organizationUnits.value]; |
|
|
expandedKeys.value.push(nodeKey); |
|
|
|
|
|
loadedKeys.value.push(nodeKey); |
|
|
loadedKeys.value.push(nodeKey); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -162,7 +159,6 @@ watchEffect(() => { |
|
|
</Button> |
|
|
</Button> |
|
|
</template> |
|
|
</template> |
|
|
<Tree |
|
|
<Tree |
|
|
:expanded-keys="expandedKeys" |
|
|
|
|
|
:load-data="onLoad" |
|
|
:load-data="onLoad" |
|
|
:loaded-keys="loadedKeys" |
|
|
:loaded-keys="loadedKeys" |
|
|
:tree-data="organizationUnits" |
|
|
:tree-data="organizationUnits" |
|
|
|