"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[3327],{33327:function(e,n,i){i.r(n),i.d(n,{default:function(){return m}});var o=i(66252),a=i(3577),t=i(49963);const l=e=>((0,o.dD)("data-v-01b4425f"),e=e(),(0,o.Cn)(),e),c={class:"canvasTool"},s={class:"label_item uploadImage"},r=l((()=>(0,o._)("i",{class:"icon fi fi-br-upload"},null,-1)));function p(e,n,i,l,p,v){return(0,o.wg)(),(0,o.iD)("div",c,[(0,o._)("i",{class:"icon iconfont icon-chehui",onClick:n[0]||(n[0]=n=>e.historyState(""))}),(0,o._)("i",{class:"icon iconfont icon-fanchehui",onClick:n[1]||(n[1]=n=>e.historyState("reverse"))}),(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-bianji",{active:"pencil"==e.canvasGeneral.operation}]),onClick:n[2]||(n[2]=n=>e.setOperation("pencil"))},null,2),(0,o._)("i",{class:(0,a.C_)(["fi fi-rr-hand-paper",{active:"move"==e.canvasGeneral.operation}]),onClick:n[3]||(n[3]=n=>e.setOperation("move"))},null,2),(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-move",{active:"movePosition"==e.canvasGeneral.operation}]),onClick:n[4]||(n[4]=n=>e.setOperation("movePosition"))},null,2),(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-xiangpi_huaban1",{active:"eraser"==e.canvasGeneral.operation}]),onClick:n[5]||(n[5]=n=>e.setOperation("eraser"))},null,2),(0,o._)("i",{class:(0,a.C_)(["fi fi-rr-square-dashed",{active:"dashed"==e.canvasGeneral.operation}]),onClick:n[6]||(n[6]=n=>e.setOperation("dashed"))},null,2),(0,o._)("i",{class:(0,a.C_)(["fi fi-rr-scalpel-path",{active:"dashedPencil"==e.canvasGeneral.operation}]),onClick:n[7]||(n[7]=n=>e.setOperation("dashedPencil"))},null,2),(0,o._)("i",{class:(0,a.C_)(["fi fi-rr-zoom-in",{active:"zoomIn"==e.canvasGeneral.operation}]),onClick:n[8]||(n[8]=n=>e.setOperation("zoomIn"))},null,2),(0,o._)("i",{class:(0,a.C_)(["fi fi-rr-zoom-out",{active:"zoomOut"==e.canvasGeneral.operation}]),onClick:n[9]||(n[9]=n=>e.setOperation("zoomOut"))},null,2),(0,o._)("i",{class:"icon iconfont icon-IC-yehua",onClick:n[10]||(n[10]=n=>e.setLiquefaction())}),(0,o._)("div",s,[r,(0,o._)("input",{type:"file",onChange:n[11]||(n[11]=(...n)=>e.uploadImage&&e.uploadImage(...n))},null,32)]),(0,o._)("i",{class:(0,a.C_)(["icon iconfont",{active:"text"==e.canvasGeneral.operation}]),onClick:n[12]||(n[12]=n=>e.setOperation("text"))},"T",2),(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-xiala",{"icon-xialaActive":e.isMove}]),onClick:n[13]||(n[13]=(0,t.iM)(((...n)=>e.openMore&&e.openMore(...n)),["stop"]))},null,2),(0,o.wy)((0,o._)("div",{class:"btnModal",style:(0,a.j5)(e.moveStyle)},[(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-checkbox-full",{active:"rect"==e.canvasGeneral.operation}]),onClick:n[14]||(n[14]=n=>e.setOperation("rect"))},null,2),(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-sanjiaoxing",{active:"triangle"==e.canvasGeneral.operation}]),onClick:n[15]||(n[15]=n=>e.setOperation("triangle"))},null,2),(0,o._)("i",{class:(0,a.C_)(["icon iconfont icon-tx-fill-tuoyuanxing",{active:"ellipse"==e.canvasGeneral.operation}]),onClick:n[16]||(n[16]=n=>e.setOperation("ellipse"))},null,2)],4),[[t.F8,e.isMove]])])}var v=i(2262),u=i(47332),f=i(74961),d=(0,o.aZ)({component:{},emits:["toolLiquefaction"],setup(e,{emit:n}){let i=(0,o.f3)("canvasObj"),a=(0,o.f3)("isShowMark");const t=(0,v.qj)({isMove:!1,moveStyle:{}}),l=e=>{a.value=!0;const n=e.target.files[0];let o=e.target;if(s("movePosition"),n){const e=new FileReader;e.onload=e=>{let n=(0,u.Ll)(e.target.result,"upload"),t=new FormData;t.append("file",n);let l={headers:{"Content-Type":"multipart/form-data",Accept:"*/*"}};f.V.axiosPost(f.V.httpUrls.canvasElementUpload,t,l).then((e=>{e.imgUrl=e.minioUrl,a.value=!1,i.addImage(e)})),o.value=""},e.readAsDataURL(n)}},c=e=>{i.historyState(e)},s=e=>{i.setOperation(e)},r=e=>{if(t.isMove=!t.isMove,t.isMove){let n=e.target.getBoundingClientRect(),i=e.target.parentElement.getBoundingClientRect();const o=n.left-i.left,a=n.top-i.top;t.moveStyle.top=a+"px",t.moveStyle.left=o+n.width+2+"px"}},p=()=>{t.isMove=!1};let d=()=>{n("toolLiquefaction")};document.addEventListener("click",p);const C=()=>{document.removeEventListener("click",p)};return{canvasGeneral:i,...(0,v.BK)(t),uploadImage:l,historyState:c,setOperation:s,openMore:r,closeModal:C,setLiquefaction:d}}}),C=i(83744);const _=(0,C.Z)(d,[["render",p],["__scopeId","data-v-01b4425f"]]);var m=_}}]);