costy-plus 1.0.12-0 → 1.0.13-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.
@@ -13,18 +13,18 @@ var D = (e, t, a) => t in e ? T(e, t, { enumerable: !0, configurable: !0, writab
13
13
  import K from "vue";
14
14
  import N 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_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Emit.js";
16
- import { Prop as h } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js";
16
+ import { Prop as l } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js";
17
17
  import { Watch as w } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Watch.js";
18
- import { AnalysisMode as F, AnalyseParameterTable as O, LeadNameTexts as S, getLeadpoint as X, getActualY as z, calcDistance as H, calcPRInterval as j, calcPD as E, calcQRSD as k, calcQTAndQTCAndQTD as _, caclTD as q, calcTA as $, toFixedFun as y, calcPstate as Y, calcPA as J, calcQRS as U, calcSTJA as Z, clacST as ee, calcIaddIIaddIII as te, calcRv5 as ae, calcSv1 as se, calcPelectricAxis as ie, calcQRSelectricAxis as ne, calcTelectricAxis as re, calcMs as le, getStepForSpeed as he } from "@costy-plus/utils";
18
+ import { AnalysisMode as F, AnalyseParameterTable as X, LeadNameTexts as S, getLeadpoint as z, getActualY as O, calcDistance as H, calcPRInterval as j, calcPD as E, calcQRSD as _, calcQTAndQTCAndQTD as k, caclTD as q, calcTA as $, toFixedFun as y, calcPstate as Y, calcPA as J, calcQRS as U, calcSTJA as Z, clacST as ee, calcIaddIIaddIII as te, calcRv5 as ae, calcSv1 as se, calcPelectricAxis as ie, calcQRSelectricAxis as ne, calcTelectricAxis as re, calcMs as le, getStepForSpeed as he } from "@costy-plus/utils";
19
19
  import { util as R, Polyline as P, Text as x, Group as B, Line as oe, Circle as de } from "zrender";
20
20
  var ue = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, r = (e, t, a, s) => {
21
- for (var i = s > 1 ? void 0 : s ? ce(t, a) : t, l = e.length - 1, o; l >= 0; l--)
22
- (o = e[l]) && (i = (s ? o(t, a, i) : o(i)) || i);
21
+ for (var i = s > 1 ? void 0 : s ? ce(t, a) : t, h = e.length - 1, o; h >= 0; h--)
22
+ (o = e[h]) && (i = (s ? o(t, a, i) : o(i)) || i);
23
23
  return s && i && ue(t, a, i), i;
24
24
  };
25
25
  let n = class extends K {
26
26
  constructor() {
27
- super(...arguments), this.AnalysisMode = F, this.AnalyseParameterTable = O, this.sceneIns = Object.freeze(null), this.AssistCtx = Object.freeze(null), this.leadNameIns = Object.freeze(null), this.sensAndSpeedIns = Object.freeze(null), this.waveFromIns = Object.freeze(null), this.waveFromGroup = Object.freeze(null), this.measureGroup = Object.freeze(null), this.leadHeadIns = Object.freeze(null), this.M1 = Object.freeze(null), this.M2 = Object.freeze(null), this.P1 = Object.freeze(null), this.P2 = Object.freeze(null), this.R1 = Object.freeze(null), this.R2 = Object.freeze(null), this.T1 = Object.freeze(null), this.T2 = Object.freeze(null), this.bottomSafeAreaH = Object.freeze(63), this.drawWaveFromX = Object.freeze(0), this.dbClickTime = Object.freeze(0), this.startPos = Object.freeze(0), this.currentGainIdx = Object.freeze(0), this.currentSpeedIdx = Object.freeze(0), this.currentLeadAnalyseValueIdx = Object.freeze(0), this.longdata = Object.freeze(void 0), this.modifyAnalysed = Object.freeze(null), this.measureLineMoveInfo = Object.freeze({
27
+ super(...arguments), this.AnalysisMode = F, this.AnalyseParameterTable = X, this.sceneIns = Object.freeze(null), this.AssistCtx = Object.freeze(null), this.leadNameIns = Object.freeze(null), this.sensAndSpeedIns = Object.freeze(null), this.waveFromIns = Object.freeze(null), this.waveFromGroup = Object.freeze(null), this.measureGroup = Object.freeze(null), this.leadHeadIns = Object.freeze(null), this.M1 = Object.freeze(null), this.M2 = Object.freeze(null), this.P1 = Object.freeze(null), this.P2 = Object.freeze(null), this.R1 = Object.freeze(null), this.R2 = Object.freeze(null), this.T1 = Object.freeze(null), this.T2 = Object.freeze(null), this.bottomSafeAreaH = Object.freeze(63), this.drawWaveFromX = Object.freeze(0), this.dbClickTime = Object.freeze(0), this.startPos = Object.freeze(0), this.currentGainIdx = Object.freeze(0), this.currentSpeedIdx = Object.freeze(0), this.currentLeadAnalyseValueIdx = Object.freeze(0), this.longdata = Object.freeze(void 0), this.modifyAnalysed = Object.freeze(null), this.measureLineMoveInfo = Object.freeze({
28
28
  x: 0,
29
29
  findIdx: 0,
30
30
  name: "",
@@ -74,8 +74,8 @@ let n = class extends K {
74
74
  };
75
75
  }
76
76
  destroyed() {
77
- var e, t, a, s, i, l, o, d, u, f, p;
78
- (e = this.waveFromGroup) == null || e.removeAll(), (t = this.measureGroup) == null || t.removeAll(), (a = this.M1) == null || a.removeAll(), (s = this.M2) == null || s.removeAll(), (i = this.P1) == null || i.removeAll(), (l = this.P2) == null || l.removeAll(), (o = this.R1) == null || o.removeAll(), (d = this.R2) == null || d.removeAll(), (u = this.T1) == null || u.removeAll(), (f = this.T2) == null || f.removeAll();
77
+ var e, t, a, s, i, h, o, d, u, f, p;
78
+ (e = this.waveFromGroup) == null || e.removeAll(), (t = this.measureGroup) == null || t.removeAll(), (a = this.M1) == null || a.removeAll(), (s = this.M2) == null || s.removeAll(), (i = this.P1) == null || i.removeAll(), (h = this.P2) == null || h.removeAll(), (o = this.R1) == null || o.removeAll(), (d = this.R2) == null || d.removeAll(), (u = this.T1) == null || u.removeAll(), (f = this.T2) == null || f.removeAll();
79
79
  try {
80
80
  (p = this.sceneIns) == null || p.dispose();
81
81
  } catch (A) {
@@ -197,12 +197,12 @@ let n = class extends K {
197
197
  }), this.longdata = void 0;
198
198
  const e = this.containerWH.height / 2;
199
199
  for (let i = 0; i < this.leadNames.length - 1; i++) {
200
- const { beatData: l, startPos: o } = this.getWaveFrom(((a = this.currentLeadAnalyseValue) == null ? void 0 : a.BeatID) || 0, this.leadNames[i].val);
201
- this.startPos = o, this.drawWaveFromX === 0 && (this.waveFromLenPX = l.length * this.currentStep, this.drawWaveFromX = this.containerWH.width / 2 - this.waveFromLenPX / 2 + this.leadHeadConfig.leadHedeWidth), this.waveFromGroup.add(new P({
200
+ const { beatData: h, startPos: o } = this.getWaveFrom(((a = this.currentLeadAnalyseValue) == null ? void 0 : a.BeatID) || 0, this.leadNames[i].val);
201
+ this.startPos = o, this.drawWaveFromX === 0 && (this.waveFromLenPX = h.length * this.currentStep, this.drawWaveFromX = this.containerWH.width / 2 - this.waveFromLenPX / 2 + this.leadHeadConfig.leadHedeWidth), this.waveFromGroup.add(new P({
202
202
  cursor: "",
203
203
  name: `${i}`,
204
204
  shape: {
205
- points: l.map((d, u) => [
205
+ points: h.map((d, u) => [
206
206
  u * this.currentStep + this.drawWaveFromX,
207
207
  -d + e
208
208
  ])
@@ -216,12 +216,12 @@ let n = class extends K {
216
216
  (s = this.sceneIns) == null || s.add(this.waveFromGroup);
217
217
  }
218
218
  drawSingleLead() {
219
- var i, l, o;
219
+ var i, h, o;
220
220
  this.waveFromGroup && ((i = this.sceneIns) == null || i.remove(this.waveFromGroup));
221
221
  const { beatData: e, startPos: t, originData: a } = this.getWaveFrom();
222
222
  this.startPos = t, this.drawWaveFromX === 0 && (this.waveFromLenPX = e.length * this.currentStep, this.drawWaveFromX = this.containerWH.width / 2 - this.waveFromLenPX / 2 + this.leadHeadConfig.leadHedeWidth), this.longdata = a;
223
223
  const s = this.containerWH.height / 2;
224
- (l = this.waveFromIns) == null || l.attr({
224
+ (h = this.waveFromIns) == null || h.attr({
225
225
  shape: {
226
226
  points: e.map((d, u) => [
227
227
  u * this.currentStep + this.drawWaveFromX,
@@ -233,7 +233,7 @@ let n = class extends K {
233
233
  getWaveFrom(e, t) {
234
234
  var a;
235
235
  if (e = e !== void 0 ? e : ((a = this.currentLeadAnalyseValue) == null ? void 0 : a.BeatID) || 0, t = t !== void 0 ? t : this.leadNameActive.val, this.typeClass === "ECG") {
236
- const { beatData: s, startPos: i } = X({
236
+ const { beatData: s, startPos: i } = z({
237
237
  ComplexData: this.complexData,
238
238
  Data: this.normalData,
239
239
  AnalyseValue: this.analyseValue,
@@ -243,7 +243,7 @@ let n = class extends K {
243
243
  });
244
244
  return {
245
245
  originData: s,
246
- beatData: s.map((l) => z(this.sensitivity, l, this.currentSens)),
246
+ beatData: s.map((h) => O(this.sensitivity, h, this.currentSens)),
247
247
  startPos: i
248
248
  };
249
249
  }
@@ -254,7 +254,7 @@ let n = class extends K {
254
254
  };
255
255
  }
256
256
  drawMeasureLine() {
257
- var a, s, i, l, o, d, u, f, p, A, L, v, g, I;
257
+ var a, s, i, h, o, d, u, f, p, A, L, v, g, I;
258
258
  this.measureGroup ? ((a = this.sceneIns) == null || a.remove(this.measureGroup), this.measureGroup.removeAll()) : this.measureGroup = new B({
259
259
  name: "measureGroup"
260
260
  });
@@ -268,7 +268,7 @@ let n = class extends K {
268
268
  t
269
269
  ), this.P2 = this.createMeasureLineGroup(
270
270
  "P2",
271
- ((((o = (l = this.currentLeadAnalyseValue) == null ? void 0 : l.KeyPosByBeat) == null ? void 0 : o.Pend) || 0) - this.startPos) * this.currentStep + this.drawWaveFromX,
271
+ ((((o = (h = this.currentLeadAnalyseValue) == null ? void 0 : h.KeyPosByBeat) == null ? void 0 : o.Pend) || 0) - this.startPos) * this.currentStep + this.drawWaveFromX,
272
272
  t
273
273
  ), this.R1 = this.createMeasureLineGroup(
274
274
  "R1",
@@ -328,7 +328,7 @@ let n = class extends K {
328
328
  })), e !== "M1" && e !== "M2" && (this.measureLineList = [...this.measureLineList, {
329
329
  ins: s,
330
330
  x: t
331
- }].sort((l, o) => l.x - o.x)), s;
331
+ }].sort((h, o) => h.x - o.x)), s;
332
332
  }
333
333
  measureLineDrag(e) {
334
334
  e.target.name === "M1" || e.target.name === "M2" ? this.calculatedValue() : this.calcMeasureLineMove(e);
@@ -388,9 +388,7 @@ let n = class extends K {
388
388
  break;
389
389
  }
390
390
  if (this.electricAxisAnalyse(), this.processEnlargeAnalysis(), this.isShowSyncAnalyseValue) {
391
- const i = c({}, ((t = this.currentLeadAnalyseValue) == null ? void 0 : t.AnabyBeat) || {});
392
- for (const l in i)
393
- Object.prototype.hasOwnProperty.call(i, l) && (i[l] = this.enlargeAnalysisData[l]);
391
+ const i = c(c({}, ((t = this.currentLeadAnalyseValue) == null ? void 0 : t.AnabyBeat) || {}), this.enlargeAnalysisData);
394
392
  this.modifyAnalysed.set(((a = this.currentLeadAnalyseValue) == null ? void 0 : a.BeatID) || 0, m(c({}, this.currentLeadAnalyseValue), {
395
393
  AnabyBeat: i,
396
394
  BeatID: ((s = this.currentLeadAnalyseValue) == null ? void 0 : s.BeatID) || 0
@@ -398,7 +396,7 @@ let n = class extends K {
398
396
  }
399
397
  }
400
398
  processEnlargeAnalysis() {
401
- var t, a, s, i, l, o;
399
+ var t, a, s, i, h, o;
402
400
  const e = {
403
401
  start_pos: this.startPos,
404
402
  Sensitivity: this.sensitivity,
@@ -413,12 +411,12 @@ let n = class extends K {
413
411
  this.currentLeadAnalyseValue.KeyPosByBeat.Pend,
414
412
  this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,
415
413
  this.sampleRate
416
- ))), (this.measureLineMoveInfo.name === "" || this.measureLineMoveInfo.name === "R1" || this.measureLineMoveInfo.name === "R2") && (this.enlargeAnalysisData.QRSd = Math.round(k(
414
+ ))), (this.measureLineMoveInfo.name === "" || this.measureLineMoveInfo.name === "R1" || this.measureLineMoveInfo.name === "R2") && (this.enlargeAnalysisData.QRSd = Math.round(_(
417
415
  this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,
418
416
  this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,
419
417
  this.sampleRate
420
418
  ))), this.measureLineMoveInfo.name === "" || this.measureLineMoveInfo.name === "R1" || this.measureLineMoveInfo.name === "T2") {
421
- const { QT: d, QTC: u } = _(
419
+ const { QT: d, QTC: u } = k(
422
420
  this.currentLeadAnalyseValue.KeyPosByBeat.Tend,
423
421
  this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,
424
422
  this.analyseValue,
@@ -482,7 +480,7 @@ let n = class extends K {
482
480
  Data: this.normalData,
483
481
  QRSstart: this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,
484
482
  QRSend: this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,
485
- BeatID: ((l = this.currentLeadAnalyseValue) == null ? void 0 : l.BeatID) || 0,
483
+ BeatID: ((h = this.currentLeadAnalyseValue) == null ? void 0 : h.BeatID) || 0,
486
484
  AnalyseValue: this.analyseValue,
487
485
  leadNameList: this.leadNameList
488
486
  })) || 0, 2) + "", this.enlargeAnalysisData.RV5Amp = y(se(m(c({}, e), {
@@ -541,8 +539,8 @@ let n = class extends K {
541
539
  const e = (f = this.M1) == null ? void 0 : f.childOfName("Line_M1"), t = (p = this.M2) == null ? void 0 : p.childOfName("Line_M2");
542
540
  if (!e || !t)
543
541
  return;
544
- const a = e.shape.x1 + (e.transform && e.transform[4] || 0), s = t.shape.x1 + (t.transform && t.transform[4] || 0), i = Math.abs(a - s), l = le(i, this.currentSpeedValue, this.gridConfig.cellMg, this.magnification);
545
- this.difference.timeDifference = l;
542
+ const a = e.shape.x1 + (e.transform && e.transform[4] || 0), s = t.shape.x1 + (t.transform && t.transform[4] || 0), i = Math.abs(a - s), h = le(i, this.currentSpeedValue, this.gridConfig.cellMg, this.magnification);
543
+ this.difference.timeDifference = h;
546
544
  const o = parseInt(
547
545
  `${(a - this.drawWaveFromX) / this.currentStep}`
548
546
  ), d = parseInt(
@@ -595,76 +593,76 @@ let n = class extends K {
595
593
  }
596
594
  };
597
595
  r([
598
- h({ default: () => "" })
596
+ l({ default: () => "" })
599
597
  ], n.prototype, "className", 2);
600
598
  r([
601
- h({
599
+ l({
602
600
  required: !0,
603
601
  type: Number,
604
602
  validator: (e) => typeof e == "number"
605
603
  })
606
604
  ], n.prototype, "width", 2);
607
605
  r([
608
- h({
606
+ l({
609
607
  required: !0,
610
608
  type: Number,
611
609
  validator: (e) => typeof e == "number"
612
610
  })
613
611
  ], n.prototype, "height", 2);
614
612
  r([
615
- h({
613
+ l({
616
614
  required: !0
617
615
  })
618
616
  ], n.prototype, "gridConfig", 2);
619
617
  r([
620
- h({
618
+ l({
621
619
  required: !0
622
620
  })
623
621
  ], n.prototype, "speedValue", 2);
624
622
  r([
625
- h({
623
+ l({
626
624
  default: 1
627
625
  })
628
626
  ], n.prototype, "sens", 2);
629
627
  r([
630
- h({
628
+ l({
631
629
  default: 1
632
630
  })
633
631
  ], n.prototype, "step", 2);
634
632
  r([
635
- h({
633
+ l({
636
634
  required: !0
637
635
  })
638
636
  ], n.prototype, "sampleRate", 2);
639
637
  r([
640
- h({
638
+ l({
641
639
  required: !0
642
640
  })
643
641
  ], n.prototype, "sensitivity", 2);
644
642
  r([
645
- h({
643
+ l({
646
644
  required: !0,
647
645
  default: () => []
648
646
  })
649
647
  ], n.prototype, "complexData", 2);
650
648
  r([
651
- h({
649
+ l({
652
650
  required: !0,
653
651
  default: () => []
654
652
  })
655
653
  ], n.prototype, "normalData", 2);
656
654
  r([
657
- h({
655
+ l({
658
656
  default: !1
659
657
  })
660
658
  ], n.prototype, "isShowEnlargeWave", 2);
661
659
  r([
662
- h({
660
+ l({
663
661
  default: !0
664
662
  })
665
663
  ], n.prototype, "isShowSyncAnalyseValue", 2);
666
664
  r([
667
- h({
665
+ l({
668
666
  default: () => ({
669
667
  leadHedeWidth: 20,
670
668
  leadHedeColor: "#000",
@@ -673,7 +671,7 @@ r([
673
671
  })
674
672
  ], n.prototype, "leadHeadConfig", 2);
675
673
  r([
676
- h({
674
+ l({
677
675
  default: () => ({
678
676
  lineColor: "#000",
679
677
  lineWidth: 1,
@@ -683,57 +681,57 @@ r([
683
681
  })
684
682
  ], n.prototype, "leadConfig", 2);
685
683
  r([
686
- h({
684
+ l({
687
685
  default: 5
688
686
  })
689
687
  ], n.prototype, "magnification", 2);
690
688
  r([
691
- h({
689
+ l({
692
690
  default: () => []
693
691
  })
694
692
  ], n.prototype, "leadNameList", 2);
695
693
  r([
696
- h({
694
+ l({
697
695
  required: !0
698
696
  })
699
697
  ], n.prototype, "activeLeadIdx", 2);
700
698
  r([
701
- h({
699
+ l({
702
700
  required: !0
703
701
  })
704
702
  ], n.prototype, "activeLeadAnalyseValue", 2);
705
703
  r([
706
- h({
704
+ l({
707
705
  required: !0
708
706
  })
709
707
  ], n.prototype, "analyseValue", 2);
710
708
  r([
711
- h({
709
+ l({
712
710
  default: "ECG"
713
711
  })
714
712
  ], n.prototype, "typeClass", 2);
715
713
  r([
716
- h({
714
+ l({
717
715
  default: () => ["black", "red", "orange", "yellow", "green", "#4B0082", "blue", "purple", "#FFB6C1", "#EE82EE", "#6A5ACD", "#00FFFF"]
718
716
  })
719
717
  ], n.prototype, "leadColors", 2);
720
718
  r([
721
- h({
719
+ l({
722
720
  default: F.CompoundWave
723
721
  })
724
722
  ], n.prototype, "enlargeWaveMode", 2);
725
723
  r([
726
- h({
724
+ l({
727
725
  required: !0
728
726
  })
729
727
  ], n.prototype, "conventionalECGConfig", 2);
730
728
  r([
731
- h({
729
+ l({
732
730
  default: () => []
733
731
  })
734
732
  ], n.prototype, "gains", 2);
735
733
  r([
736
- h({
734
+ l({
737
735
  default: () => []
738
736
  })
739
737
  ], n.prototype, "speeds", 2);
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty,D=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var S=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c=(e,t)=>{for(var a in t||(t={}))R.call(t,a)&&S(e,a,t[a]);if(x)for(var a of x(t))w.call(t,a)&&S(e,a,t[a]);return e},m=(e,t)=>D(e,F(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("vue"),b=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_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Emit.js");const o=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js"),B=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Watch.js"),n=require("@costy-plus/utils"),y=require("zrender"),C=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},Q=C(T);var W=Object.defineProperty,G=Object.getOwnPropertyDescriptor,r=(e,t,a,s)=>{for(var i=s>1?void 0:s?G(t,a):t,l=e.length-1,h;l>=0;l--)(h=e[l])&&(i=(s?h(t,a,i):h(i))||i);return s&&i&&W(t,a,i),i};exports.default=class extends Q.default{constructor(){super(...arguments),this.AnalysisMode=n.AnalysisMode,this.AnalyseParameterTable=n.AnalyseParameterTable,this.sceneIns=Object.freeze(null),this.AssistCtx=Object.freeze(null),this.leadNameIns=Object.freeze(null),this.sensAndSpeedIns=Object.freeze(null),this.waveFromIns=Object.freeze(null),this.waveFromGroup=Object.freeze(null),this.measureGroup=Object.freeze(null),this.leadHeadIns=Object.freeze(null),this.M1=Object.freeze(null),this.M2=Object.freeze(null),this.P1=Object.freeze(null),this.P2=Object.freeze(null),this.R1=Object.freeze(null),this.R2=Object.freeze(null),this.T1=Object.freeze(null),this.T2=Object.freeze(null),this.bottomSafeAreaH=Object.freeze(63),this.drawWaveFromX=Object.freeze(0),this.dbClickTime=Object.freeze(0),this.startPos=Object.freeze(0),this.currentGainIdx=Object.freeze(0),this.currentSpeedIdx=Object.freeze(0),this.currentLeadAnalyseValueIdx=Object.freeze(0),this.longdata=Object.freeze(void 0),this.modifyAnalysed=Object.freeze(null),this.measureLineMoveInfo=Object.freeze({x:0,findIdx:0,name:"",offLeftX:0}),this.measureLineList=Object.freeze([]),this.waveFromLenPX=Object.freeze(0),this.leadNames=[],this.leadNameActive={name:"",val:-2},this.isSyncAnalyseValue=!1,this.currentSens=0,this.currentSpeedValue=0,this.currentStep=0,this.currentLeadAnalyseValue=null,this.complexAnalysisvalue=Object.freeze(null),this.enlargeAnalysisData=null,this.difference={timeDifference:0,amplitudeDifference:""}}watchActiveLeadIdx(e){var t;this.leadNameActive=this.leadNames.find(a=>a.val===e)||{name:"",val:-2},(t=this.leadNameIns)==null||t.attr({style:{text:this.leadNameActive.name}})}watchLeadNameList(e){this.leadNames=e.map(t=>{var a;return this.activeLeadIdx===t&&((a=this.leadNameIns)==null||a.attr({style:{text:n.LeadNameTexts[t]}}),this.leadNameActive={name:n.LeadNameTexts[t],val:t}),{name:n.LeadNameTexts[t],val:t}}).concat({name:"ALL",val:-1})}get containerWH(){return{width:this.width-230,height:this.height-40-50}}destroyed(){var e,t,a,s,i,l,h,d,u,f,p;(e=this.waveFromGroup)==null||e.removeAll(),(t=this.measureGroup)==null||t.removeAll(),(a=this.M1)==null||a.removeAll(),(s=this.M2)==null||s.removeAll(),(i=this.P1)==null||i.removeAll(),(l=this.P2)==null||l.removeAll(),(h=this.R1)==null||h.removeAll(),(d=this.R2)==null||d.removeAll(),(u=this.T1)==null||u.removeAll(),(f=this.T2)==null||f.removeAll();try{(p=this.sceneIns)==null||p.dispose()}catch(A){}}created(){this.modifyAnalysed=new Map,this.measureLineList=[],this.measureLineMoveInfo={x:0,findIdx:0,name:"",offLeftX:0},this.currentGainIdx=this.gains.findIndex(e=>e.value===this.sens/this.gridConfig.cellMg),this.currentSpeedIdx=this.speeds.findIndex(e=>e.value===this.speedValue),this.currentLeadAnalyseValueIdx=this.analyseValue.findIndex(e=>{var t;return e.BeatID===((t=this.activeLeadAnalyseValue)==null?void 0:t.BeatID)}),this.currentSens=this.sens*this.magnification,this.currentSpeedValue=this.speedValue,this.currentStep=this.step*this.magnification,this.currentLeadAnalyseValue=y.util.clone(this.activeLeadAnalyseValue),this.complexAnalysisvalue=y.util.clone(this.analyseValue[0])||null,this.processEnlargeAnalysisData()}processEnlargeAnalysisData(){var e,t,a,s,i;this.enlargeAnalysisData=m(c({},((e=this.currentLeadAnalyseValue)==null?void 0:e.AnabyBeat)||{}),{AtrialRate:((a=(t=this.complexAnalysisvalue)==null?void 0:t.AnabyBeat)==null?void 0:a.AtrialRate)||0,VentricularRate:((i=(s=this.complexAnalysisvalue)==null?void 0:s.AnabyBeat)==null?void 0:i.VentricularRate)||0,QTc:""})}selectLeadName(e){var t;this.leadNameActive=e,(t=this.leadNameIns)==null||t.attr({style:{text:e.name}}),this.drawWaveFrom()}createLeadHead(){var s,i;const t=this.containerWH.height/2,a=this.leadHeadConfig.leadHedeWidth/4;this.leadHeadIns&&((s=this.sceneIns)==null||s.remove(this.leadHeadIns)),this.leadHeadIns=new y.Polyline({cursor:"",shape:{points:[[0+0,0+t],[a+0,0+t],[a+0,-this.currentSens+t],[3*a+0,-this.currentSens+t],[3*a+0,0+t],[4*a+0,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}}),(i=this.sceneIns)==null||i.add(this.leadHeadIns)}createLeadName(){var e;this.leadNameIns=new y.Text({style:{x:this.leadHeadConfig.leadHedeWidth,y:this.containerWH.height/2-this.leadConfig.fontSize,text:this.leadNameActive.name,fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}),(e=this.sceneIns)==null||e.add(this.leadNameIns)}createSensAndSpeed(){var e,t;this.sensAndSpeedIns&&((e=this.sceneIns)==null||e.remove(this.sensAndSpeedIns)),this.sensAndSpeedIns=new y.Text({cursor:"",style:{x:this.leadHeadConfig.leadHedeWidth,y:this.containerWH.height-50,text:`${this.currentSens/this.gridConfig.cellMg}mm/mV ${this.currentSpeedValue}mm/s`,fontSize:12,fill:"#FF0080",fontFamily:this.leadConfig.fontFamily}}),(t=this.sceneIns)==null||t.add(this.sensAndSpeedIns)}createWaveFrom(){var e;this.waveFromIns=new y.Polyline({cursor:"",shape:{points:[]},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth}}),(e=this.sceneIns)==null||e.add(this.waveFromIns)}drawWaveFrom(){this.leadNameActive.val===-1?this.drawAllLead():this.drawSingleLead(),this.calculatedValue(),this.electricAxisAnalyse(),this.processEnlargeAnalysis()}drawAllLead(){var t,a,s;(t=this.waveFromIns)==null||t.hide(),this.waveFromGroup?this.waveFromGroup.removeAll():this.waveFromGroup=new y.Group({name:"waveFromGroup"}),this.longdata=void 0;const e=this.containerWH.height/2;for(let i=0;i<this.leadNames.length-1;i++){const{beatData:l,startPos:h}=this.getWaveFrom(((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,this.leadNames[i].val);this.startPos=h,this.drawWaveFromX===0&&(this.waveFromLenPX=l.length*this.currentStep,this.drawWaveFromX=this.containerWH.width/2-this.waveFromLenPX/2+this.leadHeadConfig.leadHedeWidth),this.waveFromGroup.add(new y.Polyline({cursor:"",name:`${i}`,shape:{points:l.map((d,u)=>[u*this.currentStep+this.drawWaveFromX,-d+e])},style:{stroke:this.leadColors[i]||this.leadColors[i%this.leadColors.length],lineWidth:this.leadConfig.lineWidth}}))}(s=this.sceneIns)==null||s.add(this.waveFromGroup)}drawSingleLead(){var i,l,h;this.waveFromGroup&&((i=this.sceneIns)==null||i.remove(this.waveFromGroup));const{beatData:e,startPos:t,originData:a}=this.getWaveFrom();this.startPos=t,this.drawWaveFromX===0&&(this.waveFromLenPX=e.length*this.currentStep,this.drawWaveFromX=this.containerWH.width/2-this.waveFromLenPX/2+this.leadHeadConfig.leadHedeWidth),this.longdata=a;const s=this.containerWH.height/2;(l=this.waveFromIns)==null||l.attr({shape:{points:e.map((d,u)=>[u*this.currentStep+this.drawWaveFromX,-d+s])}}),(h=this.waveFromIns)==null||h.show()}getWaveFrom(e,t){var a;if(e=e!==void 0?e:((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,t=t!==void 0?t:this.leadNameActive.val,this.typeClass==="ECG"){const{beatData:s,startPos:i}=n.getLeadpoint({ComplexData:this.complexData,Data:this.normalData,AnalyseValue:this.analyseValue,BeatID:e,leadIdx:t,SampleRate:this.sampleRate});return{originData:s,beatData:s.map(l=>n.getActualY(this.sensitivity,l,this.currentSens)),startPos:i}}return{originData:[],beatData:[],startPos:-1}}drawMeasureLine(){var a,s,i,l,h,d,u,f,p,A,L,g,v,P;this.measureGroup?((a=this.sceneIns)==null||a.remove(this.measureGroup),this.measureGroup.removeAll()):this.measureGroup=new y.Group({name:"measureGroup"});const e=n.calcDistance(this.currentSpeedValue,this.gridConfig.cellMg,this.magnification),t={stroke:"#FF09FF",lineWidth:1.5};this.M1=this.createMeasureLineGroup("M1",this.drawWaveFromX+10,t),this.M2=this.createMeasureLineGroup("M2",this.drawWaveFromX+10+e,t),t.stroke="blue",this.P1=this.createMeasureLineGroup("P1",((((i=(s=this.currentLeadAnalyseValue)==null?void 0:s.KeyPosByBeat)==null?void 0:i.Pstart)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.P2=this.createMeasureLineGroup("P2",((((h=(l=this.currentLeadAnalyseValue)==null?void 0:l.KeyPosByBeat)==null?void 0:h.Pend)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.R1=this.createMeasureLineGroup("R1",((((u=(d=this.currentLeadAnalyseValue)==null?void 0:d.KeyPosByBeat)==null?void 0:u.QRSstart)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.R2=this.createMeasureLineGroup("R2",((((p=(f=this.currentLeadAnalyseValue)==null?void 0:f.KeyPosByBeat)==null?void 0:p.QRSend)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.T1=this.createMeasureLineGroup("T1",((((L=(A=this.currentLeadAnalyseValue)==null?void 0:A.KeyPosByBeat)==null?void 0:L.Tstart)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.T2=this.createMeasureLineGroup("T2",((((v=(g=this.currentLeadAnalyseValue)==null?void 0:g.KeyPosByBeat)==null?void 0:v.Tend)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.measureGroup.add(this.M1),this.measureGroup.add(this.M2),this.measureGroup.add(this.P1),this.measureGroup.add(this.P2),this.measureGroup.add(this.R1),this.measureGroup.add(this.R2),this.measureGroup.add(this.T1),this.measureGroup.add(this.T2),(P=this.sceneIns)==null||P.add(this.measureGroup)}createMeasureLineGroup(e,t,a){const s=new y.Group({name:e,draggable:"horizontal",ondrag:this.measureLineDrag}),i=this.containerWH.height-this.bottomSafeAreaH;return s.add(new y.Line({cursor:"w-resize",name:`Line_${e}`,shape:{x1:t,y1:0,x2:t,y2:i},style:a})),s.add(new y.Circle({name:"Circle",x:t,y:i,shape:{r:6},style:{fill:"#ccc"}})),s.add(new y.Text({cursor:"",name:"Text",style:{x:t-7,y:i+12+10,text:e,fontSize:12,fill:"#000",fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1"}})),e!=="M1"&&e!=="M2"&&(this.measureLineList=[...this.measureLineList,{ins:s,x:t}].sort((l,h)=>l.x-h.x)),s}measureLineDrag(e){e.target.name==="M1"||e.target.name==="M2"?this.calculatedValue():this.calcMeasureLineMove(e)}calcMeasureLineMove(e){if(e.target.name!==this.measureLineMoveInfo.name){const a=this.measureLineList.findIndex(s=>s.ins.name===e.target.name);this.measureLineMoveInfo.findIdx=a,this.measureLineMoveInfo.name=e.target.name}if(this.measureLineMoveInfo.findIdx===-1)return;let t=0;if(this.calcMeasureLineOffx(),this.measureLineMoveInfo.findIdx===0){const a=this.measureLineList[this.measureLineMoveInfo.findIdx+1];if(t=e.target.childAt(0).shape.x1+e.target.transform[4]||0,this.measureLineMoveInfo.offLeftX=t,t<this.drawWaveFromX||t>a.x+a.ins.x-1.5){e.target.x=this.measureLineMoveInfo.x,this.measureLineMoveInfo.offLeftX=t;return}}else if(this.measureLineMoveInfo.findIdx===this.measureLineList.length-1){const a=this.measureLineList[this.measureLineMoveInfo.findIdx-1];if(!a)return;if(t=e.target.childAt(0).shape.x1+e.target.transform[4]||0,this.measureLineMoveInfo.offLeftX=t,t>this.waveFromLenPX+this.drawWaveFromX||t<a.x+a.ins.x-1.5){e.target.x=this.measureLineMoveInfo.x,this.measureLineMoveInfo.offLeftX=t;return}}else{const a=this.measureLineList[this.measureLineMoveInfo.findIdx+1],s=this.measureLineList[this.measureLineMoveInfo.findIdx-1];if(t=e.target.childAt(0).shape.x1+e.target.transform[4]||0,this.measureLineMoveInfo.offLeftX=t,t>a.x+a.ins.x-1.5||t<s.x+s.ins.x-1.5){e.target.x=this.measureLineMoveInfo.x,this.measureLineMoveInfo.offLeftX=t;return}}this.measureLineMoveInfo.x=e.target.x}calcMeasureLineOffx(){var t,a,s;const e=Math.round((this.measureLineMoveInfo.offLeftX-this.drawWaveFromX)/this.currentStep)+this.startPos;switch(this.measureLineMoveInfo.name){case"P1":this.currentLeadAnalyseValue.KeyPosByBeat.Pstart=e;break;case"P2":this.currentLeadAnalyseValue.KeyPosByBeat.Pend=e;break;case"R1":this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart=e;break;case"R2":this.currentLeadAnalyseValue.KeyPosByBeat.QRSend=e;break;case"T1":this.currentLeadAnalyseValue.KeyPosByBeat.Tstart=e;break;case"T2":this.currentLeadAnalyseValue.KeyPosByBeat.Tend=e;break}if(this.electricAxisAnalyse(),this.processEnlargeAnalysis(),this.isShowSyncAnalyseValue){const i=c({},((t=this.currentLeadAnalyseValue)==null?void 0:t.AnabyBeat)||{});for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&(i[l]=this.enlargeAnalysisData[l]);this.modifyAnalysed.set(((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,m(c({},this.currentLeadAnalyseValue),{AnabyBeat:i,BeatID:((s=this.currentLeadAnalyseValue)==null?void 0:s.BeatID)||0}))}}processEnlargeAnalysis(){var t,a,s,i,l,h;const e={start_pos:this.startPos,Sensitivity:this.sensitivity,SampleRate:this.sampleRate,longdata:this.longdata};if((this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="R1")&&(this.enlargeAnalysisData.PR=Math.round(n.calcPRInterval(this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,this.sampleRate))),(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="P2")&&(this.enlargeAnalysisData.Pd=Math.round(n.calcPD(this.currentLeadAnalyseValue.KeyPosByBeat.Pend,this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,this.sampleRate))),(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="R2")&&(this.enlargeAnalysisData.QRSd=Math.round(n.calcQRSD(this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.sampleRate))),this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="T2"){const{QT:d,QTC:u}=n.calcQTAndQTCAndQTD(this.currentLeadAnalyseValue.KeyPosByBeat.Tend,this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.analyseValue,+(((a=(t=this.conventionalECGConfig)==null?void 0:t.ecgReviewSetting)==null?void 0:a.QTd_algorithm)||1),((s=this.currentLeadAnalyseValue)==null?void 0:s.BeatID)||0,this.sampleRate);this.enlargeAnalysisData.QT=Math.round(d),this.enlargeAnalysisData.QTc=Math.round(u||(Array.isArray(this.enlargeAnalysisData.QTc)?this.enlargeAnalysisData.QTc[0]:this.enlargeAnalysisData.QTc))}if(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="T1"||this.measureLineMoveInfo.name==="T2"){this.enlargeAnalysisData.Td=Math.round(n.caclTD(this.currentLeadAnalyseValue.KeyPosByBeat.Tend,this.currentLeadAnalyseValue.KeyPosByBeat.Tstart,this.sampleRate));const{TA:d}=n.calcTA(m(c({},e),{Tstart:this.currentLeadAnalyseValue.KeyPosByBeat.Tstart,Tend:this.currentLeadAnalyseValue.KeyPosByBeat.Tend,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,TPpeak:this.currentLeadAnalyseValue.KeyPosByBeat.TPpeak}));this.enlargeAnalysisData.TtypeA=n.toFixedFun(d||0,2)}if(this.enlargeAnalysisData.Ptype=n.calcPstate(m(c({},e),{Pstart:this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,Pend:this.currentLeadAnalyseValue.KeyPosByBeat.Pend,data:this.longdata}))||"",this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="P2"){const{PA:d}=n.calcPA(m(c({},e),{Pstart:this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,Pend:this.currentLeadAnalyseValue.KeyPosByBeat.Pend,PPpeak:this.currentLeadAnalyseValue.KeyPosByBeat.PPpeak}));this.enlargeAnalysisData.PtypeA=n.toFixedFun(d||0,2)}if(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="R2"){const{qrs_morph_type:d,QA:u,QD:f,RA:p,RD:A,SD:L,RPD:g,SA:v,RPA:P}=n.calcQRS(m(c({},e),{QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend}));this.enlargeAnalysisData.QRStype=d||"",this.enlargeAnalysisData.QtypeA=n.toFixedFun(u||0,2),this.enlargeAnalysisData.QD=Math.round(f||0),this.enlargeAnalysisData.RtypeA=n.toFixedFun(p||0,2),this.enlargeAnalysisData.StypeA=n.toFixedFun(v||0,2),this.enlargeAnalysisData.RPA=n.toFixedFun(P||0,2),this.enlargeAnalysisData.RD=n.toFixedFun(A||0,2),this.enlargeAnalysisData.SD=n.toFixedFun(L||0,2),this.enlargeAnalysisData.RPD=n.toFixedFun(g||0,2);const I=n.calcSTJA(e.start_pos,this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,e.Sensitivity,e.longdata);this.enlargeAnalysisData.STJtypeA=n.toFixedFun(I||0,2),this.enlargeAnalysisData.STstate=n.clacST(I||0,e.longdata)||"";const V=n.calcIaddIIaddIII(m(c({},e),{ComplexData:this.complexData,Data:this.normalData,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,BeatID:((i=this.currentLeadAnalyseValue)==null?void 0:i.BeatID)||0,AnalyseValue:this.analyseValue,leadNameList:this.leadNameList}));this.enlargeAnalysisData.IandIIandIII=n.toFixedFun(V,2),this.enlargeAnalysisData.RV5Amp=n.toFixedFun(n.calcRv5(m(c({},e),{ComplexData:this.complexData,Data:this.normalData,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,BeatID:((l=this.currentLeadAnalyseValue)==null?void 0:l.BeatID)||0,AnalyseValue:this.analyseValue,leadNameList:this.leadNameList}))||0,2)+"",this.enlargeAnalysisData.RV5Amp=n.toFixedFun(n.calcSv1(m(c({},e),{ComplexData:this.complexData,Data:this.normalData,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,BeatID:((h=this.currentLeadAnalyseValue)==null?void 0:h.BeatID)||0,AnalyseValue:this.analyseValue,leadNameList:this.leadNameList}))||0,2)+""}}electricAxisAnalyse(){var a;const e={ComplexData:this.complexData,Data:this.normalData,BeatID:((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,AnalyseValue:this.analyseValue,SampleRate:this.sampleRate,Sensitivity:this.sensitivity,leadNameList:this.leadNameList,start_pos:this.startPos};if(this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="P2"){this.enlargeAnalysisData.PAxis=n.calcPelectricAxis(m(c({},e),{Pstart:this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,Pend:this.currentLeadAnalyseValue.KeyPosByBeat.Pend}));return}const t=()=>{let s=Math.abs(this.enlargeAnalysisData.QRSAxis-this.enlargeAnalysisData.TAxis);s>180&&(s=360-s),this.currentLeadAnalyseValue.AnabyBeat.QRS_T=s};if(this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="R2"){this.enlargeAnalysisData.QRSAxis=n.calcQRSelectricAxis(m(c({},e),{QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart})),t();return}if(this.measureLineMoveInfo.name==="T1"||this.measureLineMoveInfo.name==="T2"){this.enlargeAnalysisData.TAxis=n.calcTelectricAxis(m(c({},e),{QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,Tend:this.currentLeadAnalyseValue.KeyPosByBeat.Tend})),t();return}}calculatedValue(){var f,p,A,L;const e=(f=this.M1)==null?void 0:f.childOfName("Line_M1"),t=(p=this.M2)==null?void 0:p.childOfName("Line_M2");if(!e||!t)return;const a=e.shape.x1+(e.transform&&e.transform[4]||0),s=t.shape.x1+(t.transform&&t.transform[4]||0),i=Math.abs(a-s),l=n.calcMs(i,this.currentSpeedValue,this.gridConfig.cellMg,this.magnification);this.difference.timeDifference=l;const h=parseInt(`${(a-this.drawWaveFromX)/this.currentStep}`),d=parseInt(`${(s-this.drawWaveFromX)/this.currentStep}`);let u=[];if(this.leadNameActive.val===-1?u=((A=this.waveFromGroup)==null?void 0:A.childAt(this.waveFromGroup.childCount()-1)).shape.points||[]:u=((L=this.waveFromIns)==null?void 0:L.shape.points)||[],d>0&&h>0&&d<=u.length-1&&h<=u.length-1){const v=(Math.abs(u[d][1]-u[h][1])/this.currentSens).toFixed(2);this.difference.amplitudeDifference=v}else this.difference.amplitudeDifference=""}toggleGain(e){if(e){this.currentGainIdx<this.gains.length-1&&(this.currentGainIdx+=1,this.currentSens=this.gains[this.currentGainIdx].value*this.gridConfig.cellMg*this.magnification,this.toggleRender());return}this.currentGainIdx>0&&this.currentGainIdx<=this.gains.length-1&&(this.currentGainIdx-=1,this.currentSens=this.gains[this.currentGainIdx].value*this.gridConfig.cellMg*this.magnification,this.toggleRender())}toggleSpeeds(e){console.log("toggleSpeed",this.speeds,this.currentSpeedIdx);const t=()=>{const a=n.getStepForSpeed(this.currentSpeedValue,this.gridConfig.cellMg,this.sampleRate);this.currentStep=a*this.magnification};if(e){this.currentSpeedIdx<this.speeds.length-1&&(this.currentSpeedIdx+=1,this.currentSpeedValue=this.speeds[this.currentSpeedIdx].value,t(),this.toggleRender());return}this.currentSpeedIdx>0&&this.currentSpeedIdx<=this.speeds.length-1&&(this.currentSpeedIdx-=1,this.currentSpeedValue=this.speeds[this.currentSpeedIdx].value,t(),this.toggleRender())}toggleBeaadId(e){var t,a;if(e){this.currentLeadAnalyseValueIdx<this.analyseValue.length-1&&(this.currentLeadAnalyseValueIdx+=1,this.currentLeadAnalyseValue=m(c({},this.analyseValue[this.currentLeadAnalyseValueIdx]),{BeatCount:((t=this.currentLeadAnalyseValue)==null?void 0:t.BeatCount)||0}),this.toggleRender());return}this.currentLeadAnalyseValueIdx>1&&this.currentLeadAnalyseValueIdx<=this.analyseValue.length-1&&(this.currentLeadAnalyseValueIdx-=1,this.currentLeadAnalyseValue=m(c({},this.analyseValue[this.currentLeadAnalyseValueIdx]),{BeatCount:((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatCount)||0}),this.toggleRender())}toggleRender(){this.createLeadHead(),this.createSensAndSpeed(),this.drawWaveFrom(),this.drawMeasureLine(),this.calculatedValue(),this.electricAxisAnalyse(),this.processEnlargeAnalysis()}mainBoxDbClick(){const e=Date.now();e-this.dbClickTime<400?(this.dbClickTime=0,this.$emit("notifyCancelEnlargr"),this.$emit("update:isShowEnlargeWave",!1),this.isShowSyncAnalyseValue&&this.isSyncAnalyseValue&&this.$emit("notifyModifyAnalyse",this.modifyAnalysed)):this.dbClickTime=e}};r([o.Prop({default:()=>""})],exports.default.prototype,"className",2);r([o.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);r([o.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);r([o.Prop({required:!0})],exports.default.prototype,"gridConfig",2);r([o.Prop({required:!0})],exports.default.prototype,"speedValue",2);r([o.Prop({default:1})],exports.default.prototype,"sens",2);r([o.Prop({default:1})],exports.default.prototype,"step",2);r([o.Prop({required:!0})],exports.default.prototype,"sampleRate",2);r([o.Prop({required:!0})],exports.default.prototype,"sensitivity",2);r([o.Prop({required:!0,default:()=>[]})],exports.default.prototype,"complexData",2);r([o.Prop({required:!0,default:()=>[]})],exports.default.prototype,"normalData",2);r([o.Prop({default:!1})],exports.default.prototype,"isShowEnlargeWave",2);r([o.Prop({default:!0})],exports.default.prototype,"isShowSyncAnalyseValue",2);r([o.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);r([o.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);r([o.Prop({default:5})],exports.default.prototype,"magnification",2);r([o.Prop({default:()=>[]})],exports.default.prototype,"leadNameList",2);r([o.Prop({required:!0})],exports.default.prototype,"activeLeadIdx",2);r([o.Prop({required:!0})],exports.default.prototype,"activeLeadAnalyseValue",2);r([o.Prop({required:!0})],exports.default.prototype,"analyseValue",2);r([o.Prop({default:"ECG"})],exports.default.prototype,"typeClass",2);r([o.Prop({default:()=>["black","red","orange","yellow","green","#4B0082","blue","purple","#FFB6C1","#EE82EE","#6A5ACD","#00FFFF"]})],exports.default.prototype,"leadColors",2);r([o.Prop({default:n.AnalysisMode.CompoundWave})],exports.default.prototype,"enlargeWaveMode",2);r([o.Prop({required:!0})],exports.default.prototype,"conventionalECGConfig",2);r([o.Prop({default:()=>[]})],exports.default.prototype,"gains",2);r([o.Prop({default:()=>[]})],exports.default.prototype,"speeds",2);r([B.Watch("activeLeadIdx")],exports.default.prototype,"watchActiveLeadIdx",1);r([B.Watch("leadNameList",{deep:!0,immediate:!0})],exports.default.prototype,"watchLeadNameList",1);exports.default=r([b.default({name:"Methods"})],exports.default);
1
+ "use strict";var M=Object.defineProperty,D=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var S=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c=(e,t)=>{for(var a in t||(t={}))R.call(t,a)&&S(e,a,t[a]);if(x)for(var a of x(t))w.call(t,a)&&S(e,a,t[a]);return e},m=(e,t)=>D(e,F(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("vue"),b=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_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Emit.js");const l=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js"),B=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Watch.js"),n=require("@costy-plus/utils"),y=require("zrender"),C=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},Q=C(T);var W=Object.defineProperty,G=Object.getOwnPropertyDescriptor,r=(e,t,a,s)=>{for(var i=s>1?void 0:s?G(t,a):t,o=e.length-1,h;o>=0;o--)(h=e[o])&&(i=(s?h(t,a,i):h(i))||i);return s&&i&&W(t,a,i),i};exports.default=class extends Q.default{constructor(){super(...arguments),this.AnalysisMode=n.AnalysisMode,this.AnalyseParameterTable=n.AnalyseParameterTable,this.sceneIns=Object.freeze(null),this.AssistCtx=Object.freeze(null),this.leadNameIns=Object.freeze(null),this.sensAndSpeedIns=Object.freeze(null),this.waveFromIns=Object.freeze(null),this.waveFromGroup=Object.freeze(null),this.measureGroup=Object.freeze(null),this.leadHeadIns=Object.freeze(null),this.M1=Object.freeze(null),this.M2=Object.freeze(null),this.P1=Object.freeze(null),this.P2=Object.freeze(null),this.R1=Object.freeze(null),this.R2=Object.freeze(null),this.T1=Object.freeze(null),this.T2=Object.freeze(null),this.bottomSafeAreaH=Object.freeze(63),this.drawWaveFromX=Object.freeze(0),this.dbClickTime=Object.freeze(0),this.startPos=Object.freeze(0),this.currentGainIdx=Object.freeze(0),this.currentSpeedIdx=Object.freeze(0),this.currentLeadAnalyseValueIdx=Object.freeze(0),this.longdata=Object.freeze(void 0),this.modifyAnalysed=Object.freeze(null),this.measureLineMoveInfo=Object.freeze({x:0,findIdx:0,name:"",offLeftX:0}),this.measureLineList=Object.freeze([]),this.waveFromLenPX=Object.freeze(0),this.leadNames=[],this.leadNameActive={name:"",val:-2},this.isSyncAnalyseValue=!1,this.currentSens=0,this.currentSpeedValue=0,this.currentStep=0,this.currentLeadAnalyseValue=null,this.complexAnalysisvalue=Object.freeze(null),this.enlargeAnalysisData=null,this.difference={timeDifference:0,amplitudeDifference:""}}watchActiveLeadIdx(e){var t;this.leadNameActive=this.leadNames.find(a=>a.val===e)||{name:"",val:-2},(t=this.leadNameIns)==null||t.attr({style:{text:this.leadNameActive.name}})}watchLeadNameList(e){this.leadNames=e.map(t=>{var a;return this.activeLeadIdx===t&&((a=this.leadNameIns)==null||a.attr({style:{text:n.LeadNameTexts[t]}}),this.leadNameActive={name:n.LeadNameTexts[t],val:t}),{name:n.LeadNameTexts[t],val:t}}).concat({name:"ALL",val:-1})}get containerWH(){return{width:this.width-230,height:this.height-40-50}}destroyed(){var e,t,a,s,i,o,h,d,u,f,p;(e=this.waveFromGroup)==null||e.removeAll(),(t=this.measureGroup)==null||t.removeAll(),(a=this.M1)==null||a.removeAll(),(s=this.M2)==null||s.removeAll(),(i=this.P1)==null||i.removeAll(),(o=this.P2)==null||o.removeAll(),(h=this.R1)==null||h.removeAll(),(d=this.R2)==null||d.removeAll(),(u=this.T1)==null||u.removeAll(),(f=this.T2)==null||f.removeAll();try{(p=this.sceneIns)==null||p.dispose()}catch(A){}}created(){this.modifyAnalysed=new Map,this.measureLineList=[],this.measureLineMoveInfo={x:0,findIdx:0,name:"",offLeftX:0},this.currentGainIdx=this.gains.findIndex(e=>e.value===this.sens/this.gridConfig.cellMg),this.currentSpeedIdx=this.speeds.findIndex(e=>e.value===this.speedValue),this.currentLeadAnalyseValueIdx=this.analyseValue.findIndex(e=>{var t;return e.BeatID===((t=this.activeLeadAnalyseValue)==null?void 0:t.BeatID)}),this.currentSens=this.sens*this.magnification,this.currentSpeedValue=this.speedValue,this.currentStep=this.step*this.magnification,this.currentLeadAnalyseValue=y.util.clone(this.activeLeadAnalyseValue),this.complexAnalysisvalue=y.util.clone(this.analyseValue[0])||null,this.processEnlargeAnalysisData()}processEnlargeAnalysisData(){var e,t,a,s,i;this.enlargeAnalysisData=m(c({},((e=this.currentLeadAnalyseValue)==null?void 0:e.AnabyBeat)||{}),{AtrialRate:((a=(t=this.complexAnalysisvalue)==null?void 0:t.AnabyBeat)==null?void 0:a.AtrialRate)||0,VentricularRate:((i=(s=this.complexAnalysisvalue)==null?void 0:s.AnabyBeat)==null?void 0:i.VentricularRate)||0,QTc:""})}selectLeadName(e){var t;this.leadNameActive=e,(t=this.leadNameIns)==null||t.attr({style:{text:e.name}}),this.drawWaveFrom()}createLeadHead(){var s,i;const t=this.containerWH.height/2,a=this.leadHeadConfig.leadHedeWidth/4;this.leadHeadIns&&((s=this.sceneIns)==null||s.remove(this.leadHeadIns)),this.leadHeadIns=new y.Polyline({cursor:"",shape:{points:[[0+0,0+t],[a+0,0+t],[a+0,-this.currentSens+t],[3*a+0,-this.currentSens+t],[3*a+0,0+t],[4*a+0,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}}),(i=this.sceneIns)==null||i.add(this.leadHeadIns)}createLeadName(){var e;this.leadNameIns=new y.Text({style:{x:this.leadHeadConfig.leadHedeWidth,y:this.containerWH.height/2-this.leadConfig.fontSize,text:this.leadNameActive.name,fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}),(e=this.sceneIns)==null||e.add(this.leadNameIns)}createSensAndSpeed(){var e,t;this.sensAndSpeedIns&&((e=this.sceneIns)==null||e.remove(this.sensAndSpeedIns)),this.sensAndSpeedIns=new y.Text({cursor:"",style:{x:this.leadHeadConfig.leadHedeWidth,y:this.containerWH.height-50,text:`${this.currentSens/this.gridConfig.cellMg}mm/mV ${this.currentSpeedValue}mm/s`,fontSize:12,fill:"#FF0080",fontFamily:this.leadConfig.fontFamily}}),(t=this.sceneIns)==null||t.add(this.sensAndSpeedIns)}createWaveFrom(){var e;this.waveFromIns=new y.Polyline({cursor:"",shape:{points:[]},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth}}),(e=this.sceneIns)==null||e.add(this.waveFromIns)}drawWaveFrom(){this.leadNameActive.val===-1?this.drawAllLead():this.drawSingleLead(),this.calculatedValue(),this.electricAxisAnalyse(),this.processEnlargeAnalysis()}drawAllLead(){var t,a,s;(t=this.waveFromIns)==null||t.hide(),this.waveFromGroup?this.waveFromGroup.removeAll():this.waveFromGroup=new y.Group({name:"waveFromGroup"}),this.longdata=void 0;const e=this.containerWH.height/2;for(let i=0;i<this.leadNames.length-1;i++){const{beatData:o,startPos:h}=this.getWaveFrom(((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,this.leadNames[i].val);this.startPos=h,this.drawWaveFromX===0&&(this.waveFromLenPX=o.length*this.currentStep,this.drawWaveFromX=this.containerWH.width/2-this.waveFromLenPX/2+this.leadHeadConfig.leadHedeWidth),this.waveFromGroup.add(new y.Polyline({cursor:"",name:`${i}`,shape:{points:o.map((d,u)=>[u*this.currentStep+this.drawWaveFromX,-d+e])},style:{stroke:this.leadColors[i]||this.leadColors[i%this.leadColors.length],lineWidth:this.leadConfig.lineWidth}}))}(s=this.sceneIns)==null||s.add(this.waveFromGroup)}drawSingleLead(){var i,o,h;this.waveFromGroup&&((i=this.sceneIns)==null||i.remove(this.waveFromGroup));const{beatData:e,startPos:t,originData:a}=this.getWaveFrom();this.startPos=t,this.drawWaveFromX===0&&(this.waveFromLenPX=e.length*this.currentStep,this.drawWaveFromX=this.containerWH.width/2-this.waveFromLenPX/2+this.leadHeadConfig.leadHedeWidth),this.longdata=a;const s=this.containerWH.height/2;(o=this.waveFromIns)==null||o.attr({shape:{points:e.map((d,u)=>[u*this.currentStep+this.drawWaveFromX,-d+s])}}),(h=this.waveFromIns)==null||h.show()}getWaveFrom(e,t){var a;if(e=e!==void 0?e:((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,t=t!==void 0?t:this.leadNameActive.val,this.typeClass==="ECG"){const{beatData:s,startPos:i}=n.getLeadpoint({ComplexData:this.complexData,Data:this.normalData,AnalyseValue:this.analyseValue,BeatID:e,leadIdx:t,SampleRate:this.sampleRate});return{originData:s,beatData:s.map(o=>n.getActualY(this.sensitivity,o,this.currentSens)),startPos:i}}return{originData:[],beatData:[],startPos:-1}}drawMeasureLine(){var a,s,i,o,h,d,u,f,p,A,L,g,v,P;this.measureGroup?((a=this.sceneIns)==null||a.remove(this.measureGroup),this.measureGroup.removeAll()):this.measureGroup=new y.Group({name:"measureGroup"});const e=n.calcDistance(this.currentSpeedValue,this.gridConfig.cellMg,this.magnification),t={stroke:"#FF09FF",lineWidth:1.5};this.M1=this.createMeasureLineGroup("M1",this.drawWaveFromX+10,t),this.M2=this.createMeasureLineGroup("M2",this.drawWaveFromX+10+e,t),t.stroke="blue",this.P1=this.createMeasureLineGroup("P1",((((i=(s=this.currentLeadAnalyseValue)==null?void 0:s.KeyPosByBeat)==null?void 0:i.Pstart)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.P2=this.createMeasureLineGroup("P2",((((h=(o=this.currentLeadAnalyseValue)==null?void 0:o.KeyPosByBeat)==null?void 0:h.Pend)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.R1=this.createMeasureLineGroup("R1",((((u=(d=this.currentLeadAnalyseValue)==null?void 0:d.KeyPosByBeat)==null?void 0:u.QRSstart)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.R2=this.createMeasureLineGroup("R2",((((p=(f=this.currentLeadAnalyseValue)==null?void 0:f.KeyPosByBeat)==null?void 0:p.QRSend)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.T1=this.createMeasureLineGroup("T1",((((L=(A=this.currentLeadAnalyseValue)==null?void 0:A.KeyPosByBeat)==null?void 0:L.Tstart)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.T2=this.createMeasureLineGroup("T2",((((v=(g=this.currentLeadAnalyseValue)==null?void 0:g.KeyPosByBeat)==null?void 0:v.Tend)||0)-this.startPos)*this.currentStep+this.drawWaveFromX,t),this.measureGroup.add(this.M1),this.measureGroup.add(this.M2),this.measureGroup.add(this.P1),this.measureGroup.add(this.P2),this.measureGroup.add(this.R1),this.measureGroup.add(this.R2),this.measureGroup.add(this.T1),this.measureGroup.add(this.T2),(P=this.sceneIns)==null||P.add(this.measureGroup)}createMeasureLineGroup(e,t,a){const s=new y.Group({name:e,draggable:"horizontal",ondrag:this.measureLineDrag}),i=this.containerWH.height-this.bottomSafeAreaH;return s.add(new y.Line({cursor:"w-resize",name:`Line_${e}`,shape:{x1:t,y1:0,x2:t,y2:i},style:a})),s.add(new y.Circle({name:"Circle",x:t,y:i,shape:{r:6},style:{fill:"#ccc"}})),s.add(new y.Text({cursor:"",name:"Text",style:{x:t-7,y:i+12+10,text:e,fontSize:12,fill:"#000",fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1"}})),e!=="M1"&&e!=="M2"&&(this.measureLineList=[...this.measureLineList,{ins:s,x:t}].sort((o,h)=>o.x-h.x)),s}measureLineDrag(e){e.target.name==="M1"||e.target.name==="M2"?this.calculatedValue():this.calcMeasureLineMove(e)}calcMeasureLineMove(e){if(e.target.name!==this.measureLineMoveInfo.name){const a=this.measureLineList.findIndex(s=>s.ins.name===e.target.name);this.measureLineMoveInfo.findIdx=a,this.measureLineMoveInfo.name=e.target.name}if(this.measureLineMoveInfo.findIdx===-1)return;let t=0;if(this.calcMeasureLineOffx(),this.measureLineMoveInfo.findIdx===0){const a=this.measureLineList[this.measureLineMoveInfo.findIdx+1];if(t=e.target.childAt(0).shape.x1+e.target.transform[4]||0,this.measureLineMoveInfo.offLeftX=t,t<this.drawWaveFromX||t>a.x+a.ins.x-1.5){e.target.x=this.measureLineMoveInfo.x,this.measureLineMoveInfo.offLeftX=t;return}}else if(this.measureLineMoveInfo.findIdx===this.measureLineList.length-1){const a=this.measureLineList[this.measureLineMoveInfo.findIdx-1];if(!a)return;if(t=e.target.childAt(0).shape.x1+e.target.transform[4]||0,this.measureLineMoveInfo.offLeftX=t,t>this.waveFromLenPX+this.drawWaveFromX||t<a.x+a.ins.x-1.5){e.target.x=this.measureLineMoveInfo.x,this.measureLineMoveInfo.offLeftX=t;return}}else{const a=this.measureLineList[this.measureLineMoveInfo.findIdx+1],s=this.measureLineList[this.measureLineMoveInfo.findIdx-1];if(t=e.target.childAt(0).shape.x1+e.target.transform[4]||0,this.measureLineMoveInfo.offLeftX=t,t>a.x+a.ins.x-1.5||t<s.x+s.ins.x-1.5){e.target.x=this.measureLineMoveInfo.x,this.measureLineMoveInfo.offLeftX=t;return}}this.measureLineMoveInfo.x=e.target.x}calcMeasureLineOffx(){var t,a,s;const e=Math.round((this.measureLineMoveInfo.offLeftX-this.drawWaveFromX)/this.currentStep)+this.startPos;switch(this.measureLineMoveInfo.name){case"P1":this.currentLeadAnalyseValue.KeyPosByBeat.Pstart=e;break;case"P2":this.currentLeadAnalyseValue.KeyPosByBeat.Pend=e;break;case"R1":this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart=e;break;case"R2":this.currentLeadAnalyseValue.KeyPosByBeat.QRSend=e;break;case"T1":this.currentLeadAnalyseValue.KeyPosByBeat.Tstart=e;break;case"T2":this.currentLeadAnalyseValue.KeyPosByBeat.Tend=e;break}if(this.electricAxisAnalyse(),this.processEnlargeAnalysis(),this.isShowSyncAnalyseValue){const i=c(c({},((t=this.currentLeadAnalyseValue)==null?void 0:t.AnabyBeat)||{}),this.enlargeAnalysisData);this.modifyAnalysed.set(((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,m(c({},this.currentLeadAnalyseValue),{AnabyBeat:i,BeatID:((s=this.currentLeadAnalyseValue)==null?void 0:s.BeatID)||0}))}}processEnlargeAnalysis(){var t,a,s,i,o,h;const e={start_pos:this.startPos,Sensitivity:this.sensitivity,SampleRate:this.sampleRate,longdata:this.longdata};if((this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="R1")&&(this.enlargeAnalysisData.PR=Math.round(n.calcPRInterval(this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,this.sampleRate))),(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="P2")&&(this.enlargeAnalysisData.Pd=Math.round(n.calcPD(this.currentLeadAnalyseValue.KeyPosByBeat.Pend,this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,this.sampleRate))),(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="R2")&&(this.enlargeAnalysisData.QRSd=Math.round(n.calcQRSD(this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.sampleRate))),this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="T2"){const{QT:d,QTC:u}=n.calcQTAndQTCAndQTD(this.currentLeadAnalyseValue.KeyPosByBeat.Tend,this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.analyseValue,+(((a=(t=this.conventionalECGConfig)==null?void 0:t.ecgReviewSetting)==null?void 0:a.QTd_algorithm)||1),((s=this.currentLeadAnalyseValue)==null?void 0:s.BeatID)||0,this.sampleRate);this.enlargeAnalysisData.QT=Math.round(d),this.enlargeAnalysisData.QTc=Math.round(u||(Array.isArray(this.enlargeAnalysisData.QTc)?this.enlargeAnalysisData.QTc[0]:this.enlargeAnalysisData.QTc))}if(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="T1"||this.measureLineMoveInfo.name==="T2"){this.enlargeAnalysisData.Td=Math.round(n.caclTD(this.currentLeadAnalyseValue.KeyPosByBeat.Tend,this.currentLeadAnalyseValue.KeyPosByBeat.Tstart,this.sampleRate));const{TA:d}=n.calcTA(m(c({},e),{Tstart:this.currentLeadAnalyseValue.KeyPosByBeat.Tstart,Tend:this.currentLeadAnalyseValue.KeyPosByBeat.Tend,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,TPpeak:this.currentLeadAnalyseValue.KeyPosByBeat.TPpeak}));this.enlargeAnalysisData.TtypeA=n.toFixedFun(d||0,2)}if(this.enlargeAnalysisData.Ptype=n.calcPstate(m(c({},e),{Pstart:this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,Pend:this.currentLeadAnalyseValue.KeyPosByBeat.Pend,data:this.longdata}))||"",this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="P2"){const{PA:d}=n.calcPA(m(c({},e),{Pstart:this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,Pend:this.currentLeadAnalyseValue.KeyPosByBeat.Pend,PPpeak:this.currentLeadAnalyseValue.KeyPosByBeat.PPpeak}));this.enlargeAnalysisData.PtypeA=n.toFixedFun(d||0,2)}if(this.measureLineMoveInfo.name===""||this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="R2"){const{qrs_morph_type:d,QA:u,QD:f,RA:p,RD:A,SD:L,RPD:g,SA:v,RPA:P}=n.calcQRS(m(c({},e),{QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend}));this.enlargeAnalysisData.QRStype=d||"",this.enlargeAnalysisData.QtypeA=n.toFixedFun(u||0,2),this.enlargeAnalysisData.QD=Math.round(f||0),this.enlargeAnalysisData.RtypeA=n.toFixedFun(p||0,2),this.enlargeAnalysisData.StypeA=n.toFixedFun(v||0,2),this.enlargeAnalysisData.RPA=n.toFixedFun(P||0,2),this.enlargeAnalysisData.RD=n.toFixedFun(A||0,2),this.enlargeAnalysisData.SD=n.toFixedFun(L||0,2),this.enlargeAnalysisData.RPD=n.toFixedFun(g||0,2);const I=n.calcSTJA(e.start_pos,this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,e.Sensitivity,e.longdata);this.enlargeAnalysisData.STJtypeA=n.toFixedFun(I||0,2),this.enlargeAnalysisData.STstate=n.clacST(I||0,e.longdata)||"";const V=n.calcIaddIIaddIII(m(c({},e),{ComplexData:this.complexData,Data:this.normalData,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,BeatID:((i=this.currentLeadAnalyseValue)==null?void 0:i.BeatID)||0,AnalyseValue:this.analyseValue,leadNameList:this.leadNameList}));this.enlargeAnalysisData.IandIIandIII=n.toFixedFun(V,2),this.enlargeAnalysisData.RV5Amp=n.toFixedFun(n.calcRv5(m(c({},e),{ComplexData:this.complexData,Data:this.normalData,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,BeatID:((o=this.currentLeadAnalyseValue)==null?void 0:o.BeatID)||0,AnalyseValue:this.analyseValue,leadNameList:this.leadNameList}))||0,2)+"",this.enlargeAnalysisData.RV5Amp=n.toFixedFun(n.calcSv1(m(c({},e),{ComplexData:this.complexData,Data:this.normalData,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart,QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,BeatID:((h=this.currentLeadAnalyseValue)==null?void 0:h.BeatID)||0,AnalyseValue:this.analyseValue,leadNameList:this.leadNameList}))||0,2)+""}}electricAxisAnalyse(){var a;const e={ComplexData:this.complexData,Data:this.normalData,BeatID:((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatID)||0,AnalyseValue:this.analyseValue,SampleRate:this.sampleRate,Sensitivity:this.sensitivity,leadNameList:this.leadNameList,start_pos:this.startPos};if(this.measureLineMoveInfo.name==="P1"||this.measureLineMoveInfo.name==="P2"){this.enlargeAnalysisData.PAxis=n.calcPelectricAxis(m(c({},e),{Pstart:this.currentLeadAnalyseValue.KeyPosByBeat.Pstart,Pend:this.currentLeadAnalyseValue.KeyPosByBeat.Pend}));return}const t=()=>{let s=Math.abs(this.enlargeAnalysisData.QRSAxis-this.enlargeAnalysisData.TAxis);s>180&&(s=360-s),this.currentLeadAnalyseValue.AnabyBeat.QRS_T=s};if(this.measureLineMoveInfo.name==="R1"||this.measureLineMoveInfo.name==="R2"){this.enlargeAnalysisData.QRSAxis=n.calcQRSelectricAxis(m(c({},e),{QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,QRSstart:this.currentLeadAnalyseValue.KeyPosByBeat.QRSstart})),t();return}if(this.measureLineMoveInfo.name==="T1"||this.measureLineMoveInfo.name==="T2"){this.enlargeAnalysisData.TAxis=n.calcTelectricAxis(m(c({},e),{QRSend:this.currentLeadAnalyseValue.KeyPosByBeat.QRSend,Tend:this.currentLeadAnalyseValue.KeyPosByBeat.Tend})),t();return}}calculatedValue(){var f,p,A,L;const e=(f=this.M1)==null?void 0:f.childOfName("Line_M1"),t=(p=this.M2)==null?void 0:p.childOfName("Line_M2");if(!e||!t)return;const a=e.shape.x1+(e.transform&&e.transform[4]||0),s=t.shape.x1+(t.transform&&t.transform[4]||0),i=Math.abs(a-s),o=n.calcMs(i,this.currentSpeedValue,this.gridConfig.cellMg,this.magnification);this.difference.timeDifference=o;const h=parseInt(`${(a-this.drawWaveFromX)/this.currentStep}`),d=parseInt(`${(s-this.drawWaveFromX)/this.currentStep}`);let u=[];if(this.leadNameActive.val===-1?u=((A=this.waveFromGroup)==null?void 0:A.childAt(this.waveFromGroup.childCount()-1)).shape.points||[]:u=((L=this.waveFromIns)==null?void 0:L.shape.points)||[],d>0&&h>0&&d<=u.length-1&&h<=u.length-1){const v=(Math.abs(u[d][1]-u[h][1])/this.currentSens).toFixed(2);this.difference.amplitudeDifference=v}else this.difference.amplitudeDifference=""}toggleGain(e){if(e){this.currentGainIdx<this.gains.length-1&&(this.currentGainIdx+=1,this.currentSens=this.gains[this.currentGainIdx].value*this.gridConfig.cellMg*this.magnification,this.toggleRender());return}this.currentGainIdx>0&&this.currentGainIdx<=this.gains.length-1&&(this.currentGainIdx-=1,this.currentSens=this.gains[this.currentGainIdx].value*this.gridConfig.cellMg*this.magnification,this.toggleRender())}toggleSpeeds(e){console.log("toggleSpeed",this.speeds,this.currentSpeedIdx);const t=()=>{const a=n.getStepForSpeed(this.currentSpeedValue,this.gridConfig.cellMg,this.sampleRate);this.currentStep=a*this.magnification};if(e){this.currentSpeedIdx<this.speeds.length-1&&(this.currentSpeedIdx+=1,this.currentSpeedValue=this.speeds[this.currentSpeedIdx].value,t(),this.toggleRender());return}this.currentSpeedIdx>0&&this.currentSpeedIdx<=this.speeds.length-1&&(this.currentSpeedIdx-=1,this.currentSpeedValue=this.speeds[this.currentSpeedIdx].value,t(),this.toggleRender())}toggleBeaadId(e){var t,a;if(e){this.currentLeadAnalyseValueIdx<this.analyseValue.length-1&&(this.currentLeadAnalyseValueIdx+=1,this.currentLeadAnalyseValue=m(c({},this.analyseValue[this.currentLeadAnalyseValueIdx]),{BeatCount:((t=this.currentLeadAnalyseValue)==null?void 0:t.BeatCount)||0}),this.toggleRender());return}this.currentLeadAnalyseValueIdx>1&&this.currentLeadAnalyseValueIdx<=this.analyseValue.length-1&&(this.currentLeadAnalyseValueIdx-=1,this.currentLeadAnalyseValue=m(c({},this.analyseValue[this.currentLeadAnalyseValueIdx]),{BeatCount:((a=this.currentLeadAnalyseValue)==null?void 0:a.BeatCount)||0}),this.toggleRender())}toggleRender(){this.createLeadHead(),this.createSensAndSpeed(),this.drawWaveFrom(),this.drawMeasureLine(),this.calculatedValue(),this.electricAxisAnalyse(),this.processEnlargeAnalysis()}mainBoxDbClick(){const e=Date.now();e-this.dbClickTime<400?(this.dbClickTime=0,this.$emit("notifyCancelEnlargr"),this.$emit("update:isShowEnlargeWave",!1),this.isShowSyncAnalyseValue&&this.isSyncAnalyseValue&&this.$emit("notifyModifyAnalyse",this.modifyAnalysed)):this.dbClickTime=e}};r([l.Prop({default:()=>""})],exports.default.prototype,"className",2);r([l.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);r([l.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);r([l.Prop({required:!0})],exports.default.prototype,"gridConfig",2);r([l.Prop({required:!0})],exports.default.prototype,"speedValue",2);r([l.Prop({default:1})],exports.default.prototype,"sens",2);r([l.Prop({default:1})],exports.default.prototype,"step",2);r([l.Prop({required:!0})],exports.default.prototype,"sampleRate",2);r([l.Prop({required:!0})],exports.default.prototype,"sensitivity",2);r([l.Prop({required:!0,default:()=>[]})],exports.default.prototype,"complexData",2);r([l.Prop({required:!0,default:()=>[]})],exports.default.prototype,"normalData",2);r([l.Prop({default:!1})],exports.default.prototype,"isShowEnlargeWave",2);r([l.Prop({default:!0})],exports.default.prototype,"isShowSyncAnalyseValue",2);r([l.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);r([l.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);r([l.Prop({default:5})],exports.default.prototype,"magnification",2);r([l.Prop({default:()=>[]})],exports.default.prototype,"leadNameList",2);r([l.Prop({required:!0})],exports.default.prototype,"activeLeadIdx",2);r([l.Prop({required:!0})],exports.default.prototype,"activeLeadAnalyseValue",2);r([l.Prop({required:!0})],exports.default.prototype,"analyseValue",2);r([l.Prop({default:"ECG"})],exports.default.prototype,"typeClass",2);r([l.Prop({default:()=>["black","red","orange","yellow","green","#4B0082","blue","purple","#FFB6C1","#EE82EE","#6A5ACD","#00FFFF"]})],exports.default.prototype,"leadColors",2);r([l.Prop({default:n.AnalysisMode.CompoundWave})],exports.default.prototype,"enlargeWaveMode",2);r([l.Prop({required:!0})],exports.default.prototype,"conventionalECGConfig",2);r([l.Prop({default:()=>[]})],exports.default.prototype,"gains",2);r([l.Prop({default:()=>[]})],exports.default.prototype,"speeds",2);r([B.Watch("activeLeadIdx")],exports.default.prototype,"watchActiveLeadIdx",1);r([B.Watch("leadNameList",{deep:!0,immediate:!0})],exports.default.prototype,"watchLeadNameList",1);exports.default=r([b.default({name:"Methods"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.0.12-0",
3
+ "version": "1.0.13-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "scripts": {