更新
This commit is contained in:
1 parent
b6b528490c
commit
4ab63e77ed
28 files changed
+1858
-695
No files matched your search
@@ -198,6 +198,7 @@ import {
|
||||
deleteMenu,
|
||||
} from "@/api/menu";
|
||||
import MenuEdit from "./components/edit.vue";
|
||||
import { normalizeFontAwesomeIcon } from "@/utils/fontAwesomeIcon";
|
||||
|
||||
// 定义菜单数据类型
|
||||
interface Menu {
|
||||
@@ -264,6 +265,9 @@ const fetchMenus = async () => {
|
||||
const result = await getAllMenus();
|
||||
if (result.code === 200) {
|
||||
const sortedMenus = sortMenuTree(result.data || []);
|
||||
getAllMenuRows(sortedMenus).forEach((menu) => {
|
||||
menu.icon = normalizeFontAwesomeIcon(menu.icon);
|
||||
});
|
||||
menuTree.value = sortedMenus;
|
||||
parentMenuOptions.value = [
|
||||
{
|
||||
@@ -445,6 +449,7 @@ const handleMenuSave = async (menu: Partial<Menu>) => {
|
||||
try {
|
||||
// 解决后端时间字段问题:过滤掉不需要的字段
|
||||
const payload = { ...menu };
|
||||
payload.icon = normalizeFontAwesomeIcon(payload.icon);
|
||||
|
||||
// 确保 pid 是整数类型(后端要求必须是整数)
|
||||
// 处理数组情况:如果 pid 是数组(el-cascader 返回的是路径数组),取最后一个元素
|
||||
|
||||
Reference in new issue
Block a user