dcim-topology2d 2.1.0 → 2.2.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 (63) hide show
  1. package/chart-diagram/index.d.ts +1 -1
  2. package/chart-diagram/index.js +1 -1
  3. package/chart-diagram/src/echarts/index.js +112 -109
  4. package/chart-diagram/src/utils/changeOptions.d.ts +8 -8
  5. package/chart-diagram/src/utils/changeOptions.js +8 -2
  6. package/chart-diagram/src/utils/conversion.d.ts +19 -19
  7. package/chart-diagram/src/utils/conversion.js +601 -559
  8. package/chart-diagram/src/utils/drawGraphic.d.ts +3 -3
  9. package/chart-diagram/src/utils/drawGraphic.js +97 -97
  10. package/chart-diagram/src/utils/index.d.ts +5 -5
  11. package/chart-diagram/src/utils/index.js +5 -5
  12. package/chart-diagram/src/utils/render.js +4 -0
  13. package/core/index.js +1 -19
  14. package/core/src/activeLayer.js +23 -23
  15. package/core/src/calling.js +32 -33
  16. package/core/src/common.d.ts +1 -0
  17. package/core/src/common.js +115 -83
  18. package/core/src/core.js +15 -1
  19. package/core/src/element/common.js +12 -4
  20. package/core/src/element/datePicker.js +13 -16
  21. package/core/src/element/select.d.ts +1 -1
  22. package/core/src/element/select.js +1 -3
  23. package/core/src/element/tab.js +3 -8
  24. package/core/src/healps/changeData.js +64 -41
  25. package/core/src/middles/default.js +49 -43
  26. package/core/src/middles/index.d.ts +1 -2
  27. package/core/src/middles/index.js +3 -2
  28. package/core/src/middles/nodes/formDatePicker.js +54 -12
  29. package/core/src/middles/nodes/formoverflow.js +17 -16
  30. package/core/src/middles/nodes/formselect.js +14 -5
  31. package/core/src/middles/nodes/index.d.ts +3 -1
  32. package/core/src/middles/nodes/index.js +2 -0
  33. package/core/src/middles/nodes/progress.d.ts +2 -0
  34. package/core/src/middles/nodes/progress.js +63 -0
  35. package/core/src/middles/nodes/progress.js.map +1 -0
  36. package/core/src/middles/nodes/rectangle.js +54 -15
  37. package/core/src/middles/nodes/switchs.d.ts +2 -0
  38. package/core/src/middles/nodes/switchs.js +46 -0
  39. package/core/src/models/line.js +7 -7
  40. package/core/src/models/node.js +90 -81
  41. package/core/src/models/pen.js +21 -12
  42. package/core/src/offscreen.js +19 -19
  43. package/core/src/preview.js +75 -40
  44. package/core/src/store/data.d.ts +11 -0
  45. package/core/src/store/data.js +11 -0
  46. package/core/src/utils/assignment.d.ts +1 -1
  47. package/core/src/utils/assignment.js +50 -6
  48. package/core/src/utils/construction.d.ts +24 -0
  49. package/core/src/utils/construction.js +22 -1
  50. package/core/src/utils/conversion.d.ts +2 -0
  51. package/core/src/utils/conversion.js +109 -0
  52. package/core/src/utils/math.d.ts +0 -1
  53. package/core/src/utils/math.js +0 -3
  54. package/core/src/utils/onmousevent.js +1 -1
  55. package/core/src/utils/params.d.ts +1 -0
  56. package/core/src/utils/params.js +75 -4
  57. package/package.json +1 -1
  58. package/static/echartsDefaultData.js +178 -178
  59. package/store/actions.js +2 -1
  60. package/store/clear.js +4 -0
  61. package/store/default.js +22 -0
  62. package/store/index.js +2 -1
  63. /package/myShape-diagram/{index.ts → index.d.ts} +0 -0
