From 748464b44a747418b4bf41710b169e43f903b93d Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Fri, 11 Jul 2025 19:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86/=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E7=AE=A1=E7=90=86=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dept/index.ts | 9 +- src/api/system/dept/types.ts | 6 + src/api/system/post/index.ts | 11 + src/api/system/role/types.ts | 6 +- src/api/system/user/index.ts | 5 +- src/api/workflow/definition/types.ts | 2 + src/api/workflow/workflowCommon/index.ts | 4 +- src/views/system/dept/index.vue | 39 +++- src/views/system/role/index.vue | 213 ++++++++++++------ src/views/system/user/index.vue | 12 +- src/views/workflows/category/index.vue | 2 +- .../workflows/processDefinition/index.vue | 13 ++ src/views/workflows/task/myDocument.vue | 2 +- 13 files changed, 243 insertions(+), 81 deletions(-) diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts index f16cb2c..8aa08d6 100644 --- a/src/api/system/dept/index.ts +++ b/src/api/system/dept/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import {DeptForm, DeptQuery, DeptTreeVO, DeptVO} from './types'; +import { DeptForm, DeptQuery, DeptTreeVO, DeptVO } from './types'; // 查询部门列表 export const listDept = (query?: DeptQuery) => { @@ -11,6 +11,13 @@ export const listDept = (query?: DeptQuery) => { }); }; +export const getDeptList = () => { + return request({ + url: '/project/project/listNoDept', + method: 'get' + }); +}; + /** * 通过deptIds查询部门 * @param deptIds diff --git a/src/api/system/dept/types.ts b/src/api/system/dept/types.ts index adaefd2..7f24861 100644 --- a/src/api/system/dept/types.ts +++ b/src/api/system/dept/types.ts @@ -5,6 +5,8 @@ export interface DeptQuery extends PageQuery { deptName?: string; deptCategory?: string; status?: number; + isSubset?: string; + isShow?: string; } /** @@ -16,6 +18,7 @@ export interface DeptVO extends BaseEntity { parentId: number | string; children: DeptVO[]; deptId: number | string; + projectList: any[]; deptName: string; deptCategory: string; orderNum: number; @@ -48,10 +51,13 @@ export interface DeptForm { parentId?: number | string; children?: DeptForm[]; deptId?: number | string; + projectId?: number | string; deptName?: string; deptCategory?: string; orderNum?: number; leader?: string; + isSubset?: string; + isShow?: string; phone?: string; email?: string; status?: string; diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 6d05cdd..6ca7b40 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -56,3 +56,14 @@ export function delPost(postId: string | number | (string | number)[]) { method: 'delete' }); } + +// 获取岗位选择框列表 +export function getRoleList(deptId?: number | string): AxiosPromise { + return request({ + url: '/system/role/listNoPage', + method: 'get', + params: { + deptId + } + }); +} diff --git a/src/api/system/role/types.ts b/src/api/system/role/types.ts index 7dbb6ff..5510307 100644 --- a/src/api/system/role/types.ts +++ b/src/api/system/role/types.ts @@ -6,7 +6,8 @@ export interface DeptTreeOption { label: string; parentId: string; weight: number; - children?: DeptTreeOption[]; + children: DeptTreeOption[]; + disabled: boolean; } export interface RoleDeptTree { @@ -34,6 +35,7 @@ export interface RoleVO extends BaseEntity { export interface RoleQuery extends PageQuery { roleName: string; roleKey: string; + deptId: string; status: string; } @@ -46,7 +48,9 @@ export interface RoleForm { deptCheckStrictly: boolean; remark: string; dataScope?: string; + isSpecial: string; roleId: string | undefined; menuIds: Array; deptIds: Array; + deptId?: string; } diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 1822c91..1f8e1bf 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -202,10 +202,11 @@ export const listUserByDeptId = (deptId: string | number): AxiosPromise => { +export const deptTreeSelect = (data?: { isShow: string }): AxiosPromise => { return request({ url: '/system/user/deptTree', - method: 'get' + method: 'get', + params: data }); }; diff --git a/src/api/workflow/definition/types.ts b/src/api/workflow/definition/types.ts index 5de7f77..47888ff 100644 --- a/src/api/workflow/definition/types.ts +++ b/src/api/workflow/definition/types.ts @@ -3,6 +3,7 @@ export interface FlowDefinitionQuery extends PageQuery { flowName?: string; category: string | number; isPublish?: number; + projectId: string | number; } export interface FlowDefinitionVo { @@ -23,6 +24,7 @@ export interface FlowDefinitionForm { flowCode: string; category: string; formPath: string; + projectId: string; } export interface definitionXmlVO { diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts index 0f5ce1b..fd8a7e4 100644 --- a/src/api/workflow/workflowCommon/index.ts +++ b/src/api/workflow/workflowCommon/index.ts @@ -2,9 +2,11 @@ import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; export default { routerJump(routerJumpVo: RouterJumpVo, proxy) { + console.log(routerJumpVo.formPath); proxy.$tab.closePage(proxy.$route); + proxy.$router.push({ - path: routerJumpVo.formPath, + path: routerJumpVo.formPath ? '/' + routerJumpVo.formPath : routerJumpVo.formPath, query: { id: routerJumpVo.businessId, type: routerJumpVo.type, diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 36c18e0..f608f7a 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -63,7 +63,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -128,6 +128,21 @@ + + + + + + + + + + + + + + + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 7231f36..97e5e7c 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -4,7 +4,7 @@ - + { /** 查询部门下拉树结构 */ const getDeptTree = async () => { - const res = await api.deptTreeSelect(); + const res = await api.deptTreeSelect({ isShow: '1' }); deptOptions.value = res.data; enabledDeptOptions.value = filterDisabledDept(res.data); }; @@ -623,7 +623,6 @@ const handleAdd = async () => { dialog.visible = true; dialog.title = '新增用户'; postOptions.value = data.posts; - roleOptions.value = data.roles; form.value.password = initPassword.value.toString(); }; @@ -638,7 +637,7 @@ const handleUpdate = async (row?: UserForm) => { postOptions.value = data.posts; roleOptions.value = data.roles; form.value.postIds = data.postIds; - form.value.roleIds = data.roleIds; + form.value.roleIds = data.user.roleIds; form.value.password = ''; }; @@ -682,8 +681,11 @@ onMounted(() => { async function handleDeptChange(value: number | string) { const response = await optionselect(value); + const roleList = await getRoleList(value); + roleOptions.value = roleList.data; postOptions.value = response.data; form.value.postIds = []; + form.value.roleIds = []; } const shuttleVisible = ref(false); diff --git a/src/views/workflows/category/index.vue b/src/views/workflows/category/index.vue index 53a285a..3771a52 100644 --- a/src/views/workflows/category/index.vue +++ b/src/views/workflows/category/index.vue @@ -59,7 +59,7 @@ { const handleExportDef = () => { proxy?.download(`/workflow/definition/exportDef/${ids.value[0]}`, {}, `${flowCodeList.value[0]}.json`); }; +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); diff --git a/src/views/workflows/task/myDocument.vue b/src/views/workflows/task/myDocument.vue index 18f3c39..2f7cfe9 100644 --- a/src/views/workflows/task/myDocument.vue +++ b/src/views/workflows/task/myDocument.vue @@ -10,7 +10,7 @@ class="mt-2" node-key="id" :data="categoryOptions" - :props="{ label: 'label', children: 'children' } as any" + :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" highlight-current