costy-plus 1.1.26-0 → 1.1.27-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.
@@ -1,4 +1,4 @@
1
- var l = function() {
1
+ var t = function() {
2
2
  var e = this, a = e.$createElement, i = e._self._c || a;
3
3
  return i("div", {
4
4
  style: {
@@ -17,6 +17,7 @@ var l = function() {
17
17
  "layer-id": e.prefixId + "MXGrid"
18
18
  }
19
19
  }), e.measurRulerConfig.isShow ? i("MXMeasuringRuler", e._g({
20
+ ref: e.prefixId + "_measuringRuler",
20
21
  staticClass: "measuring-ruler",
21
22
  attrs: {
22
23
  config: e.measurRulerConfig.config,
@@ -26,6 +27,9 @@ var l = function() {
26
27
  "speed-value": e.measurRulerConfig.speed || 0,
27
28
  sens: e.measurRulerConfig.sens || 0,
28
29
  "prefix-id": e.prefixId
30
+ },
31
+ on: {
32
+ notifyMeasurintRectPostion: e.handleNotifyMeasurintRectPostion
29
33
  }
30
34
  }, e.$listeners)) : e._e(), e.paralleRulerConfig.isShow ? i("MXParallelRuler", e._g({
31
35
  staticClass: "parallel-ruler",
@@ -96,8 +100,8 @@ var l = function() {
96
100
  height: `${e.vuescrollWH.height}px`
97
101
  }
98
102
  })])], 1)], 1);
99
- }, t = [];
103
+ }, l = [];
100
104
  export {
101
- l as render,
102
- t as staticRenderFns
105
+ t as render,
106
+ l as staticRenderFns
103
107
  };
@@ -162,6 +162,11 @@ export default class Methods extends Vue {
162
162
  protected init(): void;
163
163
  protected registPostStart(): void;
164
164
  protected resetScroll(val?: number): void;
165
+ protected handleNotifyMeasurintRectPostion(position: {
166
+ x: number;
167
+ y: number;
168
+ yEnd: number;
169
+ }): void;
165
170
  protected combinationDrawing(isInitConfigInfo?: boolean): void;
166
171
  /** 计算心拍 */
167
172
  protected calcHeartBeatPositions(): void;
@@ -1,21 +1,21 @@
1
1
  var V = Object.defineProperty, q = Object.defineProperties;
2
- var Y = Object.getOwnPropertyDescriptors;
3
- var $ = Object.getOwnPropertySymbols;
4
- var _ = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
2
+ var _ = Object.getOwnPropertyDescriptors;
3
+ var j = Object.getOwnPropertySymbols;
4
+ var Y = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
5
  var T = (e, t, i) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, W = (e, t) => {
6
6
  for (var i in t || (t = {}))
7
- _.call(t, i) && T(e, i, t[i]);
8
- if ($)
9
- for (var i of $(t))
7
+ Y.call(t, i) && T(e, i, t[i]);
8
+ if (j)
9
+ for (var i of j(t))
10
10
  E.call(t, i) && T(e, i, t[i]);
11
11
  return e;
12
- }, k = (e, t) => q(e, Y(t));
12
+ }, k = (e, t) => q(e, _(t));
13
13
  import K from "vue";
14
14
  import Q from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
15
15
  import "../../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";
16
16
  import { Prop as w } from "../../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";
17
17
  import { flattenDeep as U, max as Z, min as J } from "lodash";
18
- import { throttling as X, getStepForSpeed as H, getPrintLengthToPx as ee, getSens as M, getDataLenTimes as N, getPointIdxForPx as L, getActualY as x, calcMs as te, calcBpm as ie } from "@costy-plus/utils";
18
+ import { throttling as X, getStepForSpeed as H, getPrintLengthToPx as ee, getSens as L, getDataLenTimes as N, getPointIdxForPx as M, getActualY as x, calcMs as te, calcBpm as ie } from "@costy-plus/utils";
19
19
  import * as se from "zrender";
20
20
  import { Group as S, Polyline as O, Line as z, Text as y, Polygon as ae, util as oe } from "zrender";
21
21
  var ne = Object.defineProperty, le = Object.getOwnPropertyDescriptor, c = (e, t, i, s) => {
@@ -81,6 +81,10 @@ let u = class extends K {
81
81
  });
82
82
  }) : (this.scrollWaveFrom(e), this.scrollRuler(e), this.scrollArrow(e));
83
83
  }
84
+ handleNotifyMeasurintRectPostion(e) {
85
+ let t = null;
86
+ this.leadModel.isSingleMode && this.singleWaveFromGroup ? (t = (this.singleWaveFromGroup._children || []).find((i) => i.rectContain(e.x, e.y) || i.rectContain(e.x, e.yEnd)), console.log("handleNotifyMeasurintRectPostion333333", t)) : (t = (this.rowAndColwaveFromGroup._children || []).find((i) => i.rectContain(e.x, e.y) || i.rectContain(e.x, e.yEnd)), t || (t = (this.addwaveFromGroup._children || []).find((i) => i.rectContain(e.x, e.y) || i.rectContain(e.x, e.yEnd))), console.log("handleNotifyMeasurintRectPostion44444", t)), t && this.$emit("notifyMeasurintConfig", t.sens);
87
+ }
84
88
  combinationDrawing(e = !0) {
85
89
  e && (this.drawLeadHead(), this.drawColSplitLine(), this.initSlidingWindowInfo(), this.drawRulerNotes()), this.drawWaveFrom();
86
90
  }
@@ -228,7 +232,7 @@ let u = class extends K {
228
232
  this.createLeadHead(
229
233
  0,
230
234
  this.waveConfigs[l - 1].posY || l * this.splitBlockHeight,
231
- M(this.waveConfigs[l - 1].isFixedSquareWaveSize ? this.waveConfigs[l - 1].fixedSquareWaveSizeGain : this.waveConfigs[l - 1].gain, this.gridConfig.cellMg),
235
+ L(this.waveConfigs[l - 1].isFixedSquareWaveSize ? this.waveConfigs[l - 1].fixedSquareWaveSizeGain : this.waveConfigs[l - 1].gain, this.gridConfig.cellMg),
232
236
  t
233
237
  )
234
238
  ));
@@ -239,7 +243,7 @@ let u = class extends K {
239
243
  this.createLeadHead(
240
244
  0,
241
245
  ((o = this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]]) == null ? void 0 : o.posY) || l * this.splitBlockHeight,
242
- M(this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].isFixedSquareWaveSize ? this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].fixedSquareWaveSizeGain : this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].gain, this.gridConfig.cellMg),
246
+ L(this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].isFixedSquareWaveSize ? this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].fixedSquareWaveSizeGain : this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].gain, this.gridConfig.cellMg),
243
247
  t
244
248
  )
245
249
  ));
