dcim-topology2d 1.1.3 → 1.1.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 +2 -0
- package/chart-diagram/index.js +1 -0
- package/chart-diagram/src/echarts/index.d.ts +0 -1
- package/chart-diagram/src/echarts/index.js +106 -107
- package/chart-diagram/src/register.js +9 -8
- package/chart-diagram/src/utils/changeOptions.d.ts +4 -0
- package/chart-diagram/src/utils/changeOptions.js +163 -0
- package/chart-diagram/src/utils/conversion.d.ts +17 -0
- package/chart-diagram/src/utils/conversion.js +179 -0
- package/chart-diagram/src/utils/drawGraphic.d.ts +3 -0
- package/chart-diagram/src/utils/drawGraphic.js +97 -0
- package/chart-diagram/src/utils/index.d.ts +3 -0
- package/chart-diagram/src/utils/index.js +3 -0
- package/core/src/common.js +27 -30
- package/core/src/core.js +115 -73
- package/core/src/divLayer.d.ts +0 -26
- package/core/src/divLayer.js +22 -276
- package/core/src/healps/changeData.js +45 -22
- package/core/src/middles/arrows/index.d.ts +4 -0
- package/core/src/middles/arrows/index.js +5 -0
- package/core/src/middles/default.d.ts +1 -3
- package/core/src/middles/default.js +51 -51
- package/core/src/middles/index.js +3 -2
- package/core/src/middles/lines/index.d.ts +4 -0
- package/core/src/middles/lines/index.js +5 -0
- package/core/src/middles/nodes/iframe.d.ts +2 -0
- package/core/src/middles/nodes/iframe.js +12 -0
- package/core/src/middles/nodes/index.d.ts +46 -0
- package/core/src/middles/nodes/index.js +47 -0
- package/core/src/middles/nodes/pentagon.rect.js +1 -1
- package/core/src/middles/nodes/rectangle.rect.js +1 -1
- package/core/src/models/node.d.ts +6 -0
- package/core/src/models/node.js +16 -6
- package/core/src/preview.js +14 -0
- package/core/src/store/data.js +2 -0
- package/core/src/utils/dom.d.ts +2 -0
- package/core/src/utils/dom.js +81 -47
- package/package.json +1 -1
- package/static/echartsDefaultData.js +239 -95
- package/static/echartsStore.js +14 -0
- package/static/index.js +2 -1
- package/style/index.css +3 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
// 绘制柱子切面
|
2
|
+
export function drawGraphicShape(appearance) {
|
3
|
+
const offsetX = appearance.offsetX;
|
4
|
+
const offsetY = appearance.offsetY;
|
5
|
+
// 绘制左侧面
|
6
|
+
const CubeLeft = echarts.graphic.extendShape({
|
7
|
+
shape: {
|
8
|
+
x: 0,
|
9
|
+
y: 0,
|
10
|
+
},
|
11
|
+
buildPath: function (ctx, shape) {
|
12
|
+
// 会canvas的应该都能看得懂,shape是从custom传入的
|
13
|
+
const xAxisPoint = shape.xAxisPoint;
|
14
|
+
// console.log(shape);
|
15
|
+
const c0 = [shape.x, shape.y];
|
16
|
+
const c1 = [shape.x - offsetX, shape.y - offsetY];
|
17
|
+
const c2 = [xAxisPoint[0] - offsetX, xAxisPoint[1] - offsetY];
|
18
|
+
const c3 = [xAxisPoint[0], xAxisPoint[1]];
|
19
|
+
ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath();
|
20
|
+
},
|
21
|
+
});
|
22
|
+
// 绘制右侧面
|
23
|
+
const CubeRight = echarts.graphic.extendShape({
|
24
|
+
shape: {
|
25
|
+
x: 0,
|
26
|
+
y: 0,
|
27
|
+
},
|
28
|
+
buildPath: function (ctx, shape) {
|
29
|
+
const xAxisPoint = shape.xAxisPoint;
|
30
|
+
const c1 = [shape.x, shape.y];
|
31
|
+
const c2 = [xAxisPoint[0], xAxisPoint[1]];
|
32
|
+
const c3 = [xAxisPoint[0] + offsetX, xAxisPoint[1] - offsetY];
|
33
|
+
const c4 = [shape.x + offsetX, shape.y - offsetY];
|
34
|
+
ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
|
35
|
+
},
|
36
|
+
});
|
37
|
+
// 绘制顶面
|
38
|
+
const CubeTop = echarts.graphic.extendShape({
|
39
|
+
shape: {
|
40
|
+
x: 0,
|
41
|
+
y: 0,
|
42
|
+
},
|
43
|
+
buildPath: function (ctx, shape) {
|
44
|
+
const c1 = [shape.x, shape.y];
|
45
|
+
const c2 = [shape.x + offsetX, shape.y - offsetY]; //右点
|
46
|
+
const c3 = [shape.x, shape.y - offsetX];
|
47
|
+
const c4 = [shape.x - offsetX, shape.y - offsetY];
|
48
|
+
ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath();
|
49
|
+
},
|
50
|
+
});
|
51
|
+
return {
|
52
|
+
CubeLeft,
|
53
|
+
CubeRight,
|
54
|
+
CubeTop
|
55
|
+
}
|
56
|
+
}
|
57
|
+
// 线性渐变
|
58
|
+
export function graphicLinearGradient(nr, nb, nl, nt, colors) {
|
59
|
+
return new echarts.graphic.LinearGradient(nr, nb, nl, nt, colors);
|
60
|
+
}
|
61
|
+
export function setSeriesRenderGroup(appearance, api) {
|
62
|
+
const seriesRenderData = [];
|
63
|
+
const groupTypeData = ['CubeLeft', 'CubeRight', 'CubeTop'];
|
64
|
+
const location = api.coord([api.value(0), api.value(1)]);
|
65
|
+
for (let i = 0; i < groupTypeData.length; i++) {
|
66
|
+
const groupItem = groupTypeData[i];
|
67
|
+
const groupNode = {
|
68
|
+
type: groupItem,
|
69
|
+
shape: {
|
70
|
+
api,
|
71
|
+
xValue: api.value(0),
|
72
|
+
yValue: api.value(1),
|
73
|
+
x: location[0],
|
74
|
+
y: location[1],
|
75
|
+
xAxisPoint: api.coord([api.value(0), 0]),
|
76
|
+
}
|
77
|
+
};
|
78
|
+
if(i === groupTypeData.length - 1){
|
79
|
+
// 顶部切面颜色填充
|
80
|
+
groupNode.style = {
|
81
|
+
fill: appearance.seriesCubeTopColor
|
82
|
+
}
|
83
|
+
}else {
|
84
|
+
// 左右切面颜色填充
|
85
|
+
let fillColor = graphicLinearGradient(0, 0, 0, 1, appearance[`series${groupItem}Gradient`]);
|
86
|
+
const cubeColorLinear = appearance[`series${groupItem}Linear`];
|
87
|
+
if(!cubeColorLinear) {
|
88
|
+
fillColor = appearance[`series${groupItem}Color`];
|
89
|
+
}
|
90
|
+
groupNode.style = {
|
91
|
+
fill: fillColor
|
92
|
+
}
|
93
|
+
}
|
94
|
+
seriesRenderData.push(groupNode);
|
95
|
+
}
|
96
|
+
return seriesRenderData;
|
97
|
+
}
|
package/core/src/common.js
CHANGED
@@ -10,7 +10,7 @@ import { useStore, clearStore } from './store'
|
|
10
10
|
import {POLL} from './poll';
|
11
11
|
import axios from 'axios';
|
12
12
|
import * as mqtt from './mqtt.min';
|
13
|
-
import {
|
13
|
+
import { destroyEcharts } from "../../static";
|
14
14
|
|
15
15
|
var MoveInType;
|
16
16
|
(function (MoveInType) {
|
@@ -52,10 +52,10 @@ var Common = /** @class */ (function () {
|
|
52
52
|
this.store.options.interval = 50;
|
53
53
|
//Store.set(this.generateStoreKey('topology-data'), this.data);
|
54
54
|
var id = this.id;
|
55
|
-
this.animateLayer = new AnimateLayer(id);
|
56
|
-
this.offscreen = new Offscreen(id);
|
55
|
+
this.animateLayer = new AnimateLayer(id);
|
56
|
+
this.offscreen = new Offscreen(id);
|
57
57
|
this.canvas = new RenderLayer(id);
|
58
|
-
this.divLayer = new DivLayer(id);
|
58
|
+
this.divLayer = new DivLayer(id);
|
59
59
|
this.divLayer.canvas.tabIndex = 0;
|
60
60
|
this.divLayer.canvas.ondblclick = this.ondblclick;
|
61
61
|
this.divLayer.canvas.onblur = function () {
|
@@ -185,11 +185,11 @@ var Common = /** @class */ (function () {
|
|
185
185
|
}
|
186
186
|
Object.assign(this.store.data, data);
|
187
187
|
this.store.data.pens = [];
|
188
|
-
this.setBKImageRect();
|
189
188
|
this.openCount = 0
|
190
189
|
// for old data.
|
191
190
|
if (data.nodes) {
|
192
191
|
for (var _i = 0, _a = data.nodes; _i < _a.length; _i++) {
|
192
|
+
_a[_i].TID = this.id;
|
193
193
|
const item = new Node(_a[_i]);
|
194
194
|
this.store.data.pens.push(item);
|
195
195
|
this.store.pens[item.id] = item;
|
@@ -200,6 +200,7 @@ var Common = /** @class */ (function () {
|
|
200
200
|
}
|
201
201
|
}
|
202
202
|
for (var _b = 0, _c = data.lines; _b < _c.length; _b++) {
|
203
|
+
_c[_b].TID = this.id;
|
203
204
|
const item = new Line(_c[_b]);
|
204
205
|
this.store.data.pens.push(item);
|
205
206
|
this.store.pens[item.id] = item;
|
@@ -209,6 +210,7 @@ var Common = /** @class */ (function () {
|
|
209
210
|
if (data.pens) {
|
210
211
|
for (var _d = 0, _e = data.pens; _d < _e.length; _d++) {
|
211
212
|
const item = _e[_d];
|
213
|
+
item.TID = this.id;
|
212
214
|
if (!item.from) {
|
213
215
|
const node = new Node(item);
|
214
216
|
this.store.data.pens.push(node);
|
@@ -233,18 +235,6 @@ var Common = /** @class */ (function () {
|
|
233
235
|
this.store.parentElem.scrollLeft = 0;
|
234
236
|
this.store.parentElem.scrollTop = 0;
|
235
237
|
};
|
236
|
-
Common.prototype.setBKImageRect = function () {
|
237
|
-
if (this.store.data.bkImageRect) {
|
238
|
-
this.store.data.bkImageRect.x = this.store.data.bkImageRect.x ? Number(this.store.data.bkImageRect.x) : 0;
|
239
|
-
this.store.data.bkImageRect.y = this.store.data.bkImageRect.y ? Number(this.store.data.bkImageRect.y) : 0;
|
240
|
-
this.store.data.bkImageRect.width = this.store.data.bkImageRect.width ? Number(this.store.data.bkImageRect.width) : this.canvas.width;
|
241
|
-
this.store.data.bkImageRect.height = this.store.data.bkImageRect.height ? Number(this.store.data.bkImageRect.height) : this.canvas.height;
|
242
|
-
this.store.data.bkImageRect.center = {
|
243
|
-
x: this.store.data.bkImageRect.x + this.store.data.bkImageRect.width / 2,
|
244
|
-
y: this.store.data.bkImageRect.y + this.store.data.bkImageRect.height / 2
|
245
|
-
}
|
246
|
-
}
|
247
|
-
};
|
248
238
|
Common.prototype.setSwitchTabData = function (node, index, type) {
|
249
239
|
if (type) {
|
250
240
|
let topologyChangeData = Store.get('TCD:topologyChangeData');
|
@@ -278,12 +268,12 @@ var Common = /** @class */ (function () {
|
|
278
268
|
};
|
279
269
|
Common.prototype.canvasResize = function (size) {
|
280
270
|
try {
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
271
|
+
this.canvas.resize(size);
|
272
|
+
//this.canvas.bkImgRectResize(size);
|
273
|
+
this.offscreen.resize(size);
|
274
|
+
this.divLayer.resize(size);
|
285
275
|
}catch (err) {
|
286
|
-
|
276
|
+
//console.log('resize-----', err)
|
287
277
|
}
|
288
278
|
};
|
289
279
|
// Render or redraw
|
@@ -887,7 +877,7 @@ var Common = /** @class */ (function () {
|
|
887
877
|
let path = '';
|
888
878
|
let assetData = null;
|
889
879
|
let pathRewrite = this.pathRewrite;
|
890
|
-
let canvasData =
|
880
|
+
let canvasData = this.store.data;
|
891
881
|
let mqttTopics = this.store.data.mqttTopics;
|
892
882
|
let tagParamsData = tagParams;
|
893
883
|
let detailJson = null;
|
@@ -963,6 +953,7 @@ var Common = /** @class */ (function () {
|
|
963
953
|
// console.log('收到消息', syncData)
|
964
954
|
Store.set('mqtt:responseData', syncData);
|
965
955
|
data.pens.map((item) => {
|
956
|
+
item.TID = this.id;
|
966
957
|
if (item.children && item.children.length) {
|
967
958
|
item.children.map((_item) => {
|
968
959
|
item.defaultFillStyle = item.fillStyle;
|
@@ -991,9 +982,12 @@ var Common = /** @class */ (function () {
|
|
991
982
|
}
|
992
983
|
})
|
993
984
|
//console.log('定制函数=====')
|
994
|
-
|
995
|
-
|
996
|
-
|
985
|
+
try {
|
986
|
+
const func = new Function('pen', 'params', dataValue.value)
|
987
|
+
func(_item, JSON.stringify(retData))
|
988
|
+
}catch (e) {
|
989
|
+
console.log(`自定义函数 ${item.id} 出错>>>`, e);
|
990
|
+
}
|
997
991
|
} else {
|
998
992
|
// console.log('默认函数')
|
999
993
|
setConfItemNode(_item, syncData);
|
@@ -1026,10 +1020,12 @@ var Common = /** @class */ (function () {
|
|
1026
1020
|
}
|
1027
1021
|
}
|
1028
1022
|
});
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1023
|
+
try {
|
1024
|
+
const func = new Function('pen', 'params', dataValue.value);
|
1025
|
+
func(item, JSON.stringify(retData));
|
1026
|
+
}catch (e) {
|
1027
|
+
console.log(`自定义函数 ${item.id} 出错>>>`, e);
|
1028
|
+
}
|
1033
1029
|
} else {
|
1034
1030
|
// console.log('默认函数')
|
1035
1031
|
setConfItemNode(item, syncData);
|
@@ -1264,6 +1260,7 @@ var Common = /** @class */ (function () {
|
|
1264
1260
|
this.offscreen.destroy();
|
1265
1261
|
this.offscreen = null;
|
1266
1262
|
this.store.parentElem = null;
|
1263
|
+
destroyEcharts();
|
1267
1264
|
Store.set('form:tableData', null);
|
1268
1265
|
Store.set('TIMEOUT:currentPage', `empty${this.s8()}`);
|
1269
1266
|
Store.set('FORM:tableData', {
|
package/core/src/core.js
CHANGED
@@ -47,6 +47,7 @@ var Topology = (function (_super) {
|
|
47
47
|
close: false, //闭合
|
48
48
|
};
|
49
49
|
_this.onMouseMove = function (e) {
|
50
|
+
_this.store.data.dataResize = 0;
|
50
51
|
if (Store.get('addingArbitraryGraph')) {
|
51
52
|
return
|
52
53
|
}
|
@@ -339,6 +340,7 @@ var Topology = (function (_super) {
|
|
339
340
|
});
|
340
341
|
};
|
341
342
|
_this.onmousedown = function (e) {
|
343
|
+
_this.store.data.dataResize = 0;
|
342
344
|
if (e.button !== 0)
|
343
345
|
return;
|
344
346
|
var canvasPos = _this.divLayer.canvas.getBoundingClientRect();
|
@@ -675,34 +677,38 @@ var Topology = (function (_super) {
|
|
675
677
|
return;
|
676
678
|
var obj = JSON.parse(json);
|
677
679
|
event.preventDefault();
|
678
|
-
if
|
679
|
-
|
680
|
-
|
681
|
-
_this.
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
}
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
680
|
+
if(obj.type && obj.type === 'temp') {
|
681
|
+
obj.locked = 0;
|
682
|
+
// 模板
|
683
|
+
_this.animateLayer.stop();
|
684
|
+
_this.closeMqtt();
|
685
|
+
_this.open(obj);
|
686
|
+
const tempData = {
|
687
|
+
name: obj.name,
|
688
|
+
component: obj.component,
|
689
|
+
image: obj.image,
|
690
|
+
useType: obj.useType,
|
691
|
+
data: JSON.parse(json)
|
692
|
+
};
|
693
|
+
delete tempData.data['pens'];
|
694
|
+
_this.dispatch('template', tempData);
|
695
|
+
}else {
|
696
|
+
if (obj.name && obj.name == 'arbitraryGraph') {
|
697
|
+
Store.set('addingArbitraryGraph', true);
|
698
|
+
_this.addingArbitraryGraph = true;
|
699
|
+
_this.dispatch('addingArbitraryGraph', true);
|
700
|
+
return
|
701
|
+
}
|
702
|
+
_this.addingArbitraryGraph = false;
|
703
|
+
Store.set('addingArbitraryGraph', false);
|
704
|
+
_this.arbitrarygGraphData = {
|
705
|
+
points: [],
|
706
|
+
circles: [],
|
707
|
+
indexCircle: 0, //当前点击的圆圈
|
708
|
+
oZindex: -1, //是否达到起点
|
709
|
+
isDragging: false, //是否在抓取
|
710
|
+
close: false, //闭合
|
711
|
+
};
|
706
712
|
_this.dropNodes(Array.isArray(obj) ? obj : [obj], event.offsetX, event.offsetY);
|
707
713
|
}
|
708
714
|
} catch (_a) {
|
@@ -863,49 +869,16 @@ var Topology = (function (_super) {
|
|
863
869
|
}
|
864
870
|
|
865
871
|
if (json.name == 'define') {
|
866
|
-
|
867
872
|
// console.log('创建自定义组件 ', json);
|
868
|
-
|
869
873
|
console.log('store 中的 自定义 ', Store.get('defineNode'));
|
870
|
-
|
871
|
-
|
872
|
-
//
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
let renderNodesList = [];
|
877
|
-
|
878
|
-
for (let i = 0, len = nodesList.length; i < len; i++) {
|
879
|
-
|
880
|
-
nodesList[i].rect.x = offsetX - nodesList[i].rect.width / 2;
|
881
|
-
|
882
|
-
nodesList[i].rect.y = offsetY - nodesList[i].rect.height / 2;
|
883
|
-
|
884
|
-
let node = new Node(nodesList[i]);
|
885
|
-
|
886
|
-
node.setTID(s8());
|
887
|
-
node.id = s8();
|
888
|
-
node.fileId = defineNode.fileId;
|
889
|
-
|
890
|
-
// console.log('push之前的node', node);
|
891
|
-
|
892
|
-
_this.store.data.pens.push(node);
|
893
|
-
|
894
|
-
renderNodesList.push(node);
|
895
|
-
}
|
896
|
-
_this.activeLayer.setPens([renderNodesList[0]]);
|
897
|
-
|
898
|
-
_this.render(false);
|
899
|
-
|
900
|
-
_this.animate(true);
|
901
|
-
|
902
|
-
_this.cache();
|
903
|
-
|
904
|
-
_this.dispatch('addNode', renderNodesList[0]);
|
905
|
-
|
906
|
-
} else {
|
874
|
+
_this.dropDefineNode(json, offsetX, offsetY);
|
875
|
+
} else if(json.name === 'temp') {
|
876
|
+
// 温湿度元件
|
877
|
+
_this.dropTempNode(json);
|
878
|
+
}else {
|
907
879
|
var node = new Node(json);
|
908
880
|
if(node.name === 'echarts') node.dash = 4;
|
881
|
+
if(node.name === 'iframe') node.iframe = 'http://www.yingzeshiji.com.cn/'; // 默认展示盈泽世纪官网
|
909
882
|
node.setTID(_this.id);
|
910
883
|
node.clearChildrenIds();
|
911
884
|
_this.addNode(node, true);
|
@@ -922,6 +895,75 @@ var Topology = (function (_super) {
|
|
922
895
|
});
|
923
896
|
this.divLayer.canvas.focus();
|
924
897
|
};
|
898
|
+
Topology.prototype.setNodeData = function(node) {
|
899
|
+
const item = new Node(node);
|
900
|
+
item.setTID(this.id);
|
901
|
+
item.clearChildrenIds();
|
902
|
+
return item;
|
903
|
+
};
|
904
|
+
// 添加温湿度元件
|
905
|
+
Topology.prototype.dropTempNode = function(json) {
|
906
|
+
const nodeChildren = json.children;
|
907
|
+
delete json['children'];
|
908
|
+
const node = this.setNodeData(json);
|
909
|
+
const combinTempData = [];
|
910
|
+
let nodeX = node.rect.x;
|
911
|
+
let nodeY = node.rect.y;
|
912
|
+
for (let i = 0; i < nodeChildren.length; i++) {
|
913
|
+
const childNode = this.setNodeData(nodeChildren[i]);
|
914
|
+
childNode.rect.x = i === 0 ? nodeX : nodeX + childNode.rect.width / 2;
|
915
|
+
childNode.rect.y = i === 2 ? nodeY + childNode.rect.height + 1 : nodeY;
|
916
|
+
childNode.rect.center = {
|
917
|
+
x: childNode.rect.x + childNode.rect.width / 2,
|
918
|
+
y: childNode.rect.y + childNode.rect.height / 2
|
919
|
+
}
|
920
|
+
childNode.rect.ex = childNode.rect.x + childNode.rect.width;
|
921
|
+
childNode.rect.ey = childNode.rect.y + childNode.rect.height;
|
922
|
+
combinTempData.push(childNode);
|
923
|
+
}
|
924
|
+
this.combine(combinTempData, null, 'temp');
|
925
|
+
this.render();
|
926
|
+
this.cache();
|
927
|
+
};
|
928
|
+
// 添加自定义元件
|
929
|
+
Topology.prototype.dropDefineNode = function(josn, offsetX, offsetY) {
|
930
|
+
var _this = this;
|
931
|
+
if (_this.store.data.locked) return
|
932
|
+
// let defineNode = Store.get('defineNode');
|
933
|
+
// let nodesList = Store.get('defineNode').pens;
|
934
|
+
let defineNode = JSON.parse(localStorage.getItem("defineNode_"))
|
935
|
+
let nodesList = defineNode.pens;
|
936
|
+
|
937
|
+
let renderNodesList = [];
|
938
|
+
|
939
|
+
for (let i = 0, len = nodesList.length; i < len; i++) {
|
940
|
+
|
941
|
+
nodesList[i].rect.x = offsetX - nodesList[i].rect.width / 2;
|
942
|
+
|
943
|
+
nodesList[i].rect.y = offsetY - nodesList[i].rect.height / 2;
|
944
|
+
|
945
|
+
let node = new Node(nodesList[i]);
|
946
|
+
|
947
|
+
node.setTID(s8());
|
948
|
+
node.id = s8();
|
949
|
+
node.fileId = defineNode.fileId;
|
950
|
+
|
951
|
+
// console.log('push之前的node', node);
|
952
|
+
|
953
|
+
_this.store.data.pens.push(node);
|
954
|
+
|
955
|
+
renderNodesList.push(node);
|
956
|
+
}
|
957
|
+
_this.activeLayer.setPens([renderNodesList[0]]);
|
958
|
+
|
959
|
+
_this.render(false);
|
960
|
+
|
961
|
+
_this.animate(true);
|
962
|
+
|
963
|
+
_this.cache();
|
964
|
+
|
965
|
+
_this.dispatch('addNode', renderNodesList[0]);
|
966
|
+
};
|
925
967
|
Topology.prototype.addNode = function (node, focus, visit) {
|
926
968
|
if (focus === void 0) {
|
927
969
|
focus = false;
|
@@ -947,14 +989,13 @@ var Topology = (function (_super) {
|
|
947
989
|
this.store.data.pens.push(node);
|
948
990
|
this.setSwitchTabData(node, this.store.data.pens.length-1);
|
949
991
|
if (focus) {
|
992
|
+
this.render();
|
993
|
+
this.animate(true);
|
994
|
+
this.cache();
|
950
995
|
if(!visit) {
|
951
996
|
this.activeLayer.setPens([node]);
|
952
997
|
this.dispatch('addNode', node);
|
953
998
|
}
|
954
|
-
this.render();
|
955
|
-
this.animate(true);
|
956
|
-
this.cache();
|
957
|
-
this.dispatch('addNode', node);
|
958
999
|
}
|
959
1000
|
return node;
|
960
1001
|
};
|
@@ -1006,7 +1047,7 @@ var Topology = (function (_super) {
|
|
1006
1047
|
if (height < rect.height) {
|
1007
1048
|
height = rect.height;
|
1008
1049
|
}
|
1009
|
-
this.resize({width: width
|
1050
|
+
this.resize({width: width, height: height});
|
1010
1051
|
return rect;
|
1011
1052
|
}catch (e){
|
1012
1053
|
//console.log('init-error-----------',e)
|
@@ -1072,6 +1113,7 @@ var Topology = (function (_super) {
|
|
1072
1113
|
}
|
1073
1114
|
}
|
1074
1115
|
}
|
1116
|
+
this.store.data.dataResize = 1;
|
1075
1117
|
this.divLayer.canvas.style.cursor = 'default';
|
1076
1118
|
var len = this.store.data.pens.length;
|
1077
1119
|
for (var i = len - 1; i > -1; --i) {
|
@@ -1841,7 +1883,7 @@ var Topology = (function (_super) {
|
|
1841
1883
|
this.store.data.pens.splice(i + 1, 1);
|
1842
1884
|
}
|
1843
1885
|
};
|
1844
|
-
Topology.prototype.combine = function (pens, stand, temp) {
|
1886
|
+
Topology.prototype.combine = function (pens, stand, temp, rect) {
|
1845
1887
|
if (stand === void 0) {
|
1846
1888
|
stand = false;
|
1847
1889
|
}
|
package/core/src/divLayer.d.ts
CHANGED
@@ -2,28 +2,6 @@ import { Node } from './models';
|
|
2
2
|
import { Layer } from './layer';
|
3
3
|
export declare class DivLayer extends Layer {
|
4
4
|
canvas: HTMLDivElement;
|
5
|
-
player: HTMLDivElement;
|
6
|
-
curNode: Node;
|
7
|
-
playBtn: HTMLElement;
|
8
|
-
currentTime: HTMLElement;
|
9
|
-
progressCurrent: HTMLElement;
|
10
|
-
progress: HTMLElement;
|
11
|
-
loop: HTMLElement;
|
12
|
-
media: HTMLMediaElement;
|
13
|
-
videos: {
|
14
|
-
[key: string]: {
|
15
|
-
player: HTMLElement;
|
16
|
-
current: HTMLElement;
|
17
|
-
media: HTMLMediaElement;
|
18
|
-
};
|
19
|
-
};
|
20
|
-
audios: {
|
21
|
-
[key: string]: {
|
22
|
-
player: HTMLElement;
|
23
|
-
current: HTMLElement;
|
24
|
-
media: HTMLMediaElement;
|
25
|
-
};
|
26
|
-
};
|
27
5
|
iframes: {
|
28
6
|
[key: string]: HTMLIFrameElement;
|
29
7
|
};
|
@@ -37,10 +15,6 @@ export declare class DivLayer extends Layer {
|
|
37
15
|
private subcribeNode;
|
38
16
|
constructor(TID: String);
|
39
17
|
addDiv: (node: Node) => void;
|
40
|
-
createPlayer(): void;
|
41
|
-
getMediaCurrent(): void;
|
42
|
-
addMedia(node: Node, type: string): HTMLDivElement;
|
43
|
-
playNext(next: string): void;
|
44
18
|
addIframe(node: Node): HTMLIFrameElement;
|
45
19
|
addGif(node: Node): HTMLImageElement;
|
46
20
|
setElemPosition(node: Node, elem: HTMLElement): void;
|