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,42 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _get from "@babel/runtime/helpers/esm/get";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
+
import { NodeView } from '@antv/x6';
|
|
8
|
+
var MiniMapSimpleNode = /*#__PURE__*/function (_NodeView) {
|
|
9
|
+
_inherits(MiniMapSimpleNode, _NodeView);
|
|
10
|
+
var _super = _createSuper(MiniMapSimpleNode);
|
|
11
|
+
function MiniMapSimpleNode() {
|
|
12
|
+
_classCallCheck(this, MiniMapSimpleNode);
|
|
13
|
+
return _super.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
_createClass(MiniMapSimpleNode, [{
|
|
16
|
+
key: "renderMarkup",
|
|
17
|
+
value: function renderMarkup() {
|
|
18
|
+
return this.renderJSONMarkup({
|
|
19
|
+
tagName: 'rect',
|
|
20
|
+
selector: 'body'
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
key: "renderPorts",
|
|
25
|
+
value: function renderPorts() {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
key: "update",
|
|
30
|
+
value: function update() {
|
|
31
|
+
_get(_getPrototypeOf(MiniMapSimpleNode.prototype), "update", this).call(this, {
|
|
32
|
+
body: {
|
|
33
|
+
refWidth: '100%',
|
|
34
|
+
refHeight: '100%',
|
|
35
|
+
fill: '#D9D9D9'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}]);
|
|
40
|
+
return MiniMapSimpleNode;
|
|
41
|
+
}(NodeView);
|
|
42
|
+
export default MiniMapSimpleNode;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import { Button, Modal, Radio, Table, Select, Input } from 'antd';
|
|
4
|
+
import styles from "./index.module.less";
|
|
5
|
+
var NodeEditModal = function NodeEditModal(props) {
|
|
6
|
+
var _props$title = props.title,
|
|
7
|
+
title = _props$title === void 0 ? '编辑节点' : _props$title,
|
|
8
|
+
flowGraph = props.flowGraph;
|
|
9
|
+
var _useState = useState(''),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
label = _useState2[0],
|
|
12
|
+
setLabel = _useState2[1];
|
|
13
|
+
var _useState3 = useState(false),
|
|
14
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
15
|
+
visible = _useState4[0],
|
|
16
|
+
setVisible = _useState4[1];
|
|
17
|
+
|
|
18
|
+
// life
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
var handler = function handler() {
|
|
21
|
+
return setVisible(true);
|
|
22
|
+
};
|
|
23
|
+
flowGraph.on('graph:editNode', handler);
|
|
24
|
+
return function () {
|
|
25
|
+
flowGraph.off('graph:editNode', handler);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (visible) {
|
|
30
|
+
var cell = flowGraph.getSelectedCells()[0];
|
|
31
|
+
var _ref = cell.getData() || {},
|
|
32
|
+
_label = _ref.label;
|
|
33
|
+
setLabel(_label);
|
|
34
|
+
} else {
|
|
35
|
+
setLabel('');
|
|
36
|
+
}
|
|
37
|
+
}, [visible]);
|
|
38
|
+
|
|
39
|
+
// events
|
|
40
|
+
var onOk = function onOk() {
|
|
41
|
+
setVisible(false);
|
|
42
|
+
};
|
|
43
|
+
var onCancel = function onCancel() {
|
|
44
|
+
setVisible(false);
|
|
45
|
+
};
|
|
46
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
47
|
+
className: styles.liteflowEditorModal,
|
|
48
|
+
width: 560,
|
|
49
|
+
title: "".concat(title, "-").concat(label),
|
|
50
|
+
visible: visible,
|
|
51
|
+
onCancel: onCancel,
|
|
52
|
+
footer: [/*#__PURE__*/React.createElement(Button, {
|
|
53
|
+
key: 'cancel',
|
|
54
|
+
onClick: onCancel
|
|
55
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
56
|
+
key: 'saveCode',
|
|
57
|
+
type: 'primary',
|
|
58
|
+
onClick: onOk
|
|
59
|
+
}, "\u786E\u5B9A")]
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: styles.depsInfoModalContent
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
63
|
+
options: ['判断条件', '陪跑'],
|
|
64
|
+
value: '判断条件'
|
|
65
|
+
}), /*#__PURE__*/React.createElement(Table, {
|
|
66
|
+
style: {
|
|
67
|
+
paddingTop: 20
|
|
68
|
+
},
|
|
69
|
+
pagination: false,
|
|
70
|
+
columns: [{
|
|
71
|
+
title: '上一节点输出结果',
|
|
72
|
+
dataIndex: 'position',
|
|
73
|
+
key: 'position',
|
|
74
|
+
render: function render(text) {
|
|
75
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
76
|
+
value: "\u6863\u4F4D"
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
78
|
+
value: "\u6863\u4F4D"
|
|
79
|
+
}, "\u6863\u4F4D"));
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
title: '条件关系',
|
|
83
|
+
dataIndex: 'relationship',
|
|
84
|
+
key: 'relationship',
|
|
85
|
+
render: function render(text) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
87
|
+
value: ">"
|
|
88
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
89
|
+
value: ">"
|
|
90
|
+
}, ">"));
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
title: '阈值',
|
|
94
|
+
dataIndex: 'limit',
|
|
95
|
+
key: 'limit',
|
|
96
|
+
render: function render(text) {
|
|
97
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
98
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}],
|
|
102
|
+
dataSource: [{
|
|
103
|
+
key: '1',
|
|
104
|
+
position: '档位',
|
|
105
|
+
relationship: '>',
|
|
106
|
+
limit: '请输入'
|
|
107
|
+
}]
|
|
108
|
+
})));
|
|
109
|
+
};
|
|
110
|
+
export default NodeEditModal;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Graph } from '@antv/x6';
|
|
3
|
+
import '@antv/x6-react-components/es/split-box/style/index.css';
|
|
4
|
+
interface ISubComponentProps {
|
|
5
|
+
flowGraph: Graph;
|
|
6
|
+
widgets?: React.FC<any>[];
|
|
7
|
+
}
|
|
8
|
+
interface IProps {
|
|
9
|
+
flowGraph?: Graph;
|
|
10
|
+
SideBar: React.FC<ISubComponentProps>;
|
|
11
|
+
ToolBar: React.FC<ISubComponentProps>;
|
|
12
|
+
SettingBar: React.FC<ISubComponentProps>;
|
|
13
|
+
widgets?: React.FC[];
|
|
14
|
+
}
|
|
15
|
+
declare const Layout: React.FC<IProps>;
|
|
16
|
+
export default Layout;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
3
|
+
import { SplitBox } from '@antv/x6-react-components';
|
|
4
|
+
import { useGraphWrapper } from "../../hooks";
|
|
5
|
+
import '@antv/x6-react-components/es/split-box/style/index.css';
|
|
6
|
+
import styles from "./index.module.less";
|
|
7
|
+
import { MIN_ZOOM } from "../../constant";
|
|
8
|
+
import { GraphContext } from "../../context/GraphContext";
|
|
9
|
+
var Layout = function Layout(props) {
|
|
10
|
+
var flowGraph = props.flowGraph,
|
|
11
|
+
SideBar = props.SideBar,
|
|
12
|
+
ToolBar = props.ToolBar,
|
|
13
|
+
SettingBar = props.SettingBar,
|
|
14
|
+
widgets = props.widgets;
|
|
15
|
+
var _useContext = useContext(GraphContext),
|
|
16
|
+
chainObject = _useContext.chainObject;
|
|
17
|
+
var _useState = useState('22%'),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
settingBarWidth = _useState2[0],
|
|
20
|
+
setSettingBarWidth = _useState2[1];
|
|
21
|
+
var _useState3 = useState('22%'),
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
sideBarWidth = _useState4[0],
|
|
24
|
+
setSideBarWidth = _useState4[1];
|
|
25
|
+
var wrapperRef = useGraphWrapper();
|
|
26
|
+
var handleResize = function handleResize() {
|
|
27
|
+
if (flowGraph && wrapperRef && wrapperRef.current) {
|
|
28
|
+
var width = wrapperRef.current.clientWidth;
|
|
29
|
+
var height = wrapperRef.current.clientHeight;
|
|
30
|
+
flowGraph.resize(width, height);
|
|
31
|
+
flowGraph.zoomToFit({
|
|
32
|
+
minScale: MIN_ZOOM,
|
|
33
|
+
maxScale: 1
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var sideBar, toolBar, settingBar;
|
|
38
|
+
if (flowGraph) {
|
|
39
|
+
sideBar = /*#__PURE__*/React.createElement(SideBar, {
|
|
40
|
+
flowGraph: flowGraph
|
|
41
|
+
});
|
|
42
|
+
toolBar = /*#__PURE__*/React.createElement(ToolBar, {
|
|
43
|
+
flowGraph: flowGraph,
|
|
44
|
+
widgets: widgets
|
|
45
|
+
});
|
|
46
|
+
settingBar = /*#__PURE__*/React.createElement(SettingBar, {
|
|
47
|
+
flowGraph: flowGraph
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
if (flowGraph && wrapperRef && wrapperRef.current) {
|
|
52
|
+
if (!chainObject.hasPermission) {
|
|
53
|
+
setSideBarWidth('0%');
|
|
54
|
+
setSettingBarWidth('25%');
|
|
55
|
+
setTimeout(function () {
|
|
56
|
+
handleResize();
|
|
57
|
+
}, 200);
|
|
58
|
+
}
|
|
59
|
+
flowGraph.on('node:selected', function () {
|
|
60
|
+
setSideBarWidth('0%');
|
|
61
|
+
setSettingBarWidth('60%');
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
handleResize();
|
|
64
|
+
}, 0);
|
|
65
|
+
});
|
|
66
|
+
flowGraph.on('node:unselected', function () {
|
|
67
|
+
if (!chainObject.hasPermission) {
|
|
68
|
+
setSideBarWidth('0%');
|
|
69
|
+
setSettingBarWidth('25%');
|
|
70
|
+
setTimeout(function () {
|
|
71
|
+
handleResize();
|
|
72
|
+
}, 0);
|
|
73
|
+
} else {
|
|
74
|
+
setSideBarWidth('22%');
|
|
75
|
+
setSettingBarWidth('22%');
|
|
76
|
+
setTimeout(function () {
|
|
77
|
+
handleResize();
|
|
78
|
+
}, 0);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return function () {
|
|
83
|
+
if (flowGraph) {
|
|
84
|
+
flowGraph.off('node:selected');
|
|
85
|
+
flowGraph.off('node:unselected');
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, [flowGraph]);
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: styles.liteflowEditorLayoutContainer
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: styles.liteflowEditorToolBar
|
|
93
|
+
}, toolBar), /*#__PURE__*/React.createElement(SplitBox, {
|
|
94
|
+
split: 'vertical',
|
|
95
|
+
resizable: false,
|
|
96
|
+
defaultSize: sideBarWidth,
|
|
97
|
+
primary: "first",
|
|
98
|
+
onResizing: handleResize,
|
|
99
|
+
boxStyle: {
|
|
100
|
+
transition: 'width 0.2s ease-in-out'
|
|
101
|
+
}
|
|
102
|
+
}, chainObject.hasPermission && /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
className: styles.liteflowEditorSideBar
|
|
104
|
+
}, sideBar), /*#__PURE__*/React.createElement(SplitBox, {
|
|
105
|
+
split: 'vertical',
|
|
106
|
+
minSize: 300,
|
|
107
|
+
defaultSize: settingBarWidth,
|
|
108
|
+
primary: "second",
|
|
109
|
+
onResizing: handleResize,
|
|
110
|
+
boxStyle: {
|
|
111
|
+
transition: 'width 0.2s ease-in-out'
|
|
112
|
+
}
|
|
113
|
+
}, props.children, /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: styles.liteflowEditorSettingBar
|
|
115
|
+
}, settingBar))));
|
|
116
|
+
};
|
|
117
|
+
export default Layout;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.liteflowEditorLayoutContainer {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
|
|
7
|
+
.liteflowEditorToolBar {
|
|
8
|
+
height: 43px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.liteflowEditorSideBar {
|
|
12
|
+
border-right: 1px solid #d9d9d9;
|
|
13
|
+
height: 100%;
|
|
14
|
+
overflow: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.liteflowEditorSideBar::-webkit-scrollbar {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.liteflowEditorSettingBar {
|
|
22
|
+
height: 100%;
|
|
23
|
+
border-left: 1px solid #d9d9d9;
|
|
24
|
+
}
|
|
25
|
+
:global {
|
|
26
|
+
.x6-split-box-item-second {
|
|
27
|
+
z-index: 2 !important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { useModel } from "../../../hooks/useModel";
|
|
4
|
+
import { Empty } from 'antd';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
var Basic = function Basic(props) {
|
|
7
|
+
var _useModel;
|
|
8
|
+
var flowGraph = props.flowGraph;
|
|
9
|
+
var _useTranslation = useTranslation(),
|
|
10
|
+
t = _useTranslation.t;
|
|
11
|
+
var _useState = useState((_useModel = useModel()) === null || _useModel === void 0 ? void 0 : _useModel.toEL(' ')),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
elString = _useState2[0],
|
|
14
|
+
setELString = _useState2[1];
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
var handleModelChange = function handleModelChange() {
|
|
17
|
+
var _useModel2;
|
|
18
|
+
setELString((_useModel2 = useModel()) === null || _useModel2 === void 0 ? void 0 : _useModel2.toEL(' '));
|
|
19
|
+
};
|
|
20
|
+
flowGraph.on('model:change', handleModelChange);
|
|
21
|
+
return function () {
|
|
22
|
+
flowGraph.off('model:change', handleModelChange);
|
|
23
|
+
};
|
|
24
|
+
}, [flowGraph, setELString]);
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// <div className={styles.liteflowEditorBasicContainer}>
|
|
28
|
+
// <div className={styles.liteflowEditorTitle}>EL表达式:</div>
|
|
29
|
+
// <div className={styles.elContentWrapper}>
|
|
30
|
+
// <pre>{elString}</pre>
|
|
31
|
+
// </div>
|
|
32
|
+
// </div>
|
|
33
|
+
React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
style: {
|
|
35
|
+
height: '100px'
|
|
36
|
+
}
|
|
37
|
+
}), /*#__PURE__*/React.createElement(Empty, {
|
|
38
|
+
image: "https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg",
|
|
39
|
+
imageStyle: {
|
|
40
|
+
height: 60
|
|
41
|
+
},
|
|
42
|
+
description: /*#__PURE__*/React.createElement("span", null, t('node_attribute_tips'))
|
|
43
|
+
}), /*#__PURE__*/React.createElement("pre", {
|
|
44
|
+
style: {
|
|
45
|
+
opacity: 0
|
|
46
|
+
}
|
|
47
|
+
}, elString))
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
export default Basic;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.liteflowEditorBasicContainer {
|
|
2
|
+
height: auto;
|
|
3
|
+
// overflow-y: auto;
|
|
4
|
+
padding: 10px;
|
|
5
|
+
|
|
6
|
+
&::-webkit-scrollbar {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
.liteflowEditorTitle {
|
|
11
|
+
color: rgba(0, 0, 0, 0.85);
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
}
|
|
14
|
+
.elContentWrapper {
|
|
15
|
+
margin-top: 10px;
|
|
16
|
+
margin-left: -8px;
|
|
17
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
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, useReducer } from 'react';
|
|
5
|
+
import { Tabs, message } from 'antd';
|
|
6
|
+
import { useModel } from "../../hooks/useModel";
|
|
7
|
+
import Basic from "./basic";
|
|
8
|
+
import { ComponentPropertiesEditor, ConditionPropertiesEditor } from "./properties";
|
|
9
|
+
// import Outline from './outline';
|
|
10
|
+
import Parameters from "./parameters";
|
|
11
|
+
import NodeOperator from "../../model/el/node-operator";
|
|
12
|
+
import styles from "./index.module.less";
|
|
13
|
+
import { useScriptContext } from "../../context/ScriptContext";
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
var TabPane = Tabs.TabPane;
|
|
16
|
+
var SettingBar = function SettingBar(_ref) {
|
|
17
|
+
var _currentModel;
|
|
18
|
+
var flowGraph = _ref.flowGraph;
|
|
19
|
+
var _useState = useState(null),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
selectedModel = _useState2[0],
|
|
22
|
+
setSelectedModel = _useState2[1];
|
|
23
|
+
var _useState3 = useState([]),
|
|
24
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
|
+
paramsList = _useState4[0],
|
|
26
|
+
setParamsList = _useState4[1];
|
|
27
|
+
var _useState5 = useState('properties'),
|
|
28
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
29
|
+
tabKeys = _useState6[0],
|
|
30
|
+
setTabKeys = _useState6[1];
|
|
31
|
+
var _useScriptContext = useScriptContext(),
|
|
32
|
+
logFieldsData = _useScriptContext.logFieldsData;
|
|
33
|
+
var _message$useMessage = message.useMessage(),
|
|
34
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
35
|
+
messageApi = _message$useMessage2[0],
|
|
36
|
+
contextHolder = _message$useMessage2[1];
|
|
37
|
+
var model = useModel();
|
|
38
|
+
var _useTranslation = useTranslation(),
|
|
39
|
+
t = _useTranslation.t;
|
|
40
|
+
var forceUpdate = useReducer(function (n) {
|
|
41
|
+
return n + 1;
|
|
42
|
+
}, 0)[1];
|
|
43
|
+
var findLabelById = function findLabelById(data, targetId) {
|
|
44
|
+
if (targetId.includes('user_added_')) {
|
|
45
|
+
return targetId.replace('user_added_', '');
|
|
46
|
+
}
|
|
47
|
+
var _iterator = _createForOfIteratorHelper(data),
|
|
48
|
+
_step;
|
|
49
|
+
try {
|
|
50
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
51
|
+
var item = _step.value;
|
|
52
|
+
if (item.id === targetId) {
|
|
53
|
+
return item.label;
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(item.children)) {
|
|
56
|
+
var result = findLabelById(item.children, targetId);
|
|
57
|
+
if (result) return result;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} catch (err) {
|
|
61
|
+
_iterator.e(err);
|
|
62
|
+
} finally {
|
|
63
|
+
_iterator.f();
|
|
64
|
+
}
|
|
65
|
+
return null; // 没找到返回 null
|
|
66
|
+
};
|
|
67
|
+
var generateUniqueId = function generateUniqueId() {
|
|
68
|
+
var timestamp = Date.now().toString(36).slice(-4);
|
|
69
|
+
var randomStr = Math.random().toString(36).slice(2, 6);
|
|
70
|
+
return timestamp + randomStr;
|
|
71
|
+
};
|
|
72
|
+
var changeParams = function changeParams(params) {
|
|
73
|
+
setParamsList(params);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @description: 使用正则匹配括号内的内容
|
|
78
|
+
* @param {string} text
|
|
79
|
+
* @return {*}
|
|
80
|
+
*/
|
|
81
|
+
var extractTextInParentheses = function extractTextInParentheses(text) {
|
|
82
|
+
var match = text.match(/\(([^)]+)\)/);
|
|
83
|
+
return match ? match[1] : text;
|
|
84
|
+
};
|
|
85
|
+
var handleTabClick = function handleTabClick(key) {
|
|
86
|
+
if (key === 'properties') {
|
|
87
|
+
if (paramsList.some(function (i) {
|
|
88
|
+
return !i.name;
|
|
89
|
+
})) {
|
|
90
|
+
return messageApi.open({
|
|
91
|
+
type: 'warning',
|
|
92
|
+
content: t('parameter_name_not_selected')
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (paramsList.some(function (i) {
|
|
96
|
+
return !i.type;
|
|
97
|
+
})) {
|
|
98
|
+
return messageApi.open({
|
|
99
|
+
type: 'warning',
|
|
100
|
+
content: t('parameter_type_not_selected')
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (paramsList.some(function (i) {
|
|
104
|
+
return i.type === 'select' && !i.logField;
|
|
105
|
+
})) {
|
|
106
|
+
return messageApi.open({
|
|
107
|
+
type: 'warning',
|
|
108
|
+
content: t('log_field_not_selected')
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (paramsList.some(function (i) {
|
|
112
|
+
return !i.description;
|
|
113
|
+
})) {
|
|
114
|
+
return messageApi.open({
|
|
115
|
+
type: 'warning',
|
|
116
|
+
content: t('parameter_description_not_input')
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// if (paramsList.some(i => !/^[\u4e00-\u9fa5]*$/.test(i.description))) {
|
|
120
|
+
// return messageApi.open({
|
|
121
|
+
// type: 'warning',
|
|
122
|
+
// content: '参数描述只能填写中文!'
|
|
123
|
+
// });
|
|
124
|
+
// }
|
|
125
|
+
}
|
|
126
|
+
setTabKeys(key);
|
|
127
|
+
};
|
|
128
|
+
useEffect(function () {
|
|
129
|
+
var handler = function handler() {
|
|
130
|
+
setSelectedModel(null);
|
|
131
|
+
forceUpdate();
|
|
132
|
+
};
|
|
133
|
+
var handleSelect = function handleSelect(component) {
|
|
134
|
+
setSelectedModel(component);
|
|
135
|
+
};
|
|
136
|
+
flowGraph.on('settingBar:forceUpdate', handler);
|
|
137
|
+
flowGraph.on('model:select', handleSelect);
|
|
138
|
+
return function () {
|
|
139
|
+
flowGraph.off('settingBar:forceUpdate', handler);
|
|
140
|
+
flowGraph.off('model:select', handleSelect);
|
|
141
|
+
};
|
|
142
|
+
}, [flowGraph]);
|
|
143
|
+
useEffect(function () {
|
|
144
|
+
if (!model) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (model.children && model.children[0] && model.children[0].properties && model.children[0].properties.data) {
|
|
148
|
+
var data = JSON.parse(model.children[0].properties.data);
|
|
149
|
+
var floatData = [];
|
|
150
|
+
logFieldsData.forEach(function (v) {
|
|
151
|
+
floatData.push.apply(floatData, _toConsumableArray(v.children));
|
|
152
|
+
});
|
|
153
|
+
var list = [];
|
|
154
|
+
Object.keys(data).map(function (key) {
|
|
155
|
+
data[key].forEach(function (item) {
|
|
156
|
+
if (list.findIndex(function (v) {
|
|
157
|
+
return extractTextInParentheses(v.name) === item.variableName;
|
|
158
|
+
}) === -1) {
|
|
159
|
+
var _floatData$find;
|
|
160
|
+
list.push({
|
|
161
|
+
id: generateUniqueId(),
|
|
162
|
+
key: list.length + 1 + '',
|
|
163
|
+
name: "".concat(findLabelById(logFieldsData, item.variableName), "(").concat(item.variableName, ")"),
|
|
164
|
+
type: item.variableType,
|
|
165
|
+
logField: item.variableSelect,
|
|
166
|
+
description: item.variableDescription,
|
|
167
|
+
action: list.length + 1,
|
|
168
|
+
selectIsOpen: false,
|
|
169
|
+
fieldsType: (_floatData$find = floatData.find(function (v) {
|
|
170
|
+
return v.id === item.variableSelect;
|
|
171
|
+
})) === null || _floatData$find === void 0 ? void 0 : _floatData$find.fieldsType
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
// console.log(list, 'list');
|
|
177
|
+
changeParams(list);
|
|
178
|
+
}
|
|
179
|
+
}, [model]);
|
|
180
|
+
var nodes = flowGraph.getSelectedCells().filter(function (v) {
|
|
181
|
+
return !v.isEdge();
|
|
182
|
+
});
|
|
183
|
+
var currentModel;
|
|
184
|
+
if (selectedModel || nodes.length === 1) {
|
|
185
|
+
currentModel = selectedModel || nodes[0].getData().model;
|
|
186
|
+
currentModel = currentModel.proxy || currentModel;
|
|
187
|
+
}
|
|
188
|
+
var propertiesPanel = /*#__PURE__*/React.createElement(Basic, {
|
|
189
|
+
flowGraph: flowGraph
|
|
190
|
+
});
|
|
191
|
+
if ((_currentModel = currentModel) !== null && _currentModel !== void 0 && _currentModel.parent) {
|
|
192
|
+
if (Object.getPrototypeOf(currentModel) === NodeOperator.prototype) {
|
|
193
|
+
propertiesPanel = /*#__PURE__*/React.createElement(ComponentPropertiesEditor, {
|
|
194
|
+
flowGraph: flowGraph,
|
|
195
|
+
model: currentModel,
|
|
196
|
+
paramsList: paramsList
|
|
197
|
+
});
|
|
198
|
+
} else {
|
|
199
|
+
propertiesPanel = /*#__PURE__*/React.createElement(ConditionPropertiesEditor, {
|
|
200
|
+
model: currentModel
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
205
|
+
className: styles.liteflowEditorSettingBarContainer
|
|
206
|
+
}, contextHolder, /*#__PURE__*/React.createElement(Tabs, {
|
|
207
|
+
activeKey: tabKeys,
|
|
208
|
+
onTabClick: handleTabClick
|
|
209
|
+
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
210
|
+
tab: t('node_attribute'),
|
|
211
|
+
key: 'properties'
|
|
212
|
+
}, propertiesPanel), /*#__PURE__*/React.createElement(TabPane, {
|
|
213
|
+
tab: t('workflow_parameters'),
|
|
214
|
+
key: 'parameters'
|
|
215
|
+
}, /*#__PURE__*/React.createElement(Parameters, {
|
|
216
|
+
changeParams: changeParams
|
|
217
|
+
}))));
|
|
218
|
+
};
|
|
219
|
+
export default SettingBar;
|