菜单添加问题修复

This commit is contained in:
evoxwht 2023-05-30 15:00:53 +08:00
parent 43c48f1e07
commit 7937a1c7bd
2 changed files with 18 additions and 8 deletions

View File

@ -47,12 +47,19 @@
</Input>
</FormItem>
</Col>
<Col v-bind="grid" v-if="authType == 2">
<FormItem label="请求方式:" prop="methods">
<Select v-model="formValidate.methods">
<Option value="GET">GET</Option>
<Option value="POST">POST</Option>
<Option value="PUT">PUT</Option>
<Option value="DELETE">DELETE</Option>
</Select>
</FormItem>
</Col>
<Col v-bind="grid" v-if="authType == 2">
<FormItem label="接口地址:" prop="api_url">
<Input v-model="formValidate.api_url" placeholder="请输入接口地址" @on-change="changeUnique">
<template #prepend>
<span>adminapi/</span>
</template>
</Input>
</FormItem>
</Col>
@ -369,10 +376,13 @@ export default {
datas: this.formValidate,
};
if (!this.formValidate.menu_name) {
return this.$Message.warning('请填写按钮名称');
return this.$Message.warning('请填写菜单/按钮/接口名称');
}
if (!this.formValidate.menu_path) {
return this.$Message.warning('请填写路由地址');
if (!this.formValidate.menu_path && this.authType != 2) {
return this.$Message.warning('请填写页面地址');
}
if (!this.formValidate.api_url && this.authType == 2) {
return this.$Message.warning('请填写接口地址');
}
this.valids = true;
addMenusApi(data)

View File

@ -71,10 +71,10 @@
<span>
<a @click="addRoute(row)" v-if="row.auth_type === 1 || row.auth_type === 3">选择权限</a>
<Divider type="vertical" v-if="row.auth_type === 1 || row.auth_type === 3"/>
<a @click="addE(row, '添加子菜单')" v-if="row.auth_type === 1">添加下级</a>
<a @click="addE(row, '添加子菜单')" v-if="row.auth_type === 1 || row.auth_type === 3">添加下级</a>
<!-- <a @click="addE(row, '添加规则')" v-else>添加规则</a> -->
</span>
<Divider type="vertical" v-if="row.auth_type === 1" />
<Divider type="vertical" v-if="row.auth_type === 1 || row.auth_type === 3" />
<a @click="edit(row, '编辑')">编辑</a>
<Divider type="vertical" />
<a @click="del(row, '删除规则')">删除</a>