提交 4eaa8a04 authored 作者: 詹银鑫's avatar 詹银鑫

feat: 菜单管理联调完毕

上级 3b055f16
import editForm from "../form.vue";
import { handleTree } from "@/utils/tree";
import { message } from "@/utils/message";
import { getMenuList, addMenu, deleteMenu } from "@/api/system";
import { getMenuList, addMenu, updateMenu, deleteMenu } from "@/api/system";
import { transformI18n } from "@/plugins/i18n";
import { addDialog } from "@/components/ReDialog";
import { reactive, ref, onMounted, h } from "vue";
......@@ -188,14 +188,24 @@ export function useMenu() {
if (title === "新增") {
curData.visible =
curData.visible || curData.visible === 0 ? 1 : 0;
console.log("curData", curData);
addMenu(curData).then(res => {
if ((res as any).code === "0") {
chores();
}
});
} else {
// 实际开发先调用修改接口,再进行下面操作
if (!row?.id) {
message("id不能为空", { type: "error" });
return;
}
curData.id = row?.id;
curData.visible =
curData.visible || curData.visible === 0 ? 1 : 0;
updateMenu(curData).then(res => {
if ((res as any).code === "0") {
chores();
}
});
chores();
}
}
......
......@@ -11,6 +11,7 @@ interface FormItemProps {
sort: number;
icon: string;
frameSrc: string;
id?: any;
// title: string;
// rank: number;
// redirect: string;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论