sasp-flow-render 1.0.4 → 1.0.6

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.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -14,7 +14,7 @@ const install = function (Vue, opts = {}) {
14
14
 
15
15
  Vue.use(flowUserGlobal,opts);
16
16
  Vue.prototype.FLOW_GLOBAL = flowGlobal;
17
- Vue.prototype.CACHE_GLOBAL = cacheGlobal;
17
+ Vue.prototype.FLOW_CACHE_GLOBAL = cacheGlobal;
18
18
  Vue.prototype.INTER_CACHE = interfaceCache;
19
19
  Vue.prototype.FLOW_USER_GLOBAL = flowUserGlobal;
20
20
  Object.assign(Vue.prototype.api, apiFlow.apis);
@@ -236,7 +236,7 @@
236
236
  },
237
237
  //初始化用户信息
238
238
  initUserInfo(){
239
- this.loginUser = this.CACHE_GLOBAL.getLoginUser();
239
+ this.loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser();
240
240
  }
241
241
  }
242
242
  }
@@ -10,11 +10,8 @@
10
10
  </el-form-item>
11
11
  <el-form-item label="启动人"
12
12
  v-if="isShow('pending,processed,finished,rescinded,discontinue,flowQuery')">
13
- <el-select v-model="crud.searchForm.startUserName" style="width: 90px;" filterable allow-create clearable>
14
- <el-option v-for="item in userArr" :key="item.id" :value="item.id" :label="item.userName">
15
-
16
- </el-option>
17
- </el-select>
13
+ <el-input v-model="crud.searchForm.startUserName" style="width: 90px;">
14
+ </el-input>
18
15
  </el-form-item>
19
16
 
20
17
  <el-form-item label="当前处理人" v-if="isShow('flowQuery')">
@@ -380,8 +377,8 @@
380
377
  noClearSearchColumns: this.initNoClearSearch(),
381
378
  initNoSearch: true,
382
379
  }),
383
- loginUser: this.CACHE_GLOBAL.getLoginUser(),//当前登录用户
384
- userDept: this.CACHE_GLOBAL.getLoginDept(),
380
+ loginUser: this.FLOW_CACHE_GLOBAL.getLoginUser(),//当前登录用户
381
+ userDept: this.FLOW_CACHE_GLOBAL.getLoginDept(),
385
382
  flowStatusObj: {//流程状态
386
383
  all: '',
387
384
  draft: 0,
@@ -476,6 +476,7 @@
476
476
  initMessageFunc:{type: Function,default:null},
477
477
  initFormInfo:{type: Function,default:null}, // 添加修改打开表单时执行的事件
478
478
  saveFormInfo:{type: Function,default:null}, // 保存表单时执行的事件
479
+ getFormInfo:{type: Function,default:null}, // 获取表单内容,以方便进行表单信息修改
479
480
  dataPermis:{type:String,default:''},
480
481
  flowNextOperation:{type: Function,default:null} // 流程下一步时的参数回调事件
481
482
  },
@@ -888,8 +889,8 @@
888
889
  }
889
890
  this.agentFormObj.flowId = this.flowData.flowId;
890
891
  this.isShowAgentSet = false;
891
- this.loginUser = this.CACHE_GLOBAL.getLoginUser();
892
- this.userDept = this.CACHE_GLOBAL.getLoginDept();
892
+ this.loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser();
893
+ this.userDept = this.FLOW_CACHE_GLOBAL.getLoginDept();
893
894
  this.initTabOpts(); // 初始化外部选项卡权限
894
895
 
