strategy-panel 1.0.0 → 1.0.1

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.
Files changed (58) hide show
  1. package/.fatherrc.ts +26 -26
  2. package/.umirc.ts +29 -29
  3. package/README.md +33 -33
  4. package/es/assets/rhombus.svg +3 -3
  5. package/es/common/graph-common/node-element/common-element.less +117 -117
  6. package/es/common/graph-common/node-element/condition-element.d.ts +1 -0
  7. package/es/common/graph-common/node-element/condition-element.js +28 -3
  8. package/es/common/graph-common/node-element/condition-element.less +1 -2
  9. package/es/common/graph-common/node-element/logical-element.d.ts +1 -0
  10. package/es/common/graph-common/node-element/logical-element.js +28 -3
  11. package/es/common/graph-common/node-element/node-element.d.ts +1 -0
  12. package/es/common/graph-common/node-element/node-element.js +29 -4
  13. package/es/hooks/withMode.d.ts +1 -0
  14. package/es/hooks/withMode.js +16 -0
  15. package/es/pages/component-tree-panel/category-tree/index.less +36 -35
  16. package/es/pages/config-panel/components/condition-configuration/configure-modal/data-origin.js +26 -15
  17. package/es/pages/config-panel/components/condition-configuration/configure-modal/index.js +3 -6
  18. package/es/pages/config-panel/components/condition-configuration/cross-line.d.ts +1 -0
  19. package/es/pages/config-panel/components/condition-configuration/cross-line.js +3 -1
  20. package/es/pages/config-panel/components/condition-configuration/index.d.ts +1 -1
  21. package/es/pages/config-panel/components/condition-configuration/index.js +12 -9
  22. package/es/pages/config-panel/components/condition-configuration/style.less +74 -70
  23. package/es/pages/config-panel/components/time-trigger/components/cycle-time.d.ts +1 -0
  24. package/es/pages/config-panel/components/time-trigger/components/cycle-time.js +35 -20
  25. package/es/pages/config-panel/components/time-trigger/components/time-horizon.d.ts +1 -0
  26. package/es/pages/config-panel/components/time-trigger/components/time-horizon.js +12 -9
  27. package/es/pages/config-panel/components/time-trigger/delay-time.d.ts +1 -0
  28. package/es/pages/config-panel/components/time-trigger/delay-time.js +3 -1
  29. package/es/pages/config-panel/components/time-trigger/index.d.ts +1 -1
  30. package/es/pages/config-panel/components/time-trigger/index.js +15 -10
  31. package/es/pages/config-panel/components/time-trigger/interval-time.d.ts +1 -0
  32. package/es/pages/config-panel/components/time-trigger/interval-time.js +5 -2
  33. package/es/pages/config-panel/components/time-trigger/persistent-time.d.ts +1 -0
  34. package/es/pages/config-panel/components/time-trigger/persistent-time.js +3 -1
  35. package/es/pages/config-panel/components/time-trigger/timing-time.d.ts +1 -0
  36. package/es/pages/config-panel/components/time-trigger/timing-time.js +4 -1
  37. package/es/pages/config-panel/config-common.d.ts +1 -1
  38. package/es/pages/config-panel/config-common.js +9 -5
  39. package/es/pages/config-panel/index.d.ts +1 -0
  40. package/es/pages/config-panel/index.js +4 -1
  41. package/es/pages/config-panel/node-form.d.ts +1 -0
  42. package/es/pages/config-panel/node-form.js +13 -29
  43. package/es/pages/config-panel/style.less +23 -4
  44. package/es/pages/dag-canvas/canvas-content.d.ts +1 -0
  45. package/es/pages/dag-canvas/canvas-content.js +3 -1
  46. package/es/pages/dag-canvas/index.d.ts +5 -0
  47. package/es/pages/dag-canvas/index.js +3 -1
  48. package/es/pages/dag-canvas/preview.d.ts +1 -0
  49. package/es/pages/dag-canvas/preview.js +9 -1
  50. package/es/pages/index.d.ts +6 -1
  51. package/es/pages/index.js +6 -1
  52. package/es/pages/index.less +50 -50
  53. package/es/pages/rx-models/experiment-graph.d.ts +4 -4
  54. package/es/pages/rx-models/experiment-graph.js +116 -84
  55. package/es/pages/strategy-header/index.js +16 -3
  56. package/es/pages/strategy-header/style.less +22 -22
  57. package/es/typings.d.ts +14 -6
  58. package/package.json +1 -1
