dcim-topology2d 2.0.7 → 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 -106
- 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 +18 -18
- package/core/src/common.d.ts +7 -6
- package/core/src/common.js +672 -333
- package/core/src/core.d.ts +4 -3
- package/core/src/core.js +367 -466
- 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 -53
- 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 +32 -54
- 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 -1
- package/core/src/preview.js +43 -111
- package/core/src/renderLayer.d.ts +9 -11
- package/core/src/renderLayer.js +60 -48
- 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 -11
- package/core/src/utils/conversion.js +0 -167
- 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 +8 -37
- 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 -7
- package/chart-diagram/src/utils/changeOptions.js +0 -253
- package/chart-diagram/src/utils/conversion.d.ts +0 -18
- package/chart-diagram/src/utils/conversion.js +0 -399
- 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 -129
- package/chart-diagram/src/utils/index.d.ts +0 -4
- package/chart-diagram/src/utils/index.js +0 -4
- package/chart-diagram/src/utils/render.d.ts +0 -8
- package/chart-diagram/src/utils/render.js +0 -199
- package/core/src/element/common.d.ts +0 -5
- package/core/src/element/common.js +0 -54
- 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 -4
- package/core/src/element/index.js +0 -4
- package/core/src/element/select.d.ts +0 -11
- package/core/src/element/select.js +0 -263
- package/core/src/element/tab.d.ts +0 -1
- package/core/src/element/tab.js +0 -23
- 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/formoverflow.js +0 -61
- package/core/src/middles/nodes/formselect.d.ts +0 -2
- package/core/src/middles/nodes/formselect.js +0 -95
- 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 -48
- package/core/src/middles/nodes/index.js +0 -49
- 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 -186
- package/core/src/store/data.js +0 -178
- 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 -6
- package/core/src/utils/assignment.js +0 -168
- package/core/src/utils/params.d.ts +0 -2
- package/core/src/utils/params.js +0 -60
- package/static/echartsDefaultData.js +0 -167
- 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 -18
- package/style/editor.css +0 -13
- package/style/index.css +0 -4
- package/style/select.css +0 -143
- /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
@@ -1,61 +0,0 @@
|
|
1
|
-
// import {} from './rectangle';
|
2
|
-
import {rectangle, createDiv, s8, Topology} from '../../../../core';
|
3
|
-
import {commonStore} from "../../store";
|
4
|
-
|
5
|
-
export async function formOverflow(ctx, node) {
|
6
|
-
// 绘制一个底图,类似于占位符。
|
7
|
-
rectangle(ctx, node)
|
8
|
-
console.log('绘制滚动组件--')
|
9
|
-
// 添加当前节点到div层
|
10
|
-
if (!node.elementId) {
|
11
|
-
node.elementId = s8()
|
12
|
-
}
|
13
|
-
let formoverData = commonStore[node.TID].formoverDataPool[node.id];
|
14
|
-
let id = node.formData.detailPageId
|
15
|
-
const color = node.formData.scrollbarColor? node.formData.scrollbarColor: 'auto'
|
16
|
-
const colorBg = node.formData.scrollbarColorBg? node.formData.scrollbarColorBg: 'auto'
|
17
|
-
const scrollbarColor = color + ' ' + colorBg
|
18
|
-
|
19
|
-
if (!node.elementLoaded && !formoverData) {
|
20
|
-
console.log('是否存在--formoverData--0-',formoverData)
|
21
|
-
if(!formoverData) {
|
22
|
-
formoverData = {
|
23
|
-
div: createDiv(node)
|
24
|
-
};
|
25
|
-
}else {
|
26
|
-
formoverData.div = createDiv(node);
|
27
|
-
}
|
28
|
-
formoverData.div.setAttribute('class', 'topoOverflow');
|
29
|
-
formoverData.div.style.setProperty('scrollbar-color', scrollbarColor);
|
30
|
-
formoverData.div.style.setProperty('scrollbar-width', 'thin');
|
31
|
-
|
32
|
-
node.elementLoaded = true
|
33
|
-
document.body.appendChild(formoverData.div)
|
34
|
-
// 添加当前节点到div层
|
35
|
-
node.addToDiv()
|
36
|
-
commonStore[node.TID].formoverDataPool[node.id] = formoverData;
|
37
|
-
|
38
|
-
|
39
|
-
console.log('请求子页面接口-----id =',id)
|
40
|
-
let canvas = new Topology(node.id, {
|
41
|
-
rotateCursor: '/img/rotate.cur',
|
42
|
-
})
|
43
|
-
canvas.formOverflowOpen(node.formData.detailPageData)
|
44
|
-
commonStore[node.TID].formoverCanvasDataPool[node.id] = canvas
|
45
|
-
}else if(formoverData && id){
|
46
|
-
console.log('是否存在--formoverData--1-',formoverData)
|
47
|
-
formoverData.div.style.setProperty('scrollbar-color', scrollbarColor);
|
48
|
-
formOverflowChange(node)
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
// 更新滚动组件中子页面
|
53
|
-
export function formOverflowChange(node) {
|
54
|
-
//绘制画布
|
55
|
-
console.log('更新滚动组件中子页面-',node)
|
56
|
-
let canvas = commonStore[node.TID].formoverCanvasDataPool[node.id]
|
57
|
-
let data = node.formData.detailPageData
|
58
|
-
console.log('改变滚动组件中子页面-',data)
|
59
|
-
canvas.formOverflowOpen(data)
|
60
|
-
}
|
61
|
-
|
@@ -1,95 +0,0 @@
|
|
1
|
-
import {rectangle} from './rectangle';
|
2
|
-
import {
|
3
|
-
createSelectElement,
|
4
|
-
createSelectDropdown} from '../../element';
|
5
|
-
import {
|
6
|
-
setEventListener,
|
7
|
-
s8} from '../../utils';
|
8
|
-
import {selectDefaultData} from '../../../../static';
|
9
|
-
import {commonStore} from "../../store";
|
10
|
-
|
11
|
-
export function formSelect(ctx, node) {
|
12
|
-
// 绘制一个底图,类似于占位符。
|
13
|
-
rectangle(ctx, node);
|
14
|
-
if (!commonStore[node.TID].selectDataPool[node.id]) {
|
15
|
-
const currentStore = commonStore[node.TID];
|
16
|
-
node.elementId = s8();
|
17
|
-
node.dash = 4;
|
18
|
-
currentStore.selectDataPool[node.id] = {
|
19
|
-
slideState: node.selectDropdown,
|
20
|
-
node: {
|
21
|
-
id: node.id,
|
22
|
-
color: node.font.color,
|
23
|
-
fontSize: node.font.fontSize,
|
24
|
-
selected: node.formData.selected || null
|
25
|
-
},
|
26
|
-
dom: {}
|
27
|
-
};
|
28
|
-
let bindBlockId = '';
|
29
|
-
if(node.formData.bindBlockId) {
|
30
|
-
// 去空格重新赋值
|
31
|
-
bindBlockId = node.formData.bindBlockId.trim();
|
32
|
-
node.formData.bindBlockId = bindBlockId;
|
33
|
-
}
|
34
|
-
if(node.formData.bindBlockTag) {
|
35
|
-
// 去空格重新赋值
|
36
|
-
node.formData.bindBlockTag = node.formData.bindBlockTag.trim();
|
37
|
-
}
|
38
|
-
let selectRealData = bindBlockId && currentStore.selectRealDataPool[bindBlockId];
|
39
|
-
if(bindBlockId && selectRealData) {
|
40
|
-
// select与echarts互相关联
|
41
|
-
currentStore.selectDataPool[node.id].data = selectRealData;
|
42
|
-
const echartsData = currentStore.echartsDataPool[bindBlockId];
|
43
|
-
echartsData ? echartsData.bindId = node.id : currentStore.echartsDataPool[bindBlockId] = {
|
44
|
-
bindId: node.id
|
45
|
-
};
|
46
|
-
// select与Tab关联
|
47
|
-
const bindBlockTagData = currentStore.switchTabDataPool[`${node.formData.bindBlockTag}Data`];
|
48
|
-
if(bindBlockTagData) currentStore.echartsDataPool[bindBlockId].tabCorrelationType = 'select';
|
49
|
-
}else {
|
50
|
-
if(node.formData.ids) {
|
51
|
-
const optionIds = node.formData.ids.split(',');
|
52
|
-
const optionNames = node.formData.names.split(',');
|
53
|
-
const optionsData = [];
|
54
|
-
for (let i = 0; i < optionIds.length; i++) {
|
55
|
-
optionsData.push({
|
56
|
-
id: optionIds[i],
|
57
|
-
name: optionNames[i]
|
58
|
-
});
|
59
|
-
}
|
60
|
-
currentStore.selectDataPool[node.id].data = optionsData;
|
61
|
-
}else {
|
62
|
-
currentStore.selectDataPool[node.id].data = JSON.parse(JSON.stringify(selectDefaultData));
|
63
|
-
}
|
64
|
-
}
|
65
|
-
const select = createSelectElement(node);
|
66
|
-
currentStore.selectDataPool[node.id].dom.selectEle = select;
|
67
|
-
document.body.appendChild(select);
|
68
|
-
let selectDropdownEle = document.querySelector('.topology-select-dropdown');
|
69
|
-
if(!selectDropdownEle) {
|
70
|
-
selectDropdownEle = createSelectDropdown(node);
|
71
|
-
const parentEle = window.location.pathname.includes('workspace') ? document.getElementById('topology-canvas') : document.body;
|
72
|
-
parentEle.appendChild(selectDropdownEle);
|
73
|
-
// 鼠标按下
|
74
|
-
selectDropdownEle.addEventListener('mousedown', (e) => {
|
75
|
-
setEventListener(e, node.TID);
|
76
|
-
});
|
77
|
-
}
|
78
|
-
// 添加当前节点到div层
|
79
|
-
node.addToDiv();
|
80
|
-
}else {
|
81
|
-
const selectNode = commonStore[node.TID].selectDataPool[node.id];
|
82
|
-
if(selectNode.node.color === node.font.color && selectNode.node.fontSize === node.font.fontSize) return;
|
83
|
-
const selectDom = selectNode.dom;
|
84
|
-
if(!selectDom.selectInput) selectDom.selectInput = selectDom.selectEle.querySelector('.topology-select-input');
|
85
|
-
selectDom.selectInput.style.color = node.font.color;
|
86
|
-
selectDom.selectInput.style.fontSize = `${node.font.fontSize}px`;
|
87
|
-
if(node.selectDropdown) {
|
88
|
-
const liEle = selectDom.selectDropdownUl.querySelectorAll('.topology-select-dropdown-item');
|
89
|
-
liEle.forEach(function(element) {
|
90
|
-
element.style.color = node.font.color;
|
91
|
-
element.style.fontSize = `${node.font.fontSize}px`;
|
92
|
-
});
|
93
|
-
}
|
94
|
-
}
|
95
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import {rectangle} from './rectangle';
|
2
|
-
import {s8} from "../../utils";
|
3
|
-
import {createIframeElement} from "../../element";
|
4
|
-
import {commonStore} from "../../store";
|
5
|
-
|
6
|
-
export function iframePrimeval(ctx, node) {
|
7
|
-
//console.log('iframePrimeval############', node)
|
8
|
-
// 绘制一个底图,类似于占位符。
|
9
|
-
rectangle(ctx, node);
|
10
|
-
if (!commonStore[node.TID].iframeDataPool[node.id]) {
|
11
|
-
node.elementId = s8();
|
12
|
-
commonStore[node.TID].iframeDataPool[node.id] = {
|
13
|
-
node: {
|
14
|
-
id: node.id,
|
15
|
-
src: node.iframe
|
16
|
-
}
|
17
|
-
};
|
18
|
-
const iframe = createIframeElement(node);
|
19
|
-
commonStore[node.TID].iframeDataPool[node.id].iframe = iframe;
|
20
|
-
const parentEle = window.location.pathname.includes('workspace') ? document.getElementById('topology-canvas') : document.body;
|
21
|
-
parentEle.appendChild(iframe);
|
22
|
-
// 添加当前节点到div层
|
23
|
-
node.addToDiv();
|
24
|
-
}else {
|
25
|
-
const iframeNode = commonStore[node.TID].iframeDataPool[node.id];
|
26
|
-
if(iframeNode.node.src === node.iframe) return;
|
27
|
-
iframeNode.iframe.src = node.iframe;
|
28
|
-
}
|
29
|
-
}
|
@@ -1,48 +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';
|
@@ -1,49 +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
|
-
//# sourceMappingURL=index.js.map
|
@@ -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,186 +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
|
-
data?: any;
|
30
|
-
bkImageRect?: any;
|
31
|
-
}
|
32
|
-
export interface paramsData {
|
33
|
-
doorIds?: [],
|
34
|
-
tagIds?: [],
|
35
|
-
kpiAddrs?: [],
|
36
|
-
tagEcharts?: [],
|
37
|
-
assetIds?: [],
|
38
|
-
areaIds?: [],
|
39
|
-
varVaule?: [],
|
40
|
-
echartData?: [],
|
41
|
-
echartAssemblyData?: [],
|
42
|
-
routingkey?: string,
|
43
|
-
pathRewrite?: string
|
44
|
-
}
|
45
|
-
// 2D可视化使用到的数据仓库
|
46
|
-
export interface visualization2DStore {
|
47
|
-
id: string;
|
48
|
-
data: visualization2DData;
|
49
|
-
mqttData?: null; // mqtt实时数据
|
50
|
-
initConfNode: {}; // 初始化元件节点数据
|
51
|
-
mqttParams: paramsData; // mqtt参数
|
52
|
-
pens: { [key: string]: Pen };
|
53
|
-
options: Options;
|
54
|
-
cacheDatas?: {
|
55
|
-
data: visualization2DData;
|
56
|
-
}[];
|
57
|
-
elementInteractivePoor: {}; // element 交互过渡数据
|
58
|
-
echartsDataPool: {}; // echarts Dom节点数据
|
59
|
-
echartsOptionsPool: {}; // echarts options节点数据
|
60
|
-
echartsRealDataPool: {}; // echarts 实时数据
|
61
|
-
switchTabDataPool: {}; // tabs
|
62
|
-
tableDataPool: {}; // form table
|
63
|
-
selectDataPool: {}; // form select
|
64
|
-
selectRealDataPool: {}; // form select
|
65
|
-
selectTabDataPool: {}; // form select
|
66
|
-
iframeDataPool: {}; // iframe
|
67
|
-
formoverDataPool: {}; // 滚动组件 Dom节点数据
|
68
|
-
formoverCanvasDataPool: {}; // 滚动组件 画布节点数据
|
69
|
-
emitter: Emitter;
|
70
|
-
dpiRatio?: number;
|
71
|
-
lastScale?: number; //记录上次模版的scale
|
72
|
-
monitorAlarm?:boolean; // 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
|
73
|
-
parentElem: HTMLElement
|
74
|
-
}
|
75
|
-
// @ts-ignore
|
76
|
-
export const createStore = () => {
|
77
|
-
return {
|
78
|
-
id: '',
|
79
|
-
data: {
|
80
|
-
pens: [],
|
81
|
-
lineName: 'curve',
|
82
|
-
fromArrowType: '',
|
83
|
-
toArrowType: 'triangleSolid',
|
84
|
-
scale: 1,
|
85
|
-
pageZoom: 1,
|
86
|
-
locked: Lock.None,
|
87
|
-
bkImageRect: null,
|
88
|
-
mqttOptions: {
|
89
|
-
clientId: s8()
|
90
|
-
},
|
91
|
-
dataConstruct: {}
|
92
|
-
},
|
93
|
-
mqttData: null,
|
94
|
-
initConfNode: {},
|
95
|
-
mqttParams: {
|
96
|
-
doorIds: [],
|
97
|
-
tagIds: [],
|
98
|
-
kpiAddrs: [],
|
99
|
-
tagEcharts: [],
|
100
|
-
assetIds: [],
|
101
|
-
areaIds: [],
|
102
|
-
varVaule: [],
|
103
|
-
echartData: [],
|
104
|
-
echartAssemblyData: [],
|
105
|
-
routingkey: '',
|
106
|
-
pathRewrite: ''
|
107
|
-
},
|
108
|
-
pens: {},
|
109
|
-
options: { ...DefalutOptions },
|
110
|
-
elementInteractivePoor: {}, // element 交互过渡数据
|
111
|
-
echartsDataPool: {}, // echarts Dom节点数据
|
112
|
-
echartsOptionsPool: {}, // echarts options节点数据
|
113
|
-
echartsRealDataPool: {}, // echarts 实时数据
|
114
|
-
switchTabDataPool: {}, // tabs
|
115
|
-
tableDataPool: {}, // form table
|
116
|
-
selectDataPool: {}, // form select
|
117
|
-
selectRealDataPool: {}, // form select
|
118
|
-
selectTabDataPool: {}, // form select
|
119
|
-
iframeDataPool: {}, // iframe
|
120
|
-
formoverDataPool: {}, // 滚动组件 Dom节点数据
|
121
|
-
formoverCanvasDataPool: {}, // 滚动组件 画布节点数据
|
122
|
-
emitter: mitt(),
|
123
|
-
cacheDatas: [],
|
124
|
-
dpiRatio: 1,
|
125
|
-
lastScale: 1,
|
126
|
-
monitorAlarm: false,
|
127
|
-
parentElem: null
|
128
|
-
} as visualization2DStore;
|
129
|
-
};
|
130
|
-
// @ts-ignore
|
131
|
-
export const useStore = (id = 'default'): visualization2DStore => {
|
132
|
-
if (!commonStore[id]) {
|
133
|
-
// @ts-ignore
|
134
|
-
commonStore[id] = createStore();
|
135
|
-
commonStore[id].id = id;
|
136
|
-
}
|
137
|
-
return commonStore[id];
|
138
|
-
};
|
139
|
-
export declare function clearElementDataPool(data: {}): void;
|
140
|
-
// @ts-ignore
|
141
|
-
export const clearStore = (store: visualization2DStore, del: string) => {
|
142
|
-
store.data = {
|
143
|
-
bkColor: '',
|
144
|
-
bkImage: '',
|
145
|
-
data: undefined,
|
146
|
-
grid: false,
|
147
|
-
manualCps: false,
|
148
|
-
mqttTopics: '',
|
149
|
-
mqttUrl: '',
|
150
|
-
websocket: '',
|
151
|
-
pens: [],
|
152
|
-
lineName: 'curve',
|
153
|
-
fromArrowType: '',
|
154
|
-
toArrowType: 'triangleSolid',
|
155
|
-
scale: 1,
|
156
|
-
pageZoom: 1,
|
157
|
-
locked: Lock.None,
|
158
|
-
bkImageRect: null,
|
159
|
-
mqttOptions: {
|
160
|
-
clientId: s8()
|
161
|
-
},
|
162
|
-
dataConstruct: {}
|
163
|
-
};
|
164
|
-
store.mqttData = null;
|
165
|
-
store.initConfNode = {};
|
166
|
-
store.mqttParams = {
|
167
|
-
doorIds: [],
|
168
|
-
tagIds: [],
|
169
|
-
kpiAddrs: [],
|
170
|
-
tagEcharts: [],
|
171
|
-
assetIds: [],
|
172
|
-
areaIds: [],
|
173
|
-
varVaule: [],
|
174
|
-
echartData: [],
|
175
|
-
echartAssemblyData: [],
|
176
|
-
routingkey: '',
|
177
|
-
pathRewrite: ''
|
178
|
-
};
|
179
|
-
store.lastScale = store.data.scale;
|
180
|
-
store.pens = {};
|
181
|
-
store.options = {};
|
182
|
-
store.cacheDatas = [];
|
183
|
-
store.dpiRatio = 1;
|
184
|
-
store.lastScale = 1;
|
185
|
-
store.monitorAlarm = false;
|
186
|
-
};
|
package/core/src/store/data.js
DELETED
@@ -1,178 +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
|
-
},
|
36
|
-
mqttData: null,
|
37
|
-
initConfNode: {},
|
38
|
-
mqttParams: {
|
39
|
-
doorIds: [],
|
40
|
-
tagIds: [],
|
41
|
-
kpiAddrs: [],
|
42
|
-
tagEcharts: [],
|
43
|
-
assetIds: [],
|
44
|
-
areaIds: [],
|
45
|
-
varVaule: [],
|
46
|
-
echartData: [],
|
47
|
-
echartAssemblyData: [],
|
48
|
-
routingkey: '',
|
49
|
-
pathRewrite: ''
|
50
|
-
},
|
51
|
-
pens: {},
|
52
|
-
options: { ...DefalutOptions },
|
53
|
-
elementInteractivePoor: {}, // element 交互过渡数据
|
54
|
-
echartsDataPool: {}, // echarts Dom节点数据
|
55
|
-
echartsOptionsPool: {}, // echarts options节点数据
|
56
|
-
echartsRealDataPool: {}, // echarts 实时数据
|
57
|
-
switchTabDataPool: {}, // tabs
|
58
|
-
tableDataPool: {}, // form table
|
59
|
-
selectDataPool: {}, // form select
|
60
|
-
selectRealDataPool: {}, // form select
|
61
|
-
selectTabDataPool: {}, // form select
|
62
|
-
iframeDataPool: {}, // iframe
|
63
|
-
formoverDataPool: {}, // 滚动组件 Dom节点数据
|
64
|
-
formoverCanvasDataPool: {}, // 滚动组件 画布节点数据
|
65
|
-
emitter: mitt(),
|
66
|
-
cacheDatas: [],
|
67
|
-
dpiRatio: 1,
|
68
|
-
lastScale: 1,
|
69
|
-
monitorAlarm: false,// 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
|
70
|
-
parentElem: null
|
71
|
-
};
|
72
|
-
};
|
73
|
-
export var useStore = function (id) {
|
74
|
-
if (id === void 0) { id = 'default'; }
|
75
|
-
if (!commonStore[id]) {
|
76
|
-
commonStore[id] = createStore();
|
77
|
-
commonStore[id].id = id;
|
78
|
-
}
|
79
|
-
return commonStore[id];
|
80
|
-
};
|
81
|
-
export function clearElementDataPool(data) {
|
82
|
-
const { echartsDataPool, selectDataPool, iframeDataPool, formoverDataPool, formoverCanvasDataPool} = data;
|
83
|
-
for (let [key, node] of Object.entries(echartsDataPool)) {
|
84
|
-
if(node) {
|
85
|
-
clearInterval(node.timeTicket);
|
86
|
-
if(node.chart) {
|
87
|
-
node.chart.off('mouseover');
|
88
|
-
node.chart.off('mouseout');
|
89
|
-
node.chart.dispose();
|
90
|
-
}
|
91
|
-
if(node.div && node.div.parentNode) node.div.parentNode.removeChild(node.div);
|
92
|
-
}
|
93
|
-
delete data.echartsDataPool[key];
|
94
|
-
}
|
95
|
-
if(Object.keys(selectDataPool).length) {
|
96
|
-
let dropdownEle = null,
|
97
|
-
dropdownListEle = null;
|
98
|
-
for (let [key, node] of Object.entries(selectDataPool)) {
|
99
|
-
if(!dropdownEle) {
|
100
|
-
dropdownEle = node.dom.selectDropdown;
|
101
|
-
dropdownListEle = node.dom.selectDropdownUl;
|
102
|
-
}
|
103
|
-
if(node.dom.selectEle && node.dom.selectEle.parentNode) node.dom.selectEle.parentNode.removeChild(node.dom.selectEle);
|
104
|
-
delete data.selectDataPool[key];
|
105
|
-
}
|
106
|
-
if(dropdownEle) dropdownEle.style.display = 'none';
|
107
|
-
if(dropdownListEle) dropdownListEle.innerHTML = '';
|
108
|
-
}
|
109
|
-
for (let [key, node] of Object.entries(iframeDataPool)) {
|
110
|
-
node.iframe.parentNode.removeChild(node.iframe);
|
111
|
-
delete data.iframeDataPool[key];
|
112
|
-
}
|
113
|
-
for (let key of Object.keys(formoverDataPool)) {
|
114
|
-
delete formoverDataPool[key];
|
115
|
-
}
|
116
|
-
for (let key of Object.keys(formoverCanvasDataPool)) {
|
117
|
-
const elementNode = document.getElementById(key);
|
118
|
-
if(elementNode) {
|
119
|
-
elementNode.parentNode.removeChild(elementNode);
|
120
|
-
}
|
121
|
-
delete formoverCanvasDataPool[key];
|
122
|
-
}
|
123
|
-
}
|
124
|
-
export var clearStore = function (store, del) {
|
125
|
-
store.lastScale = store.data.scale;
|
126
|
-
store.data = {
|
127
|
-
pens: [],
|
128
|
-
lineName: 'curve',
|
129
|
-
fromArrowType: '',
|
130
|
-
toArrowType: 'triangleSolid',
|
131
|
-
scale: 1,
|
132
|
-
pageZoom: 1,
|
133
|
-
locked: Lock.None,
|
134
|
-
dataResize: 1, // 数据是否加载,1是,0否
|
135
|
-
bkImageRect: null,
|
136
|
-
mqttOptions: {
|
137
|
-
clientId: s8()
|
138
|
-
},
|
139
|
-
dataConstruct: {}
|
140
|
-
};
|
141
|
-
store.initConfNode = {};
|
142
|
-
store.mqttParams = {
|
143
|
-
doorIds: [],
|
144
|
-
tagIds: [],
|
145
|
-
kpiAddrs: [],
|
146
|
-
tagEcharts: [],
|
147
|
-
assetIds: [],
|
148
|
-
areaIds: [],
|
149
|
-
varVaule: [],
|
150
|
-
echartData: [],
|
151
|
-
echartAssemblyData: [],
|
152
|
-
routingkey: '',
|
153
|
-
pathRewrite: ''
|
154
|
-
};
|
155
|
-
store.pens = {}; // 先保留,后期优化提取变量用
|
156
|
-
store.cacheDatas = [];
|
157
|
-
store.dpiRatio = 1;
|
158
|
-
store.lastScale = 1;
|
159
|
-
store.monitorAlarm = false;
|
160
|
-
store.elementInteractivePoor = {};
|
161
|
-
store.echartsOptionsPool = {};
|
162
|
-
store.echartsRealDataPool = {};
|
163
|
-
store.switchTabDataPool = {};
|
164
|
-
store.tableDataPool = {};
|
165
|
-
store.selectRealDataPool = {};
|
166
|
-
store.selectTabDataPool = {};
|
167
|
-
clearElementDataPool({
|
168
|
-
echartsDataPool: store.echartsDataPool,
|
169
|
-
selectDataPool: store.selectDataPool,
|
170
|
-
iframeDataPool: store.iframeDataPool,
|
171
|
-
formoverDataPool: store.formoverDataPool,
|
172
|
-
formoverCanvasDataPool: store.formoverCanvasDataPool,
|
173
|
-
});
|
174
|
-
if(del) {
|
175
|
-
delete commonStore[store.id];
|
176
|
-
removeAllElement();
|
177
|
-
}
|
178
|
-
};
|
package/core/src/store/index.js
DELETED