From f5d900db29abcae8330cc1265481e4acae116800 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 26 Mar 2023 19:32:19 +0800 Subject: [PATCH] =?UTF-8?q?Vue3=20=E9=87=8D=E6=9E=84=EF=BC=9A=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=88=86=E9=85=8D=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/userGroup/index.ts | 2 +- src/api/system/dept/index.ts | 2 +- src/api/system/post/index.ts | 2 +- src/api/system/role/index.ts | 2 +- src/api/system/user/index.ts | 2 +- src/router/modules/remaining.ts | 2 +- .../bpm/taskAssignRule/TaskAssignRuleForm.vue | 247 ++++++++++++ src/views/bpm/taskAssignRule/index.vue | 367 ++++-------------- .../bpm/taskAssignRule/taskAssignRule.data.ts | 54 --- src/views/system/dept/DeptForm.vue | 2 +- src/views/system/role/index.vue | 4 +- src/views/system/user/index.vue | 8 +- 12 files changed, 331 insertions(+), 363 deletions(-) create mode 100644 src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue delete mode 100644 src/views/bpm/taskAssignRule/taskAssignRule.data.ts diff --git a/src/api/bpm/userGroup/index.ts b/src/api/bpm/userGroup/index.ts index c3399f27..035762bf 100644 --- a/src/api/bpm/userGroup/index.ts +++ b/src/api/bpm/userGroup/index.ts @@ -42,6 +42,6 @@ export const getUserGroupPage = async (params) => { } // 获取用户组精简信息列表 -export const listSimpleUserGroup = async () => { +export const getSimpleUserGroupList = async (): Promise => { return await request.get({ url: '/bpm/user-group/list-all-simple' }) } diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts index d66de3f1..e9c31fd7 100644 --- a/src/api/system/dept/index.ts +++ b/src/api/system/dept/index.ts @@ -18,7 +18,7 @@ export interface DeptPageReqVO { } // 查询部门(精简)列表 -export const listSimpleDeptApi = async () => { +export const getSimpleDeptList = async (): Promise => { return await request.get({ url: '/system/dept/list-all-simple' }) } diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 98df227f..405db387 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -16,7 +16,7 @@ export const getPostPage = async (params: PageParam) => { } // 获取岗位精简信息列表 -export const getSimplePostList = async () => { +export const getSimplePostList = async (): Promise => { return await request.get({ url: '/system/post/list-all-simple' }) } diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts index 0d477555..9692548a 100644 --- a/src/api/system/role/index.ts +++ b/src/api/system/role/index.ts @@ -28,7 +28,7 @@ export const getRolePageApi = async (params: RolePageReqVO) => { } // 查询角色(精简)列表 -export const listSimpleRolesApi = async () => { +export const getSimpleRoleList = async (): Promise => { return await request.get({ url: '/system/role/list-all-simple' }) } diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 3cc0a84d..058b320a 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -86,6 +86,6 @@ export const updateUserStatusApi = (id: number, status: number) => { } // 获取用户精简信息列表 -export const getSimpleUserList = () => { +export const getSimpleUserList = (): Promise => { return request.get({ url: '/system/user/list-all-simple' }) } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index b1bdfafe..58d5601b 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -256,7 +256,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ hidden: true, canTo: true, title: '流程定义', - activeMenu: 'bpm/definition/index' + activeMenu: '/bpm/manager/model' } }, { diff --git a/src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue b/src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue new file mode 100644 index 00000000..a452cab9 --- /dev/null +++ b/src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue @@ -0,0 +1,247 @@ + + diff --git a/src/views/bpm/taskAssignRule/index.vue b/src/views/bpm/taskAssignRule/index.vue index 8db7b578..feea80a2 100644 --- a/src/views/bpm/taskAssignRule/index.vue +++ b/src/views/bpm/taskAssignRule/index.vue @@ -1,186 +1,73 @@ diff --git a/src/views/bpm/taskAssignRule/taskAssignRule.data.ts b/src/views/bpm/taskAssignRule/taskAssignRule.data.ts deleted file mode 100644 index cad74325..00000000 --- a/src/views/bpm/taskAssignRule/taskAssignRule.data.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -// 表单校验 -export const rules = reactive({ - type: [{ required: true, message: '规则类型不能为空', trigger: 'change' }], - roleIds: [{ required: true, message: '指定角色不能为空', trigger: 'change' }], - deptIds: [{ required: true, message: '指定部门不能为空', trigger: 'change' }], - postIds: [{ required: true, message: '指定岗位不能为空', trigger: 'change' }], - userIds: [{ required: true, message: '指定用户不能为空', trigger: 'change' }], - userGroupIds: [{ required: true, message: '指定用户组不能为空', trigger: 'change' }], - scripts: [{ required: true, message: '指定脚本不能为空', trigger: 'change' }] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - action: true, - actionWidth: '200px', - columns: [ - { - title: '任务名', - field: 'taskDefinitionName' - }, - { - title: '任务标识', - field: 'taskDefinitionKey' - }, - { - title: '规则类型', - field: 'type', - dictType: DICT_TYPE.BPM_TASK_ASSIGN_RULE_TYPE, - dictClass: 'number' - }, - { - title: '规则范围', - field: 'options', - table: { - slots: { - default: 'options_default' - } - } - } - ] -}) - -export const idShowActionClick = (modelId?: any) => { - if (modelId) { - return true - } else { - return false - } -} -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/dept/DeptForm.vue b/src/views/system/dept/DeptForm.vue index 188ecb79..f2c3bc02 100644 --- a/src/views/system/dept/DeptForm.vue +++ b/src/views/system/dept/DeptForm.vue @@ -166,7 +166,7 @@ const resetForm = () => { /** 获得部门树 */ const getTree = async () => { deptTree.value = [] - const data = await DeptApi.listSimpleDeptApi() + const data = await DeptApi.getSimpleDeptList() let dept: Tree = { id: 0, name: '顶级部门', children: [] } dept.children = handleTree(data) deptTree.value.push(dept) diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index da4b8389..d2661abb 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -165,7 +165,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { rules, allSchemas } from './role.data' import * as RoleApi from '@/api/system/role' import { listSimpleMenusApi } from '@/api/system/menu' -import { listSimpleDeptApi } from '@/api/system/dept' +import { getSimpleDeptList } from '@/api/system/dept' import * as PermissionApi from '@/api/system/permission' const { t } = useI18n() // 国际化 @@ -278,7 +278,7 @@ const handleScope = async (type: string, row: RoleApi.RoleVO) => { }) } } else if (type === 'data') { - const deptRes = await listSimpleDeptApi() + const deptRes = await getSimpleDeptList() treeOptions.value = handleTree(deptRes) const role = await RoleApi.getRoleApi(row.id) dataScopeForm.dataScope = role.dataScope diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 9bb50930..542ae2f0 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -271,8 +271,8 @@ import { getAccessToken, getTenantId } from '@/utils/auth' import type { FormExpose } from '@/components/Form' import { rules, allSchemas } from './user.data' import * as UserApi from '@/api/system/user' -import { listSimpleDeptApi } from '@/api/system/dept' -import { listSimpleRolesApi } from '@/api/system/role' +import { getSimpleDeptList } from '@/api/system/dept' +import { getSimpleRoleList } from '@/api/system/role' import { getSimplePostList, PostVO } from '@/api/system/post' import { aassignUserRoleApi, @@ -301,7 +301,7 @@ const filterText = ref('') const deptOptions = ref([]) // 树形结构 const treeRef = ref>() const getTree = async () => { - const res = await listSimpleDeptApi() + const res = await getSimpleDeptList() deptOptions.value.push(...handleTree(res)) } const filterNode = (value: string, data: Tree) => { @@ -477,7 +477,7 @@ const handleRole = async (row: UserApi.UserVO) => { const roles = await listUserRolesApi(row.id) userRole.roleIds = roles // 获取角色列表 - const roleOpt = await listSimpleRolesApi() + const roleOpt = await getSimpleRoleList() roleOptions.value = roleOpt roleDialogVisible.value = true }