mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 整合动态路由
This commit is contained in:
@ -49,14 +49,15 @@ const getMeunTree = async () => {
|
||||
|
||||
getMeunTree();
|
||||
|
||||
async function handleSubmitted() {
|
||||
getMeunTree();
|
||||
async function handleSubmitted(menuType?: Api.System.MenuType) {
|
||||
if (menuType === 'F') {
|
||||
await getBtnMenuList();
|
||||
return;
|
||||
}
|
||||
await getMeunTree();
|
||||
if (operateType.value === 'edit') {
|
||||
currentMenu.value = menuTreeRef.value?.getCheckedData().options[0] as Api.System.Menu;
|
||||
}
|
||||
if (createType.value === 'F') {
|
||||
getBtnMenuList();
|
||||
}
|
||||
}
|
||||
|
||||
function handleAddMenu(pid: CommonType.IdType) {
|
||||
@ -83,7 +84,7 @@ async function handleDeleteMenu(id?: CommonType.IdType) {
|
||||
expandedKeys.value.filter(item => !checkedKeys.value.includes(item));
|
||||
currentMenu.value = undefined;
|
||||
checkedKeys.value = [];
|
||||
getBtnMenuList();
|
||||
getMeunTree();
|
||||
}
|
||||
|
||||
function renderPrefix({ option }: { option: TreeOption }) {
|
||||
@ -339,7 +340,7 @@ const btnColumns: DataTableColumns<Api.System.Menu> = [
|
||||
</NButton>
|
||||
<NPopconfirm @positive-click="() => handleDeleteMenu()">
|
||||
<template #trigger>
|
||||
<NButton size="small" ghost type="error">
|
||||
<NButton size="small" ghost type="error" :disabled="btnData.length > 0 || btnLoading">
|
||||
<template #icon>
|
||||
<icon-ic-round-delete />
|
||||
</template>
|
||||
|
@ -30,7 +30,7 @@ interface Props {
|
||||
const props = defineProps<Props>();
|
||||
|
||||
interface Emits {
|
||||
(e: 'submitted'): void;
|
||||
(e: 'submitted', menuType?: Api.System.MenuType): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
@ -136,7 +136,10 @@ async function handleSubmit() {
|
||||
remark
|
||||
} = model;
|
||||
|
||||
const path = !model.path?.startsWith('/') ? `/${model.path}` : model.path;
|
||||
let path = model.path;
|
||||
if (model.isFrame === '1') {
|
||||
path = !model.path?.startsWith('/') ? `/${model.path}` : model.path;
|
||||
}
|
||||
|
||||
let icon;
|
||||
if (model.icon) {
|
||||
@ -206,7 +209,7 @@ async function handleSubmit() {
|
||||
}
|
||||
|
||||
closeDrawer();
|
||||
emit('submitted');
|
||||
emit('submitted', menuType);
|
||||
}
|
||||
|
||||
watch(visible, () => {
|
||||
@ -265,7 +268,13 @@ const FormTipComponent = defineComponent({
|
||||
</NFormItemGi>
|
||||
<NFormItemGi v-if="menuType !== 'F'" :span="24" label="菜单类型" path="menuType">
|
||||
<NRadioGroup v-model:value="model.menuType">
|
||||
<NRadioButton v-for="item in menuTypeOptions" :key="item.value" :value="item.value" :label="item.label" />
|
||||
<NRadioButton
|
||||
v-for="item in menuTypeOptions"
|
||||
v-show="item.value !== 'F'"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</NRadioGroup>
|
||||
</NFormItemGi>
|
||||
<NFormItemGi :span="24" label="菜单名称" path="menuName">
|
||||
|
Reference in New Issue
Block a user