新增:获取字典管理中label的值
parent
220896507b
commit
a939ac4e53
|
@ -188,6 +188,19 @@ selectType.component.props.color = 'auto' // 修改官方的字段类型,设
|
|||
Vue.prototype.dictionary = function (name) {
|
||||
return store.state.d2admin.dictionary.data[name]
|
||||
}
|
||||
// 获取字典label值
|
||||
Vue.prototype.getDictionaryLabel = function (name, value) {
|
||||
const data = store.state.d2admin.dictionary.data[name]
|
||||
if (data && data instanceof Array) {
|
||||
for (var i = 0, len = data.length; i < len; i++) {
|
||||
if (data[i].value === value) {
|
||||
return data[i].label
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
return store.state.d2admin.dictionary.data[name]
|
||||
}
|
||||
// 默认Columns 结尾 showForm:显示在form中,showTable:显示在table中
|
||||
Vue.prototype.commonEndColumns = function (param = {}) {
|
||||
/**
|
||||
|
|
|
@ -29,43 +29,7 @@ function supplementPath (menu) {
|
|||
|
||||
export const menuHeader = supplementPath([])
|
||||
|
||||
// export const menuHeader = supplementPath([
|
||||
// { path: '/index', title: '控制台', icon: 'home' },
|
||||
// {
|
||||
// title: '页面',
|
||||
// icon: 'folder-o',
|
||||
// children: [
|
||||
// { path: '/page1', title: '页面 1' },
|
||||
// { path: '/page2', title: '页面 2' },
|
||||
// { path: '/page3', title: '页面 3' }
|
||||
// ]
|
||||
// }
|
||||
// ])
|
||||
|
||||
export const menuAside = supplementPath([])
|
||||
// export const menuAside = supplementPath([
|
||||
// { path: '/index', title: '控制台', icon: 'home' },
|
||||
// {
|
||||
// title: '系统管理',
|
||||
// icon: 'folder-o',
|
||||
// children: [
|
||||
// // { path: '/page1', title: '页面 1' },
|
||||
// // { path: '/page2', title: '页面 2' },
|
||||
// // { path: '/page3', title: '页面 3' },
|
||||
// { path: '/menu', title: '菜单' },
|
||||
// { path: '/user', title: '用户' },
|
||||
// { path: '/button', title: '按钮' },
|
||||
// { path: '/role', title: '角色' },
|
||||
// { path: '/dept', title: '部门' },
|
||||
// { path: '/rolePermission', title: '角色权限' },
|
||||
// {
|
||||
// title: '日志管理', children: [
|
||||
// { path: '/operationLog', title: '操作日志' },
|
||||
// ]
|
||||
// },
|
||||
// ]
|
||||
// }
|
||||
// ])
|
||||
|
||||
// 请求菜单数据,用于解析路由和侧边栏菜单
|
||||
export const getMenu = function () {
|
||||
|
@ -136,7 +100,7 @@ export const handleAsideMenu = function (menuData) {
|
|||
strict: true
|
||||
})
|
||||
const menu = [
|
||||
{ path: '/index', title: '控制台', icon: 'home' },
|
||||
{ path: '/index', title: '控制啊台1', icon: 'home' },
|
||||
...data
|
||||
]
|
||||
return supplementPath(menu)
|
||||
|
|
Loading…
Reference in New Issue