@@ -1,23 +1,62 @@
1
1
  export function rectangle(ctx, node) {
2
- var wr = node.borderRadius;
3
- var hr = node.borderRadius;
4
- if (node.borderRadius < 1) {
5
- wr = node.rect.width * node.borderRadius;
6
- hr = node.rect.height * node.borderRadius;
2
+
3
+ var topLeftR = node.borderRadiusTopLeft;
4
+ var topRightR = node.borderRadiusTopRight;
5
+ var bottomLeftR = node.borderRadiusBottomLeft;
6
+ var bottomRightR = node.borderRadiusBottomRight;
7
+
8
+
9
+ var w = node.rect.width > node.rect.height ? node.rect.height : node.rect.width;
10
+
11
+
12
+ if (node.borderRadiusTopLeft < 1) {
13
+
14
+ topLeftR = w * node.borderRadiusTopLeft;
15
+
7
16
  }
8
- var r = wr < hr ? wr : hr;
9
- if (node.rect.width < 2 * r) {
10
- r = node.rect.width / 2;
17
+ if (node.borderRadiusTopRight < 1) {
18
+
19
+ topRightR = w * node.borderRadiusTopRight;
20
+
11
21
  }
12
- if (node.rect.height < 2 * r) {
13
- r = node.rect.height / 2;
22
+ if (node.borderRadiusBottomLeft < 1) {
23
+
24
+ bottomLeftR = w * node.borderRadiusBottomLeft;
25
+
14
26
  }
27
+ if (node.borderRadiusBottomRight < 1) {
28
+
29
+ bottomRightR = w * node.borderRadiusBottomRight;
30
+
31
+ }
32
+
33
+ var tlr = topLeftR;
34
+ if (w < 2 * tlr) {
35
+ tlr = w / 2
36
+ }
37
+
38
+ var trr = topRightR;
39
+ if (w < 2 * trr) {
40
+ trr = w / 2
41
+ }
42
+
43
+ var blr = bottomLeftR;
44
+ if (w < 2 * blr) {
45
+ blr = w / 2
46
+ }
47
+
48
+ var brr = bottomRightR;
49
+ if (w < 2 * brr) {
50
+ brr = w / 2
51
+ }
52
+
15
53
  ctx.beginPath();
16
- ctx.moveTo(node.rect.x + r, node.rect.y);
17
- ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r);
18
- ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r);
19
- ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r);
20
- ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r);
54
+
55
+ ctx.moveTo(node.rect.x + tlr, node.rect.y);
56
+ ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, trr);
57
+ ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, brr);
58
+ ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, blr);
59
+ ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, tlr);
21
60
  ctx.closePath();
22
61
  (node.fillStyle || node.bkType) && ctx.fill();
23
62
  ctx.stroke();
