costy-plus 1.0.16-0 → 1.0.18-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.
@@ -9,16 +9,16 @@ var T = (e, t, i) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writab
9
9
  for (var i of $(t))
10
10
  Y.call(t, i) && T(e, i, t[i]);
11
11
  return e;
12
- }, A = (e, t) => V(e, _(t));
12
+ }, H = (e, t) => V(e, _(t));
13
13
  import K from "vue";
14
14
  import U from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
15
15
  import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Emit.js";
16
16
  import { Prop as w } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js";
17
- import { AnalysisMode as P, throttling as Q, getPrintLengthToPx as J, getDataLenTimes as H, LeadNameTexts as y, getPointIdxForPx as G } from "@costy-plus/utils";
17
+ import { AnalysisMode as P, throttling as Q, getPrintLengthToPx as J, getDataLenTimes as L, LeadNameTexts as y, getPointIdxForPx as G } from "@costy-plus/utils";
18
18
  import { init as Z, Group as C, Polyline as F, Line as b, Text as I, Polygon as ee, util as te } from "zrender";
19
19
  var ie = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, g = (e, t, i, a) => {
20
- for (var s = a > 1 ? void 0 : a ? ae(t, i) : t, o = e.length - 1, r; o >= 0; o--)
21
- (r = e[o]) && (s = (a ? r(t, i, s) : r(s)) || s);
20
+ for (var s = a > 1 ? void 0 : a ? ae(t, i) : t, o = e.length - 1, n; o >= 0; o--)
21
+ (n = e[o]) && (s = (a ? n(t, i, s) : n(s)) || s);
22
22
  return a && s && ie(t, i, s), s;
23
23
  };
24
24
  let m = class extends K {
@@ -61,8 +61,8 @@ let m = class extends K {
61
61
  return this.leadModel.column === 1 && this.leadModel.line === 1;
62
62
  }
63
63
  destroyed() {
64
- var e, t, i, a, s, o, r, l, n, h, d;
65
- this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (a = this.leadHeadGroup) == null || a.removeAll(), (s = this.splitLineGroup) == null || s.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.sceneIns) == null || d.dispose();
64
+ var e, t, i, a, s, o, n, l, r, h, d;
65
+ this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (a = this.leadHeadGroup) == null || a.removeAll(), (s = this.splitLineGroup) == null || s.removeAll(), (o = this.leadHeadNameGroup) == null || o.removeAll(), (n = this.leadHeadOffAndDelGroup) == null || n.removeAll(), (l = this.rulerGroup) == null || l.removeAll(), (r = this.arrowGroup) == null || r.removeAll(), (h = this.heardBeatLineGroup) == null || h.removeAll(), (d = this.sceneIns) == null || d.dispose();
66
66
  }
