"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[5869],{55869:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}});var i=n(66252),o=n(3577);const a={class:"canvasTool"};function s(e,t,n,s,c,r){return(0,i.wg)(),(0,i.iD)("div",a,[(0,i._)("i",{class:"icon iconfont icon-chehui",onClick:t[0]||(t[0]=t=>e.historyState(""))}),(0,i._)("i",{class:"icon iconfont icon-fanchehui",onClick:t[1]||(t[1]=t=>e.historyState("reverse"))}),(0,i._)("i",{class:(0,o.C_)(["icon iconfont icon-bianji",{active:"pencil"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[2]||(t[2]=t=>e.setOperation("pencil"))},null,2),(0,i._)("i",{class:(0,o.C_)(["icon iconfont icon-caizhi",{active:"texture"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[3]||(t[3]=t=>e.setOperation("texture"))},null,2),(0,i._)("i",{class:(0,o.C_)(["fi fi-rr-hand-paper",{active:"move"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[4]||(t[4]=t=>e.setOperation("move"))},null,2),(0,i._)("i",{class:(0,o.C_)(["icon iconfont icon-move",{active:"movePosition"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[5]||(t[5]=t=>e.setOperation("movePosition"))},null,2),(0,i._)("i",{class:(0,o.C_)(["icon iconfont icon-xiangpi_huaban1",{active:"eraser"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[6]||(t[6]=t=>e.setOperation("eraser"))},null,2),(0,i._)("i",{class:(0,o.C_)(["fi fi-rr-square-dashed",{active:"dashed"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[7]||(t[7]=t=>e.setOperation("dashed"))},null,2),(0,i._)("i",{class:(0,o.C_)(["fi fi-rr-scalpel-path",{active:"dashedPencil"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[8]||(t[8]=t=>e.setOperation("dashedPencil"))},null,2),(0,i._)("i",{class:(0,o.C_)(["fi fi-rr-zoom-in",{active:"zoomIn"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[9]||(t[9]=t=>e.setOperation("zoomIn"))},null,2),(0,i._)("i",{class:(0,o.C_)(["fi fi-rr-zoom-out",{active:"zoomOut"==e.canvasGeneral.operation,eventNone:e.isEditFrontBack}]),onClick:t[10]||(t[10]=t=>e.setOperation("zoomOut"))},null,2),(0,i._)("i",{onClick:t[11]||(t[11]=(...t)=>e.setEditFront&&e.setEditFront(...t)),class:(0,o.C_)([{active:e.isEditFrontBack||!1},"fi fi-sr-layers"])},null,2)])}var c=n(2262),r=n(47332),l=n(74961),d=(0,i.aZ)({component:{},emits:["toolLiquefaction","editFront"],props:["isEditFrontBack"],setup(e,{emit:t}){let n=(0,i.f3)("canvasObj"),o=(0,i.f3)("isShowMark");const a=(0,c.qj)({isMove:!1,moveStyle:{},isShowMark:o}),s=e=>{a.isShowMark=!0;const t=e.target.files[0];let i=e.target;if(v("movePosition"),t){const e=new FileReader;e.onload=e=>{let t=(0,r.Ll)(e.target.result,"upload"),o=new FormData;o.append("file",t);let s={headers:{"Content-Type":"multipart/form-data",Accept:"*/*"}};l.V.axiosPost(l.V.httpUrls.canvasElementUpload,o,s).then((e=>{e.imgUrl=e.minioUrl,a.isShowMark=!1,n.addImage(e)})),i.value=""},e.readAsDataURL(t)}},d=e=>{n.historyState(e)},v=t=>{e.isEditFrontBack||n.setOperation(t)},p=e=>{if(a.isMove=!a.isMove,a.isMove){let t=e.target.getBoundingClientRect(),n=e.target.parentElement.getBoundingClientRect();const i=t.left-n.left,o=t.top-n.top;a.moveStyle.top=o+"px",a.moveStyle.left=i+t.width+2+"px"}},u=()=>{a.isMove=!1};let f=()=>{t("toolLiquefaction")};document.addEventListener("click",u);const k=()=>{document.removeEventListener("click",u)},m=()=>{t("editFront")};return{canvasGeneral:n,...(0,c.BK)(a),uploadImage:s,historyState:d,setOperation:v,openMore:p,closeModal:k,setLiquefaction:f,setEditFront:m}}}),v=n(83744);const p=(0,v.Z)(d,[["render",s],["__scopeId","data-v-5eef58d4"]]);var u=p}}]);