crm-团队成员:新增获得权限级别名称函数 getLevelName

This commit is contained in:
puhui999 2023-11-14 12:06:42 +08:00
parent ba702d03bc
commit 8e0cf5c1e5
2 changed files with 36 additions and 3 deletions

View File

@ -9,6 +9,7 @@ export interface PermissionVO {
deptName?: string // 部门名称 deptName?: string // 部门名称
nickname?: string // 用户昵称 nickname?: string // 用户昵称
postNames?: string // 岗位名称数组 postNames?: string // 岗位名称数组
createTime?: Date
} }
// 查询团队成员列表 // 查询团队成员列表

View File

@ -28,7 +28,11 @@
<el-table-column align="center" label="姓名" prop="nickname" /> <el-table-column align="center" label="姓名" prop="nickname" />
<el-table-column align="center" label="部门" prop="deptName" /> <el-table-column align="center" label="部门" prop="deptName" />
<el-table-column align="center" label="岗位" prop="postNames" /> <el-table-column align="center" label="岗位" prop="postNames" />
<el-table-column align="center" label="权限级别" prop="level" /> <el-table-column align="center" label="权限级别" prop="level">
<template #default="{ row }">
<el-tag>{{ getLevelName(row.level) }}</el-tag>
</template>
</el-table-column>
<el-table-column :formatter="dateFormatter" align="center" label="加入时间" prop="createTime" /> <el-table-column :formatter="dateFormatter" align="center" label="加入时间" prop="createTime" />
</el-table> </el-table>
<CrmPermissionForm ref="crmPermissionFormRef" /> <CrmPermissionForm ref="crmPermissionFormRef" />
@ -47,7 +51,20 @@ const props = defineProps<{
bizId: number bizId: number
}>() }>()
const loading = ref(true) // const loading = ref(true) //
const list = ref<PermissionApi.PermissionVO[]>([]) // const list = ref<PermissionApi.PermissionVO[]>([
// TODO
{
id: 1, //
userId: 1, //
bizType: 1, // Crm
bizId: 1, // Crm
level: 1, //
deptName: '研发部门', //
nickname: '芋道源码', //
postNames: '全栈开发工程师', //
createTime: new Date()
}
]) //
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
@ -60,7 +77,22 @@ const getList = async () => {
loading.value = false loading.value = false
} }
} }
/**
* 获得权限级别名称
* @param level 权限级别
*/
const getLevelName = computed(() => (level: number) => {
switch (level) {
case CrmPermissionLevelEnum.OWNER:
return '负责人'
case CrmPermissionLevelEnum.READ:
return '只读'
case CrmPermissionLevelEnum.WRITE:
return '读写'
default:
break
}
})
const multipleSelection = ref<PermissionApi.PermissionVO[]>([]) const multipleSelection = ref<PermissionApi.PermissionVO[]>([])
const handleSelectionChange = (val: PermissionApi.PermissionVO[]) => { const handleSelectionChange = (val: PermissionApi.PermissionVO[]) => {
multipleSelection.value = val multipleSelection.value = val