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
@@ -4,5 +4,4 @@ export declare function setConfItemNode(item: any[], syncData: Node): Node;
4
4
  export declare function setNodeEvents(item: any[], pen: Pen): void;
5
5
  export declare function setControlData(pen: Pen, syncData: Node): void;
6
6
  export declare function getControlNode(item: any, data: any): Node;
7
- export declare function getDetailData(data: Node): void;
8
- export declare function setStatisticalData(pen: Pen, dataType: any, staticForType: string, chartData: any): Node;
7
+ export declare function getDetailData(data: Node): void;
@@ -1,13 +1,13 @@
1
1
  //let DETAILDATA = null;
2
- import { echartsDefaultDataMap } from '../../../static';
3
- import { commonStore } from '../store'
2
+ import {commonStore} from '../store';
3
+ import {echartsRealDataPool} from '../../../store';
4
+ import { getEchartsRealData } from '../utils/conversion';
4
5
  export function setConfItemNode(pen, syn_synata) {
5
- if (!pen.data) return
6
- commonStore[pen.TID].data.dataResize = 1;
6
+ if (!pen.data) return;
7
+ if(commonStore[pen.TID]) commonStore[pen.TID].data.dataResize = 1;
7
8
  if(pen.data instanceof Array) {
8
- let _syn = ''
9
- let isResetVal = false
10
- let isResetFontColor = false
9
+ let _syn = null;
10
+ let isResetVal = false;
11
11
  const {areaData, assetData, kpiData, tagData, asset} = syn_synata
12
12
  pen.data.map((d) => {
13
13
  const key = d.key;
@@ -15,7 +15,7 @@ export function setConfItemNode(pen, syn_synata) {
15
15
  const assetItem = assetData[value];
16
16
  const areaItem = areaData[value];
17
17
  const kpiItem = kpiData[value];
18
- if(key === 'tagId') value = d.tagId ? d.tagId : d.value
18
+ if(key === 'tagId') value = d.tagId ? d.tagId : d.value;
19
19
  const tagItem = tagData[value];
20
20
  //console.log('key===========', d)
21
21
  if (key === 'assetKey' && d.value === 'assetName' && asset) {
@@ -28,7 +28,7 @@ export function setConfItemNode(pen, syn_synata) {
28
28
  }else if (key === 'tagId' && tagItem) {
29
29
  _syn = tagItem;
30
30
  if(_syn.kpiName !== '通讯状态' || pen.name !== 'circle'){
31
- isResetVal = true
31
+ isResetVal = true;
32
32
  }
33
33
  const isControl = parseInt(tagItem.isControlDis); // 是否可控,0可控,1不可控
34
34
  //d.isControlDis = isControlDis
@@ -50,6 +50,7 @@ export function setConfItemNode(pen, syn_synata) {
50
50
  }
51
51
  }
52
52
  })
53
+ if(!_syn) return;
53
54
  // const type = parseInt(_syn.type) // 是否是开关量
54
55
  // 显示的值
55
56
  if (isResetVal) pen.text = `${_syn.value}${_syn.unit}`;
@@ -96,124 +97,17 @@ export function setConfItemNode(pen, syn_synata) {
96
97
  if(pen.data.echarts) {
97
98
  const { echartDataValue } = syn_synata;
98
99
  const seriesData = echartDataValue;
99
- const chartData = pen.data.params && seriesData && Object.keys(seriesData).length && seriesData[pen.data.params.id];
100
- const staticForType = pen.data.params && pen.data.params.staticForType || '';//统计类型:日,周,月,年
101
- pen.data.echarts.option = setStatisticalData(pen, null, staticForType, chartData);
100
+ const realData = pen.data.params && seriesData && Object.keys(seriesData).length && seriesData[pen.data.params.id];
101
+ if (Array.isArray(realData)) {
102
+ getEchartsRealData(pen, realData);
103
+ }else {
104
+ echartsRealDataPool[pen.id] = realData;
105
+ }
102
106
  }
103
107
  }
104
108
  return pen
105
109
  }
106
110
 
107
- /**
108
- * 设置图表数据
109
- * @param pen 拓扑节点
110
- * @param dataType 数据类型:‘def’-默认,不传默认为-实时
111
- * @param staticForType 统计类型:日,周,月,年
112
- * @param chartData // 图表实时数据
113
- * @returns {*}
114
- */
115
- export function setStatisticalData(pen, dataType, staticForType, chartData) {
116
- const node = JSON.parse(JSON.stringify(pen));
117
- const echartsOption = node.data.echarts.option;
118
- const optionDisplayMode = echartsOption.displayMode;
119
- let displayMode = 0;
120
- if(typeof optionDisplayMode === 'string') {
121
-
122
- const displayType = optionDisplayMode.split('_')[0];
123
-
124
- displayMode = parseInt(displayType);
125
-
126
- }else {
127
- displayMode = parseInt(optionDisplayMode);
128
- }
129
- const defaultData = echartsDefaultDataMap[`displayMode_${optionDisplayMode}`];
130
- const staticTypeData = chartData && chartData[`${staticForType}_Data`];
131
- const chartRealData = staticForType ? staticTypeData || defaultData : chartData || defaultData;
132
- if (displayMode === 1 || displayMode === 2){ // 折线图,柱状图
133
- //const xData = [], seriesData = [];
134
- dataType = staticForType && staticTypeData || chartData && chartData.seriesData.length ? '' : 'def';
135
- const seriesNodes = echartsOption.series;
136
- const isBaseLineBar = ['line', 'bar'].includes(node.appearance.type);
137
- // 双轴曲线
138
- if(seriesNodes.length > 1 || node.data.params && node.data.params.curveNum > 1){
139
- const legendData = [];
140
- let legendChange = false;
141
- echartsOption.xAxis[0].data = chartRealData.XData;
142
- let order = 0;
143
- //循环给每条统计数据赋值
144
- seriesNodes.map((item, index) => {
145
- let seriesItem = null;
146
- // 执行类型为恢复默认
147
- if(dataType === 'def') {
148
- let defaultSeriesItem = defaultData.seriesData[order];
149
- if(!defaultSeriesItem) defaultSeriesItem = defaultData.seriesData[0]; // 默认数据只有一个时,只取第一个
150
- seriesItem = JSON.parse(JSON.stringify(defaultSeriesItem));
151
- if(['line', 'bar'].includes(item.type)) order++; // 此判断为过滤series中的图表柱子或折线节点样式
152
- if(!isBaseLineBar) return item.data = seriesItem.data; // 曲线或柱状图模板一般会走这个逻辑
153
- if(!index) {
154
- seriesItem.name = '标注1';
155
- item.data = seriesItem.data;
156
- }else {
157
- // 自动生成series数据计算
158
- for(let i = 0, sdl = seriesItem.data.length; i < sdl; i++){
159
- displayMode === 1 ? seriesItem.data[i] -= 400 : seriesItem.data[i] += 100;
160
- }
161
- seriesItem.name = `标注${index + 1}`;
162
- item.data = seriesItem.data;
163
- }
164
- }else {
165
- // 执行类型为实时数据
166
- seriesItem = chartRealData.seriesData[index];
167
- if(!seriesItem) return item.data = [];
168
- item.data = seriesItem.data;
169
- }
170
- // 获取角标数据
171
- if(seriesItem.name) {
172
- item.name = seriesItem.name;
173
- legendData.push(seriesItem.name);
174
- legendChange = true;
175
- }
176
- });
177
- if(echartsOption.legend && legendChange) echartsOption.legend.data = legendData; // 为角标数据赋值
178
- }else {
179
- // 单曲线或柱状的执行逻辑
180
- echartsOption.xAxis[0].data = chartRealData.XData;
181
- const { name, data } = chartRealData.seriesData[0];
182
- if(name) seriesNodes[0].name = name;
183
- seriesNodes[0].data = data;
184
- }
185
- }
186
- if(displayMode === 4) { // top排行榜
187
- echartsOption.yAxis[0].data = chartRealData.XData;
188
- const { data } = chartRealData.seriesData[0];
189
- echartsOption.yAxis[1].data = data;
190
- for (let i = 0; i < echartsOption.series.length; i++) {
191
- const node = echartsOption.series[i];
192
- node.symbolBoundingData = chartRealData.total;
193
- node.data = data;
194
- }
195
- }
196
- if (displayMode === 5 || displayMode === 3){ // 饼图/环形图
197
- const colors = echartsOption.color;
198
- const pieData = staticForType ? chartData || defaultData : chartData && chartData.data || defaultData.seriesData;
199
- const seriesData = [];
200
- pieData.map((chd, index) => {
201
- seriesData.push({
202
- itemStyle: { color: colors[index] },
203
- name: chd.name,
204
- value: chd.value
205
- })
206
- })
207
- echartsOption.series[0].data = seriesData;
208
- }
209
- if(displayMode === 6){ // 仪表盘
210
- // 仪表盘分两种,分别有不同的取值方式,下面两行先注释掉
211
- // node.appearance.title.text = chartData.name;
212
- // node.data.echarts.option.title.text = chartData.name;
213
- echartsOption.series[0].data[0].value = chartData && chartData.value || defaultData.value;
214
- }
215
- return echartsOption;
216
- }
217
111
  export function setNodeEvents(item, pen) {
218
112
 
219
113
  }
@@ -5,7 +5,7 @@ import {
5
5
  twowayArrow, twowayArrowIconRect, twowayArrowTextRect,
6
6
  rectangle, rectangleIconRect, rectangleTextRect,
7
7
  diamond, diamondIconRect, diamondTextRect,
8
- text, file, formtable, tablePagination, iframePrimeval,
8
+ text, file, formtable, tablePagination, iframePrimeval,formSelect,
9
9
  line as nodeLine, lineAnchors, lineIconRect, lineTextRect,
10
10
  circle, circleIconRect, circleTextRect, circleAnchors,
11
11
  triangle, triangleIconRect, triangleTextRect, triangleAnchors,
@@ -62,6 +62,8 @@ export var drawArrowFns = {};
62
62
  function init() {
63
63
  console.log('Init middles.');
64
64
  // ********Default nodes.*******
65
+ // select
66
+ drawNodeFns.select = formSelect;
65
67
  // iframe
66
68
  drawNodeFns.iframe = iframePrimeval;
67
69
  // tablePagination
@@ -1,17 +1,19 @@
1
1
  export function arbitraryGraph(ctx, node) {
2
2
 
3
- ctx.beginPath();
3
+ ctx.beginPath();
4
4
 
5
- ctx.lineWidth = 1;
5
+ ctx.lineWidth = 1;
6
6
 
7
- for(let i=0,len=node.rect.circles.length; i<len; i++) {
7
+ ctx.moveTo(node.rect.circles[0].x, node.rect.circles[0].y);
8
8
 
9
- ctx.lineTo(node.rect.circles[i].x, node.rect.circles[i].y)
10
- }
9
+ for(let i=1,len=node.rect.circles.length; i<len; i++) {
11
10
 
12
- ctx.closePath();
11
+ ctx.lineTo(node.rect.circles[i].x, node.rect.circles[i].y);
12
+ }
13
13
 
14
- (node.fillStyle || node.bkType) && ctx.fill();
15
-
16
- ctx.stroke();
14
+ ctx.closePath();
15
+
16
+ (node.fillStyle || node.bkType) && ctx.fill();
17
+
18
+ ctx.stroke();
17
19
  }
@@ -0,0 +1,2 @@
1
+ import { Node } from '../../models';
2
+ export declare function formSelect(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -0,0 +1,73 @@
1
+ import {rectangle} from './rectangle';
2
+ import {
3
+ createSelectElement,
4
+ createSelectDropdown} from '../../element';
5
+ import {
6
+ setEventListener,
7
+ s8} from '../../utils';
8
+ import {echartsDataPool, selectDataPool, selectRealDataPool} from '../../../../store';
9
+ import {selectDefaultData} from '../../../../static';
10
+
11
+ export function formSelect(ctx, node) {
12
+ // 绘制一个底图,类似于占位符。
13
+ rectangle(ctx, node);
14
+ if (!selectDataPool[node.id]) {
15
+ node.elementId = s8();
16
+ node.dash = 4;
17
+ selectDataPool[node.id] = {
18
+ slideState: node.selectDropdown,
19
+ node: {
20
+ id: node.id,
21
+ color: node.font.color,
22
+ fontSize: node.font.fontSize,
23
+ selected: null
24
+ },
25
+ dom: {}
26
+ };
27
+ const bindBlockId = node.formData && node.formData.bindBlockId;
28
+ let selectRealData = bindBlockId && selectRealDataPool[bindBlockId];
29
+ if(bindBlockId && selectRealData) {
30
+ // select与echarts互相关联
31
+ selectDataPool[node.id].data = selectRealData;
32
+ const echartsData = echartsDataPool[bindBlockId];
33
+ if(echartsData){
34
+ echartsData.bindId = node.id;
35
+ }else {
36
+ echartsDataPool[bindBlockId] = {
37
+ bindId: node.id
38
+ }
39
+ }
40
+ }else {
41
+ selectDataPool[node.id].data = JSON.parse(JSON.stringify(selectDefaultData));
42
+ }
43
+ const select = createSelectElement(node);
44
+ selectDataPool[node.id].dom.selectEle = select;
45
+ document.body.appendChild(select);
46
+ let selectDropdownEle = document.querySelector('.topology-select-dropdown');
47
+ if(!selectDropdownEle) {
48
+ selectDropdownEle = createSelectDropdown(node);
49
+ const parentEle = window.location.pathname.includes('workspace') ? document.getElementById('topology-canvas') : document.body;
50
+ parentEle.appendChild(selectDropdownEle);
51
+ // 鼠标按下
52
+ selectDropdownEle.addEventListener('mousedown', (e) => {
53
+ setEventListener(e);
54
+ });
55
+ }
56
+ // 添加当前节点到div层
57
+ node.addToDiv();
58
+ }else {
59
+ const selectNode = selectDataPool[node.id];
60
+ if(selectNode.node.color === node.font.color && selectNode.node.fontSize === node.font.fontSize) return;
61
+ const selectDom = selectNode.dom;
62
+ if(!selectDom.selectInput) selectDom.selectInput = selectDom.selectEle.querySelector('.topology-select-input');
63
+ selectDom.selectInput.style.color = node.font.color;
64
+ selectDom.selectInput.style.fontSize = `${node.font.fontSize}px`;
65
+ if(node.selectDropdown) {
66
+ const liEle = selectDom.selectDropdownUl.querySelectorAll('.topology-select-dropdown-item');
67
+ liEle.forEach(function(element) {
68
+ element.style.color = node.font.color;
69
+ element.style.fontSize = `${node.font.fontSize}px`;
70
+ });
71
+ }
72
+ }
73
+ }
@@ -1,12 +1,29 @@
1
- import {rectangle} from 'dcim-topology2d/core'
1
+ import {rectangle} from './rectangle';
2
+ import {iframeDataPool} from '../../../../store';
3
+ import {s8} from "../../utils";
4
+ import {createIframeElement} from "../../element";
2
5
 
3
6
  export function iframePrimeval(ctx, node) {
4
7
  //console.log('iframePrimeval############', node)
5
8
  // 绘制一个底图,类似于占位符。
6
9
  rectangle(ctx, node);
7
- if (!node.elementLoaded) {
10
+ if (!iframeDataPool[node.id]) {
11
+ node.elementId = s8();
12
+ iframeDataPool[node.id] = {
13
+ node: {
14
+ id: node.id,
15
+ src: node.iframe
16
+ }
17
+ };
18
+ const iframe = createIframeElement(node);
19
+ iframeDataPool[node.id].iframe = iframe;
20
+ const parentEle = window.location.pathname.includes('workspace') ? document.getElementById('topology-canvas') : document.body;
21
+ parentEle.appendChild(iframe);
8
22
  // 添加当前节点到div层
9
- node.addToDiv('init')
10
- node.elementRendered = false
23
+ node.addToDiv();
24
+ }else {
25
+ const iframeNode = iframeDataPool[node.id];
26
+ if(iframeNode.node.src === node.iframe) return;
27
+ iframeNode.iframe.src = node.iframe;
11
28
  }
12
29
  }
@@ -17,6 +17,7 @@ export * from './diamond';
17
17
  export * from './diamond.rect';
18
18
  export * from './file';
19
19
  export * from './formtable';
20
+ export * from './formselect';
20
21
  export * from './hexagon';
21
22
  export * from './hexagon.anchor';
22
23
  export * from './hexagon.rect';
@@ -17,6 +17,7 @@ export * from './diamond';
17
17
  export * from './diamond.rect';
18
18
  export * from './file';
19
19
  export * from './formtable';
20
+ export * from './formselect';
20
21
  export * from './hexagon';
21
22
  export * from './hexagon.anchor';
22
23
  export * from './hexagon.rect';
@@ -58,6 +58,10 @@ export declare class Node extends Pen {
58
58
  linear: boolean;
59
59
  state: Node;
60
60
  }[];
61
+ formData: {
62
+ bindBlockId: string;
63
+ theme: number;
64
+ };
61
65
  animateAlone: boolean;
62
66
  gif: boolean;
63
67
  video: string;
@@ -20,7 +20,7 @@ import { defaultAnchors } from '../middles/default.anchor';
20
20
  import { defaultIconRect, defaultTextRect } from '../middles/default.rect';
21
21
  import { text, tableText, defaultText, iconfont } from '../middles/nodes/text';
22
22
  import { Store } from 'le5le-store';
23
- import { abs, s8, animateType, createChildrenDivByElementId } from '../utils';
23
+ import { abs, s8, animateType } from '../utils';
24
24
  export const images = {};
25
25
  export const defaultImages = {};
26
26
  var Node = /** @class */ (function (_super) {
@@ -37,8 +37,10 @@ var Node = /** @class */ (function (_super) {
37
37
  _this.animateFrames = [];
38
38
  _this.type = PenType.Node;
39
39
  _this.TID = json.TID;
40
+ _this.selectDropdown = json.selectDropdown || false;
40
41
  _this.is3D = json.is3D;
41
42
  _this.z = json.z;
43
+ _this.order = json.order;
42
44
  _this.zRotate = json.zRotate || 0;
43
45
  _this.borderRadius = +json.borderRadius || 0;
44
46
  _this.icon = json.icon;
@@ -81,7 +83,7 @@ var Node = /** @class */ (function (_super) {
81
83
  _this.leakageEnd = json.leakageEnd || 0;
82
84
  _this.leakageFillStyle = json.leakageFillStyle || '#ff0000';
83
85
  _this.bindStaticId = json.bindStaticId || '';
84
- _this.buttonCheckSlide = json.buttonCheckSlide || '';
86
+ //_this.buttonCheckSlide = json.buttonCheckSlide || '';
85
87
  _this.visitStrokeStyle = json.visitStrokeStyle || '';
86
88
  _this.thBottomStrokeStyle = json.thBottomStrokeStyle || '#fff';
87
89
  _this.thBottomLineWidth = json.thBottomLineWidth || 1;
@@ -235,17 +237,11 @@ var Node = /** @class */ (function (_super) {
235
237
  data: tableData
236
238
  })
237
239
  };
238
- Node.prototype.addToDiv = function (type) {
240
+ Node.prototype.addToDiv = function () {
239
241
  if (this.iframe ||
240
242
  this.elementId ||
241
243
  this.hasGif()) {
242
244
  Store.set(this.generateStoreKey('LT:addDiv'), this);
243
- // if(type || this.iframe) {
244
- // // 复合Echarts初始化
245
- // createChildrenDivByElementId(this);
246
- // }else {
247
- // Store.set(this.generateStoreKey('LT:addDiv'), this);
248
- // }
249
245
  }
250
246
  };
251
247
  Node.prototype.hasGif = function () {
@@ -275,6 +271,7 @@ var Node = /** @class */ (function (_super) {
275
271
  this.children = [];
276
272
  for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
277
273
  var item = children_1[_i];
274
+ item.visible = this.visible;
278
275
  var child = void 0;
279
276
  switch (item.type) {
280
277
  case PenType.Line:
@@ -620,8 +617,8 @@ var Node = /** @class */ (function (_super) {
620
617
  this.dash = item.state.dash;
621
618
  this.strokeStyle = item.state.strokeStyle;
622
619
  this.fillStyle = item.state.fillStyle;
623
- this.text = item.state.text;
624
- this.font = item.state.font;
620
+ //this.text = item.state.text;
621
+ //this.font = item.state.font;
625
622
  this.lineWidth = item.state.lineWidth;
626
623
  this.rotate = item.state.rotate;
627
624
  this.globalAlpha = item.state.globalAlpha;
@@ -647,8 +644,8 @@ var Node = /** @class */ (function (_super) {
647
644
  this.dash = item.state.dash;
648
645
  this.strokeStyle = item.state.strokeStyle;
649
646
  this.fillStyle = item.state.fillStyle;
650
- this.text = item.state.text;
651
- this.font = item.state.font;
647
+ //this.text = item.state.text;
648
+ //this.font = item.state.font;
652
649
  var rate = (timeline - item.start) / item.duration;
653
650
  if (item.linear) {
654
651
  // 线条左右流动动画
@@ -745,21 +742,20 @@ var Node = /** @class */ (function (_super) {
745
742
  this['oldRect'] = this.rect.clone();
746
743
  if(this.rect.circles) {
747
744
  for(let c=0, circles= this.rect.circles; c<circles.length; c++) {
748
- circles[c].x = (center.x - (center.x - circles[c].x)) * w;
749
- circles[c].y = (center.y - (center.y - circles[c].y)) * h + 15;
745
+ circles[c].x = center.x - (center.x - circles[c].x) * w;
746
+ circles[c].y = center.y - (center.y - circles[c].y) * h;
750
747
  }
751
- }else {
752
- this.rect.x = center.x - (center.x - this.rect.x) * w;
753
- if(this.rotate % 180) {
754
- this.rect.x = this.rect.x + (this.rect.width * w - this.rect.width * h) / 2;
755
- }
756
- this.rect.y = center.y - (center.y - this.rect.y) * h;
757
748
  }
758
- this.z *= scale;
749
+ this.rect.x = center.x - (center.x - this.rect.x) * w;
750
+ if(this.rotate % 180) {
751
+ this.rect.x = this.rect.x + (this.rect.width * w - this.rect.width * h) / 2;
752
+ }
753
+ this.rect.y = center.y - (center.y - this.rect.y) * h;
759
754
  this.rect.width *= this.rotate % 180 ? h : w;
760
755
  this.rect.height *= h;
761
756
  this.rect.ex = this.rect.x + this.rect.width;
762
757
  this.rect.ey = this.rect.y + this.rect.height;
758
+ this.z *= scale;
763
759
  if(!(center.type && center.type === 'bottLogo')) {
764
760
  if (this.imageWidth) {
765
761
  this.imageWidth *= w;
@@ -864,6 +860,12 @@ var Node = /** @class */ (function (_super) {
864
860
  }
865
861
  };
866
862
  Node.prototype.translate = function (x, y) {
863
+ if(this.rect.circles) {
864
+ for(let c=0, circles= this.rect.circles; c<circles.length; c++) {
865
+ circles[c].x += x;
866
+ circles[c].y += y;
867
+ }
868
+ }
867
869
  this.rect.x += x;
868
870
  this.rect.y += y;
869
871
  this.rect.ex = this.rect.x + this.rect.width;
@@ -24,7 +24,7 @@ var Pen = /** @class */ (function () {
24
24
  this.font = {
25
25
  color: '',
26
26
  fontFamily: '"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial',
27
- fontSize: 12,
27
+ fontSize: json.name === 'select' ? 14 : 12,
28
28
  lineHeight: 1.5,
29
29
  fontStyle: 'normal',
30
30
  fontWeight: 'normal',
@@ -261,7 +261,6 @@ var Pen = /** @class */ (function () {
261
261
  }catch (error) { }
262
262
  }
263
263
  console.log('doSocketMqtt-------------', jsonNode)
264
- Store.set('mqtt:responseData', jsonNode)
265
264
  //const { areaData, assetData, data } = jsonNode
266
265
  if (!this.data && this.data.length <= 0 && typeof this.data !== 'object') return
267
266
  // const subscribeObj = {
@@ -8,10 +8,10 @@ var Rect = /** @class */ (function () {
8
8
  this.height = height;
9
9
  this.center = new Point(0, 0);
10
10
  if (width < 0) {
11
- width = 0;
11
+ this.width = 0;
12
12
  }
13
13
  if (height < 0) {
14
- height = 0;
14
+ this.height = 0;
15
15
  }
16
16
  this.init();
17
17
  }
@@ -11,6 +11,7 @@ export declare enum KeydownType {
11
11
  Canvas = 1
12
12
  }
13
13
  export interface Options {
14
+ type?: string;
14
15
  cacheLen?: number;
15
16
  extDpiRatio?: number;
16
17
  width?: string | number;