@@ -1,35 +1,36 @@
1
- @import (reference) '../../../style/theme-light';
2
-
3
- .category-tree-list {
4
- height: 100%;
5
- overflow-x: hidden;
6
- overflow-y: auto;
7
- background: #fff;
8
-
9
- .category-tree-collapse {
10
- border: none;
11
-
12
- .ant-collapse-header {
13
- height: 36px;
14
- font-size: 14px;
15
- line-height: 1;
16
- background: @light-gray-bg;
17
- }
18
- .ant-collapse-header > div {
19
- position: absolute;
20
- right: 0;
21
- }
22
- .ant-collapse-header > div > span {
23
- color: rgba(142, 142, 142, 0.52);
24
- }
25
- .ant-collapse-content > .ant-collapse-content-box {
26
- padding-bottom: 5px;
27
- }
28
- .ant-collapse-content {
29
- border-top: none;
30
- }
31
- .ant-collapse-item {
32
- border-bottom: none;
33
- }
34
- }
35
- }
1
+ @import (reference) '../../../style/theme-light';
2
+
3
+ .category-tree-list {
4
+ height: 100%;
5
+ overflow-x: hidden;
6
+ overflow-y: auto;
7
+ background: #fff;
8
+
9
+ .category-tree-collapse {
10
+ border-color: #DCDCDC;
11
+
12
+ .ant-collapse-header {
13
+ height: 36px;
14
+ font-size: 14px;
15
+ line-height: 1 !important;
16
+ background: @light-gray-bg;
17
+
18
+ }
19
+ .ant-collapse-header > div {
20
+ position: absolute;
21
+ right: 0;
22
+ }
23
+ .ant-collapse-header > div > span {
24
+ color: rgba(142, 142, 142, 0.52);
25
+ }
26
+ .ant-collapse-content > .ant-collapse-content-box {
27
+ padding-bottom: 5px;
28
+ }
29
+ .ant-collapse-content {
30
+ border-top: 1px solid #DCDCDC;
31
+ }
32
+ .ant-collapse-item {
33
+ border-bottom: 1px solid #DCDCDC;
34
+ }
35
+ }
36
+ }
@@ -67,15 +67,23 @@ var DataOrigin = function DataOrigin(props) {
67
67
  }));
68
68
  };
69
69
 
70
+ var handleBooleanChange = function handleBooleanChange(fixedValue) {
71
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, value), {}, {
72
+ value: fixedValue === 1
73
+ }));
74
+ };
75
+
70
76
  var handleDateChange = function handleDateChange(date) {
71
77
  handleValueChange(date === null || date === void 0 ? void 0 : date.format('YYYY-MM-DD HH:mm:ss'));
72
78
  };
73
79
 
