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.
- package/index.js +108 -0
- package/package.json +21 -0
- package/router.js +13 -0
- package/src/assets/font/iconfont.css +1158 -0
- package/src/assets/font/iconfont.eot +0 -0
- package/src/assets/font/iconfont.js +1 -0
- package/src/assets/font/iconfont.svg +827 -0
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/images/card_zwsj.png +0 -0
- package/src/assets/images/dataStore.png +0 -0
- package/src/assets/images/dataStore_icon.png +0 -0
- package/src/assets/images/draft.png +0 -0
- package/src/assets/images/edit_icon.png +0 -0
- package/src/assets/images/end.png +0 -0
- package/src/assets/images/end_icon.png +0 -0
- package/src/assets/images/gateway.png +0 -0
- package/src/assets/images/gateway_icon.png +0 -0
- package/src/assets/images/globalConnect_icon.png +0 -0
- package/src/assets/images/group_icon.png +0 -0
- package/src/assets/images/hander_icon.png +0 -0
- package/src/assets/images/icon_ quality.png +0 -0
- package/src/assets/images/lasso_icon.png +0 -0
- package/src/assets/images/mobile_preview.png +0 -0
- package/src/assets/images/participant_icon.png +0 -0
- package/src/assets/images/publicProcess_icon.png +0 -0
- package/src/assets/images/remind_example.png +0 -0
- package/src/assets/images/space_icon.png +0 -0
- package/src/assets/images/start.png +0 -0
- package/src/assets/images/start_icon.png +0 -0
- package/src/assets/images/subprocess_icon.png +0 -0
- package/src/assets/images/tab_set_example.png +0 -0
- package/src/assets/images/timer.png +0 -0
- package/src/assets/images/timer_icon.png +0 -0
- package/src/assets/images/userTask_icon.png +0 -0
- package/src/assets/images/user_task.png +0 -0
- package/src/assets/js/api/apiFlow.js +219 -0
- package/src/assets/js/flowInstall.js +25 -0
- package/src/assets/js/global/cacheGlobal.js +110 -0
- package/src/assets/js/global/flowGlobal.js +61 -0
- package/src/assets/js/global/flowUserGlobal.js +35 -0
- package/src/assets/js/global/interfaceCache.js +31 -0
- package/src/assets/js/storageIO.js +106 -0
- package/src/components/flowChart.vue +463 -0
- package/src/components/flowInst/css/flowInstList.scss +193 -0
- package/src/components/flowInst/flowInstList.vue +818 -0
- package/src/components/flowInst/flowInstTab.vue +2858 -0
- package/src/components/flowInst/popup/flowInstForm.vue +54 -0
- package/src/components/flowRoamRecords.vue +768 -0
- package/src/components/messageMould/messageMould.vue +547 -0
- package/src/components/roamRecord.vue +567 -0
- package/src/components/userSelect.vue +537 -0
- package/src/views/flowInstView.vue +178 -0
- package/src/views/menuRouter/flowMenuRouter.vue +260 -0
- package/src/views/menuRouter/flowResRouter.vue +223 -0
- package/src/views/popup/css/flowMain.scss +156 -0
- package/src/views/popup/event/compoment/diy/info.txt +1 -0
- package/src/views/popup/event/compoment/eventParentConfig.vue +45 -0
- package/src/views/popup/event/js/loadFlowEventPlugin.js +279 -0
- package/src/views/popup/js/controls/CustomContextPad.js +310 -0
- package/src/views/popup/js/controls/CustomPalette.js +303 -0
- package/src/views/popup/js/controls/CustomRenderer.js +219 -0
- package/src/views/popup/js/controls/index.js +11 -0
- package/src/views/popup/js/customModeler/CustomModeler.js +22 -0
- package/src/views/popup/js/translations/customTranslate.js +14 -0
- package/src/views/popup/js/translations/translations.js +234 -0
- package/src/views/popup/js/utils/utils.js +53 -0
- package/src/views/test.vue +79 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
export default function CustomContextPad(config, contextPad, create,globalConnect,connect,modeling, elementFactory, injector, translate) { //控件点击出现的小弹窗 overla
|
|
2
|
+
this.create = create;
|
|
3
|
+
this.globalConnect = globalConnect;
|
|
4
|
+
this.connect = connect;
|
|
5
|
+
this.modeling = modeling;
|
|
6
|
+
this.elementFactory = elementFactory;
|
|
7
|
+
this.translate = translate;
|
|
8
|
+
if (config.autoPlace !== false) {
|
|
9
|
+
this.autoPlace = injector.get('autoPlace', false);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
contextPad.registerProvider(this);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
CustomContextPad.$inject = [
|
|
16
|
+
'config',
|
|
17
|
+
'contextPad',
|
|
18
|
+
'create',
|
|
19
|
+
'globalConnect',
|
|
20
|
+
'connect',
|
|
21
|
+
'modeling',
|
|
22
|
+
'elementFactory',
|
|
23
|
+
'injector',
|
|
24
|
+
'translate',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
CustomContextPad.prototype.getContextPadEntries= function(element) {
|
|
28
|
+
const {
|
|
29
|
+
autoPlace,
|
|
30
|
+
create,
|
|
31
|
+
globalConnect,
|
|
32
|
+
connect,
|
|
33
|
+
modeling,
|
|
34
|
+
elementFactory,
|
|
35
|
+
translate,
|
|
36
|
+
} = this;
|
|
37
|
+
|
|
38
|
+
let businessObject = element.businessObject;
|
|
39
|
+
|
|
40
|
+
function startConnect(event, element) { //连线
|
|
41
|
+
connect.start(event, element);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function appendUserTask(event, element) {
|
|
45
|
+
if (autoPlace) {
|
|
46
|
+
const shape = elementFactory.createShape({type: 'bpmn:UserTask'});
|
|
47
|
+
autoPlace.append(element, shape);
|
|
48
|
+
createManyDeal(shape);
|
|
49
|
+
} else {
|
|
50
|
+
appendUserTaskStart(event);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function createManyDeal(shape){
|
|
55
|
+
let bpmnFactory= modeling._elementFactory._bpmnFactory;
|
|
56
|
+
shape.businessObject.assignee = "${assignee}";
|
|
57
|
+
shape.businessObject.loopCharacteristics = bpmnFactory.create("bpmn:MultiInstanceLoopCharacteristics",{
|
|
58
|
+
"isSequential":"false", // 并行执行还是顺序执行,这里是并行执行
|
|
59
|
+
"collection":"assigneeList_" + shape.id,
|
|
60
|
+
"elementVariable":"assignee",
|
|
61
|
+
});
|
|
62
|
+
shape.businessObject.loopCharacteristics.completionCondition = bpmnFactory.create("bpmn:FormalExpression",{
|
|
63
|
+
body:"${nrOfCompletedInstances/nrOfInstances == 1}"
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function appendUserTaskStart(event) {
|
|
68
|
+
const shape = elementFactory.createShape({type: 'bpmn:UserTask'});
|
|
69
|
+
create.start(event, shape, element);
|
|
70
|
+
createManyDeal(shape);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function appendDraft(event, element) {
|
|
74
|
+
if (autoPlace) {
|
|
75
|
+
const shape = elementFactory.createShape({type: 'bpmn:UserTask',nodeType:'draft'});
|
|
76
|
+
autoPlace.append(element, shape);
|
|
77
|
+
} else {
|
|
78
|
+
appendDraftStart(event);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function appendDraftStart(event) {
|
|
83
|
+
const shape = elementFactory.createShape({type: 'bpmn:UserTask',nodeType:'draft'});
|
|
84
|
+
create.start(event, shape, element);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function appendGateway(event, element) {
|
|
88
|
+
if (autoPlace) {
|
|
89
|
+
const shape = elementFactory.createShape({type: 'bpmn:InclusiveGateway'});
|
|
90
|
+
autoPlace.append(element, shape);
|
|
91
|
+
} else {
|
|
92
|
+
appendGatewayStart(event);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function appendGatewayStart(event) {
|
|
97
|
+
const shape = elementFactory.createShape({type: 'bpmn:InclusiveGateway'});
|
|
98
|
+
create.start(event, shape, element);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function appendEnd(event, element) {
|
|
102
|
+
if (autoPlace) {
|
|
103
|
+
const shape = elementFactory.createShape({type: 'bpmn:EndEvent'});
|
|
104
|
+
autoPlace.append(element, shape);
|
|
105
|
+
} else {
|
|
106
|
+
appendEndStart(event);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function appendEndStart(event) {
|
|
111
|
+
const shape = elementFactory.createShape({type: 'bpmn:EndEvent'});
|
|
112
|
+
create.start(event, shape, element);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
function removeElement(e) { //删除
|
|
117
|
+
modeling.removeElements([ element ]);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
let ccp = this;
|
|
121
|
+
function editElement(event, element){ //编辑
|
|
122
|
+
ccp.editBtnCallBack && ccp.editBtnCallBack(element);
|
|
123
|
+
// window.editNodeElement = element;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const noPadTypeArr= ["bpmn:SequenceFlow","bpmn:EndEvent","bpmn:Participant","bpmn:Lane"]; //不需要单独需要
|
|
127
|
+
const gateWayArr = ["bpmn:ExclusiveGateway","bpmn:ParallelGateway","bpmn:InclusiveGateway"]; //网关类型
|
|
128
|
+
if(element.type != 'label'){
|
|
129
|
+
if(noPadTypeArr.indexOf(element.type) == -1){ //如果是连线
|
|
130
|
+
if(['bpmn:BoundaryEvent','bpmn:IntermediateCatchEvent'].indexOf(element.type) > -1){
|
|
131
|
+
//自定义编辑节点
|
|
132
|
+
if(element.outgoing.length == 0){
|
|
133
|
+
return {
|
|
134
|
+
//自定义编辑节点
|
|
135
|
+
'append.edit':{
|
|
136
|
+
group:'event',
|
|
137
|
+
className: 'icon-custom demo-icon-edit',
|
|
138
|
+
title:translate('Append NodeEdit'),
|
|
139
|
+
action:{
|
|
140
|
+
click:editElement
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
'append.user-task':{
|
|
144
|
+
group: 'tools',
|
|
145
|
+
className: 'icon-custom demo-user-task',
|
|
146
|
+
title: translate('Append UserTask'),
|
|
147
|
+
action: {
|
|
148
|
+
click: appendUserTask,
|
|
149
|
+
dragstart: appendUserTaskStart
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
'create.connect': {//连线工具
|
|
153
|
+
group: 'gateway',
|
|
154
|
+
className: 'icon-custom demo-global-connect-tool',
|
|
155
|
+
title: translate('Activate the global connect tool'),
|
|
156
|
+
action: {
|
|
157
|
+
click: startConnect,
|
|
158
|
+
dragstart: startConnect
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
}
|
|
162
|
+
}else {
|
|
163
|
+
return{
|
|
164
|
+
//自定义编辑节点
|
|
165
|
+
'append.edit':{
|
|
166
|
+
group:'gateway',
|
|
167
|
+
className: 'icon-custom demo-icon-edit',
|
|
168
|
+
title:translate('Append NodeEdit'),
|
|
169
|
+
action:{
|
|
170
|
+
click:editElement
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}else {
|
|
176
|
+
let btnObj = {
|
|
177
|
+
'append.delete': {
|
|
178
|
+
group: 'tools',
|
|
179
|
+
className: 'bpmn-icon-trash',
|
|
180
|
+
title: translate('Remove'),
|
|
181
|
+
action: {
|
|
182
|
+
click: removeElement
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
//自定义编辑节点
|
|
186
|
+
'append.edit':{
|
|
187
|
+
group:'gateway',
|
|
188
|
+
className: 'icon-custom demo-icon-edit',
|
|
189
|
+
title:translate('Append NodeEdit'),
|
|
190
|
+
action:{
|
|
191
|
+
click:editElement
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
if(element.type=="bpmn:StartEvent"){
|
|
196
|
+
if(element.outgoing.length==0){
|
|
197
|
+
btnObj["append.user-task"]={
|
|
198
|
+
group: 'model',
|
|
199
|
+
className: 'bpmn-icon-manual',
|
|
200
|
+
title: "添加草稿",
|
|
201
|
+
action: {
|
|
202
|
+
click: appendDraft,
|
|
203
|
+
dragstart: appendDraftStart
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}else{
|
|
208
|
+
btnObj = {
|
|
209
|
+
'append.end-event':{
|
|
210
|
+
group: 'event',
|
|
211
|
+
className: 'icon-custom demo-end-pad',
|
|
212
|
+
title: translate('Create EndEvent'),
|
|
213
|
+
action: {
|
|
214
|
+
click: appendEnd,
|
|
215
|
+
dragstart: appendEnd
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
'append.exclusive-gateway':{
|
|
219
|
+
group: 'gateway',
|
|
220
|
+
className: 'icon-custom demo-gateway',
|
|
221
|
+
title: translate('Append Gateway'),
|
|
222
|
+
action: {
|
|
223
|
+
click: appendGateway,
|
|
224
|
+
dragstart: appendGatewayStart
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
'create.connect': {//连线工具
|
|
228
|
+
group: 'tools',
|
|
229
|
+
className: 'icon-custom demo-global-connect-tool',
|
|
230
|
+
title: translate('Activate the global connect tool'),
|
|
231
|
+
action: {
|
|
232
|
+
click: startConnect,
|
|
233
|
+
dragstart: startConnect
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
'append.delete': {
|
|
238
|
+
group: 'tools',
|
|
239
|
+
className: 'bpmn-icon-trash',
|
|
240
|
+
title: translate('Remove'),
|
|
241
|
+
action: {
|
|
242
|
+
click: removeElement
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
//自定义编辑节点
|
|
246
|
+
'append.edit':{
|
|
247
|
+
group:'gateway',
|
|
248
|
+
className: 'icon-custom demo-icon-edit',
|
|
249
|
+
title:translate('Append NodeEdit'),
|
|
250
|
+
action:{
|
|
251
|
+
click:editElement
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
'append.user-task':{
|
|
255
|
+
group: 'model',
|
|
256
|
+
className: 'icon-custom demo-user-task',
|
|
257
|
+
title: translate('Append UserTask'),
|
|
258
|
+
action: {
|
|
259
|
+
click: appendUserTask,
|
|
260
|
+
dragstart: appendUserTaskStart
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
return btnObj;
|
|
266
|
+
}
|
|
267
|
+
}else if(element.type == 'bpmn:EndEvent'|| (element.type == 'bpmn:SequenceFlow' && element.source && gateWayArr.indexOf(element.source.type) > -1)){
|
|
268
|
+
return{
|
|
269
|
+
//自定义编辑节点
|
|
270
|
+
'append.edit':{
|
|
271
|
+
group:'gateway',
|
|
272
|
+
className: 'icon-custom demo-icon-edit',
|
|
273
|
+
title:translate('Append NodeEdit'),
|
|
274
|
+
action:{
|
|
275
|
+
click:editElement
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
'append.delete': {
|
|
279
|
+
group: 'tools',
|
|
280
|
+
className: 'bpmn-icon-trash',
|
|
281
|
+
title: translate('Remove'),
|
|
282
|
+
action: {
|
|
283
|
+
click: removeElement
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
}else {
|
|
288
|
+
return{
|
|
289
|
+
'append.delete': {
|
|
290
|
+
group: 'tools',
|
|
291
|
+
className: 'bpmn-icon-trash',
|
|
292
|
+
title: translate('Remove'),
|
|
293
|
+
action: {
|
|
294
|
+
click: removeElement
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
const propertiesConfig = { //节点默认名称
|
|
303
|
+
'StartEvent': "开始",
|
|
304
|
+
"UserTask":"用户任务",
|
|
305
|
+
"EndEvent":"结束",
|
|
306
|
+
"ParallelGateway":"条件流转",
|
|
307
|
+
"Participant":"泳道",
|
|
308
|
+
"Group":"公共流程"
|
|
309
|
+
};
|
|
310
|
+
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
export default function CustomPalette(bpmnFactory,create,spaceTool,lassoTool,handTool,globalConnect,elementFactory, palette, translate) {
|
|
2
|
+
this.bpmnFactory = bpmnFactory;
|
|
3
|
+
this.create = create;
|
|
4
|
+
this.spaceTool = spaceTool; //工具栏
|
|
5
|
+
this.lassoTool = lassoTool;
|
|
6
|
+
this.handTool = handTool;
|
|
7
|
+
this.globalConnect = globalConnect;
|
|
8
|
+
this.elementFactory = elementFactory;
|
|
9
|
+
this.translate = translate;
|
|
10
|
+
|
|
11
|
+
palette.registerProvider(this);
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
CustomPalette.prototype.getPaletteEntries = function(element) {
|
|
17
|
+
const {
|
|
18
|
+
bpmnFactory,
|
|
19
|
+
create,
|
|
20
|
+
spaceTool,
|
|
21
|
+
elementFactory,
|
|
22
|
+
handTool,
|
|
23
|
+
globalConnect,
|
|
24
|
+
lassoTool,
|
|
25
|
+
translate
|
|
26
|
+
} = this;
|
|
27
|
+
|
|
28
|
+
function createControls(key) {
|
|
29
|
+
return function (event) {
|
|
30
|
+
const businessObject = bpmnFactory.create('bpmn:'+key);
|
|
31
|
+
//设置默认默默认名称
|
|
32
|
+
if(propertiesConfig[key] && !businessObject['name']){
|
|
33
|
+
businessObject['name'] = propertiesConfig[key];
|
|
34
|
+
}
|
|
35
|
+
const shape = elementFactory.createShape({type: 'bpmn:' + key,businessObject}); //拖动点击时候触发
|
|
36
|
+
businessObject.assignee = "${assignee}";
|
|
37
|
+
businessObject.loopCharacteristics = bpmnFactory.create("bpmn:MultiInstanceLoopCharacteristics",{
|
|
38
|
+
"isSequential":"false", // 并行执行还是顺序执行,这里是并行执行
|
|
39
|
+
"collection":"assigneeList_" + shape.id,
|
|
40
|
+
"elementVariable":"assignee",
|
|
41
|
+
});
|
|
42
|
+
businessObject.loopCharacteristics.completionCondition = bpmnFactory.create("bpmn:FormalExpression",{
|
|
43
|
+
body:"${nrOfCompletedInstances/nrOfInstances == 1}"
|
|
44
|
+
})
|
|
45
|
+
create.start(event, shape);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function createStart(key) {
|
|
50
|
+
return function (event) {
|
|
51
|
+
// 判断是否已存在开始节点,存在则提示无法添加
|
|
52
|
+
if(window.currentFlowStartNodeNum>0){
|
|
53
|
+
console.log("开始节点已存在,无需添加!");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//开始与草稿同时添加,但无法添加关联关系,在shape.add监听中进行手动连线
|
|
58
|
+
const businessObject = bpmnFactory.create('bpmn:'+key);
|
|
59
|
+
//设置默认默默认名称
|
|
60
|
+
if(propertiesConfig[key] && !businessObject['name']){
|
|
61
|
+
businessObject['name'] = propertiesConfig[key];
|
|
62
|
+
}
|
|
63
|
+
const shape = elementFactory.createShape({type: 'bpmn:' + key,x:0,y:22,businessObject}); //拖动点击时候触发
|
|
64
|
+
const draftObject = bpmnFactory.create('bpmn:UserTask');
|
|
65
|
+
if(propertiesConfig["UserTask"] && !draftObject['name']){
|
|
66
|
+
draftObject['name'] = propertiesConfig[key];
|
|
67
|
+
}
|
|
68
|
+
draftObject["name"]="开启任务";
|
|
69
|
+
const draftShape = elementFactory.createShape({type: 'bpmn:UserTask',x:100,y:0,nodeType:'draft',draftObject}); //拖动点击时候触发
|
|
70
|
+
// 设置全局变量,告知为第一次手动添加开始节点,用于在add监听中手动连线
|
|
71
|
+
window.ifFirstCreateStartNode = true;
|
|
72
|
+
create.start(event, [shape,draftShape]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function createGroupControls(event) { //添加公共流程块节点
|
|
77
|
+
const businessObject = bpmnFactory.create('bpmn:Group');
|
|
78
|
+
//设置默认默默认名称
|
|
79
|
+
if(propertiesConfig['Group']){
|
|
80
|
+
businessObject['name'] = propertiesConfig['Group'];
|
|
81
|
+
businessObject['custom'] = 1;
|
|
82
|
+
}
|
|
83
|
+
const shape = elementFactory.createShape({type: 'bpmn:Group' ,businessObject}); //拖动点击时候触发
|
|
84
|
+
create.start(event, shape);
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
function createSubprocess(event) { //子流程专用事件
|
|
90
|
+
const businessObject = bpmnFactory.create('bpmn:SubProcess');
|
|
91
|
+
businessObject['name'] = "子流程";
|
|
92
|
+
const subProcess = elementFactory.createShape({
|
|
93
|
+
type: 'bpmn:SubProcess',
|
|
94
|
+
x: 0,
|
|
95
|
+
y: 0,
|
|
96
|
+
isExpanded: true
|
|
97
|
+
},businessObject);
|
|
98
|
+
|
|
99
|
+
const startEvent = elementFactory.createShape({ //子流程中默认开始节点
|
|
100
|
+
type: 'bpmn:StartEvent',
|
|
101
|
+
x: 40,
|
|
102
|
+
y: 82,
|
|
103
|
+
parent: subProcess
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
create.start(event, [ subProcess, startEvent ], {
|
|
108
|
+
hints: {
|
|
109
|
+
autoSelect: [ startEvent ]
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
|
|
116
|
+
//重写tools
|
|
117
|
+
'create.hand-tool': {
|
|
118
|
+
group: 'tools',
|
|
119
|
+
className: 'icon-custom demo-hand-tool',
|
|
120
|
+
title: translate('Activate the hand tool'),
|
|
121
|
+
action: {
|
|
122
|
+
click: (event =>{
|
|
123
|
+
handTool.activateHand(event);
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
'create.lasso-tool': { //套索工具
|
|
129
|
+
group: 'tools',
|
|
130
|
+
className: 'icon-custom demo-lasso-tool',
|
|
131
|
+
title: translate('Activate the lasso tool'),
|
|
132
|
+
action: {
|
|
133
|
+
click: (event =>{
|
|
134
|
+
lassoTool.activateSelection(event);
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
'create.space-tool': { //创建/删除空间
|
|
140
|
+
group: 'tools',
|
|
141
|
+
className: 'icon-custom demo-space-tool',
|
|
142
|
+
title: translate('Activate the create/remove space tool'),
|
|
143
|
+
action: {
|
|
144
|
+
click: (event =>{
|
|
145
|
+
spaceTool.activateSelection(event);
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
//下划线
|
|
151
|
+
'create.tool-separator-diy': {
|
|
152
|
+
group: 'tools',
|
|
153
|
+
separator: true
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
'create.global-connect-tool': { //连线工具
|
|
157
|
+
group: 'tools',
|
|
158
|
+
className: 'icon-custom demo-global-connect-tool',
|
|
159
|
+
title: translate('Activate the global connect tool'),
|
|
160
|
+
action: {
|
|
161
|
+
click:(event =>{
|
|
162
|
+
globalConnect.toggle(event);
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
//自定义定时器
|
|
168
|
+
'create.intermediate-event-catch-timer':{ //自定义定时器组件
|
|
169
|
+
group: 'event',
|
|
170
|
+
className: 'icon-custom demo-data-timer',
|
|
171
|
+
title: translate('Create Timer'),
|
|
172
|
+
action:{
|
|
173
|
+
dragstart:createControls("IntermediateCatchEvent"),
|
|
174
|
+
click: createControls("IntermediateCatchEvent")
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
'create.start-event': { //自定义开始节点
|
|
179
|
+
group: 'event',
|
|
180
|
+
className: 'icon-custom demo-start',
|
|
181
|
+
title: translate('Create StartEvent'),
|
|
182
|
+
action: {
|
|
183
|
+
dragstart: createStart("StartEvent"),
|
|
184
|
+
click: createStart("StartEvent")
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
//自定义公共区域模块
|
|
189
|
+
'create.public-process-block':{
|
|
190
|
+
group: 'activity',
|
|
191
|
+
className: 'icon-custom demo-process-block',
|
|
192
|
+
title:translate('Create process block'),
|
|
193
|
+
action: {
|
|
194
|
+
dragstart: createGroupControls,
|
|
195
|
+
click: createGroupControls
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
'create.end-event': { //自定义结束节点
|
|
202
|
+
group: 'event',
|
|
203
|
+
className: 'icon-custom demo-end',
|
|
204
|
+
title: translate('Create EndEvent'),
|
|
205
|
+
action: {
|
|
206
|
+
dragstart: createControls("EndEvent"),
|
|
207
|
+
click: createControls("EndEvent")
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
'create.data-store': { //自定义数据操作节点
|
|
212
|
+
group: 'activity',
|
|
213
|
+
className: 'icon-custom demo-data-store',
|
|
214
|
+
title: translate('Create DataStoreReference'),
|
|
215
|
+
action: {
|
|
216
|
+
dragstart: createControls("DataStoreReference"),
|
|
217
|
+
click: createControls("DataStoreReference")
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
'create.user-task': { //自定义用户任务节点
|
|
222
|
+
group: 'event',
|
|
223
|
+
className: 'icon-custom demo-user-task',
|
|
224
|
+
title: translate('Create UserTask'),
|
|
225
|
+
action: {
|
|
226
|
+
dragstart: createControls("UserTask"),
|
|
227
|
+
click: createControls("UserTask")
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
//自定义网关闭节点
|
|
232
|
+
'create.exclusive-gateway': {
|
|
233
|
+
group: 'gateway',
|
|
234
|
+
className:'icon-custom demo-gateway',
|
|
235
|
+
title:translate('Create ExclusiveGateway'),
|
|
236
|
+
action: {
|
|
237
|
+
dragstart: createControls("InclusiveGateway"),
|
|
238
|
+
click: createControls("InclusiveGateway")
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
//子流程 subprocess-expanded
|
|
243
|
+
'create.subprocess-expanded': {
|
|
244
|
+
group: 'activity',
|
|
245
|
+
className: 'icon-custom demo-subprocess',
|
|
246
|
+
title: translate('Create expanded SubProcess'),
|
|
247
|
+
action: {
|
|
248
|
+
dragstart: createSubprocess,
|
|
249
|
+
click: createSubprocess
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
//自定义泳道
|
|
255
|
+
'create.participant-expanded': {
|
|
256
|
+
group: 'collaboration',
|
|
257
|
+
className: 'icon-custom demo-participant',
|
|
258
|
+
title: translate('Create Pool/Participant'),
|
|
259
|
+
action: {
|
|
260
|
+
dragstart: createControls("Participant"),
|
|
261
|
+
click: createControls("Participant")
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
//自定义分组
|
|
268
|
+
'create.group':{
|
|
269
|
+
group: 'artifact',
|
|
270
|
+
className: 'icon-custom demo-group',
|
|
271
|
+
title:translate('Create Group'),
|
|
272
|
+
action: {
|
|
273
|
+
dragstart: createControls("Group"),
|
|
274
|
+
click: createControls("Group")
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const propertiesConfig = { //节点默认名称
|
|
283
|
+
'StartEvent': "开始",
|
|
284
|
+
"UserTask":"用户任务",
|
|
285
|
+
"EndEvent":"结束",
|
|
286
|
+
"ParallelGateway":"条件流转",
|
|
287
|
+
"Participant":"泳道",
|
|
288
|
+
"Group":"公共流程"
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
CustomPalette.$inject = [
|
|
294
|
+
'bpmnFactory',
|
|
295
|
+
'create',
|
|
296
|
+
'spaceTool',
|
|
297
|
+
'lassoTool',
|
|
298
|
+
'handTool',
|
|
299
|
+
'globalConnect',
|
|
300
|
+
'elementFactory',
|
|
301
|
+
'palette',
|
|
302
|
+
'translate'
|
|
303
|
+
];
|