@jiangood/springboot-admin-starter 0.0.3 → 0.0.4
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/dist/config.js +32 -0
- package/config/dist/index.js +0 -1
- package/config/dist/plugins/form-plugin.js +2 -2
- package/package.json +12 -10
- package/src/forms/demoForm.jsx +5 -5
- package/src/framework/components/DownloadFileButton.jsx +2 -2
- package/src/framework/components/Ellipsis.jsx +2 -2
- package/src/framework/components/LinkButton.d.ts +4 -4
- package/src/framework/components/LinkButton.jsx +6 -9
- package/src/framework/components/Page/index.jsx +2 -2
- package/src/framework/components/PageLoading.tsx +27 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +6 -7
- package/src/framework/components/ProTable/index.d.ts +5 -1
- package/src/framework/components/ProTable/index.jsx +4 -6
- package/src/framework/components/ProTable/index.less +0 -1
- package/src/framework/components/ValueType/registry.jsx +9 -20
- package/src/framework/components/{index.js → index.ts} +2 -10
- package/src/framework/components/system/ButtonList.jsx +35 -0
- package/src/framework/components/system/HasPerm.tsx +14 -0
- package/src/framework/components/system/index.tsx +29 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.tsx +20 -0
- package/src/framework/components/view/ViewEllipsis.jsx +2 -2
- package/src/framework/components/view/ViewFile.jsx +1 -2
- package/src/framework/components/view/ViewImage.jsx +2 -3
- package/src/framework/components/view/ViewText.tsx +16 -0
- package/src/framework/components/view/{index.js → index.ts} +0 -2
- package/src/framework/field-components/FieldBoolean.d.ts +13 -0
- package/src/framework/field-components/FieldBoolean.jsx +76 -0
- package/src/framework/field-components/FieldDate.d.ts +25 -0
- package/src/framework/field-components/FieldDate.jsx +109 -0
- package/src/framework/field-components/FieldDateRange.d.ts +6 -0
- package/src/framework/field-components/FieldDateRange.jsx +101 -0
- package/src/framework/field-components/FieldDictSelect.d.ts +13 -0
- package/src/framework/field-components/FieldDictSelect.jsx +16 -0
- package/src/framework/field-components/FieldEditor.d.ts +10 -0
- package/src/framework/field-components/FieldEditor.jsx +58 -0
- package/src/framework/field-components/FieldPercent.d.ts +12 -0
- package/src/framework/field-components/FieldPercent.jsx +27 -0
- package/src/framework/field-components/FieldRemoteSelect.d.ts +13 -0
- package/src/framework/field-components/FieldRemoteSelect.jsx +87 -0
- package/src/framework/field-components/FieldRemoteSelectMultiple.d.ts +13 -0
- package/src/framework/field-components/FieldRemoteSelectMultiple.jsx +86 -0
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.d.ts +20 -0
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.jsx +86 -0
- package/src/framework/field-components/FieldRemoteTree.d.ts +21 -0
- package/src/framework/field-components/FieldRemoteTree.jsx +45 -0
- package/src/framework/field-components/FieldRemoteTreeCascader.d.ts +23 -0
- package/src/framework/field-components/FieldRemoteTreeCascader.jsx +61 -0
- package/src/framework/field-components/FieldRemoteTreeSelect.d.ts +17 -0
- package/src/framework/field-components/FieldRemoteTreeSelect.jsx +67 -0
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.d.ts +17 -0
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.jsx +68 -0
- package/src/framework/field-components/FieldSysOrgTree.d.ts +12 -0
- package/src/framework/field-components/FieldSysOrgTree.jsx +23 -0
- package/src/framework/field-components/FieldSysOrgTreeSelect.d.ts +12 -0
- package/src/framework/field-components/FieldSysOrgTreeSelect.jsx +23 -0
- package/src/framework/{components/field/FieldEditTable/index.d.ts → field-components/FieldTable.d.ts} +5 -2
- package/src/framework/{components/field/FieldEditTable/index.jsx → field-components/FieldTable.jsx} +29 -21
- package/src/framework/{components/field/select/FieldTableSelect/index.d.ts → field-components/FieldTableSelect.d.ts} +4 -14
- package/src/framework/field-components/FieldTableSelect.jsx +59 -0
- package/src/framework/{components/field/upload → field-components}/FieldUploadFile.d.ts +0 -1
- package/src/framework/{components/field/upload → field-components}/FieldUploadFile.jsx +5 -9
- package/src/framework/field-components/index.ts +20 -0
- package/src/framework/{components/OrgTree.jsx → field-components/system/OrgTree.tsx} +8 -7
- package/src/framework/{components/RoleTree.jsx → field-components/system/RoleTree.tsx} +3 -3
- package/src/framework/field-components/system/index.ts +2 -0
- package/src/framework/index.ts +4 -0
- package/src/framework/utils/ArrUtils.ts +229 -0
- package/src/framework/utils/ColorsUtils.ts +378 -0
- package/src/framework/utils/{date.js → DateUtils.ts} +69 -69
- package/src/framework/utils/DeviceUtils.ts +46 -0
- package/src/framework/utils/DomUtils.ts +50 -0
- package/src/framework/utils/EventBusUtils.ts +143 -0
- package/src/framework/utils/MessageUtils.tsx +182 -0
- package/src/framework/utils/ObjectUtils.ts +113 -0
- package/src/framework/utils/StorageUtils.ts +67 -0
- package/src/framework/utils/StringUtils.ts +410 -0
- package/src/framework/utils/TreeUtils.ts +248 -0
- package/src/framework/utils/UrlUtils.ts +152 -0
- package/src/framework/utils/UuidUtils.ts +88 -0
- package/src/framework/utils/ValidateUtils.ts +28 -0
- package/src/framework/utils/index.ts +16 -0
- package/src/framework/utils/system/DictUtils.ts +97 -0
- package/src/framework/utils/system/FormRegistryUtils.ts +77 -0
- package/src/framework/utils/system/HttpUtils.ts +246 -0
- package/src/framework/utils/system/PageUtils.ts +153 -0
- package/src/framework/utils/system/PermUtils.ts +79 -0
- package/src/framework/utils/system/SysUtils.ts +97 -0
- package/src/framework/utils/system/ThemeUtils.ts +27 -0
- package/src/framework/utils/system/index.ts +7 -0
- package/src/framework/view-components/ViewBoolean.jsx +4 -0
- package/src/framework/view-components/index.js +3 -0
- package/src/layouts/PageRender.jsx +2 -2
- package/src/layouts/admin/HeaderRight.jsx +9 -9
- package/src/layouts/admin/TabPageRender.jsx +2 -2
- package/src/layouts/admin/index.jsx +27 -40
- package/src/layouts/admin/index.less +2 -1
- package/src/layouts/index.jsx +30 -38
- package/src/layouts/index.less +0 -21
- package/src/loading.jsx +2 -2
- package/src/{components → pages/flowable}/InstanceInfo.jsx +5 -4
- package/src/pages/flowable/design/customTranslate/customTranslate.js +16 -0
- package/src/pages/flowable/design/customTranslate/translations-properties-panel.js +10 -0
- package/src/pages/flowable/design/customTranslate/translations.js +144 -0
- package/src/pages/flowable/design/descriptors/flowable.json +1109 -0
- package/src/pages/flowable/design/index.jsx +61 -234
- package/src/pages/flowable/design/provider/FlowablePropertiesProvider.js +75 -0
- package/src/pages/flowable/design/provider/index.js +6 -0
- package/src/pages/flowable/design/provider/properties/ConditionDesign.jsx +175 -0
- package/src/pages/flowable/design/provider/properties/ConditionProps.jsx +76 -0
- package/src/pages/flowable/design/provider/properties/DelegateExpressionProps.js +54 -0
- package/src/pages/flowable/design/provider/properties/FormProps.js +55 -0
- package/src/pages/flowable/design/provider/properties/MultiInstanceProps.js +100 -0
- package/src/pages/flowable/design/provider/properties/UserTaskForm.jsx +48 -0
- package/src/pages/flowable/design/provider/properties/utils.jsx +35 -0
- package/src/pages/flowable/index.jsx +28 -69
- package/src/pages/flowable/monitor/definition.jsx +87 -0
- package/src/pages/flowable/monitor/instance/index.jsx +177 -0
- package/src/pages/flowable/monitor/instance/view.jsx +102 -0
- package/src/pages/flowable/monitor/task.jsx +93 -0
- package/src/pages/flowable/task/form.jsx +5 -5
- package/src/pages/flowable/task/index.jsx +5 -5
- package/src/pages/flowable/test/index.jsx +13 -10
- package/src/pages/index.jsx +8 -13
- package/src/pages/login.jsx +8 -8
- package/src/pages/{api/doc.jsx → system/api/ApiDoc.jsx} +56 -47
- package/src/pages/system/api/index.jsx +268 -0
- package/src/pages/system/api/perm.jsx +69 -0
- package/src/pages/system/config/index.jsx +3 -3
- package/src/pages/system/dict/Dict.jsx +2 -3
- package/src/pages/system/dict/DictItem.jsx +5 -5
- package/src/pages/system/file/index.jsx +13 -5
- package/src/pages/{job → system/job}/index.jsx +124 -39
- package/src/pages/system/log/index.jsx +3 -3
- package/src/pages/system/org/index.jsx +11 -12
- package/src/pages/system/role/index.jsx +11 -11
- package/src/pages/system/role/perm.jsx +8 -8
- package/src/pages/system/sysManual/index.jsx +6 -6
- package/src/pages/system/user/UserPerm.jsx +7 -42
- package/src/pages/system/user/index.jsx +13 -17
- package/src/pages/test.jsx +188 -3
- package/src/pages/ureport/index.jsx +4 -4
- package/src/pages/userCenter/ChangePassword.jsx +3 -4
- package/src/pages/userCenter/index.jsx +2 -2
- package/src/pages/userCenter/manual.jsx +3 -7
- package/src/pages/userCenter/message.jsx +5 -5
- package/config/dist/config.local.js +0 -23
- package/src/components/InstanceStatusInfo.jsx +0 -79
- package/src/components/StreamLog.jsx +0 -27
- package/src/components/flow/BpmnUtils.js +0 -85
- package/src/components/flow/customTranslate/customTranslate.js +0 -19
- package/src/components/flow/customTranslate/translations.js +0 -79
- package/src/components/flow/design/form/ConditionForm.jsx +0 -316
- package/src/components/flow/design/form/ServiceTaskForm.jsx +0 -55
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +0 -62
- package/src/components/flow/design/form/UserTaskForm.jsx +0 -211
- package/src/components/flow/design/palette.js +0 -39
- package/src/components/monitor/AllDefinition.jsx +0 -46
- package/src/components/monitor/AllInstance.jsx +0 -76
- package/src/forms/driverForm.jsx +0 -18
- package/src/framework/components/ButtonList.jsx +0 -91
- package/src/framework/components/Echarts/index.d.ts +0 -10
- package/src/framework/components/Echarts/index.jsx +0 -49
- package/src/framework/components/EditTable/index.d.ts +0 -11
- package/src/framework/components/EditTable/index.jsx +0 -85
- package/src/framework/components/FieldRemoteTree.jsx +0 -20
- package/src/framework/components/HasPerm.jsx +0 -18
- package/src/framework/components/ImageView.d.ts +0 -12
- package/src/framework/components/ImageView.jsx +0 -64
- package/src/framework/components/MsgBox.jsx +0 -180
- package/src/framework/components/PageLoading.jsx +0 -31
- package/src/framework/components/Panel/index.d.ts +0 -11
- package/src/framework/components/Panel/index.jsx +0 -24
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +0 -46
- package/src/framework/components/field/FieldBoolean/index.tsx +0 -92
- package/src/framework/components/field/FieldEditTable/index.less +0 -29
- package/src/framework/components/field/FieldEditor.jsx +0 -48
- package/src/framework/components/field/FieldFileBase64/index.d.ts +0 -15
- package/src/framework/components/field/FieldFileBase64/index.jsx +0 -23
- package/src/framework/components/field/FieldImageBase64/index.d.ts +0 -15
- package/src/framework/components/field/FieldImageBase64/index.jsx +0 -22
- package/src/framework/components/field/FieldInput.jsx +0 -13
- package/src/framework/components/field/FieldOrgTree/index.tsx +0 -45
- package/src/framework/components/field/FieldPassword.jsx +0 -11
- package/src/framework/components/field/FieldProps.ts +0 -19
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +0 -75
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +0 -81
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +0 -100
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +0 -82
- package/src/framework/components/field/FieldSelectPosition/index.tsx +0 -85
- package/src/framework/components/field/FieldTree.jsx +0 -45
- package/src/framework/components/field/dict/index.tsx +0 -110
- package/src/framework/components/field/flat-multiple-select/index.d.ts +0 -4
- package/src/framework/components/field/flat-multiple-select/index.jsx +0 -116
- package/src/framework/components/field/flat-multiple-select/index.less +0 -12
- package/src/framework/components/field/flat-select/index.d.ts +0 -4
- package/src/framework/components/field/flat-select/index.jsx +0 -107
- package/src/framework/components/field/flat-select/index.less +0 -12
- package/src/framework/components/field/index.js +0 -33
- package/src/framework/components/field/input-number-percent/index.d.ts +0 -11
- package/src/framework/components/field/input-number-percent/index.jsx +0 -28
- package/src/framework/components/field/select/FieldSelect/index.d.ts +0 -39
- package/src/framework/components/field/select/FieldSelect/index.jsx +0 -156
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +0 -155
- package/src/framework/components/field/select/index.jsx +0 -2
- package/src/framework/components/field/switch-y-n/index.d.ts +0 -11
- package/src/framework/components/field/switch-y-n/index.jsx +0 -31
- package/src/framework/components/field/text/index.tsx +0 -7
- package/src/framework/components/field/time/DatePickerString.tsx +0 -37
- package/src/framework/components/field/time/DateTimePickerString.tsx +0 -42
- package/src/framework/components/field/time/FieldDateRange.d.ts +0 -9
- package/src/framework/components/field/time/FieldDateRange.jsx +0 -49
- package/src/framework/components/field/time/HHmmPickerString.tsx +0 -42
- package/src/framework/components/field/time/MonthPickerString.tsx +0 -45
- package/src/framework/components/field/time/TimePickerTool.ts +0 -14
- package/src/framework/components/field/time/YearPickerString.tsx +0 -41
- package/src/framework/components/field/time/YearQuarterString.tsx +0 -38
- package/src/framework/components/field/time/index.tsx +0 -7
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +0 -22
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +0 -11
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +0 -7
- package/src/framework/components/field/upload/FieldUploadImage.jsx +0 -16
- package/src/framework/components/field/upload/index.jsx +0 -3
- package/src/framework/components/system.jsx +0 -29
- package/src/framework/components/view/ViewBoolean.jsx +0 -15
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +0 -16
- package/src/framework/components/view/ViewText.jsx +0 -9
- package/src/framework/index.js +0 -3
- package/src/framework/system/dict.js +0 -88
- package/src/framework/system/formRegistry.js +0 -58
- package/src/framework/system/http.jsx +0 -290
- package/src/framework/system/index.js +0 -13
- package/src/framework/system/page.js +0 -109
- package/src/framework/system/permission.js +0 -44
- package/src/framework/system/sys.js +0 -60
- package/src/framework/system/theme.js +0 -17
- package/src/framework/utils/arr.js +0 -118
- package/src/framework/utils/browser.js +0 -24
- package/src/framework/utils/color.js +0 -269
- package/src/framework/utils/debounce.js +0 -33
- package/src/framework/utils/dom.js +0 -16
- package/src/framework/utils/eventBus.js +0 -70
- package/src/framework/utils/html.js +0 -13
- package/src/framework/utils/index.js +0 -17
- package/src/framework/utils/obj.js +0 -72
- package/src/framework/utils/storage.js +0 -37
- package/src/framework/utils/str.js +0 -297
- package/src/framework/utils/tree.js +0 -175
- package/src/framework/utils/uid.js +0 -76
- package/src/framework/utils/url.js +0 -84
- package/src/framework/utils/validate.js +0 -9
- package/src/pages/api/accessLog/index.jsx +0 -108
- package/src/pages/api/accountResource/index.jsx +0 -149
- package/src/pages/api/index.jsx +0 -163
- package/src/pages/api/resource.jsx +0 -18
- package/src/pages/flowable/instance/view.jsx +0 -13
- package/src/pages/flowable/monitor.jsx +0 -106
- package/src/pages/flowable/test/form.jsx +0 -31
- package/src/pages/job/logList.jsx +0 -100
- package/src/pages/job/status.jsx +0 -84
- /package/src/framework/components/{ButtonList.d.ts → system/ButtonList.d.ts} +0 -0
- /package/src/framework/{components/EditTable/index.less → field-components/FieldTable.less} +0 -0
- /package/src/framework/{components/view → view-components}/ViewPassword.jsx +0 -0
- /package/src/{index.js → index.ts} +0 -0
- /package/src/{components/flow → pages/flowable}/design/contextPad.js +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {Button, Card,
|
|
2
|
+
import {Button, Card, message, Space, Splitter} from "antd";
|
|
3
3
|
|
|
4
4
|
import 'bpmn-js/dist/assets/diagram-js.css'
|
|
5
5
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
|
|
6
|
-
import {getBusinessObject} from "bpmn-js/lib/util/ModelUtil";
|
|
7
6
|
import BpmnModeler from 'bpmn-js/lib/Modeler'
|
|
8
7
|
|
|
9
8
|
import './index.css'
|
|
10
|
-
import customTranslate from "
|
|
11
|
-
import
|
|
12
|
-
import ServiceTaskForm from "../../../components/flow/design/form/ServiceTaskForm";
|
|
13
|
-
import ConditionForm from "../../../components/flow/design/form/ConditionForm";
|
|
14
|
-
import UserTaskForm from "../../../components/flow/design/form/UserTaskForm";
|
|
15
|
-
import palette from "../../../components/flow/design/palette";
|
|
16
|
-
import contextPad from "../../../components/flow/design/contextPad";
|
|
9
|
+
import customTranslate from "./customTranslate/customTranslate";
|
|
10
|
+
import contextPad from "./contextPad";
|
|
17
11
|
import {CloudUploadOutlined, SaveOutlined} from "@ant-design/icons";
|
|
18
|
-
import {
|
|
12
|
+
import {HttpUtils, MessageUtils, PageUtils} from "../../../framework";
|
|
13
|
+
import 'bpmn-js/dist/assets/bpmn-js.css';
|
|
14
|
+
import '@bpmn-io/properties-panel/assets/properties-panel.css';
|
|
15
|
+
import {BpmnPropertiesPanelModule, BpmnPropertiesProviderModule} from 'bpmn-js-properties-panel';
|
|
16
|
+
|
|
17
|
+
import flowablePropertiesProviderModule from './provider';
|
|
18
|
+
import flowableJson from './descriptors/flowable';
|
|
19
|
+
import Loading from "../../../loading";
|
|
19
20
|
|
|
20
21
|
export default class extends React.Component {
|
|
21
22
|
|
|
@@ -23,275 +24,101 @@ export default class extends React.Component {
|
|
|
23
24
|
state = {
|
|
24
25
|
id: null,
|
|
25
26
|
model: null,
|
|
26
|
-
conditionVariable: null,
|
|
27
|
-
|
|
28
|
-
elementType: null,
|
|
29
|
-
elementName: '',
|
|
30
|
-
|
|
31
|
-
showForm: false, // 表单切换过渡使用
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
openXmlModal: false,
|
|
35
|
-
xml: null
|
|
36
|
-
|
|
37
27
|
}
|
|
38
|
-
curBo = null
|
|
39
|
-
curNode = null
|
|
40
28
|
|
|
41
29
|
bpmRef = React.createRef()
|
|
42
30
|
|
|
43
31
|
preXmlRef = React.createRef()
|
|
44
32
|
|
|
45
|
-
componentDidMount() {
|
|
46
|
-
let params =
|
|
33
|
+
async componentDidMount() {
|
|
34
|
+
let params = PageUtils.currentParams()
|
|
47
35
|
this.state.id = params.id
|
|
36
|
+
const rs = await HttpUtils.get('admin/flowable/model/detail', {id: this.state.id})
|
|
37
|
+
this.setState({model:rs}, this.initBpmn)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
initBpmn = () => {
|
|
41
|
+
let container = this.bpmRef.current;
|
|
42
|
+
let xml = this.state.model.content;
|
|
43
|
+
|
|
48
44
|
this.bpmnModeler = new BpmnModeler({
|
|
45
|
+
container: container,
|
|
46
|
+
propertiesPanel: {parent: '#js-properties-panel',},
|
|
49
47
|
additionalModules: [
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
translate: ['value', customTranslate]
|
|
53
|
-
},
|
|
54
|
-
palette,
|
|
48
|
+
{translate: ['value', customTranslate]},
|
|
55
49
|
contextPad,
|
|
56
|
-
|
|
50
|
+
BpmnPropertiesPanelModule,
|
|
51
|
+
BpmnPropertiesProviderModule,
|
|
52
|
+
flowablePropertiesProviderModule
|
|
53
|
+
],
|
|
54
|
+
moddleExtensions: {
|
|
55
|
+
flowable: flowableJson
|
|
56
|
+
}
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
this.modeling = this.bpmnModeler.get('modeling'); // 建模, 包含很多方法
|
|
60
|
-
this.moddle = this.bpmnModeler.get('moddle'); // 数据模型, 主要存储元数据
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
HttpUtil.get('admin/flowable/model/detail', {id: this.state.id}).then(rs => {
|
|
64
|
-
let {conditionVariable, model} = rs;
|
|
65
|
-
this.setState({model, conditionVariable}, () => this.initBpmn(model.content))
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
window.bpmnModeler = this.bpmnModeler
|
|
70
|
-
window.moddle = this.moddle;
|
|
71
|
-
window.modeling = this.modeling;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
initBpmn = xml => {
|
|
75
|
-
let parentNode = this.bpmRef.current;
|
|
76
|
-
this.bpmnModeler.attachTo(parentNode);
|
|
77
59
|
this.bpmnModeler.importXML(xml)
|
|
78
|
-
|
|
79
60
|
this.bpmnModeler.on('element.contextmenu', e => e.preventDefault()) // 关闭右键,影响操作
|
|
80
|
-
this.bpmnModeler.on('selection.changed', this.onSelectionChanged);
|
|
81
|
-
//this.bpmnModeler.on('element.changed', this.refreshForm);
|
|
82
61
|
};
|
|
83
62
|
|
|
84
63
|
|
|
85
64
|
showXML = () => {
|
|
86
65
|
this.bpmnModeler.saveXML({format: true}).then(res => {
|
|
87
|
-
|
|
88
|
-
openXmlModal: true,
|
|
89
|
-
xml: res.xml
|
|
90
|
-
})
|
|
66
|
+
MessageUtils.alert(<pre style={{overflowX: "auto", height: '64vh'}}>{res.xml}</pre>, {width: 1024})
|
|
91
67
|
})
|
|
92
68
|
}
|
|
93
69
|
|
|
94
70
|
|
|
95
|
-
|
|
96
|
-
const xml = this.preXmlRef.current.innerText;
|
|
97
|
-
|
|
98
|
-
const root = this.bpmnModeler.getDefinitions().rootElements[0]
|
|
99
|
-
const {id, name} = root;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.bpmnModeler.importXML(xml)
|
|
103
|
-
root.set('id', id)
|
|
104
|
-
root.set('name', name)
|
|
105
|
-
|
|
106
|
-
message.success('编辑完成');
|
|
107
|
-
this.setState({openXmlModal: false})
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
onSelectionChanged = e => {
|
|
111
|
-
const {newSelection} = e;
|
|
112
|
-
if (newSelection.length !== 1) {
|
|
113
|
-
this.setState({showForm: false})
|
|
114
|
-
return null
|
|
115
|
-
}
|
|
116
|
-
const curNode = newSelection[0]
|
|
117
|
-
const curBo = getBusinessObject(curNode)
|
|
118
|
-
|
|
119
|
-
this.curBo = curBo;
|
|
120
|
-
this.curNode = curNode;
|
|
121
|
-
|
|
122
|
-
let elementType = curBo.$type.replace("bpmn:", "");
|
|
123
|
-
let elementName = curBo.get('name');
|
|
124
|
-
|
|
125
|
-
console.log('选择元素', elementType, curBo)
|
|
126
|
-
|
|
127
|
-
this.setState({
|
|
128
|
-
elementType,
|
|
129
|
-
elementName,
|
|
130
|
-
})
|
|
131
|
-
// 给一个过渡期
|
|
132
|
-
this.refreshForm()
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
handleSubmit = () => {
|
|
71
|
+
handleSave = async () => {
|
|
137
72
|
let id = this.state.id;
|
|
73
|
+
const hide = MessageUtils.loading('正在保存...')
|
|
74
|
+
try {
|
|
75
|
+
const res = await this.bpmnModeler.saveXML();
|
|
76
|
+
await HttpUtils.post('admin/flowable/model/saveContent', {id, content: res.xml});
|
|
77
|
+
} finally {
|
|
78
|
+
hide()
|
|
79
|
+
}
|
|
138
80
|
|
|
139
|
-
return new Promise((resolve, reject) => {
|
|
140
|
-
const hide = message.loading('保存中...', 0)
|
|
141
|
-
this.bpmnModeler.saveXML().then(res => {
|
|
142
|
-
HttpUtil.post('admin//flowable/model/saveContent', {id: id, content: res.xml}).then(rs => {
|
|
143
|
-
hide()
|
|
144
|
-
message.success('服务端保存成功')
|
|
145
|
-
resolve()
|
|
146
|
-
}).catch(e => {
|
|
147
|
-
hide()
|
|
148
|
-
reject()
|
|
149
|
-
})
|
|
150
|
-
})
|
|
151
|
-
})
|
|
152
81
|
}
|
|
153
|
-
handleDeploy = () => {
|
|
82
|
+
handleDeploy = async () => {
|
|
154
83
|
let id = this.state.id;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
refreshForm = () => {
|
|
163
|
-
this.setState({showForm: false}, () => this.setState({showForm: true}))
|
|
84
|
+
const hide = MessageUtils.loading('正在部署...')
|
|
85
|
+
try {
|
|
86
|
+
const res = await this.bpmnModeler.saveXML();
|
|
87
|
+
await HttpUtils.post('admin/flowable/model/deploy', {id, content: res.xml});
|
|
88
|
+
} finally {
|
|
89
|
+
hide()
|
|
90
|
+
}
|
|
164
91
|
}
|
|
165
92
|
|
|
166
93
|
|
|
167
94
|
render() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
95
|
+
if (this.state.model == null) {
|
|
96
|
+
return <Loading/>
|
|
97
|
+
}
|
|
98
|
+
return <Card title={'流程设计 ' + this.state.model?.name}
|
|
171
99
|
extra={<Space>
|
|
172
|
-
<Button type='primary' icon={<SaveOutlined/>} onClick={this.
|
|
100
|
+
<Button type='primary' icon={<SaveOutlined/>} onClick={this.handleSave}>暂存</Button>
|
|
173
101
|
<Button type='primary' danger icon={<CloudUploadOutlined/>}
|
|
174
102
|
onClick={this.handleDeploy}>部署</Button>
|
|
175
103
|
<Button onClick={this.showXML}>XML</Button>
|
|
176
104
|
<Button
|
|
177
|
-
onClick={() =>
|
|
178
|
-
|
|
105
|
+
onClick={() => PageUtils.open('/flowable/test?id=' + this.state.id, "流程测试")}> 测试 </Button>
|
|
179
106
|
</Space>}>
|
|
180
107
|
|
|
181
108
|
|
|
182
|
-
<
|
|
183
|
-
<
|
|
109
|
+
<Splitter style={{minHeight: 'calc(100vh - 200px)'}}>
|
|
110
|
+
<Splitter.Panel>
|
|
184
111
|
<div ref={this.bpmRef} style={{width: '100%', height: '100%'}}></div>
|
|
185
|
-
</
|
|
186
|
-
|
|
187
|
-
<Col flex='300px'>
|
|
188
|
-
<Card title='属性面板'>
|
|
189
|
-
{this.renderForm()}
|
|
190
|
-
</Card>
|
|
191
|
-
|
|
192
|
-
{this.renderMultiInstanceLoopCharacteristics()}
|
|
193
|
-
</Col>
|
|
194
|
-
</Row>
|
|
112
|
+
</Splitter.Panel>
|
|
195
113
|
|
|
114
|
+
<Splitter.Panel defaultSize={300}>
|
|
115
|
+
<div id={'js-properties-panel'}></div>
|
|
116
|
+
</Splitter.Panel>
|
|
117
|
+
</Splitter>
|
|
196
118
|
|
|
197
|
-
<Modal title='流程定义XML文本内容' open={this.state.openXmlModal}
|
|
198
|
-
okText='确定'
|
|
199
|
-
width='70vw'
|
|
200
|
-
onOk={this.handleChangeXml}
|
|
201
|
-
onCancel={() => this.setState({openXmlModal: false})}>
|
|
202
|
-
<div style={{maxHeight: '70vh', overflow: 'auto'}}>
|
|
203
|
-
{this.state.xml && <pre ref={this.preXmlRef} contentEditable>
|
|
204
|
-
{this.state.xml}
|
|
205
|
-
</pre>}
|
|
206
119
|
|
|
207
|
-
</div>
|
|
208
|
-
</Modal>
|
|
209
120
|
</Card>
|
|
210
121
|
}
|
|
211
122
|
|
|
212
123
|
|
|
213
|
-
renderForm = () => {
|
|
214
|
-
if (!this.state.showForm) {
|
|
215
|
-
return <Empty description='请选择节点'/>
|
|
216
|
-
}
|
|
217
|
-
const {elementType, conditionVariable} = this.state;
|
|
218
|
-
const {curBo} = this
|
|
219
|
-
|
|
220
|
-
switch (elementType) {
|
|
221
|
-
case 'SequenceFlow':
|
|
222
|
-
return <ConditionForm conditionVariable={conditionVariable}
|
|
223
|
-
moddle={this.moddle}
|
|
224
|
-
bo={curBo}
|
|
225
|
-
node={this.curNode}
|
|
226
|
-
modeling={this.modeling}
|
|
227
|
-
/>
|
|
228
|
-
case 'UserTask':
|
|
229
|
-
return <UserTaskForm bo={curBo} node={this.curNode} modeling={this.modeling} model={this.state.model}/>
|
|
230
|
-
case 'ServiceTask':
|
|
231
|
-
return <ServiceTaskForm bo={curBo}/>
|
|
232
|
-
case 'StartEvent':
|
|
233
|
-
if (curBo.eventDefinitions != null) {
|
|
234
|
-
return <TimerEventDefinitionForm bo={curBo}/>
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return <></>
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
// 多实例,支持任务和子流程
|
|
241
|
-
renderMultiInstanceLoopCharacteristics = () => {
|
|
242
|
-
if (!this.state.showForm) {
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
const {elementType, conditionVariable} = this.state;
|
|
247
|
-
const {curBo} = this
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (elementType !== 'SubProcess') {
|
|
251
|
-
return
|
|
252
|
-
}
|
|
253
|
-
let bo = curBo.loopCharacteristics;
|
|
254
|
-
if (!bo) {
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
const initialValues = Object.assign({}, bo.$attrs)
|
|
259
|
-
|
|
260
|
-
if (bo.loopCardinality) {
|
|
261
|
-
initialValues.loopCardinality = bo.loopCardinality.body
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return <Card title='多实例配置'>
|
|
265
|
-
<Form layout='vertical' onValuesChange={this.onMultiInstanceLoopCharacteristicsChange}
|
|
266
|
-
initialValues={initialValues}>
|
|
267
|
-
<Form.Item label='循环基数' name='loopCardinality'>
|
|
268
|
-
<Input placeholder='数字或表达式,如 ${userCount}'/>
|
|
269
|
-
</Form.Item>
|
|
270
|
-
|
|
271
|
-
<Form.Item label='集合' name='flowable:collection'>
|
|
272
|
-
<Input placeholder='如 userList'/>
|
|
273
|
-
</Form.Item>
|
|
274
|
-
<Form.Item label='元素变量' name='flowable:elementVariable'>
|
|
275
|
-
<Input placeholder='如 user'/>
|
|
276
|
-
</Form.Item>
|
|
277
|
-
|
|
278
|
-
</Form>
|
|
279
|
-
</Card>
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
onMultiInstanceLoopCharacteristicsChange = (changedValue, values) => {
|
|
285
|
-
let bo = this.curBo.loopCharacteristics;
|
|
286
|
-
if (changedValue.loopCardinality != null) {
|
|
287
|
-
const expression = this.moddle.create('bpmn:FormalExpression', {body: changedValue.loopCardinality});
|
|
288
|
-
bo.loopCardinality = expression;
|
|
289
|
-
return
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
for (let key in changedValue) {
|
|
293
|
-
bo.set(key, changedValue[key])
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
124
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {is} from 'bpmn-js/lib/util/ModelUtil';
|
|
2
|
+
import {DelegateExpressionProps} from "./properties/DelegateExpressionProps";
|
|
3
|
+
import {FormProps} from "./properties/FormProps";
|
|
4
|
+
import {PreactUserTaskForm, renderReact, UserTaskForm} from "./properties/UserTaskForm";
|
|
5
|
+
import {isTextFieldEntryEdited} from "@bpmn-io/properties-panel";
|
|
6
|
+
import {ConditionProps} from "./properties/ConditionProps";
|
|
7
|
+
import {MultiInstanceProps} from "./properties/MultiInstanceProps";
|
|
8
|
+
|
|
9
|
+
const LOW_PRIORITY = 500;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export default function FlowablePropertiesProvider(propertiesPanel) {
|
|
13
|
+
|
|
14
|
+
this.getGroups = function (element) {
|
|
15
|
+
return function (groups) {
|
|
16
|
+
if (is(element, 'bpmn:ServiceTask')) {
|
|
17
|
+
groups.push({
|
|
18
|
+
id: 'processBean',
|
|
19
|
+
label: "处理器",
|
|
20
|
+
entries: DelegateExpressionProps(element),
|
|
21
|
+
shouldOpen: true
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (is(element, 'bpmn:UserTask')) {
|
|
26
|
+
groups.push({
|
|
27
|
+
id: 'user',
|
|
28
|
+
label: "用户",
|
|
29
|
+
entries: [
|
|
30
|
+
{
|
|
31
|
+
id: 'user',
|
|
32
|
+
component: PreactUserTaskForm,
|
|
33
|
+
isEdited: isTextFieldEntryEdited,
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
shouldOpen: true
|
|
37
|
+
})
|
|
38
|
+
groups.push({
|
|
39
|
+
id: 'form',
|
|
40
|
+
label: "表单",
|
|
41
|
+
entries: FormProps(element),
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
if (is(element, 'bpmn:SequenceFlow')) {
|
|
45
|
+
groups.push({
|
|
46
|
+
id: 'condition',
|
|
47
|
+
label: "条件",
|
|
48
|
+
entries: ConditionProps(element),
|
|
49
|
+
shouldOpen: true
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let group = {
|
|
54
|
+
label: '多实例(集合设置)',
|
|
55
|
+
id: 'multiInstanceCollection',
|
|
56
|
+
entries: MultiInstanceProps({element}),
|
|
57
|
+
shouldOpen: true
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
if(group.entries.length){
|
|
61
|
+
groups.push(group)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return groups;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
propertiesPanel.registerProvider(LOW_PRIORITY, this);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
FlowablePropertiesProvider.$inject = ['propertiesPanel'];
|
|
74
|
+
|
|
75
|
+
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import {Button, Input, InputNumber, Modal, Select} from "antd";
|
|
2
|
+
import React, {Component} from "react";
|
|
3
|
+
import {FieldBoolean, FieldTable, HttpUtils, StringUtils, ThemeUtils} from "../../../../../framework";
|
|
4
|
+
|
|
5
|
+
const metaInfo = {
|
|
6
|
+
STRING: {
|
|
7
|
+
ops: {
|
|
8
|
+
'==': '等于',
|
|
9
|
+
'!=': '不等于',
|
|
10
|
+
contains: '包含',
|
|
11
|
+
'!contains': '不包含',
|
|
12
|
+
startWith: '开头等于',
|
|
13
|
+
endWith: '结尾等于',
|
|
14
|
+
},
|
|
15
|
+
render() {
|
|
16
|
+
return <Input/>;
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
NUMBER: {
|
|
20
|
+
ops: {
|
|
21
|
+
'==': '等于',
|
|
22
|
+
'!=': '不等于',
|
|
23
|
+
'>': '大于',
|
|
24
|
+
'<': '小于',
|
|
25
|
+
'>=': '大于等于',
|
|
26
|
+
'<=': '小于等于',
|
|
27
|
+
between: '介于',
|
|
28
|
+
},
|
|
29
|
+
render(op) {
|
|
30
|
+
if (op !== 'between') return <InputNumber/>;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Input.Group>
|
|
34
|
+
<InputNumber placeholder="最小值"></InputNumber>
|
|
35
|
+
<InputNumber placeholder="最大值"></InputNumber>
|
|
36
|
+
</Input.Group>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
BOOLEAN: {
|
|
41
|
+
ops: {
|
|
42
|
+
'==': '等于',
|
|
43
|
+
},
|
|
44
|
+
render() {
|
|
45
|
+
return <FieldBoolean/>;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export class ConditionDesignButton extends Component {
|
|
51
|
+
|
|
52
|
+
state = {
|
|
53
|
+
open: false,
|
|
54
|
+
varList: [],
|
|
55
|
+
varOptions: []
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
componentDidMount() {
|
|
59
|
+
const {processId} = this.props;
|
|
60
|
+
console.log('流程id', processId)
|
|
61
|
+
|
|
62
|
+
HttpUtils.get('admin/flowable/model/varList', {code: processId}).then(rs => {
|
|
63
|
+
|
|
64
|
+
const options = rs.map(r => {
|
|
65
|
+
return {
|
|
66
|
+
label: r.label,
|
|
67
|
+
value: r.name
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
this.setState({varList: rs, varOptions: options})
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
onChange = arr => {
|
|
75
|
+
const str = this.convertArrToStr(arr)
|
|
76
|
+
this.props.setValue(str, this.props.element, this.props.modeling, this.props.bpmnFactory)
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
columns = [
|
|
80
|
+
{
|
|
81
|
+
dataIndex: 'key', title: '变量名称',
|
|
82
|
+
render: () => {
|
|
83
|
+
return <Select options={this.state.varOptions} style={{width: 200}}></Select>
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
dataIndex: 'op', title: '操作符', render: (v, record) => {
|
|
88
|
+
let options = []
|
|
89
|
+
let {varList} = this.state;
|
|
90
|
+
let varItem = varList.find(t => t.name === record.key)
|
|
91
|
+
|
|
92
|
+
if (varItem) {
|
|
93
|
+
const {valueType} = varItem;
|
|
94
|
+
const ops = metaInfo[valueType].ops;
|
|
95
|
+
options = Object.keys(ops).map(key => {
|
|
96
|
+
return {
|
|
97
|
+
label: ops[key],
|
|
98
|
+
value: key
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return <Select options={options} style={{width: 100}}></Select>
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{dataIndex: 'value', title: '值'},
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
render() {
|
|
110
|
+
let value = this.props.getValue(this.props.element);
|
|
111
|
+
let arrValue = this.convertStrToArr(value);
|
|
112
|
+
|
|
113
|
+
return <div style={{display: 'flex', justifyContent: 'right', padding: 8}}>
|
|
114
|
+
<Button type='primary' size='small'
|
|
115
|
+
styles={{
|
|
116
|
+
root: {backgroundColor: ThemeUtils.getColor('primary-color')}
|
|
117
|
+
}}
|
|
118
|
+
onClick={() => this.setState({open: true})}
|
|
119
|
+
>条件编辑器</Button>
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<Modal title='条件编辑器 (复杂表达式暂不支持)' open={this.state.open}
|
|
123
|
+
onCancel={() => this.setState({open: false})}
|
|
124
|
+
footer={null}
|
|
125
|
+
mask={{blur: false}}
|
|
126
|
+
destroyOnHidden
|
|
127
|
+
>
|
|
128
|
+
<FieldTable columns={this.columns}
|
|
129
|
+
value={arrValue}
|
|
130
|
+
onChange={this.onChange}
|
|
131
|
+
></FieldTable>
|
|
132
|
+
</Modal>
|
|
133
|
+
|
|
134
|
+
</div>
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
convertStrToArr(value) {
|
|
138
|
+
|
|
139
|
+
let arrValue = []
|
|
140
|
+
if (value) {
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
value = StringUtils.removePrefix(value, "${")
|
|
144
|
+
value = StringUtils.removeSuffix(value, "}")
|
|
145
|
+
const strArr = StringUtils.split(value, '&&');
|
|
146
|
+
|
|
147
|
+
const regex = /(\w+)([<>=!]+)(\w+)/;
|
|
148
|
+
|
|
149
|
+
strArr.forEach(expression => {
|
|
150
|
+
const parts = expression.match(regex);
|
|
151
|
+
// parts[0] 是整个匹配的字符串
|
|
152
|
+
// parts[1] 是第一个捕获组 (左操作数)
|
|
153
|
+
// parts[2] 是第二个捕获组 (操作符)
|
|
154
|
+
// parts[3] 是第三个捕获组 (右操作数)
|
|
155
|
+
arrValue.push({
|
|
156
|
+
key: parts[1],
|
|
157
|
+
op: parts[2],
|
|
158
|
+
value: parts[3],
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
return arrValue;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
convertArrToStr = arrValue => {
|
|
166
|
+
const str = arrValue.map(i => {
|
|
167
|
+
const {key, op, value} = i;
|
|
168
|
+
return `${key}${op}${value}`
|
|
169
|
+
}).join('&&')
|
|
170
|
+
|
|
171
|
+
return "${" + str + "}"
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {isTextFieldEntryEdited, TextFieldEntry} from '@bpmn-io/properties-panel';
|
|
2
|
+
import {useService} from 'bpmn-js-properties-panel';
|
|
3
|
+
import {renderReact} from "./utils";
|
|
4
|
+
import {ConditionDesignButton} from "./ConditionDesign";
|
|
5
|
+
|
|
6
|
+
function PreactConditionDesign(props) {
|
|
7
|
+
return renderReact(props, ConditionDesignButton, {getValue,setValue})
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const getValue = (element) => {
|
|
12
|
+
const condition = element.businessObject.conditionExpression;
|
|
13
|
+
return condition ? condition.body : '';
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const setValue =( value, element, modeling,moddle) => {
|
|
17
|
+
const businessObject = element.businessObject;
|
|
18
|
+
let conditionExpression = businessObject.conditionExpression;
|
|
19
|
+
|
|
20
|
+
if (!value) {
|
|
21
|
+
// 移除条件表达式
|
|
22
|
+
modeling.updateProperties(element, {
|
|
23
|
+
conditionExpression: undefined
|
|
24
|
+
});
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!conditionExpression) {
|
|
29
|
+
conditionExpression = moddle.create('bpmn:FormalExpression');
|
|
30
|
+
modeling.updateProperties(element, {
|
|
31
|
+
conditionExpression: conditionExpression
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 更新表达式主体
|
|
36
|
+
modeling.updateModdleProperties(element, conditionExpression, {
|
|
37
|
+
body: value
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export function ConditionProps() {
|
|
41
|
+
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
id: 'expression',
|
|
45
|
+
component: Component,
|
|
46
|
+
isEdited: isTextFieldEntryEdited,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'expressionDesign',
|
|
50
|
+
component: PreactConditionDesign,
|
|
51
|
+
isEdited: isTextFieldEntryEdited,
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function Component(props) {
|
|
57
|
+
const {element, id} = props;
|
|
58
|
+
|
|
59
|
+
const modeling = useService('modeling');
|
|
60
|
+
const debounce = useService('debounceInput');
|
|
61
|
+
const moddle = useService('moddle');
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
return TextFieldEntry({
|
|
65
|
+
element,
|
|
66
|
+
id: id,
|
|
67
|
+
label: '条件表达式',
|
|
68
|
+
getValue,
|
|
69
|
+
setValue: value=>setValue(value,element,modeling,moddle),
|
|
70
|
+
debounce,
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|