111bcd83 by xiaomiao

流程记录办理人渲染

1 parent 31bf6e58
1 // 封装axios请求
2 import axios from "axios";
3 // 创建axios的对象
4 const instance = axios.create({
5 baseURL: "http://192.168.2.235/management/rest/users",
6 })
7
8
9
10 export const getusername = (data) => instance({
11
12 url: '', // 请求地址
13 method: 'get',
14 params:{
15 queryOptions: {
16 conditionGroup: {
17 conditions: [
18 {
19 property: "loginName",
20 value:data,
21 operator: "IN",
22 },
23 ],
24 queryRelation: "AND",
25 },
26 orderBys:[{"property":"sort","direction":"desc"}]
27 },
28 },
29
30 })
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-05-17 10:41:15 4 * @LastEditTime: 2023-05-17 10:41:15
5 --> 5 -->
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
64 </template> 64 </template>
65 </el-table-column> 65 </el-table-column>
66 <el-table-column label="环节名称" prop="taskName" minWidth="100" align="center" /> 66 <el-table-column label="环节名称" prop="taskName" minWidth="100" align="center" />
67 <el-table-column label="办理人" prop="assigneeName" minWidth="120" align="center" /> 67 <el-table-column label="办理人" prop="agent" minWidth="120" align="center" />
68 <el-table-column label="处理时间" prop="createTime" width="160" align="center" /> 68 <el-table-column label="处理时间" prop="createTime" width="160" align="center" />
69 <el-table-column label="办结时间" prop="finishTime" width="160" align="center" /> 69 <el-table-column label="办结时间" prop="finishTime" width="160" align="center" />
70 <el-table-column label="操作方式" align="center"> 70 <el-table-column label="操作方式" align="center">
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
76 <script> 76 <script>
77 import '@/styles/package/theme/index.scss' 77 import '@/styles/package/theme/index.scss'
78 import BpmnViewer from 'bpmn-js/lib/Viewer' 78 import BpmnViewer from 'bpmn-js/lib/Viewer'
79 import { getusername } from "@/api/getusername.js";
79 import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas' 80 import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas'
80 export default { 81 export default {
81 props: { 82 props: {
...@@ -96,6 +97,7 @@ ...@@ -96,6 +97,7 @@
96 // 当前任务id 97 // 当前任务id
97 selectTaskId: undefined, 98 selectTaskId: undefined,
98 // 任务节点审批记录 99 // 任务节点审批记录
100 taskList:[],
99 taskCommentList: [], 101 taskCommentList: [],
100 // 已完成任务悬浮延迟Timer 102 // 已完成任务悬浮延迟Timer
101 hoverTimer: null, 103 hoverTimer: null,
...@@ -105,9 +107,13 @@ ...@@ -105,9 +107,13 @@
105 } 107 }
106 }, 108 },
107 created () { 109 created () {
110
108 this.$nextTick(() => { 111 this.$nextTick(() => {
112 // 获取流程记录
113 this.getCommentList()
114 this.setProcessStatus(this.formData.finishedInfo);
109 this.importXML(this.formData.xml) 115 this.importXML(this.formData.xml)
110 this.setProcessStatus(this.formData.finishedInfo); 116
111 }) 117 })
112 }, 118 },
113 destroyed () { 119 destroyed () {
...@@ -170,20 +176,20 @@ ...@@ -170,20 +176,20 @@
170 this.selectValue = element.id 176 this.selectValue = element.id
171 this.dlgTitle = element.businessObject ? element.businessObject.name : undefined 177 this.dlgTitle = element.businessObject ? element.businessObject.name : undefined
172 // 计算当前悬浮任务审批记录,如果记录为空不显示弹窗 178 // 计算当前悬浮任务审批记录,如果记录为空不显示弹窗
173 this.taskCommentList = (this.formData.allCommentList || []).filter(item => { 179 this.taskCommentList = (this.taskList || []).filter(item => {
174 return item.taskDefKey === this.selectTaskId 180 return item.taskDefKey === this.selectTaskId
175 }) 181 })
176 if (this.selectTaskId.length > 3) { 182 if (this.selectTaskId.length > 3) {
177 this.taskCommentList = this.formData.allCommentList; 183 this.taskCommentList = this.taskList;
178 } 184 }
179 }, 185 },
180 // 下拉列表切换 186 // 下拉列表切换
181 handleSelect (val) { 187 handleSelect (val) {
182 this.taskCommentList = (this.formData.allCommentList || []).filter(item => { 188 this.taskCommentList = (this.taskList || []).filter(item => {
183 return item.taskDefKey === val 189 return item.taskDefKey === val
184 }) 190 })
185 if (val.length > 3) { 191 if (val.length > 3) {
186 this.taskCommentList = this.formData.allCommentList; 192 this.taskCommentList = this.taskList;
187 } 193 }
188 }, 194 },
189 // 显示流程图 195 // 显示流程图
...@@ -230,9 +236,39 @@ ...@@ -230,9 +236,39 @@
230 } 236 }
231 } 237 }
232 }, 238 },
239 // 获取流程记录
240 getCommentList() {
241 this.formData.allCommentList.forEach(async (item,index) => {
242 var arr=item.assigneeName.split(",");
243 // 获取用户名
244 let res = await getusername(arr)
245 if(res){
246 let str=""
247 res.data.content.forEach((el,i) => {
248 if(str==""){
249 str=el.name;
250 }else{
251 str += ","+el.name;
252
253 }
254 this.formData.allCommentList[index].agent=str
255 })
256 }
257
258 })
259 setTimeout(() => {
260 this.taskList =this.formData.allCommentList;
261 // 处理数据之后赋值
262 this.taskCommentList=this.taskList
263 }, 100)
264 // this.$nextTick(() => {
265 // this.taskList =this.formData.allCommentList;
266 // this.taskCommentList=this.taskList
267 // })
268 },
269
233 // 设置流程图元素状态 270 // 设置流程图元素状态
234 setProcessStatus (processNodeInfo) { 271 setProcessStatus (processNodeInfo) {
235 this.taskCommentList = this.formData.allCommentList;
236 this.processNodeInfo = processNodeInfo 272 this.processNodeInfo = processNodeInfo
237 if (this.isLoading || this.processNodeInfo == null || this.bpmnViewer == null) return 273 if (this.isLoading || this.processNodeInfo == null || this.bpmnViewer == null) return
238 const { finishedTaskSet, rejectedTaskSet, unfinishedTaskSet, finishedSequenceFlowSet } = this.processNodeInfo 274 const { finishedTaskSet, rejectedTaskSet, unfinishedTaskSet, finishedSequenceFlowSet } = this.processNodeInfo
...@@ -268,6 +304,7 @@ ...@@ -268,6 +304,7 @@
268 } 304 }
269 }) 305 })
270 } 306 }
307
271 } 308 }
272 } 309 }
273 } 310 }
......