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.
- package/.fatherrc.ts +26 -26
- package/.umirc.ts +29 -29
- package/README.md +33 -33
- package/es/assets/rhombus.svg +3 -3
- package/es/common/graph-common/node-element/common-element.less +117 -117
- package/es/common/graph-common/node-element/condition-element.d.ts +1 -0
- package/es/common/graph-common/node-element/condition-element.js +28 -3
- package/es/common/graph-common/node-element/condition-element.less +1 -2
- package/es/common/graph-common/node-element/logical-element.d.ts +1 -0
- package/es/common/graph-common/node-element/logical-element.js +28 -3
- package/es/common/graph-common/node-element/node-element.d.ts +1 -0
- package/es/common/graph-common/node-element/node-element.js +29 -4
- package/es/hooks/withMode.d.ts +1 -0
- package/es/hooks/withMode.js +16 -0
- package/es/pages/component-tree-panel/category-tree/index.less +36 -35
- package/es/pages/config-panel/components/condition-configuration/configure-modal/data-origin.js +26 -15
- package/es/pages/config-panel/components/condition-configuration/configure-modal/index.js +3 -6
- package/es/pages/config-panel/components/condition-configuration/cross-line.d.ts +1 -0
- package/es/pages/config-panel/components/condition-configuration/cross-line.js +3 -1
- package/es/pages/config-panel/components/condition-configuration/index.d.ts +1 -1
- package/es/pages/config-panel/components/condition-configuration/index.js +12 -9
- package/es/pages/config-panel/components/condition-configuration/style.less +74 -70
- package/es/pages/config-panel/components/time-trigger/components/cycle-time.d.ts +1 -0
- package/es/pages/config-panel/components/time-trigger/components/cycle-time.js +35 -20
- package/es/pages/config-panel/components/time-trigger/components/time-horizon.d.ts +1 -0
- package/es/pages/config-panel/components/time-trigger/components/time-horizon.js +12 -9
- package/es/pages/config-panel/components/time-trigger/delay-time.d.ts +1 -0
- package/es/pages/config-panel/components/time-trigger/delay-time.js +3 -1
- package/es/pages/config-panel/components/time-trigger/index.d.ts +1 -1
- package/es/pages/config-panel/components/time-trigger/index.js +15 -10
- package/es/pages/config-panel/components/time-trigger/interval-time.d.ts +1 -0
- package/es/pages/config-panel/components/time-trigger/interval-time.js +5 -2
- package/es/pages/config-panel/components/time-trigger/persistent-time.d.ts +1 -0
- package/es/pages/config-panel/components/time-trigger/persistent-time.js +3 -1
- package/es/pages/config-panel/components/time-trigger/timing-time.d.ts +1 -0
- package/es/pages/config-panel/components/time-trigger/timing-time.js +4 -1
- package/es/pages/config-panel/config-common.d.ts +1 -1
- package/es/pages/config-panel/config-common.js +9 -5
- package/es/pages/config-panel/index.d.ts +1 -0
- package/es/pages/config-panel/index.js +4 -1
- package/es/pages/config-panel/node-form.d.ts +1 -0
- package/es/pages/config-panel/node-form.js +13 -29
- package/es/pages/config-panel/style.less +23 -4
- package/es/pages/dag-canvas/canvas-content.d.ts +1 -0
- package/es/pages/dag-canvas/canvas-content.js +3 -1
- package/es/pages/dag-canvas/index.d.ts +5 -0
- package/es/pages/dag-canvas/index.js +3 -1
- package/es/pages/dag-canvas/preview.d.ts +1 -0
- package/es/pages/dag-canvas/preview.js +9 -1
- package/es/pages/index.d.ts +6 -1
- package/es/pages/index.js +6 -1
- package/es/pages/index.less +50 -50
- package/es/pages/rx-models/experiment-graph.d.ts +4 -4
- package/es/pages/rx-models/experiment-graph.js +116 -84
- package/es/pages/strategy-header/index.js +16 -3
- package/es/pages/strategy-header/style.less +22 -22
- package/es/typings.d.ts +14 -6
- package/package.json +1 -1
|
@@ -28,17 +28,19 @@ declare class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
|
28
28
|
reRenderSub?: Subscription;
|
|
29
29
|
constructor(expId: string);
|
|
30
30
|
initialize(): Promise<void>;
|
|
31
|
+
initPreviewData(graphRes: any): Promise<void>;
|
|
31
32
|
loadExperimentGraph(graphRes: any): Promise<void>;
|
|
32
33
|
updateExperimentGraph(nodes?: NExperimentGraph.Node[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
33
34
|
delExperimentGraphElement(nodes?: string[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
34
35
|
isGraphReady(): boolean;
|
|
35
36
|
renderGraph: (wrapper: HTMLElement, container: HTMLElement, options?: any) => void;
|
|
36
|
-
createTypeNodeMeta: (nodeMeta: NodeMeta, nodeType: any) => BaseNode | undefined;
|
|
37
|
+
createTypeNodeMeta: (nodeMeta: NodeMeta, nodeType: any, experimentId: string) => BaseNode | undefined;
|
|
37
38
|
renderNode(nodeMeta: NodeMeta): BaseNode | undefined;
|
|
38
39
|
afterLayout(): void;
|
|
39
40
|
renderEdge(edgeMeta: EdgeMeta): BaseEdge | undefined;
|
|
40
41
|
validateContextMenu: (info: NExperimentGraph.ContextMenuInfo) => boolean;
|
|
41
42
|
onSelectNodes(nodes: BaseNode[]): void;
|
|
43
|
+
onClearSelectNodes(): void;
|
|
42
44
|
handlerResize: (e: CustomEvent<string>) => void;
|
|
43
45
|
onConnectNode(args: any): Promise<{
|
|
44
46
|
success: boolean;
|
|
@@ -65,9 +67,7 @@ declare class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
|
65
67
|
success: boolean;
|
|
66
68
|
}>;
|
|
67
69
|
undoDeleteNode: () => Promise<void>;
|
|
68
|
-
updateNodeData: (nodeInstanceId: string, nodeData: any) => Promise<
|
|
69
|
-
success: boolean;
|
|
70
|
-
}>;
|
|
70
|
+
updateNodeData: (nodeInstanceId: string, nodeData: any) => Promise<void>;
|
|
71
71
|
zoomGraph: (factor: number) => void;
|
|
72
72
|
zoomGraphToFit: () => void;
|
|
73
73
|
zoomGraphRealSize: () => void;
|
|
@@ -313,7 +313,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
313
313
|
}).subscribe(_this.handlerResize);
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
-
_this.createTypeNodeMeta = function (nodeMeta, nodeType) {
|
|
316
|
+
_this.createTypeNodeMeta = function (nodeMeta, nodeType, experimentId) {
|
|
317
317
|
console.log('===================== createTypeNodeMeta');
|
|
318
318
|
var data = nodeMeta.data;
|
|
319
319
|
var type = data.type; // 节点
|
|
@@ -323,7 +323,9 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
323
323
|
if (nodeType === SIGN_OPERATION.CONDITION) {
|
|
324
324
|
return _this.graph.addNode(new ConditionJudgment(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
325
325
|
shape: 'condition-judgement-element',
|
|
326
|
-
component: /*#__PURE__*/React.createElement(ConditionElement,
|
|
326
|
+
component: /*#__PURE__*/React.createElement(ConditionElement, {
|
|
327
|
+
experimentId: experimentId
|
|
328
|
+
})
|
|
327
329
|
})));
|
|
328
330
|
}
|
|
329
331
|
/* 逻辑运算 */
|
|
@@ -332,13 +334,17 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
332
334
|
if (nodeType === SIGN_OPERATION.LOGICAL) {
|
|
333
335
|
return _this.graph.addNode(new LogicalNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
334
336
|
shape: 'logical-element',
|
|
335
|
-
component: /*#__PURE__*/React.createElement(LogicalElement,
|
|
337
|
+
component: /*#__PURE__*/React.createElement(LogicalElement, {
|
|
338
|
+
experimentId: experimentId
|
|
339
|
+
})
|
|
336
340
|
})));
|
|
337
341
|
}
|
|
338
342
|
|
|
339
343
|
return _this.graph.addNode(new CommonNode(_objectSpread(_objectSpread({}, nodeMeta), {}, {
|
|
340
344
|
shape: 'base-rect-node',
|
|
341
|
-
component: /*#__PURE__*/React.createElement(NodeElement,
|
|
345
|
+
component: /*#__PURE__*/React.createElement(NodeElement, {
|
|
346
|
+
experimentId: experimentId
|
|
347
|
+
})
|
|
342
348
|
})));
|
|
343
349
|
}
|
|
344
350
|
|
|
@@ -388,7 +394,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
388
394
|
|
|
389
395
|
nodeMeta = param.nodeMeta, clientX = param.clientX, clientY = param.clientY;
|
|
390
396
|
pos = graph.clientToLocal(clientX, clientY);
|
|
391
|
-
console.log('nodeMeta', nodeMeta);
|
|
397
|
+
console.log('nodeMeta', nodeMeta, pos);
|
|
392
398
|
nodeRes = addNode(_objectSpread(_objectSpread({}, nodeMeta), pos));
|
|
393
399
|
_context.next = 8;
|
|
394
400
|
return _this.updateExperimentGraph([nodeRes]);
|
|
@@ -523,46 +529,26 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
523
529
|
|
|
524
530
|
_this.updateNodeData = /*#__PURE__*/function () {
|
|
525
531
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(nodeInstanceId, nodeData) {
|
|
526
|
-
var
|
|
532
|
+
var cell, data, newData;
|
|
527
533
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
528
534
|
while (1) {
|
|
529
535
|
switch (_context5.prev = _context5.next) {
|
|
530
536
|
case 0:
|
|
531
|
-
renameRes = {
|
|
532
|
-
success: true
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
if (!renameRes.success) {
|
|
536
|
-
_context5.next = 10;
|
|
537
|
-
break;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
537
|
cell = _this.getCellById(nodeInstanceId);
|
|
541
538
|
|
|
542
|
-
if (
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
data = cell.getData();
|
|
548
|
-
newData = _objectSpread(_objectSpread({}, data), {}, {
|
|
549
|
-
nodeData: nodeData
|
|
550
|
-
});
|
|
551
|
-
cell.setData(newData);
|
|
552
|
-
_context5.next = 9;
|
|
553
|
-
return _this.updateExperimentGraph([newData]);
|
|
554
|
-
|
|
555
|
-
case 9:
|
|
556
|
-
_this.updateNodeById(nodeInstanceId, function (nodes) {
|
|
557
|
-
nodes.setData({
|
|
558
|
-
nodeData: nodeData
|
|
539
|
+
if (cell) {
|
|
540
|
+
data = cell.getData();
|
|
541
|
+
newData = _objectSpread(_objectSpread({}, data), {}, {
|
|
542
|
+
nodeData: JSON.stringify(nodeData)
|
|
559
543
|
});
|
|
560
|
-
|
|
544
|
+
cell.setData(newData);
|
|
561
545
|
|
|
562
|
-
|
|
563
|
-
|
|
546
|
+
_this.updateNodeById(nodeInstanceId, function (nodes) {
|
|
547
|
+
nodes.setData(newData);
|
|
548
|
+
});
|
|
549
|
+
}
|
|
564
550
|
|
|
565
|
-
case
|
|
551
|
+
case 2:
|
|
566
552
|
case "end":
|
|
567
553
|
return _context5.stop();
|
|
568
554
|
}
|
|
@@ -677,27 +663,68 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
677
663
|
}
|
|
678
664
|
|
|
679
665
|
return initialize;
|
|
680
|
-
}()
|
|
681
|
-
|
|
666
|
+
}()
|
|
682
667
|
}, {
|
|
683
|
-
key: "
|
|
668
|
+
key: "initPreviewData",
|
|
684
669
|
value: function () {
|
|
685
|
-
var
|
|
670
|
+
var _initPreviewData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(graphRes) {
|
|
671
|
+
var _this2 = this;
|
|
672
|
+
|
|
673
|
+
var nodes, links;
|
|
686
674
|
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
687
675
|
while (1) {
|
|
688
676
|
switch (_context8.prev = _context8.next) {
|
|
689
677
|
case 0:
|
|
690
|
-
|
|
678
|
+
console.log('initPreviewData', graphRes);
|
|
679
|
+
nodes = (graphRes === null || graphRes === void 0 ? void 0 : graphRes.nodes) || [];
|
|
680
|
+
links = (graphRes === null || graphRes === void 0 ? void 0 : graphRes.links) || [];
|
|
681
|
+
nodes === null || nodes === void 0 ? void 0 : nodes.forEach(function (item) {
|
|
682
|
+
_this2.updateExperimentGraph([item.data]);
|
|
691
683
|
|
|
692
|
-
|
|
684
|
+
_this2.addNode(item);
|
|
685
|
+
});
|
|
686
|
+
links === null || links === void 0 ? void 0 : links.forEach(function (item) {
|
|
687
|
+
_this2.updateExperimentGraph([], [item.data]);
|
|
688
|
+
|
|
689
|
+
_this2.addEdge(item);
|
|
690
|
+
}); // await this.updateExperimentGraph([nodeRes]);
|
|
691
|
+
// await this.experimentGraph$.next(graphRes)
|
|
692
|
+
|
|
693
|
+
case 5:
|
|
693
694
|
case "end":
|
|
694
695
|
return _context8.stop();
|
|
695
696
|
}
|
|
696
697
|
}
|
|
697
|
-
}, _callee8
|
|
698
|
+
}, _callee8);
|
|
699
|
+
}));
|
|
700
|
+
|
|
701
|
+
function initPreviewData(_x7) {
|
|
702
|
+
return _initPreviewData.apply(this, arguments);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
return initPreviewData;
|
|
706
|
+
}() // 获取图
|
|
707
|
+
|
|
708
|
+
}, {
|
|
709
|
+
key: "loadExperimentGraph",
|
|
710
|
+
value: function () {
|
|
711
|
+
var _loadExperimentGraph = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(graphRes) {
|
|
712
|
+
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
713
|
+
while (1) {
|
|
714
|
+
switch (_context9.prev = _context9.next) {
|
|
715
|
+
case 0:
|
|
716
|
+
_context9.next = 2;
|
|
717
|
+
return this.experimentGraph$.next(graphRes.data);
|
|
718
|
+
|
|
719
|
+
case 2:
|
|
720
|
+
case "end":
|
|
721
|
+
return _context9.stop();
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}, _callee9, this);
|
|
698
725
|
}));
|
|
699
726
|
|
|
700
|
-
function loadExperimentGraph(
|
|
727
|
+
function loadExperimentGraph(_x8) {
|
|
701
728
|
return _loadExperimentGraph.apply(this, arguments);
|
|
702
729
|
}
|
|
703
730
|
|
|
@@ -707,18 +734,18 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
707
734
|
}, {
|
|
708
735
|
key: "updateExperimentGraph",
|
|
709
736
|
value: function () {
|
|
710
|
-
var _updateExperimentGraph = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
737
|
+
var _updateExperimentGraph = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
|
|
711
738
|
var nodes,
|
|
712
739
|
links,
|
|
713
740
|
oldGraph,
|
|
714
741
|
newGraph,
|
|
715
|
-
|
|
716
|
-
return regeneratorRuntime.wrap(function
|
|
742
|
+
_args10 = arguments;
|
|
743
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
717
744
|
while (1) {
|
|
718
|
-
switch (
|
|
745
|
+
switch (_context10.prev = _context10.next) {
|
|
719
746
|
case 0:
|
|
720
|
-
nodes =
|
|
721
|
-
links =
|
|
747
|
+
nodes = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : [];
|
|
748
|
+
links = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : [];
|
|
722
749
|
console.log('========================== updateExperimentGraph');
|
|
723
750
|
oldGraph = this.experimentGraph$.getValue();
|
|
724
751
|
newGraph = produce(oldGraph, function (nextGraph) {
|
|
@@ -738,10 +765,10 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
738
765
|
|
|
739
766
|
case 6:
|
|
740
767
|
case "end":
|
|
741
|
-
return
|
|
768
|
+
return _context10.stop();
|
|
742
769
|
}
|
|
743
770
|
}
|
|
744
|
-
},
|
|
771
|
+
}, _callee10, this);
|
|
745
772
|
}));
|
|
746
773
|
|
|
747
774
|
function updateExperimentGraph() {
|
|
@@ -754,18 +781,18 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
754
781
|
}, {
|
|
755
782
|
key: "delExperimentGraphElement",
|
|
756
783
|
value: function () {
|
|
757
|
-
var _delExperimentGraphElement = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
784
|
+
var _delExperimentGraphElement = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
|
|
758
785
|
var nodes,
|
|
759
786
|
links,
|
|
760
787
|
oldGraph,
|
|
761
788
|
newGraph,
|
|
762
|
-
|
|
763
|
-
return regeneratorRuntime.wrap(function
|
|
789
|
+
_args11 = arguments;
|
|
790
|
+
return regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
764
791
|
while (1) {
|
|
765
|
-
switch (
|
|
792
|
+
switch (_context11.prev = _context11.next) {
|
|
766
793
|
case 0:
|
|
767
|
-
nodes =
|
|
768
|
-
links =
|
|
794
|
+
nodes = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : [];
|
|
795
|
+
links = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : [];
|
|
769
796
|
oldGraph = this.experimentGraph$.getValue();
|
|
770
797
|
newGraph = produce(oldGraph, function (nextGraph) {
|
|
771
798
|
if (nodes.length) {
|
|
@@ -789,10 +816,10 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
789
816
|
|
|
790
817
|
case 5:
|
|
791
818
|
case "end":
|
|
792
|
-
return
|
|
819
|
+
return _context11.stop();
|
|
793
820
|
}
|
|
794
821
|
}
|
|
795
|
-
},
|
|
822
|
+
}, _callee11, this);
|
|
796
823
|
}));
|
|
797
824
|
|
|
798
825
|
function delExperimentGraphElement() {
|
|
@@ -811,7 +838,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
811
838
|
}, {
|
|
812
839
|
key: "renderNode",
|
|
813
840
|
value: function renderNode(nodeMeta) {
|
|
814
|
-
var
|
|
841
|
+
var _this3 = this;
|
|
815
842
|
|
|
816
843
|
console.log('renderNode >>>>>>', nodeMeta);
|
|
817
844
|
var experimentId = this.experimentId;
|
|
@@ -826,7 +853,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
826
853
|
|
|
827
854
|
var nodeType = id === null || id === void 0 ? void 0 : (_id$split = id.split('-')) === null || _id$split === void 0 ? void 0 : _id$split[0]; // 创建 node meta 元数据
|
|
828
855
|
|
|
829
|
-
var node = this.createTypeNodeMeta(nodeMeta, nodeType);
|
|
856
|
+
var node = this.createTypeNodeMeta(nodeMeta, nodeType, experimentId);
|
|
830
857
|
if (!node) return undefined;
|
|
831
858
|
|
|
832
859
|
if (nodeMeta.data.hide) {
|
|
@@ -845,7 +872,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
845
872
|
})
|
|
846
873
|
})));
|
|
847
874
|
includedNodes.forEach(function (normalNode) {
|
|
848
|
-
var targetNode =
|
|
875
|
+
var targetNode = _this3.getNodeById(normalNode.id);
|
|
849
876
|
|
|
850
877
|
group.addChild(targetNode);
|
|
851
878
|
});
|
|
@@ -905,15 +932,20 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
905
932
|
this.selectedGroup$.next(undefined);
|
|
906
933
|
}
|
|
907
934
|
}
|
|
935
|
+
}, {
|
|
936
|
+
key: "onClearSelectNodes",
|
|
937
|
+
value: function onClearSelectNodes() {
|
|
938
|
+
this.activeNodeInstance$.next(null); // 当没选中任何东西时,清空选中的节点信息
|
|
939
|
+
}
|
|
908
940
|
}, {
|
|
909
941
|
key: "onConnectNode",
|
|
910
942
|
value: function () {
|
|
911
|
-
var _onConnectNode = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
943
|
+
var _onConnectNode = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(args) {
|
|
912
944
|
var _args$edge, edge, isNew, source, target, node, portId, _this$graph, _this$graph2, data, sourceCell, targetCell, sourceCellData, targetCellData;
|
|
913
945
|
|
|
914
|
-
return regeneratorRuntime.wrap(function
|
|
946
|
+
return regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
915
947
|
while (1) {
|
|
916
|
-
switch (
|
|
948
|
+
switch (_context12.prev = _context12.next) {
|
|
917
949
|
case 0:
|
|
918
950
|
_args$edge = args.edge, edge = _args$edge === void 0 ? {} : _args$edge, isNew = args.isNew;
|
|
919
951
|
source = edge.source, target = edge.target;
|
|
@@ -954,19 +986,19 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
954
986
|
}
|
|
955
987
|
}
|
|
956
988
|
|
|
957
|
-
return
|
|
989
|
+
return _context12.abrupt("return", {
|
|
958
990
|
success: true
|
|
959
991
|
});
|
|
960
992
|
|
|
961
993
|
case 4:
|
|
962
994
|
case "end":
|
|
963
|
-
return
|
|
995
|
+
return _context12.stop();
|
|
964
996
|
}
|
|
965
997
|
}
|
|
966
|
-
},
|
|
998
|
+
}, _callee12, this);
|
|
967
999
|
}));
|
|
968
1000
|
|
|
969
|
-
function onConnectNode(
|
|
1001
|
+
function onConnectNode(_x9) {
|
|
970
1002
|
return _onConnectNode.apply(this, arguments);
|
|
971
1003
|
}
|
|
972
1004
|
|
|
@@ -1011,13 +1043,13 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
1011
1043
|
}, {
|
|
1012
1044
|
key: "onMoveNodes",
|
|
1013
1045
|
value: function () {
|
|
1014
|
-
var _onMoveNodes = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1015
|
-
var
|
|
1046
|
+
var _onMoveNodes = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(movedNodes) {
|
|
1047
|
+
var _this4 = this;
|
|
1016
1048
|
|
|
1017
1049
|
var targetNodes, newPos, oldGraph, newGraph;
|
|
1018
|
-
return regeneratorRuntime.wrap(function
|
|
1050
|
+
return regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1019
1051
|
while (1) {
|
|
1020
|
-
switch (
|
|
1052
|
+
switch (_context13.prev = _context13.next) {
|
|
1021
1053
|
case 0:
|
|
1022
1054
|
targetNodes = movedNodes.filter(function (arg) {
|
|
1023
1055
|
var node = arg.node;
|
|
@@ -1032,7 +1064,7 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
1032
1064
|
y = current.y;
|
|
1033
1065
|
var id = node.id;
|
|
1034
1066
|
|
|
1035
|
-
|
|
1067
|
+
_this4.updateNodeById(id, function (nodes) {
|
|
1036
1068
|
nodes.setData({
|
|
1037
1069
|
x: x,
|
|
1038
1070
|
y: y
|
|
@@ -1066,13 +1098,13 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
1066
1098
|
|
|
1067
1099
|
case 2:
|
|
1068
1100
|
case "end":
|
|
1069
|
-
return
|
|
1101
|
+
return _context13.stop();
|
|
1070
1102
|
}
|
|
1071
1103
|
}
|
|
1072
|
-
},
|
|
1104
|
+
}, _callee13, this);
|
|
1073
1105
|
}));
|
|
1074
1106
|
|
|
1075
|
-
function onMoveNodes(
|
|
1107
|
+
function onMoveNodes(_x10) {
|
|
1076
1108
|
return _onMoveNodes.apply(this, arguments);
|
|
1077
1109
|
}
|
|
1078
1110
|
|
|
@@ -1122,22 +1154,22 @@ var ExperimentGraph = /*#__PURE__*/function (_GraphCore) {
|
|
|
1122
1154
|
key: "setModal",
|
|
1123
1155
|
value: // 打开弹窗
|
|
1124
1156
|
function () {
|
|
1125
|
-
var _setModal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1126
|
-
return regeneratorRuntime.wrap(function
|
|
1157
|
+
var _setModal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(params) {
|
|
1158
|
+
return regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1127
1159
|
while (1) {
|
|
1128
|
-
switch (
|
|
1160
|
+
switch (_context14.prev = _context14.next) {
|
|
1129
1161
|
case 0:
|
|
1130
1162
|
this.activeModal$.next(params);
|
|
1131
1163
|
|
|
1132
1164
|
case 1:
|
|
1133
1165
|
case "end":
|
|
1134
|
-
return
|
|
1166
|
+
return _context14.stop();
|
|
1135
1167
|
}
|
|
1136
1168
|
}
|
|
1137
|
-
},
|
|
1169
|
+
}, _callee14, this);
|
|
1138
1170
|
}));
|
|
1139
1171
|
|
|
1140
|
-
function setModal(
|
|
1172
|
+
function setModal(_x11) {
|
|
1141
1173
|
return _setModal.apply(this, arguments);
|
|
1142
1174
|
}
|
|
1143
1175
|
|
|
@@ -40,9 +40,22 @@ var Index = function Index(props) {
|
|
|
40
40
|
var handleSave = function handleSave(type) {
|
|
41
41
|
var _expGraph$graph, _expGraph$graph2;
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
var nodes = expGraph === null || expGraph === void 0 ? void 0 : (_expGraph$graph = expGraph.graph) === null || _expGraph$graph === void 0 ? void 0 : _expGraph$graph.getNodes();
|
|
44
|
+
var nodesData = nodes === null || nodes === void 0 ? void 0 : nodes.map(function (item) {
|
|
45
|
+
return item === null || item === void 0 ? void 0 : item.store.data;
|
|
46
|
+
});
|
|
47
|
+
var edges = expGraph === null || expGraph === void 0 ? void 0 : (_expGraph$graph2 = expGraph.graph) === null || _expGraph$graph2 === void 0 ? void 0 : _expGraph$graph2.getEdges();
|
|
48
|
+
var edgesData = edges === null || edges === void 0 ? void 0 : edges.map(function (item) {
|
|
49
|
+
return item === null || item === void 0 ? void 0 : item.store.data;
|
|
50
|
+
});
|
|
51
|
+
console.log({
|
|
52
|
+
nodes: nodesData,
|
|
53
|
+
links: edgesData
|
|
54
|
+
});
|
|
55
|
+
onSave === null || onSave === void 0 ? void 0 : onSave(type, {
|
|
56
|
+
nodes: nodesData,
|
|
57
|
+
links: edgesData
|
|
58
|
+
});
|
|
46
59
|
};
|
|
47
60
|
|
|
48
61
|
var handleFocus = function handleFocus() {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
@import (reference) '../../style/theme-light';
|
|
2
|
-
|
|
3
|
-
.header-btn {
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
margin-right: 15px;
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
cursor: pointer;
|
|
9
|
-
.header-btn-img {
|
|
10
|
-
width: 13px;
|
|
11
|
-
height: 13px;
|
|
12
|
-
margin-right: 5px;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.strategyHeader {
|
|
17
|
-
height: 45px !important;
|
|
18
|
-
line-height: 45px !important;
|
|
19
|
-
padding: 0 15px;
|
|
20
|
-
background: @light-gray-bg;
|
|
21
|
-
box-shadow: 0 2px 30px 0 rgba(137, 137, 137, 0.3);
|
|
22
|
-
}
|
|
1
|
+
@import (reference) '../../style/theme-light';
|
|
2
|
+
|
|
3
|
+
.header-btn {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
margin-right: 15px;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
.header-btn-img {
|
|
10
|
+
width: 13px;
|
|
11
|
+
height: 13px;
|
|
12
|
+
margin-right: 5px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.strategyHeader {
|
|
17
|
+
height: 45px !important;
|
|
18
|
+
line-height: 45px !important;
|
|
19
|
+
padding: 0 15px;
|
|
20
|
+
background: @light-gray-bg;
|
|
21
|
+
box-shadow: 0 2px 30px 0 rgba(137, 137, 137, 0.3);
|
|
22
|
+
}
|
package/es/typings.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
declare module '*.css';
|
|
2
|
-
declare module '*.less';
|
|
3
|
-
|
|
4
|
-
type Window = {
|
|
5
|
-
requestIdleCallback: (callback: () => void) => void;
|
|
6
|
-
};
|
|
1
|
+
declare module '*.css';
|
|
2
|
+
declare module '*.less';
|
|
3
|
+
|
|
4
|
+
type Window = {
|
|
5
|
+
requestIdleCallback: (callback: () => void) => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
declare namespace Types {
|
|
9
|
+
export type ModeType = 'platform' | 'view';
|
|
10
|
+
|
|
11
|
+
export interface PanelComponentProps {
|
|
12
|
+
mode?: ModeType;
|
|
13
|
+
}
|
|
14
|
+
}
|