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,2780 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
import React, { useState, useEffect, useRef, useContext } from 'react';
|
|
7
|
+
import { Button, Form, Input, Select, Divider, Space, message, Cascader, TreeSelect, List, Switch } from 'antd';
|
|
8
|
+
import { PlusOutlined, CloseCircleTwoTone } from '@ant-design/icons';
|
|
9
|
+
import { history } from "../../../hooks/useHistory";
|
|
10
|
+
import { useModel } from "../../../hooks/useModel";
|
|
11
|
+
import { useUpdateEffect } from "../../../hooks/useUpdateEffect";
|
|
12
|
+
import styles from "./index.module.less";
|
|
13
|
+
import GraphContext from "../../../context/GraphContext";
|
|
14
|
+
import { useScriptContext } from "../../../context/ScriptContext";
|
|
15
|
+
import RichParamEditor from "./RichParamEditor";
|
|
16
|
+
import { unitNumOptions, unitOptions } from "../../../constant/index";
|
|
17
|
+
import { useTagGetModel, findNodesBeforeTag, extractBracedContent, findWorkInputs, extractTextInParentheses, formatDateTime } from "../../../utils/index";
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
19
|
+
var ComponentPropertiesEditor = function ComponentPropertiesEditor(_ref) {
|
|
20
|
+
var model = _ref.model,
|
|
21
|
+
paramsList = _ref.paramsList,
|
|
22
|
+
flowGraph = _ref.flowGraph;
|
|
23
|
+
var _useContext = useContext(GraphContext),
|
|
24
|
+
chainObject = _useContext.chainObject; // 工作流回显参数
|
|
25
|
+
// 组件数据,添加过滤器方法,数据集列表,过滤器信息,添加聚合方法,聚合列表,报表模板列表,查询知识库方法
|
|
26
|
+
var _useScriptContext = useScriptContext(),
|
|
27
|
+
scriptList = _useScriptContext.scriptList,
|
|
28
|
+
addFilter = _useScriptContext.addFilter,
|
|
29
|
+
dataSetList = _useScriptContext.dataSetList,
|
|
30
|
+
filtersInfo = _useScriptContext.filtersInfo,
|
|
31
|
+
addAggFun = _useScriptContext.addAggFun,
|
|
32
|
+
aggList = _useScriptContext.aggList,
|
|
33
|
+
reportTemplateList = _useScriptContext.reportTemplateList,
|
|
34
|
+
chainCurComponent = _useScriptContext.chainCurComponent,
|
|
35
|
+
changeIndex = _useScriptContext.changeIndex,
|
|
36
|
+
changeLogIndex = _useScriptContext.changeLogIndex,
|
|
37
|
+
queryKnowledge = _useScriptContext.queryKnowledge,
|
|
38
|
+
selectApply = _useScriptContext.selectApply,
|
|
39
|
+
getCompliance = _useScriptContext.getCompliance,
|
|
40
|
+
getApplyFlow = _useScriptContext.getApplyFlow,
|
|
41
|
+
getCurScheduleSet = _useScriptContext.getCurScheduleSet,
|
|
42
|
+
getAnalyseField = _useScriptContext.getAnalyseField,
|
|
43
|
+
showViewSetting = _useScriptContext.showViewSetting;
|
|
44
|
+
var dataOptions = dataSetList.map(function (item) {
|
|
45
|
+
return {
|
|
46
|
+
label: item.dataSetName,
|
|
47
|
+
value: item.id,
|
|
48
|
+
isLeaf: false,
|
|
49
|
+
getLogList: item.getLogList,
|
|
50
|
+
getLogFieldsData: item.getLogFieldsData
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
var _useState = useState(dataSetList.map(function (item) {
|
|
54
|
+
return {
|
|
55
|
+
title: item.dataSetName,
|
|
56
|
+
value: item.id,
|
|
57
|
+
id: item.id,
|
|
58
|
+
pid: 0,
|
|
59
|
+
isLeaf: false,
|
|
60
|
+
getLogList: item.getLogList,
|
|
61
|
+
checkable: false,
|
|
62
|
+
disableCheckbox: true,
|
|
63
|
+
selectable: false,
|
|
64
|
+
level: 1
|
|
65
|
+
};
|
|
66
|
+
})),
|
|
67
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
+
treeData = _useState2[0],
|
|
69
|
+
setTreeData = _useState2[1];
|
|
70
|
+
// 已加载的节点键值
|
|
71
|
+
var _useState3 = useState([]),
|
|
72
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73
|
+
loadedKeys = _useState4[0],
|
|
74
|
+
setLoadedKeys = _useState4[1];
|
|
75
|
+
var _useState5 = useState([]),
|
|
76
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
77
|
+
inputParams = _useState6[0],
|
|
78
|
+
setInputParams = _useState6[1];
|
|
79
|
+
var _useState7 = useState([]),
|
|
80
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
81
|
+
inputValues = _useState8[0],
|
|
82
|
+
setInputValues = _useState8[1];
|
|
83
|
+
var _useState9 = useState([]),
|
|
84
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
85
|
+
inputList = _useState10[0],
|
|
86
|
+
setInputList = _useState10[1];
|
|
87
|
+
var _useState11 = useState(0),
|
|
88
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
89
|
+
currentType = _useState12[0],
|
|
90
|
+
setCurrentType = _useState12[1];
|
|
91
|
+
var _message$useMessage = message.useMessage(),
|
|
92
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
93
|
+
messageApi = _message$useMessage2[0],
|
|
94
|
+
contextHolder = _message$useMessage2[1];
|
|
95
|
+
var _Form$useForm = Form.useForm(),
|
|
96
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
97
|
+
form = _Form$useForm2[0];
|
|
98
|
+
var inputRef = useRef(null);
|
|
99
|
+
var _useState13 = useState(''),
|
|
100
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
101
|
+
newFields = _useState14[0],
|
|
102
|
+
setNewFields = _useState14[1];
|
|
103
|
+
var _useState15 = useState(dataOptions),
|
|
104
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
105
|
+
dataSetOptions = _useState16[0],
|
|
106
|
+
setDataSetOptions = _useState16[1];
|
|
107
|
+
var _useState17 = useState([]),
|
|
108
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
109
|
+
selectLog = _useState18[0],
|
|
110
|
+
setSelectLog = _useState18[1];
|
|
111
|
+
var _useState19 = useState([]),
|
|
112
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
113
|
+
nodeFilters = _useState20[0],
|
|
114
|
+
setNodeFilters = _useState20[1];
|
|
115
|
+
var _useState21 = useState([]),
|
|
116
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
117
|
+
selections = _useState22[0],
|
|
118
|
+
setSelections = _useState22[1];
|
|
119
|
+
var _useState23 = useState([]),
|
|
120
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
121
|
+
iteratorNodes = _useState24[0],
|
|
122
|
+
setIteratorNodes = _useState24[1];
|
|
123
|
+
var _useState25 = useState(''),
|
|
124
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
125
|
+
iteratorNodeValue = _useState26[0],
|
|
126
|
+
setIteratorNodeValue = _useState26[1];
|
|
127
|
+
var _useState27 = useState([]),
|
|
128
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
129
|
+
selectAggList = _useState28[0],
|
|
130
|
+
setSelectAggList = _useState28[1];
|
|
131
|
+
var _useState29 = useState([]),
|
|
132
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
133
|
+
selectionsOptions = _useState30[0],
|
|
134
|
+
setSelectionsOptions = _useState30[1];
|
|
135
|
+
var _useState31 = useState([]),
|
|
136
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
137
|
+
applyList = _useState32[0],
|
|
138
|
+
setApplyList = _useState32[1];
|
|
139
|
+
var _useState33 = useState([]),
|
|
140
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
141
|
+
sortCriteria = _useState34[0],
|
|
142
|
+
setSortCriteria = _useState34[1];
|
|
143
|
+
var _useState35 = useState([]),
|
|
144
|
+
_useState36 = _slicedToArray(_useState35, 2),
|
|
145
|
+
fieldSetting = _useState36[0],
|
|
146
|
+
setFieldSetting = _useState36[1];
|
|
147
|
+
var _useState37 = useState(0),
|
|
148
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
149
|
+
aiNetSearch = _useState38[0],
|
|
150
|
+
setAiNetSearch = _useState38[1];
|
|
151
|
+
var _useState39 = useState([]),
|
|
152
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
153
|
+
curScheduleSet = _useState40[0],
|
|
154
|
+
setCurScheduleSet = _useState40[1];
|
|
155
|
+
var _useState41 = useState([]),
|
|
156
|
+
_useState42 = _slicedToArray(_useState41, 2),
|
|
157
|
+
caseAttrField = _useState42[0],
|
|
158
|
+
setCaseAttrField = _useState42[1];
|
|
159
|
+
var _useState43 = useState([]),
|
|
160
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
161
|
+
selectNodes = _useState44[0],
|
|
162
|
+
setSelectNodes = _useState44[1];
|
|
163
|
+
var _useState45 = useState(undefined),
|
|
164
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
165
|
+
rootCauseNode = _useState46[0],
|
|
166
|
+
setRootCauseNode = _useState46[1];
|
|
167
|
+
var _useState47 = useState([]),
|
|
168
|
+
_useState48 = _slicedToArray(_useState47, 2),
|
|
169
|
+
rootCauseParam = _useState48[0],
|
|
170
|
+
setRootCauseParam = _useState48[1];
|
|
171
|
+
var _useState49 = useState([]),
|
|
172
|
+
_useState50 = _slicedToArray(_useState49, 2),
|
|
173
|
+
analyseField = _useState50[0],
|
|
174
|
+
setAnalyseField = _useState50[1];
|
|
175
|
+
var _useState51 = useState(undefined),
|
|
176
|
+
_useState52 = _slicedToArray(_useState51, 2),
|
|
177
|
+
analysisFieldTemplate = _useState52[0],
|
|
178
|
+
setAnalysisFieldTemplate = _useState52[1];
|
|
179
|
+
var _useTranslation = useTranslation(),
|
|
180
|
+
t = _useTranslation.t;
|
|
181
|
+
var loadTreeData = /*#__PURE__*/function () {
|
|
182
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(node) {
|
|
183
|
+
var children, res, _res, index;
|
|
184
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
185
|
+
while (1) switch (_context.prev = _context.next) {
|
|
186
|
+
case 0:
|
|
187
|
+
if (!(node.level === 1)) {
|
|
188
|
+
_context.next = 8;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
_context.next = 3;
|
|
192
|
+
return node.getLogList({
|
|
193
|
+
dataSetId: node.value,
|
|
194
|
+
success: 3
|
|
195
|
+
});
|
|
196
|
+
case 3:
|
|
197
|
+
res = _context.sent;
|
|
198
|
+
children = res.data;
|
|
199
|
+
children = children.map(function (item) {
|
|
200
|
+
return {
|
|
201
|
+
title: item.logName,
|
|
202
|
+
value: item.logId,
|
|
203
|
+
id: item.logId,
|
|
204
|
+
pId: node.value,
|
|
205
|
+
isLeaf: false,
|
|
206
|
+
checkable: false,
|
|
207
|
+
// 只有叶子节点可以被选中
|
|
208
|
+
disableCheckbox: true,
|
|
209
|
+
selectable: false,
|
|
210
|
+
level: 2
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
_context.next = 13;
|
|
214
|
+
break;
|
|
215
|
+
case 8:
|
|
216
|
+
_context.next = 10;
|
|
217
|
+
return queryKnowledge({
|
|
218
|
+
logId: node.value
|
|
219
|
+
});
|
|
220
|
+
case 10:
|
|
221
|
+
_res = _context.sent;
|
|
222
|
+
children = _res.data;
|
|
223
|
+
children = children.map(function (item) {
|
|
224
|
+
return {
|
|
225
|
+
title: item.fileName,
|
|
226
|
+
value: item.id,
|
|
227
|
+
id: item.id,
|
|
228
|
+
pId: node.value,
|
|
229
|
+
isLeaf: true,
|
|
230
|
+
checkable: true,
|
|
231
|
+
// 只有叶子节点可以被选中
|
|
232
|
+
level: 3
|
|
233
|
+
};
|
|
234
|
+
});
|
|
235
|
+
case 13:
|
|
236
|
+
loadedKeys.push(node.value);
|
|
237
|
+
setLoadedKeys(_toConsumableArray(loadedKeys));
|
|
238
|
+
if (children.length > 0) {
|
|
239
|
+
setTreeData(treeData.concat(children));
|
|
240
|
+
} else {
|
|
241
|
+
index = treeData.findIndex(function (item) {
|
|
242
|
+
return item.value === node.value;
|
|
243
|
+
});
|
|
244
|
+
treeData[index].isLeaf = true;
|
|
245
|
+
setTreeData(_toConsumableArray(treeData));
|
|
246
|
+
}
|
|
247
|
+
case 16:
|
|
248
|
+
case "end":
|
|
249
|
+
return _context.stop();
|
|
250
|
+
}
|
|
251
|
+
}, _callee);
|
|
252
|
+
}));
|
|
253
|
+
return function loadTreeData(_x) {
|
|
254
|
+
return _ref2.apply(this, arguments);
|
|
255
|
+
};
|
|
256
|
+
}();
|
|
257
|
+
var onChangeKnowledge = /*#__PURE__*/function () {
|
|
258
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value, title) {
|
|
259
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
260
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
261
|
+
case 0:
|
|
262
|
+
// console.log('onChangeKnowledge', value, title);
|
|
263
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
264
|
+
knowledgeTreeData: treeData,
|
|
265
|
+
aiKnowledgeFileList: title,
|
|
266
|
+
aiKnowledgeFileId: value
|
|
267
|
+
}));
|
|
268
|
+
setCurrentModelProperties();
|
|
269
|
+
case 2:
|
|
270
|
+
case "end":
|
|
271
|
+
return _context2.stop();
|
|
272
|
+
}
|
|
273
|
+
}, _callee2);
|
|
274
|
+
}));
|
|
275
|
+
return function onChangeKnowledge(_x2, _x3) {
|
|
276
|
+
return _ref3.apply(this, arguments);
|
|
277
|
+
};
|
|
278
|
+
}();
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* @description: 切换组件
|
|
282
|
+
* @param {string | undefined} value
|
|
283
|
+
*/
|
|
284
|
+
var changeScript = function changeScript(value) {
|
|
285
|
+
var scriptInfo = scriptList.find(function (i) {
|
|
286
|
+
return i.scriptId === value;
|
|
287
|
+
});
|
|
288
|
+
if (((scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type) === 1 || (scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type) == 4 || (scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type) == 5) && scriptInfo !== null && scriptInfo !== void 0 && scriptInfo.params) {
|
|
289
|
+
var _paramsList = JSON.parse(scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.params);
|
|
290
|
+
var newInputList = _paramsList.map(function (item) {
|
|
291
|
+
return {
|
|
292
|
+
value: '',
|
|
293
|
+
variableDesc: item.variableDesc,
|
|
294
|
+
label: item.variableName,
|
|
295
|
+
type: item.variableType,
|
|
296
|
+
richValue: [],
|
|
297
|
+
selectIsOpen: false
|
|
298
|
+
};
|
|
299
|
+
});
|
|
300
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
301
|
+
inputList: newInputList
|
|
302
|
+
}));
|
|
303
|
+
setInputList(newInputList);
|
|
304
|
+
} else if ((scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type) == 6 || (scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type) == 7) {
|
|
305
|
+
selectApply({
|
|
306
|
+
applyName: scriptInfo.scriptName
|
|
307
|
+
}).then(function (res) {
|
|
308
|
+
setApplyList(res);
|
|
309
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
310
|
+
applyList: res
|
|
311
|
+
}));
|
|
312
|
+
});
|
|
313
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
314
|
+
inputList: []
|
|
315
|
+
}));
|
|
316
|
+
setInputList([]);
|
|
317
|
+
} else {
|
|
318
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
319
|
+
inputList: []
|
|
320
|
+
}));
|
|
321
|
+
setInputList([]);
|
|
322
|
+
}
|
|
323
|
+
setSortCriteria([]);
|
|
324
|
+
setSelectionsOptions([]);
|
|
325
|
+
setSelections([]);
|
|
326
|
+
setSelectLog([]);
|
|
327
|
+
setCurScheduleSet([]);
|
|
328
|
+
setRootCauseNode(undefined);
|
|
329
|
+
setRootCauseParam([]);
|
|
330
|
+
setAnalysisFieldTemplate(undefined);
|
|
331
|
+
var text = '';
|
|
332
|
+
var oldScriptInfo = scriptList.find(function (i) {
|
|
333
|
+
return i.scriptId === model.id;
|
|
334
|
+
});
|
|
335
|
+
if (model.getProperties().scriptName && (oldScriptInfo === null || oldScriptInfo === void 0 ? void 0 : oldScriptInfo.scriptName) !== model.getProperties().scriptName) {
|
|
336
|
+
text = model.getProperties().scriptName;
|
|
337
|
+
} else {
|
|
338
|
+
text = (scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.scriptName) || '';
|
|
339
|
+
}
|
|
340
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
341
|
+
scriptName: text,
|
|
342
|
+
forecastId: '',
|
|
343
|
+
modelType: scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type,
|
|
344
|
+
logId: '',
|
|
345
|
+
dataSetId: '',
|
|
346
|
+
simpleQueryModel: {},
|
|
347
|
+
rootCauseNode: '',
|
|
348
|
+
rootCauseParam: undefined
|
|
349
|
+
}));
|
|
350
|
+
model.id = scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.scriptId;
|
|
351
|
+
var modelNode = model.getStartNode();
|
|
352
|
+
modelNode.updateAttrs({
|
|
353
|
+
label: {
|
|
354
|
+
text: text,
|
|
355
|
+
fill: "#333",
|
|
356
|
+
fontSize: 13,
|
|
357
|
+
refX: 0.5,
|
|
358
|
+
refY: "100%",
|
|
359
|
+
refY2: 20,
|
|
360
|
+
textAnchor: "middle",
|
|
361
|
+
textVerticalAnchor: "middle"
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
form.setFieldsValue({
|
|
365
|
+
script: scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.scriptId,
|
|
366
|
+
name: text
|
|
367
|
+
});
|
|
368
|
+
setCurrentType(scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type);
|
|
369
|
+
history.push(undefined, {
|
|
370
|
+
silent: true
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* @description: 切换下拉弹窗的显示
|
|
375
|
+
* @param {number} index
|
|
376
|
+
* @param {boolean} visible
|
|
377
|
+
*/
|
|
378
|
+
var _onDropdownVisibleChange = function onDropdownVisibleChange(index, visible) {
|
|
379
|
+
var newInputList = _toConsumableArray(inputList);
|
|
380
|
+
newInputList[index].selectIsOpen = visible;
|
|
381
|
+
setInputList(newInputList);
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* @description: 添加自定义参数
|
|
385
|
+
* @param {number} index
|
|
386
|
+
*/
|
|
387
|
+
var addNewFields = function addNewFields(index) {
|
|
388
|
+
if (!newFields) {
|
|
389
|
+
messageApi.open({
|
|
390
|
+
type: 'warning',
|
|
391
|
+
content: '请输入参数名称'
|
|
392
|
+
});
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
var newInputParams = [];
|
|
396
|
+
if (inputParams.length === 0) {
|
|
397
|
+
newInputParams = [{
|
|
398
|
+
id: 'user_added',
|
|
399
|
+
label: '用户新增字段',
|
|
400
|
+
icon: 'user_added_icon',
|
|
401
|
+
children: [{
|
|
402
|
+
id: 'user_added_' + newFields,
|
|
403
|
+
label: newFields,
|
|
404
|
+
icon: 'user_added_icon',
|
|
405
|
+
type: 'Standard',
|
|
406
|
+
fieldsType: 'TEXT'
|
|
407
|
+
}]
|
|
408
|
+
}];
|
|
409
|
+
setInputParams(newInputParams);
|
|
410
|
+
} else {
|
|
411
|
+
newInputParams = _toConsumableArray(inputParams);
|
|
412
|
+
newInputParams[0].children.push({
|
|
413
|
+
id: 'user_added_' + newFields,
|
|
414
|
+
label: newFields,
|
|
415
|
+
icon: 'user_added_icon',
|
|
416
|
+
type: 'Standard',
|
|
417
|
+
fieldsType: 'TEXT'
|
|
418
|
+
});
|
|
419
|
+
setInputParams(newInputParams);
|
|
420
|
+
}
|
|
421
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
422
|
+
inputParams: newInputParams
|
|
423
|
+
}));
|
|
424
|
+
changeInputLabel("user_added_".concat(newFields), index);
|
|
425
|
+
setNewFields('');
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* @description: 更新自定义参数的名称
|
|
430
|
+
*/
|
|
431
|
+
var onNewFieldsChange = function onNewFieldsChange(e) {
|
|
432
|
+
setNewFields(e.target.value);
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* @description: 设置工作流参数的值到Then节点
|
|
436
|
+
*/
|
|
437
|
+
var setThenProperties = function setThenProperties() {
|
|
438
|
+
var allModel = useModel();
|
|
439
|
+
if (allModel.children && allModel.children[0]) {
|
|
440
|
+
var workInputs = findWorkInputs(allModel.toJSON());
|
|
441
|
+
// console.log('workInputs', workInputs);
|
|
442
|
+
if (workInputs.length > 0) {
|
|
443
|
+
var object = {};
|
|
444
|
+
workInputs.forEach(function (item) {
|
|
445
|
+
// console.log(paramsList)
|
|
446
|
+
paramsList.forEach(function (param) {
|
|
447
|
+
if (item.value === param.name || item.value === extractTextInParentheses(param.name)) {
|
|
448
|
+
if (!Object.keys(object).includes(item.tag)) {
|
|
449
|
+
object[item.tag] = [{
|
|
450
|
+
variableName: extractTextInParentheses(param.name),
|
|
451
|
+
variableType: param.type,
|
|
452
|
+
variableDescription: param.description,
|
|
453
|
+
variableValue: item.label,
|
|
454
|
+
variableSelect: param.logField
|
|
455
|
+
}];
|
|
456
|
+
} else {
|
|
457
|
+
object[item.tag].push({
|
|
458
|
+
variableName: extractTextInParentheses(param.name),
|
|
459
|
+
variableType: param.type,
|
|
460
|
+
variableDescription: param.description,
|
|
461
|
+
variableValue: item.label,
|
|
462
|
+
variableSelect: param.logField
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
// console.log(object)
|
|
469
|
+
allModel.children[0].setProperties({
|
|
470
|
+
data: JSON.stringify(object)
|
|
471
|
+
});
|
|
472
|
+
} else {
|
|
473
|
+
allModel.children[0].setProperties({});
|
|
474
|
+
}
|
|
475
|
+
;
|
|
476
|
+
// flowGraph.trigger('node:change:*');
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* @description: 设置当前节点的BindObject
|
|
481
|
+
*/
|
|
482
|
+
var setCurrentModelProperties = function setCurrentModelProperties() {
|
|
483
|
+
var _model$getProperties, _model$getProperties2, _model$getProperties3, _model$parent, _model$getProperties5, _model$getProperties7, _model$getProperties9, _model$getProperties11, _model$getProperties13;
|
|
484
|
+
var properties = model.getProperties();
|
|
485
|
+
if (!properties) return;
|
|
486
|
+
var modelInputList = properties['inputList'] || [];
|
|
487
|
+
var specialInputList = modelInputList.filter(function (item) {
|
|
488
|
+
return item.type === 'input';
|
|
489
|
+
});
|
|
490
|
+
modelInputList = modelInputList.filter(function (item) {
|
|
491
|
+
return !item.type || item.type !== 'input';
|
|
492
|
+
});
|
|
493
|
+
var bindObject = {};
|
|
494
|
+
if (modelInputList.length && modelInputList.every(function (i) {
|
|
495
|
+
return i.value && i.label;
|
|
496
|
+
})) {
|
|
497
|
+
modelInputList.forEach(function (item) {
|
|
498
|
+
var type = '';
|
|
499
|
+
if (item.type) {
|
|
500
|
+
type = item.type;
|
|
501
|
+
} else {
|
|
502
|
+
inputValues.forEach(function (i1) {
|
|
503
|
+
i1.options.forEach(function (i2) {
|
|
504
|
+
if (i2.value === item.value) {
|
|
505
|
+
type = i2.type;
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
var types = {
|
|
511
|
+
'string': ['TEXT', 'Standard', 'input'],
|
|
512
|
+
'number': ['DOUBLE', 'INT', 'Long'],
|
|
513
|
+
'time': ['TIME', 'TIME TANG', 'time', 'Time', 'TimeSpan']
|
|
514
|
+
};
|
|
515
|
+
if (types.string.includes(type)) {
|
|
516
|
+
type = 'string';
|
|
517
|
+
} else if (types.number.includes(type)) {
|
|
518
|
+
type = 'number';
|
|
519
|
+
} else if (types.time.includes(type)) {
|
|
520
|
+
type = 'time';
|
|
521
|
+
}
|
|
522
|
+
if (item.value.split('~~~')[0] === 'work') {
|
|
523
|
+
bindObject[item.label] = {
|
|
524
|
+
sourceField: extractTextInParentheses(item.value.split('~~~')[1]) || '',
|
|
525
|
+
type: type,
|
|
526
|
+
target: 'initialize'
|
|
527
|
+
};
|
|
528
|
+
} else {
|
|
529
|
+
var useParamModel = useTagGetModel(item.value.split('~~~')[0], useModel);
|
|
530
|
+
if (useParamModel && [6, 7].includes(useParamModel.properties.modelType)) {
|
|
531
|
+
bindObject[item.label] = {
|
|
532
|
+
sourceField: item.value.split('~~~')[1].split('-')[1],
|
|
533
|
+
type: type,
|
|
534
|
+
target: item.value.split('~~~')[0] + "".concat(item.value.split('~~~')[1].split('-')[0])
|
|
535
|
+
};
|
|
536
|
+
} else {
|
|
537
|
+
bindObject[item.label] = {
|
|
538
|
+
sourceField: item.value.split('~~~')[1],
|
|
539
|
+
type: type,
|
|
540
|
+
target: item.value.split('~~~')[0]
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
if (specialInputList.length > 0) {
|
|
547
|
+
specialInputList.forEach(function (item) {
|
|
548
|
+
var usePramsList = extractBracedContent(item.value);
|
|
549
|
+
// console.log(usePramsList, item.value);
|
|
550
|
+
var paramsValue = item.value;
|
|
551
|
+
usePramsList.forEach(function (param) {
|
|
552
|
+
if (param.split('~~~')[0] === 'work') {
|
|
553
|
+
paramsValue = paramsValue.replace(param, "initialize-".concat(extractTextInParentheses(param.split('~~~')[1]) || ''));
|
|
554
|
+
} else {
|
|
555
|
+
var useParamModel = useTagGetModel(param.split('~~~')[0], useModel);
|
|
556
|
+
if (useParamModel && [6, 7].includes(useParamModel.properties.modelType)) {
|
|
557
|
+
if (param.split('~~~')[1].split('-').length == 1) {
|
|
558
|
+
paramsValue = paramsValue.replace(param, "".concat(param.split('~~~')[0] + param.split('~~~')[1].split('-')[0], "-").concat(param.split('~~~')[1]));
|
|
559
|
+
} else {
|
|
560
|
+
paramsValue = paramsValue.replace(param, "".concat(param.split('~~~')[0] + param.split('~~~')[1].split('-')[0], "-").concat(param.split('~~~')[1].split('-')[1]));
|
|
561
|
+
}
|
|
562
|
+
} else {
|
|
563
|
+
paramsValue = paramsValue.replace(param, "".concat(param.split('~~~')[0], "-").concat(param.split('~~~')[1]));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
var inputParamObj = {};
|
|
568
|
+
var typedObj = inputParamObj;
|
|
569
|
+
usePramsList.forEach(function (param) {
|
|
570
|
+
if (param.split('~~~')[0] === 'work') {
|
|
571
|
+
var workValue = extractTextInParentheses(param.split('~~~')[1]) || '';
|
|
572
|
+
typedObj["initialize-".concat(extractTextInParentheses(param.split('~~~')[1]) || '')] = "initialize@@".concat(workValue);
|
|
573
|
+
} else {
|
|
574
|
+
var useParamModel = useTagGetModel(param.split('~~~')[0], useModel);
|
|
575
|
+
if (useParamModel && [6, 7].includes(useParamModel.properties.modelType)) {
|
|
576
|
+
if (param.split('~~~')[1].split('-').length == 1) {
|
|
577
|
+
typedObj["".concat(param.split('~~~')[0] + param.split('~~~')[1], "-").concat(param.split('~~~')[1])] = "".concat(param.split('~~~')[0] + param.split('~~~')[1].split('-')[0], "@@").concat(param.split('~~~')[1]);
|
|
578
|
+
} else {
|
|
579
|
+
typedObj["".concat(param.split('~~~')[0] + param.split('~~~')[1].split('-')[0], "-").concat(param.split('~~~')[1].split('-')[1])] = "".concat(param.split('~~~')[0] + param.split('~~~')[1].split('-')[0], "@@").concat(param.split('~~~')[1].split('-')[1]);
|
|
580
|
+
}
|
|
581
|
+
} else {
|
|
582
|
+
typedObj["".concat(param.split('~~~')[0], "-").concat(param.split('~~~')[1])] = "".concat(param.split('~~~')[0], "@@").concat(param.split('~~~')[1]);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return typedObj;
|
|
586
|
+
});
|
|
587
|
+
bindObject[item.label] = {
|
|
588
|
+
sourceField: paramsValue,
|
|
589
|
+
type: item.type || '',
|
|
590
|
+
inputParam: [typedObj]
|
|
591
|
+
};
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
var obj = {
|
|
595
|
+
logId: properties['logId'],
|
|
596
|
+
dataSetId: properties['dataSetId'],
|
|
597
|
+
simpleQueryModel: [2, 6, 7, 8].includes(properties['modelType']) ? JSON.stringify((_model$getProperties = model.getProperties()) === null || _model$getProperties === void 0 ? void 0 : _model$getProperties.simpleQueryModel) : undefined,
|
|
598
|
+
nodeMappingListMap: JSON.stringify(bindObject),
|
|
599
|
+
aiNetSearch: (_model$getProperties2 = model.getProperties()) === null || _model$getProperties2 === void 0 ? void 0 : _model$getProperties2.aiNetSearch
|
|
600
|
+
};
|
|
601
|
+
if ((_model$getProperties3 = model.getProperties()) !== null && _model$getProperties3 !== void 0 && _model$getProperties3.filterParam) {
|
|
602
|
+
var _model$getProperties4;
|
|
603
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
604
|
+
filterParam: (_model$getProperties4 = model.getProperties()) === null || _model$getProperties4 === void 0 ? void 0 : _model$getProperties4.filterParam
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
if (((_model$parent = model.parent) === null || _model$parent === void 0 ? void 0 : _model$parent.type) === "ITERATOR" && model.parent.condition) {
|
|
608
|
+
var _model$parent$conditi;
|
|
609
|
+
if ((_model$parent$conditi = model.parent.condition.properties) !== null && _model$parent$conditi !== void 0 && _model$parent$conditi.bind) {
|
|
610
|
+
var _model$parent$conditi2;
|
|
611
|
+
var paramsType = JSON.parse((_model$parent$conditi2 = model.parent.condition.properties) === null || _model$parent$conditi2 === void 0 ? void 0 : _model$parent$conditi2.bind).iterator;
|
|
612
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
613
|
+
iterator: paramsType
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
if (currentType === 5 && (_model$getProperties5 = model.getProperties()) !== null && _model$getProperties5 !== void 0 && _model$getProperties5.reportMinioName) {
|
|
618
|
+
var _model$getProperties6;
|
|
619
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
620
|
+
reportMinioName: (_model$getProperties6 = model.getProperties()) === null || _model$getProperties6 === void 0 ? void 0 : _model$getProperties6.reportMinioName
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
if (currentType === 4 && (_model$getProperties7 = model.getProperties()) !== null && _model$getProperties7 !== void 0 && _model$getProperties7.aiKnowledgeFileList) {
|
|
624
|
+
var _model$getProperties8;
|
|
625
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
626
|
+
aiKnowledgeFileList: JSON.stringify((_model$getProperties8 = model.getProperties()) === null || _model$getProperties8 === void 0 ? void 0 : _model$getProperties8.aiKnowledgeFileList)
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
if (currentType === 7 && (_model$getProperties9 = model.getProperties()) !== null && _model$getProperties9 !== void 0 && _model$getProperties9.forecastId) {
|
|
630
|
+
var _model$getProperties10;
|
|
631
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
632
|
+
forecastId: (_model$getProperties10 = model.getProperties()) === null || _model$getProperties10 === void 0 ? void 0 : _model$getProperties10.forecastId
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
if (currentType === 8 && (_model$getProperties11 = model.getProperties()) !== null && _model$getProperties11 !== void 0 && _model$getProperties11.rootCauseNode) {
|
|
636
|
+
var _model$getProperties12;
|
|
637
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
638
|
+
rootCauseNode: (_model$getProperties12 = model.getProperties()) === null || _model$getProperties12 === void 0 ? void 0 : _model$getProperties12.rootCauseNode
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
if (currentType === 8 && (_model$getProperties13 = model.getProperties()) !== null && _model$getProperties13 !== void 0 && _model$getProperties13.rootCauseParam) {
|
|
642
|
+
var _model$getProperties14;
|
|
643
|
+
obj = _objectSpread(_objectSpread({}, obj), {}, {
|
|
644
|
+
rootCauseParam: JSON.stringify((_model$getProperties14 = model.getProperties()) === null || _model$getProperties14 === void 0 ? void 0 : _model$getProperties14.rootCauseParam)
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
648
|
+
bind: JSON.stringify(obj)
|
|
649
|
+
}));
|
|
650
|
+
};
|
|
651
|
+
var formatUnitList = function formatUnitList(currentFile) {
|
|
652
|
+
// console.log(currentFile);
|
|
653
|
+
var unitNeedList = [];
|
|
654
|
+
if (currentFile.fieldsType === "TIME TANG" && currentFile.aggregation !== "COUNT" && currentFile.aggregation !== "COUNT_DISTINCT") {
|
|
655
|
+
unitNeedList = [{
|
|
656
|
+
label: "以毫秒",
|
|
657
|
+
value: "Millisecond"
|
|
658
|
+
}, {
|
|
659
|
+
label: "以秒",
|
|
660
|
+
value: "Seconds"
|
|
661
|
+
}, {
|
|
662
|
+
label: "以分",
|
|
663
|
+
value: "Minutes"
|
|
664
|
+
}, {
|
|
665
|
+
label: "以小时",
|
|
666
|
+
value: "Hours"
|
|
667
|
+
}, {
|
|
668
|
+
label: "以天",
|
|
669
|
+
value: "Days"
|
|
670
|
+
}, {
|
|
671
|
+
label: "以周",
|
|
672
|
+
value: "Weeks"
|
|
673
|
+
}, {
|
|
674
|
+
label: "以月",
|
|
675
|
+
value: "Months"
|
|
676
|
+
}, {
|
|
677
|
+
label: "以年",
|
|
678
|
+
value: "Years"
|
|
679
|
+
}, {
|
|
680
|
+
label: "以-天-小时-分钟-秒",
|
|
681
|
+
value: "forMatTime"
|
|
682
|
+
}];
|
|
683
|
+
} else {
|
|
684
|
+
unitNeedList = [{
|
|
685
|
+
label: "基本",
|
|
686
|
+
value: "Basic"
|
|
687
|
+
}, {
|
|
688
|
+
label: "以千",
|
|
689
|
+
value: "Thousand"
|
|
690
|
+
}, {
|
|
691
|
+
label: "以百万",
|
|
692
|
+
value: "Million"
|
|
693
|
+
}, {
|
|
694
|
+
label: "以十亿",
|
|
695
|
+
value: "Billion"
|
|
696
|
+
}];
|
|
697
|
+
}
|
|
698
|
+
return unitNeedList;
|
|
699
|
+
};
|
|
700
|
+
var changeRootCauseNode = function changeRootCauseNode(value) {
|
|
701
|
+
var _node$properties, _node$properties2, _node$properties3;
|
|
702
|
+
var node = selectNodes.find(function (i) {
|
|
703
|
+
var _i$properties;
|
|
704
|
+
return ((_i$properties = i.properties) === null || _i$properties === void 0 ? void 0 : _i$properties.tag) === value;
|
|
705
|
+
});
|
|
706
|
+
var getLogFieldsData = dataOptions[0].getLogFieldsData;
|
|
707
|
+
setRootCauseNode(value);
|
|
708
|
+
setRootCauseParam([]);
|
|
709
|
+
setAnalysisFieldTemplate(undefined);
|
|
710
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
711
|
+
rootCauseNode: value,
|
|
712
|
+
logId: (_node$properties = node.properties) === null || _node$properties === void 0 ? void 0 : _node$properties.logId,
|
|
713
|
+
rootCauseParam: []
|
|
714
|
+
}));
|
|
715
|
+
setCurrentModelProperties();
|
|
716
|
+
getLogFieldsData((_node$properties2 = node.properties) === null || _node$properties2 === void 0 ? void 0 : _node$properties2.logId).then(function (res) {
|
|
717
|
+
if (res.status === 'success') {
|
|
718
|
+
setInputParams(generateInputParams(res.logFields));
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
getAnalyseField({
|
|
722
|
+
logId: (_node$properties3 = node.properties) === null || _node$properties3 === void 0 ? void 0 : _node$properties3.logId
|
|
723
|
+
}).then(function (res) {
|
|
724
|
+
if (res.code === 200) {
|
|
725
|
+
setAnalyseField(res.data);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
flowGraph.trigger('node:change:*');
|
|
729
|
+
};
|
|
730
|
+
var getRootCauseParam = function getRootCauseParam() {
|
|
731
|
+
if (!rootCauseParam.length) return undefined;
|
|
732
|
+
if (rootCauseParam.length == 1) return rootCauseParam[0].asColumn;
|
|
733
|
+
return rootCauseParam.filter(function (i) {
|
|
734
|
+
return i.asColumn.includes('y');
|
|
735
|
+
})[0].asColumn;
|
|
736
|
+
};
|
|
737
|
+
var changeAnalysisAgg = function changeAnalysisAgg(value, option) {
|
|
738
|
+
setSelections(value);
|
|
739
|
+
setSelectionsOptions(option.map(function (item) {
|
|
740
|
+
return {
|
|
741
|
+
fieldsType: item.fieldsType,
|
|
742
|
+
label: item.label,
|
|
743
|
+
type: item.type,
|
|
744
|
+
asColumn: item.id,
|
|
745
|
+
id: item.id,
|
|
746
|
+
key: item.id,
|
|
747
|
+
config: getConfig(item)
|
|
748
|
+
};
|
|
749
|
+
}));
|
|
750
|
+
flowGraph.trigger('node:change:*');
|
|
751
|
+
};
|
|
752
|
+
var getConfig = function getConfig(item) {
|
|
753
|
+
var _selectionsOptions$fi;
|
|
754
|
+
if ((_selectionsOptions$fi = selectionsOptions.find(function (i) {
|
|
755
|
+
return i.asColumn === item.id;
|
|
756
|
+
})) !== null && _selectionsOptions$fi !== void 0 && _selectionsOptions$fi.config) {
|
|
757
|
+
return selectionsOptions.find(function (i) {
|
|
758
|
+
return i.asColumn === item.id;
|
|
759
|
+
}).config;
|
|
760
|
+
}
|
|
761
|
+
if (getFieldType(item.id) === "Time") {
|
|
762
|
+
return {
|
|
763
|
+
interval: 1,
|
|
764
|
+
timeUnit: "MONTHS",
|
|
765
|
+
type: "timeDistributionConfig"
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
return {};
|
|
769
|
+
};
|
|
770
|
+
var changeAnalysisField = function changeAnalysisField(value) {
|
|
771
|
+
var fieldList = getRootCauseNode().properties.outputParams;
|
|
772
|
+
if (value.includes('y')) {
|
|
773
|
+
var fieldXList = fieldList.filter(function (i) {
|
|
774
|
+
return i.asColumn.includes('x');
|
|
775
|
+
});
|
|
776
|
+
var fieldData = fieldList.find(function (i) {
|
|
777
|
+
return i.asColumn == value;
|
|
778
|
+
});
|
|
779
|
+
fieldXList.push(fieldData);
|
|
780
|
+
setRootCauseParam(fieldXList);
|
|
781
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
782
|
+
rootCauseParam: fieldXList
|
|
783
|
+
}));
|
|
784
|
+
} else {
|
|
785
|
+
var _fieldData = fieldList.find(function (i) {
|
|
786
|
+
return i.asColumn == value;
|
|
787
|
+
});
|
|
788
|
+
setRootCauseParam([_objectSpread({}, _fieldData)]);
|
|
789
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
790
|
+
rootCauseParam: [_objectSpread({}, _fieldData)]
|
|
791
|
+
}));
|
|
792
|
+
}
|
|
793
|
+
setCurrentModelProperties();
|
|
794
|
+
flowGraph.trigger('node:change:*');
|
|
795
|
+
};
|
|
796
|
+
var changeAnalysisFieldTemplate = function changeAnalysisFieldTemplate(val) {
|
|
797
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
798
|
+
analysisFieldTemplate: val
|
|
799
|
+
}));
|
|
800
|
+
var selections = JSON.parse(analyseField.find(function (i) {
|
|
801
|
+
return i.id == val;
|
|
802
|
+
}).selectionsJson);
|
|
803
|
+
setSelectionsOptions(selections);
|
|
804
|
+
setSelections(selections.map(function (i) {
|
|
805
|
+
return i.key;
|
|
806
|
+
}));
|
|
807
|
+
setAnalysisFieldTemplate(val);
|
|
808
|
+
};
|
|
809
|
+
var getRootCauseNode = function getRootCauseNode() {
|
|
810
|
+
return selectNodes.find(function (i) {
|
|
811
|
+
var _i$properties2;
|
|
812
|
+
return ((_i$properties2 = i.properties) === null || _i$properties2 === void 0 ? void 0 : _i$properties2.tag) === rootCauseNode;
|
|
813
|
+
});
|
|
814
|
+
};
|
|
815
|
+
/**
|
|
816
|
+
* @description: 更新输入变量的value
|
|
817
|
+
* @param {any} sourceValue
|
|
818
|
+
* @param {number} index
|
|
819
|
+
*/
|
|
820
|
+
var changeInputValue = function changeInputValue(sourceValue, index) {
|
|
821
|
+
var value = '';
|
|
822
|
+
if (typeof sourceValue !== 'string') {
|
|
823
|
+
sourceValue.forEach(function (item) {
|
|
824
|
+
value += item.children.map(function (item) {
|
|
825
|
+
if (item.type === 'variable') {
|
|
826
|
+
return "{{".concat(item.value, "}}");
|
|
827
|
+
} else {
|
|
828
|
+
return item.text;
|
|
829
|
+
}
|
|
830
|
+
}).join('');
|
|
831
|
+
});
|
|
832
|
+
} else {
|
|
833
|
+
value = sourceValue;
|
|
834
|
+
}
|
|
835
|
+
var newInputList = _toConsumableArray(inputList);
|
|
836
|
+
newInputList[index].value = value;
|
|
837
|
+
if (newInputList[index].type === 'input') {
|
|
838
|
+
newInputList[index].richValue = sourceValue;
|
|
839
|
+
}
|
|
840
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
841
|
+
inputList: newInputList
|
|
842
|
+
}));
|
|
843
|
+
flowGraph.trigger('node:change:*');
|
|
844
|
+
setThenProperties();
|
|
845
|
+
setCurrentModelProperties();
|
|
846
|
+
setInputList(newInputList);
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* @description: 设置循环参数
|
|
850
|
+
*/
|
|
851
|
+
var changeIteratorNodes = function changeIteratorNodes(value) {
|
|
852
|
+
var option = iteratorNodes.find(function (i) {
|
|
853
|
+
return i.value === value;
|
|
854
|
+
});
|
|
855
|
+
// console.log('changeIteratorNodes', value, option);
|
|
856
|
+
setIteratorNodeValue(value);
|
|
857
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties() ? model.getProperties() : {}), {}, {
|
|
858
|
+
bind: JSON.stringify({
|
|
859
|
+
iterator: value
|
|
860
|
+
}),
|
|
861
|
+
outputParams: value !== 'initialize' ? option.properties.outputParams : paramsList
|
|
862
|
+
}));
|
|
863
|
+
flowGraph.trigger('node:change:*');
|
|
864
|
+
};
|
|
865
|
+
var changeInputLabel = function changeInputLabel(value, index) {
|
|
866
|
+
var newInputList = _toConsumableArray(inputList);
|
|
867
|
+
newInputList[index].selectIsOpen = false;
|
|
868
|
+
newInputList[index].label = value;
|
|
869
|
+
newInputList[index].value = '';
|
|
870
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
871
|
+
inputList: newInputList
|
|
872
|
+
}));
|
|
873
|
+
flowGraph.trigger('node:change:*');
|
|
874
|
+
if (newInputList[index].value.split('~~~')[0] === 'work') {
|
|
875
|
+
setThenProperties();
|
|
876
|
+
} else {
|
|
877
|
+
setCurrentModelProperties();
|
|
878
|
+
}
|
|
879
|
+
setInputList(newInputList);
|
|
880
|
+
};
|
|
881
|
+
var getInputValueDisabled = function getInputValueDisabled(option, param) {
|
|
882
|
+
var _model$getProperties15;
|
|
883
|
+
// console.log(option, param);
|
|
884
|
+
if (!option.type) return false;
|
|
885
|
+
if (((_model$getProperties15 = model.getProperties()) === null || _model$getProperties15 === void 0 ? void 0 : _model$getProperties15.modelType) != 2) {
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
var types = {
|
|
889
|
+
'string': ['TEXT', 'Standard', 'input'],
|
|
890
|
+
'number': ['DOUBLE', 'INT', 'Long'],
|
|
891
|
+
'time': ['TIME', 'TIME TANG', 'time', 'Time', 'TimeSpan']
|
|
892
|
+
};
|
|
893
|
+
if (option.type === getFieldType(param.label, true)) {
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
if (Object.keys(types).includes(param.type)) {
|
|
897
|
+
if (param.type && types[param.type].includes(option.type)) {
|
|
898
|
+
return false;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (option.type == 'select') {
|
|
902
|
+
if (option.fieldsType === getFieldType(param.label, true)) {
|
|
903
|
+
return false;
|
|
904
|
+
}
|
|
905
|
+
if (param.type === 'string' && types.string.includes(option.fieldsType)) {
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
if (param.type === 'number' && types.number.includes(option.fieldsType)) {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
if (param.type === 'time' && types.time.includes(option.fieldsType)) {
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (option.type == 'time' && ['TIME', 'TIME TANG'].includes(getFieldType(param.label, true))) {
|
|
916
|
+
return false;
|
|
917
|
+
}
|
|
918
|
+
if (option.type == 'input' && getFieldType(param.label, true) === 'TEXT') {
|
|
919
|
+
return false;
|
|
920
|
+
}
|
|
921
|
+
return true;
|
|
922
|
+
};
|
|
923
|
+
var handleQueryConfig = function handleQueryConfig(logFields) {
|
|
924
|
+
if (!model.getProperties().propValue && selectionsOptions.length) {
|
|
925
|
+
var _sortCriteria = model.getProperties().sortCriteria || [];
|
|
926
|
+
_sortCriteria.forEach(function (item) {
|
|
927
|
+
if (selectionsOptions.find(function (i) {
|
|
928
|
+
return i.asColumn === item.asColumn;
|
|
929
|
+
})) {
|
|
930
|
+
item.asColumn = "x[".concat(selectionsOptions.findIndex(function (i) {
|
|
931
|
+
return i.asColumn === item.asColumn;
|
|
932
|
+
}), "]");
|
|
933
|
+
}
|
|
934
|
+
if (aggList.find(function (i) {
|
|
935
|
+
return i.asColumn === item.asColumn;
|
|
936
|
+
})) {
|
|
937
|
+
item.asColumn = "y[".concat(aggList.findIndex(function (i) {
|
|
938
|
+
return i.asColumn === item.asColumn;
|
|
939
|
+
}), "]");
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
var propValue = {
|
|
943
|
+
"viewId": "1",
|
|
944
|
+
"type": "table-normal",
|
|
945
|
+
"textValue": "",
|
|
946
|
+
"chartInfo": {
|
|
947
|
+
"xaxis": "[]",
|
|
948
|
+
"xaxisExt": "[]",
|
|
949
|
+
"yaxis": "[]",
|
|
950
|
+
"yaxisExt": [],
|
|
951
|
+
"extStack": [],
|
|
952
|
+
"drillFields": [],
|
|
953
|
+
"viewFields": [],
|
|
954
|
+
"extBubble": [],
|
|
955
|
+
"show": true,
|
|
956
|
+
"type": "table-normal",
|
|
957
|
+
"title": "",
|
|
958
|
+
"needSubhead": false,
|
|
959
|
+
"subhead": "",
|
|
960
|
+
"refreshViewEnable": false,
|
|
961
|
+
"refreshUnit": "minute",
|
|
962
|
+
"refreshTime": 5,
|
|
963
|
+
"customAttr": "{}",
|
|
964
|
+
"customStyle": "{}",
|
|
965
|
+
"senior": "{}",
|
|
966
|
+
"customFilter": [{
|
|
967
|
+
"value": "设置",
|
|
968
|
+
"label": "设置",
|
|
969
|
+
"asColumn": "设置"
|
|
970
|
+
}].concat(_toConsumableArray(selectionsOptions.map(function (i, index) {
|
|
971
|
+
return _objectSpread(_objectSpread({
|
|
972
|
+
"value": i.label,
|
|
973
|
+
"label": "\u7EF4\u5EA6: ".concat(i.label),
|
|
974
|
+
"notsetYname": true,
|
|
975
|
+
"fieldName": i.label,
|
|
976
|
+
"isPercentage": false,
|
|
977
|
+
"isCompare": false,
|
|
978
|
+
"isCaseAttributes": false,
|
|
979
|
+
"isFilter": true,
|
|
980
|
+
"showOneLabel": false,
|
|
981
|
+
"showThousands": false,
|
|
982
|
+
"asColumn": "x[".concat(index, "]"),
|
|
983
|
+
"formatType": "auto",
|
|
984
|
+
"formatUnit": "",
|
|
985
|
+
"formatDecimal": "",
|
|
986
|
+
"formatSuffix": ""
|
|
987
|
+
}, i.config || {}), {}, {
|
|
988
|
+
"customField": _objectSpread(_objectSpread({}, i), {}, {
|
|
989
|
+
"asColumn": "x[".concat(index, "]")
|
|
990
|
+
})
|
|
991
|
+
});
|
|
992
|
+
})), _toConsumableArray(aggList.map(function (i, index) {
|
|
993
|
+
return _objectSpread(_objectSpread({
|
|
994
|
+
"value": i.key,
|
|
995
|
+
"label": "\u6307\u6807: ".concat(i.label),
|
|
996
|
+
"notsetYname": true,
|
|
997
|
+
"fieldName": i.label,
|
|
998
|
+
"isPercentage": false,
|
|
999
|
+
"isCompare": false,
|
|
1000
|
+
"isCaseAttributes": false,
|
|
1001
|
+
"isFilter": true,
|
|
1002
|
+
"showOneLabel": false,
|
|
1003
|
+
"showThousands": false,
|
|
1004
|
+
"asColumn": "y[".concat(index, "]"),
|
|
1005
|
+
"formatType": "custom",
|
|
1006
|
+
"formatUnit": "Days",
|
|
1007
|
+
"formatDecimal": "2",
|
|
1008
|
+
"formatSuffix": ""
|
|
1009
|
+
}, fieldSetting.filter(function (item) {
|
|
1010
|
+
return item.asColumn === i.asColumn;
|
|
1011
|
+
}).length > 0 ? fieldSetting.filter(function (item) {
|
|
1012
|
+
return item.asColumn === i.asColumn;
|
|
1013
|
+
})[0] : {}), {}, {
|
|
1014
|
+
"customField": _objectSpread(_objectSpread({}, i), {}, {
|
|
1015
|
+
"asColumn": "y[".concat(index, "]")
|
|
1016
|
+
})
|
|
1017
|
+
});
|
|
1018
|
+
}))),
|
|
1019
|
+
"render": "antv",
|
|
1020
|
+
"isPlugin": false,
|
|
1021
|
+
"data": {
|
|
1022
|
+
"data": [],
|
|
1023
|
+
"dynamicAssistLines": [],
|
|
1024
|
+
"fields": [],
|
|
1025
|
+
"tableRow": [],
|
|
1026
|
+
"condition": [].concat(_toConsumableArray(selectionsOptions.map(function (i, index) {
|
|
1027
|
+
return _objectSpread(_objectSpread({}, i), {}, {
|
|
1028
|
+
"asColumn": "x[".concat(index, "]")
|
|
1029
|
+
});
|
|
1030
|
+
})), _toConsumableArray(aggList.map(function (i, index) {
|
|
1031
|
+
return _objectSpread(_objectSpread({}, i), {}, {
|
|
1032
|
+
"asColumn": "y[".concat(index, "]")
|
|
1033
|
+
});
|
|
1034
|
+
}))),
|
|
1035
|
+
"size": 100,
|
|
1036
|
+
"sortCriteria": _sortCriteria
|
|
1037
|
+
},
|
|
1038
|
+
"id": "74539f10-5884-11f0-b16c-df9ab6b2b43d"
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1042
|
+
propValue: propValue
|
|
1043
|
+
}));
|
|
1044
|
+
showViewSetting(model.getProperties().propValue, caseAttrField, logFields, model.getProperties().logId);
|
|
1045
|
+
} else if (model.getProperties().propValue) {
|
|
1046
|
+
showViewSetting(model.getProperties().propValue, caseAttrField, logFields, model.getProperties().logId);
|
|
1047
|
+
} else {
|
|
1048
|
+
showViewSetting('', caseAttrField, logFields, model.getProperties().logId);
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
var changeReportTemplate = function changeReportTemplate(value) {
|
|
1052
|
+
var _reportTemplateList$f;
|
|
1053
|
+
var reportParam = ((_reportTemplateList$f = reportTemplateList.find(function (i) {
|
|
1054
|
+
return i.minioName === value;
|
|
1055
|
+
})) === null || _reportTemplateList$f === void 0 ? void 0 : _reportTemplateList$f.reportParam) || '[]';
|
|
1056
|
+
var inputList = JSON.parse(reportParam).map(function (item) {
|
|
1057
|
+
return {
|
|
1058
|
+
label: item,
|
|
1059
|
+
value: '',
|
|
1060
|
+
type: 'input'
|
|
1061
|
+
};
|
|
1062
|
+
});
|
|
1063
|
+
// console.log('changeReportTemplate', inputList);
|
|
1064
|
+
setInputList(inputList);
|
|
1065
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1066
|
+
inputList: inputList,
|
|
1067
|
+
reportMinioName: value
|
|
1068
|
+
}));
|
|
1069
|
+
flowGraph.trigger('node:change:*');
|
|
1070
|
+
};
|
|
1071
|
+
var changeAiNetSearch = function changeAiNetSearch(checked) {
|
|
1072
|
+
setAiNetSearch(checked ? 1 : 0);
|
|
1073
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1074
|
+
aiNetSearch: checked ? 1 : 0
|
|
1075
|
+
}));
|
|
1076
|
+
setCurrentModelProperties();
|
|
1077
|
+
};
|
|
1078
|
+
var delInputList = function delInputList(index) {
|
|
1079
|
+
var newInputList = _toConsumableArray(inputList);
|
|
1080
|
+
newInputList.splice(index, 1);
|
|
1081
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1082
|
+
inputList: newInputList
|
|
1083
|
+
}));
|
|
1084
|
+
setThenProperties();
|
|
1085
|
+
setCurrentModelProperties();
|
|
1086
|
+
flowGraph.trigger('node:change:*');
|
|
1087
|
+
setInputList(newInputList);
|
|
1088
|
+
};
|
|
1089
|
+
var loadLogList = function loadLogList(nodeList) {
|
|
1090
|
+
var currentNode = nodeList[0];
|
|
1091
|
+
currentNode.loading = true;
|
|
1092
|
+
currentNode.getLogList({
|
|
1093
|
+
dataSetId: currentNode.value,
|
|
1094
|
+
success: 3
|
|
1095
|
+
}).then(function (res) {
|
|
1096
|
+
// console.log(res);
|
|
1097
|
+
currentNode.loading = false;
|
|
1098
|
+
currentNode.children = res.data.map(function (item) {
|
|
1099
|
+
return {
|
|
1100
|
+
// ...item,
|
|
1101
|
+
label: item.logName,
|
|
1102
|
+
value: item.logId,
|
|
1103
|
+
isLeaf: true,
|
|
1104
|
+
children: [],
|
|
1105
|
+
loading: false
|
|
1106
|
+
};
|
|
1107
|
+
});
|
|
1108
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1109
|
+
logList: currentNode.children
|
|
1110
|
+
}));
|
|
1111
|
+
setDataSetOptions(dataSetOptions ? _toConsumableArray(dataSetOptions) : []);
|
|
1112
|
+
});
|
|
1113
|
+
};
|
|
1114
|
+
var onChangeLogId = function onChangeLogId(args) {
|
|
1115
|
+
setSelectLog(args[0]);
|
|
1116
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1117
|
+
dataSetId: args[0][0],
|
|
1118
|
+
logId: args[0][1]
|
|
1119
|
+
}));
|
|
1120
|
+
setSortCriteria([]);
|
|
1121
|
+
setSelectionsOptions([]);
|
|
1122
|
+
setSelections([]);
|
|
1123
|
+
setCurScheduleSet([]);
|
|
1124
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1125
|
+
propValue: '',
|
|
1126
|
+
forecastId: '',
|
|
1127
|
+
simpleQueryModel: {}
|
|
1128
|
+
}));
|
|
1129
|
+
flowGraph.trigger('node:change:*');
|
|
1130
|
+
if (currentType == 2) {
|
|
1131
|
+
var dataSetInfo = dataSetOptions.find(function (i) {
|
|
1132
|
+
return i.value === args[0][0];
|
|
1133
|
+
});
|
|
1134
|
+
// console.log(dataSetInfo);
|
|
1135
|
+
if (!(dataSetInfo !== null && dataSetInfo !== void 0 && dataSetInfo.getLogFieldsData)) return;
|
|
1136
|
+
dataSetInfo.getLogFieldsData(args[0][1]).then(function (res) {
|
|
1137
|
+
// console.log(res);
|
|
1138
|
+
if (res.status === 'success') {
|
|
1139
|
+
setInputParams(generateInputParams(res.logFields));
|
|
1140
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1141
|
+
inputParams: generateInputParams(res.logFields)
|
|
1142
|
+
}));
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
} else {
|
|
1146
|
+
setInputParams(model.getProperties().inputParams || []);
|
|
1147
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1148
|
+
inputParams: model.getProperties().inputParams || []
|
|
1149
|
+
}));
|
|
1150
|
+
}
|
|
1151
|
+
if (currentType == 6 || currentType == 7) {
|
|
1152
|
+
setCurrentModelProperties();
|
|
1153
|
+
updateSimpleQuery();
|
|
1154
|
+
}
|
|
1155
|
+
if (currentType == 7) {
|
|
1156
|
+
getCurScheduleSet({
|
|
1157
|
+
logId: args[0][1]
|
|
1158
|
+
}).then(function (res) {
|
|
1159
|
+
setCurScheduleSet(res.data);
|
|
1160
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1161
|
+
forecastId: '',
|
|
1162
|
+
curScheduleSet: res.data
|
|
1163
|
+
}));
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
history.push(undefined, {
|
|
1167
|
+
silent: true
|
|
1168
|
+
});
|
|
1169
|
+
};
|
|
1170
|
+
var handleAddFilter = function handleAddFilter() {
|
|
1171
|
+
addFilter(selectLog[1], nodeFilters, inputValues);
|
|
1172
|
+
};
|
|
1173
|
+
var changeForecastId = function changeForecastId(value) {
|
|
1174
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1175
|
+
forecastId: value
|
|
1176
|
+
}));
|
|
1177
|
+
setCurrentModelProperties();
|
|
1178
|
+
flowGraph.trigger('node:change:*');
|
|
1179
|
+
};
|
|
1180
|
+
var getFieldLabel = function getFieldLabel(id) {
|
|
1181
|
+
var label = "";
|
|
1182
|
+
inputParams.forEach(function (item) {
|
|
1183
|
+
item.children.forEach(function (child) {
|
|
1184
|
+
if (child.id === id) {
|
|
1185
|
+
label = child.label;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
});
|
|
1189
|
+
return label;
|
|
1190
|
+
};
|
|
1191
|
+
var getHdNum = function getHdNum(data) {
|
|
1192
|
+
var hdNum = 0;
|
|
1193
|
+
Object.keys(data).forEach(function (item) {
|
|
1194
|
+
if (item === 'contains' && data[item].length) {
|
|
1195
|
+
hdNum++;
|
|
1196
|
+
}
|
|
1197
|
+
if (item === 'isEnd' && data[item].length) {
|
|
1198
|
+
hdNum++;
|
|
1199
|
+
}
|
|
1200
|
+
if (item === 'isStart' && data[item].length) {
|
|
1201
|
+
hdNum++;
|
|
1202
|
+
}
|
|
1203
|
+
if (item === 'notContains' && data[item].length) {
|
|
1204
|
+
hdNum++;
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
return "".concat(hdNum, "\u4E2A\u6761\u4EF6");
|
|
1208
|
+
};
|
|
1209
|
+
var getFieldType = function getFieldType(field, isNoFilter) {
|
|
1210
|
+
var floatData = [];
|
|
1211
|
+
inputParams.forEach(function (item) {
|
|
1212
|
+
// console.log(item);
|
|
1213
|
+
floatData.push.apply(floatData, _toConsumableArray(item.children));
|
|
1214
|
+
});
|
|
1215
|
+
var obj = floatData.find(function (i) {
|
|
1216
|
+
return i.id == field;
|
|
1217
|
+
});
|
|
1218
|
+
if (obj && Object.keys(obj).length) {
|
|
1219
|
+
if (!isNoFilter) {
|
|
1220
|
+
if (obj.fieldsType === "TEXT") {
|
|
1221
|
+
return "Standard";
|
|
1222
|
+
}
|
|
1223
|
+
if (obj.fieldsType === "DOUBLE" || obj.fieldsType === "INT") {
|
|
1224
|
+
return "Long";
|
|
1225
|
+
}
|
|
1226
|
+
if (obj.fieldsType === "TIME") {
|
|
1227
|
+
return "Time";
|
|
1228
|
+
}
|
|
1229
|
+
if (obj.fieldsType === "TIME TANG") {
|
|
1230
|
+
return "TimeSpan";
|
|
1231
|
+
}
|
|
1232
|
+
} else {
|
|
1233
|
+
return obj.fieldsType;
|
|
1234
|
+
}
|
|
1235
|
+
return "";
|
|
1236
|
+
} else {
|
|
1237
|
+
return "";
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
var parseUnits = function parseUnits(type, val) {
|
|
1241
|
+
switch (type) {
|
|
1242
|
+
case "Millisecond":
|
|
1243
|
+
return parseInt(val);
|
|
1244
|
+
case "Seconds":
|
|
1245
|
+
return parseInt(val) / 1000;
|
|
1246
|
+
case "Minutes":
|
|
1247
|
+
return parseInt(val) / (60 * 1000);
|
|
1248
|
+
case "Hours":
|
|
1249
|
+
return parseInt(val) / (60 * 60 * 1000);
|
|
1250
|
+
case "Days":
|
|
1251
|
+
return parseInt(val) / (24 * 60 * 60 * 1000);
|
|
1252
|
+
case "Weeks":
|
|
1253
|
+
return parseInt(val) / (7 * 24 * 60 * 60 * 1000);
|
|
1254
|
+
case "Months":
|
|
1255
|
+
return (parseInt(val) / (31 * 24 * 60 * 60 * 1000)).toFixed(2);
|
|
1256
|
+
case "Years":
|
|
1257
|
+
return parseInt(val) / (365 * 24 * 60 * 60 * 1000);
|
|
1258
|
+
case "Basic":
|
|
1259
|
+
return parseInt(val);
|
|
1260
|
+
case "Thousand":
|
|
1261
|
+
return parseInt(val) / 1000;
|
|
1262
|
+
case "Million":
|
|
1263
|
+
return parseInt(val) / 1000000;
|
|
1264
|
+
case "Billion":
|
|
1265
|
+
return parseInt(val) / 1000000000;
|
|
1266
|
+
default:
|
|
1267
|
+
return val;
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
var delNodeFilters = function delNodeFilters(index) {
|
|
1271
|
+
var newNodeFilters = _toConsumableArray(nodeFilters);
|
|
1272
|
+
newNodeFilters.splice(index, 1);
|
|
1273
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties() ? model.getProperties() : {}), {}, {
|
|
1274
|
+
nodeFilters: newNodeFilters
|
|
1275
|
+
}));
|
|
1276
|
+
setNodeFilters(newNodeFilters);
|
|
1277
|
+
};
|
|
1278
|
+
var isDisabed = function isDisabed(script) {
|
|
1279
|
+
var _model$parent2;
|
|
1280
|
+
if (currentType != 3 && script.type == 3) {
|
|
1281
|
+
return true;
|
|
1282
|
+
}
|
|
1283
|
+
if ((script.type == 4 || script.type == 5 || script.type == 2) && ((_model$parent2 = model.parent) === null || _model$parent2 === void 0 ? void 0 : _model$parent2.type) === 'ITERATOR') {
|
|
1284
|
+
return true;
|
|
1285
|
+
}
|
|
1286
|
+
return false;
|
|
1287
|
+
};
|
|
1288
|
+
var setCurrentModelValues = function setCurrentModelValues() {
|
|
1289
|
+
var _model$getProperties16, _model$id;
|
|
1290
|
+
var props = ((_model$getProperties16 = model.getProperties) === null || _model$getProperties16 === void 0 ? void 0 : _model$getProperties16.call(model)) || {};
|
|
1291
|
+
var modelType = props.modelType,
|
|
1292
|
+
aiNetSearch = props.aiNetSearch,
|
|
1293
|
+
logId = props.logId,
|
|
1294
|
+
dataSetId = props.dataSetId,
|
|
1295
|
+
simpleQueryModel = props.simpleQueryModel,
|
|
1296
|
+
knowledgeTreeData = props.knowledgeTreeData,
|
|
1297
|
+
sortCriteria = props.sortCriteria,
|
|
1298
|
+
fieldSetting = props.fieldSetting,
|
|
1299
|
+
nodeFilters = props.nodeFilters,
|
|
1300
|
+
applyList = props.applyList,
|
|
1301
|
+
scriptName = props.scriptName,
|
|
1302
|
+
logList = props.logList,
|
|
1303
|
+
inputParams = props.inputParams,
|
|
1304
|
+
rootCauseNode = props.rootCauseNode,
|
|
1305
|
+
rootCauseParam = props.rootCauseParam,
|
|
1306
|
+
analysisFieldTemplate = props.analysisFieldTemplate;
|
|
1307
|
+
|
|
1308
|
+
// 类型设置
|
|
1309
|
+
setCurrentType(modelType);
|
|
1310
|
+
if (modelType !== 2 || !modelType) {
|
|
1311
|
+
setSelectLog([]);
|
|
1312
|
+
setSelections([]);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
// aiNetSearch 设置
|
|
1316
|
+
setAiNetSearch(aiNetSearch || 0);
|
|
1317
|
+
|
|
1318
|
+
// 日志相关处理
|
|
1319
|
+
if (logId && modelType != 8) {
|
|
1320
|
+
var dataSetInfo = dataSetOptions.find(function (i) {
|
|
1321
|
+
return i.value === dataSetId;
|
|
1322
|
+
});
|
|
1323
|
+
if (dataSetInfo) {
|
|
1324
|
+
if (logList) {
|
|
1325
|
+
dataSetInfo.children = logList;
|
|
1326
|
+
setDataSetOptions(_toConsumableArray(dataSetOptions));
|
|
1327
|
+
} else {
|
|
1328
|
+
if (dataSetInfo.getLogList) {
|
|
1329
|
+
dataSetInfo.getLogList({
|
|
1330
|
+
dataSetId: dataSetId,
|
|
1331
|
+
success: 3
|
|
1332
|
+
}).then(function (res) {
|
|
1333
|
+
dataSetInfo.children = res.data.map(function (item) {
|
|
1334
|
+
return {
|
|
1335
|
+
label: item.logName,
|
|
1336
|
+
value: item.logId,
|
|
1337
|
+
isLeaf: true,
|
|
1338
|
+
children: [],
|
|
1339
|
+
loading: false
|
|
1340
|
+
};
|
|
1341
|
+
});
|
|
1342
|
+
setDataSetOptions(_toConsumableArray(dataSetOptions));
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
if (!inputParams) {
|
|
1347
|
+
if (dataSetInfo.getLogFieldsData) {
|
|
1348
|
+
dataSetInfo.getLogFieldsData(logId).then(function (res) {
|
|
1349
|
+
setInputParams(generateInputParams(res.logFields));
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
} else {
|
|
1353
|
+
setInputParams(inputParams);
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
;
|
|
1357
|
+
setSelectLog([dataSetId, logId]);
|
|
1358
|
+
} else if (modelType == 8) {
|
|
1359
|
+
var _dataSetInfo = dataOptions[0];
|
|
1360
|
+
_dataSetInfo.getLogFieldsData(logId).then(function (res) {
|
|
1361
|
+
setInputParams(generateInputParams(res.logFields));
|
|
1362
|
+
});
|
|
1363
|
+
getAnalyseField({
|
|
1364
|
+
logId: logId
|
|
1365
|
+
}).then(function (res) {
|
|
1366
|
+
if (res.code === 200) {
|
|
1367
|
+
setAnalyseField(res.data);
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
// selections 设置
|
|
1373
|
+
if (simpleQueryModel !== null && simpleQueryModel !== void 0 && simpleQueryModel.selections) {
|
|
1374
|
+
var _selections = simpleQueryModel.selections;
|
|
1375
|
+
_selections = _selections.filter(function (i) {
|
|
1376
|
+
return !i.isAutoAdd;
|
|
1377
|
+
});
|
|
1378
|
+
setSelectionsOptions(_selections);
|
|
1379
|
+
setSelections(_selections.map(function (i) {
|
|
1380
|
+
return i.key;
|
|
1381
|
+
}));
|
|
1382
|
+
} else {
|
|
1383
|
+
setSelectAggList([]);
|
|
1384
|
+
setSelectionsOptions([]);
|
|
1385
|
+
setSelections([]);
|
|
1386
|
+
}
|
|
1387
|
+
if (rootCauseNode) {
|
|
1388
|
+
setRootCauseNode(rootCauseNode);
|
|
1389
|
+
} else {
|
|
1390
|
+
setRootCauseNode(undefined);
|
|
1391
|
+
}
|
|
1392
|
+
if (rootCauseParam) {
|
|
1393
|
+
setRootCauseParam(rootCauseParam);
|
|
1394
|
+
} else {
|
|
1395
|
+
setRootCauseParam([]);
|
|
1396
|
+
}
|
|
1397
|
+
if (analysisFieldTemplate) {
|
|
1398
|
+
setAnalysisFieldTemplate(analysisFieldTemplate);
|
|
1399
|
+
} else {
|
|
1400
|
+
setAnalysisFieldTemplate(undefined);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
// 树结构恢复
|
|
1404
|
+
if (Array.isArray(knowledgeTreeData)) {
|
|
1405
|
+
var loadKeys = knowledgeTreeData.filter(function (item) {
|
|
1406
|
+
return knowledgeTreeData.some(function (i) {
|
|
1407
|
+
return i.pId === item.id;
|
|
1408
|
+
});
|
|
1409
|
+
}).map(function (item) {
|
|
1410
|
+
return item.id;
|
|
1411
|
+
});
|
|
1412
|
+
setLoadedKeys(loadKeys);
|
|
1413
|
+
setTreeData(knowledgeTreeData);
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// 排序字段
|
|
1417
|
+
setSortCriteria(sortCriteria || []);
|
|
1418
|
+
|
|
1419
|
+
// 过滤器 & 应用列表
|
|
1420
|
+
setNodeFilters(nodeFilters || []);
|
|
1421
|
+
setApplyList(applyList || []);
|
|
1422
|
+
|
|
1423
|
+
// 预测模板
|
|
1424
|
+
setCurScheduleSet(props.curScheduleSet || []);
|
|
1425
|
+
|
|
1426
|
+
// 表单字段恢复逻辑
|
|
1427
|
+
var baseScriptName = scriptName || undefined;
|
|
1428
|
+
if ((_model$id = model.id) !== null && _model$id !== void 0 && _model$id.includes(t('empty_node'))) {
|
|
1429
|
+
form.setFieldsValue({
|
|
1430
|
+
script: undefined,
|
|
1431
|
+
name: baseScriptName
|
|
1432
|
+
});
|
|
1433
|
+
} else if ((model === null || model === void 0 ? void 0 : model.type) === 'NodeIteratorComponent') {
|
|
1434
|
+
var scriptInfo = scriptList.find(function (i) {
|
|
1435
|
+
return i.type === 3;
|
|
1436
|
+
});
|
|
1437
|
+
form.setFieldsValue({
|
|
1438
|
+
script: scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.scriptId,
|
|
1439
|
+
name: baseScriptName
|
|
1440
|
+
});
|
|
1441
|
+
model.setProperties(_objectSpread(_objectSpread({}, props), {}, {
|
|
1442
|
+
scriptName: baseScriptName || (scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.scriptName),
|
|
1443
|
+
modelType: scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type
|
|
1444
|
+
}));
|
|
1445
|
+
model.id = 'while';
|
|
1446
|
+
flowGraph.trigger('node:change:*');
|
|
1447
|
+
setCurrentType(scriptInfo === null || scriptInfo === void 0 ? void 0 : scriptInfo.type);
|
|
1448
|
+
} else {
|
|
1449
|
+
form.setFieldsValue({
|
|
1450
|
+
script: model === null || model === void 0 ? void 0 : model.id,
|
|
1451
|
+
name: baseScriptName
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
// 提取字段结构构造逻辑
|
|
1457
|
+
function generateInputParams(logFields) {
|
|
1458
|
+
setCaseAttrField(logFields.filter(function (log) {
|
|
1459
|
+
return log.fieldAttribute === "CASE";
|
|
1460
|
+
}).map(function (field) {
|
|
1461
|
+
return field.fieldName;
|
|
1462
|
+
}));
|
|
1463
|
+
return [{
|
|
1464
|
+
id: "case",
|
|
1465
|
+
label: "案例",
|
|
1466
|
+
icon: "el-icon-c-scale-to-original",
|
|
1467
|
+
children: [{
|
|
1468
|
+
id: "case_id",
|
|
1469
|
+
label: "案例ID",
|
|
1470
|
+
icon: "el-icon-files",
|
|
1471
|
+
type: "Standard",
|
|
1472
|
+
fieldsType: "TEXT"
|
|
1473
|
+
}, {
|
|
1474
|
+
id: "variant_id",
|
|
1475
|
+
label: "变体ID",
|
|
1476
|
+
icon: "el-icon-files",
|
|
1477
|
+
type: "Standard",
|
|
1478
|
+
fieldsType: "TEXT"
|
|
1479
|
+
}, {
|
|
1480
|
+
id: "案例状态",
|
|
1481
|
+
label: "案例状态",
|
|
1482
|
+
icon: "el-icon-files",
|
|
1483
|
+
type: "Standard",
|
|
1484
|
+
fieldsType: "TEXT"
|
|
1485
|
+
}, {
|
|
1486
|
+
id: "p_start_time",
|
|
1487
|
+
label: "案例开始时间",
|
|
1488
|
+
icon: "el-icon-date",
|
|
1489
|
+
type: "Distribution",
|
|
1490
|
+
fieldsType: "TIME"
|
|
1491
|
+
}, {
|
|
1492
|
+
id: "p_cycle_time",
|
|
1493
|
+
label: "案例持续时间",
|
|
1494
|
+
icon: "el-icon-files",
|
|
1495
|
+
type: "Standard",
|
|
1496
|
+
fieldsType: "TIME TANG"
|
|
1497
|
+
}, {
|
|
1498
|
+
id: "pnum",
|
|
1499
|
+
label: "案例数",
|
|
1500
|
+
icon: "el-icon-files",
|
|
1501
|
+
type: "Standard",
|
|
1502
|
+
fieldsType: "INT"
|
|
1503
|
+
}, {
|
|
1504
|
+
id: "p_end_time",
|
|
1505
|
+
label: "案例结束时间",
|
|
1506
|
+
icon: "el-icon-date",
|
|
1507
|
+
type: "Distribution",
|
|
1508
|
+
fieldsType: "TIME"
|
|
1509
|
+
}, {
|
|
1510
|
+
id: "activity_per_process_num",
|
|
1511
|
+
label: "每个案例的活动数",
|
|
1512
|
+
icon: "el-icon-files",
|
|
1513
|
+
type: "Standard",
|
|
1514
|
+
fieldsType: "INT"
|
|
1515
|
+
}, {
|
|
1516
|
+
id: "connections_per_process_num",
|
|
1517
|
+
label: "每个案例的连接数",
|
|
1518
|
+
icon: "el-icon-files",
|
|
1519
|
+
type: "Standard",
|
|
1520
|
+
fieldsType: "INT"
|
|
1521
|
+
}]
|
|
1522
|
+
}, {
|
|
1523
|
+
id: "activity",
|
|
1524
|
+
label: "活动",
|
|
1525
|
+
icon: "el-icon-c-scale-to-original",
|
|
1526
|
+
children: [{
|
|
1527
|
+
id: "activity_name",
|
|
1528
|
+
label: "活动名称",
|
|
1529
|
+
icon: "el-icon-files",
|
|
1530
|
+
type: "Standard",
|
|
1531
|
+
fieldsType: "TEXT"
|
|
1532
|
+
}, {
|
|
1533
|
+
id: "start_time",
|
|
1534
|
+
label: "活动开始时间",
|
|
1535
|
+
icon: "el-icon-date",
|
|
1536
|
+
type: "Distribution",
|
|
1537
|
+
fieldsType: "TIME"
|
|
1538
|
+
}, {
|
|
1539
|
+
id: "a_occurrence",
|
|
1540
|
+
label: "出现次数",
|
|
1541
|
+
icon: "el-icon-files",
|
|
1542
|
+
type: "Standard",
|
|
1543
|
+
fieldsType: "INT"
|
|
1544
|
+
}, {
|
|
1545
|
+
id: "startnum",
|
|
1546
|
+
label: "开始活动数",
|
|
1547
|
+
icon: "el-icon-files",
|
|
1548
|
+
type: "Standard",
|
|
1549
|
+
fieldsType: "INT"
|
|
1550
|
+
}, {
|
|
1551
|
+
id: "a_cycle_time",
|
|
1552
|
+
label: "活动周期时间",
|
|
1553
|
+
icon: "el-icon-files",
|
|
1554
|
+
type: "Standard",
|
|
1555
|
+
fieldsType: "TIME TANG"
|
|
1556
|
+
}, {
|
|
1557
|
+
id: "a_processing_time",
|
|
1558
|
+
label: "活动持续时间",
|
|
1559
|
+
icon: "el-icon-files",
|
|
1560
|
+
type: "Standard",
|
|
1561
|
+
fieldsType: "TIME TANG"
|
|
1562
|
+
}, {
|
|
1563
|
+
id: "fnum",
|
|
1564
|
+
label: "活动数",
|
|
1565
|
+
icon: "el-icon-files",
|
|
1566
|
+
type: "Standard",
|
|
1567
|
+
fieldsType: "INT"
|
|
1568
|
+
}, {
|
|
1569
|
+
id: "a_wait_time",
|
|
1570
|
+
label: "活动等待时间",
|
|
1571
|
+
icon: "el-icon-files",
|
|
1572
|
+
type: "Standard",
|
|
1573
|
+
fieldsType: "TIME TANG"
|
|
1574
|
+
}, {
|
|
1575
|
+
id: "end_time",
|
|
1576
|
+
label: "活动结束时间",
|
|
1577
|
+
icon: "el-icon-date",
|
|
1578
|
+
type: "Distribution",
|
|
1579
|
+
fieldsType: "TIME"
|
|
1580
|
+
}, {
|
|
1581
|
+
id: "endnum",
|
|
1582
|
+
label: "结束活动数",
|
|
1583
|
+
icon: "el-icon-files",
|
|
1584
|
+
type: "Standard",
|
|
1585
|
+
fieldsType: "INT"
|
|
1586
|
+
}]
|
|
1587
|
+
}, {
|
|
1588
|
+
id: 21,
|
|
1589
|
+
label: "日志字段",
|
|
1590
|
+
icon: "el-icon-c-scale-to-original",
|
|
1591
|
+
children: logFields.filter(function (log) {
|
|
1592
|
+
return log.fieldType !== "TYPE_INDEX";
|
|
1593
|
+
}).map(function (item) {
|
|
1594
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
1595
|
+
id: item.fieldName || "",
|
|
1596
|
+
label: item.fieldName || "",
|
|
1597
|
+
icon: "el-icon-files",
|
|
1598
|
+
type: item.type === "TIME" ? "Distribution" : "Standard",
|
|
1599
|
+
fieldsType: item.type,
|
|
1600
|
+
category: getFieldCategory(item.type)
|
|
1601
|
+
});
|
|
1602
|
+
})
|
|
1603
|
+
}, {
|
|
1604
|
+
id: "连接",
|
|
1605
|
+
label: "连接",
|
|
1606
|
+
icon: "el-icon-c-scale-to-original",
|
|
1607
|
+
children: [{
|
|
1608
|
+
id: "c_occurrence",
|
|
1609
|
+
label: "出现次数",
|
|
1610
|
+
icon: "el-icon-files",
|
|
1611
|
+
type: "Standard",
|
|
1612
|
+
fieldsType: "INT"
|
|
1613
|
+
}, {
|
|
1614
|
+
id: "from_name",
|
|
1615
|
+
label: "自(活动)",
|
|
1616
|
+
icon: "el-icon-files",
|
|
1617
|
+
type: "Standard",
|
|
1618
|
+
fieldsType: "TEXT"
|
|
1619
|
+
}, {
|
|
1620
|
+
id: "to_name",
|
|
1621
|
+
label: "至(活动)",
|
|
1622
|
+
icon: "el-icon-files",
|
|
1623
|
+
type: "Standard",
|
|
1624
|
+
fieldsType: "TEXT"
|
|
1625
|
+
}, {
|
|
1626
|
+
id: "c_cycle_time",
|
|
1627
|
+
label: "连接持续时间",
|
|
1628
|
+
icon: "el-icon-files",
|
|
1629
|
+
type: "Standard",
|
|
1630
|
+
fieldsType: "TIME TANG"
|
|
1631
|
+
}, {
|
|
1632
|
+
id: "cnum",
|
|
1633
|
+
label: "连接数",
|
|
1634
|
+
icon: "el-icon-files",
|
|
1635
|
+
type: "Standard",
|
|
1636
|
+
fieldsType: "INT"
|
|
1637
|
+
}]
|
|
1638
|
+
}, {
|
|
1639
|
+
id: "preset",
|
|
1640
|
+
label: "自定义",
|
|
1641
|
+
icon: "el-icon-news",
|
|
1642
|
+
children: logFields.filter(function (log) {
|
|
1643
|
+
return log.id && !log.aggType;
|
|
1644
|
+
}).map(function (item) {
|
|
1645
|
+
return {
|
|
1646
|
+
id: item.fieldName ? item.fieldName : "",
|
|
1647
|
+
label: item.fieldName ? item.fieldName : "",
|
|
1648
|
+
icon: item.type === "TIME" ? "el-icon-date" : "el-icon-files",
|
|
1649
|
+
type: item.type === "TIME" ? "Distribution" : "Standard",
|
|
1650
|
+
fieldsType: item.type,
|
|
1651
|
+
fieldsId: item.id,
|
|
1652
|
+
aggType: item.aggType,
|
|
1653
|
+
targetValue: item.targetValue
|
|
1654
|
+
};
|
|
1655
|
+
})
|
|
1656
|
+
}];
|
|
1657
|
+
}
|
|
1658
|
+
function getFieldCategory(type) {
|
|
1659
|
+
if (type === "TEXT") return "ValueFilter";
|
|
1660
|
+
if (["DOUBLE", "INT", "TIME", "TIME TANG"].includes(type)) return "RangeFilter";
|
|
1661
|
+
return "";
|
|
1662
|
+
}
|
|
1663
|
+
var updateSimpleQuery = /*#__PURE__*/function () {
|
|
1664
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
1665
|
+
var _model$getProperties17, _model$getProperties18, _model$getProperties19, _model$getProperties23, _model$getProperties24;
|
|
1666
|
+
var outputParams, _model$getProperties20, _model$getProperties21, _model$getProperties22, _yield$getCompliance, complianceList, _yield$getApplyFlow, applyFlowList, noUseChainParamFilters, selectionsData;
|
|
1667
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1668
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1669
|
+
case 0:
|
|
1670
|
+
outputParams = []; // console.log(model.getProperties()?.modelType, 'modelType');
|
|
1671
|
+
if (!(((_model$getProperties17 = model.getProperties()) === null || _model$getProperties17 === void 0 ? void 0 : _model$getProperties17.modelType) == 4 && inputList.every(function (item) {
|
|
1672
|
+
return item.value;
|
|
1673
|
+
}))) {
|
|
1674
|
+
_context3.next = 5;
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
outputParams = [].concat(_toConsumableArray(selectionsOptions), _toConsumableArray(selectAggList), [{
|
|
1678
|
+
label: 'AI结果',
|
|
1679
|
+
type: 'string',
|
|
1680
|
+
asColumn: '*',
|
|
1681
|
+
key: '*',
|
|
1682
|
+
id: '*'
|
|
1683
|
+
}]);
|
|
1684
|
+
_context3.next = 27;
|
|
1685
|
+
break;
|
|
1686
|
+
case 5:
|
|
1687
|
+
if (!(((_model$getProperties18 = model.getProperties()) === null || _model$getProperties18 === void 0 ? void 0 : _model$getProperties18.modelType) == 6 || ((_model$getProperties19 = model.getProperties()) === null || _model$getProperties19 === void 0 ? void 0 : _model$getProperties19.modelType) == 7)) {
|
|
1688
|
+
_context3.next = 26;
|
|
1689
|
+
break;
|
|
1690
|
+
}
|
|
1691
|
+
applyList.forEach(function (item) {
|
|
1692
|
+
if (item.selects) {
|
|
1693
|
+
outputParams.push({
|
|
1694
|
+
label: item.indexName,
|
|
1695
|
+
type: 'string',
|
|
1696
|
+
asColumn: "".concat(item.indexName, "-*"),
|
|
1697
|
+
key: "".concat(item.indexName, "-*"),
|
|
1698
|
+
id: "".concat(item.indexName, "-*")
|
|
1699
|
+
});
|
|
1700
|
+
JSON.parse(item.selects).forEach(function (i) {
|
|
1701
|
+
outputParams.push({
|
|
1702
|
+
label: "".concat(item.indexName, "-").concat(i.split('@@')[0]),
|
|
1703
|
+
type: 'string',
|
|
1704
|
+
asColumn: "".concat(item.indexName, "-").concat(i.split('@@')[1]),
|
|
1705
|
+
key: "".concat(item.indexName, "-").concat(i.split('@@')[1]),
|
|
1706
|
+
id: "".concat(item.indexName, "-").concat(i.split('@@')[1])
|
|
1707
|
+
});
|
|
1708
|
+
});
|
|
1709
|
+
} else {
|
|
1710
|
+
outputParams.push({
|
|
1711
|
+
label: item.indexName,
|
|
1712
|
+
type: 'string',
|
|
1713
|
+
asColumn: "".concat(item.indexName, "-*"),
|
|
1714
|
+
key: "".concat(item.indexName, "-*"),
|
|
1715
|
+
id: "".concat(item.indexName, "-*")
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
});
|
|
1719
|
+
if (!(applyList.length && applyList[0].applyName === '一致性合规性' && (_model$getProperties20 = model.getProperties()) !== null && _model$getProperties20 !== void 0 && _model$getProperties20.logId)) {
|
|
1720
|
+
_context3.next = 24;
|
|
1721
|
+
break;
|
|
1722
|
+
}
|
|
1723
|
+
_context3.prev = 8;
|
|
1724
|
+
_context3.next = 11;
|
|
1725
|
+
return getCompliance({
|
|
1726
|
+
logId: (_model$getProperties21 = model.getProperties()) === null || _model$getProperties21 === void 0 ? void 0 : _model$getProperties21.logId
|
|
1727
|
+
});
|
|
1728
|
+
case 11:
|
|
1729
|
+
_yield$getCompliance = _context3.sent;
|
|
1730
|
+
complianceList = _yield$getCompliance.data;
|
|
1731
|
+
_context3.next = 15;
|
|
1732
|
+
return getApplyFlow({
|
|
1733
|
+
id: (_model$getProperties22 = model.getProperties()) === null || _model$getProperties22 === void 0 ? void 0 : _model$getProperties22.logId
|
|
1734
|
+
});
|
|
1735
|
+
case 15:
|
|
1736
|
+
_yield$getApplyFlow = _context3.sent;
|
|
1737
|
+
applyFlowList = _yield$getApplyFlow.data;
|
|
1738
|
+
if (!complianceList.length) {
|
|
1739
|
+
outputParams.forEach(function (i, index) {
|
|
1740
|
+
if (index <= 12) {
|
|
1741
|
+
i.disabled = true;
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
} else {
|
|
1745
|
+
outputParams.forEach(function (i, index) {
|
|
1746
|
+
if (index <= 12) {
|
|
1747
|
+
i.disabled = false;
|
|
1748
|
+
}
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
if (!applyFlowList.length) {
|
|
1752
|
+
outputParams.forEach(function (i, index) {
|
|
1753
|
+
if (index > 12) {
|
|
1754
|
+
i.disabled = true;
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1757
|
+
} else {
|
|
1758
|
+
outputParams.forEach(function (i, index) {
|
|
1759
|
+
if (index > 12) {
|
|
1760
|
+
i.disabled = false;
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
_context3.next = 24;
|
|
1765
|
+
break;
|
|
1766
|
+
case 21:
|
|
1767
|
+
_context3.prev = 21;
|
|
1768
|
+
_context3.t0 = _context3["catch"](8);
|
|
1769
|
+
console.log(_context3.t0);
|
|
1770
|
+
case 24:
|
|
1771
|
+
_context3.next = 27;
|
|
1772
|
+
break;
|
|
1773
|
+
case 26:
|
|
1774
|
+
if (((_model$getProperties23 = model.getProperties()) === null || _model$getProperties23 === void 0 ? void 0 : _model$getProperties23.modelType) == 8) {
|
|
1775
|
+
outputParams = [{
|
|
1776
|
+
label: '根因分析结果',
|
|
1777
|
+
type: 'string',
|
|
1778
|
+
asColumn: '*',
|
|
1779
|
+
key: '*',
|
|
1780
|
+
id: '*'
|
|
1781
|
+
}];
|
|
1782
|
+
} else {
|
|
1783
|
+
outputParams = [].concat(_toConsumableArray(selectionsOptions), _toConsumableArray(selectAggList));
|
|
1784
|
+
}
|
|
1785
|
+
case 27:
|
|
1786
|
+
noUseChainParamFilters = [];
|
|
1787
|
+
nodeFilters.forEach(function (item) {
|
|
1788
|
+
if (item.type == 'ActivityFilter' || item.type == 'PathFilter' || item.type == 'ReworkFilter') return noUseChainParamFilters.push(item);
|
|
1789
|
+
if (!item.filters && (item.type == "ValueFilter" || item.type == "FuzzyFilter") && !item.values.includes("useChainParam")) {
|
|
1790
|
+
noUseChainParamFilters.push(item);
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
if (item.filters && item.filters.length > 0) {
|
|
1794
|
+
if (item.filters[0].unitSelList && !item.filters[0].unitSelList.includes("chain")) {
|
|
1795
|
+
noUseChainParamFilters.push(item);
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
if (typeof item.filters[0].from.value === 'string' && !item.filters[0].from.value.includes('~~~') && typeof item.filters[0].to.value === 'string' && !item.filters[0].to.value.includes('~~~')) {
|
|
1799
|
+
noUseChainParamFilters.push(item);
|
|
1800
|
+
return;
|
|
1801
|
+
}
|
|
1802
|
+
if (typeof item.filters[0].from.value === 'number' && typeof item.filters[0].to.value === 'number') {
|
|
1803
|
+
noUseChainParamFilters.push(item);
|
|
1804
|
+
return;
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
selectionsData = _toConsumableArray(selectionsOptions);
|
|
1809
|
+
if (((_model$getProperties24 = model.getProperties()) === null || _model$getProperties24 === void 0 ? void 0 : _model$getProperties24.modelType) == 8 && selectionsData.length && selectionsData.every(function (i) {
|
|
1810
|
+
return i.key !== 'case_id';
|
|
1811
|
+
})) {
|
|
1812
|
+
selectionsData.push({
|
|
1813
|
+
"fieldsType": "TEXT",
|
|
1814
|
+
"label": "案例ID",
|
|
1815
|
+
"type": "Standard",
|
|
1816
|
+
"asColumn": "case_id",
|
|
1817
|
+
"id": "case_id",
|
|
1818
|
+
"key": "case_id",
|
|
1819
|
+
"config": {},
|
|
1820
|
+
"isAutoAdd": true
|
|
1821
|
+
});
|
|
1822
|
+
}
|
|
1823
|
+
;
|
|
1824
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties() ? model.getProperties() : {}), {}, {
|
|
1825
|
+
outputParams: outputParams,
|
|
1826
|
+
simpleQueryModel: {
|
|
1827
|
+
selections: selectionsData,
|
|
1828
|
+
filterList: {
|
|
1829
|
+
filters: noUseChainParamFilters,
|
|
1830
|
+
mode: "AND",
|
|
1831
|
+
type: "FilterList"
|
|
1832
|
+
},
|
|
1833
|
+
runMode: true,
|
|
1834
|
+
size: 1000,
|
|
1835
|
+
sortCriteria: sortCriteria
|
|
1836
|
+
}
|
|
1837
|
+
}));
|
|
1838
|
+
setCurrentModelProperties();
|
|
1839
|
+
setThenProperties();
|
|
1840
|
+
flowGraph.trigger('node:change:*');
|
|
1841
|
+
case 36:
|
|
1842
|
+
case "end":
|
|
1843
|
+
return _context3.stop();
|
|
1844
|
+
}
|
|
1845
|
+
}, _callee3, null, [[8, 21]]);
|
|
1846
|
+
}));
|
|
1847
|
+
return function updateSimpleQuery() {
|
|
1848
|
+
return _ref4.apply(this, arguments);
|
|
1849
|
+
};
|
|
1850
|
+
}();
|
|
1851
|
+
useEffect(function () {
|
|
1852
|
+
var _model$getProperties25;
|
|
1853
|
+
if (!filtersInfo.length) return;
|
|
1854
|
+
var newNodeFilters = [].concat(_toConsumableArray(nodeFilters), _toConsumableArray(filtersInfo));
|
|
1855
|
+
|
|
1856
|
+
// 过滤出需要用链参数处理的过滤器
|
|
1857
|
+
var useChainParamFilters = newNodeFilters.filter(function (item) {
|
|
1858
|
+
var _item$filters, _item$filters2, _item$filters3;
|
|
1859
|
+
if (['ActivityFilter', 'PathFilter', 'ReworkFilter'].includes(item.type)) return false;
|
|
1860
|
+
if (!item.filters && (item.type === 'ValueFilter' || item.type === 'FuzzyFilter') && item.values.includes('useChainParam')) return true;
|
|
1861
|
+
if ((_item$filters = item.filters) !== null && _item$filters !== void 0 && (_item$filters = _item$filters[0]) !== null && _item$filters !== void 0 && (_item$filters = _item$filters.unitSelList) !== null && _item$filters !== void 0 && _item$filters.includes('chain')) return true;
|
|
1862
|
+
var fromVal = (_item$filters2 = item.filters) === null || _item$filters2 === void 0 || (_item$filters2 = _item$filters2[0]) === null || _item$filters2 === void 0 || (_item$filters2 = _item$filters2.from) === null || _item$filters2 === void 0 ? void 0 : _item$filters2.value;
|
|
1863
|
+
var toVal = (_item$filters3 = item.filters) === null || _item$filters3 === void 0 || (_item$filters3 = _item$filters3[0]) === null || _item$filters3 === void 0 || (_item$filters3 = _item$filters3.to) === null || _item$filters3 === void 0 ? void 0 : _item$filters3.value;
|
|
1864
|
+
return [fromVal, toVal].some(function (v) {
|
|
1865
|
+
return typeof v === 'string' && v.includes('~~~');
|
|
1866
|
+
});
|
|
1867
|
+
}).map(function (item) {
|
|
1868
|
+
return JSON.parse(JSON.stringify(item));
|
|
1869
|
+
}); // 深拷贝,建议用 lodash.cloneDeep
|
|
1870
|
+
|
|
1871
|
+
var filterParam = [];
|
|
1872
|
+
|
|
1873
|
+
// 工具:提取花括号内内容
|
|
1874
|
+
var extractBracedContent = function extractBracedContent(str) {
|
|
1875
|
+
var regex = /{{([^{}]+)}}/g;
|
|
1876
|
+
var result = [];
|
|
1877
|
+
var match;
|
|
1878
|
+
while ((match = regex.exec(str)) !== null) {
|
|
1879
|
+
result.push(match[1]);
|
|
1880
|
+
}
|
|
1881
|
+
return result;
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
// 工具:提取括号内文本
|
|
1885
|
+
var extractTextInParentheses = function extractTextInParentheses(str) {
|
|
1886
|
+
var match = str.match(/\(([^)]+)\)/);
|
|
1887
|
+
return match ? match[1] : '';
|
|
1888
|
+
};
|
|
1889
|
+
|
|
1890
|
+
// 工具:解析模板中的前缀和字段
|
|
1891
|
+
var extractInfo = function extractInfo(raw) {
|
|
1892
|
+
var value = extractBracedContent(raw)[0];
|
|
1893
|
+
var _value$split = value.split('~~~'),
|
|
1894
|
+
_value$split2 = _slicedToArray(_value$split, 2),
|
|
1895
|
+
prefix = _value$split2[0],
|
|
1896
|
+
fieldExpr = _value$split2[1];
|
|
1897
|
+
var field;
|
|
1898
|
+
if (prefix !== 'work') {
|
|
1899
|
+
field = fieldExpr;
|
|
1900
|
+
} else {
|
|
1901
|
+
field = extractTextInParentheses(fieldExpr);
|
|
1902
|
+
}
|
|
1903
|
+
return {
|
|
1904
|
+
prefix: prefix,
|
|
1905
|
+
field: field
|
|
1906
|
+
};
|
|
1907
|
+
};
|
|
1908
|
+
useChainParamFilters.forEach(function (item) {
|
|
1909
|
+
var _item$filters4, _filter$from, _filter$to;
|
|
1910
|
+
var typedObj = {};
|
|
1911
|
+
|
|
1912
|
+
// 用于构建参数占位符和对应对象
|
|
1913
|
+
var buildParam = function buildParam(prefix, field, type, attr) {
|
|
1914
|
+
var key = "".concat(prefix, "-").concat(attr || field);
|
|
1915
|
+
typedObj[key] = JSON.stringify(_objectSpread({
|
|
1916
|
+
value: "".concat(prefix, "@@").concat(field),
|
|
1917
|
+
type: type
|
|
1918
|
+
}, attr ? {
|
|
1919
|
+
attribute: attr
|
|
1920
|
+
} : {}));
|
|
1921
|
+
return "{{".concat(key, "}}");
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1924
|
+
// 情况 1: 无 filters 且为 ValueFilter
|
|
1925
|
+
if (!item.filters && (item.type === 'ValueFilter' || item.type === 'FuzzyFilter')) {
|
|
1926
|
+
var _extractInfo = extractInfo(item.values[0]),
|
|
1927
|
+
prefix = _extractInfo.prefix,
|
|
1928
|
+
field = _extractInfo.field;
|
|
1929
|
+
item.values = [buildParam(prefix === 'work' ? 'initialize' : prefix, field, item.values[2])];
|
|
1930
|
+
filterParam.push({
|
|
1931
|
+
filter: JSON.stringify(item),
|
|
1932
|
+
param: typedObj
|
|
1933
|
+
});
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
var filter = (_item$filters4 = item.filters) === null || _item$filters4 === void 0 ? void 0 : _item$filters4[0];
|
|
1937
|
+
if (!filter) return;
|
|
1938
|
+
var fieldName = filter.field || 'unknown'; // 真实字段名
|
|
1939
|
+
|
|
1940
|
+
// 情况 2: filters[0] 含 unitSelList 且含 chain
|
|
1941
|
+
if (filter.unitSelList) {
|
|
1942
|
+
filter.unitSelList.forEach(function (unit, index) {
|
|
1943
|
+
if (unit !== 'chain') return;
|
|
1944
|
+
var target = index === 0 ? filter.from : filter.to;
|
|
1945
|
+
var _extractInfo2 = extractInfo(target.value),
|
|
1946
|
+
prefix = _extractInfo2.prefix;
|
|
1947
|
+
var type = getFieldType(fieldName);
|
|
1948
|
+
target.value = buildParam(prefix === 'work' ? 'initialize' : prefix, fieldName, type === 'TimeSpan' ? 'time' : 'number', index === 0 ? 'from' : 'to');
|
|
1949
|
+
});
|
|
1950
|
+
filterParam.push({
|
|
1951
|
+
filter: JSON.stringify(item),
|
|
1952
|
+
param: typedObj
|
|
1953
|
+
});
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
// 情况 3/4: 处理 from/to 模板变量
|
|
1958
|
+
var fromVal = (_filter$from = filter.from) === null || _filter$from === void 0 ? void 0 : _filter$from.value;
|
|
1959
|
+
var toVal = (_filter$to = filter.to) === null || _filter$to === void 0 ? void 0 : _filter$to.value;
|
|
1960
|
+
var isTemplate = function isTemplate(v) {
|
|
1961
|
+
return typeof v === 'string' && v.includes('~~~');
|
|
1962
|
+
};
|
|
1963
|
+
if (isTemplate(fromVal)) {
|
|
1964
|
+
var _extractInfo3 = extractInfo(fromVal),
|
|
1965
|
+
_prefix = _extractInfo3.prefix;
|
|
1966
|
+
filter.from.value = buildParam(_prefix === 'work' ? 'initialize' : _prefix, fieldName, 'time', 'from');
|
|
1967
|
+
}
|
|
1968
|
+
if (isTemplate(toVal)) {
|
|
1969
|
+
var _extractInfo4 = extractInfo(toVal),
|
|
1970
|
+
_prefix2 = _extractInfo4.prefix;
|
|
1971
|
+
filter.to.value = buildParam(_prefix2 === 'work' ? 'initialize' : _prefix2, fieldName, 'time', 'to');
|
|
1972
|
+
}
|
|
1973
|
+
filterParam.push({
|
|
1974
|
+
filter: JSON.stringify(item),
|
|
1975
|
+
param: typedObj
|
|
1976
|
+
});
|
|
1977
|
+
});
|
|
1978
|
+
model.setProperties(_objectSpread(_objectSpread({}, ((_model$getProperties25 = model.getProperties) === null || _model$getProperties25 === void 0 ? void 0 : _model$getProperties25.call(model)) || {}), {}, {
|
|
1979
|
+
nodeFilters: newNodeFilters,
|
|
1980
|
+
filterParam: JSON.stringify(filterParam)
|
|
1981
|
+
}));
|
|
1982
|
+
setCurrentModelProperties();
|
|
1983
|
+
setThenProperties();
|
|
1984
|
+
setNodeFilters(newNodeFilters);
|
|
1985
|
+
}, [filtersInfo]);
|
|
1986
|
+
useUpdateEffect(function () {
|
|
1987
|
+
if (!chainCurComponent.propValue) return;
|
|
1988
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties()), {}, {
|
|
1989
|
+
propValue: chainCurComponent.propValue
|
|
1990
|
+
}));
|
|
1991
|
+
var selections = chainCurComponent.propValue.chartInfo.data.condition;
|
|
1992
|
+
var sortCriteria = chainCurComponent.propValue.chartInfo.data.sortCriteria;
|
|
1993
|
+
setSelections(selections.map(function (i) {
|
|
1994
|
+
return i.asColumn;
|
|
1995
|
+
}));
|
|
1996
|
+
setSelectionsOptions(selections);
|
|
1997
|
+
setSortCriteria(sortCriteria);
|
|
1998
|
+
}, [changeIndex]);
|
|
1999
|
+
useUpdateEffect(function () {
|
|
2000
|
+
var getLogFieldsData = dataSetOptions[0].getLogFieldsData;
|
|
2001
|
+
if (!getLogFieldsData) return;
|
|
2002
|
+
getLogFieldsData(model.getProperties().logId).then(function (res) {
|
|
2003
|
+
if (res.status === 'success') {
|
|
2004
|
+
setInputParams(generateInputParams(res.logFields));
|
|
2005
|
+
handleQueryConfig(generateInputParams(res.logFields));
|
|
2006
|
+
}
|
|
2007
|
+
});
|
|
2008
|
+
}, [changeLogIndex]);
|
|
2009
|
+
useEffect(function () {
|
|
2010
|
+
var newNodeFilters = _toConsumableArray(nodeFilters);
|
|
2011
|
+
var filterParam = [];
|
|
2012
|
+
var useChainParamFilters = [];
|
|
2013
|
+
|
|
2014
|
+
// 工具:提取花括号内内容
|
|
2015
|
+
var extractBracedContent = function extractBracedContent(str) {
|
|
2016
|
+
var regex = /{{([^{}]+)}}/g;
|
|
2017
|
+
var result = [];
|
|
2018
|
+
var match;
|
|
2019
|
+
while ((match = regex.exec(str)) !== null) {
|
|
2020
|
+
result.push(match[1]);
|
|
2021
|
+
}
|
|
2022
|
+
return result;
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
// 工具:提取括号内文本
|
|
2026
|
+
var extractTextInParentheses = function extractTextInParentheses(str) {
|
|
2027
|
+
var match = str.match(/\(([^)]+)\)/);
|
|
2028
|
+
return match ? match[1] : '';
|
|
2029
|
+
};
|
|
2030
|
+
|
|
2031
|
+
// 工具:解析模板中的前缀和字段
|
|
2032
|
+
var extractInfo = function extractInfo(raw) {
|
|
2033
|
+
var value = extractBracedContent(raw)[0];
|
|
2034
|
+
var _value$split3 = value.split('~~~'),
|
|
2035
|
+
_value$split4 = _slicedToArray(_value$split3, 2),
|
|
2036
|
+
prefix = _value$split4[0],
|
|
2037
|
+
fieldExpr = _value$split4[1];
|
|
2038
|
+
var field;
|
|
2039
|
+
if (prefix !== 'work') {
|
|
2040
|
+
field = fieldExpr;
|
|
2041
|
+
} else {
|
|
2042
|
+
field = extractTextInParentheses(fieldExpr);
|
|
2043
|
+
}
|
|
2044
|
+
return {
|
|
2045
|
+
prefix: prefix,
|
|
2046
|
+
field: field,
|
|
2047
|
+
raw: value
|
|
2048
|
+
};
|
|
2049
|
+
};
|
|
2050
|
+
newNodeFilters.forEach(function (item) {
|
|
2051
|
+
if (item.type == 'ActivityFilter' || item.type == 'PathFilter' || item.type == 'ReworkFilter') return;
|
|
2052
|
+
if (!item.filters && (item.type == "ValueFilter" || item.type == "FuzzyFilter") && item.values.includes("useChainParam")) {
|
|
2053
|
+
useChainParamFilters.push(item);
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
if (item.filters && item.filters.length > 0) {
|
|
2057
|
+
if (item.filters[0].unitSelList && item.filters[0].unitSelList.includes("chain")) {
|
|
2058
|
+
useChainParamFilters.push(item);
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
2061
|
+
if (typeof item.filters[0].from.value === 'string' && item.filters[0].from.value.includes('~~~') || typeof item.filters[0].to.value === 'string' && item.filters[0].to.value.includes('~~~')) {
|
|
2062
|
+
useChainParamFilters.push(item);
|
|
2063
|
+
return;
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2067
|
+
useChainParamFilters = JSON.parse(JSON.stringify(useChainParamFilters));
|
|
2068
|
+
if (useChainParamFilters.length > 0) {
|
|
2069
|
+
useChainParamFilters.forEach(function (item) {
|
|
2070
|
+
var _item$filters5;
|
|
2071
|
+
var typedObj = {};
|
|
2072
|
+
var buildParam = function buildParam(prefix, field, type, attr) {
|
|
2073
|
+
var key = "".concat(prefix, "-").concat(attr || field);
|
|
2074
|
+
typedObj[key] = JSON.stringify(_objectSpread({
|
|
2075
|
+
value: "".concat(prefix, "@@").concat(field),
|
|
2076
|
+
type: type
|
|
2077
|
+
}, attr ? {
|
|
2078
|
+
attribute: attr
|
|
2079
|
+
} : {}));
|
|
2080
|
+
return "{{".concat(key, "}}");
|
|
2081
|
+
};
|
|
2082
|
+
var pushResult = function pushResult() {
|
|
2083
|
+
filterParam.push({
|
|
2084
|
+
filter: JSON.stringify(item),
|
|
2085
|
+
param: typedObj
|
|
2086
|
+
});
|
|
2087
|
+
};
|
|
2088
|
+
|
|
2089
|
+
// 情况 1: 无 filters 且为 ValueFilter
|
|
2090
|
+
if (!item.filters && (item.type === "ValueFilter" || item.type === "FuzzyFilter")) {
|
|
2091
|
+
var _extractInfo5 = extractInfo(item.values[0]),
|
|
2092
|
+
prefix = _extractInfo5.prefix,
|
|
2093
|
+
field = _extractInfo5.field;
|
|
2094
|
+
item.values = [buildParam(prefix === 'work' ? 'initialize' : prefix, field, item.values[2])];
|
|
2095
|
+
pushResult();
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
var filter = (_item$filters5 = item.filters) === null || _item$filters5 === void 0 ? void 0 : _item$filters5[0];
|
|
2099
|
+
if (!filter) return;
|
|
2100
|
+
|
|
2101
|
+
// 情况 2: filters[0] 含 unitSelList 且含 chain
|
|
2102
|
+
if (filter.unitSelList) {
|
|
2103
|
+
filter.unitSelList.forEach(function (unit, index) {
|
|
2104
|
+
if (unit !== 'chain') return;
|
|
2105
|
+
var target = index === 0 ? filter.from : filter.to;
|
|
2106
|
+
var _extractInfo6 = extractInfo(target.value),
|
|
2107
|
+
prefix = _extractInfo6.prefix,
|
|
2108
|
+
field = _extractInfo6.field;
|
|
2109
|
+
var type = getFieldType(field);
|
|
2110
|
+
target.value = buildParam(prefix === 'work' ? 'initialize' : prefix, field, type === 'TimeSpan' ? 'time' : 'number', index === 0 ? 'from' : 'to');
|
|
2111
|
+
});
|
|
2112
|
+
pushResult();
|
|
2113
|
+
return;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
// 情况 3: 纯 from 和 to,包含 ~~~ 的情况处理
|
|
2117
|
+
var fromVal = filter.from.value;
|
|
2118
|
+
var toVal = filter.to.value;
|
|
2119
|
+
var isTemplate = function isTemplate(v) {
|
|
2120
|
+
return typeof v === 'string' && v.includes('~~~');
|
|
2121
|
+
};
|
|
2122
|
+
if (isTemplate(fromVal) && isTemplate(toVal)) {
|
|
2123
|
+
var _extractInfo7 = extractInfo(fromVal),
|
|
2124
|
+
fp = _extractInfo7.prefix,
|
|
2125
|
+
ff = _extractInfo7.field;
|
|
2126
|
+
var _extractInfo8 = extractInfo(toVal),
|
|
2127
|
+
tp = _extractInfo8.prefix,
|
|
2128
|
+
tf = _extractInfo8.field;
|
|
2129
|
+
filter.from.value = buildParam(fp === 'work' ? 'initialize' : fp, ff, 'time', 'from');
|
|
2130
|
+
filter.to.value = buildParam(tp === 'work' ? 'initialize' : tp, tf, 'time', 'to');
|
|
2131
|
+
pushResult();
|
|
2132
|
+
return;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
// 情况 4: 只有 from 或 to 是模板
|
|
2136
|
+
if (isTemplate(fromVal)) {
|
|
2137
|
+
var _extractInfo9 = extractInfo(fromVal),
|
|
2138
|
+
_prefix3 = _extractInfo9.prefix,
|
|
2139
|
+
_field = _extractInfo9.field;
|
|
2140
|
+
filter.from.value = buildParam(_prefix3 === 'work' ? 'initialize' : _prefix3, _field, 'time', 'from');
|
|
2141
|
+
pushResult();
|
|
2142
|
+
return;
|
|
2143
|
+
}
|
|
2144
|
+
if (isTemplate(toVal)) {
|
|
2145
|
+
var _extractInfo10 = extractInfo(toVal),
|
|
2146
|
+
_prefix4 = _extractInfo10.prefix,
|
|
2147
|
+
_field2 = _extractInfo10.field;
|
|
2148
|
+
filter.to.value = buildParam(_prefix4 === 'work' ? 'initialize' : _prefix4, _field2, 'time', 'to');
|
|
2149
|
+
pushResult();
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties ? model.getProperties() : {}), {}, {
|
|
2155
|
+
filterParam: JSON.stringify(filterParam)
|
|
2156
|
+
}));
|
|
2157
|
+
setCurrentModelProperties();
|
|
2158
|
+
setThenProperties();
|
|
2159
|
+
}, [nodeFilters]);
|
|
2160
|
+
useEffect(function () {
|
|
2161
|
+
var _model$properties, _model$getProperties26;
|
|
2162
|
+
var modelJson = useModel().toJSON();
|
|
2163
|
+
setCurrentModelValues();
|
|
2164
|
+
var nodesBefore = findNodesBeforeTag(modelJson, ((_model$properties = model.properties) === null || _model$properties === void 0 ? void 0 : _model$properties.tag) || '');
|
|
2165
|
+
var list = [];
|
|
2166
|
+
if (paramsList.length > 0) {
|
|
2167
|
+
list.push({
|
|
2168
|
+
label: t('workflow_parameters'),
|
|
2169
|
+
value: 'work~~~*(*)',
|
|
2170
|
+
options: paramsList.map(function (item) {
|
|
2171
|
+
return {
|
|
2172
|
+
label: item.name,
|
|
2173
|
+
value: 'work~~~' + item.name,
|
|
2174
|
+
type: item.type
|
|
2175
|
+
};
|
|
2176
|
+
})
|
|
2177
|
+
});
|
|
2178
|
+
}
|
|
2179
|
+
;
|
|
2180
|
+
nodesBefore.forEach(function (node, index) {
|
|
2181
|
+
var _node$properties4;
|
|
2182
|
+
// if (index !== nodesBefore.length - 1) {
|
|
2183
|
+
// return;
|
|
2184
|
+
// }
|
|
2185
|
+
if ((_node$properties4 = node.properties) !== null && _node$properties4 !== void 0 && _node$properties4.outputParams && node.properties.outputParams.length > 0) {
|
|
2186
|
+
var _node$properties5, _node$properties6;
|
|
2187
|
+
list.push({
|
|
2188
|
+
label: (_node$properties5 = node.properties) === null || _node$properties5 === void 0 ? void 0 : _node$properties5.scriptName,
|
|
2189
|
+
value: "".concat((_node$properties6 = node.properties) === null || _node$properties6 === void 0 ? void 0 : _node$properties6.tag, "~~~*"),
|
|
2190
|
+
options: node.properties.outputParams.map(function (item) {
|
|
2191
|
+
var _node$properties7;
|
|
2192
|
+
return {
|
|
2193
|
+
label: item.label,
|
|
2194
|
+
value: "".concat((_node$properties7 = node.properties) === null || _node$properties7 === void 0 ? void 0 : _node$properties7.tag, "~~~").concat(item.asColumn)
|
|
2195
|
+
};
|
|
2196
|
+
})
|
|
2197
|
+
});
|
|
2198
|
+
}
|
|
2199
|
+
});
|
|
2200
|
+
if (model.parent && model.parent.type === "ITERATOR" && model.parent.condition) {
|
|
2201
|
+
var _model$parent$conditi3;
|
|
2202
|
+
if ((_model$parent$conditi3 = model.parent.condition.properties) !== null && _model$parent$conditi3 !== void 0 && _model$parent$conditi3.bind) {
|
|
2203
|
+
var _model$parent$conditi4;
|
|
2204
|
+
var paramsType = JSON.parse((_model$parent$conditi4 = model.parent.condition.properties) === null || _model$parent$conditi4 === void 0 ? void 0 : _model$parent$conditi4.bind).iterator;
|
|
2205
|
+
setIteratorNodeValue(paramsType);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
var newIteratorNodes = nodesBefore.filter(function (i) {
|
|
2209
|
+
return i.id !== t('empty_node');
|
|
2210
|
+
}).map(function (node) {
|
|
2211
|
+
var _node$properties8, _node$properties9;
|
|
2212
|
+
return {
|
|
2213
|
+
label: (_node$properties8 = node.properties) === null || _node$properties8 === void 0 ? void 0 : _node$properties8.scriptName,
|
|
2214
|
+
value: (_node$properties9 = node.properties) === null || _node$properties9 === void 0 ? void 0 : _node$properties9.tag,
|
|
2215
|
+
properties: node.properties
|
|
2216
|
+
};
|
|
2217
|
+
});
|
|
2218
|
+
var selectNodes = nodesBefore.filter(function (i) {
|
|
2219
|
+
var _i$properties3;
|
|
2220
|
+
return i.id !== t('empty_node') && ((_i$properties3 = i.properties) === null || _i$properties3 === void 0 ? void 0 : _i$properties3.modelType) == 2;
|
|
2221
|
+
});
|
|
2222
|
+
setSelectNodes(selectNodes);
|
|
2223
|
+
setIteratorNodes([{
|
|
2224
|
+
label: t('chain'),
|
|
2225
|
+
value: 'initialize'
|
|
2226
|
+
}].concat(_toConsumableArray(newIteratorNodes)));
|
|
2227
|
+
// setInputValues(list);
|
|
2228
|
+
if (((_model$getProperties26 = model.getProperties()) === null || _model$getProperties26 === void 0 || (_model$getProperties26 = _model$getProperties26.inputList) === null || _model$getProperties26 === void 0 ? void 0 : _model$getProperties26.length) > 0) {
|
|
2229
|
+
var newInputList = model.getProperties().inputList;
|
|
2230
|
+
newInputList.forEach(function (item) {
|
|
2231
|
+
if (list.length && list.every(function (i) {
|
|
2232
|
+
return i.options.every(function (i) {
|
|
2233
|
+
return i.value !== item.value && item.type !== 'input';
|
|
2234
|
+
});
|
|
2235
|
+
})) {
|
|
2236
|
+
item.value = '';
|
|
2237
|
+
} else if (!list.length) {
|
|
2238
|
+
item.value = '';
|
|
2239
|
+
}
|
|
2240
|
+
});
|
|
2241
|
+
setThenProperties();
|
|
2242
|
+
setCurrentModelProperties();
|
|
2243
|
+
setInputList(newInputList);
|
|
2244
|
+
} else {
|
|
2245
|
+
setInputList([]);
|
|
2246
|
+
}
|
|
2247
|
+
}, [model]);
|
|
2248
|
+
useEffect(function () {
|
|
2249
|
+
var _model$properties2;
|
|
2250
|
+
var modelJson = useModel().toJSON();
|
|
2251
|
+
var nodesBefore = findNodesBeforeTag(modelJson, ((_model$properties2 = model.properties) === null || _model$properties2 === void 0 ? void 0 : _model$properties2.tag) || '');
|
|
2252
|
+
var list = [];
|
|
2253
|
+
if (paramsList.length > 0) {
|
|
2254
|
+
list.push({
|
|
2255
|
+
label: t('workflow_parameters'),
|
|
2256
|
+
value: 'work~~~*(*)',
|
|
2257
|
+
options: paramsList.map(function (item) {
|
|
2258
|
+
return {
|
|
2259
|
+
label: item.name,
|
|
2260
|
+
value: 'work~~~' + item.name,
|
|
2261
|
+
type: item.type,
|
|
2262
|
+
fieldsType: item.fieldsType
|
|
2263
|
+
};
|
|
2264
|
+
})
|
|
2265
|
+
});
|
|
2266
|
+
}
|
|
2267
|
+
;
|
|
2268
|
+
nodesBefore.forEach(function (node, index) {
|
|
2269
|
+
var _node$properties10;
|
|
2270
|
+
// if (index !== nodesBefore.length - 1) {
|
|
2271
|
+
// return;
|
|
2272
|
+
// }
|
|
2273
|
+
if ((_node$properties10 = node.properties) !== null && _node$properties10 !== void 0 && _node$properties10.outputParams && node.properties.outputParams.length > 0) {
|
|
2274
|
+
var _node$properties11;
|
|
2275
|
+
if (((_node$properties11 = node.properties) === null || _node$properties11 === void 0 ? void 0 : _node$properties11.modelType) != 6) {
|
|
2276
|
+
var _node$properties12, _node$properties13;
|
|
2277
|
+
list.push({
|
|
2278
|
+
label: (_node$properties12 = node.properties) === null || _node$properties12 === void 0 ? void 0 : _node$properties12.scriptName,
|
|
2279
|
+
value: "".concat((_node$properties13 = node.properties) === null || _node$properties13 === void 0 ? void 0 : _node$properties13.tag, "~~~*"),
|
|
2280
|
+
options: node.properties.outputParams.map(function (item) {
|
|
2281
|
+
var _node$properties14;
|
|
2282
|
+
return {
|
|
2283
|
+
label: item.label,
|
|
2284
|
+
value: "".concat((_node$properties14 = node.properties) === null || _node$properties14 === void 0 ? void 0 : _node$properties14.tag, "~~~").concat(item.asColumn),
|
|
2285
|
+
fieldsType: item.type,
|
|
2286
|
+
type: item.fieldsType
|
|
2287
|
+
};
|
|
2288
|
+
})
|
|
2289
|
+
});
|
|
2290
|
+
} else {
|
|
2291
|
+
var _node$properties15;
|
|
2292
|
+
list.push({
|
|
2293
|
+
label: (_node$properties15 = node.properties) === null || _node$properties15 === void 0 ? void 0 : _node$properties15.scriptName,
|
|
2294
|
+
value: '',
|
|
2295
|
+
options: node.properties.outputParams.map(function (item) {
|
|
2296
|
+
var _node$properties16;
|
|
2297
|
+
return {
|
|
2298
|
+
label: item.label,
|
|
2299
|
+
value: "".concat((_node$properties16 = node.properties) === null || _node$properties16 === void 0 ? void 0 : _node$properties16.tag, "~~~").concat(item.asColumn),
|
|
2300
|
+
fieldsType: item.type,
|
|
2301
|
+
type: item.fieldsType,
|
|
2302
|
+
disabled: item.disabled || false
|
|
2303
|
+
};
|
|
2304
|
+
})
|
|
2305
|
+
});
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
});
|
|
2309
|
+
setInputValues(list);
|
|
2310
|
+
setThenProperties();
|
|
2311
|
+
}, [paramsList]);
|
|
2312
|
+
|
|
2313
|
+
// 每次这些变量变化时更新 ref
|
|
2314
|
+
useEffect(function () {
|
|
2315
|
+
updateSimpleQuery();
|
|
2316
|
+
}, [selectionsOptions, selectAggList, nodeFilters, inputList, applyList, sortCriteria]);
|
|
2317
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2318
|
+
className: styles.liteflowEditorPropertiesEditorContainer
|
|
2319
|
+
}, contextHolder, /*#__PURE__*/React.createElement(Form, {
|
|
2320
|
+
layout: "vertical",
|
|
2321
|
+
form: form
|
|
2322
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
2323
|
+
name: "name",
|
|
2324
|
+
label: t('node_name')
|
|
2325
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
2326
|
+
placeholder: t('node_name_placeholder'),
|
|
2327
|
+
maxLength: 8,
|
|
2328
|
+
disabled: !chainObject.isEdit,
|
|
2329
|
+
onChange: function onChange(e) {
|
|
2330
|
+
var _model$id2;
|
|
2331
|
+
var text = '';
|
|
2332
|
+
if (!((_model$id2 = model.id) !== null && _model$id2 !== void 0 && _model$id2.includes(t('empty_node'))) && !e.target.value) {
|
|
2333
|
+
var _scriptList$find;
|
|
2334
|
+
text = ((_scriptList$find = scriptList.find(function (i) {
|
|
2335
|
+
return i.scriptId === model.id;
|
|
2336
|
+
})) === null || _scriptList$find === void 0 ? void 0 : _scriptList$find.scriptName) || '';
|
|
2337
|
+
} else {
|
|
2338
|
+
text = e.target.value;
|
|
2339
|
+
}
|
|
2340
|
+
model.setProperties(_objectSpread(_objectSpread({}, model.getProperties() ? model.getProperties() : {}), {}, {
|
|
2341
|
+
scriptName: text
|
|
2342
|
+
}));
|
|
2343
|
+
var modelNode = model.getStartNode();
|
|
2344
|
+
modelNode.updateAttrs({
|
|
2345
|
+
label: {
|
|
2346
|
+
text: text || t('empty_node'),
|
|
2347
|
+
fill: "#333",
|
|
2348
|
+
fontSize: 13,
|
|
2349
|
+
refX: 0.5,
|
|
2350
|
+
refY: "100%",
|
|
2351
|
+
refY2: 20,
|
|
2352
|
+
textAnchor: "middle",
|
|
2353
|
+
textVerticalAnchor: "middle"
|
|
2354
|
+
}
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
2358
|
+
name: "script",
|
|
2359
|
+
label: t('component'),
|
|
2360
|
+
required: true
|
|
2361
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2362
|
+
placeholder: t('component_placeholder'),
|
|
2363
|
+
onChange: changeScript,
|
|
2364
|
+
style: {
|
|
2365
|
+
borderRadius: '4px'
|
|
2366
|
+
},
|
|
2367
|
+
disabled: currentType == 3 || !chainObject.isEdit,
|
|
2368
|
+
options: scriptList.map(function (script) {
|
|
2369
|
+
return {
|
|
2370
|
+
label: script.scriptName,
|
|
2371
|
+
value: script.scriptId,
|
|
2372
|
+
disabled: isDisabed(script)
|
|
2373
|
+
};
|
|
2374
|
+
})
|
|
2375
|
+
})), currentType == 8 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2376
|
+
label: t('selectNodes'),
|
|
2377
|
+
required: true
|
|
2378
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2379
|
+
placeholder: t('selectNodes_placeholder'),
|
|
2380
|
+
disabled: !chainObject.isEdit,
|
|
2381
|
+
style: {
|
|
2382
|
+
borderRadius: '4px'
|
|
2383
|
+
},
|
|
2384
|
+
value: rootCauseNode,
|
|
2385
|
+
onChange: function onChange(value) {
|
|
2386
|
+
return changeRootCauseNode(value);
|
|
2387
|
+
},
|
|
2388
|
+
options: selectNodes.map(function (i) {
|
|
2389
|
+
var _i$properties4, _i$properties5;
|
|
2390
|
+
return {
|
|
2391
|
+
label: (_i$properties4 = i.properties) === null || _i$properties4 === void 0 ? void 0 : _i$properties4.scriptName,
|
|
2392
|
+
value: (_i$properties5 = i.properties) === null || _i$properties5 === void 0 ? void 0 : _i$properties5.tag
|
|
2393
|
+
};
|
|
2394
|
+
})
|
|
2395
|
+
})), currentType == 8 && rootCauseNode && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2396
|
+
label: t('analysis_agg'),
|
|
2397
|
+
required: true
|
|
2398
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2399
|
+
placeholder: t('analysis_agg_placeholder'),
|
|
2400
|
+
disabled: !chainObject.isEdit,
|
|
2401
|
+
value: getRootCauseParam(),
|
|
2402
|
+
style: {
|
|
2403
|
+
borderRadius: '4px'
|
|
2404
|
+
},
|
|
2405
|
+
onChange: function onChange(value) {
|
|
2406
|
+
return changeAnalysisField(value);
|
|
2407
|
+
},
|
|
2408
|
+
options: getRootCauseNode().properties.outputParams.map(function (i) {
|
|
2409
|
+
return {
|
|
2410
|
+
label: i.label,
|
|
2411
|
+
value: i.asColumn
|
|
2412
|
+
};
|
|
2413
|
+
})
|
|
2414
|
+
})), currentType == 8 && rootCauseNode && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2415
|
+
label: t('analysis_field_template')
|
|
2416
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2417
|
+
placeholder: t('analysis_field_template_placeholder'),
|
|
2418
|
+
disabled: !chainObject.isEdit,
|
|
2419
|
+
style: {
|
|
2420
|
+
borderRadius: '4px'
|
|
2421
|
+
},
|
|
2422
|
+
showSearch: true,
|
|
2423
|
+
value: analysisFieldTemplate,
|
|
2424
|
+
onChange: function onChange(value) {
|
|
2425
|
+
return changeAnalysisFieldTemplate(value);
|
|
2426
|
+
},
|
|
2427
|
+
options: analyseField.map(function (i) {
|
|
2428
|
+
return {
|
|
2429
|
+
label: i.tempName,
|
|
2430
|
+
value: i.id
|
|
2431
|
+
};
|
|
2432
|
+
})
|
|
2433
|
+
})), currentType == 8 && rootCauseNode && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2434
|
+
label: t('analysis_field'),
|
|
2435
|
+
required: true
|
|
2436
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2437
|
+
placeholder: t('analysis_field_placeholder'),
|
|
2438
|
+
disabled: !chainObject.isEdit,
|
|
2439
|
+
mode: "multiple",
|
|
2440
|
+
style: {
|
|
2441
|
+
borderRadius: '4px'
|
|
2442
|
+
},
|
|
2443
|
+
showSearch: true,
|
|
2444
|
+
value: selections,
|
|
2445
|
+
onChange: function onChange(value, option) {
|
|
2446
|
+
return changeAnalysisAgg(value, option);
|
|
2447
|
+
},
|
|
2448
|
+
options: inputParams.map(function (item) {
|
|
2449
|
+
return {
|
|
2450
|
+
label: item.label,
|
|
2451
|
+
options: item.children.map(function (child) {
|
|
2452
|
+
return _objectSpread({
|
|
2453
|
+
value: child.id
|
|
2454
|
+
}, child);
|
|
2455
|
+
})
|
|
2456
|
+
};
|
|
2457
|
+
})
|
|
2458
|
+
})), (currentType == 2 || currentType == 6 || currentType == 7) && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2459
|
+
label: t('query_log'),
|
|
2460
|
+
required: true
|
|
2461
|
+
}, /*#__PURE__*/React.createElement(Cascader, {
|
|
2462
|
+
options: dataSetOptions,
|
|
2463
|
+
disabled: !chainObject.isEdit,
|
|
2464
|
+
loadData: loadLogList,
|
|
2465
|
+
value: selectLog,
|
|
2466
|
+
style: {
|
|
2467
|
+
borderRadius: '4px'
|
|
2468
|
+
},
|
|
2469
|
+
onChange: function onChange() {
|
|
2470
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2471
|
+
args[_key] = arguments[_key];
|
|
2472
|
+
}
|
|
2473
|
+
onChangeLogId(args);
|
|
2474
|
+
},
|
|
2475
|
+
allowClear: false,
|
|
2476
|
+
placeholder: t('query_log_placeholder')
|
|
2477
|
+
})), currentType == 7 && selectLog.length > 0 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2478
|
+
label: t('predict_template'),
|
|
2479
|
+
required: true
|
|
2480
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2481
|
+
placeholder: t('predict_template_placeholder'),
|
|
2482
|
+
disabled: !chainObject.isEdit,
|
|
2483
|
+
style: {
|
|
2484
|
+
borderRadius: '4px'
|
|
2485
|
+
},
|
|
2486
|
+
value: model.getProperties().forecastId,
|
|
2487
|
+
onChange: function onChange(value) {
|
|
2488
|
+
return changeForecastId(value);
|
|
2489
|
+
},
|
|
2490
|
+
options: curScheduleSet.map(function (i) {
|
|
2491
|
+
return {
|
|
2492
|
+
label: i.forecastName,
|
|
2493
|
+
value: i.id
|
|
2494
|
+
};
|
|
2495
|
+
})
|
|
2496
|
+
})), currentType == 3 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2497
|
+
label: t('loop_node'),
|
|
2498
|
+
required: true
|
|
2499
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2500
|
+
placeholder: t('loop_node_placeholder'),
|
|
2501
|
+
disabled: !chainObject.isEdit,
|
|
2502
|
+
style: {
|
|
2503
|
+
borderRadius: '4px'
|
|
2504
|
+
},
|
|
2505
|
+
value: iteratorNodeValue,
|
|
2506
|
+
onChange: function onChange(value) {
|
|
2507
|
+
changeIteratorNodes(value);
|
|
2508
|
+
}
|
|
2509
|
+
}, iteratorNodes.map(function (item) {
|
|
2510
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
2511
|
+
value: item.value,
|
|
2512
|
+
key: item.value
|
|
2513
|
+
}, item.label);
|
|
2514
|
+
}))), selectLog.length > 0 && currentType == 2 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2515
|
+
label: t('query_dimension_and_indicator'),
|
|
2516
|
+
required: true
|
|
2517
|
+
}, selectionsOptions.length > 0 && /*#__PURE__*/React.createElement(List, {
|
|
2518
|
+
size: "large",
|
|
2519
|
+
bordered: true
|
|
2520
|
+
}, selectionsOptions.map(function (item) {
|
|
2521
|
+
return /*#__PURE__*/React.createElement(List.Item, null, /*#__PURE__*/React.createElement("div", {
|
|
2522
|
+
className: styles.flexBox
|
|
2523
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
2524
|
+
className: styles.fieldLabel
|
|
2525
|
+
}, item.type == 'Agg' ? t('indicator') : t('dimension'), ":", item.label)));
|
|
2526
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2527
|
+
className: styles.flexBox,
|
|
2528
|
+
style: {
|
|
2529
|
+
justifyContent: 'flex-end',
|
|
2530
|
+
marginTop: '16px'
|
|
2531
|
+
}
|
|
2532
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
2533
|
+
disabled: !chainObject.isEdit,
|
|
2534
|
+
type: "primary",
|
|
2535
|
+
onClick: function onClick() {
|
|
2536
|
+
return handleQueryConfig(inputParams);
|
|
2537
|
+
}
|
|
2538
|
+
}, selectionsOptions.length > 0 ? t('modify_config') : t('start_config')))), (selectLog.length > 0 || currentType == 8) && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2539
|
+
label: t('query_filter')
|
|
2540
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2541
|
+
className: styles.flexBox
|
|
2542
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2543
|
+
className: styles.filterList
|
|
2544
|
+
}, nodeFilters.map(function (filter, index) {
|
|
2545
|
+
var _unitNumOptions$find, _unitNumOptions$find2, _unitOptions$find, _unitOptions$find2;
|
|
2546
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2547
|
+
className: styles.filterItem,
|
|
2548
|
+
key: index
|
|
2549
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2550
|
+
className: styles.filterItemLeft
|
|
2551
|
+
}, filter.field ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
2552
|
+
style: {
|
|
2553
|
+
fontSize: 16,
|
|
2554
|
+
fontWeight: 700,
|
|
2555
|
+
color: '#000'
|
|
2556
|
+
}
|
|
2557
|
+
}, getFieldLabel(filter.field)), /*#__PURE__*/React.createElement("span", null, filter.isInverse && /*#__PURE__*/React.createElement("span", null, "\u975E:"), filter.type === 'FuzzyFilter' && /*#__PURE__*/React.createElement("span", null, "\u5305\u542B"), filter.values.includes('useChainParam') ? filter.values[0] : filter.values.join(','))) : filter.type === 'ActivityFilter' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
2558
|
+
style: {
|
|
2559
|
+
fontSize: 16,
|
|
2560
|
+
fontWeight: 700,
|
|
2561
|
+
color: '#000'
|
|
2562
|
+
}
|
|
2563
|
+
}, "\u6D3B\u52A8\u8FC7\u6EE4"), /*#__PURE__*/React.createElement("span", null, getHdNum(filter))) : filter.type === 'PathFilter' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
2564
|
+
style: {
|
|
2565
|
+
fontSize: 16,
|
|
2566
|
+
fontWeight: 700,
|
|
2567
|
+
color: '#000'
|
|
2568
|
+
}
|
|
2569
|
+
}, filter.mode === 'matchWithGaps' ? '最终跟随' : '直接跟随'), /*#__PURE__*/React.createElement("span", null, "".concat(filter.path[0], " -> ").concat(filter.path[1]))) : filter.type === 'ReworkFilter' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
2570
|
+
style: {
|
|
2571
|
+
fontSize: 16,
|
|
2572
|
+
fontWeight: 700,
|
|
2573
|
+
color: '#000'
|
|
2574
|
+
}
|
|
2575
|
+
}, filter.values[0]), /*#__PURE__*/React.createElement("span", null, filter.values.join(' '))) : filter.type === 'FilterList' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
2576
|
+
style: {
|
|
2577
|
+
fontSize: 16,
|
|
2578
|
+
fontWeight: 700,
|
|
2579
|
+
color: '#000'
|
|
2580
|
+
}
|
|
2581
|
+
}, getFieldLabel(filter.filters[0].field)), filter.filters[0].type === 'RangeFilter' && /*#__PURE__*/React.createElement("span", null, filter.isInverse && /*#__PURE__*/React.createElement("span", null, "\u975E:"), getFieldType(filter.filters[0].field) === 'Time' ? /*#__PURE__*/React.createElement("span", null, typeof filter.filters[0].from.value === 'string' ? extractBracedContent(filter.filters[0].from.value)[0] : formatDateTime(filter.filters[0].from.value), "\xA0-\xA0", typeof filter.filters[0].to.value === 'string' ? extractBracedContent(filter.filters[0].to.value)[0] : formatDateTime(filter.filters[0].to.value)) : getFieldType(filter.filters[0].field) === 'Long' ? filter.filters[0].from.value === filter.filters[0].to.value ? /*#__PURE__*/React.createElement("span", null, filter.filters[0].from.value) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "\xA0\u2265\xA0", parseUnits(filter.filters[0].unitSelList[0], filter.filters[0].from.value)), /*#__PURE__*/React.createElement("span", null, unitNumOptions.findIndex(function (u) {
|
|
2582
|
+
return u.value === filter.filters[0].unitSelList[0];
|
|
2583
|
+
}) > -1 ? (_unitNumOptions$find = unitNumOptions.find(function (unit) {
|
|
2584
|
+
return unit.value === filter.filters[0].unitSelList[0];
|
|
2585
|
+
})) === null || _unitNumOptions$find === void 0 ? void 0 : _unitNumOptions$find.label : ""), /*#__PURE__*/React.createElement("span", null, "\xA0<\xA0", parseUnits(filter.filters[0].unitSelList[1], filter.filters[0].to.value)), /*#__PURE__*/React.createElement("span", null, unitNumOptions.findIndex(function (unit) {
|
|
2586
|
+
return unit.value === filter.filters[0].unitSelList[1];
|
|
2587
|
+
}) > -1 ? (_unitNumOptions$find2 = unitNumOptions.find(function (unit) {
|
|
2588
|
+
return unit.value === filter.filters[0].unitSelList[1];
|
|
2589
|
+
})) === null || _unitNumOptions$find2 === void 0 ? void 0 : _unitNumOptions$find2.label : "")) : getFieldType(filter.filters[0].field) === 'TimeSpan' ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\xA0\u2265\xA0", parseUnits(filter.filters[0].unitSelList[0], filter.filters[0].from.value)), /*#__PURE__*/React.createElement("span", null, ((_unitOptions$find = unitOptions.find(function (u) {
|
|
2590
|
+
return u.value === filter.filters[0].unitSelList[0];
|
|
2591
|
+
})) === null || _unitOptions$find === void 0 ? void 0 : _unitOptions$find.label) || ''), /*#__PURE__*/React.createElement("span", null, "\xA0<\xA0", parseUnits(filter.filters[0].unitSelList[1], filter.filters[0].to.value)), /*#__PURE__*/React.createElement("span", null, ((_unitOptions$find2 = unitOptions.find(function (u) {
|
|
2592
|
+
return u.value === filter.filters[0].unitSelList[1];
|
|
2593
|
+
})) === null || _unitOptions$find2 === void 0 ? void 0 : _unitOptions$find2.label) || '')) : null)) : null), chainObject.isEdit && /*#__PURE__*/React.createElement(CloseCircleTwoTone, {
|
|
2594
|
+
style: {
|
|
2595
|
+
fontSize: 20,
|
|
2596
|
+
cursor: 'pointer'
|
|
2597
|
+
},
|
|
2598
|
+
onClick: function onClick() {
|
|
2599
|
+
return delNodeFilters(index);
|
|
2600
|
+
}
|
|
2601
|
+
}));
|
|
2602
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
2603
|
+
type: "primary",
|
|
2604
|
+
onClick: handleAddFilter,
|
|
2605
|
+
disabled: !chainObject.isEdit
|
|
2606
|
+
}, t('add_query_filter')))), currentType == 5 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2607
|
+
label: t('report_template'),
|
|
2608
|
+
required: true
|
|
2609
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2610
|
+
placeholder: t('report_template_placeholder'),
|
|
2611
|
+
style: {
|
|
2612
|
+
borderRadius: '4px'
|
|
2613
|
+
},
|
|
2614
|
+
value: model.getProperties().reportMinioName || undefined,
|
|
2615
|
+
disabled: !chainObject.isEdit,
|
|
2616
|
+
onChange: function onChange(value) {
|
|
2617
|
+
changeReportTemplate(value);
|
|
2618
|
+
},
|
|
2619
|
+
options: reportTemplateList.map(function (item) {
|
|
2620
|
+
return {
|
|
2621
|
+
label: item.reportName,
|
|
2622
|
+
value: item.minioName
|
|
2623
|
+
};
|
|
2624
|
+
})
|
|
2625
|
+
})), currentType == 4 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2626
|
+
label: t('knowledge_base')
|
|
2627
|
+
}, /*#__PURE__*/React.createElement(TreeSelect, {
|
|
2628
|
+
treeExpandAction: "click",
|
|
2629
|
+
treeDataSimpleMode: true,
|
|
2630
|
+
disabled: !chainObject.isEdit,
|
|
2631
|
+
treeDefaultExpandedKeys: loadedKeys,
|
|
2632
|
+
treeLoadedKeys: loadedKeys,
|
|
2633
|
+
treeData: treeData,
|
|
2634
|
+
defaultValue: model.getProperties().aiKnowledgeFileId || undefined,
|
|
2635
|
+
loadData: loadTreeData,
|
|
2636
|
+
onChange: function onChange(value, title) {
|
|
2637
|
+
return onChangeKnowledge(value, title);
|
|
2638
|
+
},
|
|
2639
|
+
treeCheckable: true,
|
|
2640
|
+
showCheckedStrategy: TreeSelect.SHOW_CHILD,
|
|
2641
|
+
placeholder: t('knowledge_base_placeholder'),
|
|
2642
|
+
allowClear: false,
|
|
2643
|
+
multiple: true
|
|
2644
|
+
})), currentType == 4 && /*#__PURE__*/React.createElement("div", {
|
|
2645
|
+
className: styles.flexBox,
|
|
2646
|
+
style: {
|
|
2647
|
+
width: 'fit-content',
|
|
2648
|
+
margin: '10px 0'
|
|
2649
|
+
}
|
|
2650
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
2651
|
+
style: {
|
|
2652
|
+
marginRight: '10px'
|
|
2653
|
+
}
|
|
2654
|
+
}, t('enable_network_retrieval')), /*#__PURE__*/React.createElement(Switch, {
|
|
2655
|
+
checked: aiNetSearch === 1,
|
|
2656
|
+
disabled: !chainObject.isEdit,
|
|
2657
|
+
onChange: function onChange(checked) {
|
|
2658
|
+
changeAiNetSearch(checked);
|
|
2659
|
+
}
|
|
2660
|
+
})), (selectLog.length > 0 || inputList.length > 0) && currentType != 6 && currentType != 7 && /*#__PURE__*/React.createElement(Form.Item, {
|
|
2661
|
+
name: "inputList",
|
|
2662
|
+
label: t('input_variables'),
|
|
2663
|
+
required: currentType == 1 || currentType == 4 || currentType == 5
|
|
2664
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, inputList.map(function (param, index) {
|
|
2665
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2666
|
+
style: {
|
|
2667
|
+
display: 'flex',
|
|
2668
|
+
alignItems: 'center',
|
|
2669
|
+
gap: '10px',
|
|
2670
|
+
marginBottom: '10px'
|
|
2671
|
+
}
|
|
2672
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
2673
|
+
showSearch: true,
|
|
2674
|
+
placeholder: t('input_variables_tips'),
|
|
2675
|
+
style: {
|
|
2676
|
+
borderRadius: '4px'
|
|
2677
|
+
},
|
|
2678
|
+
value: param.variableDesc || param.label || undefined,
|
|
2679
|
+
open: inputList[index].selectIsOpen,
|
|
2680
|
+
disabled: currentType == 1 || currentType == 4 || currentType == 5 || !chainObject.isEdit,
|
|
2681
|
+
onDropdownVisibleChange: function onDropdownVisibleChange(visible) {
|
|
2682
|
+
_onDropdownVisibleChange(index, visible);
|
|
2683
|
+
},
|
|
2684
|
+
onChange: function onChange(value) {
|
|
2685
|
+
changeInputLabel(value, index);
|
|
2686
|
+
},
|
|
2687
|
+
options: inputParams.map(function (item) {
|
|
2688
|
+
return {
|
|
2689
|
+
label: item.label,
|
|
2690
|
+
options: item.children.map(function (child) {
|
|
2691
|
+
return {
|
|
2692
|
+
label: child.label,
|
|
2693
|
+
value: child.id
|
|
2694
|
+
};
|
|
2695
|
+
})
|
|
2696
|
+
};
|
|
2697
|
+
}),
|
|
2698
|
+
dropdownRender: function dropdownRender(menu) {
|
|
2699
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, menu, inputParams.length <= 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
2700
|
+
style: {
|
|
2701
|
+
margin: '8px 0'
|
|
2702
|
+
}
|
|
2703
|
+
}), /*#__PURE__*/React.createElement(Space, {
|
|
2704
|
+
style: {
|
|
2705
|
+
padding: '0 8px 4px'
|
|
2706
|
+
}
|
|
2707
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
2708
|
+
placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0",
|
|
2709
|
+
ref: inputRef,
|
|
2710
|
+
value: newFields,
|
|
2711
|
+
onChange: onNewFieldsChange
|
|
2712
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
2713
|
+
type: "text",
|
|
2714
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
2715
|
+
onClick: function onClick() {
|
|
2716
|
+
addNewFields(index);
|
|
2717
|
+
}
|
|
2718
|
+
}, "\u6DFB\u52A0"))));
|
|
2719
|
+
}
|
|
2720
|
+
}), param.type !== 'input' ? /*#__PURE__*/React.createElement(Select, {
|
|
2721
|
+
showSearch: true,
|
|
2722
|
+
placeholder: t('input_variables_value_tips'),
|
|
2723
|
+
style: {
|
|
2724
|
+
borderRadius: '4px'
|
|
2725
|
+
},
|
|
2726
|
+
disabled: !chainObject.isEdit || !param.label,
|
|
2727
|
+
onChange: function onChange(value) {
|
|
2728
|
+
changeInputValue(value, index);
|
|
2729
|
+
},
|
|
2730
|
+
options: inputValues.map(function (item) {
|
|
2731
|
+
return {
|
|
2732
|
+
label: item.label,
|
|
2733
|
+
options: item.options.map(function (option) {
|
|
2734
|
+
return {
|
|
2735
|
+
label: option.label,
|
|
2736
|
+
value: option.value,
|
|
2737
|
+
disabled: option.disabled || getInputValueDisabled(option, param)
|
|
2738
|
+
};
|
|
2739
|
+
})
|
|
2740
|
+
};
|
|
2741
|
+
}),
|
|
2742
|
+
value: param.value || undefined
|
|
2743
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
2744
|
+
style: {
|
|
2745
|
+
width: '100%'
|
|
2746
|
+
}
|
|
2747
|
+
}, /*#__PURE__*/React.createElement(RichParamEditor, {
|
|
2748
|
+
value: param.richValue || [],
|
|
2749
|
+
onChange: function onChange(val) {
|
|
2750
|
+
return changeInputValue(val, index);
|
|
2751
|
+
},
|
|
2752
|
+
options: inputValues,
|
|
2753
|
+
disabled: !chainObject.isEdit
|
|
2754
|
+
})), currentType == 2 && /*#__PURE__*/React.createElement(Button, {
|
|
2755
|
+
type: "primary",
|
|
2756
|
+
onClick: function onClick() {
|
|
2757
|
+
delInputList(index);
|
|
2758
|
+
},
|
|
2759
|
+
disabled: !chainObject.isEdit
|
|
2760
|
+
}, t('delete')));
|
|
2761
|
+
}), currentType == 2 && /*#__PURE__*/React.createElement("div", {
|
|
2762
|
+
style: {
|
|
2763
|
+
display: 'flex',
|
|
2764
|
+
justifyContent: 'flex-end',
|
|
2765
|
+
gap: '10px'
|
|
2766
|
+
}
|
|
2767
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
2768
|
+
type: "primary",
|
|
2769
|
+
onClick: function onClick() {
|
|
2770
|
+
setInputList([].concat(_toConsumableArray(inputList), [{
|
|
2771
|
+
label: '',
|
|
2772
|
+
value: '',
|
|
2773
|
+
selectIsOpen: false,
|
|
2774
|
+
richValue: []
|
|
2775
|
+
}]));
|
|
2776
|
+
},
|
|
2777
|
+
disabled: !chainObject.isEdit
|
|
2778
|
+
}, t('add_input_variables')))))));
|
|
2779
|
+
};
|
|
2780
|
+
export default ComponentPropertiesEditor;
|