Commit 0d96572e0e6d38f29703491f5c26ce5062e8d1dd
1 parent
d8310faa
添加新菜单404问题解决,设置菜单路由类型默认值“是”
Showing
1 changed file
with
16 additions
and
24 deletions
ant-design-jeecg-vue/src/views/system/modules/PermissionModal.vue
... | ... | @@ -214,7 +214,8 @@ |
214 | 214 | }); |
215 | 215 | }, |
216 | 216 | add () { |
217 | - this.edit({status:'1',permsType:'1'}); | |
217 | + // 默认值 | |
218 | + this.edit({status:'1',permsType:'1',route:true}); | |
218 | 219 | }, |
219 | 220 | edit (record) { |
220 | 221 | this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度 |
... | ... | @@ -222,30 +223,21 @@ |
222 | 223 | this.model = Object.assign({}, record); |
223 | 224 | //-------------------------------------------------------------------------------------------------- |
224 | 225 | //根据菜单类型,动态展示页面字段 |
225 | - if(record){ | |
226 | - console.log(record) | |
227 | - this.alwaysShow = !record.alwaysShow?false:true; | |
228 | - this.menuHidden = !record.hidden?false:true; | |
229 | - this.routeSwitch = record.route; | |
226 | + console.log(record) | |
227 | + this.alwaysShow = !record.alwaysShow?false:true; | |
228 | + this.menuHidden = !record.hidden?false:true; | |
229 | + if(record.route!=null){ | |
230 | + this.routeSwitch = record.route?true:false; | |
231 | + } | |
230 | 232 | |
231 | - //console.log('record.menuType', record.menuType); | |
232 | - this.show = record.menuType==2?false:true; | |
233 | - this.menuLabel = record.menuType==2?'按钮/权限名称':'菜单名称'; | |
233 | + //console.log('record.menuType', record.menuType); | |
234 | + this.show = record.menuType==2?false:true; | |
235 | + this.menuLabel = record.menuType==2?'按钮/权限':'菜单名称'; | |
234 | 236 | |
235 | - if(this.model.parentId){ | |
236 | - this.localMenuType = 1; | |
237 | - }else{ | |
238 | - this.localMenuType = 0; | |
239 | - } | |
237 | + if(this.model.parentId){ | |
238 | + this.localMenuType = 1; | |
240 | 239 | }else{ |
241 | - if(this.model.parentId){ | |
242 | - this.localMenuType = 1; | |
243 | - }else{ | |
244 | - this.localMenuType = 0; | |
245 | - } | |
246 | - this.show = true; | |
247 | - this.menuLabel = '菜单名称'; | |
248 | - this.routeSwitch = true; | |
240 | + this.localMenuType = 0; | |
249 | 241 | } |
250 | 242 | //---------------------------------------------------------------------------------------------- |
251 | 243 | |
... | ... | @@ -303,11 +295,11 @@ |
303 | 295 | } |
304 | 296 | }, |
305 | 297 | onChangeMenuType(e) { |
306 | - console.log('localMenuType checked', e.target.value) | |
298 | + //console.log('localMenuType checked', e.target.value) | |
307 | 299 | this.localMenuType=e.target.value |
308 | 300 | if(e.target.value == 2){ |
309 | 301 | this.show = false; |
310 | - this.menuLabel = '按钮/权限名称'; | |
302 | + this.menuLabel = '按钮/权限'; | |
311 | 303 | }else{ |
312 | 304 | this.show = true; |
313 | 305 | this.menuLabel = '菜单名称'; |
... | ... |