liteflow-editor-process 1.0.0
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/LICENSE +21 -0
- package/README.md +1020 -0
- package/dist/LiteFlowEditor/assets/and-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/catch-icon.svg +14 -0
- package/dist/LiteFlowEditor/assets/chain-icon.svg +11 -0
- package/dist/LiteFlowEditor/assets/common-icon.svg +18 -0
- package/dist/LiteFlowEditor/assets/end-icon.svg +14 -0
- package/dist/LiteFlowEditor/assets/for-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/if-icon.svg +14 -0
- package/dist/LiteFlowEditor/assets/indicator-icons.svg +16 -0
- package/dist/LiteFlowEditor/assets/intermediate-end-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/intermediate-event-catch-error.svg +40 -0
- package/dist/LiteFlowEditor/assets/iterator-icon.svg +7 -0
- package/dist/LiteFlowEditor/assets/little-warning-icon.svg +1 -0
- package/dist/LiteFlowEditor/assets/not-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/or-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/start-icon.svg +16 -0
- package/dist/LiteFlowEditor/assets/switch-icon.svg +15 -0
- package/dist/LiteFlowEditor/assets/then-icon.svg +23 -0
- package/dist/LiteFlowEditor/assets/virtual-icon.svg +21 -0
- package/dist/LiteFlowEditor/assets/warning-icon.svg +1 -0
- package/dist/LiteFlowEditor/assets/when-icon.svg +21 -0
- package/dist/LiteFlowEditor/assets/while-icon.svg +24 -0
- package/dist/LiteFlowEditor/cells/and.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/and.js +8 -0
- package/dist/LiteFlowEditor/cells/catch.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/catch.js +8 -0
- package/dist/LiteFlowEditor/cells/chain.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/chain.js +8 -0
- package/dist/LiteFlowEditor/cells/common.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/common.js +8 -0
- package/dist/LiteFlowEditor/cells/end.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/end.js +11 -0
- package/dist/LiteFlowEditor/cells/for.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/for.js +8 -0
- package/dist/LiteFlowEditor/cells/if.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/if.js +9 -0
- package/dist/LiteFlowEditor/cells/index.d.ts +25 -0
- package/dist/LiteFlowEditor/cells/index.js +219 -0
- package/dist/LiteFlowEditor/cells/intermediate-end.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/intermediate-end.js +11 -0
- package/dist/LiteFlowEditor/cells/iterator.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/iterator.js +8 -0
- package/dist/LiteFlowEditor/cells/not.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/not.js +8 -0
- package/dist/LiteFlowEditor/cells/or.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/or.js +8 -0
- package/dist/LiteFlowEditor/cells/start.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/start.js +11 -0
- package/dist/LiteFlowEditor/cells/switch.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/switch.js +9 -0
- package/dist/LiteFlowEditor/cells/then.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/then.js +11 -0
- package/dist/LiteFlowEditor/cells/virtual.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/virtual.js +8 -0
- package/dist/LiteFlowEditor/cells/when.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/when.js +11 -0
- package/dist/LiteFlowEditor/cells/while.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/while.js +8 -0
- package/dist/LiteFlowEditor/common/anchor.d.ts +2 -0
- package/dist/LiteFlowEditor/common/anchor.js +10 -0
- package/dist/LiteFlowEditor/common/connector.d.ts +2 -0
- package/dist/LiteFlowEditor/common/connector.js +20 -0
- package/dist/LiteFlowEditor/common/edge.d.ts +61 -0
- package/dist/LiteFlowEditor/common/edge.js +57 -0
- package/dist/LiteFlowEditor/common/events.d.ts +4 -0
- package/dist/LiteFlowEditor/common/events.js +97 -0
- package/dist/LiteFlowEditor/common/index.d.ts +4 -0
- package/dist/LiteFlowEditor/common/index.js +11 -0
- package/dist/LiteFlowEditor/common/layout.d.ts +12 -0
- package/dist/LiteFlowEditor/common/layout.js +308 -0
- package/dist/LiteFlowEditor/common/router.d.ts +2 -0
- package/dist/LiteFlowEditor/common/router.js +40 -0
- package/dist/LiteFlowEditor/common/shortcuts.d.ts +10 -0
- package/dist/LiteFlowEditor/common/shortcuts.js +183 -0
- package/dist/LiteFlowEditor/components/NodeBadge/index.d.ts +6 -0
- package/dist/LiteFlowEditor/components/NodeBadge/index.js +24 -0
- package/dist/LiteFlowEditor/components/NodeBadge/index.module.less +10 -0
- package/dist/LiteFlowEditor/components/NodeToolBar/index.d.ts +6 -0
- package/dist/LiteFlowEditor/components/NodeToolBar/index.js +121 -0
- package/dist/LiteFlowEditor/components/NodeToolBar/index.module.less +133 -0
- package/dist/LiteFlowEditor/components/NodeView/index.d.ts +7 -0
- package/dist/LiteFlowEditor/components/NodeView/index.js +14 -0
- package/dist/LiteFlowEditor/components/NodeView/index.module.less +14 -0
- package/dist/LiteFlowEditor/components/index.d.ts +3 -0
- package/dist/LiteFlowEditor/components/index.js +3 -0
- package/dist/LiteFlowEditor/constant/index.d.ts +79 -0
- package/dist/LiteFlowEditor/constant/index.js +215 -0
- package/dist/LiteFlowEditor/context/GraphContext.d.ts +13 -0
- package/dist/LiteFlowEditor/context/GraphContext.js +10 -0
- package/dist/LiteFlowEditor/context/ScriptContext.d.ts +37 -0
- package/dist/LiteFlowEditor/context/ScriptContext.js +15 -0
- package/dist/LiteFlowEditor/hooks/index.d.ts +5 -0
- package/dist/LiteFlowEditor/hooks/index.js +5 -0
- package/dist/LiteFlowEditor/hooks/useClickAway.d.ts +5 -0
- package/dist/LiteFlowEditor/hooks/useClickAway.js +38 -0
- package/dist/LiteFlowEditor/hooks/useGraph.d.ts +1 -0
- package/dist/LiteFlowEditor/hooks/useGraph.js +7 -0
- package/dist/LiteFlowEditor/hooks/useGraphWrapper.d.ts +2 -0
- package/dist/LiteFlowEditor/hooks/useGraphWrapper.js +7 -0
- package/dist/LiteFlowEditor/hooks/useHistory.d.ts +2 -0
- package/dist/LiteFlowEditor/hooks/useHistory.js +69 -0
- package/dist/LiteFlowEditor/hooks/useModel.d.ts +3 -0
- package/dist/LiteFlowEditor/hooks/useModel.js +7 -0
- package/dist/LiteFlowEditor/hooks/useUpdateEffect.d.ts +7 -0
- package/dist/LiteFlowEditor/hooks/useUpdateEffect.js +17 -0
- package/dist/LiteFlowEditor/i18n/en_US/translation.json +138 -0
- package/dist/LiteFlowEditor/i18n/index.d.ts +2 -0
- package/dist/LiteFlowEditor/i18n/index.js +28 -0
- package/dist/LiteFlowEditor/i18n/zh_CN/translation.json +139 -0
- package/dist/LiteFlowEditor/i18n/zh_TW/translation.json +139 -0
- package/dist/LiteFlowEditor/index.d.ts +37 -0
- package/dist/LiteFlowEditor/index.js +299 -0
- package/dist/LiteFlowEditor/index.module.less +127 -0
- package/dist/LiteFlowEditor/mock/index.d.ts +2 -0
- package/dist/LiteFlowEditor/mock/index.js +272 -0
- package/dist/LiteFlowEditor/model/builder.d.ts +43 -0
- package/dist/LiteFlowEditor/model/builder.js +239 -0
- package/dist/LiteFlowEditor/model/chain.d.ts +83 -0
- package/dist/LiteFlowEditor/model/chain.js +278 -0
- package/dist/LiteFlowEditor/model/el/and-operator.d.ts +53 -0
- package/dist/LiteFlowEditor/model/el/and-operator.js +178 -0
- package/dist/LiteFlowEditor/model/el/catch-operator.d.ts +81 -0
- package/dist/LiteFlowEditor/model/el/catch-operator.js +338 -0
- package/dist/LiteFlowEditor/model/el/chain-operator.d.ts +53 -0
- package/dist/LiteFlowEditor/model/el/chain-operator.js +170 -0
- package/dist/LiteFlowEditor/model/el/for-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/for-operator.js +171 -0
- package/dist/LiteFlowEditor/model/el/if-operator.d.ts +64 -0
- package/dist/LiteFlowEditor/model/el/if-operator.js +265 -0
- package/dist/LiteFlowEditor/model/el/index.d.ts +40 -0
- package/dist/LiteFlowEditor/model/el/index.js +47 -0
- package/dist/LiteFlowEditor/model/el/iterator-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/iterator-operator.js +183 -0
- package/dist/LiteFlowEditor/model/el/node-operator.d.ts +62 -0
- package/dist/LiteFlowEditor/model/el/node-operator.js +136 -0
- package/dist/LiteFlowEditor/model/el/not-operator.d.ts +68 -0
- package/dist/LiteFlowEditor/model/el/not-operator.js +231 -0
- package/dist/LiteFlowEditor/model/el/or-operator.d.ts +53 -0
- package/dist/LiteFlowEditor/model/el/or-operator.js +178 -0
- package/dist/LiteFlowEditor/model/el/switch-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/switch-operator.js +173 -0
- package/dist/LiteFlowEditor/model/el/then-operator.d.ts +66 -0
- package/dist/LiteFlowEditor/model/el/then-operator.js +159 -0
- package/dist/LiteFlowEditor/model/el/when-operator.d.ts +58 -0
- package/dist/LiteFlowEditor/model/el/when-operator.js +181 -0
- package/dist/LiteFlowEditor/model/el/while-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/while-operator.js +171 -0
- package/dist/LiteFlowEditor/model/node.d.ts +182 -0
- package/dist/LiteFlowEditor/model/node.js +463 -0
- package/dist/LiteFlowEditor/model/utils/createTag.d.ts +1 -0
- package/dist/LiteFlowEditor/model/utils/createTag.js +5 -0
- package/dist/LiteFlowEditor/model/utils/end.d.ts +87 -0
- package/dist/LiteFlowEditor/model/utils/end.js +185 -0
- package/dist/LiteFlowEditor/model/utils/index.d.ts +7 -0
- package/dist/LiteFlowEditor/model/utils/index.js +10 -0
- package/dist/LiteFlowEditor/model/utils/start.d.ts +87 -0
- package/dist/LiteFlowEditor/model/utils/start.js +185 -0
- package/dist/LiteFlowEditor/model/utils/virtual.d.ts +78 -0
- package/dist/LiteFlowEditor/model/utils/virtual.js +167 -0
- package/dist/LiteFlowEditor/model-checker/checkers/AnalysisNodeChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/AnalysisNodeChecker.js +44 -0
- package/dist/LiteFlowEditor/model-checker/checkers/CurScheduleSetChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/CurScheduleSetChecker.js +26 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListChecker.js +39 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListValueChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListValueChecker.js +154 -0
- package/dist/LiteFlowEditor/model-checker/checkers/IteratorBindChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/IteratorBindChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryDimensionChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryDimensionChecker.js +33 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryLogChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryLogChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/ReportTemplateChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/ReportTemplateChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/UnconfiguredComponentChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/UnconfiguredComponentChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/index.d.ts +14 -0
- package/dist/LiteFlowEditor/model-checker/checkers/index.js +38 -0
- package/dist/LiteFlowEditor/model-checker/index.d.ts +22 -0
- package/dist/LiteFlowEditor/model-checker/index.js +43 -0
- package/dist/LiteFlowEditor/model-checker/types.d.ts +11 -0
- package/dist/LiteFlowEditor/model-checker/types.js +1 -0
- package/dist/LiteFlowEditor/panels/breadcrumb/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/breadcrumb/index.js +67 -0
- package/dist/LiteFlowEditor/panels/breadcrumb/index.module.less +23 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.d.ts +11 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.js +98 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.module.less +7 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/blank.d.ts +8 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/blank.js +18 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/index.d.ts +3 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/index.js +3 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/node.d.ts +9 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/node.js +10 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.d.ts +14 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.js +108 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.module.less +81 -0
- package/dist/LiteFlowEditor/panels/flowGraph/createFlowGraph.d.ts +3 -0
- package/dist/LiteFlowEditor/panels/flowGraph/createFlowGraph.js +199 -0
- package/dist/LiteFlowEditor/panels/flowGraph/miniMapSimpleNode/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/flowGraph/miniMapSimpleNode/index.js +42 -0
- package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.d.ts +8 -0
- package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.js +110 -0
- package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.module.less +11 -0
- package/dist/LiteFlowEditor/panels/layout/index.d.ts +16 -0
- package/dist/LiteFlowEditor/panels/layout/index.js +117 -0
- package/dist/LiteFlowEditor/panels/layout/index.module.less +30 -0
- package/dist/LiteFlowEditor/panels/settingBar/basic/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/basic/index.js +50 -0
- package/dist/LiteFlowEditor/panels/settingBar/basic/index.module.less +17 -0
- package/dist/LiteFlowEditor/panels/settingBar/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/index.js +219 -0
- package/dist/LiteFlowEditor/panels/settingBar/index.module.less +45 -0
- package/dist/LiteFlowEditor/panels/settingBar/outline/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/outline/index.js +124 -0
- package/dist/LiteFlowEditor/panels/settingBar/outline/index.module.less +39 -0
- package/dist/LiteFlowEditor/panels/settingBar/parameters/index.d.ts +6 -0
- package/dist/LiteFlowEditor/panels/settingBar/parameters/index.js +415 -0
- package/dist/LiteFlowEditor/panels/settingBar/parameters/index.module.less +4 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/CustomDropdown.d.ts +13 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/CustomDropdown.js +62 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/DraggableWrapper.d.ts +48 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/DraggableWrapper.js +94 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor-new.d.ts +33 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor-new.js +433 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor.d.ts +33 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor.js +195 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/component.d.ts +10 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/component.js +2780 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/condition.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/condition.js +54 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/index.d.ts +2 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/index.js +2 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/index.module.less +149 -0
- package/dist/LiteFlowEditor/panels/sideBar/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/sideBar/index.js +153 -0
- package/dist/LiteFlowEditor/panels/sideBar/index.module.less +48 -0
- package/dist/LiteFlowEditor/panels/toolBar/index.d.ts +8 -0
- package/dist/LiteFlowEditor/panels/toolBar/index.js +42 -0
- package/dist/LiteFlowEditor/panels/toolBar/index.module.less +19 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/check.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/check.js +40 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/badge.d.ts +12 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/badge.js +46 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeBtnWidget.d.ts +15 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeBtnWidget.js +133 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeDropdownWidget.d.ts +14 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeDropdownWidget.js +38 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fitWindow.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fitWindow.js +17 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fullscreen.d.ts +4 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fullscreen.js +104 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/global.less +6 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/index.js +12 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/index.module.less +169 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/mock.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/mock.js +83 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/redo.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/redo.js +16 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/save.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/save.js +12 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/selection.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/selection.js +23 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/undo.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/undo.js +16 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/view.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/view.js +37 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/zoom.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/zoom.js +67 -0
- package/dist/LiteFlowEditor/utils/eventBus.d.ts +34 -0
- package/dist/LiteFlowEditor/utils/eventBus.js +86 -0
- package/dist/LiteFlowEditor/utils/flowChartUtils.d.ts +9 -0
- package/dist/LiteFlowEditor/utils/flowChartUtils.js +34 -0
- package/dist/LiteFlowEditor/utils/index.d.ts +33 -0
- package/dist/LiteFlowEditor/utils/index.js +245 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package.json +97 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.liteflowEditorSettingBarContainer {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
|
|
7
|
+
:global {
|
|
8
|
+
|
|
9
|
+
.ant-tabs{
|
|
10
|
+
height: 100%;
|
|
11
|
+
.ant-tabs-content-holder{
|
|
12
|
+
flex: 1;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
&::-webkit-scrollbar {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ant-tabs-nav {
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
}
|
|
24
|
+
.ant-tabs-nav-wrap {
|
|
25
|
+
flex: 1;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: #fafafa;
|
|
29
|
+
border-bottom: 1px solid #d9d9d9;
|
|
30
|
+
}
|
|
31
|
+
// .ant-tabs-nav-list {
|
|
32
|
+
// display: flex;
|
|
33
|
+
// flex: 1;
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
// .ant-tabs-tab {
|
|
37
|
+
// display: flex;
|
|
38
|
+
// flex: 1;
|
|
39
|
+
// justify-content: center;
|
|
40
|
+
// align-items: center;
|
|
41
|
+
// padding: 10px 0;
|
|
42
|
+
// background-color: #fafafa;
|
|
43
|
+
// }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { StringExt } from '@antv/x6';
|
|
5
|
+
import { Tree } from 'antd';
|
|
6
|
+
import { useModel } from "../../../hooks/useModel";
|
|
7
|
+
import { getIconByType } from "../../../cells";
|
|
8
|
+
import styles from "./index.module.less";
|
|
9
|
+
var TreeNodeTitle = function TreeNodeTitle(_ref) {
|
|
10
|
+
var model = _ref.model,
|
|
11
|
+
onClick = _ref.onClick;
|
|
12
|
+
var id = model.id,
|
|
13
|
+
type = model.type;
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: classNames(styles.liteflowEditorOutlineTitle),
|
|
16
|
+
onClick: onClick
|
|
17
|
+
}, /*#__PURE__*/React.createElement("span", null, id ? "".concat(id, " : ").concat(type) : type));
|
|
18
|
+
};
|
|
19
|
+
var Outline = function Outline(props) {
|
|
20
|
+
var flowGraph = props.flowGraph;
|
|
21
|
+
var model = useModel();
|
|
22
|
+
var initialkeys = [];
|
|
23
|
+
var _useState = useState(model ? [transformer(model, initialkeys)] : []),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
treeData = _useState2[0],
|
|
26
|
+
setTreeData = _useState2[1];
|
|
27
|
+
var _useState3 = useState(initialkeys),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
expandedKeys = _useState4[0],
|
|
30
|
+
setExpandedKeys = _useState4[1];
|
|
31
|
+
function onTreeExpand(expandedKeys) {
|
|
32
|
+
setExpandedKeys(expandedKeys);
|
|
33
|
+
}
|
|
34
|
+
function transformer(currentModel, keys) {
|
|
35
|
+
var handleClick = function handleClick() {
|
|
36
|
+
// 始终递归展开节点,再选中
|
|
37
|
+
function findParentCollapsed(currentModel) {
|
|
38
|
+
if (currentModel.parent) {
|
|
39
|
+
var parent = currentModel.parent;
|
|
40
|
+
parent.toggleCollapse(false);
|
|
41
|
+
findParentCollapsed(parent);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
findParentCollapsed(currentModel);
|
|
45
|
+
|
|
46
|
+
// 移除触发 model:change 事件
|
|
47
|
+
// flowGraph.trigger('model:change');
|
|
48
|
+
|
|
49
|
+
// 找到了选中的节点
|
|
50
|
+
var node;
|
|
51
|
+
var nodes = currentModel === null || currentModel === void 0 ? void 0 : currentModel.getNodes();
|
|
52
|
+
if (nodes && nodes.length > 0) {
|
|
53
|
+
node = nodes[0];
|
|
54
|
+
if (node) {
|
|
55
|
+
flowGraph.positionCell(node, 'left', {
|
|
56
|
+
padding: {
|
|
57
|
+
left: 240
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
flowGraph.cleanSelection();
|
|
63
|
+
flowGraph.trigger('model:select', currentModel);
|
|
64
|
+
flowGraph.select(nodes);
|
|
65
|
+
};
|
|
66
|
+
var key = "".concat(currentModel.type, "-").concat(StringExt.uuid());
|
|
67
|
+
keys.push(key);
|
|
68
|
+
var node = {
|
|
69
|
+
title: /*#__PURE__*/React.createElement(TreeNodeTitle, {
|
|
70
|
+
model: currentModel,
|
|
71
|
+
onClick: handleClick
|
|
72
|
+
}),
|
|
73
|
+
key: key,
|
|
74
|
+
icon: /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: styles.liteflowEditorOutlineIcon,
|
|
76
|
+
onClick: handleClick
|
|
77
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
78
|
+
className: styles.liteflowEditorOutlineImage,
|
|
79
|
+
src: getIconByType(currentModel.type)
|
|
80
|
+
}))
|
|
81
|
+
};
|
|
82
|
+
node.children = [];
|
|
83
|
+
if (currentModel.condition) {
|
|
84
|
+
node.children.push(transformer(currentModel.condition, keys));
|
|
85
|
+
}
|
|
86
|
+
if (currentModel.children) {
|
|
87
|
+
node.children = node.children.concat(currentModel.children.map(function (item) {
|
|
88
|
+
return transformer(item, keys);
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
return node;
|
|
92
|
+
}
|
|
93
|
+
useEffect(function () {
|
|
94
|
+
var handleModelChange = function handleModelChange() {
|
|
95
|
+
var model = useModel();
|
|
96
|
+
if (model) {
|
|
97
|
+
var keys = [];
|
|
98
|
+
setTreeData([transformer(model, keys)]);
|
|
99
|
+
// 重新设置展开的键,让节点全部展开
|
|
100
|
+
setExpandedKeys(keys);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
setTreeData([]);
|
|
104
|
+
};
|
|
105
|
+
flowGraph.on('model:change', handleModelChange);
|
|
106
|
+
return function () {
|
|
107
|
+
flowGraph.off('model:change', handleModelChange);
|
|
108
|
+
};
|
|
109
|
+
}, [flowGraph, setTreeData]);
|
|
110
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: styles.liteflowEditorOutlineContainer
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Tree, {
|
|
113
|
+
blockNode: true,
|
|
114
|
+
showIcon: true,
|
|
115
|
+
showLine: {
|
|
116
|
+
showLeafIcon: false
|
|
117
|
+
},
|
|
118
|
+
expandedKeys: expandedKeys,
|
|
119
|
+
onExpand: onTreeExpand,
|
|
120
|
+
selectedKeys: [],
|
|
121
|
+
treeData: treeData
|
|
122
|
+
}));
|
|
123
|
+
};
|
|
124
|
+
export default Outline;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.liteflowEditorOutlineContainer {
|
|
2
|
+
height: auto;
|
|
3
|
+
// overflow-y: auto;
|
|
4
|
+
padding: 10px;
|
|
5
|
+
|
|
6
|
+
.liteflowEditorOutlineIcon {
|
|
7
|
+
.liteflowEditorOutlineImage {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.liteflowEditorOutlineTitle {
|
|
14
|
+
padding-left: 4px;
|
|
15
|
+
height: 30px;
|
|
16
|
+
line-height: 30px;
|
|
17
|
+
vertical-align: middle;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:global {
|
|
21
|
+
.ant-tree .ant-tree-treenode {
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
.ant-tree .ant-tree-node-content-wrapper {
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
.ant-tree-title {
|
|
28
|
+
flex: 1;
|
|
29
|
+
transform: translateY(-2px);
|
|
30
|
+
}
|
|
31
|
+
.ant-tree-iconEle.ant-tree-icon__customize {
|
|
32
|
+
transform: translateY(-2px);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&::-webkit-scrollbar {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import React, { useState, useEffect, useRef, useContext } from 'react';
|
|
5
|
+
import styles from "./index.module.less";
|
|
6
|
+
import { Table, Input, Select, Button, message, Divider, Space } from 'antd';
|
|
7
|
+
import { DeleteFilled, PlusOutlined } from '@ant-design/icons';
|
|
8
|
+
import { useModel } from "../../../hooks/useModel";
|
|
9
|
+
import { useScriptContext } from "../../../context/ScriptContext";
|
|
10
|
+
import GraphContext from "../../../context/GraphContext";
|
|
11
|
+
import { extractTextInParentheses } from "../../../utils";
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
var Parameters = function Parameters(_ref) {
|
|
14
|
+
var changeParams = _ref.changeParams;
|
|
15
|
+
var _useContext = useContext(GraphContext),
|
|
16
|
+
chainObject = _useContext.chainObject;
|
|
17
|
+
var _useState = useState([]),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
paramsList = _useState2[0],
|
|
20
|
+
setParamsList = _useState2[1];
|
|
21
|
+
var _message$useMessage = message.useMessage(),
|
|
22
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
23
|
+
messageApi = _message$useMessage2[0],
|
|
24
|
+
contextHolder = _message$useMessage2[1];
|
|
25
|
+
var _useState3 = useState(''),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
newFields = _useState4[0],
|
|
28
|
+
setNewFields = _useState4[1];
|
|
29
|
+
var _useScriptContext = useScriptContext(),
|
|
30
|
+
register = _useScriptContext.register,
|
|
31
|
+
logFieldsData = _useScriptContext.logFieldsData;
|
|
32
|
+
var inputRef = useRef(null);
|
|
33
|
+
var _useTranslation = useTranslation(),
|
|
34
|
+
t = _useTranslation.t;
|
|
35
|
+
var model = useModel();
|
|
36
|
+
var findLabelById = function findLabelById(data, targetId) {
|
|
37
|
+
if (targetId.includes('user_added_')) {
|
|
38
|
+
return targetId.replace('user_added_', '');
|
|
39
|
+
}
|
|
40
|
+
var _iterator = _createForOfIteratorHelper(data),
|
|
41
|
+
_step;
|
|
42
|
+
try {
|
|
43
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
44
|
+
var item = _step.value;
|
|
45
|
+
if (item.id === targetId) {
|
|
46
|
+
return item.label;
|
|
47
|
+
}
|
|
48
|
+
if (Array.isArray(item.children)) {
|
|
49
|
+
var result = findLabelById(item.children, targetId);
|
|
50
|
+
if (result) return result;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
} catch (err) {
|
|
54
|
+
_iterator.e(err);
|
|
55
|
+
} finally {
|
|
56
|
+
_iterator.f();
|
|
57
|
+
}
|
|
58
|
+
return null; // 没找到返回 null
|
|
59
|
+
};
|
|
60
|
+
var generateUniqueId = function generateUniqueId() {
|
|
61
|
+
var timestamp = Date.now().toString(36).slice(-4);
|
|
62
|
+
var randomStr = Math.random().toString(36).slice(2, 6);
|
|
63
|
+
return timestamp + randomStr;
|
|
64
|
+
};
|
|
65
|
+
useEffect(function () {
|
|
66
|
+
var _model$children;
|
|
67
|
+
if ((_model$children = model.children) !== null && _model$children !== void 0 && (_model$children = _model$children[0]) !== null && _model$children !== void 0 && (_model$children = _model$children.properties) !== null && _model$children !== void 0 && _model$children.data) {
|
|
68
|
+
var data = JSON.parse(model.children[0].properties.data);
|
|
69
|
+
var list = [];
|
|
70
|
+
var floatData = [];
|
|
71
|
+
logFieldsData.forEach(function (v) {
|
|
72
|
+
floatData.push.apply(floatData, _toConsumableArray(v.children));
|
|
73
|
+
});
|
|
74
|
+
Object.keys(data).map(function (key) {
|
|
75
|
+
data[key].forEach(function (item) {
|
|
76
|
+
if (list.findIndex(function (v) {
|
|
77
|
+
return v.name === "".concat(findLabelById(logFieldsData, item.variableName), "(").concat(item.variableName, ")");
|
|
78
|
+
}) === -1) {
|
|
79
|
+
var _floatData$find;
|
|
80
|
+
list.push({
|
|
81
|
+
id: generateUniqueId(),
|
|
82
|
+
key: list.length + 1 + '',
|
|
83
|
+
name: "".concat(findLabelById(logFieldsData, item.variableName), "(").concat(item.variableName, ")"),
|
|
84
|
+
type: item.variableType,
|
|
85
|
+
logField: item.variableSelect,
|
|
86
|
+
description: item.variableDescription,
|
|
87
|
+
action: list.length + 1,
|
|
88
|
+
selectIsOpen: false,
|
|
89
|
+
fieldsType: (_floatData$find = floatData.find(function (v) {
|
|
90
|
+
return v.id === item.variableSelect;
|
|
91
|
+
})) === null || _floatData$find === void 0 ? void 0 : _floatData$find.fieldsType
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
setParamsList(list);
|
|
97
|
+
} else {
|
|
98
|
+
setParamsList([]);
|
|
99
|
+
}
|
|
100
|
+
}, []);
|
|
101
|
+
|
|
102
|
+
// 模拟实例
|
|
103
|
+
var instance = {
|
|
104
|
+
getParams: function getParams() {
|
|
105
|
+
return paramsList;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
useEffect(function () {
|
|
109
|
+
register(instance); // 参数数组发生改变就向上注册自己
|
|
110
|
+
changeParams(paramsList);
|
|
111
|
+
}, [paramsList]);
|
|
112
|
+
var handleNameChange = function handleNameChange(index, value) {
|
|
113
|
+
var newParamsList = _toConsumableArray(paramsList);
|
|
114
|
+
if (!value.includes('user_added_')) {
|
|
115
|
+
var _floatData$find2;
|
|
116
|
+
var floatData = [];
|
|
117
|
+
logFieldsData.forEach(function (v) {
|
|
118
|
+
floatData.push.apply(floatData, _toConsumableArray(v.children));
|
|
119
|
+
});
|
|
120
|
+
newParamsList[index].type = (_floatData$find2 = floatData.find(function (v) {
|
|
121
|
+
return v.id === extractTextInParentheses(value);
|
|
122
|
+
})) === null || _floatData$find2 === void 0 ? void 0 : _floatData$find2.fieldsType;
|
|
123
|
+
} else {
|
|
124
|
+
newParamsList[index].type = '';
|
|
125
|
+
}
|
|
126
|
+
newParamsList[index].name = value;
|
|
127
|
+
setParamsList(newParamsList);
|
|
128
|
+
};
|
|
129
|
+
var onNewFieldsChange = function onNewFieldsChange(e) {
|
|
130
|
+
setNewFields(e.target.value);
|
|
131
|
+
};
|
|
132
|
+
var handleTypeChange = function handleTypeChange(index, value) {
|
|
133
|
+
var newParamsList = _toConsumableArray(paramsList);
|
|
134
|
+
if (value !== 'select') {
|
|
135
|
+
newParamsList[index].logField = '';
|
|
136
|
+
}
|
|
137
|
+
newParamsList[index].type = value;
|
|
138
|
+
setParamsList(newParamsList);
|
|
139
|
+
};
|
|
140
|
+
var handleDescriptionChange = function handleDescriptionChange(index, e) {
|
|
141
|
+
var value = e.target.value;
|
|
142
|
+
var newParamsList = _toConsumableArray(paramsList);
|
|
143
|
+
newParamsList[index].description = value;
|
|
144
|
+
setParamsList(newParamsList);
|
|
145
|
+
};
|
|
146
|
+
var addNewFields = function addNewFields(index) {
|
|
147
|
+
if (!newFields) {
|
|
148
|
+
messageApi.open({
|
|
149
|
+
type: 'warning',
|
|
150
|
+
content: t('parameter_name_input_placeholder')
|
|
151
|
+
});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (paramsList.findIndex(function (v) {
|
|
155
|
+
return v.name === "".concat(newFields, "(").concat('user_added_' + newFields, ")");
|
|
156
|
+
}) !== -1) {
|
|
157
|
+
messageApi.open({
|
|
158
|
+
type: 'warning',
|
|
159
|
+
content: t('parameter_name_exist')
|
|
160
|
+
});
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
logFieldsData[logFieldsData.length - 1].children.push({
|
|
164
|
+
label: newFields,
|
|
165
|
+
id: 'user_added_' + newFields
|
|
166
|
+
});
|
|
167
|
+
var newParamsList = _toConsumableArray(paramsList);
|
|
168
|
+
newParamsList[index].type = '';
|
|
169
|
+
newParamsList[index].name = "".concat(newFields, "(").concat('user_added_' + newFields, ")");
|
|
170
|
+
newParamsList[index].selectIsOpen = false;
|
|
171
|
+
setParamsList(newParamsList);
|
|
172
|
+
setNewFields('');
|
|
173
|
+
};
|
|
174
|
+
var _onDropdownVisibleChange = function onDropdownVisibleChange(index, visible) {
|
|
175
|
+
var newParamsList = _toConsumableArray(paramsList);
|
|
176
|
+
newParamsList[index].selectIsOpen = visible;
|
|
177
|
+
setParamsList(newParamsList);
|
|
178
|
+
};
|
|
179
|
+
var handleLogFieldChange = function handleLogFieldChange(index, value) {
|
|
180
|
+
var _floatData$find3;
|
|
181
|
+
var newParamsList = _toConsumableArray(paramsList);
|
|
182
|
+
var floatData = [];
|
|
183
|
+
logFieldsData.forEach(function (v) {
|
|
184
|
+
floatData.push.apply(floatData, _toConsumableArray(v.children));
|
|
185
|
+
});
|
|
186
|
+
newParamsList[index].fieldsType = (_floatData$find3 = floatData.find(function (v) {
|
|
187
|
+
return v.id === value;
|
|
188
|
+
})) === null || _floatData$find3 === void 0 ? void 0 : _floatData$find3.fieldsType;
|
|
189
|
+
newParamsList[index].logField = value;
|
|
190
|
+
setParamsList(newParamsList);
|
|
191
|
+
};
|
|
192
|
+
var columns = [{
|
|
193
|
+
title: t('parameter_name'),
|
|
194
|
+
dataIndex: 'name',
|
|
195
|
+
key: 'name',
|
|
196
|
+
width: '30%',
|
|
197
|
+
render: function render(text, record) {
|
|
198
|
+
var index = paramsList.findIndex(function (item) {
|
|
199
|
+
return item.key === record.key;
|
|
200
|
+
});
|
|
201
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
202
|
+
showSearch: true,
|
|
203
|
+
placeholder: t('parameter_name_placeholder'),
|
|
204
|
+
style: {
|
|
205
|
+
width: '100%'
|
|
206
|
+
},
|
|
207
|
+
value: text || undefined,
|
|
208
|
+
open: paramsList[index].selectIsOpen,
|
|
209
|
+
disabled: !chainObject.isEdit,
|
|
210
|
+
onDropdownVisibleChange: function onDropdownVisibleChange(visible) {
|
|
211
|
+
_onDropdownVisibleChange(index, visible);
|
|
212
|
+
},
|
|
213
|
+
onChange: function onChange(value) {
|
|
214
|
+
return handleNameChange(index, value);
|
|
215
|
+
},
|
|
216
|
+
dropdownRender: function dropdownRender(menu) {
|
|
217
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, menu, /*#__PURE__*/React.createElement(Divider, {
|
|
218
|
+
style: {
|
|
219
|
+
margin: '8px 0'
|
|
220
|
+
}
|
|
221
|
+
}), /*#__PURE__*/React.createElement(Space, {
|
|
222
|
+
style: {
|
|
223
|
+
padding: '0 8px 4px'
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
226
|
+
placeholder: t('parameter_name_input_placeholder'),
|
|
227
|
+
ref: inputRef,
|
|
228
|
+
value: newFields,
|
|
229
|
+
onChange: onNewFieldsChange
|
|
230
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
231
|
+
type: "text",
|
|
232
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
233
|
+
onClick: function onClick() {
|
|
234
|
+
addNewFields(index);
|
|
235
|
+
}
|
|
236
|
+
}, t('add'))));
|
|
237
|
+
},
|
|
238
|
+
options: logFieldsData.map(function (item) {
|
|
239
|
+
return {
|
|
240
|
+
label: item.label,
|
|
241
|
+
options: item.children.map(function (child) {
|
|
242
|
+
return {
|
|
243
|
+
label: child.label,
|
|
244
|
+
value: child.label + "(".concat(child.id, ")"),
|
|
245
|
+
disabled: paramsList.findIndex(function (v) {
|
|
246
|
+
return v.name === child.label + "(".concat(child.id, ")");
|
|
247
|
+
}) !== -1
|
|
248
|
+
};
|
|
249
|
+
})
|
|
250
|
+
};
|
|
251
|
+
})
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
title: t('parameter_type'),
|
|
256
|
+
dataIndex: 'type',
|
|
257
|
+
key: 'type',
|
|
258
|
+
width: '20%',
|
|
259
|
+
align: 'center',
|
|
260
|
+
render: function render(text, record) {
|
|
261
|
+
var index = paramsList.findIndex(function (item) {
|
|
262
|
+
return item.key === record.key;
|
|
263
|
+
});
|
|
264
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
265
|
+
placeholder: t('parameter_type_placeholder'),
|
|
266
|
+
style: {
|
|
267
|
+
width: '100%'
|
|
268
|
+
},
|
|
269
|
+
value: text,
|
|
270
|
+
onChange: function onChange(value) {
|
|
271
|
+
return handleTypeChange(index, value);
|
|
272
|
+
},
|
|
273
|
+
disabled: !paramsList[index].name || !chainObject.isEdit || !paramsList[index].name.includes('user_added')
|
|
274
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
275
|
+
value: "input"
|
|
276
|
+
}, "input"), /*#__PURE__*/React.createElement(Select.Option, {
|
|
277
|
+
value: "select"
|
|
278
|
+
}, "select"), /*#__PURE__*/React.createElement(Select.Option, {
|
|
279
|
+
value: "time"
|
|
280
|
+
}, "time"));
|
|
281
|
+
}
|
|
282
|
+
}, {
|
|
283
|
+
title: t('log_field'),
|
|
284
|
+
dataIndex: 'logField',
|
|
285
|
+
key: 'logField',
|
|
286
|
+
width: '25%',
|
|
287
|
+
align: 'center',
|
|
288
|
+
render: function render(text, record) {
|
|
289
|
+
var index = paramsList.findIndex(function (item) {
|
|
290
|
+
return item.key === record.key;
|
|
291
|
+
});
|
|
292
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
293
|
+
showSearch: true,
|
|
294
|
+
placeholder: t('log_field_placeholder'),
|
|
295
|
+
style: {
|
|
296
|
+
width: '100%'
|
|
297
|
+
},
|
|
298
|
+
value: text,
|
|
299
|
+
onChange: function onChange(value) {
|
|
300
|
+
handleLogFieldChange(index, value);
|
|
301
|
+
},
|
|
302
|
+
disabled: paramsList[index].type !== 'select' || !chainObject.isEdit,
|
|
303
|
+
options: logFieldsData.map(function (item) {
|
|
304
|
+
return {
|
|
305
|
+
label: item.label,
|
|
306
|
+
options: item.children.filter(function (i) {
|
|
307
|
+
return !i.id.includes('user_added');
|
|
308
|
+
}).map(function (child) {
|
|
309
|
+
return {
|
|
310
|
+
label: child.label,
|
|
311
|
+
value: child.id
|
|
312
|
+
};
|
|
313
|
+
})
|
|
314
|
+
};
|
|
315
|
+
})
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}, {
|
|
319
|
+
title: t('parameter_description'),
|
|
320
|
+
dataIndex: 'description',
|
|
321
|
+
key: 'description',
|
|
322
|
+
width: '30%',
|
|
323
|
+
render: function render(text, record) {
|
|
324
|
+
var index = paramsList.findIndex(function (item) {
|
|
325
|
+
return item.key === record.key;
|
|
326
|
+
});
|
|
327
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
328
|
+
placeholder: t('parameter_description_input_placeholder'),
|
|
329
|
+
value: text,
|
|
330
|
+
disabled: !chainObject.isEdit
|
|
331
|
+
// disabled={getCurrentIsUse(paramsList[index].action)}
|
|
332
|
+
,
|
|
333
|
+
onChange: function onChange(e) {
|
|
334
|
+
return handleDescriptionChange(index, e);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}, {
|
|
339
|
+
title: t('operation'),
|
|
340
|
+
key: 'action',
|
|
341
|
+
align: 'center',
|
|
342
|
+
render: function render(_, record) {
|
|
343
|
+
return /*#__PURE__*/React.createElement(DeleteFilled, {
|
|
344
|
+
onClick: function onClick() {
|
|
345
|
+
return handleDelete(record.action);
|
|
346
|
+
},
|
|
347
|
+
disabled: !chainObject.isEdit
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}];
|
|
351
|
+
var getCurrentIsUse = function getCurrentIsUse(action) {
|
|
352
|
+
var modelJson = model.toJSON();
|
|
353
|
+
var paramData = paramsList.find(function (item) {
|
|
354
|
+
return item.action === action;
|
|
355
|
+
});
|
|
356
|
+
var isUse = false;
|
|
357
|
+
if (modelJson && modelJson.properties && modelJson.properties.data && paramData !== null && paramData !== void 0 && paramData.name) {
|
|
358
|
+
var data = JSON.parse(modelJson.properties.data);
|
|
359
|
+
isUse = Object.keys(data).some(function (key) {
|
|
360
|
+
return data[key].findIndex(function (item) {
|
|
361
|
+
return item.variableName === (paramData === null || paramData === void 0 ? void 0 : paramData.name.split('(')[1].split(')')[0]);
|
|
362
|
+
}) !== -1 ? true : false;
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
return isUse;
|
|
366
|
+
};
|
|
367
|
+
var handleDelete = function handleDelete(action) {
|
|
368
|
+
if (getCurrentIsUse(action)) {
|
|
369
|
+
messageApi.open({
|
|
370
|
+
type: 'warning',
|
|
371
|
+
content: t('delete_warning')
|
|
372
|
+
});
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
setParamsList(paramsList.filter(function (item) {
|
|
376
|
+
return item.action !== action;
|
|
377
|
+
}));
|
|
378
|
+
messageApi.open({
|
|
379
|
+
type: 'success',
|
|
380
|
+
content: t('delete_success')
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
var handleAdd = function handleAdd() {
|
|
384
|
+
var newAction = Math.max.apply(Math, _toConsumableArray(paramsList.map(function (item) {
|
|
385
|
+
return item.action;
|
|
386
|
+
})).concat([0])) + 1;
|
|
387
|
+
setParamsList([].concat(_toConsumableArray(paramsList), [{
|
|
388
|
+
id: generateUniqueId(),
|
|
389
|
+
name: "",
|
|
390
|
+
type: '',
|
|
391
|
+
description: "",
|
|
392
|
+
// required: true,
|
|
393
|
+
action: newAction,
|
|
394
|
+
logField: '',
|
|
395
|
+
key: "".concat(newAction),
|
|
396
|
+
selectIsOpen: false
|
|
397
|
+
}]));
|
|
398
|
+
};
|
|
399
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
400
|
+
className: styles.liteflowEditorParametersContainer
|
|
401
|
+
}, contextHolder, /*#__PURE__*/React.createElement(Table, {
|
|
402
|
+
columns: columns,
|
|
403
|
+
dataSource: paramsList,
|
|
404
|
+
pagination: false
|
|
405
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
406
|
+
type: "primary",
|
|
407
|
+
onClick: handleAdd,
|
|
408
|
+
style: {
|
|
409
|
+
marginTop: '20px',
|
|
410
|
+
borderRadius: '4px'
|
|
411
|
+
},
|
|
412
|
+
disabled: !chainObject.isEdit
|
|
413
|
+
}, t('add_parameter')));
|
|
414
|
+
};
|
|
415
|
+
export default Parameters;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CustomDropdownProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
position: {
|
|
5
|
+
top: number;
|
|
6
|
+
left: number;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
};
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const CustomDropdown: React.FC<CustomDropdownProps>;
|
|
13
|
+
export default CustomDropdown;
|