@@ -0,0 +1,2 @@
1
+ import { Node } from 'dcim-topology2d/core/src/models';
2
+ export declare function switchs(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -0,0 +1,46 @@
1
+ export function switchs(ctx, node) {
2
+
3
+ let x = node.rect.x;
4
+ let y = node.rect.y;
5
+ let width = node.rect.width;
6
+ let height = node.rect.height;
7
+ // 绘制圆角
8
+ var wr = node.borderRadius;
9
+ var hr = node.borderRadius;
10
+ if (node.borderRadius < 1) {
11
+ wr = node.rect.width * node.borderRadius;
12
+ hr = node.rect.height * node.borderRadius;
13
+ }
14
+ var r = wr < hr ? wr : hr;
15
+ if (node.rect.width < 2 * r) {
16
+ r = node.rect.width / 2;
17
+ }
18
+ if (node.rect.height < 2 * r) {
19
+ r = node.rect.height / 2;
20
+ }
21
+ //绘制椭圆
22
+ ctx.fillStyle = node.fillStyle;
23
+ ctx.beginPath();
24
+ ctx.moveTo(x + r, y);
25
+ ctx.lineTo(x + width - r, y);
26
+ ctx.quadraticCurveTo(x + width, y, x + width, y + r);
27
+ ctx.lineTo(x + width, y + height - r);
28
+ ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
29
+ ctx.lineTo(x + r, y + height);
30
+ ctx.quadraticCurveTo(x, y + height, x, y + height - r);
31
+ ctx.lineTo(x, y + r);
32
+ ctx.quadraticCurveTo(x, y, x + r, y);
33
+ ctx.lineTo(x + width - r, y);
34
+ ctx.closePath();
35
+ node.fillStyle && ctx.fill();
36
+ ctx.stroke();
37
+
38
+ //绘制左侧 小圆 默认在右侧 isOpen:true
39
+ ctx.beginPath();
40
+ let cx = node.isOpen ? x + width - height * 0.5 : x + height * 0.5;
41
+ ctx.ellipse(cx, y + height * 0.5, height / 2 * 0.8, height / 2 * 0.8, 0, 0, Math.PI * 2);
42
+ ctx.fillStyle = '#ffffff';
43
+ ctx.closePath();
44
+ ctx.fill();
45
+ ctx.stroke();
46
+ }
@@ -417,19 +417,19 @@ var Line = /** @class */ (function (_super) {
417
417
  }
418
418
  Store.set(this.generateStoreKey('pts-') + this.id, null);
419
419
  };
420
- Line.prototype.scale = function (scale, center) {
421
- this.from.x = center.x - (center.x - this.from.x) * scale;
422
- this.from.y = center.y - (center.y - this.from.y) * scale;
423
- this.to.x = center.x - (center.x - this.to.x) * scale;
424
- this.to.y = center.y - (center.y - this.to.y) * scale;
420
+ Line.prototype.scale = function (scale, center, w, h) {
421
+ this.from.x = center.x - (center.x - this.from.x) * w;
422
+ this.from.y = center.y - (center.y - this.from.y) * h;
423
+ this.to.x = center.x - (center.x - this.to.x) * w;
424
+ this.to.y = center.y - (center.y - this.to.y) * h;
425
425
  if (this.text && this.font && this.font.fontSize) {
426
426
  this.font.fontSize *= scale;
427
427
  this.textRect = null;
428
428
  }
429
429
  for (var _i = 0, _a = this.controlPoints; _i < _a.length; _i++) {
430
430
  var pt = _a[_i];
431
- pt.x = center.x - (center.x - pt.x) * scale;
432
- pt.y = center.y - (center.y - pt.y) * scale;
431
+ pt.x = center.x - (center.x - pt.x) * w;
432
+ pt.y = center.y - (center.y - pt.y) * h;
433
433
  }
434
434
  Store.set(this.generateStoreKey('pts-') + this.id, null);
435
435
  };
@@ -1,8 +1,8 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
@@ -35,6 +35,7 @@ var Node = /** @class */ (function (_super) {
35
35
  _this.rotatedAnchors = [];
36
36
  _this.animateDuration = 0;
37
37
  _this.animateFrames = [];
38
+ _this.attribute = json.attribute || 'default';
38
39
  _this.type = PenType.Node;
39
40
  _this.TID = json.TID;
40
41
  _this.selectDropdown = json.selectDropdown || false;
@@ -95,6 +96,7 @@ var Node = /** @class */ (function (_super) {
95
96
  _this.visitStrokeStyle = json.visitStrokeStyle || '';
96
97
  _this.thBottomStrokeStyle = json.thBottomStrokeStyle || '#fff';
97
98
  _this.thBottomLineWidth = json.thBottomLineWidth || 1;
99
+ _this.focusFillStyle = json.focusFillStyle;
98
100
  // 兼容老数据
99
101
  if (json.children && json.children[0] && json.children[0].parentRect) {
100
102
  _this.paddingLeft = json.children[0].parentRect.offsetX;
@@ -133,10 +135,10 @@ var Node = /** @class */ (function (_super) {
133
135
  _this.animateDuration = json.animateDuration;
134
136
  }
135
137
  _this.animateType = json.animateType
136
- ? json.animateType
137
- : json.animateDuration
138
- ? 'custom'
139
- : '';
138
+ ? json.animateType
139
+ : json.animateDuration
140
+ ? 'custom'
141
+ : '';
140
142
  _this.animateAlone = json.animateAlone;
141
143
  _this.iframe = json.iframe;
142
144
  _this.iframePageAuto = json.iframePageAuto || false;
@@ -146,17 +148,21 @@ var Node = /** @class */ (function (_super) {
146
148
  _this.play = json.play;
147
149
  _this.nextPlay = json.nextPlay;
148
150
  _this.time = json.time;
151
+ _this.isOpen = json.isOpen;
152
+ _this.isShowPercent = json.isShowPercent || false;
153
+ _this.maxValue = json.maxValue || 100;
154
+ _this.retationDecimalPlaces = json.retationDecimalPlaces;
149
155
  if (json.elementLoaded !== undefined) {
150
156
  _this.elementId = null;
151
157
  _this.elementLoaded = false;
152
158
  }
153
- if(this.name == 'arbitraryGraph') {
159
+ if (this.name == 'arbitraryGraph') {
154
160
  this.rect.circles = json.rect.circles;
155
161
  //let {x, y} = this.centroid(json.rect.circles);
156
- let minX = Math.min.apply(Math, json.rect.circles.map((item)=>{ return item.x}));
157
- let minY = Math.min.apply(Math, json.rect.circles.map((item)=>{ return item.y}));
158
- this.rect.x = minX;
159
- this.rect.y = minY;
162
+ let minX = Math.min.apply(Math, json.rect.circles.map((item) => { return item.x }));
163
+ let minY = Math.min.apply(Math, json.rect.circles.map((item) => { return item.y }));
164
+ this.rect.x = minX;
165
+ this.rect.y = minY;
160
166
  this.rect.ex = this.rect.x + this.rect.width;
161
167
  this.rect.ey = this.rect.y + this.rect.height;
162
168
  // this.rect.center.x = x;
@@ -164,8 +170,8 @@ var Node = /** @class */ (function (_super) {
164
170
  // console.log('this.rect', this.rect);
165
171
  // console.log('this---node---', this);
166
172
  }
167
- if(json.name === 'formTable') _this.setFormTableData(json);
168
- if(json.name === 'tablePagination') _this.setTablePagination(json);
173
+ if (json.name === 'formTable') _this.setFormTableData(json);
174
+ if (json.name === 'tablePagination') _this.setTablePagination(json);
169
175
  _this.init();
170
176
  if (!noChild) {
171
177
  _this.setChild(json.children);
@@ -174,13 +180,13 @@ var Node = /** @class */ (function (_super) {
174
180
  _this.children = null;
175
181
  }
176
182
 
177
- if(json.name === 'time') {
178
- _this.animateFn = function() {
179
- let date = new Date();
180
- var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
181
- var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
182
- var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
183
- _this.time = {h: hour, m:minute, s:second}
183
+ if (json.name === 'time') {
184
+ _this.animateFn = function () {
185
+ let date = new Date();
186
+ var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
187
+ var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
188
+ var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
189
+ _this.time = { h: hour, m: minute, s: second }
184
190
  }
185
191
  }
186
192
 
@@ -212,7 +218,7 @@ var Node = /** @class */ (function (_super) {
212
218
  this.addToDiv();
213
219
  };
214
220
  Node.prototype.setFormTableData = function (json) {
215
- if(!Store.get('FORM:tableData')){
221
+ if (!Store.get('FORM:tableData')) {
216
222
  Store.set('FORM:tableData', {
217
223
  data: {
218
224
  tableNodes: {},
@@ -227,18 +233,18 @@ var Node = /** @class */ (function (_super) {
227
233
  data: tableData
228
234
  })
229
235
  const fromData = Store.get('SYNC:tableData');
230
- if(fromData) {
231
- if(!fromData[json.id].loading){
236
+ if (fromData) {
237
+ if (!fromData[json.id].loading) {
232
238
  this.formData.tableBody = fromData[json.id].tableBody;
233
239
  this.formData.total = fromData[json.id].total;
234
- }else {
240
+ } else {
235
241
  this.formData.tableBody = null;
236
242
  this.formData.total = 0;
237
243
  }
238
244
  }
239
245
  };
240
246
  Node.prototype.setTablePagination = function (json) {
241
- if(!Store.get('FORM:tableData')){
247
+ if (!Store.get('FORM:tableData')) {
242
248
  Store.set('FORM:tableData', {
243
249
  data: {
244
250
  tableNodes: {},
@@ -250,7 +256,7 @@ var Node = /** @class */ (function (_super) {
250
256
  const tableData = Store.get('FORM:tableData').data;
251
257
  const fromData = Store.get('SYNC:tableData');
252
258
  const tnode = fromData ? fromData[json.paginationData.bindFromTableId] : null;
253
- if(tnode) json.paginationData.total = tnode.total;
259
+ if (tnode) json.paginationData.total = tnode.total;
254
260
  tableData.paginationNodes[json.id] = json;
255
261
  Store.set('FORM:tableData', {
256
262
  data: tableData
@@ -258,11 +264,14 @@ var Node = /** @class */ (function (_super) {
258
264
  };
259
265
  Node.prototype.addToDiv = function () {
260
266
  if (this.iframe ||
261
- this.elementId ||
262
- this.hasGif()) {
267
+ this.elementId ||
268
+ this.hasGif()) {
263
269
  Store.set(this.generateStoreKey('LT:addDiv'), this);
264
270
  }
265
271
  };
272
+ Node.prototype.createOverflow = function () {
273
+ Store.set(this.generateStoreKey('LT:createOverflow'), this);
274
+ };
266
275
  Node.prototype.hasGif = function () {
267
276
  if (this.gif) {
268
277
  return true;
@@ -335,13 +344,13 @@ var Node = /** @class */ (function (_super) {
335
344
  this.drawBkRadialGradient(ctx);
336
345
  break;
337
346
  }
338
- if(this.name === 'tablePagination') defaultText(ctx, this);
347
+ if (this.name === 'tablePagination') defaultText(ctx, this);
339
348
  // Draw shape.
340
349
  drawNodeFns[this.name](ctx, this);
341
350
  // Draw text.
342
- if(this.name === 'formTable') {
351
+ if (this.name === 'formTable') {
343
352
  tableText(ctx, this);
344
- }else {
353
+ } else {
345
354
  if (this.name !== 'text' && this.text && !(this.image && this.floorImageIndex === true)) {
346
355
  text(ctx, this);
347
356
  }
@@ -436,14 +445,14 @@ var Node = /** @class */ (function (_super) {
436
445
  img: img,
437
446
  cnt: 1,
438
447
  };
439
- if(defaultImageNode) delete defaultImages[_this.id];
448
+ if (defaultImageNode) delete defaultImages[_this.id];
440
449
  Store.set(_this.generateStoreKey('LT:imageLoaded'), true);
441
450
  if (!_this.gif && gif) {
442
451
  _this.gif = true;
443
452
  Store.set(_this.generateStoreKey('LT:addDiv'), _this);
444
453
  }
445
454
  };
446
- img.onerror = function(e){
455
+ img.onerror = function (e) {
447
456
  // 图片加载失败时预留默认图为空
448
457
  defaultImages[_this.id] = {
449
458
  img: '',
@@ -451,7 +460,7 @@ var Node = /** @class */ (function (_super) {
451
460
  };
452
461
  };
453
462
  };
454
- Node.prototype.initDrawImg = function (ctx){
463
+ Node.prototype.initDrawImg = function (ctx) {
455
464
  var _this = this;
456
465
  ctx.save();
457
466
  ctx.shadowColor = '';
@@ -509,7 +518,7 @@ var Node = /** @class */ (function (_super) {
509
518
  y = rect.ey - h;
510
519
  break;
511
520
  }
512
- if(!_this.activeImgeIndex) ctx.drawImage(this.img, x, y, w, h);
521
+ if (!_this.activeImgeIndex) ctx.drawImage(this.img, x, y, w, h);
513
522
  ctx.restore();
514
523
  };
515
524
  Node.prototype.calcAnchors = function () {
@@ -554,21 +563,21 @@ var Node = /** @class */ (function (_super) {
554
563
  var parentW = parent.rect.width - parent.paddingLeftNum - parent.paddingRightNum;
555
564
  var parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum;
556
565
  var x = parent.rect.x +
557
- parent.paddingLeftNum +
558
- abs(parentW, this.rectInParent.x) +
559
- abs(parentW, this.rectInParent.marginLeft);
566
+ parent.paddingLeftNum +
567
+ abs(parentW, this.rectInParent.x) +
568
+ abs(parentW, this.rectInParent.marginLeft);
560
569
  var y = parent.rect.y +
561
- parent.paddingTopNum +
562
- abs(parentH, this.rectInParent.y) +
563
- abs(parentW, this.rectInParent.marginTop);
570
+ parent.paddingTopNum +
571
+ abs(parentH, this.rectInParent.y) +
572
+ abs(parentW, this.rectInParent.marginTop);
564
573
  var w = abs(parentW, this.rectInParent.width);
565
574
  var h = abs(parentH, this.rectInParent.height);
566
575
  if (this.rectInParent.marginLeft === undefined &&
567
- this.rectInParent.marginRight) {
576
+ this.rectInParent.marginRight) {
568
577
  x -= abs(parentW, this.rectInParent.marginRight);
569
578
  }
570
579
  if (this.rectInParent.marginTop === undefined &&
571
- this.rectInParent.marginBottom) {
580
+ this.rectInParent.marginBottom) {
572
581
  y -= abs(parentW, this.rectInParent.marginBottom);
573
582
  }
574
583
  this.rect = new Rect(x, y, w, h);
@@ -599,15 +608,15 @@ var Node = /** @class */ (function (_super) {
599
608
  var parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum;
600
609
  this.rectInParent = {
601
610
  x: ((this.rect.x - parent.rect.x - parent.paddingLeftNum) * 100) /
602
- parentW +
603
- '%',
611
+ parentW +
612
+ '%',
604
613
  y: ((this.rect.y - parent.rect.y - parent.paddingTopNum) * 100) / parentH +
605
- '%',
614
+ '%',
606
615
  width: (this.rect.width * 100) / parentW + '%',
607
616
  height: (this.rect.height * 100) / parentH + '%',
608
617
  rotate: this.rectInParent
609
- ? this.rectInParent.rotate || 0
610
- : this.rotate || 0,
618
+ ? this.rectInParent.rotate || 0
619
+ : this.rotate || 0,
611
620
  rect: this.rect.clone(),
612
621
  };
613
622
  };
@@ -628,7 +637,7 @@ var Node = /** @class */ (function (_super) {
628
637
  var timeline = now - this.animateStart;
629
638
  if (timeline > this.animateDuration) {
630
639
  if (++this.animateCycleIndex >= this.animateCycle &&
631
- this.animateCycle > 0) {
640
+ this.animateCycle > 0) {
632
641
  this.animateStart = 0;
633
642
  this.animateCycleIndex = 0;
634
643
  var item = this.animateFrames[this.animateFrames.length - 1];
@@ -668,78 +677,78 @@ var Node = /** @class */ (function (_super) {
668
677
  var rate = (timeline - item.start) / item.duration;
669
678
  if (item.linear) {
670
679
  // 线条左右流动动画
671
- if([animateType.LeftFlow, animateType.RightFlow].includes(this.animateType) && item.state.lineDashOffset){
680
+ if ([animateType.LeftFlow, animateType.RightFlow].includes(this.animateType) && item.state.lineDashOffset) {
672
681
  let o = item.state.lineDashOffset;
673
682
  switch (this.animateType) {
674
683
  case animateType.LeftFlow:
675
684
  o = Math.abs(o)
676
685
  if (o > 100) o = 1;
677
- o++
678
-
686
+ o++
687
+
679
688
  break;
680
689
  case animateType.RightFlow:
681
- o = Math.abs(o)*-1
690
+ o = Math.abs(o) * -1
682
691
  if (o < -100) o = -1;
683
692
  o--
684
693
  break;
685
694
  }
686
695
  item.state.lineDashOffset = o
687
696
  this.lineDashOffset = item.state.lineDashOffset;
688
- }else if(([animateType.Show, animateType.Rotate].includes(this.animateType) || this.name === 'electricFan') && item.state.rotate !== item.initState.rotate) {
697
+ } else if (([animateType.Show, animateType.Rotate].includes(this.animateType) || this.name === 'electricFan') && item.state.rotate !== item.initState.rotate) {
689
698
  // 旋转动画,判断逻辑先这么写,日后将所有动画统一在编辑器中配置,再做优化
690
699
  this.rotate =
691
- item.initState.rotate +
692
- (item.state.rotate - item.initState.rotate) * rate;
700
+ item.initState.rotate +
701
+ (item.state.rotate - item.initState.rotate) * rate;
693
702
  rectChanged = true;
694
- }else {
703
+ } else {
695
704
 
696
705
  if (item.state.rect.x !== item.initState.rect.x) {
697
706
  this.rect.x =
698
- item.initState.rect.x +
699
- (item.state.rect.x - item.initState.rect.x) * rate;
707
+ item.initState.rect.x +
708
+ (item.state.rect.x - item.initState.rect.x) * rate;
700
709
  rectChanged = true;
701
710
  }
702
711
  if (item.state.rect.y !== item.initState.rect.y) {
703
712
  this.rect.y =
704
- item.initState.rect.y +
705
- (item.state.rect.y - item.initState.rect.y) * rate;
713
+ item.initState.rect.y +
714
+ (item.state.rect.y - item.initState.rect.y) * rate;
706
715
  rectChanged = true;
707
716
  }
708
717
  if (item.state.rect.width !== item.initState.rect.width) {
709
718
  this.rect.width =
710
- item.initState.rect.width +
711
- (item.state.rect.width - item.initState.rect.width) * rate;
719
+ item.initState.rect.width +
720
+ (item.state.rect.width - item.initState.rect.width) * rate;
712
721
  rectChanged = true;
713
722
  }
714
723
  if (item.state.rect.height !== item.initState.rect.height) {
715
724
  this.rect.height =
716
- item.initState.rect.height +
717
- (item.state.rect.height - item.initState.rect.height) * rate;
725
+ item.initState.rect.height +
726
+ (item.state.rect.height - item.initState.rect.height) * rate;
718
727
  rectChanged = true;
719
728
  }
720
729
  this.rect.ex = this.rect.x + this.rect.width;
721
730
  this.rect.ey = this.rect.y + this.rect.height;
722
731
  this.rect.calcCenter();
723
732
  if (item.initState.z !== undefined &&
724
- item.state.z !== item.initState.z) {
733
+ item.state.z !== item.initState.z) {
725
734
  this.z =
726
- item.initState.z + (item.state.z - item.initState.z) * rate;
735
+ item.initState.z + (item.state.z - item.initState.z) * rate;
727
736
  rectChanged = true;
728
737
  }
729
738
  if (item.state.borderRadius !== item.initState.borderRadius) {
730
739
  this.borderRadius =
731
- item.initState.borderRadius +
732
- (item.state.borderRadius - item.initState.borderRadius) * rate;
740
+ item.initState.borderRadius +
741
+ (item.state.borderRadius - item.initState.borderRadius) * rate;
733
742
  }
734
743
  if (item.state.lineWidth !== item.initState.lineWidth) {
735
744
  this.lineWidth =
736
- item.initState.lineWidth +
737
- (item.state.lineWidth - item.initState.lineWidth) * rate;
745
+ item.initState.lineWidth +
746
+ (item.state.lineWidth - item.initState.lineWidth) * rate;
738
747
  }
739
748
  if (item.state.globalAlpha !== item.initState.globalAlpha) {
740
749
  this.globalAlpha =
741
- item.initState.globalAlpha +
742
- (item.state.globalAlpha - item.initState.globalAlpha) * rate;
750
+ item.initState.globalAlpha +
751
+ (item.state.globalAlpha - item.initState.globalAlpha) * rate;
743
752
  }
744
753
  }
745
754
  }
@@ -770,14 +779,14 @@ var Node = /** @class */ (function (_super) {
770
779
  h = scale;
771
780
  }
772
781
  this['oldRect'] = this.rect.clone();
773
- if(this.rect.circles) {
774
- for(let c=0, circles= this.rect.circles; c<circles.length; c++) {
782
+ if (this.rect.circles) {
783
+ for (let c = 0, circles = this.rect.circles; c < circles.length; c++) {
775
784
  circles[c].x = center.x - (center.x - circles[c].x) * w;
776
785
  circles[c].y = center.y - (center.y - circles[c].y) * h;
777
786
  }
778
787
  }
779
788
  this.rect.x = center.x - (center.x - this.rect.x) * w;
780
- if(this.rotate % 180) {
789
+ if (this.rotate % 180) {
781
790
  this.rect.x = this.rect.x + (this.rect.width * w - this.rect.width * h) / 2;
782
791
  }
783
792
  this.rect.y = center.y - (center.y - this.rect.y) * h;
@@ -786,7 +795,7 @@ var Node = /** @class */ (function (_super) {
786
795
  this.rect.ex = this.rect.x + this.rect.width;
787
796
  this.rect.ey = this.rect.y + this.rect.height;
788
797
  this.z *= scale;
789
- if(!(center.type && center.type === 'bottLogo')) {
798
+ if (!(center.type && center.type === 'bottLogo')) {
790
799
  if (this.imageWidth) {
791
800
  this.imageWidth *= w;
792
801
  }
@@ -890,8 +899,8 @@ var Node = /** @class */ (function (_super) {
890
899
  }
891
900
  };
892
901
  Node.prototype.translate = function (x, y) {
893
- if(this.rect.circles) {
894
- for(let c=0, circles= this.rect.circles; c<circles.length; c++) {
902
+ if (this.rect.circles) {
903
+ for (let c = 0, circles = this.rect.circles; c < circles.length; c++) {
895
904
  circles[c].x += x;
896
905
  circles[c].y += y;
897
906
  }
@@ -948,7 +957,7 @@ var Node = /** @class */ (function (_super) {
948
957
  return n;
949
958
  };
950
959
  //新增属性
951
- Node.prototype.area = function(pts) {
960
+ Node.prototype.area = function (pts) {
952
961
  var area = 0;
953
962
  var pts = pts;
954
963
  var nPts = pts.length;
@@ -964,7 +973,7 @@ var Node = /** @class */ (function (_super) {
964
973
  area /= 2;
965
974
  return area;
966
975
  };
967
- Node.prototype.centroid = function(pts) {
976
+ Node.prototype.centroid = function (pts) {
968
977
  var pts = pts;
969
978
  var nPts = pts.length;
970
979
  var x = 0;
@@ -111,6 +111,13 @@ var Pen = /** @class */ (function () {
111
111
  this.defaultFillStyle = json.defaultFillStyle || '';
112
112
  this.defaultFontColor = json.defaultFontColor || '';
113
113
  this.defaultStrokeStyle = json.defaultStrokeStyle || '';
114
+
115
+ this.borderRadiusTopLeft = json.borderRadiusTopLeft || 0;
116
+ this.borderRadiusTopRight = json.borderRadiusTopRight || 0;
117
+ this.borderRadiusBottomLeft = json.borderRadiusBottomLeft || 0;
118
+ this.borderRadiusBottomRight = json.borderRadiusBottomRight || 0;
119
+
120
+ this.focusFillStyle = json.focusFillStyle || '';
114
121
  if (json.rectInParent) {
115
122
  this.rectInParent = json.rectInParent;
116
123
  }
@@ -131,7 +138,7 @@ var Pen = /** @class */ (function () {
131
138
  }
132
139
  }
133
140
  Pen.prototype.render = function (ctx) {
134
- if (!this.visible && !this.visibleSwitch){
141
+ if (!this.visible && !this.visibleSwitch) {
135
142
  return;
136
143
  }
137
144
  if (this.from && !this.to) {
@@ -150,14 +157,16 @@ var Pen = /** @class */ (function () {
150
157
  if (this.lineWidth > 1) {
151
158
  ctx.lineWidth = this.lineWidth;
152
159
  }
153
- if(this.dash === 4) {
160
+ if (this.dash === 4) {
154
161
  ctx.strokeStyle = 'transparent';
155
- }else {
162
+ } else {
156
163
  const staticStrokeStyle = this.strokeStyle || '#222';
157
164
  ctx.strokeStyle = !this.activeImgeIndex ? this.visitStrokeStyle || staticStrokeStyle : this.defaultStrokeStyle || staticStrokeStyle;
158
165
  }
159
166
  //ctx.strokeStyle = this.dash === 4 ? 'transparent' : this.strokeStyle || '#222';
160
- this.fillStyle && (ctx.fillStyle = this.fillStyle);
167
+ //背景聚焦色
168
+ this.focusFillStyle && !this.activeImgeIndex ? ctx.fillStyle = this.focusFillStyle : (this.fillStyle && (ctx.fillStyle = this.fillStyle));
169
+
161
170
  if (this.lineCap) {
162
171
  ctx.lineCap = this.lineCap;
163
172
  }
@@ -219,19 +228,19 @@ var Pen = /** @class */ (function () {
219
228
  }
220
229
  for (var _i = 0, _a = this.events; _i < _a.length; _i++) {
221
230
  var item = _a[_i];
222
- if (item.type !== EventType.Click ) {
231
+ if (item.type !== EventType.Click) {
223
232
  continue;
224
233
  }
225
234
  // 画布页面,单击跳转链接事件屏蔽
226
- if(item.action === EventAction.Link && window.location.pathname.includes('workspace')){
235
+ if (item.action === EventAction.Link && window.location.pathname.includes('workspace')) {
227
236
  continue
228
237
  }
229
- if(item.action === EventAction.Link){
238
+ if (item.action === EventAction.Link) {
230
239
  this[this.eventFns[item.action]](item.value, item.dcimMenuForType);
231
- }else{
240
+ } else {
232
241
  this[this.eventFns[item.action]] && this[this.eventFns[item.action]](item.value, item.params);
233
242
  }
234
- if(item.action === 7){
243
+ if (item.action === 7) {
235
244
  Store.set(this.generateStoreKey('LT:hidePen'), item.value);
236
245
  }
237
246
  }
@@ -270,10 +279,10 @@ var Pen = /** @class */ (function () {
270
279
  // window.open(url, params === undefined ? '_blank' : params);
271
280
  var port = window.location.port;
272
281
  var href = window.location.href;
273
- if(!url.includes("http") && port.includes("3000") && url.includes("id")){
274
- url= '/workspace?id=' + url.split('id=')[1]
282
+ if (!url.includes("http") && port.includes("3000") && url.includes("id")) {
283
+ url = '/workspace?id=' + url.split('id=')[1]
275
284
  // console.log('url:3000===',url)
276
- }else if(!url.includes("http://") && href.includes("topologyDetail")){
285
+ } else if (!url.includes("http://") && href.includes("topologyDetail")) {
277
286
  switch (params) {
278
287
  case '1': // 返回上一页
279
288
  let str = href.replace(/\/topologyDetail/g, "")