costy-plus 1.0.76-0 → 1.0.77-0

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.
@@ -17,7 +17,7 @@ import { Prop as c } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2
17
17
  import { flattenDeep as R, max as z, min as j } from "lodash";
18
18
  import { throttling as G, getStepForSpeed as u, getPrintLengthToPx as $, getSens as v, getDataLenTimes as I, getPointIdxForPx as M, getActualY as S } from "@costy-plus/utils";
19
19
  import * as B from "zrender";
20
- import { Group as w, Polyline as L, Line as H, Text as C } from "zrender";
20
+ import { Group as m, Polyline as L, Line as H, Text as C } from "zrender";
21
21
  var k = Object.defineProperty, X = Object.getOwnPropertyDescriptor, g = (e, t, i, s) => {
22
22
  for (var o = s > 1 ? void 0 : s ? X(t, i) : t, n = e.length - 1, a; n >= 0; n--)
23
23
  (a = e[n]) && (o = (s ? a(t, i, o) : a(o)) || o);
@@ -47,8 +47,8 @@ let p = class extends N {
47
47
  };
48
48
  }
49
49
  destroyed() {
50
- var e, t, i, s, o, n, a, h, d, f, l;
51
- this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (o = this.splitLineGroup) == null || o.removeAll(), (n = this.leadHeadNameGroup) == null || n.removeAll(), (a = this.leadHeadOffAndDelGroup) == null || a.removeAll(), (h = this.rulerGroup) == null || h.removeAll(), (d = this.arrowGroup) == null || d.removeAll(), (f = this.heardBeatLineGroup) == null || f.removeAll(), (l = this.sceneIns) == null || l.dispose();
50
+ var e, t, i, s, o, n, a, h, l, f, r;
51
+ this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (o = this.splitLineGroup) == null || o.removeAll(), (n = this.leadHeadNameGroup) == null || n.removeAll(), (a = this.leadHeadOffAndDelGroup) == null || a.removeAll(), (h = this.rulerGroup) == null || h.removeAll(), (l = this.arrowGroup) == null || l.removeAll(), (f = this.heardBeatLineGroup) == null || f.removeAll(), (r = this.sceneIns) == null || r.dispose();
52
52
  }
