dcim-topology2d 1.1.6 → 2.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.
Files changed (76) hide show
  1. package/chart-diagram/src/echarts/index.js +88 -96
  2. package/chart-diagram/src/register.js +3 -3
  3. package/chart-diagram/src/utils/changeOptions.d.ts +4 -4
  4. package/chart-diagram/src/utils/changeOptions.js +172 -144
  5. package/chart-diagram/src/utils/conversion.d.ts +12 -12
  6. package/chart-diagram/src/utils/conversion.js +278 -137
  7. package/chart-diagram/src/utils/render.d.ts +5 -0
  8. package/chart-diagram/src/utils/render.js +107 -0
  9. package/core/index.d.ts +1 -0
  10. package/core/index.js +1 -0
  11. package/core/src/activeLayer.js +0 -6
  12. package/core/src/canvas.js +1 -0
  13. package/core/src/common.d.ts +1 -2
  14. package/core/src/common.js +123 -540
  15. package/core/src/core.js +61 -46
  16. package/core/src/divLayer.d.ts +0 -3
  17. package/core/src/divLayer.js +13 -34
  18. package/core/src/element/common.d.ts +5 -0
  19. package/core/src/element/common.js +52 -0
  20. package/core/src/element/iframe.d.ts +3 -0
  21. package/core/src/element/iframe.js +12 -0
  22. package/core/src/element/index.d.ts +4 -0
  23. package/core/src/element/index.js +4 -0
  24. package/core/src/element/select.d.ts +11 -0
  25. package/core/src/element/select.js +199 -0
  26. package/core/src/element/tab.d.ts +1 -0
  27. package/core/src/element/tab.js +22 -0
  28. package/core/src/healps/changeData.d.ts +1 -2
  29. package/core/src/healps/changeData.js +16 -122
  30. package/core/src/middles/default.js +3 -1
  31. package/core/src/middles/nodes/arbitrarygraph.js +11 -9
  32. package/core/src/middles/nodes/formselect.d.ts +2 -0
  33. package/core/src/middles/nodes/formselect.js +73 -0
  34. package/core/src/middles/nodes/iframe.js +21 -4
  35. package/core/src/middles/nodes/index.d.ts +1 -0
  36. package/core/src/middles/nodes/index.js +1 -0
  37. package/core/src/models/node.d.ts +4 -0
  38. package/core/src/models/node.js +24 -22
  39. package/core/src/models/pen.js +1 -2
  40. package/core/src/models/rect.js +2 -2
  41. package/core/src/options.d.ts +1 -0
  42. package/core/src/preview.js +45 -31
  43. package/core/src/renderLayer.d.ts +10 -6
  44. package/core/src/renderLayer.js +36 -43
  45. package/core/src/store/data.d.ts +16 -17
  46. package/core/src/store/data.js +36 -14
  47. package/core/src/utils/assignment.d.ts +6 -3
  48. package/core/src/utils/assignment.js +84 -15
  49. package/core/src/utils/construction.d.ts +9 -3
  50. package/core/src/utils/construction.js +6 -1
  51. package/core/src/utils/conversion.d.ts +3 -0
  52. package/core/src/utils/conversion.js +67 -0
  53. package/core/src/utils/index.d.ts +1 -1
  54. package/core/src/utils/index.js +1 -1
  55. package/core/src/utils/math.d.ts +1 -0
  56. package/core/src/utils/math.js +3 -0
  57. package/core/src/utils/onmousevent.d.ts +3 -0
  58. package/core/src/utils/onmousevent.js +28 -7
  59. package/core/src/utils/params.d.ts +7 -0
  60. package/core/src/utils/params.js +125 -0
  61. package/package.json +1 -1
  62. package/static/echartsDefaultData.js +27 -107
  63. package/static/element.js +14 -0
  64. package/static/form.js +11 -0
  65. package/static/index.js +2 -1
  66. package/store/actions.js +17 -0
  67. package/store/clear.js +72 -0
  68. package/store/index.js +2 -0
  69. package/style/common.css +18 -0
  70. package/style/editor.css +13 -0
  71. package/style/index.css +3 -12
  72. package/style/select.css +143 -0
  73. package/core/src/utils/dom.d.ts +0 -9
  74. package/core/src/utils/dom.js +0 -103
  75. package/core/src/utils/dom.js.map +0 -1
  76. package/static/echartsStore.js +0 -14
