menuId改为menu_id
This commit is contained in:
@@ -69,8 +69,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " label="菜单隐藏" prop="hidden">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label=true>是</el-radio-button>
|
||||
<el-radio-button label=false>否</el-radio-button>
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="菜单标题" prop="title">
|
||||
@@ -130,7 +130,7 @@
|
||||
:auto-load-root-options="false"
|
||||
:data="crud.data"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="menuId"
|
||||
row-key="menu_id"
|
||||
|
||||
@select="crud.selectChange"
|
||||
@select-all="crud.selectAllChange"
|
||||
@@ -188,7 +188,7 @@ import udOperation from '@crud/UD.operation'
|
||||
|
||||
// crud交由presenter持有
|
||||
const defaultForm = {
|
||||
menuId: null,
|
||||
menu_id: null,
|
||||
title: null,
|
||||
menuSort: 999,
|
||||
path: null,
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
name: 'Menu',
|
||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation },
|
||||
cruds() {
|
||||
return CRUD({ title: '菜单', idField: 'menuId', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
@@ -222,7 +222,7 @@ export default {
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.menuId,
|
||||
id: node.menu_id,
|
||||
label: node.title,
|
||||
children: node.children
|
||||
}
|
||||
@@ -241,37 +241,37 @@ export default {
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
this.menus = []
|
||||
if (form.menuId) { // 修改
|
||||
if (form.menu_id) { // 修改
|
||||
if (!form.pid) { // 一级菜单,一级的父级菜单的pid为0.
|
||||
form.pid = 0
|
||||
}
|
||||
this.getSupDepts(form.menuId)
|
||||
this.getSupDepts(form.menu_id)
|
||||
} else { // 新增
|
||||
this.menus.push({ menuId: 0, title: '顶级类目', children: null })
|
||||
this.menus.push({ menu_id: 0, title: '顶级类目', children: null })
|
||||
}
|
||||
},
|
||||
getMenus(tree, treeNode, resolve) {
|
||||
const params = { pid: tree.menuId }
|
||||
const params = { pid: tree.menu_id }
|
||||
setTimeout(() => {
|
||||
crudMenu.getMenus(params).then(res => {
|
||||
resolve(res.content)
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
getSupDepts(menuId) {
|
||||
crudMenu.getMenuSuperior(menuId).then(res => {
|
||||
getSupDepts(menu_id) {
|
||||
crudMenu.getMenuSuperior(menu_id).then(res => {
|
||||
const children = res.map(function(obj) {
|
||||
if (!obj.leaf && !obj.children) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
this.menus = [{ menuId: 0, title: '顶级类目', children: children }]
|
||||
this.menus = [{ menu_id: 0, title: '顶级类目', children: children }]
|
||||
})
|
||||
},
|
||||
loadMenus({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudMenu.getMenusTree(parentNode.menuId).then(res => {
|
||||
crudMenu.getMenusTree(parentNode.menu_id).then(res => {
|
||||
parentNode.children = res.map(function(obj) {
|
||||
if (!obj.leaf) {
|
||||
obj.children = null
|
||||
|
||||
@@ -75,14 +75,14 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() === '3'" label="菜单缓存" prop="cache">
|
||||
<el-radio-group v-model="form.cache" size="mini">
|
||||
<el-radio-button label=true>是</el-radio-button>
|
||||
<el-radio-button label=false>否</el-radio-button>
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " label="菜单隐藏" prop="hidden">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label=true>是</el-radio-button>
|
||||
<el-radio-button label=false>否</el-radio-button>
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="菜单标题" prop="title">
|
||||
@@ -142,7 +142,7 @@
|
||||
:auto-load-root-options="false"
|
||||
:data="crud.data"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="menuId"
|
||||
row-key="menu_id"
|
||||
|
||||
@select="crud.selectChange"
|
||||
@select-all="crud.selectAllChange"
|
||||
@@ -152,7 +152,7 @@
|
||||
<el-table-column label="菜单标题" prop="title" :min-width="100" />
|
||||
<el-table-column label="所属系统" prop="systemType" :min-width="flexWidth('systemType',crud.data,'所属系统')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.system_type[scope.row.systemType] }} : {{scope.row.systemType}}
|
||||
{{ dict.label.system_type[scope.row.systemType] }} : {{ scope.row.systemType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="icon" label="图标" align="center" :min-width="flexWidth('icon',crud.data,'图标')">
|
||||
@@ -215,12 +215,11 @@ import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import Dict from '../../../components/Dict/Dict'
|
||||
|
||||
// crud交由presenter持有
|
||||
const defaultForm = {
|
||||
menuId: null,
|
||||
menu_id: null,
|
||||
title: null,
|
||||
menuSort: 999,
|
||||
path: null,
|
||||
@@ -239,9 +238,9 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Menu',
|
||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation },
|
||||
cruds() {
|
||||
return CRUD({ title: '菜单', idField: 'menuId', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['system_type'],
|
||||
@@ -268,7 +267,7 @@ export default {
|
||||
methods: {
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.menuId,
|
||||
id: node.menu_id,
|
||||
label: node.title,
|
||||
children: node.children
|
||||
}
|
||||
@@ -294,13 +293,13 @@ export default {
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
console.log(this.dict)
|
||||
this.menus = []
|
||||
if (form.menuId) { // 修改
|
||||
if (form.menu_id) { // 修改
|
||||
if (!form.pid) { // 一级菜单,一级的父级菜单的pid为0.
|
||||
form.pid = 0
|
||||
}
|
||||
this.getSupMenus(form.menuId)
|
||||
this.getSupMenus(form.menu_id)
|
||||
} else { // 新增
|
||||
this.menus.push({ menuId: 0, title: '顶级类目', children: null })
|
||||
this.menus.push({ menu_id: 0, title: '顶级类目', children: null })
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.afterSubmit](crud, form) {
|
||||
@@ -322,27 +321,27 @@ export default {
|
||||
}
|
||||
},
|
||||
getMenus(tree, treeNode, resolve) {
|
||||
const params = { pid: tree.menuId, systemType: tree.systemType }
|
||||
const params = { pid: tree.menu_id, systemType: tree.systemType }
|
||||
setTimeout(() => {
|
||||
crudMenu.getMenus(params).then(res => {
|
||||
resolve(res.content)
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
getSupMenus(menuId) {
|
||||
crudMenu.getMenuSuperior(menuId).then(res => {
|
||||
getSupMenus(menu_id) {
|
||||
crudMenu.getMenuSuperior(menu_id).then(res => {
|
||||
const children = res.map(function(obj) {
|
||||
if (!obj.leaf && !obj.children) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
this.menus = [{ menuId: 0, title: '顶级类目', children: children }]
|
||||
this.menus = [{ menu_id: 0, title: '顶级类目', children: children }]
|
||||
})
|
||||
},
|
||||
loadMenus({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudMenu.getMenusTree(parentNode.menuId).then(res => {
|
||||
crudMenu.getMenusTree(parentNode.menu_id).then(res => {
|
||||
parentNode.children = res.map(function(obj) {
|
||||
if (!obj.leaf) {
|
||||
obj.children = null
|
||||
|
||||
Reference in New Issue
Block a user