diff --git a/admin/src/components/TreeSelect/index.vue b/admin/src/components/TreeSelect/index.vue index 2b49c9a..86ab691 100644 --- a/admin/src/components/TreeSelect/index.vue +++ b/admin/src/components/TreeSelect/index.vue @@ -280,6 +280,13 @@ export default { if (!val) return; this.checkedKeys = val; this.initCheckedData(); + }, + data() { + this.initCheckedData(); + this.$nextTick(() => { + this.handleCheckChange(); + }); + } } }; diff --git a/admin/src/plugins/package/penal/task/task-components/UserTask.vue b/admin/src/plugins/package/penal/task/task-components/UserTask.vue index 98b9175..bf0aed6 100644 --- a/admin/src/plugins/package/penal/task/task-components/UserTask.vue +++ b/admin/src/plugins/package/penal/task/task-components/UserTask.vue @@ -39,7 +39,7 @@ multiple clearable checkStrictly - nodeKey="id" + node-key="deptId" :checkedKeys="deptIds" @change="checkedDeptChange"> @@ -90,6 +90,7 @@ :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" + node-key="deptId" default-expand-all @node-click="handleNodeClick" /> @@ -99,8 +100,12 @@ - - + + + + { - let treeData = { id: `DEPT${node.id}`, label: node.label, parentId: node.parentId, weight: node.weight }; + let treeData = { deptId: `DEPT${node.deptId}`, deptName: node.deptName, parentId: node.parentId, weight: node.weight }; if (node.children && node.children.length > 0) { treeData.children = refactorTree(node.children); } @@ -306,11 +311,11 @@ export default { // 筛选节点 filterNode(value, data) { if (!value) return true; - return data.label.indexOf(value) !== -1; + return data.deptName.indexOf(value) !== -1; }, // 节点单击事件 handleNodeClick(data) { - this.queryParams.deptId = data.id; + this.queryParams.deptId = data.deptId; this.getUserList(); }, // 关闭标签 @@ -334,18 +339,18 @@ export default { return; } userTaskForm.dataType = 'USERS'; - this.selectedUser.text = this.selectedUserDate.map(k => k.nickName) || []; + this.selectedUser.text = this.selectedUserDate.map(k => k.realName) || []; if (this.selectedUserDate.length === 1) { let data = this.selectedUserDate[0]; - userTaskForm.assignee = data.userId; - userTaskForm.text = data.nickName; + userTaskForm.assignee = data.id; + userTaskForm.text = data.realName; userTaskForm.candidateUsers = null; this.showMultiFlog = false; this.multiLoopType = 'Null'; this.changeMultiLoopType(); } else { - userTaskForm.candidateUsers = this.selectedUserDate.map(k => k.userId).join() || null; - userTaskForm.text = this.selectedUserDate.map(k => k.nickName).join() || null; + userTaskForm.candidateUsers = this.selectedUserDate.map(k => k.id).join() || null; + userTaskForm.text = this.selectedUserDate.map(k => k.realName).join() || null; userTaskForm.assignee = null; this.showMultiFlog = true; } @@ -386,12 +391,12 @@ export default { if(temp.children) { stark = temp.children.concat(stark); } - if(id === temp.id) { + if(id === temp.deptId) { textArr.push(temp); } } }) - text = textArr?.map(k => k.label).join() || null; + text = textArr?.map(k => k.deptName).join() || null; } else { userTaskForm.dataType = null; this.multiLoopType = 'Null'; @@ -442,12 +447,12 @@ export default { if(temp.children) { stark = temp.children.concat(stark); } - if(id === temp.id) { + if(id === temp.deptId) { textArr.push(temp); } } }) - userTaskForm.text = textArr?.map(k => k.label).join() || null; + userTaskForm.text = textArr?.map(k => k.deptName).join() || null; } } else if (val === 'INITIATOR') { userTaskForm.assignee = "${initiator}"; diff --git a/admin/src/views/workflow/work/detail.vue b/admin/src/views/workflow/work/detail.vue index d9c5879..a315122 100644 --- a/admin/src/views/workflow/work/detail.vue +++ b/admin/src/views/workflow/work/detail.vue @@ -28,7 +28,7 @@ closable :disable-transitions="false" @close="handleClose('copy', item)"> - {{ item.nickName }} + {{ item.realName }} @@ -39,7 +39,7 @@ closable :disable-transitions="false" @close="handleClose('next', item)"> - {{ item.nickName }} + {{ item.realName }} @@ -161,6 +161,7 @@ :props="deptProps" :expand-on-click-node="false" :filter-node-method="filterNode" + node-key="deptId" ref="tree" default-expand-all @node-click="handleNodeClick" @@ -180,7 +181,7 @@ @@ -271,7 +272,7 @@ export default { userList: null, deptProps: { children: "children", - label: "label" + label: "deptName" }, // 查询参数 queryParams: { @@ -352,7 +353,7 @@ export default { }, // 节点单击事件 handleNodeClick(data) { - this.queryParams.deptId = data.id; + this.queryParams.deptId = data.deptId; this.getList(); }, setIcon(val) { @@ -377,7 +378,7 @@ export default { if (selection && selection.length > 0) { this.$nextTick(()=> { selection.forEach(item => { - let row = this.userList.find(k => k.userId === item.userId); + let row = this.userList.find(k => k.id === item.id); this.$refs.userTable.toggleRowSelection(row); }) }) @@ -389,7 +390,7 @@ export default { }, // 关闭标签 handleClose(type, tag) { - let userObj = this.userMultipleSelection.find(item => item.userId === tag.id); + let userObj = this.userMultipleSelection.find(item => item.id === tag.id); this.userMultipleSelection.splice(this.userMultipleSelection.indexOf(userObj), 1); if (type === 'copy') { this.copyUser = this.userMultipleSelection; @@ -516,7 +517,7 @@ export default { }); }, changeCurrentUser(val) { - this.currentUserId = val.userId + this.currentUserId = val.id }, /** 返回页面 */ goBack() { @@ -553,7 +554,7 @@ export default { this.$modal.msgError("请选择用户"); return false; } - let userIds = this.userMultipleSelection.map(k => k.userId); + let userIds = this.userMultipleSelection.map(k => k.id); if (type === 'copy') { // 设置抄送人ID信息 this.copyUser = this.userMultipleSelection; @@ -573,7 +574,7 @@ export default { this.$modal.msgError("请选择用户"); return false; } - this.taskForm.userId = this.currentUserId; + this.taskForm.id = this.currentUserId; if (type === 'delegate') { delegate(this.taskForm).then(res => { this.$modal.msgSuccess('操作成功');