You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
102 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8ff164aa"],{"0156":function(t,e,s){},"01eb":function(t,e,s){},"0a1d":function(t,e,s){},"0d34":function(t,e,s){},"19a5":function(t,e,s){},"19f7":function(t,e,s){"use strict";s("5a6b")},"1a77":function(t,e,s){"use strict";s("b5bf")},"1c8e":function(t,e,s){"use strict";s("b854")},2242:function(t,e,s){"use strict";s("0156")},3292:function(t,e,s){"use strict";s("01eb")},"3cfd":function(t,e,s){"use strict";s("93b2")},"41d4":function(t,e,s){"use strict";s("6f80")},"4c0d":function(t,e,s){},5202:function(t,e,s){"use strict";s("bd3e")},"53e2":function(t,e,s){"use strict";s("e814")},"57d9":function(t,e,s){"use strict";s("13d5");var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"canvas-wrap"},[e("canvas-tools",{on:{reduce:t.reduce}}),e("canvas",{ref:"reduceCanvas",staticClass:"reduce-canvas",style:{transform:`translate3d(${50*-(1-t.canvasScale)}%, ${50*-(1-t.canvasScale)}%, 0) scale(${t.canvasScale}) rotate(${t.reserve?180:0}deg)`}}),e("HoverCanvasVertical",{staticClass:"reduce-canvas",attrs:{h:t.h,reserve:t.reserve,w:t.w}})],1)},n=[],o=(s("14d9"),s("2f62")),a=s("e635"),r=s("882b"),c=s("95b7"),l=s.n(c),h=s("3920"),u=s.n(h),d=s("6c90"),p=function(){var t=this,e=t._self._c;return e("canvas",{directives:[{name:"show",rawName:"v-show",value:t.multipleChecked,expression:"multipleChecked"}],ref:"reduceCanvasHover",staticStyle:{border:"1px solid #0f0"},style:{transform:`translate3d(${50*-(1-t.canvasScale)}%, ${50*-(1-t.canvasScale)}%, 0) scale(${t.canvasScale})`},on:{mousedown:t.start,mousemove:t.move,mouseup:t.end,touchend:t.end,touchmove:t.move,touchstart:t.start}})},m=[],f={props:{w:{type:Number,default:0},h:{type:Number,default:0},reserve:{type:Boolean,default:!1}},data(){return{hoverCanvas:null,hoverContext:null,canDraw:!1,startX:0,startY:0,rect:{sX:0,sY:0,w:0,h:0}}},computed:{...Object(o["e"])("ht",["canvasScale","checkedPaths","removePaths"]),...Object(o["c"])("ht",["multipleChecked","pointsData"])},watch:{multipleChecked:{handler(t){t&&(this.setHoverCanvasStyle(),this.highlightCheckedPaths())},immediate:!0},checkedPaths:{deep:!0,handler(){this.multipleChecked||this.setHoverCanvasStyle(),this.hoverContext.clearRect(0,0,this.w,this.h),this.highlightCheckedPaths()}},removePaths:{deep:!0,handler(){this.removePaths&&this.removePaths.length?this.setCanvasTools({type:"multiple",flag:!0}):this.setCanvasTools({type:"multiple",flag:!1}),this.hoverContext.clearRect(0,0,this.w,this.h),setTimeout(()=>{this.highlightRemovePaths()},50)}}},mounted(){this.setHoverCanvasStyle(),this.highlightCheckedPaths()},methods:{...Object(o["d"])("ht",["setCheckedPaths","setCanvasTools"]),start(t){const{hoverContext:e}=this;this.canDraw=!0;const{x:s,y:i}=Object(r["c"])(this.hoverCanvas,t);this.startX=s,this.startY=i,e.fillStyle="rgba(35, 107, 216, .5)"},move(t){if(t.preventDefault(),!this.canDraw)return;const{hoverContext:e,canvasScale:s}=this;e.clearRect(0,0,this.w,this.h);const{x:i,y:n}=Object(r["c"])(this.hoverCanvas,t),o=Object(r["b"])(this.startX,this.startY,i,n);this.rect={sX:o.x/s,sY:o.y/s,w:Math.abs(i-this.startX)/s,h:Math.abs(n-this.startY)/s},e.fillRect(this.rect.sX,this.rect.sY,this.rect.w,this.rect.h)},end(t){this.canDraw=!1,this.hoverContext.clearRect(0,0,this.w,this.h),this.computeCheckPaths(),this.highlightCheckedPaths()},computeCheckPaths(){const{reserve:t,canvasScale:e,w:s,h:i,rect:n}=this,{sX:o,sY:a}=this.rect,r=o+n.w,c=a+n.h,{pointsData:l,checkedPaths:h}=this;for(let u=0,d=l.length;u<d;u++){const t=l[u],e=t.value.split(";");for(let n=0,l=e.length;n<l;n++){const t=e[n];let[l,d]=t.split(","),p=d*(i/s),m=i/s*(s-l);if(p>=o&&p<=r&&m>=a&&m<=c){h[u]=!h[u];break}}}this.setCheckedPaths(h)},highlightCheckedPaths(){const{checkedPaths:t}=this;t.forEach((t,e)=>{t&&this.drawPath(e)})},highlightRemovePaths(){const{checkedPaths:t,removePaths:e}=this;t.forEach((t,s)=>{e.forEach(t=>{t===s&&this.drawPath(t)})})},drawPath(t){try{const{pointsData:e,reserve:s,w:i,h:n}=this;let o=[];for(let t=0;t<e.length;t++)0===e[t].delStatus&&o.push(e[t]);const{color:a,value:r}=o[t],c=r.split(";