sasp-flow-render 1.0.1

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.
Files changed (68) hide show
  1. package/index.js +108 -0
  2. package/package.json +21 -0
  3. package/router.js +13 -0
  4. package/src/assets/font/iconfont.css +1158 -0
  5. package/src/assets/font/iconfont.eot +0 -0
  6. package/src/assets/font/iconfont.js +1 -0
  7. package/src/assets/font/iconfont.svg +827 -0
  8. package/src/assets/font/iconfont.ttf +0 -0
  9. package/src/assets/font/iconfont.woff +0 -0
  10. package/src/assets/images/card_zwsj.png +0 -0
  11. package/src/assets/images/dataStore.png +0 -0
  12. package/src/assets/images/dataStore_icon.png +0 -0
  13. package/src/assets/images/draft.png +0 -0
  14. package/src/assets/images/edit_icon.png +0 -0
  15. package/src/assets/images/end.png +0 -0
  16. package/src/assets/images/end_icon.png +0 -0
  17. package/src/assets/images/gateway.png +0 -0
  18. package/src/assets/images/gateway_icon.png +0 -0
  19. package/src/assets/images/globalConnect_icon.png +0 -0
  20. package/src/assets/images/group_icon.png +0 -0
  21. package/src/assets/images/hander_icon.png +0 -0
  22. package/src/assets/images/icon_ quality.png +0 -0
  23. package/src/assets/images/lasso_icon.png +0 -0
  24. package/src/assets/images/mobile_preview.png +0 -0
  25. package/src/assets/images/participant_icon.png +0 -0
  26. package/src/assets/images/publicProcess_icon.png +0 -0
  27. package/src/assets/images/remind_example.png +0 -0
  28. package/src/assets/images/space_icon.png +0 -0
  29. package/src/assets/images/start.png +0 -0
  30. package/src/assets/images/start_icon.png +0 -0
  31. package/src/assets/images/subprocess_icon.png +0 -0
  32. package/src/assets/images/tab_set_example.png +0 -0
  33. package/src/assets/images/timer.png +0 -0
  34. package/src/assets/images/timer_icon.png +0 -0
  35. package/src/assets/images/userTask_icon.png +0 -0
  36. package/src/assets/images/user_task.png +0 -0
  37. package/src/assets/js/api/apiFlow.js +219 -0
  38. package/src/assets/js/flowInstall.js +25 -0
  39. package/src/assets/js/global/cacheGlobal.js +110 -0
  40. package/src/assets/js/global/flowGlobal.js +61 -0
  41. package/src/assets/js/global/flowUserGlobal.js +35 -0
  42. package/src/assets/js/global/interfaceCache.js +31 -0
  43. package/src/assets/js/storageIO.js +106 -0
  44. package/src/components/flowChart.vue +463 -0
  45. package/src/components/flowInst/css/flowInstList.scss +193 -0
  46. package/src/components/flowInst/flowInstList.vue +818 -0
  47. package/src/components/flowInst/flowInstTab.vue +2858 -0
  48. package/src/components/flowInst/popup/flowInstForm.vue +54 -0
  49. package/src/components/flowRoamRecords.vue +768 -0
  50. package/src/components/messageMould/messageMould.vue +547 -0
  51. package/src/components/roamRecord.vue +567 -0
  52. package/src/components/userSelect.vue +537 -0
  53. package/src/views/flowInstView.vue +178 -0
  54. package/src/views/menuRouter/flowMenuRouter.vue +260 -0
  55. package/src/views/menuRouter/flowResRouter.vue +223 -0
  56. package/src/views/popup/css/flowMain.scss +156 -0
  57. package/src/views/popup/event/compoment/diy/info.txt +1 -0
  58. package/src/views/popup/event/compoment/eventParentConfig.vue +45 -0
  59. package/src/views/popup/event/js/loadFlowEventPlugin.js +279 -0
  60. package/src/views/popup/js/controls/CustomContextPad.js +310 -0
  61. package/src/views/popup/js/controls/CustomPalette.js +303 -0
  62. package/src/views/popup/js/controls/CustomRenderer.js +219 -0
  63. package/src/views/popup/js/controls/index.js +11 -0
  64. package/src/views/popup/js/customModeler/CustomModeler.js +22 -0
  65. package/src/views/popup/js/translations/customTranslate.js +14 -0
  66. package/src/views/popup/js/translations/translations.js +234 -0
  67. package/src/views/popup/js/utils/utils.js +53 -0
  68. package/src/views/test.vue +79 -0