67
67
  init() {
68
68
  var e;
@@ -93,7 +93,7 @@ let m = class extends K {
93
93
  this.initConfig(), this.drawLeadHead(), this.drawColSplitLine(), this.initSlidingWindowInfo(), this.drawRulerNotes(), this.drawWaveFrom();
94
94
  }
95
95
  initConfig() {
96
- var t, i, a, s, o, r, l, n, h, d, u;
96
+ var t, i, a, s, o, n, l, r, h, d, u;
97
97
  this.rowAndColwaveFromGroup = new C({
98
98
  name: "rowAndColwaveFrom"
99
99
  }), this.singleWaveFromGroup = new C({
@@ -138,7 +138,7 @@ let m = class extends K {
138
138
  }, this.currentHeardBeat = {
139
139
  heardBeat: null,
140
140
  ele: null
141
- }, 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) === P.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.totalRows, this.dataTotalTimes = H(
141
+ }, this.leadNameList = ((n = this.formatEcgData) == null ? void 0 : n.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 = (((r = this.formatEcgData) == null ? void 0 : r.analysisValueMode) === P.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.splitBlockHeight = this.drawArea.height / this.totalRows, this.dataTotalTimes = L(
142
142
  this.waveFromData[0].length || 0,
143
143
  ((h = this.formatEcgData) == null ? void 0 : h.processedData.otherParams.SampleRate) || 0
144
144
  ), this.rulerStep = (((d = this.formatEcgData) == null ? void 0 : d.step) || 1) * (((u = this.formatEcgData) == null ? void 0 : u.processedData.otherParams.SampleRate) || 1) / (this.gridConfig.cellMg * 2 + 2);
@@ -158,24 +158,24 @@ let m = class extends K {
158
158
  const s = e.target.name.split("_");
159
159
  this.activeLeadIdx = +s[0];
160
160
  const o = +s[1];
161
- let r = 0, l = 0;
162
- 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);
163
- let n = G(r, ((u = this.formatEcgData) == null ? void 0 : u.step) || 1);
164
- n += l;
161
+ let n = 0, l = 0;
162
+ t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[o].pos[0], l = this.singleWaveDataCopy[o].startInd) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[o].pos[0], l = this.waveDataCopy[o].startInd || 0) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[o].pos[0], l = this.addWaveDataCopy[o].startInd || 0);
163
+ let r = G(n, ((u = this.formatEcgData) == null ? void 0 : u.step) || 1);
164
+ r += l;
165
165
  const h = ((c = this.formatEcgData) == null ? void 0 : c.processedData.otherParams.AnalyseValue) || [];
166
166
  let d = null;
167
167
  if (this.enlargeWaveMode === P.SelectedHeartbeat) {
168
- if (n <= h[1].KeyPosByBeat.Tend + 0.1 * (((p = this.formatEcgData) == null ? void 0 : p.processedData.otherParams.SampleRate) || 0))
168
+ if (r <= h[1].KeyPosByBeat.Tend + 0.1 * (((p = this.formatEcgData) == null ? void 0 : p.processedData.otherParams.SampleRate) || 0))
169
169
  d = h[1];
170
170
  else
171
171
  for (let W = 1; W < h.length; W++)
172
- if (n > h[W - 1].KeyPosByBeat.Tend + 1 && n < h[W].KeyPosByBeat.Tend + 0.1 * (((D = this.formatEcgData) == null ? void 0 : D.processedData.otherParams.SampleRate) || 0)) {
172
+ if (r > h[W - 1].KeyPosByBeat.Tend + 1 && r < h[W].KeyPosByBeat.Tend + 0.1 * (((D = this.formatEcgData) == null ? void 0 : D.processedData.otherParams.SampleRate) || 0)) {
173
173
  d = h[W];
174
174
  break;
175
175
  }
176
176
  } else
177
177
  d = h[0];
178
- console.log("currentAnalyseValue", d, d == null ? void 0 : d.BeatID), d && (this.activeLeadAnalyseValue = A(v({}, d), {
178
+ console.log("currentAnalyseValue", d, d == null ? void 0 : d.BeatID), d && (this.activeLeadAnalyseValue = H(v({}, d), {
179
179
  BeatCount: h.length - 1
180
180
  }), d = null, this.isShowEnlargeWave = !0);
181
181
  };
@@ -249,23 +249,23 @@ let m = class extends K {
249
249
  });
250
250
  }
251
251
  drawLeadHead() {
252
- var i, a, s, o, r, l;
252
+ var i, a, s, o, n, l;
253
253
  (i = this.leadHeadGroup) == null || i.removeAll(), (a = this.sceneIns) == null || a.remove(this.leadHeadGroup);
254
254
  let e = 0, t = !1;
255
- for (let n = 1; n <= this.totalRows; n++)
256
- e = 0, t = !1, n <= this.leadModel.line ? e = (((s = this.formatEcgData) == null ? void 0 : s.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(y[e]) && (t = !0), (r = this.leadHeadGroup) == null || r.add(this.createLeadHead(0, n * this.splitBlockHeight, t));
255
+ for (let r = 1; r <= this.totalRows; r++)
256
+ e = 0, t = !1, r <= this.leadModel.line ? e = (((s = this.formatEcgData) == null ? void 0 : s.processedData.otherParams.LeadName) || [])[r - 1] || 0 : r > this.leadModel.line && r - this.leadModel.line <= this.leadModel.add && (e = this.longLeadConfig.leadNames[r - this.leadModel.line - 1]), ((o = this.formatEcgData) == null ? void 0 : o.gainName) === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(y[e]) && (t = !0), (n = this.leadHeadGroup) == null || n.add(this.createLeadHead(0, r * this.splitBlockHeight, t));
257
257
  (l = this.sceneIns) == null || l.add(this.leadHeadGroup);
258
258
  }
259
259
  drawColSplitLine() {
260
- var s, o, r, l, n, h, d, u, c;
260
+ var s, o, n, l, r, h, d, u, c;
261
261
  (s = this.splitLineGroup) == null || s.removeAll(), (o = this.sceneIns) == null || o.remove(this.splitLineGroup);
262
262
  const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / this.leadModel.column;
263
263
  this.splitPoint = e, this.isSingleMode && (this.splitPoint -= 80);
264
264
  let t = 0, i = 0, a = 0;
265
265
  for (let p = 1; p <= this.leadModel.column - 1; p++) {
266
266
  t = p * e + this.leadHeadConfig.leadHedeWidth, i = p * this.leadModel.line;
267
- for (let D = 1; D <= this.leadModel.line && (a = (((r = this.formatEcgData) == null ? void 0 : r.processedData.otherParams.LeadName) || [])[D - 1 + i], a !== void 0); D++)
268
- ((l = this.formatEcgData) == null ? void 0 : l.gainName) === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(y[a]) ? (h = this.splitLineGroup) == null || h.add(this.creatSplitLine(t, D * this.splitBlockHeight - (((n = this.formatEcgData) == null ? void 0 : n.sens) || 0) / 2 * 0.5, !0)) : (u = this.splitLineGroup) == null || u.add(this.creatSplitLine(t, D * this.splitBlockHeight - (((d = this.formatEcgData) == null ? void 0 : d.sens) || 0) * 0.5));
267
+ for (let D = 1; D <= this.leadModel.line && (a = (((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.LeadName) || [])[D - 1 + i], a !== void 0); D++)
268
+ ((l = this.formatEcgData) == null ? void 0 : l.gainName) === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(y[a]) ? (h = this.splitLineGroup) == null || h.add(this.creatSplitLine(t, D * this.splitBlockHeight - (((r = this.formatEcgData) == null ? void 0 : r.sens) || 0) / 2 * 0.5, !0)) : (u = this.splitLineGroup) == null || u.add(this.creatSplitLine(t, D * this.splitBlockHeight - (((d = this.formatEcgData) == null ? void 0 : d.sens) || 0) * 0.5));
269
269
  }
270
270
  (c = this.sceneIns) == null || c.add(this.splitLineGroup);
271
271
  }
@@ -288,11 +288,11 @@ let m = class extends K {
288
288
  let e = 0, t = 0;
289
289
  const i = this.waveFromData[this.singleModeInfo.defaultSelect] || [];
290
290
  let a = this.slidingWindowInfo.startInd || 0, s = this.slidingWindowInfo.endInd || 0;
291
- const o = [], r = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
291
+ const o = [], n = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
292
292
  for (let l = 0; l < 1; l++) {
293
293
  e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
294
- for (let n = 1; n <= r; n++)
295
- t = n * this.splitBlockHeight, n > 1 && (t *= 0.8, a = s, s = a + (this.slidingWindowInfo.points || 0)), n === 1 && (this.loopArrowY.rowAndCol = t), o.push({
294
+ for (let r = 1; r <= n; r++)
295
+ t = r * this.splitBlockHeight, r > 1 && (t *= 0.8, a = s, s = a + (this.slidingWindowInfo.points || 0)), r === 1 && (this.loopArrowY.rowAndCol = t), o.push({
296
296
  pos: [e, t],
297
297
  startInd: a,
298
298
  endInd: s,
@@ -306,11 +306,11 @@ let m = class extends K {
306
306
  }
307
307
  getRednerPoints() {
308
308
  let e = 0, t = 0, i = 0, a = [], s = this.slidingWindowInfo.startInd || 0, o = this.slidingWindowInfo.endInd || 0;
309
- const r = [];
309
+ const n = [];
310
310
  for (let l = 0; l < this.leadModel.column; l++) {
311
311
  e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && l > 0 && (s = o, o = s + (this.slidingWindowInfo.points || 0));
312
- for (let n = 1; n <= this.leadModel.line && (t = n * this.splitBlockHeight, !(i > (this.waveFromData || []).length - 1)); n++)
313
- a = this.waveFromData[i] || [], i++, n === 1 && (this.loopArrowY.rowAndCol = t), r.push({
312
+ for (let r = 1; r <= this.leadModel.line && (t = r * this.splitBlockHeight, !(i > (this.waveFromData || []).length - 1)); r++)
313
+ a = this.waveFromData[i] || [], i++, r === 1 && (this.loopArrowY.rowAndCol = t), n.push({
314
314
  pos: [e, t],
315
315
  startInd: s,
316
316
  endInd: o,
@@ -320,7 +320,7 @@ let m = class extends K {
320
320
  })
321
321
  });
322
322
  }
323
- return r;
323
+ return n;
324
324
  }
325
325
  getAddRednerPoints() {
326
326
  const e = [], t = this.leadHeadConfig.leadHedeWidth;
@@ -330,20 +330,20 @@ let m = class extends K {
330
330
  pos: [t, i],
331
331
  startInd: this.addSlidingWindowInfo.startInd || 0,
332
332
  endInd: this.addSlidingWindowInfo.endInd || 0,
333
- data: s.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((r, l) => {
334
- var n;
335
- return [l * (((n = this.formatEcgData) == null ? void 0 : n.step) || 0), -r];
333
+ data: s.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((n, l) => {
334
+ var r;
335
+ return [l * (((r = this.formatEcgData) == null ? void 0 : r.step) || 0), -n];
336
336
  })
337
337
  });
338
338
  return e;
339
339
  }
340
340
  createSingleWaveFrom() {
341
- var o, r, l, n, h, d, u;
341
+ var o, n, l, r, h, d, u;
342
342
  (o = this.singleWaveFromGroup) == null || o.removeAll();
343
- const e = (((r = this.formatEcgData) == null ? void 0 : r.processedData.otherParams.LeadName) || [])[this.singleModeInfo.defaultSelect] || 0;
344
- let t = this.getRednerSinglePoints(), i = H(this.slidingWindowInfo.points || 0, ((l = this.formatEcgData) == null ? void 0 : l.processedData.otherParams.SampleRate) || 0), a = 0, s = 0;
343
+ const e = (((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.LeadName) || [])[this.singleModeInfo.defaultSelect] || 0;
344
+ let t = this.getRednerSinglePoints(), i = L(this.slidingWindowInfo.points || 0, ((l = this.formatEcgData) == null ? void 0 : l.processedData.otherParams.SampleRate) || 0), a = 0, s = 0;
345
345
  for (let c = 0; c < t.length && !(t[c].pos[1] > this.drawArea.height + this.bottomAreaHeight); c++)
346
- this.isLeadDel(e) || (a = parseInt(`${i / 1e3 / 60}`, 10), s = parseInt(`${i / 1e3 % 60}`, 10), a = s === 60 ? a += 1 : a, a = a === 0 ? "00" : a < 10 ? `0${a}` : a, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (n = this.singleWaveFromGroup) == null || n.add(new F({
346
+ this.isLeadDel(e) || (a = parseInt(`${i / 1e3 / 60}`, 10), s = parseInt(`${i / 1e3 % 60}`, 10), a = s === 60 ? a += 1 : a, a = a === 0 ? "00" : a < 10 ? `0${a}` : a, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (r = this.singleWaveFromGroup) == null || r.add(new F({
347
347
  cursor: "",
348
348
  name: this.singleModeInfo.defaultSelect + "_" + c,
349
349
  shape: {
@@ -398,17 +398,17 @@ let m = class extends K {
398
398
  console.timeEnd("createAddWaveFrom"), this.addWaveDataCopy = e, e = null;
399
399
  }
400
400
  createRowAndColWaveFrom() {
401
- var i, a, s, o, r, l;
401
+ var i, a, s, o, n, l;
402
402
  console.time("createRowAndColWaveFrom"), (i = this.rowAndColwaveFromGroup) == null || i.removeAll();
403
403
  let e = this.getRednerPoints(), t = 0;
404
- for (let n = 0; n < e.length; n++)
405
- t = (((a = this.formatEcgData) == null ? void 0 : a.processedData.otherParams.LeadName) || [])[n] || 0, this.isLeadDel(t) || (s = this.rowAndColwaveFromGroup) == null || s.add(new F({
404
+ for (let r = 0; r < e.length; r++)
405
+ t = (((a = this.formatEcgData) == null ? void 0 : a.processedData.otherParams.LeadName) || [])[r] || 0, this.isLeadDel(t) || (s = this.rowAndColwaveFromGroup) == null || s.add(new F({
406
406
  cursor: "",
407
- name: n + "_" + n,
407
+ name: r + "_" + r,
408
408
  shape: {
409
- points: e[n].data.map(([h, d]) => [
410
- h + e[n].pos[0],
411
- d + e[n].pos[1]
409
+ points: e[r].data.map(([h, d]) => [
410
+ h + e[r].pos[0],
411
+ d + e[r].pos[1]
412
412
  ])
413
413
  },
414
414
  style: {
@@ -418,7 +418,7 @@ let m = class extends K {
418
418
  onclick: (h) => {
419
419
  this.onDbClickWaveFrom(h, "rowAndCol");
420
420
  }
421
- })), 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) / 2 - 15)) : (this.createLeadName(t, e[n].pos[0] + 5, e[n].pos[1] - (((r = this.formatEcgData) == null ? void 0 : r.sens) || 0) / 2), this.createLeadOffAndDel(t, e[n].pos[0] - 5, e[n].pos[1] - (((l = this.formatEcgData) == null ? void 0 : l.sens) || 0) / 2 + 9));
421
+ })), r < this.leadModel.line ? (this.createLeadName(t, e[r].pos[0], e[r].pos[1] - 15), this.createLeadOffAndDel(t, e[r].pos[0] - 5, e[r].pos[1] - (((o = this.formatEcgData) == null ? void 0 : o.sens) || 0) / 2 - 15)) : (this.createLeadName(t, e[r].pos[0] + 5, e[r].pos[1] - (((n = this.formatEcgData) == null ? void 0 : n.sens) || 0) / 2), this.createLeadOffAndDel(t, e[r].pos[0] - 5, e[r].pos[1] - (((l = this.formatEcgData) == null ? void 0 : l.sens) || 0) / 2 + 9));
422
422
  this.waveDataCopy = e, e = null;
423
423
  }
424
424
  createLeadName(e, t, i, a = !1) {
@@ -434,7 +434,7 @@ let m = class extends K {
434
434
  },
435
435
  oncontextmenu: (o) => {
436
436
  o.event.preventDefault(), this.$emit("notiifyLeadName", {
437
- event: A(v({}, o), {
437
+ event: H(v({}, o), {
438
438
  name: y[e],
439
439
  idx: e
440
440
  }),
@@ -443,7 +443,7 @@ let m = class extends K {
443
443
  },
444
444
  onclick: (o) => {
445
445
  this.$emit("notiifyLeadName", {
446
- event: A(v({}, o), {
446
+ event: H(v({}, o), {
447
447
  name: y[e],
448
448
  idx: e
449
449
  }),
@@ -468,7 +468,7 @@ let m = class extends K {
468
468
  })));
469
469
  }
470
470
  drawRulerNotes() {
471
- var a, s, o, r;
471
+ var a, s, o, n, l, r;
472
472
  if (!this.rulerConfig.isShow)
473
473
  return;
474
474
  const e = {
@@ -484,15 +484,15 @@ let m = class extends K {
484
484
  }, e)
485
485
  }), i = new I({
486
486
  style: v({
487
- text: `${(a = this.formatEcgData) == null ? void 0 : a.gain}mm/mV ${(s = this.formatEcgData) == null ? void 0 : s.speed}mm/s`,
487
+ text: `${((a = this.formatEcgData) == null ? void 0 : a.gainName) === "\u80F8\u5BFC\u51CF\u534A" ? (s = this.formatEcgData) == null ? void 0 : s.gainName : `${(o = this.formatEcgData) == null ? void 0 : o.gain}mm/mV`} ${(n = this.formatEcgData) == null ? void 0 : n.speed}mm/s`,
488
488
  x: this.leadHeadConfig.leadHedeWidth / 2 + 20,
489
489
  y: this.drawArea.height + this.bottomAreaHeight - 40
490
490
  }, e)
491
491
  });
492
- (o = this.sceneIns) == null || o.add(i), (r = this.sceneIns) == null || r.add(t);
492
+ (l = this.sceneIns) == null || l.add(i), (r = this.sceneIns) == null || r.add(t);
493
493
  }
494
494
  drawRuler(e = 0) {
495
- var o, r, l, n, h;
495
+ var o, n, l, r, h;
496
496
  if (!this.rulerConfig.isShow)
497
497
  return;
498
498
  const t = this.dataTotalTimes / 1e3;
@@ -500,7 +500,7 @@ let m = class extends K {
500
500
  if (this.leadModel.isContinuous)
501
501
  s = t * 5;
502
502
  else if (!this.leadModel.add && ((o = this.formatEcgData) == null ? void 0 : o.step)) {
503
- const d = G(this.splitPoint, this.formatEcgData.step), u = H(d, ((r = this.formatEcgData) == null ? void 0 : r.processedData.otherParams.SampleRate) || 0) / 1e3;
503
+ const d = G(this.splitPoint, this.formatEcgData.step), u = L(d, ((n = this.formatEcgData) == null ? void 0 : n.processedData.otherParams.SampleRate) || 0) / 1e3;
504
504
  s = e + u;
505
505
  }
506
506
  for (let d = e; d <= s; d = +(d + 0.1).toFixed(1))
@@ -514,7 +514,7 @@ let m = class extends K {
514
514
  fontFamily: this.fontFamily,
515
515
  fill: "#FF0080"
516
516
  }
517
- }))) : a = this.canvasContainer.height - 5, (n = this.rulerGroup) == null || n.add(new b({
517
+ }))) : a = this.canvasContainer.height - 5, (r = this.rulerGroup) == null || r.add(new b({
518
518
  cursor: "",
519
519
  shape: {
520
520
  x1: i,
@@ -538,25 +538,25 @@ let m = class extends K {
538
538
  (e = this.sceneIns) == null || e.add(this.leadHeadNameGroup), (t = this.sceneIns) == null || t.add(this.leadHeadOffAndDelGroup);
539
539
  }
540
540
  drawLoopArrow(e = 0) {
541
- var l, n, h, d, u, c, p, D, W, x, M, O, k, B, R, z, N;
541
+ var l, r, h, d, u, c, p, D, W, x, M, O, B, k, R, z, N;
542
542
  if (this.drawLoopArrowStartPosIdx = e, !this.heartFight.isShow)
543
543
  return;
544
544
  this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = ((l = this.formatEcgData) == null ? void 0 : l.heartBeatPosition[this.heartFight.defaultSelect]) || null, this.drawHeardBeatLine());
545
545
  let t = 0, i = 0;
546
- this.leadModel.add ? i = this.loopArrowY.add - (((n = this.formatEcgData) == null ? void 0 : n.sens) || 0) - this.splitBlockHeight / 3.5 : i = 20;
546
+ this.leadModel.add ? i = this.loopArrowY.add - (((r = this.formatEcgData) == null ? void 0 : r.sens) || 0) - this.splitBlockHeight / 3.5 : i = 20;
547
547
  let a = 0, s = 0;
548
548
  const o = {
549
549
  fontSize: 12,
550
550
  fill: "red",
551
551
  fontFamily: this.fontFamily
552
552
  };
553
- let r = 0;
553
+ let n = 0;
554
554
  for (let S = 0; S < (((h = this.formatEcgData) == null ? void 0 : h.heartBeatPosition) || []).length; S++) {
555
555
  const f = (d = this.formatEcgData) == null ? void 0 : d.heartBeatPosition[S];
556
- if (r = ((f == null ? void 0 : f.position) || 0) - e, !(e > ((f == null ? void 0 : f.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && r > (this.slidingWindowInfo.points || 0))) {
556
+ if (n = ((f == null ? void 0 : f.position) || 0) - e, !(e > ((f == null ? void 0 : f.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && n > (this.slidingWindowInfo.points || 0))) {
557
557
  if (((f == null ? void 0 : f.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
558
558
  break;
559
- t = r * (((u = this.formatEcgData) == null ? void 0 : u.step) || 0) + this.leadHeadConfig.leadHedeWidth - 9.5, s = 0, (D = this.arrowGroup) == null || D.add(new ee({
559
+ t = n * (((u = this.formatEcgData) == null ? void 0 : u.step) || 0) + this.leadHeadConfig.leadHedeWidth - 9.5, s = 0, (D = this.arrowGroup) == null || D.add(new ee({
560
560
  name: "arrow_box",
561
561
  shape: {
562
562
  points: [
@@ -577,8 +577,8 @@ let m = class extends K {
577
577
  var j;
578
578
  !this.heartFight.mode || (E.target.attr({
579
579
  style: { fill: "blue" }
580
- }), (j = this.arrowGroup) == null || j.children().filter((L) => L.name === "arrow_box").forEach((L) => {
581
- L.id !== E.target.id && L.attr({
580
+ }), (j = this.arrowGroup) == null || j.children().filter((A) => A.name === "arrow_box").forEach((A) => {
581
+ A.id !== E.target.id && A.attr({
582
582
  style: { fill: "#ccc" }
583
583
  });
584
584
  }), this.arrowLoopClick(f, E.target));
@@ -597,7 +597,7 @@ let m = class extends K {
597
597
  y: s + i,
598
598
  text: `${(f == null ? void 0 : f.interval) || ""}`
599
599
  }, o)
600
- })), s += 12), this.heartFight.qrstCompany && (a = ((k = this.AssistCtx) == null ? void 0 : k.measureText(`${(f == null ? void 0 : f.qrstCompany) || ""}`).width) || 0, (B = this.arrowGroup) == null || B.add(new I({
600
+ })), s += 12), this.heartFight.qrstCompany && (a = ((B = this.AssistCtx) == null ? void 0 : B.measureText(`${(f == null ? void 0 : f.qrstCompany) || ""}`).width) || 0, (k = this.arrowGroup) == null || k.add(new I({
601
601
  cursor: "",
602
602
  style: v({
603
603
  x: 4 + t - a * 1.5,
@@ -620,14 +620,14 @@ let m = class extends K {
620
620
  this.$emit("notifyHeardBeat", te.clone(e)), this.currentHeardBeat.heardBeat = e, this.currentHeardBeat.ele = t, this.drawHeardBeatLine();
621
621
  }
622
622
  drawHeardBeatLine(e = 0) {
623
- var r, l, n, h, d, u;
623
+ var n, l, r, h, d, u;
624
624
  if (!this.currentHeardBeat.heardBeat)
625
625
  return;
626
- (r = this.heardBeatLineGroup) == null || r.removeAll(), (l = this.sceneIns) == null || l.remove(this.heardBeatLineGroup);
626
+ (n = this.heardBeatLineGroup) == null || n.removeAll(), (l = this.sceneIns) == null || l.remove(this.heardBeatLineGroup);
627
627
  let t = this.formatEcgData.processedData.otherParams.AnalyseValue[this.currentHeardBeat.heardBeat.index].KeyPosByBeat, i = 0, a = this.getRednerPoints(), s = this.getAddRednerPoints(), o;
628
628
  for (const c in t)
629
629
  if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(c) && Object.prototype.hasOwnProperty.call(t, c)) {
630
- i = (t[c] - this.slidingWindowInfo.startInd) * (((n = this.formatEcgData) == null ? void 0 : n.step) || 0);
630
+ i = (t[c] - this.slidingWindowInfo.startInd) * (((r = this.formatEcgData) == null ? void 0 : r.step) || 0);
631
631
  e:
632
632
  for (let p = 0; p < a.length; p++)
633
633
  if (!(this.isLeadOff(p) || this.isLeadDel(p))) {
@@ -672,21 +672,21 @@ let m = class extends K {
672
672
  var a, s;
673
673
  this.slidingWindowInfo.startInd = e, this.slidingWindowInfo.endInd = e + (this.slidingWindowInfo.points || 0), this.addSlidingWindowInfo.startInd = e, this.addSlidingWindowInfo.endInd = e + (this.addSlidingWindowInfo.points || 0);
674
674
  let t = this.getRednerPoints(), i = this.getAddRednerPoints();
675
- this.waveDataCopy = t, this.addWaveDataCopy = i, (a = this.rowAndColwaveFromGroup) == null || a.eachChild((o, r) => {
676
- r = r || 0, o.attr({
675
+ this.waveDataCopy = t, this.addWaveDataCopy = i, (a = this.rowAndColwaveFromGroup) == null || a.eachChild((o, n) => {
676
+ n = n || 0, o.attr({
677
677
  shape: {
678
- points: t[r].data.map(([l, n]) => [
679
- l + t[r].pos[0],
680
- n + t[r].pos[1]
678
+ points: t[n].data.map(([l, r]) => [
679
+ l + t[n].pos[0],
680
+ r + t[n].pos[1]
681
681
  ])
682
682
  }
683
683
  });
684
- }), (s = this.addwaveFromGroup) == null || s.eachChild((o, r) => {
685
- r = r || 0, o.attr({
684
+ }), (s = this.addwaveFromGroup) == null || s.eachChild((o, n) => {
685
+ n = n || 0, o.attr({
686
686
  shape: {
687
- points: i[r].data.map(([l, n]) => [
688
- l + i[r].pos[0],
689
- n + i[r].pos[1]
687
+ points: i[n].data.map(([l, r]) => [
688
+ l + i[n].pos[0],
689
+ r + i[n].pos[1]
690
690
  ])
691
691
  }
692
692
  });
@@ -695,7 +695,7 @@ let m = class extends K {
695
695
  scrollRuler(e) {
696
696
  var i, a, s;
697
697
  (i = this.rulerGroup) == null || i.removeAll(), (a = this.sceneIns) == null || a.remove(this.rulerGroup);
698
- const t = H(e, ((s = this.formatEcgData) == null ? void 0 : s.processedData.otherParams.SampleRate) || 0) / 1e3;
698
+ const t = L(e, ((s = this.formatEcgData) == null ? void 0 : s.processedData.otherParams.SampleRate) || 0) / 1e3;
699
699
  this.drawRuler(t);
700
700
  }
701
701
  scrollArrow(e) {
@@ -1 +1 @@
1
- "use strict";var B=Object.defineProperty,R=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(e,t,a)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,C=(e,t)=>{for(var a in t||(t={}))z.call(t,a)&&k(e,a,t[a]);if(O)for(var a of O(t))N.call(t,a)&&k(e,a,t[a]);return e},W=(e,t)=>R(e,T(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),_=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Emit.js");const w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("@costy-plus/utils"),u=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},q=$(j);var X=Object.defineProperty,V=Object.getOwnPropertyDescriptor,g=(e,t,a,i)=>{for(var s=i>1?void 0:i?V(t,a):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(s=(i?n(t,a,s):n(s))||s);return i&&s&&X(t,a,s),s};exports.default=class extends q.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(100),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.splitBlockHeight=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.isShowEnlargeWave=!1,this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.vuescrollConfig.isShow&&parseInt(`${(e=this.vuescrollConfig.bar)==null?void 0:e.size}`)||0)||0}}get waveFromData(){var e,t,a;return((e=this.formatEcgData)==null?void 0:e.analysisValueMode)===v.AnalysisMode.CompoundWave?((t=this.formatEcgData)==null?void 0:t.processedData.handleData.ComplexData)||[[]]:((a=this.formatEcgData)==null?void 0:a.processedData.handleData.Data)||[[]]}get isSingleMode(){return this.leadModel.column===1&&this.leadModel.line===1}destroyed(){var e,t,a,i,s,o,n,l,r,h,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(a=this.addwaveFromGroup)==null||a.removeAll(),(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.splitLineGroup)==null||s.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(r=this.arrowGroup)==null||r.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.sceneIns)==null||d.dispose()}init(){var e;this.initWaveFormPeer(),this.combinationDrawing(),(e=this.formatEcgData)!=null&&e.processedData.otherParams.PosStart&&(this.vuescrollConfig.isShow?this.$nextTick(()=>{var t,a;this.$refs.vueScroll.scrollBy({dx:(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.PosStart)||0)*(((a=this.formatEcgData)==null?void 0:a.step)||0)})}):(this.scrollWaveFrom(this.formatEcgData.processedData.otherParams.PosStart),this.scrollRuler(this.formatEcgData.processedData.otherParams.PosStart),this.scrollArrow(this.formatEcgData.processedData.otherParams.PosStart)))}initWaveFormPeer(){var a;(a=this.sceneIns)==null||a.dispose(),this.AssistCtx=null;const e=document.getElementById("wave-from-box");this.sceneIns=u.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById("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,a;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(a=this.sceneIns)==null||a.off("mouseup",this.sceneInsMouseUp)}combinationDrawing(){this.initConfig(),this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}initConfig(){var t,a,i,s,o,n,l,r,h,d,m;this.rowAndColwaveFromGroup=new u.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new u.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new u.Group({name:"addwaveFrom"}),this.leadHeadGroup=new u.Group({name:"leadHead"}),this.splitLineGroup=new u.Group({name:"splitLine"}),this.leadHeadNameGroup=new u.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new u.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new u.Group({name:"ruler"}),this.arrowGroup=new u.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new u.Group({name:"heardBeatLine"}),this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height;let e=this.canvasContainer.width;if(((a=(t=this.conventionalECGConfig)==null?void 0:t.ecgReviewSetting)==null?void 0:a.ecgareawidth)==="1"){const p=v.getPrintLengthToPx(((i=this.formatEcgData)==null?void 0:i.processedData.otherParams.SampleRate)||0)+this.leadHeadConfig.leadHedeWidth;p<=e&&(e=p)}else this.leadModel.isContinuous&&(((s=this.formatEcgData)==null?void 0:s.dataPxLen)||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(((o=this.formatEcgData)==null?void 0:o.dataPxLen)||0)+this.leadHeadConfig.leadHedeWidth);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=((n=this.formatEcgData)==null?void 0:n.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=(((r=this.formatEcgData)==null?void 0:r.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.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)*(((m=this.formatEcgData)==null?void 0:m.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 a=Date.now(),i=()=>{var m,p,c,D;const s=e.target.name.split("_");this.activeLeadIdx=+s[0];const o=+s[1];let n=0,l=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],l=this.singleWaveDataCopy[o].startInd):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],l=this.waveDataCopy[o].startInd||0):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],l=this.addWaveDataCopy[o].startInd||0);let r=v.getPointIdxForPx(n,((m=this.formatEcgData)==null?void 0:m.step)||1);r+=l;const h=((p=this.formatEcgData)==null?void 0:p.processedData.otherParams.AnalyseValue)||[];let d=null;if(this.enlargeWaveMode===v.AnalysisMode.SelectedHeartbeat){if(r<=h[1].KeyPosByBeat.Tend+.1*(((c=this.formatEcgData)==null?void 0:c.processedData.otherParams.SampleRate)||0))d=h[1];else for(let y=1;y<h.length;y++)if(r>h[y-1].KeyPosByBeat.Tend+1&&r<h[y].KeyPosByBeat.Tend+.1*(((D=this.formatEcgData)==null?void 0:D.processedData.otherParams.SampleRate)||0)){d=h[y];break}}else d=h[0];console.log("currentAnalyseValue",d,d==null?void 0:d.BeatID),d&&(this.activeLeadAnalyseValue=W(C({},d),{BeatCount:h.length-1}),d=null,this.isShowEnlargeWave=!0)};a-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,i()):this.dbClickWaveFromTime=a}sceneInsMousemove(e){this.sceneIsMouseDown&&this.$refs.vueScroll.scrollBy({dx:e.offsetX-this.sceneIsMouseDownX})}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}createLeadHead(e,t,a){var o;const i=this.leadHeadConfig.leadHedeWidth/4;let s=((o=this.formatEcgData)==null?void 0:o.sens)||0;return s=a?s/2:s,new u.Polyline({cursor:"",shape:{points:[[0+e,0+t],[i+e,0+t],[i+e,-s+t],[3*i+e,-s+t],[3*i+e,0+t],[4*i+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}creatSplitLine(e,t,a){var i,s;return new u.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(a?(((i=this.formatEcgData)==null?void 0:i.sens)||0)/2:((s=this.formatEcgData)==null?void 0:s.sens)||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawLeadHead(){var a,i,s,o,n,l;(a=this.leadHeadGroup)==null||a.removeAll(),(i=this.sceneIns)==null||i.remove(this.leadHeadGroup);let e=0,t=!1;for(let r=1;r<=this.totalRows;r++)e=0,t=!1,r<=this.leadModel.line?e=(((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.LeadName)||[])[r-1]||0:r>this.leadModel.line&&r-this.leadModel.line<=this.leadModel.add&&(e=this.longLeadConfig.leadNames[r-this.leadModel.line-1]),((o=this.formatEcgData)==null?void 0:o.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(v.LeadNameTexts[e])&&(t=!0),(n=this.leadHeadGroup)==null||n.add(this.createLeadHead(0,r*this.splitBlockHeight,t));(l=this.sceneIns)==null||l.add(this.leadHeadGroup)}drawColSplitLine(){var s,o,n,l,r,h,d,m,p;(s=this.splitLineGroup)==null||s.removeAll(),(o=this.sceneIns)==null||o.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/this.leadModel.column;this.splitPoint=e,this.isSingleMode&&(this.splitPoint-=80);let t=0,a=0,i=0;for(let c=1;c<=this.leadModel.column-1;c++){t=c*e+this.leadHeadConfig.leadHedeWidth,a=c*this.leadModel.line;for(let D=1;D<=this.leadModel.line&&(i=(((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.LeadName)||[])[D-1+a],i!==void 0);D++)((l=this.formatEcgData)==null?void 0:l.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(v.LeadNameTexts[i])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,D*this.splitBlockHeight-(((r=this.formatEcgData)==null?void 0:r.sens)||0)/2*.5,!0)):(m=this.splitLineGroup)==null||m.add(this.creatSplitLine(t,D*this.splitBlockHeight-(((d=this.formatEcgData)==null?void 0:d.sens)||0)*.5))}(p=this.sceneIns)==null||p.add(this.splitLineGroup)}initSlidingWindowInfo(){var i,s;const e=((i=this.formatEcgData)==null?void 0:i.step)||0,t=Math.ceil(this.splitPoint/e);this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.vuescrollConfig.isShow&&(this.vuescrollWH.width=this.canvasContainer.width+(((s=this.formatEcgData)==null?void 0:s.dataPxLen)||0)-this.splitPoint);const a=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:a,startInd:0,endInd:a}}getRednerSinglePoints(){let e=0,t=0;const a=this.waveFromData[this.singleModeInfo.defaultSelect]||[];let i=this.slidingWindowInfo.startInd||0,s=this.slidingWindowInfo.endInd||0;const o=[],n=Math.ceil(a.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=n;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,i=s,s=i+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),o.push({pos:[e,t],startInd:i,endInd:s,data:a.slice(i,s).map((h,d)=>{var m;return[d*(((m=this.formatEcgData)==null?void 0:m.step)||0),-h]})})}return o}getRednerPoints(){let e=0,t=0,a=0,i=[],s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const n=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(s=o,o=s+(this.slidingWindowInfo.points||0));for(let r=1;r<=this.leadModel.line&&(t=r*this.splitBlockHeight,!(a>(this.waveFromData||[]).length-1));r++)i=this.waveFromData[a]||[],a++,r===1&&(this.loopArrowY.rowAndCol=t),n.push({pos:[e,t],startInd:s,endInd:o,data:i.slice(s,o).map((h,d)=>{var m;return[d*(((m=this.formatEcgData)==null?void 0:m.step)||0),-h]})})}return n}getAddRednerPoints(){const e=[],t=this.leadHeadConfig.leadHedeWidth;let a=0,i=0,s=[];for(let o=0;o<this.leadModel.add;o++)i=this.longLeadConfig.leadIdxs[o],a=(o+this.leadModel.line+1)*this.splitBlockHeight,s=this.waveFromData[i]||[],o===0&&(this.loopArrowY.add=a),e.push({pos:[t,a],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:s.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((n,l)=>{var r;return[l*(((r=this.formatEcgData)==null?void 0:r.step)||0),-n]})});return e}createSingleWaveFrom(){var o,n,l,r,h,d,m;(o=this.singleWaveFromGroup)==null||o.removeAll();const e=(((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.LeadName)||[])[this.singleModeInfo.defaultSelect]||0;let t=this.getRednerSinglePoints(),a=v.getDataLenTimes(this.slidingWindowInfo.points||0,((l=this.formatEcgData)==null?void 0:l.processedData.otherParams.SampleRate)||0),i=0,s=0;for(let p=0;p<t.length&&!(t[p].pos[1]>this.drawArea.height+this.bottomAreaHeight);p++)this.isLeadDel(e)||(i=parseInt(`${a/1e3/60}`,10),s=parseInt(`${a/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(r=this.singleWaveFromGroup)==null||r.add(new u.Polyline({cursor:"",name:this.singleModeInfo.defaultSelect+"_"+p,shape:{points:t[p].data.map(([c,D])=>[c+t[p].pos[0],D+t[p].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:c=>{this.onDbClickWaveFrom(c,"single")}})),(d=this.singleWaveFromGroup)==null||d.add(new u.Text({cursor:"",style:{x:t[p].pos[0],y:t[p].pos[1]-(((h=this.formatEcgData)==null?void 0:h.sens)||0)/2,text:p===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),p>0&&(a+=a));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)/2-15),this.singleWaveDataCopy=t,t=null}createAddWaveFrom(){var t,a;console.time("createAddWaveFrom");let e=this.getAddRednerPoints();for(let i=0;i<e.length;i++)this.isLeadDel(this.longLeadConfig.leadIdxs[i])||((t=this.addwaveFromGroup)==null||t.add(new u.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[i]+"_"+i,shape:{points:e[i].data.map(([s,o])=>[s+e[i].pos[0],o+e[i].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:s=>{this.onDbClickWaveFrom(s,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[i],e[i].pos[0],e[i].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[i],e[i].pos[0]-5,e[i].pos[1]-(((a=this.formatEcgData)==null?void 0:a.sens)||0)/2-15));console.timeEnd("createAddWaveFrom"),this.addWaveDataCopy=e,e=null}createRowAndColWaveFrom(){var a,i,s,o,n,l;console.time("createRowAndColWaveFrom"),(a=this.rowAndColwaveFromGroup)==null||a.removeAll();let e=this.getRednerPoints(),t=0;for(let r=0;r<e.length;r++)t=(((i=this.formatEcgData)==null?void 0:i.processedData.otherParams.LeadName)||[])[r]||0,this.isLeadDel(t)||(s=this.rowAndColwaveFromGroup)==null||s.add(new u.Polyline({cursor:"",name:r+"_"+r,shape:{points:e[r].data.map(([h,d])=>[h+e[r].pos[0],d+e[r].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"rowAndCol")}})),r<this.leadModel.line?(this.createLeadName(t,e[r].pos[0],e[r].pos[1]-15),this.createLeadOffAndDel(t,e[r].pos[0]-5,e[r].pos[1]-(((o=this.formatEcgData)==null?void 0:o.sens)||0)/2-15)):(this.createLeadName(t,e[r].pos[0]+5,e[r].pos[1]-(((n=this.formatEcgData)==null?void 0:n.sens)||0)/2),this.createLeadOffAndDel(t,e[r].pos[0]-5,e[r].pos[1]-(((l=this.formatEcgData)==null?void 0:l.sens)||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,a,i=!1){var s;(s=this.leadHeadNameGroup)==null||s.add(new u.Text({style:{x:t,y:a,text:v.LeadNameTexts[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:W(C({},o),{name:v.LeadNameTexts[e],idx:e}),isAdd:i})},onclick:o=>{this.$emit("notiifyLeadName",{event:W(C({},o),{name:v.LeadNameTexts[e],idx:e}),isAdd:i})}}))}createLeadOffAndDel(e,t,a){var i;(this.isLeadOff(e)||this.isLeadDel(e))&&((i=this.leadHeadOffAndDelGroup)==null||i.add(new u.Text({cursor:"",style:{x:t,y:a,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}drawRulerNotes(){var i,s,o,n;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new u.Text({cursor:"",style:C({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.drawArea.height+this.bottomAreaHeight-25},e)}),a=new u.Text({style:C({text:`${(i=this.formatEcgData)==null?void 0:i.gain}mm/mV ${(s=this.formatEcgData)==null?void 0:s.speed}mm/s`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.drawArea.height+this.bottomAreaHeight-40},e)});(o=this.sceneIns)==null||o.add(a),(n=this.sceneIns)==null||n.add(t)}drawRuler(e=0){var o,n,l,r,h;if(!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let a=this.leadHeadConfig.leadHedeWidth,i=0,s=t;if(this.leadModel.isContinuous)s=t*5;else if(!this.leadModel.add&&((o=this.formatEcgData)==null?void 0:o.step)){const d=v.getPointIdxForPx(this.splitPoint,this.formatEcgData.step),m=v.getDataLenTimes(d,((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.SampleRate)||0)/1e3;s=e+m}for(let d=e;d<=s;d=+(d+.1).toFixed(1))d!==e&&(a+=this.rulerStep),d%1===0?(i=this.canvasContainer.height-10,(l=this.rulerGroup)==null||l.add(new u.Text({cursor:"",style:{x:a,y:i-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):i=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.add(new u.Line({cursor:"",shape:{x1:a,y1:i,x2:a,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(h=this.sceneIns)==null||h.add(this.rulerGroup)}drawWaveFrom(){var e,t,a;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),(a=this.sceneIns)==null||a.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,r,h,d,m,p,c,D,y,A,H,F,x,G,S,b,E;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,a=0;this.leadModel.add?a=this.loopArrowY.add-(((r=this.formatEcgData)==null?void 0:r.sens)||0)-this.splitBlockHeight/3.5:a=20;let i=0,s=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let n=0;for(let P=0;P<(((h=this.formatEcgData)==null?void 0:h.heartBeatPosition)||[]).length;P++){const f=(d=this.formatEcgData)==null?void 0:d.heartBeatPosition[P];if(n=((f==null?void 0:f.position)||0)-e,!(e>((f==null?void 0:f.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&n>(this.slidingWindowInfo.points||0))){if(((f==null?void 0:f.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=n*(((m=this.formatEcgData)==null?void 0:m.step)||0)+this.leadHeadConfig.leadHedeWidth-9.5,s=0,(D=this.arrowGroup)==null||D.add(new u.Polygon({name:"arrow_box",shape:{points:[[4+t,0+a],[15+t,0+a],[15+t,10+a],[19+t,10+a],[9.5+t,22+a],[0+t,10+a],[4+t,10+a],[4+t,0+a]]},style:{fill:((c=(p=this.currentHeardBeat)==null?void 0:p.heardBeat)==null?void 0:c.index)===(f==null?void 0:f.index)?"blue":"#ccc"},onclick:L=>{var M;!this.heartFight.mode||(L.target.attr({style:{fill:"blue"}}),(M=this.arrowGroup)==null||M.children().filter(I=>I.name==="arrow_box").forEach(I=>{I.id!==L.target.id&&I.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(f,L.target))}})),this.heartFight.heartrate&&(i=((y=this.AssistCtx)==null?void 0:y.measureText(`${(f==null?void 0:f.heartrate)||""}`).width)||0,(A=this.arrowGroup)==null||A.add(new u.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.heartrate)||""}`},o)})),s+=12),this.heartFight.interval&&(i=((H=this.AssistCtx)==null?void 0:H.measureText(`${(f==null?void 0:f.interval)||""}`).width)||0,(F=this.arrowGroup)==null||F.add(new u.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.interval)||""}`},o)})),s+=12),this.heartFight.qrstCompany&&(i=((x=this.AssistCtx)==null?void 0:x.measureText(`${(f==null?void 0:f.qrstCompany)||""}`).width)||0,(G=this.arrowGroup)==null||G.add(new u.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.qrstCompany)||""}`},o)})),s+=12),this.heartFight.telectricalaxis&&(i=((S=this.AssistCtx)==null?void 0:S.measureText(`${(f==null?void 0:f.telectricalaxis)||""}`).width)||0,(b=this.arrowGroup)==null||b.add(new u.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.telectricalaxis)||""}`},o)})))}}(E=this.sceneIns)==null||E.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",u.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var n,l,r,h,d,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t=this.formatEcgData.processedData.otherParams.AnalyseValue[this.currentHeardBeat.heardBeat.index].KeyPosByBeat,a=0,i=this.getRednerPoints(),s=this.getAddRednerPoints(),o;for(const p in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(p)&&Object.prototype.hasOwnProperty.call(t,p)){a=(t[p]-this.slidingWindowInfo.startInd)*(((r=this.formatEcgData)==null?void 0:r.step)||0);e:for(let c=0;c<i.length;c++)if(!(this.isLeadOff(c)||this.isLeadDel(c))){if(e>t[p]||!this.leadModel.isContinuous&&t[p]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=i[c],this.leadModel.isContinuous&&c>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+a,o.pos[1]))}e:for(let c=0;c<s.length;c++)if(!(this.isLeadOff(this.longLeadConfig.leadIdxs[c])&&this.isLeadDel(this.longLeadConfig.leadIdxs[c]))){if(e>t[p])break e;o=s[c],(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(o.pos[0]+a,o.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,i=null,s=null}createHeardBeatLine(e,t){return new u.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}handleScroll(e,t,a){var i;if(t.type==="horizontal"){t.scrollLeft=t.scrollLeft||0;const s=v.getPointIdxForPx(t.scrollLeft,((i=this.formatEcgData)==null?void 0:i.step)||1);this.scrollWaveFrom(s),this.scrollRuler(s),this.scrollArrow(s),this.$emit("notifyScrollPointIdx",s)}}scrollWaveFrom(e){var i,s;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(),a=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=a,(i=this.rowAndColwaveFromGroup)==null||i.eachChild((o,n)=>{n=n||0,o.attr({shape:{points:t[n].data.map(([l,r])=>[l+t[n].pos[0],r+t[n].pos[1]])}})}),(s=this.addwaveFromGroup)==null||s.eachChild((o,n)=>{n=n||0,o.attr({shape:{points:a[n].data.map(([l,r])=>[l+a[n].pos[0],r+a[n].pos[1]])}})}),t=null,a=null}scrollRuler(e){var a,i,s;(a=this.rulerGroup)==null||a.removeAll(),(i=this.sceneIns)==null||i.remove(this.rulerGroup);const t=v.getDataLenTimes(e,((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.SampleRate)||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,a;(t=this.arrowGroup)==null||t.removeAll(),(a=this.sceneIns)==null||a.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};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({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:()=>({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,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"vuescrollConfig",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:v.AnalysisMode.CompoundWave})],exports.default.prototype,"enlargeWaveMode",2);g([w.Prop({default:()=>[]})],exports.default.prototype,"gains",2);g([w.Prop({default:()=>[]})],exports.default.prototype,"speeds",2);g([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeInfo",2);g([v.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([_.default({name:"Methods"})],exports.default);
1
+ "use strict";var B=Object.defineProperty,R=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(e,t,a)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,C=(e,t)=>{for(var a in t||(t={}))z.call(t,a)&&k(e,a,t[a]);if(O)for(var a of O(t))N.call(t,a)&&k(e,a,t[a]);return e},W=(e,t)=>R(e,T(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),_=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Emit.js");const w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_zrnidtknow37s43kh2nsmp2h4u/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("@costy-plus/utils"),c=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},q=$(j);var X=Object.defineProperty,V=Object.getOwnPropertyDescriptor,g=(e,t,a,i)=>{for(var s=i>1?void 0:i?V(t,a):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(s=(i?n(t,a,s):n(s))||s);return i&&s&&X(t,a,s),s};exports.default=class extends q.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(100),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.splitBlockHeight=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.isShowEnlargeWave=!1,this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.vuescrollConfig.isShow&&parseInt(`${(e=this.vuescrollConfig.bar)==null?void 0:e.size}`)||0)||0}}get waveFromData(){var e,t,a;return((e=this.formatEcgData)==null?void 0:e.analysisValueMode)===v.AnalysisMode.CompoundWave?((t=this.formatEcgData)==null?void 0:t.processedData.handleData.ComplexData)||[[]]:((a=this.formatEcgData)==null?void 0:a.processedData.handleData.Data)||[[]]}get isSingleMode(){return this.leadModel.column===1&&this.leadModel.line===1}destroyed(){var e,t,a,i,s,o,n,l,r,h,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(a=this.addwaveFromGroup)==null||a.removeAll(),(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.splitLineGroup)==null||s.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(r=this.arrowGroup)==null||r.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.sceneIns)==null||d.dispose()}init(){var e;this.initWaveFormPeer(),this.combinationDrawing(),(e=this.formatEcgData)!=null&&e.processedData.otherParams.PosStart&&(this.vuescrollConfig.isShow?this.$nextTick(()=>{var t,a;this.$refs.vueScroll.scrollBy({dx:(((t=this.formatEcgData)==null?void 0:t.processedData.otherParams.PosStart)||0)*(((a=this.formatEcgData)==null?void 0:a.step)||0)})}):(this.scrollWaveFrom(this.formatEcgData.processedData.otherParams.PosStart),this.scrollRuler(this.formatEcgData.processedData.otherParams.PosStart),this.scrollArrow(this.formatEcgData.processedData.otherParams.PosStart)))}initWaveFormPeer(){var a;(a=this.sceneIns)==null||a.dispose(),this.AssistCtx=null;const e=document.getElementById("wave-from-box");this.sceneIns=c.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById("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,a;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(a=this.sceneIns)==null||a.off("mouseup",this.sceneInsMouseUp)}combinationDrawing(){this.initConfig(),this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}initConfig(){var t,a,i,s,o,n,l,r,h,d,m;this.rowAndColwaveFromGroup=new c.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new c.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new c.Group({name:"addwaveFrom"}),this.leadHeadGroup=new c.Group({name:"leadHead"}),this.splitLineGroup=new c.Group({name:"splitLine"}),this.leadHeadNameGroup=new c.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new c.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new c.Group({name:"ruler"}),this.arrowGroup=new c.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new c.Group({name:"heardBeatLine"}),this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height;let e=this.canvasContainer.width;if(((a=(t=this.conventionalECGConfig)==null?void 0:t.ecgReviewSetting)==null?void 0:a.ecgareawidth)==="1"){const u=v.getPrintLengthToPx(((i=this.formatEcgData)==null?void 0:i.processedData.otherParams.SampleRate)||0)+this.leadHeadConfig.leadHedeWidth;u<=e&&(e=u)}else this.leadModel.isContinuous&&(((s=this.formatEcgData)==null?void 0:s.dataPxLen)||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(((o=this.formatEcgData)==null?void 0:o.dataPxLen)||0)+this.leadHeadConfig.leadHedeWidth);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=((n=this.formatEcgData)==null?void 0:n.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=(((r=this.formatEcgData)==null?void 0:r.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.splitBlockHeight=this.drawArea.height/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)*(((m=this.formatEcgData)==null?void 0:m.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 a=Date.now(),i=()=>{var m,u,p,D;const s=e.target.name.split("_");this.activeLeadIdx=+s[0];const o=+s[1];let n=0,l=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],l=this.singleWaveDataCopy[o].startInd):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],l=this.waveDataCopy[o].startInd||0):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],l=this.addWaveDataCopy[o].startInd||0);let r=v.getPointIdxForPx(n,((m=this.formatEcgData)==null?void 0:m.step)||1);r+=l;const h=((u=this.formatEcgData)==null?void 0:u.processedData.otherParams.AnalyseValue)||[];let d=null;if(this.enlargeWaveMode===v.AnalysisMode.SelectedHeartbeat){if(r<=h[1].KeyPosByBeat.Tend+.1*(((p=this.formatEcgData)==null?void 0:p.processedData.otherParams.SampleRate)||0))d=h[1];else for(let y=1;y<h.length;y++)if(r>h[y-1].KeyPosByBeat.Tend+1&&r<h[y].KeyPosByBeat.Tend+.1*(((D=this.formatEcgData)==null?void 0:D.processedData.otherParams.SampleRate)||0)){d=h[y];break}}else d=h[0];console.log("currentAnalyseValue",d,d==null?void 0:d.BeatID),d&&(this.activeLeadAnalyseValue=W(C({},d),{BeatCount:h.length-1}),d=null,this.isShowEnlargeWave=!0)};a-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,i()):this.dbClickWaveFromTime=a}sceneInsMousemove(e){this.sceneIsMouseDown&&this.$refs.vueScroll.scrollBy({dx:e.offsetX-this.sceneIsMouseDownX})}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}createLeadHead(e,t,a){var o;const i=this.leadHeadConfig.leadHedeWidth/4;let s=((o=this.formatEcgData)==null?void 0:o.sens)||0;return s=a?s/2:s,new c.Polyline({cursor:"",shape:{points:[[0+e,0+t],[i+e,0+t],[i+e,-s+t],[3*i+e,-s+t],[3*i+e,0+t],[4*i+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}creatSplitLine(e,t,a){var i,s;return new c.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(a?(((i=this.formatEcgData)==null?void 0:i.sens)||0)/2:((s=this.formatEcgData)==null?void 0:s.sens)||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawLeadHead(){var a,i,s,o,n,l;(a=this.leadHeadGroup)==null||a.removeAll(),(i=this.sceneIns)==null||i.remove(this.leadHeadGroup);let e=0,t=!1;for(let r=1;r<=this.totalRows;r++)e=0,t=!1,r<=this.leadModel.line?e=(((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.LeadName)||[])[r-1]||0:r>this.leadModel.line&&r-this.leadModel.line<=this.leadModel.add&&(e=this.longLeadConfig.leadNames[r-this.leadModel.line-1]),((o=this.formatEcgData)==null?void 0:o.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(v.LeadNameTexts[e])&&(t=!0),(n=this.leadHeadGroup)==null||n.add(this.createLeadHead(0,r*this.splitBlockHeight,t));(l=this.sceneIns)==null||l.add(this.leadHeadGroup)}drawColSplitLine(){var s,o,n,l,r,h,d,m,u;(s=this.splitLineGroup)==null||s.removeAll(),(o=this.sceneIns)==null||o.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/this.leadModel.column;this.splitPoint=e,this.isSingleMode&&(this.splitPoint-=80);let t=0,a=0,i=0;for(let p=1;p<=this.leadModel.column-1;p++){t=p*e+this.leadHeadConfig.leadHedeWidth,a=p*this.leadModel.line;for(let D=1;D<=this.leadModel.line&&(i=(((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.LeadName)||[])[D-1+a],i!==void 0);D++)((l=this.formatEcgData)==null?void 0:l.gainName)==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(v.LeadNameTexts[i])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,D*this.splitBlockHeight-(((r=this.formatEcgData)==null?void 0:r.sens)||0)/2*.5,!0)):(m=this.splitLineGroup)==null||m.add(this.creatSplitLine(t,D*this.splitBlockHeight-(((d=this.formatEcgData)==null?void 0:d.sens)||0)*.5))}(u=this.sceneIns)==null||u.add(this.splitLineGroup)}initSlidingWindowInfo(){var i,s;const e=((i=this.formatEcgData)==null?void 0:i.step)||0,t=Math.ceil(this.splitPoint/e);this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.vuescrollConfig.isShow&&(this.vuescrollWH.width=this.canvasContainer.width+(((s=this.formatEcgData)==null?void 0:s.dataPxLen)||0)-this.splitPoint);const a=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:a,startInd:0,endInd:a}}getRednerSinglePoints(){let e=0,t=0;const a=this.waveFromData[this.singleModeInfo.defaultSelect]||[];let i=this.slidingWindowInfo.startInd||0,s=this.slidingWindowInfo.endInd||0;const o=[],n=Math.ceil(a.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=n;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,i=s,s=i+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),o.push({pos:[e,t],startInd:i,endInd:s,data:a.slice(i,s).map((h,d)=>{var m;return[d*(((m=this.formatEcgData)==null?void 0:m.step)||0),-h]})})}return o}getRednerPoints(){let e=0,t=0,a=0,i=[],s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const n=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(s=o,o=s+(this.slidingWindowInfo.points||0));for(let r=1;r<=this.leadModel.line&&(t=r*this.splitBlockHeight,!(a>(this.waveFromData||[]).length-1));r++)i=this.waveFromData[a]||[],a++,r===1&&(this.loopArrowY.rowAndCol=t),n.push({pos:[e,t],startInd:s,endInd:o,data:i.slice(s,o).map((h,d)=>{var m;return[d*(((m=this.formatEcgData)==null?void 0:m.step)||0),-h]})})}return n}getAddRednerPoints(){const e=[],t=this.leadHeadConfig.leadHedeWidth;let a=0,i=0,s=[];for(let o=0;o<this.leadModel.add;o++)i=this.longLeadConfig.leadIdxs[o],a=(o+this.leadModel.line+1)*this.splitBlockHeight,s=this.waveFromData[i]||[],o===0&&(this.loopArrowY.add=a),e.push({pos:[t,a],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:s.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((n,l)=>{var r;return[l*(((r=this.formatEcgData)==null?void 0:r.step)||0),-n]})});return e}createSingleWaveFrom(){var o,n,l,r,h,d,m;(o=this.singleWaveFromGroup)==null||o.removeAll();const e=(((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.LeadName)||[])[this.singleModeInfo.defaultSelect]||0;let t=this.getRednerSinglePoints(),a=v.getDataLenTimes(this.slidingWindowInfo.points||0,((l=this.formatEcgData)==null?void 0:l.processedData.otherParams.SampleRate)||0),i=0,s=0;for(let u=0;u<t.length&&!(t[u].pos[1]>this.drawArea.height+this.bottomAreaHeight);u++)this.isLeadDel(e)||(i=parseInt(`${a/1e3/60}`,10),s=parseInt(`${a/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(r=this.singleWaveFromGroup)==null||r.add(new c.Polyline({cursor:"",name:this.singleModeInfo.defaultSelect+"_"+u,shape:{points:t[u].data.map(([p,D])=>[p+t[u].pos[0],D+t[u].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:p=>{this.onDbClickWaveFrom(p,"single")}})),(d=this.singleWaveFromGroup)==null||d.add(new c.Text({cursor:"",style:{x:t[u].pos[0],y:t[u].pos[1]-(((h=this.formatEcgData)==null?void 0:h.sens)||0)/2,text:u===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),u>0&&(a+=a));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)/2-15),this.singleWaveDataCopy=t,t=null}createAddWaveFrom(){var t,a;console.time("createAddWaveFrom");let e=this.getAddRednerPoints();for(let i=0;i<e.length;i++)this.isLeadDel(this.longLeadConfig.leadIdxs[i])||((t=this.addwaveFromGroup)==null||t.add(new c.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[i]+"_"+i,shape:{points:e[i].data.map(([s,o])=>[s+e[i].pos[0],o+e[i].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:s=>{this.onDbClickWaveFrom(s,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[i],e[i].pos[0],e[i].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[i],e[i].pos[0]-5,e[i].pos[1]-(((a=this.formatEcgData)==null?void 0:a.sens)||0)/2-15));console.timeEnd("createAddWaveFrom"),this.addWaveDataCopy=e,e=null}createRowAndColWaveFrom(){var a,i,s,o,n,l;console.time("createRowAndColWaveFrom"),(a=this.rowAndColwaveFromGroup)==null||a.removeAll();let e=this.getRednerPoints(),t=0;for(let r=0;r<e.length;r++)t=(((i=this.formatEcgData)==null?void 0:i.processedData.otherParams.LeadName)||[])[r]||0,this.isLeadDel(t)||(s=this.rowAndColwaveFromGroup)==null||s.add(new c.Polyline({cursor:"",name:r+"_"+r,shape:{points:e[r].data.map(([h,d])=>[h+e[r].pos[0],d+e[r].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"rowAndCol")}})),r<this.leadModel.line?(this.createLeadName(t,e[r].pos[0],e[r].pos[1]-15),this.createLeadOffAndDel(t,e[r].pos[0]-5,e[r].pos[1]-(((o=this.formatEcgData)==null?void 0:o.sens)||0)/2-15)):(this.createLeadName(t,e[r].pos[0]+5,e[r].pos[1]-(((n=this.formatEcgData)==null?void 0:n.sens)||0)/2),this.createLeadOffAndDel(t,e[r].pos[0]-5,e[r].pos[1]-(((l=this.formatEcgData)==null?void 0:l.sens)||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,a,i=!1){var s;(s=this.leadHeadNameGroup)==null||s.add(new c.Text({style:{x:t,y:a,text:v.LeadNameTexts[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:W(C({},o),{name:v.LeadNameTexts[e],idx:e}),isAdd:i})},onclick:o=>{this.$emit("notiifyLeadName",{event:W(C({},o),{name:v.LeadNameTexts[e],idx:e}),isAdd:i})}}))}createLeadOffAndDel(e,t,a){var i;(this.isLeadOff(e)||this.isLeadDel(e))&&((i=this.leadHeadOffAndDelGroup)==null||i.add(new c.Text({cursor:"",style:{x:t,y:a,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}drawRulerNotes(){var i,s,o,n,l,r;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new c.Text({cursor:"",style:C({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.drawArea.height+this.bottomAreaHeight-25},e)}),a=new c.Text({style:C({text:`${((i=this.formatEcgData)==null?void 0:i.gainName)==="\u80F8\u5BFC\u51CF\u534A"?(s=this.formatEcgData)==null?void 0:s.gainName:`${(o=this.formatEcgData)==null?void 0:o.gain}mm/mV`} ${(n=this.formatEcgData)==null?void 0:n.speed}mm/s`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.drawArea.height+this.bottomAreaHeight-40},e)});(l=this.sceneIns)==null||l.add(a),(r=this.sceneIns)==null||r.add(t)}drawRuler(e=0){var o,n,l,r,h;if(!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let a=this.leadHeadConfig.leadHedeWidth,i=0,s=t;if(this.leadModel.isContinuous)s=t*5;else if(!this.leadModel.add&&((o=this.formatEcgData)==null?void 0:o.step)){const d=v.getPointIdxForPx(this.splitPoint,this.formatEcgData.step),m=v.getDataLenTimes(d,((n=this.formatEcgData)==null?void 0:n.processedData.otherParams.SampleRate)||0)/1e3;s=e+m}for(let d=e;d<=s;d=+(d+.1).toFixed(1))d!==e&&(a+=this.rulerStep),d%1===0?(i=this.canvasContainer.height-10,(l=this.rulerGroup)==null||l.add(new c.Text({cursor:"",style:{x:a,y:i-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):i=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.add(new c.Line({cursor:"",shape:{x1:a,y1:i,x2:a,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(h=this.sceneIns)==null||h.add(this.rulerGroup)}drawWaveFrom(){var e,t,a;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),(a=this.sceneIns)==null||a.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,r,h,d,m,u,p,D,y,A,H,F,x,G,S,E,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,a=0;this.leadModel.add?a=this.loopArrowY.add-(((r=this.formatEcgData)==null?void 0:r.sens)||0)-this.splitBlockHeight/3.5:a=20;let i=0,s=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let n=0;for(let P=0;P<(((h=this.formatEcgData)==null?void 0:h.heartBeatPosition)||[]).length;P++){const f=(d=this.formatEcgData)==null?void 0:d.heartBeatPosition[P];if(n=((f==null?void 0:f.position)||0)-e,!(e>((f==null?void 0:f.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&n>(this.slidingWindowInfo.points||0))){if(((f==null?void 0:f.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=n*(((m=this.formatEcgData)==null?void 0:m.step)||0)+this.leadHeadConfig.leadHedeWidth-9.5,s=0,(D=this.arrowGroup)==null||D.add(new c.Polygon({name:"arrow_box",shape:{points:[[4+t,0+a],[15+t,0+a],[15+t,10+a],[19+t,10+a],[9.5+t,22+a],[0+t,10+a],[4+t,10+a],[4+t,0+a]]},style:{fill:((p=(u=this.currentHeardBeat)==null?void 0:u.heardBeat)==null?void 0:p.index)===(f==null?void 0:f.index)?"blue":"#ccc"},onclick:L=>{var M;!this.heartFight.mode||(L.target.attr({style:{fill:"blue"}}),(M=this.arrowGroup)==null||M.children().filter(I=>I.name==="arrow_box").forEach(I=>{I.id!==L.target.id&&I.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(f,L.target))}})),this.heartFight.heartrate&&(i=((y=this.AssistCtx)==null?void 0:y.measureText(`${(f==null?void 0:f.heartrate)||""}`).width)||0,(A=this.arrowGroup)==null||A.add(new c.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.heartrate)||""}`},o)})),s+=12),this.heartFight.interval&&(i=((H=this.AssistCtx)==null?void 0:H.measureText(`${(f==null?void 0:f.interval)||""}`).width)||0,(F=this.arrowGroup)==null||F.add(new c.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.interval)||""}`},o)})),s+=12),this.heartFight.qrstCompany&&(i=((x=this.AssistCtx)==null?void 0:x.measureText(`${(f==null?void 0:f.qrstCompany)||""}`).width)||0,(G=this.arrowGroup)==null||G.add(new c.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.qrstCompany)||""}`},o)})),s+=12),this.heartFight.telectricalaxis&&(i=((S=this.AssistCtx)==null?void 0:S.measureText(`${(f==null?void 0:f.telectricalaxis)||""}`).width)||0,(E=this.arrowGroup)==null||E.add(new c.Text({cursor:"",style:C({x:4+t-i*1.5,y:s+a,text:`${(f==null?void 0:f.telectricalaxis)||""}`},o)})))}}(b=this.sceneIns)==null||b.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",c.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var n,l,r,h,d,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t=this.formatEcgData.processedData.otherParams.AnalyseValue[this.currentHeardBeat.heardBeat.index].KeyPosByBeat,a=0,i=this.getRednerPoints(),s=this.getAddRednerPoints(),o;for(const u in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(u)&&Object.prototype.hasOwnProperty.call(t,u)){a=(t[u]-this.slidingWindowInfo.startInd)*(((r=this.formatEcgData)==null?void 0:r.step)||0);e:for(let p=0;p<i.length;p++)if(!(this.isLeadOff(p)||this.isLeadDel(p))){if(e>t[u]||!this.leadModel.isContinuous&&t[u]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=i[p],this.leadModel.isContinuous&&p>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+a,o.pos[1]))}e:for(let p=0;p<s.length;p++)if(!(this.isLeadOff(this.longLeadConfig.leadIdxs[p])&&this.isLeadDel(this.longLeadConfig.leadIdxs[p]))){if(e>t[u])break e;o=s[p],(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(o.pos[0]+a,o.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,i=null,s=null}createHeardBeatLine(e,t){return new c.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}handleScroll(e,t,a){var i;if(t.type==="horizontal"){t.scrollLeft=t.scrollLeft||0;const s=v.getPointIdxForPx(t.scrollLeft,((i=this.formatEcgData)==null?void 0:i.step)||1);this.scrollWaveFrom(s),this.scrollRuler(s),this.scrollArrow(s),this.$emit("notifyScrollPointIdx",s)}}scrollWaveFrom(e){var i,s;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(),a=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=a,(i=this.rowAndColwaveFromGroup)==null||i.eachChild((o,n)=>{n=n||0,o.attr({shape:{points:t[n].data.map(([l,r])=>[l+t[n].pos[0],r+t[n].pos[1]])}})}),(s=this.addwaveFromGroup)==null||s.eachChild((o,n)=>{n=n||0,o.attr({shape:{points:a[n].data.map(([l,r])=>[l+a[n].pos[0],r+a[n].pos[1]])}})}),t=null,a=null}scrollRuler(e){var a,i,s;(a=this.rulerGroup)==null||a.removeAll(),(i=this.sceneIns)==null||i.remove(this.rulerGroup);const t=v.getDataLenTimes(e,((s=this.formatEcgData)==null?void 0:s.processedData.otherParams.SampleRate)||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,a;(t=this.arrowGroup)==null||t.removeAll(),(a=this.sceneIns)==null||a.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};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({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:()=>({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,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"vuescrollConfig",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:v.AnalysisMode.CompoundWave})],exports.default.prototype,"enlargeWaveMode",2);g([w.Prop({default:()=>[]})],exports.default.prototype,"gains",2);g([w.Prop({default:()=>[]})],exports.default.prototype,"speeds",2);g([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeInfo",2);g([v.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([_.default({name:"Methods"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.0.16-0",
3
+ "version": "1.0.18-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",