74
80
  var handleVariableChange = function handleVariableChange(variableKeyIndex) {
81
+ console.log('handleVariableChange', variableKeyIndex, relationData);
82
+
75
83
  if (variableKeyIndex && relationData) {
76
84
  var _relationData$name;
77
85
 
78
- var valueList = variableKeyIndex === null || variableKeyIndex === void 0 ? void 0 : variableKeyIndex.split('-');
86
+ var valueList = variableKeyIndex === null || variableKeyIndex === void 0 ? void 0 : variableKeyIndex.split('^');
79
87
 
80
88
  var _valueList = _slicedToArray(valueList, 4),
81
89
  name = _valueList[0],
@@ -84,7 +92,7 @@ var DataOrigin = function DataOrigin(props) {
84
92
  modelId = _valueList[3];
85
93
 
86
94
  var sourceList = relationData === null || relationData === void 0 ? void 0 : (_relationData$name = relationData[name]) === null || _relationData$name === void 0 ? void 0 : _relationData$name[nameMap[source]];
87
- var relationValue = sourceList === null || sourceList === void 0 ? void 0 : sourceList.findIndex(function (item) {
95
+ var relationValue = sourceList === null || sourceList === void 0 ? void 0 : sourceList.find(function (item) {
88
96
  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
97
  });
90
98
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, value), {}, {
@@ -95,6 +103,7 @@ var DataOrigin = function DataOrigin(props) {
95
103
  };
96
104
 
97
105
  var relationList = keys(relationData);
106
+ console.log('relationData relationList', relationData);
98
107
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Radio.Group, {
99
108
  value: (value === null || value === void 0 ? void 0 : value.valuesType) || defaultValue,
100
109
  onChange: handleValueTypeChange
@@ -115,12 +124,12 @@ var DataOrigin = function DataOrigin(props) {
115
124
  var _relationData$item2, _relationData$item3, _relationData$item3$m;
116
125
 
117
126
  return ((_relationData$item2 = relationData[item]) === null || _relationData$item2 === void 0 ? void 0 : _relationData$item2.meterAttrList) && /*#__PURE__*/React.createElement(_Select.OptGroup, {
118
- key: "".concat(item, "--device-attr"),
127
+ key: "".concat(item, "-device-attr"),
119
128
  label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
120
129
  }, (_relationData$item3 = relationData[item]) === null || _relationData$item3 === void 0 ? void 0 : (_relationData$item3$m = _relationData$item3.meterAttrList) === null || _relationData$item3$m === void 0 ? void 0 : _relationData$item3$m.map(function (child) {
121
130
  return /*#__PURE__*/React.createElement(_Select.Option, {
122
- key: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId),
123
- value: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId)
131
+ key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
132
+ value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
124
133
  }, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
125
134
  }));
126
135
  }
@@ -129,12 +138,12 @@ var DataOrigin = function DataOrigin(props) {
129
138
  var _relationData$item5, _relationData$item6, _relationData$item6$m;
130
139
 
131
140
  return ((_relationData$item5 = relationData[item]) === null || _relationData$item5 === void 0 ? void 0 : _relationData$item5.meterEventList) && /*#__PURE__*/React.createElement(_Select.OptGroup, {
132
- key: "".concat(item, "--device-attr"),
141
+ key: "".concat(item, "-device-attr"),
133
142
  label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
134
143
  }, (_relationData$item6 = relationData[item]) === null || _relationData$item6 === void 0 ? void 0 : (_relationData$item6$m = _relationData$item6.meterEventList) === null || _relationData$item6$m === void 0 ? void 0 : _relationData$item6$m.map(function (child) {
135
144
  return /*#__PURE__*/React.createElement(_Select.Option, {
136
- key: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId),
137
- value: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId)
145
+ key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
146
+ value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
138
147
  }, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
139
148
  }));
140
149
  }
@@ -147,8 +156,8 @@ var DataOrigin = function DataOrigin(props) {
147
156
  label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
148
157
  }, (_relationData$item9 = relationData[item]) === null || _relationData$item9 === void 0 ? void 0 : (_relationData$item9$m = _relationData$item9.meterModelAttrs) === null || _relationData$item9$m === void 0 ? void 0 : _relationData$item9$m.map(function (child) {
149
158
  return /*#__PURE__*/React.createElement(_Select.Option, {
150
- key: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId),
151
- value: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId)
159
+ key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
160
+ value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
152
161
  }, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
153
162
  }));
154
163
  }
@@ -161,11 +170,13 @@ var DataOrigin = function DataOrigin(props) {
161
170
  label: "".concat(item, " - \u8BBE\u5907\u5C5E\u6027")
162
171
  }, (_relationData$item12 = relationData[item]) === null || _relationData$item12 === void 0 ? void 0 : (_relationData$item12$ = _relationData$item12.meterModelEvents) === null || _relationData$item12$ === void 0 ? void 0 : _relationData$item12$.map(function (child) {
163
172
  return /*#__PURE__*/React.createElement(_Select.Option, {
164
- key: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId),
165
- value: "".concat(item, "-").concat(child.source, "-").concat(child.targetId, "-").concat(child.modelId)
173
+ key: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId),
174
+ value: "".concat(item, "^").concat(child.source, "^").concat(child.targetId, "^").concat(child.modelId)
166
175
  }, child.targetName, "-", child === null || child === void 0 ? void 0 : child.modelName);
167
176
  }));
168
177
  }
