dcim-topology2d 2.1.0 → 3.0.2
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/activity-diagram/src/final/final.d.ts +1 -1
- package/activity-diagram/src/final/final.rect.d.ts +1 -1
- package/activity-diagram/src/final/final.rect.js +1 -1
- package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
- package/activity-diagram/src/fork/fork.anchor.js +1 -1
- package/activity-diagram/src/fork/fork.d.ts +1 -1
- package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
- package/activity-diagram/src/fork/fork.rect.js +1 -1
- package/activity-diagram/src/register.js +1 -1
- package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
- package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
- package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
- package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
- package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
- package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
- package/chart-diagram/index.d.ts +1 -3
- package/chart-diagram/index.js +1 -2
- package/chart-diagram/src/echarts/index.d.ts +2 -1
- package/chart-diagram/src/echarts/index.js +104 -109
- package/chart-diagram/src/register.js +8 -9
- package/class-diagram/src/class/class.d.ts +1 -1
- package/class-diagram/src/class/class.rect.d.ts +1 -1
- package/class-diagram/src/class/class.rect.js +1 -1
- package/class-diagram/src/register.js +1 -1
- package/core/index.d.ts +0 -2
- package/core/index.js +0 -2
- package/core/src/activeLayer.d.ts +10 -2
- package/core/src/activeLayer.js +47 -42
- package/core/src/animateLayer.d.ts +7 -3
- package/core/src/animateLayer.js +12 -10
- package/core/src/calling.d.ts +4 -1
- package/core/src/calling.js +41 -43
- package/core/src/canvas.d.ts +6 -1
- package/core/src/canvas.js +21 -22
- package/core/src/common.d.ts +7 -6
- package/core/src/common.js +674 -341
- package/core/src/core.d.ts +4 -5
- package/core/src/core.js +385 -522
- package/core/src/divLayer.d.ts +36 -2
- package/core/src/divLayer.js +305 -33
- package/core/src/healps/changeData.d.ts +2 -1
- package/core/src/healps/changeData.js +66 -32
- package/core/src/hoverLayer.d.ts +9 -2
- package/core/src/hoverLayer.js +34 -31
- package/core/src/middles/default.d.ts +3 -1
- package/core/src/middles/default.js +51 -59
- package/core/src/middles/index.js +2 -3
- package/core/src/middles/nodes/arbitrarygraph.js +9 -11
- package/core/src/middles/nodes/pentagon.rect.js +1 -1
- package/core/src/middles/nodes/rectangle.rect.js +1 -1
- package/core/src/models/data.d.ts +26 -0
- package/core/src/models/data.js +77 -0
- package/core/src/models/data.js.map +1 -0
- package/core/src/models/index.d.ts +1 -0
- package/core/src/models/index.js +1 -0
- package/core/src/models/node.d.ts +0 -10
- package/core/src/models/node.js +36 -81
- package/core/src/models/pen.js +59 -19
- package/core/src/models/rect.js +2 -2
- package/core/src/mqtt.d.ts +14 -0
- package/core/src/mqtt.js +82 -0
- package/core/src/mqtt.js.map +1 -0
- package/core/src/offscreen.d.ts +4 -1
- package/core/src/offscreen.js +8 -10
- package/core/src/options.d.ts +1 -3
- package/core/src/options.js +0 -2
- package/core/src/poll.js +39 -0
- package/core/src/preview.d.ts +13 -2
- package/core/src/preview.js +43 -135
- package/core/src/renderLayer.d.ts +9 -11
- package/core/src/renderLayer.js +61 -60
- package/core/src/socket.d.ts +10 -0
- package/core/src/socket.js +51 -0
- package/core/src/socket.js.map +1 -0
- package/core/src/utils/canvas.js +1 -1
- package/core/src/utils/construction.d.ts +3 -12
- package/core/src/utils/construction.js +1 -8
- package/core/src/utils/conversion.d.ts +0 -13
- package/core/src/utils/conversion.js +0 -210
- package/core/src/utils/dom.d.ts +8 -0
- package/core/src/utils/dom.js +67 -0
- package/core/src/utils/dom.js.map +1 -0
- package/core/src/utils/index.d.ts +1 -2
- package/core/src/utils/index.js +1 -2
- package/core/src/utils/math.d.ts +0 -1
- package/core/src/utils/math.js +0 -3
- package/core/src/utils/onmousevent.d.ts +0 -3
- package/core/src/utils/onmousevent.js +10 -42
- package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
- package/flow-diagram/src/comment/comment.anchor.js +1 -1
- package/flow-diagram/src/comment/comment.d.ts +1 -1
- package/flow-diagram/src/data/data.anchor.d.ts +1 -1
- package/flow-diagram/src/data/data.anchor.js +1 -1
- package/flow-diagram/src/data/data.d.ts +1 -1
- package/flow-diagram/src/data/data.rect.d.ts +1 -1
- package/flow-diagram/src/data/data.rect.js +1 -1
- package/flow-diagram/src/db/db.d.ts +1 -1
- package/flow-diagram/src/db/db.rect.d.ts +1 -1
- package/flow-diagram/src/db/db.rect.js +1 -1
- package/flow-diagram/src/display/display.anchor.d.ts +1 -1
- package/flow-diagram/src/display/display.anchor.js +1 -1
- package/flow-diagram/src/display/display.d.ts +1 -1
- package/flow-diagram/src/display/display.rect.d.ts +1 -1
- package/flow-diagram/src/display/display.rect.js +1 -1
- package/flow-diagram/src/document/document.anchor.d.ts +1 -1
- package/flow-diagram/src/document/document.anchor.js +1 -1
- package/flow-diagram/src/document/document.d.ts +1 -1
- package/flow-diagram/src/document/document.rect.d.ts +1 -1
- package/flow-diagram/src/document/document.rect.js +1 -1
- package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
- package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
- package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
- package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
- package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
- package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
- package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
- package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
- package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
- package/flow-diagram/src/manually/manually.anchor.js +1 -1
- package/flow-diagram/src/manually/manually.d.ts +1 -1
- package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
- package/flow-diagram/src/manually/manually.rect.js +1 -1
- package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
- package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
- package/flow-diagram/src/parallel/parallel.d.ts +1 -1
- package/flow-diagram/src/queue/queue.d.ts +1 -1
- package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
- package/flow-diagram/src/queue/queue.rect.js +1 -1
- package/flow-diagram/src/register.js +1 -1
- package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
- package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
- package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
- package/layout/src/align.d.ts +1 -1
- package/layout/src/align.js +1 -1
- package/layout/src/layout.d.ts +1 -1
- package/layout/src/layout.js +1 -1
- package/myShape-diagram/{index.js → myShape.js} +1 -4
- package/package.json +1 -1
- package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
- package/sequence-diagram/src/focus/focus.anchor.js +1 -1
- package/sequence-diagram/src/focus/focus.d.ts +1 -1
- package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
- package/sequence-diagram/src/focus/focus.rect.js +1 -1
- package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
- package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
- package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
- package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
- package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
- package/sequence-diagram/src/register.js +1 -1
- package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
- package/chart-diagram/src/utils/changeOptions.js +0 -267
- package/chart-diagram/src/utils/conversion.d.ts +0 -19
- package/chart-diagram/src/utils/conversion.js +0 -559
- package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
- package/chart-diagram/src/utils/drawGraphic.js +0 -97
- package/chart-diagram/src/utils/formatter.d.ts +0 -1
- package/chart-diagram/src/utils/formatter.js +0 -206
- package/chart-diagram/src/utils/index.d.ts +0 -5
- package/chart-diagram/src/utils/index.js +0 -5
- package/chart-diagram/src/utils/render.d.ts +0 -8
- package/chart-diagram/src/utils/render.js +0 -219
- package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
- package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
- package/core/src/element/common.d.ts +0 -6
- package/core/src/element/common.js +0 -54
- package/core/src/element/datePicker.d.ts +0 -3
- package/core/src/element/datePicker.js +0 -47
- package/core/src/element/iframe.d.ts +0 -3
- package/core/src/element/iframe.js +0 -12
- package/core/src/element/index.d.ts +0 -5
- package/core/src/element/index.js +0 -6
- package/core/src/element/select.d.ts +0 -11
- package/core/src/element/select.js +0 -275
- package/core/src/element/tab.d.ts +0 -1
- package/core/src/element/tab.js +0 -25
- package/core/src/element/time.d.ts +0 -3
- package/core/src/element/time.js +0 -44
- package/core/src/middles/arrows/index.d.ts +0 -4
- package/core/src/middles/arrows/index.js +0 -5
- package/core/src/middles/lines/index.d.ts +0 -4
- package/core/src/middles/lines/index.js +0 -5
- package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
- package/core/src/middles/nodes/formDatePicker.js +0 -66
- package/core/src/middles/nodes/formoverflow.js +0 -61
- package/core/src/middles/nodes/formselect.d.ts +0 -2
- package/core/src/middles/nodes/formselect.js +0 -102
- package/core/src/middles/nodes/iframe.d.ts +0 -2
- package/core/src/middles/nodes/iframe.js +0 -29
- package/core/src/middles/nodes/index.d.ts +0 -50
- package/core/src/middles/nodes/index.js +0 -52
- package/core/src/middles/nodes/time.d.ts +0 -2
- package/core/src/middles/nodes/time.js +0 -98
- package/core/src/store/common.d.ts +0 -9
- package/core/src/store/common.js +0 -5
- package/core/src/store/data.d.ts +0 -194
- package/core/src/store/data.js +0 -187
- package/core/src/store/index.d.ts +0 -2
- package/core/src/store/index.js +0 -2
- package/core/src/utils/assignment.d.ts +0 -7
- package/core/src/utils/assignment.js +0 -185
- package/core/src/utils/params.d.ts +0 -2
- package/core/src/utils/params.js +0 -65
- package/static/echartsDefaultData.js +0 -178
- package/static/element.js +0 -14
- package/static/form.js +0 -11
- package/static/index.js +0 -3
- package/store/actions.js +0 -1
- package/store/clear.js +0 -10
- package/store/index.js +0 -2
- package/style/common.css +0 -15
- package/style/datePicker.css +0 -44
- package/style/editor.css +0 -16
- package/style/index.css +0 -5
- package/style/select.css +0 -143
- /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
@@ -1,50 +0,0 @@
|
|
1
|
-
export * from './arbitrarygraph';
|
2
|
-
export * from './arbitrarygraph.anchor';
|
3
|
-
export * from './arrow';
|
4
|
-
export * from './arrow.rect';
|
5
|
-
export * from './arrow.anchor';
|
6
|
-
export * from './circle';
|
7
|
-
export * from './circle.rect';
|
8
|
-
export * from './circle.anchor';
|
9
|
-
export * from './cloud';
|
10
|
-
export * from './cloud.rect';
|
11
|
-
export * from './cloud.anchor';
|
12
|
-
export * from './cube';
|
13
|
-
export * from './cube.rect';
|
14
|
-
export * from './cube.anchor';
|
15
|
-
export * from './cube.model';
|
16
|
-
export * from './diamond';
|
17
|
-
export * from './diamond.rect';
|
18
|
-
export * from './file';
|
19
|
-
export * from './formtable';
|
20
|
-
export * from './formselect';
|
21
|
-
export * from './hexagon';
|
22
|
-
export * from './hexagon.anchor';
|
23
|
-
export * from './hexagon.rect';
|
24
|
-
export * from './image.rect';
|
25
|
-
export * from './image.anchor';
|
26
|
-
export * from './iframe';
|
27
|
-
export * from './line';
|
28
|
-
export * from './line.anchor';
|
29
|
-
export * from './line.rect';
|
30
|
-
export * from './message';
|
31
|
-
export * from './message.anchor';
|
32
|
-
export * from './message.rect';
|
33
|
-
export * from './pentagon';
|
34
|
-
export * from './pentagon.anchor';
|
35
|
-
export * from './pentagon.rect';
|
36
|
-
export * from './pentagram';
|
37
|
-
export * from './pentagram.anchor';
|
38
|
-
export * from './pentagram.rect';
|
39
|
-
export * from './people';
|
40
|
-
export * from './people.rect';
|
41
|
-
export * from './rectangle';
|
42
|
-
export * from './rectangle.rect';
|
43
|
-
export * from './tablePagination';
|
44
|
-
export * from './text';
|
45
|
-
export * from './triangle';
|
46
|
-
export * from './triangle.anchor';
|
47
|
-
export * from './triangle.rect';
|
48
|
-
export * from './formoverflow';
|
49
|
-
export * from './time';
|
50
|
-
export * from './formDatePicker';
|
@@ -1,52 +0,0 @@
|
|
1
|
-
export * from './arbitrarygraph';
|
2
|
-
export * from './arbitrarygraph.anchor';
|
3
|
-
export * from './arrow';
|
4
|
-
export * from './arrow.rect';
|
5
|
-
export * from './arrow.anchor';
|
6
|
-
export * from './circle';
|
7
|
-
export * from './circle.rect';
|
8
|
-
export * from './circle.anchor';
|
9
|
-
export * from './cloud';
|
10
|
-
export * from './cloud.rect';
|
11
|
-
export * from './cloud.anchor';
|
12
|
-
export * from './cube';
|
13
|
-
export * from './cube.rect';
|
14
|
-
export * from './cube.anchor';
|
15
|
-
export * from './cube.model';
|
16
|
-
export * from './diamond';
|
17
|
-
export * from './diamond.rect';
|
18
|
-
export * from './file';
|
19
|
-
export * from './formtable';
|
20
|
-
export * from './formselect';
|
21
|
-
export * from './hexagon';
|
22
|
-
export * from './hexagon.anchor';
|
23
|
-
export * from './hexagon.rect';
|
24
|
-
export * from './image.rect';
|
25
|
-
export * from './image.anchor';
|
26
|
-
export * from './iframe';
|
27
|
-
export * from './line';
|
28
|
-
export * from './line.anchor';
|
29
|
-
export * from './line.rect';
|
30
|
-
export * from './message';
|
31
|
-
export * from './message.anchor';
|
32
|
-
export * from './message.rect';
|
33
|
-
export * from './pentagon';
|
34
|
-
export * from './pentagon.anchor';
|
35
|
-
export * from './pentagon.rect';
|
36
|
-
export * from './pentagram';
|
37
|
-
export * from './pentagram.anchor';
|
38
|
-
export * from './pentagram.rect';
|
39
|
-
export * from './people';
|
40
|
-
export * from './people.rect';
|
41
|
-
export * from './rectangle';
|
42
|
-
export * from './rectangle.rect';
|
43
|
-
export * from './tablePagination';
|
44
|
-
export * from './text';
|
45
|
-
export * from './triangle';
|
46
|
-
export * from './triangle.anchor';
|
47
|
-
export * from './triangle.rect';
|
48
|
-
export * from './formoverflow';
|
49
|
-
export * from './time';
|
50
|
-
export * from './formDatePicker';
|
51
|
-
|
52
|
-
//# sourceMappingURL=index.js.map
|
@@ -1,98 +0,0 @@
|
|
1
|
-
export function time(ctx, node) {
|
2
|
-
var wr = node.borderRadius;
|
3
|
-
var hr = node.borderRadius;
|
4
|
-
if (node.borderRadius < 1) {
|
5
|
-
wr = node.rect.width * node.borderRadius;
|
6
|
-
hr = node.rect.height * node.borderRadius;
|
7
|
-
}
|
8
|
-
var r = wr < hr ? wr : hr;
|
9
|
-
if (node.rect.width < 2 * r) {
|
10
|
-
r = node.rect.width / 2;
|
11
|
-
}
|
12
|
-
if (node.rect.height < 2 * r) {
|
13
|
-
r = node.rect.height / 2;
|
14
|
-
}
|
15
|
-
|
16
|
-
// 背景
|
17
|
-
let x = node.rect.x;
|
18
|
-
let y = node.rect.y;
|
19
|
-
let width = node.rect.width * 0.29;
|
20
|
-
let height = node.rect.height;
|
21
|
-
let gap = node.rect.width * 0.065;
|
22
|
-
let {h, m, s} = node.time;
|
23
|
-
|
24
|
-
//绘制时
|
25
|
-
drawText(ctx, r, x, y, width, height, h, node, gap)
|
26
|
-
|
27
|
-
//绘制分
|
28
|
-
drawText(ctx, r, x+width+gap, y, width, height, m, node, gap)
|
29
|
-
|
30
|
-
//绘制秒
|
31
|
-
drawText(ctx, r, x+(width*2 + gap*2), y, width, height, s, node)
|
32
|
-
|
33
|
-
//恢复填充色
|
34
|
-
ctx.fillStyle = "#ffffff";
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
|
39
|
-
function drawText(ctx, r, x, y, width, height, hText, node, gap) {
|
40
|
-
|
41
|
-
//文字
|
42
|
-
let textfillStyle = node.font.color || "#ffffff";
|
43
|
-
let textBackground = node.font.background || '#ffffff1a';
|
44
|
-
ctx.font = '' + node.font.fontSize +"px " + node.font.fontFamily;
|
45
|
-
ctx.textBaseline = 'middle';
|
46
|
-
ctx.textAlign = 'center';
|
47
|
-
|
48
|
-
const centerX = width / 2;
|
49
|
-
const centerY = height / 2;
|
50
|
-
//绘制上半部分
|
51
|
-
ctx.save();
|
52
|
-
ctx.beginPath();
|
53
|
-
ctx.fillStyle = textBackground;
|
54
|
-
ctx.beginPath();
|
55
|
-
ctx.moveTo(x + r, y);
|
56
|
-
ctx.lineTo(x + width -r, y);
|
57
|
-
ctx.quadraticCurveTo(x + width, y, x+width, y+r);
|
58
|
-
ctx.lineTo(x+width, y + height/2 - 1);
|
59
|
-
ctx.lineTo(x, y + height/2 - 1);
|
60
|
-
ctx.lineTo(x, y+r);
|
61
|
-
ctx.quadraticCurveTo(x, y, x+r, y);
|
62
|
-
ctx.fill();
|
63
|
-
ctx.clip();
|
64
|
-
|
65
|
-
ctx.fillStyle = textfillStyle;
|
66
|
-
ctx.fillText(hText, x+centerX, y+centerY);
|
67
|
-
ctx.restore();
|
68
|
-
//绘制下半部分
|
69
|
-
ctx.save();
|
70
|
-
ctx.beginPath();
|
71
|
-
ctx.fillStyle = textBackground;
|
72
|
-
ctx.moveTo(x, y+height/2+1);
|
73
|
-
ctx.lineTo(x+width, y+height/2+1);
|
74
|
-
ctx.lineTo(x+width, y+height-r);
|
75
|
-
ctx.quadraticCurveTo(x+width, y+height, x+width-r, y+height);
|
76
|
-
ctx.lineTo(x+r, y+height);
|
77
|
-
ctx.quadraticCurveTo(x, y+height, x, y+height-r);
|
78
|
-
ctx.lineTo(x, y+height/2+2);
|
79
|
-
ctx.fill();
|
80
|
-
ctx.clip();
|
81
|
-
|
82
|
-
ctx.fillStyle = textfillStyle;
|
83
|
-
ctx.fillText(hText, x+centerX, y+centerY);
|
84
|
-
ctx.restore();
|
85
|
-
|
86
|
-
//绘制冒号
|
87
|
-
if(!gap) return
|
88
|
-
|
89
|
-
ctx.fillStyle = textfillStyle;
|
90
|
-
ctx.textBaseline = 'middle';
|
91
|
-
ctx.textAlign = 'center';
|
92
|
-
let metricss = ctx.measureText(":");
|
93
|
-
const fontHeights = metricss.actualBoundingBoxAscent + metricss.actualBoundingBoxDescent;
|
94
|
-
const centerYY = y + (height / 2) + (metricss.actualBoundingBoxAscent - fontHeights / 2);
|
95
|
-
ctx.fillText(":", x+width+(gap/2), centerYY);
|
96
|
-
ctx.restore();
|
97
|
-
|
98
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { Pen } from '../models';
|
2
|
-
// @ts-ignore
|
3
|
-
export const commonStore: {
|
4
|
-
canvasDraws: {
|
5
|
-
[key: string]: (ctx: CanvasRenderingContext2D, pen: Pen) => void;
|
6
|
-
};
|
7
|
-
anchors: { [key: string]: (pen: Pen) => void };
|
8
|
-
htmlElements: { [key: string]: HTMLDivElement }; // html元素
|
9
|
-
};
|
package/core/src/store/common.js
DELETED
package/core/src/store/data.d.ts
DELETED
@@ -1,194 +0,0 @@
|
|
1
|
-
// @ts-ignore
|
2
|
-
import { default as mitt, Emitter } from 'mitt';
|
3
|
-
import { Pen, Lock } from '../models';
|
4
|
-
import {Options, DefalutOptions} from '../options';
|
5
|
-
import {s8} from '../utils';
|
6
|
-
import { commonStore } from './common'
|
7
|
-
// 2D可视化的data数据
|
8
|
-
export interface visualization2DData {
|
9
|
-
pens: Pen[];
|
10
|
-
lineName: string;
|
11
|
-
fromArrowType: string;
|
12
|
-
toArrowType: string;
|
13
|
-
scale: number;
|
14
|
-
pageZoom: number,
|
15
|
-
locked: Lock;
|
16
|
-
bkImage: string;
|
17
|
-
bkColor: string;
|
18
|
-
grid?: boolean;
|
19
|
-
websocket?: string;
|
20
|
-
mqttUrl?: string;
|
21
|
-
mqttOptions?: {
|
22
|
-
clientId?: string;
|
23
|
-
username?: string;
|
24
|
-
password?: string;
|
25
|
-
};
|
26
|
-
mqttTopics?: string;
|
27
|
-
manualCps?: boolean;
|
28
|
-
dataConstruct?: any;
|
29
|
-
bindDataTooltipVisible?: boolean;
|
30
|
-
data?: any;
|
31
|
-
bkImageRect?: any;
|
32
|
-
}
|
33
|
-
export interface paramsData {
|
34
|
-
doorIds?: [],
|
35
|
-
tagIds?: [],
|
36
|
-
kpiAddrs?: [],
|
37
|
-
tagEcharts?: [],
|
38
|
-
assetIds?: [],
|
39
|
-
areaIds?: [],
|
40
|
-
varVaule?: [],
|
41
|
-
branchValue?: [],
|
42
|
-
echartData?: [],
|
43
|
-
echartAssemblyData?: [],
|
44
|
-
routingkey?: string,
|
45
|
-
pathRewrite?: string
|
46
|
-
}
|
47
|
-
// 2D可视化使用到的数据仓库
|
48
|
-
export interface visualization2DStore {
|
49
|
-
id: string;
|
50
|
-
data: visualization2DData;
|
51
|
-
mqttData?: null; // mqtt实时数据
|
52
|
-
initConfNode: {}; // 初始化元件节点数据
|
53
|
-
mqttParams: paramsData; // mqtt参数
|
54
|
-
pens: { [key: string]: Pen };
|
55
|
-
options: Options;
|
56
|
-
cacheDatas?: {
|
57
|
-
data: visualization2DData;
|
58
|
-
}[];
|
59
|
-
elementInteractivePoor: {}; // element 交互过渡数据
|
60
|
-
pickerDataPool: {}; // datePicker 交互数据池
|
61
|
-
echartsDataPool: {}; // echarts Dom节点数据
|
62
|
-
echartsOptionsPool: {}; // echarts options节点数据
|
63
|
-
echartsRealDataPool: {}; // echarts 实时数据
|
64
|
-
switchTabDataPool: {}; // tabs
|
65
|
-
tableDataPool: {}; // form table
|
66
|
-
selectDataPool: {}; // form select
|
67
|
-
selectRealDataPool: {}; // form select
|
68
|
-
selectTabDataPool: {}; // form select
|
69
|
-
iframeDataPool: {}; // iframe
|
70
|
-
formoverDataPool: {}; // 滚动组件 Dom节点数据
|
71
|
-
formoverCanvasDataPool: {}; // 滚动组件 画布节点数据
|
72
|
-
emitter: Emitter;
|
73
|
-
dpiRatio?: number;
|
74
|
-
lastScale?: number; //记录上次模版的scale
|
75
|
-
monitorAlarm?:boolean; // 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
|
76
|
-
parentElem: HTMLElement
|
77
|
-
}
|
78
|
-
// @ts-ignore
|
79
|
-
export const createStore = () => {
|
80
|
-
return {
|
81
|
-
id: '',
|
82
|
-
data: {
|
83
|
-
pens: [],
|
84
|
-
lineName: 'curve',
|
85
|
-
fromArrowType: '',
|
86
|
-
toArrowType: 'triangleSolid',
|
87
|
-
scale: 1,
|
88
|
-
pageZoom: 1,
|
89
|
-
locked: Lock.None,
|
90
|
-
bkImageRect: null,
|
91
|
-
mqttOptions: {
|
92
|
-
clientId: s8()
|
93
|
-
},
|
94
|
-
dataConstruct: {},
|
95
|
-
bindDataTooltipVisible: true
|
96
|
-
},
|
97
|
-
mqttData: null,
|
98
|
-
initConfNode: {},
|
99
|
-
mqttParams: {
|
100
|
-
doorIds: [],
|
101
|
-
tagIds: [],
|
102
|
-
kpiAddrs: [],
|
103
|
-
tagEcharts: [],
|
104
|
-
assetIds: [],
|
105
|
-
areaIds: [],
|
106
|
-
varVaule: [],
|
107
|
-
branchValue: [],
|
108
|
-
echartData: [],
|
109
|
-
echartAssemblyData: [],
|
110
|
-
routingkey: '',
|
111
|
-
pathRewrite: ''
|
112
|
-
},
|
113
|
-
pens: {},
|
114
|
-
options: { ...DefalutOptions },
|
115
|
-
elementInteractivePoor: {}, // element 交互过渡数据
|
116
|
-
pickerDataPool: {}, // datePicker 交互数据池
|
117
|
-
echartsDataPool: {}, // echarts Dom节点数据
|
118
|
-
echartsOptionsPool: {}, // echarts options节点数据
|
119
|
-
echartsRealDataPool: {}, // echarts 实时数据
|
120
|
-
switchTabDataPool: {}, // tabs
|
121
|
-
tableDataPool: {}, // form table
|
122
|
-
selectDataPool: {}, // form select
|
123
|
-
selectRealDataPool: {}, // form select
|
124
|
-
selectTabDataPool: {}, // form select
|
125
|
-
iframeDataPool: {}, // iframe
|
126
|
-
formoverDataPool: {}, // 滚动组件 Dom节点数据
|
127
|
-
formoverCanvasDataPool: {}, // 滚动组件 画布节点数据
|
128
|
-
emitter: mitt(),
|
129
|
-
cacheDatas: [],
|
130
|
-
dpiRatio: 1,
|
131
|
-
lastScale: 1,
|
132
|
-
monitorAlarm: false,
|
133
|
-
parentElem: null
|
134
|
-
} as visualization2DStore;
|
135
|
-
};
|
136
|
-
// @ts-ignore
|
137
|
-
export const useStore = (id = 'default'): visualization2DStore => {
|
138
|
-
if (!commonStore[id]) {
|
139
|
-
// @ts-ignore
|
140
|
-
commonStore[id] = createStore();
|
141
|
-
commonStore[id].id = id;
|
142
|
-
}
|
143
|
-
return commonStore[id];
|
144
|
-
};
|
145
|
-
export declare function clearElementDataPool(data: {}): void;
|
146
|
-
// @ts-ignore
|
147
|
-
export const clearStore = (store: visualization2DStore, del: string) => {
|
148
|
-
store.data = {
|
149
|
-
bkColor: '',
|
150
|
-
bkImage: '',
|
151
|
-
data: undefined,
|
152
|
-
grid: false,
|
153
|
-
manualCps: false,
|
154
|
-
mqttTopics: '',
|
155
|
-
mqttUrl: '',
|
156
|
-
websocket: '',
|
157
|
-
pens: [],
|
158
|
-
lineName: 'curve',
|
159
|
-
fromArrowType: '',
|
160
|
-
toArrowType: 'triangleSolid',
|
161
|
-
scale: 1,
|
162
|
-
pageZoom: 1,
|
163
|
-
locked: Lock.None,
|
164
|
-
bkImageRect: null,
|
165
|
-
mqttOptions: {
|
166
|
-
clientId: s8()
|
167
|
-
},
|
168
|
-
dataConstruct: {},
|
169
|
-
bindDataTooltipVisible: true
|
170
|
-
};
|
171
|
-
store.mqttData = null;
|
172
|
-
store.initConfNode = {};
|
173
|
-
store.mqttParams = {
|
174
|
-
doorIds: [],
|
175
|
-
tagIds: [],
|
176
|
-
kpiAddrs: [],
|
177
|
-
tagEcharts: [],
|
178
|
-
assetIds: [],
|
179
|
-
areaIds: [],
|
180
|
-
varVaule: [],
|
181
|
-
branchValue: [],
|
182
|
-
echartData: [],
|
183
|
-
echartAssemblyData: [],
|
184
|
-
routingkey: '',
|
185
|
-
pathRewrite: ''
|
186
|
-
};
|
187
|
-
store.lastScale = store.data.scale;
|
188
|
-
store.pens = {};
|
189
|
-
store.options = {};
|
190
|
-
store.cacheDatas = [];
|
191
|
-
store.dpiRatio = 1;
|
192
|
-
store.lastScale = 1;
|
193
|
-
store.monitorAlarm = false;
|
194
|
-
};
|
package/core/src/store/data.js
DELETED
@@ -1,187 +0,0 @@
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
2
|
-
__assign = Object.assign || function(t) {
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
import { default as mitt } from 'mitt';
|
13
|
-
import { Lock } from '../models';
|
14
|
-
import {DefalutOptions} from '../options';
|
15
|
-
import {s8} from '../utils';
|
16
|
-
import {commonStore} from './common';
|
17
|
-
import {removeAllElement} from '../../../store';
|
18
|
-
export var createStore = function () {
|
19
|
-
return {
|
20
|
-
id: '',
|
21
|
-
data: {
|
22
|
-
pens: [],
|
23
|
-
lineName: 'curve',
|
24
|
-
fromArrowType: '',
|
25
|
-
toArrowType: 'triangleSolid',
|
26
|
-
scale: 1,
|
27
|
-
locked: Lock.None,
|
28
|
-
dataResize: 1, // 数据是否加载,1是,0否
|
29
|
-
bkImageRect: null,
|
30
|
-
pageZoom: 1,
|
31
|
-
mqttOptions: {
|
32
|
-
clientId: s8()
|
33
|
-
},
|
34
|
-
dataConstruct: {},
|
35
|
-
bindDataTooltipVisible: true
|
36
|
-
},
|
37
|
-
mqttData: null,
|
38
|
-
initConfNode: {},
|
39
|
-
mqttParams: {
|
40
|
-
doorIds: [],
|
41
|
-
tagIds: [],
|
42
|
-
kpiAddrs: [],
|
43
|
-
tagEcharts: [],
|
44
|
-
assetIds: [],
|
45
|
-
areaIds: [],
|
46
|
-
varVaule: [],
|
47
|
-
branchValue: [],
|
48
|
-
echartData: [],
|
49
|
-
echartAssemblyData: [],
|
50
|
-
routingkey: '',
|
51
|
-
pathRewrite: ''
|
52
|
-
},
|
53
|
-
pens: {},
|
54
|
-
options: { ...DefalutOptions },
|
55
|
-
elementInteractivePoor: {}, // element 交互过渡数据
|
56
|
-
pickerDataPool: {}, // datePicker 交互数据池
|
57
|
-
echartsDataPool: {}, // echarts Dom节点数据
|
58
|
-
echartsOptionsPool: {}, // echarts options节点数据
|
59
|
-
echartsRealDataPool: {}, // echarts 实时数据 datePicker
|
60
|
-
switchTabDataPool: {}, // tabs
|
61
|
-
tableDataPool: {}, // form table
|
62
|
-
selectDataPool: {}, // form select
|
63
|
-
selectRealDataPool: {}, // form select
|
64
|
-
selectTabDataPool: {}, // form select
|
65
|
-
iframeDataPool: {}, // iframe
|
66
|
-
formoverDataPool: {}, // 滚动组件 Dom节点数据
|
67
|
-
formoverCanvasDataPool: {}, // 滚动组件 画布节点数据
|
68
|
-
emitter: mitt(),
|
69
|
-
cacheDatas: [],
|
70
|
-
dpiRatio: 1,
|
71
|
-
lastScale: 1,
|
72
|
-
monitorAlarm: false,// 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
|
73
|
-
parentElem: null,
|
74
|
-
timeDataPool: {}, // time
|
75
|
-
};
|
76
|
-
};
|
77
|
-
export var useStore = function (id) {
|
78
|
-
if (id === void 0) { id = 'default'; }
|
79
|
-
if (!commonStore[id]) {
|
80
|
-
commonStore[id] = createStore();
|
81
|
-
commonStore[id].id = id;
|
82
|
-
}
|
83
|
-
return commonStore[id];
|
84
|
-
};
|
85
|
-
export function clearElementDataPool(data) {
|
86
|
-
const { echartsDataPool, selectDataPool, iframeDataPool, formoverDataPool, formoverCanvasDataPool} = data;
|
87
|
-
for (let [key, node] of Object.entries(echartsDataPool)) {
|
88
|
-
if(node) {
|
89
|
-
clearInterval(node.timeTicket);
|
90
|
-
if(node.chart) {
|
91
|
-
node.chart.off('mouseover');
|
92
|
-
node.chart.off('mouseout');
|
93
|
-
node.chart.off('globalout');
|
94
|
-
node.chart.dispose();
|
95
|
-
}
|
96
|
-
if(node.div && node.div.parentNode) node.div.parentNode.removeChild(node.div);
|
97
|
-
}
|
98
|
-
delete data.echartsDataPool[key];
|
99
|
-
}
|
100
|
-
if(Object.keys(selectDataPool).length) {
|
101
|
-
let dropdownEle = null,
|
102
|
-
dropdownListEle = null;
|
103
|
-
for (let [key, node] of Object.entries(selectDataPool)) {
|
104
|
-
if(!dropdownEle) {
|
105
|
-
dropdownEle = node.dom.selectDropdown;
|
106
|
-
dropdownListEle = node.dom.selectDropdownUl;
|
107
|
-
}
|
108
|
-
if(node.dom.selectEle && node.dom.selectEle.parentNode) node.dom.selectEle.parentNode.removeChild(node.dom.selectEle);
|
109
|
-
delete data.selectDataPool[key];
|
110
|
-
}
|
111
|
-
if(dropdownEle) dropdownEle.style.display = 'none';
|
112
|
-
if(dropdownListEle) dropdownListEle.innerHTML = '';
|
113
|
-
}
|
114
|
-
for (let [key, node] of Object.entries(iframeDataPool)) {
|
115
|
-
node.iframe.parentNode.removeChild(node.iframe);
|
116
|
-
delete data.iframeDataPool[key];
|
117
|
-
}
|
118
|
-
for (let key of Object.keys(formoverDataPool)) {
|
119
|
-
delete formoverDataPool[key];
|
120
|
-
}
|
121
|
-
for (let key of Object.keys(formoverCanvasDataPool)) {
|
122
|
-
const elementNode = document.getElementById(key);
|
123
|
-
if(elementNode) {
|
124
|
-
elementNode.parentNode.removeChild(elementNode);
|
125
|
-
}
|
126
|
-
delete formoverCanvasDataPool[key];
|
127
|
-
}
|
128
|
-
}
|
129
|
-
export var clearStore = function (store, del) {
|
130
|
-
store.lastScale = store.data.scale;
|
131
|
-
store.data = {
|
132
|
-
pens: [],
|
133
|
-
lineName: 'curve',
|
134
|
-
fromArrowType: '',
|
135
|
-
toArrowType: 'triangleSolid',
|
136
|
-
scale: 1,
|
137
|
-
pageZoom: 1,
|
138
|
-
locked: Lock.None,
|
139
|
-
dataResize: 1, // 数据是否加载,1是,0否
|
140
|
-
bkImageRect: null,
|
141
|
-
mqttOptions: {
|
142
|
-
clientId: s8()
|
143
|
-
},
|
144
|
-
dataConstruct: {},
|
145
|
-
bindDataTooltipVisible: true
|
146
|
-
};
|
147
|
-
store.initConfNode = {};
|
148
|
-
store.mqttParams = {
|
149
|
-
doorIds: [],
|
150
|
-
tagIds: [],
|
151
|
-
kpiAddrs: [],
|
152
|
-
tagEcharts: [],
|
153
|
-
assetIds: [],
|
154
|
-
areaIds: [],
|
155
|
-
varVaule: [],
|
156
|
-
branchValue: [],
|
157
|
-
echartData: [],
|
158
|
-
echartAssemblyData: [],
|
159
|
-
routingkey: '',
|
160
|
-
pathRewrite: ''
|
161
|
-
};
|
162
|
-
store.pens = {}; // 先保留,后期优化提取变量用
|
163
|
-
store.cacheDatas = [];
|
164
|
-
store.dpiRatio = 1;
|
165
|
-
store.lastScale = 1;
|
166
|
-
store.monitorAlarm = false;
|
167
|
-
store.elementInteractivePoor = {};
|
168
|
-
store.pickerDataPool = {};
|
169
|
-
store.echartsOptionsPool = {};
|
170
|
-
store.echartsRealDataPool = {};
|
171
|
-
store.switchTabDataPool = {};
|
172
|
-
store.tableDataPool = {};
|
173
|
-
store.selectRealDataPool = {};
|
174
|
-
store.selectTabDataPool = {};
|
175
|
-
clearElementDataPool({
|
176
|
-
echartsDataPool: store.echartsDataPool,
|
177
|
-
selectDataPool: store.selectDataPool,
|
178
|
-
iframeDataPool: store.iframeDataPool,
|
179
|
-
formoverDataPool: store.formoverDataPool,
|
180
|
-
formoverCanvasDataPool: store.formoverCanvasDataPool,
|
181
|
-
timeDataPool: store.timeDataPool
|
182
|
-
});
|
183
|
-
if(del) {
|
184
|
-
delete commonStore[store.id];
|
185
|
-
removeAllElement();
|
186
|
-
}
|
187
|
-
};
|
package/core/src/store/index.js
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import {Node} from '../models';
|
2
|
-
|
3
|
-
export declare function setInitNodeDataValidat(node: any, TID: string, type: string, order: number): void;
|
4
|
-
export declare function initDefaultValidat(node: any, retData: any): void;
|
5
|
-
export declare function setDefaultNodeValidat(node: any, retData: any): any;
|
6
|
-
export declare function setConnectionTagForConf(node: Node): void;
|
7
|
-
export declare function setConnectionTabsData(node: Node): void;
|