895
896
  this.getFlowInfo().then(res => {
@@ -909,6 +910,7 @@
909
910
  let nowVersion = this.flowDefine.releaseVersion; //只要已发布最小版本为1.0
910
911
  this.currentRowData = {};
911
912
  this.initFieldStatus(this.startNodeKeyObj[nowVersion],nowVersion).then(()=>{
913
+ this.flowInstDataDialog = true;
912
914
  this.initFormInfoFunc('add').then(() => {
913
915
  this.formBtnArr = this.getAddAndUpdateFormBtn({});
914
916
  Object.assign(this.formInfo, {
@@ -916,7 +918,14 @@
916
918
  opt: "add"
917
919
  });
918
920
  this.currentInst = {};
919
- this.flowInstDataDialog = true;
921
+ this.$nextTick(() => {
922
+ this.exeFlowEvent("add","afterClick");
923
+ let startNodeKey = this.startNodeKeyObj[nowVersion];
924
+ let startNodeObj = this.flowVersionNodeObj[nowVersion][startNodeKey] || {};
925
+ if(startNodeObj.openEvent == '1'){
926
+ this.exeNewFlowEvent("addAfter");//新事件规则
927
+ }
928
+ })
920
929
  })
921
930
  });
922
931
  // this.$refs.flowInstDataInfo && (this.$refs.flowInstDataInfo.optFormData = {});
@@ -954,8 +963,18 @@
954
963
  }
955
964
  // console.log(currentNode);
956
965
  return new Promise(resolve => {
957
- this.initFormInfo && this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData);
958
- resolve();
966
+ if(this.initFormInfo){
967
+ let promise = this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData);
968
+ if(promise.then){
969
+ promise.then(() => {
970
+ resolve();
971
+ })
972
+ }else{
973
+ resolve();
974
+ }
975
+ } else{
976
+ resolve();
977
+ }
959
978
  })
960
979
  },
961
980
  /**
@@ -992,17 +1011,13 @@
992
1011
  this.currNodeName = 'noEnd';
993
1012
  this.flowInstDataDialog = true;
994
1013
  this.initUpdateFlowForm(row).then(() =>{
995
- this.flowInstDataDialog = true;
996
- // this.$nextTick(() => {
997
- // this.$refs.flowInstDataInfo.loadData().then(() => {
998
- // this.exeFlowEvent(executePosition,"afterClick",row.currentNode);
999
- //
1000
- // let currentNodeObj = this.flowNodeIdToInfo[row.currentNode] ||{};
1001
- // if(currentNodeObj.openEvent== '1'){ //开启事件
1002
- // this.exeNewFlowEvent("editAfter",currentNodeObj.nodeLinkId ||'');//新事件规则
1003
- // }
1004
- // })
1005
- // })
1014
+ this.$nextTick(() => {
1015
+ this.exeFlowEvent(executePosition,"afterClick",row.currentNode);
1016
+ let currentNodeObj = this.flowNodeIdToInfo[row.currentNode] ||{};
1017
+ if(currentNodeObj.openEvent== '1'){ //开启事件
1018
+ this.exeNewFlowEvent("editAfter",currentNodeObj.nodeLinkId ||'');//新事件规则
1019
+ }
1020
+ })
1006
1021
  });
1007
1022
  },
1008
1023
 
@@ -1016,6 +1031,7 @@
1016
1031
  this.currNodeName = "end";
1017
1032
  }
1018
1033
  this.initFieldStatus(row.nodeKey || startNodeKey,row.version,row.flowStatus).then(() =>{
1034
+ this.flowInstDataDialog = true;
1019
1035
  this.initFormInfoFunc('view',row).then(() => {
1020
1036
  this.currentStartUser = this.userMap[row.startUserId] || "";
1021
1037
  this.currentStartTime = row.startTime;
@@ -1026,7 +1042,6 @@
1026
1042
  opt: "view",
1027
1043
  });
1028
1044
  this.formBtnArr = this.getViewFormBtn(row);
1029
- this.flowInstDataDialog = true;
1030
1045
  });
1031
1046
  });
1032
1047
  },
@@ -1375,20 +1390,20 @@
1375
1390
  */
