菜单修改
This commit is contained in:
parent
ab8a1f1e9c
commit
2bee99f1ce
@ -175,7 +175,7 @@ import type {FormInstance} from "element-plus";
|
|||||||
import { menuAdd,menuUpdate,getMenuList,getMenuDetail } from '@/api/system/menu';
|
import { menuAdd,menuUpdate,getMenuList,getMenuDetail } from '@/api/system/menu';
|
||||||
import {onMounted, reactive, ref, shallowRef} from "vue";
|
import {onMounted, reactive, ref, shallowRef} from "vue";
|
||||||
import {getModulesKey} from "@/router";
|
import {getModulesKey} from "@/router";
|
||||||
import {arrayToTree, treeToArray,message,buildTree} from "@/utils/auth";
|
import {treeToArray,message,buildTree} from "@/utils/auth";
|
||||||
import {useLockFn} from "@/utils/useLockFn";
|
import {useLockFn} from "@/utils/useLockFn";
|
||||||
import IconPicker from "@/components/icon/picker.vue";
|
import IconPicker from "@/components/icon/picker.vue";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -241,10 +241,8 @@ const menuOptions = ref<any[]>([]);
|
|||||||
const getMenu = async () => {
|
const getMenu = async () => {
|
||||||
const data: any = await getMenuList();
|
const data: any = await getMenuList();
|
||||||
const menu: any = {id: 0, name: "顶级", children: []};
|
const menu: any = {id: 0, name: "顶级", children: []};
|
||||||
const lists = buildTree(data)
|
const lists = buildTree(data.filter(item=>item.type==0))
|
||||||
menu.children = arrayToTree(
|
menu.children = lists
|
||||||
treeToArray(lists).filter((item) => item.type ==0)
|
|
||||||
);
|
|
||||||
menuOptions.value.push(menu);
|
menuOptions.value.push(menu);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user