fix: 取值问题

This commit is contained in:
dap
2026-03-23 11:58:19 +08:00
parent b69447efea
commit 8133ebf501
3 changed files with 20 additions and 4 deletions

View File

@@ -127,6 +127,11 @@ async function handleExport() {
const fileName = buildExportFileName('岗位数据');
exportBlob({ data: formValues, fileName });
}
function handleDeptSelect(keys: string[]) {
selectDeptId.value = keys;
tableApi.reload();
}
</script>
<template>
@@ -136,7 +141,7 @@ async function handleExport() {
v-model:select-dept-id="selectDeptId"
class="w-[260px]"
@reload="() => tableApi.reload()"
@select="() => tableApi.reload()"
@select="handleDeptSelect"
/>
<BasicTable class="flex-1 overflow-hidden" table-title="岗位列表">
<template #toolbar-tools>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { Key } from 'antdv-next/dist/table/interface';
import type { PropType } from 'vue';
import type { DeptTree } from '#/api/system/user/model';
@@ -27,7 +29,7 @@ const emit = defineEmits<{
/**
* 点击节点的事件
*/
select: [];
select: [keys: string[]];
}>();
interface Props {
@@ -92,6 +94,10 @@ async function handleReload() {
}
onMounted(loadTree);
function handleSelect(keys: Key[]) {
emit('select', keys as string[]);
}
</script>
<template>
@@ -133,7 +139,7 @@ onMounted(loadTree);
:tree-data="deptTreeComputed"
:virtual="false"
default-expand-all
@select="$emit('select')"
@select="handleSelect"
:styles="{
item: {
'--ant-tree-node-selected-bg':

View File

@@ -211,6 +211,11 @@ async function handleChangeStatus(checked: SwitchProps['checked'], row: User) {
status: checked ? EnableStatus.Enable : EnableStatus.Disable,
});
}
function handleDeptSelect(keys: string[]) {
selectDeptId.value = keys;
tableApi.reload();
}
</script>
<template>
@@ -220,7 +225,7 @@ async function handleChangeStatus(checked: SwitchProps['checked'], row: User) {
v-model:select-dept-id="selectDeptId"
class="w-[260px]"
@reload="() => tableApi.reload()"
@select="() => tableApi.reload()"
@select="handleDeptSelect"
/>
<BasicTable class="flex-1 overflow-hidden" table-title="用户列表">
<template #toolbar-tools>