dcim-topology2d 1.1.6 → 2.0.5
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/chart-diagram/index.d.ts +1 -1
- package/chart-diagram/index.js +1 -1
- package/chart-diagram/src/echarts/index.js +88 -96
- package/chart-diagram/src/register.js +3 -3
- package/chart-diagram/src/utils/changeOptions.d.ts +7 -4
- package/chart-diagram/src/utils/changeOptions.js +228 -144
- package/chart-diagram/src/utils/conversion.d.ts +12 -12
- package/chart-diagram/src/utils/conversion.js +263 -137
- package/chart-diagram/src/utils/render.d.ts +6 -0
- package/chart-diagram/src/utils/render.js +124 -0
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/src/activeLayer.js +0 -6
- package/core/src/canvas.js +1 -0
- package/core/src/common.d.ts +1 -2
- package/core/src/common.js +197 -541
- package/core/src/core.js +116 -60
- package/core/src/divLayer.d.ts +0 -3
- package/core/src/divLayer.js +13 -34
- package/core/src/element/common.d.ts +5 -0
- package/core/src/element/common.js +52 -0
- package/core/src/element/iframe.d.ts +3 -0
- package/core/src/element/iframe.js +12 -0
- package/core/src/element/index.d.ts +4 -0
- package/core/src/element/index.js +4 -0
- package/core/src/element/select.d.ts +11 -0
- package/core/src/element/select.js +234 -0
- package/core/src/element/tab.d.ts +1 -0
- package/core/src/element/tab.js +19 -0
- package/core/src/healps/changeData.d.ts +1 -2
- package/core/src/healps/changeData.js +33 -125
- package/core/src/middles/default.js +3 -1
- package/core/src/middles/nodes/arbitrarygraph.js +11 -9
- package/core/src/middles/nodes/formselect.d.ts +2 -0
- package/core/src/middles/nodes/formselect.js +87 -0
- package/core/src/middles/nodes/iframe.js +21 -4
- package/core/src/middles/nodes/index.d.ts +1 -0
- package/core/src/middles/nodes/index.js +1 -0
- package/core/src/models/node.d.ts +4 -0
- package/core/src/models/node.js +24 -22
- package/core/src/models/pen.js +3 -52
- package/core/src/models/rect.js +2 -2
- package/core/src/options.d.ts +2 -0
- package/core/src/options.js +2 -1
- package/core/src/preview.js +51 -32
- package/core/src/renderLayer.d.ts +10 -6
- package/core/src/renderLayer.js +36 -43
- package/core/src/store/data.d.ts +71 -21
- package/core/src/store/data.js +93 -17
- package/core/src/utils/assignment.d.ts +6 -3
- package/core/src/utils/assignment.js +120 -21
- package/core/src/utils/construction.d.ts +10 -3
- package/core/src/utils/construction.js +7 -1
- package/core/src/utils/conversion.d.ts +3 -0
- package/core/src/utils/conversion.js +62 -1
- package/core/src/utils/index.d.ts +1 -1
- package/core/src/utils/index.js +1 -1
- package/core/src/utils/math.d.ts +1 -0
- package/core/src/utils/math.js +3 -0
- package/core/src/utils/onmousevent.d.ts +3 -0
- package/core/src/utils/onmousevent.js +27 -7
- package/core/src/utils/params.d.ts +2 -0
- package/core/src/utils/params.js +57 -0
- package/myShape-diagram/index.js +196 -0
- package/package.json +1 -1
- package/static/echartsDefaultData.js +27 -107
- package/static/element.js +14 -0
- package/static/form.js +11 -0
- package/static/index.js +2 -1
- package/store/actions.js +1 -0
- package/store/clear.js +10 -0
- package/store/index.js +2 -0
- package/style/common.css +18 -0
- package/style/editor.css +13 -0
- package/style/index.css +3 -12
- package/style/select.css +143 -0
- package/core/src/poll.js +0 -37
- package/core/src/utils/dom.d.ts +0 -9
- package/core/src/utils/dom.js +0 -103
- package/core/src/utils/dom.js.map +0 -1
- package/myShape-diagram/myShape.js +0 -196
- package/static/echartsStore.js +0 -14
- /package/myShape-diagram/{myShape.ts → index.ts} +0 -0
@@ -1,12 +1,27 @@
|
|
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 {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
|
+
}
|
4
19
|
// 执行window函数
|
5
20
|
export function omouseEventPrototDoWindowFn (eventNode, node) {
|
6
21
|
|
7
22
|
window[eventNode.value](node, eventNode.params);
|
8
23
|
|
9
|
-
}
|
24
|
+
}
|
10
25
|
export function mousMoveFun(type, pos, data) {
|
11
26
|
let params = {
|
12
27
|
order: 0,
|
@@ -51,12 +66,17 @@ export function mousDownFun(type, eventNode) {
|
|
51
66
|
const action = eventNode ? parseInt(eventNode.action) : 0;
|
52
67
|
if(action === 3) {
|
53
68
|
params.eventType = downDataType.Window; // 打开会话窗口
|
54
|
-
}else if(action === 7){
|
55
|
-
|
69
|
+
}else if(action === 7) {
|
70
|
+
// 显示/隐藏
|
71
|
+
params.eventType = downDataType.Showhide;
|
56
72
|
params.value = eventNode.value;
|
57
|
-
}else if(action === 8){
|
73
|
+
}else if(action === 8) {
|
58
74
|
params.eventType = downDataType.Tabswitch; // Tab切换
|
59
|
-
}
|
75
|
+
}else if(action === 11) {
|
76
|
+
params.eventType = downDataType.Formselect; // select下拉切换
|
77
|
+
params.staticType = eventNode.dcimStaticForType; // 1: 数据统计;2:数据展示;3:显示隐藏
|
78
|
+
}else {
|
79
|
+
// action === 5 远程控制比较特殊,无论是否绑定远程控制事件,只要数据中有远程控制属性且值为0都会认定为远程控制
|
60
80
|
params.eventType = downDataType.Target; // 链接跳转
|
61
81
|
}
|
62
82
|
return params;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import {commonStore} from '../store';
|
2
|
+
// 获取绑定数据的参数
|
3
|
+
export function getParams(id, data) {
|
4
|
+
data.map((item) => {
|
5
|
+
filterParams(id, item);
|
6
|
+
if (item.children && item.children.length) {
|
7
|
+
getParams(id, item.children);
|
8
|
+
}
|
9
|
+
});
|
10
|
+
}
|
11
|
+
// 过滤出参数
|
12
|
+
export function filterParams(id, node) {
|
13
|
+
let tagIds = [];
|
14
|
+
let kpiAddrs = [];
|
15
|
+
let assetIds = [];
|
16
|
+
let areaIds = [];
|
17
|
+
let tagEcharts = [];
|
18
|
+
let echartData = [];
|
19
|
+
let varVaule = [];
|
20
|
+
let doorIds = [];
|
21
|
+
let isMqttEventType = false;
|
22
|
+
node.events.map((ev) => {
|
23
|
+
if(ev.value && ev.value === 'entranceGuard') doorIds.push(ev.params); // 门禁参数
|
24
|
+
if(ev.type === 3) isMqttEventType = true;
|
25
|
+
});
|
26
|
+
if(doorIds.length) commonStore[id].mqttParams.doorIds = [...commonStore[id].mqttParams.doorIds, ...doorIds];
|
27
|
+
if(!isMqttEventType) return;
|
28
|
+
if (node.data && Array.isArray(node.data) && node.data.length) {
|
29
|
+
node.data.map((item) => {
|
30
|
+
if (item.key === 'tagId') {
|
31
|
+
tagIds.push(item.value);
|
32
|
+
}
|
33
|
+
if (item.key === 'kpiAddr') {
|
34
|
+
kpiAddrs.push(item.value);
|
35
|
+
}
|
36
|
+
if (item.key === 'assetId') {
|
37
|
+
assetIds.push(item.value);
|
38
|
+
}
|
39
|
+
if (item.key === 'areaId') {
|
40
|
+
areaIds.push(item.value);
|
41
|
+
}
|
42
|
+
if (item.key.includes('varValue')) {
|
43
|
+
varVaule.push(item.value);
|
44
|
+
}
|
45
|
+
})
|
46
|
+
}
|
47
|
+
if (node.data && Object.prototype.toString.call(node.data) === '[object Object]' && node.data.params && node.data.params.id) {
|
48
|
+
echartData.push(node.data.params.id);
|
49
|
+
}
|
50
|
+
commonStore[id].mqttParams.tagIds = [...commonStore[id].mqttParams.tagIds, ...tagIds];
|
51
|
+
commonStore[id].mqttParams.kpiAddrs = [...commonStore[id].mqttParams.kpiAddrs, ...kpiAddrs];
|
52
|
+
commonStore[id].mqttParams.assetIds = [...commonStore[id].mqttParams.assetIds, ...assetIds];
|
53
|
+
commonStore[id].mqttParams.areaIds = [...commonStore[id].mqttParams.areaIds, ...areaIds];
|
54
|
+
commonStore[id].mqttParams.varVaule = [...commonStore[id].mqttParams.varVaule, ...varVaule];
|
55
|
+
commonStore[id].mqttParams.tagEcharts = [...commonStore[id].mqttParams.tagEcharts, ...tagEcharts];
|
56
|
+
commonStore[id].mqttParams.echartData = [...commonStore[id].mqttParams.echartData, ...echartData];
|
57
|
+
}
|
@@ -0,0 +1,196 @@
|
|
1
|
+
// 源码版写法
|
2
|
+
import { registerNode } from '../core'
|
3
|
+
|
4
|
+
// 组件版写法和bundle一致
|
5
|
+
// window.Le5leTopology.registerNode
|
6
|
+
|
7
|
+
// 画骨架
|
8
|
+
|
9
|
+
function drawOuterLine(ctx, node) {
|
10
|
+
const R = Math.floor((node.rect.width - 6) / 2);
|
11
|
+
const r = Math.round((R * 1) / 2);
|
12
|
+
|
13
|
+
ctx.beginPath();
|
14
|
+
// 上半个圆形
|
15
|
+
ctx.arc(node.rect.x + R, node.rect.y + r, r, 0, Math.PI, true);
|
16
|
+
// 下半个圆形
|
17
|
+
const theta = Math.acos((r * 1.0) / R);
|
18
|
+
ctx.arc(
|
19
|
+
node.rect.x + R,
|
20
|
+
node.rect.y + node.rect.height - R,
|
21
|
+
R,
|
22
|
+
theta + Math.PI,
|
23
|
+
-theta,
|
24
|
+
true
|
25
|
+
); // 逆时针
|
26
|
+
ctx.closePath();
|
27
|
+
ctx.stroke();
|
28
|
+
}
|
29
|
+
|
30
|
+
// 画底色
|
31
|
+
function drawBasic(ctx, node) {
|
32
|
+
const lingrad = ctx.createLinearGradient(
|
33
|
+
node.rect.x,
|
34
|
+
node.rect.y,
|
35
|
+
node.rect.width,
|
36
|
+
node.rect.height
|
37
|
+
);
|
38
|
+
lingrad.addColorStop(0, 'mediumvioletred');
|
39
|
+
lingrad.addColorStop(0.2, 'darkorange');
|
40
|
+
lingrad.addColorStop(0.4, 'gold');
|
41
|
+
lingrad.addColorStop(0.6, 'limegreen');
|
42
|
+
lingrad.addColorStop(0.8, 'navy');
|
43
|
+
lingrad.addColorStop(1, 'purple');
|
44
|
+
ctx.fillStyle = lingrad;
|
45
|
+
ctx.fill('evenodd');
|
46
|
+
}
|
47
|
+
|
48
|
+
function getYByValue(node, i) {
|
49
|
+
const R = Math.floor((node.rect.width - 6) / 2);
|
50
|
+
const r = Math.round((R * 1) / 2);
|
51
|
+
|
52
|
+
const min = 0;
|
53
|
+
const max = 40;
|
54
|
+
|
55
|
+
// 刻度线总高度
|
56
|
+
const scale_height = node.rect.height - 2 * R - 2 * r;
|
57
|
+
// 0刻度线所在位置
|
58
|
+
const zero_scale_y = node.rect.height - 2 * R;
|
59
|
+
const dy_dtem = scale_height / (max - min);
|
60
|
+
return zero_scale_y - dy_dtem * node.value;
|
61
|
+
}
|
62
|
+
|
63
|
+
// 画刻度线
|
64
|
+
function drawScale(ctx, node) {
|
65
|
+
const min = 0;
|
66
|
+
const max = 40;
|
67
|
+
const R = Math.floor((node.rect.width - 6) / 2);
|
68
|
+
const r = Math.round((R * 1) / 2);
|
69
|
+
|
70
|
+
for (let i = min; i <= max; i++) {
|
71
|
+
// 画刻度线
|
72
|
+
const y = getYByValue(node, i);
|
73
|
+
ctx.beginPath();
|
74
|
+
ctx.moveTo(R + r, y);
|
75
|
+
if (i % 10 == 0) {
|
76
|
+
ctx.lineWidth = 2;
|
77
|
+
ctx.lineTo(R + r - (r * 2) / 3, y);
|
78
|
+
// ctx.font = "15px bold";
|
79
|
+
ctx.fillText(i + '', R + r, y + 6);
|
80
|
+
ctx.stroke();
|
81
|
+
} else {
|
82
|
+
ctx.lineWidth = 1;
|
83
|
+
if (i % 5 == 0) {
|
84
|
+
ctx.lineTo(R + r - r / 2, y);
|
85
|
+
} else {
|
86
|
+
ctx.lineTo(R + r - r / 3, y);
|
87
|
+
}
|
88
|
+
ctx.stroke();
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
/////////////////////
|
94
|
+
// end 以下代码不完整,代码来自网上改写,仅作参考
|
95
|
+
/////////////////////
|
96
|
+
|
97
|
+
// 自定义图形库绘画函数
|
98
|
+
export function thermometer(ctx, node) {
|
99
|
+
ctx.beginPath();
|
100
|
+
|
101
|
+
drawOuterLine(ctx, node);
|
102
|
+
drawBasic(ctx, node);
|
103
|
+
ctx.clearRect(
|
104
|
+
node.rect.x,
|
105
|
+
node.rect.y,
|
106
|
+
node.rect.width,
|
107
|
+
getYByValue(node, node.value)
|
108
|
+
);
|
109
|
+
drawOuterLine(ctx, node);
|
110
|
+
drawScale(ctx, node);
|
111
|
+
}
|
112
|
+
|
113
|
+
// 自定义图形库绘画函数
|
114
|
+
export function pool(ctx, node) {
|
115
|
+
var wr = node.borderRadius;
|
116
|
+
var hr = node.borderRadius;
|
117
|
+
if (node.borderRadius < 1) {
|
118
|
+
wr = node.rect.width * node.borderRadius;
|
119
|
+
hr = node.rect.height * node.borderRadius;
|
120
|
+
}
|
121
|
+
var r = wr < hr ? wr : hr;
|
122
|
+
if (node.rect.width < 2 * r) {
|
123
|
+
r = node.rect.width / 2;
|
124
|
+
}
|
125
|
+
if (node.rect.height < 2 * r) {
|
126
|
+
r = node.rect.height / 2;
|
127
|
+
}
|
128
|
+
ctx.beginPath();
|
129
|
+
ctx.strokeStyle = "rgba(0,0,0,.0)"
|
130
|
+
var value = (1-node.value) * (node.rect.height - node.lineWidth/2)
|
131
|
+
ctx.moveTo(node.rect.x + node.lineWidth/2, node.rect.y + value);
|
132
|
+
ctx.lineTo(node.rect.ex - node.lineWidth/2, node.rect.y + value);
|
133
|
+
ctx.arcTo(node.rect.ex - node.lineWidth/2, node.rect.y + node.rect.height - node.lineWidth/2, node.rect.x + node.lineWidth/2, node.rect.y + node.rect.height - node.lineWidth/2, r);
|
134
|
+
ctx.arcTo(node.rect.x + node.lineWidth/2, node.rect.y + node.rect.height - node.lineWidth/2, node.rect.x + node.lineWidth/2, node.rect.y, r);
|
135
|
+
ctx.lineTo(node.rect.x + node.lineWidth/2, node.rect.y + value);
|
136
|
+
ctx.closePath();
|
137
|
+
(node.fillStyle || node.bkType) && ctx.fill();
|
138
|
+
ctx.stroke();
|
139
|
+
|
140
|
+
ctx.beginPath();
|
141
|
+
ctx.strokeStyle = node.strokeStyle
|
142
|
+
ctx.lineWidth = node.lineWidth
|
143
|
+
ctx.moveTo(node.rect.x + node.rect.width, node.rect.y);
|
144
|
+
ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r);
|
145
|
+
ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r);
|
146
|
+
ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r);
|
147
|
+
// ctx.closePath();
|
148
|
+
(node.fillStyle || node.bkType);
|
149
|
+
ctx.stroke();
|
150
|
+
}
|
151
|
+
|
152
|
+
// 自定义图形库绘画函数
|
153
|
+
export function electricFan(ctx, node) {
|
154
|
+
var wwr = node.rect.width / 2;
|
155
|
+
var hwr = node.rect.height / 2;
|
156
|
+
var hwr = node.rect.height / 2;
|
157
|
+
var x0 = node.rect.x + node.rect.width /2
|
158
|
+
var y0 = node.rect.y + node.rect.height / 2
|
159
|
+
var withinRadius = wwr < hwr ? wwr : hwr;
|
160
|
+
ctx.beginPath();
|
161
|
+
ctx.lineWidth = node.lineWidth
|
162
|
+
ctx.arc(x0,y0,withinRadius,0,2*Math.PI);
|
163
|
+
ctx.closePath();
|
164
|
+
ctx.stroke();
|
165
|
+
ctx.beginPath();
|
166
|
+
ctx.lineWidth = 1;
|
167
|
+
var fanCount = node.fanCount;
|
168
|
+
for(var i = 0; i < fanCount; i++){
|
169
|
+
var fanAngle = 2 * Math.PI / fanCount * i;
|
170
|
+
var x1 = x0 - withinRadius*Math.sin(fanAngle);
|
171
|
+
var y1 = y0 - withinRadius*Math.cos(fanAngle);
|
172
|
+
var xr = x0 - withinRadius*Math.sin(fanAngle)/2;
|
173
|
+
var yr = y0 - withinRadius*Math.cos(fanAngle)/2;
|
174
|
+
ctx.moveTo(x0, y0);
|
175
|
+
ctx.lineTo(x1, y1);
|
176
|
+
ctx.arc(xr, yr, withinRadius/2, Math.PI / 2 - fanAngle,3 * Math.PI / 2 - fanAngle);
|
177
|
+
}
|
178
|
+
ctx.closePath();
|
179
|
+
(node.fillStyle || node.bkType) && ctx.fill();
|
180
|
+
ctx.stroke();
|
181
|
+
ctx.beginPath();
|
182
|
+
ctx.lineWidth = 3;
|
183
|
+
ctx.arc(x0,y0,withinRadius/5,0,2*Math.PI);
|
184
|
+
ctx.closePath();
|
185
|
+
(node.fillStyle || node.bkType) && ctx.fill();
|
186
|
+
ctx.stroke();
|
187
|
+
}
|
188
|
+
|
189
|
+
// 注册自定义图形库
|
190
|
+
export function registerMyShape() {
|
191
|
+
registerNode('electricFan', electricFan);
|
192
|
+
registerNode('pool', pool);
|
193
|
+
registerNode('thermometer', thermometer);
|
194
|
+
}
|
195
|
+
|
196
|
+
// src\views\data.ts 里面加载到工具栏,第一个就是此自定义图形库
|
package/package.json
CHANGED
@@ -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
|
|
package/static/form.js
ADDED
package/static/index.js
CHANGED
package/store/actions.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export const plugsPool = {};
|
package/store/clear.js
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
import {setEventListener} from "../core";
|
2
|
+
export const removeAllElement = function (){
|
3
|
+
const documentDefineEle = document.querySelectorAll('.documentDefine');
|
4
|
+
if(documentDefineEle) {
|
5
|
+
documentDefineEle.forEach(function(element) {
|
6
|
+
element.removeEventListener('click', (e) => {setEventListener(e);});
|
7
|
+
element.parentNode.removeChild(element);
|
8
|
+
});
|
9
|
+
}
|
10
|
+
}
|
package/store/index.js
ADDED
package/style/common.css
ADDED
@@ -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
|
+
}
|
package/style/editor.css
ADDED
package/style/index.css
CHANGED