sasp-flow-render 1.0.13 → 1.0.15
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/index.js +1 -1
- package/package.json +1 -1
- package/src/components/flowInst/flowInstList.vue +16 -13
- package/src/components/flowInst/flowInstTab.vue +70 -79
- package/src/views/popup/event/compoment/system/flowEditContentConfig.vue +321 -0
- package/src/views/popup/event/js/loadFlowEventPlugin.js +111 -108
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
</el-form-item>
|
|
16
16
|
|
|
17
17
|
<el-form-item label="当前处理人" v-if="isShow('flowQuery')">
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
<el-input v-model="crud.searchForm.dealUserName" style="width: 90px;">
|
|
19
|
+
</el-input>
|
|
20
20
|
</el-form-item>
|
|
21
21
|
<el-form-item label="当前任务" v-if="isShow('pending,processed,flowQuery')">
|
|
22
22
|
<el-select v-model="crud.searchForm.currentNode" filterable clearable style="width: 130px;">
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
</el-button>
|
|
56
56
|
<!-- <el-button type="warning" icon="saspiconfont liuchengtu1" size="small" round>流程图</el-button>-->
|
|
57
57
|
</div>
|
|
58
|
+
<el-button type="primary" icon="el-icon-document-copy" size="small" round v-if="isShow('pending')"
|
|
59
|
+
@click="openFlowBatchPendingDialog">批量处理
|
|
60
|
+
</el-button>
|
|
58
61
|
</el-header>
|
|
59
62
|
<el-main style="height: 100%;padding: 0;" class="main-box">
|
|
60
63
|
<el-table :data="crud.dataStore.records" :ref="crud.tableRef"
|
|
@@ -762,17 +765,17 @@
|
|
|
762
765
|
/**
|
|
763
766
|
* 打开批量处理页面方法
|
|
764
767
|
*/
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
768
|
+
async openFlowBatchPendingDialog() {
|
|
769
|
+
if (this.crud.dataStore.records.length == 0) {
|
|
770
|
+
this.$message({
|
|
771
|
+
showClose: true,
|
|
772
|
+
message: '当前没有可处理的流程'
|
|
773
|
+
});
|
|
774
|
+
} else {
|
|
775
|
+
this.openBatchUpdateFlowForm(this.crud.dataStore.records);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
},
|
|
776
779
|
|
|
777
780
|
/**
|
|
778
781
|
* 格式化当前任务
|
|
@@ -200,21 +200,21 @@
|
|
|
200
200
|
<template v-if="flowInstDataDialog">
|
|
201
201
|
<slot name="formInfo"></slot>
|
|
202
202
|
</template>
|
|
203
|
-
<!-- <table-form-render ref="flowInstDataInfo"-->
|
|
204
|
-
<!-- :tableview-id="formInfo.tableViewId"-->
|
|
205
|
-
<!-- :data-id="formInfo.dataId"-->
|
|
206
|
-
<!-- :form-id="formInfo.formId"-->
|
|
207
|
-
<!-- :list-view-id="formInfo.listViewId"-->
|
|
208
|
-
<!-- :flow-field-status="formInfo.fieldStatus"-->
|
|
209
|
-
<!-- :form-operate="formInfo.opt"-->
|
|
210
|
-
<!-- :is-flow=true-->
|
|
211
|
-
<!-- :use-load-self=true-->
|
|
212
|
-
<!-- :flow-field-default="formInfo.fieldDefaultVal"-->
|
|
213
|
-
<!-- :flow-field-default-change-num="formInfo.fieldDefaultValChangeNum"-->
|
|
214
|
-
<!-- :flow-field-default-from-form="formInfo.flowFieldDefaultFromForm"-->
|
|
215
|
-
<!-- :form-field-obj="formFieldObj"-->
|
|
216
|
-
<!-- :formPrintVisble="currNodeName">-->
|
|
217
|
-
<!-- </table-form-render>-->
|
|
203
|
+
<!-- <table-form-render ref="flowInstDataInfo"-->
|
|
204
|
+
<!-- :tableview-id="formInfo.tableViewId"-->
|
|
205
|
+
<!-- :data-id="formInfo.dataId"-->
|
|
206
|
+
<!-- :form-id="formInfo.formId"-->
|
|
207
|
+
<!-- :list-view-id="formInfo.listViewId"-->
|
|
208
|
+
<!-- :flow-field-status="formInfo.fieldStatus"-->
|
|
209
|
+
<!-- :form-operate="formInfo.opt"-->
|
|
210
|
+
<!-- :is-flow=true-->
|
|
211
|
+
<!-- :use-load-self=true-->
|
|
212
|
+
<!-- :flow-field-default="formInfo.fieldDefaultVal"-->
|
|
213
|
+
<!-- :flow-field-default-change-num="formInfo.fieldDefaultValChangeNum"-->
|
|
214
|
+
<!-- :flow-field-default-from-form="formInfo.flowFieldDefaultFromForm"-->
|
|
215
|
+
<!-- :form-field-obj="formFieldObj"-->
|
|
216
|
+
<!-- :formPrintVisble="currNodeName">-->
|
|
217
|
+
<!-- </table-form-render>-->
|
|
218
218
|
|
|
219
219
|
<div slot="footer" style="height:31px;" class="dialog-footer">
|
|
220
220
|
<div>
|
|
@@ -247,23 +247,11 @@
|
|
|
247
247
|
<el-tab-pane
|
|
248
248
|
v-for="(item, index) in batchUpdateFormInfo.dataRows"
|
|
249
249
|
:key="item.dataId"
|
|
250
|
-
:label="item.
|
|
250
|
+
:label="userMap[item.startUserId]"
|
|
251
251
|
:name="item.dataId" :closable="batchUpdateFormInfo.dataRows.length > 1" :lazy="true">
|
|
252
|
-
<
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
:form-id="formInfo.formId"
|
|
256
|
-
:list-view-id="formInfo.listViewId"
|
|
257
|
-
:flow-field-status="formInfo.fieldStatus"
|
|
258
|
-
:form-operate="formInfo.opt"
|
|
259
|
-
:is-flow="true"
|
|
260
|
-
use-load-self
|
|
261
|
-
:flow-field-default="formInfo.fieldDefaultVal"
|
|
262
|
-
:flow-field-default-change-num="formInfo.fieldDefaultValChangeNum"
|
|
263
|
-
:flow-field-default-from-form="formInfo.flowFieldDefaultFromForm"
|
|
264
|
-
:form-field-obj="formFieldObj"
|
|
265
|
-
v-if="batchUpdateFormInfo.formShow && flowBatchPendingDialog">
|
|
266
|
-
</table-form-render>
|
|
252
|
+
<template>
|
|
253
|
+
<slot name="formInfo"></slot>
|
|
254
|
+
</template>
|
|
267
255
|
</el-tab-pane>
|
|
268
256
|
</el-tabs>
|
|
269
257
|
<div slot="footer" class="dialog-footer">
|
|
@@ -336,12 +324,12 @@
|
|
|
336
324
|
|
|
337
325
|
<el-dialog :close-on-click-modal=false title="组织岗位用户" top="5vh" width="80%" height="80%"
|
|
338
326
|
:visible.sync="sysOrgPosUserDialog" append-to-body>
|
|
339
|
-
<!-- <sys-org-pos-user-select ref="orgPosUserRef" v-if="sysOrgPosUserDialog"-->
|
|
340
|
-
<!-- :filterUserParam="{'commonUserType':'common' }" :ognEnable="false"-->
|
|
341
|
-
<!-- :default-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"-->
|
|
342
|
-
<!-- defaultChooseIds="$"-->
|
|
343
|
-
<!-- :posEnable="false" :checkbox="mulitiChooseUser">-->
|
|
344
|
-
<!-- </sys-org-pos-user-select>-->
|
|
327
|
+
<!-- <sys-org-pos-user-select ref="orgPosUserRef" v-if="sysOrgPosUserDialog"-->
|
|
328
|
+
<!-- :filterUserParam="{'commonUserType':'common' }" :ognEnable="false"-->
|
|
329
|
+
<!-- :default-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"-->
|
|
330
|
+
<!-- defaultChooseIds="$"-->
|
|
331
|
+
<!-- :posEnable="false" :checkbox="mulitiChooseUser">-->
|
|
332
|
+
<!-- </sys-org-pos-user-select>-->
|
|
345
333
|
<user-select ref="orgPosUserRef"
|
|
346
334
|
:choose-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"
|
|
347
335
|
:checkbox="mulitiChooseUser" v-if="sysOrgPosUserDialog">
|
|
@@ -354,14 +342,14 @@
|
|
|
354
342
|
|
|
355
343
|
<el-dialog :close-on-click-modal=false title="选择加签人" top="5vh" width="80%" height="80%"
|
|
356
344
|
:visible.sync="completeSignDialog" append-to-body>
|
|
357
|
-
<!-- <sys-org-pos-user-select ref="completeSignRef"-->
|
|
358
|
-
<!-- :filterUserParam="{'commonUserType':'common','filterLoginUser':'Y'}"-->
|
|
359
|
-
<!-- :ognEnable="false"-->
|
|
360
|
-
<!-- :posEnable="false"-->
|
|
361
|
-
<!-- :checkbox="true"-->
|
|
362
|
-
<!-- v-if="completeSignDialog"-->
|
|
363
|
-
<!-- >-->
|
|
364
|
-
<!-- </sys-org-pos-user-select>-->
|
|
345
|
+
<!-- <sys-org-pos-user-select ref="completeSignRef"-->
|
|
346
|
+
<!-- :filterUserParam="{'commonUserType':'common','filterLoginUser':'Y'}"-->
|
|
347
|
+
<!-- :ognEnable="false"-->
|
|
348
|
+
<!-- :posEnable="false"-->
|
|
349
|
+
<!-- :checkbox="true"-->
|
|
350
|
+
<!-- v-if="completeSignDialog"-->
|
|
351
|
+
<!-- >-->
|
|
352
|
+
<!-- </sys-org-pos-user-select>-->
|
|
365
353
|
<user-select ref="completeSignRef"
|
|
366
354
|
v-if="completeSignDialog">
|
|
367
355
|
</user-select>
|
|
@@ -373,14 +361,14 @@
|
|
|
373
361
|
|
|
374
362
|
<el-dialog :close-on-click-modal=false title="选择转签人" top="5vh" width="80%" height="80%"
|
|
375
363
|
:visible.sync="turnSignDialog" append-to-body>
|
|
376
|
-
<!-- <sys-org-pos-user-select ref="turnSignRef"-->
|
|
377
|
-
<!-- :filterUserParam="{'commonUserType':'common' }"-->
|
|
378
|
-
<!-- :ognEnable="false"-->
|
|
379
|
-
<!-- :posEnable="false"-->
|
|
380
|
-
<!-- :checkbox="false"-->
|
|
381
|
-
<!-- v-if="turnSignDialog"-->
|
|
382
|
-
<!-- >-->
|
|
383
|
-
<!-- </sys-org-pos-user-select>-->
|
|
364
|
+
<!-- <sys-org-pos-user-select ref="turnSignRef"-->
|
|
365
|
+
<!-- :filterUserParam="{'commonUserType':'common' }"-->
|
|
366
|
+
<!-- :ognEnable="false"-->
|
|
367
|
+
<!-- :posEnable="false"-->
|
|
368
|
+
<!-- :checkbox="false"-->
|
|
369
|
+
<!-- v-if="turnSignDialog"-->
|
|
370
|
+
<!-- >-->
|
|
371
|
+
<!-- </sys-org-pos-user-select>-->
|
|
384
372
|
<user-select ref="turnSignRef"
|
|
385
373
|
:checkbox="false"
|
|
386
374
|
v-if="turnSignDialog">
|
|
@@ -1063,15 +1051,15 @@
|
|
|
1063
1051
|
batchDataId: arrRows[0].dataId
|
|
1064
1052
|
});
|
|
1065
1053
|
|
|
1054
|
+
this.flowBatchPendingDialog = true;
|
|
1066
1055
|
this.initUpdateFlowForm(arrRows[0]).then(()=>{
|
|
1067
|
-
this.flowBatchPendingDialog = true;
|
|
1068
1056
|
this.batchUpdateFormInfo.formShow = true;
|
|
1069
1057
|
let ref='batchTableForm'+arrRows[0].dataId+'Ref'
|
|
1070
1058
|
|
|
1071
1059
|
this.$nextTick(()=>{
|
|
1072
|
-
this.$refs[ref][0].loadData().then(() => {
|
|
1073
|
-
|
|
1074
|
-
})
|
|
1060
|
+
// this.$refs[ref][0].loadData().then(() => {
|
|
1061
|
+
this.exeFlowEvent("handle","afterClick",arrRows[0].currentNode,ref);
|
|
1062
|
+
// })
|
|
1075
1063
|
})
|
|
1076
1064
|
});
|
|
1077
1065
|
},
|
|
@@ -1208,6 +1196,9 @@
|
|
|
1208
1196
|
this.flowInstDataDialog = false;
|
|
1209
1197
|
if (resData.flowInstId) {
|
|
1210
1198
|
this.$message({type: "success", message: "保存成功!"});
|
|
1199
|
+
if (this.flowBatchPendingDialog) {//批量处理 需处理tab页
|
|
1200
|
+
this.batchSaveDraft();
|
|
1201
|
+
}
|
|
1211
1202
|
} else {
|
|
1212
1203
|
this.$message({type: "error", message: "保存失败!"});
|
|
1213
1204
|
}
|
|
@@ -1577,9 +1568,9 @@
|
|
|
1577
1568
|
let ref='batchTableForm'+dataId+'Ref';
|
|
1578
1569
|
|
|
1579
1570
|
this.$nextTick(()=>{
|
|
1580
|
-
this.$refs[ref][0].loadData().then(() => {
|
|
1581
|
-
|
|
1582
|
-
})
|
|
1571
|
+
// this.$refs[ref][0].loadData().then(() => {
|
|
1572
|
+
this.exeFlowEvent("handle","afterClick",currentNode,ref);
|
|
1573
|
+
// })
|
|
1583
1574
|
})
|
|
1584
1575
|
|
|
1585
1576
|
},
|
|
@@ -1607,9 +1598,9 @@
|
|
|
1607
1598
|
this.initUpdateFlowForm(nextTab).then(()=>{
|
|
1608
1599
|
this.$nextTick(()=>{
|
|
1609
1600
|
let ref='batchTableForm'+nextTab.dataId+'Ref';
|
|
1610
|
-
this.$refs[ref][0].loadData().then(() => {
|
|
1611
|
-
|
|
1612
|
-
})
|
|
1601
|
+
// this.$refs[ref][0].loadData().then(() => {
|
|
1602
|
+
this.exeFlowEvent("handle","afterClick",nextTab.currentNode,ref);
|
|
1603
|
+
// })
|
|
1613
1604
|
})
|
|
1614
1605
|
});
|
|
1615
1606
|
}
|
|
@@ -2162,9 +2153,9 @@
|
|
|
2162
2153
|
/**
|
|
2163
2154
|
* 批量处理存草稿
|
|
2164
2155
|
*/
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2156
|
+
batchSaveDraft() {
|
|
2157
|
+
this.batchTabRemove(this.currentInst.dataId);
|
|
2158
|
+
},
|
|
2168
2159
|
|
|
2169
2160
|
|
|
2170
2161
|
/**
|
|
@@ -2276,8 +2267,8 @@
|
|
|
2276
2267
|
// }
|
|
2277
2268
|
//工作流节点
|
|
2278
2269
|
this.startNodeKey = "Activity_draft";
|
|
2279
|
-
|
|
2280
|
-
|
|
2270
|
+
this.startNodeKeyObj = {};
|
|
2271
|
+
// let flowVersion = this.flowDefine.flowVersion || '1.0';
|
|
2281
2272
|
this.FLOW_GLOBAL.getFlowNodesByFlowId(this.flowData.flowId).then(nodeDatas => {
|
|
2282
2273
|
if (nodeDatas) {
|
|
2283
2274
|
nodeDatas.forEach(item => {
|
|
@@ -2290,19 +2281,19 @@
|
|
|
2290
2281
|
}
|
|
2291
2282
|
this.$set(this.flowVersionNodeObj[item.version],item.nodeLinkId,item); //版本节点对象
|
|
2292
2283
|
// if(item.version == this.flowDefine.releaseVersion){ //节点信息只取最新版本
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
}
|
|
2284
|
+
this.flowNodeIdToInfo[item.id] = item;
|
|
2285
|
+
if(item.nodeType&&['StartEvent','ParallelGateway','SequenceFlow','ExclusiveGateway','InclusiveGateway'].indexOf(item.nodeType) == -1){
|
|
2286
|
+
if(!this.flowNodeNameObj[item.nodeLinkId]){
|
|
2287
|
+
this.$set(this.flowNodeNameObj,item.nodeLinkId,item.nodeName);
|
|
2288
|
+
}else {
|
|
2289
|
+
if(this.flowNodeNameObj[item.nodeLinkId] != item.nodeName){
|
|
2290
|
+
this.flowNodeNameObj[item.nodeLinkId] = this.flowNodeNameObj[item.nodeLinkId] + "," + item.nodeName;
|
|
2301
2291
|
}
|
|
2302
2292
|
}
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2293
|
+
}
|
|
2294
|
+
if(item.nodeType == "UserTask" && (item.nodeLinkId || "").indexOf("Activity_draft") > -1){
|
|
2295
|
+
this.draftNodeId = item.id; // 草稿节点id
|
|
2296
|
+
}
|
|
2306
2297
|
// }
|
|
2307
2298
|
this.allNodeInfo[item.id] = item;
|
|
2308
2299
|
// 行按钮
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
<!--修改内容-->
|
|
2
|
+
<template>
|
|
3
|
+
<!--接口参数设置-->
|
|
4
|
+
<el-container style="height: 100%;background-color: white;">
|
|
5
|
+
<el-header style="height: auto;position: relative" size="medium">
|
|
6
|
+
<el-button type="primary" size="small" round icon="el-icon-circle-plus" @click="addSelectOption()">新增
|
|
7
|
+
</el-button>
|
|
8
|
+
<el-button type="danger" size="small" round icon="el-icon-delete" @click="deleteSelectOption()">删除
|
|
9
|
+
</el-button>
|
|
10
|
+
</el-header>
|
|
11
|
+
<el-form :model="eventData" ref="nodeBasicForm" size="small" style="width: 100%">
|
|
12
|
+
<el-main id="tableMain" style="height: 100%;">
|
|
13
|
+
<el-table :data="eventData.conditionArr" stripe style="width: 100%;" border ref="selectOptionTableRef" max-height="300px">
|
|
14
|
+
<el-table-column type="selection" width="40" align="center"></el-table-column>
|
|
15
|
+
<el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
16
|
+
|
|
17
|
+
<el-table-column label="字段" width="220" align="center">
|
|
18
|
+
<template slot-scope="scope">
|
|
19
|
+
<el-form-item :prop="'conditionArr.' + scope.$index + '.field'" :rules="plValidate('required')" >
|
|
20
|
+
<el-select v-model="scope.row.field"
|
|
21
|
+
:size="size" placeholder="请选择" filterable style="width: 100%">
|
|
22
|
+
<el-option v-for="(nodePower,index) in nodePowerDataArr"
|
|
23
|
+
:key="index"
|
|
24
|
+
:label="nodePower.fieldName"
|
|
25
|
+
:value="nodePower.field">
|
|
26
|
+
</el-option>
|
|
27
|
+
</el-select>
|
|
28
|
+
</el-form-item>
|
|
29
|
+
</template>
|
|
30
|
+
</el-table-column>
|
|
31
|
+
|
|
32
|
+
<el-table-column prop="valType" label="值类型" align="center" width="500">
|
|
33
|
+
<template slot-scope="scope" v-if="scope.row.operaSign != 'is null' && scope.row.operaSign != 'is not null'">
|
|
34
|
+
<el-form-item :prop="'conditionArr.' + scope.$index + '.valType'" :rules="plValidate('required')" label-width="0px">
|
|
35
|
+
<el-select v-model="scope.row.valType" :size="size" @change="changeValType(scope.row)">
|
|
36
|
+
<el-option v-for="(valType,key) in valTypeObj" :key="key" :value="key" :label="valType"></el-option>
|
|
37
|
+
</el-select>
|
|
38
|
+
</el-form-item>
|
|
39
|
+
</template>
|
|
40
|
+
</el-table-column>
|
|
41
|
+
|
|
42
|
+
<el-table-column prop="value" label="值" align="center" >
|
|
43
|
+
<template slot-scope="scope" v-if="scope.row.operaSign != 'is null' && scope.row.operaSign != 'is not null'">
|
|
44
|
+
<el-form-item v-if="scope.row.valType && scope.row.valType == 'sysData'" :prop="'conditionArr.' + scope.$index + '.value'">
|
|
45
|
+
<!--用于数据字典-->
|
|
46
|
+
<el-cascader v-if="scope.row.valType == 'sysData'" style="width: 100%"
|
|
47
|
+
v-model="scope.row.value"
|
|
48
|
+
:options="dataTreeArr"
|
|
49
|
+
expand-trigger="hover"
|
|
50
|
+
filterable
|
|
51
|
+
:size="size">
|
|
52
|
+
</el-cascader>
|
|
53
|
+
</el-form-item>
|
|
54
|
+
|
|
55
|
+
<el-form-item v-if="scope.row.valType && scope.row.valType == 'diy'" :prop="'conditionArr.' + scope.$index + '.value'">
|
|
56
|
+
<!--用于自定义-->
|
|
57
|
+
<el-input v-if="scope.row.valType == 'diy'" type="input" v-model="scope.row.value" :size="size">
|
|
58
|
+
</el-input>
|
|
59
|
+
</el-form-item>
|
|
60
|
+
|
|
61
|
+
<el-form-item v-if="scope.row.valType && scope.row.valType == 'number'" :prop="'conditionArr.' + scope.$index + '.value'" :rules="plValidate('number')">
|
|
62
|
+
<!--用于自定义-->
|
|
63
|
+
<el-input v-if="scope.row.valType == 'number'" type="input" v-model="scope.row.value" :size="size">
|
|
64
|
+
</el-input>
|
|
65
|
+
</el-form-item>
|
|
66
|
+
|
|
67
|
+
<el-form-item v-if="scope.row.valType && scope.row.valType == 'user'" :prop="'conditionArr.' + scope.$index + '.value'">
|
|
68
|
+
<!--用户信息-->
|
|
69
|
+
<el-select v-if="scope.row.valType == 'user'" style="width: 100%"
|
|
70
|
+
v-model="scope.row.value">
|
|
71
|
+
<el-option v-for="item in userInfoArr"
|
|
72
|
+
:key="item.value"
|
|
73
|
+
:label="item.label"
|
|
74
|
+
:value="item.value">
|
|
75
|
+
</el-option>
|
|
76
|
+
</el-select>
|
|
77
|
+
</el-form-item>
|
|
78
|
+
</template>
|
|
79
|
+
</el-table-column>
|
|
80
|
+
</el-table>
|
|
81
|
+
</el-main>
|
|
82
|
+
</el-form>
|
|
83
|
+
</el-container>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script>
|
|
87
|
+
import EventParentConfig from "../eventParentConfig";
|
|
88
|
+
import {Replace} from "sasp-base";
|
|
89
|
+
export default {
|
|
90
|
+
name: "flow-edit-content-config",
|
|
91
|
+
extends: EventParentConfig,
|
|
92
|
+
eventType: 'flow',
|
|
93
|
+
eventName:'修改表单内容',
|
|
94
|
+
data(){
|
|
95
|
+
return{
|
|
96
|
+
size:"samll",
|
|
97
|
+
valTypeObj:{
|
|
98
|
+
"user":"当前用户信息",
|
|
99
|
+
"sysData":"数据字典",
|
|
100
|
+
"number":"自定义数字",
|
|
101
|
+
"diy":"自定义文本"
|
|
102
|
+
},
|
|
103
|
+
dataSourceArr:[
|
|
104
|
+
{label:"缺省值",value:"default"},
|
|
105
|
+
{label:"数据字典",value:"data"},
|
|
106
|
+
{label:"表单字段",value:"formField"},
|
|
107
|
+
{label:"自定义",value:"diy"}
|
|
108
|
+
],
|
|
109
|
+
|
|
110
|
+
//缺省值类型
|
|
111
|
+
defaultArr:[
|
|
112
|
+
{label:"用户名",value:"LOGINUSER.userName"},
|
|
113
|
+
{label:"用户ID",value:"LOGINUSER.userId"},
|
|
114
|
+
{label:"用户账户",value:"LOGINUSER.userAccount"},
|
|
115
|
+
{label:"用户类型",value:"LOGINUSER.userType"},
|
|
116
|
+
{label:"关联ID",value:"LOGINUSER.linkId"},
|
|
117
|
+
{label:"组织名称",value:"LOGINUSER.mainOrgName"},
|
|
118
|
+
{label:"组织ID",value:"LOGINUSER.mainOrgId"},
|
|
119
|
+
{label:"部门名称",value:"LOGINUSERDEPT.orgName"},
|
|
120
|
+
{label:"部门ID",value:"LOGINUSERDEPT.id"},
|
|
121
|
+
{label:"组织岗位用户ID",value:"LOGINUSER.orgPosUserIds"},
|
|
122
|
+
{label:"用户所属省ID",value:"LOGINUSERDEPT.province"},
|
|
123
|
+
{label:"用户所属市ID",value:"LOGINUSERDEPT.city"},
|
|
124
|
+
{label:"用户所属区ID",value:"LOGINUSERDEPT.area"},
|
|
125
|
+
{label:"用户所属街道ID",value:"LOGINUSERDEPT.street"},
|
|
126
|
+
{label:"用户所属省名称",value:"LOGINUSERDEPT.provinceName"},
|
|
127
|
+
{label:"用户所属市名称",value:"LOGINUSERDEPT.cityName"},
|
|
128
|
+
{label:"用户所属区名称",value:"LOGINUSERDEPT.areaName"},
|
|
129
|
+
{label:"用户所属街道名称",value:"LOGINUSERDEPT.streetName"},
|
|
130
|
+
{label:"系统时间",value:"SYSTIME.yearMoNday"},
|
|
131
|
+
],
|
|
132
|
+
userInfoArr:[
|
|
133
|
+
{
|
|
134
|
+
"value":"LOGINUSER.userId",
|
|
135
|
+
"label":"用户ID",
|
|
136
|
+
},{
|
|
137
|
+
"value":"LOGINUSER.userName",
|
|
138
|
+
"label":"用户名称",
|
|
139
|
+
},
|
|
140
|
+
], //用户信息
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
created(){
|
|
144
|
+
|
|
145
|
+
},
|
|
146
|
+
methods:{
|
|
147
|
+
/**
|
|
148
|
+
* 添加选项
|
|
149
|
+
*/
|
|
150
|
+
addSelectOption(){
|
|
151
|
+
this.$refs.nodeBasicForm.validate(valid => {
|
|
152
|
+
if (!valid) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if(!this.eventData.conditionArr){
|
|
156
|
+
this.$set(this.eventData,"conditionArr",[]);
|
|
157
|
+
}
|
|
158
|
+
this.eventData.conditionArr.push({
|
|
159
|
+
field: '', //字段
|
|
160
|
+
operaSign: '', //单一通过
|
|
161
|
+
valType: '', //值类型
|
|
162
|
+
value:'',
|
|
163
|
+
key:this.COMMON_FUNC.getUuidByParams(16), //唯一标志
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* 根据index 删除选项
|
|
172
|
+
*/
|
|
173
|
+
deleteSelectOption(){
|
|
174
|
+
let selection = this.$refs["selectOptionTableRef"].selection || [];
|
|
175
|
+
if(selection.length == 0){
|
|
176
|
+
this.$message.warning('请至少选择一条需要删除的数据');
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
this.$confirm('是否确定删除选择的“' + selection.length + '”条数据?', '警告', {
|
|
181
|
+
confirmButtonText: '确定',
|
|
182
|
+
cancelButtonText: '取消',
|
|
183
|
+
}).then(()=> {
|
|
184
|
+
let keyArr = [];
|
|
185
|
+
selection.forEach(item =>{
|
|
186
|
+
keyArr.push(item.key);
|
|
187
|
+
});
|
|
188
|
+
this.eventData.conditionArr = (this.eventData.conditionArr || []).filter(({ key }) => keyArr.indexOf(key) == -1);
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* 切换
|
|
198
|
+
* @param eventData
|
|
199
|
+
*/
|
|
200
|
+
dataTypeChange(eventData){
|
|
201
|
+
this.$set(eventData,'value',null);
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* 切换数据后值清空
|
|
206
|
+
* @param eventData
|
|
207
|
+
*/
|
|
208
|
+
changeDic(eventData){
|
|
209
|
+
this.$set(eventData,'value',null);
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 校验规则,不写默认通过
|
|
215
|
+
*/
|
|
216
|
+
validateMethod(){
|
|
217
|
+
let flag = true;
|
|
218
|
+
//校验
|
|
219
|
+
let nodeBasicForm = this.$refs.nodeBasicForm;
|
|
220
|
+
if(!nodeBasicForm){
|
|
221
|
+
flag = false;
|
|
222
|
+
}
|
|
223
|
+
nodeBasicForm.validate((validate) => {
|
|
224
|
+
if (!validate) {
|
|
225
|
+
flag = false;
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
return flag;
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 如果是表单规则(eventType: 'tableView')走此渲染方法
|
|
234
|
+
* @vm 当前整个表单对象
|
|
235
|
+
* @CTX 后台url前缀 如 http://localhost:8080
|
|
236
|
+
* @axios axios 请求对象
|
|
237
|
+
* @nodeObj 节点obj
|
|
238
|
+
* @formData 表单字段
|
|
239
|
+
* @affectContent 响应配置(表单规则配置好数据)
|
|
240
|
+
* @executeType 执行类型
|
|
241
|
+
*
|
|
242
|
+
*/
|
|
243
|
+
renderFlowConfig(vm,CTX,axios,nodeObj,formData,affectContent,executeType){
|
|
244
|
+
if(executeType == 'suspend'){ //流程中止后需要单独操作
|
|
245
|
+
let paramsObj = {};
|
|
246
|
+
paramsObj["id"] = formData.ID;
|
|
247
|
+
(affectContent.conditionArr || []).forEach(affect =>{
|
|
248
|
+
let field = affect.field;
|
|
249
|
+
if(field){
|
|
250
|
+
if(affect.valType == 'diy'){ //自定义文本
|
|
251
|
+
paramsObj[field] = affect.value || '';
|
|
252
|
+
}else if(affect.valType == 'number'){ //自定义数字
|
|
253
|
+
if(affect.value && !isNaN(Number(affect.value)) ){
|
|
254
|
+
paramsObj[field] = affect.value;
|
|
255
|
+
}else {
|
|
256
|
+
paramsObj[field] = '';
|
|
257
|
+
}
|
|
258
|
+
}else if(affect.valType == 'sysData'){ //数据字典
|
|
259
|
+
if(affect.value){
|
|
260
|
+
let maxIndex = affect.value.length - 1;
|
|
261
|
+
paramsObj[field] = affect.value[maxIndex] || '';
|
|
262
|
+
}
|
|
263
|
+
}else if(affect.valType == 'user'){
|
|
264
|
+
if(affect.value.indexOf("LOGINUSER") > -1){
|
|
265
|
+
let value = Replace.def(vm.loginUser,affect.value) || "";
|
|
266
|
+
paramsObj[field] = value;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
//更新表单
|
|
272
|
+
axios.post(vm.api.plCommonmethod.url + "/updateById", {"formId":vm.formInfo.formId,"dataId":formData.ID,"updateParams":JSON.stringify(paramsObj)}).then(res => {
|
|
273
|
+
|
|
274
|
+
});
|
|
275
|
+
}else{ //其他类型
|
|
276
|
+
(affectContent.conditionArr || []).forEach(affect =>{
|
|
277
|
+
let field = affect.field;
|
|
278
|
+
if(field){
|
|
279
|
+
if(affect.valType == 'diy'){ //自定义文本
|
|
280
|
+
vm.$set(formData,field,affect.value || '')
|
|
281
|
+
}else if(affect.valType == 'number'){ //自定义数字
|
|
282
|
+
if(affect.value && !isNaN(Number(affect.value)) ){
|
|
283
|
+
vm.$set(formData,field,affect.value);
|
|
284
|
+
}else {
|
|
285
|
+
vm.$set(formData,field,'');
|
|
286
|
+
}
|
|
287
|
+
}else if(affect.valType == 'sysData'){ //数据字典
|
|
288
|
+
if(affect.value){
|
|
289
|
+
let maxIndex = affect.value.length - 1;
|
|
290
|
+
vm.$set(formData,field,affect.value[maxIndex] || '');
|
|
291
|
+
}
|
|
292
|
+
}else if(affect.valType == 'user'){
|
|
293
|
+
if(affect.value.indexOf("LOGINUSER") > -1){
|
|
294
|
+
let value = Replace.def(vm.loginUser,affect.value) || "";
|
|
295
|
+
vm.$set(formData,field,value)
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* 切换值类型
|
|
305
|
+
* @param row
|
|
306
|
+
*/
|
|
307
|
+
changeValType(row){
|
|
308
|
+
if(row.valType == 'diy' || row.valType == 'number' || row.valType == 'user'){
|
|
309
|
+
this.$set(row,'value','');//重置值
|
|
310
|
+
}else if(row.valType == 'sysData'){
|
|
311
|
+
this.$set(row,'value',[]);//重置值
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
</script>
|
|
318
|
+
|
|
319
|
+
<style scoped>
|
|
320
|
+
|
|
321
|
+
</style>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {eventPlugin} from "sasp-base";
|
|
2
1
|
import axios from "axios/index";
|
|
3
2
|
import apiFlow from "../../../../assets/js/api/apiFlow";
|
|
4
3
|
|
|
@@ -167,113 +166,117 @@ let eventObj = {}; //事件对象
|
|
|
167
166
|
|
|
168
167
|
export default {
|
|
169
168
|
name: "loadEventPlugin",
|
|
170
|
-
installAll(){
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
169
|
+
installAll(Vue){
|
|
170
|
+
axios.post(apiFlow.apis.eventRule.findByVersion,{"eventTypes":"flow"}).then(res =>{ //查询流程相关事件规则
|
|
171
|
+
let eventPlugin = Vue.prototype.EVENT_PLUGIN || {};
|
|
172
|
+
if(res){
|
|
173
|
+
Object.keys(diyEventObjs).forEach(key =>{
|
|
174
|
+
//加载列格式化
|
|
175
|
+
diyEventObjs[key].forEach(item =>{
|
|
176
|
+
eventPlugin.preActiveEventRule(item);
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
//加载系统事件规则
|
|
180
|
+
Object.keys(sysEventObjs).forEach(key =>{
|
|
181
|
+
//加载列格式化
|
|
182
|
+
sysEventObjs[key].forEach(item =>{
|
|
183
|
+
eventPlugin.installEventRule(item);
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
if(!Array.isArray(res.data)){
|
|
188
|
+
res.data = [];
|
|
189
|
+
}
|
|
190
|
+
(res.data || []).forEach(item =>{
|
|
191
|
+
if(item.eventUse == '1' && item.dataSource == '2')
|
|
192
|
+
{
|
|
193
|
+
//将后台返回的配置字符串转换为config组件,渲染字符串转化为render组件
|
|
194
|
+
let configStr = item.eventConfigurationStr; //配置文件字符串
|
|
195
|
+
let renderStr = item.eventRenderStr; //渲染文件字符串
|
|
196
|
+
let eventComp = {"id":item.eventKey,
|
|
197
|
+
"name":item.eventName,
|
|
198
|
+
"eventSource": item.eventSource,
|
|
199
|
+
"eventType":item.eventType,
|
|
200
|
+
"dataSource":item.dataSource,
|
|
201
|
+
"config":null,
|
|
202
|
+
"render":null};
|
|
203
|
+
if(configStr){
|
|
204
|
+
let configObj = JSON.parse(configStr);
|
|
205
|
+
let tempComp = configObj["comp"];
|
|
206
|
+
let method = configObj["method"];
|
|
207
|
+
// 转化
|
|
208
|
+
try {
|
|
209
|
+
recoverComponent(method);
|
|
210
|
+
}catch (e) {
|
|
211
|
+
console.log(e);
|
|
212
|
+
}
|
|
213
|
+
assignLevel(tempComp,method);
|
|
214
|
+
Object.assign(eventComp,{"config":tempComp});
|
|
215
|
+
}
|
|
216
|
+
if(renderStr){
|
|
217
|
+
let renderObj = JSON.parse(renderStr);
|
|
218
|
+
let tempComp = renderObj["comp"];
|
|
219
|
+
let obj = renderObj["method"];
|
|
220
|
+
recoverComponent(obj);
|
|
221
|
+
assignLevel(tempComp,obj);
|
|
222
|
+
Object.assign(eventComp,{"render":tempComp});
|
|
223
|
+
}
|
|
224
|
+
eventPlugin.installEventRule(eventComp); //执行注册
|
|
225
|
+
|
|
226
|
+
function recoverComponent(result){
|
|
227
|
+
Object.keys(result).forEach(key => {
|
|
228
|
+
if(Array.isArray(result[key])){
|
|
229
|
+
if(key == "beforeCreate" || key == "beforeDestroy"){
|
|
230
|
+
result[key] = [];
|
|
231
|
+
}else{
|
|
232
|
+
result[key].forEach((item,index) => {
|
|
233
|
+
let name = item.name || "a";
|
|
234
|
+
result[key][index] = new Function("let " + name + " = "+ item +";return " + name + ";")();
|
|
235
|
+
})
|
|
236
|
+
}
|
|
237
|
+
}else if (typeof result[key] === "object"){
|
|
238
|
+
if(result[key]["beforeCreate"] && result[key]["beforeDestroy"]){
|
|
239
|
+
recoverComponent(result[key]);
|
|
240
|
+
}else{
|
|
241
|
+
Object.keys(result[key]).forEach(temKey => {
|
|
242
|
+
let name = result[key][temKey].name || temKey;
|
|
243
|
+
if(Number(name) || Number(name) === 0){
|
|
244
|
+
name = "a";
|
|
245
|
+
}
|
|
246
|
+
result[key][temKey] = new Function("let " + name + " = " + result[key][temKey] +";return " + name + ";")();
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
}else{
|
|
250
|
+
let name = result[key].name || key;
|
|
251
|
+
result[key] = new Function("let " + name + " = " + result[key] +";return " + name + ";")();
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
// 多级对象复制方法
|
|
256
|
+
function assignLevel(target,source){
|
|
257
|
+
let value = {};
|
|
258
|
+
Object.keys(target).forEach(key => {
|
|
259
|
+
if(typeof target[key] === "object" && target[key]["beforeCreate"] && target[key]["beforeDestroy"]){
|
|
260
|
+
value[key] = target[key];
|
|
261
|
+
assignLevel(value[key],source[key]);
|
|
262
|
+
delete target[key];
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
Object.assign(target,source,value);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if(item.dataSource == '1') { //数据库已经保存得组件注册
|
|
269
|
+
Object.keys(diyEventObjs).forEach(key => {
|
|
270
|
+
diyEventObjs[key].forEach(comp =>{
|
|
271
|
+
if(comp.id == item.eventKey){
|
|
272
|
+
eventPlugin.installEventRule(comp);//全局注册
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
});
|
|
277
280
|
|
|
278
281
|
}
|
|
279
282
|
}
|