b27c9ed7 by xiaomiao

--no commit message

1 parent 1a57a7e8
...@@ -147,7 +147,8 @@ ...@@ -147,7 +147,8 @@
147 if (this.supplementarylist.length) { 147 if (this.supplementarylist.length) {
148 this.unitClick(0) 148 this.unitClick(0)
149 } else { 149 } else {
150 this.$emit("getCurrentSelectProps", this.currentSelectProps); 150 this.loadBdcdylist()
151 // this.$emit("getCurrentSelectProps", this.currentSelectProps);
151 } 152 }
152 }); 153 });
153 }, 154 },
...@@ -179,7 +180,6 @@ ...@@ -179,7 +180,6 @@
179 }); 180 });
180 this.$nextTick(() => { 181 this.$nextTick(() => {
181 this.getleftMenubl(); 182 this.getleftMenubl();
182 this.blxxClick()
183 if (!this.supplementarylist.length) { 183 if (!this.supplementarylist.length) {
184 getdjblist() 184 getdjblist()
185 } 185 }
...@@ -285,5 +285,8 @@ ...@@ -285,5 +285,8 @@
285 height: 27px; 285 height: 27px;
286 float: left; 286 float: left;
287 } 287 }
288 .el-icon-delete:hover{
289 color: #0079fe;
290 }
288 } 291 }
289 </style> 292 </style>
......
...@@ -6,44 +6,123 @@ ...@@ -6,44 +6,123 @@
6 <template> 6 <template>
7 <div> 7 <div>
8 <div class="process-viewer"> 8 <div class="process-viewer">
9 <div v-show="!isLoading" ref="processCanvas" class="process-canvas" style="height: 280px;" /> 9 <div
10 v-show="!isLoading"
11 ref="processCanvas"
12 class="process-canvas"
13 style="height: 280px"
14 />
10 <!-- 自定义箭头样式,用于成功状态下流程连线箭头 --> 15 <!-- 自定义箭头样式,用于成功状态下流程连线箭头 -->
11 <defs ref="customSuccessDefs"> 16 <defs ref="customSuccessDefs">
12 <marker id="sequenceflow-end-white-success" view-box="0 0 20 20" ref-x="11" ref-y="10" marker-width="10" 17 <marker
13 marker-height="10" orient="auto"> 18 id="sequenceflow-end-white-success"
14 <path class="success-arrow" d="M 1 5 L 11 10 L 1 15 Z" 19 view-box="0 0 20 20"
15 style="stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1;" /> 20 ref-x="11"
21 ref-y="10"
22 marker-width="10"
23 marker-height="10"
24 orient="auto"
25 >
26 <path
27 class="success-arrow"
28 d="M 1 5 L 11 10 L 1 15 Z"
29 style="
30 stroke-width: 1px;
31 stroke-linecap: round;
32 stroke-dasharray: 10000, 1;
33 "
34 />
16 </marker> 35 </marker>
17 <marker id="conditional-flow-marker-white-success" view-box="0 0 20 20" ref-x="-1" ref-y="10" marker-width="10" 36 <marker
18 marker-height="10" orient="auto"> 37 id="conditional-flow-marker-white-success"
19 <path class="success-conditional" d="M 0 10 L 8 6 L 16 10 L 8 14 Z" 38 view-box="0 0 20 20"
20 style="stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1;" /> 39 ref-x="-1"
40 ref-y="10"
41 marker-width="10"
42 marker-height="10"
43 orient="auto"
44 >
45 <path
46 class="success-conditional"
47 d="M 0 10 L 8 6 L 16 10 L 8 14 Z"
48 style="
49 stroke-width: 1px;
50 stroke-linecap: round;
51 stroke-dasharray: 10000, 1;
52 "
53 />
21 </marker> 54 </marker>
22 </defs> 55 </defs>
23 <!-- 自定义箭头样式,用于失败状态下流程连线箭头 --> 56 <!-- 自定义箭头样式,用于失败状态下流程连线箭头 -->
24 <defs ref="customFailDefs"> 57 <defs ref="customFailDefs">
25 <marker id="sequenceflow-end-white-fail" view-box="0 0 20 20" ref-x="11" ref-y="10" marker-width="10" 58 <marker
26 marker-height="10" orient="auto"> 59 id="sequenceflow-end-white-fail"
27 <path class="fail-arrow" d="M 1 5 L 11 10 L 1 15 Z" 60 view-box="0 0 20 20"
28 style="stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1;" /> 61 ref-x="11"
62 ref-y="10"
63 marker-width="10"
64 marker-height="10"
65 orient="auto"
66 >
67 <path
68 class="fail-arrow"
69 d="M 1 5 L 11 10 L 1 15 Z"
70 style="
71 stroke-width: 1px;
72 stroke-linecap: round;
73 stroke-dasharray: 10000, 1;
74 "
75 />
29 </marker> 76 </marker>
30 <marker id="conditional-flow-marker-white-fail" view-box="0 0 20 20" ref-x="-1" ref-y="10" marker-width="10" 77 <marker
31 marker-height="10" orient="auto"> 78 id="conditional-flow-marker-white-fail"
32 <path class="fail-conditional" d="M 0 10 L 8 6 L 16 10 L 8 14 Z" 79 view-box="0 0 20 20"
33 style="stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1;" /> 80 ref-x="-1"
81 ref-y="10"
82 marker-width="10"
83 marker-height="10"
84 orient="auto"
85 >
86 <path
87 class="fail-conditional"
88 d="M 0 10 L 8 6 L 16 10 L 8 14 Z"
89 style="
90 stroke-width: 1px;
91 stroke-linecap: round;
92 stroke-dasharray: 10000, 1;
93 "
94 />
34 </marker> 95 </marker>
35 </defs> 96 </defs>
36 97
37 <div style="position: absolute; top: 0px; left: 0px; width: 100%;"> 98 <div style="position: absolute; top: 0px; left: 0px; width: 100%">
38 <el-row type="flex" justify="end"> 99 <el-row type="flex" justify="end">
39 <el-button-group key="scale-control" size="medium"> 100 <el-button-group key="scale-control" size="medium">
40 <el-button size="medium" type="default" :plain="true" :disabled="defaultZoom <= 0.3" icon="el-icon-zoom-out" 101 <el-button
41 @click="processZoomOut()" /> 102 size="medium"
42 <el-button size="medium" type="default" style="width: 90px;">{{ Math.floor(this.defaultZoom * 10 * 10) + "%" 103 type="default"
104 :plain="true"
105 :disabled="defaultZoom <= 0.3"
106 icon="el-icon-zoom-out"
107 @click="processZoomOut()"
108 />
109 <el-button size="medium" type="default" style="width: 90px">{{
110 Math.floor(this.defaultZoom * 10 * 10) + "%"
43 }}</el-button> 111 }}</el-button>
44 <el-button size="medium" type="default" :plain="true" :disabled="defaultZoom >= 3.9" icon="el-icon-zoom-in" 112 <el-button
45 @click="processZoomIn()" /> 113 size="medium"
46 <el-button size="medium" type="default" icon="el-icon-c-scale-to-original" @click="processReZoom()" /> 114 type="default"
115 :plain="true"
116 :disabled="defaultZoom >= 3.9"
117 icon="el-icon-zoom-in"
118 @click="processZoomIn()"
119 />
120 <el-button
121 size="medium"
122 type="default"
123 icon="el-icon-c-scale-to-original"
124 @click="processReZoom()"
125 />
47 <slot /> 126 <slot />
48 </el-button-group> 127 </el-button-group>
49 </el-row> 128 </el-row>
...@@ -52,285 +131,396 @@ ...@@ -52,285 +131,396 @@
52 <!-- 已完成节点悬浮弹窗 --> 131 <!-- 已完成节点悬浮弹窗 -->
53 <div class="information-list"> 132 <div class="information-list">
54 <el-select v-model="selectValue" @change="handleSelect"> 133 <el-select v-model="selectValue" @change="handleSelect">
55 <el-option v-for="item in selectOptions" :key="item.value" :label="item.label" :value="item.value"> 134 <el-option
135 v-for="item in selectOptions"
136 :key="item.value"
137 :label="item.label"
138 :value="item.value"
139 >
56 </el-option> 140 </el-option>
57 </el-select> 141 </el-select>
58 <el-table height="190" :data="taskCommentList" size="mini" border header-cell-class-name="table-header-gray"> 142 <el-table
59 <el-table-column label="序号" header-align="center" align="center" type="index" width="55px" /> 143 height="190"
144 :data="taskCommentList"
145 size="mini"
146 border
147 header-cell-class-name="table-header-gray"
148 >
149 <el-table-column
150 label="序号"
151 header-align="center"
152 align="center"
153 type="index"
154 width="55px"
155 />
60 <el-table-column label="流程状态" header-align="center" align="center"> 156 <el-table-column label="流程状态" header-align="center" align="center">
61 <template slot-scope="scope"> 157 <template slot-scope="scope">
62 <div v-if="scope.row.endTime">已完结</div> 158 <div v-if="scope.row.endTime">已完结</div>
63 <div v-else>正在办理</div> 159 <div v-else>正在办理</div>
64 </template> 160 </template>
65 </el-table-column> 161 </el-table-column>
66 <el-table-column label="环节名称" prop="name" minWidth="100" align="center" /> 162 <el-table-column
67 <el-table-column label="办理人" prop="agent" minWidth="120" align="center" /> 163 label="环节名称"
68 <el-table-column label="转入时间" prop="createTime" :formatter="formatDate" width="160" align="center" /> 164 prop="name"
69 <el-table-column label="认领时间" prop="claimTime" :formatter="formatDate" width="160" align="center" /> 165 minWidth="100"
70 <el-table-column label="转出时间" prop="endTime" :formatter="formatDate" width="160" align="center" /> 166 align="center"
71 <el-table-column label="操作方式" prop="controls" align="center"/> 167 />
72 <el-table-column label="意见" prop="idea" align="center"/> 168 <el-table-column
169 label="办理人"
170 prop="agent"
171 minWidth="120"
172 align="center"
173 />
174 <el-table-column
175 label="转入时间"
176 prop="createTime"
177 :formatter="formatDate"
178 width="160"
179 align="center"
180 />
181 <el-table-column
182 label="认领时间"
183 prop="claimTime"
184 :formatter="formatDate"
185 width="160"
186 align="center"
187 />
188 <el-table-column
189 label="转出时间"
190 prop="endTime"
191 :formatter="formatDate"
192 width="160"
193 align="center"
194 />
195 <el-table-column label="操作方式" prop="controls" align="center" />
196 <el-table-column label="意见" prop="idea" align="center" />
73 </el-table> 197 </el-table>
74 </div> 198 </div>
75 </div> 199 </div>
76 </template> 200 </template>
77 <script> 201 <script>
78 import '@/styles/package/theme/index.scss' 202 import "@/styles/package/theme/index.scss";
79 import BpmnViewer from 'bpmn-js/lib/Viewer' 203 import BpmnViewer from "bpmn-js/lib/Viewer";
80 import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas' 204 import MoveCanvasModule from "diagram-js/lib/navigation/movecanvas";
81 export default { 205 export default {
82 props: { 206 props: {
83 formData: { 207 formData: {
84 type: Object, 208 type: Object,
85 default: {} 209 default: {},
210 },
211 },
212 data() {
213 return {
214 dlgTitle: undefined,
215 defaultZoom: 1,
216 // 是否正在加载流程图
217 isLoading: true,
218 bpmnViewer: undefined,
219 // 已完成流程元素
220 processNodeInfo: undefined,
221 // 当前任务id
222 selectTaskId: undefined,
223 // 任务节点审批记录
224 taskList: [],
225 taskCommentList: [],
226 // 已完成任务悬浮延迟Timer
227 hoverTimer: null,
228 // 下拉
229 selectValue: "",
230 selectOptions: [],
231 };
232 },
233 created() {
234 this.$nextTick(() => {
235 // 获取流程记录
236 this.getCommentList();
237 this.setProcessStatus(this.formData.finishedInfo);
238 this.importXML(this.formData.xml);
239 });
240 },
241 destroyed() {
242 this.clearViewer();
243 },
244 methods: {
245 formatDate(row, column) {
246 let data = row[column.property];
247 if (data == null) {
248 return null;
86 } 249 }
250 let dt = new Date(data);
251 return (
252 dt.getFullYear() +
253 "-" +
254 (dt.getMonth() + 1) +
255 "-" +
256 dt.getDate() +
257 " " +
258 dt.getHours() +
259 ":" +
260 dt.getMinutes() +
261 ":" +
262 dt.getSeconds()
263 );
264 },
265 processReZoom() {
266 this.defaultZoom = 1;
267 this.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
87 }, 268 },
88 data () { 269 processZoomIn(zoomStep = 0.1) {
89 return { 270 const newZoom = Math.floor(this.defaultZoom * 100 + zoomStep * 100) / 100;
90 dlgTitle: undefined, 271 if (newZoom > 4) {
91 defaultZoom: 1, 272 throw new Error(
92 // 是否正在加载流程图 273 "[Process Designer Warn ]: The zoom ratio cannot be greater than 4"
93 isLoading: true, 274 );
94 bpmnViewer: undefined,
95 // 已完成流程元素
96 processNodeInfo: undefined,
97 // 当前任务id
98 selectTaskId: undefined,
99 // 任务节点审批记录
100 taskList:[],
101 taskCommentList: [],
102 // 已完成任务悬浮延迟Timer
103 hoverTimer: null,
104 // 下拉
105 selectValue: '',
106 selectOptions: []
107 } 275 }
276 this.defaultZoom = newZoom;
277 this.bpmnViewer.get("canvas").zoom(this.defaultZoom);
108 }, 278 },
109 created () { 279 processZoomOut(zoomStep = 0.1) {
110 this.$nextTick(() => { 280 const newZoom = Math.floor(this.defaultZoom * 100 - zoomStep * 100) / 100;
111 // 获取流程记录 281 if (newZoom < 0.2) {
112 this.getCommentList() 282 throw new Error(
113 this.setProcessStatus(this.formData.finishedInfo); 283 "[Process Designer Warn ]: The zoom ratio cannot be scss than 0.2"
114 this.importXML(this.formData.xml) 284 );
115 285 }
116 }) 286 this.defaultZoom = newZoom;
287 this.bpmnViewer.get("canvas").zoom(this.defaultZoom);
117 }, 288 },
118 destroyed () { 289 getOperationTagType(type) {
119 this.clearViewer() 290 return "success";
120 }, 291 },
121 methods: { 292 // 流程图预览清空
122 formatDate(row, column) { 293 clearViewer(a) {
123 let data = row[column.property] 294 if (this.$refs.processCanvas) {
124 if(data == null) { 295 this.$refs.processCanvas.innerHTML = "";
125 return null 296 }
126 } 297 if (this.bpmnViewer) {
127 let dt = new Date(data) 298 this.bpmnViewer.destroy();
128 return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' ' + dt.getHours() + ':' + dt.getMinutes() + ':' + dt.getSeconds() 299 }
129 }, 300 this.bpmnViewer = null;
130 processReZoom () { 301 },
131 this.defaultZoom = 1 302 // 添加自定义箭头
132 this.bpmnViewer.get('canvas').zoom('fit-viewport', 'auto') 303 addCustomDefs() {
133 }, 304 const canvas = this.bpmnViewer.get("canvas");
134 processZoomIn (zoomStep = 0.1) { 305 const svg = canvas._svg;
135 const newZoom = Math.floor(this.defaultZoom * 100 + zoomStep * 100) / 100 306 const customSuccessDefs = this.$refs.customSuccessDefs;
136 if (newZoom > 4) { 307 const customFailDefs = this.$refs.customFailDefs;
137 throw new Error('[Process Designer Warn ]: The zoom ratio cannot be greater than 4') 308 svg.appendChild(customSuccessDefs);
138 } 309 svg.appendChild(customFailDefs);
139 this.defaultZoom = newZoom 310 },
140 this.bpmnViewer.get('canvas').zoom(this.defaultZoom) 311 // 任务悬浮弹窗
141 }, 312 onSelectElement(element) {
142 processZoomOut (zoomStep = 0.1) { 313 this.selectTaskId = undefined;
143 const newZoom = Math.floor(this.defaultZoom * 100 - zoomStep * 100) / 100 314 this.dlgTitle = undefined;
144 if (newZoom < 0.2) { 315 let allfinishedTaskSet = [
145 throw new Error('[Process Designer Warn ]: The zoom ratio cannot be scss than 0.2') 316 ...this.processNodeInfo.finishedTaskSet,
146 } 317 ...this.processNodeInfo.unfinishedTaskSet,
147 this.defaultZoom = newZoom 318 ];
148 this.bpmnViewer.get('canvas').zoom(this.defaultZoom) 319 if (this.processNodeInfo == null || allfinishedTaskSet == null) return;
149 }, 320 if (element == null || allfinishedTaskSet.indexOf(element.id) === -1) {
150 getOperationTagType (type) { 321 return;
151 return 'success' 322 }
152 }, 323 this.selectTaskId = element.id;
153 // 流程图预览清空 324 this.selectValue = element.id;
154 clearViewer (a) { 325 this.dlgTitle = element.businessObject
155 if (this.$refs.processCanvas) { 326 ? element.businessObject.name
156 this.$refs.processCanvas.innerHTML = '' 327 : undefined;
157 } 328 // 计算当前悬浮任务审批记录,如果记录为空不显示弹窗
158 if (this.bpmnViewer) { 329 this.taskCommentList = (this.taskList || []).filter((item) => {
159 this.bpmnViewer.destroy() 330 return item.taskDefinitionKey === this.selectTaskId;
160 } 331 });
161 this.bpmnViewer = null 332 if (this.taskCommentList.length == 0) {
162 }, 333 this.taskCommentList = this.taskList;
163 // 添加自定义箭头 334 }
164 addCustomDefs () { 335 },
165 const canvas = this.bpmnViewer.get('canvas') 336 // 下拉列表切换
166 const svg = canvas._svg 337 handleSelect(val) {
167 const customSuccessDefs = this.$refs.customSuccessDefs 338 this.taskCommentList = (this.taskList || []).filter((item) => {
168 const customFailDefs = this.$refs.customFailDefs 339 return item.taskDefinitionKey === val;
169 svg.appendChild(customSuccessDefs) 340 });
170 svg.appendChild(customFailDefs) 341 if (this.taskCommentList.length == 0) {
171 }, 342 this.taskCommentList = this.taskList;
172 // 任务悬浮弹窗 343 }
173 onSelectElement (element) { 344 },
174 this.selectTaskId = undefined 345 // 显示流程图
175 this.dlgTitle = undefined 346 async importXML(xml) {
176 let allfinishedTaskSet = [...this.processNodeInfo.finishedTaskSet, ...this.processNodeInfo.unfinishedTaskSet] 347 let xmlData = this.$x2js.xml2js(xml).definitions.process;
177 if (this.processNodeInfo == null || allfinishedTaskSet == null) 348 this.selectOptions = xmlData.userTask.map((item) => {
178 return 349 return { value: item._id, label: item._name };
179 if (element == null || allfinishedTaskSet.indexOf(element.id) === -1) { 350 });
180 return 351 this.selectOptions = [
181 } 352 { value: xmlData.startEvent._id, label: "浏览记录" },
182 this.selectTaskId = element.id 353 ...this.selectOptions,
183 this.selectValue = element.id 354 ];
184 this.dlgTitle = element.businessObject ? element.businessObject.name : undefined 355 this.selectOptions = this.selectOptions
185 // 计算当前悬浮任务审批记录,如果记录为空不显示弹窗 356 .map((item) => {
186 this.taskCommentList = (this.taskList || []).filter(item => {
187 return item.taskDefinitionKey === this.selectTaskId
188 })
189 if (this.taskCommentList.length==0) {
190 this.taskCommentList = this.taskList;
191 }
192 },
193 // 下拉列表切换
194 handleSelect (val) {
195 this.taskCommentList = (this.taskList || []).filter(item => {
196 return item.taskDefinitionKey === val
197 })
198 if (this.taskCommentList.length==0) {
199 this.taskCommentList = this.taskList;
200 }
201 },
202 // 显示流程图
203 async importXML (xml) {
204 let xmlData = this.$x2js.xml2js(xml).definitions.process;
205 this.selectOptions = xmlData.userTask.map(item => {
206 return { value: item._id, label: item._name }
207 })
208 this.selectOptions = [{ value: xmlData.startEvent._id, label: '浏览记录' }, ...this.selectOptions]
209 this.selectOptions = this.selectOptions.map(item => {
210 if (this.formData.finishedInfo.finishedTaskSet.includes(item.value)) { 357 if (this.formData.finishedInfo.finishedTaskSet.includes(item.value)) {
211 return item 358 return item;
212 } 359 }
213 if (this.formData.finishedInfo.unfinishedTaskSet.includes(item.value)) { 360 if (
214 return item 361 this.formData.finishedInfo.unfinishedTaskSet.includes(item.value)
362 ) {
363 return item;
215 } 364 }
216 }).filter(Boolean);
217 this.selectValue = xmlData.startEvent._id
218 this.clearViewer('a')
219 if (xml != null && xml !== '') {
220 try {
221 this.bpmnViewer = new BpmnViewer({
222 additionalModules: [
223 // 移动整个画布
224 MoveCanvasModule
225 ],
226 container: this.$refs.processCanvas
227 })
228 // 任务节点悬浮事件
229 this.bpmnViewer.on('element.click', ({ element }) => {
230 this.onSelectElement(element)
231 })
232 await this.bpmnViewer.importXML(xml)
233 this.isLoading = true
234 this.addCustomDefs()
235 } catch (e) {
236 this.clearViewer('b')
237 } finally {
238 this.isLoading = false
239 this.setProcessStatus(this.processNodeInfo)
240 this.$nextTick(() => {
241 this.processReZoom()
242 })
243 }
244 }
245 },
246 // 获取流程记录
247 getCommentList() {
248 this.formData.allCommentList.forEach(async (item,index) => {
249 item.comments.forEach(element => {
250 if(element.type=="COMPLETE"){
251 this.formData.allCommentList[index].idea=element.message
252 this.formData.allCommentList[index].controls="完成"
253 }
254 });
255 this.formData.allCommentList[index].agent=item.assignee.name
256 })
257 this.formData.handlinglist.forEach(async (item,index) => {
258 if(item.assignee.name){
259 this.formData.handlinglist[index].agent=item.assignee.name
260 }else{
261 let str=""
262 item.countersign.forEach((item) => {
263 str+=item.name+","
264 })
265 str=str.slice(0, -1);
266 this.formData.allCommentList[index].agent=str
267 }
268
269 }) 365 })
270 this.taskList =[...this.formData.allCommentList,...this.formData.handlinglist]; 366 .filter(Boolean);
271 // this.taskList =this.formData.allCommentList; 367 this.selectValue = xmlData.startEvent._id;
272 // 处理数据之后赋值 368 this.clearViewer("a");
273 this.taskCommentList=this.taskList 369 if (xml != null && xml !== "") {
274 370 try {
275 }, 371 this.bpmnViewer = new BpmnViewer({
276 372 additionalModules: [
277 // 设置流程图元素状态 373 // 移动整个画布
278 setProcessStatus (processNodeInfo) { 374 MoveCanvasModule,
279 this.processNodeInfo = processNodeInfo 375 ],
280 if (this.isLoading || this.processNodeInfo == null || this.bpmnViewer == null) return 376 container: this.$refs.processCanvas,
281 const { finishedTaskSet, rejectedTaskSet, unfinishedTaskSet, finishedSequenceFlowSet } = this.processNodeInfo 377 });
282 const canvas = this.bpmnViewer.get('canvas') 378 // 任务节点悬浮事件
283 const elementRegistry = this.bpmnViewer.get('elementRegistry') 379 this.bpmnViewer.on("element.click", ({ element }) => {
284 if (Array.isArray(finishedSequenceFlowSet)) { 380 this.onSelectElement(element);
285 finishedSequenceFlowSet.forEach(item => { 381 });
286 if (item != null) { 382 await this.bpmnViewer.importXML(xml);
287 canvas.addMarker(item, 'success') 383 this.isLoading = true;
288 const element = elementRegistry.get(item) 384 this.addCustomDefs();
289 const conditionExpression = element.businessObject.conditionExpression 385 } catch (e) {
290 if (conditionExpression) { 386 this.clearViewer("b");
291 canvas.addMarker(item, 'condition-expression') 387 } finally {
292 } 388 this.isLoading = false;
293 } 389 this.setProcessStatus(this.processNodeInfo);
294 }) 390 this.$nextTick(() => {
295 } 391 this.processReZoom();
296 if (Array.isArray(finishedTaskSet)) { 392 });
297 finishedTaskSet.forEach(item => canvas.addMarker(item, 'success'))
298 } 393 }
299 if (Array.isArray(unfinishedTaskSet)) { 394 }
300 unfinishedTaskSet.forEach(item => canvas.addMarker(item, 'primary')) 395 },
396 // 获取流程记录
397 getCommentList() {
398 this.formData.allCommentList.forEach(async (item, index) => {
399 // item.comments.forEach(element => {
400 // if(element.type=="COMPLETE"){
401 // this.formData.allCommentList[index].idea=element.message
402 // this.formData.allCommentList[index].controls="完成"
403 // }
404 // });
405 let type = item.comments[item.comments.length - 1].type;
406 this.formData.allCommentList[index].idea =
407 item.comments[item.comments.length - 1].message;
408 // 操作方式
409 let controls = "";
410 switch (type) {
411 case "COMPLETE":
412 controls = "完成";
413 break;
414 case "CLAIM":
415 controls = "完成";
416 break;
417 case "ASSIGN":
418 controls = "转办";
419 break;
420 case "DELEGATE":
421 controls = "委派";
422 break;
423 case "UNCLAIM":
424 controls = "取消认领";
425 break;
426 case "STOP":
427 controls = "终止";
428 break;
429 case "BACK":
430 controls = "退回";
431 break;
301 } 432 }
302 if (Array.isArray(rejectedTaskSet)) { 433 this.formData.allCommentList[index].controls = controls;
303 rejectedTaskSet.forEach(item => { 434 this.formData.allCommentList[index].agent = item.assignee.name;
304 if (item != null) { 435 });
305 const element = elementRegistry.get(item) 436 this.formData.handlinglist.forEach(async (item, index) => {
306 if (element.type.includes('Task')) { 437 if (item.assignee.name) {
307 canvas.addMarker(item, 'danger') 438 this.formData.handlinglist[index].agent = item.assignee.name;
308 } else { 439 } else {
309 canvas.addMarker(item, 'warning') 440 let str = "";
310 } 441 item.countersign.forEach((item) => {
311 } 442 str += item.name + ",";
312 }) 443 });
444 str = str.slice(0, -1);
445 this.formData.allCommentList[index].agent = str;
313 } 446 }
447 });
448 this.taskList = [
449 ...this.formData.allCommentList,
450 ...this.formData.handlinglist,
451 ];
452 // this.taskList =this.formData.allCommentList;
453 // 处理数据之后赋值
454 this.taskCommentList = this.taskList;
455 },
314 456
457 // 设置流程图元素状态
458 setProcessStatus(processNodeInfo) {
459 this.processNodeInfo = processNodeInfo;
460 if (
461 this.isLoading ||
462 this.processNodeInfo == null ||
463 this.bpmnViewer == null
464 )
465 return;
466 const {
467 finishedTaskSet,
468 rejectedTaskSet,
469 unfinishedTaskSet,
470 finishedSequenceFlowSet,
471 } = this.processNodeInfo;
472 const canvas = this.bpmnViewer.get("canvas");
473 const elementRegistry = this.bpmnViewer.get("elementRegistry");
474 if (Array.isArray(finishedSequenceFlowSet)) {
475 finishedSequenceFlowSet.forEach((item) => {
476 if (item != null) {
477 canvas.addMarker(item, "success");
478 const element = elementRegistry.get(item);
479 const conditionExpression =
480 element.businessObject.conditionExpression;
481 if (conditionExpression) {
482 canvas.addMarker(item, "condition-expression");
483 }
484 }
485 });
315 } 486 }
316 } 487 if (Array.isArray(finishedTaskSet)) {
317 } 488 finishedTaskSet.forEach((item) => canvas.addMarker(item, "success"));
489 }
490 if (Array.isArray(unfinishedTaskSet)) {
491 unfinishedTaskSet.forEach((item) => canvas.addMarker(item, "primary"));
492 }
493 if (Array.isArray(rejectedTaskSet)) {
494 rejectedTaskSet.forEach((item) => {
495 if (item != null) {
496 const element = elementRegistry.get(item);
497 if (element.type.includes("Task")) {
498 canvas.addMarker(item, "danger");
499 } else {
500 canvas.addMarker(item, "warning");
501 }
502 }
503 });
504 }
505 },
506 },
507 };
318 </script> 508 </script>
319 <style scoped lang="scss"> 509 <style scoped lang="scss">
320 .information-list { 510 .information-list {
321 height: 220px; 511 height: 220px;
322 margin-top: 10px; 512 margin-top: 10px;
323 513
324 p { 514 p {
325 font-size: 16px; 515 font-size: 16px;
326 line-height: 24px; 516 line-height: 24px;
327 }
328 }
329 /deep/.bjs-powered-by {
330 display: none;
331 } 517 }
332 // /deep/.information-list { 518 }
333 // height: 170px; 519 /deep/.bjs-powered-by {
334 // overflow: visible; 520 display: none;
335 // } 521 }
522 // /deep/.information-list {
523 // height: 170px;
524 // overflow: visible;
525 // }
336 </style> 526 </style>
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
201 </el-col> 201 </el-col>
202 </el-row> 202 </el-row>
203 </div> 203 </div>
204 <el-row class="btn" v-if="!ableOperation"> 204 <el-row class="btn" v-if="ableOperation">
205 <el-form-item> 205 <el-form-item>
206 <el-button type="primary" @click="onSubmit">保存</el-button> 206 <el-button type="primary" @click="onSubmit">保存</el-button>
207 </el-form-item> 207 </el-form-item>
......
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
194 </el-col> 194 </el-col>
195 </el-row> 195 </el-row>
196 </div> 196 </div>
197 <el-row class="btn" v-if="!ableOperation"> 197 <el-row class="btn" v-if="ableOperation">
198 <el-form-item> 198 <el-form-item>
199 <el-button type="primary" @click="onSubmit">保存</el-button> 199 <el-button type="primary" @click="onSubmit">保存</el-button>
200 </el-form-item> 200 </el-form-item>
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
145 </el-col> 145 </el-col>
146 </el-row> 146 </el-row>
147 </div> 147 </div>
148 <el-row class="btn" v-if="!ableOperation"> 148 <el-row class="btn" v-if="ableOperation">
149 <el-form-item> 149 <el-form-item>
150 <el-button type="primary" @click="onSubmit">保存</el-button> 150 <el-button type="primary" @click="onSubmit">保存</el-button>
151 </el-form-item> 151 </el-form-item>
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
177 </el-col> 177 </el-col>
178 </el-row> 178 </el-row>
179 </div> 179 </div>
180 <el-row class="btn" v-if="!ableOperation"> 180 <el-row class="btn" v-if="ableOperation">
181 <el-form-item> 181 <el-form-item>
182 <el-button type="primary" @click="onSubmit">保存</el-button> 182 <el-button type="primary" @click="onSubmit">保存</el-button>
183 </el-form-item> 183 </el-form-item>
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
103 </el-form-item> 103 </el-form-item>
104 </el-col> 104 </el-col>
105 </el-row> 105 </el-row>
106 <el-row :gutter="10"> 106 <!-- <el-row :gutter="10">
107 <el-col :span="8"> 107 <el-col :span="8">
108 <el-form-item label="使用期限:"> 108 <el-form-item label="使用期限:">
109 <el-input v-model="ruleForm.jsydsyq.tdsyqx"></el-input> 109 <el-input v-model="ruleForm.jsydsyq.tdsyqx"></el-input>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
115 <el-input v-model="ruleForm.jsydsyq.syqqzsj"></el-input> 115 <el-input v-model="ruleForm.jsydsyq.syqqzsj"></el-input>
116 </el-form-item> 116 </el-form-item>
117 </el-col> 117 </el-col>
118 </el-row> 118 </el-row> -->
119 <el-row :gutter="10"> 119 <el-row :gutter="10">
120 <el-col> 120 <el-col>
121 <el-form-item label="附记:" prop="fj"> 121 <el-form-item label="附记:" prop="fj">
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
189 </el-col> 189 </el-col>
190 </el-row> 190 </el-row>
191 </div> 191 </div>
192 <el-row class="btn" v-if="!ableOperation"> 192 <el-row class="btn" v-if="ableOperation">
193 <el-form-item> 193 <el-form-item>
194 <el-button type="primary" @click="onSubmit">保存</el-button> 194 <el-button type="primary" @click="onSubmit">保存</el-button>
195 </el-form-item> 195 </el-form-item>
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
105 </el-form-item> 105 </el-form-item>
106 </el-col> 106 </el-col>
107 </el-row> 107 </el-row>
108 <el-row :gutter="10"> 108 <!-- <el-row :gutter="10">
109 <el-col :span="8"> 109 <el-col :span="8">
110 <el-form-item label="使用期限:"> 110 <el-form-item label="使用期限:">
111 <el-input disabled v-model="ruleForm.jsydsyq.tdsyqx"></el-input> 111 <el-input disabled v-model="ruleForm.jsydsyq.tdsyqx"></el-input>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
117 <el-input disabled v-model="ruleForm.jsydsyq.syqqzsj"></el-input> 117 <el-input disabled v-model="ruleForm.jsydsyq.syqqzsj"></el-input>
118 </el-form-item> 118 </el-form-item>
119 </el-col> 119 </el-col>
120 </el-row> 120 </el-row> -->
121 <el-row :gutter="10"> 121 <el-row :gutter="10">
122 <el-col> 122 <el-col>
123 <el-form-item label="附记:" prop="fj"> 123 <el-form-item label="附记:" prop="fj">
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
183 </el-col> 183 </el-col>
184 </el-row> 184 </el-row>
185 </div> 185 </div>
186 <el-row class="btn" v-if="!ableOperation"> 186 <el-row class="btn" v-if="ableOperation">
187 <el-form-item> 187 <el-form-item>
188 <el-button type="primary" @click="onSubmit">保存</el-button> 188 <el-button type="primary" @click="onSubmit">保存</el-button>
189 </el-form-item> 189 </el-form-item>
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
226 </el-col> 226 </el-col>
227 </el-row> 227 </el-row>
228 </div> 228 </div>
229 <el-row class="btn" v-if="!ableOperation"> 229 <el-row class="btn" v-if="ableOperation">
230 <el-form-item> 230 <el-form-item>
231 <el-button type="primary" @click="onSubmit">保存</el-button> 231 <el-button type="primary" @click="onSubmit">保存</el-button>
232 </el-form-item> 232 </el-form-item>
......
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
368 </el-col> 368 </el-col>
369 </el-row> 369 </el-row>
370 </div> 370 </div>
371 <el-row class="btn" v-if="!ableOperation"> 371 <el-row class="btn" v-if="ableOperation">
372 <el-form-item> 372 <el-form-item>
373 <el-button type="primary" @click="onSubmit">保存</el-button> 373 <el-button type="primary" @click="onSubmit">保存</el-button>
374 </el-form-item> 374 </el-form-item>
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
142 </el-col> 142 </el-col>
143 </el-row> 143 </el-row>
144 </div> 144 </div>
145 <el-row class="btn" v-if="!ableOperation"> 145 <el-row class="btn" v-if="ableOperation">
146 <el-form-item> 146 <el-form-item>
147 <el-button type="primary" @click="onSubmit">保存</el-button> 147 <el-button type="primary" @click="onSubmit">保存</el-button>
148 </el-form-item> 148 </el-form-item>
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
145 </el-col> 145 </el-col>
146 </el-row> 146 </el-row>
147 </div> 147 </div>
148 <el-row class="btn" v-if="!ableOperation"> 148 <el-row class="btn" v-if="ableOperation">
149 <el-form-item> 149 <el-form-item>
150 <el-button type="primary" @click="onSubmit">保存</el-button> 150 <el-button type="primary" @click="onSubmit">保存</el-button>
151 </el-form-item> 151 </el-form-item>
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
192 </el-col> 192 </el-col>
193 </el-row> 193 </el-row>
194 </div> 194 </div>
195 <el-row class="btn" v-if="!ableOperation"> 195 <el-row class="btn" v-if="ableOperation">
196 <el-form-item> 196 <el-form-item>
197 <el-button type="primary" @click="onSubmit">保存</el-button> 197 <el-button type="primary" @click="onSubmit">保存</el-button>
198 </el-form-item> 198 </el-form-item>
......
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
196 </el-row> 196 </el-row>
197 197
198 </div> 198 </div>
199 <el-row class="btn" v-if="!ableOperation"> 199 <el-row class="btn" v-if="ableOperation">
200 <el-form-item> 200 <el-form-item>
201 <el-button type="primary" @click="onSubmitClick()">保存</el-button> 201 <el-button type="primary" @click="onSubmitClick()">保存</el-button>
202 </el-form-item> 202 </el-form-item>
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
240 </el-row> 240 </el-row>
241 241
242 </div> 242 </div>
243 <el-row class="btn" v-if="!ableOperation"> 243 <el-row class="btn" v-if="ableOperation">
244 <el-form-item> 244 <el-form-item>
245 <el-button type="primary" @click="onSubmitClick()">保存</el-button> 245 <el-button type="primary" @click="onSubmitClick()">保存</el-button>
246 </el-form-item> 246 </el-form-item>
......