@@ -1,3 +1,58 @@
1
+ import {syncMqttData} from '../store';
2
+ import {
3
+ echartsRealDataPool,
4
+ selectRealDataPool,
5
+ echartsDataPool,
6
+ selectDataPool
7
+ } from "../../../store";
8
+
9
+ /**
10
+ * 获取echarts和select实时数据
11
+ * @param node 节点
12
+ * @param data 实时数据
13
+ */
14
+ export function getEchartsRealData(node, data){
15
+ if(!selectRealDataPool[node.id]) {
16
+ const selectData = [];
17
+ let currentData = null;
18
+ data.map((item, index) => {
19
+ if(index === 0) currentData = item;
20
+ selectData.push({
21
+ id: item.id,
22
+ name: item.aliasName
23
+ });
24
+ echartsRealDataPool[item.id] = item;
25
+ });
26
+ echartsRealDataPool[node.id] = currentData;
27
+ selectRealDataPool[node.id] = selectData;
28
+ }else {
29
+ const selectId = echartsDataPool[node.id] && echartsDataPool[node.id].bindId;
30
+ const selected = selectId && selectDataPool[selectId] && selectDataPool[selectId].node.selected;
31
+ if(selected && selected.id) {
32
+ // 如有选中的数据
33
+ echartsRealDataPool[node.id] = echartsRealDataPool[selected.id];
34
+ }else {
35
+ echartsRealDataPool[node.id] = data[0];
36
+ }
37
+ }
38
+ }
39
+ export function setInitConfData(data){
40
+ if(syncMqttData.initData[data.id]) return;
41
+ const bindMqttNode = data.events.find((ev) => {return ev.type === 3});
42
+ if(!bindMqttNode) return;
43
+ const initNode = {
44
+ text: data.text,
45
+ font: data.font,
46
+ strokeStyle: data.strokeStyle,
47
+ fillStyle: data.fillStyle,
48
+ image: data.image,
49
+ leakageEnd: data.leakageEnd,
50
+ leakageFillStyle: data.leakageFillStyle,
51
+ leakageStart: data.leakageStart
52
+ }
53
+ if(data.name === 'echarts') initNode.data = data.data;
54
+ syncMqttData.initData[data.id] = initNode;
55
+ }
1
56
  export function setTagIdData(data) {
2
57
  return [{
3
58
  "key": "tagId",
@@ -41,6 +96,18 @@ export function setAreaIdData(data) {
41
96
  "value": data.name
42
97
  }];
43
98
  }
99
+ export function setVarValueData(data) {
100
+ return [{
101
+ "key": "varId",
102
+ "value": data.id
103
+ },{
104
+ "key": "varValue",
105
+ "value": data.value
106
+ }, {
107
+ "key": "变量类型名称",
108
+ "value": data.name
109
+ }];
110
+ }
44
111
  export function setThreeCategoryIdData(pen, data) {
45
112
  let params = [];
46
113
  const hasThreeCategoryId = pen.data.find((tc) => {
@@ -1,5 +1,4 @@
1
1
  export * from './canvas';
2
- export * from './dom';
3
2
  export * from './math';
4
3
  export * from './rect';
5
4
  export * from './uuid';
@@ -8,3 +7,4 @@ export * from './construction';
8
7
  export * from './onmousevent';
9
8
  export * from './conversion';
10
9
  export * from './assignment';
10
+ export * from './params';
@@ -1,5 +1,4 @@
1
1
  export * from './canvas';
2
- export * from './dom';
3
2
  export * from './math';
4
3
  export * from './rect';
5
4
  export * from './uuid';
@@ -8,4 +7,5 @@ export * from './construction';
8
7
  export * from './onmousevent';
9
8
  export * from './conversion';
10
9
  export * from './assignment';
10
+ export * from './params';
11
11
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  export declare function pSBC(p: any, c0: any, c1?: any, l?: any): string;
2
2
  export declare function abs(num: number, percent: number | string): number;
3
3
  export declare function ptInPolyXY(pt: any, poly: []): boolean;
4
+ export declare function jsonLength(obj: {}): number;
@@ -115,4 +115,7 @@ export function ptInPolyXY(pt, poly) {
115
115
  }
116
116
  return c;
117
117
  }
118
+ export function jsonLength(obj) {
119
+ return Object.keys(obj).length;
120
+ }
118
121
  //# sourceMappingURL=math.js.map
@@ -1,3 +1,6 @@
1
+ import {Node} from '../models';
2
+
3
+ export declare function setEventListener(e: Event, node: Node): any;
1
4
  export declare function mousMoveFun(type: string, data: any): object;
2
5
  export declare function mousDownFun(type: string, eventNode: object): object;
3
6
  export declare function omouseEventPrototDoWindowFn(eventNode: object, node: object): string;
@@ -1,12 +1,28 @@
1
1
  import { ptInPolyXY } from './math';
2
- import { moveDataType, downDataType } from './construction'
3
- import { Node } from '../models'
2
+ import { moveDataType, downDataType } from './construction';
3
+ import { Node } from '../models';
4
+ import {elementInteractivePoor} from '../../../store';
5
+ import {elementType} from "../../../static";
6
+ import {getSelectedData} from '../element';
7
+ // 配置鼠标事件监听 监听样式 documentDefine
8
+ // 凡是类名为documentDefine的Dom元素都自动注册下面的监听
9
+ export function setEventListener(e) {
10
+ e.preventDefault();
11
+ const documentDefine = document.querySelector('.documentDefine');
12
+ if(!documentDefine) return;
13
+ const currentNode = elementInteractivePoor.node; // 当前点击的元件节点数据
14
+ if(currentNode && currentNode.name === elementType.select) {
15
+ // select 下拉 option选中操作
16
+ getSelectedData(e, currentNode);
17
+ //Store.set(`${currentNode.TID}-LT:render`, true);
18
+ }
19
+ }
4
20
  // 执行window函数
5
21
  export function omouseEventPrototDoWindowFn (eventNode, node) {
6
22
 
7
23
  window[eventNode.value](node, eventNode.params);
8
24
 
9
- };
25
+ }
10
26
  export function mousMoveFun(type, pos, data) {
11
27
  let params = {
12
28
  order: 0,
@@ -51,12 +67,17 @@ export function mousDownFun(type, eventNode) {
51
67
  const action = eventNode ? parseInt(eventNode.action) : 0;
52
68
  if(action === 3) {
53
69
  params.eventType = downDataType.Window; // 打开会话窗口
54
- }else if(action === 7){
55
- params.eventType = downDataType.Showhide; // 显示/隐藏
70
+ }else if(action === 7) {
71
+ // 显示/隐藏
72
+ params.eventType = downDataType.Showhide;
56
73
  params.value = eventNode.value;
57
- }else if(action === 8){
74
+ }else if(action === 8) {
58
75
  params.eventType = downDataType.Tabswitch; // Tab切换
59
- } else {
76
+ }else if(action === 11) {
77
+ params.eventType = downDataType.Formselect; // select下拉切换
78
+ params.staticType = eventNode.dcimStaticForType; // 1: 数据统计;2:数据展示
79
+ }else {
80
+ // action === 5 远程控制比较特殊,无论是否绑定远程控制事件,只要数据中有远程控制属性且值为0都会认定为远程控制
60
81
  params.eventType = downDataType.Target; // 链接跳转
61
82
  }
62
83
  return params;
@@ -0,0 +1,7 @@
1
+ export declare function categoryDataParams(data: []): void;
2
+ export declare function setParams(assetId: string): object;
3
+ export declare function getParams(data: []): void;
4
+ export declare function filterParams(node: any): void;
5
+ export declare function getTagIdsForKpiAddrs(data: []): void;
6
+ export declare function getVarValueIdsForVarData(data: []): void;
7
+ export declare function renderForAssetPoperties(asset: any, data: []): void;
@@ -0,0 +1,125 @@
1
+ import { syncMqttData, clearMqttParams } from '../store';
2
+ export function categoryDataParams(data) {
3
+ clearMqttParams();
4
+ getParams(data);
5
+ }
6
+ export function setParams(assetId) {
7
+ const params = {
8
+ tagIds: syncMqttData.params.tagIds.join(","),
9
+ assetIds: syncMqttData.params.assetIds.join(","),
10
+ areaIds: syncMqttData.params.areaIds.join(","),
11
+ routingkey: syncMqttData.params.routingkey,
12
+ echart: syncMqttData.params.tagEcharts.join(","),
13
+ echartData: syncMqttData.params.echartData
14
+ }
15
+ if (syncMqttData.params.echartAssemblyData && syncMqttData.params.echartAssemblyData.length) {
16
+ params.echartAssemblyData = syncMqttData.params.echartAssemblyData;
17
+ }
18
+ if(assetId) {
19
+ params.varValueIds = syncMqttData.params.varVaule.join(",");
20
+ }else {
21
+ if(syncMqttData.params.assetIds.length && syncMqttData.params.varVaule.length) {
22
+ const assetId = syncMqttData.params.assetIds[syncMqttData.params.assetIds.length -1];
23
+ for(let va = 0; va < syncMqttData.params.varVaule.length; va++) {
24
+ syncMqttData.params.varVaule[va] = `${assetId}_${syncMqttData.params.varVaule[va]}`;
25
+ }
26
+ params.varValueIds = syncMqttData.params.varVaule.join(",");
27
+ }else {
28
+ params.varVaule = syncMqttData.params.varVaule.join(",");
29
+ }
30
+ }
31
+ return params;
32
+ }
33
+ // 获取绑定数据的参数
34
+ export function getParams(data) {
35
+ data.map((item) => {
36
+ filterParams(item);
37
+ if (item.children && item.children.length) {
38
+ getParams(item.children);
39
+ }
40
+ });
41
+ }
42
+ // 过滤出参数
43
+ export function filterParams(node) {
44
+ let tagIds = [];
45
+ let kpiAddrs = [];
46
+ let assetIds = [];
47
+ let areaIds = [];
48
+ let tagEcharts = [];
49
+ let echartData = [];
50
+ let varVaule = [];
51
+ let isMqttEventType = node.events.find((ev) => {return ev.type === 3});
52
+ if(!isMqttEventType) return;
53
+ if (node.data && Array.isArray(node.data) && node.data.length) {
54
+ node.data.map((item) => {
55
+ if (item.key === 'tagId') {
56
+ tagIds.push(item.value);
57
+ }
58
+ if (item.key === 'kpiAddr') {
59
+ kpiAddrs.push(item.value);
60
+ }
61
+ if (item.key === 'assetId') {
62
+ assetIds.push(item.value);
63
+ }
64
+ if (item.key === 'areaId') {
65
+ areaIds.push(item.value);
66
+ }
67
+ if (item.key.includes('varValue')) {
68
+ varVaule.push(item.value);
69
+ }
70
+ })
71
+ }
72
+ if (node.data && Object.prototype.toString.call(node.data) === '[object Object]' && node.data.params && node.data.params.id) {
73
+ echartData.push(node.data.params.id);
74
+ }
75
+ syncMqttData.params.tagIds = [...syncMqttData.params.tagIds, ...tagIds];
76
+ syncMqttData.params.kpiAddrs = [...syncMqttData.params.kpiAddrs, ...kpiAddrs];
77
+ syncMqttData.params.assetIds = [...syncMqttData.params.assetIds, ...assetIds];
78
+ syncMqttData.params.areaIds = [...syncMqttData.params.areaIds, ...areaIds];
79
+ syncMqttData.params.varVaule = [...syncMqttData.params.varVaule, ...varVaule];
80
+ syncMqttData.params.tagEcharts = [...syncMqttData.params.tagEcharts, ...tagEcharts];
81
+ syncMqttData.params.echartData = [...syncMqttData.params.echartData, ...echartData];
82
+ }
83
+ // 根据指标地址数据获取测点数据
84
+ export function getTagIdsForKpiAddrs(data) {
85
+ let tagIds = [];
86
+ if (data && data.length > 0) {
87
+ data.map((item) => {
88
+ tagIds.push(item.tagId);
89
+ })
90
+ // syncMqttData.params.detailAssetData = data;
91
+ }
92
+ syncMqttData.params.tagIds = tagIds;
93
+ syncMqttData.params.echartAssemblyData = data.echartAssemblyData;
94
+ }
95
+ // 获取绑定值类型参数
96
+ export function getVarValueIdsForVarData(data) {
97
+ const ids = [];
98
+ if(data && data.length) {
99
+ data.map((item) => {
100
+ if(item.varVal) ids.push(item.assetVarIds);
101
+ })
102
+ }
103
+ syncMqttData.params.varVaule = ids;
104
+ }
105
+ // 固定资产详情数据赋值
106
+ export function renderForAssetPoperties(asset, data) {
107
+ if(!(asset && Object.keys(asset).length)) return;
108
+ data.map((node) => {
109
+ if (node.data && Array.isArray(node.data) && node.data.length) {
110
+ node.data.map((item) => {
111
+ if (item.key === 'assetKey' && asset[item.value]) {
112
+ if (['imgUrl', 'principleImg'].includes(item.value)) {
113
+ node.text = '';
114
+ node.image = `${syncMqttData.params.pathRewrite}${asset[item.value]}`;
115
+ } else {
116
+ node.text = asset[item.value];
117
+ }
118
+ }
119
+ })
120
+ }
121
+ if (node.children && node.children.length) {
122
+ renderForAssetPoperties(asset, node.children);
123
+ }
124
+ });
125
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "1.1.6",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "main": "-",
6
6
  "scripts": {
@@ -1,110 +1,3 @@
1
- /**
2
- * echarts图表默认数据组
3
- * @type {{displayMode_1: string}}
4
- */
5
- export const echartsDefaultDataMap = {
6
- displayMode_1: {
7
- legend: null,
8
- XData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
9
- seriesData: [{
10
- type: 'line',
11
- data: [820, 932, 901, 934, 1290, 1330, 1320]
12
- }]
13
- }, // 折线图
14
- displayMode_2: {
15
- legend: null,
16
- XData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
17
- seriesData: [{
18
- name: '',
19
- data: [20, 60, 110, 220, 80, 100, 180]
20
- }]
21
- },// 柱状图
22
- displayMode_3: {
23
- legend: null,
24
- seriesData: [{
25
- value: 10,
26
- name: '机房1'
27
- }, {
28
- value: 30,
29
- name: '机房2'
30
- }, {
31
- value: 50,
32
- name: '机房3'
33
- }, {
34
- value: 20,
35
- name: '机房4'
36
- }, {
37
- value: 60,
38
- name: '机房5'
39
- }, {
40
- value: 15,
41
- name: '机房6'
42
- }, {
43
- value: 18,
44
- name: '机房7'
45
- }, {
46
- value: 26,
47
- name: '机房8'
48
- }]
49
- },// 环形图
50
- displayMode_4: {
51
- legend: null,
52
- total: 100,
53
- XData: ['CA机房', '五层IT', '四层IT', '冷水机组'],
54
- seriesData: [{
55
- data: [5, 20, 50, 80]
56
- }]
57
- },// TOP排行榜
58
- displayMode_5: {
59
- legend: null,
60
- seriesData: [{
61
- name: '一般',
62
- value: 0
63
- }, {
64
- name: '较大',
65
- value: 0
66
- }, {
67
- name: '重大',
68
- value: 0
69
- }, {
70
- name: '严重',
71
- value: 0
72
- }, {
73
- name: '高级',
74
- value: 0
75
- }]
76
- },// 饼图
77
- displayMode_6: {
78
- value: 8
79
- },// 仪表盘
80
- displayMode_1_tem_line_1: {
81
- legend: ['温度', '湿度'],
82
- XData: ['00:00','03:00','06:00','09:00','12:00','15:00','18:00','21:00','24:00'],
83
- seriesData: [{
84
- name: '温度',
85
- data: [20,24,20,24,20,24,20,24,20]
86
- },{
87
- name: '湿度',
88
- data: [40,45,40,45,40,45,40,45,40]
89
- }]
90
- }, // 双轴双曲线
91
- displayMode_1_tem_line_2: {
92
- legend: null,
93
- XData: ['00:00','03:00','06:00','09:00','12:00','15:00','18:00','21:00','24:00'],
94
- seriesData: [{
95
- name: '温度',
96
- data: [20,24,20,24,20,24,20,24,20]
97
- }]
98
- }, // 单轴双曲线区域
99
- displayMode_2_tem_3dbar_1: {
100
- legend: null,
101
- XData: ['制冷', '配电制冷', '网络机房制冷', '主机房制冷', '网络机房IT', '主机房IT', 'IT'],
102
- seriesData: [{
103
- name: '',
104
- data: [82, 115, 42, 82, 70, 40, 92]
105
- }]
106
- }, // 3D柱状图模板-3d柱状图1
107
- };
108
1
  // 图例默认数据
109
2
  export const echartsLegendDefaultData = {
110
3
  icon: 'rect', // 图标类型:'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
@@ -236,4 +129,31 @@ export const echartsDataRoom = [{ //给x轴设置滚动条
236
129
  start: 0, //默认为1
237
130
  end: 50 // 100 - 1500 / 31, //默认为100
238
131
  }];
132
+ // 图表类型Map
133
+ export const echartsTypeMap = {
134
+ 'type_1': 'line',
135
+ 'type_2': 'bar',
136
+ 'type_3': 'ring',
137
+ 'type_4': 'TOP',
138
+ 'type_5': 'pie',
139
+ 'type_6': 'gauge'
140
+ };
141
+ // 图表颜色
142
+ export const echartsColorData = [
143
+ 'rgb(36, 220, 132)',
144
+ 'rgb(154, 77, 251)',
145
+ 'rgb(226, 182, 56)',
146
+ 'rgb(253, 92, 71)',
147
+ 'rgb(26, 117, 255)',
148
+ 'rgb(175, 215, 14)',
149
+ 'rgb(214, 154, 37)',
150
+ 'rgb(66, 251, 251)',
151
+ 'rgb(255, 158, 4)',
152
+ 'rgb(30, 107, 222)',
153
+ 'rgb(21, 151, 224)',
154
+ 'rgb(19, 236, 236)',
155
+ 'rgb(68, 237, 146)',
156
+ 'rgb(251, 94, 45)',
157
+ 'rgb(18, 255, 113)',
158
+ 'rgb(18, 255, 113)']
239
159
 
@@ -0,0 +1,14 @@
1
+ export const elementType = {
2
+ select: 'select',
3
+ table: 'table',
4
+ pagination: 'pagination',
5
+ iframe: 'iframe',
6
+ echarts: 'echarts'
7
+ };
8
+ export const elementSelectThemeType = [{
9
+ id: 0,
10
+ name: '默认'
11
+ },{
12
+ id: 1,
13
+ name: '青色'
14
+ }];
package/static/form.js ADDED
@@ -0,0 +1,11 @@
1
+ // 下拉默认数据
2
+ export const selectDefaultData = [{
3
+ id: '1',
4
+ name: '列表一'
5
+ },{
6
+ id: '2',
7
+ name: '列表二'
8
+ },{
9
+ id: '3',
10
+ name: '列表三'
11
+ }];
package/static/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './echartsDefaultData';
2
- export * from './echartsStore';
2
+ export * from './form';
3
+ export * from './element';
@@ -0,0 +1,17 @@
1
+ // element 交互过渡数据
2
+ export const elementInteractivePoor = {};
3
+ // echarts
4
+ export const echartsDataPool = {}; // echarts Dom节点数据
5
+ export const echartsOptionsPool = {}; // echarts options节点数据
6
+ export const echartsRealDataPool = {}; // echarts 实时数据
7
+
8
+ // tabs
9
+ export const switchTabDataPool = {};
10
+
11
+ // form
12
+ export const tableDataPool = {};
13
+ export const selectDataPool = {};
14
+ export const selectRealDataPool = {};
15
+
16
+ // iframe
17
+ export const iframeDataPool = {};
package/store/clear.js ADDED
@@ -0,0 +1,72 @@
1
+ import {
2
+ echartsDataPool,
3
+ echartsOptionsPool,
4
+ echartsRealDataPool,
5
+ switchTabDataPool,
6
+ tableDataPool,
7
+ selectDataPool,
8
+ elementInteractivePoor,
9
+ selectRealDataPool,
10
+ iframeDataPool
11
+ } from './actions';
12
+ import {setEventListener} from "../core";
13
+
14
+ export const clearDataPool = function (){
15
+ for (let [key, node] of Object.entries(echartsDataPool)) {
16
+ if(node) {
17
+ clearInterval(node.timeTicket);
18
+ if(node.chart) {
19
+ node.chart.off('mouseover');
20
+ node.chart.off('mouseout');
21
+ node.chart.dispose();
22
+ }
23
+ if(node.div && node.div.parentNode) node.div.parentNode.removeChild(node.div);
24
+ }
25
+ delete echartsDataPool[key];
26
+ }
27
+ for (let key of Object.keys(echartsOptionsPool)) {
28
+ delete echartsOptionsPool[key];
29
+ }
30
+ for (let key of Object.keys(echartsRealDataPool)) {
31
+ delete echartsRealDataPool[key];
32
+ }
33
+ for (let key of Object.keys(switchTabDataPool)) {
34
+ delete switchTabDataPool[key];
35
+ }
36
+ for (let key of Object.keys(tableDataPool)) {
37
+ delete tableDataPool[key];
38
+ }
39
+ if(Object.keys(selectDataPool).length) {
40
+ let dropdownEle = null,
41
+ dropdownListEle = null;
42
+ for (let [key, node] of Object.entries(selectDataPool)) {
43
+ if(!dropdownEle) {
44
+ dropdownEle = node.dom.selectDropdown;
45
+ dropdownListEle = node.dom.selectDropdownUl;
46
+ }
47
+ if(node.dom.selectEle && node.dom.selectEle.parentNode) node.dom.selectEle.parentNode.removeChild(node.dom.selectEle);
48
+ delete selectDataPool[key];
49
+ }
50
+ if(dropdownEle) dropdownEle.style.display = 'none';
51
+ if(dropdownListEle) dropdownListEle.innerHTML = '';
52
+ }
53
+ for (let key of Object.keys(elementInteractivePoor)) {
54
+ delete elementInteractivePoor[key];
55
+ }
56
+ for (let key of Object.keys(selectRealDataPool)) {
57
+ delete selectRealDataPool[key];
58
+ }
59
+ for (let [key, node] of Object.entries(iframeDataPool)) {
60
+ node.iframe.parentNode.removeChild(node.iframe);
61
+ delete iframeDataPool[key];
62
+ }
63
+ }
64
+ export const removeAllElement = function (){
65
+ const documentDefineEle = document.querySelectorAll('.documentDefine');
66
+ if(documentDefineEle) {
67
+ documentDefineEle.forEach(function(element) {
68
+ element.removeEventListener('click', (e) => {setEventListener(e);});
69
+ element.parentNode.removeChild(element);
70
+ });
71
+ }
72
+ }
package/store/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './actions';
2
+ export * from './clear';
@@ -0,0 +1,18 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+ li {
7
+ list-style: none;
8
+ }
9
+ .canvas-point.pointer{
10
+ cursor: pointer;
11
+ }
12
+ .canvas-point,
13
+ .canvas-point.default{
14
+ cursor: default;
15
+ }
16
+ .canvas-point.pointer > div{
17
+ z-index: -2;
18
+ }
@@ -0,0 +1,13 @@
1
+ /*.canvas-draw{*/
2
+ /* z-index: 2;*/
3
+ /*}*/
4
+ /*.canvas-point{*/
5
+ /* z-index: 6;*/
6
+ /*}*/
7
+ .topoEchart,
8
+ .topology-select{
9
+ z-index: 1;
10
+ }
11
+ .topology-select-dropdown{
12
+ transition: all ease-in .2s;
13
+ }
package/style/index.css CHANGED
@@ -1,13 +1,4 @@
1
- .canvas-point.pointer{
2
- cursor: pointer;
3
- }
4
- .canvas-point,
5
- .canvas-point.default{
6
- cursor: default;
7
- }
8
- .canvas-point.pointer > div{
9
- z-index: -2;
10
- }
11
- .topology2dConfIfram{
1
+ @import './common.css';
2
+ @import './select.css';
3
+
12
4
 
13
- }