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,6 +1,4 @@
|
|
1
1
|
// @ts-ignore
|
2
|
-
export declare const echartsStaticType: Array<string> = [];
|
3
|
-
// @ts-ignore
|
4
2
|
export declare const winEventActionFns: Array<string> = [];
|
5
3
|
export interface MoveDataType {
|
6
4
|
None?: string | number;
|
@@ -14,18 +12,20 @@ export interface MoveDataType {
|
|
14
12
|
HoverAnchors?: string | number;
|
15
13
|
Rotate?: string | number;
|
16
14
|
}
|
15
|
+
export const moveDataType: MoveDataType;
|
17
16
|
export interface DownDataType {
|
18
17
|
Window?: string | number;
|
19
18
|
Target?: string | number;
|
20
19
|
Showhide?: string | number;
|
21
20
|
Tabswitch?: string | number;
|
22
|
-
Formselect?: string | number;
|
23
21
|
}
|
22
|
+
export const downDataType: DownDataType;
|
24
23
|
export interface PreviewType {
|
25
24
|
Dcim?: string;
|
26
25
|
Topology?: string;
|
27
26
|
Logo?: string;
|
28
27
|
}
|
28
|
+
export const previewType: PreviewType;
|
29
29
|
export interface AnimateType {
|
30
30
|
LeftFlow?: string;
|
31
31
|
RightFlow?: string;
|
@@ -38,13 +38,4 @@ export interface AnimateType {
|
|
38
38
|
Show?: string;
|
39
39
|
Rotate?: string;
|
40
40
|
}
|
41
|
-
export interface SelectStaticType {
|
42
|
-
static?:number;
|
43
|
-
dataShow?:number;
|
44
|
-
visible?:number;
|
45
|
-
}
|
46
|
-
export const moveDataType: MoveDataType;
|
47
|
-
export const downDataType: DownDataType;
|
48
|
-
export const previewType: PreviewType;
|
49
41
|
export const animateType: AnimateType;
|
50
|
-
export const selectStaticType: SelectStaticType;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export const echartsStaticType = ['DAY', 'WEEK', 'MONTH', 'YEAR', 'REALTIME'];
|
2
1
|
export const winEventActionFns = ['Link', 'DoAnimate', 'DoFn', 'DoWindowFn', 'openImg'];
|
3
2
|
export const moveDataType = {
|
4
3
|
None: 0,
|
@@ -16,8 +15,7 @@ export const downDataType = {
|
|
16
15
|
Window: 'window',
|
17
16
|
Target: 'target',
|
18
17
|
Showhide: 'showhide',
|
19
|
-
Tabswitch: 'Tabswitch'
|
20
|
-
Formselect: 'Formselect'
|
18
|
+
Tabswitch: 'Tabswitch'
|
21
19
|
};
|
22
20
|
export const previewType = {
|
23
21
|
Dcim: 'dcim',
|
@@ -35,9 +33,4 @@ export const animateType = {
|
|
35
33
|
Error: 'error',
|
36
34
|
Show: 'show',
|
37
35
|
Rotate: 'rotate'
|
38
|
-
};
|
39
|
-
export const selectStaticType = {
|
40
|
-
static: 1,
|
41
|
-
dataShow: 2,
|
42
|
-
visible: 3
|
43
36
|
};
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import {Node} from "../models";
|
2
|
-
export declare function getTabConnectSHConf(node: Node): Node;
|
3
|
-
export declare function tabStaticOperation(type: string, node: Node, areaData: any, params: object): void;
|
4
|
-
export declare function tabHideShowOperation(node: any, areaData: any, visible: boolean): void;
|
5
|
-
export declare function getEchartsRealData(node: {}, data: []): void;
|
6
|
-
export declare function setInitConfData(id: string, data: object): void;
|
7
|
-
export declare function setTagIdData(data: any): [];
|
8
|
-
export declare function setKpiAddrData(data: any): [];
|
9
|
-
export declare function setAssetIdData(data: any): [];
|
10
|
-
export declare function setAreaIdData(data: any): [];
|
11
|
-
export declare function setVarValueData(data: any): [];
|
12
|
-
export declare function setBranchAddressData(data: any): [];
|
13
|
-
export declare function setThreeCategoryIdData(pen: Node, data: any): [];
|
@@ -1,210 +0,0 @@
|
|
1
|
-
import {commonStore} from '../store';
|
2
|
-
import {setElementSwitchTabState} from '../element';
|
3
|
-
import {echartsStaticType} from '../utils';
|
4
|
-
// tab切换页签删除数据处理
|
5
|
-
export function getTabConnectSHConf(node) {
|
6
|
-
const switchTabType = node.tags.find((t) => {
|
7
|
-
return t.includes('switchTabType');
|
8
|
-
}); // 获取按钮组类型
|
9
|
-
const topologyChangeData = commonStore[node.TID].switchTabDataPool;
|
10
|
-
const tabAreaData = topologyChangeData[`${switchTabType}AreaData`];
|
11
|
-
const bindConfIds = node.bindStaticId.split(','); // tab元件绑定的元件id
|
12
|
-
const currentNode = [{...node}]; // 需要删除的关联元件数据
|
13
|
-
for (let i = 0; i < bindConfIds.length; i++) {
|
14
|
-
const id = bindConfIds[i];
|
15
|
-
if(tabAreaData[id]) {
|
16
|
-
currentNode.push(tabAreaData[id]);
|
17
|
-
delete tabAreaData[id];
|
18
|
-
}
|
19
|
-
}
|
20
|
-
const changeData = topologyChangeData[`${switchTabType}Data`];
|
21
|
-
delete changeData[node.id];
|
22
|
-
if(Object.keys(changeData).length) {
|
23
|
-
// 第一个页签设置选中效果
|
24
|
-
const firstNode = Object.values(changeData)[0];
|
25
|
-
firstNode.activeImgeIndex = false;
|
26
|
-
const firstNodeBindConfIds = firstNode.bindStaticId.split(','); // tab元件绑定的元件id
|
27
|
-
// 为绑定的每个元件设置可见
|
28
|
-
for (let i = 0; i < firstNodeBindConfIds.length; i++) {
|
29
|
-
const tabAreaNode = tabAreaData[firstNodeBindConfIds[i]];
|
30
|
-
if(tabAreaNode) {
|
31
|
-
tabAreaNode.visible = true;
|
32
|
-
tabAreaNode.visibleSwitch = true;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
return currentNode;
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* Tab 数据统计
|
40
|
-
* @param type 统计类型
|
41
|
-
* @param node 元件数据
|
42
|
-
* @param areaData tab展示区域数据
|
43
|
-
* @param params Tab 切换选中参数
|
44
|
-
*/
|
45
|
-
export function tabStaticOperation(type, node, areaData, params) {
|
46
|
-
if(!node.bindStaticId || !(echartsStaticType.includes(type) || type === 'OTHER')) return;
|
47
|
-
const curentEchart = areaData && areaData[node.bindStaticId]; // 获取当前点中的节点绑定的统计图表数据
|
48
|
-
if(!curentEchart || !curentEchart.data.params) return console.log('未能找到匹配的echarts图表>>>');
|
49
|
-
const currentStore = commonStore[node.TID];
|
50
|
-
const echartNode = currentStore.data.pens[curentEchart.order]; // 获取tab 绑定的图表元件数据
|
51
|
-
if(type === 'OTHER') {
|
52
|
-
const tabCorrelationType = currentStore.echartsDataPool[node.bindStaticId].tabCorrelationType; // 获取select与tab关联的标识
|
53
|
-
const optionNode = currentStore.echartsOptionsPool[node.bindStaticId];
|
54
|
-
if(tabCorrelationType === 'select') {
|
55
|
-
// tab类型为包含在select下的切换则执行下面的逻辑
|
56
|
-
echartNode.data.params['tabVisitOrder'] = params.order;
|
57
|
-
}else {
|
58
|
-
// 非 年、月、日、周、实时类型的切换
|
59
|
-
const groupData = currentStore.selectRealDataPool[node.bindStaticId];
|
60
|
-
if (optionNode) currentStore.echartsRealDataPool[optionNode.data.id] = currentStore.echartsRealDataPool[groupData[params.order].id];
|
61
|
-
}
|
62
|
-
if(optionNode) optionNode.data.tabData = {
|
63
|
-
type,
|
64
|
-
data: params.data
|
65
|
-
};
|
66
|
-
}
|
67
|
-
echartNode.data.params['staticForType'] = type
|
68
|
-
echartNode.elementRendered = false;
|
69
|
-
}
|
70
|
-
/**
|
71
|
-
* Tab 显示/隐藏切换
|
72
|
-
* @param node tab页签数据
|
73
|
-
* @param areaData // tab展示区域数据
|
74
|
-
* @param isActive
|
75
|
-
*/
|
76
|
-
export function tabHideShowOperation(node, areaData, isActive) {
|
77
|
-
const confIds = node.bindStaticId && node.bindStaticId.split(',') || [];
|
78
|
-
const pens = commonStore[node.TID].data.pens;
|
79
|
-
for (let i = 0; i < confIds.length; i++) {
|
80
|
-
const confid = confIds[i];
|
81
|
-
const areaNode = areaData[confid];
|
82
|
-
if(!(areaNode && pens[areaNode.order])) return;
|
83
|
-
const tagNode = pens[areaNode.order];
|
84
|
-
tagNode.visible = !isActive;
|
85
|
-
setElementSwitchTabState(tagNode);
|
86
|
-
}
|
87
|
-
}
|
88
|
-
/**
|
89
|
-
* 获取echarts和select实时数据
|
90
|
-
* @param node 节点
|
91
|
-
* @param data 实时数据
|
92
|
-
*/
|
93
|
-
export function getEchartsRealData(node, data){
|
94
|
-
const currentStore = commonStore[node.TID];
|
95
|
-
if(!currentStore.selectRealDataPool[node.id]) {
|
96
|
-
const selectData = [];
|
97
|
-
let currentData = null;
|
98
|
-
data.map((item, index) => {
|
99
|
-
if(index === 0) currentData = item;
|
100
|
-
selectData.push({
|
101
|
-
id: item.id,
|
102
|
-
name: item.aliasName
|
103
|
-
});
|
104
|
-
currentStore.echartsRealDataPool[item.id] = item;
|
105
|
-
});
|
106
|
-
currentStore.echartsRealDataPool[node.id] = currentData;
|
107
|
-
currentStore.selectRealDataPool[node.id] = selectData;
|
108
|
-
}else {
|
109
|
-
const selectId = currentStore.echartsDataPool[node.id] && currentStore.echartsDataPool[node.id].bindId;
|
110
|
-
const selected = selectId && currentStore.selectDataPool[selectId] && currentStore.selectDataPool[selectId].node.selected;
|
111
|
-
if(selected && selected.id) {
|
112
|
-
// 如有选中的数据
|
113
|
-
currentStore.echartsRealDataPool[node.id] = currentStore.echartsRealDataPool[selected.id];
|
114
|
-
}else {
|
115
|
-
currentStore.echartsRealDataPool[node.id] = data[0];
|
116
|
-
}
|
117
|
-
}
|
118
|
-
}
|
119
|
-
export function setInitConfData(id, data){
|
120
|
-
if(commonStore[id].initConfNode[data.id]) return;
|
121
|
-
const bindMqttNode = data.events.find((ev) => {return ev.type === 3});
|
122
|
-
if(!bindMqttNode) return;
|
123
|
-
const initNode = {
|
124
|
-
text: data.text,
|
125
|
-
font: data.font,
|
126
|
-
strokeStyle: data.strokeStyle,
|
127
|
-
fillStyle: data.fillStyle,
|
128
|
-
image: data.image,
|
129
|
-
leakageEnd: data.leakageEnd,
|
130
|
-
leakageFillStyle: data.leakageFillStyle,
|
131
|
-
leakageStart: data.leakageStart
|
132
|
-
}
|
133
|
-
if(data.name === 'echarts') initNode.data = data.data;
|
134
|
-
commonStore[id].initConfNode[data.id] = initNode;
|
135
|
-
}
|
136
|
-
export function setTagIdData(data) {
|
137
|
-
return [{
|
138
|
-
"key": "tagId",
|
139
|
-
"value": data.tagId,
|
140
|
-
"isControlDis": data.isControlDis,
|
141
|
-
"type": data.tagType,
|
142
|
-
"tagVal": data.value,
|
143
|
-
"valExplain": data.valExplain,
|
144
|
-
"tagId": data.tagId
|
145
|
-
}, {
|
146
|
-
"key": "测点名称",
|
147
|
-
"value": data.tagName
|
148
|
-
}];
|
149
|
-
}
|
150
|
-
export function setKpiAddrData(data) {
|
151
|
-
return [{
|
152
|
-
"key": "kpiAddr",
|
153
|
-
"value": data.kpiId + '_' + data.kpiAddr,
|
154
|
-
"isControlDis": data.isControlDis,
|
155
|
-
"type": data.tagType
|
156
|
-
}, {
|
157
|
-
"key": "指标名称",
|
158
|
-
"value": data.kpiName
|
159
|
-
}];
|
160
|
-
}
|
161
|
-
export function setAssetIdData(data) {
|
162
|
-
return [{
|
163
|
-
"key": "assetId",
|
164
|
-
"value": data.id
|
165
|
-
}, {
|
166
|
-
"key": "资产名称",
|
167
|
-
"value": data.name
|
168
|
-
}];
|
169
|
-
}
|
170
|
-
export function setAreaIdData(data) {
|
171
|
-
return [{
|
172
|
-
"key": "areaId",
|
173
|
-
"value": data.id
|
174
|
-
}, {
|
175
|
-
"key": "区域名称",
|
176
|
-
"value": data.name
|
177
|
-
}];
|
178
|
-
}
|
179
|
-
export function setVarValueData(data) {
|
180
|
-
return [{
|
181
|
-
"key": "varId",
|
182
|
-
"value": data.id
|
183
|
-
},{
|
184
|
-
"key": "varValue",
|
185
|
-
"value": data.value
|
186
|
-
}, {
|
187
|
-
"key": "变量类型名称",
|
188
|
-
"value": data.name
|
189
|
-
}];
|
190
|
-
}
|
191
|
-
export function setBranchAddressData(data) {
|
192
|
-
return [{
|
193
|
-
"key": "branchVal",
|
194
|
-
"value": data.value
|
195
|
-
}, {
|
196
|
-
"key": "支路地址Key",
|
197
|
-
"value": data.key
|
198
|
-
}];
|
199
|
-
}
|
200
|
-
export function setThreeCategoryIdData(pen, data) {
|
201
|
-
let params = [];
|
202
|
-
const hasThreeCategoryId = pen.data.find((tc) => {
|
203
|
-
return tc.key === 'threeCategoryId' && tc.value === data.threeCategoryId;
|
204
|
-
});
|
205
|
-
if(!hasThreeCategoryId) params = [{
|
206
|
-
"key": "threeCategoryId",
|
207
|
-
"value": data.threeCategoryId
|
208
|
-
}];
|
209
|
-
return params;
|
210
|
-
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Node } from '../models/node';
|
2
|
+
// @ts-ignore
|
3
|
+
import { TopologyData } from 'dcim-topology/core'
|
4
|
+
export declare let DomElements: {};
|
5
|
+
export declare function createChildrenDivByElementId(node: Node, data?: TopologyData): HTMLDivElement;
|
6
|
+
export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: TopologyData): void;
|
7
|
+
export declare function createDiv(node: Node): HTMLDivElement;
|
8
|
+
export declare function loadJS(url: string, callback?: () => void, render?: boolean): void;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { Store } from 'le5le-store';
|
2
|
+
import { Lock } from 'dcim-topology/core/src/models/status'
|
3
|
+
export let DomElements = {};
|
4
|
+
export function createChildrenDivByElementId(node, data) {
|
5
|
+
if (!DomElements[node.id]) {
|
6
|
+
DomElements[node.id] = document.getElementById(node.id);
|
7
|
+
if (DomElements[node.id]) {
|
8
|
+
document.querySelector('.canvas-point').appendChild(DomElements[node.id]);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
setStyleForElementIdDiv(node, DomElements[node.id], data);
|
12
|
+
}
|
13
|
+
export function setStyleForElementIdDiv(node, elem, data) {
|
14
|
+
if (!elem) {
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
elem.style.position = 'absolute';
|
18
|
+
elem.style.outline = 'none';
|
19
|
+
elem.style.left = node.rect.x + 'px';
|
20
|
+
elem.style.top = node.rect.y + 'px';
|
21
|
+
elem.style.width = node.rect.width + 'px';
|
22
|
+
elem.style.height = node.rect.height + 'px';
|
23
|
+
if (node.rotate || node.offsetRotate) {
|
24
|
+
elem.style.transform = "rotate(" + (node.rotate + node.offsetRotate) + "deg)";
|
25
|
+
}
|
26
|
+
// if (node.video && this.videos[node.id] && this.videos[node.id].media) {
|
27
|
+
// this.videos[node.id].media.style.width = '100%';
|
28
|
+
// this.videos[node.id].media.style.height = '100%';
|
29
|
+
// }
|
30
|
+
if (data && data.locked > Lock.None || node.locked > Lock.None) {
|
31
|
+
elem.style.userSelect = 'initial';
|
32
|
+
elem.style.pointerEvents = 'initial';
|
33
|
+
} else {
|
34
|
+
elem.style.userSelect = 'none';
|
35
|
+
elem.style.pointerEvents = 'none';
|
36
|
+
}
|
37
|
+
}
|
38
|
+
export function createDiv(node) {
|
39
|
+
var div = document.createElement('div');
|
40
|
+
div.style.position = 'absolute';
|
41
|
+
div.style.outline = 'none';
|
42
|
+
div.style.left = '-9999px';
|
43
|
+
div.style.bottom = '-9999px';
|
44
|
+
div.style.width = node.rect.width + 'px';
|
45
|
+
div.style.height = node.rect.height + 'px';
|
46
|
+
// if (node.elementId) {
|
47
|
+
// div.id = node.elementId;
|
48
|
+
// }
|
49
|
+
div.id = node.id;
|
50
|
+
return div;
|
51
|
+
}
|
52
|
+
export function loadJS(url, callback, render) {
|
53
|
+
var loaderScript = document.createElement('script');
|
54
|
+
loaderScript.type = 'text/javascript';
|
55
|
+
loaderScript.src = url;
|
56
|
+
loaderScript.addEventListener('load', function () {
|
57
|
+
if (callback) {
|
58
|
+
callback();
|
59
|
+
}
|
60
|
+
// how to do
|
61
|
+
if (render) {
|
62
|
+
Store.set('LT:render', true);
|
63
|
+
}
|
64
|
+
});
|
65
|
+
document.body.appendChild(loaderScript);
|
66
|
+
}
|
67
|
+
//# sourceMappingURL=dom.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../../../packages/core/src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,MAAM,UAAU,SAAS,CAAC,IAAU;IAClC,IAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IAChC,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC3B,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACzC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IAC3C,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;KACzB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,QAAqB,EAAE,MAAgB;IACzE,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,CAAC,IAAI,GAAG,iBAAiB,CAAC;IACtC,YAAY,CAAC,GAAG,GAAG,GAAG,CAAC;IACvB,YAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE;QACpC,IAAI,QAAQ,EAAE;YACZ,QAAQ,EAAE,CAAC;SACZ;QACD,YAAY;QACZ,IAAI,MAAM,EAAE;YACV,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SAC9B;IACH,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export * from './canvas';
|
2
|
+
export * from './dom';
|
2
3
|
export * from './math';
|
3
4
|
export * from './rect';
|
4
5
|
export * from './uuid';
|
@@ -6,5 +7,3 @@ export * from './padding'
|
|
6
7
|
export * from './construction';
|
7
8
|
export * from './onmousevent';
|
8
9
|
export * from './conversion';
|
9
|
-
export * from './assignment';
|
10
|
-
export * from './params';
|
package/core/src/utils/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
export * from './canvas';
|
2
|
+
export * from './dom';
|
2
3
|
export * from './math';
|
3
4
|
export * from './rect';
|
4
5
|
export * from './uuid';
|
@@ -6,6 +7,4 @@ export * from './padding'
|
|
6
7
|
export * from './construction';
|
7
8
|
export * from './onmousevent';
|
8
9
|
export * from './conversion';
|
9
|
-
export * from './assignment';
|
10
|
-
export * from './params';
|
11
10
|
//# sourceMappingURL=index.js.map
|
package/core/src/utils/math.d.ts
CHANGED
package/core/src/utils/math.js
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
import {Node} from '../models';
|
2
|
-
|
3
|
-
export declare function setEventListener(e: Event, TID: string, node: Node): any;
|
4
1
|
export declare function mousMoveFun(type: string, data: any): object;
|
5
2
|
export declare function mousDownFun(type: string, eventNode: object): object;
|
6
3
|
export declare function omouseEventPrototDoWindowFn(eventNode: object, node: object): string;
|
@@ -1,27 +1,11 @@
|
|
1
1
|
import { ptInPolyXY } from './math';
|
2
|
-
import { moveDataType, downDataType } from './construction'
|
3
|
-
import { Node } from '../models';
|
4
|
-
import {elementType} from "../../../static";
|
5
|
-
import {getSelectedData} from '../element';
|
6
|
-
import {commonStore} from "../store";
|
7
|
-
// 配置鼠标事件监听 监听样式 documentDefine
|
8
|
-
// 凡是类名为documentDefine的Dom元素都自动注册下面的监听
|
9
|
-
export function setEventListener(e, TID) {
|
10
|
-
e.preventDefault();
|
11
|
-
const documentDefine = document.querySelector('.documentDefine');
|
12
|
-
if(!documentDefine) return;
|
13
|
-
const currentNode = commonStore[TID].elementInteractivePoor.node; // 当前点击的元件节点数据
|
14
|
-
if(currentNode && currentNode.name === elementType.select) {
|
15
|
-
// select 下拉 option选中操作
|
16
|
-
getSelectedData(e, currentNode);
|
17
|
-
}
|
18
|
-
}
|
2
|
+
import { moveDataType, downDataType } from './construction'
|
19
3
|
// 执行window函数
|
20
4
|
export function omouseEventPrototDoWindowFn (eventNode, node) {
|
21
5
|
|
22
6
|
window[eventNode.value](node, eventNode.params);
|
23
7
|
|
24
|
-
}
|
8
|
+
};
|
25
9
|
export function mousMoveFun(type, pos, data) {
|
26
10
|
let params = {
|
27
11
|
order: 0,
|
@@ -34,20 +18,10 @@ export function mousMoveFun(type, pos, data) {
|
|
34
18
|
|
35
19
|
for (var _i = 0, _a = data; _i < _a.length; _i++) {
|
36
20
|
var item = _a[_i];
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
// 任意多边形通过点获取区域
|
42
|
-
isInPointNode = ptInPolyXY(pos, item.rotatedAnchors);
|
43
|
-
}else {
|
44
|
-
if(!(item instanceof Node)) item = new Node(item);
|
45
|
-
isInPointNode = item.hit(pos);
|
46
|
-
}
|
47
|
-
if(isInPointNode) {
|
48
|
-
params.hoverNode = item;
|
49
|
-
params.order = _i;
|
50
|
-
}
|
21
|
+
const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
|
22
|
+
if(isPoint) {
|
23
|
+
params.hoverNode = item;
|
24
|
+
params.order = _i;
|
51
25
|
}
|
52
26
|
}
|
53
27
|
// 不在此节点上停留
|
@@ -65,21 +39,15 @@ export function mousMoveFun(type, pos, data) {
|
|
65
39
|
}
|
66
40
|
export function mousDownFun(type, eventNode) {
|
67
41
|
let params = {};
|
68
|
-
if(eventNode === null) return params;
|
69
42
|
const action = eventNode ? parseInt(eventNode.action) : 0;
|
70
43
|
if(action === 3) {
|
71
44
|
params.eventType = downDataType.Window; // 打开会话窗口
|
72
|
-
}else if(action === 7)
|
73
|
-
//
|
74
|
-
params.eventType = downDataType.Showhide;
|
45
|
+
}else if(action === 7){
|
46
|
+
params.eventType = downDataType.Showhide; // 链接跳转
|
75
47
|
params.value = eventNode.value;
|
76
|
-
}else if(action === 8)
|
48
|
+
}else if(action === 8){
|
77
49
|
params.eventType = downDataType.Tabswitch; // Tab切换
|
78
|
-
}else
|
79
|
-
params.eventType = downDataType.Formselect; // select下拉切换
|
80
|
-
params.staticType = eventNode.dcimStaticForType; // 1: 数据统计;2:数据展示;3:显示隐藏
|
81
|
-
}else {
|
82
|
-
// action === 5 远程控制比较特殊,无论是否绑定远程控制事件,只要数据中有远程控制属性且值为0都会认定为远程控制
|
50
|
+
} else {
|
83
51
|
params.eventType = downDataType.Target; // 链接跳转
|
84
52
|
}
|
85
53
|
return params;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowCommentAnchors(node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowComment(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowDataAnchors(node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Point, Direction } from '
|
1
|
+
import { Point, Direction } from 'dcim-topology/core';
|
2
2
|
export function flowDataAnchors(node) {
|
3
3
|
node.anchors.push(new Point(node.rect.x + node.rect.width / 14, node.rect.y + node.rect.height / 2, Direction.Left));
|
4
4
|
node.anchors.push(new Point(node.rect.x + (node.rect.width * 4) / 7, node.rect.y, Direction.Up));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowData(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowDb(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowDisplayAnchors(node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Point, Direction } from '
|
1
|
+
import { Point, Direction } from 'dcim-topology/core';
|
2
2
|
export function flowDisplayAnchors(node) {
|
3
3
|
node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
|
4
4
|
node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowDisplay(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowDocumentAnchors(node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Point, Direction } from '
|
1
|
+
import { Point, Direction } from 'dcim-topology/core';
|
2
2
|
export function flowDocumentAnchors(node) {
|
3
3
|
node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
|
4
4
|
node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowDocument(ctx: CanvasRenderingContext2D, node: Node): void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowExternStorageAnchors(node: Node): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Point, Direction } from '
|
1
|
+
import { Point, Direction } from 'dcim-topology/core';
|
2
2
|
export function flowExternStorageAnchors(node) {
|
3
3
|
node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
|
4
4
|
node.anchors.push(new Point(node.rect.x + (node.rect.width * 8) / 15, node.rect.y, Direction.Up));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Node } from '
|
1
|
+
import { Node } from 'dcim-topology/core';
|
2
2
|
export declare function flowExternStorage(ctx: CanvasRenderingContext2D, node: Node): void;
|