@@ -0,0 +1,818 @@
1
+ <template>
2
+ <el-container style="height: 100%;">
3
+ <el-header style="height: auto;">
4
+ <div class="search-form-parent el-card">
5
+ <el-form :inline="true" :model="crud.searchForm" size="small" class="demo-form-inline"
6
+ @keyup.enter.native="doSearch()" onSubmit="return false;">
7
+ <el-form-item label="事项概述"
8
+ v-if="isShow('draft,pending,processed,finished,rescinded,discontinue,flowQuery')">
9
+ <el-input v-model="crud.searchForm.flowSummary"></el-input>
10
+ </el-form-item>
11
+ <el-form-item label="启动人"
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>
18
+ </el-form-item>
19
+
20
+ <el-form-item label="当前处理人" v-if="isShow('flowQuery')">
21
+ <el-select v-model="crud.searchForm.dealUserId" style="width: 90px;" filterable allow-create clearable>
22
+ <el-option v-for="item in userArr" :key="item.id" :value="item.id" :label="item.userName">
23
+
24
+ </el-option>
25
+ </el-select>
26
+ </el-form-item>
27
+ <el-form-item label="当前任务" v-if="isShow('pending,processed,flowQuery')">
28
+ <el-select v-model="crud.searchForm.currentNode" filterable clearable style="width: 130px;">
29
+ <el-option v-for="(nodeName,nodeIdStr) in flowNodeNameObj" :key="nodeIdStr" :value="nodeIdStr"
30
+ :label="nodeName"></el-option>
31
+ </el-select>
32
+ </el-form-item>
33
+ <el-form-item label="流程状态" v-if="isShow('flowQuery')">
34
+ <el-select v-model="crud.searchForm.flowStatus" style="width: 130px;" clearable>
35
+ <el-option v-for="(value,key) in flowStatusForm" :key="key" :value="key"
36
+ :label="value"></el-option>
37
+ </el-select>
38
+ </el-form-item>
39
+ <el-form-item label="启动时间" v-if="isShow('processed,finished,rescinded,discontinue,flowQuery')">
40
+ <el-date-picker v-model="crud.searchForm.startTime" type="daterange" value-format="yyyy-MM-dd"
41
+ style="width: 240px;"
42
+ range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间">
43
+ </el-date-picker>
44
+ </el-form-item>
45
+ <el-form-item>
46
+ <el-button type="primary" icon="el-icon-search" @click="doSearch()">查询</el-button>
47
+ <el-button icon="el-icon-close" @click="resetSearch()">清空</el-button>
48
+ </el-form-item>
49
+ </el-form>
50
+ </div>
51
+ </el-header>
52
+ <el-main style="height: 100%;padding:0 10px">
53
+ <el-container style="height: 100%">
54
+ <el-header style="height: auto;padding:10px 0;">
55
+ <div v-if="isShow('draft')">
56
+ <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" round
57
+ @click="openAddFlowForm()">新增
58
+ </el-button>
59
+ <el-button type="danger" icon="el-icon-circle-close" size="small" round @click="deleteFlow()">
60
+ 删除
61
+ </el-button>
62
+ <!-- <el-button type="warning" icon="saspiconfont liuchengtu1" size="small" round>流程图</el-button>-->
63
+ </div>
64
+ </el-header>
65
+ <el-main style="height: 100%;padding: 0;" class="main-box">
66
+ <el-table :data="crud.dataStore.records" :ref="crud.tableRef"
67
+ v-if="showModel=='list'" stripe border height="100%" style="width: 100%;">
68
+ <el-table-column type="selection" width="40" align="center"
69
+ v-if="isShow('draft')"></el-table-column>
70
+ <el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
71
+ <el-table-column label="事项概述" prop="flowSummary" show-overflow-tooltip :formatter="formatterFlowSummary"></el-table-column>
72
+ <el-table-column label="启动人" prop="startUserId" v-if="isNotShow('draft')" width="100" align="center">
73
+ <template slot-scope="scope">
74
+ {{userMap[scope.row.startUserId]}}
75
+ </template>
76
+ </el-table-column>
77
+ <el-table-column :label="tabType=='draft'?'创建时间':'启动时间'" prop="saspStartTime" width="180" align="center"></el-table-column>
78
+ <el-table-column label="办结时间" prop="finishedTime" width="180" align="center"
79
+ v-if="isShow('finished')"></el-table-column>
80
+ <el-table-column label="撤销时间" prop="revokedTime" width="180" align="center"
81
+ v-if="isShow('rescinded')"></el-table-column>
82
+ <el-table-column label="中止时间" prop="discontinueTime" width="180" align="center"
83
+ v-if="isShow('discontinue')"></el-table-column>
84
+ <el-table-column label="当前任务" prop="currentNodeName" width="150" align="center"
85
+ v-if="!isShow('draft')" show-overflow-tooltip>
86
+ <template slot-scope="scope">
87
+ {{formatterCurrentNodeName(scope.row)}}
88
+ <span v-if="scope.row.operateStatus == '0' && scope.row.agentType == '0'">(正常)</span>
89
+ <span v-if="scope.row.operateStatus == '1'"
90
+ style="color: rgba(14,192,82,1);">(加签)</span>
91
+ <span v-if="scope.row.operateStatus == '3'"
92
+ style="color: rgba(52,133,255,1);">(转签)</span>
93
+ <span v-if="scope.row.operateStatus == '2'"
94
+ style="color: rgba(249,61,61,1);">(退回)</span>
95
+ <span v-if="scope.row.operateStatus == '4'"
96
+ style="color: rgba(249,61,61,1);">(取回)</span>
97
+ <span v-if="scope.row.agentType == '1'" style="color: rgba(52,204,255,1);">(已代理)</span>
98
+ <span v-if="scope.row.agentType == '2'" style="color: rgba(251,124,87,1);">(代理)</span>
99
+ <span v-if="scope.row.hangUp == '1'" style="color: rgba(254,195,35,1);">(已挂起)</span>
100
+ </template>
101
+ </el-table-column>
102
+ <el-table-column label="当前处理人" prop="currentDealer" width="150" :formatter="formaterDealer"
103
+ show-overflow-tooltip align="center" v-if="isShow(['processed','flowQuery'])">
104
+ </el-table-column>
105
+ <el-table-column label="流程状态" prop="flowStatus" width="100"
106
+ show-overflow-tooltip align="center" v-if="isShow(['flowQuery'])">
107
+ <template slot-scope="scope">
108
+ <el-tag :type="(flowStatusObj[scope.row.flowStatus] || {})['type']">
109
+ {{(flowStatusTagObj[scope.row.flowStatus] || {})["name"] || '其他'}}
110
+ </el-tag>
111
+ </template>
112
+ </el-table-column>
113
+ <el-table-column label="操作" align="center" :width="currentOptColumnWidth">
114
+ <template slot-scope="scope">
115
+ <el-button
116
+ v-for="buttonObj in nodeListButtonObj[scope.row.currentNode || (flowVersionNodeObj[scope.row.version][startNodeKeyObj[scope.row.version]] || {}).id] || []"
117
+ :key="buttonObj.type" size="small" type="primary"
118
+ v-if="judgeListButton(tabType,buttonObj.type)"
119
+ @click="listButtonOpt(buttonObj.type,scope.row)"
120
+ :icon="buttonIcon[buttonObj.type]" :type="buttonType[buttonObj.type]">
121
+ {{buttonObj.showName}}
122
+ </el-button>
123
+ <el-button v-if="scope.row.currentNode == 'end'" size="small"
124
+ @click="listButtonOpt('view',scope.row)"
125
+ icon="el-icon-view" type="primary">
126
+ 查看
127
+ </el-button>
128
+ <el-button v-if="scope.row.currentNode == 'end'" size="small"
129
+ @click="listButtonOpt('flowRecord',scope.row)"
130
+ icon="saspiconfont pl-icon-liuchengtu" type="primary">
131
+ 流转记录
132
+ </el-button>
133
+ </template>
134
+ </el-table-column>
135
+ </el-table>
136
+ <div v-if="showModel=='card'" :ref="crud.tableRef" style="width: 100%;margin-top: 5px;">
137
+ <div v-if="crud.dataStore.total>0" v-for="(item,index) in crud.dataStore.records" :key="index"
138
+ :class="mycardclass">
139
+ <el-card class="box-card" shadow="always"
140
+ :style="{'cursor':tabType == 'draft'? 'pointer':'default'}">
141
+ <div slot="header" class="clearfix" @click="clickCard(item,index)">
142
+ <div class="cardhead">
143
+ <span class="cardhead-title">{{item['startUserName']}}</span>
144
+ <el-tag v-if="item['currentNodeName']!='' && item['currentNodeName']!=undefined && !isShow('draft')"
145
+ size="small" class="cardhead-tag"
146
+ style="background-color: rgba(255,140,25,0.20);color: rgba(255,140,25,1);">
147
+ {{item['currentNodeName']}}
148
+ </el-tag>
149
+ <el-tag v-if="item['operateStatus']=='1'" size="small" class="cardhead-tag"
150
+ style="background-color: rgba(14,192,82,0.20);color: rgba(14,192,82,1);">
151
+ 加签
152
+ </el-tag>
153
+ <el-tag v-if="item['operateStatus']=='3'" size="small" class="cardhead-tag"
154
+ style="background-color: rgba(52,133,255,0.20);color: rgba(52,133,255,1);">
155
+ 转签
156
+ </el-tag>
157
+ <el-tag v-if="item['operateStatus']=='2'" size="small" class="cardhead-tag"
158
+ style="background-color: rgba(249,61,61,0.20);color: rgba(249,61,61,1);">
159
+ 退回
160
+ </el-tag>
161
+ <el-tag v-if="item['operateStatus']=='4'" size="small" class="cardhead-tag"
162
+ style="background-color: rgba(249,61,61,0.20);color: rgba(249,61,61,1);">
163
+ 取回
164
+ </el-tag>
165
+ <el-tag v-if="item['agentType']=='1'" size="small" class="cardhead-tag"
166
+ style="background-color: rgba(52,204,255,0.20);color: rgba(52,204,255,1)">
167
+ 已代理
168
+ </el-tag>
169
+ <el-tag v-if="item['agentType']=='2'" size="small" class="cardhead-tag"
170
+ style="background-color: rgba(251,124,87,0.20);color: rgba(251,124,87,1)">
171
+ 代理
172
+ </el-tag>
173
+ <el-tag v-if="item['hangUp']=='1'" size="small" class="cardhead-tag"
174
+ style="background-color: rgba(254,195,35,0.20);color: rgba(254,195,35,1)">
175
+ 已挂起
176
+ </el-tag>
177
+
178
+ <!--<el-tag size="small" class="cardhead-tag" style="background-color: rgba(254,195,35,0.20);color: rgba(254,195,35,1)">挂起</el-tag>-->
179
+ <i :id="'checkCard_'+index" class="el-icon-check"
180
+ style="cursor:pointer;visibility:hidden;position:absolute;top:12px;right: 10px;font-size: 30px;color:#409EFF;"></i>
181
+ </div>
182
+ </div>
183
+ <div class="mycardBody" @click="clickCard(item,index)">
184
+ <div class="cardbody-box" style="border-bottom: 1px dashed #E4EAF7;">
185
+ <div class="cardbody-title">事项概述:</div>
186
+ <el-tooltip class="item" effect="dark" :content="item['flowSummary']" placement="right-start">
187
+ <div class="cardbody-content">{{item['flowSummary']}}</div>
188
+ </el-tooltip>
189
+ </div>
190
+ <div class="cardbody-box" style="border-bottom: 1px dashed #E4EAF7;">
191
+ <div class="cardbody-title">启动人:</div>
192
+ <div class="cardbody-content">{{item['startUserName']}}</div>
193
+ </div>
194
+ <div class="cardbody-box">
195
+ <div class="cardbody-title">启动时间:</div>
196
+ <div class="cardbody-content">{{item['saspStartTime']}}</div>
197
+ </div>
198
+ </div>
199
+ <div class="mycardFoot">
200
+ <el-button
201
+ v-for="buttonObj in nodeListButtonObj[item.currentNode || (flowVersionNodeObj[scope.row.version][startNodeKeyObj[scope.row.version]] || {}).id]"
202
+ :key="buttonObj.type" size="small" round
203
+ v-if="judgeListButton(tabType,buttonObj.type)"
204
+ :class="cardButtonClass[buttonObj.type]"
205
+ @click="listButtonOpt(buttonObj.type,item)">
206
+ {{buttonObj.showName}}
207
+ </el-button>
208
+
209
+ <el-button v-if="item.currentNode == 'end'" size="small"
210
+ @click="listButtonOpt('view',item)"
211
+ :class="cardButtonClass['view']"
212
+ round type="primary">
213
+ 查看
214
+ </el-button>
215
+ <el-button v-if="item.currentNode == 'end'" size="small"
216
+ @click="listButtonOpt('flowRecord',item)"
217
+ :class="cardButtonClass['flowRecord']"
218
+ round type="primary">
219
+ 流转记录
220
+ </el-button>
221
+ </div>
222
+ </el-card>
223
+ </div>
224
+ <div v-if="crud.dataStore.total==0" style="margin-top: 10%;text-align: center;">
225
+ <img :src="cardNullUrl"/>
226
+ </div>
227
+ </div>
228
+ </el-main>
229
+ </el-container>
230
+ </el-main>
231
+ <el-footer style="padding: 16px 10px;">
232
+ <el-pagination
233
+ :ref="crud.pageRef"
234
+ :page-sizes="crud.pageSizes"
235
+ :page-size="crud.pageSize"
236
+ :current-page="crud.page"
237
+ :total="crud.dataStore.total"
238
+ @size-change="crud.sizeChange()"
239
+ @current-change="crud.currentPage()"
240
+ layout="total, sizes, prev, pager, next, jumper">
241
+ </el-pagination>
242
+ </el-footer>
243
+ </el-container>
244
+ </template>
245
+
246
+ <script>
247
+ import {Replace} from "sasp-base";
248
+ import FlowChart from "../flowChart";
249
+ import FlowRoamRecord from "../flowRoamRecords";
250
+
251
+ export default {
252
+ name: "flowInstList",
253
+ components: {FlowRoamRecord, FlowChart, Replace},
254
+ props: {
255
+ tabType: {type: String, default: "draft"},
256
+ flowDefine: {
257
+ type: Object, default: () => {
258
+ return {};
259
+ }
260
+ },//工作流配置信息
261
+ formId: {type: String, default: ""},
262
+ startNodeKey: {type: String, default: ""},//开始节点key
263
+ flowNodeIdToInfo: {
264
+ type: Object, default: () => {
265
+ return {};
266
+ }
267
+ },
268
+ flowNodeNameObj:{
269
+ type: Object, default: () => {
270
+ return {};
271
+ }
272
+ }, //根据节点名称分组的节点id (相同用逗号分隔)
273
+ nodeListButtonObj: {
274
+ type: Object, default: () => {
275
+ return {};
276
+ }
277
+ },//节点行按钮
278
+ optColumnWidth: {type: Number, default: 0},
279
+ showModel: {type: String, default: "list"},//流程状态
280
+
281
+ // 初始化查询
282
+ initSearch: {
283
+ type: Boolean, default() {
284
+ return false;
285
+ }
286
+ },
287
+
288
+ // 打开流程图回调函数
289
+ openFlowChart: {
290
+ type: Function, default() {
291
+
292
+ }
293
+ },
294
+
295
+ // 打开流转记录回调函数
296
+ openFlowRecord: {
297
+ type: Function, default() {
298
+
299
+ }
300
+ },
301
+
302
+ // 打开添加窗口回调函数
303
+ openAddFlowForm: {
304
+ type: Function, default() {
305
+
306
+ }
307
+ },
308
+
309
+ // 打开修改窗口回调函数
310
+ openUpdateFlowForm: {
311
+ type: Function, default() {
312
+
313
+ }
314
+ },
315
+
316
+ // 打开批量修改窗口回调函数
317
+ openBatchUpdateFlowForm: {
318
+ type: Function, default() {
319
+
320
+ }
321
+ },
322
+
323
+ // 打开查看窗口回调函数
324
+ openViewFlowForm: {
325
+ type: Function, default() {
326
+
327
+ }
328
+ },
329
+
330
+ //所有版本开始节点
331
+ startNodeKeyObj:{
332
+ type: Object, default: () => {
333
+ return {};
334
+ }
335
+ },
336
+ //所有版本节点信息
337
+ flowVersionNodeObj: {
338
+ type: Object, default: () => {
339
+ return {};
340
+ }
341
+ },
342
+ //用户
343
+ userArr: {
344
+ type: Array, default: () => {
345
+ return [];
346
+ }
347
+ },
348
+ userMap:{type: Object,default:()=>{return {};}},
349
+
350
+ instQueryPower:{type:String,default:""}
351
+
352
+ },
353
+ data() {
354
+
355
+ let objSearchUrl = {
356
+ "draft": this.api.plFlowInst.findFlowInstPage,
357
+ "pending": this.api.plFlowInst.findInstPending,
358
+ "processed": this.api.plFlowInst.findInstProcessed,
359
+ "finished": this.api.plFlowInst.findInstFinished,
360
+ "flowQuery": this.api.plFlowInst.findInstQueryNew,
361
+ "rescinded": this.api.plFlowInst.findRescinded,
362
+ "discontinue": this.api.plFlowInst.finDiscontinue,
363
+ };
364
+
365
+ return {
366
+ crud: new this.CrudUtil({
367
+ vue: this,
368
+ entityName: "plFlowInst",
369
+ url: this.api.plFlowInst.url,
370
+ searchUrl: objSearchUrl[this.tabType],
371
+ noClearSearchColumns: this.initNoClearSearch(),
372
+ initNoSearch: true,
373
+ }),
374
+ loginUser: this.CACHE_GLOBAL.getLoginUser(),//当前登录用户
375
+ userDept: this.CACHE_GLOBAL.getLoginDept(),
376
+ flowStatusObj: {//流程状态
377
+ all: '',
378
+ draft: 0,
379
+ pending: 1,
380
+ rescinded: 2,
381
+ discontinue: 3,
382
+ finished: 4
383
+ },
384
+
385
+ flowStatusForm: {
386
+ "0": "草稿",
387
+ "1": "处理中",
388
+ "2": "已撤销",
389
+ // "3": "已中止",
390
+ "4": "已办结"
391
+ },
392
+
393
+ flowStatusTagObj:{
394
+ "0":{"name":"草稿","type":"info"},
395
+ "1":{"name":"处理中","type":"success"},
396
+ "2":{"name":"已撤销","type":"danger"},
397
+ "3":{"name":"已中止","type":"warning"},
398
+ "4":{"name":"已办结","type":"primary"},
399
+ },
400
+
401
+ flowStatusObjNamme: {
402
+ all: '全部',
403
+ draft: '草稿',
404
+ pending: '待处理',
405
+ rescinded: '已撤销',
406
+ discontinue: '已中止',
407
+ finished: '已办结'
408
+ },
409
+
410
+ buttonIcon: {
411
+ update: "el-icon-edit",
412
+ deal: "el-icon-edit",
413
+ flowRecord: "saspiconfont pl-icon-liuchengtu",
414
+ flowChart: "saspiconfont pl-icon-gongzuoliuchengtu",
415
+ view: "el-icon-view",
416
+ },
417
+
418
+ buttonType: {
419
+ update: "primary",//修改
420
+ deal: "primary",//处理
421
+ flowRecord: "primary",//流转记录
422
+ flowChart: "primary",//流程图
423
+ view: "primary",//查看
424
+ },
425
+
426
+ operateStatus: {
427
+ 0: "正常",
428
+ 1: "加签",
429
+ 2: "取回",
430
+ 3: "转签",
431
+ 4: "已代理",
432
+ 5: "代理"
433
+ },
434
+
435
+ flowStatusTagType: {
436
+ "0": "info", // 草稿
437
+ "1": "success", // 处理中
438
+ "2": "warning", // 撤销
439
+ "3": "danger", //
440
+ "4": "primary", //
441
+ },
442
+
443
+ mycardclass: "myelcard4",//默认卡片样式
444
+ cardClickArr: [],//卡片选中数组
445
+ cardNullUrl: require("../../assets/images/card_zwsj.png"),//卡片暂无数据图标
446
+ cardButtonClass: {
447
+ "update": "myDealButton",
448
+ "flowRecord": "myFlowRecordButton",
449
+ "flowChart": "myFlowChartButton",
450
+ "deal": "myDealButton",
451
+ "view": "myDealButton"
452
+ },
453
+ currentOptColumnWidth: this.optColumnWidth,
454
+ screenWidth:"",
455
+ screenHeight:"",
456
+ }
457
+ },
458
+ created() {
459
+ this.init();
460
+ this.getListButton();
461
+ if (this.showModel == "card") {
462
+ this.checkScreenWidth();
463
+ window.addEventListener('resize', () => { //监听浏览器窗口大小改变
464
+ //浏览器变化执行动作
465
+ this.checkScreenWidth();
466
+ });
467
+ }
468
+ },
469
+ mounted() {
470
+ },
471
+ methods: {
472
+
473
+ /**
474
+ * 根据类型加载不需要清楚的
475
+ */
476
+ initNoClearSearch() {
477
+ if (this.isShow(['draft', 'pending', 'processed', 'rescinded', 'discontinue', 'finished'])) {
478
+ return ["flowId", "flowStatus", "dealUserId", "created", "nodeType"];
479
+ } else if (this.isShow(['flowQuery'])) {
480
+ return ["flowId", "created", "nodeType","instQueryPower","queryOrderSetting"];
481
+ }
482
+ },
483
+
484
+ init() {
485
+ this.crud.searchForm["flowId"] = this.flowDefine.id;
486
+ let flowStatus = this.flowStatusObj[this.tabType];
487
+ this.crud.searchForm["nodeType"] = this.tabType;
488
+ if (this.tabType == "draft") {
489
+ this.crud.searchForm["created"] = this.loginUser.id;
490
+ }
491
+ if (this.tabType == "pending" || this.tabType == "processed" || this.tabType == "finished"
492
+ || this.tabType == "rescinded" || this.tabType == "discontinue") {
493
+ this.crud.searchForm["dealUserId"] = this.loginUser.id;
494
+ flowStatus = this.flowStatusObj[this.tabType] || "1";
495
+ }
496
+ if(this.tabType == "flowQuery"){
497
+ this.crud.searchForm["instQueryPower"] = this.instQueryPower;
498
+ this.crud.searchForm["created"] = this.loginUser.id;
499
+ this.crud.searchForm["queryOrderSetting"] = this.flowDefine.queryOrderSetting;
500
+ }
501
+ this.$set(this.crud.searchForm, 'flowStatus', flowStatus);
502
+ this.crud.search();
503
+
504
+ },
505
+
506
+ /**
507
+ * 列表操作按钮显示
508
+ */
509
+ getListButton() {
510
+ Object.values(this.nodeListButtonObj).forEach(arr => {
511
+ if (this.isShow("processed,finished,discontinue,flowQuery") && JSON.stringify(arr).indexOf("view") == -1) {//已处理、已办结、已中止、流程查询
512
+ let obj = {};
513
+ obj.isUse = "1";
514
+ obj.showName = "查看";
515
+ obj.type = "view";
516
+ arr.unshift(obj);
517
+ }
518
+ arr.forEach(item => {
519
+ if (item.type == "update") {//修改
520
+ item.order = 0;
521
+ }
522
+ if (item.type == "deal") {//处理
523
+ item.order = 1;
524
+ }
525
+ if (item.type == "view") {//查看
526
+ item.order = 2;
527
+ }
528
+ if (item.type == "flowChart") {//流程图
529
+ item.order = 3;
530
+ }
531
+ if (item.type == "flowRecord") {//流转记录
532
+ item.order = 4;
533
+ }
534
+ });
535
+ arr = arr.sort(sortBy("order"));
536
+ });
537
+
538
+ //按钮排序
539
+ function sortBy(props) {
540
+ return function (a, b) {
541
+ return a[props] - b[props];
542
+ }
543
+ }
544
+ },
545
+
546
+ /**
547
+ * 判断列表操作按钮显示
548
+ */
549
+ judgeListButton(tabType, button) {
550
+ let objTabTypeBtn = {
551
+ "draft": "update", // 草稿---修改
552
+ "pending": "update,deal,flowChart,flowRecord", // 待处理---修改、处理、流程图、流转记录
553
+ "processed": "view,flowChart,flowRecord", // 已处理---查看、流程图、流转记录
554
+ "finished": "view,flowRecord", // 已办结---查看、流转记录
555
+ "rescinded": "view,flowRecord", // 已撤销---查看、流转记录
556
+ "discontinue": "view,flowRecord", // 已中止---查看、流转记录
557
+ "flowQuery": "view,flowChart,flowRecord" // 流程查询---查看、流程图、流转记录
558
+ };
559
+ return objTabTypeBtn[tabType].indexOf(button) > -1;
560
+ },
561
+ /**
562
+ * 判断浏览器分辨率
563
+ */
564
+ checkScreenWidth() {
565
+ let clientWidth = document.body.clientWidth;
566
+ this.screenWidth = window.screen.width;
567
+ this.screenHeight = window.screen.height;
568
+ let befroeClass = JSON.parse(JSON.stringify(this.mycardclass));
569
+ if (this.screenWidth <= "1280") {//一行2个
570
+ this.mycardclass = "myelcard2";
571
+ this.crud.pageSizes = [10, 30, 50, 100];
572
+ this.crud.pageSize = 10;
573
+ } else if (this.screenWidth <= "1536") {//一行3个
574
+ this.mycardclass = "myelcard3";
575
+ this.crud.pageSizes = [9, 30, 60, 90];
576
+ this.crud.pageSize = 9;
577
+ if (clientWidth < 1000) {
578
+ this.mycardclass = "myelcard2";
579
+ this.crud.pageSizes = [10, 30, 50, 100];
580
+ this.crud.pageSize = 10;
581
+ }
582
+ } else if (this.screenWidth <= "1920") {//一行4个
583
+ this.mycardclass = "myelcard4";
584
+ this.crud.pageSizes = [12, 40, 80, 120];
585
+ this.crud.pageSize = 12;
586
+ if (clientWidth < 1200) {
587
+ this.mycardclass = "myelcard2";
588
+ this.crud.pageSizes = [10, 30, 50, 100];
589
+ this.crud.pageSize = 10;
590
+ } else if (clientWidth < 1534) {
591
+ this.mycardclass = "myelcard3";
592
+ this.crud.pageSizes = [9, 30, 60, 90];
593
+ this.crud.pageSize = 9;
594
+ }
595
+ } else if (this.screenWidth <= "2560") {//一行5个
596
+ this.mycardclass = "myelcard5";
597
+ this.crud.pageSizes = [10, 30, 50, 100];
598
+ this.crud.pageSize = 10;
599
+ if (clientWidth < 1261) {
600
+ this.mycardclass = "myelcard2";
601
+ this.crud.pageSizes = [10, 30, 50, 100];
602
+ this.crud.pageSize = 10;
603
+ } else if (clientWidth < 1521) {
604
+ this.mycardclass = "myelcard3";
605
+ this.crud.pageSizes = [9, 30, 60, 90];
606
+ this.crud.pageSize = 9;
607
+ } else if (clientWidth < 1722) {
608
+ this.mycardclass = "myelcard4";
609
+ this.crud.pageSizes = [12, 40, 80, 120];
610
+ this.crud.pageSize = 12;
611
+ }
612
+ } else {//一行6个
613
+ this.mycardclass = "myelcard6";
614
+ this.crud.pageSizes = [12, 36, 60, 120];
615
+ this.crud.pageSize = 12;
616
+ if (clientWidth < 1630) {
617
+ this.mycardclass = "myelcard2";
618
+ this.crud.pageSizes = [10, 30, 50, 100];
619
+ this.crud.pageSize = 10;
620
+ } else if (clientWidth < 1979) {
621
+ this.mycardclass = "myelcard3";
622
+ this.crud.pageSizes = [9, 30, 60, 90];
623
+ this.crud.pageSize = 9;
624
+ } else if (clientWidth < 2201) {
625
+ this.mycardclass = "myelcard4";
626
+ this.crud.pageSizes = [12, 40, 80, 120];
627
+ this.crud.pageSize = 12;
628
+ } else if (clientWidth < 2947) {
629
+ this.mycardclass = "myelcard5";
630
+ this.crud.pageSizes = [10, 30, 50, 100];
631
+ this.crud.pageSize = 10;
632
+ }
633
+ }
634
+ if (befroeClass != this.mycardclass) {
635
+ this.crud.search();
636
+ }
637
+ },
638
+
639
+ /**
640
+ * 点击卡片选中
641
+ */
642
+ clickCard(data, index) {
643
+ if (this.tabType == "draft") {
644
+ let show = document.getElementById("checkCard_" + index).style.visibility;
645
+ if (show == "hidden") {
646
+ this.$set(data, "idIndex", index);
647
+ this.cardClickArr.push(data);
648
+ document.getElementById("checkCard_" + index).style.visibility = "visible";
649
+ } else {
650
+ let beforeIndex = this.cardClickArr.findIndex(val => {
651
+ if (val['DATA_ID'] == data['DATA_ID']) {
652
+ return true;
653
+ }
654
+ });
655
+ if (beforeIndex >= 0) {
656
+ this.cardClickArr.splice(beforeIndex, 1);
657
+ }
658
+ document.getElementById("checkCard_" + index).style.visibility = "hidden";
659
+ }
660
+ }
661
+ },
662
+ /**
663
+ * 查询方法
664
+ */
665
+ doSearch(type) {
666
+ let timeArr = this.crud.searchForm.startTime || [];
667
+ if (timeArr.length > 0 && timeArr[0]) {
668
+ this.crud.searchForm.startTimeStart = timeArr[0] + " 00:00:00";
669
+ }
670
+ if (timeArr.length > 0 && timeArr[1]) {
671
+ this.crud.searchForm.startTimeEnd = timeArr[1] + " 23:59:59";
672
+ }
673
+ this.$emit("initTabNum");
674
+ if (type == "noMessage") {
675
+ this.crud.search();
676
+ } else {
677
+ this.crud.doSearch();
678
+ }
679
+ },
680
+
681
+ /**
682
+ * 清空
683
+ */
684
+ resetSearch() {
685
+ this.crud.resetSearch();
686
+ this.$emit("initTabNum");
687
+ },
688
+
689
+ isShow(typeArr) {
690
+ if (typeArr.indexOf(this.tabType) > -1) {
691
+ return true;
692
+ } else {
693
+ return false;
694
+ }
695
+ },
696
+
697
+ isNotShow(typeArr) {
698
+ if (typeArr.indexOf(this.tabType) == -1) {
699
+ return true;
700
+ } else {
701
+ return false;
702
+ }
703
+ },
704
+
705
+ /**
706
+ * 删除
707
+ */
708
+ deleteFlow() {
709
+ let selection = "";
710
+ if (this.showModel == "card") {
711
+ selection = JSON.parse(JSON.stringify(this.cardClickArr));
712
+ } else {
713
+ selection = this.$refs[this.crud.tableRef].selection;
714
+ }
715
+ if (selection.length == 0) {
716
+ this.$message({type: "warning", message: "请勾选需要删除的数据!"});
717
+ return;
718
+ }
719
+ this.$confirm('确定要删除所选项吗?', '提示', {
720
+ confirmButtonText: '确定',
721
+ cancelButtonText: '取消',
722
+ type: 'warning'
723
+ }).then(() => {
724
+ let flowInstIds = "";
725
+ selection.forEach(row => {
726
+ flowInstIds += "," + row.id;
727
+ });
728
+ this.axios.post(this.api.plFlowInst.deleteFlowInst, {
729
+ flowInstIds: flowInstIds.substring(1)
730
+ }).then(res => {
731
+ if (res && res.data && res.data.operateSuccess) {
732
+ this.$message({type: "success", message: "删除成功!"});
733
+ this.crud.search();
734
+ this.$emit("initTabNum");
735
+ } else {
736
+ this.$message({type: "error", message: "删除失败!"});
737
+ }
738
+ })
739
+ })
740
+ },
741
+
742
+ /**
743
+ * 按钮操作事件
744
+ */
745
+ listButtonOpt(buttonType, row, type) {
746
+ if (buttonType == "update") {//修改
747
+ this.openUpdateFlowForm(row,'update');
748
+ } else if (buttonType == "deal") {//处理
749
+ this.openUpdateFlowForm(row,'handle');
750
+ } else if (buttonType == "view") {//查看
751
+ this.openViewFlowForm(row);
752
+ } else if (buttonType == "flowChart") {
753
+ this.openFlowChart(row);
754
+ } else if (buttonType == "flowRecord") {
755
+ this.openFlowRecord(row);
756
+ }
757
+ },
758
+
759
+ /**
760
+ * 打开批量处理页面方法
761
+ */
762
+ // async openFlowBatchPendingDialog() {
763
+ // if (this.crud.dataStore.records.length == 0) {
764
+ // this.$message({
765
+ // showClose: true,
766
+ // message: '当前没有可处理的流程'
767
+ // });
768
+ // } else {
769
+ // this.openBatchUpdateFlowForm(this.crud.dataStore.records);
770
+ // }
771
+ //
772
+ // },
773
+
774
+ /**
775
+ * 格式化当前任务
776
+ */
777
+ formatterCurrentNodeName(row){
778
+ let currentNodeName = row.currentNodeName;
779
+ if(!currentNodeName){
780
+ if(row.flowStatus != '0'){
781
+ currentNodeName = "结束";
782
+ }else {
783
+ currentNodeName = "开始";
784
+ }
785
+ }
786
+ return currentNodeName;
787
+ },
788
+
789
+ /**
790
+ * 格式化流程概要
791
+ * @param row
792
+ * @param column
793
+ * @param cellValue
794
+ * @returns {*}
795
+ */
796
+ formatterFlowSummary(row, column, cellValue){
797
+ cellValue = Replace.text(null,cellValue || '');
798
+ return cellValue;
799
+ },
800
+ formaterDealer(row, column, cellValue){
801
+ let arr = [];
802
+ (cellValue || "").split(",").forEach(dealer => {
803
+ arr.push(this.userMap[dealer] || dealer);
804
+ })
805
+ return arr.join(",");
806
+ },
807
+ }
808
+ }
809
+ </script>
810
+
811
+ <style scoped lang="scss">
812
+ @import "css/flowInstList";
813
+ </style>
814
+ <style lang="scss">
815
+ .el-tooltip__popper{
816
+ max-width: 800px !important;
817
+ }
818
+ </style>