mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix: 修复用户新增时,岗位下拉未清空Bug,抽取form-tip组件
This commit is contained in:
26
src/components/custom/form-tip.vue
Normal file
26
src/components/custom/form-tip.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { NTooltip } from 'naive-ui';
|
||||
|
||||
defineOptions({
|
||||
name: 'FormTip'
|
||||
});
|
||||
|
||||
interface Props {
|
||||
content: string;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NTooltip trigger="hover">
|
||||
<template #default>
|
||||
<span>{{ content }}</span>
|
||||
</template>
|
||||
<template #trigger>
|
||||
<div class="cursor-pointer pr-3px">
|
||||
<SvgIcon class="text-15px" icon="ep:warning" />
|
||||
</div>
|
||||
</template>
|
||||
</NTooltip>
|
||||
</template>
|
@ -4,7 +4,7 @@ import { useLoading } from '@sa/hooks';
|
||||
import type { TreeOption, TreeSelectProps } from 'naive-ui';
|
||||
import { fetchGetMenuList } from '@/service/api/system';
|
||||
import SvgIcon from '@/components/custom/svg-icon.vue';
|
||||
import { handleMenuTree } from '@/utils/ruoyi';
|
||||
import { handleTree } from '@/utils/common';
|
||||
|
||||
defineOptions({ name: 'MenuTreeSelect' });
|
||||
|
||||
@ -29,7 +29,7 @@ async function getMenuList() {
|
||||
menuId: 0,
|
||||
menuName: '根目录',
|
||||
icon: 'material-symbols:home-outline-rounded',
|
||||
children: handleMenuTree(data, 'menuId')
|
||||
children: handleTree(data, { idField: 'menuId', filterFn: item => item.menuType !== 'F' })
|
||||
}
|
||||
] as Api.System.Menu[];
|
||||
endLoading();
|
||||
|
@ -27,7 +27,10 @@ const roleOptions = ref<CommonType.Option<CommonType.IdType>[]>([]);
|
||||
watch(
|
||||
() => props.deptId,
|
||||
() => {
|
||||
if (!props.deptId) return;
|
||||
if (!props.deptId) {
|
||||
roleOptions.value = [];
|
||||
return;
|
||||
}
|
||||
getRoleOptions();
|
||||
},
|
||||
{ immediate: true }
|
||||
|
Reference in New Issue
Block a user