修复代码生成权限标识出现“/”问题,代码生成添加 直接生成到某某菜单下

This commit is contained in:
吕金泽
2022-04-06 23:54:09 +08:00
parent 10985aabb2
commit 4400acd4e1
9 changed files with 53 additions and 16 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
function gen(groupPath, data){
var permissionPrefix = groupPath.replace(/^\//,'').replace(/\/\//, '/').replace('/', ':')
var permissionPrefix = groupPath.replace(/^\//,'').replace(/\/\//, '/').replaceAll('/', ':')
var html = `<template>
<mb-list ref="magicList" v-bind="listOptions" />
<mb-dialog ref="formDialog" :title="magicFormTitle" @confirm-click="magicForm.save($event)" width="50%">
@@ -69,7 +69,12 @@
<el-input v-model="genInfo.info.businessPath"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="上级菜单" prop="pid">
<treeselect v-model="genInfo.info.pid" :options="menuTree" :key="genInfo.info.pid" style="position: fixed;z-index:999999;width: 548px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<template #label>
代码生成
@@ -93,6 +98,14 @@
const dataForm = ref()
const tables = ref([])
const emit = defineEmits(['reload'])
const menuTree = ref()
proxy.$get('/system/menu/tree').then(res => {
menuTree.value = [{
label: '根节点',
id: '0',
children: proxy.$treeTable.genTree(res.data.list)
}]
})
var validatePath = (rule, value, callback) => {
if(!value.startsWith('/')){
callback(new Error('请以“/”开头'));
@@ -119,7 +132,8 @@
modulePath: '',
businessName: '',
businessPath: '',
template: 'singleTable'
template: 'singleTable',
pid: ''
},
columns: []
})