strategy-panel 1.0.3-rc-6 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/canvas/component-tree-panel/category-tree/category-type.js +18 -17
- package/es/components/canvas/component-tree-panel/category-tree/index.js +13 -29
- package/es/components/canvas/component-tree-panel/category-tree/node-title.d.ts +2 -1
- package/es/components/canvas/component-tree-panel/category-tree/node-title.js +10 -13
- package/es/components/canvas/component-tree-panel/index.js +2 -4
- package/es/components/canvas/config-panel/components/condition-configuration/configure-modal/data-origin.js +33 -58
- package/es/components/canvas/config-panel/components/condition-configuration/configure-modal/index.js +20 -36
- package/es/components/canvas/config-panel/components/condition-configuration/cross-line.js +9 -13
- package/es/components/canvas/config-panel/components/condition-configuration/index.js +26 -53
- package/es/components/canvas/config-panel/components/time-trigger/components/cycle-time.js +10 -15
- package/es/components/canvas/config-panel/components/time-trigger/components/time-horizon.js +11 -16
- package/es/components/canvas/config-panel/components/time-trigger/delay-time.js +2 -4
- package/es/components/canvas/config-panel/components/time-trigger/effective-time.js +5 -10
- package/es/components/canvas/config-panel/components/time-trigger/index.js +7 -18
- package/es/components/canvas/config-panel/components/time-trigger/interval-time.js +9 -13
- package/es/components/canvas/config-panel/components/time-trigger/persistent-time.js +2 -4
- package/es/components/canvas/config-panel/components/time-trigger/section-Detail.d.ts +1 -1
- package/es/components/canvas/config-panel/components/time-trigger/section-Detail.js +19 -27
- package/es/components/canvas/config-panel/components/time-trigger/section-time.js +12 -18
- package/es/components/canvas/config-panel/components/time-trigger/timing-time.js +9 -13
- package/es/components/canvas/config-panel/config-common.d.ts +4 -3
- package/es/components/canvas/config-panel/config-common.js +24 -22
- package/es/components/canvas/config-panel/index.js +11 -21
- package/es/components/canvas/config-panel/node-form.js +14 -29
- package/es/components/canvas/dag-canvas/canvas-content.js +38 -50
- package/es/components/canvas/dag-canvas/index.js +8 -8
- package/es/components/canvas/dag-canvas/preview.js +11 -14
- package/es/components/canvas/index.js +12 -22
- package/es/components/canvas/strategy-header/index.js +49 -73
- package/es/components/canvas/strategy-header/theme-switch/index.js +0 -3
- package/es/index.js +1 -0
- package/es/packages/graph-canvas/graph-model/edge/group-edge/index.js +6 -21
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.js +1 -3
- package/es/packages/graph-canvas/graph-model/node/application-node/index.js +4 -20
- package/es/packages/graph-canvas/graph-model/node/common-node/index.js +4 -20
- package/es/packages/graph-canvas/graph-model/node/common-node/node-element.js +10 -20
- package/es/packages/graph-canvas/graph-model/node/condition-node/condition-element.js +12 -21
- package/es/packages/graph-canvas/graph-model/node/condition-node/index.js +4 -20
- package/es/packages/graph-canvas/graph-model/node/logical-node/index.js +4 -20
- package/es/packages/graph-canvas/graph-model/node/logical-node/logical-element.js +10 -21
- package/es/packages/graph-canvas/graph-utils/graph.js +23 -26
- package/es/packages/graph-canvas/index.js +387 -581
- package/es/packages/graph-canvas/node-types.js +0 -4
- package/es/packages/graph-common/graph.js +3 -3
- package/es/packages/graph-core/graph-util.js +55 -68
- package/es/packages/graph-core/index.js +114 -211
- package/es/packages/graph-model/edge/index.js +4 -20
- package/es/packages/graph-model/node/index.js +4 -24
- package/es/packages/hooks/useObservableState.js +10 -20
- package/es/packages/hooks/withMode.d.ts +2 -1
- package/es/packages/hooks/withMode.js +0 -2
- package/lib/components/canvas/component-tree-panel/category-tree/category-type.js +20 -30
- package/lib/components/canvas/component-tree-panel/category-tree/index.js +14 -39
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.d.ts +2 -1
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.js +12 -24
- package/lib/components/canvas/component-tree-panel/index.js +3 -11
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/data-origin.js +34 -66
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/index.js +23 -50
- package/lib/components/canvas/config-panel/components/condition-configuration/cross-line.js +10 -19
- package/lib/components/canvas/config-panel/components/condition-configuration/index.js +30 -76
- package/lib/components/canvas/config-panel/components/time-trigger/components/cycle-time.js +11 -24
- package/lib/components/canvas/config-panel/components/time-trigger/components/time-horizon.js +12 -22
- package/lib/components/canvas/config-panel/components/time-trigger/delay-time.js +3 -11
- package/lib/components/canvas/config-panel/components/time-trigger/effective-time.js +6 -19
- package/lib/components/canvas/config-panel/components/time-trigger/index.js +11 -36
- package/lib/components/canvas/config-panel/components/time-trigger/interval-time.js +10 -21
- package/lib/components/canvas/config-panel/components/time-trigger/persistent-time.js +3 -11
- package/lib/components/canvas/config-panel/components/time-trigger/section-Detail.d.ts +1 -1
- package/lib/components/canvas/config-panel/components/time-trigger/section-Detail.js +20 -36
- package/lib/components/canvas/config-panel/components/time-trigger/section-time.js +13 -27
- package/lib/components/canvas/config-panel/components/time-trigger/timing-time.js +10 -21
- package/lib/components/canvas/config-panel/config-common.d.ts +4 -3
- package/lib/components/canvas/config-panel/config-common.js +23 -38
- package/lib/components/canvas/config-panel/index.js +12 -30
- package/lib/components/canvas/config-panel/node-form.js +18 -44
- package/lib/components/canvas/dag-canvas/canvas-content.js +43 -70
- package/lib/components/canvas/dag-canvas/index.js +12 -22
- package/lib/components/canvas/dag-canvas/preview.js +15 -28
- package/lib/components/canvas/index.js +13 -35
- package/lib/components/canvas/strategy-header/index.js +50 -86
- package/lib/components/canvas/strategy-header/theme-switch/index.js +1 -9
- package/lib/index.js +0 -9
- package/lib/packages/graph-canvas/graph-common.js +3 -5
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/index.js +7 -27
- package/lib/packages/graph-canvas/graph-model/edge/index.js +0 -2
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.js +2 -8
- package/lib/packages/graph-canvas/graph-model/node/application-node/index.js +7 -31
- package/lib/packages/graph-canvas/graph-model/node/common-node/index.js +7 -31
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.js +11 -29
- package/lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.js +13 -31
- package/lib/packages/graph-canvas/graph-model/node/condition-node/index.js +5 -27
- package/lib/packages/graph-canvas/graph-model/node/index.js +0 -5
- package/lib/packages/graph-canvas/graph-model/node/logical-node/index.js +6 -29
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.js +11 -37
- package/lib/packages/graph-canvas/graph-utils/graph.js +28 -46
- package/lib/packages/graph-canvas/index.js +393 -619
- package/lib/packages/graph-canvas/node-types.js +7 -17
- package/lib/packages/graph-common/global.js +1 -2
- package/lib/packages/graph-common/graph.js +13 -25
- package/lib/packages/graph-core/graph-util.js +53 -75
- package/lib/packages/graph-core/index.js +115 -218
- package/lib/packages/graph-model/connector/index.js +0 -1
- package/lib/packages/graph-model/edge/index.js +5 -25
- package/lib/packages/graph-model/node/index.js +6 -29
- package/lib/packages/hooks/useObservableState.js +12 -27
- package/lib/packages/hooks/withMode.d.ts +2 -1
- package/lib/packages/hooks/withMode.js +0 -5
- package/lib/style/svgRaw.js +1 -2
- package/lib/utils/utils.js +0 -1
- package/package.json +1 -4
|
@@ -5,6 +5,9 @@ import device from "../../../../assets/decive.svg";
|
|
|
5
5
|
import time from "../../../../assets/time.svg";
|
|
6
6
|
import hand from "../../../../assets/hand.svg";
|
|
7
7
|
import condition from "../../../../assets/condition.svg";
|
|
8
|
+
import alarm from "../../../../assets/alarm.svg";
|
|
9
|
+
import notice from "../../../../assets/notice.svg";
|
|
10
|
+
import order from "../../../../assets/order.svg";
|
|
8
11
|
import control from "../../../../assets/control.svg";
|
|
9
12
|
export var componentsData = [{
|
|
10
13
|
id: COMPONENTS_TYPE.COMMONLY_USED,
|
|
@@ -36,7 +39,8 @@ export var componentsData = [{
|
|
|
36
39
|
name: '运算组件',
|
|
37
40
|
isDir: true,
|
|
38
41
|
tooltip: '通过条件判断、函数计算、逻辑判断、时间判断等进行规则判断,得出结论是否需要继续执行',
|
|
39
|
-
children: [
|
|
42
|
+
children: [
|
|
43
|
+
// {
|
|
40
44
|
// id: SIGN_OPERATION.RELATION,
|
|
41
45
|
// name: '关系运算',
|
|
42
46
|
// imgUrl: relation,
|
|
@@ -64,22 +68,19 @@ export var componentsData = [{
|
|
|
64
68
|
id: COMMONLY_USED.LOCKED,
|
|
65
69
|
name: '服务锁定',
|
|
66
70
|
imgUrl: lock
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// imgUrl: order,
|
|
81
|
-
// },
|
|
82
|
-
{
|
|
71
|
+
}, {
|
|
72
|
+
id: MOTION_OPERATION.ALARM,
|
|
73
|
+
name: '报警',
|
|
74
|
+
imgUrl: alarm
|
|
75
|
+
}, {
|
|
76
|
+
id: MOTION_OPERATION.NOTICE,
|
|
77
|
+
name: '通知',
|
|
78
|
+
imgUrl: notice
|
|
79
|
+
}, {
|
|
80
|
+
id: MOTION_OPERATION.ORDER,
|
|
81
|
+
name: '派发工单',
|
|
82
|
+
imgUrl: order
|
|
83
|
+
}, {
|
|
83
84
|
id: MOTION_OPERATION.CONTROL,
|
|
84
85
|
name: '远程控制',
|
|
85
86
|
imgUrl: control
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function _objectSpread(
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Col, Collapse, Row, Tooltip } from 'antd';
|
|
9
9
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
@@ -11,27 +11,21 @@ import { componentsData } from "./category-type";
|
|
|
11
11
|
import { NodeTitle } from "./node-title";
|
|
12
12
|
import "./index.less";
|
|
13
13
|
var Panel = Collapse.Panel;
|
|
14
|
-
|
|
15
14
|
var getComponentsData = function getComponentsData(data) {
|
|
16
15
|
return data === null || data === void 0 ? void 0 : data.reduce(function (pre, next) {
|
|
17
16
|
var existentIndex = pre.findIndex(function (child) {
|
|
18
17
|
return child.id === next.id;
|
|
19
18
|
});
|
|
20
|
-
|
|
21
19
|
if (existentIndex > -1) {
|
|
22
20
|
var _pre$existentIndex;
|
|
23
|
-
|
|
24
|
-
var existentChildren = pre === null || pre === void 0 ? void 0 : (_pre$existentIndex = pre[existentIndex]) === null || _pre$existentIndex === void 0 ? void 0 : _pre$existentIndex.children;
|
|
25
|
-
|
|
21
|
+
var existentChildren = pre === null || pre === void 0 || (_pre$existentIndex = pre[existentIndex]) === null || _pre$existentIndex === void 0 ? void 0 : _pre$existentIndex.children;
|
|
26
22
|
if (existentChildren && next.children) {
|
|
27
23
|
var _next$children;
|
|
28
|
-
|
|
29
24
|
pre[existentIndex] = _objectSpread(_objectSpread({}, pre[existentIndex]), next);
|
|
30
|
-
(_next$children = next.children) === null || _next$children === void 0
|
|
25
|
+
(_next$children = next.children) === null || _next$children === void 0 || _next$children.forEach(function (item) {
|
|
31
26
|
var childIndex = existentChildren === null || existentChildren === void 0 ? void 0 : existentChildren.findIndex(function (child) {
|
|
32
27
|
return child.id === item.id;
|
|
33
28
|
});
|
|
34
|
-
|
|
35
29
|
if (childIndex > -1) {
|
|
36
30
|
existentChildren[childIndex] = item;
|
|
37
31
|
} else {
|
|
@@ -45,36 +39,29 @@ var getComponentsData = function getComponentsData(data) {
|
|
|
45
39
|
} else {
|
|
46
40
|
pre.push(next);
|
|
47
41
|
}
|
|
48
|
-
|
|
49
42
|
return pre;
|
|
50
43
|
}, componentsData);
|
|
51
44
|
};
|
|
52
|
-
|
|
53
45
|
var CategoryTree = function CategoryTree(props) {
|
|
54
46
|
var _props$sortNum = props.sortNum,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
sortNum = _props$sortNum === void 0 ? 3 : _props$sortNum,
|
|
48
|
+
_props$panelData = props.panelData,
|
|
49
|
+
panelData = _props$panelData === void 0 ? [] : _props$panelData;
|
|
59
50
|
var isRowFirst = function isRowFirst(index) {
|
|
60
51
|
return (index + 1) % sortNum === 1;
|
|
61
52
|
};
|
|
62
|
-
|
|
63
53
|
var sortIndex = function sortIndex(index) {
|
|
64
54
|
return index % sortNum;
|
|
65
55
|
};
|
|
66
|
-
|
|
67
56
|
var currentPanelData = getComponentsData(panelData);
|
|
68
57
|
var omitEmptyData = currentPanelData === null || currentPanelData === void 0 ? void 0 : currentPanelData.filter(function (item) {
|
|
69
58
|
var _item$children;
|
|
70
|
-
|
|
71
|
-
return (item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) > 0;
|
|
59
|
+
return (item === null || item === void 0 || (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) > 0;
|
|
72
60
|
});
|
|
73
61
|
var defaultActiveKey = currentPanelData === null || currentPanelData === void 0 ? void 0 : currentPanelData.map(function (item) {
|
|
74
62
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
75
63
|
});
|
|
76
64
|
console.log('xxxxcurrentPanelData', currentPanelData, componentsData);
|
|
77
|
-
|
|
78
65
|
var getPanelTitle = function getPanelTitle(item) {
|
|
79
66
|
return /*#__PURE__*/React.createElement("div", null, item.name, (item === null || item === void 0 ? void 0 : item.tooltip) && /*#__PURE__*/React.createElement(Tooltip, {
|
|
80
67
|
title: item.tooltip
|
|
@@ -84,7 +71,6 @@ var CategoryTree = function CategoryTree(props) {
|
|
|
84
71
|
}
|
|
85
72
|
})));
|
|
86
73
|
};
|
|
87
|
-
|
|
88
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
89
75
|
className: "category-tree-list"
|
|
90
76
|
}, /*#__PURE__*/React.createElement(Collapse, {
|
|
@@ -92,11 +78,10 @@ var CategoryTree = function CategoryTree(props) {
|
|
|
92
78
|
defaultActiveKey: defaultActiveKey
|
|
93
79
|
}, omitEmptyData === null || omitEmptyData === void 0 ? void 0 : omitEmptyData.map(function (item) {
|
|
94
80
|
var _item$children2, _item$children3;
|
|
95
|
-
|
|
96
81
|
return /*#__PURE__*/React.createElement(Panel, {
|
|
97
82
|
header: getPanelTitle(item),
|
|
98
83
|
key: item.id
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Row, null, item !== null && item !== void 0 && (_item$children2 = item.children) !== null && _item$children2 !== void 0 && _item$children2.length ? item === null || item === void 0
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Row, null, item !== null && item !== void 0 && (_item$children2 = item.children) !== null && _item$children2 !== void 0 && _item$children2.length ? item === null || item === void 0 || (_item$children3 = item.children) === null || _item$children3 === void 0 ? void 0 : _item$children3.map(function (child, index) {
|
|
100
85
|
return /*#__PURE__*/React.createElement(Col, {
|
|
101
86
|
key: child.id,
|
|
102
87
|
span: 8
|
|
@@ -108,5 +93,4 @@ var CategoryTree = function CategoryTree(props) {
|
|
|
108
93
|
}) : /*#__PURE__*/React.createElement("div", null)));
|
|
109
94
|
})));
|
|
110
95
|
};
|
|
111
|
-
|
|
112
96
|
export default CategoryTree;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { ConnectDragPreview, ConnectDragSource } from 'react-dnd';
|
|
2
3
|
import './node-title.less';
|
|
3
4
|
interface Props {
|
|
@@ -8,5 +9,5 @@ interface Props {
|
|
|
8
9
|
connectDragSource: ConnectDragSource;
|
|
9
10
|
connectDragPreview: ConnectDragPreview;
|
|
10
11
|
}
|
|
11
|
-
export declare const NodeTitle: import("react-dnd").DndComponentClass<(props: Props) => JSX.Element, import("react-dnd").Omit<Props, "connectDragSource" | "connectDragPreview" | "isDragging">>;
|
|
12
|
+
export declare const NodeTitle: import("react-dnd").DndComponentClass<(props: Props) => React.JSX.Element, import("react-dnd").Omit<Props, "connectDragSource" | "connectDragPreview" | "isDragging">>;
|
|
12
13
|
export {};
|
|
@@ -8,26 +8,24 @@ marked.setOptions({
|
|
|
8
8
|
gfm: true,
|
|
9
9
|
breaks: true
|
|
10
10
|
});
|
|
11
|
-
|
|
12
11
|
var InnerNodeTitle = function InnerNodeTitle(props) {
|
|
13
12
|
var _props$node = props.node,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
node = _props$node === void 0 ? {} : _props$node,
|
|
14
|
+
isRowFirst = props.isRowFirst,
|
|
15
|
+
sortIndex = props.sortIndex,
|
|
16
|
+
connectDragPreview = props.connectDragPreview,
|
|
17
|
+
connectDragSource = props.connectDragSource;
|
|
19
18
|
var _node$name = node.name,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log('InnerNodeTitlexxxx', node);
|
|
24
|
-
|
|
19
|
+
name = _node$name === void 0 ? '' : _node$name,
|
|
20
|
+
isDir = node.isDir,
|
|
21
|
+
imgUrl = node.imgUrl;
|
|
22
|
+
console.log('InnerNodeTitlexxxx', node);
|
|
23
|
+
// 文件夹
|
|
25
24
|
if (isDir) {
|
|
26
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
26
|
className: "folder"
|
|
28
27
|
}, name);
|
|
29
28
|
}
|
|
30
|
-
|
|
31
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
32
30
|
className: "node-title-wrapper"
|
|
33
31
|
}, connectDragPreview(connectDragSource( /*#__PURE__*/React.createElement("div", {
|
|
@@ -43,7 +41,6 @@ var InnerNodeTitle = function InnerNodeTitle(props) {
|
|
|
43
41
|
className: "label"
|
|
44
42
|
}, name));
|
|
45
43
|
};
|
|
46
|
-
|
|
47
44
|
export var NodeTitle = DragSource(DRAGGABLE_ALGO_COMPONENT, {
|
|
48
45
|
beginDrag: function beginDrag(props) {
|
|
49
46
|
return {
|
|
@@ -2,11 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import CategoryTree from "./category-tree";
|
|
4
4
|
import "./index.less";
|
|
5
|
-
|
|
6
5
|
var ComponentTreePanel = function ComponentTreePanel(props) {
|
|
7
6
|
var className = props.className,
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
_props$panelData = props.panelData,
|
|
8
|
+
panelData = _props$panelData === void 0 ? [] : _props$panelData;
|
|
10
9
|
console.log('ComponentTreePanelxxxxxxxx', panelData);
|
|
11
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
11
|
className: classNames(className, 'node-source-tree-container', 'node-source-tree-shadow')
|
|
@@ -16,5 +15,4 @@ var ComponentTreePanel = function ComponentTreePanel(props) {
|
|
|
16
15
|
panelData: panelData
|
|
17
16
|
})));
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
export default ComponentTreePanel;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
13
|
import React from 'react';
|
|
20
14
|
import { DatePicker, InputNumber, Radio, Select } from 'antd';
|
|
21
15
|
import moment from 'moment';
|
|
@@ -25,16 +19,17 @@ var nameMap = {
|
|
|
25
19
|
device_event: 'meterEventList',
|
|
26
20
|
model_attr: 'meterModelAttrs',
|
|
27
21
|
model_event: 'meterModelEvents'
|
|
28
|
-
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// const selectTypeData = ['meterAttrList', 'meterEventList', 'meterModelAttrs', 'meterModelEvents']
|
|
29
25
|
|
|
30
26
|
var DataOrigin = function DataOrigin(props) {
|
|
31
27
|
var value = props.value,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
onChange = props.onChange,
|
|
29
|
+
_props$defaultValue = props.defaultValue,
|
|
30
|
+
defaultValue = _props$defaultValue === void 0 ? 'variable' : _props$defaultValue,
|
|
31
|
+
relationData = props.relationData;
|
|
36
32
|
console.log('DataOrigin =========> value', value);
|
|
37
|
-
|
|
38
33
|
var handleValueTypeChange = function handleValueTypeChange(e) {
|
|
39
34
|
var valuesType = e.target.value;
|
|
40
35
|
var payload = valuesType === 'fixed' ? {
|
|
@@ -43,57 +38,47 @@ var DataOrigin = function DataOrigin(props) {
|
|
|
43
38
|
} : {
|
|
44
39
|
valuesType: valuesType
|
|
45
40
|
};
|
|
46
|
-
onChange === null || onChange === void 0
|
|
41
|
+
onChange === null || onChange === void 0 || onChange(payload);
|
|
47
42
|
};
|
|
48
|
-
|
|
49
43
|
var handleTypeChange = function handleTypeChange(type) {
|
|
50
|
-
onChange === null || onChange === void 0
|
|
44
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
51
45
|
type: type,
|
|
52
46
|
value: null
|
|
53
47
|
}));
|
|
54
48
|
};
|
|
55
|
-
|
|
56
49
|
var handleValueChange = function handleValueChange(fixedValue) {
|
|
57
|
-
onChange === null || onChange === void 0
|
|
50
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
58
51
|
value: fixedValue
|
|
59
52
|
}));
|
|
60
53
|
};
|
|
61
|
-
|
|
62
54
|
var handleBooleanChange = function handleBooleanChange(fixedValue) {
|
|
63
|
-
onChange === null || onChange === void 0
|
|
55
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
64
56
|
value: fixedValue === 1
|
|
65
57
|
}));
|
|
66
58
|
};
|
|
67
|
-
|
|
68
59
|
var handleDateChange = function handleDateChange(date) {
|
|
69
60
|
handleValueChange(date === null || date === void 0 ? void 0 : date.format('YYYY-MM-DD HH:mm:ss'));
|
|
70
61
|
};
|
|
71
|
-
|
|
72
62
|
var handleVariableChange = function handleVariableChange(variableKeyIndex) {
|
|
73
63
|
console.log('handleVariableChange', variableKeyIndex, relationData);
|
|
74
|
-
|
|
75
64
|
if (variableKeyIndex && relationData) {
|
|
76
65
|
var _relationData$name;
|
|
77
|
-
|
|
78
66
|
var valueList = variableKeyIndex === null || variableKeyIndex === void 0 ? void 0 : variableKeyIndex.split('^');
|
|
79
|
-
|
|
80
67
|
var _valueList = _slicedToArray(valueList, 4),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var sourceList = relationData === null || relationData === void 0 ? void 0 : (_relationData$name = relationData[name]) === null || _relationData$name === void 0 ? void 0 : _relationData$name[nameMap[source]];
|
|
68
|
+
name = _valueList[0],
|
|
69
|
+
source = _valueList[1],
|
|
70
|
+
targetId = _valueList[2],
|
|
71
|
+
modelId = _valueList[3];
|
|
72
|
+
var sourceList = relationData === null || relationData === void 0 || (_relationData$name = relationData[name]) === null || _relationData$name === void 0 ? void 0 : _relationData$name[nameMap[source]];
|
|
87
73
|
var relationValue = sourceList === null || sourceList === void 0 ? void 0 : sourceList.find(function (item) {
|
|
88
74
|
return (item === null || item === void 0 ? void 0 : item.source) === source && (item === null || item === void 0 ? void 0 : item.targetId) === targetId && (item === null || item === void 0 ? void 0 : item.modelId) === modelId;
|
|
89
75
|
});
|
|
90
|
-
onChange === null || onChange === void 0
|
|
76
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
91
77
|
value: relationValue,
|
|
92
78
|
variableKeyIndex: variableKeyIndex
|
|
93
79
|
}));
|
|
94
80
|
}
|
|
95
81
|
};
|
|
96
|
-
|
|
97
82
|
var relationList = keys(relationData);
|
|
98
83
|
console.log('relationData relationList', relationData);
|
|
99
84
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
@@ -111,63 +96,54 @@ var DataOrigin = function DataOrigin(props) {
|
|
|
111
96
|
onChange: handleVariableChange
|
|
112
97
|
}, relationList === null || relationList === void 0 ? void 0 : relationList.map(function (item) {
|
|
113
98
|
var _relationData$item, _relationData$item4, _relationData$item7, _relationData$item10;
|
|
114
|
-
|
|
115
99
|
if ((_relationData$item = relationData[item]) !== null && _relationData$item !== void 0 && _relationData$item.meterAttrList) {
|
|
116
|
-
var _relationData$item2, _relationData$item3
|
|
117
|
-
|
|
100
|
+
var _relationData$item2, _relationData$item3;
|
|
118
101
|
return ((_relationData$item2 = relationData[item]) === null || _relationData$item2 === void 0 ? void 0 : _relationData$item2.meterAttrList) && /*#__PURE__*/React.createElement(Select.OptGroup, {
|
|
119
102
|
key: "".concat(item, "-device-attr"),
|
|
120
103
|
label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
|
|
121
|
-
}, (_relationData$item3 = relationData[item]) === null || _relationData$item3 === void 0
|
|
104
|
+
}, (_relationData$item3 = relationData[item]) === null || _relationData$item3 === void 0 || (_relationData$item3 = _relationData$item3.meterAttrList) === null || _relationData$item3 === void 0 ? void 0 : _relationData$item3.map(function (child) {
|
|
122
105
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
123
106
|
key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
|
|
124
107
|
value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
|
|
125
108
|
}, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
|
|
126
109
|
}));
|
|
127
110
|
}
|
|
128
|
-
|
|
129
111
|
if ((_relationData$item4 = relationData[item]) !== null && _relationData$item4 !== void 0 && _relationData$item4.meterEventList) {
|
|
130
|
-
var _relationData$item5, _relationData$item6
|
|
131
|
-
|
|
112
|
+
var _relationData$item5, _relationData$item6;
|
|
132
113
|
return ((_relationData$item5 = relationData[item]) === null || _relationData$item5 === void 0 ? void 0 : _relationData$item5.meterEventList) && /*#__PURE__*/React.createElement(Select.OptGroup, {
|
|
133
114
|
key: "".concat(item, "-device-attr"),
|
|
134
115
|
label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
|
|
135
|
-
}, (_relationData$item6 = relationData[item]) === null || _relationData$item6 === void 0
|
|
116
|
+
}, (_relationData$item6 = relationData[item]) === null || _relationData$item6 === void 0 || (_relationData$item6 = _relationData$item6.meterEventList) === null || _relationData$item6 === void 0 ? void 0 : _relationData$item6.map(function (child) {
|
|
136
117
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
137
118
|
key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
|
|
138
119
|
value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
|
|
139
120
|
}, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
|
|
140
121
|
}));
|
|
141
122
|
}
|
|
142
|
-
|
|
143
123
|
if ((_relationData$item7 = relationData[item]) !== null && _relationData$item7 !== void 0 && _relationData$item7.meterModelAttrs) {
|
|
144
|
-
var _relationData$item8, _relationData$item9
|
|
145
|
-
|
|
124
|
+
var _relationData$item8, _relationData$item9;
|
|
146
125
|
return ((_relationData$item8 = relationData[item]) === null || _relationData$item8 === void 0 ? void 0 : _relationData$item8.meterModelAttrs) && /*#__PURE__*/React.createElement(Select.OptGroup, {
|
|
147
126
|
key: "".concat(item, "--device-attr"),
|
|
148
127
|
label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
|
|
149
|
-
}, (_relationData$item9 = relationData[item]) === null || _relationData$item9 === void 0
|
|
128
|
+
}, (_relationData$item9 = relationData[item]) === null || _relationData$item9 === void 0 || (_relationData$item9 = _relationData$item9.meterModelAttrs) === null || _relationData$item9 === void 0 ? void 0 : _relationData$item9.map(function (child) {
|
|
150
129
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
151
130
|
key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
|
|
152
131
|
value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
|
|
153
132
|
}, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
|
|
154
133
|
}));
|
|
155
134
|
}
|
|
156
|
-
|
|
157
135
|
if ((_relationData$item10 = relationData[item]) !== null && _relationData$item10 !== void 0 && _relationData$item10.meterModelEvents) {
|
|
158
|
-
var _relationData$item11, _relationData$item12
|
|
159
|
-
|
|
136
|
+
var _relationData$item11, _relationData$item12;
|
|
160
137
|
return ((_relationData$item11 = relationData[item]) === null || _relationData$item11 === void 0 ? void 0 : _relationData$item11.meterModelEvents) && /*#__PURE__*/React.createElement(Select.OptGroup, {
|
|
161
138
|
key: "".concat(item, "--device-attr"),
|
|
162
139
|
label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
|
|
163
|
-
}, (_relationData$item12 = relationData[item]) === null || _relationData$item12 === void 0
|
|
140
|
+
}, (_relationData$item12 = relationData[item]) === null || _relationData$item12 === void 0 || (_relationData$item12 = _relationData$item12.meterModelEvents) === null || _relationData$item12 === void 0 ? void 0 : _relationData$item12.map(function (child) {
|
|
164
141
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
165
142
|
key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
|
|
166
143
|
value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
|
|
167
144
|
}, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
|
|
168
145
|
}));
|
|
169
146
|
}
|
|
170
|
-
|
|
171
147
|
return null;
|
|
172
148
|
})), (value === null || value === void 0 ? void 0 : value.valuesType) === 'fixed' && /*#__PURE__*/React.createElement("div", {
|
|
173
149
|
style: {
|
|
@@ -211,5 +187,4 @@ var DataOrigin = function DataOrigin(props) {
|
|
|
211
187
|
}
|
|
212
188
|
})));
|
|
213
189
|
};
|
|
214
|
-
|
|
215
190
|
export default DataOrigin;
|
|
@@ -1,38 +1,29 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function _objectSpread(
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
-
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
13
|
import React, { useCallback, useEffect } from 'react';
|
|
20
14
|
import { Form, Modal, Select, Button } from 'antd';
|
|
21
15
|
import { omit } from 'lodash-es';
|
|
22
16
|
import DataOrigin from "./data-origin";
|
|
23
17
|
import "./style.less";
|
|
24
|
-
|
|
25
18
|
var ConfigureModal = function ConfigureModal(props) {
|
|
26
19
|
var visible = props.visible,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
onClose = props.onClose,
|
|
21
|
+
onSubmit = props.onSubmit,
|
|
22
|
+
relationData = props.relationData,
|
|
23
|
+
configureInfo = props.configureInfo;
|
|
32
24
|
var _Form$useForm = Form.useForm(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
26
|
+
form = _Form$useForm2[0];
|
|
36
27
|
var compareMode = ['>', '>=', '<', '<=', '==', '!='];
|
|
37
28
|
var initialValues = {
|
|
38
29
|
pre: {
|
|
@@ -43,30 +34,26 @@ var ConfigureModal = function ConfigureModal(props) {
|
|
|
43
34
|
type: 'number'
|
|
44
35
|
}
|
|
45
36
|
};
|
|
46
|
-
|
|
47
37
|
var handleClose = function handleClose() {
|
|
48
38
|
onClose();
|
|
49
39
|
form.resetFields();
|
|
50
40
|
};
|
|
51
|
-
|
|
52
41
|
var handleSubmit = function handleSubmit(payload) {
|
|
53
42
|
console.log('handleSubmit payload', payload);
|
|
54
43
|
var pre = payload.pre,
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
compare = payload.compare,
|
|
45
|
+
next = payload.next;
|
|
57
46
|
var preOmit = omit(pre, ['variableKeyIndex']);
|
|
58
47
|
var nextOmit = omit(next, ['variableKeyIndex']);
|
|
59
48
|
var store = [preOmit, compare, nextOmit];
|
|
60
|
-
onSubmit === null || onSubmit === void 0
|
|
49
|
+
onSubmit === null || onSubmit === void 0 || onSubmit({
|
|
61
50
|
store: store,
|
|
62
51
|
relation: configureInfo === null || configureInfo === void 0 ? void 0 : configureInfo.relation
|
|
63
52
|
});
|
|
64
53
|
handleClose();
|
|
65
54
|
};
|
|
66
|
-
|
|
67
55
|
var formReset = useCallback(function (configure) {
|
|
68
56
|
if (configure.valuesType === 'fixed') return configure;
|
|
69
|
-
|
|
70
57
|
if (configure.valuesType === 'variable') {
|
|
71
58
|
var configureValue = configure === null || configure === void 0 ? void 0 : configure.value;
|
|
72
59
|
var variableKeyIndex = configureValue && "".concat(configureValue.targetName, "-").concat(configureValue.type, "^").concat(configureValue.source, "^").concat(configureValue.targetId, "^").concat(configureValue.modelId);
|
|
@@ -74,17 +61,15 @@ var ConfigureModal = function ConfigureModal(props) {
|
|
|
74
61
|
variableKeyIndex: variableKeyIndex
|
|
75
62
|
}) : configure;
|
|
76
63
|
}
|
|
77
|
-
|
|
78
64
|
return {};
|
|
79
65
|
}, []);
|
|
80
66
|
useEffect(function () {
|
|
81
67
|
if (visible && configureInfo) {
|
|
82
68
|
var _configureInfo$store, _configureInfo$store2, _configureInfo$store3;
|
|
83
|
-
|
|
84
69
|
var _payload = {
|
|
85
|
-
pre: formReset(configureInfo === null || configureInfo === void 0
|
|
86
|
-
compare: configureInfo === null || configureInfo === void 0
|
|
87
|
-
next: formReset(configureInfo === null || configureInfo === void 0
|
|
70
|
+
pre: formReset(configureInfo === null || configureInfo === void 0 || (_configureInfo$store = configureInfo.store) === null || _configureInfo$store === void 0 ? void 0 : _configureInfo$store[0]),
|
|
71
|
+
compare: configureInfo === null || configureInfo === void 0 || (_configureInfo$store2 = configureInfo.store) === null || _configureInfo$store2 === void 0 ? void 0 : _configureInfo$store2[1],
|
|
72
|
+
next: formReset(configureInfo === null || configureInfo === void 0 || (_configureInfo$store3 = configureInfo.store) === null || _configureInfo$store3 === void 0 ? void 0 : _configureInfo$store3[2])
|
|
88
73
|
};
|
|
89
74
|
form.setFieldsValue(_payload);
|
|
90
75
|
console.log('========================>', _payload);
|
|
@@ -163,5 +148,4 @@ var ConfigureModal = function ConfigureModal(props) {
|
|
|
163
148
|
className: "condition-form-btn"
|
|
164
149
|
}, "\u786E\u5B9A")))));
|
|
165
150
|
};
|
|
166
|
-
|
|
167
151
|
export default ConfigureModal;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function _objectSpread(
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Divider, Select } from 'antd';
|
|
9
9
|
import "./style.less";
|
|
10
|
-
|
|
11
10
|
var CrossLine = function CrossLine(props) {
|
|
12
11
|
var value = props.value,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
onRelationChange = props.onRelationChange,
|
|
13
|
+
disabled = props.disabled;
|
|
16
14
|
var handleChange = function handleChange(relation) {
|
|
17
|
-
onRelationChange === null || onRelationChange === void 0
|
|
15
|
+
onRelationChange === null || onRelationChange === void 0 || onRelationChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
18
16
|
relation: relation
|
|
19
17
|
}));
|
|
20
18
|
};
|
|
21
|
-
|
|
22
19
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
20
|
className: "condition-cross-line"
|
|
24
21
|
}, /*#__PURE__*/React.createElement(Divider, {
|
|
@@ -41,5 +38,4 @@ var CrossLine = function CrossLine(props) {
|
|
|
41
38
|
value: "OR"
|
|
42
39
|
}, "OR"))));
|
|
43
40
|
};
|
|
44
|
-
|
|
45
41
|
export default CrossLine;
|