Commit 4019f497 by wangchunyang

日常管理配置修改

parent e500f9dd
...@@ -535,6 +535,7 @@ export default { ...@@ -535,6 +535,7 @@ export default {
{ type: 'index', title: '序号', width: 60, align: 'center' }, { type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '分类名称', key: 'catgory_name', align: 'center' }, { title: '分类名称', key: 'catgory_name', align: 'center' },
{ title: '描述', key: 'remark', align: 'center' }, { title: '描述', key: 'remark', align: 'center' },
{ title: '权限', key: 'permission_names', align: 'center', minWidth: 200 },
{ title: '排序号', key: 'order_no', align: 'center', width: 100 }, { title: '排序号', key: 'order_no', align: 'center', width: 100 },
{ title: '操作', slot: 'action', align: 'center', width: 250, fixed: 'right' } { title: '操作', slot: 'action', align: 'center', width: 250, fixed: 'right' }
], ],
...@@ -600,6 +601,23 @@ export default { ...@@ -600,6 +601,23 @@ export default {
if (ret.data && ret.data.errcode === 0) { if (ret.data && ret.data.errcode === 0) {
const data = ret.data.data || {} const data = ret.data.data || {}
this.tables[tab] = data.results || [] this.tables[tab] = data.results || []
// 如果是人员分类,加载每行的权限名称并拼接显示
if (tab === 'userCategory' && Array.isArray(this.tables[tab]) && this.tables[tab].length > 0) {
const rows = this.tables[tab]
// 并行查询每个分类的权限配置(可优化为批量接口)
const promises = rows.map(r => {
return getUserCategoryPermissionList({ category_id: r.id }).then(res => {
if (res.data && res.data.errcode === 0) {
const list = res.data.data || res.data.results || []
r.permission_names = (Array.isArray(list) ? list.map(it => it.permission_name).filter(Boolean) : []).join(',')
} else {
r.permission_names = ''
}
return r
}).catch(() => { r.permission_names = ''; return r })
})
Promise.all(promises).then(() => { /* update reactive table already done */ })
}
this.pagers[tab].totalRecord = data.totalRecord || 0 this.pagers[tab].totalRecord = data.totalRecord || 0
} else { } else {
this.$Notice.error({ title: '查询失败', desc: ret.data.errmsg || '请稍后重试' }) this.$Notice.error({ title: '查询失败', desc: ret.data.errmsg || '请稍后重试' })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论