sasp-flow-render 1.1.24-decoupling → 1.1.26-decoupling

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasp-flow-render",
3
- "version": "1.1.24-decoupling",
3
+ "version": "1.1.26-decoupling",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -33,6 +33,9 @@ class WorkflowEngine {
33
33
  }
34
34
  this.$flowDialog = this.$this.$flowDialog;
35
35
  this.flowDefine = {};
36
+ this.flowRecordObj = {};
37
+ this.flowChartObj = {};
38
+ this.draftNodeId = "";
36
39
 
37
40
  // 初始化插入部分方法
38
41
  let methods = flowAttrs["methods"] || {};
@@ -110,6 +113,8 @@ class WorkflowEngine {
110
113
  this.nextSteptUserArr = [];
111
114
 
112
115
  this.newEventObj = {};
116
+ this.newScriptObj = {};
117
+ this.scriptObj = {};
113
118
  this.resourceTabOpts = ['draft','pending','processed','rescinded','finished','discontinue','flowQuery'];
114
119
  //表单按钮
115
120
  this.formButtonObj = {
@@ -368,6 +373,7 @@ class WorkflowEngine {
368
373
  init(){
369
374
  return new Promise(resolve => {
370
375
  if(!this.skipAutoInit && !this.loadSuccess){
376
+ this.initUserData();
371
377
  this.$this.saspFlowAxios.all([
372
378
  this.initFlowInfo(),
373
379
  this.initFlowFormInfo()
@@ -378,7 +384,6 @@ class WorkflowEngine {
378
384
  }else{
379
385
  resolve();
380
386
  }
381
- this.initUserData();
382
387
  this.initDialogProps();
383
388
  })
384
389
  }
@@ -477,6 +482,9 @@ class WorkflowEngine {
477
482
  }
478
483
  if (item.nodeType === "UserTask" && (item.nodeLinkId || "").indexOf("Activity_draft") > -1) {
479
484
  this.draftNodeId = item.id; // 草稿节点id
485
+ this.$flowDialog.fillFlowDialogParams({
486
+ draftNodeId: this.draftNodeId
487
+ });
480
488
  }
481
489
  // 行按钮
482
490
  let listButton = JSON.parse(item.listButton || "[]") || [];
@@ -528,6 +536,7 @@ class WorkflowEngine {
528
536
  flowVersionNodeObjByFlowId : this.flowVersionNodeObjByFlowId,
529
537
  flowEventScriptByFlowId : this.flowEventScriptByFlowId
530
538
  };
539
+ this.$flowDialog.fillFlowDialogParams(result);
531
540
  resolve(result);
532
541
  });
533
542
  });
@@ -590,6 +599,9 @@ class WorkflowEngine {
590
599
  }
591
600
  if(item.nodeType == "UserTask" && (item.nodeLinkId || "").indexOf("Activity_draft") > -1){
592
601
  this.draftNodeId = item.id; // 草稿节点id
602
+ this.$flowDialog.fillFlowDialogParams({
603
+ draftNodeId: this.draftNodeId
604
+ });
593
605
  }
594
606
  // }
595
607
  this.allNodeInfo[item.id] = item;
@@ -655,6 +667,7 @@ class WorkflowEngine {
655
667
  diyButtonsObj : this.diyButtonsObj,
656
668
  };
657
669
  this.initFlowObj();
670
+ this.$flowDialog.fillFlowDialogParams(result);
658
671
  resolve(result);
659
672
  })
660
673
  });
@@ -1354,7 +1367,7 @@ class WorkflowEngine {
1354
1367
  formData = this.getFormInfo();
1355
1368
  }
1356
1369
  let CTX = "";
