mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-05 17:11:26 +08:00
fix: 取值问题
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user