diff --git a/admin/src/api/perms/admin.ts b/admin/src/api/perms/admin.ts index a54b275..18de0a2 100644 --- a/admin/src/api/perms/admin.ts +++ b/admin/src/api/perms/admin.ts @@ -29,3 +29,8 @@ export function adminDelete(params: any) { export function adminStatus(params: any) { return request.post({ url: '/system/admin/disable', params }) } + +// 部门下的管理员 +export function adminListByDeptId(params: any) { + return request.get({ url: '/system/admin/ListByDeptId', params }) +} diff --git a/admin/src/components/flow/flowEdit/Diagram.vue b/admin/src/components/flow/flowEdit/Diagram.vue index fa3495f..6a9e528 100644 --- a/admin/src/components/flow/flowEdit/Diagram.vue +++ b/admin/src/components/flow/flowEdit/Diagram.vue @@ -219,6 +219,8 @@ export default { label: node?.text?.value, type: node.type, fieldAuth: node?.properties?.fieldAuth, + + userType: node?.properties?.userType || 0, userId: node?.properties?.userId || 0, deptId: node?.properties?.deptId || 0, postId: node?.properties?.postId || 0 diff --git a/admin/src/components/flow/flowEdit/PropertyPanel.vue b/admin/src/components/flow/flowEdit/PropertyPanel.vue index aeee14e..9a8ff3d 100644 --- a/admin/src/components/flow/flowEdit/PropertyPanel.vue +++ b/admin/src/components/flow/flowEdit/PropertyPanel.vue @@ -133,9 +133,11 @@ export default { open(node, fieldList) { this.node = node + this.properties.userType = node?.properties?.userType || '' this.properties.userId = node?.properties?.userId || '' this.properties.deptId = node?.properties?.deptId || '' this.properties.postId = node?.properties?.postId || '' + this.properties.fieldAuth = node?.properties?.fieldAuth ? { ...node?.properties?.fieldAuth } : {} @@ -163,6 +165,7 @@ export default { this.setProperties('fieldAuth', { ...fieldAuth }) + this.setProperties('userType', this.properties.userType) this.setProperties('userId', this.properties.userId) this.setProperties('deptId', this.properties.deptId) this.setProperties('postId', this.properties.postId) diff --git a/admin/src/utils/util.ts b/admin/src/utils/util.ts index bba954e..8948a6b 100644 --- a/admin/src/utils/util.ts +++ b/admin/src/utils/util.ts @@ -48,25 +48,18 @@ export const treeToArray = (data: any[], props = { children: 'children' }) => { * @param {Object} props `{ parent: 'pid', children: 'children' }` */ -export const arrayToTree = ( - data: any[], - props = { id: 'id', parentId: 'pid', children: 'children' } -) => { - data = cloneDeep(data) - const { id, parentId, children } = props - const result: any[] = [] - const map = new Map() - data.forEach((item) => { - map.set(item[id], item) - const parent = map.get(item[parentId]) - if (parent) { - parent[children] = parent[children] ?? [] - parent[children].push(item) - } else { - result.push(item) +export function arrayToTree(arr, parentId = '') { + const tree = [] + for (const item of arr) { + if (item.pid == parentId) { + const children = arrayToTree(arr, item.id) + if (children.length > 0) { + item.children = children + } + tree.push(item) } - }) - return result + } + return tree } /** diff --git a/admin/src/views/flow/flow_apply/components/apply_submit.vue b/admin/src/views/flow/flow_apply/components/apply_submit.vue index 6883f8e..e5848e6 100644 --- a/admin/src/views/flow/flow_apply/components/apply_submit.vue +++ b/admin/src/views/flow/flow_apply/components/apply_submit.vue @@ -103,14 +103,14 @@ function open(applyId) { console.log('res', res) next_nodes.value = res - res.map((item) => { - if (item.type == 'bpmn:userTask') { - flow_history_get_approver(item).then((user) => { - console.log('user', user) - approverUserList.value = user - }) - } - }) + // res.map((item) => { + // if (item.type == 'bpmn:userTask') { + // } + // }) + }) + flow_history_get_approver({ applyId: applyId }).then((user) => { + console.log('user', user) + approverUserList.value = user }) } function BeforeClose() { diff --git a/admin/src/views/organization/department/edit.vue b/admin/src/views/organization/department/edit.vue index 07e3f5f..114d65e 100644 --- a/admin/src/views/organization/department/edit.vue +++ b/admin/src/views/organization/department/edit.vue @@ -33,15 +33,25 @@ :maxlength="100" /> - - + + placeholder="请选择上级部门" + @change="dutyChange" + > + + + + - + @@ -60,6 +70,8 @@