@jiangood/springboot-admin-starter 0.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/config/config.js +10 -0
- package/config/config.local.js +10 -0
- package/config/defaultConfig.js +35 -0
- package/config/plugins/forms.js +44 -0
- package/config/plugins/routes.js +82 -0
- package/package.json +41 -0
- package/src/.npmignore +6 -0
- package/src/app.js +0 -0
- package/src/asserts/login_bg.jpg +0 -0
- package/src/asserts/welcome.png +0 -0
- package/src/components/InstanceInfo.jsx +138 -0
- package/src/components/InstanceStatusInfo.jsx +79 -0
- package/src/components/StreamLog.jsx +27 -0
- package/src/components/flow/BpmnUtils.js +85 -0
- package/src/components/flow/customTranslate/customTranslate.js +19 -0
- package/src/components/flow/customTranslate/translations.js +79 -0
- package/src/components/flow/design/contextPad.js +50 -0
- package/src/components/flow/design/form/ConditionForm.jsx +316 -0
- package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
- package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
- package/src/components/flow/design/palette.js +39 -0
- package/src/components/monitor/AllDefinition.jsx +46 -0
- package/src/components/monitor/AllInstance.jsx +76 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/ButtonList.d.ts +9 -0
- package/src/framework/components/ButtonList.jsx +91 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Echarts/index.d.ts +10 -0
- package/src/framework/components/Echarts/index.jsx +49 -0
- package/src/framework/components/EditTable/index.d.ts +11 -0
- package/src/framework/components/EditTable/index.jsx +85 -0
- package/src/framework/components/EditTable/index.less +29 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/FieldRemoteTree.jsx +20 -0
- package/src/framework/components/Gap/index.d.ts +10 -0
- package/src/framework/components/Gap/index.jsx +15 -0
- package/src/framework/components/Gap/index.less +3 -0
- package/src/framework/components/HasPerm.jsx +18 -0
- package/src/framework/components/ImageView.d.ts +12 -0
- package/src/framework/components/ImageView.jsx +64 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +13 -0
- package/src/framework/components/MsgBox.jsx +180 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/OrgTree.jsx +60 -0
- package/src/framework/components/Page/index.d.ts +10 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.jsx +31 -0
- package/src/framework/components/Panel/index.d.ts +11 -0
- package/src/framework/components/Panel/index.jsx +24 -0
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +38 -0
- package/src/framework/components/ProTable/index.jsx +258 -0
- package/src/framework/components/ProTable/index.less +3 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree.jsx +53 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +38 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
- package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
- package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
- package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
- package/src/framework/components/field/FieldEditTable/index.less +29 -0
- package/src/framework/components/field/FieldEditor.jsx +48 -0
- package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
- package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
- package/src/framework/components/field/FieldInput.jsx +13 -0
- package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
- package/src/framework/components/field/FieldPassword.jsx +11 -0
- package/src/framework/components/field/FieldProps.ts +19 -0
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
- package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
- package/src/framework/components/field/FieldTree.jsx +45 -0
- package/src/framework/components/field/dict/index.tsx +110 -0
- package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
- package/src/framework/components/field/flat-multiple-select/index.less +12 -0
- package/src/framework/components/field/flat-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-select/index.jsx +107 -0
- package/src/framework/components/field/flat-select/index.less +12 -0
- package/src/framework/components/field/index.js +33 -0
- package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
- package/src/framework/components/field/input-number-percent/index.jsx +28 -0
- package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
- package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
- package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
- package/src/framework/components/field/select/index.jsx +2 -0
- package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
- package/src/framework/components/field/switch-y-n/index.jsx +31 -0
- package/src/framework/components/field/text/index.tsx +7 -0
- package/src/framework/components/field/time/DatePickerString.tsx +37 -0
- package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
- package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
- package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
- package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
- package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
- package/src/framework/components/field/time/TimePickerTool.ts +14 -0
- package/src/framework/components/field/time/YearPickerString.tsx +41 -0
- package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
- package/src/framework/components/field/time/index.tsx +7 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
- package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
- package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
- package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
- package/src/framework/components/field/upload/index.jsx +3 -0
- package/src/framework/components/index.js +25 -0
- package/src/framework/components/system.jsx +29 -0
- package/src/framework/components/view/ViewBoolean.jsx +15 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +50 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +61 -0
- package/src/framework/components/view/ViewPassword.jsx +24 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.jsx +9 -0
- package/src/framework/components/view/index.js +12 -0
- package/src/framework/index.js +3 -0
- package/src/framework/system/FormRegistry.js +58 -0
- package/src/framework/system/dict.js +88 -0
- package/src/framework/system/http.jsx +290 -0
- package/src/framework/system/index.js +13 -0
- package/src/framework/system/page.js +109 -0
- package/src/framework/system/permission.js +44 -0
- package/src/framework/system/sys.js +60 -0
- package/src/framework/system/theme.js +17 -0
- package/src/framework/utils/arr.js +118 -0
- package/src/framework/utils/browser.js +24 -0
- package/src/framework/utils/color.js +269 -0
- package/src/framework/utils/date.js +173 -0
- package/src/framework/utils/debounce.js +33 -0
- package/src/framework/utils/dom.js +16 -0
- package/src/framework/utils/eventBus.js +70 -0
- package/src/framework/utils/html.js +13 -0
- package/src/framework/utils/index.js +17 -0
- package/src/framework/utils/obj.js +72 -0
- package/src/framework/utils/storage.js +37 -0
- package/src/framework/utils/str.js +297 -0
- package/src/framework/utils/tree.js +175 -0
- package/src/framework/utils/uid.js +76 -0
- package/src/framework/utils/url.js +84 -0
- package/src/framework/utils/validate.js +9 -0
- package/src/index.js +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +174 -0
- package/src/layouts/admin/index.less +64 -0
- package/src/layouts/index.jsx +163 -0
- package/src/layouts/index.less +45 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/api/accessLog/index.jsx +108 -0
- package/src/pages/api/accountResource/index.jsx +149 -0
- package/src/pages/api/doc.jsx +135 -0
- package/src/pages/api/index.jsx +163 -0
- package/src/pages/api/resource.jsx +18 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +297 -0
- package/src/pages/flowable/index.jsx +128 -0
- package/src/pages/flowable/instance/view.jsx +13 -0
- package/src/pages/flowable/monitor.jsx +106 -0
- package/src/pages/flowable/task/form.jsx +99 -0
- package/src/pages/flowable/task/index.jsx +200 -0
- package/src/pages/flowable/test/form.jsx +31 -0
- package/src/pages/flowable/test/index.jsx +54 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/job/index.jsx +239 -0
- package/src/pages/job/logList.jsx +100 -0
- package/src/pages/job/status.jsx +84 -0
- package/src/pages/login.jsx +144 -0
- package/src/pages/login.less +53 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +73 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +152 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +263 -0
- package/src/pages/system/role/index.jsx +314 -0
- package/src/pages/system/role/perm.jsx +111 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +132 -0
- package/src/pages/system/user/index.jsx +261 -0
- package/src/pages/test.jsx +16 -0
- package/src/pages/ureport/index.jsx +43 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +63 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
class CustomContextPad {
|
|
2
|
+
constructor(config, contextPad, create, elementFactory, injector, translate) {
|
|
3
|
+
this.create = create;
|
|
4
|
+
this.elementFactory = elementFactory;
|
|
5
|
+
this.translate = translate;
|
|
6
|
+
|
|
7
|
+
if (config.autoPlace !== false) {
|
|
8
|
+
this.autoPlace = injector.get('autoPlace', false);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
contextPad.registerProvider(this);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static $inject = ['config', 'contextPad', 'create', 'elementFactory', 'injector'];
|
|
15
|
+
|
|
16
|
+
getContextPadEntries(element) {
|
|
17
|
+
const { autoPlace, create, elementFactory } = this;
|
|
18
|
+
|
|
19
|
+
function appendServiceTask(event, element) {
|
|
20
|
+
if (autoPlace) {
|
|
21
|
+
const shape = elementFactory.createShape({ type: 'bpmn:UserTask' });
|
|
22
|
+
autoPlace.append(element, shape);
|
|
23
|
+
} else {
|
|
24
|
+
appendServiceTaskStart(event, element);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function appendServiceTaskStart(event) {
|
|
29
|
+
const shape = elementFactory.createShape({ type: 'bpmn:UserTask' });
|
|
30
|
+
create.start(event, shape, element);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
'append.append-task': {
|
|
35
|
+
group: 'model',
|
|
36
|
+
className: 'bpmn-icon-user-task',
|
|
37
|
+
title: '追加用户任务',
|
|
38
|
+
action: {
|
|
39
|
+
click: appendServiceTask,
|
|
40
|
+
dragstart: appendServiceTaskStart,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
__init__: ['customContextPad'],
|
|
49
|
+
customContextPad: ['type', CustomContextPad],
|
|
50
|
+
};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Button, Form, Input, InputNumber, message, Radio, Table} from 'antd';
|
|
3
|
+
import {DeleteOutlined, PlusOutlined} from '@ant-design/icons';
|
|
4
|
+
import {ArrUtil, ProModal} from "../../../../framework";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 条件表单
|
|
8
|
+
* onFinish
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const PREFIX = 'flowable:';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const metaInfo = {
|
|
17
|
+
text: {
|
|
18
|
+
ops: {
|
|
19
|
+
'==': '等于',
|
|
20
|
+
'!=': '不等于',
|
|
21
|
+
contains: '包含',
|
|
22
|
+
'!contains': '不包含',
|
|
23
|
+
startWith: '开头等于',
|
|
24
|
+
endWith: '结尾等于',
|
|
25
|
+
},
|
|
26
|
+
render() {
|
|
27
|
+
return <Input />;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
digit: {
|
|
31
|
+
ops: {
|
|
32
|
+
'==': '等于',
|
|
33
|
+
'!=': '不等于',
|
|
34
|
+
'>': '大于',
|
|
35
|
+
'<': '小于',
|
|
36
|
+
'>=': '大于等于',
|
|
37
|
+
'<=': '小于等于',
|
|
38
|
+
between: '介于',
|
|
39
|
+
},
|
|
40
|
+
render(op) {
|
|
41
|
+
if (op != 'between') return <InputNumber />;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Input.Group>
|
|
45
|
+
<InputNumber placeholder="最小值"></InputNumber>
|
|
46
|
+
<InputNumber placeholder="最大值"></InputNumber>
|
|
47
|
+
</Input.Group>
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
boolean: {
|
|
52
|
+
ops: {
|
|
53
|
+
'==': '等于',
|
|
54
|
+
},
|
|
55
|
+
render() {
|
|
56
|
+
return <InputNumber />;
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default class extends React.Component {
|
|
62
|
+
|
|
63
|
+
constructor(props) {
|
|
64
|
+
super(props);
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
let conditionList = this.props.bo.get('flowable:conditionList');
|
|
71
|
+
conditionList = conditionList ? JSON.parse(conditionList) : []
|
|
72
|
+
this.state.conditionList = conditionList;
|
|
73
|
+
this.state.expression = this.createExpression(conditionList)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
state = {
|
|
77
|
+
expression: null,
|
|
78
|
+
conditionList:[],
|
|
79
|
+
modalForm: {
|
|
80
|
+
key: null,
|
|
81
|
+
keyLabel: null,
|
|
82
|
+
|
|
83
|
+
valueType: null,
|
|
84
|
+
|
|
85
|
+
op: null,
|
|
86
|
+
opLabel: null,
|
|
87
|
+
|
|
88
|
+
value: null,
|
|
89
|
+
valueLabel: null,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
addRef = React.createRef();
|
|
94
|
+
|
|
95
|
+
add = () => {
|
|
96
|
+
this.setState({ modalForm: {} });
|
|
97
|
+
this.addRef.current.show();
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
handleAdd = (values) => {
|
|
101
|
+
const { modalForm } = this.state;
|
|
102
|
+
const { conditionList } = this.state;
|
|
103
|
+
modalForm.value = values.value;
|
|
104
|
+
conditionList.push(modalForm);
|
|
105
|
+
this.save(conditionList);
|
|
106
|
+
this.addRef.current.close();
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
handleDelete = (item) => {
|
|
110
|
+
let { conditionList } = this.state;
|
|
111
|
+
|
|
112
|
+
ArrUtil.remove(conditionList, item)
|
|
113
|
+
this.save(conditionList);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
save = (conditionList) => {
|
|
117
|
+
const expression = this.createExpression(conditionList);
|
|
118
|
+
|
|
119
|
+
this.setState({ conditionList, expression }, ()=>this.setNodeLabel());
|
|
120
|
+
this.setConditionData(expression, conditionList);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
createExpression(conditionList) {
|
|
124
|
+
const expressionList = [];
|
|
125
|
+
conditionList.forEach((i) => {
|
|
126
|
+
expressionList.push(this.createExpressionByCondition(i));
|
|
127
|
+
});
|
|
128
|
+
const expression = expressionList.join('&&');
|
|
129
|
+
|
|
130
|
+
console.log('条件表达式', expression);
|
|
131
|
+
|
|
132
|
+
return expression;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 创建表达式
|
|
137
|
+
* key: "days"
|
|
138
|
+
* keyLabel: "请假天数"
|
|
139
|
+
* op: "=="
|
|
140
|
+
* opLabel: "等于"
|
|
141
|
+
* value: 34
|
|
142
|
+
* valueType: "digit", "text"
|
|
143
|
+
*
|
|
144
|
+
* @param i
|
|
145
|
+
* @returns {*}
|
|
146
|
+
*/
|
|
147
|
+
createExpressionByCondition(condition) {
|
|
148
|
+
const { key, op, value, valueType } = condition;
|
|
149
|
+
switch (valueType) {
|
|
150
|
+
case 'digit':
|
|
151
|
+
return key + op + value;
|
|
152
|
+
case 'text':
|
|
153
|
+
if (op === 'contains') {
|
|
154
|
+
return key + ".contains('" + value + "')";
|
|
155
|
+
}
|
|
156
|
+
if (op === '!contains') {
|
|
157
|
+
return '!' + key + ".contains('" + value + "')";
|
|
158
|
+
}
|
|
159
|
+
return key + op + "'" + value + "'";
|
|
160
|
+
default:
|
|
161
|
+
throw new Error('未知类型' + valueType);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
columns = [
|
|
166
|
+
{
|
|
167
|
+
dataIndex: 'key',
|
|
168
|
+
title: '名',
|
|
169
|
+
render(_, r) {
|
|
170
|
+
return r.keyLabel;
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
dataIndex: 'opLabel',
|
|
175
|
+
title: '操作',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
dataIndex: 'value',
|
|
179
|
+
title: '值',
|
|
180
|
+
render(_, r) {
|
|
181
|
+
if (r.valueLabel != null) {
|
|
182
|
+
return r.valueLabel;
|
|
183
|
+
}
|
|
184
|
+
return r.value;
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
dataIndex: 'option',
|
|
189
|
+
title: '-',
|
|
190
|
+
render: (_, record) => (
|
|
191
|
+
<a onClick={() => this.handleDelete(record)}>
|
|
192
|
+
<DeleteOutlined />
|
|
193
|
+
</a>
|
|
194
|
+
),
|
|
195
|
+
},
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
setConditionData = (expression, conditionList) => {
|
|
199
|
+
if (expression != null && expression != '') {
|
|
200
|
+
expression = '${' + expression + '}'
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 设置标准条件表达式
|
|
204
|
+
const conditionExpression = this.props.moddle.create('bpmn:FormalExpression', {body: expression});
|
|
205
|
+
|
|
206
|
+
this.props.modeling.updateProperties(this.props.node, {conditionExpression: conditionExpression});
|
|
207
|
+
|
|
208
|
+
// 保存条件列表 (最总存在xml中)
|
|
209
|
+
this.props.bo.set('flowable:conditionList', JSON.stringify(conditionList))
|
|
210
|
+
message.success("设置成功")
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
render() {
|
|
214
|
+
const { conditionVariable } = this.props;
|
|
215
|
+
|
|
216
|
+
if (conditionVariable == null || conditionVariable.length == 0) {
|
|
217
|
+
return '未设置条件变量,需在后台XML';
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const { modalForm } = this.state;
|
|
221
|
+
let { conditionList } = this.state;
|
|
222
|
+
|
|
223
|
+
let { valueType, op, opLabel, value } = modalForm;
|
|
224
|
+
|
|
225
|
+
const meta = metaInfo[valueType];
|
|
226
|
+
|
|
227
|
+
conditionList = JSON.parse(JSON.stringify(conditionList)); // 这样才能触发dataSource变化
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
<>
|
|
231
|
+
<Button type="primary" onClick={this.add} icon={<PlusOutlined />}>
|
|
232
|
+
添加条件
|
|
233
|
+
</Button>
|
|
234
|
+
<div className="q-my-sm" />
|
|
235
|
+
<Table
|
|
236
|
+
dataSource={conditionList}
|
|
237
|
+
columns={this.columns}
|
|
238
|
+
pagination={false}
|
|
239
|
+
size="small"
|
|
240
|
+
bordered
|
|
241
|
+
rowKey="key"
|
|
242
|
+
></Table>
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
<div className="q-my-md"></div>
|
|
246
|
+
|
|
247
|
+
<div>条件表达式: {this.state.expression}</div>
|
|
248
|
+
<div className="q-my-md"></div>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<ProModal actionRef={this.addRef} title="添加条件">
|
|
252
|
+
<Form onFinish={this.handleAdd} layout="vertical">
|
|
253
|
+
<Form.Item name="item" label="数据" rules={[{ required: true }]}>
|
|
254
|
+
<Radio.Group
|
|
255
|
+
onChange={(e) => {
|
|
256
|
+
const form = {
|
|
257
|
+
key: e.target.value.name,
|
|
258
|
+
keyLabel: e.target.value.label,
|
|
259
|
+
valueType: e.target.value.valueType,
|
|
260
|
+
};
|
|
261
|
+
this.setState({ modalForm: form });
|
|
262
|
+
}}
|
|
263
|
+
>
|
|
264
|
+
{conditionVariable.map((v) => (
|
|
265
|
+
<Radio key={v.name} name={v.name} value={v}>
|
|
266
|
+
{v.label}
|
|
267
|
+
</Radio>
|
|
268
|
+
))}
|
|
269
|
+
</Radio.Group>
|
|
270
|
+
</Form.Item>
|
|
271
|
+
|
|
272
|
+
{meta && (
|
|
273
|
+
<Form.Item name="op" label="符号" rules={[{ required: true }]}>
|
|
274
|
+
<Radio.Group
|
|
275
|
+
onChange={(e) => {
|
|
276
|
+
op = e.target.value;
|
|
277
|
+
opLabel = meta.ops[op];
|
|
278
|
+
if (value != null && (op == 'between' || value.indexOf(' - ') >= 0)) {
|
|
279
|
+
value = null;
|
|
280
|
+
}
|
|
281
|
+
modalForm.op = op;
|
|
282
|
+
modalForm.opLabel = opLabel;
|
|
283
|
+
modalForm.value = value;
|
|
284
|
+
this.setState({ modalForm });
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
287
|
+
{Object.keys(meta.ops).map((k) => {
|
|
288
|
+
const kv = {
|
|
289
|
+
key: k,
|
|
290
|
+
value: meta.ops[k],
|
|
291
|
+
};
|
|
292
|
+
return (
|
|
293
|
+
<Radio key={k} value={k}>
|
|
294
|
+
{kv.value}
|
|
295
|
+
</Radio>
|
|
296
|
+
);
|
|
297
|
+
})}
|
|
298
|
+
</Radio.Group>
|
|
299
|
+
</Form.Item>
|
|
300
|
+
)}
|
|
301
|
+
|
|
302
|
+
{meta && (
|
|
303
|
+
<Form.Item name="value" label="值" rules={[{ required: true }]}>
|
|
304
|
+
{meta.render(op)}
|
|
305
|
+
</Form.Item>
|
|
306
|
+
)}
|
|
307
|
+
|
|
308
|
+
<Button type="primary" htmlType="submit">
|
|
309
|
+
确定
|
|
310
|
+
</Button>
|
|
311
|
+
</Form>
|
|
312
|
+
</ProModal>
|
|
313
|
+
</>
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Form, Select} from 'antd';
|
|
3
|
+
import {HttpUtil} from "../../../../framework";
|
|
4
|
+
|
|
5
|
+
export default class extends React.Component {
|
|
6
|
+
bo = null;
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
data: {},
|
|
10
|
+
|
|
11
|
+
selectOptions: [],
|
|
12
|
+
|
|
13
|
+
javaDelegateOptions:[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.bo = props.bo;
|
|
19
|
+
|
|
20
|
+
const data = {};
|
|
21
|
+
data['flowable:delegateExpression'] = this.bo.get('flowable:delegateExpression');
|
|
22
|
+
this.state.data = data;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
componentDidMount() {
|
|
26
|
+
HttpUtil.get('admin/flowable/model/javaDelegateOptions').then(rs=>{
|
|
27
|
+
this.setState({javaDelegateOptions:rs})
|
|
28
|
+
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
onValuesChange = (changedValue) => {
|
|
33
|
+
for (let key in changedValue) {
|
|
34
|
+
this.bo.set(key, changedValue[key]);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<Form
|
|
42
|
+
onValuesChange={this.onValuesChange}
|
|
43
|
+
initialValues={this.state.data}
|
|
44
|
+
layout={'vertical'}
|
|
45
|
+
>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<Form.Item label="监听类(表达式)" name="flowable:delegateExpression" extra="需实现JavaDelegate接口">
|
|
49
|
+
<Select options={this.state.javaDelegateOptions} ></Select>
|
|
50
|
+
</Form.Item>
|
|
51
|
+
</Form>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Form, Input} from 'antd';
|
|
3
|
+
|
|
4
|
+
export default class TimerEventDefinitionForm extends React.Component {
|
|
5
|
+
bo = null;
|
|
6
|
+
|
|
7
|
+
state = {
|
|
8
|
+
data: {},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.bo = props.bo;
|
|
14
|
+
|
|
15
|
+
const data = {};
|
|
16
|
+
|
|
17
|
+
this.state.data = data;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
onValuesChange = (changedValue) => {};
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<a
|
|
26
|
+
href="https://docs.camunda.org/manual/7.16/reference/bpmn20/events/timer-events/"
|
|
27
|
+
target="_blank"
|
|
28
|
+
>
|
|
29
|
+
参考文档1
|
|
30
|
+
</a>
|
|
31
|
+
|
|
32
|
+
<a
|
|
33
|
+
href="https://docs.camunda.io/docs/components/modeler/bpmn/timer-events/"
|
|
34
|
+
target="_blank"
|
|
35
|
+
>
|
|
36
|
+
参考文档2
|
|
37
|
+
</a>
|
|
38
|
+
<Form
|
|
39
|
+
onValuesChange={this.onValuesChange}
|
|
40
|
+
initialValues={this.state.data}
|
|
41
|
+
layout={'vertical'}
|
|
42
|
+
>
|
|
43
|
+
<Form.Item
|
|
44
|
+
label="开始时间 timeDate"
|
|
45
|
+
name="timeDate"
|
|
46
|
+
extra="触发时间 如2019-10-01T12:00:00Z"
|
|
47
|
+
>
|
|
48
|
+
<Input />
|
|
49
|
+
</Form.Item>
|
|
50
|
+
|
|
51
|
+
<Form.Item label="持续时间 timeDuration" name="timeDuration" extra="PnYnMnDTnHnMnS">
|
|
52
|
+
<Input />
|
|
53
|
+
</Form.Item>
|
|
54
|
+
|
|
55
|
+
<Form.Item label="循环时间 timeCycle" name="timeCycle" extra="包含持续时间和次数 如PT5M">
|
|
56
|
+
<Input />
|
|
57
|
+
</Form.Item>
|
|
58
|
+
</Form>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Card, Divider, Form, Input, Select} from 'antd';
|
|
3
|
+
import BpmnUtils from '../../BpmnUtils';
|
|
4
|
+
import {HttpUtil} from "../../../../framework";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const PREFIX = 'flowable:';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default class extends React.Component {
|
|
11
|
+
state = {
|
|
12
|
+
assignmentType: null,
|
|
13
|
+
assignmentTypeList: [],
|
|
14
|
+
assignmentObjectList: [],
|
|
15
|
+
|
|
16
|
+
assignmentTypeMap: {},
|
|
17
|
+
|
|
18
|
+
initData: {},
|
|
19
|
+
|
|
20
|
+
loading: true,
|
|
21
|
+
|
|
22
|
+
formKeyOptions:[]
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
formRef = React.createRef();
|
|
26
|
+
|
|
27
|
+
destroyed = false;
|
|
28
|
+
|
|
29
|
+
constructor(props) {
|
|
30
|
+
super(props);
|
|
31
|
+
|
|
32
|
+
const data = {};
|
|
33
|
+
data.assignmentType = this.props.bo.get('flowable:assignmentType');
|
|
34
|
+
data.assignmentObject = this.props.bo.get('flowable:assignmentObject');
|
|
35
|
+
data['flowable:assignee'] = this.props.bo.get('flowable:assignee');
|
|
36
|
+
data['flowable:formKey'] = this.props.bo.get('flowable:formKey');
|
|
37
|
+
this.state.initData = data;
|
|
38
|
+
this.state.assignmentType = data.assignmentType
|
|
39
|
+
|
|
40
|
+
if(this.props.model.formKeyList){
|
|
41
|
+
this.state.formKeyOptions = props.model.formKeyList.map(k=>{
|
|
42
|
+
return {
|
|
43
|
+
label:k.label,
|
|
44
|
+
value:k.value
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
componentDidMount() {
|
|
52
|
+
const {initData} = this.state;
|
|
53
|
+
HttpUtil.get('admin/flowable/model/assignmentTypeList').then(assignmentTypeList => {
|
|
54
|
+
if (this.destroyed) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const assignmentTypeMap = {};
|
|
59
|
+
|
|
60
|
+
assignmentTypeList.forEach((a) => {
|
|
61
|
+
assignmentTypeMap[a.code] = a;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
this.setState({assignmentTypeList, assignmentTypeMap});
|
|
65
|
+
|
|
66
|
+
// 如果已指定分配类型
|
|
67
|
+
if (initData.assignmentType) {
|
|
68
|
+
const assignmentTypeInfo = assignmentTypeMap[initData.assignmentType];
|
|
69
|
+
|
|
70
|
+
if (assignmentTypeInfo) {
|
|
71
|
+
this.setState({assignmentTypeInfo});
|
|
72
|
+
this.loadAssignmentObjectTree(initData.assignmentType);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 如果已指定分配对象
|
|
76
|
+
if (initData.assignmentObject != null && assignmentTypeInfo != null) {
|
|
77
|
+
if (assignmentTypeInfo.multiple && !Array.isArray(initData.assignmentObject)) {
|
|
78
|
+
initData.assignmentObject = initData.assignmentObject.split(',');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.setState({loading: false});
|
|
83
|
+
console.log('initData', initData);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
loadAssignmentObjectTree = (assignmentTypeCode) => {
|
|
88
|
+
const url = 'admin/flowable/model/assignmentObjectTree?code=' + assignmentTypeCode;
|
|
89
|
+
HttpUtil.get(url).then((rs) => {
|
|
90
|
+
this.setState({assignmentObjectList: rs});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
onValuesChange = (changed, values) => {
|
|
96
|
+
for (let k in changed) {
|
|
97
|
+
let v = changed[k];
|
|
98
|
+
let fullKey = k.startsWith(PREFIX) ? k : PREFIX + k;
|
|
99
|
+
if (v == null) {
|
|
100
|
+
BpmnUtils.removeProperty(this.props.bo, fullKey);
|
|
101
|
+
} else {
|
|
102
|
+
this.props.bo.set(fullKey, v);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 选择用户或角色等具体
|
|
106
|
+
switch (k) {
|
|
107
|
+
case 'assignmentObject':
|
|
108
|
+
this.onAssignmentObjectChange(k, v, values)
|
|
109
|
+
break;
|
|
110
|
+
case 'assignmentType':
|
|
111
|
+
this.setState({assignmentType: v})
|
|
112
|
+
this.onAssignmentTypeChange(v)
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
onAssignmentTypeChange = (type) => {
|
|
120
|
+
let exp = type === 'assigneeExpression';
|
|
121
|
+
if (type != null && !exp) {
|
|
122
|
+
this.loadAssignmentObjectTree(type);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!exp) {
|
|
126
|
+
const assignmentTypeInfo = this.state.assignmentTypeMap[type];
|
|
127
|
+
if (assignmentTypeInfo.multiple) {
|
|
128
|
+
this.formRef.current.setFieldsValue({assignmentObject: []});
|
|
129
|
+
} else {
|
|
130
|
+
this.formRef.current.setFieldsValue({assignmentObject: null});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
BpmnUtils.removeProperty(this.props.bo, PREFIX + 'assignmentObject');
|
|
135
|
+
BpmnUtils.removeProperty(this.props.bo, PREFIX + 'assignee');
|
|
136
|
+
BpmnUtils.removeProperty(this.props.bo, PREFIX + 'candidateGroups');
|
|
137
|
+
BpmnUtils.removeProperty(this.props.bo, PREFIX + 'candidateUsers');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
onAssignmentObjectChange = (k, v, values) => {
|
|
142
|
+
// 设置自定义属性
|
|
143
|
+
const typeInfo = this.state.assignmentTypeMap[values.assignmentType];
|
|
144
|
+
const xmlKey = typeInfo.xmlAttribute;
|
|
145
|
+
this.props.bo.set(PREFIX + xmlKey, v);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
componentWillUnmount() {
|
|
150
|
+
this.destroyed = true;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
render() {
|
|
154
|
+
if (this.state.loading) {
|
|
155
|
+
return <Card loading={true} variant={"borderless"}></Card>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const {assignmentTypeList, assignmentObjectList} = this.state;
|
|
159
|
+
const assignmentType = this.state.assignmentType;
|
|
160
|
+
const assignmentTypeInfo = this.state.assignmentTypeMap[assignmentType];
|
|
161
|
+
const assignmentObjectOptions = assignmentObjectList.map((t) => ({
|
|
162
|
+
key: t.value,
|
|
163
|
+
label: t.label,
|
|
164
|
+
value: t.value
|
|
165
|
+
}
|
|
166
|
+
))
|
|
167
|
+
|
|
168
|
+
return <>
|
|
169
|
+
<Form
|
|
170
|
+
ref={this.formRef}
|
|
171
|
+
onValuesChange={this.onValuesChange}
|
|
172
|
+
initialValues={this.state.initData}
|
|
173
|
+
layout={'vertical'}
|
|
174
|
+
>
|
|
175
|
+
<Form.Item label="人员分配方式" name="assignmentType">
|
|
176
|
+
<Select allowClear={true}>
|
|
177
|
+
{assignmentTypeList.map((t) => <Select.Option key={t.code} value={t.code}>
|
|
178
|
+
{t.label}
|
|
179
|
+
</Select.Option>)}
|
|
180
|
+
<Select.Option key='assigneeExpression'
|
|
181
|
+
value='assigneeExpression'>办理人表达式</Select.Option>
|
|
182
|
+
</Select>
|
|
183
|
+
|
|
184
|
+
</Form.Item>
|
|
185
|
+
|
|
186
|
+
{assignmentTypeInfo && <Form.Item label="分配目标" name="assignmentObject">
|
|
187
|
+
<Select
|
|
188
|
+
mode={assignmentTypeInfo.multiple ? 'multiple' : false}
|
|
189
|
+
allowClear={true}
|
|
190
|
+
showSearch={true}
|
|
191
|
+
filterOption={(input, option) => option.label.includes(input)}
|
|
192
|
+
options={assignmentObjectOptions}
|
|
193
|
+
>
|
|
194
|
+
</Select>
|
|
195
|
+
</Form.Item>}
|
|
196
|
+
{assignmentType === 'assigneeExpression' && <Form.Item label='表达式' name='flowable:assignee'>
|
|
197
|
+
<Input/>
|
|
198
|
+
</Form.Item>}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<Divider />
|
|
203
|
+
|
|
204
|
+
<Form.Item label='指定表单' name='flowable:formKey'>
|
|
205
|
+
<Select options={this.state.formKeyOptions} placeholder='请选择表单' allowClear/>
|
|
206
|
+
</Form.Item>
|
|
207
|
+
|
|
208
|
+
</Form>
|
|
209
|
+
</>;
|
|
210
|
+
}
|
|
211
|
+
}
|