File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ func AddBaseMenu(c *gin.Context) {
70
70
var menu model.SysBaseMenu
71
71
_ = c .ShouldBindJSON (& menu )
72
72
MenuVerify := utils.Rules {
73
- "Path" : {"notEmpty" },
73
+ "Path" : {utils . NotEmpty () },
74
74
"ParentId" : {utils .NotEmpty ()},
75
75
"Name" : {utils .NotEmpty ()},
76
76
"Component" : {utils .NotEmpty ()},
Original file line number Diff line number Diff line change 8
8
<el-table :data =" tableData" border row-key =" ID" stripe >
9
9
<el-table-column label =" ID" min-width =" 100" prop =" ID" ></el-table-column >
10
10
<el-table-column label =" 路由Name" min-width =" 160" prop =" name" ></el-table-column >
11
+ <el-table-column label =" 路由Path" min-width =" 160" prop =" path" ></el-table-column >
11
12
<el-table-column label =" 是否隐藏" min-width =" 100" prop =" hidden" >
12
13
<template slot-scope="scope">
13
14
<span >{{scope.row.hidden?"隐藏":"显示"}}</span >
46
47
label-position =" top"
47
48
>
48
49
<el-form-item label =" 路由name" prop =" path" style =" width :30% " >
49
- <el-input autocomplete =" off" placeholder =" 唯一英文字符串" v-model =" form.path" ></el-input >
50
+ <el-input autocomplete =" off" placeholder =" 唯一英文字符串" @change =" changeName" v-model =" form.name" ></el-input >
51
+ </el-form-item >
52
+ <el-form-item label =" 路由path" prop =" path" style =" width :30% " >
53
+ <el-input autocomplete =" off" placeholder =" 建议只在后方拼接参数" v-model =" form.path" ></el-input >
50
54
</el-form-item >
51
55
<el-form-item label =" 是否隐藏" style =" width :30% " >
52
56
<el-select placeholder =" 是否在列表隐藏" v-model =" form.hidden" >
@@ -151,6 +155,9 @@ export default {
151
155
icon
152
156
},
153
157
methods: {
158
+ changeName (){
159
+ this .form .path = this .form .name
160
+ },
154
161
setOptions () {
155
162
this .menuOption = [
156
163
{
@@ -259,7 +266,6 @@ export default {
259
266
this .$refs .menuForm .validate (async valid => {
260
267
if (valid) {
261
268
let res;
262
- this .form .name = this .form .path ;
263
269
if (this .isEdit ) {
264
270
res = await updateBaseMenu (this .form );
265
271
} else {
You can’t perform that action at this time.
0 commit comments