costy-plus 1.1.4-0 → 1.1.5-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,28 +1,28 @@
1
- var Y = Object.defineProperty, V = Object.defineProperties;
2
- var _ = Object.getOwnPropertyDescriptors;
3
- var T = Object.getOwnPropertySymbols;
4
- var q = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
- var X = (e, t, i) => t in e ? Y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, G = (e, t) => {
1
+ var V = Object.defineProperty, _ = Object.defineProperties;
2
+ var q = Object.getOwnPropertyDescriptors;
3
+ var X = Object.getOwnPropertySymbols;
4
+ var U = Object.prototype.hasOwnProperty, Y = Object.prototype.propertyIsEnumerable;
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
- q.call(t, i) && X(e, i, t[i]);
8
- if (T)
9
- for (var i of T(t))
10
- U.call(t, i) && X(e, i, t[i]);
7
+ U.call(t, i) && T(e, i, t[i]);
8
+ if (X)
9
+ for (var i of X(t))
10
+ Y.call(t, i) && T(e, i, t[i]);
11
11
  return e;
12
- }, P = (e, t) => V(e, _(t));
12
+ }, P = (e, t) => _(e, q(t));
13
13
  import K from "vue";
14
14
  import Z 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
- import { AnalysisMode as S, throttling as B, getPrintLengthToPx as Q, getDataLenTimes as F, getDistance as $, getPointIdxForPx as x, LeadNameTexts as J } from "@costy-plus/utils";
17
+ import { AnalysisMode as S, throttling as O, getPrintLengthToPx as Q, getDataLenTimes as G, getDistance as $, getPointIdxForPx as x, LeadNameTexts as J } from "@costy-plus/utils";
18
18
  import * as ee from "zrender";
