BPM:简化 userGroup 的实现
This commit is contained in:
parent
2d424fc9a6
commit
a0f157c8b6
@ -4,7 +4,7 @@ export type UserGroupVO = {
|
|||||||
id: number
|
id: number
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
memberUserIds: number[]
|
userIds: number[]
|
||||||
status: number
|
status: number
|
||||||
remark: string
|
remark: string
|
||||||
createTime: string
|
createTime: string
|
||||||
@ -42,6 +42,6 @@ export const getUserGroupPage = async (params) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户组精简信息列表
|
// 获取用户组精简信息列表
|
||||||
export const getSimpleUserGroupList = async (): Promise<UserGroupVO[]> => {
|
export const getUserGroupSimpleList = async (): Promise<UserGroupVO[]> => {
|
||||||
return await request.get({ url: '/bpm/user-group/list-all-simple' })
|
return await request.get({ url: '/bpm/user-group/simple-list' })
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ onMounted(async () => {
|
|||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
userOptions.value = await UserApi.getSimpleUserList()
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
// 获得用户组列表
|
// 获得用户组列表
|
||||||
userGroupOptions.value = await UserGroupApi.getSimpleUserGroupList()
|
userGroupOptions.value = await UserGroupApi.getUserGroupSimpleList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
<el-form-item label="描述">
|
<el-form-item label="描述">
|
||||||
<el-input v-model="formData.description" placeholder="请输入描述" type="textarea" />
|
<el-input v-model="formData.description" placeholder="请输入描述" type="textarea" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="成员" prop="memberUserIds">
|
<el-form-item label="成员" prop="userIds">
|
||||||
<el-select v-model="formData.memberUserIds" multiple placeholder="请选择成员">
|
<el-select v-model="formData.userIds" multiple placeholder="请选择成员">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="user in userList"
|
v-for="user in userList"
|
||||||
:key="user.id"
|
:key="user.id"
|
||||||
@ -60,13 +60,13 @@ const formData = ref({
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
memberUserIds: undefined,
|
userIds: undefined,
|
||||||
status: CommonStatusEnum.ENABLE
|
status: CommonStatusEnum.ENABLE
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
name: [{ required: true, message: '组名不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '组名不能为空', trigger: 'blur' }],
|
||||||
description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
|
description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
|
||||||
memberUserIds: [{ required: true, message: '成员不能为空', trigger: 'blur' }],
|
userIds: [{ required: true, message: '成员不能为空', trigger: 'blur' }],
|
||||||
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
|
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
@ -124,7 +124,7 @@ const resetForm = () => {
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
memberUserIds: undefined,
|
userIds: undefined,
|
||||||
status: CommonStatusEnum.ENABLE
|
status: CommonStatusEnum.ENABLE
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
<el-table-column label="描述" align="center" prop="description" />
|
<el-table-column label="描述" align="center" prop="description" />
|
||||||
<el-table-column label="成员" align="center">
|
<el-table-column label="成员" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-for="userId in scope.row.memberUserIds" :key="userId" class="pr-5px">
|
<span v-for="userId in scope.row.userIds" :key="userId" class="pr-5px">
|
||||||
{{ userList.find((user) => user.id === userId)?.nickname }}
|
{{ userList.find((user) => user.id === userId)?.nickname }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user