1357
- let paramValues = [this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode,null]; // 入参
1370
+ let paramValues = [this.$this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode,null]; // 入参
1358
1371
  if(executePosition == "add" || executePosition == "update"){
1359
1372
  ((this.scriptObj[executePosition] || {})[executeTime] || []).forEach(event => {
1360
1373
  event && event(...paramValues); // 执行事件
@@ -1388,7 +1401,7 @@ class WorkflowEngine {
1388
1401
  //执行自定义脚本
1389
1402
  // let CTX = window.JAVA_URL;
1390
1403
  let CTX = "";
1391
- let paramValues = [this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
1404
+ let paramValues = [this.$this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
1392
1405
  if(executeType == "addAfter"){ //新增或后
1393
1406
  (this.newScriptObj[executeType] || []).forEach(event => {
1394
1407
  event && event(...paramValues); // 执行事件
@@ -1497,6 +1510,24 @@ class WorkflowEngine {
1497
1510
  let version = this.flowDefine.releaseVersion;
1498
1511
  currentNode = this.flowVersionNodeObj[version][this.startNodeKeyObj[version]];
1499
1512
  }
1513
+ let result = {
1514
+ draftNodeId: this.draftNodeId,
1515
+ // operateType : this.operateType,
1516
+ // tabActive : this.tabActive,
1517
+ flowDefine : this.flowDefine,
1518
+ startNodeKey : this.startNodeKey,
1519
+ startNodeKeyObj : this.startNodeKeyObj,
1520
+ flowVersionNodeObj : this.flowVersionNodeObj,
1521
+ allNodeInfo : this.allNodeInfo,
1522
+ flowNodeNameObj : this.flowNodeNameObj,
1523
+ flowNodeIdToInfo : this.flowNodeIdToInfo,
1524
+ nodeListButtonObj : this.nodeListButtonObj,
1525
+ nodeFormButtonObj : this.nodeFormButtonObj,
1526
+ nodeFormBtnObj : this.nodeFormBtnObj,
1527
+ // optColumnWidth : this.optColumnWidth,
1528
+ diyButtonsObj : this.diyButtonsObj,
1529
+ };
1530
+ this.$flowDialog.fillFlowDialogParams(result);
1500
1531
  return new Promise(resolve => {
1501
1532
  if(this.initFormInfo){
1502
1533
  let promise = this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData);
@@ -1854,6 +1885,23 @@ class WorkflowEngine {
1854
1885
  flowRecordObj: this.flowRecordObj
1855
1886
  });
1856
1887
  }
1888
+
1889
+ openFlowChart(row) {
1890
+ let flowId = "";
1891
+ let instId = "";
1892
+ let linkProcId = "";
1893
+ let isRelease = "";
1894
+ if (row) {
1895
+ flowId = row.flowId;
1896
+ instId = row.flowInstId;
1897
+ linkProcId = row.linkProcId;
1898
+ isRelease = row.isRelease;
1899
+ }
1900
+ this.flowChartObj = {flowId: flowId,instId: instId,linkProcId:linkProcId,isRelease:isRelease, dialogVisible: true};
1901
+ this.$flowDialog.fillFlowDialogParams({
1902
+ flowChartObj: this.flowChartObj,
1903
+ })
1904
+ }
1857
1905
 
1858
1906
  // end of button methods 按钮方法结束
1859
1907
 
@@ -2115,7 +2163,7 @@ class WorkflowEngine {
2115
2163
  })
2116
2164
  this.userArr = arr;
2117
2165
  this.$this.INTER_CACHE.setUserArr(arr);
2118
- this.$this.userMap = this.$this.INTER_CACHE.getUserMap();
2166
+ this.userMap = this.$this.INTER_CACHE.getUserMap();
2119
2167
  })
2120
2168
  })
2121
2169
  }
@@ -2215,6 +2263,48 @@ class WorkflowEngine {
2215
2263
  openFlowDialog(args){
2216
2264
  this.$flowDialog.openFlowDialog(args);
2217
2265
  }
2266
+
2267
+ openRecordEvent(dataId){ // 采用初始化构造类时传递flowId
2268
+ if(!this.flowId){
2269
+ this.$this.$message.error("请先设置flowId");
2270
+ return;
2271
+ }
2272
+ this.openRecord(this.flowId,dataId);
2273
+ }
2274
+
2275
+ openRecord(flowId,dataId){
2276
+ this.$this.saspFlowAxios.post(this.$this.api.plFlowInst.getFlowInstByFlowDataId,{flowId:(flowId || this.flowId),dataId:dataId}).then(res => {
2277
+ if (!res.data) {
2278
+ this.$this.$message.error("未获取到此流程数据!");
2279
+ return;
2280
+ }
2281
+ let currentInst = res.data || {};
2282
+ this.openFlowRecord(currentInst);
2283
+ });
2284
+ }
2285
+
2286
+ openChartEvent(dataId){ // 采用初始化构造类时传递flowId
2287
+ if(!this.flowId){
2288
+ this.$this.$message.error("请先设置flowId");
2289
+ return;
2290
+ }
2291
+ this.openChart(this.flowId,dataId);
2292
+ }
2293
+
2294
+ openChart(flowId,dataId){
2295
+ if(dataId){
2296
+ this.$this.saspFlowAxios.post(this.$this.api.plFlowInst.getFlowInstByFlowDataId,{flowId:flowId || this.flowId,dataId:dataId}).then(res => {
2297
+ if (!res.data) {
2298
+ this.$this.$message.error("未获取到此流程数据");
2299
+ return;
2300
+ }
2301
+ let currentInst = res.data || {};
2302
+ this.openFlowChart(currentInst);
2303
+ });
2304
+ }else{
2305
+ this.openFlowChart({flowId:(flowId || this.flowId)});
2306
+ }
2307
+ }
2218
2308
  }
2219
2309
 
2220
2310
  export default {
@@ -180,7 +180,7 @@
180
180
  :visible.sync="flowChartObj.dialogVisible"
181
181
  width="90%" height="90%"
182
182
  top="5vh">
183
- <flow-chart :flow-id="(flowChartObj.flowId) + ''" :inst-id="flowChartObj.instId + ''"
183
+ <flow-chart :flow-id="(flowChartObj.flowId || workFlowUtil.flowId) + ''" :inst-id="flowChartObj.instId + ''"
184
184
  :link-proc-id="flowChartObj.linkProcId + ''"
185
185
  :is-release="flowChartObj.isRelease"
186
186
  v-if="flowChartObj.dialogVisible"></flow-chart>