178
+
179
+ return null;
169
180
  })), (value === null || value === void 0 ? void 0 : value.valuesType) === 'fixed' && /*#__PURE__*/React.createElement("div", {
170
181
  style: {
171
182
  marginTop: 15
@@ -188,15 +199,15 @@ var DataOrigin = function DataOrigin(props) {
188
199
  }
189
200
  }), (value === null || value === void 0 ? void 0 : value.type) === 'boolean' && /*#__PURE__*/React.createElement(_Select, {
190
201
  value: value === null || value === void 0 ? void 0 : value.value,
191
- onChange: handleValueChange,
202
+ onChange: handleBooleanChange,
192
203
  style: {
193
204
  width: '100%',
194
205
  marginTop: 15
195
206
  }
196
207
  }, /*#__PURE__*/React.createElement(_Select.Option, {
197
- value: true
208
+ value: 1
198
209
  }, "True"), /*#__PURE__*/React.createElement(_Select.Option, {
199
- value: false
210
+ value: 0
200
211
  }, "False")), (value === null || value === void 0 ? void 0 : value.type) === 'time' && /*#__PURE__*/React.createElement(_DatePicker, {
201
212
  showTime: true,
202
213
  value: (value === null || value === void 0 ? void 0 : value.value) && moment(value === null || value === void 0 ? void 0 : value.value),
@@ -76,12 +76,9 @@ var ConfigureModal = function ConfigureModal(props) {
76
76
  if (configure.valuesType === 'fixed') return configure;
77
77
 
78
78
  if (configure.valuesType === 'variable') {
79
- var variableKeyIndex = relationData === null || relationData === void 0 ? void 0 : relationData.findIndex(function (item) {
80
- var _configure$value, _configure$value2, _configure$value3;
81
-
82
- return (item === null || item === void 0 ? void 0 : item.type) === (configure === null || configure === void 0 ? void 0 : (_configure$value = configure.value) === null || _configure$value === void 0 ? void 0 : _configure$value.type) && (item === null || item === void 0 ? void 0 : item.targetId) === (configure === null || configure === void 0 ? void 0 : (_configure$value2 = configure.value) === null || _configure$value2 === void 0 ? void 0 : _configure$value2.targetId) && (item === null || item === void 0 ? void 0 : item.modelId) === (configure === null || configure === void 0 ? void 0 : (_configure$value3 = configure.value) === null || _configure$value3 === void 0 ? void 0 : _configure$value3.modelId);
83
- });
84
- return variableKeyIndex > -1 ? _objectSpread(_objectSpread({}, configure), {}, {
79
+ var configureValue = configure === null || configure === void 0 ? void 0 : configure.value;
80
+ var variableKeyIndex = configureValue && "".concat(configureValue.targetName, "-").concat(configureValue.type, "^").concat(configureValue.source, "^").concat(configureValue.targetId, "^").concat(configureValue.modelId);
81
+ return variableKeyIndex ? _objectSpread(_objectSpread({}, configure), {}, {
85
82
  variableKeyIndex: variableKeyIndex
86
83
  }) : configure;
87
84
  }
@@ -3,6 +3,7 @@ import './style.less';
3
3
  interface Props {
4
4
  value: any;
5
5
  onRelationChange?: (value: any) => void;
6
+ disabled: boolean;
6
7
  }
7
8
  declare const CrossLine: React.FC<Props>;
8
9
  export default CrossLine;
@@ -14,7 +14,8 @@ import "./style.less";
14
14
 
15
15
  var CrossLine = function CrossLine(props) {
16
16
  var value = props.value,
17
- onRelationChange = props.onRelationChange;
17
+ onRelationChange = props.onRelationChange,
18
+ disabled = props.disabled;
18
19
 
19
20
  var handleChange = function handleChange(relation) {
20
21
  onRelationChange === null || onRelationChange === void 0 ? void 0 : onRelationChange(_objectSpread(_objectSpread({}, value), {}, {
@@ -29,6 +30,7 @@ var CrossLine = function CrossLine(props) {
29
30
  margin: 0
30
31
  }
31
32
  }, /*#__PURE__*/React.createElement(_Select, {
33
+ disabled: disabled,
32
34
  style: {
33
35
  width: 60
34
36
  },
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './style.less';
3
- interface Props {
3
+ interface Props extends Types.PanelComponentProps {
4
4
  experimentId: string;
5
5
  value?: any;
6
6
  onChange?: (value: any) => void;
@@ -25,7 +25,7 @@ import "./style.less";
25
25
  import { useObservableState } from "../../../../hooks/useObservableState";
26
26
 
27
27
  var getRelationData = function getRelationData(expGraph, nodeId) {
28
- var _expGraph$graph, _equipment$store, _equipment$store$data, _equipment$store$data2, _variate$store, _variate$store$data, _variate$store$data$d, _equipment$store2, _equipment$store2$dat, _equipment$store2$dat2;
28
+ var _expGraph$graph, _equipment$store, _equipment$store$data, _equipment$store$data2;
29
29
 
30
30
  if (!nodeId) return;
31
31
  var nodes = expGraph === null || expGraph === void 0 ? void 0 : (_expGraph$graph = expGraph.graph) === null || _expGraph$graph === void 0 ? void 0 : _expGraph$graph.getNodes();
@@ -39,15 +39,18 @@ var getRelationData = function getRelationData(expGraph, nodeId) {
39
39
 
40
40
  return (item === null || item === void 0 ? void 0 : (_item$id2 = item.id) === null || _item$id2 === void 0 ? void 0 : _item$id2.indexOf(COMMONLY_USED.VARIATE)) > -1;
41
41
  });
42
- var equipmentData = (equipment === null || equipment === void 0 ? void 0 : (_equipment$store = equipment.store) === null || _equipment$store === void 0 ? void 0 : (_equipment$store$data = _equipment$store.data) === null || _equipment$store$data === void 0 ? void 0 : (_equipment$store$data2 = _equipment$store$data.data) === null || _equipment$store$data2 === void 0 ? void 0 : _equipment$store$data2.nodeData) || [];
43
- var variateData = (variate === null || variate === void 0 ? void 0 : (_variate$store = variate.store) === null || _variate$store === void 0 ? void 0 : (_variate$store$data = _variate$store.data) === null || _variate$store$data === void 0 ? void 0 : (_variate$store$data$d = _variate$store$data.data) === null || _variate$store$data$d === void 0 ? void 0 : _variate$store$data$d.nodeData) || [];
44
- return (equipment === null || equipment === void 0 ? void 0 : (_equipment$store2 = equipment.store) === null || _equipment$store2 === void 0 ? void 0 : (_equipment$store2$dat = _equipment$store2.data) === null || _equipment$store2$dat === void 0 ? void 0 : (_equipment$store2$dat2 = _equipment$store2$dat.data) === null || _equipment$store2$dat2 === void 0 ? void 0 : _equipment$store2$dat2.nodeData) || [];
42
+ console.log('equipmentData', equipment === null || equipment === void 0 ? void 0 : equipment.getData());
43
+ console.log('equipmentData', variate === null || variate === void 0 ? void 0 : variate.getData());
44
+ return (equipment === null || equipment === void 0 ? void 0 : (_equipment$store = equipment.store) === null || _equipment$store === void 0 ? void 0 : (_equipment$store$data = _equipment$store.data) === null || _equipment$store$data === void 0 ? void 0 : (_equipment$store$data2 = _equipment$store$data.data) === null || _equipment$store$data2 === void 0 ? void 0 : _equipment$store$data2.nodeData) || [];
45
45
  };
46
46
 
47
47
  var ConditionConfiguration = function ConditionConfiguration(props) {
48
48
  var value = props.value,
49
49
  onChange = props.onChange,
50
- experimentId = props.experimentId;
50
+ experimentId = props.experimentId,
51
+ mode = props.mode; // mode === view 禁止编辑
52
+
53
+ var modeDisabled = mode === 'view';
51
54
 
52
55
  var _useState = useState(),
53
56
  _useState2 = _slicedToArray(_useState, 2),
@@ -63,8 +66,7 @@ var ConditionConfiguration = function ConditionConfiguration(props) {
63
66
  activeNodeInstance = _useObservableState2[0];
64
67
 
65
68
  var nodeId = activeNodeInstance === null || activeNodeInstance === void 0 ? void 0 : activeNodeInstance.id;
66
- console.log('activeNodeInstance', expGraph, activeNodeInstance); // TODO 上级所有的变量
67
-
69
+ console.log('activeNodeInstance', props);
68
70
  var relationData = getRelationData(expGraph, nodeId);
69
71
 
70
72
  var _useState3 = useState(false),
@@ -136,7 +138,7 @@ var ConditionConfiguration = function ConditionConfiguration(props) {
136
138
  className: classNames('pos-btw', 'configure-line')
137
139
  }, /*#__PURE__*/React.createElement("div", {
138
140
  className: classNames('flex-1', 'mr-10', 'title')
139
- }, titleFormat(item === null || item === void 0 ? void 0 : item.store)), /*#__PURE__*/React.createElement("div", {
141
+ }, titleFormat(item === null || item === void 0 ? void 0 : item.store)), !modeDisabled && /*#__PURE__*/React.createElement("div", {
140
142
  className: "pos-line-center"
141
143
  }, /*#__PURE__*/React.createElement(ReactSVG, {
142
144
  onClick: function onClick() {
@@ -156,13 +158,14 @@ var ConditionConfiguration = function ConditionConfiguration(props) {
156
158
  src: require("../../../../assets/delete.svg"),
157
159
  className: "icon"
158
160
  })))), index !== value.length - 1 && /*#__PURE__*/React.createElement(CrossLine, {
161
+ disabled: modeDisabled,
159
162
  value: item,
160
163
  onRelationChange: function onRelationChange(info) {
161
164
  return handleRelationChange(info, index);
162
165
  }
163
166
  }))
164
167
  );
165
- }), /*#__PURE__*/React.createElement("div", {
168
+ }), !modeDisabled && /*#__PURE__*/React.createElement("div", {
166
169
  className: "condition-edit-box",
167
170
  onClick: handleOpenConfigure
168
171
  }, /*#__PURE__*/React.createElement(ReactSVG, {
@@ -1,70 +1,74 @@
1
- @import "../../../../style/position";
2
- @import "../../../../style/basic";
3
-
4
-
5
- @icon-color: #0052D9;
6
- @configure-title-bg: #F2F2F2;
7
- @configure-title-border: #F2F2F2;
8
-
9
-
10
- .condition-edit-box{
11
- display: flex;
12
- flex-direction: row;
13
- align-items: center;
14
- color: @icon-color;
15
- cursor: pointer;
16
-
17
- & .icon{
18
- width: 22px;
19
- height: 22px;
20
- margin-right: 6px;
21
- cursor: pointer;
22
- div{
23
- height: 22px;
24
- }
25
- svg {
26
- width: 22px;
27
- height: 22px;
28
- path {
29
- fill: @icon-color;
30
- }
31
- }
32
- }
33
- }
34
-
35
- .configure-line{
36
- .title{
37
- padding: 5px 12px;
38
- background: #F2F2F2;
39
- border: 1px solid #D3D3D3;
40
- border-radius: 4px;
41
- overflow: hidden;
42
- word-break: break-all;
43
- }
44
- .icon{
45
- width: 20px;
46
- height: 20px;
47
- cursor: pointer;
48
- div{
49
- height: 20px;
50
- }
51
- svg {
52
- width: 20px;
53
- height: 20px;
54
- }
55
- }
56
-
57
- }
58
-
59
- .condition-cross-line{
60
- .ant-select-single.ant-select-show-arrow .ant-select-selection-item,
61
- .ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{
62
- padding-right: 0;
63
- }
64
- .ant-select-arrow{
65
- display: none;
66
- }
67
- .ant-divider-inner-text{
68
- padding: 0;
69
- }
70
- }
1
+ @import "../../../../style/position";
2
+ @import "../../../../style/basic";
3
+
4
+
5
+ @icon-color: #0052D9;
6
+ @configure-title-bg: #F2F2F2;
7
+ @configure-title-border: #F2F2F2;
8
+
9
+
10
+ .condition-edit-box{
11
+ display: flex;
12
+ flex-direction: row;
13
+ align-items: center;
14
+ color: @icon-color;
15
+ cursor: pointer;
16
+
17
+ & .icon{
18
+ width: 22px;
19
+ height: 22px;
20
+ margin-right: 6px;
21
+ cursor: pointer;
22
+ div{
23
+ height: 22px;
24
+ }
25
+ svg {
26
+ width: 22px;
27
+ height: 22px;
28
+ path {
29
+ fill: @icon-color;
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ .configure-line{
36
+ .title{
37
+ padding: 5px 12px;
38
+ background: #F2F2F2;
39
+ border: 1px solid #D3D3D3;
40
+ border-radius: 4px;
41
+ overflow: hidden;
42
+ word-break: break-all;
43
+ }
44
+ .icon{
45
+ width: 20px;
46
+ height: 20px;
47
+ cursor: pointer;
48
+ div{
49
+ height: 20px;
50
+ }
51
+ svg {
52
+ width: 20px;
53
+ height: 20px;
54
+ }
55
+ }
56
+
57
+ }
58
+
59
+ .condition-cross-line{
60
+ .ant-select-single.ant-select-show-arrow .ant-select-selection-item,
61
+ .ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{
62
+ padding-right: 0;
63
+ text-align: center;
64
+ }
65
+ .ant-select-arrow{
66
+ display: none;
67
+ }
68
+ .ant-divider-inner-text{
69
+ padding: 0;
70
+ }
71
+ .ant-select:not(.ant-select-customize-input) .ant-select-selector{
72
+ background: transparent !important;
73
+ }
74
+ }
@@ -3,6 +3,7 @@ import '@/pages/config-panel/style.less';
3
3
  interface Props {
4
4
  value?: any;
5
5
  onChange?: (value: any) => void;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const CycleTime: React.FC<Props>;
8
9
  export default CycleTime;
@@ -18,20 +18,24 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
18
18
  import React from 'react';
19
19
  import classNames from 'classnames';
20
20
  import "../../../style.less";
21
+ var MonthDayList = Array.from(new Array(31), function (item, index) {
22
+ return index + 1;
23
+ });
21
24
 
22
25
  var CycleTime = function CycleTime(props) {
23
26
  var value = props.value,
24
- onChange = props.onChange;
27
+ onChange = props.onChange,
28
+ disabled = props.disabled;
25
29
 
26
- var timeTypeChange = function timeTypeChange(cycleType) {
30
+ var timeTypeChange = function timeTypeChange(date) {
27
31
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, value), {}, {
28
- cycleType: cycleType
32
+ date: date
29
33
  }));
30
34
  };
31
35
 
32
- var cycleTimeChange = function cycleTimeChange(cycleTime) {
36
+ var cycleTimeChange = function cycleTimeChange(time) {
33
37
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, value), {}, {
34
- cycleTime: cycleTime
38
+ time: time
35
39
  }));
36
40
  };
37
41
 
@@ -45,41 +49,52 @@ var CycleTime = function CycleTime(props) {
45
49
  label: "\u89E6\u53D1\u65F6\u95F4",
46
50
  required: true,
47
51
  className: "no-margin-bottom",
48
- validateStatus: (value === null || value === void 0 ? void 0 : value.cycleType) ? 'success' : 'error'
49
- }, /*#__PURE__*/React.createElement(_Select, {
50
- value: value === null || value === void 0 ? void 0 : value.cycleType,
52
+ validateStatus: (value === null || value === void 0 ? void 0 : value.date) ? 'success' : 'error'
53
+ }, (value === null || value === void 0 ? void 0 : value.cycle) === 'week' && /*#__PURE__*/React.createElement(_Select, {
54
+ disabled: disabled,
55
+ value: value === null || value === void 0 ? void 0 : value.date,
51
56
  onChange: timeTypeChange
52
57
  }, /*#__PURE__*/React.createElement(_Select.Option, {
53
- value: "workday"
58
+ value: 8
54
59
  }, "\u5DE5\u4F5C\u65E5"), /*#__PURE__*/React.createElement(_Select.Option, {
55
- value: "nonWorkdays"
60
+ value: 9
56
61
  }, "\u975E\u5DE5\u4F5C\u65E5"), /*#__PURE__*/React.createElement(_Select.Option, {
57
- value: "monday"
62
+ value: 1
58
63
  }, "\u5468\u4E00"), /*#__PURE__*/React.createElement(_Select.Option, {
59
- value: "tuesday"
64
+ value: 2
60
65
  }, "\u5468\u4E8C"), /*#__PURE__*/React.createElement(_Select.Option, {
61
- value: "wednesday"
66
+ value: 3
62
67
  }, "\u5468\u4E09"), /*#__PURE__*/React.createElement(_Select.Option, {
63
- value: "thursday"
68
+ value: 4
64
69
  }, "\u5468\u56DB"), /*#__PURE__*/React.createElement(_Select.Option, {
65
- value: "friday"
70
+ value: 5
66
71
  }, "\u5468\u4E94"), /*#__PURE__*/React.createElement(_Select.Option, {
67
- value: "saturday"
72
+ value: 6
68
73
  }, "\u5468\u516D"), /*#__PURE__*/React.createElement(_Select.Option, {
69
- value: "sunday"
70
- }, "\u5468\u65E5")))), /*#__PURE__*/React.createElement(_Col, {
74
+ value: 7
75
+ }, "\u5468\u65E5")), (value === null || value === void 0 ? void 0 : value.cycle) === 'month' && /*#__PURE__*/React.createElement(_Select, {
76
+ disabled: disabled,
77
+ value: value === null || value === void 0 ? void 0 : value.date,
78
+ onChange: timeTypeChange
79
+ }, MonthDayList === null || MonthDayList === void 0 ? void 0 : MonthDayList.map(function (item) {
80
+ return /*#__PURE__*/React.createElement(_Select.Option, {
81
+ key: item,
82
+ value: item
83
+ }, item, "\u65E5");
84
+ })))), /*#__PURE__*/React.createElement(_Col, {
71
85
  span: (value === null || value === void 0 ? void 0 : value.cycle) === 'day' ? 24 : 12
72
86
  }, /*#__PURE__*/React.createElement(_Form.Item, {
73
87
  required: (value === null || value === void 0 ? void 0 : value.cycle) === 'day',
74
88
  label: (value === null || value === void 0 ? void 0 : value.cycle) === 'day' ? '触发时间' : ' ',
75
89
  className: "no-margin-bottom",
76
- validateStatus: (value === null || value === void 0 ? void 0 : value.cycleTime) ? 'success' : 'error'
90
+ validateStatus: (value === null || value === void 0 ? void 0 : value.time) ? 'success' : 'error'
77
91
  }, /*#__PURE__*/React.createElement(_TimePicker, {
92
+ disabled: disabled,
78
93
  placeholder: "",
79
94
  style: {
80
95
  width: '100%'
81
96
  },
82
- value: value === null || value === void 0 ? void 0 : value.cycleTime,
97
+ value: value === null || value === void 0 ? void 0 : value.time,
83
98
  onChange: cycleTimeChange
84
99
  })))));
85
100
  };
@@ -4,6 +4,7 @@ interface Props {
4
4
  title: string;
5
5
  value?: any;
6
6
  onChange?: (value: any) => void;
7
+ disabled?: boolean;
7
8
  }
8
9
  declare const TimeHorizon: React.FC<Props>;
9
10
  export default TimeHorizon;
@@ -21,17 +21,18 @@ import "../../../style.less";
21
21
  var TimeHorizon = function TimeHorizon(props) {
22
22
  var title = props.title,
23
23
  value = props.value,
24
- onChange = props.onChange;
24
+ onChange = props.onChange,
25
+ disabled = props.disabled;
25
26
 
26
- var timeNumberChange = function timeNumberChange(time) {
27
+ var timeNumberChange = function timeNumberChange(duration) {
27
28
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, value), {}, {
28
- time: time
29
+ duration: duration
29
30
  }));
30
31
  };
31
32
 
32
- var timeTypeChange = function timeTypeChange(type) {
33
+ var timeTypeChange = function timeTypeChange(unit) {
33
34
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, value), {}, {
34
- type: type
35
+ unit: unit
35
36
  }));
36
37
  };
37
38
 
@@ -43,9 +44,10 @@ var TimeHorizon = function TimeHorizon(props) {
43
44
  label: title,
44
45
  required: true,
45
46
  className: "no-margin-bottom",
46
- validateStatus: (value === null || value === void 0 ? void 0 : value.time) ? 'success' : 'error'
47
+ validateStatus: (value === null || value === void 0 ? void 0 : value.duration) ? 'success' : 'error'
47
48
  }, /*#__PURE__*/React.createElement(_InputNumber, {
48
- value: value === null || value === void 0 ? void 0 : value.time,
49
+ disabled: disabled,
50
+ value: value === null || value === void 0 ? void 0 : value.duration,
49
51
  onChange: timeNumberChange,
50
52
  style: {
51
53
  width: '100%'
@@ -55,9 +57,10 @@ var TimeHorizon = function TimeHorizon(props) {
55
57
  }, /*#__PURE__*/React.createElement(_Form.Item, {
56
58
  label: " ",
57
59
  className: "no-margin-bottom",
58
- validateStatus: (value === null || value === void 0 ? void 0 : value.type) ? 'success' : 'error'
60
+ validateStatus: (value === null || value === void 0 ? void 0 : value.unit) ? 'success' : 'error'
59
61
  }, /*#__PURE__*/React.createElement(_Select, {
60
- value: value === null || value === void 0 ? void 0 : value.type,
62
+ disabled: disabled,
63
+ value: value === null || value === void 0 ? void 0 : value.unit,
61
64
  onChange: timeTypeChange
62
65
  }, /*#__PURE__*/React.createElement(_Select.Option, {
63
66
  value: "second"
@@ -3,6 +3,7 @@ import '../../style.less';
3
3
  interface Props {
4
4
  value?: any;
5
5
  onChange?: (value: any) => void;
6
+ disabled?: boolean;
6
7
  }
7
8
  declare const DelayTime: React.FC<Props>;
8
9
  export default DelayTime;
@@ -5,10 +5,12 @@ import "../../style.less";
5
5
 
6
6
  var DelayTime = function DelayTime(props) {
7
7
  var value = props.value,
8
- onChange = props.onChange;
8
+ onChange = props.onChange,
9
+ disabled = props.disabled;
9
10
  return /*#__PURE__*/React.createElement("div", {
10
11
  className: classNames('border-bottom', 'inner-bottom-box')
11
12
  }, /*#__PURE__*/React.createElement(TimeHorizon, {
13
+ disabled: disabled,
12
14
  title: "\u5EF6\u8FDF\u65F6\u95F4",
13
15
  value: value,
14
16
  onChange: onChange