costy-plus 1.0.73-0 → 1.0.76-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.
@@ -5,7 +5,7 @@ import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-componen
5
5
  import { Watch as o } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js";
6
6
  import d from "../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.16/node_modules/vuescroll/dist/vuescroll-native.js";
7
7
  import m from "../BackgroundGrid/index2.js";
8
- import g from "../MeasuringRulerMore/index2.js";
8
+ import g from "../MeasuringRuler/index2.js";
9
9
  import f from "../ParallelRuler/index2.js";
10
10
  import w from "../MagnifierWave/index.js";
11
11
  import u from "../EnlargeWave/index2.js";
@@ -85,7 +85,7 @@ r = a([
85
85
  components: {
86
86
  vueScroll: d,
87
87
  MXBackgroundGrid: m,
88
- MeasuringRulerMore: g,
88
+ MeasuringRuler: g,
89
89
  MXParallelRuler: f,
90
90
  MXMagnifierWave: w,
91
91
  MXEnlargeWave: u
@@ -15,7 +15,7 @@ var C = function() {
15
15
  "grid-config": a.gridConfig,
16
16
  "layer-id": "MXGrid"
17
17
  }
18
- }), a.measurRulerConfig.isShow ? e("MeasuringRulerMore", a._g({
18
+ }), a.measurRulerConfig.isShow ? e("MeasuringRuler", a._g({
19
19
  staticClass: "measuring-ruler",
20
20
  attrs: {
21
21
  config: a.measurRulerConfig.config,
@@ -60,26 +60,26 @@ let u = class extends I {
60
60
  }), (t = this.sceneIns) == null || t.add(this.measuringRulerGroup), this.sceneAddToEventListener(), this.rectAddToEventListener(), this.circleAddToEventListener();
61
61
  }
62
62
  calcText() {
63
- var i, n, c, a, o, m, h, l, d;
63
+ var i, n, c, a, o, m, h, l, d, x;
64
64
  let e, t = 0, s = "", r = 0;
65
65
  for (let p = 0; p < this.rectInsList.length; p++)
66
- if (e = this.rectInsList[p], ((i = e.react) == null ? void 0 : i.name) === this.moveReactName) {
66
+ if (e = this.rectInsList[p], ((i = e.react) == null ? void 0 : i.name) === this.moveReactName && ((n = e.react) == null ? void 0 : n.shape.width)) {
67
67
  t = C(
68
- ((n = e.react) == null ? void 0 : n.shape.width) || 0,
68
+ ((c = e.react) == null ? void 0 : c.shape.width) || 0,
69
69
  this.speedValue,
70
70
  this.cellMg,
71
71
  this.magnification
72
72
  ), s = M(
73
- ((c = e.react) == null ? void 0 : c.shape.height) || 0,
73
+ ((a = e.react) == null ? void 0 : a.shape.height) || 0,
74
74
  this.sens,
75
75
  this.magnification
76
- ), r = t !== 0 && z(t) || 0, (d = e.text) == null || d.attr({
76
+ ), r = t !== 0 && z(t) || 0, (x = e.text) == null || x.attr({
77
77
  style: {
78
78
  text: `${t} ms
79
79
  ${r} bpm
80
80
  ${s} mV`,
81
- x: (((a = e.react) == null ? void 0 : a.x) || 0) + (((o = e.react) == null ? void 0 : o.shape.x) || 0) + (((m = e.react) == null ? void 0 : m.shape.width) || 0) + 20,
82
- y: (((h = e.react) == null ? void 0 : h.y) || 0) + (((l = e.react) == null ? void 0 : l.shape.y) || 0)
81
+ x: (((o = e.react) == null ? void 0 : o.x) || 0) + (((m = e.react) == null ? void 0 : m.shape.x) || 0) + (((h = e.react) == null ? void 0 : h.shape.width) || 0) + 20,
82
+ y: (((l = e.react) == null ? void 0 : l.y) || 0) + (((d = e.react) == null ? void 0 : d.shape.y) || 0)
83
83
  }
84
84
  });
85
85
  break;
@@ -198,11 +198,11 @@ let u = class extends I {
198
198
  t = null;
199
199
  }
200
200
  scenemouseup(e) {
201
- var s, r, i, n, c, a, o, m, h, l, d, p, y, L;
201
+ var s, r, i, n, c, a, o, m, h, l, d, x, p, L;
202
202
  this.isMouseDown = !1;
203
203
  let t;
204
- for (let x = 0; x < this.rectInsList.length; x++)
205
- if (t = this.rectInsList[x], ((s = t.react) == null ? void 0 : s.name) === this.moveReactName) {
204
+ for (let y = 0; y < this.rectInsList.length; y++)
205
+ if (t = this.rectInsList[y], ((s = t.react) == null ? void 0 : s.name) === this.moveReactName) {
206
206
  (r = t.react) == null || r.attr({
207
207
  shape: {
208
208
  width: e.offsetX - t.react.shape.x,
@@ -218,8 +218,8 @@ let u = class extends I {
218
218
  x: e.offsetX - (((m = t.react) == null ? void 0 : m.shape.x) || 0) + (((h = t.react) == null ? void 0 : h.shape.x) || 0),
219
219
  y: e.offsetY - (((l = t.react) == null ? void 0 : l.shape.y) || 0) + (((d = t.react) == null ? void 0 : d.shape.y) || 0)
220
220
  }), t.circleList[3].attr({
221
- x: (p = t.react) == null ? void 0 : p.shape.x,
222
- y: e.offsetY - (((y = t.react) == null ? void 0 : y.shape.y) || 0) + (((L = t.react) == null ? void 0 : L.shape.y) || 0)
221
+ x: (x = t.react) == null ? void 0 : x.shape.x,
222
+ y: e.offsetY - (((p = t.react) == null ? void 0 : p.shape.y) || 0) + (((L = t.react) == null ? void 0 : L.shape.y) || 0)
223
223
  }), this.calcText(), this.circleHideOrShow(!0);
224
224
  break;
225
225
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const l=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const o=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),c=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.16/node_modules/vuescroll/dist/vuescroll-native.js"),u=require("../BackgroundGrid/index2.js"),h=require("../MeasuringRulerMore/index2.js"),p=require("../ParallelRuler/index2.js"),v=require("../MagnifierWave/index.js"),f=require("../EnlargeWave/index2.js"),g=require("./method.js");var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,a=(e,t,s,n)=>{for(var r=n>1?void 0:n?w(t,s):t,i=e.length-1,d;i>=0;i--)(d=e[i])&&(r=(n?d(t,s,r):d(r))||r);return n&&r&&m(t,s,r),r};exports.default=class extends l.mixins(g.default){watchFormatEcgData(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchVuescrollConfig(){this.repaint()}watchLeadHeadConfig(){var e,t;(e=this.leadHeadGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchHeartFight(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}mounted(){this.init()}repaint(){var e,t;(e=this.sceneIns)==null||e.clear(),(t=this.sceneIns)==null||t.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.combinationDrawing()}};a([o.Watch("formatEcgData",{deep:!0})],exports.default.prototype,"watchFormatEcgData",1);a([o.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);a([o.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);a([o.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);a([o.Watch("width")],exports.default.prototype,"watchWidth",1);a([o.Watch("height")],exports.default.prototype,"watchHeight",1);a([o.Watch("singleModeInfo",{deep:!0})],exports.default.prototype,"watchHeartFight",1);a([o.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);exports.default=a([l.default({name:"ECGWaveForm",components:{vueScroll:c.default,MXBackgroundGrid:u.default,MeasuringRulerMore:h.default,MXParallelRuler:p.default,MXMagnifierWave:v.default,MXEnlargeWave:f.default}})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const l=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const o=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),c=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.16/node_modules/vuescroll/dist/vuescroll-native.js"),u=require("../BackgroundGrid/index2.js"),h=require("../MeasuringRuler/index2.js"),p=require("../ParallelRuler/index2.js"),v=require("../MagnifierWave/index.js"),f=require("../EnlargeWave/index2.js"),g=require("./method.js");var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,a=(e,t,s,n)=>{for(var r=n>1?void 0:n?w(t,s):t,i=e.length-1,d;i>=0;i--)(d=e[i])&&(r=(n?d(t,s,r):d(r))||r);return n&&r&&m(t,s,r),r};exports.default=class extends l.mixins(g.default){watchFormatEcgData(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchVuescrollConfig(){this.repaint()}watchLeadHeadConfig(){var e,t;(e=this.leadHeadGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchHeartFight(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}mounted(){this.init()}repaint(){var e,t;(e=this.sceneIns)==null||e.clear(),(t=this.sceneIns)==null||t.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.combinationDrawing()}};a([o.Watch("formatEcgData",{deep:!0})],exports.default.prototype,"watchFormatEcgData",1);a([o.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);a([o.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);a([o.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);a([o.Watch("width")],exports.default.prototype,"watchWidth",1);a([o.Watch("height")],exports.default.prototype,"watchHeight",1);a([o.Watch("singleModeInfo",{deep:!0})],exports.default.prototype,"watchHeartFight",1);a([o.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);exports.default=a([l.default({name:"ECGWaveForm",components:{vueScroll:c.default,MXBackgroundGrid:u.default,MeasuringRuler:h.default,MXParallelRuler:p.default,MXMagnifierWave:v.default,MXEnlargeWave:f.default}})],exports.default);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var C=function(){var t,i,l,o,r,s,n,d,g,v,c,h,m,f,a=this,p=a.$createElement,e=a._self._c||p;return e("div",{style:{width:`${a.width}px`,height:`${a.height}px`},attrs:{id:"ecg-wave-form-main"}},[e("MXBackgroundGrid",{attrs:{width:a.canvasContainer.width,height:a.canvasContainer.height,"grid-config":a.gridConfig,"layer-id":"MXGrid"}}),a.measurRulerConfig.isShow?e("MeasuringRulerMore",a._g({staticClass:"measuring-ruler",attrs:{config:a.measurRulerConfig.config,width:a.canvasContainer.width,height:a.canvasContainer.height,"cell-mg":a.gridConfig.cellMg,"speed-value":((t=a.formatEcgData)===null||t===void 0?void 0:t.speed)||0,sens:a.formatEcgData.sens}},a.$listeners)):a._e(),a.paralleRulerConfig.isShow?e("MXParallelRuler",a._g({staticClass:"parallel-ruler",attrs:{width:a.canvasContainer.width,height:a.canvasContainer.height,"cell-mg":a.gridConfig.cellMg,"speed-value":((i=a.formatEcgData)===null||i===void 0?void 0:i.speed)||0,sens:a.formatEcgData.sens,"heart-rate":a.ventricularRate}},a.$listeners)):a._e(),a.magnifierRulerConfig.isShow?e("MXMagnifierWave",{staticClass:"magnifier-wave",attrs:{width:a.canvasContainer.width,height:a.canvasContainer.height,"grid-config":a.gridConfig,"speed-value":((l=a.formatEcgData)===null||l===void 0?void 0:l.speed)||0,sens:a.formatEcgData.sens,step:((o=a.formatEcgData)===null||o===void 0?void 0:o.step)||0,"lead-head-config":a.leadHeadConfig,"wave-data":a.waveDataCopy,"add-wave-data":a.addWaveDataCopy,"single-wave-data":a.singleWaveDataCopy,"long-lead-config":a.longLeadConfig,"split-block-height":a.splitBlockHeight,"split-point":a.splitPoint,"lead-config":a.leadConfig,"heart-fight":a.heartFight,"normal-lead-names":((r=a.formatEcgData)===null||r===void 0?void 0:r.processedData.otherParams.LeadName)||[]}}):a._e(),a.isShowEnlargeWave?e("MXEnlargeWave",a._g({staticClass:"enlarge-wave",attrs:{"is-show-enlarge-wave":a.isShowEnlargeWave,width:a.MXEnlargeWaveWH.width,height:a.MXEnlargeWaveWH.height,"grid-config":a.gridConfig,"speed-value":((s=a.formatEcgData)===null||s===void 0?void 0:s.speed)||0,sens:a.formatEcgData.sens,step:((n=a.formatEcgData)===null||n===void 0?void 0:n.step)||0,"sample-rate":((d=a.formatEcgData)===null||d===void 0?void 0:d.processedData.otherParams.SampleRate)||0,sensitivity:((g=a.formatEcgData)===null||g===void 0?void 0:g.processedData.otherParams.Sensitivity)||0,"normal-data":((v=a.formatEcgData)===null||v===void 0?void 0:v.processedData.originData.Data)||[],"complex-data":((c=a.formatEcgData)===null||c===void 0?void 0:c.processedData.originData.ComplexData)||[],"lead-name-list":a.leadNameList,"lead-head-config":a.leadHeadConfig,"active-lead-idx":a.activeLeadIdx,"active-lead-analyse-value":a.activeLeadAnalyseValue,"analyse-value":((h=a.formatEcgData)===null||h===void 0?void 0:h.processedData.otherParams.AnalyseValue)||[],"enlarge-wave-mode":a.enlargeWaveMode,"q-td-algorithm":((m=a.conventionalECGConfig)===null||m===void 0||(f=m.ecgReviewSetting)===null||f===void 0?void 0:f.QTd_algorithm)||1,"is-sync-analyse-value-check":a.isSyncAnalyseValueCheck,"enlarge-gains":a.enlargeGains,"lead-name-texts-porps":a.LeadNameTextsPorps,"enlarge-speeds":a.enlargeSpeeds},on:{"update:isShowEnlargeWave":function(u){a.isShowEnlargeWave=u},"update:is-show-enlarge-wave":function(u){a.isShowEnlargeWave=u}}},a.$listeners)):a._e(),e("div",{attrs:{id:"wave-from-box"}}),e("div",{staticClass:"scroll-box",style:{width:`${a.width}px`,height:`${a.height}px`}},[a.scrollConfig.isNativeScroll?e("div",{ref:"nativeScroll",staticClass:"native-scroll",on:{scroll:a.nativeScrollFunc}},[e("div",{staticClass:"scroll-empty",style:{width:`${a.vuescrollWH.width}px`,height:`${a.vuescrollWH.height}px`}})]):e("vueScroll",{ref:"vueScroll",attrs:{ops:a.scrollConfig},on:{"handle-scroll":a.handleScroll}},[e("div",{staticClass:"scroll-empty",style:{width:`${a.vuescrollWH.width}px`,height:`${a.vuescrollWH.height}px`}})])],1)],1)},D=[];exports.render=C;exports.staticRenderFns=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var C=function(){var t,i,l,o,r,s,n,d,g,v,c,h,m,f,a=this,p=a.$createElement,e=a._self._c||p;return e("div",{style:{width:`${a.width}px`,height:`${a.height}px`},attrs:{id:"ecg-wave-form-main"}},[e("MXBackgroundGrid",{attrs:{width:a.canvasContainer.width,height:a.canvasContainer.height,"grid-config":a.gridConfig,"layer-id":"MXGrid"}}),a.measurRulerConfig.isShow?e("MeasuringRuler",a._g({staticClass:"measuring-ruler",attrs:{config:a.measurRulerConfig.config,width:a.canvasContainer.width,height:a.canvasContainer.height,"cell-mg":a.gridConfig.cellMg,"speed-value":((t=a.formatEcgData)===null||t===void 0?void 0:t.speed)||0,sens:a.formatEcgData.sens}},a.$listeners)):a._e(),a.paralleRulerConfig.isShow?e("MXParallelRuler",a._g({staticClass:"parallel-ruler",attrs:{width:a.canvasContainer.width,height:a.canvasContainer.height,"cell-mg":a.gridConfig.cellMg,"speed-value":((i=a.formatEcgData)===null||i===void 0?void 0:i.speed)||0,sens:a.formatEcgData.sens,"heart-rate":a.ventricularRate}},a.$listeners)):a._e(),a.magnifierRulerConfig.isShow?e("MXMagnifierWave",{staticClass:"magnifier-wave",attrs:{width:a.canvasContainer.width,height:a.canvasContainer.height,"grid-config":a.gridConfig,"speed-value":((l=a.formatEcgData)===null||l===void 0?void 0:l.speed)||0,sens:a.formatEcgData.sens,step:((o=a.formatEcgData)===null||o===void 0?void 0:o.step)||0,"lead-head-config":a.leadHeadConfig,"wave-data":a.waveDataCopy,"add-wave-data":a.addWaveDataCopy,"single-wave-data":a.singleWaveDataCopy,"long-lead-config":a.longLeadConfig,"split-block-height":a.splitBlockHeight,"split-point":a.splitPoint,"lead-config":a.leadConfig,"heart-fight":a.heartFight,"normal-lead-names":((r=a.formatEcgData)===null||r===void 0?void 0:r.processedData.otherParams.LeadName)||[]}}):a._e(),a.isShowEnlargeWave?e("MXEnlargeWave",a._g({staticClass:"enlarge-wave",attrs:{"is-show-enlarge-wave":a.isShowEnlargeWave,width:a.MXEnlargeWaveWH.width,height:a.MXEnlargeWaveWH.height,"grid-config":a.gridConfig,"speed-value":((s=a.formatEcgData)===null||s===void 0?void 0:s.speed)||0,sens:a.formatEcgData.sens,step:((n=a.formatEcgData)===null||n===void 0?void 0:n.step)||0,"sample-rate":((d=a.formatEcgData)===null||d===void 0?void 0:d.processedData.otherParams.SampleRate)||0,sensitivity:((g=a.formatEcgData)===null||g===void 0?void 0:g.processedData.otherParams.Sensitivity)||0,"normal-data":((v=a.formatEcgData)===null||v===void 0?void 0:v.processedData.originData.Data)||[],"complex-data":((c=a.formatEcgData)===null||c===void 0?void 0:c.processedData.originData.ComplexData)||[],"lead-name-list":a.leadNameList,"lead-head-config":a.leadHeadConfig,"active-lead-idx":a.activeLeadIdx,"active-lead-analyse-value":a.activeLeadAnalyseValue,"analyse-value":((h=a.formatEcgData)===null||h===void 0?void 0:h.processedData.otherParams.AnalyseValue)||[],"enlarge-wave-mode":a.enlargeWaveMode,"q-td-algorithm":((m=a.conventionalECGConfig)===null||m===void 0||(f=m.ecgReviewSetting)===null||f===void 0?void 0:f.QTd_algorithm)||1,"is-sync-analyse-value-check":a.isSyncAnalyseValueCheck,"enlarge-gains":a.enlargeGains,"lead-name-texts-porps":a.LeadNameTextsPorps,"enlarge-speeds":a.enlargeSpeeds},on:{"update:isShowEnlargeWave":function(u){a.isShowEnlargeWave=u},"update:is-show-enlarge-wave":function(u){a.isShowEnlargeWave=u}}},a.$listeners)):a._e(),e("div",{attrs:{id:"wave-from-box"}}),e("div",{staticClass:"scroll-box",style:{width:`${a.width}px`,height:`${a.height}px`}},[a.scrollConfig.isNativeScroll?e("div",{ref:"nativeScroll",staticClass:"native-scroll",on:{scroll:a.nativeScrollFunc}},[e("div",{staticClass:"scroll-empty",style:{width:`${a.vuescrollWH.width}px`,height:`${a.vuescrollWH.height}px`}})]):e("vueScroll",{ref:"vueScroll",attrs:{ops:a.scrollConfig},on:{"handle-scroll":a.handleScroll}},[e("div",{staticClass:"scroll-empty",style:{width:`${a.vuescrollWH.width}px`,height:`${a.vuescrollWH.height}px`}})])],1)],1)},D=[];exports.render=C;exports.staticRenderFns=D;
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const I=require("vue"),R=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const m=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),p=require("zrender"),x=require("@costy-plus/utils"),b=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},D=b(I);var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,u=(e,t,s,r)=>{for(var i=r>1?void 0:r?_(t,s):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(r?c(t,s,i):c(i))||i);return r&&i&&w(t,s,i),i};exports.default=class extends D.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectInsList=Object.freeze([]),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.isMouseDown=Object.freeze(!1),this.moveReactName=Object.freeze("")}destroyed(){var e,t;(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.dispose()}created(){this.rectInsList=[],this.measuringRulerGroup=new p.Group({name:"measuringRuler"}),this.initConfig()}clearCanvas(){var e,t;this.rectInsList=[],(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.measuringRulerGroup)}initConfig(){var e;(e=this.measuringRulerGroup)==null||e.add(new p.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"}))}mounted(){this.init()}init(){var t;const e=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=p.init(e,{width:this.width,height:this.height,devicePixelRatio:2}),(t=this.sceneIns)==null||t.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var i,o,c,a,n,f,l,h,g;let e,t=0,s="",r=0;for(let d=0;d<this.rectInsList.length;d++)if(e=this.rectInsList[d],((i=e.react)==null?void 0:i.name)===this.moveReactName){t=x.calcMs(((o=e.react)==null?void 0:o.shape.width)||0,this.speedValue,this.cellMg,this.magnification),s=x.calcMV(((c=e.react)==null?void 0:c.shape.height)||0,this.sens,this.magnification),r=t!==0&&x.calcBpm(t)||0,(g=e.text)==null||g.attr({style:{text:`${t} ms
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const I=require("vue"),R=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const m=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),p=require("zrender"),y=require("@costy-plus/utils"),b=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},w=b(I);var D=Object.defineProperty,_=Object.getOwnPropertyDescriptor,u=(e,t,s,r)=>{for(var i=r>1?void 0:r?_(t,s):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(r?c(t,s,i):c(i))||i);return r&&i&&D(t,s,i),i};exports.default=class extends w.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectInsList=Object.freeze([]),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.isMouseDown=Object.freeze(!1),this.moveReactName=Object.freeze("")}destroyed(){var e,t;(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.dispose()}created(){this.rectInsList=[],this.measuringRulerGroup=new p.Group({name:"measuringRuler"}),this.initConfig()}clearCanvas(){var e,t;this.rectInsList=[],(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.measuringRulerGroup)}initConfig(){var e;(e=this.measuringRulerGroup)==null||e.add(new p.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"}))}mounted(){this.init()}init(){var t;const e=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=p.init(e,{width:this.width,height:this.height,devicePixelRatio:2}),(t=this.sceneIns)==null||t.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var i,o,c,a,n,f,l,h,g,v;let e,t=0,s="",r=0;for(let d=0;d<this.rectInsList.length;d++)if(e=this.rectInsList[d],((i=e.react)==null?void 0:i.name)===this.moveReactName&&((o=e.react)==null?void 0:o.shape.width)){t=y.calcMs(((c=e.react)==null?void 0:c.shape.width)||0,this.speedValue,this.cellMg,this.magnification),s=y.calcMV(((a=e.react)==null?void 0:a.shape.height)||0,this.sens,this.magnification),r=t!==0&&y.calcBpm(t)||0,(v=e.text)==null||v.attr({style:{text:`${t} ms
2
2
  ${r} bpm
3
- ${s} mV`,x:(((a=e.react)==null?void 0:a.x)||0)+(((n=e.react)==null?void 0:n.shape.x)||0)+(((f=e.react)==null?void 0:f.shape.width)||0)+20,y:(((l=e.react)==null?void 0:l.y)||0)+(((h=e.react)==null?void 0:h.shape.y)||0)}});break}e=null}circleHideOrShow(e){var s;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach(i=>e?i.show():i.hide());break}t=null}sceneAddToEventListener(){var t,s,r,i;const e=o=>{var c;o.event.preventDefault(),this.clearCanvas(),this.initConfig(),(c=this.sceneIns)==null||c.add(this.measuringRulerGroup),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})};(t=this.sceneIns)==null||t.on("contextmenu",e),(s=this.sceneIns)==null||s.on("mousedown",this.sceneMousedown),(r=this.sceneIns)==null||r.on("mousemove",this.scenemousemove),(i=this.sceneIns)==null||i.on("mouseup",this.scenemouseup),this.$once("hook:beforeDestroy",()=>{var o,c,a,n;(o=this.sceneIns)==null||o.off("contextmenu",e),(c=this.sceneIns)==null||c.off("mousedown",this.sceneMousedown),(a=this.sceneIns)==null||a.off("mousemove",this.scenemousemove),(n=this.sceneIns)==null||n.off("mouseup",this.scenemouseup)})}sceneRemoveEventListener(){var e,t,s;(e=this.sceneIns)==null||e.off("mousedown",this.sceneMousedown),(t=this.sceneIns)==null||t.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}createRectBox(e,t,s){this.moveReactName=e;const r=new p.Rect({name:e,style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:t,y:s},ondrag:this.rectDrag,cursor:"move",draggable:!0}),i=new p.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),o=[];let c;const a=["nw-resize","ne-resize","se-resize","sw-resize"];for(let n=0;n<4;n++)c=new p.Circle({name:`${n}_circle`,customName:e,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:a[n],zlevel:1,draggable:!0,ondrag:this.circleDrag,ondragstart:this.circleDragStart}),c.hide(),this.measuringRulerGroup.add(c),o.push(c);return this.measuringRulerGroup.add(i),this.measuringRulerGroup.add(r),{react:r,text:i,circleList:o,circleDragPos:{x:0,y:0}}}sceneMousedown(e){var t;if(console.log("sceneMousedown",e),e.event.button===0)if(this.isMouseDown=!0,this.rectInsList.length===0)this.rectInsList.push(this.createRectBox("react_1",e.offsetX,e.offsetY));else{let s=!1,r;for(let i=0;i<this.rectInsList.length&&(r=this.rectInsList[i],s=((t=r.react)==null?void 0:t.contain(e.offsetX,e.offsetY))||!1,!s);i++);r=null,s||this.rectInsList.push(this.createRectBox(`react_${this.rectInsList.length+1}`,e.offsetX,e.offsetY)),console.log("isContain",s)}}scenemousemove(e){var s,r;if(!this.isMouseDown)return;let t;for(let i=0;i<this.rectInsList.length;i++)if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}});break}t=null}scenemouseup(e){var s,r,i,o,c,a,n,f,l,h,g,d,y,L;this.isMouseDown=!1;let t;for(let v=0;v<this.rectInsList.length;v++)if(t=this.rectInsList[v],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}}),t.circleList[0].attr({x:(i=t.react)==null?void 0:i.shape.x,y:(o=t.react)==null?void 0:o.shape.y}),t.circleList[1].attr({x:e.offsetX-(((c=t.react)==null?void 0:c.shape.x)||0)+(((a=t.react)==null?void 0:a.shape.x)||0),y:(n=t.react)==null?void 0:n.shape.y}),t.circleList[2].attr({x:e.offsetX-(((f=t.react)==null?void 0:f.shape.x)||0)+(((l=t.react)==null?void 0:l.shape.x)||0),y:e.offsetY-(((h=t.react)==null?void 0:h.shape.y)||0)+(((g=t.react)==null?void 0:g.shape.y)||0)}),t.circleList[3].attr({x:(d=t.react)==null?void 0:d.shape.x,y:e.offsetY-(((y=t.react)==null?void 0:y.shape.y)||0)+(((L=t.react)==null?void 0:L.shape.y)||0)}),this.calcText(),this.circleHideOrShow(!0);break}t=null,this.moveReactName=""}rectAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.react)==null||t.off("drag",this.rectDrag);e=null})}rectDrag(e){var s,r;console.log("rectDrag",e),this.moveReactName=e.target.name;let t;for(let i=0;i<this.rectInsList.length;i++){if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach(o=>{o.attr({shape:{cx:e.target.x,cy:e.target.y}})}),this.calcText();break}(r=t.react)==null||r.off("drag",this.rectDrag)}t=null,this.moveReactName="",console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.circleList)==null||t.forEach(r=>{r.off("drag",this.circleDrag),r.off("dragstart",this.circleDragStart)});e=null})}circleDragStart(e){var s;console.log("circleDragStart--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleDragPos.x=e.offsetX,t.circleDragPos.y=e.offsetY;break}t=null,this.moveReactName=""}circleDrag(e){var o,c;console.log("circleDrag--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;const t=parseInt(e.target.name);if(isNaN(t))return;let s,r=0,i=0;for(let a=0;a<this.rectInsList.length;a++)if(s=this.rectInsList[a],((o=s.react)==null?void 0:o.name)===this.moveReactName){r=e.offsetX-s.circleDragPos.x,i=e.offsetY-s.circleDragPos.y,s.circleDragPos.x=e.offsetX,s.circleDragPos.y=e.offsetY;let n=s.react.shape.x,f=s.react.shape.y,l=s.react.shape.width,h=s.react.shape.height;console.log("moveX",r,i),t===0?(n+=r,f+=i,r<0?l+=-r:l-=r,i<0?h+=-i:h-=i,s.circleList[1].attr({y:e.target.y}),s.circleList[3].attr({x:e.target.x})):t===1?(f+=i,l+=r,i<0?h+=-i:h-=i,s.circleList[0].attr({y:e.target.y}),s.circleList[2].attr({x:e.target.x})):t===2?(l+=r,h+=i,s.circleList[3].attr({y:e.target.y}),s.circleList[1].attr({x:e.target.x})):t===3&&(n+=r,r<0?l+=-r:l-=r,h+=i,s.circleList[2].attr({y:e.target.y}),s.circleList[0].attr({x:e.target.x})),(c=s.react)==null||c.attr({shape:{x:n,y:f,width:l,height:h}}),this.calcText();break}s=null,this.moveReactName=""}};u([m.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);u([m.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);u([m.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);u([m.Prop({default:()=>({lineW:.6,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);u([m.Prop({required:!0})],exports.default.prototype,"speedValue",2);u([m.Prop({required:!0})],exports.default.prototype,"cellMg",2);u([m.Prop({default:1})],exports.default.prototype,"magnification",2);u([m.Prop({default:1})],exports.default.prototype,"sens",2);u([m.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=u([R.default({name:"MXMeasuringRuler"})],exports.default);
3
+ ${s} mV`,x:(((n=e.react)==null?void 0:n.x)||0)+(((f=e.react)==null?void 0:f.shape.x)||0)+(((l=e.react)==null?void 0:l.shape.width)||0)+20,y:(((h=e.react)==null?void 0:h.y)||0)+(((g=e.react)==null?void 0:g.shape.y)||0)}});break}e=null}circleHideOrShow(e){var s;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach(i=>e?i.show():i.hide());break}t=null}sceneAddToEventListener(){var t,s,r,i;const e=o=>{var c;o.event.preventDefault(),this.clearCanvas(),this.initConfig(),(c=this.sceneIns)==null||c.add(this.measuringRulerGroup),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})};(t=this.sceneIns)==null||t.on("contextmenu",e),(s=this.sceneIns)==null||s.on("mousedown",this.sceneMousedown),(r=this.sceneIns)==null||r.on("mousemove",this.scenemousemove),(i=this.sceneIns)==null||i.on("mouseup",this.scenemouseup),this.$once("hook:beforeDestroy",()=>{var o,c,a,n;(o=this.sceneIns)==null||o.off("contextmenu",e),(c=this.sceneIns)==null||c.off("mousedown",this.sceneMousedown),(a=this.sceneIns)==null||a.off("mousemove",this.scenemousemove),(n=this.sceneIns)==null||n.off("mouseup",this.scenemouseup)})}sceneRemoveEventListener(){var e,t,s;(e=this.sceneIns)==null||e.off("mousedown",this.sceneMousedown),(t=this.sceneIns)==null||t.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}createRectBox(e,t,s){this.moveReactName=e;const r=new p.Rect({name:e,style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:t,y:s},ondrag:this.rectDrag,cursor:"move",draggable:!0}),i=new p.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),o=[];let c;const a=["nw-resize","ne-resize","se-resize","sw-resize"];for(let n=0;n<4;n++)c=new p.Circle({name:`${n}_circle`,customName:e,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:a[n],zlevel:1,draggable:!0,ondrag:this.circleDrag,ondragstart:this.circleDragStart}),c.hide(),this.measuringRulerGroup.add(c),o.push(c);return this.measuringRulerGroup.add(i),this.measuringRulerGroup.add(r),{react:r,text:i,circleList:o,circleDragPos:{x:0,y:0}}}sceneMousedown(e){var t;if(console.log("sceneMousedown",e),e.event.button===0)if(this.isMouseDown=!0,this.rectInsList.length===0)this.rectInsList.push(this.createRectBox("react_1",e.offsetX,e.offsetY));else{let s=!1,r;for(let i=0;i<this.rectInsList.length&&(r=this.rectInsList[i],s=((t=r.react)==null?void 0:t.contain(e.offsetX,e.offsetY))||!1,!s);i++);r=null,s||this.rectInsList.push(this.createRectBox(`react_${this.rectInsList.length+1}`,e.offsetX,e.offsetY)),console.log("isContain",s)}}scenemousemove(e){var s,r;if(!this.isMouseDown)return;let t;for(let i=0;i<this.rectInsList.length;i++)if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}});break}t=null}scenemouseup(e){var s,r,i,o,c,a,n,f,l,h,g,v,d,L;this.isMouseDown=!1;let t;for(let x=0;x<this.rectInsList.length;x++)if(t=this.rectInsList[x],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}}),t.circleList[0].attr({x:(i=t.react)==null?void 0:i.shape.x,y:(o=t.react)==null?void 0:o.shape.y}),t.circleList[1].attr({x:e.offsetX-(((c=t.react)==null?void 0:c.shape.x)||0)+(((a=t.react)==null?void 0:a.shape.x)||0),y:(n=t.react)==null?void 0:n.shape.y}),t.circleList[2].attr({x:e.offsetX-(((f=t.react)==null?void 0:f.shape.x)||0)+(((l=t.react)==null?void 0:l.shape.x)||0),y:e.offsetY-(((h=t.react)==null?void 0:h.shape.y)||0)+(((g=t.react)==null?void 0:g.shape.y)||0)}),t.circleList[3].attr({x:(v=t.react)==null?void 0:v.shape.x,y:e.offsetY-(((d=t.react)==null?void 0:d.shape.y)||0)+(((L=t.react)==null?void 0:L.shape.y)||0)}),this.calcText(),this.circleHideOrShow(!0);break}t=null,this.moveReactName=""}rectAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.react)==null||t.off("drag",this.rectDrag);e=null})}rectDrag(e){var s,r;console.log("rectDrag",e),this.moveReactName=e.target.name;let t;for(let i=0;i<this.rectInsList.length;i++){if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach(o=>{o.attr({shape:{cx:e.target.x,cy:e.target.y}})}),this.calcText();break}(r=t.react)==null||r.off("drag",this.rectDrag)}t=null,this.moveReactName="",console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.circleList)==null||t.forEach(r=>{r.off("drag",this.circleDrag),r.off("dragstart",this.circleDragStart)});e=null})}circleDragStart(e){var s;console.log("circleDragStart--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleDragPos.x=e.offsetX,t.circleDragPos.y=e.offsetY;break}t=null,this.moveReactName=""}circleDrag(e){var o,c;console.log("circleDrag--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;const t=parseInt(e.target.name);if(isNaN(t))return;let s,r=0,i=0;for(let a=0;a<this.rectInsList.length;a++)if(s=this.rectInsList[a],((o=s.react)==null?void 0:o.name)===this.moveReactName){r=e.offsetX-s.circleDragPos.x,i=e.offsetY-s.circleDragPos.y,s.circleDragPos.x=e.offsetX,s.circleDragPos.y=e.offsetY;let n=s.react.shape.x,f=s.react.shape.y,l=s.react.shape.width,h=s.react.shape.height;console.log("moveX",r,i),t===0?(n+=r,f+=i,r<0?l+=-r:l-=r,i<0?h+=-i:h-=i,s.circleList[1].attr({y:e.target.y}),s.circleList[3].attr({x:e.target.x})):t===1?(f+=i,l+=r,i<0?h+=-i:h-=i,s.circleList[0].attr({y:e.target.y}),s.circleList[2].attr({x:e.target.x})):t===2?(l+=r,h+=i,s.circleList[3].attr({y:e.target.y}),s.circleList[1].attr({x:e.target.x})):t===3&&(n+=r,r<0?l+=-r:l-=r,h+=i,s.circleList[2].attr({y:e.target.y}),s.circleList[0].attr({x:e.target.x})),(c=s.react)==null||c.attr({shape:{x:n,y:f,width:l,height:h}}),this.calcText();break}s=null,this.moveReactName=""}};u([m.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);u([m.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);u([m.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);u([m.Prop({default:()=>({lineW:.6,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);u([m.Prop({required:!0})],exports.default.prototype,"speedValue",2);u([m.Prop({required:!0})],exports.default.prototype,"cellMg",2);u([m.Prop({default:1})],exports.default.prototype,"magnification",2);u([m.Prop({default:1})],exports.default.prototype,"sens",2);u([m.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=u([R.default({name:"MXMeasuringRuler"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.0.73-0",
3
+ "version": "1.0.76-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",