sasp-flow-render 1.1.8 → 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
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
v-if="isShow('draft')"></el-table-column>
|
|
94
94
|
<el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
95
95
|
<el-table-column label="事项概述" prop="flowSummary" show-overflow-tooltip :formatter="formatterFlowSummary"></el-table-column>
|
|
96
|
+
<el-table-column label="流程名称" prop="flowId" width="200" align="center" :formatter="formatterFlowName" v-if="flowIds.includes(',')"></el-table-column>
|
|
96
97
|
<el-table-column label="启动人" prop="startUserId" v-if="isNotShow('draft')" width="100" align="center">
|
|
97
98
|
<template slot-scope="scope">
|
|
98
99
|
{{userMap[scope.row.startUserId]}}
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
<el-table-column label="中止时间" prop="discontinueTime" width="180" align="center"
|
|
108
109
|
v-if="isShow('discontinue')"></el-table-column>
|
|
109
110
|
<el-table-column label="当前任务" prop="currentNodeName" width="150" align="center"
|
|
110
|
-
v-if="!isShow('draft')" show-overflow-tooltip :sortable="tabType
|
|
111
|
+
v-if="!isShow('draft')" show-overflow-tooltip :sortable="tabType === 'pending' ? 'custom' : false">
|
|
111
112
|
<template slot-scope="scope">
|
|
112
113
|
{{formatterCurrentNodeName(scope.row)}}
|
|
113
114
|
<span v-if="scope.row.operateStatus == '0' && scope.row.agentType == '0'">(正常)</span>
|
|
@@ -397,6 +398,7 @@
|
|
|
397
398
|
flowImpParamObj: {type: Object, default: () => ({})},
|
|
398
399
|
downloadTemplate: {type: Function, default: null},
|
|
399
400
|
getFormDataByDataIds: {type: Function, default: null},
|
|
401
|
+
flowDefineByFlowId: {type: Object, default: () => ({})},
|
|
400
402
|
},
|
|
401
403
|
data() {
|
|
402
404
|
|
|
@@ -921,6 +923,11 @@
|
|
|
921
923
|
})
|
|
922
924
|
return arr.join(",");
|
|
923
925
|
},
|
|
926
|
+
|
|
927
|
+
formatterFlowName(row, column, cellValue) {
|
|
928
|
+
let flowDefineObj = this.flowDefineByFlowId[cellValue] || {};
|
|
929
|
+
return flowDefineObj.flowName || "";
|
|
930
|
+
},
|
|
924
931
|
//点击列排序是的函数
|
|
925
932
|
flowSortChange({column, prop, order}){
|
|
926
933
|
if(column.order){
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
:open-batch-update-flow-form="openBatchUpdateFlowForm"
|
|
31
31
|
:openNewBatchUpdateFlowForm="openNewBatchUpdateFlowForm"
|
|
32
32
|
@setDataValue="setDataValue"
|
|
33
|
+
:flowDefineByFlowId="flowDefineByFlowId"
|
|
33
34
|
>
|
|
34
35
|
</flow-inst-list>
|
|
35
36
|
</div>
|
|
@@ -324,7 +325,7 @@
|
|
|
324
325
|
</el-dialog>
|
|
325
326
|
|
|
326
327
|
<!--流程下一步处理人选择弹窗-->
|
|
327
|
-
<el-dialog :close-on-click-modal=false :title="'下一步' + (nextNodeName ? (isProceedNext?' -> ' + nextNodeName:'->等待他人处理') : '')"
|
|
328
|
+
<el-dialog :close-on-click-modal=false style="font-family: '微软雅黑'" :title="'下一步' + (nextNodeName ? (isProceedNext?' -> ' + nextNodeName:'->等待他人处理') : '')"
|
|
328
329
|
:top="nextNode.nextType != 'inclusiveGateway' ? '20vh': '10vh'" append-to-body
|
|
329
330
|
width="500px" :visible.sync="nextSteptUserDialog" @closed="closeNextSteptUserDialog">
|
|
330
331
|
<el-form label-width="100px" size="small" v-if="nextNode.nodeType != 'EndEvent'">
|
|
@@ -967,6 +968,7 @@
|
|
|
967
968
|
pages: 1, //总页数
|
|
968
969
|
total: 0, //总条数
|
|
969
970
|
pageSize: 50, //每页多少条
|
|
971
|
+
flowEventScriptByFlowId: {},
|
|
970
972
|
}
|
|
971
973
|
},
|
|
972
974
|
watch:{
|
|
@@ -1102,7 +1104,6 @@
|
|
|
1102
1104
|
let version = this.flowDefine.releaseVersion;
|
|
1103
1105
|
currentNode = this.flowVersionNodeObj[version][this.startNodeKeyObj[version]];
|
|
1104
1106
|
}
|
|
1105
|
-
// console.log(currentNode);
|
|
1106
1107
|
return new Promise(resolve => {
|
|
1107
1108
|
if(this.initFormInfo){
|
|
1108
1109
|
let promise = this.initFormInfo(type,dataId,JSON.parse(currentNode.fieldOperate || "{}"),rowData);
|
|
@@ -1129,6 +1130,8 @@
|
|
|
1129
1130
|
this.startNodeKeyObj = this.startNodeKeyObjByFlowId[row.flowId];
|
|
1130
1131
|
this.flowVersionNodeObj = this.flowVersionNodeObjByFlowId[row.flowId];
|
|
1131
1132
|
this.initFlowObj();
|
|
1133
|
+
// 加载工作流脚本与工作流事件规则
|
|
1134
|
+
// this.initFlowScript();
|
|
1132
1135
|
// Object.assign(this.formInfo, this.formInfoByFlowId[row.flowId]);
|
|
1133
1136
|
}
|
|
1134
1137
|
|
|
@@ -1155,6 +1158,9 @@
|
|
|
1155
1158
|
* 打开[修改和处理]窗口
|
|
1156
1159
|
*/
|
|
1157
1160
|
openUpdateFlowForm(row,executePosition) {
|
|
1161
|
+
if (this.flowId.includes(",")) {
|
|
1162
|
+
this.setFlowScript(row.flowId);
|
|
1163
|
+
}
|
|
1158
1164
|
this.currentRowData = row;
|
|
1159
1165
|
this.currNodeName = 'noEnd';
|
|
1160
1166
|
let currentNodeObj1 = this.flowNodeIdToInfo[row.currentNode] ||{};
|
|
@@ -1231,7 +1237,6 @@
|
|
|
1231
1237
|
|
|
1232
1238
|
// 新批量处理弹框回调事件
|
|
1233
1239
|
openNewBatchUpdateFlowForm() {
|
|
1234
|
-
// console.log('this.sysDataObj', this.sysDataObj, this.loginUser);
|
|
1235
1240
|
Object.assign(this.formSearchObj, {
|
|
1236
1241
|
flowNewBatchDealArr: [],
|
|
1237
1242
|
isNewSelectBatchDeal: false,
|
|
@@ -1314,7 +1319,6 @@
|
|
|
1314
1319
|
rows: this.pageSize,
|
|
1315
1320
|
page: this.currentPage
|
|
1316
1321
|
}).then(res => {
|
|
1317
|
-
// console.log('initNewBatchDeal', res);
|
|
1318
1322
|
this.total = res.data.total;
|
|
1319
1323
|
this.pages = res.data.pages;
|
|
1320
1324
|
let flowNewBatchDeal = [];
|
|
@@ -2250,9 +2254,7 @@
|
|
|
2250
2254
|
Object.assign(params,this.flowParams || {},obj);
|
|
2251
2255
|
this.saspFlowAxios.post(this.api.plFlowInst.executeNextStep,params).then(res => {
|
|
2252
2256
|
if (res && res.data && res.data.operateSuccess) {
|
|
2253
|
-
|
|
2254
|
-
this.initTabNum();
|
|
2255
|
-
}
|
|
2257
|
+
this.initTabNum();
|
|
2256
2258
|
this.$message({type: "success", message: "提交成功!"});
|
|
2257
2259
|
if (this.flowBatchPendingDialog) {
|
|
2258
2260
|
this.batchTabRemove(this.currentInst.dataId);
|
|
@@ -2328,9 +2330,7 @@
|
|
|
2328
2330
|
if (res && res.data && res.data.operateSuccess) {
|
|
2329
2331
|
this.completeSignDialog = false;
|
|
2330
2332
|
this.flowInstDataDialog = false;
|
|
2331
|
-
|
|
2332
|
-
this.initTabNum();
|
|
2333
|
-
}
|
|
2333
|
+
this.initTabNum();
|
|
2334
2334
|
this.$message({type: "success", message: "加签成功!"});
|
|
2335
2335
|
this.tabCrudSearch();
|
|
2336
2336
|
} else {
|
|
@@ -2358,9 +2358,7 @@
|
|
|
2358
2358
|
if (res && res.data && res.data.operateSuccess) {
|
|
2359
2359
|
this.turnSignDialog = false;
|
|
2360
2360
|
this.flowInstDataDialog = false;
|
|
2361
|
-
|
|
2362
|
-
this.initTabNum();
|
|
2363
|
-
}
|
|
2361
|
+
this.initTabNum();
|
|
2364
2362
|
this.$message({type: "success", message: "转签成功!"});
|
|
2365
2363
|
this.tabCrudSearch();
|
|
2366
2364
|
} else {
|
|
@@ -2394,9 +2392,7 @@
|
|
|
2394
2392
|
}).then(res => {
|
|
2395
2393
|
if (res && res.data && res.data.operateSuccess) {
|
|
2396
2394
|
this.$message({type: "success", message: "退回成功!"});
|
|
2397
|
-
|
|
2398
|
-
this.initTabNum();
|
|
2399
|
-
}
|
|
2395
|
+
this.initTabNum();
|
|
2400
2396
|
if (this.flowBatchPendingDialog) {
|
|
2401
2397
|
this.batchTabRemove(this.currentInst.dataId);
|
|
2402
2398
|
} else {
|
|
@@ -2435,9 +2431,7 @@
|
|
|
2435
2431
|
}).then(res => {
|
|
2436
2432
|
if (res && res.data && res.data.operateSuccess) {
|
|
2437
2433
|
this.$message({type: "success", message: "取回成功!"});
|
|
2438
|
-
|
|
2439
|
-
this.initTabNum();
|
|
2440
|
-
}
|
|
2434
|
+
this.initTabNum();
|
|
2441
2435
|
if (this.flowBatchPendingDialog) {
|
|
2442
2436
|
this.batchTabRemove(this.currentInst.dataId);
|
|
2443
2437
|
} else {
|
|
@@ -2711,9 +2705,7 @@
|
|
|
2711
2705
|
} else {
|
|
2712
2706
|
this.tabCrudSearch();
|
|
2713
2707
|
}
|
|
2714
|
-
|
|
2715
|
-
this.initTabNum();
|
|
2716
|
-
}
|
|
2708
|
+
this.initTabNum();
|
|
2717
2709
|
} else {
|
|
2718
2710
|
this.$message({type: "error", message: res.data.operateMessage});
|
|
2719
2711
|
}
|
|
@@ -2732,6 +2724,9 @@
|
|
|
2732
2724
|
|
|
2733
2725
|
initTabNum() {
|
|
2734
2726
|
this.initMessageFunc && this.initMessageFunc();
|
|
2727
|
+
if (this.flowId.includes(",")) {
|
|
2728
|
+
return;
|
|
2729
|
+
}
|
|
2735
2730
|
this.saspFlowAxios.all([
|
|
2736
2731
|
this.saspFlowAxios.post(this.api.plFlowInst.getTabsNum,
|
|
2737
2732
|
{flowId: this.flowData.flowId, type: "1"}),
|
|
@@ -2860,7 +2855,7 @@
|
|
|
2860
2855
|
this.$forceUpdate();
|
|
2861
2856
|
}
|
|
2862
2857
|
// 加载工作流脚本与工作流事件规则
|
|
2863
|
-
this.initFlowScript(
|
|
2858
|
+
this.initFlowScript().then(() => {
|
|
2864
2859
|
resolve(true);
|
|
2865
2860
|
})
|
|
2866
2861
|
});
|
|
@@ -2889,6 +2884,8 @@
|
|
|
2889
2884
|
for (const allFlowNode of allFlowNodeArr) {
|
|
2890
2885
|
this.startNodeKeyObj = {};
|
|
2891
2886
|
this.flowVersionNodeObj = {};
|
|
2887
|
+
let flowId = allFlowNode[0].flowId;
|
|
2888
|
+
this.flowDefine = this.flowDefineByFlowId[flowId];
|
|
2892
2889
|
(allFlowNode || []).forEach(item => {
|
|
2893
2890
|
if (item.nodeLinkId.indexOf("Activity_draft") > -1) {
|
|
2894
2891
|
this.startNodeKey = item.nodeLinkId;
|
|
@@ -2904,7 +2901,11 @@
|
|
|
2904
2901
|
let nodeArr = ['StartEvent', 'ParallelGateway', 'SequenceFlow', 'ExclusiveGateway', 'InclusiveGateway'];
|
|
2905
2902
|
if (item.nodeType && nodeArr.indexOf(item.nodeType) === -1) {
|
|
2906
2903
|
if (!this.flowNodeNameObj[item.nodeLinkId]) {
|
|
2907
|
-
|
|
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);
|
|
2908
2909
|
} else {
|
|
2909
2910
|
if (this.flowNodeNameObj[item.nodeLinkId] !== item.nodeName) {
|
|
2910
2911
|
this.flowNodeNameObj[item.nodeLinkId] = this.flowNodeNameObj[item.nodeLinkId] + "," + item.nodeName;
|
|
@@ -2930,27 +2931,49 @@
|
|
|
2930
2931
|
this.nodeFormButtonObj[item.id] = this.sortButtonArr(formButton);
|
|
2931
2932
|
this.nodeFormBtnObj[item.id] = this.formatterFormButton(formButton);
|
|
2932
2933
|
});
|
|
2933
|
-
let flowId = allFlowNode[0].flowId;
|
|
2934
2934
|
this.$set(this.startNodeKeyObjByFlowId, flowId, this.startNodeKeyObj);
|
|
2935
2935
|
this.$set(this.flowVersionNodeObjByFlowId, flowId, this.flowVersionNodeObj);
|
|
2936
|
-
//
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
resolve(true);
|
|
2940
|
-
});
|
|
2936
|
+
// this.initFlowScript().then(() => {
|
|
2937
|
+
// resolve(true);
|
|
2938
|
+
// });
|
|
2941
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
|
+
});
|
|
2952
|
+
resolve(true);
|
|
2942
2953
|
});
|
|
2943
2954
|
});
|
|
2944
2955
|
},
|
|
2945
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
|
+
|
|
2946
2966
|
/**
|
|
2947
2967
|
* 加载工作流脚本与工作流事件规则
|
|
2948
2968
|
*/
|
|
2949
2969
|
initFlowScript(flowId){
|
|
2970
|
+
if (flowId) {
|
|
2971
|
+
this.flowDefine = this.flowDefineByFlowId[flowId] || {};
|
|
2972
|
+
}
|
|
2950
2973
|
return new Promise(resolve => {
|
|
2951
2974
|
this.saspFlowAxios.all([
|
|
2952
|
-
this.saspFlowAxios.post(this.api.plFlowScript.find,{"flowId":
|
|
2953
|
-
this.saspFlowAxios.post(this.api.plFlowEventDetail.findByFlowAndLeadFunc,{"flowId":
|
|
2975
|
+
this.saspFlowAxios.post(this.api.plFlowScript.find,{"flowId": this.flowDefine.id}),
|
|
2976
|
+
this.saspFlowAxios.post(this.api.plFlowEventDetail.findByFlowAndLeadFunc,{"flowId": this.flowDefine.id,"version":this.flowDefine.flowVersion || "1.0"})
|
|
2954
2977
|
]).then(this.saspFlowAxios.spread((resScript, resEvent) => {
|
|
2955
2978
|
// 流程脚本
|
|
2956
2979
|
if(resScript){
|
|
@@ -3146,7 +3169,8 @@
|
|
|
3146
3169
|
});
|
|
3147
3170
|
}
|
|
3148
3171
|
// 结束
|
|
3149
|
-
|
|
3172
|
+
let obj = {"scriptObj": this.scriptObj, "newScriptObj": this.newScriptObj, "newEventObj": this.newEventObj};
|
|
3173
|
+
resolve({[flowId]: obj});
|
|
3150
3174
|
}));
|
|
3151
3175
|
})
|
|
3152
3176
|
},
|
|
@@ -3355,9 +3379,7 @@
|
|
|
3355
3379
|
tabClick(tab) {
|
|
3356
3380
|
if (this.showInfo === "flow" && this.$refs[tab.name + "Ref"] && this.$refs[tab.name + "Ref"].crud) {
|
|
3357
3381
|
this.$refs[tab.name + "Ref"].crud.search();
|
|
3358
|
-
|
|
3359
|
-
this.initTabNum();
|
|
3360
|
-
}
|
|
3382
|
+
this.initTabNum();
|
|
3361
3383
|
} else if (this.showInfo === "form" && this.$refs[tab.name + "Ref"] && this.$refs[tab.name + "Ref"].getDataRows) {
|
|
3362
3384
|
this.$refs[tab.name + "Ref"].getDataRows();
|
|
3363
3385
|
this.initTabNum();
|