19
- import { Group as I, Text as W, Polyline as H, Line as b, Polygon as te, util as ie } from "zrender";
20
- var se = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, m = (e, t, i, s) => {
19
+ import { Group as y, Text as C, Polyline as H, Line as b, Polygon as te, util as ie } from "zrender";
20
+ var se = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, u = (e, t, i, s) => {
21
21
  for (var a = s > 1 ? void 0 : s ? ae(t, i) : t, o = e.length - 1, r; o >= 0; o--)
22
22
  (r = e[o]) && (a = (s ? r(t, i, a) : r(a)) || a);
23
23
  return s && a && se(t, i, a), a;
24
24
  };
25
- let u = class extends K {
25
+ let g = class extends K {
26
26
  constructor() {
27
27
  super(...arguments), this.AssistCtx = Object.freeze(null), this.sceneIns = 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.pacingGroup = Object.freeze(null), this.bottomAreaHeight = Object.freeze(55), this.dataTotalTimes = Object.freeze(0), this.totalRows = Object.freeze(0), this.rulerStep = Object.freeze(0), this.drawLoopArrowStartPosIdx = Object.freeze(0), this.dbClickWaveFromTime = Object.freeze(0), this.currentHeardBeat = {
28
28
  heardBeat: null,
@@ -69,8 +69,8 @@ let u = class extends K {
69
69
  };
70
70
  }
71
71
  destroyed() {
72
- var e, t, i, s, a, o, r, l, n, d, h, c;
73
- 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(), (r = this.leadHeadOffAndDelGroup) == null || r.removeAll(), (l = this.rulerGroup) == null || l.removeAll(), (n = this.arrowGroup) == null || n.removeAll(), (d = this.heardBeatLineGroup) == null || d.removeAll(), (h = this.pacingGroup) == null || h.removeAll(), (c = this.sceneIns) == null || c.dispose();
72
+ var e, t, i, s, a, o, r, l, n, d, h, p;
73
+ 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(), (r = this.leadHeadOffAndDelGroup) == null || r.removeAll(), (l = this.rulerGroup) == null || l.removeAll(), (n = this.arrowGroup) == null || n.removeAll(), (d = this.heardBeatLineGroup) == null || d.removeAll(), (h = this.pacingGroup) == null || h.removeAll(), (p = this.sceneIns) == null || p.dispose();
74
74
  }
75
75
  init() {
76
76
  var e;
@@ -104,34 +104,34 @@ let u = class extends K {
104
104
  this.initConfig(), this.drawLeadHead(), this.drawColSplitLine(), this.initSlidingWindowInfo(), this.drawPacing(), this.drawRulerNotes(), this.drawWaveFrom();
105
105
  }
106
106
  initConfig() {
107
- var t, i, s, a, o, r, l, n, d, h, c;
108
- this.rowAndColwaveFromGroup = new I({
107
+ var t, i, s, a, o, r, l, n, d, h, p;
108
+ this.rowAndColwaveFromGroup = new y({
109
109
  name: "rowAndColwaveFrom"
110
- }), this.singleWaveFromGroup = new I({
110
+ }), this.singleWaveFromGroup = new y({
111
111
  name: "singleWaveFrom"
112
- }), this.addwaveFromGroup = new I({
112
+ }), this.addwaveFromGroup = new y({
113
113
  name: "addwaveFrom"
114
- }), this.leadHeadGroup = new I({
114
+ }), this.leadHeadGroup = new y({
115
115
  name: "leadHead"
116
- }), this.splitLineGroup = new I({
116
+ }), this.splitLineGroup = new y({
117
117
  name: "splitLine"
118
- }), this.leadHeadNameGroup = new I({
118
+ }), this.leadHeadNameGroup = new y({
119
119
  name: "leadHeadName"
120
- }), this.leadHeadOffAndDelGroup = new I({
120
+ }), this.leadHeadOffAndDelGroup = new y({
121
121
  name: "leadHeadOffAndDel"
122
- }), this.rulerGroup = new I({
122
+ }), this.rulerGroup = new y({
123
123
  name: "ruler"
124
- }), this.arrowGroup = new I({
124
+ }), this.arrowGroup = new y({
125
125
  name: "arrowLoop"
126
- }), this.heardBeatLineGroup = new I({
126
+ }), this.heardBeatLineGroup = new y({
127
127
  name: "heardBeatLine"
128
- }), this.pacingGroup = new I({
128
+ }), this.pacingGroup = new y({
129
129
  name: "pacing"
130
130
  }), (this.leadModel.name === "12*1" || this.leadModel.name === "18*1" || this.leadModel.name === "15*1" || this.leadModel.name === "16*1") && (this.sceneMagnification = 0.8), this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height;
131
131
  let e = this.canvasContainer.width;
132
132
  if (((i = (t = this.conventionalECGConfig) == null ? void 0 : t.ecgReviewSetting) == null ? void 0 : i.ecgareawidth) === "1") {
133
- const p = Q(((s = this.formatEcgData) == null ? void 0 : s.processedData.otherParams.SampleRate) || 0) + this.leadHeadConfig.leadHedeWidth;
134
- p <= e && (e = p);
133
+ const m = Q(((s = this.formatEcgData) == null ? void 0 : s.processedData.otherParams.SampleRate) || 0) + this.leadHeadConfig.leadHedeWidth;
134
+ m <= e && (e = m);
135
135
  } else
136
136
  this.leadModel.isContinuous && !this.isSingleMode && (((a = this.formatEcgData) == null ? void 0 : a.dataPxLen) || 0) < e - this.leadHeadConfig.leadHedeWidth && (e = (((o = this.formatEcgData) == null ? void 0 : o.dataPxLen) || 0) + this.leadHeadConfig.leadHedeWidth);
137
137
  if (this.drawArea = {
@@ -154,13 +154,13 @@ let u = class extends K {
154
154
  }, this.leadNameList = ((r = this.formatEcgData) == null ? void 0 : r.processedData.otherParams.LeadName) || [], this.totalRows = this.leadModel.line + this.leadModel.add || 1, this.highestAndLowestPoint = (l = this.formatEcgData) == null ? void 0 : l.calcHighestAndLowestPoint(), this.isSingleMode)
155
155
  this.splitBlockHeight = (((n = this.formatEcgData) == null ? void 0 : n.analysisValueMode) === S.CompoundWave ? Math.abs(this.highestAndLowestPoint.ComplexData.maxPoints) + Math.abs(this.highestAndLowestPoint.ComplexData.minPoints) : Math.abs(this.highestAndLowestPoint.Data.maxPoints) + Math.abs(this.highestAndLowestPoint.Data.minPoints)) + 22, this.splitBlockHeight > this.drawArea.height && (this.splitBlockHeight = this.drawArea.height / 6, this.splitBlockHeight2 = this.drawArea.height / 6);
156
156
  else {
157
- let p = this.drawArea.height;
158
- this.leadModel.isShowPacing && (p = this.drawArea.height - this.drawBottomPacH), this.splitBlockHeight = p / this.totalRows, this.splitBlockHeight2 = p / this.totalRows;
157
+ let m = this.drawArea.height;
158
+ this.leadModel.isShowPacing && (m = this.drawArea.height - this.drawBottomPacH), this.splitBlockHeight = m / this.totalRows, this.splitBlockHeight2 = m / this.totalRows;
159
159
  }
160
- this.dataTotalTimes = F(
160
+ this.dataTotalTimes = G(
161
161
  this.waveFromData[0].length || 0,
162
162
  ((d = this.formatEcgData) == null ? void 0 : d.processedData.otherParams.SampleRate) || 0
163
- ), this.rulerStep = (((h = this.formatEcgData) == null ? void 0 : h.step) || 1) * (((c = this.formatEcgData) == null ? void 0 : c.processedData.otherParams.SampleRate) || 1) / (this.gridConfig.cellMg * 2 + 2);
163
+ ), this.rulerStep = (((h = this.formatEcgData) == null ? void 0 : h.step) || 1) * (((p = this.formatEcgData) == null ? void 0 : p.processedData.otherParams.SampleRate) || 1) / (this.gridConfig.cellMg * 2 + 2);
164
164
  }
165
165
  isLeadOff(e) {
166
166
  var t;
@@ -173,72 +173,59 @@ let u = class extends K {
173
173
  onDbClickWaveFrom(e, t) {
174
174
  console.log("onDbClickWaveFrom", e);
175
175
  const i = Date.now(), s = () => {
176
- var c, p, f, v;
176
+ var p, m, f, D;
177
177
  const a = e.target.name.split("_");
178
178
  this.activeLeadIdx = +a[0];
179
179
  const o = +a[1];
180
180
  let r = 0, l = 0;
181
181
  t === "single" ? (r = e.offsetX - this.singleWaveDataCopy[o].pos[0], l = this.singleWaveDataCopy[o].startInd) : t === "rowAndCol" ? (r = e.offsetX - this.waveDataCopy[o].pos[0], l = this.waveDataCopy[o].startInd || 0) : t === "add" && (r = e.offsetX - this.addWaveDataCopy[o].pos[0], l = this.addWaveDataCopy[o].startInd || 0);
182
- let n = x(r, (((c = this.formatEcgData) == null ? void 0 : c.step) || 1) * this.sceneMagnification);
182
+ let n = x(r, (((p = this.formatEcgData) == null ? void 0 : p.step) || 1) * this.sceneMagnification);
183
183
  n += l;
184
- const d = ((p = this.formatEcgData) == null ? void 0 : p.processedData.otherParams.AnalyseValue) || [];
184
+ const d = ((m = this.formatEcgData) == null ? void 0 : m.processedData.otherParams.AnalyseValue) || [];
185
185
  let h = null;
186
186
  if (this.enlargeWaveMode === S.SelectedHeartbeat) {
187
187
  if (n <= d[1].KeyPosByBeat.Tend + 0.1 * (((f = this.formatEcgData) == null ? void 0 : f.processedData.otherParams.SampleRate) || 0))
188
188
  h = d[1];
189
189
  else
190
- for (let D = 1; D < d.length; D++)
191
- if (n > d[D - 1].KeyPosByBeat.Tend + 1 && n < d[D].KeyPosByBeat.Tend + 0.1 * (((v = this.formatEcgData) == null ? void 0 : v.processedData.otherParams.SampleRate) || 0)) {
192
- h = d[D];
190
+ for (let v = 1; v < d.length; v++)
191
+ if (n > d[v - 1].KeyPosByBeat.Tend + 1 && n < d[v].KeyPosByBeat.Tend + 0.1 * (((D = this.formatEcgData) == null ? void 0 : D.processedData.otherParams.SampleRate) || 0)) {
192
+ h = d[v];
193
193
  break;
194
194
  }
195
195
  } else
196
196
  h = d[0];
197
- !h || (this.activeLeadAnalyseValue = P(G({}, h), {
197
+ !h || (this.activeLeadAnalyseValue = P(W({}, h), {
198
198
  BeatCount: d.length - 1
199
199
  }), h = null, this.$emit("notifyActiveEnlargr"), this.isShowEnlargeWave = !0);
200
200
  };
201
201
  i - this.dbClickWaveFromTime < 400 ? (this.dbClickWaveFromTime = 0, s()) : this.dbClickWaveFromTime = i;
202
202
  }
203
203
  sceneInsMousemove(e) {
204
- var t, i, s, a, o, r, l, n, d, h, c, p, f;
204
+ var t, i, s, a, o, r, l, n, d, h, p, m, f;
205
205
  if (e.event.preventDefault(), e.event.stopPropagation(), this.sceneIsMouseDown) {
206
206
  if (!e.event.touches || e.event.touches.length === 1) {
207
- const v = e.offsetY - this.sceneIsStartY, D = e.offsetX - this.sceneIsStartY;
208
- Math.abs(v) > Math.abs(D) ? (this.sceneIsMoveUpDown = !0, this.moveUpAndDown(e.offsetY - this.sceneIsMouseDownY), this.sceneIsMouseDownY = e.offsetY) : (this.sceneIsMoveUpDown = !1, this.scrollConfig.isNativeScroll ? (t = this.$refs[this.prefixId + "nativeScroll"]) == null || t.scrollBy({
207
+ const D = e.offsetY - this.sceneIsStartY, v = e.offsetX - this.sceneIsStartX;
208
+ Math.abs(D) > Math.abs(v) ? (this.sceneIsMoveUpDown = !0, this.moveUpAndDown(e.offsetY - this.sceneIsMouseDownY), this.sceneIsMouseDownY = e.offsetY) : (this.sceneIsMoveUpDown = !1, this.scrollConfig.isNativeScroll ? (t = this.$refs[this.prefixId + "nativeScroll"]) == null || t.scrollBy({
209
209
  left: -(e.offsetX - this.sceneIsMouseDownX),
210
210
  top: 0
211
211
  }) : this.$refs[this.prefixId + "vueScroll"].scrollBy({
212
212
  dx: -(e.offsetX - this.sceneIsMouseDownX)
213
213
  }), this.sceneIsMouseDownX = e.offsetX);
214
214
  } else if (this.supportTwoFingerZoom && e.event.touches.length === 2) {
215
- const v = $({
215
+ const D = $({
216
216
  x: e.event.touches[0].pageX,
217
217
  y: e.event.touches[0].pageY
218
218
  }, {
219
219
  x: e.event.touches[1].pageX,
220
220
  y: e.event.touches[1].pageY
221
221
  });
222
- this.sceneFirstDistance === 0 && (this.sceneFirstDistance = v), v < this.sceneFirstDistance ? (this.sceneMagnification -= this.zoomStep, this.sceneMagnification < 0.1 && (this.sceneMagnification = 0.1)) : this.sceneMagnification += this.zoomStep, this.splitBlockHeight = this.splitBlockHeight2 * this.sceneMagnification, (i = this.leadHeadNameGroup) == null || i.removeAll(), (s = this.leadHeadOffAndDelGroup) == null || s.removeAll(), (a = this.heardBeatLineGroup) == null || a.removeAll(), (o = this.rulerGroup) == null || o.removeAll(), (r = this.arrowGroup) == null || r.removeAll(), (l = this.splitLineGroup) == null || l.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup), (d = this.rowAndColwaveFromGroup) == null || d.removeAll(), (h = this.singleWaveFromGroup) == null || h.removeAll(), (c = this.addwaveFromGroup) == null || c.removeAll(), (p = this.leadHeadGroup) == null || p.removeAll(), (f = this.pacingGroup) == null || f.removeAll(), this.drawWaveFrom(), this.sceneFirstDistance = v, this.zoomWave();
222
+ this.sceneFirstDistance === 0 && (this.sceneFirstDistance = D), D < this.sceneFirstDistance ? (this.sceneMagnification -= this.zoomStep, this.sceneMagnification < 0.1 && (this.sceneMagnification = 0.1)) : this.sceneMagnification += this.zoomStep, this.splitBlockHeight = this.splitBlockHeight2 * this.sceneMagnification, (i = this.leadHeadNameGroup) == null || i.removeAll(), (s = this.leadHeadOffAndDelGroup) == null || s.removeAll(), (a = this.heardBeatLineGroup) == null || a.removeAll(), (o = this.rulerGroup) == null || o.removeAll(), (r = this.arrowGroup) == null || r.removeAll(), (l = this.splitLineGroup) == null || l.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup), (d = this.rowAndColwaveFromGroup) == null || d.removeAll(), (h = this.singleWaveFromGroup) == null || h.removeAll(), (p = this.addwaveFromGroup) == null || p.removeAll(), (m = this.leadHeadGroup) == null || m.removeAll(), (f = this.pacingGroup) == null || f.removeAll(), this.drawWaveFrom(), this.sceneFirstDistance = D, this.zoomWave();
223
223
  }
224
224
  }
225
225
  }
226
226
  moveUpAndDown(e) {
227
227
  var t, i, s, a, o, r, l, n, d, h;
228
- if (this.isSingleMode) {
229
- const c = this.singleWaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e) + this.singleWaveFromGroup.getBoundingRect().height, p = this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e) + this.arrowGroup.getBoundingRect().height, f = c < p ? p : c, v = this.singleWaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e), D = this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e), M = v < D ? v : D;
230
- if (f < this.canvasContainer.height - 100 || M > this.canvasContainer.height - 100)
231
- return;
232
- } else {
233
- const c = this.rowAndColwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e) + this.rowAndColwaveFromGroup.getBoundingRect().height, p = this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e) + this.arrowGroup.getBoundingRect().height, f = this.addwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e) + this.addwaveFromGroup.getBoundingRect().height;
234
- let v = c < p ? p : c;
235
- v = f < v ? v : f;
236
- const D = this.rowAndColwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e), M = this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e), y = this.addwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e);
237
- let C = D < M ? D : M;
238
- if (C = y < C ? y : C, v < this.canvasContainer.height - 100 || C > this.canvasContainer.height - 100)
239
- return;
240
- }
241
- this.isSingleMode ? (t = this.singleWaveFromGroup) == null || t.attr({
228
+ this.isSingleMode ? (this.singleWaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e) + this.singleWaveFromGroup.getBoundingRect().height, this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e) + this.arrowGroup.getBoundingRect().height, this.singleWaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e), this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e)) : (this.rowAndColwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e) + this.rowAndColwaveFromGroup.getBoundingRect().height, this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e) + this.arrowGroup.getBoundingRect().height, this.addwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e) + this.addwaveFromGroup.getBoundingRect().height, this.rowAndColwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e), this.arrowGroup.getBoundingRect().y + (this.arrowGroup.y + e), this.addwaveFromGroup.getBoundingRect().y + (this.rowAndColwaveFromGroup.y + e)), this.isSingleMode ? (t = this.singleWaveFromGroup) == null || t.attr({
242
229
  y: this.singleWaveFromGroup.y + e
243
230
  }) : ((i = this.rowAndColwaveFromGroup) == null || i.attr({
244
231
  y: this.rowAndColwaveFromGroup.y + e
@@ -286,7 +273,7 @@ let u = class extends K {
286
273
  return;
287
274
  (a = this.pacingGroup) == null || a.removeAll(), (o = this.sceneIns) == null || o.remove(this.pacingGroup);
288
275
  const e = this.leadHeadConfig.leadHedeWidth, t = this.canvasContainer.height - this.drawBottomPacH;
289
- (r = this.pacingGroup) == null || r.add(new W({
276
+ (r = this.pacingGroup) == null || r.add(new C({
290
277
  cursor: "",
291
278
  style: {
292
279
  x: e,
@@ -383,23 +370,23 @@ let u = class extends K {
383
370
  (l = this.sceneIns) == null || l.add(this.leadHeadGroup);
384
371
  }
385
372
  drawColSplitLine() {
386
- var a, o, r, l, n, d, h, c, p, f, v, D, M;
373
+ var a, o, r, l, n, d, h, p, m, f, D, v, F;
387
374
  (a = this.splitLineGroup) == null || a.removeAll(), (o = this.sceneIns) == null || o.remove(this.splitLineGroup);
388
375
  const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / this.leadModel.column;
389
376
  if (this.splitPoint = e, this.isSingleMode) {
390
- const y = F(
377
+ const M = G(
391
378
  Math.ceil(this.splitPoint / ((((r = this.formatEcgData) == null ? void 0 : r.step) || 1) * this.sceneMagnification)) || 0,
392
379
  ((l = this.formatEcgData) == null ? void 0 : l.processedData.otherParams.SampleRate) || 0
393
- ), C = parseInt(`${y / 1e3 % 60}`, 10);
394
- this.splitPoint = C * (((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.SampleRate) || 0) * (((d = this.formatEcgData) == null ? void 0 : d.step) || 0) * this.sceneMagnification;
380
+ ), I = parseInt(`${M / 1e3 % 60}`, 10);
381
+ this.splitPoint = I * (((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.SampleRate) || 0) * (((d = this.formatEcgData) == null ? void 0 : d.step) || 0) * this.sceneMagnification;
395
382
  }
396
383
  let t = 0, i = 0, s = 0;
397
- for (let y = 1; y <= this.leadModel.column - 1; y++) {
398
- t = y * e + this.leadHeadConfig.leadHedeWidth, i = y * this.leadModel.line;
399
- for (let C = 1; C <= this.leadModel.line && (s = (((h = this.formatEcgData) == null ? void 0 : h.processedData.otherParams.LeadName) || [])[C - 1 + i], s !== void 0); C++)
400
- ((c = this.formatEcgData) == null ? void 0 : c.gainName) === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.LeadNameTextsPorps[s]) ? (f = this.splitLineGroup) == null || f.add(this.creatSplitLine(t, C * this.splitBlockHeight - (((p = this.formatEcgData) == null ? void 0 : p.sens) || 0) * this.sceneMagnification / 2 * 0.5, !0)) : (D = this.splitLineGroup) == null || D.add(this.creatSplitLine(t, C * this.splitBlockHeight - (((v = this.formatEcgData) == null ? void 0 : v.sens) || 0) * this.sceneMagnification * 0.5));
384
+ for (let M = 1; M <= this.leadModel.column - 1; M++) {
385
+ t = M * e + this.leadHeadConfig.leadHedeWidth, i = M * this.leadModel.line;
386
+ for (let I = 1; I <= this.leadModel.line && (s = (((h = this.formatEcgData) == null ? void 0 : h.processedData.otherParams.LeadName) || [])[I - 1 + i], s !== void 0); I++)
387
+ ((p = this.formatEcgData) == null ? void 0 : p.gainName) === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.LeadNameTextsPorps[s]) ? (f = this.splitLineGroup) == null || f.add(this.creatSplitLine(t, I * this.splitBlockHeight - (((m = this.formatEcgData) == null ? void 0 : m.sens) || 0) * this.sceneMagnification / 2 * 0.5, !0)) : (v = this.splitLineGroup) == null || v.add(this.creatSplitLine(t, I * this.splitBlockHeight - (((D = this.formatEcgData) == null ? void 0 : D.sens) || 0) * this.sceneMagnification * 0.5));
401
388
  }
402
- (M = this.sceneIns) == null || M.add(this.splitLineGroup);
389
+ (F = this.sceneIns) == null || F.add(this.splitLineGroup);
403
390
  }
404
391
  initSlidingWindowInfo() {
405
392
  var s, a;
@@ -429,8 +416,8 @@ let u = class extends K {
429
416
  startInd: s,
430
417
  endInd: a,
431
418
  data: i.slice(s, a).map((d, h) => {
432
- var c;
433
- return [h * (((c = this.formatEcgData) == null ? void 0 : c.step) || 0) * this.sceneMagnification, -d * this.sceneMagnification];
419
+ var p;
420
+ return [h * (((p = this.formatEcgData) == null ? void 0 : p.step) || 0) * this.sceneMagnification, -d * this.sceneMagnification];
434
421
  })
435
422
  });
436
423
  }
@@ -447,8 +434,8 @@ let u = class extends K {
447
434
  startInd: a,
448
435
  endInd: o,
449
436
  data: s.slice(a, o).map((d, h) => {
450
- var c;
451
- return [h * (((c = this.formatEcgData) == null ? void 0 : c.step) || 0) * this.sceneMagnification, -d * this.sceneMagnification];
437
+ var p;
438
+ return [h * (((p = this.formatEcgData) == null ? void 0 : p.step) || 0) * this.sceneMagnification, -d * this.sceneMagnification];
452
439
  })
453
440
  });
454
441
  }
@@ -470,10 +457,10 @@ let u = class extends K {
470
457
  return e;
471
458
  }
472
459
  createSingleWaveFrom() {
473
- var r, l, n, d, h, c, p;
460
+ var r, l, n, d, h, p, m;
474
461
  (r = this.singleWaveFromGroup) == null || r.removeAll();
475
462
  const e = (((l = this.formatEcgData) == null ? void 0 : l.processedData.otherParams.LeadName) || [])[this.singleModeInfo.defaultSelect] || 0;
476
- let t = this.getRednerSinglePoints(), i = F(this.slidingWindowInfo.points || 0, ((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.SampleRate) || 0);
463
+ let t = this.getRednerSinglePoints(), i = G(this.slidingWindowInfo.points || 0, ((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.SampleRate) || 0);
477
464
  const s = i;
478
465
  let a = 0, o = 0;
479
466
  for (let f = 0; f < t.length && !(t[f].pos[1] > this.drawArea.height + this.bottomAreaHeight); f++)
@@ -481,19 +468,19 @@ let u = class extends K {
481
468
  cursor: "",
482
469
  name: this.singleModeInfo.defaultSelect + "_" + f,
483
470
  shape: {
484
- points: t[f].data.map(([v, D]) => [
485
- v + t[f].pos[0],
486
- D + t[f].pos[1]
471
+ points: t[f].data.map(([D, v]) => [
472
+ D + t[f].pos[0],
473
+ v + t[f].pos[1]
487
474
  ])
488
475
  },
489
476
  style: {
490
477
  stroke: this.leadConfig.lineColor,
491
478
  lineWidth: this.leadConfig.lineWidth
492
479
  },
493
- onclick: (v) => {
494
- this.onDbClickWaveFrom(v, "single");
480
+ onclick: (D) => {
481
+ this.onDbClickWaveFrom(D, "single");
495
482
  }
496
- })), (c = this.singleWaveFromGroup) == null || c.add(new W({
483
+ })), (p = this.singleWaveFromGroup) == null || p.add(new C({
497
484
  cursor: "",
498
485
  style: {
499
486
  x: t[f].pos[0],
@@ -505,7 +492,7 @@ let u = class extends K {
505
492
  fontFamily: this.fontFamily
506
493
  }
507
494
  })), f > 0 && (i += s));
508
- this.createLeadName(e, t[0].pos[0] - 10, t[0].pos[1] + 10), this.createLeadOffAndDel(e, t[0].pos[0] - 5, t[0].pos[1] - (((p = this.formatEcgData) == null ? void 0 : p.sens) || 0) * this.sceneMagnification / 2 - 15), this.singleWaveDataCopy = t, t = null;
495
+ this.createLeadName(e, t[0].pos[0] - 10, t[0].pos[1] + 10), this.createLeadOffAndDel(e, t[0].pos[0] - 5, t[0].pos[1] - (((m = this.formatEcgData) == null ? void 0 : m.sens) || 0) * this.sceneMagnification / 2 - 15), this.singleWaveDataCopy = t, t = null;
509
496
  }
510
497
  createAddWaveFrom() {
511
498
  var t, i;
@@ -557,7 +544,7 @@ let u = class extends K {
557
544
  }
558
545
  createLeadName(e, t, i, s = !1) {
559
546
  var a;
560
- (a = this.leadHeadNameGroup) == null || a.add(new W({
547
+ (a = this.leadHeadNameGroup) == null || a.add(new C({
561
548
  style: {
562
549
  x: t,
563
550
  y: i,
@@ -568,7 +555,7 @@ let u = class extends K {
568
555
  },
569
556
  oncontextmenu: (o) => {
570
557
  o.event.preventDefault(), this.$emit("notiifyLeadName", {
571
- event: P(G({}, o), {
558
+ event: P(W({}, o), {
572
559
  name: this.LeadNameTextsPorps[e],
573
560
  idx: e
574
561
  }),
@@ -577,7 +564,7 @@ let u = class extends K {
577
564
  },
578
565
  onclick: (o) => {
579
566
  this.$emit("notiifyLeadName", {
580
- event: P(G({}, o), {
567
+ event: P(W({}, o), {
581
568
  name: this.LeadNameTextsPorps[e],
582
569
  idx: e
583
570
  }),
@@ -588,7 +575,7 @@ let u = class extends K {
588
575
  }
589
576
  createLeadOffAndDel(e, t, i) {
590
577
  var s;
591
- (this.isLeadOff(e) || this.isLeadDel(e)) && ((s = this.leadHeadOffAndDelGroup) == null || s.add(new W({
578
+ (this.isLeadOff(e) || this.isLeadDel(e)) && ((s = this.leadHeadOffAndDelGroup) == null || s.add(new C({
592
579
  cursor: "",
593
580
  style: {
594
581
  x: t,
@@ -609,15 +596,15 @@ let u = class extends K {
609
596
  fill: "#FF0080",
610
597
  fontSize: 13,
611
598
  fontFamily: this.fontFamily
612
- }, t = new W({
599
+ }, t = new C({
613
600
  cursor: "",
614
- style: G({
601
+ style: W({
615
602
  text: "(s)",
616
603
  x: this.leadHeadConfig.leadHedeWidth / 2 - 8,
617
604
  y: this.canvasContainer.height - 25
618
605
  }, e)
619
- }), i = new W({
620
- style: G({
606
+ }), i = new C({
607
+ style: W({
621
608
  text: `${((s = this.formatEcgData) == null ? void 0 : s.gainName) === "\u80F8\u5BFC\u51CF\u534A" ? (a = this.formatEcgData) == null ? void 0 : a.gainName : `${(o = this.formatEcgData) == null ? void 0 : o.gain}mm/mV`} ${(r = this.formatEcgData) == null ? void 0 : r.speed}mm/s`,
622
609
  x: this.leadHeadConfig.leadHedeWidth / 2 + 20,
623
610
  y: this.canvasContainer.height - this.ruleH
@@ -634,11 +621,11 @@ let u = class extends K {
634
621
  if (this.leadModel.isContinuous)
635
622
  a = t * 5;
636
623
  else if (!this.leadModel.add && ((o = this.formatEcgData) == null ? void 0 : o.step)) {
637
- const h = x(this.splitPoint, this.formatEcgData.step * this.sceneMagnification), c = F(h, ((r = this.formatEcgData) == null ? void 0 : r.processedData.otherParams.SampleRate) || 0) / 1e3;
638
- a = e + c;
624
+ const h = x(this.splitPoint, this.formatEcgData.step * this.sceneMagnification), p = G(h, ((r = this.formatEcgData) == null ? void 0 : r.processedData.otherParams.SampleRate) || 0) / 1e3;
625
+ a = e + p;
639
626
  }
640
627
  for (let h = e; h <= a; h = +(h + 0.1).toFixed(1))
641
- h !== e && (i += this.rulerStep * this.sceneMagnification), h % 1 === 0 ? (s = this.canvasContainer.height - 10, (l = this.rulerGroup) == null || l.add(new W({
628
+ h !== e && (i += this.rulerStep * this.sceneMagnification), h % 1 === 0 ? (s = this.canvasContainer.height - 10, (l = this.rulerGroup) == null || l.add(new C({
642
629
  cursor: "",
643
630
  style: {
644
631
  x: i,
@@ -672,7 +659,7 @@ let u = class extends K {
672
659
  (e = this.sceneIns) == null || e.add(this.leadHeadNameGroup), (t = this.sceneIns) == null || t.add(this.leadHeadOffAndDelGroup);
673
660
  }
674
661
  drawLoopArrow(e = 0) {
675
- var l, n, d, h, c, p, f, v, D, M, y, C, O, R, z, k, N;
662
+ var l, n, d, h, p, m, f, D, v, F, M, I, B, R, z, k, N;
676
663
  if (this.drawLoopArrowStartPosIdx = e, !this.heartFight.isShow)
677
664
  return;
678
665
  this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = ((l = this.formatEcgData) == null ? void 0 : l.heartBeatPosition[this.heartFight.defaultSelect]) || null, this.drawHeardBeatLine());
@@ -686,11 +673,11 @@ let u = class extends K {
686
673
  };
687
674
  let r = 0;
688
675
  for (let L = 0; L < (((d = this.formatEcgData) == null ? void 0 : d.heartBeatPosition) || []).length; L++) {
689
- const g = (h = this.formatEcgData) == null ? void 0 : h.heartBeatPosition[L];
690
- if (r = ((g == null ? void 0 : g.position) || 0) - e, !(e > ((g == null ? void 0 : g.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && r > (this.slidingWindowInfo.points || 0)) && !(this.isSingleMode && this.singleModeInfo && r > (this.slidingWindowInfo.points || 0))) {
691
- if (((g == null ? void 0 : g.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
676
+ const c = (h = this.formatEcgData) == null ? void 0 : h.heartBeatPosition[L];
677
+ if (r = ((c == null ? void 0 : c.position) || 0) - e, !(e > ((c == null ? void 0 : c.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && r > (this.slidingWindowInfo.points || 0)) && !(this.isSingleMode && this.singleModeInfo && r > (this.slidingWindowInfo.points || 0))) {
678
+ if (((c == null ? void 0 : c.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
692
679
  break;
693
- t = r * (((c = this.formatEcgData) == null ? void 0 : c.step) || 0) * this.sceneMagnification + this.leadHeadConfig.leadHedeWidth - 9.5, a = 0, (v = this.arrowGroup) == null || v.add(new te({
680
+ t = r * (((p = this.formatEcgData) == null ? void 0 : p.step) || 0) * this.sceneMagnification + this.leadHeadConfig.leadHedeWidth - 9.5, a = 0, (D = this.arrowGroup) == null || D.add(new te({
694
681
  name: "arrow_box",
695
682
  shape: {
696
683
  points: [
@@ -705,7 +692,7 @@ let u = class extends K {
705
692
  ]
706
693
  },
707
694
  style: {
708
- fill: ((f = (p = this.currentHeardBeat) == null ? void 0 : p.heardBeat) == null ? void 0 : f.index) === (g == null ? void 0 : g.index) ? "blue" : "#ccc"
695
+ fill: ((f = (m = this.currentHeardBeat) == null ? void 0 : m.heardBeat) == null ? void 0 : f.index) === (c == null ? void 0 : c.index) ? "blue" : "#ccc"
709
696
  },
710
697
  onclick: (E) => {
711
698
  var j;
@@ -715,35 +702,35 @@ let u = class extends K {
715
702
  A.id !== E.target.id && A.attr({
716
703
  style: { fill: "#ccc" }
717
704
  });
718
- }), this.arrowLoopClick(g, E.target));
705
+ }), this.arrowLoopClick(c, E.target));
719
706
  }
720
- })), this.heartFight.heartrate && (s = ((D = this.AssistCtx) == null ? void 0 : D.measureText(`${(g == null ? void 0 : g.heartrate) || ""}`).width) || 0, (M = this.arrowGroup) == null || M.add(new W({
707
+ })), this.heartFight.heartrate && (s = ((v = this.AssistCtx) == null ? void 0 : v.measureText(`${(c == null ? void 0 : c.heartrate) || ""}`).width) || 0, (F = this.arrowGroup) == null || F.add(new C({
721
708
  cursor: "",
722
- style: G({
709
+ style: W({
723
710
  x: 4 + t - s * 1.5,
724
711
  y: a + i,
725
- text: `${(g == null ? void 0 : g.heartrate) || ""}`
712
+ text: `${(c == null ? void 0 : c.heartrate) || ""}`
726
713
  }, o)
727
- })), a += 12), this.heartFight.interval && (s = ((y = this.AssistCtx) == null ? void 0 : y.measureText(`${(g == null ? void 0 : g.interval) || ""}`).width) || 0, (C = this.arrowGroup) == null || C.add(new W({
714
+ })), a += 12), this.heartFight.interval && (s = ((M = this.AssistCtx) == null ? void 0 : M.measureText(`${(c == null ? void 0 : c.interval) || ""}`).width) || 0, (I = this.arrowGroup) == null || I.add(new C({
728
715
  cursor: "",
729
- style: G({
716
+ style: W({
730
717
  x: 4 + t - s * 1.5,
731
718
  y: a + i,
732
- text: `${(g == null ? void 0 : g.interval) || ""}`
719
+ text: `${(c == null ? void 0 : c.interval) || ""}`
733
720
  }, o)
734
- })), a += 12), this.heartFight.qrstCompany && (s = ((O = this.AssistCtx) == null ? void 0 : O.measureText(`${(g == null ? void 0 : g.qrstCompany) || ""}`).width) || 0, (R = this.arrowGroup) == null || R.add(new W({
721
+ })), a += 12), this.heartFight.qrstCompany && (s = ((B = this.AssistCtx) == null ? void 0 : B.measureText(`${(c == null ? void 0 : c.qrstCompany) || ""}`).width) || 0, (R = this.arrowGroup) == null || R.add(new C({
735
722
  cursor: "",
736
- style: G({
723
+ style: W({
737
724
  x: 4 + t - s * 1.5,
738
725
  y: a + i,
739
- text: `${(g == null ? void 0 : g.qrstCompany) || ""}`
726
+ text: `${(c == null ? void 0 : c.qrstCompany) || ""}`
740
727
  }, o)
741
- })), a += 12), this.heartFight.telectricalaxis && (s = ((z = this.AssistCtx) == null ? void 0 : z.measureText(`${(g == null ? void 0 : g.telectricalaxis) || ""}`).width) || 0, (k = this.arrowGroup) == null || k.add(new W({
728
+ })), a += 12), this.heartFight.telectricalaxis && (s = ((z = this.AssistCtx) == null ? void 0 : z.measureText(`${(c == null ? void 0 : c.telectricalaxis) || ""}`).width) || 0, (k = this.arrowGroup) == null || k.add(new C({
742
729
  cursor: "",
743
- style: G({
730
+ style: W({
744
731
  x: 4 + t - s * 1.5,
745
732
  y: a + i,
746
- text: `${(g == null ? void 0 : g.telectricalaxis) || ""}`
733
+ text: `${(c == null ? void 0 : c.telectricalaxis) || ""}`
747
734
  }, o)
748
735
  })));
749
736
  }
@@ -754,30 +741,30 @@ let u = class extends K {
754
741
  this.$emit("notifyHeardBeat", ie.clone(e)), this.currentHeardBeat.heardBeat = e, this.currentHeardBeat.ele = t, this.drawHeardBeatLine();
755
742
  }
756
743
  drawHeardBeatLine(e = 0) {
757
- var r, l, n, d, h, c;
744
+ var r, l, n, d, h, p;
758
745
  if (!this.currentHeardBeat.heardBeat)
759
746
  return;
760
747
  (r = this.heardBeatLineGroup) == null || r.removeAll(), (l = this.sceneIns) == null || l.remove(this.heardBeatLineGroup);
761
748
  let t = this.formatEcgData.processedData.otherParams.AnalyseValue[this.currentHeardBeat.heardBeat.index].KeyPosByBeat, i = 0, s = this.getRednerPoints(), a = this.getAddRednerPoints(), o;
762
- for (const p in t)
763
- if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(p) && Object.prototype.hasOwnProperty.call(t, p)) {
764
- i = (t[p] - this.slidingWindowInfo.startInd) * (((n = this.formatEcgData) == null ? void 0 : n.step) || 0) * this.sceneMagnification;
749
+ for (const m in t)
750
+ if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(m) && Object.prototype.hasOwnProperty.call(t, m)) {
751
+ i = (t[m] - this.slidingWindowInfo.startInd) * (((n = this.formatEcgData) == null ? void 0 : n.step) || 0) * this.sceneMagnification;
765
752
  e:
766
753
  for (let f = 0; f < s.length; f++)
767
754
  if (!(this.isLeadOff(f) || this.isLeadDel(f))) {
768
- if (e > t[p] || !this.leadModel.isContinuous && t[p] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (o = s[f], this.leadModel.isContinuous && f > this.leadModel.line - 1))
755
+ if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (o = s[f], this.leadModel.isContinuous && f > this.leadModel.line - 1))
769
756
  break e;
770
757
  (d = this.heardBeatLineGroup) == null || d.add(this.createHeardBeatLine(o.pos[0] + i, o.pos[1]));
771
758
  }
772
759
  e:
773
760
  for (let f = 0; f < a.length; f++)
774
761
  if (!(this.isLeadOff(this.longLeadConfig.leadIdxs[f]) && this.isLeadDel(this.longLeadConfig.leadIdxs[f]))) {
775
- if (e > t[p])
762
+ if (e > t[m])
776
763
  break e;
777
764
  o = a[f], (h = this.heardBeatLineGroup) == null || h.add(this.createHeardBeatLine(o.pos[0] + i, o.pos[1]));
778
765
  }
779
766
  }
780
- (c = this.sceneIns) == null || c.add(this.heardBeatLineGroup), t = null, s = null, a = null;
767
+ (p = this.sceneIns) == null || p.add(this.heardBeatLineGroup), t = null, s = null, a = null;
781
768
  }
782
769
  createHeardBeatLine(e, t) {
783
770
  return new b({
@@ -814,18 +801,18 @@ let u = class extends K {
814
801
  this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((d, h) => {
815
802
  h = h || 0, d.attr({
816
803
  shape: {
817
- points: t[h].data.map(([c, p]) => [
818
- c + t[h].pos[0],
819
- p + t[h].pos[1]
804
+ points: t[h].data.map(([p, m]) => [
805
+ p + t[h].pos[0],
806
+ m + t[h].pos[1]
820
807
  ])
821
808
  }
822
809
  });
823
810
  }), (a = this.addwaveFromGroup) == null || a.eachChild((d, h) => {
824
811
  h = h || 0, d.attr({
825
812
  shape: {
826
- points: i[h].data.map(([c, p]) => [
827
- c + i[h].pos[0],
828
- p + i[h].pos[1]
813
+ points: i[h].data.map(([p, m]) => [
814
+ p + i[h].pos[0],
815
+ m + i[h].pos[1]
829
816
  ])
830
817
  }
831
818
  });
@@ -841,7 +828,7 @@ let u = class extends K {
841
828
  scrollRuler(e) {
842
829
  var i, s, a;
843
830
  (i = this.rulerGroup) == null || i.removeAll(), (s = this.sceneIns) == null || s.remove(this.rulerGroup);
844
- const t = F(this.isSingleMode ? 0 : e, ((a = this.formatEcgData) == null ? void 0 : a.processedData.otherParams.SampleRate) || 0) / 1e3;
831
+ const t = G(this.isSingleMode ? 0 : e, ((a = this.formatEcgData) == null ? void 0 : a.processedData.otherParams.SampleRate) || 0) / 1e3;
845
832
  this.drawRuler(t);
846
833
  }
847
834
  scrollArrow(e) {
@@ -849,70 +836,70 @@ let u = class extends K {
849
836
  (t = this.arrowGroup) == null || t.removeAll(), (i = this.sceneIns) == null || i.remove(this.arrowGroup), this.drawLoopArrow(e), this.drawHeardBeatLine(e);
850
837
  }
851
838
  };
852
- m([
839
+ u([
853
840
  w({
854
841
  default: () => 0.04
855
842
  })
856
- ], u.prototype, "zoomStep", 2);
857
- m([
843
+ ], g.prototype, "zoomStep", 2);
844
+ u([
858
845
  w({
859
846
  default: () => !0
860
847
  })
861
- ], u.prototype, "supportTwoFingerZoom", 2);
862
- m([
848
+ ], g.prototype, "supportTwoFingerZoom", 2);
849
+ u([
863
850
  w({
864
851
  default: () => ""
865
852
  })
866
- ], u.prototype, "prefixId", 2);
867
- m([
853
+ ], g.prototype, "prefixId", 2);
854
+ u([
868
855
  w({
869
856
  required: !0,
870
857
  type: Number,
871
858
  validator: (e) => typeof e == "number"
872
859
  })
873
- ], u.prototype, "width", 2);
874
- m([
860
+ ], g.prototype, "width", 2);
861
+ u([
875
862
  w({
876
863
  required: !0,
877
864
  type: Number,
878
865
  validator: (e) => typeof e == "number"
879
866
  })
880
- ], u.prototype, "height", 2);
881
- m([
867
+ ], g.prototype, "height", 2);
868
+ u([
882
869
  w({
883
870
  default: 0,
884
871
  validator: (e) => typeof e == "number"
885
872
  })
886
- ], u.prototype, "MXEnlargeWaveWidth", 2);
887
- m([
873
+ ], g.prototype, "MXEnlargeWaveWidth", 2);
874
+ u([
888
875
  w({
889
876
  default: () => J
890
877
  })
891
- ], u.prototype, "LeadNameTextsPorps", 2);
892
- m([
878
+ ], g.prototype, "LeadNameTextsPorps", 2);
879
+ u([
893
880
  w({
894
881
  default: 0,
895
882
  type: Number,
896
883
  validator: (e) => typeof e == "number"
897
884
  })
898
- ], u.prototype, "MXEnlargeWaveHeight", 2);
899
- m([
885
+ ], g.prototype, "MXEnlargeWaveHeight", 2);
886
+ u([
900
887
  w({
901
888
  required: !0
902
889
  })
903
- ], u.prototype, "gridConfig", 2);
904
- m([
890
+ ], g.prototype, "gridConfig", 2);
891
+ u([
905
892
  w({
906
893
  default: 5,
907
894
  type: Number
908
895
  })
909
- ], u.prototype, "cellPoints", 2);
910
- m([
896
+ ], g.prototype, "cellPoints", 2);
897
+ u([
911
898
  w({
912
899
  required: !0
913
900
  })
914
- ], u.prototype, "conventionalECGConfig", 2);
915
- m([
901
+ ], g.prototype, "conventionalECGConfig", 2);
902
+ u([
916
903
  w({
917
904
  default: () => ({
918
905
  leadHedeWidth: 20,
@@ -920,18 +907,18 @@ m([
920
907
  leadHedeLineWidth: 2
921
908
  })
922
909
  })
923
- ], u.prototype, "leadHeadConfig", 2);
924
- m([
910
+ ], g.prototype, "leadHeadConfig", 2);
911
+ u([
925
912
  w({
926
913
  required: !0
927
914
  })
928
- ], u.prototype, "formatEcgData", 2);
929
- m([
915
+ ], g.prototype, "formatEcgData", 2);
916
+ u([
930
917
  w({
931
918
  required: !0
932
919
  })
933
- ], u.prototype, "leadModel", 2);
934
- m([
920
+ ], g.prototype, "leadModel", 2);
921
+ u([
935
922
  w({
936
923
  default: () => ({
937
924
  lineColor: "#000",
@@ -940,21 +927,21 @@ m([
940
927
  fontSize: 15
941
928
  })
942
929
  })
943
- ], u.prototype, "leadConfig", 2);
944
- m([
930
+ ], g.prototype, "leadConfig", 2);
931
+ u([
945
932
  w({
946
933
  default: 5
947
934
  })
948
- ], u.prototype, "magnification", 2);
949
- m([
935
+ ], g.prototype, "magnification", 2);
936
+ u([
950
937
  w({
951
938
  default: () => ({
952
939
  leadIdxs: [1, 6, 10],
953
940
  leadNames: [1, 6, 10]
954
941
  })
955
942
  })
956
- ], u.prototype, "longLeadConfig", 2);
957
- m([
943
+ ], g.prototype, "longLeadConfig", 2);
944
+ u([
958
945
  w({
959
946
  default: () => ({
960
947
  isShow: !1,
@@ -966,8 +953,8 @@ m([
966
953
  telectricalaxis: !1
967
954
  })
968
955
  })
969
- ], u.prototype, "heartFight", 2);
970
- m([
956
+ ], g.prototype, "heartFight", 2);
957
+ u([
971
958
  w({
972
959
  default: () => ({
973
960
  isShow: !0,
@@ -981,84 +968,84 @@ m([
981
968
  }
982
969
  })
983
970
  })
984
- ], u.prototype, "scrollConfig", 2);
985
- m([
971
+ ], g.prototype, "scrollConfig", 2);
972
+ u([
986
973
  w({
987
974
  default: () => ({
988
975
  isShow: !1
989
976
  })
990
977
  })
991
- ], u.prototype, "rulerConfig", 2);
992
- m([
978
+ ], g.prototype, "rulerConfig", 2);
979
+ u([
993
980
  w({
994
981
  default: () => ({
995
982
  isShow: !1
996
983
  })
997
984
  })
998
- ], u.prototype, "measurRulerConfig", 2);
999
- m([
985
+ ], g.prototype, "measurRulerConfig", 2);
986
+ u([
1000
987
  w({
1001
988
  default: () => ({
1002
989
  isShow: !1
1003
990
  })
1004
991
  })
1005
- ], u.prototype, "paralleRulerConfig", 2);
1006
- m([
992
+ ], g.prototype, "paralleRulerConfig", 2);
993
+ u([
1007
994
  w({
1008
995
  default: () => ({
1009
996
  isShow: !1
1010
997
  })
1011
998
  })
1012
- ], u.prototype, "magnifierRulerConfig", 2);
1013
- m([
999
+ ], g.prototype, "magnifierRulerConfig", 2);
1000
+ u([
1014
1001
  w({
1015
1002
  default: 60
1016
1003
  })
1017
- ], u.prototype, "ventricularRate", 2);
1018
- m([
1004
+ ], g.prototype, "ventricularRate", 2);
1005
+ u([
1019
1006
  w({
1020
1007
  default: S.CompoundWave
1021
1008
  })
1022
- ], u.prototype, "enlargeWaveMode", 2);
1023
- m([
1009
+ ], g.prototype, "enlargeWaveMode", 2);
1010
+ u([
1024
1011
  w({
1025
1012
  default: () => []
1026
1013
  })
1027
- ], u.prototype, "enlargeGains", 2);
1028
- m([
1014
+ ], g.prototype, "enlargeGains", 2);
1015
+ u([
1029
1016
  w({
1030
1017
  default: () => []
1031
1018
  })
1032
- ], u.prototype, "enlargeSpeeds", 2);
1033
- m([
1019
+ ], g.prototype, "enlargeSpeeds", 2);
1020
+ u([
1034
1021
  w({
1035
1022
  default: () => ({
1036
1023
  defaultSelect: 1
1037
1024
  })
1038
1025
  })
1039
- ], u.prototype, "singleModeInfo", 2);
1040
- m([
1026
+ ], g.prototype, "singleModeInfo", 2);
1027
+ u([
1041
1028
  w({ default: !0 })
1042
- ], u.prototype, "isMXEnlargeWaveShow", 2);
1043
- m([
1029
+ ], g.prototype, "isMXEnlargeWaveShow", 2);
1030
+ u([
1044
1031
  w({
1045
1032
  default: !1
1046
1033
  })
1047
- ], u.prototype, "isSyncAnalyseValueCheck", 2);
1048
- m([
1049
- B(200)
1050
- ], u.prototype, "sceneInsMousemove", 1);
1051
- m([
1052
- B(200)
1053
- ], u.prototype, "nativeScrollFunc", 1);
1054
- m([
1055
- B(200)
1056
- ], u.prototype, "handleScroll", 1);
1057
- u = m([
1034
+ ], g.prototype, "isSyncAnalyseValueCheck", 2);
1035
+ u([
1036
+ O(200)
1037
+ ], g.prototype, "sceneInsMousemove", 1);
1038
+ u([
1039
+ O(200)
1040
+ ], g.prototype, "nativeScrollFunc", 1);
1041
+ u([
1042
+ O(200)
1043
+ ], g.prototype, "handleScroll", 1);
1044
+ g = u([
1058
1045
  Z({
1059
1046
  name: "Methods"
1060
1047
  })
1061
- ], u);
1048
+ ], g);
1062
1049
  export {
1063
- u as default
1050
+ g as default
1064
1051
  };
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty,z=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var B=(e,t,i)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,W=(e,t)=>{for(var i in t||(t={}))j.call(t,i)&&B(e,i,t[i]);if(O)for(var i of O(t))k.call(t,i)&&B(e,i,t[i]);return e},M=(e,t)=>z(e,T(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const N=require("vue"),X=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 w=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"),y=require("@costy-plus/utils"),m=require("zrender"),_=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function $(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 Y=_(N),q=$(m);var V=Object.defineProperty,U=Object.getOwnPropertyDescriptor,g=(e,t,i,s)=>{for(var a=s>1?void 0:s?U(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&V(t,i,a),a};exports.default=class extends Y.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=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.pacingGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.dataTotalTimes=Object.freeze(0),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),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.bottomPacH=Object.freeze(20),this.drawBottomPacH=Object.freeze(this.bottomPacH+40),this.pacingh=Object.freeze(12),this.pacingPFontSize=Object.freeze(14),this.splitBlockHeight=0,this.splitBlockHeight2=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({Data:{maxPoints:0,minPoints:0},ComplexData:{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=-1,this.activeLeadAnalyseValue=null,this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0),this.sceneIsMouseDownY=Object.freeze(0),this.sceneIsStartX=Object.freeze(0),this.sceneIsStartY=Object.freeze(0),this.sceneIsMoveUpDown=Object.freeze(!1),this.isShowEnlargeWave=!1,this.sceneFirstDistance=Object.freeze(0),this.sceneMagnification=1,this.rulerHistorySlidIdxs=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}}get waveFromData(){var e,t,i;return((e=this.formatEcgData)==null?void 0:e.analysisValueMode)===y.AnalysisMode.CompoundWave?((t=this.formatEcgData)==null?void 0:t.processedData.handleData.ComplexData)||[[]]:((i=this.formatEcgData)==null?void 0:i.processedData.handleData.Data)||[[]]}get isSingleMode(){return this.leadModel.column===1&&this.leadModel.line===1}get MXEnlargeWaveWH(){let e=this.width,t=this.height;return this.MXEnlargeWaveWidth&&(e=this.MXEnlargeWaveWidth),this.MXEnlargeWaveHeight&&(t=this.MXEnlargeWaveHeight),{width:e,height:t}}destroyed(){var e,t,i,s,a,o,r,l,n,h,d,c;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(),(r=this.leadHeadOffAndDelGroup)==null||r.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(n=this.arrowGroup)==null||n.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.pacingGroup)==null||d.removeAll(),(c=this.sceneIns)==null||c.dispose()}init(){var e;this.initWaveFormPeer(),this.combinationDrawing(),(e=this.formatEcgData)!=null&&e.processedData.otherParams.PosStart&&(this.scrollConfig.isShow?this.$nextTick(()=>{var t,i,s,a,o;this.scrollConfig.isNativeScroll?(s=this.$refs[this.prefixId+"nativeScroll"])==null||s.scrollBy({left:(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.PosStart)||0)*(((i=this.formatEcgData)==null?void 0:i.step)||0)*this.sceneMagnification,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({dx:(((a=this.formatEcgData)==null?void 0:a.processedData.otherParams.PosStart)||0)*(((o=this.formatEcgData)==null?void 0:o.step)||0)*this.sceneMagnification})}):(this.scrollWaveFrom(this.formatEcgData.processedData.otherParams.PosStart),this.scrollRuler(this.formatEcgData.processedData.otherParams.PosStart),this.scrollArrow(this.formatEcgData.processedData.otherParams.PosStart)))}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=q.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}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)}combinationDrawing(){this.initConfig(),this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawPacing(),this.drawRulerNotes(),this.drawWaveFrom()}initConfig(){var t,i,s,a,o,r,l,n,h,d,c;this.rowAndColwaveFromGroup=new m.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new m.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new m.Group({name:"addwaveFrom"}),this.leadHeadGroup=new m.Group({name:"leadHead"}),this.splitLineGroup=new m.Group({name:"splitLine"}),this.leadHeadNameGroup=new m.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new m.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new m.Group({name:"ruler"}),this.arrowGroup=new m.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new m.Group({name:"heardBeatLine"}),this.pacingGroup=new m.Group({name:"pacing"}),(this.leadModel.name==="12*1"||this.leadModel.name==="18*1"||this.leadModel.name==="15*1"||this.leadModel.name==="16*1")&&(this.sceneMagnification=.8),this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height;let e=this.canvasContainer.width;if(((i=(t=this.conventionalECGConfig)==null?void 0:t.ecgReviewSetting)==null?void 0:i.ecgareawidth)==="1"){const f=y.getPrintLengthToPx(((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.SampleRate)||0)+this.leadHeadConfig.leadHedeWidth;f<=e&&(e=f)}else this.leadModel.isContinuous&&!this.isSingleMode&&(((a=this.formatEcgData)==null?void 0:a.dataPxLen)||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(((o=this.formatEcgData)==null?void 0:o.dataPxLen)||0)+this.leadHeadConfig.leadHedeWidth);if(this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.addSlidingWindowInfo={points:0,startInd:0,endInd:0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=((r=this.formatEcgData)==null?void 0:r.processedData.otherParams.LeadName)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=(l=this.formatEcgData)==null?void 0:l.calcHighestAndLowestPoint(),this.isSingleMode)this.splitBlockHeight=(((n=this.formatEcgData)==null?void 0:n.analysisValueMode)===y.AnalysisMode.CompoundWave?Math.abs(this.highestAndLowestPoint.ComplexData.maxPoints)+Math.abs(this.highestAndLowestPoint.ComplexData.minPoints):Math.abs(this.highestAndLowestPoint.Data.maxPoints)+Math.abs(this.highestAndLowestPoint.Data.minPoints))+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6,this.splitBlockHeight2=this.drawArea.height/6);else{let f=this.drawArea.height;this.leadModel.isShowPacing&&(f=this.drawArea.height-this.drawBottomPacH),this.splitBlockHeight=f/this.totalRows,this.splitBlockHeight2=f/this.totalRows}this.dataTotalTimes=y.getDataLenTimes(this.waveFromData[0].length||0,((h=this.formatEcgData)==null?void 0:h.processedData.otherParams.SampleRate)||0),this.rulerStep=(((d=this.formatEcgData)==null?void 0:d.step)||1)*(((c=this.formatEcgData)==null?void 0:c.processedData.otherParams.SampleRate)||1)/(this.gridConfig.cellMg*2+2)}isLeadOff(e){var t;return!!(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.LeadOff)||[]).includes(e)}isLeadDel(e){var t;return!!(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.LeadDelete)||[]).includes(e)}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{var c,f,p,v;const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let r=0,l=0;t==="single"?(r=e.offsetX-this.singleWaveDataCopy[o].pos[0],l=this.singleWaveDataCopy[o].startInd):t==="rowAndCol"?(r=e.offsetX-this.waveDataCopy[o].pos[0],l=this.waveDataCopy[o].startInd||0):t==="add"&&(r=e.offsetX-this.addWaveDataCopy[o].pos[0],l=this.addWaveDataCopy[o].startInd||0);let n=y.getPointIdxForPx(r,(((c=this.formatEcgData)==null?void 0:c.step)||1)*this.sceneMagnification);n+=l;const h=((f=this.formatEcgData)==null?void 0:f.processedData.otherParams.AnalyseValue)||[];let d=null;if(this.enlargeWaveMode===y.AnalysisMode.SelectedHeartbeat){if(n<=h[1].KeyPosByBeat.Tend+.1*(((p=this.formatEcgData)==null?void 0:p.processedData.otherParams.SampleRate)||0))d=h[1];else for(let D=1;D<h.length;D++)if(n>h[D-1].KeyPosByBeat.Tend+1&&n<h[D].KeyPosByBeat.Tend+.1*(((v=this.formatEcgData)==null?void 0:v.processedData.otherParams.SampleRate)||0)){d=h[D];break}}else d=h[0];!d||(this.activeLeadAnalyseValue=M(W({},d),{BeatCount:h.length-1}),d=null,this.$emit("notifyActiveEnlargr"),this.isShowEnlargeWave=!0)};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}sceneInsMousemove(e){var t,i,s,a,o,r,l,n,h,d,c,f,p;if(e.event.preventDefault(),e.event.stopPropagation(),this.sceneIsMouseDown){if(!e.event.touches||e.event.touches.length===1){const v=e.offsetY-this.sceneIsStartY,D=e.offsetX-this.sceneIsStartY;Math.abs(v)>Math.abs(D)?(this.sceneIsMoveUpDown=!0,this.moveUpAndDown(e.offsetY-this.sceneIsMouseDownY),this.sceneIsMouseDownY=e.offsetY):(this.sceneIsMoveUpDown=!1,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)}),this.sceneIsMouseDownX=e.offsetX)}else if(this.supportTwoFingerZoom&&e.event.touches.length===2){const v=y.getDistance({x:e.event.touches[0].pageX,y:e.event.touches[0].pageY},{x:e.event.touches[1].pageX,y:e.event.touches[1].pageY});this.sceneFirstDistance===0&&(this.sceneFirstDistance=v),v<this.sceneFirstDistance?(this.sceneMagnification-=this.zoomStep,this.sceneMagnification<.1&&(this.sceneMagnification=.1)):this.sceneMagnification+=this.zoomStep,this.splitBlockHeight=this.splitBlockHeight2*this.sceneMagnification,(i=this.leadHeadNameGroup)==null||i.removeAll(),(s=this.leadHeadOffAndDelGroup)==null||s.removeAll(),(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.rulerGroup)==null||o.removeAll(),(r=this.arrowGroup)==null||r.removeAll(),(l=this.splitLineGroup)==null||l.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup),(h=this.rowAndColwaveFromGroup)==null||h.removeAll(),(d=this.singleWaveFromGroup)==null||d.removeAll(),(c=this.addwaveFromGroup)==null||c.removeAll(),(f=this.leadHeadGroup)==null||f.removeAll(),(p=this.pacingGroup)==null||p.removeAll(),this.drawWaveFrom(),this.sceneFirstDistance=v,this.zoomWave()}}}moveUpAndDown(e){var t,i,s,a,o,r,l,n,h,d;if(this.isSingleMode){const c=this.singleWaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)+this.singleWaveFromGroup.getBoundingRect().height,f=this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e)+this.arrowGroup.getBoundingRect().height,p=c<f?f:c,v=this.singleWaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e),D=this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e),I=v<D?v:D;if(p<this.canvasContainer.height-100||I>this.canvasContainer.height-100)return}else{const c=this.rowAndColwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)+this.rowAndColwaveFromGroup.getBoundingRect().height,f=this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e)+this.arrowGroup.getBoundingRect().height,p=this.addwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)+this.addwaveFromGroup.getBoundingRect().height;let v=c<f?f:c;v=p<v?v:p;const D=this.rowAndColwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e),I=this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e),P=this.addwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e);let C=D<I?D:I;if(C=P<C?P:C,v<this.canvasContainer.height-100||C>this.canvasContainer.height-100)return}this.isSingleMode?(t=this.singleWaveFromGroup)==null||t.attr({y:this.singleWaveFromGroup.y+e}):((i=this.rowAndColwaveFromGroup)==null||i.attr({y:this.rowAndColwaveFromGroup.y+e}),(s=this.leadHeadGroup)==null||s.attr({y:this.leadHeadGroup.y+e}),(a=this.addwaveFromGroup)==null||a.attr({y:this.addwaveFromGroup.y+e}),(o=this.splitLineGroup)==null||o.attr({y:this.splitLineGroup.y+e})),(r=this.leadHeadNameGroup)==null||r.attr({y:this.leadHeadNameGroup.y+e}),(l=this.leadHeadOffAndDelGroup)==null||l.attr({y:this.leadHeadOffAndDelGroup.y+e}),(n=this.arrowGroup)==null||n.attr({y:this.arrowGroup.y+e}),(h=this.heardBeatLineGroup)==null||h.attr({y:this.heardBeatLineGroup.y+e}),this.leadModel.isShowPacing&&((d=this.pacingGroup)==null||d.attr({y:this.pacingGroup.y+e}))}zoomWave(){var s,a,o;this.scrollConfig.isShow&&!this.isSingleMode&&(this.vuescrollWH.width=this.canvasContainer.width+(((s=this.formatEcgData)==null?void 0:s.dataPxLen)||0)*this.sceneMagnification-this.splitPoint);const e=(((a=this.formatEcgData)==null?void 0:a.step)||0)*this.sceneMagnification,t=Math.ceil(this.splitPoint/e);this.slidingWindowInfo.points=t;const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo.points=i,this.drawLeadHead(),this.drawColSplitLine(),this.isSingleMode?(this.slidingWindowInfo.endInd=t,this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(o=this.sceneIns)==null||o.add(this.singleWaveFromGroup)):this.scrollWaveFrom(this.rulerHistorySlidIdxs),this.scrollRuler(this.rulerHistorySlidIdxs),this.scrollArrow(this.rulerHistorySlidIdxs)}sceneInsMouseDown(e){e.event.preventDefault(),e.event.stopPropagation(),this.sceneIsMouseDown=!0,!e.event.touches||e.event.touches.length===1?(this.sceneIsMouseDownX=e.offsetX,this.sceneIsMouseDownY=e.offsetY,this.sceneIsStartX=e.offsetX,this.sceneIsStartY=e.offsetY):e.event.touches.length===2&&(this.sceneFirstDistance=y.getDistance({x:e.event.touches[0].pageX,y:e.event.touches[0].pageY},{x:e.event.touches[1].pageX,y:e.event.touches[1].pageY}))}sceneInsMouseUp(e){e.event.preventDefault(),e.event.stopPropagation(),this.sceneIsMouseDown=!1,this.sceneIsMoveUpDown=!1}drawPacing(){var i,s,a,o,r,l,n;if(!this.leadModel.isShowPacing||!((s=(i=this.formatEcgData)==null?void 0:i.processedData.otherParams.PacingData)!=null&&s.length))return;(a=this.pacingGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.pacingGroup);const e=this.leadHeadConfig.leadHedeWidth,t=this.canvasContainer.height-this.drawBottomPacH;(r=this.pacingGroup)==null||r.add(new m.Text({cursor:"",style:{x:e,y:t,text:"P",fontSize:this.pacingPFontSize,fill:this.leadConfig.lineColor,fontFamily:this.fontFamily}})),(l=this.pacingGroup)==null||l.add(new m.Polyline({cursor:"",name:"0_0",shape:{points:this.getPacinfPoints(e,t)},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth}})),(n=this.sceneIns)==null||n.add(this.pacingGroup)}getPacinfPoints(e,t){var i;return(((i=this.formatEcgData)==null?void 0:i.processedData.otherParams.PacingData)||[]).slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((s,a)=>{var o;return[e+a*(((o=this.formatEcgData)==null?void 0:o.step)||0)*this.sceneMagnification,(s===1?t-this.pacingh:t)+this.pacingPFontSize]})}createLeadHead(e,t,i){var o;const s=this.leadHeadConfig.leadHedeWidth/4;let a=(((o=this.formatEcgData)==null?void 0:o.sens)||0)*this.sceneMagnification;return a=i?a/2:a,new m.Polyline({cursor:"",shape:{points:[[0+e,0+t],[s+e,0+t],[s+e,-a+t],[3*s+e,-a+t],[3*s+e,0+t],[4*s+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}creatSplitLine(e,t,i){var s,a;return new m.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(i?(((s=this.formatEcgData)==null?void 0:s.sens)||0)*this.sceneMagnification/2:(((a=this.formatEcgData)==null?void 0:a.sens)||0)*this.sceneMagnification)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawLeadHead(){var i,s,a,o,r,l;(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.leadHeadGroup);let e=0,t=!1;for(let n=1;n<=this.totalRows;n++)e=0,t=!1,n<=this.leadModel.line?e=(((a=this.formatEcgData)==null?void 0:a.processedData.otherParams.LeadName)||[])[n-1]||0:n>this.leadModel.line&&n-this.leadModel.line<=this.leadModel.add&&(e=this.longLeadConfig.leadNames[n-this.leadModel.line-1]),((o=this.formatEcgData)==null?void 0:o.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.LeadNameTextsPorps[e])&&(t=!0),(r=this.leadHeadGroup)==null||r.add(this.createLeadHead(0,n*this.splitBlockHeight,t));(l=this.sceneIns)==null||l.add(this.leadHeadGroup)}drawColSplitLine(){var a,o,r,l,n,h,d,c,f,p,v,D,I;(a=this.splitLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/this.leadModel.column;if(this.splitPoint=e,this.isSingleMode){const P=y.getDataLenTimes(Math.ceil(this.splitPoint/((((r=this.formatEcgData)==null?void 0:r.step)||1)*this.sceneMagnification))||0,((l=this.formatEcgData)==null?void 0:l.processedData.otherParams.SampleRate)||0),C=parseInt(`${P/1e3%60}`,10);this.splitPoint=C*(((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.SampleRate)||0)*(((h=this.formatEcgData)==null?void 0:h.step)||0)*this.sceneMagnification}let t=0,i=0,s=0;for(let P=1;P<=this.leadModel.column-1;P++){t=P*e+this.leadHeadConfig.leadHedeWidth,i=P*this.leadModel.line;for(let C=1;C<=this.leadModel.line&&(s=(((d=this.formatEcgData)==null?void 0:d.processedData.otherParams.LeadName)||[])[C-1+i],s!==void 0);C++)((c=this.formatEcgData)==null?void 0:c.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.LeadNameTextsPorps[s])?(p=this.splitLineGroup)==null||p.add(this.creatSplitLine(t,C*this.splitBlockHeight-(((f=this.formatEcgData)==null?void 0:f.sens)||0)*this.sceneMagnification/2*.5,!0)):(D=this.splitLineGroup)==null||D.add(this.creatSplitLine(t,C*this.splitBlockHeight-(((v=this.formatEcgData)==null?void 0:v.sens)||0)*this.sceneMagnification*.5))}(I=this.sceneIns)==null||I.add(this.splitLineGroup)}initSlidingWindowInfo(){var s,a;const e=(((s=this.formatEcgData)==null?void 0:s.step)||0)*this.sceneMagnification,t=Math.ceil(this.splitPoint/e);this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.scrollConfig.isShow&&!this.isSingleMode&&(this.vuescrollWH.width=this.canvasContainer.width+(((a=this.formatEcgData)==null?void 0:a.dataPxLen)||0)*this.sceneMagnification-this.splitPoint);const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:i,startInd:0,endInd:i}}getRednerSinglePoints(){let e=0,t=0;const i=this.waveFromData[this.singleModeInfo.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=[],r=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let n=1;n<=r;n++)t=n*this.splitBlockHeight,n>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),n===1&&(this.loopArrowY.rowAndCol=t),o.push({pos:[e,t],startInd:s,endInd:a,data:i.slice(s,a).map((h,d)=>{var c;return[d*(((c=this.formatEcgData)==null?void 0:c.step)||0)*this.sceneMagnification,-h*this.sceneMagnification]})})}return o}getRednerPoints(){let e=0,t=0,i=0,s=[],a=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const r=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(a=o,o=a+(this.slidingWindowInfo.points||0));for(let n=1;n<=this.leadModel.line&&(t=n*this.splitBlockHeight,!(i>(this.waveFromData||[]).length-1));n++)s=this.waveFromData[i]||[],i++,n===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:a,endInd:o,data:s.slice(a,o).map((h,d)=>{var c;return[d*(((c=this.formatEcgData)==null?void 0:c.step)||0)*this.sceneMagnification,-h*this.sceneMagnification]})})}return r}getAddRednerPoints(){const e=[],t=this.leadHeadConfig.leadHedeWidth;let i=0,s=0,a=[];for(let o=0;o<this.leadModel.add;o++)s=this.longLeadConfig.leadIdxs[o],i=(o+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveFromData[s]||[],o===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((r,l)=>{var n;return[l*(((n=this.formatEcgData)==null?void 0:n.step)||0)*this.sceneMagnification,-r*this.sceneMagnification]})});return e}createSingleWaveFrom(){var r,l,n,h,d,c,f;(r=this.singleWaveFromGroup)==null||r.removeAll();const e=(((l=this.formatEcgData)==null?void 0:l.processedData.otherParams.LeadName)||[])[this.singleModeInfo.defaultSelect]||0;let t=this.getRednerSinglePoints(),i=y.getDataLenTimes(this.slidingWindowInfo.points||0,((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.SampleRate)||0);const s=i;let a=0,o=0;for(let p=0;p<t.length&&!(t[p].pos[1]>this.drawArea.height+this.bottomAreaHeight);p++)this.isLeadDel(e)||(a=Math.floor(i/1e3/60),o=Math.floor(i/1e3%60),a=o===60?a+=1:a,a=a===0?"00":a<10?`0${a}`:a,o=o===0||o===60?"00":o<10?`0${o}`:o,(h=this.singleWaveFromGroup)==null||h.add(new m.Polyline({cursor:"",name:this.singleModeInfo.defaultSelect+"_"+p,shape:{points:t[p].data.map(([v,D])=>[v+t[p].pos[0],D+t[p].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:v=>{this.onDbClickWaveFrom(v,"single")}})),(c=this.singleWaveFromGroup)==null||c.add(new m.Text({cursor:"",style:{x:t[p].pos[0],y:t[p].pos[1]-(((d=this.formatEcgData)==null?void 0:d.sens)||0)*this.sceneMagnification/2,text:p===0?"00:00 \u5FC3\u7387":`${a}:${o} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),p>0&&(i+=s));this.createLeadName(e,t[0].pos[0]-10,t[0].pos[1]+10),this.createLeadOffAndDel(e,t[0].pos[0]-5,t[0].pos[1]-(((f=this.formatEcgData)==null?void 0:f.sens)||0)*this.sceneMagnification/2-15),this.singleWaveDataCopy=t,t=null}createAddWaveFrom(){var t,i;console.time("createAddWaveFrom");let e=this.getAddRednerPoints();for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((t=this.addwaveFromGroup)==null||t.add(new m.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o])=>[a+e[s].pos[0],o+e[s].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(((i=this.formatEcgData)==null?void 0:i.sens)||0)*this.sceneMagnification/2-15));console.timeEnd("createAddWaveFrom"),this.addWaveDataCopy=e,e=null}createRowAndColWaveFrom(){var i,s,a,o,r,l;console.time("createRowAndColWaveFrom"),(i=this.rowAndColwaveFromGroup)==null||i.removeAll();let e=this.getRednerPoints(),t=0;for(let n=0;n<e.length;n++)t=(((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.LeadName)||[])[n]||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new m.Polyline({cursor:"",name:n+"_"+n,shape:{points:e[n].data.map(([h,d])=>[h+e[n].pos[0],d+e[n].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"rowAndCol")}})),n<this.leadModel.line?(this.createLeadName(t,e[n].pos[0],e[n].pos[1]-15),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(((o=this.formatEcgData)==null?void 0:o.sens)||0)*this.sceneMagnification/2-15)):(this.createLeadName(t,e[n].pos[0]+5,e[n].pos[1]-(((r=this.formatEcgData)==null?void 0:r.sens)||0)*this.sceneMagnification/2),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(((l=this.formatEcgData)==null?void 0:l.sens)||0)*this.sceneMagnification/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var a;(a=this.leadHeadNameGroup)==null||a.add(new m.Text({style:{x:t,y:i,text:this.LeadNameTextsPorps[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:M(W({},o),{name:this.LeadNameTextsPorps[e],idx:e}),isAdd:s})},onclick:o=>{this.$emit("notiifyLeadName",{event:M(W({},o),{name:this.LeadNameTextsPorps[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new m.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}drawRulerNotes(){var s,a,o,r,l,n;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new m.Text({cursor:"",style:W({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new m.Text({style:W({text:`${((s=this.formatEcgData)==null?void 0:s.gainName)==="\u80F8\u5BFC\u51CF\u534A"?(a=this.formatEcgData)==null?void 0:a.gainName:`${(o=this.formatEcgData)==null?void 0:o.gain}mm/mV`} ${(r=this.formatEcgData)==null?void 0:r.speed}mm/s`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(l=this.sceneIns)==null||l.add(i),(n=this.sceneIns)==null||n.add(t)}drawRuler(e=0){var o,r,l,n,h;if(!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&((o=this.formatEcgData)==null?void 0:o.step)){const d=y.getPointIdxForPx(this.splitPoint,this.formatEcgData.step*this.sceneMagnification),c=y.getDataLenTimes(d,((r=this.formatEcgData)==null?void 0:r.processedData.otherParams.SampleRate)||0)/1e3;a=e+c}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep*this.sceneMagnification),d%1===0?(s=this.canvasContainer.height-10,(l=this.rulerGroup)==null||l.add(new m.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(n=this.rulerGroup)==null||n.add(new m.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(h=this.sceneIns)==null||h.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(),this.drawLoopArrow()}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}drawLoopArrow(e=0){var l,n,h,d,c,f,p,v,D,I,P,C,H,S,L,x,b;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=((l=this.formatEcgData)==null?void 0:l.heartBeatPosition[this.heartFight.defaultSelect])||null,this.drawHeardBeatLine());let t=0,i=0;this.leadModel.add?i=this.loopArrowY.add-(((n=this.formatEcgData)==null?void 0:n.sens)||0)*this.sceneMagnification-this.splitBlockHeight/3.5:i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let r=0;for(let F=0;F<(((h=this.formatEcgData)==null?void 0:h.heartBeatPosition)||[]).length;F++){const u=(d=this.formatEcgData)==null?void 0:d.heartBeatPosition[F];if(r=((u==null?void 0:u.position)||0)-e,!(e>((u==null?void 0:u.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&r>(this.slidingWindowInfo.points||0))&&!(this.isSingleMode&&this.singleModeInfo&&r>(this.slidingWindowInfo.points||0))){if(((u==null?void 0:u.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=r*(((c=this.formatEcgData)==null?void 0:c.step)||0)*this.sceneMagnification+this.leadHeadConfig.leadHedeWidth-9.5,a=0,(v=this.arrowGroup)==null||v.add(new m.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((p=(f=this.currentHeardBeat)==null?void 0:f.heardBeat)==null?void 0:p.index)===(u==null?void 0:u.index)?"blue":"#ccc"},onclick:A=>{var E;!this.heartFight.mode||(A.target.attr({style:{fill:"blue"}}),(E=this.arrowGroup)==null||E.children().filter(G=>G.name==="arrow_box").forEach(G=>{G.id!==A.target.id&&G.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(u,A.target))}})),this.heartFight.heartrate&&(s=((D=this.AssistCtx)==null?void 0:D.measureText(`${(u==null?void 0:u.heartrate)||""}`).width)||0,(I=this.arrowGroup)==null||I.add(new m.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(u==null?void 0:u.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((P=this.AssistCtx)==null?void 0:P.measureText(`${(u==null?void 0:u.interval)||""}`).width)||0,(C=this.arrowGroup)==null||C.add(new m.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(u==null?void 0:u.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((H=this.AssistCtx)==null?void 0:H.measureText(`${(u==null?void 0:u.qrstCompany)||""}`).width)||0,(S=this.arrowGroup)==null||S.add(new m.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(u==null?void 0:u.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(u==null?void 0:u.telectricalaxis)||""}`).width)||0,(x=this.arrowGroup)==null||x.add(new m.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(u==null?void 0:u.telectricalaxis)||""}`},o)})))}}(b=this.sceneIns)==null||b.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",m.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var r,l,n,h,d,c;if(!this.currentHeardBeat.heardBeat)return;(r=this.heardBeatLineGroup)==null||r.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t=this.formatEcgData.processedData.otherParams.AnalyseValue[this.currentHeardBeat.heardBeat.index].KeyPosByBeat,i=0,s=this.getRednerPoints(),a=this.getAddRednerPoints(),o;for(const f in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(f)&&Object.prototype.hasOwnProperty.call(t,f)){i=(t[f]-this.slidingWindowInfo.startInd)*(((n=this.formatEcgData)==null?void 0:n.step)||0)*this.sceneMagnification;e:for(let p=0;p<s.length;p++)if(!(this.isLeadOff(p)||this.isLeadDel(p))){if(e>t[f]||!this.leadModel.isContinuous&&t[f]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=s[p],this.leadModel.isContinuous&&p>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}e:for(let p=0;p<a.length;p++)if(!(this.isLeadOff(this.longLeadConfig.leadIdxs[p])&&this.isLeadDel(this.longLeadConfig.leadIdxs[p]))){if(e>t[f])break e;o=a[p],(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}(c=this.sceneIns)==null||c.add(this.heardBeatLineGroup),t=null,s=null,a=null}createHeardBeatLine(e,t){return new m.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}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){var i;if(this.sceneIsMoveUpDown)return;const t=y.getPointIdxForPx(e,(((i=this.formatEcgData)==null?void 0:i.step)||1)*this.sceneMagnification);this.rulerHistorySlidIdxs=t,this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",t)}scrollWaveFrom(e){var s,a,o,r,l,n;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((h,d)=>{d=d||0,h.attr({shape:{points:t[d].data.map(([c,f])=>[c+t[d].pos[0],f+t[d].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((h,d)=>{d=d||0,h.attr({shape:{points:i[d].data.map(([c,f])=>[c+i[d].pos[0],f+i[d].pos[1]])}})}),this.leadModel.isShowPacing&&((r=(o=this.formatEcgData)==null?void 0:o.processedData.otherParams.PacingData)==null?void 0:r.length)&&((n=(l=this.pacingGroup)==null?void 0:l.childOfName("0_0"))==null||n.attr({shape:{points:this.getPacinfPoints(this.leadHeadConfig.leadHedeWidth,this.canvasContainer.height-this.drawBottomPacH)}})),t=null,i=null}scrollRuler(e){var i,s,a;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=y.getDataLenTimes(this.isSingleMode?0:e,((a=this.formatEcgData)==null?void 0:a.processedData.otherParams.SampleRate)||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)}};g([w.Prop({default:()=>.04})],exports.default.prototype,"zoomStep",2);g([w.Prop({default:()=>!0})],exports.default.prototype,"supportTwoFingerZoom",2);g([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);g([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);g([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);g([w.Prop({default:0,validator:e=>typeof e=="number"})],exports.default.prototype,"MXEnlargeWaveWidth",2);g([w.Prop({default:()=>y.LeadNameTexts})],exports.default.prototype,"LeadNameTextsPorps",2);g([w.Prop({default:0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"MXEnlargeWaveHeight",2);g([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);g([w.Prop({default:5,type:Number})],exports.default.prototype,"cellPoints",2);g([w.Prop({required:!0})],exports.default.prototype,"conventionalECGConfig",2);g([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);g([w.Prop({required:!0})],exports.default.prototype,"formatEcgData",2);g([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);g([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);g([w.Prop({default:5})],exports.default.prototype,"magnification",2);g([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);g([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1})})],exports.default.prototype,"heartFight",2);g([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);g([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"rulerConfig",2);g([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"measurRulerConfig",2);g([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"paralleRulerConfig",2);g([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"magnifierRulerConfig",2);g([w.Prop({default:60})],exports.default.prototype,"ventricularRate",2);g([w.Prop({default:y.AnalysisMode.CompoundWave})],exports.default.prototype,"enlargeWaveMode",2);g([w.Prop({default:()=>[]})],exports.default.prototype,"enlargeGains",2);g([w.Prop({default:()=>[]})],exports.default.prototype,"enlargeSpeeds",2);g([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeInfo",2);g([w.Prop({default:!0})],exports.default.prototype,"isMXEnlargeWaveShow",2);g([w.Prop({default:!1})],exports.default.prototype,"isSyncAnalyseValueCheck",2);g([y.throttling(200)],exports.default.prototype,"sceneInsMousemove",1);g([y.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);g([y.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([X.default({name:"Methods"})],exports.default);
1
+ "use strict";var R=Object.defineProperty,z=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var B=(e,t,i)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,P=(e,t)=>{for(var i in t||(t={}))k.call(t,i)&&B(e,i,t[i]);if(O)for(var i of O(t))N.call(t,i)&&B(e,i,t[i]);return e},G=(e,t)=>z(e,j(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("vue"),X=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 w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("@costy-plus/utils"),g=require("zrender"),_=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function $(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=_(T),V=$(g);var U=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,u=(e,t,i,s)=>{for(var a=s>1?void 0:s?Y(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&U(t,i,a),a};exports.default=class extends q.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=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.pacingGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.dataTotalTimes=Object.freeze(0),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),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.bottomPacH=Object.freeze(20),this.drawBottomPacH=Object.freeze(this.bottomPacH+40),this.pacingh=Object.freeze(12),this.pacingPFontSize=Object.freeze(14),this.splitBlockHeight=0,this.splitBlockHeight2=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({Data:{maxPoints:0,minPoints:0},ComplexData:{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=-1,this.activeLeadAnalyseValue=null,this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0),this.sceneIsMouseDownY=Object.freeze(0),this.sceneIsStartX=Object.freeze(0),this.sceneIsStartY=Object.freeze(0),this.sceneIsMoveUpDown=Object.freeze(!1),this.isShowEnlargeWave=!1,this.sceneFirstDistance=Object.freeze(0),this.sceneMagnification=1,this.rulerHistorySlidIdxs=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}}get waveFromData(){var e,t,i;return((e=this.formatEcgData)==null?void 0:e.analysisValueMode)===v.AnalysisMode.CompoundWave?((t=this.formatEcgData)==null?void 0:t.processedData.handleData.ComplexData)||[[]]:((i=this.formatEcgData)==null?void 0:i.processedData.handleData.Data)||[[]]}get isSingleMode(){return this.leadModel.column===1&&this.leadModel.line===1}get MXEnlargeWaveWH(){let e=this.width,t=this.height;return this.MXEnlargeWaveWidth&&(e=this.MXEnlargeWaveWidth),this.MXEnlargeWaveHeight&&(t=this.MXEnlargeWaveHeight),{width:e,height:t}}destroyed(){var e,t,i,s,a,o,r,l,n,h,d,p;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(),(r=this.leadHeadOffAndDelGroup)==null||r.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(n=this.arrowGroup)==null||n.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.pacingGroup)==null||d.removeAll(),(p=this.sceneIns)==null||p.dispose()}init(){var e;this.initWaveFormPeer(),this.combinationDrawing(),(e=this.formatEcgData)!=null&&e.processedData.otherParams.PosStart&&(this.scrollConfig.isShow?this.$nextTick(()=>{var t,i,s,a,o;this.scrollConfig.isNativeScroll?(s=this.$refs[this.prefixId+"nativeScroll"])==null||s.scrollBy({left:(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.PosStart)||0)*(((i=this.formatEcgData)==null?void 0:i.step)||0)*this.sceneMagnification,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({dx:(((a=this.formatEcgData)==null?void 0:a.processedData.otherParams.PosStart)||0)*(((o=this.formatEcgData)==null?void 0:o.step)||0)*this.sceneMagnification})}):(this.scrollWaveFrom(this.formatEcgData.processedData.otherParams.PosStart),this.scrollRuler(this.formatEcgData.processedData.otherParams.PosStart),this.scrollArrow(this.formatEcgData.processedData.otherParams.PosStart)))}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:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}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)}combinationDrawing(){this.initConfig(),this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawPacing(),this.drawRulerNotes(),this.drawWaveFrom()}initConfig(){var t,i,s,a,o,r,l,n,h,d,p;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"}),this.pacingGroup=new g.Group({name:"pacing"}),(this.leadModel.name==="12*1"||this.leadModel.name==="18*1"||this.leadModel.name==="15*1"||this.leadModel.name==="16*1")&&(this.sceneMagnification=.8),this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height;let e=this.canvasContainer.width;if(((i=(t=this.conventionalECGConfig)==null?void 0:t.ecgReviewSetting)==null?void 0:i.ecgareawidth)==="1"){const m=v.getPrintLengthToPx(((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.SampleRate)||0)+this.leadHeadConfig.leadHedeWidth;m<=e&&(e=m)}else this.leadModel.isContinuous&&!this.isSingleMode&&(((a=this.formatEcgData)==null?void 0:a.dataPxLen)||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(((o=this.formatEcgData)==null?void 0:o.dataPxLen)||0)+this.leadHeadConfig.leadHedeWidth);if(this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.addSlidingWindowInfo={points:0,startInd:0,endInd:0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=((r=this.formatEcgData)==null?void 0:r.processedData.otherParams.LeadName)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=(l=this.formatEcgData)==null?void 0:l.calcHighestAndLowestPoint(),this.isSingleMode)this.splitBlockHeight=(((n=this.formatEcgData)==null?void 0:n.analysisValueMode)===v.AnalysisMode.CompoundWave?Math.abs(this.highestAndLowestPoint.ComplexData.maxPoints)+Math.abs(this.highestAndLowestPoint.ComplexData.minPoints):Math.abs(this.highestAndLowestPoint.Data.maxPoints)+Math.abs(this.highestAndLowestPoint.Data.minPoints))+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6,this.splitBlockHeight2=this.drawArea.height/6);else{let m=this.drawArea.height;this.leadModel.isShowPacing&&(m=this.drawArea.height-this.drawBottomPacH),this.splitBlockHeight=m/this.totalRows,this.splitBlockHeight2=m/this.totalRows}this.dataTotalTimes=v.getDataLenTimes(this.waveFromData[0].length||0,((h=this.formatEcgData)==null?void 0:h.processedData.otherParams.SampleRate)||0),this.rulerStep=(((d=this.formatEcgData)==null?void 0:d.step)||1)*(((p=this.formatEcgData)==null?void 0:p.processedData.otherParams.SampleRate)||1)/(this.gridConfig.cellMg*2+2)}isLeadOff(e){var t;return!!(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.LeadOff)||[]).includes(e)}isLeadDel(e){var t;return!!(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.LeadDelete)||[]).includes(e)}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{var p,m,f,D;const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let r=0,l=0;t==="single"?(r=e.offsetX-this.singleWaveDataCopy[o].pos[0],l=this.singleWaveDataCopy[o].startInd):t==="rowAndCol"?(r=e.offsetX-this.waveDataCopy[o].pos[0],l=this.waveDataCopy[o].startInd||0):t==="add"&&(r=e.offsetX-this.addWaveDataCopy[o].pos[0],l=this.addWaveDataCopy[o].startInd||0);let n=v.getPointIdxForPx(r,(((p=this.formatEcgData)==null?void 0:p.step)||1)*this.sceneMagnification);n+=l;const h=((m=this.formatEcgData)==null?void 0:m.processedData.otherParams.AnalyseValue)||[];let d=null;if(this.enlargeWaveMode===v.AnalysisMode.SelectedHeartbeat){if(n<=h[1].KeyPosByBeat.Tend+.1*(((f=this.formatEcgData)==null?void 0:f.processedData.otherParams.SampleRate)||0))d=h[1];else for(let y=1;y<h.length;y++)if(n>h[y-1].KeyPosByBeat.Tend+1&&n<h[y].KeyPosByBeat.Tend+.1*(((D=this.formatEcgData)==null?void 0:D.processedData.otherParams.SampleRate)||0)){d=h[y];break}}else d=h[0];!d||(this.activeLeadAnalyseValue=G(P({},d),{BeatCount:h.length-1}),d=null,this.$emit("notifyActiveEnlargr"),this.isShowEnlargeWave=!0)};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}sceneInsMousemove(e){var t,i,s,a,o,r,l,n,h,d,p,m,f;if(e.event.preventDefault(),e.event.stopPropagation(),this.sceneIsMouseDown){if(!e.event.touches||e.event.touches.length===1){const D=e.offsetY-this.sceneIsStartY,y=e.offsetX-this.sceneIsStartX;Math.abs(D)>Math.abs(y)?(this.sceneIsMoveUpDown=!0,this.moveUpAndDown(e.offsetY-this.sceneIsMouseDownY),this.sceneIsMouseDownY=e.offsetY):(this.sceneIsMoveUpDown=!1,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)}),this.sceneIsMouseDownX=e.offsetX)}else if(this.supportTwoFingerZoom&&e.event.touches.length===2){const D=v.getDistance({x:e.event.touches[0].pageX,y:e.event.touches[0].pageY},{x:e.event.touches[1].pageX,y:e.event.touches[1].pageY});this.sceneFirstDistance===0&&(this.sceneFirstDistance=D),D<this.sceneFirstDistance?(this.sceneMagnification-=this.zoomStep,this.sceneMagnification<.1&&(this.sceneMagnification=.1)):this.sceneMagnification+=this.zoomStep,this.splitBlockHeight=this.splitBlockHeight2*this.sceneMagnification,(i=this.leadHeadNameGroup)==null||i.removeAll(),(s=this.leadHeadOffAndDelGroup)==null||s.removeAll(),(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.rulerGroup)==null||o.removeAll(),(r=this.arrowGroup)==null||r.removeAll(),(l=this.splitLineGroup)==null||l.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup),(h=this.rowAndColwaveFromGroup)==null||h.removeAll(),(d=this.singleWaveFromGroup)==null||d.removeAll(),(p=this.addwaveFromGroup)==null||p.removeAll(),(m=this.leadHeadGroup)==null||m.removeAll(),(f=this.pacingGroup)==null||f.removeAll(),this.drawWaveFrom(),this.sceneFirstDistance=D,this.zoomWave()}}}moveUpAndDown(e){var t,i,s,a,o,r,l,n,h,d;this.isSingleMode?(this.singleWaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)+this.singleWaveFromGroup.getBoundingRect().height,this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e)+this.arrowGroup.getBoundingRect().height,this.singleWaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e),this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e)):(this.rowAndColwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)+this.rowAndColwaveFromGroup.getBoundingRect().height,this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e)+this.arrowGroup.getBoundingRect().height,this.addwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)+this.addwaveFromGroup.getBoundingRect().height,this.rowAndColwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e),this.arrowGroup.getBoundingRect().y+(this.arrowGroup.y+e),this.addwaveFromGroup.getBoundingRect().y+(this.rowAndColwaveFromGroup.y+e)),this.isSingleMode?(t=this.singleWaveFromGroup)==null||t.attr({y:this.singleWaveFromGroup.y+e}):((i=this.rowAndColwaveFromGroup)==null||i.attr({y:this.rowAndColwaveFromGroup.y+e}),(s=this.leadHeadGroup)==null||s.attr({y:this.leadHeadGroup.y+e}),(a=this.addwaveFromGroup)==null||a.attr({y:this.addwaveFromGroup.y+e}),(o=this.splitLineGroup)==null||o.attr({y:this.splitLineGroup.y+e})),(r=this.leadHeadNameGroup)==null||r.attr({y:this.leadHeadNameGroup.y+e}),(l=this.leadHeadOffAndDelGroup)==null||l.attr({y:this.leadHeadOffAndDelGroup.y+e}),(n=this.arrowGroup)==null||n.attr({y:this.arrowGroup.y+e}),(h=this.heardBeatLineGroup)==null||h.attr({y:this.heardBeatLineGroup.y+e}),this.leadModel.isShowPacing&&((d=this.pacingGroup)==null||d.attr({y:this.pacingGroup.y+e}))}zoomWave(){var s,a,o;this.scrollConfig.isShow&&!this.isSingleMode&&(this.vuescrollWH.width=this.canvasContainer.width+(((s=this.formatEcgData)==null?void 0:s.dataPxLen)||0)*this.sceneMagnification-this.splitPoint);const e=(((a=this.formatEcgData)==null?void 0:a.step)||0)*this.sceneMagnification,t=Math.ceil(this.splitPoint/e);this.slidingWindowInfo.points=t;const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo.points=i,this.drawLeadHead(),this.drawColSplitLine(),this.isSingleMode?(this.slidingWindowInfo.endInd=t,this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(o=this.sceneIns)==null||o.add(this.singleWaveFromGroup)):this.scrollWaveFrom(this.rulerHistorySlidIdxs),this.scrollRuler(this.rulerHistorySlidIdxs),this.scrollArrow(this.rulerHistorySlidIdxs)}sceneInsMouseDown(e){e.event.preventDefault(),e.event.stopPropagation(),this.sceneIsMouseDown=!0,!e.event.touches||e.event.touches.length===1?(this.sceneIsMouseDownX=e.offsetX,this.sceneIsMouseDownY=e.offsetY,this.sceneIsStartX=e.offsetX,this.sceneIsStartY=e.offsetY):e.event.touches.length===2&&(this.sceneFirstDistance=v.getDistance({x:e.event.touches[0].pageX,y:e.event.touches[0].pageY},{x:e.event.touches[1].pageX,y:e.event.touches[1].pageY}))}sceneInsMouseUp(e){e.event.preventDefault(),e.event.stopPropagation(),this.sceneIsMouseDown=!1,this.sceneIsMoveUpDown=!1}drawPacing(){var i,s,a,o,r,l,n;if(!this.leadModel.isShowPacing||!((s=(i=this.formatEcgData)==null?void 0:i.processedData.otherParams.PacingData)!=null&&s.length))return;(a=this.pacingGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.pacingGroup);const e=this.leadHeadConfig.leadHedeWidth,t=this.canvasContainer.height-this.drawBottomPacH;(r=this.pacingGroup)==null||r.add(new g.Text({cursor:"",style:{x:e,y:t,text:"P",fontSize:this.pacingPFontSize,fill:this.leadConfig.lineColor,fontFamily:this.fontFamily}})),(l=this.pacingGroup)==null||l.add(new g.Polyline({cursor:"",name:"0_0",shape:{points:this.getPacinfPoints(e,t)},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth}})),(n=this.sceneIns)==null||n.add(this.pacingGroup)}getPacinfPoints(e,t){var i;return(((i=this.formatEcgData)==null?void 0:i.processedData.otherParams.PacingData)||[]).slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((s,a)=>{var o;return[e+a*(((o=this.formatEcgData)==null?void 0:o.step)||0)*this.sceneMagnification,(s===1?t-this.pacingh:t)+this.pacingPFontSize]})}createLeadHead(e,t,i){var o;const s=this.leadHeadConfig.leadHedeWidth/4;let a=(((o=this.formatEcgData)==null?void 0:o.sens)||0)*this.sceneMagnification;return a=i?a/2:a,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[s+e,0+t],[s+e,-a+t],[3*s+e,-a+t],[3*s+e,0+t],[4*s+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}creatSplitLine(e,t,i){var s,a;return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(i?(((s=this.formatEcgData)==null?void 0:s.sens)||0)*this.sceneMagnification/2:(((a=this.formatEcgData)==null?void 0:a.sens)||0)*this.sceneMagnification)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawLeadHead(){var i,s,a,o,r,l;(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.leadHeadGroup);let e=0,t=!1;for(let n=1;n<=this.totalRows;n++)e=0,t=!1,n<=this.leadModel.line?e=(((a=this.formatEcgData)==null?void 0:a.processedData.otherParams.LeadName)||[])[n-1]||0:n>this.leadModel.line&&n-this.leadModel.line<=this.leadModel.add&&(e=this.longLeadConfig.leadNames[n-this.leadModel.line-1]),((o=this.formatEcgData)==null?void 0:o.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.LeadNameTextsPorps[e])&&(t=!0),(r=this.leadHeadGroup)==null||r.add(this.createLeadHead(0,n*this.splitBlockHeight,t));(l=this.sceneIns)==null||l.add(this.leadHeadGroup)}drawColSplitLine(){var a,o,r,l,n,h,d,p,m,f,D,y,W;(a=this.splitLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/this.leadModel.column;if(this.splitPoint=e,this.isSingleMode){const I=v.getDataLenTimes(Math.ceil(this.splitPoint/((((r=this.formatEcgData)==null?void 0:r.step)||1)*this.sceneMagnification))||0,((l=this.formatEcgData)==null?void 0:l.processedData.otherParams.SampleRate)||0),C=parseInt(`${I/1e3%60}`,10);this.splitPoint=C*(((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.SampleRate)||0)*(((h=this.formatEcgData)==null?void 0:h.step)||0)*this.sceneMagnification}let t=0,i=0,s=0;for(let I=1;I<=this.leadModel.column-1;I++){t=I*e+this.leadHeadConfig.leadHedeWidth,i=I*this.leadModel.line;for(let C=1;C<=this.leadModel.line&&(s=(((d=this.formatEcgData)==null?void 0:d.processedData.otherParams.LeadName)||[])[C-1+i],s!==void 0);C++)((p=this.formatEcgData)==null?void 0:p.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.LeadNameTextsPorps[s])?(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,C*this.splitBlockHeight-(((m=this.formatEcgData)==null?void 0:m.sens)||0)*this.sceneMagnification/2*.5,!0)):(y=this.splitLineGroup)==null||y.add(this.creatSplitLine(t,C*this.splitBlockHeight-(((D=this.formatEcgData)==null?void 0:D.sens)||0)*this.sceneMagnification*.5))}(W=this.sceneIns)==null||W.add(this.splitLineGroup)}initSlidingWindowInfo(){var s,a;const e=(((s=this.formatEcgData)==null?void 0:s.step)||0)*this.sceneMagnification,t=Math.ceil(this.splitPoint/e);this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.scrollConfig.isShow&&!this.isSingleMode&&(this.vuescrollWH.width=this.canvasContainer.width+(((a=this.formatEcgData)==null?void 0:a.dataPxLen)||0)*this.sceneMagnification-this.splitPoint);const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:i,startInd:0,endInd:i}}getRednerSinglePoints(){let e=0,t=0;const i=this.waveFromData[this.singleModeInfo.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=[],r=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let n=1;n<=r;n++)t=n*this.splitBlockHeight,n>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),n===1&&(this.loopArrowY.rowAndCol=t),o.push({pos:[e,t],startInd:s,endInd:a,data:i.slice(s,a).map((h,d)=>{var p;return[d*(((p=this.formatEcgData)==null?void 0:p.step)||0)*this.sceneMagnification,-h*this.sceneMagnification]})})}return o}getRednerPoints(){let e=0,t=0,i=0,s=[],a=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const r=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(a=o,o=a+(this.slidingWindowInfo.points||0));for(let n=1;n<=this.leadModel.line&&(t=n*this.splitBlockHeight,!(i>(this.waveFromData||[]).length-1));n++)s=this.waveFromData[i]||[],i++,n===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:a,endInd:o,data:s.slice(a,o).map((h,d)=>{var p;return[d*(((p=this.formatEcgData)==null?void 0:p.step)||0)*this.sceneMagnification,-h*this.sceneMagnification]})})}return r}getAddRednerPoints(){const e=[],t=this.leadHeadConfig.leadHedeWidth;let i=0,s=0,a=[];for(let o=0;o<this.leadModel.add;o++)s=this.longLeadConfig.leadIdxs[o],i=(o+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveFromData[s]||[],o===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((r,l)=>{var n;return[l*(((n=this.formatEcgData)==null?void 0:n.step)||0)*this.sceneMagnification,-r*this.sceneMagnification]})});return e}createSingleWaveFrom(){var r,l,n,h,d,p,m;(r=this.singleWaveFromGroup)==null||r.removeAll();const e=(((l=this.formatEcgData)==null?void 0:l.processedData.otherParams.LeadName)||[])[this.singleModeInfo.defaultSelect]||0;let t=this.getRednerSinglePoints(),i=v.getDataLenTimes(this.slidingWindowInfo.points||0,((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.SampleRate)||0);const s=i;let a=0,o=0;for(let f=0;f<t.length&&!(t[f].pos[1]>this.drawArea.height+this.bottomAreaHeight);f++)this.isLeadDel(e)||(a=Math.floor(i/1e3/60),o=Math.floor(i/1e3%60),a=o===60?a+=1:a,a=a===0?"00":a<10?`0${a}`:a,o=o===0||o===60?"00":o<10?`0${o}`:o,(h=this.singleWaveFromGroup)==null||h.add(new g.Polyline({cursor:"",name:this.singleModeInfo.defaultSelect+"_"+f,shape:{points:t[f].data.map(([D,y])=>[D+t[f].pos[0],y+t[f].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:D=>{this.onDbClickWaveFrom(D,"single")}})),(p=this.singleWaveFromGroup)==null||p.add(new g.Text({cursor:"",style:{x:t[f].pos[0],y:t[f].pos[1]-(((d=this.formatEcgData)==null?void 0:d.sens)||0)*this.sceneMagnification/2,text:f===0?"00:00 \u5FC3\u7387":`${a}:${o} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),f>0&&(i+=s));this.createLeadName(e,t[0].pos[0]-10,t[0].pos[1]+10),this.createLeadOffAndDel(e,t[0].pos[0]-5,t[0].pos[1]-(((m=this.formatEcgData)==null?void 0:m.sens)||0)*this.sceneMagnification/2-15),this.singleWaveDataCopy=t,t=null}createAddWaveFrom(){var t,i;console.time("createAddWaveFrom");let e=this.getAddRednerPoints();for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((t=this.addwaveFromGroup)==null||t.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o])=>[a+e[s].pos[0],o+e[s].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(((i=this.formatEcgData)==null?void 0:i.sens)||0)*this.sceneMagnification/2-15));console.timeEnd("createAddWaveFrom"),this.addWaveDataCopy=e,e=null}createRowAndColWaveFrom(){var i,s,a,o,r,l;console.time("createRowAndColWaveFrom"),(i=this.rowAndColwaveFromGroup)==null||i.removeAll();let e=this.getRednerPoints(),t=0;for(let n=0;n<e.length;n++)t=(((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.LeadName)||[])[n]||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:n+"_"+n,shape:{points:e[n].data.map(([h,d])=>[h+e[n].pos[0],d+e[n].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"rowAndCol")}})),n<this.leadModel.line?(this.createLeadName(t,e[n].pos[0],e[n].pos[1]-15),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(((o=this.formatEcgData)==null?void 0:o.sens)||0)*this.sceneMagnification/2-15)):(this.createLeadName(t,e[n].pos[0]+5,e[n].pos[1]-(((r=this.formatEcgData)==null?void 0:r.sens)||0)*this.sceneMagnification/2),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(((l=this.formatEcgData)==null?void 0:l.sens)||0)*this.sceneMagnification/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var a;(a=this.leadHeadNameGroup)==null||a.add(new g.Text({style:{x:t,y:i,text:this.LeadNameTextsPorps[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:G(P({},o),{name:this.LeadNameTextsPorps[e],idx:e}),isAdd:s})},onclick:o=>{this.$emit("notiifyLeadName",{event:G(P({},o),{name:this.LeadNameTextsPorps[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}drawRulerNotes(){var s,a,o,r,l,n;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:P({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:P({text:`${((s=this.formatEcgData)==null?void 0:s.gainName)==="\u80F8\u5BFC\u51CF\u534A"?(a=this.formatEcgData)==null?void 0:a.gainName:`${(o=this.formatEcgData)==null?void 0:o.gain}mm/mV`} ${(r=this.formatEcgData)==null?void 0:r.speed}mm/s`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(l=this.sceneIns)==null||l.add(i),(n=this.sceneIns)==null||n.add(t)}drawRuler(e=0){var o,r,l,n,h;if(!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&((o=this.formatEcgData)==null?void 0:o.step)){const d=v.getPointIdxForPx(this.splitPoint,this.formatEcgData.step*this.sceneMagnification),p=v.getDataLenTimes(d,((r=this.formatEcgData)==null?void 0:r.processedData.otherParams.SampleRate)||0)/1e3;a=e+p}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep*this.sceneMagnification),d%1===0?(s=this.canvasContainer.height-10,(l=this.rulerGroup)==null||l.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(n=this.rulerGroup)==null||n.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(h=this.sceneIns)==null||h.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(),this.drawLoopArrow()}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}drawLoopArrow(e=0){var l,n,h,d,p,m,f,D,y,W,I,C,H,S,L,x,b;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=((l=this.formatEcgData)==null?void 0:l.heartBeatPosition[this.heartFight.defaultSelect])||null,this.drawHeardBeatLine());let t=0,i=0;this.leadModel.add?i=this.loopArrowY.add-(((n=this.formatEcgData)==null?void 0:n.sens)||0)*this.sceneMagnification-this.splitBlockHeight/3.5:i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let r=0;for(let F=0;F<(((h=this.formatEcgData)==null?void 0:h.heartBeatPosition)||[]).length;F++){const c=(d=this.formatEcgData)==null?void 0:d.heartBeatPosition[F];if(r=((c==null?void 0:c.position)||0)-e,!(e>((c==null?void 0:c.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&r>(this.slidingWindowInfo.points||0))&&!(this.isSingleMode&&this.singleModeInfo&&r>(this.slidingWindowInfo.points||0))){if(((c==null?void 0:c.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=r*(((p=this.formatEcgData)==null?void 0:p.step)||0)*this.sceneMagnification+this.leadHeadConfig.leadHedeWidth-9.5,a=0,(D=this.arrowGroup)==null||D.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((f=(m=this.currentHeardBeat)==null?void 0:m.heardBeat)==null?void 0:f.index)===(c==null?void 0:c.index)?"blue":"#ccc"},onclick:A=>{var E;!this.heartFight.mode||(A.target.attr({style:{fill:"blue"}}),(E=this.arrowGroup)==null||E.children().filter(M=>M.name==="arrow_box").forEach(M=>{M.id!==A.target.id&&M.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(c,A.target))}})),this.heartFight.heartrate&&(s=((y=this.AssistCtx)==null?void 0:y.measureText(`${(c==null?void 0:c.heartrate)||""}`).width)||0,(W=this.arrowGroup)==null||W.add(new g.Text({cursor:"",style:P({x:4+t-s*1.5,y:a+i,text:`${(c==null?void 0:c.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((I=this.AssistCtx)==null?void 0:I.measureText(`${(c==null?void 0:c.interval)||""}`).width)||0,(C=this.arrowGroup)==null||C.add(new g.Text({cursor:"",style:P({x:4+t-s*1.5,y:a+i,text:`${(c==null?void 0:c.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((H=this.AssistCtx)==null?void 0:H.measureText(`${(c==null?void 0:c.qrstCompany)||""}`).width)||0,(S=this.arrowGroup)==null||S.add(new g.Text({cursor:"",style:P({x:4+t-s*1.5,y:a+i,text:`${(c==null?void 0:c.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(c==null?void 0:c.telectricalaxis)||""}`).width)||0,(x=this.arrowGroup)==null||x.add(new g.Text({cursor:"",style:P({x:4+t-s*1.5,y:a+i,text:`${(c==null?void 0:c.telectricalaxis)||""}`},o)})))}}(b=this.sceneIns)==null||b.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",g.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var r,l,n,h,d,p;if(!this.currentHeardBeat.heardBeat)return;(r=this.heardBeatLineGroup)==null||r.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t=this.formatEcgData.processedData.otherParams.AnalyseValue[this.currentHeardBeat.heardBeat.index].KeyPosByBeat,i=0,s=this.getRednerPoints(),a=this.getAddRednerPoints(),o;for(const m in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(m)&&Object.prototype.hasOwnProperty.call(t,m)){i=(t[m]-this.slidingWindowInfo.startInd)*(((n=this.formatEcgData)==null?void 0:n.step)||0)*this.sceneMagnification;e:for(let f=0;f<s.length;f++)if(!(this.isLeadOff(f)||this.isLeadDel(f))){if(e>t[m]||!this.leadModel.isContinuous&&t[m]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=s[f],this.leadModel.isContinuous&&f>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}e:for(let f=0;f<a.length;f++)if(!(this.isLeadOff(this.longLeadConfig.leadIdxs[f])&&this.isLeadDel(this.longLeadConfig.leadIdxs[f]))){if(e>t[m])break e;o=a[f],(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}(p=this.sceneIns)==null||p.add(this.heardBeatLineGroup),t=null,s=null,a=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}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){var i;if(this.sceneIsMoveUpDown)return;const t=v.getPointIdxForPx(e,(((i=this.formatEcgData)==null?void 0:i.step)||1)*this.sceneMagnification);this.rulerHistorySlidIdxs=t,this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",t)}scrollWaveFrom(e){var s,a,o,r,l,n;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((h,d)=>{d=d||0,h.attr({shape:{points:t[d].data.map(([p,m])=>[p+t[d].pos[0],m+t[d].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((h,d)=>{d=d||0,h.attr({shape:{points:i[d].data.map(([p,m])=>[p+i[d].pos[0],m+i[d].pos[1]])}})}),this.leadModel.isShowPacing&&((r=(o=this.formatEcgData)==null?void 0:o.processedData.otherParams.PacingData)==null?void 0:r.length)&&((n=(l=this.pacingGroup)==null?void 0:l.childOfName("0_0"))==null||n.attr({shape:{points:this.getPacinfPoints(this.leadHeadConfig.leadHedeWidth,this.canvasContainer.height-this.drawBottomPacH)}})),t=null,i=null}scrollRuler(e){var i,s,a;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=v.getDataLenTimes(this.isSingleMode?0:e,((a=this.formatEcgData)==null?void 0:a.processedData.otherParams.SampleRate)||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)}};u([w.Prop({default:()=>.04})],exports.default.prototype,"zoomStep",2);u([w.Prop({default:()=>!0})],exports.default.prototype,"supportTwoFingerZoom",2);u([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);u([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);u([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);u([w.Prop({default:0,validator:e=>typeof e=="number"})],exports.default.prototype,"MXEnlargeWaveWidth",2);u([w.Prop({default:()=>v.LeadNameTexts})],exports.default.prototype,"LeadNameTextsPorps",2);u([w.Prop({default:0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"MXEnlargeWaveHeight",2);u([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);u([w.Prop({default:5,type:Number})],exports.default.prototype,"cellPoints",2);u([w.Prop({required:!0})],exports.default.prototype,"conventionalECGConfig",2);u([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);u([w.Prop({required:!0})],exports.default.prototype,"formatEcgData",2);u([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);u([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);u([w.Prop({default:5})],exports.default.prototype,"magnification",2);u([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);u([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1})})],exports.default.prototype,"heartFight",2);u([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);u([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"rulerConfig",2);u([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"measurRulerConfig",2);u([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"paralleRulerConfig",2);u([w.Prop({default:()=>({isShow:!1})})],exports.default.prototype,"magnifierRulerConfig",2);u([w.Prop({default:60})],exports.default.prototype,"ventricularRate",2);u([w.Prop({default:v.AnalysisMode.CompoundWave})],exports.default.prototype,"enlargeWaveMode",2);u([w.Prop({default:()=>[]})],exports.default.prototype,"enlargeGains",2);u([w.Prop({default:()=>[]})],exports.default.prototype,"enlargeSpeeds",2);u([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeInfo",2);u([w.Prop({default:!0})],exports.default.prototype,"isMXEnlargeWaveShow",2);u([w.Prop({default:!1})],exports.default.prototype,"isSyncAnalyseValueCheck",2);u([v.throttling(200)],exports.default.prototype,"sceneInsMousemove",1);u([v.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);u([v.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=u([X.default({name:"Methods"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.1.4-0",
3
+ "version": "1.1.5-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",