sasp-flow-render 1.1.24-decoupling → 1.1.25-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.25-decoupling",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -33,6 +33,8 @@ class WorkflowEngine {
33
33
  }
34
34
  this.$flowDialog = this.$this.$flowDialog;
35
35
  this.flowDefine = {};
36
+ this.flowRecordObj = {};
37
+ this.flowChartObj = {};
36
38
 
37
39
  // 初始化插入部分方法
38
40
  let methods = flowAttrs["methods"] || {};
@@ -110,6 +112,8 @@ class WorkflowEngine {
110
112
  this.nextSteptUserArr = [];
111
113
 
112
114
  this.newEventObj = {};
115
+ this.newScriptObj = {};
116
+ this.scriptObj = {};
113
117
  this.resourceTabOpts = ['draft','pending','processed','rescinded','finished','discontinue','flowQuery'];
114
118
  //表单按钮
115
119
  this.formButtonObj = {
@@ -1354,7 +1358,7 @@ class WorkflowEngine {
1354
1358
  formData = this.getFormInfo();
1355
1359
  }
1356
1360
  let CTX = "";
1357
- let paramValues = [this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode,null]; // 入参
1361
+ let paramValues = [this.$this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode,null]; // 入参
1358
1362
  if(executePosition == "add" || executePosition == "update"){
1359
1363
  ((this.scriptObj[executePosition] || {})[executeTime] || []).forEach(event => {
1360
1364
  event && event(...paramValues); // 执行事件
@@ -1388,7 +1392,7 @@ class WorkflowEngine {
1388
1392
  //执行自定义脚本
1389
1393
  // let CTX = window.JAVA_URL;
1390
1394
  let CTX = "";
1391
- let paramValues = [this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
1395
+ let paramValues = [this.$this,this.$this.saspFlowAxios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
1392
1396
  if(executeType == "addAfter"){ //新增或后
1393
1397
  (this.newScriptObj[executeType] || []).forEach(event => {
1394
1398
  event && event(...paramValues); // 执行事件
@@ -1854,6 +1858,23 @@ class WorkflowEngine {
1854
1858
  flowRecordObj: this.flowRecordObj
1855
1859
  });
1856
1860
  }
1861
+
1862
+ openFlowChart(row) {
1863
+ let flowId = "";
1864
+ let instId = "";
1865
+ let linkProcId = "";
1866
+ let isRelease = "";
1867
+ if (row) {
1868
+ flowId = row.flowId;
1869
+ instId = row.flowInstId;
1870
+ linkProcId = row.linkProcId;
1871
+ isRelease = row.isRelease;
1872
+ }
1873
+ this.flowChartObj = {flowId: flowId,instId: instId,linkProcId:linkProcId,isRelease:isRelease, dialogVisible: true};
1874
+ this.$flowDialog.fillFlowDialogParams({
1875
+ flowChartObj: this.flowChartObj,
1876
+ })
1877
+ }
1857
1878
 
1858
1879
  // end of button methods 按钮方法结束
1859
1880
 
@@ -2215,6 +2236,32 @@ class WorkflowEngine {
2215
2236
  openFlowDialog(args){
2216
2237
  this.$flowDialog.openFlowDialog(args);
2217
2238
  }
2239
+
2240
+ openRecord(flowId,dataId){
2241
+ this.$this.saspFlowAxios.post(this.$this.api.plFlowInst.getFlowInstByFlowDataId,{flowId:(flowId || this.flowId),dataId:dataId}).then(res => {
2242
+ if (!res.data) {
2243
+ this.$this.$message.error("未获取到此流程数据!");
2244
+ return;
2245
+ }
2246
+ let currentInst = res.data || {};
2247
+ this.openFlowRecord(currentInst);
2248
+ });
2249
+ }
2250
+
2251
+ openChart(flowId,dataId){
2252
+ if(dataId){
2253
+ this.$this.saspFlowAxios.post(this.$this.api.plFlowInst.getFlowInstByFlowDataId,{flowId:flowId || this.flowId,dataId:dataId}).then(res => {
2254
+ if (!res.data) {
2255
+ this.$this.$message.error("未获取到此流程数据");
2256
+ return;
2257
+ }
2258
+ let currentInst = res.data || {};
2259
+ this.openFlowChart(currentInst);
2260
+ });
2261
+ }else{
2262
+ this.openFlowChart({flowId:(flowId || this.flowId)});
2263
+ }
2264
+ }
2218
2265
  }
2219
2266
 
2220
2267
  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>