已修改角色、新增用户、检测源列表、被检设备列表、检测脚本列表
This commit is contained in:
@@ -4,10 +4,11 @@
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:data='roleData'
|
||||
>
|
||||
>
|
||||
<!-- :requestApi="getRoleList" -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增')">新增角色</el-button>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增角色</el-button>
|
||||
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出角色数据</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
@@ -16,10 +17,8 @@
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑', scope.row)">编辑</el-button>
|
||||
<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 type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)">设置权限</el-button>
|
||||
</template>
|
||||
|
||||
@@ -73,13 +72,27 @@
|
||||
const roleUnitTitle = ref()
|
||||
const permissionUnitTitle = ref()
|
||||
const roleUnitData = ref<Role.ResRoleList>({} as Role.ResRoleList)
|
||||
const permissionUnitData = ref<Role.Permission[]>([])
|
||||
const permissionUnitData = ref<Role.ResRoleList>({} as Role.ResRoleList)
|
||||
// const permissionUnitData = ref<Role.Permission[]>([])
|
||||
return {roleUnitVisible,permissionUnitVisible,roleUnitTitle,permissionUnitTitle,roleUnitData,permissionUnitData};
|
||||
}
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const roleData = roleDataList
|
||||
//const roleData = roleDataList
|
||||
const roleData = ref<Role.ResRoleList[]>([])
|
||||
getRoleList({
|
||||
id: '',
|
||||
rolename: '',
|
||||
status: 0,
|
||||
describe: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}).then(res => {
|
||||
if(res.code == '200') {
|
||||
roleData.value = res.data.list
|
||||
}
|
||||
})
|
||||
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
@@ -126,6 +139,11 @@
|
||||
search: { el: 'input' },
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
prop: 'describe',
|
||||
label: '描述',
|
||||
minWidth: 380,
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
|
||||
@@ -141,11 +159,6 @@
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'describe',
|
||||
label: '描述',
|
||||
minWidth: 380,
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
|
||||
])
|
||||
|
||||
@@ -192,7 +205,7 @@
|
||||
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
const openDrawer = (title: string, row: Partial<Role.ResRoleList> = {}) => {
|
||||
if(title === "新增" || title === '编辑' )
|
||||
if(title === "新增角色" || title === '编辑角色' )
|
||||
{
|
||||
roleUnitVisible.value = true
|
||||
roleUnitTitle.value = title
|
||||
@@ -212,10 +225,20 @@
|
||||
permissionUnitVisible.value = true
|
||||
permissionUnitTitle.value = title
|
||||
|
||||
if (row.permissionList)
|
||||
{
|
||||
permissionUnitData.value = row.permissionList;
|
||||
}
|
||||
const safeRow: Role.ResRoleList = {
|
||||
id: row.id || '',
|
||||
rolename: row.rolename || '',
|
||||
status: row.status || 0,
|
||||
describe: row.describe || '',
|
||||
permissionList: row.permissionList || []
|
||||
};
|
||||
|
||||
permissionUnitData.value = safeRow;
|
||||
console.log(111,permissionUnitData);
|
||||
// if (row.permissionList)
|
||||
// {
|
||||
// permissionUnitData.value = row.permissionList;
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user