crm:code review 权限列表

(cherry picked from commit b1f5ad55b8)
This commit is contained in:
YunaiV 2023-11-19 00:28:22 +08:00 committed by shizhong
parent b1892674f6
commit 7f50592069
4 changed files with 19 additions and 7 deletions

View File

@ -6,9 +6,9 @@ export interface PermissionVO {
bizType: number | undefined // Crm 类型
bizId: number | undefined // Crm 类型数据编号
level: number | undefined // 权限级别
deptName?: string // 部门名称
deptName?: string // 部门名称 // 岗位名称数组 TODO @puhui999数组
nickname?: string // 用户昵称
postNames?: string // 岗位名称数组
postNames?: string // 岗位名称数组 TODO @puhui999数组
createTime?: Date
}

View File

@ -19,6 +19,7 @@
</el-form-item>
<el-form-item label="权限级别" prop="level">
<el-radio-group v-model="formData.level">
<!-- TODO @puhui999搞个字典配置然后这里 remove 掉负责人 -->
<el-radio :label="CrmPermissionLevelEnum.READ">只读</el-radio>
<el-radio :label="CrmPermissionLevelEnum.WRITE">读写</el-radio>
</el-radio-group>
@ -36,6 +37,7 @@ import * as PermissionApi from '@/api/crm/permission'
import { CrmPermissionLevelEnum } from './index'
defineOptions({ name: 'CrmPermissionForm' })
const { t } = useI18n() //
const message = useMessage() //
@ -107,6 +109,7 @@ const resetForm = (bizType: number, bizId: number) => {
}
onMounted(async () => {
//
// TODO
userOptions.value = await UserApi.getSimpleUserList()
})
</script>

View File

@ -38,6 +38,7 @@
<CrmPermissionForm ref="crmPermissionFormRef" />
</template>
<script lang="ts" setup>
// TODO @puhui999 CrmPermissionList
import { dateFormatter } from '@/utils/formatTime'
import { ElTable } from 'element-plus'
import * as PermissionApi from '@/api/crm/permission'
@ -46,6 +47,9 @@ import CrmPermissionForm from './CrmPermissionForm.vue'
import { CrmPermissionLevelEnum } from './index'
defineOptions({ name: 'CrmTeam' })
const message = useMessage() //
const props = defineProps<{
bizType: number
bizId: number
@ -65,18 +69,22 @@ const list = ref<PermissionApi.PermissionVO[]>([
createTime: new Date()
}
]) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const res = await PermissionApi.getPermissionList({
const data = await PermissionApi.getPermissionList({
bizType: props.bizType,
bizId: props.bizId
})
list.value = res
list.value = data
} finally {
loading.value = false
}
}
// TODO @puhui999
/**
* 获得权限级别名称
* @param level 权限级别
@ -93,11 +101,12 @@ const getLevelName = computed(() => (level: number) => {
break
}
})
// TODO @puhui999
const multipleSelection = ref<PermissionApi.PermissionVO[]>([])
const handleSelectionChange = (val: PermissionApi.PermissionVO[]) => {
multipleSelection.value = val
}
const message = useMessage()
// TODO @puhui999 index.vue
const crmPermissionFormRef = ref<InstanceType<typeof CrmPermissionForm>>()
const handleEdit = () => {
if (multipleSelection.value?.length === 0) {

View File

@ -185,8 +185,8 @@
@pagination="getList"
/>
</ContentWrap>
<!-- TODO 方便查看效果 -->
<CrmTeam :biz-id="1" :biz-type="CrmBizTypeEnum.CRM_CUSTOMER" />
<!-- TODO 方便查看效果 TODO 芋艿先注释了避免演示环境报错 -->
<!-- <CrmTeam :biz-id="1" :biz-type="CrmBizTypeEnum.CRM_CUSTOMER" />-->
<!-- 表单弹窗添加/修改 -->
<CustomerForm ref="formRef" @success="getList" />