53
53
  initCreatedConfig() {
54
54
  this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height, this.initConfig();
@@ -113,25 +113,25 @@ let p = class extends N {
113
113
  }
114
114
  initConfig() {
115
115
  var t;
116
- this.rowAndColwaveFromGroup = new w({
116
+ this.rowAndColwaveFromGroup = new m({
117
117
  name: "rowAndColwaveFrom"
118
- }), this.singleWaveFromGroup = new w({
118
+ }), this.singleWaveFromGroup = new m({
119
119
  name: "singleWaveFrom"
120
- }), this.addwaveFromGroup = new w({
120
+ }), this.addwaveFromGroup = new m({
121
121
  name: "addwaveFrom"
122
- }), this.leadHeadGroup = new w({
122
+ }), this.leadHeadGroup = new m({
123
123
  name: "leadHead"
124
- }), this.splitLineGroup = new w({
124
+ }), this.splitLineGroup = new m({
125
125
  name: "splitLine"
126
- }), this.leadHeadNameGroup = new w({
126
+ }), this.leadHeadNameGroup = new m({
127
127
  name: "leadHeadName"
128
- }), this.leadHeadOffAndDelGroup = new w({
128
+ }), this.leadHeadOffAndDelGroup = new m({
129
129
  name: "leadHeadOffAndDel"
130
- }), this.rulerGroup = new w({
130
+ }), this.rulerGroup = new m({
131
131
  name: "ruler"
132
- }), this.arrowGroup = new w({
132
+ }), this.arrowGroup = new m({
133
133
  name: "arrowLoop"
134
- }), this.heardBeatLineGroup = new w({
134
+ }), this.heardBeatLineGroup = new m({
135
135
  name: "heardBeatLine"
136
136
  });
137
137
  let e = this.canvasContainer.width;
@@ -190,31 +190,31 @@ let p = class extends N {
190
190
  (e = this.sceneIns) == null || e.off("mousemove", this.sceneInsMousemove), (t = this.sceneIns) == null || t.off("mousedown", this.sceneInsMouseDown), (i = this.sceneIns) == null || i.off("mouseup", this.sceneInsMouseUp);
191
191
  }
192
192
  drawLeadHead() {
193
- var n, a, h, d, f;
193
+ var n, a, h, l, f;
194
194
  (n = this.leadHeadGroup) == null || n.removeAll(), (a = this.sceneIns) == null || a.remove(this.leadHeadGroup), console.log("this.waveConfigs", this.waveConfigs);
195
195
  let e = "", t = !1, i = 0, s = 0;
196
- for (let l = 0; l <= this.leadModel.column; l++) {
197
- s = l * this.leadModel.line;
196
+ for (let r = 0; r <= this.leadModel.column; r++) {
197
+ s = r * this.leadModel.line;
198
198
  e:
199
- for (let r = 1; r <= this.leadModel.line; r++) {
200
- if (!(this.waveConfigs || [])[r - 1 + s])
199
+ for (let d = 1; d <= this.leadModel.line; d++) {
200
+ if (!(this.waveConfigs || [])[d - 1 + s])
201
201
  break e;
202
- !this.waveConfigs[r - 1 + s].isShowLeadHead || (t = !1, e = (this.leadNames || [])[r - 1 + s] || "", this.waveConfigs[r - 1 + s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = this.waveConfigs[r - 1 + s].posX ? this.waveConfigs[r - 1 + s].posX - this.leadHeadConfig.leadHedeWidth : 0, (h = this.leadHeadGroup) == null || h.add(
202
+ !this.waveConfigs[d - 1 + s].isShowLeadHead || (t = !1, e = (this.leadNames || [])[d - 1 + s] || "", this.waveConfigs[d - 1 + s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = this.waveConfigs[d - 1 + s].posX ? this.waveConfigs[d - 1 + s].posX - this.leadHeadConfig.leadHedeWidth : 0, (h = this.leadHeadGroup) == null || h.add(
203
203
  this.createLeadHead(
204
204
  i,
205
- this.waveConfigs[r - 1 + s].posY || r * this.splitBlockHeight,
206
- v(this.waveConfigs[r - 1 + s].gain, this.gridConfig.cellMg),
205
+ this.waveConfigs[d - 1 + s].posY || d * this.splitBlockHeight,
206
+ v(this.waveConfigs[d - 1 + s].gain, this.gridConfig.cellMg),
207
207
  t
208
208
  )
209
209
  ));
210
210
  }
211
211
  }
212
212
  let o = null;
213
- for (let l = 0; l < this.leadModel.add; l++)
214
- !this.waveConfigs[this.longLeadConfig.leadIdxs[l]] || (o = this.waveConfigs[this.longLeadConfig.leadIdxs[l]], e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l]]], t = !1, o.gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = o.posX ? o.posX - this.leadHeadConfig.leadHedeWidth : 0, (d = this.leadHeadGroup) == null || d.add(
213
+ for (let r = 0; r < this.leadModel.add; r++)
214
+ !this.waveConfigs[this.longLeadConfig.leadIdxs[r]] || (o = this.waveConfigs[this.longLeadConfig.leadIdxs[r]], e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]], t = !1, o.gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = o.posX ? o.posX - this.leadHeadConfig.leadHedeWidth : 0, (l = this.leadHeadGroup) == null || l.add(
215
215
  this.createLeadHead(
216
216
  i,
217
- o.posY || (l + 1 + this.leadModel.line) * this.splitBlockHeight,
217
+ o.posY || (r + 1 + this.leadModel.line) * this.splitBlockHeight,
218
218
  v(o.gain, this.gridConfig.cellMg),
219
219
  t
220
220
  )
@@ -260,42 +260,42 @@ let p = class extends N {
260
260
  });
261
261
  }
262
262
  drawColSplitLine() {
263
- var n, a, h, d, f;
263
+ var n, a, h, l, f;
264
264
  (n = this.splitLineGroup) == null || n.removeAll(), (a = this.sceneIns) == null || a.remove(this.splitLineGroup);
265
265
  const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
266
266
  if (this.splitPoint = e, this.leadModel.isSingleMode) {
267
- const l = u(
267
+ const r = u(
268
268
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
269
269
  this.gridConfig.cellMg,
270
270
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
271
- ), r = I(
272
- Math.ceil(this.splitPoint / (l || 1)) || 0,
271
+ ), d = I(
272
+ Math.ceil(this.splitPoint / (r || 1)) || 0,
273
273
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0
274
- ), m = parseInt(`${r / 1e3 % 60}`, 10);
275
- this.splitPoint = m * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (l || 0);
274
+ ), w = parseInt(`${d / 1e3 % 60}`, 10);
275
+ this.splitPoint = w * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (r || 0);
276
276
  }
277
277
  let t = 0, i = 0, s = 0, o = 0;
278
- for (let l = 1; l <= this.leadModel.column - 1; l++) {
279
- t = l * e + this.leadHeadConfig.leadHedeWidth, i = l * this.leadModel.line;
278
+ for (let r = 1; r <= this.leadModel.column - 1; r++) {
279
+ t = r * e + this.leadHeadConfig.leadHedeWidth, i = r * this.leadModel.line;
280
280
  e:
281
- for (let r = 1; r <= this.leadModel.line; r++) {
282
- if (!(this.waveConfigs || [])[r - 1 + i])
281
+ for (let d = 1; d <= this.leadModel.line; d++) {
282
+ if (!(this.waveConfigs || [])[d - 1 + i])
283
283
  break e;
284
- if ((this.waveConfigs || [])[r - 1 + i].isShowLeadHead)
284
+ if ((this.waveConfigs || [])[d - 1 + i].isShowLeadHead)
285
285
  continue e;
286
- if ((this.waveConfigs || [])[r - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[r - 1 + i].posX), s = (this.waveConfigs || [])[r - 1 + i].leadIdx, s === void 0)
286
+ if ((this.waveConfigs || [])[d - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[d - 1 + i].posX), s = (this.waveConfigs || [])[d - 1 + i].leadIdx, s === void 0)
287
287
  break;
288
- o = v((this.waveConfigs || [])[r - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[r - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (h = this.splitLineGroup) == null || h.add(
288
+ o = v((this.waveConfigs || [])[d - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[d - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (h = this.splitLineGroup) == null || h.add(
289
289
  this.creatSplitLine(
290
290
  t,
291
- ((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (o || 0) / 2 * 0.5,
291
+ ((this.waveConfigs || [])[d - 1 + i].posY || d * this.splitBlockHeight) - (o || 0) / 2 * 0.5,
292
292
  o,
293
293
  !0
294
294
  )
295
- ) : (d = this.splitLineGroup) == null || d.add(
295
+ ) : (l = this.splitLineGroup) == null || l.add(
296
296
  this.creatSplitLine(
297
297
  t,
298
- ((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (o || 0) * 0.5,
298
+ ((this.waveConfigs || [])[d - 1 + i].posY || d * this.splitBlockHeight) - (o || 0) * 0.5,
299
299
  o
300
300
  )
301
301
  );
@@ -343,7 +343,7 @@ let p = class extends N {
343
343
  (s = this.sceneIns) == null || s.add(i), (o = this.sceneIns) == null || o.add(t);
344
344
  }
345
345
  drawRuler(e = 0) {
346
- var a, h, d;
346
+ var a, h, l;
347
347
  if (this.timersCopy = e, !this.rulerConfig.isShow)
348
348
  return;
349
349
  const t = this.dataTotalTimes / 1e3;
@@ -352,8 +352,8 @@ let p = class extends N {
352
352
  if (this.leadModel.isContinuous)
353
353
  o = t * 5;
354
354
  else if (!this.leadModel.add && n) {
355
- const f = M(this.splitPoint, n), l = I(f, this.rulerConfig.sampleRate || 0) / 1e3;
356
- o = e + l;
355
+ const f = M(this.splitPoint, n), r = I(f, this.rulerConfig.sampleRate || 0) / 1e3;
356
+ o = e + r;
357
357
  }
358
358
  for (let f = e; f <= o; f = +(f + 0.1).toFixed(1))
359
359
  f !== e && (i += this.rulerStep), f % 1 === 0 ? (s = this.canvasContainer.height - 10, (a = this.rulerGroup) == null || a.add(new C({
@@ -379,10 +379,10 @@ let p = class extends N {
379
379
  lineWidth: 2
380
380
  }
381
381
  }));
382
- (d = this.sceneIns) == null || d.add(this.rulerGroup);
382
+ (l = this.sceneIns) == null || l.add(this.rulerGroup);
383
383
  }
384
384
  drawTopTimeLine(e = 0) {
385
- var d, f;
385
+ var f, r;
386
386
  if (this.timersCopy = e, !this.timeLineConfig.isShow)
387
387
  return;
388
388
  const t = this.dataTotalTimes / 1e3;
@@ -391,12 +391,12 @@ let p = class extends N {
391
391
  if (this.leadModel.isContinuous)
392
392
  s = t * 5;
393
393
  else if (!this.leadModel.add && o) {
394
- const l = M(this.splitPoint, o), r = I(l, this.rulerConfig.sampleRate || 0) / 1e3;
395
- s = e + r;
394
+ const d = M(this.splitPoint, o), w = I(d, this.rulerConfig.sampleRate || 0) / 1e3;
395
+ s = e + w;
396
396
  }
397
- const n = new Date(this.timeLineConfig.startLineTime).getTime() - new Date(this.timeLineConfig.startTime).getTime(), a = Math.floor(n / 1e3), h = Math.floor((new Date(this.timeLineConfig.endLineTime).getTime() - new Date(this.timeLineConfig.startTime).getTime()) / 1e3);
398
- for (let l = e; l <= s; l = +(l + 0.1).toFixed(1))
399
- l !== e && (i += this.rulerStep), l >= a && l <= h && ((d = this.rulerGroup) == null || d.add(new H({
397
+ const n = new Date(this.timeLineConfig.startLineTime).getTime() - new Date(this.timeLineConfig.startTime).getTime(), a = Math.floor(n / 100) / 10, h = (new Date(this.timeLineConfig.endLineTime).getTime() - new Date(this.timeLineConfig.startTime).getTime()) / 100, l = Math.floor(h) / 10;
398
+ for (let d = e; d <= s; d = +(d + 0.1).toFixed(1))
399
+ d !== e && (i += this.rulerStep), d >= a && d <= l && ((f = this.rulerGroup) == null || f.add(new H({
400
400
  cursor: "",
401
401
  shape: {
402
402
  x1: i,
@@ -409,14 +409,14 @@ let p = class extends N {
409
409
  lineWidth: 1
410
410
  }
411
411
  })));
412
- (f = this.sceneIns) == null || f.add(this.rulerGroup);
412
+ (r = this.sceneIns) == null || r.add(this.rulerGroup);
413
413
  }
414
414
  timestampToTime(e = 0) {
415
415
  const t = new Date(e), i = t.getFullYear(), s = ("0" + (t.getMonth() + 1)).slice(-2), o = ("0" + t.getDate()).slice(-2), n = ("0" + t.getHours()).slice(-2), a = ("0" + t.getMinutes()).slice(-2), h = ("0" + t.getSeconds()).slice(-2);
416
416
  return `${i}-${s}-${o} ${n}:${a}:${h}`;
417
417
  }
418
418
  drawTimeLine(e = 0) {
419
- var h, d, f;
419
+ var h, l, f;
420
420
  if (this.timersCopy = e, !this.timeConfig.isShow)
421
421
  return;
422
422
  const t = this.dataTotalTimes / 1e3;
@@ -425,22 +425,22 @@ let p = class extends N {
425
425
  if (this.leadModel.isContinuous)
426
426
  o = t * 5;
427
427
  else if (!this.leadModel.add && n) {
428
- const l = M(this.splitPoint, n), r = I(l, this.timeConfig.sampleRate || 0) / 1e3;
429
- o = e + r;
428
+ const r = M(this.splitPoint, n), d = I(r, this.timeConfig.sampleRate || 0) / 1e3;
429
+ o = e + d;
430
430
  }
431
431
  const a = new Date(this.timeConfig.startTime).getTime();
432
- for (let l = e; l <= o; l = +(l + 0.1).toFixed(1))
433
- l !== e && (i += this.rulerStep), l % 1 === 0 ? (s = this.canvasContainer.height - 10, (h = this.rulerGroup) == null || h.add(new C({
432
+ for (let r = e; r <= o; r = +(r + 0.1).toFixed(1))
433
+ r !== e && (i += this.rulerStep), r % 1 === 0 ? (s = this.canvasContainer.height - 10, (h = this.rulerGroup) == null || h.add(new C({
434
434
  cursor: "",
435
435
  style: {
436
436
  x: i,
437
437
  y: s - 15,
438
- text: this.timestampToTime(a + l * 1e3).slice(11),
438
+ text: this.timestampToTime(a + r * 1e3).slice(11),
439
439
  fontSize: 13,
440
440
  fontFamily: this.fontFamily,
441
441
  fill: "#000"
442
442
  }
443
- })), (d = this.rulerGroup) == null || d.add(new H({
443
+ })), (l = this.rulerGroup) == null || l.add(new H({
444
444
  cursor: "",
445
445
  shape: {
446
446
  x1: i,
@@ -467,17 +467,17 @@ let p = class extends N {
467
467
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
468
468
  this.gridConfig.cellMg,
469
469
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
470
- ), a = v(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [], d = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
470
+ ), a = v(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [], l = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
471
471
  for (let f = 0; f < 1; f++) {
472
472
  e = f * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
473
- for (let l = 1; l <= d; l++)
474
- t = l * this.splitBlockHeight, l > 1 && (t *= 0.8, s = o, o = s + (this.slidingWindowInfo.points || 0)), l === 1 && (this.loopArrowY.rowAndCol = t), h.push({
473
+ for (let r = 1; r <= l; r++)
474
+ t = r * this.splitBlockHeight, r > 1 && (t *= 0.8, s = o, o = s + (this.slidingWindowInfo.points || 0)), r === 1 && (this.loopArrowY.rowAndCol = t), h.push({
475
475
  pos: [e, t],
476
476
  startInd: s,
477
477
  endInd: o,
478
478
  step: n,
479
479
  sens: a,
480
- data: i.slice(s, o).map((r, m) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? S(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, r, a / 2) : S(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, r, a)).map((r, m) => [m * (n || 0), -r])
480
+ data: i.slice(s, o).map((d, w) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? S(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, d, a / 2) : S(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, d, a)).map((d, w) => [w * (n || 0), -d])
481
481
  });
482
482
  }
483
483
  return h;
@@ -486,17 +486,17 @@ let p = class extends N {
486
486
  var n, a, h;
487
487
  (n = this.singleWaveFromGroup) == null || n.removeAll();
488
488
  let e = this.getRednerSinglePoints(), t = I(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0), i = 0, s = 0, o = 0;
489
- for (let d = 0; d < e.length && !(e[d].pos[1] > this.drawArea.height + this.bottomAreaHeight); d++)
489
+ for (let l = 0; l < e.length && !(e[l].pos[1] > this.drawArea.height + this.bottomAreaHeight); l++)
490
490
  this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (i = parseInt(`${t / 1e3 / 60}`, 10), s = parseInt(`${t / 1e3 % 60}`, 10), i = s === 60 ? i += 1 : i, i = i === 0 ? "00" : i < 10 ? `0${i}` : i, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (a = this.singleWaveFromGroup) == null || a.add(new L({
491
491
  cursor: "",
492
- name: this.singleModeConfig.defaultSelect + "_" + d,
492
+ name: this.singleModeConfig.defaultSelect + "_" + l,
493
493
  shape: {
494
- points: e[d].data.map(([f, l], r) => isNaN(l) ? (o === 0 && (o = r - 1, o = o < 0 ? 0 : o), [
495
- e[d].data[o][0] + e[d].pos[0],
496
- e[d].data[o][1] + e[d].pos[1]
494
+ points: e[l].data.map(([f, r], d) => isNaN(r) ? (o === 0 && (o = d - 1, o = o < 0 ? 0 : o), [
495
+ e[l].data[o][0] + e[l].pos[0],
496
+ e[l].data[o][1] + e[l].pos[1]
497
497
  ]) : (o = 0, [
498
- f + e[d].pos[0],
499
- l + e[d].pos[1]
498
+ f + e[l].pos[0],
499
+ r + e[l].pos[1]
500
500
  ]))
501
501
  },
502
502
  style: {
@@ -509,18 +509,18 @@ let p = class extends N {
509
509
  })), (h = this.singleWaveFromGroup) == null || h.add(new C({
510
510
  cursor: "",
511
511
  style: {
512
- x: e[d].pos[0],
513
- y: e[d].pos[1] - (e[d].sens || 0) / 2,
514
- text: d === 0 ? "00:00 \u5FC3\u7387" : `${i}:${s} \u5FC3\u7387`,
512
+ x: e[l].pos[0],
513
+ y: e[l].pos[1] - (e[l].sens || 0) / 2,
514
+ text: l === 0 ? "00:00 \u5FC3\u7387" : `${i}:${s} \u5FC3\u7387`,
515
515
  fontWeight: "bold",
516
516
  fontSize: 14,
517
517
  fill: "#FF0080",
518
518
  fontFamily: this.fontFamily
519
519
  }
520
- })), d > 0 && (t += t)), this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx, e[0].pos[0] - 10, e[0].pos[1] + 10), this.createLeadOffAndDel(
520
+ })), l > 0 && (t += t)), this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx, e[0].pos[0] - 10, e[0].pos[1] + 10), this.createLeadOffAndDel(
521
521
  this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,
522
522
  e[0].pos[0] - 5,
523
- e[0].pos[1] - (e[d].sens || 0) / 2 - 15
523
+ e[0].pos[1] - (e[l].sens || 0) / 2 - 15
524
524
  );
525
525
  this.singleWaveDataCopy = e, e = null;
526
526
  }
@@ -536,7 +536,7 @@ let p = class extends N {
536
536
  pos: [t, i],
537
537
  startInd: this.addSlidingWindowInfo.startInd || 0,
538
538
  endInd: this.addSlidingWindowInfo.endInd || 0,
539
- data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((d, f) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? S(this.waveConfigs[s].sensitivity, d, a / 2) : S(this.waveConfigs[s].sensitivity, d, a)).map((d, f) => [f * (n || 0), -d]),
539
+ data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((l, f) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? S(this.waveConfigs[s].sensitivity, l, a / 2) : S(this.waveConfigs[s].sensitivity, l, a)).map((l, f) => [f * (n || 0), -l]),
540
540
  sens: a,
541
541
  step: n
542
542
  }));
@@ -570,20 +570,20 @@ let p = class extends N {
570
570
  }
571
571
  getRednerPoints() {
572
572
  let e = 0, t = 0, i = 0, s = [], o = 0, n = 0, a = this.slidingWindowInfo.startInd || 0, h = this.slidingWindowInfo.endInd || 0;
573
- const d = [];
573
+ const l = [];
574
574
  for (let f = 0; f < this.leadModel.column; f++) {
575
575
  e = f * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && f > 0 && (a = h, h = a + (this.slidingWindowInfo.points || 0));
576
- for (let l = 1; l <= this.leadModel.line && (t = l * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); l++)
577
- e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o = u(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), n = v(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (l === 1 && (this.loopArrowY.rowAndCol = t), d.push({
576
+ for (let r = 1; r <= this.leadModel.line && (t = r * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); r++)
577
+ e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o = u(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), n = v(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), l.push({
578
578
  pos: [e, t],
579
579
  startInd: a,
580
580
  endInd: h,
581
581
  sens: n,
582
582
  step: o,
583
- data: s.slice(a, h).map((r, m) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? S(this.waveConfigs[i].sensitivity, r, n / 2) : S(this.waveConfigs[i].sensitivity, r, n)).map((r, m) => [m * (o || 0), -r])
583
+ data: s.slice(a, h).map((d, w) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? S(this.waveConfigs[i].sensitivity, d, n / 2) : S(this.waveConfigs[i].sensitivity, d, n)).map((d, w) => [w * (o || 0), -d])
584
584
  }), i++);
585
585
  }
586
- return d;
586
+ return l;
587
587
  }
588
588
  createRowAndColWaveFrom() {
589
589
  var s, o;
@@ -594,7 +594,7 @@ let p = class extends N {
594
594
  cursor: "",
595
595
  name: n + "_" + n,
596
596
  shape: {
597
- points: e[n].data.map(([a, h], d) => isNaN(h) ? (i === 0 && (i = d - 1, i = i < 0 ? 0 : i), [
597
+ points: e[n].data.map(([a, h], l) => isNaN(h) ? (i === 0 && (i = l - 1, i = i < 0 ? 0 : i), [
598
598
  e[n].data[i][0] + e[n].pos[0],
599
599
  e[n].data[i][1] + e[n].pos[1]
600
600
  ]) : (i = 0, [
@@ -678,18 +678,18 @@ let p = class extends N {
678
678
  this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((n, a) => {
679
679
  a = a || 0, !(!t[a] || !t[a].data) && n.attr({
680
680
  shape: {
681
- points: t[a].data.map(([h, d]) => [
681
+ points: t[a].data.map(([h, l]) => [
682
682
  h + t[a].pos[0],
683
- d + t[a].pos[1]
683
+ l + t[a].pos[1]
684
684
  ])
685
685
  }
686
686
  });
687
687
  }), (o = this.addwaveFromGroup) == null || o.eachChild((n, a) => {
688
688
  a = a || 0, !(!i[a] || !i[a].data) && n.attr({
689
689
  shape: {
690
- points: i[a].data.map(([h, d]) => [
690
+ points: i[a].data.map(([h, l]) => [
691
691
  h + i[a].pos[0],
692
- d + i[a].pos[1]
692
+ l + i[a].pos[1]
693
693
  ])
694
694
  }
695
695
  });
@@ -1 +1 @@
1
- "use strict";var W=Object.defineProperty,L=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var S=(e,t,i)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,w=(e,t)=>{for(var i in t||(t={}))y.call(t,i)&&S(e,i,t[i]);if(I)for(var i of I(t))F.call(t,i)&&S(e,i,t[i]);return e},C=(e,t)=>L(e,M(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("vue"),A=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const c=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("lodash"),p=require("@costy-plus/utils"),u=require("zrender"),P=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function b(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const x=P(H),G=b(u);var D=Object.defineProperty,O=Object.getOwnPropertyDescriptor,g=(e,t,i,s)=>{for(var o=s>1?void 0:s?O(t,i):t,n=e.length-1,a;n>=0;n--)(a=e[n])&&(o=(s?a(t,i,o):a(o))||o);return s&&o&&D(t,i,o),o};exports.default=class extends x.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,o,n,a,h,d,f,l;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(o=this.splitLineGroup)==null||o.removeAll(),(n=this.leadHeadNameGroup)==null||n.removeAll(),(a=this.leadHeadOffAndDelGroup)==null||a.removeAll(),(h=this.rulerGroup)==null||h.removeAll(),(d=this.arrowGroup)==null||d.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(l=this.sceneIns)==null||l.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd!==t?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),o=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(o||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points!==i?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd!==i?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=v.flattenDeep(this.waveLists);return{maxPoints:v.max(e)||0,minPoints:v.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new u.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new u.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new u.Group({name:"addwaveFrom"}),this.leadHeadGroup=new u.Group({name:"leadHead"}),this.splitLineGroup=new u.Group({name:"splitLine"}),this.leadHeadNameGroup=new u.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new u.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new u.Group({name:"ruler"}),this.arrowGroup=new u.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new u.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=p.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=G.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var n,a,h,d,f;(n=this.leadHeadGroup)==null||n.removeAll(),(a=this.sceneIns)==null||a.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let l=0;l<=this.leadModel.column;l++){s=l*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+s])break e;!this.waveConfigs[r-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[r-1+s]||"",this.waveConfigs[r-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[r-1+s].posX?this.waveConfigs[r-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(h=this.leadHeadGroup)==null||h.add(this.createLeadHead(i,this.waveConfigs[r-1+s].posY||r*this.splitBlockHeight,p.getSens(this.waveConfigs[r-1+s].gain,this.gridConfig.cellMg),t)))}}let o=null;for(let l=0;l<this.leadModel.add;l++)!this.waveConfigs[this.longLeadConfig.leadIdxs[l]]||(o=this.waveConfigs[this.longLeadConfig.leadIdxs[l]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l]]],t=!1,o.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=o.posX?o.posX-this.leadHeadConfig.leadHedeWidth:0,(d=this.leadHeadGroup)==null||d.add(this.createLeadHead(i,o.posY||(l+1+this.leadModel.line)*this.splitBlockHeight,p.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new u.Polyline({cursor:"",shape:{points:[[0+e,0+t],[o+e,0+t],[o+e,-i+t],[3*o+e,-i+t],[3*o+e,0+t],[4*o+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var n,a,h,d,f;(n=this.splitLineGroup)==null||n.removeAll(),(a=this.sceneIns)==null||a.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const l=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),r=p.getDataLenTimes(Math.ceil(this.splitPoint/(l||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${r/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(l||0)}let t=0,i=0,s=0,o=0;for(let l=1;l<=this.leadModel.column-1;l++){t=l*e+this.leadHeadConfig.leadHedeWidth,i=l*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+i])break e;if((this.waveConfigs||[])[r-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[r-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[r-1+i].posX),s=(this.waveConfigs||[])[r-1+i].leadIdx,s===void 0)break;o=p.getSens((this.waveConfigs||[])[r-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[r-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(d=this.splitLineGroup)==null||d.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)*.5,o))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new u.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,o;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new u.Text({cursor:"",style:w({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new u.Text({style:w({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(o=this.sceneIns)==null||o.add(t)}drawRuler(e=0){var a,h,d;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const f=p.getPointIdxForPx(this.splitPoint,n),l=p.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;o=e+l}for(let f=e;f<=o;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(a=this.rulerGroup)==null||a.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(h=this.rulerGroup)==null||h.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(d=this.sceneIns)==null||d.add(this.rulerGroup)}drawTopTimeLine(e=0){var d,f;if(this.timersCopy=e,!this.timeLineConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)s=t*5;else if(!this.leadModel.add&&o){const l=p.getPointIdxForPx(this.splitPoint,o),r=p.getDataLenTimes(l,this.rulerConfig.sampleRate||0)/1e3;s=e+r}const n=new Date(this.timeLineConfig.startLineTime).getTime()-new Date(this.timeLineConfig.startTime).getTime(),a=Math.floor(n/1e3),h=Math.floor((new Date(this.timeLineConfig.endLineTime).getTime()-new Date(this.timeLineConfig.startTime).getTime())/1e3);for(let l=e;l<=s;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l>=a&&l<=h&&((d=this.rulerGroup)==null||d.add(new u.Line({cursor:"",shape:{x1:i,y1:1,x2:i+this.rulerStep,y2:1},style:{stroke:this.timeLineConfig.color,lineWidth:1}})));(f=this.sceneIns)==null||f.add(this.rulerGroup)}timestampToTime(e=0){const t=new Date(e),i=t.getFullYear(),s=("0"+(t.getMonth()+1)).slice(-2),o=("0"+t.getDate()).slice(-2),n=("0"+t.getHours()).slice(-2),a=("0"+t.getMinutes()).slice(-2),h=("0"+t.getSeconds()).slice(-2);return`${i}-${s}-${o} ${n}:${a}:${h}`}drawTimeLine(e=0){var h,d,f;if(this.timersCopy=e,!this.timeConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.timeConfig.speed,this.gridConfig.cellMg,this.timeConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const l=p.getPointIdxForPx(this.splitPoint,n),r=p.getDataLenTimes(l,this.timeConfig.sampleRate||0)/1e3;o=e+r}const a=new Date(this.timeConfig.startTime).getTime();for(let l=e;l<=o;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l%1===0?(s=this.canvasContainer.height-10,(h=this.rulerGroup)==null||h.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:this.timestampToTime(a+l*1e3).slice(11),fontSize:13,fontFamily:this.fontFamily,fill:"#000"}})),(d=this.rulerGroup)==null||d.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#000",lineWidth:1}}))):s=this.canvasContainer.height-5;(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawTimeLine(this.timersCopy),this.drawTopTimeLine(this.timersCopy)}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const n=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),a=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),h=[],d=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let l=1;l<=d;l++)t=l*this.splitBlockHeight,l>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),l===1&&(this.loopArrowY.rowAndCol=t),h.push({pos:[e,t],startInd:s,endInd:o,step:n,sens:a,data:i.slice(s,o).map((r,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,a/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,a)).map((r,m)=>[m*(n||0),-r])})}return h}createSingleWaveFrom(){var n,a,h;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,o=0;for(let d=0;d<e.length&&!(e[d].pos[1]>this.drawArea.height+this.bottomAreaHeight);d++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(a=this.singleWaveFromGroup)==null||a.add(new u.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,shape:{points:e[d].data.map(([f,l],r)=>isNaN(l)?(o===0&&(o=r-1,o=o<0?0:o),[e[d].data[o][0]+e[d].pos[0],e[d].data[o][1]+e[d].pos[1]]):(o=0,[f+e[d].pos[0],l+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{console.log(11,f)}})),(h=this.singleWaveFromGroup)==null||h.add(new u.Text({cursor:"",style:{x:e[d].pos[0],y:e[d].pos[1]-(e[d].sens||0)/2,text:d===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),d>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[d].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,o=[],n=0,a=0;for(let h=0;h<this.leadModel.add;h++)s=this.longLeadConfig.leadIdxs[h],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,n=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),a=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(h+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],h===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:o.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((d,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,d,a/2):p.getActualY(this.waveConfigs[s].sensitivity,d,a)).map((d,f)=>[f*(n||0),-d]),sens:a,step:n}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new u.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([o,n],a)=>isNaN(n)?(t===0&&(t=a-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[o+e[s].pos[0],n+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{console.log(22,o)}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,n=0,a=this.slidingWindowInfo.startInd||0,h=this.slidingWindowInfo.endInd||0;const d=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(a=h,h=a+(this.slidingWindowInfo.points||0));for(let l=1;l<=this.leadModel.line&&(t=l*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));l++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,o=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),n=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(l===1&&(this.loopArrowY.rowAndCol=t),d.push({pos:[e,t],startInd:a,endInd:h,sens:n,step:o,data:s.slice(a,h).map((r,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,r,n/2):p.getActualY(this.waveConfigs[i].sensitivity,r,n)).map((r,m)=>[m*(o||0),-r])}),i++)}return d}createRowAndColWaveFrom(){var s,o;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let n=0;n<e.length;n++)t=this.waveConfigs[n].leadIdx||0,this.isLeadDel(t)||(o=this.rowAndColwaveFromGroup)==null||o.add(new u.Polyline({cursor:"",name:n+"_"+n,shape:{points:e[n].data.map(([a,h],d)=>isNaN(h)?(i===0&&(i=d-1,i=i<0?0:i),[e[n].data[i][0]+e[n].pos[0],e[n].data[i][1]+e[n].pos[1]]):(i=0,[a+e[n].pos[0],h+e[n].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{console.log(33,a)}})),n<this.leadModel.line?(this.createLeadName(t,e[n].pos[0],e[n].pos[1]-15),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2-15)):(this.createLeadName(t,e[n].pos[0]+5,e[n].pos[1]-(e[n].sens||0)/2),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new u.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:C(w({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:C(w({},n),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new u.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=p.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,o;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((n,a)=>{a=a||0,!(!t[a]||!t[a].data)&&n.attr({shape:{points:t[a].data.map(([h,d])=>[h+t[a].pos[0],d+t[a].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((n,a)=>{a=a||0,!(!i[a]||!i[a].data)&&n.attr({shape:{points:i[a].data.map(([h,d])=>[h+i[a].pos[0],d+i[a].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=p.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t),this.drawTimeLine(t),this.drawTopTimeLine(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup)}};g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);g([c.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"leadModel",2);g([c.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);g([c.Prop({default:()=>({isShow:!0,sampleRate:500,speed:10,gain:10,startTime:""})})],exports.default.prototype,"timeConfig",2);g([c.Prop({default:()=>({isShow:!1,sampleRate:500,speed:10,gain:10,startTime:"",startLineTime:"",endLineTime:"",color:""})})],exports.default.prototype,"timeLineConfig",2);g([c.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"gridConfig",2);g([c.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);g([c.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);g([c.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);g([c.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);g([c.Prop({default:()=>0})],exports.default.prototype,"posStart",2);g([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);g([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([A.default({name:"Methods"})],exports.default);
1
+ "use strict";var W=Object.defineProperty,L=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var S=(e,t,i)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,w=(e,t)=>{for(var i in t||(t={}))y.call(t,i)&&S(e,i,t[i]);if(I)for(var i of I(t))F.call(t,i)&&S(e,i,t[i]);return e},C=(e,t)=>L(e,M(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("vue"),A=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const c=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("lodash"),p=require("@costy-plus/utils"),u=require("zrender"),P=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function b(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const x=P(H),G=b(u);var D=Object.defineProperty,O=Object.getOwnPropertyDescriptor,g=(e,t,i,s)=>{for(var o=s>1?void 0:s?O(t,i):t,n=e.length-1,a;n>=0;n--)(a=e[n])&&(o=(s?a(t,i,o):a(o))||o);return s&&o&&D(t,i,o),o};exports.default=class extends x.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,o,n,a,h,l,f,r;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(o=this.splitLineGroup)==null||o.removeAll(),(n=this.leadHeadNameGroup)==null||n.removeAll(),(a=this.leadHeadOffAndDelGroup)==null||a.removeAll(),(h=this.rulerGroup)==null||h.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(r=this.sceneIns)==null||r.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd!==t?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),o=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(o||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points!==i?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd!==i?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=v.flattenDeep(this.waveLists);return{maxPoints:v.max(e)||0,minPoints:v.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new u.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new u.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new u.Group({name:"addwaveFrom"}),this.leadHeadGroup=new u.Group({name:"leadHead"}),this.splitLineGroup=new u.Group({name:"splitLine"}),this.leadHeadNameGroup=new u.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new u.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new u.Group({name:"ruler"}),this.arrowGroup=new u.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new u.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=p.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=G.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var n,a,h,l,f;(n=this.leadHeadGroup)==null||n.removeAll(),(a=this.sceneIns)==null||a.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let r=0;r<=this.leadModel.column;r++){s=r*this.leadModel.line;e:for(let d=1;d<=this.leadModel.line;d++){if(!(this.waveConfigs||[])[d-1+s])break e;!this.waveConfigs[d-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[d-1+s]||"",this.waveConfigs[d-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[d-1+s].posX?this.waveConfigs[d-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(h=this.leadHeadGroup)==null||h.add(this.createLeadHead(i,this.waveConfigs[d-1+s].posY||d*this.splitBlockHeight,p.getSens(this.waveConfigs[d-1+s].gain,this.gridConfig.cellMg),t)))}}let o=null;for(let r=0;r<this.leadModel.add;r++)!this.waveConfigs[this.longLeadConfig.leadIdxs[r]]||(o=this.waveConfigs[this.longLeadConfig.leadIdxs[r]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]],t=!1,o.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=o.posX?o.posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,o.posY||(r+1+this.leadModel.line)*this.splitBlockHeight,p.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new u.Polyline({cursor:"",shape:{points:[[0+e,0+t],[o+e,0+t],[o+e,-i+t],[3*o+e,-i+t],[3*o+e,0+t],[4*o+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var n,a,h,l,f;(n=this.splitLineGroup)==null||n.removeAll(),(a=this.sceneIns)==null||a.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const r=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),d=p.getDataLenTimes(Math.ceil(this.splitPoint/(r||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${d/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(r||0)}let t=0,i=0,s=0,o=0;for(let r=1;r<=this.leadModel.column-1;r++){t=r*e+this.leadHeadConfig.leadHedeWidth,i=r*this.leadModel.line;e:for(let d=1;d<=this.leadModel.line;d++){if(!(this.waveConfigs||[])[d-1+i])break e;if((this.waveConfigs||[])[d-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[d-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[d-1+i].posX),s=(this.waveConfigs||[])[d-1+i].leadIdx,s===void 0)break;o=p.getSens((this.waveConfigs||[])[d-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[d-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,((this.waveConfigs||[])[d-1+i].posY||d*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[d-1+i].posY||d*this.splitBlockHeight)-(o||0)*.5,o))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new u.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,o;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new u.Text({cursor:"",style:w({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new u.Text({style:w({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(o=this.sceneIns)==null||o.add(t)}drawRuler(e=0){var a,h,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const f=p.getPointIdxForPx(this.splitPoint,n),r=p.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;o=e+r}for(let f=e;f<=o;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(a=this.rulerGroup)==null||a.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(h=this.rulerGroup)==null||h.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(l=this.sceneIns)==null||l.add(this.rulerGroup)}drawTopTimeLine(e=0){var f,r;if(this.timersCopy=e,!this.timeLineConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)s=t*5;else if(!this.leadModel.add&&o){const d=p.getPointIdxForPx(this.splitPoint,o),m=p.getDataLenTimes(d,this.rulerConfig.sampleRate||0)/1e3;s=e+m}const n=new Date(this.timeLineConfig.startLineTime).getTime()-new Date(this.timeLineConfig.startTime).getTime(),a=Math.floor(n/100)/10,h=(new Date(this.timeLineConfig.endLineTime).getTime()-new Date(this.timeLineConfig.startTime).getTime())/100,l=Math.floor(h)/10;for(let d=e;d<=s;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d>=a&&d<=l&&((f=this.rulerGroup)==null||f.add(new u.Line({cursor:"",shape:{x1:i,y1:1,x2:i+this.rulerStep,y2:1},style:{stroke:this.timeLineConfig.color,lineWidth:1}})));(r=this.sceneIns)==null||r.add(this.rulerGroup)}timestampToTime(e=0){const t=new Date(e),i=t.getFullYear(),s=("0"+(t.getMonth()+1)).slice(-2),o=("0"+t.getDate()).slice(-2),n=("0"+t.getHours()).slice(-2),a=("0"+t.getMinutes()).slice(-2),h=("0"+t.getSeconds()).slice(-2);return`${i}-${s}-${o} ${n}:${a}:${h}`}drawTimeLine(e=0){var h,l,f;if(this.timersCopy=e,!this.timeConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.timeConfig.speed,this.gridConfig.cellMg,this.timeConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const r=p.getPointIdxForPx(this.splitPoint,n),d=p.getDataLenTimes(r,this.timeConfig.sampleRate||0)/1e3;o=e+d}const a=new Date(this.timeConfig.startTime).getTime();for(let r=e;r<=o;r=+(r+.1).toFixed(1))r!==e&&(i+=this.rulerStep),r%1===0?(s=this.canvasContainer.height-10,(h=this.rulerGroup)==null||h.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:this.timestampToTime(a+r*1e3).slice(11),fontSize:13,fontFamily:this.fontFamily,fill:"#000"}})),(l=this.rulerGroup)==null||l.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#000",lineWidth:1}}))):s=this.canvasContainer.height-5;(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawTimeLine(this.timersCopy),this.drawTopTimeLine(this.timersCopy)}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const n=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),a=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),h=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=l;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),h.push({pos:[e,t],startInd:s,endInd:o,step:n,sens:a,data:i.slice(s,o).map((d,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,d,a/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,d,a)).map((d,m)=>[m*(n||0),-d])})}return h}createSingleWaveFrom(){var n,a,h;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,o=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(a=this.singleWaveFromGroup)==null||a.add(new u.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,r],d)=>isNaN(r)?(o===0&&(o=d-1,o=o<0?0:o),[e[l].data[o][0]+e[l].pos[0],e[l].data[o][1]+e[l].pos[1]]):(o=0,[f+e[l].pos[0],r+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{console.log(11,f)}})),(h=this.singleWaveFromGroup)==null||h.add(new u.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,o=[],n=0,a=0;for(let h=0;h<this.leadModel.add;h++)s=this.longLeadConfig.leadIdxs[h],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,n=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),a=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(h+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],h===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:o.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((l,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,l,a/2):p.getActualY(this.waveConfigs[s].sensitivity,l,a)).map((l,f)=>[f*(n||0),-l]),sens:a,step:n}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new u.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([o,n],a)=>isNaN(n)?(t===0&&(t=a-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[o+e[s].pos[0],n+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{console.log(22,o)}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,n=0,a=this.slidingWindowInfo.startInd||0,h=this.slidingWindowInfo.endInd||0;const l=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(a=h,h=a+(this.slidingWindowInfo.points||0));for(let r=1;r<=this.leadModel.line&&(t=r*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));r++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,o=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),n=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(r===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:a,endInd:h,sens:n,step:o,data:s.slice(a,h).map((d,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,d,n/2):p.getActualY(this.waveConfigs[i].sensitivity,d,n)).map((d,m)=>[m*(o||0),-d])}),i++)}return l}createRowAndColWaveFrom(){var s,o;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let n=0;n<e.length;n++)t=this.waveConfigs[n].leadIdx||0,this.isLeadDel(t)||(o=this.rowAndColwaveFromGroup)==null||o.add(new u.Polyline({cursor:"",name:n+"_"+n,shape:{points:e[n].data.map(([a,h],l)=>isNaN(h)?(i===0&&(i=l-1,i=i<0?0:i),[e[n].data[i][0]+e[n].pos[0],e[n].data[i][1]+e[n].pos[1]]):(i=0,[a+e[n].pos[0],h+e[n].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{console.log(33,a)}})),n<this.leadModel.line?(this.createLeadName(t,e[n].pos[0],e[n].pos[1]-15),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2-15)):(this.createLeadName(t,e[n].pos[0]+5,e[n].pos[1]-(e[n].sens||0)/2),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new u.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:C(w({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:C(w({},n),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new u.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=p.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,o;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((n,a)=>{a=a||0,!(!t[a]||!t[a].data)&&n.attr({shape:{points:t[a].data.map(([h,l])=>[h+t[a].pos[0],l+t[a].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((n,a)=>{a=a||0,!(!i[a]||!i[a].data)&&n.attr({shape:{points:i[a].data.map(([h,l])=>[h+i[a].pos[0],l+i[a].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=p.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t),this.drawTimeLine(t),this.drawTopTimeLine(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup)}};g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);g([c.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"leadModel",2);g([c.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);g([c.Prop({default:()=>({isShow:!0,sampleRate:500,speed:10,gain:10,startTime:""})})],exports.default.prototype,"timeConfig",2);g([c.Prop({default:()=>({isShow:!1,sampleRate:500,speed:10,gain:10,startTime:"",startLineTime:"",endLineTime:"",color:""})})],exports.default.prototype,"timeLineConfig",2);g([c.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"gridConfig",2);g([c.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);g([c.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);g([c.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);g([c.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);g([c.Prop({default:()=>0})],exports.default.prototype,"posStart",2);g([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);g([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([A.default({name:"Methods"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.0.76-0",
3
+ "version": "1.0.77-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "description": "",
21
21
  "typings": "dist/lib/index.d.ts",
22
22
  "dependencies": {
23
- "@costy-plus/utils": "0.0.13-0",
23
+ "@costy-plus/utils": "workspace:*",
24
24
  "element-ui": "~2.15.11",
25
25
  "vuescroll": "4.17.5",
26
26
  "zrender": "5.4.0"