costy-plus 1.1.4-0 → 1.1.6-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.
@@ -15,7 +15,7 @@ import Q from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/nod
15
15
  import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
16
16
  import { Prop as w } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js";
17
17
  import { flattenDeep as U, max as Z, min as J } from "lodash";
18
- import { throttling as V, getStepForSpeed as H, getPrintLengthToPx as ee, getSens as x, getDataLenTimes as O, getPointIdxForPx as M, getActualY as L, calcMs as te, calcBpm as ie } from "@costy-plus/utils";
18
+ import { throttling as V, getStepForSpeed as M, getPrintLengthToPx as ee, getSens as x, getDataLenTimes as O, getPointIdxForPx as H, getActualY as L, calcMs as te, calcBpm as ie } from "@costy-plus/utils";
19
19
  import * as se from "zrender";
20
20
  import { Group as y, Polyline as R, Line as z, Text as W, Polygon as ae, util as oe } from "zrender";
21
21
  var ne = Object.defineProperty, le = Object.getOwnPropertyDescriptor, c = (e, t, i, s) => {
@@ -106,18 +106,18 @@ let u = class extends q {
106
106
  initSlidingWindowInfo() {
107
107
  const e = this.publicStep || 0, t = Math.ceil(this.splitPoint / e);
108
108
  if (this.slidingWindowInfo = {
109
- points: this.slidingWindowInfo.points <= t || this.leadModel.isSingleMode ? t : this.slidingWindowInfo.points,
109
+ points: this.slidingWindowInfo.points !== t || this.leadModel.isSingleMode ? t : this.slidingWindowInfo.points,
110
110
  startInd: this.slidingWindowInfo.startInd || 0,
111
- endInd: this.slidingWindowInfo.endInd <= t || this.leadModel.isSingleMode ? t : this.slidingWindowInfo.endInd
111
+ endInd: this.slidingWindowInfo.endInd !== t || this.leadModel.isSingleMode ? t : this.slidingWindowInfo.endInd
112
112
  }, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
113
- const s = H(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), a = this.dataTotalLength * s;
113
+ const s = M(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), a = this.dataTotalLength * s;
114
114
  this.vuescrollWH.width = this.canvasContainer.width + (a || 0) - this.splitPoint;
115
115
  }
116
116
  const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
117
117
  this.addSlidingWindowInfo = {
118
- points: this.addSlidingWindowInfo.points <= i || this.leadModel.isSingleMode ? i : this.addSlidingWindowInfo.points,
118
+ points: this.addSlidingWindowInfo.points !== i || this.leadModel.isSingleMode ? i : this.addSlidingWindowInfo.points,
119
119
  startInd: this.addSlidingWindowInfo.startInd || 0,
120
- endInd: this.addSlidingWindowInfo.endInd <= i || this.leadModel.isSingleMode ? i : this.addSlidingWindowInfo.endInd
120
+ endInd: this.addSlidingWindowInfo.endInd !== i || this.leadModel.isSingleMode ? i : this.addSlidingWindowInfo.endInd
121
121
  };
122
122
  }
123
123
  calcHighestAndLowestPoint() {
@@ -161,7 +161,7 @@ let u = class extends q {
161
161
  const i = ee(((t = this.waveConfigs[0]) == null ? void 0 : t.sampleRate) || 0) + this.leadHeadConfig.leadHedeWidth;
162
162
  i <= e && (e = i);
163
163
  } else if (this.leadModel.isContinuous) {
164
- const i = H(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), s = this.dataTotalLength * i;
164
+ const i = M(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), s = this.dataTotalLength * i;
165
165
  !this.leadModel.isSingleMode && (s || 0) < e - this.leadHeadConfig.leadHedeWidth && (e = (s || 0) + this.leadHeadConfig.leadHedeWidth);
166
166
  }
167
167
  this.drawArea = {
@@ -181,7 +181,7 @@ let u = class extends q {
181
181
  }, this.currentHeardBeat = {
182
182
  heardBeat: null,
183
183
  ele: null
184
- }, this.leadNameList = this.leadNames.map((i, s) => s) || [], this.totalRows = this.leadModel.line + this.leadModel.add || 1, this.highestAndLowestPoint = this.calcHighestAndLowestPoint(), this.leadModel.isSingleMode ? (this.splitBlockHeight = Math.abs(this.highestAndLowestPoint.maxPoints) + Math.abs(this.highestAndLowestPoint.minPoints) + 22, this.splitBlockHeight > this.drawArea.height && (this.splitBlockHeight = this.drawArea.height / 6)) : this.splitBlockHeight = this.drawArea.height / this.totalRows, this.publicStep = H(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), this.rulerStep = (this.publicStep || 1) * (this.leadModel.publicSampleRate || 1) / (this.gridConfig.cellMg * 2 + 2);
184
+ }, this.leadNameList = this.leadNames.map((i, s) => s) || [], this.totalRows = this.leadModel.line + this.leadModel.add || 1, this.highestAndLowestPoint = this.calcHighestAndLowestPoint(), this.leadModel.isSingleMode ? (this.splitBlockHeight = Math.abs(this.highestAndLowestPoint.maxPoints) + Math.abs(this.highestAndLowestPoint.minPoints) + 22, this.splitBlockHeight > this.drawArea.height && (this.splitBlockHeight = this.drawArea.height / 6)) : this.splitBlockHeight = this.drawArea.height / this.totalRows, this.publicStep = M(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), this.rulerStep = (this.publicStep || 1) * (this.leadModel.publicSampleRate || 1) / (this.gridConfig.cellMg * 2 + 2);
185
185
  }
186
186
  initWaveFormPeer() {
187
187
  var i;
@@ -289,7 +289,7 @@ let u = class extends q {
289
289
  (o = this.splitLineGroup) == null || o.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup);
290
290
  const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
291
291
  if (this.splitPoint = e, this.leadModel.isSingleMode) {
292
- const r = H(
292
+ const r = M(
293
293
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
294
294
  this.gridConfig.cellMg,
295
295
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
@@ -306,8 +306,6 @@ let u = class extends q {
306
306
  for (let f = 1; f <= this.leadModel.line; f++) {
307
307
  if (!(this.waveConfigs || [])[f - 1 + i])
308
308
  break e;
309
- if ((this.waveConfigs || [])[f - 1 + i].isShowLeadHead)
310
- continue e;
311
309
  if ((this.waveConfigs || [])[f - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[f - 1 + i].posX), s = (this.waveConfigs || [])[f - 1 + i].leadIdx, s === void 0)
312
310
  break;
313
311
  a = x((this.waveConfigs || [])[f - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[f - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (d = this.splitLineGroup) == null || d.add(
@@ -373,11 +371,11 @@ let u = class extends q {
373
371
  return;
374
372
  const t = this.dataTotalTimes / 1e3;
375
373
  let i = this.leadHeadConfig.leadHedeWidth, s = 0, a = t;
376
- const o = H(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
374
+ const o = M(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
377
375
  if (this.leadModel.isContinuous)
378
376
  a = t * 5;
379
377
  else if (!this.leadModel.add && o) {
380
- const l = M(this.splitPoint, o), r = O(l, this.rulerConfig.sampleRate || 0) / 1e3;
378
+ const l = H(this.splitPoint * (this.leadModel.column || 1), o), r = O(l, this.rulerConfig.sampleRate || 0) / 1e3;
381
379
  a = e + r;
382
380
  }
383
381
  for (let l = e; l <= a; l = +(l + 0.1).toFixed(1))
@@ -414,7 +412,7 @@ let u = class extends q {
414
412
  let e = 0, t = 0;
415
413
  const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
416
414
  let s = this.slidingWindowInfo.startInd || 0, a = this.slidingWindowInfo.endInd || 0;
417
- const o = H(
415
+ const o = M(
418
416
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
419
417
  this.gridConfig.cellMg,
420
418
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
@@ -498,7 +496,7 @@ let u = class extends q {
498
496
  fontFamily: this.fontFamily
499
497
  };
500
498
  let n = 0, d = 0;
501
- const h = H(
499
+ const h = M(
502
500
  this.waveConfigs[this.heartFight.showIdxPai].speed,
503
501
  this.gridConfig.cellMg,
504
502
  this.waveConfigs[this.heartFight.showIdxPai].sampleRate
@@ -668,7 +666,7 @@ let u = class extends q {
668
666
  const e = [];
669
667
  let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, a = [], o = 0, n = 0;
670
668
  for (let d = 0; d < this.leadModel.add; d++)
671
- s = this.longLeadConfig.leadIdxs[d], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, o = H(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = x(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (d + this.leadModel.line + 1) * this.splitBlockHeight, a = this.waveLists[s] || [], d === 0 && (this.loopArrowY.add = i), e.push({
669
+ s = this.longLeadConfig.leadIdxs[d], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, o = M(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = x(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (d + this.leadModel.line + 1) * this.splitBlockHeight, a = this.waveLists[s] || [], d === 0 && (this.loopArrowY.add = i), e.push({
672
670
  pos: [t, i],
673
671
  startInd: this.addSlidingWindowInfo.startInd || 0,
674
672
  endInd: this.addSlidingWindowInfo.endInd || 0,
@@ -713,7 +711,7 @@ let u = class extends q {
713
711
  for (let l = 0; l < this.leadModel.column; l++) {
714
712
  e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && l > 0 && (n = d, d = n + (this.slidingWindowInfo.points || 0));
715
713
  for (let r = 1; r <= this.leadModel.line && (t = r * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); r++)
716
- e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = H(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), o = x(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), h.push({
714
+ e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = M(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), o = x(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), h.push({
717
715
  pos: [e, t],
718
716
  startInd: n,
719
717
  endInd: d,
@@ -805,7 +803,7 @@ let u = class extends q {
805
803
  e.event.preventDefault(), e.event.stopPropagation(), console.log("onContextmenu", e);
806
804
  const i = e.target.name.split("_"), s = +i[1];
807
805
  let a = 0, o = 0, n = 0, d = 0, h = 0;
808
- t === "single" ? (a = e.offsetX - this.singleWaveDataCopy[s].pos[0], o = this.singleWaveDataCopy[s].startInd, n = M(a, this.singleWaveDataCopy[s].step || 1), d = this.singleWaveDataCopy[s].sens, h = this.singleWaveDataCopy[s].step) : t === "rowAndCol" ? (a = e.offsetX - this.waveDataCopy[s].pos[0], o = this.waveDataCopy[s].startInd || 0, n = M(a, this.waveDataCopy[s].step || 1), d = this.waveDataCopy[s].sens, h = this.waveDataCopy[s].step) : t === "add" && (a = e.offsetX - this.addWaveDataCopy[s].pos[0], o = this.addWaveDataCopy[s].startInd || 0, n = M(a, this.addWaveDataCopy[s].step || 1), d = this.addWaveDataCopy[s].sens, h = this.addWaveDataCopy[s].step), n += o, this.$emit("notifyOnContextmenu", {
806
+ t === "single" ? (a = e.offsetX - this.singleWaveDataCopy[s].pos[0], o = this.singleWaveDataCopy[s].startInd, n = H(a, this.singleWaveDataCopy[s].step || 1), d = this.singleWaveDataCopy[s].sens, h = this.singleWaveDataCopy[s].step) : t === "rowAndCol" ? (a = e.offsetX - this.waveDataCopy[s].pos[0], o = this.waveDataCopy[s].startInd || 0, n = H(a, this.waveDataCopy[s].step || 1), d = this.waveDataCopy[s].sens, h = this.waveDataCopy[s].step) : t === "add" && (a = e.offsetX - this.addWaveDataCopy[s].pos[0], o = this.addWaveDataCopy[s].startInd || 0, n = H(a, this.addWaveDataCopy[s].step || 1), d = this.addWaveDataCopy[s].sens, h = this.addWaveDataCopy[s].step), n += o, this.$emit("notifyOnContextmenu", {
809
807
  sens: d,
810
808
  step: h,
811
809
  activeLeadIdx: +i[0],
@@ -823,7 +821,7 @@ let u = class extends q {
823
821
  this.activeLeadIdx = +a[0];
824
822
  const o = +a[1];
825
823
  let n = 0, d = 0, h = 0, l = 0, r = 0;
826
- t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[o].pos[0], d = this.singleWaveDataCopy[o].startInd, h = M(n, this.singleWaveDataCopy[o].step || 1), l = this.singleWaveDataCopy[o].sens, r = this.singleWaveDataCopy[o].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[o].pos[0], d = this.waveDataCopy[o].startInd || 0, h = M(n, this.waveDataCopy[o].step || 1), l = this.waveDataCopy[o].sens, r = this.waveDataCopy[o].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[o].pos[0], d = this.addWaveDataCopy[o].startInd || 0, h = M(n, this.addWaveDataCopy[o].step || 1), l = this.addWaveDataCopy[o].sens, r = this.addWaveDataCopy[o].step), h += d, this.$emit("notifyActiveEnlargr", {
824
+ t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[o].pos[0], d = this.singleWaveDataCopy[o].startInd, h = H(n, this.singleWaveDataCopy[o].step || 1), l = this.singleWaveDataCopy[o].sens, r = this.singleWaveDataCopy[o].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[o].pos[0], d = this.waveDataCopy[o].startInd || 0, h = H(n, this.waveDataCopy[o].step || 1), l = this.waveDataCopy[o].sens, r = this.waveDataCopy[o].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[o].pos[0], d = this.addWaveDataCopy[o].startInd || 0, h = H(n, this.addWaveDataCopy[o].step || 1), l = this.addWaveDataCopy[o].sens, r = this.addWaveDataCopy[o].step), h += d, this.$emit("notifyActiveEnlargr", {
827
825
  sens: l,
828
826
  step: r,
829
827
  activeLeadIdx: this.activeLeadIdx,
@@ -839,7 +837,7 @@ let u = class extends q {
839
837
  t.type === "horizontal" && (t.scrollLeft = t.scrollLeft || 0, this.scrollCommon(t.scrollLeft));
840
838
  }
841
839
  scrollCommon(e) {
842
- const t = M(e, this.publicStep || 1);
840
+ const t = H(e, this.publicStep || 1);
843
841
  this.scrollWaveFrom(t), this.scrollRuler(t), this.scrollArrow(t), this.$emit("notifyScrollPointIdx", {
844
842
  slidIdxs: t,
845
843
  scrollLeft: e