提交 9819c4c1 编写于 作者: 郝先瑞

fix: 菜单ID类型声明错误修改

上级 26e345a9
......@@ -30,7 +30,7 @@ export interface MenuFormData {
/**
* 菜单ID
*/
id: string ,
id?: string ,
/**
* 父菜单ID
*/
......@@ -51,7 +51,7 @@ export interface MenuFormData {
/**
* 组件路径
*/
component: string,
component?: string,
/**
* 路由路径
*/
......
......@@ -49,7 +49,8 @@
<el-dialog :title="dialog.title" v-model="dialog.visible" @close="cancel" width="750px">
<el-form ref="dataFormRef" :model="formData" :rules="rules" label-width="100px">
<el-form-item label="父级菜单" prop="parentId">
<el-tree-select v-model="formData.parentId" placeholder="选择上级菜单" :data="menuOptions" filterable check-strictly />
<el-tree-select v-model="formData.parentId" placeholder="选择上级菜单" :data="menuOptions" filterable
check-strictly />
</el-form-item>
<el-form-item label="菜单名称" prop="name">
......@@ -230,10 +231,11 @@ function handleRowClick(row: any) {
}
async function handleAdd(row: any) {
state.formData.id = undefined
await loadMenuData();
state.dialog = {
title: "添加菜单",
visible: true,
visible: true
};
if (row.id) {
// 行点击新增
......@@ -241,13 +243,13 @@ async function handleAdd(row: any) {
if (row.id == '0') {
state.formData.component = "Layout";
} else {
state.formData.component = "";
state.formData.component = undefined;
}
} else {
if (state.currentRow) {
// 工具栏新增
state.formData.parentId = (state.currentRow as any).id;
state.formData.component = "";
state.formData.component = undefined;
} else {
state.formData.parentId = "0";
state.formData.component = "Layout";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册