fix: 部分权限标识, 修复部门编辑bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-button type="primary" link >
|
||||
{{ modelValue }}
|
||||
{{ modelValue || '请选择' }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ const getInfo = async () => {
|
||||
|
||||
const formatIdsToNames = (ids, infoList, key, viewKey) => {
|
||||
const resArr = []
|
||||
if(!ids.length) return '--'
|
||||
if(!ids?.length) return
|
||||
ids.forEach(item=>{
|
||||
infoList.forEach(v=>{
|
||||
item == v[key] && resArr.push(v[viewKey])
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<el-table-column prop="createTime" label="创建时间"/>
|
||||
<el-table-column prop="oper" label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="goEdit(row.departmentId)">编辑</el-button>
|
||||
<el-button type="primary" v-perm="['admin:department:update']" link @click="goEdit(row.departmentId)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -135,14 +135,14 @@ const tableConfig = reactive({
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
let btn = [{label: '修改', auth: auths.edit, func: ()=>handleEdit(row) , type: 'primary'}]
|
||||
btn.push(
|
||||
{
|
||||
label: '分配用户',
|
||||
auth: auths.edit,
|
||||
func: ()=>handleAssign(row),
|
||||
type: 'primary'
|
||||
}
|
||||
)
|
||||
// btn.push(
|
||||
// {
|
||||
// label: '分配用户',
|
||||
// auth: auths.edit,
|
||||
// func: ()=>handleAssign(row),
|
||||
// type: 'primary'
|
||||
// }
|
||||
// )
|
||||
if(authStore.roles.includes('superAdmin')) {
|
||||
btn.push({label: '删除', auth: auths.edit, func: ()=>handleDel(row) , type: 'danger'})
|
||||
} else if(!row.template) {
|
||||
|
||||
@@ -119,10 +119,10 @@ const tableConfig = reactive({
|
||||
currentRender: ({row, index}) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button type="primary" link onClick={()=>handleEdit(row)}>编辑</el-button>
|
||||
<el-button type="primary" link onClick={()=>handleEdit(row)} v-perm={['admin:user:edit']}>编辑</el-button>
|
||||
{
|
||||
row.userType != 0 ?
|
||||
<el-button type="danger" link onClick={()=>handleDel(row)}>删除</el-button> :
|
||||
<el-button type="danger" link onClick={()=>handleDel(row)} v-perm={['admin:user:del']}>删除</el-button> :
|
||||
null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user