1376
1391
  nextStep() {
1377
1392
  // let type = this.flowBatchPendingDialog ? "batch" : "";
1378
- // let afterClickResult;
1379
- // let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
1380
- // afterClickResult=this.exeFlowEvent("nextStep","afterClick", this.currentInst.currentNode || this.draftNodeId);
1393
+ let afterClickResult;
1394
+ let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
1395
+ afterClickResult=this.exeFlowEvent("nextStep","afterClick", this.currentInst.currentNode || this.draftNodeId);
1381
1396
  //
1382
- // if(currentNodeObj.openEvent == '1'){
1383
- // afterClickResult = this.exeNewFlowEvent("nextClick",currentNodeObj.nodeLinkId);
1384
- // }
1397
+ if(currentNodeObj.openEvent == '1'){
1398
+ afterClickResult = this.exeNewFlowEvent("nextClick",currentNodeObj.nodeLinkId);
1399
+ }
1385
1400
 
1386
1401
  // let afterValidateResult;
1387
1402
  // let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
1388
- // afterValidateResult=this.exeFlowEvent("nextStep","afterValidate", this.currentInst.currentNode || this.draftNodeId);
1389
- // if(currentNodeObj.openEvent == '1'){
1390
- // afterValidateResult = this.exeNewFlowEvent("nextCheck",currentNodeObj.nodeLinkId);
1391
- // }
1403
+ this.exeFlowEvent("nextStep","afterValidate", this.currentInst.currentNode || this.draftNodeId);
1404
+ if(currentNodeObj.openEvent == '1'){
1405
+ this.exeNewFlowEvent("nextCheck",currentNodeObj.nodeLinkId);
1406
+ }
1392
1407
 
1393
1408
  this.isDisabled['nextStep'] = false;
1394
1409
  this.flowParams = {};
@@ -2532,12 +2547,15 @@
2532
2547
  // executePosition:add:['afterClick'],update:['afterClick'],handle:['afterClick'],
2533
2548
  // nextStep:['afterClick','afterValidate','submitSuccess'],view:['afterClick'],
2534
2549
  // (columnFormatter:['finished','end']?暂时不用)
2535
- let formData;
2536
- if(batchDataRef){//批量处理走单独方法
2537
- formData=this.$refs[batchDataRef][0] && this.$refs[batchDataRef][0].optFormData || {};
2538
- }else{
2539
- formData=(this.$refs.flowInstDataInfo && this.$refs.flowInstDataInfo.optFormData) || {};
2550
+ let formData = {};
2551
+ if(this.getFormInfo){
2552
+ formData = this.getFormInfo();
2540
2553
  }
2554
+ // if(batchDataRef){//批量处理走单独方法
2555
+ // formData=this.$refs[batchDataRef][0] && this.$refs[batchDataRef][0].optFormData || {};
2556
+ // }else{
2557
+ // formData=(this.$refs.flowInstDataInfo && this.$refs.flowInstDataInfo.optFormData) || {};
2558
+ // }
2541
2559
  let CTX = window.JAVA_URL;
2542
2560
  let paramValues = [this,this.axios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode,null]; // 入参
2543
2561
  if(executePosition == "add" || executePosition == "update"){
@@ -2568,12 +2586,16 @@
2568
2586
  * 执行工作流新版本事件规则
2569
2587
  */
2570
2588
  exeNewFlowEvent(executeType,nodeKey,batchDataRef){
2571
- let formData;
2572
- if(batchDataRef){//批量处理走单独方法
2573
- formData=this.$refs[batchDataRef][0] && this.$refs[batchDataRef][0].optFormData || {};
2574
- }else{
2575
- formData=(this.$refs.flowInstDataInfo && this.$refs.flowInstDataInfo.optFormData) || {};
2589
+ let formData = {};
2590
+ if(this.getFormInfo){
2591
+ formData = this.getFormInfo();
2576
2592
  }
2593
+ // let formData;
2594
+ // if(batchDataRef){//批量处理走单独方法
2595
+ // formData=this.$refs[batchDataRef][0] && this.$refs[batchDataRef][0].optFormData || {};
2596
+ // }else{
2597
+ // formData=(this.$refs.flowInstDataInfo && this.$refs.flowInstDataInfo.optFormData) || {};
2598
+ // }
2577
2599
  //执行自定义脚本
2578
2600
  let CTX = window.JAVA_URL;
2579
2601
  let paramValues = [this,this.axios,CTX,formData,this.loginUser,AjaxUtil,this.nextNode]; // 入参
@@ -559,6 +559,12 @@
559
559
  if(b.activityType == "startEvent"){
560
560
  return 1;
561
561
  }
562
+ if(a.activityType == "noneEndEvent"){
563
+ return 1;
564
+ }
565
+ if(b.activityType == "noneEndEvent"){
566
+ return -1;
567
+ }
562
568
  if(a.activityId == b.activityId){
563
569
  return a.endTime - b.endTime;
564
570
  }
@@ -2,7 +2,7 @@
2
2
  <flow-inst-tab :flow-id="useFlowId" :userArr="userArr" :userMap="userMap"
3
3
  :operateRootArr="operateArr" :dataPermis="dataPermis"
4
4
  :initFormInfo="initFormInfo" :saveFormInfo="saveFormInfo" :class='flowViewMainClass'
5
- :flow-next-operation="flowNextOperation">
5
+ :flow-next-operation="flowNextOperation" :getFormInfo="getFormInfo">
6
6
  <template slot="formInfo">
7
7
  <slot name="formInfo"></slot>
8
8
  </template>
@@ -21,6 +21,7 @@
21
21
  operateArr:{type:Array,default:null},
22
22
  initFormInfo:{type: Function,default:null}, // 添加修改打开表单时执行的事件
23
23
  saveFormInfo:{type: Function,default:null}, // 保存表单时执行的事件
24
+ getFormInfo:{type: Function,default:null}, // 获取表单内容,以方便进行表单信息修改
24
25
  flowNextOperation:{type: Function,default:null} // 流程下一步时的参数回调事件
25
26
  },
26
27
  data(){
@@ -70,7 +71,7 @@
70
71
  },
71
72
  init(){
72
73
  if(this.loginUser){
73
- this.CACHE_GLOBAL.setLoginUser(this.loginUser);
74
+ this.FLOW_CACHE_GLOBAL.setLoginUser(this.loginUser);
74
75
  }else{
75
76
  let loginUser = {};
76
77
  if(this.userId){
@@ -81,7 +82,7 @@
81
82
  if(this.userName){
82
83
  loginUser.userName = this.userName;
83
84
  }
84
- this.CACHE_GLOBAL.setLoginUser(loginUser);
85
+ this.FLOW_CACHE_GLOBAL.setLoginUser(loginUser);
85
86
  }
86
87
  if(this.flowId){
87
88
  this.useFlowId = this.flowId;
@@ -102,7 +102,7 @@
102
102
  }
103
103
  // let menuObj = window.menuIdToMenuObj[this.menuId] || {};
104
104
 
105
- let loginUser = this.CACHE_GLOBAL.getLoginUser(); //获取当前用户
105
+ let loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser(); //获取当前用户
106
106
  //根据 当前用户查询 数据权限和操作权限
107
107
  //判断当前用户类型
108
108
  if(loginUser.userType == 'sup' || this.isCloudView){ //开发者
@@ -77,7 +77,7 @@
77
77
  //let menuObj = window.resourceToMemu[this.resourceId];
78
78
  //this.menuId = menuObj.id;
79
79
 
80
- let loginUser = this.CACHE_GLOBAL.getLoginUser(); //获取当前用户
80
+ let loginUser = this.FLOW_CACHE_GLOBAL.getLoginUser(); //获取当前用户
81
81
  //根据 当前用户查询 数据权限和操作权限
82
82
  //判断当前用户类型
83
83
  if(loginUser.userType == 'sup'){ //开发者