DefManager.vue
64.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
<template>
<el-container
class="fullheight"
style="border: 1px solid #eee; position: relative"
>
<ht-aside-tree
cat-id="6"
@node-click="handleNodeClick"
@delete="
selectTypeIds = ''
$refs.htTable.load()
"
@check="check"
/>
<el-container>
<el-main>
<ht-table
@load="loadData"
@row-click="rowClick"
:data="data"
:pageResult="pageResult"
:selection="true"
quick-search-props="name,defKey,desc"
ref="htTable"
:show-export="false"
:defaultSorter="[{property: 'createTime', direction: 'DESC'}]"
:header-cell-class-name="headerCellClassName"
@selection-change="handleSelectionChange"
>
<template v-slot:toolbar>
<!-- <el-button-group> -->
<el-button
size="small"
@click="handleCommand({command: 'add'})"
icon="el-icon-plus"
type="primary"
>新增</el-button
>
<el-button
size="small"
@click="
importDialogVisible = true
flowTypeSelectorCatId = ''
flowTypeSelectorCatName = ''
"
icon="el-icon-download"
>导入</el-button
>
<el-button
size="small"
@click="handExport"
icon="el-icon-upload2"
:disabled="isDisabled"
>导出</el-button
>
<el-button
@click="openTypeSetDialog()"
:disabled="isDisabled"
icon="icon-shezhifenlei"
>设置分类</el-button
>
<el-button
@click="batchGoLive()"
:disabled="isDisabled"
icon="el-icon-document-checked"
>批量上线</el-button
>
<el-button
@click="batchGoTest()"
:disabled="isDisabled"
icon="el-icon-document-delete"
>批量测试</el-button
>
<el-button
style="margin-left: 10px"
icon="icon-application-delete"
@click="batchDelete()"
:disabled="isDisabled"
>删除</el-button
>
<!-- <el-button size="small" @click="batchAddNode()" icon="el-icon-plus"
>批量新增节点</el-button
>
<el-button type="danger" @click="batchDeleteNode()"
>批量删除节点</el-button
>-->
<!-- </el-button-group> -->
</template>
<template>
<ht-table-column
type="index"
width="50"
align="center"
label="序号"
/>
<ht-table-column
prop="name"
label="名称"
:hiden="true"
width="200"
:show-overflow-tooltip="true"
:sortable="true"
>
<template v-slot="{row}">
<span v-if="!row.authorizeRight.m_edit">{{ row.name }}</span>
<el-link
type="primary"
v-if="row.authorizeRight.m_edit"
@click="handleCommand({row: row, command: 'edit'})"
title="编辑流程"
>{{ row.name }}</el-link
>
</template>
</ht-table-column>
<ht-table-column
prop="defKey"
label="流程key"
width="100"
:show-overflow-tooltip="true"
/>
<ht-table-column
prop="desc"
label="流程描述"
:show-overflow-tooltip="true"
:sortable="true"
/>
<ht-table-column
prop="typeName"
label="流程分类"
hidden
:show-overflow-tooltip="true"
width="110"
:sortable="true"
/>
<ht-table-column
prop="status"
label="状态"
width="100"
:render-header="renderHeaderMethod"
:filters="statusArray"
>
<template v-slot="{row}">
<el-tag
v-show="row.status == s.value"
:type="s.type"
v-for="s in statusArray"
:key="s.value"
>{{ s.text }}</el-tag
>
</template>
</ht-table-column>
<ht-table-column
prop="testStatus"
label="生产状态"
width="110"
:render-header="renderHeaderMethod"
:filters="[
{text: '测试', value: 'test'},
{text: '正式', value: 'run'},
]"
>
<template v-slot="{row}">
<el-tag type="info" v-if="row.testStatus == 'test'"
>测试</el-tag
>
<el-tag type="danger" v-if="row.testStatus == 'run'"
>正式</el-tag
>
</template>
</ht-table-column>
<!-- <ht-table-column
prop="designPattern"
label="设计模式"
width="100"
:render-header="renderHeaderMethod"
:filters="[
// {text: '简易模式', value: 'simple'},
{text: '正常模式', value: 'normal'},
]"
>
<template v-slot="{row}">
<el-tag type="info" v-if="row.designPattern == 'simple'"
>简易模式</el-tag
>
<el-tag type="danger" v-else>正常模式</el-tag>
</template>
</ht-table-column> -->
<ht-table-column label="版本" width="200">
<template v-slot="{row}">
<el-tag
v-if="row.authorizeRight.m_edit"
type="info"
style="margin-left:10px;cursor:pointer"
class="version-tag"
title="查看表单主版本"
@click="handleCommand({row: row, command: 'mainEdit'})"
>主版本:{{ row.mainVersion }}
</el-tag>
<el-tag
v-else
type="info"
style="margin-left:10px;color: dimgrey;"
class="version-tag"
>主版本:{{ row.mainVersion }}
</el-tag>
<el-tag
style="margin-left:10px;cursor:pointer"
title="查看表单的所有版本"
class="version-tag"
@click="openDefVersion(row)"
type="info"
>版本数量({{ row.versionCount }})</el-tag
>
</template>
</ht-table-column>
<ht-table-column width="200" label="操作" align="left">
<template v-slot="{row}">
<template v-if="row.status != 'draft'">
<el-button
type="text"
@click="
row.authorizeRight.m_start
? handleCommand({row: row, command: 'startFlow'})
: handleCommand({row: row, command: 'bindRelation'})
"
>{{
row.authorizeRight.m_start ? '启动' : '绑定关系'
}}</el-button
>
<el-button v-if="row.testStatus != 'test'"
type="text"
@click="handleCommand({row: row, command: 'goTest'})"
>测试</el-button
>
<el-button
type="text" v-if="row.testStatus == 'test'"
@click="handleCommand({row: row, command: 'goLive'})"
>上线</el-button
>
<el-dropdown
size="mini"
class="more-operate-btn__dropdown"
@command="handleCommand"
>
<span class="more-operate-btn"
>更多操作<i class="el-icon-caret-bottom"></i>
</span>
<el-dropdown-menu
slot="dropdown"
class="operate-dropdown__button"
>
<el-dropdown-item
v-if="
row.authorizeRight.m_clean && row.testStatus == 'test'
"
:command="{row: row, command: 'cleanData'}"
>清除数据</el-dropdown-item
>
<el-dropdown-item
type="text"
:command="{row: row, command: 'copy'}"
>复制</el-dropdown-item
>
<el-dropdown-item
v-if="row.authorizeRight.m_start"
:command="{row: row, command: 'bindRelation'}"
>绑定关系</el-dropdown-item
>
<el-dropdown-item
v-if="row.status == 'deploy'"
:command="{row: row, command: 'processSimulation'}"
size="mini"
>流程仿真配置</el-dropdown-item
>
<el-dropdown-item
:command="{row: row, command: 'auth'}"
size="mini"
>授权管理</el-dropdown-item
>
<el-dropdown-item
:command="{row: row, command: 'pcModulePublish'}"
size="mini"
>发布到PC应用模块</el-dropdown-item
>
<el-dropdown-item
:command="{row: row, command: 'mobileModulePublish'}"
size="mini"
v-if="row.supportMobile === 1"
>发布到移动端</el-dropdown-item
>
<el-dropdown-item
:command="{row: row, command: 'sysModulePublish'}"
size="mini"
>发布流程模块</el-dropdown-item
>
<el-dropdown-item
:command="{row: row, command: 'tagsSetting'}"
size="mini"
>设置标签</el-dropdown-item
>
<el-dropdown-item :command="{ row: row, command: 'showModifyLog' }"
size="mini">修改日志</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<el-button
v-if="row.status == 'draft'"
type="text"
@click="handleCommand({row: row, command: 'delete'})"
size="mini"
>删除</el-button
>
</template>
</ht-table-column>
</template>
</ht-table>
</el-main>
</el-container>
<ht-sidebar-dialog
width="28%"
title="绑定关系"
:visible.sync="dialogVisible2"
:before-close="handleClose"
>
<el-row>
<el-col>
PC表单实体对象:
<span v-if="bindData.pcEnt">
<el-tag
style="margin-right: 5px; cursor: pointer"
@click="handleClose"
>
<router-link
:to="{path: 'businessObj', query: {id: bindData.pcEnt.id_}}"
>{{ bindData.pcEnt.description_ }}</router-link
>
</el-tag>
</span>
</el-col>
</el-row>
<br />
<el-row>
<el-col>
手机表单实体对象:
<span v-if="bindData.mobileEnt">
<el-tag
style="margin-right: 5px; cursor: pointer"
@click="handleClose"
>
<router-link
:to="{
path: 'businessObj',
query: {id: bindData.mobileEnt.id_},
}"
>{{ bindData.mobileEnt.description_ }}</router-link
>
</el-tag>
</span>
</el-col>
</el-row>
<br />
<el-row>
<el-col>
PC表单:
<span v-if="bindData.pcForm">
<el-tag style="margin-right: 5px" @click="handleClose">
<router-link
replace
:to="{
path: 'formManager',
query: {
formId: bindData.pcForm.pcFormId,
defId: bindData.pcForm.pcDefId,
},
}"
>{{ bindData.pcForm.pcName }}</router-link
>
</el-tag>
</span>
</el-col>
</el-row>
<br />
<el-row>
<el-col>
手机表单:
<span v-if="bindData.mobileForm">
<el-tag style="margin-right: 5px" @click="handleClose">
<router-link
replace
:to="{
path: 'mobileFormManager',
query: {
formId: bindData.mobileForm.mobileFormId,
defId: bindData.mobileForm.mobileDefId,
},
}"
>{{ bindData.mobileForm.mobileName }}</router-link
>
</el-tag>
</span>
</el-col>
</el-row>
</ht-sidebar-dialog>
<ht-sidebar-dialog
width="100%"
:close-on-click-modal="false"
:visible="dialogVisible"
:key="defConfComponetKey"
:before-close="handleClose"
:close-on-press-escape="false"
class="flow_conf"
>
<el-container class="fullheight">
<el-header height="48px" style="padding: 0">
<!-- <Navigator /> -->
<div class="title">
<span class="title_icon" @click="handleClose">
<i class="el-icon-back" style="font-weight: bold"></i
></span>
<span class="title_tit">流程编辑({{ defNameAndVrsionTitle }})</span>
</div>
<!-- <div class="flex" style="
float: left;
justify-content: center;
background: #fff;
height: 47px;
width: 180px;
border-bottom: 1px solid #eee;
">
<el-page-header @back="handleClose" content="流程编辑" title=""></el-page-header>
</div>
<div class="flex" style="
float: left;
justify-content: space-between;
height: 47px;
width: calc(100% - 181px);
border-bottom: 1px solid #eee;
">
<el-breadcrumb separator=">" style="margin-left: 20px">
<el-breadcrumb-item :to="{ path: '/' }">流程设计</el-breadcrumb-item>
<el-breadcrumb-item>{{
defNameAndVrsionTitle
}}</el-breadcrumb-item>
</el-breadcrumb>
</div> -->
<el-link class="bpmn-xml-link" @click="watchBPMNXML">
<i class="icon-technology" />
BPMNXML
</el-link>
</el-header>
<el-main style="padding: 0; height: 100%; overflow: hidden">
<el-tabs
class="flow-edit-container"
v-if="dialogVisible"
type="card"
style="height: 100%"
tab-position="left"
v-model="activeName"
@tab-click="handlePaneClick"
@tab-remove="handlePaneRemove"
:before-leave="beforePanelLeave"
ref="flowEditTables"
>
<el-tab-pane label="流程设计" name="defDesign">
<BpmnEdit
ref="BpmnEdit"
:defId="curSelectDefId"
:defKey="curSelectDefKey"
:design-pattern="designPattern"
:operateType="operateType"
:processStatus="processStatus"
@def-deploy-success="handleDefDeploySuccess"
@switch-config-refresh="handleDefSignSuccess"
/>
</el-tab-pane>
<el-tab-pane
v-if="!isShowSubFlowSet"
label="流程配置"
name="defConfig"
>
<keep-alive v-if="!flowConfigShouldRefresh">
<FlowConfig
:defId="curSelectDefId"
@repeatQuest="repeatQuest"
/>
</keep-alive>
<FlowConfig
v-else
:defId="curSelectDefId"
@repeatQuest="repeatQuest"
/>
</el-tab-pane>
<el-tab-pane
label="流程配置"
v-if="isShowSubFlowSet"
name="defConfig"
>
<SubFlowConfig
v-if="activeName == 'defConfig'"
:defId="curSelectDefId"
/>
</el-tab-pane>
<el-tab-pane label="初始赋值" name="boSetting">
<FlowEditBoSetting
v-if="isCurDefPublish && activeName == 'boSetting'"
:defId="curSelectDefId"
/>
</el-tab-pane>
<el-tab-pane label="变量管理" name="varManage">
<FlowVarList
v-if="isCurDefPublish && activeName == 'varManage'"
:defId="curSelectDefId"
/>
</el-tab-pane>
<!-- <el-tab-pane label="版本管理" name="versionManage">-->
<!-- <FlowVersionList-->
<!-- v-if="isCurDefPublish && activeName == 'versionManage'"-->
<!-- :defId="curSelectDefId"-->
<!-- />-->
<!-- </el-tab-pane>-->
<el-tab-pane label="其它设置" name="otherSetting">
<FlowOtherSetting
v-if="isCurDefPublish && activeName == 'otherSetting'"
:defId="curSelectDefId"
@toggleTab="toggleTab"
/>
</el-tab-pane>
<el-tab-pane
:closable="true"
label="子流程设置"
v-if="isShowSubFlowSet"
name="subFlowSet"
>
<SubFlowConfig
v-if="activeName == 'subFlowSet'"
:defId="subDefId"
:topDefKey="topDefKey"
/>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</ht-sidebar-dialog>
<el-dialog
title="导入流程"
:visible.sync="importDialogVisible"
width="40%"
top="30vh"
:close-on-click-modal="false"
v-if="importDialogVisible"
>
<div style="height: 150px; padding-left: 20px">
<eip-sys-type-selector
placeholder="请选择分类"
type-key="FLOW_TYPE"
v-model="flowTypeSelectorCatName"
:sys-type-id.sync="flowTypeSelectorCatId"
:validate="{required: true}"
/>
<br /><br />
<el-upload
style="display: inline-block"
:action="imporCheckUrl"
:on-success="handleUploadResult"
:on-error="handleUploadResult"
:headers="uploadHeaders"
:on-exceed="onExceed"
accept=".zip"
:before-upload="beforeUpload"
:limit="1"
:data="{isCheck: true}"
:auto-upload="false"
ref="upload"
>
<el-button size="small" icon="el-icon-upload">选择流程</el-button>
</el-upload>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importDialogVisible = false">取 消</el-button>
<el-button
type="primary"
@click="submitImport"
element-loading-text="拼命导入中"
v-loading.fullscreen.lock="fullscreenLoading"
>确 定</el-button
>
</span>
</el-dialog>
<el-dialog
width="60%"
title="复制流程"
:close-on-click-modal="false"
:visible="dialogSaveCopyVisible"
:before-close="handleCloseSaveCopy"
:destroy-on-close="true"
>
<form v-form data-vv-scope="saveCopyForm">
<table class="form-table" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<th width="140px">原流程名称:</th>
<td>{{ flowRow.name }}</td>
<th width="140px" class="is-required">新流程名称</th>
<td>
<ht-input v-model="newFlow.name" :validate="{required: true}" />
</td>
</tr>
<tr>
<th width="140px" class="is-required">原流程别名:</th>
<td>{{ flowRow.defKey }}</td>
<th width="140px" class="is-required">新流程别名</th>
<td>
<ht-input
v-model="newFlow.defKey"
v-pinyin="newFlow.name"
autocomplete="off"
:validate="{
required: true,
regex: {
exp: '^[^0-9][\\w]{1,29}$',
message: '只能输入字母开头的不超过30位的key',
},
}"
placeholder="请输入别名"
></ht-input>
</td>
</tr>
<tr>
<th width="140px" class="is-required">原流程分类:</th>
<td>{{ flowRow.typeName }}</td>
<th width="140px" class="is-required">新流程分类</th>
<td>
<EipSysTypeSelector
placeholder="请选择流程分类"
cat-id="6"
v-model="newFlow.typeName"
:sys-type-id.sync="newFlow.typeId"
:validate="{required: true}"
/>
</td>
</tr>
</tbody>
</table>
</form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCloseSaveCopy">取消</el-button>
<el-button type="primary" @click="saveCopy">确定</el-button>
</div>
</el-dialog>
<el-dialog
title="流程版本管理"
class="form-version__dialog"
width="60%"
destroy-on-close
:visible.sync="bpmVersionVisible"
:before-close="handleCloseFormVersion"
top="8vh"
>
<FlowVersionList
v-if="bpmVersionVisible"
:defId="defId"
:authorize-right = "authorizeRight"
@design="design(arguments)"
/>
</el-dialog>
<el-dialog
title="删除流程"
:visible.sync="deleteDialogVisible"
width="50%"
:close-on-click-modal="false"
v-if="deleteDialogVisible"
class="delete-dialog"
>
<h3 style="color: red">
重要提醒:删除流程定义,对应的实例和任务会一起删除,并且无法恢复
</h3>
<div class="delete-dialog_container">
<div v-for="def in deleteList" :key="def.defKey">
{{ def.name }}(共有实例:{{ def.totalCount }}个,其中运行中的实例:{{
def.runningCount
}}个) <i
class="el-icon-close"
@click="deleteList.remove(def)"
></i>
</div>
</div>
<el-input
v-if="false"
type="textarea"
:rows="2"
placeholder="请输入删除原因"
v-model="deleteReason"
>
</el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="deleteDialogVisible = false">取 消</el-button>
<el-button
type="primary"
@click="batchDeleteConfirm"
element-loading-text="删除中"
v-loading.fullscreen.lock="fullscreenLoading"
>确认删除</el-button
>
</span>
</el-dialog>
<eip-sys-type-dialog
ref="typeSetDialog"
name="typeSetDialog"
:cat-id="'6'"
@onConfirm="sysTypeDialogOnConfirm"
/>
<processSimulation ref="processSimulation"></processSimulation>
<!-- 授权管理 -->
<def-authorize-page-dialog
ref="defAuthorizePageDialog"
name="defAuthorizePageDialog"
></def-authorize-page-dialog>
<PcModulePublish ref="pcModulePublish" />
<MobileModulePublish ref="mobileModulePublish" />
<SysModulePublish ref="sysModulePublish" />
<TagsSetting ref="tagsSetting" @reloadTable="reloadTable" />
<!-- 修改日志 -->
<ModifyLog :title="'修改日志'" :showType="'bpmDef'" :defKey="curSelectDefKey" ref="modifyLog"/>
<el-dialog
title="删除节点"
:visible.sync="nodeDialogVisible"
width="30%"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-input v-model="nodeName" placeholder="请输入节点名称"></el-input>
<el-table
:data="returnData.error"
style="width: 100%"
v-if="isReturn && returnData.error.length > 0"
>
<el-table-column prop="name" label="删除异常流程名"> </el-table-column>
<el-table-column prop="defKey" label="流程KEY"> </el-table-column>
</el-table>
<el-table
:data="returnData.noNode"
style="width: 100%"
v-if="isReturn && returnData.noNode.length > 0"
>
<el-table-column prop="name" label="不存在节点流程名">
</el-table-column>
<el-table-column prop="defKey" label="流程KEY"> </el-table-column>
</el-table>
<el-table
:data="returnData.ok"
style="width: 100%"
v-if="isReturn && returnData.ok.length > 0"
>
<el-table-column prop="name" label="成功流程名"> </el-table-column>
<el-table-column prop="defKey" label="流程KEY"> </el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="nodeDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="nodeConfirm()" v-if="!isReturn"
>确 定</el-button
>
</span>
</el-dialog>
<el-dialog
title="新增用户任务节点"
:visible.sync="addNodeDialogVisible"
width="30%"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form ref="form" label-width="130px" :model="addNode" :rules="rules">
<el-form-item label="规则类型" prop="type">
<el-radio v-model="addNode.type" label="1">节点之前</el-radio>
<el-radio v-model="addNode.type" label="2"
>节点之后</el-radio
></el-form-item
>
<el-form-item label="对应节点名称" prop="selectNode"
><el-input
v-model="addNode.selectNode"
prop="selectNode"
placeholder="请输入对应节点名称"
></el-input
></el-form-item>
<el-form-item label="新增节点名称" prop="nodeName">
<el-input
v-model="addNode.nodeName"
placeholder="请输入节点名称"
></el-input
></el-form-item>
<!-- <el-form-item label="新增节点key" prop="nodeKey"
><el-input
v-model="addNode.nodeKey"
placeholder="请输入节点key"
></el-input
></el-form-item> -->
<el-form-item label="审批人"
><el-button
icon="el-icon-circle-plus-outline"
@click="setNodeUser()"
type="text"
>新增</el-button
>
<div
class="alert-danger alert"
v-if="!nodeUsers || nodeUsers.length == 0"
>
尚未配置节点人员,请添加人员设置
</div>
<div v-else class="alert">
<div>
<el-tooltip
class="item"
effect="dark"
content="批次顺序由上至下增大,第一批次无法获取到审批人时才会获取下一个批次审批人信息。"
placement="left"
>
<span class="control-label left-label">
<i class="el-icon-warning"></i>
</span>
</el-tooltip>
{{ nodeUsers.description }}
</div>
</div>
</el-form-item>
</el-form>
<el-table
:data="returnData.error"
style="width: 100%"
v-if="isReturn && returnData.error.length > 0"
>
<el-table-column prop="name" label="新增异常流程名"> </el-table-column>
<el-table-column prop="defKey" label="流程KEY"> </el-table-column>
<el-table-column prop="errMsg" label="错误信息"> </el-table-column>
</el-table>
<el-table
:data="returnData.noNode"
style="width: 100%"
v-if="isReturn && returnData.noNode.length > 0"
>
<el-table-column prop="name" label="不存在节点流程名">
</el-table-column>
<el-table-column prop="defKey" label="流程KEY"> </el-table-column>
</el-table>
<el-table
:data="returnData.ok"
style="width: 100%"
v-if="isReturn && returnData.ok.length > 0"
>
<el-table-column prop="name" label="成功流程名"> </el-table-column>
<el-table-column prop="defKey" label="流程KEY"> </el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="addNodeDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addNodeConfirm('1')" v-if="!isReturn"
>发布</el-button
>
<el-button type="primary" @click="addNodeConfirm('2')" v-if="!isReturn"
>保存</el-button
>
</span>
</el-dialog>
<FlowNodeUserCondition
@nodeUserConditionConfirm="nodeUserConditionConfirm"
ref="flowNodeUserCondition"
:paramNodes="paramNodes"
/>
</el-container>
</template>
<script>
/* import Navigator from '@/views/Navigator.vue' */
import {mapState} from 'vuex'
import flow from '@/api/flow.js'
import BpmnEdit from '@/components/VueBpmn/BpmnEdit.vue'
import req from '@/request.js'
import utils from '@/hotent-ui-util.js'
const FlowNodeUserCondition = () =>
import('@/components/flow/FlowNodeUserCondition.vue')
const htAsideTree = () => import('@/components/common/HtAsideTree.vue')
const FlowConfig = () => import('@/components/flow/FlowConfig.vue')
const SubFlowConfig = () => import('@/components/flow/FlowConfig.vue')
const FlowOtherSetting = () => import('@/components/flow/FlowOtherSetting.vue')
const FlowVarList = () => import('@/components/flow/FlowVarList.vue')
const FlowVersionList = () => import('@/components/flow/FlowVersionList.vue')
const eipSysTypeSelector = () =>
import('@/components/selector/EipSysTypeSelector.vue')
const FlowEditBoSetting = () =>
import('@/components/flow/FlowEditBoSetting.vue')
const eipSysTypeDialog = () =>
import('@/components/dialog/EipSysTypeDialog.vue')
const processSimulation = () =>
import('@/views/flow/simulation/ProcessSimulation.vue')
const EipSysTypeSelector = () =>
import('@/components/selector/EipSysTypeSelector.vue')
const defAuthorizePageDialog = () =>
import('@/components/dialog/DefAuthorizePageDialog.vue')
const PcModulePublish = () => import('@/components/common/PcModulePublish.vue')
const MobileModulePublish = () =>
import('@/components/common/MobileModulePublish.vue')
const SysModulePublish = () =>
import('@/components/common/SysModulePublish.vue')
const TagsSetting = () => import('@/components/common/TagsSetting.vue')
import tableHeaderFilter from '@/mixins/tableHeaderFilter.js'
import ModifyLog from '@/components/VueBpmn/BpmnModifyLog.vue'
export default {
components: {
FlowNodeUserCondition,
BpmnEdit,
/* Navigator, */
htAsideTree,
FlowConfig,
FlowOtherSetting,
SubFlowConfig,
FlowVarList,
FlowVersionList,
FlowEditBoSetting,
eipSysTypeSelector,
eipSysTypeDialog,
processSimulation,
EipSysTypeSelector,
defAuthorizePageDialog,
PcModulePublish,
MobileModulePublish,
SysModulePublish,
TagsSetting,
ModifyLog,
},
mixins: [tableHeaderFilter],
data() {
return {
rules: {
selectNode: [{required: true, message: '必填', trigger: 'blur'}],
nodeKey: [
{required: true, message: '必填', trigger: 'blur'},
{
pattern: '^[a-zA-Z][\\s\\S]{1,60}$',
message: '字母开头字母数字下划线,最长60',
trigger: 'blur',
},
],
nodeName: [{required: true, message: '必填', trigger: 'blur'}],
},
paramNodes: [],
addNode: {
selectNode: '',
nodeKey: '',
nodeName: '',
type: '2',
},
nodeUsers: [],
addNodeDialogVisible: false,
isReturn: false,
returnData: {error: [], noNode: [], ok: []},
selectIds: [],
nodeDialogVisible: false,
nodeName: '',
data: [],
pageResult: {
page: 1,
pageSize: 50,
total: 0,
},
dialogVisible: false,
defEditTabComponent: [
{alias: 'defConfig', name: '流程设计'},
{alias: 'defVarList', name: '变量管理'},
],
statusArray: [
{text: '已发布', value: 'deploy', type: 'info'},
{text: '禁用', value: 'forbidden', type: 'danger'},
{text: '禁止实例', value: 'forbidden_instance', type: 'warning'},
],
activeName: 'defConfig',
curSelectDefId: '',
curSelectDefKey: '',
// 配置页面是否需要刷新缓存
flowConfigShouldRefresh: false,
topDefKey: '',
subDefId: '',
isShowSubFlowSet: false,
isCurDefPublish: false,
selectTypeIds: '',
fullscreenLoading: false,
importDialogVisible: false,
flowTypeSelectorCatId: '',
flowTypeSelectorCatName: '',
startDef: '',
defNameAndVrsionTitle: '',
dialogVisible2: false,
bindData: {},
dialogSaveCopyVisible: false,
newFlow: {},
flowRow: {},
deleteList: [],
deleteDialogVisible: false,
deleteReason: '111',
defConfComponetKey: '',
isDisabled: true,
selectedList: [],
operateType: '',
processStatus: 'draft',
designPattern: 'normal', // normal 正常模式 simple简易模式
bpmVersionVisible: false,
defId:'',
authorizeRight: {}
}
},
computed: mapState({
isForbidden: function () {
return [
{text: '正常', value: '0', type: 'success'},
{text: '挂起', value: '1', type: 'danger'},
]
},
deleteUrl: function () {
return window.context.bpmModel + '/flow/def/v1'
},
uploadHeaders: function (mapState) {
return {Authorization: 'Bearer ' + mapState.login.currentUser.token}
},
imporCheckUrl: function () {
return (
window.context.bpmModel +
'/flow/def/v1/importCheck?typeId=' +
this.flowTypeSelectorCatId
)
},
account: (state) => state.login.currentUser.account,
token: (state) => state.login.currentUser.token,
frontUrl: function () {
return `${window.context.front}/matter/startProcess?token=${this.token}`
},
}),
mounted() {
//数据建模-》查看绑定关系
if (this.$route.query.bpmId) {
this.isCurDefPublish = true
this.curSelectDefId = this.$route.query.bpmId
this.activeName = 'defDesign'
this.dialogVisible = true
this.$router.push('/defManager')
this.handleDefSignSuccess()
}
this.$validator = this.$root.$validator
},
// 监听选中
watch: {
selectedList: {
handler(val) {
this.isDisabled = val.length < 1 ? true : false
},
deep: true,
},
},
methods: {
openDefVersion(row){
this.authorizeRight = row.authorizeRight
this.bpmVersionVisible = true
this.defId = row.defId
},
handleCloseFormVersion() {
this.bpmVersionVisible = false
this.$refs.htTable.load()
},
setNodeUser() {
this.$refs['form'].validate((valid) => {
if (valid) {
let conf = {nodeId: this.addNode.nodeKey}
this.paramNodes = [
{
name: this.addNode.nodeName,
nodeId: this.addNode.nodeKey,
type: 'userTask',
},
]
this.$nextTick(() => {
this.$refs.flowNodeUserCondition.showDialog(conf)
})
} else {
return false
}
})
},
nodeUserConditionConfirm(res) {
let userJson = {}
userJson[this.addNode.nodeKey] = []
userJson[this.addNode.nodeKey].push(res)
this.nodeUsers = res
this.userJson = JSON.stringify(userJson)
},
addNodeConfirm(action) {
this.$refs['form'].validate((valid) => {
if (valid) {
let _this = this
let obj = {
nodeName: this.addNode.nodeName,
nodeKey: this.addNode.nodeKey,
defIds: this.selectIds.join(','),
selectNode: this.addNode.selectNode,
userJson: this.userJson,
type: this.addNode.type,
action: action,
}
this.$http
.post(`${window.context.bpmRunTime}/flow/def/v1/batchAddNode`, obj)
.then(function (resp) {
_this.returnData = resp.data
_this.isReturn = true
_this.$refs.htTable.load()
})
} else {
return
}
})
},
nodeConfirm() {
let _this = this
this.$http
.get(
`${window.context.bpmRunTime}/flow/def/v1/batchDeleteNode?nodeName=${
this.nodeName
}&defIds=${this.selectIds.join(',')}`
)
.then(function (resp) {
_this.returnData = resp.data
_this.isReturn = true
})
},
batchAddNode() {
this.isReturn = false
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let defKeys = []
for (let item of elTable.selection) {
if (item.designPattern != 'simple') {
this.$message.warning('此操作只适用于简易模式')
return
}
defKeys.push(item['id'])
}
if (defKeys.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
this.selectIds = defKeys
this.nodeName = ''
this.addNodeDialogVisible = true
// 随机生成节点id
this.addNode.nodeKey = 'UserTask_' + utils.randomString(7)
},
batchDeleteNode() {
this.isReturn = false
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let defKeys = []
for (let item of elTable.selection) {
if (item.designPattern != 'simple') {
this.$message.warning('此操作只适用于简易模式')
return
}
defKeys.push(item['id'])
}
if (defKeys.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
this.selectIds = defKeys
this.nodeName = ''
this.nodeDialogVisible = true
},
handleSelectionChange(selection) {
this.selectedList = selection
},
reloadTable() {
this.$refs.htTable.load()
},
rowClick(row) {
this.$refs.htTable.$refs.htTable.toggleRowSelection(row)
},
handleDefSignSuccess() {
this.flowConfigShouldRefresh = true
if (!this.curSelectDefId) {
return
}
let this_ = this
req
.get('${bpmModel}/flow/def/v1/defGet?defId=' + this.curSelectDefId)
.then(function (resp) {
let data = resp.data
if (data) {
this_.processStatus = data.status
this_.defNameAndVrsionTitle = data.name + '/版本' + data.version
}
})
},
handleDefDeploySuccess(id) {
this.curSelectDefId = id
this.isCurDefPublish = true
this.defConfComponetKey = new Date().getTime()
this.activeName = 'defConfig'
this.handleDefSignSuccess()
},
//跳转指定选项卡
toggleTab(name) {
this.activeName = name
this.flowConfigShouldRefresh = true
},
//启动流程
startFlow(row) {
this.startDef = row.id
let url = `${this.frontUrl}&defId=${row.defId}`
window.open(url, '_blank')
},
//获取url指定参数
getQueryString(url, name) {
var arrObj = url.split('?')
if (arrObj.length > 1) {
var arrPara = arrObj[1].split('&')
var arr
for (var i = 0; i < arrPara.length; i++) {
arr = arrPara[i].split('=')
if (arr != null && arr[0] == name) {
return arr[1]
}
}
return null
} else {
return null
}
},
handleUploadResult(response) {
var height =
(document.documentElement.clientHeight || document.body.clientHeight) *
0.85 +
'px'
this.fullscreenLoading = false
let this_ = this
if (response.state) {
this_.handleImportSuccess()
} else {
if (
response.message &&
response.message.indexOf('是否继续为其新增版本') > 0
) {
this.$confirm(
'<div style="overflow-x:hidden;overflow-y:auto ;max-height:' +
height +
'">' +
response.message +
'</div>',
'提示',
{
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: false,
}
)
.then(() => {
this_.fullscreenLoading = true
req
.post(
window.context.bpmModel +
'/flow/def/v1/importSave?cacheFileId=' +
response.value +
'&confirmImport=' +
true +
'&typeId=' +
this.flowTypeSelectorCatId
)
.then(function (resp) {
this_.fullscreenLoading = false
let data = resp.data
if (data.state) {
this_.handleImportSuccess()
}
})
})
.catch(() => {
req.post(
window.context.bpmModel +
'/flow/def/v1/importSave?cacheFileId=' +
response.value +
'&confirmImport=' +
false
)
this_.importDialogVisible = false
this.$refs.upload.clearFiles()
})
} else {
this.$message.error(response.message || '流程导入失败')
}
}
},
handleImportSuccess() {
this.$message.success('流程导入成功')
this.importDialogVisible = false
this.$refs.htTable.load()
this.$refs.upload.clearFiles()
},
beforeUpload(file) {
if (!file.name.endsWith('.zip')) {
this.$message.warning('只能导入zip文件!')
return false
}
this.imporActionUrl = this.imporCheckUrl
this.fullscreenLoading = true
},
onExceed() {
this.$message.warning('只能选择一个zip文件!')
},
submitImport() {
if (
!this.$refs.upload.uploadFiles ||
this.$refs.upload.uploadFiles.length == 0
) {
this.$message.warning('请选择要导入的流程!')
return false
}
if (!this.flowTypeSelectorCatId) {
this.$message.warning('请选择要导入的分类!')
return false
}
this.$refs.upload.submit()
},
watchBPMNXML() {
let url =
window.context.bpmModel +
'/flow/def/v1/bpmnXml?defId=' +
this.curSelectDefId
let tenantId = '-1'
try {
if (this.$store.state.login.currentUser.userAttrs.tenantId) {
tenantId = this.$store.state.login.currentUser.userAttrs.tenantId
}
} catch (error) {}
if (tenantId != '-1') {
url = url + '&tenantId=' + tenantId
}
window.open(url, '_blank')
},
beforePanelLeave() {
if (!this.isCurDefPublish) {
this.$message.warning('流程还未发布,无法进行配置')
return false
}
},
handlePaneClick: function (data) {
if (data.alias) {
this.currentTabComponent = data.alias
}
//流程设计
if (data.name == 'defConfig') {
this.flowConfigShouldRefresh = false
}
},
handlePaneRemove: function () {
this.activeName = 'defConfig'
this.flowConfigShouldRefresh = true
this.isShowSubFlowSet = false
},
handleNodeClick(node) {
if (node.id == '6') {
this.selectTypeIds = ''
} else {
this.selectTypeIds = node.id
}
this.$refs.htTable.doQuickSearch()
},
check(data, checkObj) {
this.selectTypeIds = checkObj.checkedKeys.join(',')
this.$refs.htTable.load()
},
handleClose() {
this.dialogVisible = false
this.dialogVisible2 = false
this.$refs.htTable.load(true)
this.$emit('handleDefManagerClose',false)
},
handleCloseMenuPerm() {
this.dialogVisibleMenuPerm = false
},
dialogCancel(dialogVisible) {
this[dialogVisible] = false
},
loadData(param, cb) {
param.querys = param.querys || []
if (this.selectTypeIds) {
let hasTypeQuery = false
for (const query of param.querys) {
if (query.property == 'typeId') {
query.value = this.selectTypeIds
hasTypeQuery = true
break
}
}
if (!hasTypeQuery) {
param.querys.push({
group: 'main',
operation: 'IN',
property: 'typeId',
relation: 'AND',
value: this.selectTypeIds,
})
}
} else {
param.querys = param.querys.filter((q) => {
return q.property != 'typeId'
})
}
flow
.getDefPage(param)
.then((response) => {
this.data = response.rows
this.pageResult = {
page: response.page,
pageSize: response.pageSize,
total: response.total,
}
})
.finally(() => cb())
},
design(params){
this.handleCommand({row: params[0], command: 'edit'})
},
handleCommand(params) {
console.log('params: ', params);
this.operateType = params.command
if (params.command == 'add') {
this.processStatus = 'draft'
} else {
this.processStatus = params.row.status
}
switch (params.command) {
case 'edit': //编辑
this.curSelectDefId = params.row.defId
this.curSelectDefKey = params.row.defKey
this.defNameAndVrsionTitle =
params.row.name + '/版本' + params.row.version
if (params.row.status == 'draft') {
this.isCurDefPublish = false
this.activeName = 'defDesign'
} else {
this.isCurDefPublish = true
this.activeName = 'defConfig'
}
this.isShowSubFlowSet = false
this.dialogVisible = true
break
case 'mainEdit': //编辑
this.curSelectDefId = params.row.mainId
this.curSelectDefKey = params.row.defKey
this.defNameAndVrsionTitle =
params.row.name + '/版本' + params.row.mainVersion
if (params.row.status == 'draft') {
this.isCurDefPublish = false
this.activeName = 'defDesign'
} else {
this.isCurDefPublish = true
this.activeName = 'defConfig'
}
this.isShowSubFlowSet = false
this.dialogVisible = true
break
case 'add': //新增
this.designPattern = 'normal'
this.curSelectDefId = ''
this.activeName = 'defDesign'
this.dialogVisible = true
this.isCurDefPublish = false
this.isShowSubFlowSet = false
this.defNameAndVrsionTitle = ''
break
case 'addSimpleMode': //新增
this.designPattern = 'simple'
this.curSelectDefId = ''
this.activeName = 'defDesign'
this.dialogVisible = true
this.isCurDefPublish = false
this.isShowSubFlowSet = false
this.defNameAndVrsionTitle = ''
break
case 'restore': //恢复
break
case 'isForbidden': //挂起/取消挂起
this.forbiddenOrUnForbiddenInst(params)
break
case 'cleanData':
this.cleanData(params.row.id)
break
case 'startFlow':
this.startFlow(params.row)
break
case 'bindRelation':
this.bindRelation(params.row.defId)
break
case 'delete':
// if (params.row.status == 'draft') {
this.deleteFlow(params.row.defId)
// } else {
// this.batchDelete(params.row)
// }
break
case 'processSimulation':
this.$refs.processSimulation.showProcessSimulation(params.row.defKey)
break
case 'add': //新增
this.curSelectDefId = ''
this.activeName = 'defDesign'
this.dialogVisible = true
this.isCurDefPublish = false
this.defNameAndVrsionTitle = ''
break
case 'restore': //恢复
break
case 'isForbidden': //挂起/取消挂起
this.forbiddenOrUnForbiddenInst(params)
break
case 'cleanData':
this.cleanData(params.row.id)
break
case 'startFlow':
this.startFlow(params.row)
break
case 'bindRelation':
this.bindRelation(params.row.defId)
break
case 'delete':
this.deleteFlow(params.row.defId)
break
case 'processSimulation':
this.$refs.processSimulation.showProcessSimulation(params.row.defKey)
break
case 'copy':
this.copy(params.row)
break
case 'goLive':
this.goLive(params.row)
break
case 'goTest':
this.goTest(params.row)
break
case 'auth':
this.auth(params.row)
break
case 'pcModulePublish':
this.handlePcModule(params.row)
break
case 'mobileModulePublish':
this.handleMobileModulePublish(params.row)
break
case 'sysModulePublish':
this.handleSysModulePublish(params.row)
break
case 'tagsSetting':
this.handleTagsSetting(params.row)
break
case 'showModifyLog':
this.curSelectDefKey = params.row.defKey
this.showRecords(params.row)
break
default:
break
}
},
auth(row) {
this.$refs.defAuthorizePageDialog.showDialog(row)
},
copy(flow) {
this.flowRow = {...flow}
this.newFlow = {
defId: this.flowRow.id,
defKey: '',
name: '',
typeId: '',
}
this.dialogSaveCopyVisible = true
},
goLive(flow) {
this.goRunOrTest(flow.defId, true, "上线")
},
goTest(flow){
this.goRunOrTest(flow.defId, false, "测试")
},
batchGoLive(){
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let defIds = []
for (let item of elTable.selection) {
defIds.push(item['defId'])
}
if (defIds.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
this.goRunOrTest(defIds.join(','), true, '批量上线')
},
batchGoTest(){
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let defIds = []
for (let item of elTable.selection) {
defIds.push(item['defId'])
}
if (defIds.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
this.goRunOrTest(defIds.join(','), false, '批量测试')
},
goRunOrTest(defIds,isRun,message){
const this_ = this
req.get(window.context.bpmModel + '/flow/def/v1/goRunOrTest?defIds=' + defIds+'&isRun=' + isRun)
.then(function (response) {
let data = response.data
if (data.state) {
this_.$message.success(message + data.value)
this_.$refs.htTable.load()
} else {
this_.$message.success(message + data.value)
}
})
},
handleCloseSaveCopy() {
this.dialogSaveCopyVisible = false
},
saveCopy() {
const this_ = this
this.$validator.validateAll('saveCopyForm').then((result) => {
if (result) {
req.get(window.context.bpmModel + '/flow/def/v1/checkDefKey?defKey=' + this_.newFlow.defKey).then(resp =>{
if(!resp.data.value){
flow.copy(this_.newFlow).then((resp) => {
if (resp.data.state) {
this_.dialogSaveCopyVisible = false
this_.$message.success(resp.data.message)
this_.$refs.htTable.load()
}
})
}else{
this_.$message.error('流程key已存在')
}
})
} else {
this_.$message.error('表单校验不通过, 请完善信息')
}
})
},
bindRelation(defId) {
this.dialogVisible2 = true
flow.getBindRelation(defId).then((resp) => {
this.bindData = resp.data
})
},
cleanData(defId) {
let this_ = this
this.$confirm(
'此操作会清除该流程所有的实例任务等数据,是否确认清除?',
'提示',
{
cancelButtonText: '取消',
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: false,
}
).then(() => {
req
.post(
window.context.bpmModel + '/flow/def/v1/cleanData?defId=' + defId
)
.then(function (response) {
let data = response.data
if (data.state) {
this_.$message.success(data.message)
} else {
this_.$message.fail(data.message)
}
})
})
},
deleteFlow(defId) {
let this_ = this
this.$confirm('删除后不可恢复,是否确定删除?', '提示', {
cancelButtonText: '取消',
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: false,
}).then(() => {
req
.remove(
this_.deleteUrl + '/physicsRemoveAllVersionByIds?ids=' + defId
)
.then(function (response) {
if (response.data && response.data.state) {
this_.$message.success('删除成功')
this_.$refs.htTable.load()
}
})
})
},
handExport() {
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
if (elTable && elTable.selection && elTable.selection.length > 10) {
this.$message.warning('因流程和表单相关数据较大,单次最多导出10条')
return
}
let ids = []
for (let item of elTable.selection) {
ids.push(item['id'])
}
if (ids.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let url = `${window.context.bpmModel}/flow/def/v1/exportXml?bpmDefId=${ids}`
req.download(url)
},
batchDelete() {
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let defKeys = []
for (let item of elTable.selection) {
defKeys.push(item['defKey'])
}
if (defKeys.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let me_ = this
this.$http
.get(
'${bpmRunTime}/runtime/instance/v1/getInstanceCountByDefKeys?defKeys=' +
defKeys.join(',')
)
.then(function (resp) {
if (resp.data) {
let countMap = {}
resp.data.forEach((d) => {
countMap[d['PROC_DEF_KEY_']] = d
})
let list = []
elTable.selection.forEach((s) => {
s = JSON.parse(JSON.stringify(s))
if (countMap[s.defKey]) {
s.totalCount = countMap[s.defKey].totalCount
s.runningCount = countMap[s.defKey].runningCount
} else {
s.totalCount = 0
s.runningCount = 0
}
list.push(s)
})
me_.deleteList = list
me_.deleteDialogVisible = true
me_.deleteReason = ''
return
}
me_.$message.error(resp.data.message)
})
},
batchDeleteConfirm() {
if (!this.deleteReason) {
//this.$message.warning('请输入删除原因');
//return
}
if (!this.deleteList || this.deleteList.length == 0) {
this.$message.warning('删除的流程不能为空')
return
}
let ids = []
this.deleteList.forEach((e) => {
ids.push(e.defId)
})
let this_ = this
this.fullscreenLoading = true
req
.remove(
'${bpmModel}/flow/def/v1/physicsRemoveAllVersionByIds?ids=' +
ids.join(',')
)
.then(function (response) {
if (response.data && response.data.state) {
this_.$message.success('删除成功')
this_.deleteDialogVisible = false
this_.$refs.htTable.load()
}
})
.finally(() => {
this.fullscreenLoading = false
})
},
//设置分类
openTypeSetDialog() {
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
this.$refs.typeSetDialog.showDialog({})
},
sysTypeDialogOnConfirm(data) {
let elTable = this.$refs.htTable
if (this.$refs.htTable.$refs && this.$refs.htTable.$refs.htTable) {
elTable = this.$refs.htTable.$refs.htTable
}
if (elTable && elTable.selection && elTable.selection.length == 0) {
this.$message.warning('请选择至少一项记录')
return
}
let id = []
for (let item of elTable.selection) {
id.push(item['id'])
}
let this_ = this
this.$http
.post('${bpmModel}/flow/def/v1/defSetCategory', {
typeName: data.name,
typeId: data.id,
defIds: id.join(','),
})
.then(function (resp) {
if (resp.data && resp.data.state) {
this_.$message({message: resp.data.message, type: 'success'})
setTimeout(function () {
this_.$refs.htTable.load()
}, 3000)
return
}
this_.$message.error(resp.data.message)
})
},
handlePcModule(row) {
let data = {
id: row.id,
name: row.name,
key: row.defKey,
}
this.$refs.pcModulePublish.showDialog(JSON.stringify(data), 8)
},
handleMobileModulePublish(row) {
let {id, name} = row
this.$refs.mobileModulePublish.showDialog(
JSON.stringify({
id,
name,
}),
5
)
},
handleSysModulePublish(row) {
this.$refs.sysModulePublish.showDialog(row)
},
handleTagsSetting(row) {
this.$refs.tagsSetting.showDialog(row)
},
repeatQuest() {
this.$refs.BpmnEdit.getModelData()
},
/**
* 展示查阅记录
*/
showRecords(currentRow){
this.$refs.modifyLog.showRecordDialog(currentRow, 'read');
},
},
created() {
let this_ = this
this.$root.$on('set-sub-flow', function (data) {
this_.activeName = ''
this_.showSubFlowSet = false
req
.get(
window.context.bpmModel +
'/flow/def/v1/subFlowDetail?defId=' +
data.defId +
'&nodeId=' +
data.nodeId
)
.then((response) => {
let data = response.data
this_.topDefKey = data.topDefKey
this_.subDefId = data.defId
this_.activeName = 'subFlowSet'
this_.isShowSubFlowSet = true
})
})
},
}
</script>
<style lang="scss" scoped>
@import '@/assets/css/element-variables.scss';
div[aria-invalid='true'] {
::v-deep {
.el-input__inner,
.el-input__inner:focus {
border-color: #f56c6c;
}
}
}
div.flow_conf {
::v-deep {
& > .el-dialog {
.el-dialog__header {
display: none;
height: 100%;
padding: 0;
}
.el-dialog__body {
height: 100%;
padding: 0;
}
}
}
}
.flow-edit-container {
padding: 0 !important;
::v-deep {
& > .el-tabs__header {
width: 180px;
background: #fff;
border-right: 1px solid #eee;
margin-right: 0;
}
.el-tabs__nav {
border-bottom: none;
}
& > .el-tabs__content {
height: calc(100% - 5px) !important;
.el-tab-pane {
height: 100%;
}
}
.el-tabs__item {
border: none !important;
color: #666;
font-weight: bold;
margin: 5px 0;
padding-left: 30px !important;
}
.is-left {
.el-tabs__item.is-active {
background: #f0f7ff !important;
color: #409eff;
position: relative;
&::before {
content: ' ';
height: 100%;
width: 2px;
background: #409eff;
position: absolute;
left: 0;
top: 0;
bottom: 0;
}
}
}
}
}
.bpmn-xml-link {
position: fixed;
bottom: 30px;
left: 35px;
z-index: 9999;
::v-deep {
.el-link--inner {
font-size: 13px;
color: $--color-primary;
i {
font-size: 13px;
font-weight: bold;
color: $--color-primary;
}
}
}
}
@media (max-width: 1366px) {
/deep/ .search-container__col {
flex-wrap: wrap;
.el-button-group {
margin-top: 10px;
}
}
}
.delete-dialog_container {
height: 300px;
padding-left: 20px;
margin-bottom: 10px;
overflow: auto;
}
.delete-dialog_container > div {
font-weight: 500;
font-size: 14px;
}
.delete-dialog_container /deep/ .el-icon-close {
padding: 6px;
cursor: pointer;
font-weight: bold;
font-size: 16px;
}
.delete-dialog /deep/ .el-dialog__body {
padding: 0px 30px;
}
::v-deep {
.cell > .el-table__column-filter-trigger {
display: none;
}
}
.title {
height: 48px;
line-height: 48px;
border-bottom: 1px solid #e6e6e6;
&_icon {
margin-left: 24px;
margin-right: 10px;
color: #409eff;
cursor: pointer;
font-size: 16px;
font-weight: bold;
}
&_tit {
font-size: 16px;
font-weight: bold;
color: #222222;
}
}
</style>