This commit is contained in:
sjl
2024-11-15 16:31:48 +08:00
parent 413c14083b
commit a8eaccc53e
6 changed files with 126 additions and 78 deletions

View File

@@ -17,7 +17,7 @@
<!-- 表格操作 -->
<template #operation='scope'>
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑角色', scope.row)">编辑</el-button>
<el-button type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button>
<el-button v-if="scope.row.type !== 0 && scope.row.type !== 1" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button>
<el-button type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)">设置权限</el-button>
</template>
@@ -39,6 +39,7 @@ import RolePopup from './components/rolePopup.vue'
import RoleResourcePopup from './components/roleResourcePopup.vue'
import { onMounted, reactive, ref } from 'vue'
import {useDictStore} from '@/stores/modules/dict'
import { fa } from 'element-plus/es/locale/index.mjs'
const rolePopup = ref()
const roleResourcePopup = ref()
const dictStore = useDictStore()
@@ -65,8 +66,20 @@ const getTableList = (params: any) => {
// 表格配置项
const columns = reactive<ColumnProps<Role.RoleBO>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
type: 'selection',
fixed: 'left',
width: 70,
selectable(row, index) {
return ![0, 1].includes(row.type);//类型是0-超级管理员1-管理员,不可选择
},
},
{
type: 'index',
fixed: 'left',
width: 70,
label: '序号'
},
{
prop: 'name',
label: '名称',
@@ -94,7 +107,12 @@ const columns = reactive<ColumnProps<Role.RoleBO>[]>([
)
},
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
{ prop: 'operation',
label: '操作',
fixed: 'right',
width: 250,
}
])
// 删除角色信息