sasp-flow-render 1.1.9 → 1.1.10
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
|
@@ -968,6 +968,7 @@
|
|
|
968
968
|
pages: 1, //总页数
|
|
969
969
|
total: 0, //总条数
|
|
970
970
|
pageSize: 50, //每页多少条
|
|
971
|
+
flowEventScriptByFlowId: {},
|
|
971
972
|
}
|
|
972
973
|
},
|
|
973
974
|
watch:{
|
|
@@ -1103,7 +1104,6 @@
|
|
|
1103
1104
|
let version = this.flowDefine.releaseVersion;
|
|
1104
1105
|
currentNode = this.flowVersionNodeObj[version][this.startNodeKeyObj[version]];
|
|
1105
1106
|
}
|
|
1106
|
-
// console.log(currentNode);
|
|
1107
1107
|
return new Promise(resolve => {
|
|
1108
1108
|
if(this.initFormInfo){
|
|
1109
1109
|
let promise = this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData);
|
|
@@ -1131,7 +1131,7 @@
|
|
|
1131
1131
|
this.flowVersionNodeObj = this.flowVersionNodeObjByFlowId[row.flowId];
|
|
1132
1132
|
this.initFlowObj();
|
|
1133
1133
|
// 加载工作流脚本与工作流事件规则
|
|
1134
|
-
this.initFlowScript();
|
|
1134
|
+
// this.initFlowScript();
|
|
1135
1135
|
// Object.assign(this.formInfo, this.formInfoByFlowId[row.flowId]);
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
@@ -1158,6 +1158,9 @@
|
|
|
1158
1158
|
* 打开[修改和处理]窗口
|
|
1159
1159
|
*/
|
|
1160
1160
|
openUpdateFlowForm(row,executePosition) {
|
|
1161
|
+
if (this.flowId.includes(",")) {
|
|
1162
|
+
this.setFlowScript(row.flowId);
|
|
1163
|
+
}
|
|
1161
1164
|
this.currentRowData = row;
|
|
1162
1165
|
this.currNodeName = 'noEnd';
|
|
1163
1166
|
let currentNodeObj1 = this.flowNodeIdToInfo[row.currentNode] ||{};
|
|
@@ -1234,7 +1237,6 @@
|
|
|
1234
1237
|
|
|
1235
1238
|
// 新批量处理弹框回调事件
|
|
1236
1239
|
openNewBatchUpdateFlowForm() {
|
|
1237
|
-
// console.log('this.sysDataObj', this.sysDataObj, this.loginUser);
|
|
1238
1240
|
Object.assign(this.formSearchObj, {
|
|
1239
1241
|
flowNewBatchDealArr: [],
|
|
1240
1242
|
isNewSelectBatchDeal: false,
|
|
@@ -1317,7 +1319,6 @@
|
|
|
1317
1319
|
rows: this.pageSize,
|
|
1318
1320
|
page: this.currentPage
|
|
1319
1321
|
}).then(res => {
|
|
1320
|
-
// console.log('initNewBatchDeal', res);
|
|
1321
1322
|
this.total = res.data.total;
|
|
1322
1323
|
this.pages = res.data.pages;
|
|
1323
1324
|
let flowNewBatchDeal = [];
|
|
@@ -2883,6 +2884,8 @@
|
|
|
2883
2884
|
for (const allFlowNode of allFlowNodeArr) {
|
|
2884
2885
|
this.startNodeKeyObj = {};
|
|
2885
2886
|
this.flowVersionNodeObj = {};
|
|
2887
|
+
let flowId = allFlowNode[0].flowId;
|
|
2888
|
+
this.flowDefine = this.flowDefineByFlowId[flowId];
|
|
2886
2889
|
(allFlowNode || []).forEach(item => {
|
|
2887
2890
|
if (item.nodeLinkId.indexOf("Activity_draft") > -1) {
|
|
2888
2891
|
this.startNodeKey = item.nodeLinkId;
|
|
@@ -2898,7 +2901,11 @@
|
|
|
2898
2901
|
let nodeArr = ['StartEvent', 'ParallelGateway', 'SequenceFlow', 'ExclusiveGateway', 'InclusiveGateway'];
|
|
2899
2902
|
if (item.nodeType && nodeArr.indexOf(item.nodeType) === -1) {
|
|
2900
2903
|
if (!this.flowNodeNameObj[item.nodeLinkId]) {
|
|
2901
|
-
|
|
2904
|
+
let nodeName = item.nodeName;
|
|
2905
|
+
if (this.flowId.includes(",")) {
|
|
2906
|
+
nodeName = this.flowDefine.flowName + "-" + item.nodeName;
|
|
2907
|
+
}
|
|
2908
|
+
this.$set(this.flowNodeNameObj, item.nodeLinkId, nodeName);
|
|
2902
2909
|
} else {
|
|
2903
2910
|
if (this.flowNodeNameObj[item.nodeLinkId] !== item.nodeName) {
|
|
2904
2911
|
this.flowNodeNameObj[item.nodeLinkId] = this.flowNodeNameObj[item.nodeLinkId] + "," + item.nodeName;
|
|
@@ -2924,23 +2931,45 @@
|
|
|
2924
2931
|
this.nodeFormButtonObj[item.id] = this.sortButtonArr(formButton);
|
|
2925
2932
|
this.nodeFormBtnObj[item.id] = this.formatterFormButton(formButton);
|
|
2926
2933
|
});
|
|
2927
|
-
let flowId = allFlowNode[0].flowId;
|
|
2928
2934
|
this.$set(this.startNodeKeyObjByFlowId, flowId, this.startNodeKeyObj);
|
|
2929
2935
|
this.$set(this.flowVersionNodeObjByFlowId, flowId, this.flowVersionNodeObj);
|
|
2930
|
-
this.flowDefine = this.flowDefineByFlowId[flowId];
|
|
2931
2936
|
// this.initFlowScript().then(() => {
|
|
2932
2937
|
// resolve(true);
|
|
2933
2938
|
// });
|
|
2934
2939
|
}
|
|
2940
|
+
const initFlowScriptFunc = flowIdArr.map(flowId => () => this.initFlowScript(flowId));
|
|
2941
|
+
Promise.all(initFlowScriptFunc.map(func => func())).then(scriptArr => {
|
|
2942
|
+
(scriptArr || []).forEach(scriptEventObj => {
|
|
2943
|
+
Object.keys(scriptEventObj).forEach(key => {
|
|
2944
|
+
if (key) {
|
|
2945
|
+
this.flowEventScriptByFlowId[key] = scriptEventObj[key];
|
|
2946
|
+
}
|
|
2947
|
+
});
|
|
2948
|
+
});
|
|
2949
|
+
}).catch(reason => {
|
|
2950
|
+
console.log('流程脚本加载出错了', reason);
|
|
2951
|
+
});
|
|
2935
2952
|
resolve(true);
|
|
2936
2953
|
});
|
|
2937
2954
|
});
|
|
2938
2955
|
},
|
|
2939
2956
|
|
|
2957
|
+
setFlowScript(flowId) {
|
|
2958
|
+
if (flowId) {
|
|
2959
|
+
let scriptObj = this.flowEventScriptByFlowId[flowId] || {};
|
|
2960
|
+
this.scriptObj = scriptObj.scriptObj || {};
|
|
2961
|
+
this.newScriptObj = scriptObj.newScriptObj || {};
|
|
2962
|
+
this.newEventObj = scriptObj.newEventObj || {};
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
|
|
2940
2966
|
/**
|
|
2941
2967
|
* 加载工作流脚本与工作流事件规则
|
|
2942
2968
|
*/
|
|
2943
|
-
initFlowScript(){
|
|
2969
|
+
initFlowScript(flowId){
|
|
2970
|
+
if (flowId) {
|
|
2971
|
+
this.flowDefine = this.flowDefineByFlowId[flowId] || {};
|
|
2972
|
+
}
|
|
2944
2973
|
return new Promise(resolve => {
|
|
2945
2974
|
this.saspFlowAxios.all([
|
|
2946
2975
|
this.saspFlowAxios.post(this.api.plFlowScript.find,{"flowId": this.flowDefine.id}),
|
|
@@ -3140,7 +3169,8 @@
|
|
|
3140
3169
|
});
|
|
3141
3170
|
}
|
|
3142
3171
|
// 结束
|
|
3143
|
-
|
|
3172
|
+
let obj = {"scriptObj": this.scriptObj, "newScriptObj": this.newScriptObj, "newEventObj": this.newEventObj};
|
|
3173
|
+
resolve({[flowId]: obj});
|
|
3144
3174
|
}));
|
|
3145
3175
|
})
|
|
3146
3176
|
},
|