@@ -310,7 +314,7 @@ let u = class extends K {
310
314
  break e;
311
315
  if ((this.waveConfigs || [])[g - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[g - 1 + i].posX), s = (this.waveConfigs || [])[g - 1 + i].leadIdx, s === void 0)
312
316
  break;
313
- a = M((this.waveConfigs || [])[g - 1 + i].isFixedSquareWaveSize ? (this.waveConfigs || [])[g - 1 + i].fixedSquareWaveSizeGain : (this.waveConfigs || [])[g - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[g - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (h = this.splitLineGroup) == null || h.add(
317
+ a = L((this.waveConfigs || [])[g - 1 + i].isFixedSquareWaveSize ? (this.waveConfigs || [])[g - 1 + i].fixedSquareWaveSizeGain : (this.waveConfigs || [])[g - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[g - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (h = this.splitLineGroup) == null || h.add(
314
318
  this.creatSplitLine(
315
319
  t,
316
320
  ((this.waveConfigs || [])[g - 1 + i].posY || g * this.splitBlockHeight) - (a || 0) / 2 * 0.5,
@@ -377,7 +381,7 @@ let u = class extends K {
377
381
  if (this.leadModel.isContinuous)
378
382
  a = t * 5;
379
383
  else if (!this.leadModel.add && o) {
380
- const d = L(this.splitPoint * (this.leadModel.column || 1), o), r = N(d, this.rulerConfig.sampleRate || 0) / 1e3;
384
+ const d = M(this.splitPoint * (this.leadModel.column || 1), o), r = N(d, this.rulerConfig.sampleRate || 0) / 1e3;
381
385
  a = e + r;
382
386
  }
383
387
  for (let d = e; d <= a; d = +(d + 0.1).toFixed(1))
@@ -418,7 +422,7 @@ let u = class extends K {
418
422
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
419
423
  this.gridConfig.cellMg,
420
424
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
421
- ), n = M(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [], l = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
425
+ ), n = L(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [], l = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
422
426
  for (let d = 0; d < 1; d++) {
423
427
  e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
424
428
  for (let r = 1; r <= l; r++)
@@ -443,6 +447,7 @@ let u = class extends K {
443
447
  this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (s = parseInt(`${t / 1e3 / 60}`, 10), a = parseInt(`${t / 1e3 % 60}`, 10), s = a === 60 ? s += 1 : s, s = s === 0 ? "00" : s < 10 ? `0${s}` : s, a = a === 0 || a === 60 ? "00" : a < 10 ? `0${a}` : a, (h = this.singleWaveFromGroup) == null || h.add(new O({
444
448
  cursor: "",
445
449
  name: this.singleModeConfig.defaultSelect + "_" + d,
450
+ sens: e[d].sens,
446
451
  shape: {
447
452
  points: e[d].data.map(([r, g], v) => isNaN(g) ? (o === 0 && (o = v - 1, o = o < 0 ? 0 : o), [
448
453
  e[d].data[o][0] + e[d].pos[0],
@@ -487,7 +492,7 @@ let u = class extends K {
487
492
  this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect] || null, this.drawHeardBeatLine());
488
493
  let t = 0, i = 0;
489
494
  if (this.leadModel.add) {
490
- const C = M(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain, this.gridConfig.cellMg);
495
+ const C = L(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain, this.gridConfig.cellMg);
491
496
  i = this.loopArrowY.add - (C || 0) - this.splitBlockHeight / 3.5;
492
497
  } else
493
498
  i = 20;
@@ -527,10 +532,10 @@ let u = class extends K {
527
532
  fill: ((g = (r = this.currentHeardBeat) == null ? void 0 : r.heardBeat) == null ? void 0 : g.index) === (f == null ? void 0 : f.index) ? "blue" : "#ccc"
528
533
  },
529
534
  onclick: (R) => {
530
- var j;
535
+ var $;
531
536
  !this.heartFight.mode && !this.heartFight.isClickArrow || (R.target.attr({
532
537
  style: { fill: "blue" }
533
- }), (j = this.arrowGroup) == null || j.children().filter((G) => G.name === "arrow_box").forEach((G) => {
538
+ }), ($ = this.arrowGroup) == null || $.children().filter((G) => G.name === "arrow_box").forEach((G) => {
534
539
  G.id !== R.target.id && G.attr({
535
540
  style: { fill: "#ccc" }
536
541
  });
@@ -668,7 +673,7 @@ let u = class extends K {
668
673
  const e = [];
669
674
  let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, a = [], o = 0, n = 0;
670
675
  for (let h = 0; h < this.leadModel.add; h++)
671
- s = this.longLeadConfig.leadIdxs[h], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, o = H(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = M(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (h + this.leadModel.line + 1) * this.splitBlockHeight, a = this.waveLists[s] || [], h === 0 && (this.loopArrowY.add = i), e.push({
676
+ s = this.longLeadConfig.leadIdxs[h], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, o = H(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = L(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (h + this.leadModel.line + 1) * this.splitBlockHeight, a = this.waveLists[s] || [], h === 0 && (this.loopArrowY.add = i), e.push({
672
677
  pos: [t, i],
673
678
  startInd: this.addSlidingWindowInfo.startInd || 0,
674
679
  endInd: this.addSlidingWindowInfo.endInd || 0,
@@ -686,6 +691,7 @@ let u = class extends K {
686
691
  this.isLeadDel(this.longLeadConfig.leadIdxs[a]) || ((s = this.addwaveFromGroup) == null || s.add(new O({
687
692
  cursor: "",
688
693
  name: this.longLeadConfig.leadIdxs[a] + "_" + a,
694
+ sens: e[a].sens,
689
695
  shape: {
690
696
  points: e[a].data.map(([o, n], h) => isNaN(n) ? (t === 0 && (t = h - 1, t = t < 0 ? 0 : t), [
691
697
  e[a].data[t][0] + e[a].pos[0],
@@ -714,7 +720,7 @@ let u = class extends K {
714
720
  for (let d = 0; d < this.leadModel.column; d++) {
715
721
  e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && d > 0 && (n = h, h = n + (this.slidingWindowInfo.points || 0));
716
722
  for (let r = 1; r <= this.leadModel.line && (t = r * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); r++)
717
- e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = H(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), o = M(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), l.push({
723
+ e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = H(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), o = L(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), l.push({
718
724
  pos: [e, t],
719
725
  startInd: n,
720
726
  endInd: h,
@@ -733,6 +739,7 @@ let u = class extends K {
733
739
  t = this.waveConfigs[o].leadIdx || 0, this.isLeadDel(t) || (a = this.rowAndColwaveFromGroup) == null || a.add(new O({
734
740
  cursor: "",
735
741
  name: o + "_" + o,
742
+ sens: e[o].sens,
736
743
  shape: {
737
744
  points: e[o].data.map(([n, h], l) => isNaN(h) ? (i === 0 && (i = l - 1, i = i < 0 ? 0 : i), [
738
745
  e[o].data[i][0] + e[o].pos[0],
@@ -820,7 +827,7 @@ let u = class extends K {
820
827
  e.event.preventDefault(), e.event.stopPropagation(), console.log("onContextmenu", e);
821
828
  const i = e.target.name.split("_"), s = +i[1];
822
829
  let a = 0, o = 0, n = 0, h = 0, l = 0;
823
- t === "single" ? (a = e.offsetX - this.singleWaveDataCopy[s].pos[0], o = this.singleWaveDataCopy[s].startInd, n = L(a, this.singleWaveDataCopy[s].step || 1), h = this.singleWaveDataCopy[s].sens, l = this.singleWaveDataCopy[s].step) : t === "rowAndCol" ? (a = e.offsetX - this.waveDataCopy[s].pos[0], o = this.waveDataCopy[s].startInd || 0, n = L(a, this.waveDataCopy[s].step || 1), h = this.waveDataCopy[s].sens, l = this.waveDataCopy[s].step) : t === "add" && (a = e.offsetX - this.addWaveDataCopy[s].pos[0], o = this.addWaveDataCopy[s].startInd || 0, n = L(a, this.addWaveDataCopy[s].step || 1), h = this.addWaveDataCopy[s].sens, l = this.addWaveDataCopy[s].step), n += o, this.$emit("notifyOnContextmenu", {
830
+ t === "single" ? (a = e.offsetX - this.singleWaveDataCopy[s].pos[0], o = this.singleWaveDataCopy[s].startInd, n = M(a, this.singleWaveDataCopy[s].step || 1), h = this.singleWaveDataCopy[s].sens, l = this.singleWaveDataCopy[s].step) : t === "rowAndCol" ? (a = e.offsetX - this.waveDataCopy[s].pos[0], o = this.waveDataCopy[s].startInd || 0, n = M(a, this.waveDataCopy[s].step || 1), h = this.waveDataCopy[s].sens, l = this.waveDataCopy[s].step) : t === "add" && (a = e.offsetX - this.addWaveDataCopy[s].pos[0], o = this.addWaveDataCopy[s].startInd || 0, n = M(a, this.addWaveDataCopy[s].step || 1), h = this.addWaveDataCopy[s].sens, l = this.addWaveDataCopy[s].step), n += o, this.$emit("notifyOnContextmenu", {
824
831
  sens: h,
825
832
  step: l,
826
833
  activeLeadIdx: +i[0],
@@ -838,7 +845,7 @@ let u = class extends K {
838
845
  this.activeLeadIdx = +a[0];
839
846
  const o = +a[1];
840
847
  let n = 0, h = 0, l = 0, d = 0, r = 0;
841
- t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[o].pos[0], h = this.singleWaveDataCopy[o].startInd, l = L(n, this.singleWaveDataCopy[o].step || 1), d = this.singleWaveDataCopy[o].sens, r = this.singleWaveDataCopy[o].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[o].pos[0], h = this.waveDataCopy[o].startInd || 0, l = L(n, this.waveDataCopy[o].step || 1), d = this.waveDataCopy[o].sens, r = this.waveDataCopy[o].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[o].pos[0], h = this.addWaveDataCopy[o].startInd || 0, l = L(n, this.addWaveDataCopy[o].step || 1), d = this.addWaveDataCopy[o].sens, r = this.addWaveDataCopy[o].step), l += h, this.$emit("notifyActiveEnlargr", {
848
+ t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[o].pos[0], h = this.singleWaveDataCopy[o].startInd, l = M(n, this.singleWaveDataCopy[o].step || 1), d = this.singleWaveDataCopy[o].sens, r = this.singleWaveDataCopy[o].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[o].pos[0], h = this.waveDataCopy[o].startInd || 0, l = M(n, this.waveDataCopy[o].step || 1), d = this.waveDataCopy[o].sens, r = this.waveDataCopy[o].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[o].pos[0], h = this.addWaveDataCopy[o].startInd || 0, l = M(n, this.addWaveDataCopy[o].step || 1), d = this.addWaveDataCopy[o].sens, r = this.addWaveDataCopy[o].step), l += h, this.$emit("notifyActiveEnlargr", {
842
849
  sens: d,
843
850
  step: r,
844
851
  activeLeadIdx: this.activeLeadIdx,
@@ -854,7 +861,7 @@ let u = class extends K {
854
861
  t.type === "horizontal" && (t.scrollLeft = t.scrollLeft || 0, this.scrollCommon(t.scrollLeft));
855
862
  }
856
863
  scrollCommon(e) {
857
- const t = L(e, this.publicStep || 1);
864
+ const t = M(e, this.publicStep || 1);
858
865
  this.scrollWaveFrom(t), this.scrollRuler(t), this.scrollArrow(t), this.$emit("notifyScrollPointIdx", {
859
866
  slidIdxs: t,
860
867
  scrollLeft: e
@@ -29,12 +29,13 @@ declare class MXMeasuringRuler extends Vue {
29
29
  x: number;
30
30
  y: number;
31
31
  }>;
32
+ protected WatchSens(newVal: number, oldVal: number): void;
32
33
  protected destroyed(): void;
33
34
  protected created(): void;
34
35
  protected initConfig(): void;
35
36
  protected mounted(): void;
36
37
  protected init(): void;
37
- protected calcText(): void;
38
+ protected calcText(isWatch?: boolean): void;
38
39
  protected circleHideOrShow(isShow: boolean): void;
39
40
  protected sceneAddToEventListener(): void;
40
41
  protected sceneRemoveEventListener(): void;
@@ -3,20 +3,24 @@ import C from "vue";
3
3
  import E from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
4
4
  import "../../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";
5
5
  import { Prop as f } from "../../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";
6
- import { Text as O, Group as Y, Rect as y, Circle as F, init as j } from "zrender";
7
- import { calcMs as T, calcMV as $, calcBpm as k } from "@costy-plus/utils";
8
- var S = Object.defineProperty, G = Object.getOwnPropertyDescriptor, l = (t, e, s, h) => {
6
+ import { Watch as O } from "../../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/Watch.js";
7
+ import { Text as Y, Group as S, Rect as I, Circle as F, init as T } from "zrender";
8
+ import { calcMs as W, calcMV as $, calcBpm as j } from "@costy-plus/utils";
9
+ var k = Object.defineProperty, G = Object.getOwnPropertyDescriptor, l = (t, e, s, h) => {
9
10
  for (var c = h > 1 ? void 0 : h ? G(e, s) : e, a = t.length - 1, i; a >= 0; a--)
10
11
  (i = t[a]) && (c = (h ? i(e, s, c) : i(c)) || c);
11
- return h && c && S(e, s, c), c;
12
+ return h && c && k(e, s, c), c;
12
13
  };
13
- let o = class extends C {
14
+ let n = class extends C {
14
15
  constructor() {
15
16
  super(...arguments), this.sceneIns = Object.freeze(null), this.measuringRulerGroup = Object.freeze(null), this.rectIns = Object.freeze(null), this.textIns = Object.freeze(null), this.fontFamily = Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"), this.circleList = Object.freeze([]), this.isMouseDown = Object.freeze(!1), this.originReactPostion = Object.freeze([]), this.circleDragPos = Object.freeze({
16
17
  x: 0,
17
18
  y: 0
18
19
  });
19
20
  }
21
+ WatchSens(t, e) {
22
+ t !== e && this.calcText(!0);
23
+ }
20
24
  destroyed() {
21
25
  var t, e;
22
26
  (t = this.measuringRulerGroup) == null || t.removeAll(), (e = this.sceneIns) == null || e.dispose();
@@ -28,7 +32,7 @@ let o = class extends C {
28
32
  this.circleList = [], this.circleDragPos = {
29
33
  x: 0,
30
34
  y: 0
31
- }, this.textIns = new O({
35
+ }, this.textIns = new Y({
32
36
  style: {
33
37
  lineHeight: this.config.textFontSize + 4,
34
38
  fontSize: this.config.textFontSize,
@@ -36,9 +40,9 @@ let o = class extends C {
36
40
  fontFamily: this.fontFamily,
37
41
  fontWeight: "bold"
38
42
  }
39
- }), this.measuringRulerGroup = new Y({
43
+ }), this.measuringRulerGroup = new S({
40
44
  name: "measuringRuler"
41
- }), this.rectIns = new y({
45
+ }), this.rectIns = new I({
42
46
  name: "rect",
43
47
  style: {
44
48
  stroke: this.config.stroke,
@@ -55,7 +59,7 @@ let o = class extends C {
55
59
  let t;
56
60
  const e = ["nw-resize", "ne-resize", "se-resize", "sw-resize", "n-resize", "e-resize", "s-resize", "w-resize"];
57
61
  for (let s = 0; s < 8; s++)
58
- s > 3 ? t = new y({
62
+ s > 3 ? t = new I({
59
63
  name: `${s}_circle`,
60
64
  style: {
61
65
  stroke: this.config.circleLinestroke,
@@ -84,7 +88,7 @@ let o = class extends C {
84
88
  draggable: !0
85
89
  }), t.hide(), this.measuringRulerGroup.add(t), this.circleList.push(t);
86
90
  this.measuringRulerGroup.add(
87
- new y({
91
+ new I({
88
92
  name: "main-box",
89
93
  style: {
90
94
  fill: "transparent"
@@ -107,31 +111,36 @@ let o = class extends C {
107
111
  const t = document.getElementById(
108
112
  `${this.prefixId}mx-measuring-ruler`
109
113
  );
110
- this.sceneIns = j(t, {
114
+ this.sceneIns = T(t, {
111
115
  width: this.width,
112
116
  height: this.height,
113
117
  devicePixelRatio: 2
114
118
  }), (e = this.sceneIns) == null || e.add(this.measuringRulerGroup), this.sceneAddToEventListener(), this.rectAddToEventListener(), this.circleAddToEventListener();
115
119
  }
116
- calcText() {
117
- var h, c, a, i, r, n, g, p;
118
- const t = T(
119
- ((h = this.rectIns) == null ? void 0 : h.shape.width) || 0,
120
+ calcText(t) {
121
+ var c, a, i, r, o, p, g, u, y, x, d, m;
122
+ !t && this.config.isDragSens && this.$emit("notifyMeasurintRectPostion", {
123
+ x: ((c = this.rectIns) == null ? void 0 : c.shape.x) || 0 + (this.rectIns.x || 0),
124
+ y: ((a = this.rectIns) == null ? void 0 : a.shape.y) + (this.rectIns.y || 0),
125
+ yEnd: ((i = this.rectIns) == null ? void 0 : i.shape.y) + (this.rectIns.y || 0) + (((r = this.rectIns) == null ? void 0 : r.shape.height) || 0)
126
+ });
127
+ const e = W(
128
+ ((o = this.rectIns) == null ? void 0 : o.shape.width) || 0,
120
129
  this.speedValue,
121
130
  this.cellMg,
122
131
  this.magnification
123
- ), e = $(
124
- ((c = this.rectIns) == null ? void 0 : c.shape.height) || 0,
132
+ ), s = $(
133
+ ((p = this.rectIns) == null ? void 0 : p.shape.height) || 0,
125
134
  this.sens,
126
135
  this.magnification
127
- ), s = t !== 0 && k(t) || 0;
128
- (p = this.textIns) == null || p.attr({
136
+ ), h = e !== 0 && j(e) || 0;
137
+ (m = this.textIns) == null || m.attr({
129
138
  style: {
130
- text: `${t} ms
131
- ${s} bpm
132
- ${e} mV`,
133
- x: (((a = this.rectIns) == null ? void 0 : a.x) || 0) + (((i = this.rectIns) == null ? void 0 : i.shape.x) || 0) + (((r = this.rectIns) == null ? void 0 : r.shape.width) || 0) + 20,
134
- y: (((n = this.rectIns) == null ? void 0 : n.y) || 0) + (((g = this.rectIns) == null ? void 0 : g.shape.y) || 0)
139
+ text: `${e} ms
140
+ ${h} bpm
141
+ ${s} mV`,
142
+ x: (((g = this.rectIns) == null ? void 0 : g.x) || 0) + (((u = this.rectIns) == null ? void 0 : u.shape.x) || 0) + (((y = this.rectIns) == null ? void 0 : y.shape.width) || 0) + 20,
143
+ y: (((x = this.rectIns) == null ? void 0 : x.y) || 0) + (((d = this.rectIns) == null ? void 0 : d.shape.y) || 0)
135
144
  }
136
145
  });
137
146
  }
@@ -150,8 +159,8 @@ let o = class extends C {
150
159
  });
151
160
  };
152
161
  (s = this.sceneIns) == null || s.on("contextmenu", t), (h = this.sceneIns) == null || h.on("mousedown", this.sceneMousedown), (c = this.sceneIns) == null || c.on("mousemove", this.scenemousemove), (a = this.sceneIns) == null || a.on("mouseup", this.scenemouseup), (i = this.sceneIns) == null || i.on("dblclick", e), this.$once("hook:beforeDestroy", () => {
153
- var r, n, g, p, u;
154
- (r = this.sceneIns) == null || r.off("contextmenu", t), (n = this.sceneIns) == null || n.off("mousedown", this.sceneMousedown), (g = this.sceneIns) == null || g.off("mousemove", this.scenemousemove), (p = this.sceneIns) == null || p.off("mouseup", this.scenemouseup), (u = this.sceneIns) == null || u.off("dblclick", e);
162
+ var r, o, p, g, u;
163
+ (r = this.sceneIns) == null || r.off("contextmenu", t), (o = this.sceneIns) == null || o.off("mousedown", this.sceneMousedown), (p = this.sceneIns) == null || p.off("mousemove", this.scenemousemove), (g = this.sceneIns) == null || g.off("mouseup", this.scenemouseup), (u = this.sceneIns) == null || u.off("dblclick", e);
155
164
  });
156
165
  }
157
166
  sceneRemoveEventListener() {
@@ -177,7 +186,7 @@ let o = class extends C {
177
186
  });
178
187
  }
179
188
  scenemouseup(t) {
180
- var e, s, h, c, a, i, r, n, g, p, u, x, d, m, I, L, w, v, D, b, z, R, P, M, X;
189
+ var e, s, h, c, a, i, r, o, p, g, u, y, x, d, m, L, w, D, v, b, z, R, P, M, X;
181
190
  this.isMouseDown = !1, (e = this.rectIns) == null || e.attr({
182
191
  shape: {
183
192
  width: t.offsetX - this.rectIns.shape.x,
@@ -190,24 +199,24 @@ let o = class extends C {
190
199
  x: t.offsetX - (((c = this.rectIns) == null ? void 0 : c.shape.x) || 0) + (((a = this.rectIns) == null ? void 0 : a.shape.x) || 0),
191
200
  y: (i = this.rectIns) == null ? void 0 : i.shape.y
192
201
  }), this.circleList[2].attr({
193
- x: t.offsetX - (((r = this.rectIns) == null ? void 0 : r.shape.x) || 0) + (((n = this.rectIns) == null ? void 0 : n.shape.x) || 0),
194
- y: t.offsetY - (((g = this.rectIns) == null ? void 0 : g.shape.y) || 0) + (((p = this.rectIns) == null ? void 0 : p.shape.y) || 0)
202
+ x: t.offsetX - (((r = this.rectIns) == null ? void 0 : r.shape.x) || 0) + (((o = this.rectIns) == null ? void 0 : o.shape.x) || 0),
203
+ y: t.offsetY - (((p = this.rectIns) == null ? void 0 : p.shape.y) || 0) + (((g = this.rectIns) == null ? void 0 : g.shape.y) || 0)
195
204
  }), this.circleList[3].attr({
196
205
  x: (u = this.rectIns) == null ? void 0 : u.shape.x,
197
- y: t.offsetY - (((x = this.rectIns) == null ? void 0 : x.shape.y) || 0) + (((d = this.rectIns) == null ? void 0 : d.shape.y) || 0)
206
+ y: t.offsetY - (((y = this.rectIns) == null ? void 0 : y.shape.y) || 0) + (((x = this.rectIns) == null ? void 0 : x.shape.y) || 0)
198
207
  }), this.circleList[4].attr({
199
- x: ((m = this.rectIns) == null ? void 0 : m.shape.x) + 12,
200
- y: ((I = this.rectIns) == null ? void 0 : I.shape.y) - 1,
208
+ x: ((d = this.rectIns) == null ? void 0 : d.shape.x) + 12,
209
+ y: ((m = this.rectIns) == null ? void 0 : m.shape.y) - 1,
201
210
  shape: {
202
211
  width: t.offsetX - this.rectIns.shape.x - 24,
203
212
  height: 2
204
213
  }
205
214
  }), this.circleList[5].attr({
206
215
  x: t.offsetX - (((L = this.rectIns) == null ? void 0 : L.shape.x) || 0) + (((w = this.rectIns) == null ? void 0 : w.shape.x) || 0) - 1,
207
- y: ((v = this.rectIns) == null ? void 0 : v.shape.y) + 12,
216
+ y: ((D = this.rectIns) == null ? void 0 : D.shape.y) + 12,
208
217
  shape: {
209
218
  width: 2,
210
- height: t.offsetY - ((D = this.rectIns) == null ? void 0 : D.shape.y) - 24
219
+ height: t.offsetY - ((v = this.rectIns) == null ? void 0 : v.shape.y) - 24
211
220
  }
212
221
  }), this.circleList[6].attr({
213
222
  x: ((b = this.rectIns) == null ? void 0 : b.shape.x) + 12,
@@ -265,7 +274,7 @@ let o = class extends C {
265
274
  console.log("circleDragStart--\u8FD9\u91CC", t), this.circleDragPos.x = t.offsetX, this.circleDragPos.y = t.offsetY;
266
275
  }
267
276
  circleDrag(t) {
268
- var n;
277
+ var o;
269
278
  console.log("circleDrag--\u8FD9\u91CC", t);
270
279
  const e = parseInt(t.target.name);
271
280
  if (isNaN(e))
@@ -430,7 +439,7 @@ let o = class extends C {
430
439
  }
431
440
  }), this.circleList[7].attr({
432
441
  y: a + 12
433
- })), (n = this.rectIns) == null || n.attr({
442
+ })), (o = this.rectIns) == null || o.attr({
434
443
  shape: {
435
444
  x: c,
436
445
  y: a,
@@ -444,21 +453,21 @@ l([
444
453
  f({
445
454
  default: () => ""
446
455
  })
447
- ], o.prototype, "prefixId", 2);
456
+ ], n.prototype, "prefixId", 2);
448
457
  l([
449
458
  f({
450
459
  required: !0,
451
460
  type: Number,
452
461
  validator: (t) => typeof t == "number"
453
462
  })
454
- ], o.prototype, "width", 2);
463
+ ], n.prototype, "width", 2);
455
464
  l([
456
465
  f({
457
466
  required: !0,
458
467
  type: Number,
459
468
  validator: (t) => typeof t == "number"
460
469
  })
461
- ], o.prototype, "height", 2);
470
+ ], n.prototype, "height", 2);
462
471
  l([
463
472
  f({
464
473
  default: () => ({
@@ -470,35 +479,38 @@ l([
470
479
  textFontSize: 12
471
480
  })
472
481
  })
473
- ], o.prototype, "config", 2);
482
+ ], n.prototype, "config", 2);
474
483
  l([
475
484
  f({
476
485
  required: !0
477
486
  })
478
- ], o.prototype, "speedValue", 2);
487
+ ], n.prototype, "speedValue", 2);
479
488
  l([
480
489
  f({
481
490
  required: !0
482
491
  })
483
- ], o.prototype, "cellMg", 2);
492
+ ], n.prototype, "cellMg", 2);
484
493
  l([
485
494
  f({
486
495
  default: 1
487
496
  })
488
- ], o.prototype, "magnification", 2);
497
+ ], n.prototype, "magnification", 2);
489
498
  l([
490
499
  f({
491
500
  default: 1
492
501
  })
493
- ], o.prototype, "sens", 2);
502
+ ], n.prototype, "sens", 2);
494
503
  l([
495
504
  f({ default: () => "" })
496
- ], o.prototype, "className", 2);
497
- o = l([
505
+ ], n.prototype, "className", 2);
506
+ l([
507
+ O("sens")
508
+ ], n.prototype, "WatchSens", 1);
509
+ n = l([
498
510
  E({
499
511
  name: "MXMeasuringRuler"
500
512
  })
501
- ], o);
513
+ ], n);
502
514
  export {
503
- o as default
515
+ n as default
504
516
  };
@@ -11,4 +11,6 @@ export interface MXMeasuringRulerConfig {
11
11
  textColor: string;
12
12
  /** 文案 fontSize */
13
13
  textFontSize: number;
14
- }
14
+ /** 是否拖动测量当前对应波形sens */
15
+ isDragSens?: boolean;
16
+ }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{style:{width:`${e.width}px`,height:`${e.height}px`},attrs:{id:"common-wave-form-main"}},[i("MXBackgroundGrid",{attrs:{width:e.canvasContainer.width,height:e.canvasContainer.height,"grid-config":e.gridConfig,model:e.gridConfig.model,"layer-id":e.prefixId+"MXGrid"}}),e.measurRulerConfig.isShow?i("MXMeasuringRuler",e._g({staticClass:"measuring-ruler",attrs:{config:e.measurRulerConfig.config,width:e.canvasContainer.width,height:e.canvasContainer.height,"cell-mg":e.gridConfig.cellMg,"speed-value":e.measurRulerConfig.speed||0,sens:e.measurRulerConfig.sens||0,"prefix-id":e.prefixId}},e.$listeners)):e._e(),e.paralleRulerConfig.isShow?i("MXParallelRuler",e._g({staticClass:"parallel-ruler",attrs:{width:e.canvasContainer.width,height:e.canvasContainer.height,"cell-mg":e.gridConfig.cellMg,"speed-value":e.paralleRulerConfig.speed||0,sens:e.paralleRulerConfig.sens||0,"heart-rate":e.paralleRulerConfig.heartRate,"prefix-id":e.prefixId}},e.$listeners)):e._e(),e.magnifierRulerConfig.isShow?i("MXMagnifierWave",e._g({staticClass:"magnifier-wave",attrs:{"prefix-id":e.prefixId,width:e.canvasContainer.width,height:e.canvasContainer.height,"grid-config":e.gridConfig,"speed-value":e.magnifierRulerConfig.speed||0,"lead-head-config":e.leadHeadConfig,"wave-data":e.waveDataCopy,"add-wave-data":e.addWaveDataCopy,"single-wave-data":e.singleWaveDataCopy,"long-lead-config":e.longLeadConfig,"split-block-height":e.splitBlockHeight,"split-point":e.splitPoint,"lead-config":e.leadConfig,"heart-fight":e.heartFight,"normal-lead-names":e.leadNameList,"lead-names":e.leadNames}},e.$listeners)):e._e(),i("div",{staticClass:"wave-from-box_container",attrs:{id:e.prefixId+"wave-from-box"}}),i("div",{staticClass:"scroll-box",style:{width:`${e.width}px`,height:`${e.height}px`}},[e.scrollConfig.isNativeScroll?i("div",{ref:e.prefixId+"nativeScroll",staticClass:"native-scroll",on:{scroll:e.nativeScrollFunc}},[i("div",{staticClass:"scroll-empty",style:{width:`${e.vuescrollWH.width}px`,height:`${e.vuescrollWH.height}px`}})]):i("vueScroll",{ref:e.prefixId+"vueScroll",attrs:{ops:e.scrollConfig},on:{"handle-scroll":e.handleScroll}},[i("div",{staticClass:"scroll-empty",style:{width:`${e.vuescrollWH.width}px`,height:`${e.vuescrollWH.height}px`}})])],1)],1)},l=[];exports.render=t;exports.staticRenderFns=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{style:{width:`${e.width}px`,height:`${e.height}px`},attrs:{id:"common-wave-form-main"}},[i("MXBackgroundGrid",{attrs:{width:e.canvasContainer.width,height:e.canvasContainer.height,"grid-config":e.gridConfig,model:e.gridConfig.model,"layer-id":e.prefixId+"MXGrid"}}),e.measurRulerConfig.isShow?i("MXMeasuringRuler",e._g({ref:e.prefixId+"_measuringRuler",staticClass:"measuring-ruler",attrs:{config:e.measurRulerConfig.config,width:e.canvasContainer.width,height:e.canvasContainer.height,"cell-mg":e.gridConfig.cellMg,"speed-value":e.measurRulerConfig.speed||0,sens:e.measurRulerConfig.sens||0,"prefix-id":e.prefixId},on:{notifyMeasurintRectPostion:e.handleNotifyMeasurintRectPostion}},e.$listeners)):e._e(),e.paralleRulerConfig.isShow?i("MXParallelRuler",e._g({staticClass:"parallel-ruler",attrs:{width:e.canvasContainer.width,height:e.canvasContainer.height,"cell-mg":e.gridConfig.cellMg,"speed-value":e.paralleRulerConfig.speed||0,sens:e.paralleRulerConfig.sens||0,"heart-rate":e.paralleRulerConfig.heartRate,"prefix-id":e.prefixId}},e.$listeners)):e._e(),e.magnifierRulerConfig.isShow?i("MXMagnifierWave",e._g({staticClass:"magnifier-wave",attrs:{"prefix-id":e.prefixId,width:e.canvasContainer.width,height:e.canvasContainer.height,"grid-config":e.gridConfig,"speed-value":e.magnifierRulerConfig.speed||0,"lead-head-config":e.leadHeadConfig,"wave-data":e.waveDataCopy,"add-wave-data":e.addWaveDataCopy,"single-wave-data":e.singleWaveDataCopy,"long-lead-config":e.longLeadConfig,"split-block-height":e.splitBlockHeight,"split-point":e.splitPoint,"lead-config":e.leadConfig,"heart-fight":e.heartFight,"normal-lead-names":e.leadNameList,"lead-names":e.leadNames}},e.$listeners)):e._e(),i("div",{staticClass:"wave-from-box_container",attrs:{id:e.prefixId+"wave-from-box"}}),i("div",{staticClass:"scroll-box",style:{width:`${e.width}px`,height:`${e.height}px`}},[e.scrollConfig.isNativeScroll?i("div",{ref:e.prefixId+"nativeScroll",staticClass:"native-scroll",on:{scroll:e.nativeScrollFunc}},[i("div",{staticClass:"scroll-empty",style:{width:`${e.vuescrollWH.width}px`,height:`${e.vuescrollWH.height}px`}})]):i("vueScroll",{ref:e.prefixId+"vueScroll",attrs:{ops:e.scrollConfig},on:{"handle-scroll":e.handleScroll}},[i("div",{staticClass:"scroll-empty",style:{width:`${e.vuescrollWH.width}px`,height:`${e.vuescrollWH.height}px`}})])],1)],1)},r=[];exports.render=t;exports.staticRenderFns=r;
@@ -162,6 +162,11 @@ export default class Methods extends Vue {
162
162
  protected init(): void;
163
163
  protected registPostStart(): void;
164
164
  protected resetScroll(val?: number): void;
165
+ protected handleNotifyMeasurintRectPostion(position: {
166
+ x: number;
167
+ y: number;
168
+ yEnd: number;
169
+ }): void;
165
170
  protected combinationDrawing(isInitConfigInfo?: boolean): void;
166
171
  /** 计算心拍 */
167
172
  protected calcHeartBeatPositions(): void;
@@ -1 +1 @@
1
- "use strict";var O=Object.defineProperty,R=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var N=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))z.call(t,i)&&N(e,i,t[i]);if(B)for(var i of B(t))T.call(t,i)&&N(e,i,t[i]);return e},b=(e,t)=>R(e,k(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),_=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"),D=require("lodash"),p=require("@costy-plus/utils"),c=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function X(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 q=$(j),V=X(c);var Y=Object.defineProperty,E=Object.getOwnPropertyDescriptor,w=(e,t,i,s)=>{for(var a=s>1?void 0:s?E(t,i):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(a=(s?n(t,i,a):n(a))||a);return s&&a&&Y(t,i,a),a};exports.default=class extends q.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(60),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.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},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,a,o,n,r,l,d,h;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(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(r=this.rulerGroup)==null||r.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(d=this.heardBeatLineGroup)==null||d.removeAll(),(h=this.sceneIns)==null||h.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.calcHeartBeatPositions(),this.initConfig()}init(){this.calcHeartBeatPositions(),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(e=!0){e&&(this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes()),this.drawWaveFrom()}calcHeartBeatPositions(){this.heartBeatPosition=[];let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate,interval:Math.round(60/(this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate)*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:(this.slidingWindowInfo.startInd||0)+t},this.slidingWindowInfo.endInd>this.dataTotalLength&&(this.slidingWindowInfo.endInd=this.dataTotalLength),this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points!==i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:(this.addSlidingWindowInfo.endInd||0)+i},this.addSlidingWindowInfo.endInd>this.dataTotalLength&&(this.addSlidingWindowInfo.endInd=this.dataTotalLength)}calcHighestAndLowestPoint(){const e=D.flattenDeep(this.waveLists);return{maxPoints:D.max(e)||0,minPoints:D.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new c.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new c.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new c.Group({name:"addwaveFrom"}),this.leadHeadGroup=new c.Group({name:"leadHead"}),this.splitLineGroup=new c.Group({name:"splitLine"}),this.leadHeadNameGroup=new c.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new c.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new c.Group({name:"ruler"}),this.arrowGroup=new c.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new c.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-30},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.currentHeardBeat={heardBeat:null,ele:null},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=V.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:1});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 i,s,a,o,n,r;(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.leadHeadGroup);let e="",t=!1;e:for(let l=1;l<=this.totalRows;l++){if(t=!1,!(this.waveConfigs||[])[l-1])break e;if(!!this.waveConfigs[l-1].isShowLeadHead){if(l<=this.leadModel.line)e=(this.leadNames||[])[l-1]||"",this.waveConfigs[l-1].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((a=this.leadHeadGroup)==null||a.add(this.createLeadHead(0,this.waveConfigs[l-1].posY||l*this.splitBlockHeight,p.getSens(this.waveConfigs[l-1].isFixedSquareWaveSize?this.waveConfigs[l-1].fixedSquareWaveSizeGain:this.waveConfigs[l-1].gain,this.gridConfig.cellMg),t)));else if(l>this.leadModel.line&&l-this.leadModel.line<=this.leadModel.add){if(!this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])continue;e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l-this.leadModel.line-1]]],this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((n=this.leadHeadGroup)==null||n.add(this.createLeadHead(0,((o=this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])==null?void 0:o.posY)||l*this.splitBlockHeight,p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].isFixedSquareWaveSize?this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].fixedSquareWaveSizeGain:this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gain,this.gridConfig.cellMg),t)))}}}(r=this.sceneIns)==null||r.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const a=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new c.Polyline({cursor:"",shape:{points:[[0+e,0+t],[a+e,0+t],[a+e,-i+t],[3*a+e,-i+t],[3*a+e,0+t],[4*a+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var o,n,r,l,d;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const h=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),g=p.getDataLenTimes(Math.ceil(this.splitPoint/(h||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),I=parseInt(`${g/1e3%60}`,10);this.splitPoint=I*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(h||0)}let t=0,i=0,s=0,a=0;for(let h=1;h<=this.leadModel.column-1;h++){t=h*e+this.leadHeadConfig.leadHedeWidth,i=h*this.leadModel.line;e:for(let g=1;g<=this.leadModel.line;g++){if(!(this.waveConfigs||[])[g-1+i])break e;if((this.waveConfigs||[])[g-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[g-1+i].posX),s=(this.waveConfigs||[])[g-1+i].leadIdx,s===void 0)break;a=p.getSens((this.waveConfigs||[])[g-1+i].isFixedSquareWaveSize?(this.waveConfigs||[])[g-1+i].fixedSquareWaveSizeGain:(this.waveConfigs||[])[g-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[g-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[g-1+i].posY||g*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[g-1+i].posY||g*this.splitBlockHeight)-(a||0)*.5,a))}}(d=this.sceneIns)==null||d.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new c.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,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new c.Text({cursor:"",style:y({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new c.Text({style:y({text:this.rulerConfig.renderText||`${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),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,r,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes*2;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const d=p.getPointIdxForPx(this.splitPoint*(this.leadModel.column||1),o),h=p.getDataLenTimes(d,this.rulerConfig.sampleRate||0)/1e3;a=e+h}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new c.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.add(new c.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)}drawWaveFrom(){var e,t,i,s,a;(e=this.leadHeadNameGroup)==null||e.removeAll(),(t=this.leadHeadOffAndDelGroup)==null||t.removeAll(),this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(i=this.sceneIns)==null||i.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(s=this.sceneIns)==null||s.add(this.rowAndColwaveFromGroup),(a=this.sceneIns)==null||a.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(this.drawLoopArrowStartPosIdx)}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let d=0;d<1;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let h=1;h<=l;h++)t=h*this.splitBlockHeight,h>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),h===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((g,I)=>this.waveConfigs[this.singleModeConfig.defaultSelect].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,g,n/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,g,n)).map((g,I)=>[I*(o||0),-g])})}return r}createSingleWaveFrom(){var n,r,l;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=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)||(s=parseInt(`${t/1e3/60}`,10),a=parseInt(`${t/1e3%60}`,10),s=a===60?s+=1:s,s=s===0?"00":s<10?`0${s}`:s,a=a===0||a===60?"00":a<10?`0${a}`:a,(r=this.singleWaveFromGroup)==null||r.add(new c.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,shape:{points:e[d].data.map(([h,g],I)=>isNaN(g)?(o===0&&(o=I-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,[h+e[d].pos[0],g+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"single")},oncontextmenu:h=>{this.onContextmenu(h,"single")}})),t/1e3<this.dataTotalTimes&&((l=this.singleWaveFromGroup)==null||l.add(new c.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":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),d>0&&(t+=i)),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.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens,e[0].pos[0]-10,e[0].pos[1]+10);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var h,g,I,W,x,L,H,M,F,S,v,u;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const m=p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(m||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let n=0,r=0;const l=p.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0;for(let m=0;m<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;m++){const f=this.heartBeatPosition[this.heartFight.showIdxPai][m];if(d=((f==null?void 0:f.position)||0)-e,!(e>((f==null?void 0:f.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))){if(((f==null?void 0:f.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=d*(l||0)+this.leadHeadConfig.leadHedeWidth-8.5,a=0,(I=this.arrowGroup)==null||I.add(new c.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[13+t,0+i],[13+t,10+i],[17+t,10+i],[8.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((g=(h=this.currentHeardBeat)==null?void 0:h.heardBeat)==null?void 0:g.index)===(f==null?void 0:f.index)?"blue":"#ccc"},onclick:A=>{var G;!this.heartFight.mode&&!this.heartFight.isClickArrow||(A.target.attr({style:{fill:"blue"}}),(G=this.arrowGroup)==null||G.children().filter(P=>P.name==="arrow_box").forEach(P=>{P.id!==A.target.id&&P.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(f,A.target))}})),this.heartFight.heartrate&&(n=f==null?void 0:f.heartrate,this.heartFight.isHeartRateCalculatedBasedOnInterval&&m!==0&&(r=p.calcMs(Math.abs((f==null?void 0:f.position)*(l||0)-this.heartBeatPosition[this.heartFight.showIdxPai][m-1].position*(l||0)),this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,1),n=r!==0&&p.calcBpm(r)||0),s=((W=this.AssistCtx)==null?void 0:W.measureText(`${n||""}`).width)||0,(x=this.arrowGroup)==null||x.add(new c.Text({cursor:"",style:y({x:4+t-s*1.4,y:a+i,text:`${n||""}`},o)})),a+=12),this.heartFight.interval&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(f==null?void 0:f.interval)||""}`).width)||0,(H=this.arrowGroup)==null||H.add(new c.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(f==null?void 0:f.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((M=this.AssistCtx)==null?void 0:M.measureText(`${(f==null?void 0:f.qrstCompany)||""}`).width)||0,(F=this.arrowGroup)==null||F.add(new c.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(f==null?void 0:f.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((S=this.AssistCtx)==null?void 0:S.measureText(`${(f==null?void 0:f.telectricalaxis)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new c.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(f==null?void 0:f.telectricalaxis)||""}`},o)})))}}(u=this.sceneIns)==null||u.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",c.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var a,o,n,r,l,d,h,g,I,W,x,L,H,M,F;if(!this.currentHeardBeat.heardBeat)return;(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.heardBeatLineGroup);let t={},i=0,s;if(this.leadModel.isSingleMode){let S=this.getRednerSinglePoints();e:for(let v=0;v<S.length;v++){if(v>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((d=(l=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:l[this.currentHeardBeat.heardBeat.index])==null?void 0:d.KeyPosByBeat)||t;else{let u=this.analyseValues.find(m=>{var f;return(f=m[this.currentHeardBeat.heardBeat.index])==null?void 0:f.KeyPosByBeat});if(!u)break e;u&&(t=(r=u[this.currentHeardBeat.heardBeat.index])==null?void 0:r.KeyPosByBeat),u=null}for(const u in t)if(this.heardBeatLineKeys.includes(u)){if(i=(t[u]-this.slidingWindowInfo.startInd)*(S[v].step||0),this.isLeadOff(v)||this.isLeadDel(v))continue;if(!this.leadModel.isContinuous&&t[u]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=S[v],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.singleModeConfig.defaultSelect+"_"+v,"single"))}}S=null}else{let S=this.getRednerPoints(),v=this.getAddRednerPoints();e:for(let u=0;u<S.length;u++){t=((I=(g=this.analyseValues[u])==null?void 0:g[this.currentHeardBeat.heardBeat.index])==null?void 0:I.KeyPosByBeat)||t;for(const m in t)if(this.heardBeatLineKeys.includes(m)&&Object.prototype.hasOwnProperty.call(t,m)){if(i=(t[m]-this.slidingWindowInfo.startInd)*(S[u].step||0),this.isLeadOff(u)||this.isLeadDel(u))continue;if(e>t[m]||!this.leadModel.isContinuous&&t[m]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=S[u],this.leadModel.isContinuous&&u>this.leadModel.line-1))break e;(W=this.heardBeatLineGroup)==null||W.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],u+"_"+u,"rowAndCol"))}}e:for(let u=0;u<v.length;u++)if(!!((x=this.analyseValues[u])!=null&&x[this.currentHeardBeat.heardBeat.index])){t=((H=(L=this.analyseValues[u])==null?void 0:L[this.currentHeardBeat.heardBeat.index])==null?void 0:H.KeyPosByBeat)||t;for(const m in t)if(this.heardBeatLineKeys.includes(m)){if(i=(t[m]-this.slidingWindowInfo.startInd)*(v[u].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[u])&&this.isLeadDel(this.longLeadConfig.leadIdxs[u]))continue;if(e>t[m])break e;s=v[u],(M=this.heardBeatLineGroup)==null||M.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.longLeadConfig.leadIdxs[u]+"_"+u,"add"))}}S=null,v=null}(F=this.sceneIns)==null||F.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t,i,s){return new c.Line({name:i,cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1},oncontextmenu:a=>{this.onContextmenu(a,s)}})}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,a=[],o=0,n=0;for(let r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(r+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],r===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((l,d)=>this.waveConfigs[s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,l,n/2):p.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,d)=>[d*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i,s;(i=this.addwaveFromGroup)==null||i.removeAll();let e=this.getAddRednerPoints(),t=0;for(let a=0;a<e.length;a++)this.isLeadDel(this.longLeadConfig.leadIdxs[a])||((s=this.addwaveFromGroup)==null||s.add(new c.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[a]+"_"+a,shape:{points:e[a].data.map(([o,n],r)=>isNaN(n)?(t===0&&(t=r-1,t=t<0?0:t),[e[a].data[t][0]+e[a].pos[0],e[a].data[t][1]+e[a].pos[1]]):(t=0,[o+e[a].pos[0],n+e[a].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{this.onDbClickWaveFrom(o,"add")},oncontextmenu:o=>{this.onContextmenu(o,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[a],e[a].pos[0],e[a].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[a],e[a].pos[0]-5,e[a].pos[1]-(e[a].sens||0)/2-15),this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens,e[a].pos[0],e[a].pos[1]-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const l=[];for(let d=0;d<this.leadModel.column;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&d>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let h=1;h<=this.leadModel.line&&(t=h*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));h++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(h===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((g,I)=>this.waveConfigs[i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,g,o/2):p.getActualY(this.waveConfigs[i].sensitivity,g,o)).map((g,I)=>[I*(a||0),-g])}),i++)}return l}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new c.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,r],l)=>isNaN(r)?(i===0&&(i=l-1,i=i<0?0:i),[e[o].data[i][0]+e[o].pos[0],e[o].data[i][1]+e[o].pos[1]]):(i=0,[n+e[o].pos[0],r+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")},oncontextmenu:n=>{this.onContextmenu(n,"rowAndCol")}})),o<this.leadModel.line?(console.log("this.leadNames[LeadNameTextIdx]1111",this.leadNames[t],e[o].pos[1],e[o].sens),this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15),this.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15)):(console.log("this.leadNames[LeadNameTextIdx]2222",this.leadNames[t],e[o].pos[1],e[o].sens),this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-40),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9),this.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15));this.waveDataCopy=e,e=null}createLeadSensNams(e,t,i){var a;let s=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),i=i+40),(a=this.leadHeadNameGroup)==null||a.add(new c.Text({style:{x:s,y:i,text:e,fontSize:this.leadConfig.squareWaveSensFontSize||this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}))}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i),i=i+20,console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i)),(o=this.leadHeadNameGroup)==null||o.add(new c.Text({style:{x:a,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:b(y({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:b(y({},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 c.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onContextmenu(e,t){e.event.preventDefault(),e.event.stopPropagation(),console.log("onContextmenu",e);const i=e.target.name.split("_"),s=+i[1];let a=0,o=0,n=0,r=0,l=0;t==="single"?(a=e.offsetX-this.singleWaveDataCopy[s].pos[0],o=this.singleWaveDataCopy[s].startInd,n=p.getPointIdxForPx(a,this.singleWaveDataCopy[s].step||1),r=this.singleWaveDataCopy[s].sens,l=this.singleWaveDataCopy[s].step):t==="rowAndCol"?(a=e.offsetX-this.waveDataCopy[s].pos[0],o=this.waveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.waveDataCopy[s].step||1),r=this.waveDataCopy[s].sens,l=this.waveDataCopy[s].step):t==="add"&&(a=e.offsetX-this.addWaveDataCopy[s].pos[0],o=this.addWaveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.addWaveDataCopy[s].step||1),r=this.addWaveDataCopy[s].sens,l=this.addWaveDataCopy[s].step),n+=o,this.$emit("notifyOnContextmenu",{sens:r,step:l,activeLeadIdx:+i[0],pointIdx:n,offsetX:e.offsetX,offsetY:e.offsetY,pageX:e.event.pageX,pageY:e.event.pageY})}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,r=0,l=0,d=0,h=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,l=p.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),d=this.singleWaveDataCopy[o].sens,h=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.waveDataCopy[o].step||1),d=this.waveDataCopy[o].sens,h=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),d=this.addWaveDataCopy[o].sens,h=this.addWaveDataCopy[o].step),l+=r,this.$emit("notifyActiveEnlargr",{sens:d,step:h,activeLeadIdx:this.activeLeadIdx,pointIdx:l})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}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,a;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((o,n)=>{n=n||0,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([r,l])=>[r+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([r,l])=>[r+i[n].pos[0],l+i[n].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)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};w([C.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);w([C.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"leadModel",2);w([C.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);w([C.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"gridConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,isClickArrow:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);w([C.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);w([C.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);w([C.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);w([C.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);w([C.Prop({default:()=>0})],exports.default.prototype,"posStart",2);w([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);w([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=w([_.default({name:"Methods"})],exports.default);
1
+ "use strict";var O=Object.defineProperty,R=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var N=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))z.call(t,i)&&N(e,i,t[i]);if(B)for(var i of B(t))T.call(t,i)&&N(e,i,t[i]);return e},b=(e,t)=>R(e,k(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),_=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"),D=require("lodash"),p=require("@costy-plus/utils"),c=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function X(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 q=$(j),V=X(c);var Y=Object.defineProperty,E=Object.getOwnPropertyDescriptor,w=(e,t,i,s)=>{for(var a=s>1?void 0:s?E(t,i):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(a=(s?n(t,i,a):n(a))||a);return s&&a&&Y(t,i,a),a};exports.default=class extends q.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(60),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.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},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,a,o,n,r,l,d,h;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(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(r=this.rulerGroup)==null||r.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(d=this.heardBeatLineGroup)==null||d.removeAll(),(h=this.sceneIns)==null||h.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.calcHeartBeatPositions(),this.initConfig()}init(){this.calcHeartBeatPositions(),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))}handleNotifyMeasurintRectPostion(e){let t=null;this.leadModel.isSingleMode&&this.singleWaveFromGroup?(t=(this.singleWaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd)),console.log("handleNotifyMeasurintRectPostion333333",t)):(t=(this.rowAndColwaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd)),t||(t=(this.addwaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd))),console.log("handleNotifyMeasurintRectPostion44444",t)),t&&this.$emit("notifyMeasurintConfig",t.sens)}combinationDrawing(e=!0){e&&(this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes()),this.drawWaveFrom()}calcHeartBeatPositions(){this.heartBeatPosition=[];let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate,interval:Math.round(60/(this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate)*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:(this.slidingWindowInfo.startInd||0)+t},this.slidingWindowInfo.endInd>this.dataTotalLength&&(this.slidingWindowInfo.endInd=this.dataTotalLength),this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points!==i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:(this.addSlidingWindowInfo.endInd||0)+i},this.addSlidingWindowInfo.endInd>this.dataTotalLength&&(this.addSlidingWindowInfo.endInd=this.dataTotalLength)}calcHighestAndLowestPoint(){const e=D.flattenDeep(this.waveLists);return{maxPoints:D.max(e)||0,minPoints:D.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new c.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new c.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new c.Group({name:"addwaveFrom"}),this.leadHeadGroup=new c.Group({name:"leadHead"}),this.splitLineGroup=new c.Group({name:"splitLine"}),this.leadHeadNameGroup=new c.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new c.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new c.Group({name:"ruler"}),this.arrowGroup=new c.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new c.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-30},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.currentHeardBeat={heardBeat:null,ele:null},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=V.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:1});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 i,s,a,o,n,r;(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.leadHeadGroup);let e="",t=!1;e:for(let l=1;l<=this.totalRows;l++){if(t=!1,!(this.waveConfigs||[])[l-1])break e;if(!!this.waveConfigs[l-1].isShowLeadHead){if(l<=this.leadModel.line)e=(this.leadNames||[])[l-1]||"",this.waveConfigs[l-1].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((a=this.leadHeadGroup)==null||a.add(this.createLeadHead(0,this.waveConfigs[l-1].posY||l*this.splitBlockHeight,p.getSens(this.waveConfigs[l-1].isFixedSquareWaveSize?this.waveConfigs[l-1].fixedSquareWaveSizeGain:this.waveConfigs[l-1].gain,this.gridConfig.cellMg),t)));else if(l>this.leadModel.line&&l-this.leadModel.line<=this.leadModel.add){if(!this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])continue;e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l-this.leadModel.line-1]]],this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((n=this.leadHeadGroup)==null||n.add(this.createLeadHead(0,((o=this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])==null?void 0:o.posY)||l*this.splitBlockHeight,p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].isFixedSquareWaveSize?this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].fixedSquareWaveSizeGain:this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gain,this.gridConfig.cellMg),t)))}}}(r=this.sceneIns)==null||r.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const a=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new c.Polyline({cursor:"",shape:{points:[[0+e,0+t],[a+e,0+t],[a+e,-i+t],[3*a+e,-i+t],[3*a+e,0+t],[4*a+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var o,n,r,l,d;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const h=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),g=p.getDataLenTimes(Math.ceil(this.splitPoint/(h||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),I=parseInt(`${g/1e3%60}`,10);this.splitPoint=I*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(h||0)}let t=0,i=0,s=0,a=0;for(let h=1;h<=this.leadModel.column-1;h++){t=h*e+this.leadHeadConfig.leadHedeWidth,i=h*this.leadModel.line;e:for(let g=1;g<=this.leadModel.line;g++){if(!(this.waveConfigs||[])[g-1+i])break e;if((this.waveConfigs||[])[g-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[g-1+i].posX),s=(this.waveConfigs||[])[g-1+i].leadIdx,s===void 0)break;a=p.getSens((this.waveConfigs||[])[g-1+i].isFixedSquareWaveSize?(this.waveConfigs||[])[g-1+i].fixedSquareWaveSizeGain:(this.waveConfigs||[])[g-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[g-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[g-1+i].posY||g*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[g-1+i].posY||g*this.splitBlockHeight)-(a||0)*.5,a))}}(d=this.sceneIns)==null||d.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new c.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,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new c.Text({cursor:"",style:y({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new c.Text({style:y({text:this.rulerConfig.renderText||`${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),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,r,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes*2;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const d=p.getPointIdxForPx(this.splitPoint*(this.leadModel.column||1),o),h=p.getDataLenTimes(d,this.rulerConfig.sampleRate||0)/1e3;a=e+h}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new c.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.add(new c.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)}drawWaveFrom(){var e,t,i,s,a;(e=this.leadHeadNameGroup)==null||e.removeAll(),(t=this.leadHeadOffAndDelGroup)==null||t.removeAll(),this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(i=this.sceneIns)==null||i.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(s=this.sceneIns)==null||s.add(this.rowAndColwaveFromGroup),(a=this.sceneIns)==null||a.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(this.drawLoopArrowStartPosIdx)}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let d=0;d<1;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let h=1;h<=l;h++)t=h*this.splitBlockHeight,h>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),h===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((g,I)=>this.waveConfigs[this.singleModeConfig.defaultSelect].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,g,n/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,g,n)).map((g,I)=>[I*(o||0),-g])})}return r}createSingleWaveFrom(){var n,r,l;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=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)||(s=parseInt(`${t/1e3/60}`,10),a=parseInt(`${t/1e3%60}`,10),s=a===60?s+=1:s,s=s===0?"00":s<10?`0${s}`:s,a=a===0||a===60?"00":a<10?`0${a}`:a,(r=this.singleWaveFromGroup)==null||r.add(new c.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,sens:e[d].sens,shape:{points:e[d].data.map(([h,g],I)=>isNaN(g)?(o===0&&(o=I-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,[h+e[d].pos[0],g+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"single")},oncontextmenu:h=>{this.onContextmenu(h,"single")}})),t/1e3<this.dataTotalTimes&&((l=this.singleWaveFromGroup)==null||l.add(new c.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":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),d>0&&(t+=i)),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.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens,e[0].pos[0]-10,e[0].pos[1]+10);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var h,g,I,W,x,L,H,M,F,S,v,u;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const m=p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(m||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let n=0,r=0;const l=p.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0;for(let m=0;m<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;m++){const f=this.heartBeatPosition[this.heartFight.showIdxPai][m];if(d=((f==null?void 0:f.position)||0)-e,!(e>((f==null?void 0:f.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))){if(((f==null?void 0:f.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=d*(l||0)+this.leadHeadConfig.leadHedeWidth-8.5,a=0,(I=this.arrowGroup)==null||I.add(new c.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[13+t,0+i],[13+t,10+i],[17+t,10+i],[8.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((g=(h=this.currentHeardBeat)==null?void 0:h.heardBeat)==null?void 0:g.index)===(f==null?void 0:f.index)?"blue":"#ccc"},onclick:A=>{var G;!this.heartFight.mode&&!this.heartFight.isClickArrow||(A.target.attr({style:{fill:"blue"}}),(G=this.arrowGroup)==null||G.children().filter(P=>P.name==="arrow_box").forEach(P=>{P.id!==A.target.id&&P.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(f,A.target))}})),this.heartFight.heartrate&&(n=f==null?void 0:f.heartrate,this.heartFight.isHeartRateCalculatedBasedOnInterval&&m!==0&&(r=p.calcMs(Math.abs((f==null?void 0:f.position)*(l||0)-this.heartBeatPosition[this.heartFight.showIdxPai][m-1].position*(l||0)),this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,1),n=r!==0&&p.calcBpm(r)||0),s=((W=this.AssistCtx)==null?void 0:W.measureText(`${n||""}`).width)||0,(x=this.arrowGroup)==null||x.add(new c.Text({cursor:"",style:y({x:4+t-s*1.4,y:a+i,text:`${n||""}`},o)})),a+=12),this.heartFight.interval&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(f==null?void 0:f.interval)||""}`).width)||0,(H=this.arrowGroup)==null||H.add(new c.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(f==null?void 0:f.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((M=this.AssistCtx)==null?void 0:M.measureText(`${(f==null?void 0:f.qrstCompany)||""}`).width)||0,(F=this.arrowGroup)==null||F.add(new c.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(f==null?void 0:f.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((S=this.AssistCtx)==null?void 0:S.measureText(`${(f==null?void 0:f.telectricalaxis)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new c.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(f==null?void 0:f.telectricalaxis)||""}`},o)})))}}(u=this.sceneIns)==null||u.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",c.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var a,o,n,r,l,d,h,g,I,W,x,L,H,M,F;if(!this.currentHeardBeat.heardBeat)return;(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.heardBeatLineGroup);let t={},i=0,s;if(this.leadModel.isSingleMode){let S=this.getRednerSinglePoints();e:for(let v=0;v<S.length;v++){if(v>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((d=(l=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:l[this.currentHeardBeat.heardBeat.index])==null?void 0:d.KeyPosByBeat)||t;else{let u=this.analyseValues.find(m=>{var f;return(f=m[this.currentHeardBeat.heardBeat.index])==null?void 0:f.KeyPosByBeat});if(!u)break e;u&&(t=(r=u[this.currentHeardBeat.heardBeat.index])==null?void 0:r.KeyPosByBeat),u=null}for(const u in t)if(this.heardBeatLineKeys.includes(u)){if(i=(t[u]-this.slidingWindowInfo.startInd)*(S[v].step||0),this.isLeadOff(v)||this.isLeadDel(v))continue;if(!this.leadModel.isContinuous&&t[u]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=S[v],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.singleModeConfig.defaultSelect+"_"+v,"single"))}}S=null}else{let S=this.getRednerPoints(),v=this.getAddRednerPoints();e:for(let u=0;u<S.length;u++){t=((I=(g=this.analyseValues[u])==null?void 0:g[this.currentHeardBeat.heardBeat.index])==null?void 0:I.KeyPosByBeat)||t;for(const m in t)if(this.heardBeatLineKeys.includes(m)&&Object.prototype.hasOwnProperty.call(t,m)){if(i=(t[m]-this.slidingWindowInfo.startInd)*(S[u].step||0),this.isLeadOff(u)||this.isLeadDel(u))continue;if(e>t[m]||!this.leadModel.isContinuous&&t[m]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=S[u],this.leadModel.isContinuous&&u>this.leadModel.line-1))break e;(W=this.heardBeatLineGroup)==null||W.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],u+"_"+u,"rowAndCol"))}}e:for(let u=0;u<v.length;u++)if(!!((x=this.analyseValues[u])!=null&&x[this.currentHeardBeat.heardBeat.index])){t=((H=(L=this.analyseValues[u])==null?void 0:L[this.currentHeardBeat.heardBeat.index])==null?void 0:H.KeyPosByBeat)||t;for(const m in t)if(this.heardBeatLineKeys.includes(m)){if(i=(t[m]-this.slidingWindowInfo.startInd)*(v[u].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[u])&&this.isLeadDel(this.longLeadConfig.leadIdxs[u]))continue;if(e>t[m])break e;s=v[u],(M=this.heardBeatLineGroup)==null||M.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.longLeadConfig.leadIdxs[u]+"_"+u,"add"))}}S=null,v=null}(F=this.sceneIns)==null||F.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t,i,s){return new c.Line({name:i,cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1},oncontextmenu:a=>{this.onContextmenu(a,s)}})}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,a=[],o=0,n=0;for(let r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(r+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],r===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((l,d)=>this.waveConfigs[s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,l,n/2):p.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,d)=>[d*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i,s;(i=this.addwaveFromGroup)==null||i.removeAll();let e=this.getAddRednerPoints(),t=0;for(let a=0;a<e.length;a++)this.isLeadDel(this.longLeadConfig.leadIdxs[a])||((s=this.addwaveFromGroup)==null||s.add(new c.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[a]+"_"+a,sens:e[a].sens,shape:{points:e[a].data.map(([o,n],r)=>isNaN(n)?(t===0&&(t=r-1,t=t<0?0:t),[e[a].data[t][0]+e[a].pos[0],e[a].data[t][1]+e[a].pos[1]]):(t=0,[o+e[a].pos[0],n+e[a].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{this.onDbClickWaveFrom(o,"add")},oncontextmenu:o=>{this.onContextmenu(o,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[a],e[a].pos[0],e[a].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[a],e[a].pos[0]-5,e[a].pos[1]-(e[a].sens||0)/2-15),this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens,e[a].pos[0],e[a].pos[1]-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const l=[];for(let d=0;d<this.leadModel.column;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&d>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let h=1;h<=this.leadModel.line&&(t=h*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));h++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(h===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((g,I)=>this.waveConfigs[i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,g,o/2):p.getActualY(this.waveConfigs[i].sensitivity,g,o)).map((g,I)=>[I*(a||0),-g])}),i++)}return l}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new c.Polyline({cursor:"",name:o+"_"+o,sens:e[o].sens,shape:{points:e[o].data.map(([n,r],l)=>isNaN(r)?(i===0&&(i=l-1,i=i<0?0:i),[e[o].data[i][0]+e[o].pos[0],e[o].data[i][1]+e[o].pos[1]]):(i=0,[n+e[o].pos[0],r+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")},oncontextmenu:n=>{this.onContextmenu(n,"rowAndCol")}})),o<this.leadModel.line?(console.log("this.leadNames[LeadNameTextIdx]1111",this.leadNames[t],e[o].pos[1],e[o].sens),this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15),this.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15)):(console.log("this.leadNames[LeadNameTextIdx]2222",this.leadNames[t],e[o].pos[1],e[o].sens),this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-40),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9),this.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15));this.waveDataCopy=e,e=null}createLeadSensNams(e,t,i){var a;let s=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),i=i+40),(a=this.leadHeadNameGroup)==null||a.add(new c.Text({style:{x:s,y:i,text:e,fontSize:this.leadConfig.squareWaveSensFontSize||this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}))}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i),i=i+20,console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i)),(o=this.leadHeadNameGroup)==null||o.add(new c.Text({style:{x:a,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:b(y({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:b(y({},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 c.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onContextmenu(e,t){e.event.preventDefault(),e.event.stopPropagation(),console.log("onContextmenu",e);const i=e.target.name.split("_"),s=+i[1];let a=0,o=0,n=0,r=0,l=0;t==="single"?(a=e.offsetX-this.singleWaveDataCopy[s].pos[0],o=this.singleWaveDataCopy[s].startInd,n=p.getPointIdxForPx(a,this.singleWaveDataCopy[s].step||1),r=this.singleWaveDataCopy[s].sens,l=this.singleWaveDataCopy[s].step):t==="rowAndCol"?(a=e.offsetX-this.waveDataCopy[s].pos[0],o=this.waveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.waveDataCopy[s].step||1),r=this.waveDataCopy[s].sens,l=this.waveDataCopy[s].step):t==="add"&&(a=e.offsetX-this.addWaveDataCopy[s].pos[0],o=this.addWaveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.addWaveDataCopy[s].step||1),r=this.addWaveDataCopy[s].sens,l=this.addWaveDataCopy[s].step),n+=o,this.$emit("notifyOnContextmenu",{sens:r,step:l,activeLeadIdx:+i[0],pointIdx:n,offsetX:e.offsetX,offsetY:e.offsetY,pageX:e.event.pageX,pageY:e.event.pageY})}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,r=0,l=0,d=0,h=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,l=p.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),d=this.singleWaveDataCopy[o].sens,h=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.waveDataCopy[o].step||1),d=this.waveDataCopy[o].sens,h=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),d=this.addWaveDataCopy[o].sens,h=this.addWaveDataCopy[o].step),l+=r,this.$emit("notifyActiveEnlargr",{sens:d,step:h,activeLeadIdx:this.activeLeadIdx,pointIdx:l})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}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,a;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((o,n)=>{n=n||0,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([r,l])=>[r+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([r,l])=>[r+i[n].pos[0],l+i[n].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)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};w([C.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);w([C.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"leadModel",2);w([C.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);w([C.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"gridConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,isClickArrow:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);w([C.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);w([C.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);w([C.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);w([C.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);w([C.Prop({default:()=>0})],exports.default.prototype,"posStart",2);w([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);w([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=w([_.default({name:"Methods"})],exports.default);
@@ -29,12 +29,13 @@ declare class MXMeasuringRuler extends Vue {
29
29
  x: number;
30
30
  y: number;
31
31
  }>;
32
+ protected WatchSens(newVal: number, oldVal: number): void;
32
33
  protected destroyed(): void;
33
34
  protected created(): void;
34
35
  protected initConfig(): void;
35
36
  protected mounted(): void;
36
37
  protected init(): void;
37
- protected calcText(): void;
38
+ protected calcText(isWatch?: boolean): void;
38
39
  protected circleHideOrShow(isShow: boolean): void;
39
40
  protected sceneAddToEventListener(): void;
40
41
  protected sceneRemoveEventListener(): void;
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const C=require("vue"),j=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 l=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"),f=require("zrender"),d=require("@costy-plus/utils"),E=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},O=E(C);var X=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,n=(t,e,s,h)=>{for(var c=h>1?void 0:h?Y(e,s):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(c=(h?i(e,s,c):i(c))||c);return h&&c&&X(e,s,c),c};exports.default=class extends O.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectIns=Object.freeze(null),this.textIns=Object.freeze(null),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.circleList=Object.freeze([]),this.isMouseDown=Object.freeze(!1),this.originReactPostion=Object.freeze([]),this.circleDragPos=Object.freeze({x:0,y:0})}destroyed(){var t,e;(t=this.measuringRulerGroup)==null||t.removeAll(),(e=this.sceneIns)==null||e.dispose()}created(){this.initConfig()}initConfig(){this.circleList=[],this.circleDragPos={x:0,y:0},this.textIns=new f.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),this.measuringRulerGroup=new f.Group({name:"measuringRuler"}),this.rectIns=new f.Rect({name:"rect",style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:0,y:0},cursor:"move",draggable:!0});let t;const e=["nw-resize","ne-resize","se-resize","sw-resize","n-resize","e-resize","s-resize","w-resize"];for(let s=0;s<8;s++)s>3?t=new f.Rect({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{width:1,height:1},cursor:e[s],zlevel:1,draggable:!0}):t=new f.Circle({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:e[s],zlevel:1,draggable:!0}),t.hide(),this.measuringRulerGroup.add(t),this.circleList.push(t);this.measuringRulerGroup.add(new f.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"})),this.measuringRulerGroup.add(this.rectIns),this.measuringRulerGroup.add(this.textIns)}mounted(){this.init()}init(){var e;const t=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=f.init(t,{width:this.width,height:this.height,devicePixelRatio:2}),(e=this.sceneIns)==null||e.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var h,c,a,i,r,o,u,p;const t=d.calcMs(((h=this.rectIns)==null?void 0:h.shape.width)||0,this.speedValue,this.cellMg,this.magnification),e=d.calcMV(((c=this.rectIns)==null?void 0:c.shape.height)||0,this.sens,this.magnification),s=t!==0&&d.calcBpm(t)||0;(p=this.textIns)==null||p.attr({style:{text:`${t} ms
2
- ${s} bpm
3
- ${e} mV`,x:(((a=this.rectIns)==null?void 0:a.x)||0)+(((i=this.rectIns)==null?void 0:i.shape.x)||0)+(((r=this.rectIns)==null?void 0:r.shape.width)||0)+20,y:(((o=this.rectIns)==null?void 0:o.y)||0)+(((u=this.rectIns)==null?void 0:u.shape.y)||0)}})}circleHideOrShow(t){this.circleList.forEach(e=>t?e.show():e.hide())}sceneAddToEventListener(){var s,h,c,a,i;const t=r=>{r.event.preventDefault(),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})},e=r=>{this.$emit("notifyMeasuringRuler",{name:"dblclick"})};(s=this.sceneIns)==null||s.on("contextmenu",t),(h=this.sceneIns)==null||h.on("mousedown",this.sceneMousedown),(c=this.sceneIns)==null||c.on("mousemove",this.scenemousemove),(a=this.sceneIns)==null||a.on("mouseup",this.scenemouseup),(i=this.sceneIns)==null||i.on("dblclick",e),this.$once("hook:beforeDestroy",()=>{var r,o,u,p,g;(r=this.sceneIns)==null||r.off("contextmenu",t),(o=this.sceneIns)==null||o.off("mousedown",this.sceneMousedown),(u=this.sceneIns)==null||u.off("mousemove",this.scenemousemove),(p=this.sceneIns)==null||p.off("mouseup",this.scenemouseup),(g=this.sceneIns)==null||g.off("dblclick",e)})}sceneRemoveEventListener(){var t,e,s;(t=this.sceneIns)==null||t.off("mousedown",this.sceneMousedown),(e=this.sceneIns)==null||e.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}sceneMousedown(t){var e;this.isMouseDown=!0,(e=this.rectIns)==null||e.attr({shape:{x:t.offsetX,y:t.offsetY}})}scenemousemove(t){var e;!this.isMouseDown||(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}})}scenemouseup(t){var e,s,h,c,a,i,r,o,u,p,g,y,x,m,I,L,w,v,b,D,P,_,z,R,M;this.isMouseDown=!1,(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}}),this.circleList[0].attr({x:(s=this.rectIns)==null?void 0:s.shape.x,y:(h=this.rectIns)==null?void 0:h.shape.y}),this.circleList[1].attr({x:t.offsetX-(((c=this.rectIns)==null?void 0:c.shape.x)||0)+(((a=this.rectIns)==null?void 0:a.shape.x)||0),y:(i=this.rectIns)==null?void 0:i.shape.y}),this.circleList[2].attr({x:t.offsetX-(((r=this.rectIns)==null?void 0:r.shape.x)||0)+(((o=this.rectIns)==null?void 0:o.shape.x)||0),y:t.offsetY-(((u=this.rectIns)==null?void 0:u.shape.y)||0)+(((p=this.rectIns)==null?void 0:p.shape.y)||0)}),this.circleList[3].attr({x:(g=this.rectIns)==null?void 0:g.shape.x,y:t.offsetY-(((y=this.rectIns)==null?void 0:y.shape.y)||0)+(((x=this.rectIns)==null?void 0:x.shape.y)||0)}),this.circleList[4].attr({x:((m=this.rectIns)==null?void 0:m.shape.x)+12,y:((I=this.rectIns)==null?void 0:I.shape.y)-1,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:2}}),this.circleList[5].attr({x:t.offsetX-(((L=this.rectIns)==null?void 0:L.shape.x)||0)+(((w=this.rectIns)==null?void 0:w.shape.x)||0)-1,y:((v=this.rectIns)==null?void 0:v.shape.y)+12,shape:{width:2,height:t.offsetY-((b=this.rectIns)==null?void 0:b.shape.y)-24}}),this.circleList[6].attr({x:((D=this.rectIns)==null?void 0:D.shape.x)+12,y:t.offsetY-(((P=this.rectIns)==null?void 0:P.shape.y)||0)+(((_=this.rectIns)==null?void 0:_.shape.y)||0)-1,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:2}}),this.circleList[7].attr({x:((z=this.rectIns)==null?void 0:z.shape.x)-1,y:((R=this.rectIns)==null?void 0:R.shape.y)+12,shape:{width:2,height:t.offsetY-((M=this.rectIns)==null?void 0:M.shape.y)-24}}),this.calcText(),this.circleHideOrShow(!0),this.sceneRemoveEventListener()}rectAddToEventListener(){var t;(t=this.rectIns)==null||t.on("drag",this.rectDrag),this.$once("hook:beforeDestroy",()=>{var e;(e=this.rectIns)==null||e.on("drag",this.rectDrag)})}rectDrag(t){var e;if(t.offsetX<=5||t.offsetX>=this.width-5||t.offsetY<=5||t.offsetY>=this.height-5){(e=this.rectIns)==null||e.setPosition([this.originReactPostion[0],this.originReactPostion[1]]);return}this.originReactPostion=[t.target.x,t.target.y],this.circleList.forEach((s,h)=>{h>3?s.attr({shape:{x:t.target.x,y:t.target.y}}):s.attr({shape:{cx:t.target.x,cy:t.target.y}})}),this.calcText(),console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.circleList.forEach(t=>{t.on("drag",this.circleDrag),t.on("dragstart",this.circleDragStart)}),this.$once("hook:beforeDestroy",()=>{this.circleList.forEach(t=>{t.off("drag",this.circleDrag),t.off("dragstart",this.circleDragStart)})})}circleDragStart(t){console.log("circleDragStart--\u8FD9\u91CC",t),this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY}circleDrag(t){var o;console.log("circleDrag--\u8FD9\u91CC",t);const e=parseInt(t.target.name);if(isNaN(e))return;const s=t.offsetX-this.circleDragPos.x,h=t.offsetY-this.circleDragPos.y;this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY;let c=this.rectIns.shape.x,a=this.rectIns.shape.y,i=this.rectIns.shape.width,r=this.rectIns.shape.height;console.log("moveX",s,h),e===0?(c+=s,a+=h,s<0?i+=-s:i-=s,h<0?r+=-h:r-=h,this.circleList[1].attr({y:t.target.y}),this.circleList[3].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-1,y:t.target.y+12,shape:{height:r-24}}),this.circleList[5].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}})):e===1?(a+=h,i+=s,h<0?r+=-h:r-=h,this.circleList[0].attr({y:t.target.y}),this.circleList[2].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x-i+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[5].attr({x:t.target.x-1,y:t.target.y+12,shape:{height:r-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:r-24}})):e===2?(i+=s,r+=h,this.circleList[3].attr({y:t.target.y}),this.circleList[1].attr({x:t.target.x}),this.circleList[5].attr({x:t.target.x-1,shape:{height:r-24}}),this.circleList[6].attr({y:t.target.y-1,shape:{width:i-24}}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[7].attr({shape:{height:r-24}})):e===3?(c+=s,s<0?i+=-s:i-=s,r+=h,this.circleList[2].attr({y:t.target.y}),this.circleList[0].attr({x:t.target.x}),this.circleList[6].attr({x:t.target.x+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-1,shape:{height:r-24}}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[5].attr({shape:{height:r-24}})):e===4?(a+=h,h<0?r+=-h:r-=h,this.circleList[0].attr({y:t.target.y+1}),this.circleList[1].attr({y:t.target.y+1}),this.circleList[5].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[4].attr({x:c+12})):e===5?(i+=s,this.circleList[1].attr({x:t.target.x+1}),this.circleList[2].attr({x:t.target.x+1}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[5].attr({y:a+12})):e===6?(r+=h,this.circleList[2].attr({y:t.target.y+1}),this.circleList[3].attr({y:t.target.y+1}),this.circleList[5].attr({shape:{height:r-24}}),this.circleList[7].attr({shape:{height:r-24}}),this.circleList[6].attr({x:c+12})):e===7&&(c+=s,s<0?i+=-s:i-=s,this.circleList[0].attr({x:t.target.x+1}),this.circleList[3].attr({x:t.target.x+1}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[7].attr({y:a+12})),(o=this.rectIns)==null||o.attr({shape:{x:c,y:a,width:i,height:r}}),this.calcText()}};n([l.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"width",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"height",2);n([l.Prop({default:()=>({lineW:1,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);n([l.Prop({required:!0})],exports.default.prototype,"speedValue",2);n([l.Prop({required:!0})],exports.default.prototype,"cellMg",2);n([l.Prop({default:1})],exports.default.prototype,"magnification",2);n([l.Prop({default:1})],exports.default.prototype,"sens",2);n([l.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=n([j.default({name:"MXMeasuringRuler"})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const j=require("vue"),C=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 l=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"),E=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/Watch.js"),g=require("zrender"),I=require("@costy-plus/utils"),O=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},X=O(j);var S=Object.defineProperty,W=Object.getOwnPropertyDescriptor,n=(t,e,s,h)=>{for(var c=h>1?void 0:h?W(e,s):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(c=(h?i(e,s,c):i(c))||c);return h&&c&&S(e,s,c),c};exports.default=class extends X.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectIns=Object.freeze(null),this.textIns=Object.freeze(null),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.circleList=Object.freeze([]),this.isMouseDown=Object.freeze(!1),this.originReactPostion=Object.freeze([]),this.circleDragPos=Object.freeze({x:0,y:0})}WatchSens(t,e){t!==e&&this.calcText(!0)}destroyed(){var t,e;(t=this.measuringRulerGroup)==null||t.removeAll(),(e=this.sceneIns)==null||e.dispose()}created(){this.initConfig()}initConfig(){this.circleList=[],this.circleDragPos={x:0,y:0},this.textIns=new g.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),this.measuringRulerGroup=new g.Group({name:"measuringRuler"}),this.rectIns=new g.Rect({name:"rect",style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:0,y:0},cursor:"move",draggable:!0});let t;const e=["nw-resize","ne-resize","se-resize","sw-resize","n-resize","e-resize","s-resize","w-resize"];for(let s=0;s<8;s++)s>3?t=new g.Rect({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{width:1,height:1},cursor:e[s],zlevel:1,draggable:!0}):t=new g.Circle({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:e[s],zlevel:1,draggable:!0}),t.hide(),this.measuringRulerGroup.add(t),this.circleList.push(t);this.measuringRulerGroup.add(new g.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"})),this.measuringRulerGroup.add(this.rectIns),this.measuringRulerGroup.add(this.textIns)}mounted(){this.init()}init(){var e;const t=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=g.init(t,{width:this.width,height:this.height,devicePixelRatio:2}),(e=this.sceneIns)==null||e.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(t){var c,a,i,r,o,u,p,f,d,y,x,m;!t&&this.config.isDragSens&&this.$emit("notifyMeasurintRectPostion",{x:((c=this.rectIns)==null?void 0:c.shape.x)||0+(this.rectIns.x||0),y:((a=this.rectIns)==null?void 0:a.shape.y)+(this.rectIns.y||0),yEnd:((i=this.rectIns)==null?void 0:i.shape.y)+(this.rectIns.y||0)+(((r=this.rectIns)==null?void 0:r.shape.height)||0)});const e=I.calcMs(((o=this.rectIns)==null?void 0:o.shape.width)||0,this.speedValue,this.cellMg,this.magnification),s=I.calcMV(((u=this.rectIns)==null?void 0:u.shape.height)||0,this.sens,this.magnification),h=e!==0&&I.calcBpm(e)||0;(m=this.textIns)==null||m.attr({style:{text:`${e} ms
2
+ ${h} bpm
3
+ ${s} mV`,x:(((p=this.rectIns)==null?void 0:p.x)||0)+(((f=this.rectIns)==null?void 0:f.shape.x)||0)+(((d=this.rectIns)==null?void 0:d.shape.width)||0)+20,y:(((y=this.rectIns)==null?void 0:y.y)||0)+(((x=this.rectIns)==null?void 0:x.shape.y)||0)}})}circleHideOrShow(t){this.circleList.forEach(e=>t?e.show():e.hide())}sceneAddToEventListener(){var s,h,c,a,i;const t=r=>{r.event.preventDefault(),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})},e=r=>{this.$emit("notifyMeasuringRuler",{name:"dblclick"})};(s=this.sceneIns)==null||s.on("contextmenu",t),(h=this.sceneIns)==null||h.on("mousedown",this.sceneMousedown),(c=this.sceneIns)==null||c.on("mousemove",this.scenemousemove),(a=this.sceneIns)==null||a.on("mouseup",this.scenemouseup),(i=this.sceneIns)==null||i.on("dblclick",e),this.$once("hook:beforeDestroy",()=>{var r,o,u,p,f;(r=this.sceneIns)==null||r.off("contextmenu",t),(o=this.sceneIns)==null||o.off("mousedown",this.sceneMousedown),(u=this.sceneIns)==null||u.off("mousemove",this.scenemousemove),(p=this.sceneIns)==null||p.off("mouseup",this.scenemouseup),(f=this.sceneIns)==null||f.off("dblclick",e)})}sceneRemoveEventListener(){var t,e,s;(t=this.sceneIns)==null||t.off("mousedown",this.sceneMousedown),(e=this.sceneIns)==null||e.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}sceneMousedown(t){var e;this.isMouseDown=!0,(e=this.rectIns)==null||e.attr({shape:{x:t.offsetX,y:t.offsetY}})}scenemousemove(t){var e;!this.isMouseDown||(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}})}scenemouseup(t){var e,s,h,c,a,i,r,o,u,p,f,d,y,x,m,L,v,w,b,D,P,_,z,R,M;this.isMouseDown=!1,(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}}),this.circleList[0].attr({x:(s=this.rectIns)==null?void 0:s.shape.x,y:(h=this.rectIns)==null?void 0:h.shape.y}),this.circleList[1].attr({x:t.offsetX-(((c=this.rectIns)==null?void 0:c.shape.x)||0)+(((a=this.rectIns)==null?void 0:a.shape.x)||0),y:(i=this.rectIns)==null?void 0:i.shape.y}),this.circleList[2].attr({x:t.offsetX-(((r=this.rectIns)==null?void 0:r.shape.x)||0)+(((o=this.rectIns)==null?void 0:o.shape.x)||0),y:t.offsetY-(((u=this.rectIns)==null?void 0:u.shape.y)||0)+(((p=this.rectIns)==null?void 0:p.shape.y)||0)}),this.circleList[3].attr({x:(f=this.rectIns)==null?void 0:f.shape.x,y:t.offsetY-(((d=this.rectIns)==null?void 0:d.shape.y)||0)+(((y=this.rectIns)==null?void 0:y.shape.y)||0)}),this.circleList[4].attr({x:((x=this.rectIns)==null?void 0:x.shape.x)+12,y:((m=this.rectIns)==null?void 0:m.shape.y)-1,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:2}}),this.circleList[5].attr({x:t.offsetX-(((L=this.rectIns)==null?void 0:L.shape.x)||0)+(((v=this.rectIns)==null?void 0:v.shape.x)||0)-1,y:((w=this.rectIns)==null?void 0:w.shape.y)+12,shape:{width:2,height:t.offsetY-((b=this.rectIns)==null?void 0:b.shape.y)-24}}),this.circleList[6].attr({x:((D=this.rectIns)==null?void 0:D.shape.x)+12,y:t.offsetY-(((P=this.rectIns)==null?void 0:P.shape.y)||0)+(((_=this.rectIns)==null?void 0:_.shape.y)||0)-1,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:2}}),this.circleList[7].attr({x:((z=this.rectIns)==null?void 0:z.shape.x)-1,y:((R=this.rectIns)==null?void 0:R.shape.y)+12,shape:{width:2,height:t.offsetY-((M=this.rectIns)==null?void 0:M.shape.y)-24}}),this.calcText(),this.circleHideOrShow(!0),this.sceneRemoveEventListener()}rectAddToEventListener(){var t;(t=this.rectIns)==null||t.on("drag",this.rectDrag),this.$once("hook:beforeDestroy",()=>{var e;(e=this.rectIns)==null||e.on("drag",this.rectDrag)})}rectDrag(t){var e;if(t.offsetX<=5||t.offsetX>=this.width-5||t.offsetY<=5||t.offsetY>=this.height-5){(e=this.rectIns)==null||e.setPosition([this.originReactPostion[0],this.originReactPostion[1]]);return}this.originReactPostion=[t.target.x,t.target.y],this.circleList.forEach((s,h)=>{h>3?s.attr({shape:{x:t.target.x,y:t.target.y}}):s.attr({shape:{cx:t.target.x,cy:t.target.y}})}),this.calcText(),console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.circleList.forEach(t=>{t.on("drag",this.circleDrag),t.on("dragstart",this.circleDragStart)}),this.$once("hook:beforeDestroy",()=>{this.circleList.forEach(t=>{t.off("drag",this.circleDrag),t.off("dragstart",this.circleDragStart)})})}circleDragStart(t){console.log("circleDragStart--\u8FD9\u91CC",t),this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY}circleDrag(t){var o;console.log("circleDrag--\u8FD9\u91CC",t);const e=parseInt(t.target.name);if(isNaN(e))return;const s=t.offsetX-this.circleDragPos.x,h=t.offsetY-this.circleDragPos.y;this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY;let c=this.rectIns.shape.x,a=this.rectIns.shape.y,i=this.rectIns.shape.width,r=this.rectIns.shape.height;console.log("moveX",s,h),e===0?(c+=s,a+=h,s<0?i+=-s:i-=s,h<0?r+=-h:r-=h,this.circleList[1].attr({y:t.target.y}),this.circleList[3].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-1,y:t.target.y+12,shape:{height:r-24}}),this.circleList[5].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}})):e===1?(a+=h,i+=s,h<0?r+=-h:r-=h,this.circleList[0].attr({y:t.target.y}),this.circleList[2].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x-i+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[5].attr({x:t.target.x-1,y:t.target.y+12,shape:{height:r-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:r-24}})):e===2?(i+=s,r+=h,this.circleList[3].attr({y:t.target.y}),this.circleList[1].attr({x:t.target.x}),this.circleList[5].attr({x:t.target.x-1,shape:{height:r-24}}),this.circleList[6].attr({y:t.target.y-1,shape:{width:i-24}}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[7].attr({shape:{height:r-24}})):e===3?(c+=s,s<0?i+=-s:i-=s,r+=h,this.circleList[2].attr({y:t.target.y}),this.circleList[0].attr({x:t.target.x}),this.circleList[6].attr({x:t.target.x+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-1,shape:{height:r-24}}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[5].attr({shape:{height:r-24}})):e===4?(a+=h,h<0?r+=-h:r-=h,this.circleList[0].attr({y:t.target.y+1}),this.circleList[1].attr({y:t.target.y+1}),this.circleList[5].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[4].attr({x:c+12})):e===5?(i+=s,this.circleList[1].attr({x:t.target.x+1}),this.circleList[2].attr({x:t.target.x+1}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[5].attr({y:a+12})):e===6?(r+=h,this.circleList[2].attr({y:t.target.y+1}),this.circleList[3].attr({y:t.target.y+1}),this.circleList[5].attr({shape:{height:r-24}}),this.circleList[7].attr({shape:{height:r-24}}),this.circleList[6].attr({x:c+12})):e===7&&(c+=s,s<0?i+=-s:i-=s,this.circleList[0].attr({x:t.target.x+1}),this.circleList[3].attr({x:t.target.x+1}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[7].attr({y:a+12})),(o=this.rectIns)==null||o.attr({shape:{x:c,y:a,width:i,height:r}}),this.calcText()}};n([l.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"width",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"height",2);n([l.Prop({default:()=>({lineW:1,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);n([l.Prop({required:!0})],exports.default.prototype,"speedValue",2);n([l.Prop({required:!0})],exports.default.prototype,"cellMg",2);n([l.Prop({default:1})],exports.default.prototype,"magnification",2);n([l.Prop({default:1})],exports.default.prototype,"sens",2);n([l.Prop({default:()=>""})],exports.default.prototype,"className",2);n([E.Watch("sens")],exports.default.prototype,"WatchSens",1);exports.default=n([C.default({name:"MXMeasuringRuler"})],exports.default);
@@ -11,4 +11,6 @@ export interface MXMeasuringRulerConfig {
11
11
  textColor: string;
12
12
  /** 文案 fontSize */
13
13
  textFontSize: number;
14
- }
14
+ /** 是否拖动测量当前对应波形sens */
15
+ isDragSens?: boolean;
16
+ }
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "name": "costy-plus",
3
- "version": "1.1.26-0",
4
- "main": "dist/lib/index.js",
5
- "module": "dist/es/index.js",
6
- "types": "dist/es/index.d.ts",
7
- "scripts": {
8
- "build": "vite build",
9
- "test": "vitest run"
10
- },
11
- "files": [
12
- "dist"
13
- ],
14
- "keywords": [
15
- "costy-plus",
16
- "vue2组件库"
17
- ],
18
- "author": "Wick Magic",
19
- "license": "MIT",
20
- "description": "",
21
- "typings": "dist/lib/index.d.ts",
22
- "dependencies": {
23
- "@costy-plus/utils": "0.0.17-0",
24
- "element-ui": "~2.15.11",
25
- "vuescroll": "4.17.5",
26
- "zrender": "^5.5.0"
27
- },
28
- "peerDependencies": {
29
- "lodash": "^4.17.21",
30
- "view-design": "^4.7.0",
31
- "zrender": "^5.5.0"
32
- }
33
- }
1
+ {
2
+ "name": "costy-plus",
3
+ "version": "1.1.27-0",
4
+ "main": "dist/lib/index.js",
5
+ "module": "dist/es/index.js",
6
+ "types": "dist/es/index.d.ts",
7
+ "scripts": {
8
+ "build": "vite build",
9
+ "test": "vitest run"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "keywords": [
15
+ "costy-plus",
16
+ "vue2组件库"
17
+ ],
18
+ "author": "Wick Magic",
19
+ "license": "MIT",
20
+ "description": "",
21
+ "typings": "dist/lib/index.d.ts",
22
+ "dependencies": {
23
+ "@costy-plus/utils": "0.0.17-0",
24
+ "element-ui": "~2.15.11",
25
+ "vuescroll": "4.17.5",
26
+ "zrender": "^5.5.0"
27
+ },
28
+ "peerDependencies": {
29
+ "lodash": "^4.17.21",
30
+ "view-design": "^4.7.0",
31
+ "zrender": "^5.5.0"
32
+ }
33
+ }