strategy-panel 1.0.4-3 → 1.0.5
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 +9 -4
- package/es/components/canvas/config-panel/config-common.d.ts +0 -10
- package/es/components/canvas/config-panel/config-common.js +3 -17
- package/es/components/canvas/dag-canvas/canvas-content.d.ts +1 -0
- package/es/components/canvas/dag-canvas/canvas-content.js +7 -4
- package/es/components/canvas/dag-canvas/index.d.ts +5 -0
- package/es/components/canvas/dag-canvas/index.js +4 -1
- package/es/components/canvas/dag-canvas/preview.d.ts +1 -0
- package/es/components/canvas/dag-canvas/preview.js +4 -2
- package/es/components/canvas/index.d.ts +3 -3
- package/es/components/canvas/index.js +5 -1
- package/es/packages/graph-canvas/graph-model/node/common-node/node-element.js +1 -1
- package/es/packages/graph-canvas/index.d.ts +1 -1
- package/es/packages/graph-canvas/index.js +26 -12
- package/es/packages/graph-model/node/index.d.ts +2 -0
- package/es/packages/graph-model/node/index.js +52 -4
- package/es/packages/graph-model/node/node-basic.less +2 -1
- package/lib/components/canvas/component-tree-panel/category-tree/category-type.js +9 -4
- package/lib/components/canvas/config-panel/config-common.d.ts +0 -10
- package/lib/components/canvas/config-panel/config-common.js +1 -15
- package/lib/components/canvas/dag-canvas/canvas-content.d.ts +1 -0
- package/lib/components/canvas/dag-canvas/canvas-content.js +7 -4
- package/lib/components/canvas/dag-canvas/index.d.ts +5 -0
- package/lib/components/canvas/dag-canvas/index.js +4 -1
- package/lib/components/canvas/dag-canvas/preview.d.ts +1 -0
- package/lib/components/canvas/dag-canvas/preview.js +4 -2
- package/lib/components/canvas/index.d.ts +3 -3
- package/lib/components/canvas/index.js +5 -1
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.js +1 -1
- package/lib/packages/graph-canvas/index.d.ts +1 -1
- package/lib/packages/graph-canvas/index.js +26 -12
- package/lib/packages/graph-model/node/index.d.ts +2 -0
- package/lib/packages/graph-model/node/index.js +52 -4
- package/lib/packages/graph-model/node/node-basic.less +2 -1
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ export var componentsData = [{
|
|
|
25
25
|
isDir: true,
|
|
26
26
|
tooltip: '触发组件是规则运行的触发条件,作为策略树中的第一个节点,目前支持设备触发、时间触发和手动触发',
|
|
27
27
|
children: [{
|
|
28
|
+
nodeType: 'counter',
|
|
28
29
|
id: SCENE_DISPLAY.EQUIPMENT,
|
|
29
30
|
name: '设备触发',
|
|
30
31
|
imgUrl: device
|
|
@@ -56,7 +57,8 @@ export var componentsData = [{
|
|
|
56
57
|
}, {
|
|
57
58
|
id: SCENE_DISPLAY.TIME,
|
|
58
59
|
name: '时间触发',
|
|
59
|
-
imgUrl: time
|
|
60
|
+
imgUrl: time,
|
|
61
|
+
description: "说明:在指定区间单位的时间内,发生报警才会生效,时间区间范围外则不会生效;"
|
|
60
62
|
}]
|
|
61
63
|
}, {
|
|
62
64
|
id: COMPONENTS_TYPE.MOTION_OPERATION,
|
|
@@ -70,15 +72,18 @@ export var componentsData = [{
|
|
|
70
72
|
}, {
|
|
71
73
|
id: MOTION_OPERATION.ALARM,
|
|
72
74
|
name: '报警',
|
|
73
|
-
imgUrl: alarm
|
|
75
|
+
imgUrl: alarm,
|
|
76
|
+
description: "执行报警通知"
|
|
74
77
|
}, {
|
|
75
78
|
id: MOTION_OPERATION.NOTICE,
|
|
76
79
|
name: '通知',
|
|
77
|
-
imgUrl: notice
|
|
80
|
+
imgUrl: notice,
|
|
81
|
+
description: "执行通知规则"
|
|
78
82
|
}, {
|
|
79
83
|
id: MOTION_OPERATION.ORDER,
|
|
80
84
|
name: '派发工单',
|
|
81
|
-
imgUrl: order
|
|
85
|
+
imgUrl: order,
|
|
86
|
+
description: "达到条件生成工单任务"
|
|
82
87
|
}, {
|
|
83
88
|
id: MOTION_OPERATION.CONTROL,
|
|
84
89
|
name: '远程控制',
|
|
@@ -11,16 +11,6 @@ export declare const getComponentConfig: (experimentId: string) => {
|
|
|
11
11
|
label: string;
|
|
12
12
|
value: string;
|
|
13
13
|
}[];
|
|
14
|
-
}[] | {
|
|
15
|
-
name: string;
|
|
16
|
-
type: string;
|
|
17
|
-
component: React.JSX.Element;
|
|
18
|
-
}[] | {
|
|
19
|
-
name: string;
|
|
20
|
-
label: string;
|
|
21
|
-
required: boolean;
|
|
22
|
-
type: string;
|
|
23
|
-
component: React.JSX.Element;
|
|
24
14
|
}[] | ({
|
|
25
15
|
name: string;
|
|
26
16
|
label: string;
|
|
@@ -5,18 +5,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Form, Input, InputNumber, Select } from 'antd';
|
|
7
7
|
import { withMode } from "../../../packages/hooks/withMode";
|
|
8
|
-
import { MOTION_OPERATION
|
|
8
|
+
import { MOTION_OPERATION
|
|
9
9
|
// COMPONENTS_TYPE,
|
|
10
10
|
// COMMONLY_USED,
|
|
11
|
-
|
|
11
|
+
, SIGN_OPERATION
|
|
12
12
|
// MOTION_OPERATION,
|
|
13
13
|
} from "../../../packages/graph-canvas/node-types";
|
|
14
|
-
import TimeTrigger from "./components/time-trigger";
|
|
15
|
-
import ConditionConfiguration from "./components/condition-configuration";
|
|
16
14
|
import "./style.less";
|
|
17
15
|
var Option = Select.Option;
|
|
18
16
|
export var getComponentConfig = function getComponentConfig(experimentId) {
|
|
19
|
-
return _defineProperty(_defineProperty(
|
|
17
|
+
return _defineProperty(_defineProperty({}, SIGN_OPERATION.LOGICAL, [{
|
|
20
18
|
name: 'operator',
|
|
21
19
|
label: '逻辑符号',
|
|
22
20
|
type: 'select',
|
|
@@ -31,18 +29,6 @@ export var getComponentConfig = function getComponentConfig(experimentId) {
|
|
|
31
29
|
label: '异',
|
|
32
30
|
value: '^'
|
|
33
31
|
}]
|
|
34
|
-
}]), SCENE_DISPLAY.TIME, [{
|
|
35
|
-
name: 'timeControl',
|
|
36
|
-
type: 'auto',
|
|
37
|
-
component: /*#__PURE__*/React.createElement(TimeTrigger, null)
|
|
38
|
-
}]), SIGN_OPERATION.CONDITION, [{
|
|
39
|
-
name: 'condition',
|
|
40
|
-
label: '条件配置',
|
|
41
|
-
required: true,
|
|
42
|
-
type: 'auto',
|
|
43
|
-
component: /*#__PURE__*/React.createElement(ConditionConfiguration, {
|
|
44
|
-
experimentId: experimentId
|
|
45
|
-
})
|
|
46
32
|
}]), MOTION_OPERATION.CONTROL, [{
|
|
47
33
|
name: 'name',
|
|
48
34
|
label: '控制名称',
|
|
@@ -16,7 +16,9 @@ export var CanvasContent = function CanvasContent(props) {
|
|
|
16
16
|
var experimentId = props.experimentId,
|
|
17
17
|
className = props.className,
|
|
18
18
|
viewData = props.viewData,
|
|
19
|
-
dragEnable = props.dragEnable
|
|
19
|
+
dragEnable = props.dragEnable,
|
|
20
|
+
_props$methodMap = props.methodMap,
|
|
21
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap;
|
|
20
22
|
var viewDataJSON = JSON.stringify(viewData);
|
|
21
23
|
console.log('dragEnable', dragEnable);
|
|
22
24
|
var containerRef = useRef(null);
|
|
@@ -26,7 +28,8 @@ export var CanvasContent = function CanvasContent(props) {
|
|
|
26
28
|
// 渲染画布
|
|
27
29
|
useEffect(function () {
|
|
28
30
|
window.requestIdleCallback(function () {
|
|
29
|
-
|
|
31
|
+
console.log('renderGraphxxx', methodMap);
|
|
32
|
+
expGraph.renderGraph(containerRef.current, canvasRef.current, {}, methodMap);
|
|
30
33
|
if (viewData) {
|
|
31
34
|
var _expGraph$graph, _expGraph$graph2, _expGraph$graph2$zoom;
|
|
32
35
|
// console.log('=====================>>>>>>>>>>>>>>>>', viewData)
|
|
@@ -37,7 +40,7 @@ export var CanvasContent = function CanvasContent(props) {
|
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
42
|
});
|
|
40
|
-
}, [expGraph, viewDataJSON]);
|
|
43
|
+
}, [expGraph, viewDataJSON, methodMap]);
|
|
41
44
|
var checkNodeNumber = function checkNodeNumber(_ref) {
|
|
42
45
|
var _expGraph$graph3;
|
|
43
46
|
var id = _ref.id,
|
|
@@ -70,7 +73,7 @@ export var CanvasContent = function CanvasContent(props) {
|
|
|
70
73
|
clientX: x,
|
|
71
74
|
clientY: y,
|
|
72
75
|
nodeMeta: item.component
|
|
73
|
-
});
|
|
76
|
+
}, methodMap);
|
|
74
77
|
} else {
|
|
75
78
|
message.error("".concat(item.component.name, "\u7EC4\u4EF6\u53EA\u80FD\u5B58\u5728\u4E00\u4E2A"));
|
|
76
79
|
}
|
|
@@ -8,7 +8,9 @@ var DAGCanvas = function DAGCanvas(props) {
|
|
|
8
8
|
className = props.className,
|
|
9
9
|
viewData = props.viewData,
|
|
10
10
|
_props$dragEnable = props.dragEnable,
|
|
11
|
-
dragEnable = _props$dragEnable === void 0 ? true : _props$dragEnable
|
|
11
|
+
dragEnable = _props$dragEnable === void 0 ? true : _props$dragEnable,
|
|
12
|
+
_props$methodMap = props.methodMap,
|
|
13
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap;
|
|
12
14
|
var expGraph = useExperimentGraph(experimentId);
|
|
13
15
|
|
|
14
16
|
// 处理画布卸载
|
|
@@ -26,6 +28,7 @@ var DAGCanvas = function DAGCanvas(props) {
|
|
|
26
28
|
}, /*#__PURE__*/React.createElement(CanvasContent, {
|
|
27
29
|
dragEnable: dragEnable,
|
|
28
30
|
viewData: viewData,
|
|
31
|
+
methodMap: methodMap,
|
|
29
32
|
experimentId: experimentId,
|
|
30
33
|
className: "canvas-content"
|
|
31
34
|
}));
|
|
@@ -6,7 +6,9 @@ import "./canvas-content.less";
|
|
|
6
6
|
var CanvasContent = function CanvasContent(props) {
|
|
7
7
|
var experimentId = props.experimentId,
|
|
8
8
|
className = props.className,
|
|
9
|
-
viewData = props.viewData
|
|
9
|
+
viewData = props.viewData,
|
|
10
|
+
_props$methodMap = props.methodMap,
|
|
11
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap;
|
|
10
12
|
var viewDataJSON = JSON.stringify(viewData);
|
|
11
13
|
|
|
12
14
|
// 处理画布卸载
|
|
@@ -22,7 +24,7 @@ var CanvasContent = function CanvasContent(props) {
|
|
|
22
24
|
var _expGraph$graph, _expGraph$graph2, _expGraph$graph3;
|
|
23
25
|
expGraph.renderGraph(containerRef.current, canvasRef.current, {
|
|
24
26
|
interacting: false
|
|
25
|
-
});
|
|
27
|
+
}, methodMap);
|
|
26
28
|
expGraph === null || expGraph === void 0 || (_expGraph$graph = expGraph.graph) === null || _expGraph$graph === void 0 || _expGraph$graph.hideGrid();
|
|
27
29
|
expGraph === null || expGraph === void 0 || (_expGraph$graph2 = expGraph.graph) === null || _expGraph$graph2 === void 0 || _expGraph$graph2.disableKeyboard();
|
|
28
30
|
expGraph.onClearSelectNodes();
|
|
@@ -44,10 +44,10 @@ interface Props extends Omit<HeaderProps, 'experimentId'> {
|
|
|
44
44
|
*/
|
|
45
45
|
dragEnable?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
* @description
|
|
48
|
-
* @description.zh-CN
|
|
47
|
+
* @description methodMap
|
|
48
|
+
* @description.zh-CN 方法映射
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
methodMap?: any;
|
|
51
51
|
}
|
|
52
52
|
declare const StrategyCanvas: React.FC<Props>;
|
|
53
53
|
export default StrategyCanvas;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["experimentId", "headerVisible", "panelData", "configData", "mode", "viewData", "dragEnable"];
|
|
1
|
+
var _excluded = ["experimentId", "headerVisible", "panelData", "configData", "mode", "viewData", "dragEnable", "methodMap"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -26,6 +26,8 @@ var StrategyCanvas = function StrategyCanvas(props) {
|
|
|
26
26
|
viewData = _props$viewData === void 0 ? {} : _props$viewData,
|
|
27
27
|
_props$dragEnable = props.dragEnable,
|
|
28
28
|
dragEnable = _props$dragEnable === void 0 ? true : _props$dragEnable,
|
|
29
|
+
_props$methodMap = props.methodMap,
|
|
30
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap,
|
|
29
31
|
rest = _objectWithoutProperties(props, _excluded);
|
|
30
32
|
console.log('userAgent', (_window = window) === null || _window === void 0 ? void 0 : _window.openDatebase);
|
|
31
33
|
if ((_window2 = window) !== null && _window2 !== void 0 && _window2.openDatebase) {
|
|
@@ -42,6 +44,7 @@ var StrategyCanvas = function StrategyCanvas(props) {
|
|
|
42
44
|
}, /*#__PURE__*/React.createElement("div", {
|
|
43
45
|
className: "experiment-edit-panel"
|
|
44
46
|
}, /*#__PURE__*/React.createElement(CanvasPreview, {
|
|
47
|
+
methodMap: methodMap,
|
|
45
48
|
viewData: viewData,
|
|
46
49
|
experimentId: "".concat(experimentId),
|
|
47
50
|
className: "panel-dag-canvas"
|
|
@@ -66,6 +69,7 @@ var StrategyCanvas = function StrategyCanvas(props) {
|
|
|
66
69
|
className: "experiment-edit-panel"
|
|
67
70
|
}, /*#__PURE__*/React.createElement(DAGCanvas, {
|
|
68
71
|
viewData: viewData,
|
|
72
|
+
methodMap: methodMap,
|
|
69
73
|
experimentId: "".concat(experimentId),
|
|
70
74
|
className: "panel-dag-canvas",
|
|
71
75
|
dragEnable: dragEnable
|
|
@@ -26,7 +26,7 @@ var NodeElement = function NodeElement(props) {
|
|
|
26
26
|
activeNodeInstance = _useObservableState2[0];
|
|
27
27
|
var nodeId = activeNodeInstance && activeNodeInstance.id;
|
|
28
28
|
var nodeFormData = typeof nodeData === 'string' ? JSON.parse(nodeData) : nodeData;
|
|
29
|
-
console.log('NodeElement
|
|
29
|
+
console.log('NodeElement', data);
|
|
30
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
31
|
className: classNames('node-element', {
|
|
32
32
|
selected: !!nodeId && nodeId === id
|
|
@@ -30,7 +30,7 @@ declare class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
|
30
30
|
updateExperimentGraph(nodes?: NExperimentGraph.Node[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
31
31
|
delExperimentGraphElement(nodes?: string[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
32
32
|
isGraphReady(): boolean;
|
|
33
|
-
renderGraph: (wrapper: HTMLElement, container: HTMLElement, options?: any) => void;
|
|
33
|
+
renderGraph: (wrapper: HTMLElement, container: HTMLElement, options?: any, nodeConfig?: Record<string, any>) => void;
|
|
34
34
|
registerEdge: () => void;
|
|
35
35
|
createTypeNodeMeta: (nodeMeta: NodeMeta, nodeType: any, experimentId: string) => BaseNode | undefined;
|
|
36
36
|
renderNode(nodeMeta: NodeMeta): BaseNode | undefined;
|
|
@@ -142,7 +142,10 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
142
142
|
// 是否触发交互事件 点击 magnet 时 根据 validateMagnet 返回值来判断是否新增边,触发时机是 magnet 被按下,如果返回 false,则没有任何反应,如果返回 true,会在当前 magnet 创建一条新的边。
|
|
143
143
|
validateMagnet: function validateMagnet(_ref) {
|
|
144
144
|
var magnet = _ref.magnet;
|
|
145
|
-
|
|
145
|
+
var portGroup = magnet.getAttribute('port-group');
|
|
146
|
+
// console.log('validateMagnet', portGroup, portGroup !== 'in')
|
|
147
|
+
// 允许从除了'in'和'method'之外的端口发起连接
|
|
148
|
+
return !['in', 'method'].includes(portGroup);
|
|
146
149
|
},
|
|
147
150
|
// 显示可用的链接桩 在移动边的时候判断连接是否有效,如果返回 false,当鼠标放开的时候,不会连接到当前元素,否则会连接到当前元素。
|
|
148
151
|
validateConnection: function validateConnection(_ref2) {
|
|
@@ -150,6 +153,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
150
153
|
targetView = _ref2.targetView,
|
|
151
154
|
sourceMagnet = _ref2.sourceMagnet,
|
|
152
155
|
targetMagnet = _ref2.targetMagnet;
|
|
156
|
+
// console.log("validateConnection", sourceView, targetView, sourceMagnet, targetMagnet)
|
|
153
157
|
// 不允许连接到自己
|
|
154
158
|
if (sourceView === targetView) {
|
|
155
159
|
return false;
|
|
@@ -160,8 +164,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
160
164
|
return false;
|
|
161
165
|
}
|
|
162
166
|
|
|
163
|
-
//
|
|
164
|
-
|
|
167
|
+
// 只能连接到输入链接桩或方法端口
|
|
168
|
+
var targetPortGroup = targetMagnet === null || targetMagnet === void 0 ? void 0 : targetMagnet.getAttribute('port-group');
|
|
169
|
+
if (!targetMagnet || !['in', 'method'].includes(targetPortGroup)) {
|
|
165
170
|
return false;
|
|
166
171
|
}
|
|
167
172
|
|
|
@@ -257,7 +262,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
257
262
|
// 渲染画布
|
|
258
263
|
_defineProperty(_assertThisInitialized(_this), "renderGraph", function (wrapper, container) {
|
|
259
264
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
260
|
-
|
|
265
|
+
var nodeConfig = arguments.length > 3 ? arguments[3] : undefined;
|
|
266
|
+
_this.nodeConfig = nodeConfig;
|
|
267
|
+
console.log('renderGraphxxx =====>1', nodeConfig, _this.nodeConfig);
|
|
261
268
|
_this.experimentGraphSub = _this.experimentGraph$.pipe(filter(function (x) {
|
|
262
269
|
return !!x;
|
|
263
270
|
}),
|
|
@@ -273,7 +280,8 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
273
280
|
container: container,
|
|
274
281
|
nodes: nodes,
|
|
275
282
|
edges: edges,
|
|
276
|
-
options: options
|
|
283
|
+
options: options,
|
|
284
|
+
nodeConfig: nodeConfig
|
|
277
285
|
});
|
|
278
286
|
}
|
|
279
287
|
});
|
|
@@ -289,7 +297,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
289
297
|
Graph.registerEdge('group-edge', GroupEdge);
|
|
290
298
|
});
|
|
291
299
|
_defineProperty(_assertThisInitialized(_this), "createTypeNodeMeta", function (nodeMeta, nodeType, experimentId) {
|
|
292
|
-
|
|
300
|
+
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
301
|
+
nodeConfig = _assertThisInitialize.nodeConfig;
|
|
302
|
+
console.log('===================== createTypeNodeMeta', nodeType, _this.nodeConfig);
|
|
293
303
|
var data = nodeMeta.data;
|
|
294
304
|
var _ref3 = data,
|
|
295
305
|
type = _ref3.type;
|
|
@@ -298,6 +308,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
298
308
|
/* 条件判断 */
|
|
299
309
|
if (nodeType === SIGN_OPERATION.CONDITION) {
|
|
300
310
|
return _this.graph.addNode(new ConditionJudgment(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
311
|
+
nodeConfig: nodeConfig,
|
|
301
312
|
shape: 'condition-judgement-element',
|
|
302
313
|
component: /*#__PURE__*/React.createElement(ConditionElement, {
|
|
303
314
|
experimentId: experimentId
|
|
@@ -307,6 +318,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
307
318
|
/* 逻辑运算 */
|
|
308
319
|
if (nodeType === SIGN_OPERATION.LOGICAL || nodeType === COMMONLY_USED.LOCKED) {
|
|
309
320
|
return _this.graph.addNode(new LogicalNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
321
|
+
nodeConfig: nodeConfig,
|
|
310
322
|
shape: 'logical-node',
|
|
311
323
|
component: /*#__PURE__*/React.createElement(LogicalElement, {
|
|
312
324
|
experimentId: experimentId
|
|
@@ -315,6 +327,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
315
327
|
}
|
|
316
328
|
if ((nodeType === null || nodeType === void 0 ? void 0 : nodeType.indexOf(COMPONENTS_TYPE.APPLICATION)) === 0) {
|
|
317
329
|
return _this.graph.addNode(new ApplicationNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
330
|
+
nodeConfig: nodeConfig,
|
|
318
331
|
shape: 'application-node',
|
|
319
332
|
component: /*#__PURE__*/React.createElement(ApplicationElement, {
|
|
320
333
|
experimentId: experimentId
|
|
@@ -322,7 +335,8 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
322
335
|
})));
|
|
323
336
|
}
|
|
324
337
|
return _this.graph.addNode(new CommonNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
325
|
-
shape: '
|
|
338
|
+
shape: 'base-rect-node',
|
|
339
|
+
nodeConfig: nodeConfig,
|
|
326
340
|
component: /*#__PURE__*/React.createElement(NodeElement, {
|
|
327
341
|
experimentId: experimentId
|
|
328
342
|
})
|
|
@@ -351,12 +365,12 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
351
365
|
// 发起请求增加节点
|
|
352
366
|
_defineProperty(_assertThisInitialized(_this), "requestAddNode", /*#__PURE__*/function () {
|
|
353
367
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(param) {
|
|
354
|
-
var
|
|
368
|
+
var _assertThisInitialize2, graph, nodeMeta, clientX, clientY, pos, nodeRes, newNode;
|
|
355
369
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
356
370
|
while (1) switch (_context.prev = _context.next) {
|
|
357
371
|
case 0:
|
|
358
372
|
console.log('requestAddNode');
|
|
359
|
-
|
|
373
|
+
_assertThisInitialize2 = _assertThisInitialized(_this), graph = _assertThisInitialize2.graph;
|
|
360
374
|
if (!graph) {
|
|
361
375
|
_context.next = 14;
|
|
362
376
|
break;
|
|
@@ -528,8 +542,8 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
528
542
|
}());
|
|
529
543
|
// 清除选中节点
|
|
530
544
|
_defineProperty(_assertThisInitialized(_this), "unSelectNode", function () {
|
|
531
|
-
var
|
|
532
|
-
graph =
|
|
545
|
+
var _assertThisInitialize3 = _assertThisInitialized(_this),
|
|
546
|
+
graph = _assertThisInitialize3.graph;
|
|
533
547
|
if (graph) {
|
|
534
548
|
graph.cleanSelection();
|
|
535
549
|
}
|
|
@@ -600,7 +614,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
600
614
|
return _resetGraphData.apply(this, arguments);
|
|
601
615
|
}
|
|
602
616
|
return resetGraphData;
|
|
603
|
-
}()
|
|
617
|
+
}() // 初始化预览数据
|
|
604
618
|
}, {
|
|
605
619
|
key: "initPreviewData",
|
|
606
620
|
value: function () {
|
|
@@ -2,6 +2,8 @@ import { ReactShape } from '@antv/x6-react-shape';
|
|
|
2
2
|
import type { Node } from '@antv/x6/src/model/node';
|
|
3
3
|
import './node-basic.less';
|
|
4
4
|
export default class BaseNode extends ReactShape {
|
|
5
|
+
methodList: any;
|
|
5
6
|
constructor(metadata?: Node.Metadata);
|
|
7
|
+
addMethodPorts(methods: any[]): void;
|
|
6
8
|
isGroup(): boolean;
|
|
7
9
|
}
|
|
@@ -2,8 +2,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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
5
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
6
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -11,25 +9,75 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
11
9
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
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); }
|
|
14
15
|
import { ReactShape } from '@antv/x6-react-shape';
|
|
15
16
|
import "./node-basic.less";
|
|
16
17
|
var BaseNode = /*#__PURE__*/function (_ReactShape) {
|
|
17
18
|
_inherits(BaseNode, _ReactShape);
|
|
18
19
|
var _super = _createSuper(BaseNode);
|
|
19
20
|
function BaseNode() {
|
|
21
|
+
var _metadata$nodeConfig;
|
|
20
22
|
var _this;
|
|
21
23
|
var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
24
|
_classCallCheck(this, BaseNode);
|
|
23
25
|
_this = _super.call(this, metadata);
|
|
26
|
+
_defineProperty(_assertThisInitialized(_this), "methodList", void 0);
|
|
24
27
|
_this.initPorts();
|
|
28
|
+
var methodList = metadata === null || metadata === void 0 || (_metadata$nodeConfig = metadata.nodeConfig) === null || _metadata$nodeConfig === void 0 ? void 0 : _metadata$nodeConfig[metadata === null || metadata === void 0 ? void 0 : metadata.nodeType];
|
|
29
|
+
if (methodList !== null && methodList !== void 0 && methodList.length) {
|
|
30
|
+
_this.methodList = methodList;
|
|
31
|
+
// 为每个方法在节点左侧添加端口
|
|
32
|
+
_this.addMethodPorts(methodList);
|
|
33
|
+
}
|
|
34
|
+
console.log("BaseNodexxxxx", metadata, _assertThisInitialized(_this));
|
|
25
35
|
return _this;
|
|
26
36
|
}
|
|
27
37
|
_createClass(BaseNode, [{
|
|
38
|
+
key: "addMethodPorts",
|
|
39
|
+
value: function addMethodPorts(methods) {
|
|
40
|
+
var _this2 = this;
|
|
41
|
+
// 添加方法端口到节点左侧,保持垂直居中对称分布
|
|
42
|
+
var count = methods.length;
|
|
43
|
+
var spacing = 20; // 端口之间的间距
|
|
44
|
+
var totalHeight = (count - 1) * spacing; // 所有端口占据的总高度
|
|
45
|
+
var startY = -totalHeight / 2; // 起始Y位置,确保居中
|
|
46
|
+
|
|
47
|
+
methods.forEach(function (method, index) {
|
|
48
|
+
_this2.addPort({
|
|
49
|
+
id: "method-".concat(method.method),
|
|
50
|
+
group: 'method',
|
|
51
|
+
attrs: {
|
|
52
|
+
text: {
|
|
53
|
+
text: method.tag || method.method
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
args: {
|
|
57
|
+
dx: -10,
|
|
58
|
+
// 向左偏移10个单位
|
|
59
|
+
dy: startY + index * spacing // 垂直居中对称分布
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
28
65
|
key: "isGroup",
|
|
29
66
|
value: function isGroup() {
|
|
30
67
|
return false;
|
|
31
68
|
}
|
|
32
69
|
}]);
|
|
33
70
|
return BaseNode;
|
|
34
|
-
}(ReactShape);
|
|
35
|
-
export { BaseNode as default };
|
|
71
|
+
}(ReactShape); // 配置方法端口的默认属性
|
|
72
|
+
export { BaseNode as default };
|
|
73
|
+
BaseNode.config({
|
|
74
|
+
ports: {
|
|
75
|
+
groups: {
|
|
76
|
+
method: {
|
|
77
|
+
position: 'left',
|
|
78
|
+
zIndex: 2,
|
|
79
|
+
magnet: false
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -32,6 +32,7 @@ var componentsData = exports.componentsData = [{
|
|
|
32
32
|
isDir: true,
|
|
33
33
|
tooltip: '触发组件是规则运行的触发条件,作为策略树中的第一个节点,目前支持设备触发、时间触发和手动触发',
|
|
34
34
|
children: [{
|
|
35
|
+
nodeType: 'counter',
|
|
35
36
|
id: _nodeTypes.SCENE_DISPLAY.EQUIPMENT,
|
|
36
37
|
name: '设备触发',
|
|
37
38
|
imgUrl: _decive.default
|
|
@@ -63,7 +64,8 @@ var componentsData = exports.componentsData = [{
|
|
|
63
64
|
}, {
|
|
64
65
|
id: _nodeTypes.SCENE_DISPLAY.TIME,
|
|
65
66
|
name: '时间触发',
|
|
66
|
-
imgUrl: _time.default
|
|
67
|
+
imgUrl: _time.default,
|
|
68
|
+
description: "说明:在指定区间单位的时间内,发生报警才会生效,时间区间范围外则不会生效;"
|
|
67
69
|
}]
|
|
68
70
|
}, {
|
|
69
71
|
id: _nodeTypes.COMPONENTS_TYPE.MOTION_OPERATION,
|
|
@@ -77,15 +79,18 @@ var componentsData = exports.componentsData = [{
|
|
|
77
79
|
}, {
|
|
78
80
|
id: _nodeTypes.MOTION_OPERATION.ALARM,
|
|
79
81
|
name: '报警',
|
|
80
|
-
imgUrl: _alarm.default
|
|
82
|
+
imgUrl: _alarm.default,
|
|
83
|
+
description: "执行报警通知"
|
|
81
84
|
}, {
|
|
82
85
|
id: _nodeTypes.MOTION_OPERATION.NOTICE,
|
|
83
86
|
name: '通知',
|
|
84
|
-
imgUrl: _notice.default
|
|
87
|
+
imgUrl: _notice.default,
|
|
88
|
+
description: "执行通知规则"
|
|
85
89
|
}, {
|
|
86
90
|
id: _nodeTypes.MOTION_OPERATION.ORDER,
|
|
87
91
|
name: '派发工单',
|
|
88
|
-
imgUrl: _order.default
|
|
92
|
+
imgUrl: _order.default,
|
|
93
|
+
description: "达到条件生成工单任务"
|
|
89
94
|
}, {
|
|
90
95
|
id: _nodeTypes.MOTION_OPERATION.CONTROL,
|
|
91
96
|
name: '远程控制',
|
|
@@ -11,16 +11,6 @@ export declare const getComponentConfig: (experimentId: string) => {
|
|
|
11
11
|
label: string;
|
|
12
12
|
value: string;
|
|
13
13
|
}[];
|
|
14
|
-
}[] | {
|
|
15
|
-
name: string;
|
|
16
|
-
type: string;
|
|
17
|
-
component: React.JSX.Element;
|
|
18
|
-
}[] | {
|
|
19
|
-
name: string;
|
|
20
|
-
label: string;
|
|
21
|
-
required: boolean;
|
|
22
|
-
type: string;
|
|
23
|
-
component: React.JSX.Element;
|
|
24
14
|
}[] | ({
|
|
25
15
|
name: string;
|
|
26
16
|
label: string;
|
|
@@ -8,8 +8,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _antd = require("antd");
|
|
9
9
|
var _withMode = require("../../../packages/hooks/withMode");
|
|
10
10
|
var _nodeTypes = require("../../../packages/graph-canvas/node-types");
|
|
11
|
-
var _timeTrigger = _interopRequireDefault(require("./components/time-trigger"));
|
|
12
|
-
var _conditionConfiguration = _interopRequireDefault(require("./components/condition-configuration"));
|
|
13
11
|
require("./style.less");
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
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); }
|
|
@@ -18,7 +16,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
16
|
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
17
|
var Option = _antd.Select.Option;
|
|
20
18
|
var getComponentConfig = exports.getComponentConfig = function getComponentConfig(experimentId) {
|
|
21
|
-
return _defineProperty(_defineProperty(
|
|
19
|
+
return _defineProperty(_defineProperty({}, _nodeTypes.SIGN_OPERATION.LOGICAL, [{
|
|
22
20
|
name: 'operator',
|
|
23
21
|
label: '逻辑符号',
|
|
24
22
|
type: 'select',
|
|
@@ -33,18 +31,6 @@ var getComponentConfig = exports.getComponentConfig = function getComponentConfi
|
|
|
33
31
|
label: '异',
|
|
34
32
|
value: '^'
|
|
35
33
|
}]
|
|
36
|
-
}]), _nodeTypes.SCENE_DISPLAY.TIME, [{
|
|
37
|
-
name: 'timeControl',
|
|
38
|
-
type: 'auto',
|
|
39
|
-
component: /*#__PURE__*/_react.default.createElement(_timeTrigger.default, null)
|
|
40
|
-
}]), _nodeTypes.SIGN_OPERATION.CONDITION, [{
|
|
41
|
-
name: 'condition',
|
|
42
|
-
label: '条件配置',
|
|
43
|
-
required: true,
|
|
44
|
-
type: 'auto',
|
|
45
|
-
component: /*#__PURE__*/_react.default.createElement(_conditionConfiguration.default, {
|
|
46
|
-
experimentId: experimentId
|
|
47
|
-
})
|
|
48
34
|
}]), _nodeTypes.MOTION_OPERATION.CONTROL, [{
|
|
49
35
|
name: 'name',
|
|
50
36
|
label: '控制名称',
|
|
@@ -26,7 +26,9 @@ var CanvasContent = exports.CanvasContent = function CanvasContent(props) {
|
|
|
26
26
|
var experimentId = props.experimentId,
|
|
27
27
|
className = props.className,
|
|
28
28
|
viewData = props.viewData,
|
|
29
|
-
dragEnable = props.dragEnable
|
|
29
|
+
dragEnable = props.dragEnable,
|
|
30
|
+
_props$methodMap = props.methodMap,
|
|
31
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap;
|
|
30
32
|
var viewDataJSON = JSON.stringify(viewData);
|
|
31
33
|
console.log('dragEnable', dragEnable);
|
|
32
34
|
var containerRef = (0, _react.useRef)(null);
|
|
@@ -36,7 +38,8 @@ var CanvasContent = exports.CanvasContent = function CanvasContent(props) {
|
|
|
36
38
|
// 渲染画布
|
|
37
39
|
(0, _react.useEffect)(function () {
|
|
38
40
|
window.requestIdleCallback(function () {
|
|
39
|
-
|
|
41
|
+
console.log('renderGraphxxx', methodMap);
|
|
42
|
+
expGraph.renderGraph(containerRef.current, canvasRef.current, {}, methodMap);
|
|
40
43
|
if (viewData) {
|
|
41
44
|
var _expGraph$graph, _expGraph$graph2, _expGraph$graph2$zoom;
|
|
42
45
|
// console.log('=====================>>>>>>>>>>>>>>>>', viewData)
|
|
@@ -47,7 +50,7 @@ var CanvasContent = exports.CanvasContent = function CanvasContent(props) {
|
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
});
|
|
50
|
-
}, [expGraph, viewDataJSON]);
|
|
53
|
+
}, [expGraph, viewDataJSON, methodMap]);
|
|
51
54
|
var checkNodeNumber = function checkNodeNumber(_ref) {
|
|
52
55
|
var _expGraph$graph3;
|
|
53
56
|
var id = _ref.id,
|
|
@@ -80,7 +83,7 @@ var CanvasContent = exports.CanvasContent = function CanvasContent(props) {
|
|
|
80
83
|
clientX: x,
|
|
81
84
|
clientY: y,
|
|
82
85
|
nodeMeta: item.component
|
|
83
|
-
});
|
|
86
|
+
}, methodMap);
|
|
84
87
|
} else {
|
|
85
88
|
_antd.message.error("".concat(item.component.name, "\u7EC4\u4EF6\u53EA\u80FD\u5B58\u5728\u4E00\u4E2A"));
|
|
86
89
|
}
|
|
@@ -18,7 +18,9 @@ var DAGCanvas = function DAGCanvas(props) {
|
|
|
18
18
|
className = props.className,
|
|
19
19
|
viewData = props.viewData,
|
|
20
20
|
_props$dragEnable = props.dragEnable,
|
|
21
|
-
dragEnable = _props$dragEnable === void 0 ? true : _props$dragEnable
|
|
21
|
+
dragEnable = _props$dragEnable === void 0 ? true : _props$dragEnable,
|
|
22
|
+
_props$methodMap = props.methodMap,
|
|
23
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap;
|
|
22
24
|
var expGraph = (0, _graphCanvas.useExperimentGraph)(experimentId);
|
|
23
25
|
|
|
24
26
|
// 处理画布卸载
|
|
@@ -36,6 +38,7 @@ var DAGCanvas = function DAGCanvas(props) {
|
|
|
36
38
|
}, /*#__PURE__*/_react.default.createElement(_canvasContent.CanvasContent, {
|
|
37
39
|
dragEnable: dragEnable,
|
|
38
40
|
viewData: viewData,
|
|
41
|
+
methodMap: methodMap,
|
|
39
42
|
experimentId: experimentId,
|
|
40
43
|
className: "canvas-content"
|
|
41
44
|
}));
|
|
@@ -16,7 +16,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
16
16
|
var CanvasContent = function CanvasContent(props) {
|
|
17
17
|
var experimentId = props.experimentId,
|
|
18
18
|
className = props.className,
|
|
19
|
-
viewData = props.viewData
|
|
19
|
+
viewData = props.viewData,
|
|
20
|
+
_props$methodMap = props.methodMap,
|
|
21
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap;
|
|
20
22
|
var viewDataJSON = JSON.stringify(viewData);
|
|
21
23
|
|
|
22
24
|
// 处理画布卸载
|
|
@@ -32,7 +34,7 @@ var CanvasContent = function CanvasContent(props) {
|
|
|
32
34
|
var _expGraph$graph, _expGraph$graph2, _expGraph$graph3;
|
|
33
35
|
expGraph.renderGraph(containerRef.current, canvasRef.current, {
|
|
34
36
|
interacting: false
|
|
35
|
-
});
|
|
37
|
+
}, methodMap);
|
|
36
38
|
expGraph === null || expGraph === void 0 || (_expGraph$graph = expGraph.graph) === null || _expGraph$graph === void 0 || _expGraph$graph.hideGrid();
|
|
37
39
|
expGraph === null || expGraph === void 0 || (_expGraph$graph2 = expGraph.graph) === null || _expGraph$graph2 === void 0 || _expGraph$graph2.disableKeyboard();
|
|
38
40
|
expGraph.onClearSelectNodes();
|
|
@@ -44,10 +44,10 @@ interface Props extends Omit<HeaderProps, 'experimentId'> {
|
|
|
44
44
|
*/
|
|
45
45
|
dragEnable?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
* @description
|
|
48
|
-
* @description.zh-CN
|
|
47
|
+
* @description methodMap
|
|
48
|
+
* @description.zh-CN 方法映射
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
methodMap?: any;
|
|
51
51
|
}
|
|
52
52
|
declare const StrategyCanvas: React.FC<Props>;
|
|
53
53
|
export default StrategyCanvas;
|
|
@@ -14,7 +14,7 @@ var _dagCanvas = _interopRequireDefault(require("./dag-canvas"));
|
|
|
14
14
|
var _preview = _interopRequireDefault(require("./dag-canvas/preview"));
|
|
15
15
|
require("../../style/default.less");
|
|
16
16
|
require("./index.less");
|
|
17
|
-
var _excluded = ["experimentId", "headerVisible", "panelData", "configData", "mode", "viewData", "dragEnable"];
|
|
17
|
+
var _excluded = ["experimentId", "headerVisible", "panelData", "configData", "mode", "viewData", "dragEnable", "methodMap"];
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -33,6 +33,8 @@ var StrategyCanvas = function StrategyCanvas(props) {
|
|
|
33
33
|
viewData = _props$viewData === void 0 ? {} : _props$viewData,
|
|
34
34
|
_props$dragEnable = props.dragEnable,
|
|
35
35
|
dragEnable = _props$dragEnable === void 0 ? true : _props$dragEnable,
|
|
36
|
+
_props$methodMap = props.methodMap,
|
|
37
|
+
methodMap = _props$methodMap === void 0 ? {} : _props$methodMap,
|
|
36
38
|
rest = _objectWithoutProperties(props, _excluded);
|
|
37
39
|
console.log('userAgent', (_window = window) === null || _window === void 0 ? void 0 : _window.openDatebase);
|
|
38
40
|
if ((_window2 = window) !== null && _window2 !== void 0 && _window2.openDatebase) {
|
|
@@ -49,6 +51,7 @@ var StrategyCanvas = function StrategyCanvas(props) {
|
|
|
49
51
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
52
|
className: "experiment-edit-panel"
|
|
51
53
|
}, /*#__PURE__*/_react.default.createElement(_preview.default, {
|
|
54
|
+
methodMap: methodMap,
|
|
52
55
|
viewData: viewData,
|
|
53
56
|
experimentId: "".concat(experimentId),
|
|
54
57
|
className: "panel-dag-canvas"
|
|
@@ -73,6 +76,7 @@ var StrategyCanvas = function StrategyCanvas(props) {
|
|
|
73
76
|
className: "experiment-edit-panel"
|
|
74
77
|
}, /*#__PURE__*/_react.default.createElement(_dagCanvas.default, {
|
|
75
78
|
viewData: viewData,
|
|
79
|
+
methodMap: methodMap,
|
|
76
80
|
experimentId: "".concat(experimentId),
|
|
77
81
|
className: "panel-dag-canvas",
|
|
78
82
|
dragEnable: dragEnable
|
|
@@ -33,7 +33,7 @@ var NodeElement = function NodeElement(props) {
|
|
|
33
33
|
activeNodeInstance = _useObservableState2[0];
|
|
34
34
|
var nodeId = activeNodeInstance && activeNodeInstance.id;
|
|
35
35
|
var nodeFormData = typeof nodeData === 'string' ? JSON.parse(nodeData) : nodeData;
|
|
36
|
-
console.log('NodeElement
|
|
36
|
+
console.log('NodeElement', data);
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
38
|
className: (0, _classnames.default)('node-element', {
|
|
39
39
|
selected: !!nodeId && nodeId === id
|
|
@@ -30,7 +30,7 @@ declare class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
|
30
30
|
updateExperimentGraph(nodes?: NExperimentGraph.Node[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
31
31
|
delExperimentGraphElement(nodes?: string[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
32
32
|
isGraphReady(): boolean;
|
|
33
|
-
renderGraph: (wrapper: HTMLElement, container: HTMLElement, options?: any) => void;
|
|
33
|
+
renderGraph: (wrapper: HTMLElement, container: HTMLElement, options?: any, nodeConfig?: Record<string, any>) => void;
|
|
34
34
|
registerEdge: () => void;
|
|
35
35
|
createTypeNodeMeta: (nodeMeta: NodeMeta, nodeType: any, experimentId: string) => BaseNode | undefined;
|
|
36
36
|
renderNode(nodeMeta: NodeMeta): BaseNode | undefined;
|
|
@@ -151,7 +151,10 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
151
151
|
// 是否触发交互事件 点击 magnet 时 根据 validateMagnet 返回值来判断是否新增边,触发时机是 magnet 被按下,如果返回 false,则没有任何反应,如果返回 true,会在当前 magnet 创建一条新的边。
|
|
152
152
|
validateMagnet: function validateMagnet(_ref) {
|
|
153
153
|
var magnet = _ref.magnet;
|
|
154
|
-
|
|
154
|
+
var portGroup = magnet.getAttribute('port-group');
|
|
155
|
+
// console.log('validateMagnet', portGroup, portGroup !== 'in')
|
|
156
|
+
// 允许从除了'in'和'method'之外的端口发起连接
|
|
157
|
+
return !['in', 'method'].includes(portGroup);
|
|
155
158
|
},
|
|
156
159
|
// 显示可用的链接桩 在移动边的时候判断连接是否有效,如果返回 false,当鼠标放开的时候,不会连接到当前元素,否则会连接到当前元素。
|
|
157
160
|
validateConnection: function validateConnection(_ref2) {
|
|
@@ -159,6 +162,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
159
162
|
targetView = _ref2.targetView,
|
|
160
163
|
sourceMagnet = _ref2.sourceMagnet,
|
|
161
164
|
targetMagnet = _ref2.targetMagnet;
|
|
165
|
+
// console.log("validateConnection", sourceView, targetView, sourceMagnet, targetMagnet)
|
|
162
166
|
// 不允许连接到自己
|
|
163
167
|
if (sourceView === targetView) {
|
|
164
168
|
return false;
|
|
@@ -169,8 +173,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
169
173
|
return false;
|
|
170
174
|
}
|
|
171
175
|
|
|
172
|
-
//
|
|
173
|
-
|
|
176
|
+
// 只能连接到输入链接桩或方法端口
|
|
177
|
+
var targetPortGroup = targetMagnet === null || targetMagnet === void 0 ? void 0 : targetMagnet.getAttribute('port-group');
|
|
178
|
+
if (!targetMagnet || !['in', 'method'].includes(targetPortGroup)) {
|
|
174
179
|
return false;
|
|
175
180
|
}
|
|
176
181
|
|
|
@@ -266,7 +271,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
266
271
|
// 渲染画布
|
|
267
272
|
_defineProperty(_assertThisInitialized(_this), "renderGraph", function (wrapper, container) {
|
|
268
273
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
269
|
-
|
|
274
|
+
var nodeConfig = arguments.length > 3 ? arguments[3] : undefined;
|
|
275
|
+
_this.nodeConfig = nodeConfig;
|
|
276
|
+
console.log('renderGraphxxx =====>1', nodeConfig, _this.nodeConfig);
|
|
270
277
|
_this.experimentGraphSub = _this.experimentGraph$.pipe((0, _operators.filter)(function (x) {
|
|
271
278
|
return !!x;
|
|
272
279
|
}),
|
|
@@ -282,7 +289,8 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
282
289
|
container: container,
|
|
283
290
|
nodes: nodes,
|
|
284
291
|
edges: edges,
|
|
285
|
-
options: options
|
|
292
|
+
options: options,
|
|
293
|
+
nodeConfig: nodeConfig
|
|
286
294
|
});
|
|
287
295
|
}
|
|
288
296
|
});
|
|
@@ -298,7 +306,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
298
306
|
_x11.Graph.registerEdge('group-edge', _edge2.GroupEdge);
|
|
299
307
|
});
|
|
300
308
|
_defineProperty(_assertThisInitialized(_this), "createTypeNodeMeta", function (nodeMeta, nodeType, experimentId) {
|
|
301
|
-
|
|
309
|
+
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
310
|
+
nodeConfig = _assertThisInitialize.nodeConfig;
|
|
311
|
+
console.log('===================== createTypeNodeMeta', nodeType, _this.nodeConfig);
|
|
302
312
|
var data = nodeMeta.data;
|
|
303
313
|
var _ref3 = data,
|
|
304
314
|
type = _ref3.type;
|
|
@@ -307,6 +317,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
307
317
|
/* 条件判断 */
|
|
308
318
|
if (nodeType === _nodeTypes.SIGN_OPERATION.CONDITION) {
|
|
309
319
|
return _this.graph.addNode(new _node.ConditionJudgment(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
320
|
+
nodeConfig: nodeConfig,
|
|
310
321
|
shape: 'condition-judgement-element',
|
|
311
322
|
component: /*#__PURE__*/_react.default.createElement(_conditionElement.default, {
|
|
312
323
|
experimentId: experimentId
|
|
@@ -316,6 +327,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
316
327
|
/* 逻辑运算 */
|
|
317
328
|
if (nodeType === _nodeTypes.SIGN_OPERATION.LOGICAL || nodeType === _nodeTypes.COMMONLY_USED.LOCKED) {
|
|
318
329
|
return _this.graph.addNode(new _node.LogicalNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
330
|
+
nodeConfig: nodeConfig,
|
|
319
331
|
shape: 'logical-node',
|
|
320
332
|
component: /*#__PURE__*/_react.default.createElement(_logicalElement.default, {
|
|
321
333
|
experimentId: experimentId
|
|
@@ -324,6 +336,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
324
336
|
}
|
|
325
337
|
if ((nodeType === null || nodeType === void 0 ? void 0 : nodeType.indexOf(_nodeTypes.COMPONENTS_TYPE.APPLICATION)) === 0) {
|
|
326
338
|
return _this.graph.addNode(new _node.ApplicationNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
339
|
+
nodeConfig: nodeConfig,
|
|
327
340
|
shape: 'application-node',
|
|
328
341
|
component: /*#__PURE__*/_react.default.createElement(_applicationElement.default, {
|
|
329
342
|
experimentId: experimentId
|
|
@@ -331,7 +344,8 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
331
344
|
})));
|
|
332
345
|
}
|
|
333
346
|
return _this.graph.addNode(new _node.CommonNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
334
|
-
shape: '
|
|
347
|
+
shape: 'base-rect-node',
|
|
348
|
+
nodeConfig: nodeConfig,
|
|
335
349
|
component: /*#__PURE__*/_react.default.createElement(_nodeElement.default, {
|
|
336
350
|
experimentId: experimentId
|
|
337
351
|
})
|
|
@@ -360,12 +374,12 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
360
374
|
// 发起请求增加节点
|
|
361
375
|
_defineProperty(_assertThisInitialized(_this), "requestAddNode", /*#__PURE__*/function () {
|
|
362
376
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(param) {
|
|
363
|
-
var
|
|
377
|
+
var _assertThisInitialize2, graph, nodeMeta, clientX, clientY, pos, nodeRes, newNode;
|
|
364
378
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
365
379
|
while (1) switch (_context.prev = _context.next) {
|
|
366
380
|
case 0:
|
|
367
381
|
console.log('requestAddNode');
|
|
368
|
-
|
|
382
|
+
_assertThisInitialize2 = _assertThisInitialized(_this), graph = _assertThisInitialize2.graph;
|
|
369
383
|
if (!graph) {
|
|
370
384
|
_context.next = 14;
|
|
371
385
|
break;
|
|
@@ -537,8 +551,8 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
537
551
|
}());
|
|
538
552
|
// 清除选中节点
|
|
539
553
|
_defineProperty(_assertThisInitialized(_this), "unSelectNode", function () {
|
|
540
|
-
var
|
|
541
|
-
graph =
|
|
554
|
+
var _assertThisInitialize3 = _assertThisInitialized(_this),
|
|
555
|
+
graph = _assertThisInitialize3.graph;
|
|
542
556
|
if (graph) {
|
|
543
557
|
graph.cleanSelection();
|
|
544
558
|
}
|
|
@@ -609,7 +623,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
609
623
|
return _resetGraphData.apply(this, arguments);
|
|
610
624
|
}
|
|
611
625
|
return resetGraphData;
|
|
612
|
-
}()
|
|
626
|
+
}() // 初始化预览数据
|
|
613
627
|
}, {
|
|
614
628
|
key: "initPreviewData",
|
|
615
629
|
value: function () {
|
|
@@ -2,6 +2,8 @@ import { ReactShape } from '@antv/x6-react-shape';
|
|
|
2
2
|
import type { Node } from '@antv/x6/src/model/node';
|
|
3
3
|
import './node-basic.less';
|
|
4
4
|
export default class BaseNode extends ReactShape {
|
|
5
|
+
methodList: any;
|
|
5
6
|
constructor(metadata?: Node.Metadata);
|
|
7
|
+
addMethodPorts(methods: any[]): void;
|
|
6
8
|
isGroup(): boolean;
|
|
7
9
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _x6ReactShape = require("@antv/x6-react-shape");
|
|
9
8
|
require("./node-basic.less");
|
|
9
|
+
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); }
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
-
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); }
|
|
15
13
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
14
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -19,22 +17,72 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
19
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
19
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
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); }
|
|
22
23
|
var BaseNode = exports.default = /*#__PURE__*/function (_ReactShape) {
|
|
23
24
|
_inherits(BaseNode, _ReactShape);
|
|
24
25
|
var _super = _createSuper(BaseNode);
|
|
25
26
|
function BaseNode() {
|
|
27
|
+
var _metadata$nodeConfig;
|
|
26
28
|
var _this;
|
|
27
29
|
var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28
30
|
_classCallCheck(this, BaseNode);
|
|
29
31
|
_this = _super.call(this, metadata);
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "methodList", void 0);
|
|
30
33
|
_this.initPorts();
|
|
34
|
+
var methodList = metadata === null || metadata === void 0 || (_metadata$nodeConfig = metadata.nodeConfig) === null || _metadata$nodeConfig === void 0 ? void 0 : _metadata$nodeConfig[metadata === null || metadata === void 0 ? void 0 : metadata.nodeType];
|
|
35
|
+
if (methodList !== null && methodList !== void 0 && methodList.length) {
|
|
36
|
+
_this.methodList = methodList;
|
|
37
|
+
// 为每个方法在节点左侧添加端口
|
|
38
|
+
_this.addMethodPorts(methodList);
|
|
39
|
+
}
|
|
40
|
+
console.log("BaseNodexxxxx", metadata, _assertThisInitialized(_this));
|
|
31
41
|
return _this;
|
|
32
42
|
}
|
|
33
43
|
_createClass(BaseNode, [{
|
|
44
|
+
key: "addMethodPorts",
|
|
45
|
+
value: function addMethodPorts(methods) {
|
|
46
|
+
var _this2 = this;
|
|
47
|
+
// 添加方法端口到节点左侧,保持垂直居中对称分布
|
|
48
|
+
var count = methods.length;
|
|
49
|
+
var spacing = 20; // 端口之间的间距
|
|
50
|
+
var totalHeight = (count - 1) * spacing; // 所有端口占据的总高度
|
|
51
|
+
var startY = -totalHeight / 2; // 起始Y位置,确保居中
|
|
52
|
+
|
|
53
|
+
methods.forEach(function (method, index) {
|
|
54
|
+
_this2.addPort({
|
|
55
|
+
id: "method-".concat(method.method),
|
|
56
|
+
group: 'method',
|
|
57
|
+
attrs: {
|
|
58
|
+
text: {
|
|
59
|
+
text: method.tag || method.method
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
args: {
|
|
63
|
+
dx: -10,
|
|
64
|
+
// 向左偏移10个单位
|
|
65
|
+
dy: startY + index * spacing // 垂直居中对称分布
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
34
71
|
key: "isGroup",
|
|
35
72
|
value: function isGroup() {
|
|
36
73
|
return false;
|
|
37
74
|
}
|
|
38
75
|
}]);
|
|
39
76
|
return BaseNode;
|
|
40
|
-
}(_x6ReactShape.ReactShape);
|
|
77
|
+
}(_x6ReactShape.ReactShape); // 配置方法端口的默认属性
|
|
78
|
+
BaseNode.config({
|
|
79
|
+
ports: {
|
|
80
|
+
groups: {
|
|
81
|
+
method: {
|
|
82
|
+
position: 'left',
|
|
83
|
+
zIndex: 2,
|
|
84
|
+
magnet: false
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|