(window.webpackJsonp=window.webpackJsonp||[]).push([["design"],{"0581":function(t,e,i){},"0837":function(t,e,i){},"0d66":function(t,e,i){},"110e":function(t,e,i){},"129f":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},"144f":function(t,e,i){"use strict";i.r(e);i("ca08"),i("bc3a");var a=i("a60c"),n={name:"Orders",data:function(){return{third_no:"",ordershow:!1,orders_list:[]}},methods:{open_order:function(){var e=this;Object(a.x)(this.third_no).then(function(t){1==t.data.code&&(e.orders_list=t.data.data.unions,e.ordershow=!0),e.messageBox(t)})},isAssociation:function(t){return"MANUAL_IMPORT"!=t.origin_type||t.is_union},godesign:function(t){this.$router.push({path:"/thdesign",query:{id:t,third_no:this.third_no}})}},created:function(){this.$route.query&&this.$route.query.third_no&&(this.third_no=this.$route.query.third_no,this.open_order()),document.getElementById("kefu")&&(document.getElementById("kefu").style.display="none"),document.getElementById("kefuBox")&&(document.getElementById("kefuBox").style.display="none")}},i=(i("2ffa"),i("2877")),i=Object(i.a)(n,function(){var i=this,t=i.$createElement,a=i._self._c||t;return a("div",{staticClass:"Order"},[a("div",{staticClass:"title"},[i._v("TK订单查询")]),a("div",{staticStyle:{display:"flex","justify-content":"center","margin-top":"177px"}},[a("el-input",{staticStyle:{width:"600px",height:"109.12px","border-radius":"6.61px"},attrs:{size:"big",placeholder:"输入订单号查询"},model:{value:i.third_no,callback:function(t){i.third_no=t},expression:"third_no"}})],1),a("el-button",{staticStyle:{width:"600px",height:"77px",opacity:"1","font-size":"22px",margin:"10px","margin-top":"110px",color:"rgb(38, 38, 38)",border:"0","border-radius":"13px",background:"rgb(250, 233, 207)","box-shadow":"rgb(250, 233, 207) 0px 0px 4px"},on:{click:i.open_order}},[i._v("立即查询")]),a("el-drawer",{attrs:{width:"620px",visible:i.ordershow,title:"子订单",direction:"btt",size:"80%"},on:{"update:visible":function(t){i.ordershow=t}}},[a("div",{staticStyle:{display:"flex","flex-direction":"column",padding:"40px"}},i._l(i.orders_list,function(e){return a("div",[a("div",{staticClass:"product"},[a("div",[a("div",{staticClass:"img-box"},[a("el-image",{staticClass:"img",attrs:{src:e.is_union?-1==e.finished.thumb.indexOf("static")?""==e.finished.thumb?"https://www.didaplan.cn/3D/loading.gif":e.finished.thumb:e.finished.thumb+"?imageView2/2/w/400":e.import_thumb,"preview-src-list":[e.is_union?-1==e.finished.thumb.indexOf("static")?e.finished.thumb:e.finished.thumb+"?imageView2/2/w/600":e.import_thumb],fit:"contain"}}),6==e.status?a("p",{staticClass:"status-text"},[i._v("已取消")]):"1"==e.is_delete?a("p",{staticClass:"status-text"},[i._v(" 已删除 ")]):i._e()],1)]),a("div",{staticClass:"info"},[a("p",{staticClass:"config"},[i._v(" ID:"+i._s(e.is_union?e.finished.id:e.import_sku)+" ")]),e.is_union?a("div",{staticClass:"config"},[i._v(" 规格: "+i._s(e.finished.size)+"／ "),a("span",{staticClass:"color",style:{backgroundColor:e.finished.color}})]):a("div",{staticClass:"config"},[i._v(" "+i._s(e.import_size)+"／"+i._s(e.import_color)+" ")]),a("p",{staticClass:"association",on:{click:function(t){return i.godesign(e.id)}}},[a("i",{staticClass:"el-icon-connection"}),i._v("去设计 ")])])])])}),0)])],1)},[],!1,null,"2263bc88",null);e.default=i.exports},"1c0d":function(t,e,i){},"1ede":function(t,e,i){},2398:function(t,e,i){"use strict";i("ea89")},"258d":function(t,e,i){"use strict";i("7751")},2935:function(t,e,i){t.exports=i.p+"img/8-8.fe5aef82.png"},"2a10":function(t,e,i){t.exports=i.p+"img/koutu-1.92e42ad5.png"},"2abd":function(t,e,i){},"2d77":function(t,e,i){t.exports=i.p+"img/10-10.c04c0279.png"},"2dad":function(t,e,i){},"2e7e":function(t,e,i){"use strict";i("da8c")},"2ffa":function(t,e,i){"use strict";i("dc8b")},"31fb":function(t,e,i){"use strict";i("66b1")},"33ba":function(t,e,i){t.exports=i.p+"img/15-15.f688d31b.png"},3777:function(t,e,i){},"37ca":function(t,e,i){"use strict";i("110e")},"39a8":function(t,e,i){},"3a32":function(t,e,i){t.exports=i.p+"img/4-4.a05891ef.png"},"3b47":function(t,e,i){"use strict";i("2dad")},"42ee":function(t,e,i){"use strict";i("9a59")},"4e03":function(t,e,i){t.exports=i.p+"img/3-3.87241f46.png"},"4f31":function(B,t,e){"use strict";e.r(t);var o=e("1da1"),i=(e("96cf"),e("b0c0"),e("159b"),e("d3b7"),e("fb6a"),e("a15b"),e("25f0"),e("1321")),a=e("2515"),l=e("ade3"),s=e("2909"),c=(e("d81d"),e("4e82"),e("a434"),e("a9e3"),e("b680"),e("8a5a")),n=e("7212"),r=(e("bbe3"),e("6d3b")),d=e("b42f"),u=e("8343");r.a.use([d.a,u.a]);var h={components:{Swiper:n.Swiper,SwiperSlide:n.SwiperSlide},data:function(){var t=this;return{c:null,ctx:null,dragArr:[],checkClickArea:[],swipeOptions:{initialSlide:0,speed:500,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}},swiperOptions1:{initialSlide:0,speed:500,on:{slideChange:function(){t.active=t.$refs.redefineSwipe1.$swiper.activeIndex}}},active:0,popShow:!1,num:1,product:{search:"",radio:"1"},buttons:["产品","素材","背景","图片"],buttonIndex:0,typeButton:["分类","类别","等级"],typeArr:[{name:"北京",children:[{name:"海淀区",children:[{name:"1环",children:[{name:"10环"},{name:"11环"}]},{name:"2环"}]},{name:"朝阳区"}]},{name:"浙江",children:[{name:"杭州"},{name:"宁波"}]},{name:"广东",children:[{name:"1环"},{name:"2环"}]}],pickShow:!1,pickShow1:!1,pickShow2:!1,pickShow3:!1,mouseIndex:-1,imgList:[e("ae45"),e("65ba"),e("ae45"),e("65ba"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45")],curImgList:[e("ae45"),e("ae45")],imgIndex:-1,curimgIndex:0,scrollImg:1}},watch:{active:function(t){this.$refs.redefineSwipe1.$swiper.slideTo(t)}},methods:(h={swiperNext:function(){this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex+2},swiperPrev:function(){this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex},setButton:function(t){3==t?this.$refs.file.click():this.buttonIndex=t},enter:function(t){this.mouseIndex=t,0!=this.typeArr.length&&(this.pickShow=!this.pickShow)},leave:function(){this.mouseIndex=-1,this.pickShow=!this.pickShow},pickImg:function(t){this.imgIndex=t},curImgIndex:function(t){this.curimgIndex=t},handleBlur:function(){null==this.num&&(this.num=1)},popSwiper:function(t){this.active=t},openPop:function(){this.popShow=!this.popShow},closePop:function(){this.popShow=!this.popShow},addImage:function(t){var r=this,t=t.target.files[0],e=new FileReader;e.readAsDataURL(t),e.onload=function(t){var i,a,n=new Image;n.src=t.target.result,n.onload=function(t){i=n.width,(a=n.height)<i?(e=i/600,i=600,a/=e):(e=a/600,a=600,i/=e);var e={url:n,width:i,height:a};r.dragArr.push(new c.a(e,r.ctx)),r.draw()}}},draw:function(){this.ctx.clearRect(0,0,this.c.width,this.c.height),this.dragArr.forEach(function(t){t.paint()})},start:function(t){var a=this,n=(this.clickedkArr=[],t.offsetX),r=t.offsetY,t=(this.dragArr.forEach(function(t,e){var i=t.isInWhere(n,r);t.place=i,t.index=e,t.selected=!1,i&&a.checkClickArea.push(t)}),this.checkClickArea.length);if(0<t){t=this.checkClickArea[t-1];if(t.index=Math.max.apply(Math,Object(s.a)(this.dragArr.map(function(t){return t.index})))+1,this.dragArr.sort(function(t,e){return t.index-e.index}),"del"===t.place)return this.dragArr.splice(t.index-1,1),void this.draw();t.selected=!0,this.lastImg=t,this.initial={initialX:t.x,initialY:t.y,initialH:t.h,initialW:t.w,initialRotate:t.rotate,initialPointList:t.pointList}}this.draw(),this.startTouch={startX:n,startY:r}},move:function(t){var e,i,a,n,r,s,o,l,c;0<this.checkClickArea.length&&(e=this.lastImg,t.clientX,t.clientY,i=(a=this.startTouch).startX,a=a.startY,l=(c=this.initial).initialX,c=c.initialY,n=e.centerX,r=e.centerY,this.initial.initialRotate,s=(o=this.initial).initialH,o=o.initialW,"move"==e.place?(e.x=l+(t.offsetX-i),e.y=c+(t.offsetY-a)):"rotate"==e.place?(l=Math.atan2(a-r,i-n),(c=180*(Math.atan2(t.offsetY-r,t.offsetX-n)-l)/Math.PI)<0&&(c-=360),e.rotate=c):"transform"==e.place&&(l=Math.sqrt(Math.pow(n-i,2)+Math.pow(r-a,2)),c=Math.sqrt(Math.pow(n-t.offsetX,2)+Math.pow(r-t.offsetY,2))-l,o<s?(e.h=s+c,e.w=o+o/s*c):s==o?(e.h=s+c,e.w=o+c):(e.w=o+c,e.h=s+s/o*c)),this.draw())},up:function(){var t=this.lastImg,e=this.lastImg,i=e.place,a=e.rotate,n=e.centerX,r=e.centerY,s=(e.x,e.y,e.pointList),e=e.oldAngle;null==t?this.clickedkArr=[]:("move"==i?t.calculate():"rotate"==t.place?(e=360-(a-e),this.lastImg.oldAngle=a,a={x:n,y:-1*r},(n={x:0,y:0}).x=s[0].x,n.y=-1*s[0].y,r=this.XY(n,a,e),s[0].x=r.x,s[0].y=r.y,n.x=s[1].x,n.y=-1*s[1].y,r=this.XY(n,a,e),s[1].x=r.x,s[1].y=r.y,n.x=s[2].x,n.y=-1*s[2].y,r=this.XY(n,a,e),s[2].x=r.x,s[2].y=r.y,n.x=s[3].x,n.y=-1*s[3].y,r=this.XY(n,a,e),s[3].x=r.x,s[3].y=r.y):"transform"==i&&t.ratio(),this.checkClickArea=[])}},Object(l.a)(h,"leave",function(){}),Object(l.a)(h,"XY",function(t,e,i){var a=(t.x-e.x)*Math.cos(i*Math.PI/180)-(t.y-e.y)*Math.sin(i*Math.PI/180)+e.x,t=(t.x-e.x)*Math.sin(i*Math.PI/180)+(t.y-e.y)*Math.cos(i*Math.PI/180)+e.y;return t*=-1,{x:Number(a.toFixed(2)),y:Number(t.toFixed(2))}}),h),mounted:function(){var t=document.getElementById("myCanvas");(this.c=t).width=600,t.height=600,this.ctx=t.getContext("2d")}},g=(e("5096"),e("258d"),e("2877")),h=Object(g.a)(h,function(){var i=this,t=i.$createElement,a=i._self._c||t;return a("div",{staticClass:"diy"},[a("div",{directives:[{name:"show",rawName:"v-show",value:!i.popShow,expression:"!popShow"}],staticClass:"left"},[a("div",{staticClass:"left-button"},i._l(i.buttons,function(t,e){return a("el-button",{class:i.buttonIndex==e?"buttonStyle":"",attrs:{type:"primary",size:"small ",keys:"index"},on:{click:function(t){return i.setButton(e)}}},[i._v(i._s(t))])}),1),a("div",{staticClass:"product"},[a("div",{staticClass:"search"},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入搜索内容",size:"max"},model:{value:i.product.search,callback:function(t){i.$set(i.product,"search",t)},expression:"product.search"}},[a("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},slot:"append"})],1)],1),a("div",{staticClass:"options"},[a("div",{staticClass:"typeList"},[a("input",{ref:"file",staticClass:"input-opacity",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpeg, image/png, image/jpg"},on:{change:function(t){return i.addImage(t)}}}),i._l(i.typeButton,function(t,e){return a("div",{staticClass:"typeBtn",on:{mouseenter:function(t){return i.enter(e)},mouseleave:i.leave}},[i._v(" "+i._s(t)+" "),a("i",{class:i.mouseIndex==e?"el-icon-arrow-up":"el-icon-arrow-down"})])}),a("el-radio",{attrs:{label:"1"},model:{value:i.product.radio,callback:function(t){i.$set(i.product,"radio",t)},expression:"product.radio"}},[i._v("全部")]),a("el-radio",{attrs:{label:"2"},model:{value:i.product.radio,callback:function(t){i.$set(i.product,"radio",t)},expression:"product.radio"}},[i._v("常用")]),a("div",{staticClass:"typeBtn",staticStyle:{color:"#55afae"}},[i._v("重置")])],2),a("div",{staticClass:"pickList"},i._l(i.typeArr,function(t,e){return a("div",{directives:[{name:"show",rawName:"v-show",value:i.pickShow,expression:"pickShow"}],staticClass:"typePick",on:{mouseenter:function(t){return i.enter(e)},mouseleave:i.leave}},[a("ul",[a("li",[i._v(i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])]),a("ul",i._l(t.children,function(t,e){return a("li",[i._v(" "+i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])}),0),a("ul",i._l(t.children.children,function(t,e){return a("li",[i._v(" "+i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])}),0)])}),0)])]),a("div",{staticClass:"imgList"},[i._l(i.imgList,function(t,e){return a("div",{staticClass:"imgItem",style:i.imgIndex==e?" border: 1px solid #55afae;":"",on:{click:function(t){return i.pickImg(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),a("div",{staticClass:"imgPage"},[a("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{small:"",layout:"prev, pager, next",total:100}}),a("p",[i._v("共有100件商品")])],1)],2)]),a("div",{directives:[{name:"show",rawName:"v-show",value:!i.popShow,expression:"!popShow"}],staticClass:"right"},[a("div",{staticClass:"flex"},[a("div",{staticClass:"imgList"},i._l(i.curImgList,function(t,e){return a("div",{staticClass:"curimg",style:i.curimgIndex==e?" border: 1px solid #55afae;":"",on:{click:function(t){return i.curImgIndex(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),0),a("div",{staticClass:"canvas"},[a("img",{ref:"myImg",attrs:{src:e("b3ba")}}),a("canvas",{ref:"myCanvas",attrs:{id:"myCanvas"},on:{mousedown:i.start,mousemove:i.move,mouseup:i.up,mouseleave:i.leave}})]),a("div",{staticClass:"swiper"},[a("swiper",{ref:"interSwiper",staticClass:"swiper-no-swiping",attrs:{options:i.swipeOptions}},[i._l(i.imgList,function(t,e){return a("swiper-slide",[a("img",{attrs:{src:t}})])}),a("div",{staticClass:"swiper-button-prev",attrs:{slot:"button-prev"},on:{click:i.swiperPrev},slot:"button-prev"}),a("div",{staticClass:"swiper-button-next",attrs:{slot:"button-next"},on:{click:i.swiperNext},slot:"button-next"})],2),a("div",{staticClass:"count"},[i._v(i._s(i.scrollImg)+"/"+i._s(i.imgList.length))]),a("i",{staticClass:"el-icon-zoom-in pop",on:{click:i.openPop}}),i._m(0),a("div",{staticClass:"specifications"},[i._m(1),i._m(2),a("div",{staticClass:"num"},[a("div",{staticClass:"title"},[i._v("数量")]),a("el-input-number",{attrs:{size:"mini",min:1},on:{blur:i.handleBlur},model:{value:i.num,callback:function(t){i.num=t},expression:"num"}})],1),a("div",{staticClass:"button"},[a("el-button",{staticClass:"but-car",attrs:{size:"small"}},[i._v("加入购物车")]),a("el-button",{staticClass:"but-save",attrs:{size:"small"}},[i._v("保存")])],1)])],1)])]),a("div",{directives:[{name:"show",rawName:"v-show",value:i.popShow,expression:"popShow"}],staticClass:"fiexd"},[a("div",{staticClass:"close"},[a("i",{staticClass:"el-icon-back",on:{click:i.closePop}})]),a("div",{staticClass:"swiper"},[a("div",{staticClass:"imgList"},i._l(i.imgList,function(t,e){return a("div",{class:{imgItem:!0,border:e==i.active},on:{click:function(t){return i.popSwiper(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),0),a("swiper",{ref:"redefineSwipe1",staticClass:"swiperOptions1 swiper-no-swiping",attrs:{options:i.swiperOptions1}},i._l(i.imgList,function(t){return a("swiper-slide",{staticClass:"rs-box"},[a("img",{staticClass:"rs-icon",attrs:{src:t}})])}),1)],1)])])},[function(){var t=this,e=t.$createElement,e=t._self._c||e;return e("div",{staticClass:"detail"},[e("div",{staticClass:"size"},[t._v("推荐尺寸"),e("span",[t._v(" 2000px*800px")])]),e("div",{staticClass:"quality"},[t._v("打印质量:"),e("span",[t._v("优秀")])])])},function(){var t=this,e=t.$createElement,e=t._self._c||e;return e("div",{staticClass:"color"},[e("div",{staticClass:"title"},[t._v("颜色")]),e("p",[e("span"),t._v(" "),e("span"),t._v(" "),e("span"),t._v(" "),e("span")])])},function(){var t=this,e=t.$createElement,e=t._self._c||e;return e("div",{staticClass:"size"},[e("div",{staticClass:"title"},[t._v("规格")]),e("p",[e("span",[t._v("s")]),e("span",[t._v("m")]),e("span",[t._v("l")])])])}],!1,null,"6e08c3bb",null).exports,f=(e("cb29"),e("7db0"),e("ac1f"),e("5319"),e("4d63"),e("99af"),e("1276"),e("466d"),e("5cc6"),e("9a8c"),e("a975"),e("735e"),e("c1ac"),e("d139"),e("3a7b"),e("d5d6"),e("82f8"),e("e91f"),e("60bd"),e("5f96"),e("3280"),e("3fcc"),e("ca91"),e("25a1"),e("cd26"),e("3c5d"),e("2954"),e("649e"),e("219c"),e("170b"),e("b39a"),e("72f7"),e("caad"),e("1b62")),w=e("362d"),m=e("b85c"),p={name:"threed",components:{},props:{picimg:{type:String|Array,default:function(){return null}}},data:function(){return{LOADER:document.getElementById("js-loader"),DRAG_NOTICE:document.getElementById("js-drag-notice"),TRAY:document.getElementById("js-tray-slide"),theModel:"",number:0,numberf:0,MODEL_PATH:"https://www.didaplan.cn/3D/baozhen.glb",cameraFar:5,activeOption:"RootNode",BACKGROUND_COLOR:15856113,scene:"",canvas:"",renderer:"",camera:"",controls:"",index:0,texture:"",INITIAL_MTL:"",INITIAL_MAP:""}},methods:{initModel:function(t){var e=this,i=document.querySelector("#c"),a=new THREE.GLTFLoader;this.renderer=new THREE.WebGLRenderer({canvas:i,antialias:!0,alpha:!0}),this.renderer.shadowMap.enabled=!0,this.renderer.setPixelRatio(window.devicePixelRatio),this.scene=new THREE.Scene,this.scene.background=new THREE.Color(this.BACKGROUND_COLOR),this.scene.fog=new THREE.Fog(this.BACKGROUND_COLOR,20,100),this.camera=new THREE.PerspectiveCamera(50,window.innerWidth/window.innerHeight,.1,1e3),this.camera.position.z=this.cameraFar,this.camera.position.x=0,this.INITIAL_MTL=new THREE.MeshPhongMaterial({color:16777215,shininess:10}),this.INITIAL_MAP=[{index:0,childID:"RootNode",mtl:e.INITIAL_MTL},{index:1,childID:"RootNode2",mtl:e.INITIAL_MTL}],a.setDRACOLoader(new THREE.DRACOLoader),a.load(t,function(t){e.number=-1,e.numberf=1,e.scene.remove(e.theModel),e.theModel=t.scene,e.theModel.traverse(function(t){t.isMesh&&(t.castShadow=!0,t.receiveShadow=!0)}),e.initColor(e.theModel,e.INITIAL_MAP[0].childID,e.INITIAL_MAP[0].mtl),e.scene.add(e.theModel)},void 0,function(t){})},initColor:function(t,e,i){for(var a=t.children[0].children,n=0;n<a.length;n++)a[n].material=i,a[n].isMesh?this.number++:this.numberf++;this.index=this.numberf;var r,s=document.querySelectorAll(".option"),o=Object(m.a)(s);try{for(o.s();!(r=o.n()).done;)r.value.addEventListener("click",this.selectOption)}catch(t){o.e(t)}finally{o.f()}s[0].classList.add("--is-active");for(var l=0;l<s.length;l++)l>=this.number?s[l].style.display="none":s[l].style.display="flex";var t=new THREE.HemisphereLight(16777215,16777215,.61),t=(t.position.set(0,50,0),this.scene.add(t),new THREE.DirectionalLight(16777215,.54)),t=(t.position.set(-8,12,8),t.castShadow=!0,t.shadow.mapSize=new THREE.Vector2(1024,1024),this.scene.add(t),new THREE.PlaneGeometry(5e3,5e3,1,1)),c=new THREE.MeshPhongMaterial({color:15658734,shininess:0}),t=new THREE.Mesh(t,c);t.rotation.x=-.5*Math.PI,t.receiveShadow=!0,t.position.y=-1,this.scene.add(t),this.controls=new THREE.OrbitControls(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.enablePan=!0,this.controls.dampingFactor=.2,this.controls.autoRotate=!1,this.controls.autoRotateSpeed=.1,this.controls.maxDistance=1.5},selectOption:function(t){var e,i=t.target,t=(this.index=t.target.dataset.index,this.index=parseInt(this.index)+parseInt(this.numberf),this.activeOption=t.target.dataset.option,document.querySelectorAll(".option")),a=Object(m.a)(t);try{for(a.s();!(e=a.n()).done;)e.value.classList.remove("--is-active")}catch(t){a.e(t)}finally{a.f()}i.classList.add("--is-active")},animate:function(){var t;this.controls&&this.controls.update(),this.renderer.render(this.scene,this.camera),requestAnimationFrame(this.animate),this.resizeRendererToDisplaySize(this.renderer)&&(t=this.renderer.domElement,this.camera.aspect=t.clientWidth/t.clientHeight,this.camera.updateProjectionMatrix())},resizeRendererToDisplaySize:function(t){var e=t.domElement,i=window.innerWidth,a=window.innerHeight,n=e.width/window.devicePixelRatio,e=e.height/window.devicePixelRatio,n=n!==i||e!==a;return n&&t.setSize(i,a,!1),n},selectSwatch:function(t){var e=this,i=new Image,a=(i.src=t,(new THREE.TextureLoader).load(t)),n=new THREE.MeshPhongMaterial({map:a,shininess:10,opacity:1,transparent:!0});i.onload=function(){a.needsUpdate=!0,e.setMaterial(e.theModel,n)}},setMaterial:function(t,e){t.children[0].children[this.index].material=e}},watch:{picimg:function(t){this.selectSwatch(t)}},created:function(){},mounted:function(){this.initModel(this.MODEL_PATH),this.animate()}},p=(e("df6d"),Object(g.a)(p,function(){var t=this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,t=this._self._c||t;return t("div",{staticClass:"body"},[t("div",{staticClass:"options"},[t("div",{staticClass:"option --is-active",attrs:{title:"拉链","data-option":"RootNode","data-index":"0"}},[t("img",{attrs:{src:"https://crossdiy.didaplan.cn/uploads/20220722/e58be1ad824657a29f54ae8e4b4a35fc.jpg"}})]),t("div",{staticClass:"option",attrs:{title:"正面","data-option":"RootNode2","data-index":"1"}},[t("img",{attrs:{src:"https://crossdiy.didaplan.cn/uploads/20220722/dc633ab40dfc030368fbcf7d825ca53c.jpg"}})])]),t("div",{staticClass:"controls"},[t("div",{staticClass:"info"}),t("div",{staticClass:"tray",attrs:{id:"js-tray"}},[t("div",{staticClass:"tray__slide",attrs:{id:"js-tray-slide"}})])]),t("canvas",{attrs:{id:"c"}})])}],!1,null,"14d53754",null).exports);e("4de4");function y(c,d,u,h,t,g){var f;c.on("click tap ",function(t){var e;t.target!==c&&(Math.max.apply(Math,Object(s.a)(d.children.map(function(t){return t.zIndex()}))),e=d.children.filter(function(t){return"background"===t.attrs.status}),d.children.filter(function(t){return"fill"===t.attrs.name}),0!==e.length&&"background"===t.target.attrs.status?t.target.zIndex(0):(u.moveToTop(),0!==d.find(".grid").length&&d.find(".grid").forEach(function(t){t.moveToTop()})),d.find(".fill").forEach(function(t){t.zIndex(0)})),t.target===c||"fill"===t.target.attrs.name?(u.nodes([]),d.draw()):-1!==t.target.getName().indexOf("rectTransformer")&&t.target!==u.nodes()[0]&&(u.nodes([t.target]),d.draw())}),u.on("transform",function(t){}),h&&(h.on("dblclick",function(t){g(),h.hide(),u.hide(),d.draw();var e=h.absolutePosition(),i=c.container().getBoundingClientRect(),a=(1/(document.body.style.zoom||1)).toFixed(3),n=i.left*a+e.x,i=i.top*a+e.y,r=document.createElement("textarea"),a=(document.body.appendChild(r),r.value=h.text(),r.style.position="absolute",r.style.top=i+"px",r.style.left=n+"px",r.style.width=h.width()-2*h.padding()+"px",r.style.height=h.height()-2*h.padding()+5+"px",r.style.fontSize=h.fontSize()+"px",r.style.border="none",r.style.padding="0px",r.style.margin="0px",r.style.overflow="hidden",r.style.background="none",r.style.outline="none",r.style.resize="none",r.style.letterSpacing=h.letterSpacing()+"px",r.style.lineHeight=h.lineHeight(),r.style.fontFamily=h.fontFamily(),r.style.textDecoration=h.textDecoration(),r.style.transformOrigin="left top",r.style.textAlign=h.align(),r.style.color=h.fill(),h.getRotation()),e="",i=(a&&(e+="rotateZ("+a+"deg)"),0);function s(){r.parentNode.removeChild(r),window.removeEventListener("click",o),h.show(),u.show(),u.forceUpdate(),d.draw()}function o(t){t.target!==r&&(h.text(r.value),s())}-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&(i+=2+Math.round(h.fontSize()/20)),r.style.transform=e+="translateY(-"+i+"px)",r.style.height="auto",r.style.height=r.scrollHeight+3+"px",r.focus(),r.addEventListener("keydown",function(t){13!==t.keyCode||t.shiftKey||(h.text(r.value),s()),27===t.keyCode&&s()}),r.addEventListener("keydown",function(t){var e,i,a=h.getAbsoluteScale().x;a=(a=h.width()*a)||h.placeholder.length*h.fontSize(),e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(e||i)&&(a=Math.ceil(a)),(document.documentMode||/Edge/.test(navigator.userAgent))&&(a+=1),r.style.width=a+"px",r.style.height="auto",r.style.height=r.scrollHeight+h.fontSize()+"px"}),setTimeout(function(){window.addEventListener("click",o)})}),f=0,h.on("tap",function(t){var e,n,i,a,r,s=(new Date).getTime();function o(){n.parentNode.removeChild(n),window.removeEventListener("touchstart",l),h.show(),u.show(),u.forceUpdate(),d.draw()}function l(t){t.target!==n&&(h.text(n.value),o())}s-f<300?(g(),h.hide(),u.hide(),d.draw(),i=h.absolutePosition(),r=c.container().getBoundingClientRect(),a=(1/(document.body.style.zoom||1)).toFixed(3),e=r.left*a+i.x,r=r.top*a+i.y,n=document.createElement("textarea"),document.body.appendChild(n),n.value=h.text(),n.style.position="absolute",n.style.top=r+"px",n.style.left=e+"px",n.style.width=h.width()-2*h.padding()+"px",n.style.height=h.height()-2*h.padding()+5+"px",n.style.fontSize=h.fontSize()+"px",n.style.border="none",n.style.padding="0px",n.style.margin="0px",n.style.overflow="hidden",n.style.background="none",n.style.outline="none",n.style.resize="none",n.style.letterSpacing=h.letterSpacing()+"px",n.style.lineHeight=h.lineHeight(),n.style.fontFamily=h.fontFamily(),n.style.transformOrigin="left top",n.style.textAlign=h.align(),n.style.color=h.fill(),a="",(i=h.getRotation())&&(a+="rotateZ("+i+"deg)"),r=0,-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&(r+=2+Math.round(h.fontSize()/20)),n.style.transform=a+="translateY(-"+r+"px)",n.style.height="auto",n.style.height=n.scrollHeight+3+"px",n.focus(),n.addEventListener("keydown",function(t){13!==t.keyCode||t.shiftKey||(h.text(n.value),o()),27===t.keyCode&&o()}),n.addEventListener("keydown",function(t){var e,i,a=h.getAbsoluteScale().x;a=(a=h.width()*a)||h.placeholder.length*h.fontSize(),e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(e||i)&&(a=Math.ceil(a)),(document.documentMode||/Edge/.test(navigator.userAgent))&&(a+=1),n.style.width=a+"px",n.style.height="auto",n.style.height=n.scrollHeight+h.fontSize()+"px"}),setTimeout(function(){window.addEventListener("touchstart",l)}),0):(f=s,0)}))}function v(e){e.on("mousemove touchmove ",function(t){(t.target===e||(e.container().style.cursor="move","gridLv"===t.target.attrs.name&&(e.container().style.cursor="col-resize"),"gridLh"===t.target.attrs.name&&(e.container().style.cursor="row-resize"),"fill"===t.target.attrs.name))&&(e.container().style.cursor="default")})}e("0481");function b(u,h){u.on("dragmove",function(e){var i,a,n,t,r,s,o,l,c,d;"rectTransformer"===e.target.attrs.name&&(h.find(".guid-line").forEach(function(t){t.destroy()}),i=e.target,a=[0,(c=u).width()/2,c.width()],n=[0,c.height()/2,c.height()],c.find(".rectTransformer").forEach(function(t){t!==i&&(t=t.getClientRect(),a.push([t.x,t.x+t.width,t.x+t.width/2]),n.push([t.y,t.y+t.height,t.y+t.height/2]))}),c.find(".gridLh").forEach(function(t){t.attrs.reference&&t!==i&&(t.attrs.reference,t=t.getClientRect(),a.push([t.x+t.width/2]),n.push([t.y+t.height/2]))}),c.find(".gridLv").forEach(function(t){t.attrs.reference&&t!==i&&(t.attrs.reference,t=t.getClientRect(),a.push([t.x+t.width/2]),n.push([t.y+t.height/2]))}),c={vertical:a.flat(),horizontal:n.flat()},l=e.target,t=l.getClientRect(),l={vertical:[{guide:Math.round(t.x),offset:Math.round(l.x()-t.x),snap:"start"},{guide:Math.round(t.x+t.width/2),offset:Math.round(l.x()-t.x-t.width/2),snap:"center"},{guide:Math.round(t.x+t.width),offset:Math.round(l.x()-t.x-t.width),snap:"end"}],horizontal:[{guide:Math.round(t.y),offset:Math.round(l.y()-t.y),snap:"start"},{guide:Math.round(t.y+t.height/2),offset:Math.round(l.y()-t.y-t.height/2),snap:"center"},{guide:Math.round(t.y+t.height),offset:Math.round(l.y()-t.y-t.height),snap:"end"}]},r=l,s=[],o=[],(t=c).vertical.forEach(function(i){r.vertical.forEach(function(t){var e=Math.abs(i-t.guide);e<5&&s.push({lineGuide:i,diff:e,snap:t.snap,offset:t.offset})})}),t.horizontal.forEach(function(i){r.horizontal.forEach(function(t){var e=Math.abs(i-t.guide);e<5&&o.push({lineGuide:i,diff:e,snap:t.snap,offset:t.offset})})}),t=[],l=s.sort(function(t,e){return t.diff-e.diff})[0],c=o.sort(function(t,e){return t.diff-e.diff})[0],l&&t.push({lineGuide:l.lineGuide,offset:l.offset,orientation:"V",snap:l.snap}),c&&t.push({lineGuide:c.lineGuide,offset:c.offset,orientation:"H",snap:c.snap}),(l=t).length)&&(d=h,l.forEach(function(t){var e;"H"===t.orientation?(e=new Konva.Line({points:[-6e3,t.lineGuide,6e3,t.lineGuide],stroke:"rgb(255, 232, 41)",strokeWidth:2.5,name:"guid-line",dash:[6,6]}),d.add(e),d.batchDraw()):"V"===t.orientation&&(e=new Konva.Line({points:[t.lineGuide,-5e3,t.lineGuide,5e3],stroke:"rgb(255, 232, 41)",strokeWidth:2.5,name:"guid-line",dash:[6,6]}),d.add(e),d.batchDraw())}),l.forEach(function(t){switch(t.snap){case"start":case"center":case"end":switch(t.orientation){case"V":e.target.x(t.lineGuide+t.offset);break;case"H":e.target.y(t.lineGuide+t.offset)}}}))}),u.on("dragend",function(e){h.find(".guid-line").forEach(function(t){t.destroy()}),"rectTransformer"===e.target.attrs.name&&(u.find(".gridLh").forEach(function(t){t.attrs.reference&&t.attrs.Linefollow&&(t.points()[1]=e.target.y()+t.attrs.imagey,t.points()[3]=e.target.y()+t.attrs.imagey)}),u.find(".gridLv").forEach(function(t){t.attrs.reference&&t.attrs.Linefollow&&(t.points()[0]=e.target.x()+t.attrs.imagex,t.points()[2]=e.target.x()+t.attrs.imagex)})),h.batchDraw()})}var H=e("c749"),x=e("ed95"),k=e("22fe"),A=e("099e"),I=e.n(A);function S(){return[Number(document.getElementById("container").style.width.replace("px","")),Number(document.getElementById("container").style.height.replace("px",""))]}function C(t){t.scale().x<0&&t.scale().y<0?t.scale({x:t.scale().x-.1,y:t.scale().y-.1}):t.scale().x<0?t.scale({x:t.scale().x-.1,y:t.scale().y+.1}):t.scale().y<0?t.scale({x:t.scale().x+.1,y:t.scale().y-.1}):t.scale({x:t.scale().x+.1,y:t.scale().y+.1})}function _(t){t.scale().x<0&&t.scale().y<0?t.scale({x:t.scale().x+.1,y:t.scale().y+.1}):t.scale().x<0?t.scale({x:t.scale().x+.1,y:t.scale().y-.1}):t.scale().y<0?t.scale({x:t.scale().x-.1,y:t.scale().y+.1}):t.scale({x:t.scale().x-.1,y:t.scale().y-.1})}function E(t){var e=t.attrs.width,i=t.attrs.height,a=0,n=S();i<e?(a=n[1]/i,e=n[0]*a,i=n[1]):e==i?i=(e=(a=n[0]>n[1]?n[0]/e:n[1]/i,n[0]*a),n[1]):(a=n[0]/e,i=n[1]*a,e=n[0]),t.scale({x:a,y:a}),t.x((n[0]-e)/2+e/2),t.y((n[1]-i)/2+i/2)}function O(t){var e=t.attrs.width,i=t.attrs.height,a=0,n=S();i<e?(a=e/n[0],e=n[0],i/=a):(a=i/n[1],i=n[1],e/=a),t.scale({x:a,y:a}),t.x((n[0]-e)/2+e/2),t.y((n[1]-i)/2+i/2)}var $=e("5530");function L(t,e,i){this.fangda=i,this.canvas=document.createElement("canvas"),this.canvas.width=t*this.fangda,this.canvas.height=e*this.fangda,this.cWidth=t*this.fangda,this.cHeight=e*this.fangda,this._getImage=function(a){return new Promise(function(t,e){var i=new Image;i.crossOrigin="anonymous",i.onload=function(){t(i)},i.src=a})},this._dataURLToBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),a=i.length,n=new Uint8Array(a);a--;)n[a]=i.charCodeAt(a);return new Blob([n],{type:e})}}L.prototype._getImgConfig=function(t){var e=t.width*Math.abs(t.scaleX)*t.canvasZoom*this.fangda,i=t.height*Math.abs(t.scaleY)*t.canvasZoom*this.fangda,a=t.left*t.canvasZoom*this.fangda+t.viewportTransform[0]*this.fangda,n=t.top*t.canvasZoom*this.fangda+t.viewportTransform[1]*this.fangda,r=t.marginLeft*t.canvasZoom*this.fangda,s=t.marginTop*t.canvasZoom*this.fangda,o=t.angle;return Object($.a)({orignW:e,orignH:i,orignL:a,orignT:n,marginLeft:r,marginTop:s,orignAngle:o},t)},L.prototype._returnJingxiangImg=function(r){var s=this;return new Promise(function(e,t){!function(){i.apply(this,arguments)}(function(t){e(t)})});function i(){return(i=Object(o.a)(regeneratorRuntime.mark(function t(e){var i,a,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.image,r.flipX||r.flipY||e(n),i=document.createElement("canvas"),a=i.getContext("2d"),i.width=r.naturalWidth,i.height=r.naturalHeight,r.flipX&&r.flipY?(a.translate(i.width,i.height),a.scale(-1,-1)):r.flipX?(a.translate(i.width,0),a.scale(-1,1)):r.flipY&&(a.translate(0,i.height),a.scale(1,-1)),a.drawImage(n,0,0),a=i.toDataURL("image/png",1),t.next=11,s._getImage(a);case 11:n=t.sent,e(n);case 13:case"end":return t.stop()}},t)}))).apply(this,arguments)}},L.prototype._patternInitData=function(t,e,i){var a=document.createElement("canvas"),n=a.getContext("2d"),r=t.orignW,s=t.orignH,o=t.marginLeft,l=t.marginTop;return"jichu"==e&&(a.width=o+r,a.height=l+s,n.drawImage(i,o/2,l/2,r,s)),"hengxiang"==e&&(a.width=2*o+2*r,a.height=2*l+2*s,n.drawImage(i,o/2,l/2,r,s),n.drawImage(i,1.5*o+r,l/2,r,s),n.drawImage(i,t.naturalWidth/2,0,t.naturalWidth/2,t.naturalHeight,0,1.5*l+s,r/2,s),n.drawImage(i,o+r/2,1.5*l+s,r,s),n.drawImage(i,0,0,t.naturalWidth/2,t.naturalHeight,2*o+1.5*r,1.5*l+s,r/2,s)),"zongxiang"==e&&(a.width=2*o+2*r,a.height=2*l+2*s,n.drawImage(i,o/2,l/2,r,s),n.drawImage(i,o/2,1.5*l+s,r,s),n.drawImage(i,0,t.naturalHeight/2,t.naturalWidth,t.naturalHeight/2,1.5*o+r,0,r,s/2),n.drawImage(i,1.5*o+r,l+s/2,r,s),n.drawImage(i,0,0,t.naturalWidth,t.naturalHeight/2,1.5*o+r,2*l+1.5*s,r,s/2)),"jingxiang"==e&&(a.width=2*o+2*r,a.height=2*l+2*s,t=-r-o/2,e=-s-l/2,n.save(),n.drawImage(i,o/2,l/2,r,s),n.restore(),n.save(),n.scale(-1,1),n.drawImage(i,t-r-o,l/2,r,s),n.restore(),n.save(),n.scale(1,-1),n.drawImage(i,o/2,e-s-l,r,s),n.restore(),n.save(),n.scale(-1,-1),n.drawImage(i,t-r-o,e-s-l,r,s)),n.restore(),a},L.prototype.setPattern=function(){var a=Object(o.a)(regeneratorRuntime.mark(function t(e,i,a){var n,r,s,o,l,c,d,u,h,g,f,m,p,y;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&i){t.next=3;break}return alert("参数传输不正确"),t.abrupt("return");case 3:return t.next=5,this._returnJingxiangImg(e);case 5:if(g=t.sent,n=this.canvas.getContext("2d"),h=this._getImgConfig(e),r=h.orignW,s=h.orignH,o=h.orignL,l=h.orignT,c=h.marginLeft,d=h.marginTop,u=h.orignAngle,n.clearRect(0,0,this.cWidth,this.cHeight),h=this._patternInitData(h,i,g),g=n.createPattern(h,"repeat"),f=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),g.setTransform){t.next=16;break}return alert("浏览器不支持，平铺效果，请切换到谷歌浏览器"),t.abrupt("return");case 16:m=Math.sqrt(Math.pow(h.width,2)+Math.pow(h.height,2)),p=Math.atan(h.height/h.width),p=u*Math.PI/180+p,"left"==e.originX?(c+=2,d+=2,y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(-c/2,-d/2)):(c-=2,d-=2,"jichu"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(r/2+c/2,s/2+d/2):"jingxiang"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(-(r/2+c/2),-(s/2+d/2)):"zongxiang"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(r/2+c/2,0):"hengxiang"==i&&(y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(0,s/2+d/2))),g.setTransform(y),n.fillStyle=g,n.fillRect(0,0,this.cWidth,this.cHeight),a(this._returnCanvasImg());case 25:case"end":return t.stop()}},t,this)}));return function(t,e,i){return a.apply(this,arguments)}}(),L.prototype._returnCanvasImg=function(){return this.canvas.getContext("2d").setTransform(this.fangda,0,0,this.fangda,0,0),this.canvas.toDataURL()};var A=e("90b9"),D=e("a60c"),T=(e("9490"),e("bc3a")),P=e.n(T),T=e("ca08"),z=e.n(T),T=e("d581"),j=(e("1503"),e("bab4")),Z=e.n(j);e("6107");r.a.use([d.a,u.a]);j={name:"SelectAndTransform",status:"image",mixins:[f.c],components:{Swiper:n.Swiper,SwiperSlide:n.SwiperSlide,threed:p,SearchAccount:T.a},props:{category:{type:Array,default:[]},res:{type:Array,default:[]},category1:{type:Array,default:[]},level:{type:Array,default:[]},productList:{type:Object,default:{}},productDetail:{type:Object,default:{}},currentArea:{type:Object,default:{}},imgLoading:{type:Boolean,default:!1},productLoding:{type:Boolean,default:!1},materiaLoding:{type:Boolean,default:!1},sourceList:{type:Object,default:{}},folderList:{type:Array,default:[]},keywordList:{type:Array,default:[]},sizes:{type:Array,default:[]},attr_id:{type:Number,default:0},currentId:{type:String|Number,default:function(){return null}},initProductDetailPsd:{type:Array,default:function(){return[]}}},data:function(){var t=this;return{current_area_w:0,current_area_h:0,current_area_t:0,current_area_l:0,thXimgShow:!1,thXimg:null,coverimgs:!1,edits:!1,shopimage:!1,Gradientcolor3:"#2D0EAD",Gradientcolor4:"#F2CA51",Gradientcolor5:"#522D97",Gradientcolor6:"#A700FD",Gradientcolor7:"#FF0084",blendmode:"screen",mixblendmode:[{name:"正常",value:"normal"},{name:"正片叠底",value:"multiply"},{name:"滤色",value:"screen"},{name:"叠加",value:"overlay"},{name:"变暗",value:"darken"},{name:"变亮",value:"lighten"},{name:"颜色减淡",value:"color-dodge"},{name:"颜色加深",value:"color-burn"},{name:"强光",value:"hard-light"},{name:"柔光",value:"soft-light"},{name:"差值",value:"difference"},{name:"排除",value:"exclusion"},{name:"色相",value:"hue"},{name:"饱和度",value:"saturation"},{name:"颜色",value:"color"},{name:"亮度",value:"luminosity"}],lvjingVisible:!1,lvjingVisible2:!1,lvjingVisible3:!1,lvjingVisible4:!1,lvjingLoading:!1,lvjingLoading2:!1,lvjingLoading3:!1,lvjingLoading4:!1,htmlString:'<div id="lvjingboxx"  style="display: flex;"><div id="lvjing" style="background-image: linear-gradient(to right, Gradientcolor1, Gradientcolor2); visibility: visible; width:700px;margin: 0px; padding: 0px; font-size: 0px; border: 0;"><img id="lvjingimg" style="mix-blend-mode: screen; height: 100%; width: 100%;" src="srcpath"></div></div>',htmlString2:'<div id="lvjingboxx2" style="background-color:Gradientcolor5; visibility: visible;width: 700px;display: flex;"><img id="lvjingimg2" style="mix-blend-mode: hard-light;width: 100%;"src="srcpath"></div>',htmlString3:'<div id="lvjingboxx3" style="visibility: visible;;z-index: auto;width: 700px;font-size: 0;"><div style="background-color: Gradientcolor6;"><img style="width: 100%;opacity: 1;height: 100%;filter: grayscale(1);mix-blend-mode: multiply;object-fit: contain;" src="srcpath"></div><div style="background-color:Gradientcolor7;mix-blend-mode: lighten;position: absolute;top: 0;right: 0;bottom: 0;left: 0;overflow: hidden;"><img style="transform: translateY(10px) scale(-1.4, 1.4);width: 100%;height: 100%;opacity: 1;filter: grayscale(1);mix-blend-mode: multiply;object-fit: contain;" src="srcpath"></div></div>',htmlString4:'<div id="lvjingboxx4"style="visibility: visible;width: 700px;filter: grayscale(1) contrast(1.1) brightness(1.1);display: flex;"><img style="width: 100%;" src="srcpath"></div>',svgXml:[],svgpath:[],cutpiece_index:0,layerimages:{},layerimages2:[],imageindex:0,drawer:!1,picimg:"",images:[],color:"rgba(255,255,255,0)",defaultcolor:"#ffffff",stage:"",layer:"",fill:"",grid:"",transformer:"",tr:"",curImg:"",lucency:100,options:H.a,fontstyleoptions:[{value:"normal",style:"normal",weight:"normal",label:"正常"},{value:"italic",style:"italic",weight:"normal",label:"斜体"},{value:"bold",style:"normal",weight:"bold",label:"加粗"},{value:"italic bold",style:"italic",weight:"bold",label:"加粗斜体"}],textdecorationoptions:[{value:"",label:"无"},{value:"underline",label:"下划线"},{value:"line-through",label:"删除线"}],fontFamily:"Arial",fontColor:"#000000",fontstrokeColor:"#FFFFFF",fontstrokeWidth:0,fontletterSpacing:0,textDecoration:"",fontlineHeight:1,fontSizeStr:40,fontStyle:"normal",textShadowEnabled:!1,textShadowColor:"#2D4571",textShadowOpacity:1,textShadowOffsetX:5,textShadowOffsetY:5,textShadowBlur:2,popovervisible:!1,gradientEnabled:!1,gradientStartX:0,gradientStartY:0,gradientEndX:0,gradientEndY:30,gradientColors:["#ff0000","#0087F5","#ffffff"],fontSize:[],tag:0,click_up:0,click_up2:0,sourceIds:[],shilihua:0,numgo:1,numgo1:2,dwarning:!1,gaoqingtag:0,changetag:1,changetag1:1,yuantulist:[0,0],vcolorpicker:!1,accelerate_img:e("fcb0"),product:{name:"",cid:"",pageNumber:1,pageSize:20,tag:"全部",level:"全部"},material:{userId:"",fid:"",pageNumber:1,pageSize:20,name:"",keywords:[]},cateListProps:{checkStrictly:!0,expandTrigger:"hover"},car:{num:1},currentProduct:"",currentProductIndex:0,currentMaterialIndex:0,swipeOptions:{initialSlide:0,speed:500,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}},swiperOptions1:{initialSlide:0,speed:500,on:{click:function(){alert("你点了Swiper")},slideChange:function(){t.active=t.$refs.redefineSwipe1.$swiper.activeIndex}}},active:0,leftButtonStatus:"product",keywordShow:!0,popShow:!1,layerLength:!0,layerLength1:!0,productColorIndex:0,productSizeIndex:0,scrollImg:0,allLoading:!1,myCropper:null,afterImg:"",ScaleX:1,ScaleY:1,fixed:!1,inputRotate:0,imgFile:"",autoCropWidth:0,autoCropHeight:0,dialogVisible:!1,croploading:!1,lvjingList:[e("97ca"),e("6cc0"),e("5ed4"),e("484f"),e("ea63"),e("bbe1"),e("eda5"),e("602f"),e("a280"),e("d95a"),e("a058"),e("9d6d"),e("5324"),e("cc51")]}},methods:{thInit:function(){var e=this;setTimeout(function(t){e.thinit()},20),setTimeout(function(t){e.stage=e.pageStage,e.fill=e.pageLayer[0].fillLayer,e.layer=e.pageLayer[1].layer,e.transformer=e.pageLayer[2].transformer,e.grid=e.pageLayer[3].gridLayer,e.tr=new w.a.Transformer({name:"tr",status:"",anchorSize:30,anchorCornerRadius:15,borderStrokeWidth:2,centeredScaling:!0,anchorFill:"rgb(0, 161, 255)",enabledAnchors:["bottom-right"]}),e.transformer.add(e.tr),e.transformer.draw(),e.getKonvaScale(),e.stage.find(".gridLh").forEach(function(t){t.destroy()}),e.stage.find(".gridLv").forEach(function(t){t.destroy()}),e.layerimages[""+e.currentArea.id]?e.curDesign(e.currentArea,0,!0):e.moren("https://static.didaplan.cn/source/20240411/64a228fc5555a8f84cd8a8ece88f6679.png")},40)},thSave:function(){var e=this,i=(this.allLoading=!0,[]),t=(this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),this.layerimages[""+this.currentArea.id]=i,this.saveIds(),{union_id:this.$route.query.id,is_online:0,source_ids:this.sourceIds.join(","),extends:JSON.stringify(this.layerimages)});Object(D.n)(t).then(function(t){e.allLoading=!1,1==t.data.code&&e.$router.push({path:"/tkorder",query:{third_no:e.$route.query.third_no}})})},generateImage:function(){document.getElementById("lvjingboxx")&&document.getElementById("lvjingboxx").remove(),this.blendmode="screen";var t=this.htmlString.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1);t=(t=t.replace(new RegExp("Gradientcolor1","gm"),this.Gradientcolor3)).replace(new RegExp("Gradientcolor2","gm"),this.Gradientcolor4);t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer").appendChild(t.body.firstChild)},generateImage2:function(){document.getElementById("lvjingboxx2")&&document.getElementById("lvjingboxx2").remove();var t=(t=this.htmlString2.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1)).replace(new RegExp("Gradientcolor5","gm"),this.Gradientcolor5),t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer2").appendChild(t.body.firstChild)},generateImage3:function(){document.getElementById("lvjingboxx3")&&document.getElementById("lvjingboxx3").remove();var t=this.htmlString3.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1);t=(t=t.replace(new RegExp("Gradientcolor6","gm"),this.Gradientcolor6)).replace(new RegExp("Gradientcolor7","gm"),this.Gradientcolor7);t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer3").appendChild(t.body.firstChild)},generateImage4:function(){document.getElementById("lvjingboxx4")&&document.getElementById("lvjingboxx4").remove();var t=this.htmlString4.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1),t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer4").appendChild(t.body.firstChild),this.startlvjing4()},lvjingblendmode:function(){document.getElementById("lvjingimg").style.mixBlendMode=this.blendmode},startlvjing:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading=!0;var i=new Image,a=this;i.src=this.curImg.attrs.src1,i.onload=function(){var t=document.getElementById("lvjing"),e=(t.style.width=i.width,t.style.height=i.height,document.getElementById("lvjingimg"));e.style.width=i.width,e.style.height=i.height,I.a.toPng(t).then(function(t){var e,t=a.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(a.lvjingVisible=!1,a.lvjingLoading=!1,a.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(x.a)(e).then(function(t){1==t.data.code?(a.lvjingVisible=!1,a.lvjingLoading=!1,a.$message.success("合成完成 添加进画布"),a.lingshiceshi(t.data.data.url)):a.messageBox(t)}))}).catch(function(t){a.lvjingLoading=!1,a.$message.error(t)})}},startlvjing2:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading2=!0;var i=new Image,a=this;i.src=this.curImg.attrs.src1,i.onload=function(){var t=document.getElementById("lvjingboxx2"),e=(t.style.width=i.width,t.style.height=i.height,document.getElementById("lvjingimg2"));e.style.width=i.width,e.style.height=i.height,I.a.toPng(t).then(function(t){var e,t=a.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(a.lvjingVisible2=!1,a.lvjingLoading2=!1,a.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(x.a)(e).then(function(t){1==t.data.code?(a.lvjingVisible2=!1,a.lvjingLoading2=!1,a.$message.success("合成完成 添加进画布"),a.lingshiceshi(t.data.data.url)):a.messageBox(t)}))}).catch(function(t){a.lvjingLoading2=!1,a.lvjingVisible2=!1,a.$message.error(t)})}},startlvjing3:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading3=!0;var e=new Image,i=this;e.src=this.curImg.attrs.src1,e.onload=function(){var t=document.getElementById("lvjingboxx3");t.style.width=e.width,t.style.height=e.height,I.a.toPng(t).then(function(t){var e,t=i.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(i.lvjingVisible3=!1,i.lvjingLoading3=!1,i.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(x.a)(e).then(function(t){1==t.data.code?(i.lvjingVisible3=!1,i.lvjingLoading3=!1,i.$message.success("合成完成 添加进画布"),i.lingshiceshi(t.data.data.url)):i.messageBox(t)}))}).catch(function(t){i.lvjingLoading3=!1,i.lvjingVisible3=!1,i.$message.error(t)})}},startlvjing4:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading4=!0;var e=new Image,i=this;e.src=this.curImg.attrs.src1,e.onload=function(){var t=document.getElementById("lvjingboxx4");t.style.width=e.width,t.style.height=e.height,I.a.toPng(t).then(function(t){var e,t=i.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(i.lvjingVisible4=!1,i.lvjingLoading4=!1,i.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(x.a)(e).then(function(t){1==t.data.code?(i.lvjingVisible4=!1,i.lvjingLoading4=!1,i.$message.success("合成完成 添加进画布"),i.lingshiceshi(t.data.data.url)):i.messageBox(t)}))}).catch(function(t){i.lvjingLoading4=!1,i.lvjingVisible4=!1,i.$message.error(t)})}},showlvjing:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage()},0)},showlvjing2:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage2()},0)},showlvjing3:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage3()},0)},showlvjing4:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage4()},0)},cutout:function(){var e=this;this.allLoading=!0,Object(k.e)(this.curImg.attrs.src).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},styleTransfer:function(t){var e=this;this.allLoading=!0,Object(k.t)(this.curImg.attrs.src,-1!=t.indexOf("static")?t:"https://www.didaplan.cn/"+t).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},imageClarity:function(){var e=this;this.allLoading=!0,Object(k.o)(this.curImg.attrs.src1).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},cropimage:function(){this.dialogVisible=!0},show:function(){var t=this;setTimeout(function(){t.initcrop()},0)},changeD:function(t){var e=document.getElementsByClassName("changeb"),i=document.getElementsByClassName("body");0==t?(e[0].classList.add("actionb"),e[1].classList.remove("actionb"),i[0].style.zIndex=1000001):(e[1].classList.add("actionb"),e[0].classList.remove("actionb"),i[0].style.zIndex=0)},clickChange:function(t){"product"===t&&"product"!=this.leftButtonStatus?this.leftButtonStatus="product":"image"===t?this.$refs.file.click():"Material"==t&&"Material"!=this.leftButtonStatus?(this.material.userId="",this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("getMaterial"),this.leftButtonStatus="Material"):"goshop"==t&&this.$router.push("/mobile-product-library")},addFont:function(){var t=this.layer,e=(this.transformer,this.stage),i=1/(this.gradientColors.length-1),a=[],n=(this.gradientColors.forEach(function(t,e){a.push(e*i,t)}),null==this.fontColor&&(this.fontColor="#000000"),new w.a.Text({text:"37POD DESIGN",x:0,y:20,fontSize:20,draggable:!0,width:this.current_area_w,name:"rectTransformer",rotation:0,fontStyle:this.fontStyle,textDecoration:this.textDecoration,fontFamily:this.fontFamily,shadowEnabled:this.textShadowEnabled,shadowColor:this.textShadowColor,shadowBlur:this.textShadowBlur,shadowOpacity:this.textShadowOpacity,shadowOffsetX:this.textShadowOffsetX,shadowOffsetY:this.textShadowOffsetY,stroke:this.fontstrokeColor,strokeWidth:this.fontstrokeWidth,shadowForStrokeEnabled:!1,gradientEnabled:!1,letterSpacing:this.fontletterSpacing,backgroundColor:"#000000",fill:this.fontColor,fillLinearGradientStartPoint:{x:this.gradientStartX,y:this.gradientStartY},fillLinearGradientEndPoint:{x:this.gradientEndX,y:this.gradientEndY},fillLinearGradientColorStops:a,align:"center",lineHeight:this.fontlineHeight}));this.gradientEnabled=!1,t.add(n),(this.curImg=n).on("transform",function(){n.setAttrs({width:n.width()*n.scaleX(),scaleY:1,scaleX:1})}),this.keydown(e,t,this.tr),y(e,t,this.tr,n,this.currentArea.id,this.deletCurImg),v(e),b(e,t),this.fontSizeStr=20},deletCurImg:function(){this.curImg=""},colorPicker:function(){this.$refs.colorPicker.click()},handleClear:function(t){null==this.color&&(this.color="rgba(255,255,255,0)")},getcolor:function(){document.getElementById("getcolor").click()},nativePick:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.color=e);case 3:case"end":return t.stop()}},t)}))()},nativePick2:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor3=e);case 3:case"end":return t.stop()}},t)}))()},nativePick3:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor4=e);case 3:case"end":return t.stop()}},t)}))()},nativePick4:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor5=e);case 3:case"end":return t.stop()}},t)}))()},nativePick5:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor6=e);case 3:case"end":return t.stop()}},t)}))()},nativePick6:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor7=e);case 3:case"end":return t.stop()}},t)}))()},addImage:function(t){var e,i=this,t=t.target.files[0];20<Number(t.size/1024/1024)?this.$msgbox({title:"",message:"文件大小不能超过20MB，请重新上传。",type:"warning"}):((e=new FormData).append("file",t),e.append("fid",0),document.getElementsByClassName("input-opacity")[0].value="",this.allLoading=!0,P.a.post("http://crossdiy.didaplan.cn/api/my_source/upLoad",e,{headers:{token:"7ab2fe54-47b3-408d-ada2-bc632ee0d15c"}}).then(function(t){1==t.data.code?i.lingshiceshi(t.data.data.img_url):(i.allLoading=!1,i.$message.error(t.data.msg))}).catch(function(t){i.allLoading=!1,i.$message.error(t.data.msg)}))},changekim:function(){this.coverimgs=!0},drawGrid:function(){var t=this.grid;if(0==t.find(".grid").length){for(var e=0;e<10;e++){var i=new w.a.Line({points:[0,a=60*e,600,a],stroke:"#ededed",strokeWidth:.5,lineCap:"round",lineJoin:"round",name:"grid",visible:!0}),a=new w.a.Line({points:[a,0,a,600],stroke:"#ededed",strokeWidth:.5,lineCap:"round",lineJoin:"round",name:"grid",visible:!0});t.add(i,a)}t.batchDraw()}else t.find(".grid").forEach(function(t){t.destroy()})},addElemP:function(t){for(var e=0;e<this.layer.children.length;e++)if(this.layer.children[e].attrs.hasOwnProperty("pingpu")){this.layer.children.splice(e,1);break}this.transformer.children.forEach(function(t){t.nodes([])});var i=this.layer,t=(this.fill,this.transformer,this.grid,this.stage,new w.a.Image(t));t.cache(!1),i.add(t),t.moveToBottom(),this.save()},addElemnew:function(t){var e=this.layer,i=(this.fill,this.transformer,this.grid,this.stage),a=(this.transformer.children.forEach(function(t){t.nodes([])}),(new Date).getTime().toString()),a=(t.timestamp=a,new w.a.Image(t));a.cache(!1),e.add(a),this.curImg=a,1==t.putu&&this.setPatternf(t.putustr,a),"background"===t.status&&a.zIndex(0),t.status;this.keydown(i,e,this.tr),y(i,e,this.tr,"",this.currentArea.id,this.deletCurImg),v(i),b(i,e)},addElem:function(t){var e=this.layer,i=(this.fill,this.transformer,this.grid,this.stage),a=(this.transformer.children.forEach(function(t){t.nodes([])}),(new Date).getTime().toString()),a=(t.timestamp=a,new w.a.Image(t));a.cache(!1),e.add(a),this.curImg=a,1==t.putu&&this.setPatternf(t.putustr,a),"background"===t.status&&a.zIndex(0),t.status;this.keydown(i,e,this.tr),y(i,e,this.tr,"",this.currentArea.id,this.deletCurImg),v(i),b(i,e),this.tr.nodes([a])},setPattern_change:function(t){var i,a,e,n;1==this.curImg.attrs.putu&&(this.click_up=0,this.click_up2=0,this.transformer.children.forEach(function(t){t.nodes([])}),this.pageLayer[1].layer.children.length)&&(e=new L((i=this).current_area_w,i.current_area_h,i.numgo1),this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,(a=this.curImg.attrs).width=a.naturalWidth,a.height=a.naturalHeight,a.viewportTransform=[a.x,a.y],e.setPattern(a,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/i.numgo1,scaleY:1/i.numgo1,pingpu:1,sourceid:a.sourceid};i.curImg.moveToBottom(),i.addElemP(t)}}),e=a.naturalWidth,t=a.naturalHeight,Number(e)>Number(t)?(n=e/i.current_area_w,e=i.current_area_w,t/=n):(n=t/i.current_area_h,t=i.current_area_h,e/=n),a.width=e,a.height=t)},clearrect:function(){var t;this.layer.children[0]&&this.layer.children[0].attrs.hasOwnProperty("pingpu")&&(t=this.layer.children[0],this.transformer.children[0].nodes([]),t.destroy(),this.save())},chexiao:function(){0<=this.imageindex-1&&(this.imageindex--,this.imageDesign(this.layerimages2[this.imageindex]))},chonzuo:function(){this.imageindex+1<this.layerimages2.length&&(this.imageindex++,this.imageDesign(this.layerimages2[this.imageindex]))},setPattern:function(t){if(this.click_up2=0,this.transformer.children.forEach(function(t){t.nodes([])}),0!=this.tag&&this.layer.children.forEach(function(t){t.attrs.putu=0}),"jichu"==t){var e=document.getElementById("btn1"),i=document.getElementById("btn2"),a=document.getElementById("btn3"),n=document.getElementById("btn4");if(1==this.tag)return this.tag=0,this.clearrect(),e.style.color="black",void(e.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=1,e.style.color="white",e.style.backgroundColor="var(--style-color-design)",i.style.color="black",i.style.backgroundColor="#f5f5f5",a.style.color="black",a.style.backgroundColor="#f5f5f5",n.style.color="black",n.style.backgroundColor="#f5f5f5"}if("jingxiang"==t){if(2==this.tag)return this.tag=0,this.clearrect(),btn2.style.color="black",void(btn2.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=2,btn2.style.color="white",btn2.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn3.style.color="black",btn3.style.backgroundColor="#f5f5f5",btn4.style.color="black",btn4.style.backgroundColor="#f5f5f5"}if("zongxiang"==t){if(3==this.tag)return this.tag=0,this.clearrect(),btn3.style.color="black",void(btn3.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=3,btn3.style.color="white",btn3.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn2.style.color="black",btn2.style.backgroundColor="#f5f5f5",btn4.style.color="black",btn4.style.backgroundColor="#f5f5f5"}if("hengxiang"==t){if(4==this.tag)return this.tag=0,this.clearrect(),btn4.style.color="black",void(btn4.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=4,btn4.style.color="white",btn4.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn2.style.color="black",btn2.style.backgroundColor="#f5f5f5",btn3.style.color="black",btn3.style.backgroundColor="#f5f5f5"}var r,s;this.pageLayer[1].layer.children.length&&(e=new L((r=this).current_area_w,this.current_area_h,r.numgo1),(s=r.curImg.attrs).width=s.naturalWidth,s.height=s.naturalHeight,s.viewportTransform=[s.x,s.y],e.setPattern(s,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/r.numgo1,scaleY:1/r.numgo1,pingpu:1,sourceid:s.sourceid};r.curImg.moveToBottom(),r.addElemP(t)}}),i=s.naturalWidth,a=s.naturalHeight,Number(i)>Number(a)?(n=i/this.current_area_w,i=this.current_area_w,a/=n):(e=a/this.current_area_h,a=this.current_area_h,i/=e),s.width=i,s.height=a)},setPatternf:function(t,i){var a,n,e,r,s,o;document.getElementById("btn1")?("jichu"==t&&(document.getElementById("btn1")&&(e=document.getElementById("btn1"),o=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),e.style.color="white",e.style.backgroundColor="var(--style-color-design)",o.style.color="black",o.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),this.tag=1),"jingxiang"==t&&(this.tag=2,document.getElementById("btn1"))&&(e=document.getElementById("btn1"),o=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),o.style.color="white",o.style.backgroundColor="var(--style-color-design)",e.style.color="black",e.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),"zongxiang"==t&&(this.tag=3,document.getElementById("btn1"))&&(o=document.getElementById("btn1"),e=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),r.style.color="white",r.style.backgroundColor="var(--style-color-design)",o.style.color="black",o.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),"hengxiang"==t&&(this.tag=4,document.getElementById("btn1"))&&(r=document.getElementById("btn1"),o=document.getElementById("btn2"),e=document.getElementById("btn3"),(s=document.getElementById("btn4")).style.color="white",s.style.backgroundColor="var(--style-color-design)",r.style.color="black",r.style.backgroundColor="#f5f5f5",o.style.color="black",o.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5")):("jichu"==t&&(this.tag=1),"jingxiang"==t&&(this.tag=2),"zongxiang"==t&&(this.tag=3),"hengxiang"==t&&(this.tag=4)),this.pageLayer[1].layer.children.length&&(s=new L((a=this).current_area_w,this.current_area_h,a.numgo1),(n=i.attrs).width=n.naturalWidth,n.height=n.naturalHeight,n.viewportTransform=[n.x,n.y],s.setPattern(n,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/a.numgo1,scaleY:1/a.numgo1,pingpu:1,sourceid:n.sourceid};i.moveToBottom(),a.addElemP(t)}}),r=n.naturalWidth,o=n.naturalHeight,Number(r)>Number(o)?(e=r/a.current_area_w,r=a.current_area_w,o/=e):(s=o/a.current_area_h,o=a.current_area_h,r/=s),n.width=r,n.height=o)},rightButton:function(t){var e,i,a,n,r,s,o,l,c,d,u,h,g,f,m,p,y,v=this,b=this.curImg;if("rectTransformer"==b.attrs.name)switch(t){case"vertical":p=(m=b).scaleX(),y=m.scaleY(),m.scale({x:p,y:y*=-1}),0==m.attrs.flipY?m.attrs.flipY=1:m.attrs.flipY=0;break;case"horizontal":y=(p=b).scaleX(),m=p.scaleY(),p.scale({x:y*=-1,y:m}),0==p.attrs.flipX||-1==p.attrs.flipX?(p.attrs.flipX=1,p.attrs.angle1=p.attrs.rotation):p.attrs.flipX=0;break;case"top":this.save(),"background"!=(f=b).attrs.status&&f.moveToTop();break;case"bottom":this.save(),"background"!=(f=b).attrs.status&&f.moveToBottom();break;case"up":b.moveUp(),this.save();break;case"down":"background"!=(g=b).attrs.status&&g.moveDown(),this.save();break;case"copy":null==b.attrs.text?((e=JSON.parse(JSON.stringify(b.attrs))).x+=10,e.y+=10,(i=new window.Image).crossOrigin="anonymous",i.src=e.src,r=e.src,s=e.src1,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:-1,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:e.x,y:e.y,rotation:0,offset:{x:a/2,y:n/2},scaleX:e.scaleX,scaleY:e.scaleY,flipX:e.flipX,flipY:e.flipY,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,naturalWidthB:e.naturalWidthB,naturalHeightB:e.naturalHeightB,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};v.images.push(t),v.addElem(t)}):((g=JSON.parse(JSON.stringify(b.attrs))).x+=10,g.y+=10,h=new w.a.Text(g),this.layer.add(h));break;case"delet":null!=b.attrs.text?(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",b.destroy(),this.edits=!1):1!=b.attrs.putu&&(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",b.destroy(),this.edits=!1);break;case"LeftAlignment":(h=b).x(h.width()*h.scaleX()/2);break;case"Center":d=b,u=S(),d.x(u[0]/2);break;case"RightAlignment":d=b,u=S(),d.x(u[0]-d.width()*d.scaleX()/2);break;case"TopAlignment":(c=b).y(c.height()*c.scaleY()/2);break;case"VerticalAlignment":c=b,l=S(),c.y(l[1]/2);break;case"BottomAlignment":l=b,o=S(),l.y(o[1]-l.height()*l.scaleY()/2);break;case"ClockwiseRotation":b.rotate(45);break;case"CounterclockwiseRotation":b.rotate(-45);break;case"amplification":null!=b.attrs.text?this.fontSizeStr<200&&(this.fontSizeStr+=2,this.curImg.setFontSize(this.fontSizeStr),this.MinwidthFontSize(this.curImg)):C(b),this.save();break;case"narrow":null!=b.attrs.text?12<this.fontSizeStr&&(this.fontSizeStr-=2,this.curImg.setFontSize(this.fontSizeStr)):_(b),this.save();break;case"imageFill":E(b);break;case"imageAdaptive":O(b);break;case"fontLeft":b.setAlign("left");break;case"fontCenter":b.setAlign("center");break;case"fontRight":b.setAlign("right");break;default:return}},jilu:function(){var t=this,e=[];this.save(),t.imageindex++,t.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(t.color),t.layerimages2[t.imageindex]=JSON.parse(JSON.stringify(e)),t.layerimages2=t.layerimages2.slice(0,t.imageindex+1)},addgroup:function(){this.curImg&&(this.curImg.draggable(!1),this.group.add(this.curImg))},keydown:function(r,t,c){var s=this,d=(r.off(),this),u="",e=(r.on("mousedown touchstart tap",function(e){if(e.target!=r){if("gridLv"!==e.target.attrs.name&&"gridLh"!==e.target.attrs.name){if(d.click_up2=1,"rectTransformer"===e.target.attrs.name){if(r.find(".gridLh").forEach(function(t){t.attrs.reference&&(t.attrs.imagey=t.points()[1]-e.target.y())}),r.find(".gridLv").forEach(function(t){t.attrs.reference&&(t.attrs.imagex=t.points()[0]-e.target.x())}),e.target.attrs.hasOwnProperty("sourceid")&&(d.click_up2=e.target.attrs,d.click_up=1),d.curImg=e.target,u=e.target,c.nodes([u]),null!=d.curImg.attrs.text){if(d.fontSizeStr=d.curImg.attrs.fontSize,d.fontFamily=d.curImg.attrs.fontFamily,d.fontstrokeColor=d.curImg.attrs.stroke,d.fontStyle=d.curImg.attrs.fontStyle,d.fontstrokeWidth=d.curImg.attrs.strokeWidth,d.fontlineHeight=d.curImg.attrs.lineHeight,d.textDecoration=d.curImg.attrs.textDecoration,d.textShadowEnabled=d.curImg.shadowEnabled(),d.textShadowColor=d.curImg.shadowColor().toString(),d.textShadowBlur=d.curImg.shadowBlur(),d.textShadowOpacity=d.curImg.shadowOpacity(),d.textShadowOffsetX=d.curImg.shadowOffsetX(),d.textShadowOffsetY=d.curImg.shadowOffsetY(),d.gradientEnabled=d.curImg.attrs.gradientEnabled,d.gradientEnabled){for(var t=[],i=d.curImg.fillLinearGradientColorStops(),a=0;a<i.length;a+=2){var n=i[a+1];t.push(n)}d.gradientColors=t}else d.fontColor=d.curImg.attrs.fill;d.gradientStartX=d.curImg.fillLinearGradientStartPointX(),d.gradientStartY=d.curImg.fillLinearGradientStartPointY(),d.gradientEndX=d.curImg.fillLinearGradientEndPointX(),d.gradientEndY=d.curImg.fillLinearGradientEndPointY()}}else u="fill"===e.target.attrs.name?d.curImg="":(d.curImg=d.curImg,d.curImg);e.target.attrs.hasOwnProperty("pingpu")&&(d.curImg=d.curImg,""!=(u=d.curImg))&&c.nodes([u])}}else u="",d.curImg="",s.transformer.children.forEach(function(t){t.nodes([])})}),r.on("mouseup touchend",function(t){2==d.click_up2&&(d.click_up2=0),1==d.click_up&&"rectTransformer"===t.target.attrs.name&&null!=t.target.attrs.image&&s.$refs.file.click(),2==d.click_up&&(1==d.tag&&s.setPattern_change("jichu"),2==d.tag&&s.setPattern_change("jingxiang"),3==d.tag&&s.setPattern_change("zongxiang"),4==d.tag)&&s.setPattern_change("hengxiang"),d.click_up=0}),r.on("mousemove touchmove",function(t){t.target.attrs.hasOwnProperty("sourceid")&&1==d.click_up&&t.target.attrs!=d.click_up2&&(d.click_up=2),1==d.click_up2&&(d.click_up2=2)}),r.container());e.tabIndex=1,e.focus();e.addEventListener("keydown",function(t){var e,i,a,n,r,s,o=t.ctrlKey,l=t.altKey;if(t.shiftKey&&82===t.keyCode&&d.emptyCanvas2(),""!==u&&"rectTransformer"==u.attrs.name){if(37===t.keyCode)u.x(u.x()-1);else if(38===t.keyCode)u.y(u.y()-1);else if(39===t.keyCode)u.x(u.x()+1);else if(40===t.keyCode)u.y(u.y()+1);else if(o&&81===t.keyCode)u.rotate(-45);else if(l&&81===t.keyCode)u.rotate(45);else if(o&&90===t.keyCode)null!=u.attrs.text?d.fontSizeStr<200&&(d.fontSizeStr+=2,d.curImg.setFontSize(d.fontSizeStr),d.MinwidthFontSize(d.curImg)):C(u),d.save();else if(l&&90===t.keyCode)null!=u.attrs.text?12<d.fontSizeStr&&(d.fontSizeStr-=2,d.curImg.setFontSize(d.fontSizeStr)):_(u),d.save();else if(46===t.keyCode)null!=u.attrs.text?(d.transformer.children.forEach(function(t){t.nodes([])}),d.curImg="",u.destroy()):1!=u.attrs.putu&&(d.transformer.children.forEach(function(t){t.nodes([])}),d.curImg="",u.destroy());else if(o&&83===t.keyCode)alert("保存");else if(o&&67===t.keyCode)"background"===u.attrs.status?alert("背景图片不可复制"):null==u.attrs.text&&((e=JSON.parse(JSON.stringify(u.attrs))).x+=10,e.y+=10,(i=new window.Image).crossOrigin="anonymous",i.src=e.src,r=e.src,s=e.src1,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:-1,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:e.x,y:e.y,rotation:0,offset:{x:a/2,y:n/2},scaleX:e.scaleX,scaleY:e.scaleY,flipX:e.flipX,flipY:e.flipY,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,naturalWidthB:e.naturalWidthB,naturalHeightB:e.naturalHeightB,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};d.images.push(t),d.addElem(t)});else{if(o&&66===t.keyCode)E(u);else{if(!l||66!==t.keyCode)return;O(u)}c.nodes([])}o&&t.keyCode,t.preventDefault()}})},moren:function(t){var i,a,n,r,s,o=this;null==t||""==t?this.$message.error("无素材"):(this.allLoading=!0,(i=new window.Image).crossOrigin="anonymous",i.src=t+"?imageView2/1/w/".concat(this.current_area_w,"/h/").concat(this.current_area_h),r=t+"?imageView2/1/w/".concat(this.current_area_w,"/h/").concat(this.current_area_h),s=t+"?imageView2/1/w/".concat(this.current_area_w,"/h/").concat(this.current_area_h),i.onload=function(){a=i.width;var t=1,e=1,e=(n=i.height)<a?(t=a/o.current_area_w,a=o.current_area_w,n/=t,o.current_area_h/n):(t=n/o.current_area_h,n=o.current_area_h,a/=t,o.current_area_w/a),t={sourceid:0,src:r,src1:s,moren:1,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:(o.current_area_w-a)/2+a/2,y:(o.current_area_h-n)/2+n/2,rotation:0,offset:{x:a/2,y:n/2},scaleX:e,scaleY:e,left:0,top:0,flipX:0,flipY:0,putu:0,naturalWidth:Number(i.width),naturalHeight:Number(i.height),canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};o.images.push(t),o.addElem(t),o.allLoading=!1})},save:Object(A.a)(function(){var e=[],t=(window._this.layer.find(".guid-line").forEach(function(t){e.push(t),t.destroy()}),window._this.grid.find(".grid").forEach(function(t){t.hide()}),window._this.grid.find(".gridLh").forEach(function(t){t.hide()}),window._this.grid.find(".gridLv").forEach(function(t){t.hide()}),window._this.stage.toDataURL({mimeType:"image/webp",pixelRatio:1}));e.forEach(function(t){window._this.layer.add(t),window._this.layer.batchDraw()}),window._this.grid.find(".grid").forEach(function(t){t.show()}),window._this.grid.find(".gridLh").forEach(function(t){t.show()}),window._this.grid.find(".gridLv").forEach(function(t){t.show()});window._this.$emit("getDesignTemp","",window._this.currentArea,window._this.scrollImg,t,t)},29),dataURLtoFile:function(t,e){for(var t=t.split(","),i=t[0].match(/:(.*?);/)[1],a=atob(t[1]),n=a.length,r=new Uint8Array(n);n--;)r[n]=a.charCodeAt(n);for(var s=0;s<window._this.layer.children.length;s++)if(window._this.layer.children[s].attrs.hasOwnProperty("pingpu")){window._this.layer.children[s].moveToBottom(),0==this.tag&&this.clearrect();break}return new File([r],e,{type:i})},emptyCanvas2:function(){var e=this,i=(this.click_up2=0,this.stage.off(),this.stageons(),this.layerimages2=[],this.imageindex=0,this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),this.fill.children.forEach(function(t){t.destroy()}),this.color="rgba(255,255,255,0)",0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),[]);this.color="rgba(255,255,255,0)",i.push(this.color),this.productDetail.design_list.forEach(function(t){t!=e.currentArea&&(e.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)))}),this.$emit("emptyC"),this.clearrect(),this.curImg="",this.save()},emptyCanvas:function(){this.stage.off(),this.stageons(),this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),this.fill.children.forEach(function(t){t.destroy()}),this.color="rgba(255,255,255,0)",0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),this.clearrect(),this.save()},chehuiemptyCanvas:function(){this.stage.off(),this.stageons(),this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),this.clearrect(),this.save()},pickFontFamily:function(){var t=this;this.curImg.setFontFamily(this.fontFamily),document.fonts.ready.then(function(){t.curImg.setFontFamily(""),t.curImg.setFontFamily(t.fontFamily)})},pickFontColor:function(){this.gradientEnabled||(null==this.fontColor&&(this.fontColor="#000000"),this.curImg.setFill(this.fontColor))},pickFontStrokeColor:function(){this.curImg.setStroke(this.fontstrokeColor)},MinwidthFontSize:function(t){t.setAttr("width",Math.max(t.fontSize()+70,t.width()))},pickFontSize:function(){this.curImg.setFontSize(this.fontSizeStr),this.MinwidthFontSize(this.curImg)},pickFontStyle:function(){this.curImg.setAttrs({fontStyle:this.fontStyle})},pickFontDecoration:function(){this.curImg.setAttrs({textDecoration:this.textDecoration})},pickFontstrokeWidth:function(){this.curImg.strokeWidth(this.fontstrokeWidth)},pickFontlineHeight:function(){this.curImg.lineHeight(this.fontlineHeight)},pickfontletterSpacing:function(){this.curImg.letterSpacing(this.fontletterSpacing)},toggleGradient:function(t){this.gradientEnabled=t,(this.curImg.attrs.gradientEnabled=t)?(this.curImg.setFill(""),this.updateGradient()):(null==this.fontColor&&(this.fontColor="#000000"),this.curImg.setFill(this.fontColor))},getRandomColor:function(){for(var t="#",e=0;e<6;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t},addGradientColor:function(){var t;this.gradientColors.length<10&&(t=this.getRandomColor(),this.gradientColors.push(t),this.updateGradient())},delGradientColor:function(){2<this.gradientColors.length&&(this.gradientColors.pop(),this.updateGradient())},updateGradient:function(){var i=1/(this.gradientColors.length-1),a=[];this.gradientColors.forEach(function(t,e){a.push(e*i,t)}),this.curImg.fillLinearGradientColorStops(a),this.curImg.fillLinearGradientStartPoint({x:this.gradientStartX,y:this.gradientStartY}),this.curImg.fillLinearGradientEndPoint({x:this.gradientEndX,y:this.gradientEndY})},toggleTextShadow:function(t){this.textShadowEnabled=t,this.curImg.shadowEnabled(this.textShadowEnabled)},pickTextShadowColor:function(){this.curImg.shadowColor(this.textShadowColor)},pickTextShadowOpacity:function(){this.curImg.shadowOpacity(this.textShadowOpacity)},pickTextShadowOffsetX:function(){this.curImg.shadowOffsetX(this.textShadowOffsetX)},pickTextShadowOffsetY:function(){this.curImg.shadowOffsetY(this.textShadowOffsetY)},pickTextShadowBlur:function(){this.curImg.shadowBlur(this.textShadowBlur)},setCategory:function(){this.$refs.selectDeptRef?this.$refs.selectDeptRef.dropDownVisible=!1:this.$refs.selectDeptRef1.dropDownVisible=!1,this.$refs.selectDeptRef.panel.initStore(),this.productSearch()},setCategory1:function(){this.$refs.selectDeptRef?this.$refs.selectDeptRef.dropDownVisible=!1:this.$refs.selectDeptRef1.dropDownVisible=!1,this.$refs.selectDeptRef1.panel.initStore(),this.materialSearch()},productMove:function(t){""==this.currentProduct&&(this.currentProduct=t)},cutpiece:function(){var a=this;this.svgXml=[],this.cutpiece_index=0,this.svgpath.forEach(function(t,i){P.a.get(t).then(function(t){var e=t.data;e=(e=e.replace(new RegExp("<svg","gm"),"<svg style='width: 100%;height: 100%;'")).replace(new RegExp("https://www.didaplan.cn/3D/ewm.png","gm"),"data:image/webp;base64,UklGRmwMAABXRUJQVlA4WAoAAAAwAAAArwQArwQASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBISwAAAAEHEBERAFCk//8pov+p//3vf//73//+97///e9///vf//73v//973//+9///ve///3vf//73//+97///e9///vf//73v//97/+kAQBWUDggKgoAAPAxAZ0BKrAEsAQ+bTaZSaQjIqEgCACADYlpbuF3YRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/6wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="),a.res.forEach(function(t){e=e.replace(new RegExp("https://www.didaplan.cn/3D/"+t.name+".png","gm"),t.content)}),a.svgXml.push(e),i==a.svgpath.length-1&&(a.drawer=!0)}).catch(function(t){a.$message.error("裁件配置错误！")})})},productDown:function(t){this.shilihua=0,this.scrollImg=0,this.$emit("clickProduct",t),this.productColorIndex=0,this.productSizeIndex=0,this.shopimage=!1},materialDown:function(t,e){var i,a,n=this,r=0,s=(this.currentMaterialIndex=e,new window.Image),o=(s.crossOrigin="anonymous",s.src=t.thumb1200,t.thumb1200),l=t.img_url;s.onload=function(){var t;0==r&&(r=1,i=s.width,(a=s.height)<i?(t=i/n.current_area_w,i=n.current_area_w,a/=t):(t=a/n.current_area_h,a=n.current_area_h,i/=t),t={sourceid:n.sourceList.source_list[e].id,src:o,src1:l,name:"rectTransformer",image:s,width:i,height:a,draggable:!0,x:(n.current_area_w-i)/2+i/2,y:(n.current_area_h-a)/2+a/2,rotation:0,offset:{x:i/2,y:a/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:s.width,naturalHeight:s.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]},n.images.push(t),n.addElem(t))}},productLeave:function(t){this.currentProduct=""},lingshiceshi:function(a){var n=this,r=(this.allLoading=!0,new window.Image),s=((new Date).getTime().toString(),r.crossOrigin="anonymous",r.src=a+"?imageView2/2/w/1200",0),o=0;this.curImg&&(s=this.curImg.attrs.sourceid,o=this.curImg.attrs.rotation),r.onerror=function(){n.allLoading=!1,n.$message.error("素材加载出错！")},r.onload=function(){n.transformer.children.forEach(function(t){t.nodes([])}),n.curImg&&n.curImg.destroy();var t,e=r.width,i=r.height,e=(i<e?(t=e/n.current_area_w,e=n.current_area_w,i/=t):(t=i/n.current_area_h,i=n.current_area_h,e/=t),t={sourceid:s,src:a+"?imageView2/2/w/1200",src1:a,name:"rectTransformer",image:r,width:e,height:i,draggable:!0,x:(n.current_area_w-e)/2+e/2,y:(n.current_area_h-i)/2+i/2,rotation:0,offset:{x:e/2,y:i/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:r.width,naturalHeight:r.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:void 0},Object(l.a)(t,"rotation",o),Object(l.a)(t,"viewportTransform",[0,0]),t);n.images.push(e),n.addElem(e),n.allLoading=!1}},imageDesign:function(t){var r,e,s=this,o=this;null!=t?(r=[],t.forEach(function(t,e){var i,a,n;null!=t.image?(i=new window.Image,(new Date).getTime().toString(),i.crossOrigin="anonymous",i.src=t.src,o.images.push(t),i.onload=function(){t.image=i,r[e]=t}):null!=t.text?r[e]=t:((a=o.fill).find(".fill").forEach(function(t){t.destroy()}),o.color=t,n=new w.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:t}),a.add(n),n.moveToBottom())}),e=setInterval(function(){r.length!=t.length-1||r.includes(void 0)||(o.chehuiemptyCanvas(),clearInterval(e),r.forEach(function(t){var e,i,a,n,r;null!=t.text?(e=o.layer,i=o.transformer,a=o.stage,n=new w.a.Text(t),e.add(n),r=new w.a.Transformer({node:n,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(n.fontSize()+70,e.width),e}}),n.on("transform",function(){n.setAttrs({width:n.width()*n.scaleX(),scaleY:1,scaleX:1})}),i.add(r),i.draw(),s.keydown(a,e,r),y(a,e,r,n,o.currentArea.id,s.deletCurImg),v(a),i.children.forEach(function(t){t.nodes([])})):o.addElem(t)}))},100)):o.emptyCanvas()},curDesign:function(t,e){var o,i,a,l,n,c=this;1==t.is_ironing?(o=this,0==(2<arguments.length&&void 0!==arguments[2]&&arguments[2])&&(i=[],this.saveIds(),this.layerimages2=[],this.imageindex=0,this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),this.layerimages[""+this.currentArea.id]=i,this.$emit("setCurrentArea",t,e),o.color="rgba(255,255,255,0)",i=JSON.stringify(i),sessionStorage.setItem(this.currentArea.id,i)),this.emptyCanvas(),this.clearrect(),this.stage.width(this.current_area_w),this.stage.height(this.current_area_h),this.stage.batchDraw(),this.tag=0,t.id&&(this.popovervisible=!1,null!=(a=JSON.parse(sessionStorage.getItem(t.id)))?(this.layerimages2[this.imageindex]=JSON.parse(sessionStorage.getItem(t.id)),l=[],a.forEach(function(n,r){var s,t,e;null!=n.image?(s=new window.Image,(new Date).getTime().toString(),s.crossOrigin="anonymous",s.src=n.src,o.images.push(n),s.onload=function(){var t,e,i,a;600==n.width||600==n.height?(t=s.width,i=a=1,i=(e=s.height)<t?(a=t/c.current_area_w,t=c.current_area_w,c.current_area_h/(e/=a)):(a=e/c.current_area_h,e=c.current_area_h,c.current_area_w/(t/=a)),a={sourceid:n.sourceid,src:n.src,src1:n.src1,moren:1,name:"rectTransformer",image:s,width:t,height:e,draggable:!0,x:(c.current_area_w-t)/2+t/2,y:(c.current_area_h-e)/2+e/2,rotation:0,offset:{x:t/2,y:e/2},scaleX:i,scaleY:i,left:0,top:0,flipX:0,flipY:0,putu:0,naturalWidth:Number(s.width),naturalHeight:Number(s.height),canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]},n=a):n.image=s,l[r]=n}):null!=n.text?((n.x>c.current_area_w||n.y>c.current_area_h)&&(n.x=0,n.y=0),l[r]=n):((t=o.fill).find(".fill").forEach(function(t){t.destroy()}),o.color=n,e=new w.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:n}),t.add(e),e.moveToBottom())}),n=setInterval(function(){l.length!=a.length-1||l.includes(void 0)||(clearInterval(n),l.forEach(function(t){var e,i,a;null!=t.text?(e=o.layer,i=o.stage,a=new w.a.Text(t),e.add(a),(c.curImg=a).on("transform",function(){a.setAttrs({width:a.width()*a.scaleX(),scaleY:1,scaleX:1})}),c.keydown(i,e,c.tr),y(i,e,c.tr,a,o.currentArea.id,c.deletCurImg),c.tr.nodes([a])):o.addElem(t)}))},100)):this.moren("https://static.didaplan.cn/source/20240411/64a228fc5555a8f84cd8a8ece88f6679.png"),a.length<2)&&this.moren("https://static.didaplan.cn/source/20240411/64a228fc5555a8f84cd8a8ece88f6679.png")):this.$message.warning("未开启烫画设计")},swiperNext:function(){this.shilihua=0,this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex+1,this.save()},swiperPrev:function(){this.shilihua=0,this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex-1,this.save()},setPage1:function(t){var e;this.material.keywords==[]?(e={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:t,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords},this.$emit("materialSearch",e)):(e={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:t,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords.join(",")},this.$emit("materialSearch",e))},setNum1:function(t){t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:t,name:this.material.name,keywords:this.material.keywords.join(",")};this.$emit("materialSearch",t)},setPage:function(t){this.product.pageNumber=t,"全部"==this.product.tag&&(this.product.tag=""),"全部"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},setNum:function(t){this.product.pageSize=t,"全部"==this.product.tag&&(this.product.tag=""),"全部"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},productSearch:function(){this.product.pageNumber=1,""!=this.product.cid&&(this.product.cid=this.product.cid[this.product.cid.length-1]),"全部"==this.product.tag&&(this.product.tag=""),"全部"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},materialSearch:function(){var t;this.material.pageNumber=1,this.material.keywords==[]?(t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords},this.$emit("materialSearch",t)):(t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords.join(",")},this.$emit("materialSearch",t))},resetProduct:function(){this.product.name="",this.product.cid="",this.product.pageNumber=1,this.product.pageSize=20,this.product.tag="",this.product.level="",this.$emit("productSearch",this.product)},resetProduct1:function(){this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("materialSearch",this.material)},carNum:function(t){""==t&&(this.car.num=1)},setProductColor:function(t){this.shilihua=0,this.productColorIndex=t,this.productSizeIndex=0,this.$emit("setSizes",t,this.currentId)},setProductColor2:function(t){this.shilihua=0,this.productColorIndex=t,this.productSizeIndex=0,this.$emit("setSizes2",t,this.currentId)},setProductSize:function(t,e){this.shilihua=0,this.productSizeIndex=e,this.$emit("setColor",e,this.productColorIndex,this.currentId),this.$emit("setAttrId",t.id)},setProductSize2:function(t,e){this.shilihua=0,this.productSizeIndex=e,this.$emit("setColor2",e,this.productColorIndex,this.currentId),this.$emit("setAttrId",t.id)},saveIds:function(){for(var t=this,i=(this.sourceIds=[],0);i<window._this.productDetail.design_list.length;i++)!function(){var e=[];t.layer.children.forEach(function(t){t=t.attrs.sourceid;e.push(t)}),e=JSON.stringify(e),sessionStorage.setItem(t.currentArea.id+"id",e),window._this.productDetail.design_list[i].id&&t.sourceIds.push(JSON.parse(sessionStorage.getItem(window._this.productDetail.design_list[i].id+"id")))}()},addCart:function(t){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("addCar",t,this.car,this.productColorIndex,this.sourceIds)},addCar:function(){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("addCar",this.productDetail.attr_list[this.productColorIndex].sizes[this.productSizeIndex].id,this.car,this.productColorIndex,this.sourceIds)},saveCanvas:function(){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("saveCanvas",this.productDetail.attr_list[this.productColorIndex].sizes[this.productSizeIndex].id,this.productColorIndex,this.sourceIds)},copyCanvas:function(t){var e,i,a=this;t==this.currentArea?this.$message.error("就在当前遮罩，无需复制。"):(window._this.transformer.children.forEach(function(t){t.nodes([])}),window._this.grid.find(".grid").forEach(function(t){t.hide()}),window._this.grid.find(".gridLh").forEach(function(t){t.hide()}),window._this.grid.find(".gridLv").forEach(function(t){t.hide()}),e=window._this.stage.toDataURL({mimeType:"image/webp",pixelRatio:1}),window._this.grid.find(".grid").forEach(function(t){t.show()}),window._this.grid.find(".gridLh").forEach(function(t){t.show()}),window._this.grid.find(".gridLv").forEach(function(t){t.show()}),i=[],this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),"all"==t?this.productDetail.design_list.forEach(function(t){t!=a.currentArea&&(a.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)),a.$emit("getDesignTemp","",t,a.scrollImg,e,e))}):(this.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)),this.$emit("getDesignTemp","",t,this.scrollImg,e,e)),this.$message({message:"复制成功",type:"success"}))},setPop:function(){this.$emit("openBigImg",{colorIndex:this.productColorIndex})},keycodes:function(){document.oncontextmenu=function(){return!1},document.addEventListener("keydown",function(t){("F12"==t.key||"Ctrl"==t.key&&"shift"==t.key&&"i"==t.key||"shift"==t.key&&"F10"==t.key)&&t.preventDefault()})},closeCropper:function(){this.myCropper.destroy(),this.dialogVisible=!1},handleChangeRotate:function(t){this.cropperrotateTo(t)},initcrop:function(){this.myCropper=new Z.a(this.$refs.imagecrop,{viewMode:1,dragMode:"move",preview:".before",background:!1,autoCropArea:.5,zoomOnWheel:!0,aspectRatio:this.autoCropWidth/this.autoCropHeight,minCropBoxWidth:1,minCropBoxHeight:1}),this.myCropper.replace(this.curImg.attrs.src1)},sureSava:function(){var t,e=this,i=(this.croploading=!0,this.curImg.attrs.src1.match(/\.([^.]+)$/)),i=(this.afterImg=this.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toDataURL("image/".concat(i?i[1]:"png")),this.dataURLtoFile(this.afterImg,"crop.".concat(i?i[1]:"png")));20<Number(i.size/1024/1024)?(this.croploading=!1,this.$msgbox({title:"",message:"裁切画质较高，图像大小已超过20MB，请重新框选。",type:"warning"})):((t=new FormData).append("file",i),Object(x.a)(t).then(function(t){e.croploading=!1,1==t.data.code?(e.dialogVisible=!1,e.lingshiceshi(t.data.data.url)):e.messageBox(t)}))},cropperzoom:function(t){this.myCropper.zoom(t)},cropperReset:function(){this.myCropper.reset(),this.ScaleX=1,this.ScaleY=1},croppermove:function(t,e){this.myCropper.move(t,e)},cropperRotate:function(t){this.myCropper.rotate(t)},cropperrotateTo:function(t){this.myCropper.rotateTo(t)},cropperScaleX:function(){this.ScaleX=-this.ScaleX,-90===this.myCropper.getImageData().rotate||90===this.myCropper.getImageData().rotate?this.myCropper.scaleY(this.ScaleX):this.myCropper.scaleX(this.ScaleX)},cropperScaleY:function(){this.ScaleY=-this.ScaleY,-90===this.myCropper.getImageData().rotate||90===this.myCropper.getImageData().rotate?this.myCropper.scaleX(this.ScaleY):this.myCropper.scaleY(this.ScaleY)},getKonvaScale:function(){var t=document.body.style.zoom||1,e=document.getElementById("container"),i=(1/t).toFixed(3);e.style.transform="scale(".concat(t,")"),e.style.zoom=i,e.style.transformOrigin="0px 0px"},handleColorPickerClick:function(){var a=(1/(document.body.style.zoom||1)).toFixed(3);setTimeout(function(){var t=document.getElementsByClassName("el-color-dropdown el-color-picker__panel");0<t.length&&t.forEach(function(t){t.style.zoom=a;var e=parseInt(t.style.top,10),i=parseInt(t.style.left,10);t.style.top=(e/a).toFixed(2).toString()+"px",t.style.left=(i/a).toFixed(2).toString()+"px"})},10)}},mounted:function(){},watch:{"material.userId":{handler:function(t,e){this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("getFolderlist",this.material.userId),this.$emit("getKeywordlist",this.material.userId),this.materialSearch()}},color:function(t,e){var i=this.fill,a=(i.find(".fill").forEach(function(t){t.destroy()}),new w.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:this.color}));i.add(a),a.moveToBottom(),this.save()},Gradientcolor3:function(t,e){this.generateImage()},Gradientcolor4:function(t,e){this.generateImage()},Gradientcolor5:function(t,e){this.generateImage2()},Gradientcolor6:function(t,e){this.generateImage3()},Gradientcolor7:function(t,e){this.generateImage3()},lucency:function(t,e){this.curImg.setOpacity(t/100),this.save()},active:function(t){this.$refs.redefineSwipe1.$swiper.slideTo(t)},layer:{handler:function(t,e){},deep:!0},"curImg.attrs":{handler:function(t,e){this.curImg&&null!=this.curImg.text||(this.popovervisible=!1),1==this.click_up&&(this.click_up=2),this.curImg&&(1==this.curImg.attrs.flipX&&this.curImg.attrs.angle1!=this.curImg.attrs.rotation?this.curImg.attrs.angle=this.curImg.attrs.rotation+180:this.curImg.attrs.angle=this.curImg.attrs.rotation),document.getElementsByClassName("changeb")[1]&&(0!=document.getElementsByClassName("body")[0].style.zIndex?(document.getElementsByClassName("changeb")[0].classList.add("actionb"),document.getElementsByClassName("changeb")[1]):(document.getElementsByClassName("changeb")[1].classList.add("actionb"),document.getElementsByClassName("changeb")[0])).classList.remove("actionb"),this.curImg&&document.getElementById("btn1")&&(1==this.tag&&(document.getElementById("btn1").style.backgroundColor="var(--style-color-design)"),2==this.tag&&(document.getElementById("btn2").style.backgroundColor="var(--style-color-design)"),3==this.tag&&(document.getElementById("btn3").style.backgroundColor="var(--style-color-design)"),4==this.tag)&&(document.getElementById("btn4").style.backgroundColor="var(--style-color-design)"),this.save()},deep:!0}},created:function(){this.keycodes(),window._this=this;for(var t=200;11<t;t-=2)this.fontSize.unshift(t);var e=this.$route.query.type;sessionStorage.clear(),e&&this.clickChange(e)},computed:{formatTooltip:function(){this.lucency=100*this.curImg.getOpacity()}}},e("e7aa"),e("5886"),e("8f90"),r=Object(g.a)(j,function(){var a=this,t=a.$createElement,n=a._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.allLoading,expression:"allLoading"}],staticClass:"content",staticStyle:{width:"620px",display:"flex","flex-direction":"column","align-items":"center"},on:{click:function(t){a.keywordShow=!1}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!a.popShow,expression:"!popShow"}],staticClass:"ct"},[n("div",{staticStyle:{width:"620px",display:"flex","flex-direction":"column","justify-content":"space-between"}},[n("input",{ref:"file",staticClass:"input-opacity",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpeg, image/png, image/jpg"},on:{change:function(t){return a.addImage(t)}}}),n("div",{staticClass:"curProduct"},a._l(a.productDetail.design_list,function(e,i){return n("div",{staticClass:"item",class:e==a.currentArea?"curItem":"",on:{click:function(t){return a.curDesign(e,i)}}},[n("img",{attrs:{src:e?e.area_path:"",alt:""}})])}),0)]),n("div",{staticClass:"canvas"},[n("div",{staticClass:"konva",attrs:{id:"konva"}},[n("div",{staticClass:"k-img"},[""!=a.currentArea?n("img",{ref:"myImg",attrs:{src:a.currentArea.ironing_bg}}):a._e()]),n("div",{staticStyle:{position:"absolute"},style:{border:a.curImg?"1px dashed #474747":"none",width:a.current_area_w+2+"px",height:a.current_area_h+2+"px",top:a.current_area_t-1+"px",left:a.current_area_l-1+"px"}}),n("div",{ref:"thcontainer",staticClass:"container",style:{width:a.current_area_w+"px",height:a.current_area_h+"px",top:a.current_area_t+"px",left:a.current_area_l+"px"},attrs:{id:"container"}})]),n("el-button",{staticStyle:{width:"600px",height:"77px",opacity:"1","font-size":"22px",margin:"10px","margin-top":"50px",color:"rgb(38, 38, 38)",border:"0","border-radius":"13px",background:"rgb(250, 233, 207)","box-shadow":"rgb(250, 233, 207) 0px 0px 4px"},on:{click:function(t){return a.thSave()}}},[a._v("立即保存")])],1)]),n("el-dialog",{attrs:{visible:a.drawer,title:"裁件预览",top:"60px",width:"90vw"},on:{"update:visible":function(t){a.drawer=t}}},[0<a.svgXml.length?n("div",[n("div",{staticClass:"vhtml",domProps:{innerHTML:a._s(a.svgXml[a.cutpiece_index])}})]):a._e(),n("div",{staticStyle:{display:"flex","justify-content":"center","margin-top":"20px"}},[n("el-button",{attrs:{disabled:a.cutpiece_index<=0,icon:"el-icon-arrow-left"},on:{click:function(t){a.cutpiece_index--}}}),n("el-button",{attrs:{disabled:a.cutpiece_index>=a.svgXml.length-1,icon:"el-icon-arrow-right"},on:{click:function(t){a.cutpiece_index++}}})],1),n("div",{staticClass:"cutp"},[a._v(" 颜色： "),n("div",{staticClass:"colors"},a._l(a.productDetail.attr_list,function(t,e){return n("p",{key:e,class:a.productColorIndex==e?"boder":"",style:{background:t.color},on:{click:function(t){return a.setProductColor2(e)}}})}),0),a._v(" 规格： "),n("div",{staticClass:"colors"},a._l(a.sizes,function(e,i){return n("p",{key:i,class:a.productSizeIndex==i?"boder":"",on:{click:function(t){return a.setProductSize2(e,i)}}},[a._v(" "+a._s(e.size)+" ")])}),0)])]),n("div",{directives:[{name:"show",rawName:"v-show",value:a.popShow,expression:"popShow"}],staticClass:"fiexd"},[n("div",{staticClass:"close"},[n("i",{staticClass:"el-icon-back",on:{click:function(t){a.popShow=!a.popShow,a.active=0}}})]),a.productDetail.attr_list?n("div",{staticClass:"swiper"},[n("div",{staticClass:"imgList"},a._l(a.productDetail.attr_list[this.productColorIndex].templates,function(t,e){return n("div",{key:e,class:{imgItem:!0,border:e==a.active},on:{click:function(t){a.active=e}}},[n("img",{attrs:{src:t,alt:""}})])}),0),n("swiper",{ref:"redefineSwipe1",staticClass:"swiperOptions1 swiper-no-swiping",attrs:{options:a.swiperOptions1}},a._l(a.productDetail.attr_list[this.productColorIndex].templates,function(t,e){return n("swiper-slide",{key:e,staticClass:"rs-box"},[n("img",{staticClass:"rs-icon",attrs:{src:t}})])}),1)],1):a._e()]),n("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:a.croploading,expression:"croploading"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!1,visible:a.dialogVisible,top:"20px",width:"90vw"},on:{"update:visible":function(t){a.dialogVisible=t},open:function(t){return a.show()},close:function(t){return a.closeCropper()}}},[n("div",[n("div",{staticClass:"cropper-content"},[n("div",{staticClass:"cropper"},[n("img",{ref:"imagecrop",attrs:{id:"imagecrop",src:a.imgFile,alt:""}})])]),n("div",{staticClass:"footer-btn"},[n("div",{staticClass:"scope-btn"},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"放大",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-zoom-in"},on:{click:function(t){return a.cropperzoom(.05)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"缩小",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-zoom-out"},on:{click:function(t){return a.cropperzoom(-.05)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"逆时针旋转",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh-left"},on:{click:function(t){return a.cropperRotate(-90)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"顺时针旋转",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh-right"},on:{click:function(t){return a.cropperRotate(90)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"重置画布",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh"},on:{click:function(t){return a.cropperReset()}}})],1)],1),n("div",{staticClass:"upload-btn"},[n("el-button",{staticStyle:{border:"1px solid #efb15e",color:"#efb15e"},on:{click:function(t){a.dialogVisible=!1}}},[a._v("取消")]),n("el-button",{staticStyle:{"background-color":"#efb15e",color:"white",border:"0"},attrs:{type:"primary"},on:{click:function(t){return a.sureSava()}}},[a._v("确定")])],1)])])]),n("el-drawer",{attrs:{"with-header":!1,width:"620px",visible:a.coverimgs,direction:"btt",size:"220px",modal:!1},on:{"update:visible":function(t){a.coverimgs=t}}},[n("div",{staticClass:"curProduct"},a._l(a.productDetail.design_list,function(e,i){return n("div",{staticClass:"item",class:e==a.currentArea?"curItem":"",on:{click:function(t){return a.curDesign(e,i)}}},[n("img",{attrs:{src:e?e.area_path:"",alt:""}}),e.show_diy_layername?n("div",{staticStyle:{"align-self":"center"}},[a._v(" "+a._s(e.diy_layername)+" ")]):n("div",{staticStyle:{"align-self":"center"}},[a._v("图层"+a._s(i+1))])])}),0)]),n("el-drawer",{attrs:{"with-header":!1,width:"620px",visible:a.edits,direction:"btt",size:"456px",modal:!1},on:{"update:visible":function(t){a.edits=t}}},[n("div",{staticClass:"right"},[a.curImg?n("div",{staticClass:"edit"},[n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"置顶"},on:{click:function(t){return a.rightButton("top")}}},[n("img",{attrs:{src:e("60b8"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status||1==a.curImg.attrs.putu,type:"text",title:"置底"},on:{click:function(t){return a.rightButton("bottom")}}},[n("img",{attrs:{src:e("fb5f"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"上移"},on:{click:function(t){return a.rightButton("up")}}},[n("img",{attrs:{src:e("33ba"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"下移"},on:{click:function(t){return a.rightButton("down")}}},[n("img",{attrs:{src:e("e57f"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"复制图层"},on:{click:function(t){return a.rightButton("copy")}}},[n("img",{attrs:{src:e("4fae"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"删除图层"},on:{click:function(t){return a.rightButton("delet")}}},[n("img",{attrs:{src:e("9cf2"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"左对齐"},on:{click:function(t){return a.rightButton("LeftAlignment")}}},[n("img",{attrs:{src:e("8893"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"水平居中"},on:{click:function(t){return a.rightButton("Center")}}},[n("img",{attrs:{src:e("ddd5"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"右对齐"},on:{click:function(t){return a.rightButton("RightAlignment")}}},[n("img",{attrs:{src:e("2935"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"上对齐"},on:{click:function(t){return a.rightButton("TopAlignment")}}},[n("img",{attrs:{src:e("2d77"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"垂直居中"},on:{click:function(t){return a.rightButton("VerticalAlignment")}}},[n("img",{attrs:{src:e("91ce"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"下对齐"},on:{click:function(t){return a.rightButton("BottomAlignment")}}},[n("img",{attrs:{src:e("cc9f"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"放大"},on:{click:function(t){return a.rightButton("amplification")}}},[n("img",{attrs:{src:e("b532"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"缩小"},on:{click:function(t){return a.rightButton("narrow")}}},[n("img",{attrs:{src:e("7220"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"逆时针旋转"},on:{click:function(t){return a.rightButton("CounterclockwiseRotation")}}},[n("img",{attrs:{src:e("4e03"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"顺时针旋转"},on:{click:function(t){return a.rightButton("ClockwiseRotation")}}},[n("img",{attrs:{src:e("3a32"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"水平翻转"},on:{click:function(t){return a.rightButton("horizontal")}}},[n("img",{attrs:{src:e("86d7b"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"垂直翻转"},on:{click:function(t){return a.rightButton("vertical")}}},[n("img",{attrs:{src:e("e511"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"},on:{click:function(t){return a.cutout()}}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"抠图",placement:"top"}},[n("img",{attrs:{src:e("2a10"),alt:""}})])],1)],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"},on:{click:function(t){return a.imageClarity()}}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"清晰化",placement:"top"}},[n("img",{attrs:{src:e("85fa"),alt:""}})])],1)],1),n("div",{staticClass:"item"},[n("el-dropdown",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}]},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"滤镜",placement:"top"}},[n("img",{attrs:{src:e("83ae"),alt:""}})])],1),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("div",{staticStyle:{"margin-left":"10px","font-size":"15px",color:"var(--style-color-design)"}},[a._v(" 滤镜风格 ")]),n("div",{staticClass:"lvjing_box"},a._l(a.lvjingList,function(e){return n("img",{attrs:{src:e,alt:""},on:{click:function(t){return a.styleTransfer(e)}}})}),0)])],1)],1)]):a._e(),a.curImg?n("div",{staticClass:"opacity"},[n("p",[a._v("透明度：")]),n("div",{staticClass:"lucency"},[n("el-slider",{attrs:{"format-tooltip":a.formatTooltip},model:{value:a.lucency,callback:function(t){a.lucency=t},expression:"lucency"}})],1)]):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"imgEdit"},[n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"70px","background-color":"#f5f5f5","border-radius":"0",border:"0","font-size":"22px"},attrs:{size:"big"},on:{click:function(t){return a.rightButton("imageFill")}}},[a._v("图片填充")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"70px","background-color":"#f5f5f5","border-radius":"0",border:"0","font-size":"22px"},attrs:{size:"big"},on:{click:function(t){return a.rightButton("imageAdaptive")}}},[a._v("图片适应")])],1)]):a._e(),a.curImg&&a.curImg.attrs.text?n("div",{staticClass:"fontEdit"},[n("div",{staticClass:"flex"},[n("div",{staticClass:"fontFamliy"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"big"},on:{change:a.pickFontFamily},model:{value:a.fontFamily,callback:function(t){a.fontFamily=t},expression:"fontFamily"}},a._l(a.options,function(t){return n("el-option",{key:t.value,style:{fontFamily:t.value,fontSize:"28px",width:"300px"},attrs:{label:t.label,value:t.value}})}),1)],1),n("el-popover",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placement:"bottom",width:"520",title:"文字效果",trigger:"manual"},model:{value:a.popovervisible,callback:function(t){a.popovervisible=t},expression:"popovervisible"}},[n("button",{staticClass:"close-button",staticStyle:{position:"absolute",right:"7px",top:"5px","font-size":"22px",cursor:"pointer"},on:{click:function(t){a.popovervisible=!1}}},[n("i",{staticClass:"el-icon-close"})]),n("div",{staticStyle:{height:"420px","overflow-y":"scroll"}},[n("el-form",{attrs:{"label-position":"right","label-width":"80px"}},[n("el-form-item",{attrs:{label:"是否渐变"}},[n("el-switch",{attrs:{size:"big","active-text":"是","inactive-text":"否"},on:{change:a.toggleGradient},model:{value:a.gradientEnabled,callback:function(t){a.gradientEnabled=t},expression:"gradientEnabled"}})],1),a.gradientEnabled?[n("el-form-item",{attrs:{label:"开始坐标"}},[a._v(" X "),n("el-input-number",{attrs:{size:"big","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientStartX,callback:function(t){a.gradientStartX=t},expression:"gradientStartX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"big","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientStartY,callback:function(t){a.gradientStartY=t},expression:"gradientStartY"}})],1),n("el-form-item",{attrs:{label:"结束坐标"}},[a._v(" X "),n("el-input-number",{attrs:{size:"big","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientEndX,callback:function(t){a.gradientEndX=t},expression:"gradientEndX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"big","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientEndY,callback:function(t){a.gradientEndY=t},expression:"gradientEndY"}})],1),n("el-form-item",{attrs:{label:"渐变颜色"}},[n("div",{staticStyle:{display:"flex","flex-wrap":"wrap","align-items":"center"}},[a._l(a.gradientColors,function(t,e){return[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"big"},on:{change:a.updateGradient},model:{value:a.gradientColors[e],callback:function(t){a.$set(a.gradientColors,e,t)},expression:"gradientColors[index]"}})],1)]})],2)]),n("el-form-item",{attrs:{label:"颜色增减"}},[n("el-button",{attrs:{disabled:10<=a.gradientColors.length,type:"primary",size:"big",icon:"el-icon-plus"},on:{click:a.addGradientColor}}),n("el-button",{attrs:{disabled:a.gradientColors.length<=2,type:"primary",size:"big",icon:"el-icon-minus"},on:{click:a.delGradientColor}})],1)]:a._e(),n("el-form-item",{attrs:{label:"描边厚度"}},[n("el-input-number",{attrs:{size:"big","controls-position":"right",min:0,max:100},on:{change:a.pickFontstrokeWidth},model:{value:a.fontstrokeWidth,callback:function(t){a.fontstrokeWidth=t},expression:"fontstrokeWidth"}})],1),n("el-form-item",{attrs:{label:"描边颜色"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"big"},on:{change:a.pickFontStrokeColor},model:{value:a.fontstrokeColor,callback:function(t){a.fontstrokeColor=t},expression:"fontstrokeColor"}})],1)]),n("el-form-item",{attrs:{label:"文本行高"}},[n("el-input-number",{attrs:{size:"big","controls-position":"right",step:.1,min:1,max:100},on:{change:a.pickFontlineHeight},model:{value:a.fontlineHeight,callback:function(t){a.fontlineHeight=t},expression:"fontlineHeight"}})],1),n("el-form-item",{attrs:{label:"文字间距"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:-50,max:250,step:5},on:{change:a.pickfontletterSpacing},model:{value:a.fontletterSpacing,callback:function(t){a.fontletterSpacing=t},expression:"fontletterSpacing"}})],1),n("el-form-item",{attrs:{label:"文本加线"}},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"big"},on:{change:a.pickFontDecoration},model:{value:a.textDecoration,callback:function(t){a.textDecoration=t},expression:"textDecoration"}},a._l(a.textdecorationoptions,function(t){return n("el-option",{key:t.value,style:{textDecoration:t.value},attrs:{label:t.label,value:t.value}})}),1)],1),n("el-form-item",{attrs:{label:"文本阴影"}},[n("el-switch",{attrs:{size:"big","active-text":"开启","inactive-text":"关闭"},on:{change:a.toggleTextShadow},model:{value:a.textShadowEnabled,callback:function(t){a.textShadowEnabled=t},expression:"textShadowEnabled"}})],1),a.textShadowEnabled?[n("el-form-item",{attrs:{label:"阴影颜色"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"big"},on:{change:a.pickTextShadowColor},model:{value:a.textShadowColor,callback:function(t){a.textShadowColor=t},expression:"textShadowColor"}})],1)]),n("el-form-item",{attrs:{label:"阴影透明"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:0,max:1,step:.1},on:{change:a.pickTextShadowOpacity},model:{value:a.textShadowOpacity,callback:function(t){a.textShadowOpacity=t},expression:"textShadowOpacity"}})],1),n("el-form-item",{attrs:{label:"阴影偏移"}},[a._v(" X "),n("el-input-number",{attrs:{size:"big","controls-position":"right",min:-100,max:100},on:{change:a.pickTextShadowOffsetX},model:{value:a.textShadowOffsetX,callback:function(t){a.textShadowOffsetX=t},expression:"textShadowOffsetX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"big","controls-position":"right",min:-100,max:100},on:{change:a.pickTextShadowOffsetY},model:{value:a.textShadowOffsetY,callback:function(t){a.textShadowOffsetY=t},expression:"textShadowOffsetY"}})],1),n("el-form-item",{attrs:{label:"模糊程度"}},[n("el-input-number",{attrs:{size:"big","controls-position":"right",min:0,max:100},on:{change:a.pickTextShadowBlur},model:{value:a.textShadowBlur,callback:function(t){a.textShadowBlur=t},expression:"textShadowBlur"}})],1)]:a._e()],2)],1),n("el-button",{staticStyle:{margin:"0 49px"},attrs:{slot:"reference"},on:{click:function(t){a.popovervisible=!a.popovervisible}},slot:"reference"},[a._v("文字效果")])],1),n("div",{staticClass:"fontColor",staticStyle:{display:"flex"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"big"},on:{change:a.pickFontColor},model:{value:a.fontColor,callback:function(t){a.fontColor=t},expression:"fontColor"}})],1)])],1),n("div",{staticClass:"flex"},[n("div",{staticClass:"fontSize"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"big"},on:{change:a.pickFontSize},model:{value:a.fontSizeStr,callback:function(t){a.fontSizeStr=t},expression:"fontSizeStr"}},a._l(a.fontSize,function(t,e){return n("el-option",{key:t,style:{fontSize:"28px"},attrs:{label:t,value:t}})}),1)],1),n("div",{staticClass:"fontButtom"},[n("el-button",{staticClass:"fontBut",attrs:{size:"big",type:"text",title:"文本居左"},on:{click:function(t){return a.rightButton("fontLeft")}}},[n("img",{attrs:{src:e("ccd8"),alt:""}})])],1),n("div",{staticClass:"fontButtom"},[n("el-button",{staticClass:"fontBut",attrs:{size:"big",type:"text",title:"文本居中"},on:{click:function(t){return a.rightButton("fontCenter")}}},[n("img",{attrs:{src:e("75c4"),alt:""}})])],1),n("div",{staticClass:"fontButtom"},[n("el-button",{staticClass:"fontBut",attrs:{size:"big",type:"text",title:"文本居右"},on:{click:function(t){return a.rightButton("fontRight")}}},[n("img",{attrs:{src:e("5636"),alt:""}})])],1)])]):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"btns"},[n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn1"},on:{click:function(t){return a.setPattern("jichu")}}},[a._v("基础平铺")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn2"},on:{click:function(t){return a.setPattern("jingxiang")}}},[a._v("镜像平铺")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn3"},on:{click:function(t){return a.setPattern("zongxiang")}}},[a._v("纵向平铺")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn4"},on:{click:function(t){return a.setPattern("hengxiang")}}},[a._v("横向平铺")])],1):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"changeD"}):a._e()])]),n("el-drawer",{staticStyle:{"border-radius":"20px 20px 0px 0px"},attrs:{"with-header":!1,width:"620px",visible:a.shopimage,direction:"btt",size:"580px",modal:!1},on:{"update:visible":function(t){a.shopimage=t}}},[n("div",{staticClass:"left"},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.productLoding,expression:"productLoding"}],staticClass:"productShow"},["product"==a.leftButtonStatus?n("div",{staticClass:"productList"},a._l(a.productList.product_list,function(e,t){return n("div",{staticClass:"item",class:a.currentId==e.id?"curItem":"",on:{mousemove:function(t){return a.productMove(e)},mouseleave:function(t){return a.productLeave(e)},click:function(t){return a.productDown(e)}}},[n("img",{attrs:{src:e.img_url,alt:""}})])}),0):a._e(),"product"==a.leftButtonStatus?n("div",{staticClass:"imgPage"},[n("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{background:"","current-page":a.product.pageNumber,"page-sizes":[20,50,100,200],"page-size":a.product.pageSize,"pager-count":8,layout:" prev, pager, next",total:a.productList.num_total},on:{"size-change":a.setNum,"current-change":a.setPage,"update:currentPage":function(t){return a.$set(a.product,"pageNumber",t)},"update:current-page":function(t){return a.$set(a.product,"pageNumber",t)}}})],1):a._e()]),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.materiaLoding,expression:"materiaLoding"}],staticClass:"materialShow"},["Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"productList"},a._l(a.sourceList.source_list,function(e,i){return n("div",{staticClass:"item",class:a.currentMaterialIndex==i?"curItem":"",on:{mousemove:function(t){return a.productMove(e)},mouseleave:function(t){return a.productLeave(e)},click:function(t){return a.materialDown(e,i)}}},[n("img",{attrs:{src:e.thumb,alt:""}})])}),0):a._e(),"Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"imgPage"},[n("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{background:"","current-page":a.material.pageNumber,"page-sizes":[20,50,100,200],"page-size":a.material.pageSize,"pager-count":8,layout:" prev, pager, next",total:a.sourceList.num_total},on:{"size-change":a.setNum1,"current-change":a.setPage1,"update:currentPage":function(t){return a.$set(a.material,"pageNumber",t)},"update:current-page":function(t){return a.$set(a.material,"pageNumber",t)}}})],1):a._e()])])]),n("el-dialog",{attrs:{title:"烫画稿件预览",visible:a.thXimgShow,width:"500px"},on:{"update:visible":function(t){a.thXimgShow=t}}},[n("el-image",{staticStyle:{width:"100%"},attrs:{src:a.thXimg,fit:a.contain}})],1)],1)},[],!1,null,"14f61840",null).exports,d={name:"Design",components:{ProductAnchor:i.a,ProductRecommend:a.a,diy:h,diys:r},props:{product:{type:Object,default:function(){return null}}},data:function(){return{res:[],category:[],SDKObj1:"",bigSDKObj1:"",psdsku_list:[],bigpsdsku_list:[],token:"",shilihua:0,category1:[{value:"",label:"全部"},{value:"0",label:"新品"},{value:"1",label:"促销"},{value:"2",label:"热卖"},{value:"3",label:"精品"}],level:[{value:"",label:"全部"},{value:"0",label:"v0"},{value:"1",label:"v1"},{value:"2",label:"v2"},{value:"3",label:"v3"}],productList:{},productDetail:{},currentArea:{},extends:{},extends1:{},sourceList:{},folderList:[],keywordList:[],imgLoading:!1,productLoding:!1,materiaLoding:!1,sizes:[],attr_id:0,initProductDetailPsd:[],vLoading:!1,currentId:null,srcList:[],colorIndex:0}},methods:{getProductcatelist:function(){var r=this;Object(k.k)().then(function(t){if(1===t.data.code){for(var e=t.data.data,i=[],a=0;a<e.length;a++){var n={};n.label=e[a].name,n.value=e[a].id,e[a].childlist&&(n.children=r.tree_childlist(e[a].childlist)),i.push(n)}r.category=i}})},tree_childlist:function(t){for(var e=[],i=0;i<t.length;i++){var a={};a.label=t[i].name,a.value=t[i].id,t[i].childlist&&(a.children=this.tree_childlist(t[i].childlist)),e.push(a)}return e},tree_childrens:function(t){for(var e=[],i=0;i<t.length;i++){var a={};a.label=t[i].title,a.value=t[i].id,0<t[i].children.length&&(a.children=this.tree_childrens(t[i].children)),e.push(a)}return e},productSearch:function(t){var e=this;this.productLoding=!0,Object(k.l)(t).then(function(t){1!==t.data.code||"暂无数据"==t.data.msg?e.productList={}:e.productList=t.data.data,e.productLoding=!1})},materialSearch:function(t){var e=this;this.materiaLoding=!0,Object(k.m)(t).then(function(t){1==t.data.code?(e.materiaLoding=!1,e.sourceList=t.data.data):(e.sourceList={},e.materiaLoding=!1)})},getProductlist:function(){var e=this;this.productLoding=!0;Object(k.l)({name:"",cid:"",pageNumber:1,pageSize:20,tag:"",level:""}).then(function(t){1===t.data.code?("暂无数据"==t.data.msg?e.productList={}:e.productList=t.data.data,e.$route.query&&e.$route.query.id?(e.currentId=e.$route.query.id,e.$refs.diys.productDown(e.$route.query)):"暂无数据"!=t.data.msg&&(e.currentId=t.data.data.product_list[0].id,e.$refs.diys.productDown(t.data.data.product_list[0]))):e.productList={},e.productLoding=!1})},clickProduct:function(t){var e=this;sessionStorage.clear(),this.productLoding=!0,this.currentId=t.id,this.colorIndex=0,this.extends={},this.extends1={},this.$refs.diys.dwarning=!1,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.$refs.diys.layerimages={},Object(D.s)(this.currentId).then(function(t){e.res=[],1==t.data.code?(e.productDetail=t.data.data,e.currentArea=e.productDetail.design_list[0],e.$refs.diys.current_area_w=e.currentArea.current_area_w,e.$refs.diys.current_area_h=e.currentArea.current_area_h,e.$refs.diys.current_area_t=e.currentArea.current_area_t,e.$refs.diys.current_area_l=e.currentArea.current_area_l,e.$refs.diys.layerimages=e.productDetail.finished.layerdata,e.productDetail.design_list.forEach(function(t){e.$refs.diys.layerimages[""+t.id]&&sessionStorage.setItem(t.id,JSON.stringify(e.$refs.diys.layerimages[""+t.id]))}),0<document.getElementsByClassName("konvajs-content").length?e.$refs.diys.curDesign(e.currentArea,0):e.$refs.diys.thInit()):e.messageBox(t),e.productLoding=!1}),this.$emit("updateProduct")},setSizes2:function(t,e){var i=this;this.imgLoading=!0,this.extends={},this.extends1={},this.res=[],this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,sessionStorage.clear(),this.$refs.diys.layerimages={},Object(k.f)(e,this.sizes[0].id).then(function(t){if(0==t.data.code&&i.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list,i.$refs.diys.cutpiece()),i.productDetail.design_list=t.data.data.design_list,i.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)i.res.push({name:t.data.data.design_list[e].templatelayer,content:""});i.psdsku_list=t.data.data.sku_list,i.bigpsdsku_list=t.data.data.big_svg_list,i.$refs.diys.save()}})},setColor2:function(t,e,i){var a=this;this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,Object(k.f)(i,this.sizes[t].id).then(function(t){if(0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list,a.$refs.diys.cutpiece()),a.productDetail.design_list=t.data.data.design_list,a.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)a.res.push({name:t.data.data.design_list[e].templatelayer,content:""});a.psdsku_list=t.data.data.sku_list,a.bigpsdsku_list=t.data.data.big_svg_list,a.$refs.diys.save()}})},setSizes:function(t,e){var i=this;this.imgLoading=!0,this.extends={},this.extends1={},this.res=[],this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,sessionStorage.clear(),this.$refs.diys.layerimages={},Object(k.f)(e,this.sizes[0].id).then(function(t){if(0==t.data.code&&i.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list),i.productDetail.design_list=t.data.data.design_list,i.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)i.res.push({name:t.data.data.design_list[e].templatelayer,content:""});i.psdsku_list=t.data.data.sku_list,i.bigpsdsku_list=t.data.data.big_svg_list,i.$refs.diys.save()}})},setColor:function(t,e,i){var a=this;this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,Object(k.f)(i,this.sizes[t].id).then(function(t){if(0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list),a.productDetail.design_list=t.data.data.design_list,a.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)a.res.push({name:t.data.data.design_list[e].templatelayer,content:""});a.psdsku_list=t.data.data.sku_list,a.bigpsdsku_list=t.data.data.big_svg_list,a.$refs.diys.save()}})},emptyC:function(){this.res.forEach(function(t,e){t.content=""}),this.$refs.diys.shilihua=0,this.extends1={},this.$refs.diys.layerimages={}},DesignTemp:function(t){this.shilihua=this.$refs.diys.shilihua,this.$refs.diys.layerLength=!0,0==this.shilihua&&(this.imgLoading=!0),this.extends1[""+t[1].id]=t[3];this.$refs.diys.layerLength=!1;for(var e=0;e<this.res.length;e++)this.res[e].name==t[1].templatelayer&&(this.res[e].content=t[4],0)},setCurrentArea:function(t,e){this.currentArea=t,this.$refs.diys.current_area_w=this.currentArea.current_area_w,this.$refs.diys.current_area_h=this.currentArea.current_area_h,this.$refs.diys.current_area_t=this.currentArea.current_area_t,this.$refs.diys.current_area_l=this.currentArea.current_area_l},asyncCall:function(a,e){var n=this;return Object(o.a)(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0==n.shilihua)return""!=n.SDKObj1&&(n.SDKObj1.destroy(),n.SDKObj1.qinchurul()),n.SDKObj1="",n.bigSDKObj1="",n.shilihua=1,n.$refs.diys.shilihua=1,t.next=10,new Promise(function(e){var i=new SDK("xtu",{psdSkus:n.psdsku_list.slice(0,2),Autoken:z.a.get("token"),token:z.a.get("token"),onload:function(){a.forEach(function(t){i.changet({image:t.content,layers:t.name})});var t=document.getElementsByClassName("fangda")[0];t&&t.remove(),e(i),this.imgLoading=!1}})});t.next=11;break;case 10:n.SDKObj1=t.sent;case 11:if(""!=n.SDKObj1)return t.next=14,n.SDKObj1.changet({image:a[e].content,layers:a[e].name});t.next=14;break;case 14:n.imgLoading=!1;case 15:case"end":return t.stop()}},t)}))()},getMaterial:function(){var e=this;this.materialLoding=!0;Object(k.m)({userId:"",fid:"",pageNumber:1,pageSize:20,name:"",keywords:""}).then(function(t){1==t.data.code?e.sourceList=t.data.data:e.sourceList={},e.materialLoding=!1})},addCar:function(t,e,i,a){var n=this,t=(a.join(","),a=a.toString(),{product_id:this.currentId,attr_id:t,num:e.num,extends:JSON.stringify(this.$refs.diys.layerimages),source_ids:a});Object(k.b)(t).then(function(t){1!=t.data.code&&n.messageBox(t)}),setTimeout(function(){n.$message.success("加购成功")},1500)},saveCanvas:function(t,e,i){var a=this,t=(i.join(","),i=i.toString(),{product_id:this.currentId,attr_id:t,extends:JSON.stringify(this.$refs.diys.layerimages),source_ids:i,is_online:0});Object(k.r)(t).then(function(t){1!=t.data.code&&a.messageBox(t)}),setTimeout(function(){a.$message.success("保存成功")},1500)},getFolderlist:function(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Object(k.g)(t).then(function(t){if(1===t.data.code){for(var e=t.data.data,i=[],a=0;a<e.length;a++){var n={};n.label=e[a].title,n.value=e[a].id,0<e[a].children.length&&(n.children=r.tree_childrens(e[a].children)),i.push(n)}r.folderList=i}})},getKeywordlist:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Object(k.i)(t).then(function(t){1==t.data.code&&(e.keywordList=t.data.data)})},setAttrId:function(t){this.attr_id=t},deletImg:function(i){this.productDetail.attr_list[0].templates.forEach(function(t,e){e!=i&&(t.url=" ")})},getBigImgs:function(t){},openBigImg:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.SDKObj1.getImg();case 2:e=t.sent,a.productDetail.attr_list[i.colorIndex].templates=e,a.$refs.diys.popShow=!a.$refs.diys.popShow;case 5:case"end":return t.stop()}},t)}))()}},mounted:function(){this.$route.query&&this.$route.query.id&&(this.currentId=this.$route.query.id,this.clickProduct(this.$route.query))},created:function(){document.getElementById("kefu")&&(document.getElementById("kefu").style.display="none"),document.getElementById("kefuBox")&&(document.getElementById("kefuBox").style.display="none")}},e("3b47"),u=Object(g.a)(d,function(){var e=this,t=e.$createElement,t=e._self._c||t;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.vLoading,expression:"vLoading"}],staticClass:"design"},[e._v(" "+e._s(e.product)+" "),t("diys",{ref:"diys",attrs:{category:e.category,category1:e.category1,level:e.level,productList:e.productList,productDetail:e.productDetail,currentArea:e.currentArea,res:e.res,imgLoading:e.imgLoading,sourceList:e.sourceList,folderList:e.folderList,keywordList:e.keywordList,productLoding:e.productLoding,materiaLoding:e.materiaLoding,sizes:e.sizes,attr_id:e.attr_id,currentId:e.currentId,initProductDetailPsd:e.initProductDetailPsd},on:{clickProduct:e.clickProduct,getDesignTemp:function(t){return e.DesignTemp(arguments)},emptyC:e.emptyC,setCurrentArea:e.setCurrentArea,getMaterial:e.getMaterial,productSearch:e.productSearch,materialSearch:e.materialSearch,addCar:e.addCar,saveCanvas:e.saveCanvas,setAttrId:e.setAttrId,deletImg:e.deletImg,setSizes:e.setSizes,setColor:e.setColor,setSizes2:e.setSizes2,setColor2:e.setColor2,getBigImgs:e.getBigImgs,openBigImg:e.openBigImg,getFolderlist:e.getFolderlist,getKeywordlist:e.getKeywordlist}})],1)},[],!1,null,"b5fdd73a",null);t.default=u.exports},"4fae":function(t,e,i){t.exports=i.p+"img/17-17.ad5e55a9.png"},"4fe6":function(B,t,e){"use strict";e.r(t);var l=e("2909"),o=e("1da1"),i=(e("96cf"),e("b0c0"),e("159b"),e("b680"),e("d3b7"),e("a15b"),e("25f0"),e("d81d"),e("6062"),e("3ca3"),e("ddb0"),e("a9e3"),e("1321")),a=e("2515"),c=e("ade3"),s=(e("4e82"),e("a434"),e("8a5a")),n=e("7212"),r=(e("bbe3"),e("6d3b")),d=e("b42f"),u=e("8343");r.a.use([d.a,u.a]);var h={components:{Swiper:n.Swiper,SwiperSlide:n.SwiperSlide},data:function(){var t=this;return{c:null,ctx:null,dragArr:[],checkClickArea:[],swipeOptions:{initialSlide:0,speed:500,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}},swiperOptions1:{initialSlide:0,speed:500,on:{slideChange:function(){t.active=t.$refs.redefineSwipe1.$swiper.activeIndex}}},active:0,popShow:!1,num:1,product:{search:"",radio:"1"},buttons:["产品","素材","背景","图片"],buttonIndex:0,typeButton:["分类","类别","等级"],typeArr:[{name:"北京",children:[{name:"海淀区",children:[{name:"1环",children:[{name:"10环"},{name:"11环"}]},{name:"2环"}]},{name:"朝阳区"}]},{name:"浙江",children:[{name:"杭州"},{name:"宁波"}]},{name:"广东",children:[{name:"1环"},{name:"2环"}]}],pickShow:!1,pickShow1:!1,pickShow2:!1,pickShow3:!1,mouseIndex:-1,imgList:[e("ae45"),e("65ba"),e("ae45"),e("65ba"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45")],curImgList:[e("ae45"),e("ae45")],imgIndex:-1,curimgIndex:0,scrollImg:1}},watch:{active:function(t){this.$refs.redefineSwipe1.$swiper.slideTo(t)}},methods:(h={swiperNext:function(){this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex+2},swiperPrev:function(){this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex},setButton:function(t){3==t?this.$refs.file.click():this.buttonIndex=t},enter:function(t){this.mouseIndex=t,0!=this.typeArr.length&&(this.pickShow=!this.pickShow)},leave:function(){this.mouseIndex=-1,this.pickShow=!this.pickShow},pickImg:function(t){this.imgIndex=t},curImgIndex:function(t){this.curimgIndex=t},handleBlur:function(){null==this.num&&(this.num=1)},popSwiper:function(t){this.active=t},openPop:function(){this.popShow=!this.popShow},closePop:function(){this.popShow=!this.popShow},addImage:function(t){var r=this,t=t.target.files[0],e=new FileReader;e.readAsDataURL(t),e.onload=function(t){var i,a,n=new Image;n.src=t.target.result,n.onload=function(t){i=n.width,(a=n.height)<i?(e=i/600,i=600,a/=e):(e=a/600,a=600,i/=e);var e={url:n,width:i,height:a};r.dragArr.push(new s.a(e,r.ctx)),r.draw()}}},draw:function(){this.ctx.clearRect(0,0,this.c.width,this.c.height),this.dragArr.forEach(function(t){t.paint()})},start:function(t){var a=this,n=(this.clickedkArr=[],t.offsetX),r=t.offsetY,t=(this.dragArr.forEach(function(t,e){var i=t.isInWhere(n,r);t.place=i,t.index=e,t.selected=!1,i&&a.checkClickArea.push(t)}),this.checkClickArea.length);if(0<t){t=this.checkClickArea[t-1];if(t.index=Math.max.apply(Math,Object(l.a)(this.dragArr.map(function(t){return t.index})))+1,this.dragArr.sort(function(t,e){return t.index-e.index}),"del"===t.place)return this.dragArr.splice(t.index-1,1),void this.draw();t.selected=!0,this.lastImg=t,this.initial={initialX:t.x,initialY:t.y,initialH:t.h,initialW:t.w,initialRotate:t.rotate,initialPointList:t.pointList}}this.draw(),this.startTouch={startX:n,startY:r}},move:function(t){var e,i,a,n,r,s,o,l,c;0<this.checkClickArea.length&&(e=this.lastImg,t.clientX,t.clientY,i=(a=this.startTouch).startX,a=a.startY,l=(c=this.initial).initialX,c=c.initialY,n=e.centerX,r=e.centerY,this.initial.initialRotate,s=(o=this.initial).initialH,o=o.initialW,"move"==e.place?(e.x=l+(t.offsetX-i),e.y=c+(t.offsetY-a)):"rotate"==e.place?(l=Math.atan2(a-r,i-n),(c=180*(Math.atan2(t.offsetY-r,t.offsetX-n)-l)/Math.PI)<0&&(c-=360),e.rotate=c):"transform"==e.place&&(l=Math.sqrt(Math.pow(n-i,2)+Math.pow(r-a,2)),c=Math.sqrt(Math.pow(n-t.offsetX,2)+Math.pow(r-t.offsetY,2))-l,o<s?(e.h=s+c,e.w=o+o/s*c):s==o?(e.h=s+c,e.w=o+c):(e.w=o+c,e.h=s+s/o*c)),this.draw())},up:function(){var t=this.lastImg,e=this.lastImg,i=e.place,a=e.rotate,n=e.centerX,r=e.centerY,s=(e.x,e.y,e.pointList),e=e.oldAngle;null==t?this.clickedkArr=[]:("move"==i?t.calculate():"rotate"==t.place?(e=360-(a-e),this.lastImg.oldAngle=a,a={x:n,y:-1*r},(n={x:0,y:0}).x=s[0].x,n.y=-1*s[0].y,r=this.XY(n,a,e),s[0].x=r.x,s[0].y=r.y,n.x=s[1].x,n.y=-1*s[1].y,r=this.XY(n,a,e),s[1].x=r.x,s[1].y=r.y,n.x=s[2].x,n.y=-1*s[2].y,r=this.XY(n,a,e),s[2].x=r.x,s[2].y=r.y,n.x=s[3].x,n.y=-1*s[3].y,r=this.XY(n,a,e),s[3].x=r.x,s[3].y=r.y):"transform"==i&&t.ratio(),this.checkClickArea=[])}},Object(c.a)(h,"leave",function(){}),Object(c.a)(h,"XY",function(t,e,i){var a=(t.x-e.x)*Math.cos(i*Math.PI/180)-(t.y-e.y)*Math.sin(i*Math.PI/180)+e.x,t=(t.x-e.x)*Math.sin(i*Math.PI/180)+(t.y-e.y)*Math.cos(i*Math.PI/180)+e.y;return t*=-1,{x:Number(a.toFixed(2)),y:Number(t.toFixed(2))}}),h),mounted:function(){var t=document.getElementById("myCanvas");(this.c=t).width=600,t.height=600,this.ctx=t.getContext("2d")}},g=(e("b8a0"),e("978b"),e("2877")),h=Object(g.a)(h,function(){var i=this,t=i.$createElement,a=i._self._c||t;return a("div",{staticClass:"diy"},[a("div",{directives:[{name:"show",rawName:"v-show",value:!i.popShow,expression:"!popShow"}],staticClass:"left"},[a("div",{staticClass:"left-button"},i._l(i.buttons,function(t,e){return a("el-button",{class:i.buttonIndex==e?"buttonStyle":"",attrs:{type:"primary",size:"small ",keys:"index"},on:{click:function(t){return i.setButton(e)}}},[i._v(i._s(t))])}),1),a("div",{staticClass:"product"},[a("div",{staticClass:"search"},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入搜索内容",size:"max"},model:{value:i.product.search,callback:function(t){i.$set(i.product,"search",t)},expression:"product.search"}},[a("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},slot:"append"})],1)],1),a("div",{staticClass:"options"},[a("div",{staticClass:"typeList"},[a("input",{ref:"file",staticClass:"input-opacity",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpeg, image/png, image/jpg"},on:{change:function(t){return i.addImage(t)}}}),i._l(i.typeButton,function(t,e){return a("div",{staticClass:"typeBtn",on:{mouseenter:function(t){return i.enter(e)},mouseleave:i.leave}},[i._v(" "+i._s(t)+" "),a("i",{class:i.mouseIndex==e?"el-icon-arrow-up":"el-icon-arrow-down"})])}),a("el-radio",{attrs:{label:"1"},model:{value:i.product.radio,callback:function(t){i.$set(i.product,"radio",t)},expression:"product.radio"}},[i._v("全部")]),a("el-radio",{attrs:{label:"2"},model:{value:i.product.radio,callback:function(t){i.$set(i.product,"radio",t)},expression:"product.radio"}},[i._v("常用")]),a("div",{staticClass:"typeBtn",staticStyle:{color:"#55afae"}},[i._v("重置")])],2),a("div",{staticClass:"pickList"},i._l(i.typeArr,function(t,e){return a("div",{directives:[{name:"show",rawName:"v-show",value:i.pickShow,expression:"pickShow"}],staticClass:"typePick",on:{mouseenter:function(t){return i.enter(e)},mouseleave:i.leave}},[a("ul",[a("li",[i._v(i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])]),a("ul",i._l(t.children,function(t,e){return a("li",[i._v(" "+i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])}),0),a("ul",i._l(t.children.children,function(t,e){return a("li",[i._v(" "+i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])}),0)])}),0)])]),a("div",{staticClass:"imgList"},[i._l(i.imgList,function(t,e){return a("div",{staticClass:"imgItem",style:i.imgIndex==e?" border: 1px solid #55afae;":"",on:{click:function(t){return i.pickImg(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),a("div",{staticClass:"imgPage"},[a("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{small:"",layout:"prev, pager, next",total:100}}),a("p",[i._v("共有100件商品")])],1)],2)]),a("div",{directives:[{name:"show",rawName:"v-show",value:!i.popShow,expression:"!popShow"}],staticClass:"right"},[a("div",{staticClass:"flex"},[a("div",{staticClass:"imgList"},i._l(i.curImgList,function(t,e){return a("div",{staticClass:"curimg",style:i.curimgIndex==e?" border: 1px solid #55afae;":"",on:{click:function(t){return i.curImgIndex(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),0),a("div",{staticClass:"canvas"},[a("img",{ref:"myImg",attrs:{src:e("b3ba")}}),a("canvas",{ref:"myCanvas",attrs:{id:"myCanvas"},on:{mousedown:i.start,mousemove:i.move,mouseup:i.up,mouseleave:i.leave}})]),a("div",{staticClass:"swiper"},[a("swiper",{ref:"interSwiper",staticClass:"swiper-no-swiping",attrs:{options:i.swipeOptions}},[i._l(i.imgList,function(t,e){return a("swiper-slide",[a("img",{attrs:{src:t}})])}),a("div",{staticClass:"swiper-button-prev",attrs:{slot:"button-prev"},on:{click:i.swiperPrev},slot:"button-prev"}),a("div",{staticClass:"swiper-button-next",attrs:{slot:"button-next"},on:{click:i.swiperNext},slot:"button-next"})],2),a("div",{staticClass:"count"},[i._v(i._s(i.scrollImg)+"/"+i._s(i.imgList.length))]),a("i",{staticClass:"el-icon-zoom-in pop",on:{click:i.openPop}}),i._m(0),a("div",{staticClass:"specifications"},[i._m(1),i._m(2),a("div",{staticClass:"num"},[a("div",{staticClass:"title"},[i._v("数量")]),a("el-input-number",{attrs:{size:"mini",min:1},on:{blur:i.handleBlur},model:{value:i.num,callback:function(t){i.num=t},expression:"num"}})],1),a("div",{staticClass:"button"},[a("el-button",{staticClass:"but-car",attrs:{size:"small"}},[i._v("加入购物车")]),a("el-button",{staticClass:"but-save",attrs:{size:"small"}},[i._v("保存")])],1)])],1)])]),a("div",{directives:[{name:"show",rawName:"v-show",value:i.popShow,expression:"popShow"}],staticClass:"fiexd"},[a("div",{staticClass:"close"},[a("i",{staticClass:"el-icon-back",on:{click:i.closePop}})]),a("div",{staticClass:"swiper"},[a("div",{staticClass:"imgList"},i._l(i.imgList,function(t,e){return a("div",{class:{imgItem:!0,border:e==i.active},on:{click:function(t){return i.popSwiper(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),0),a("swiper",{ref:"redefineSwipe1",staticClass:"swiperOptions1 swiper-no-swiping",attrs:{options:i.swiperOptions1}},i._l(i.imgList,function(t){return a("swiper-slide",{staticClass:"rs-box"},[a("img",{staticClass:"rs-icon",attrs:{src:t}})])}),1)],1)])])},[function(){var t=this,e=t.$createElement,e=t._self._c||e;return e("div",{staticClass:"detail"},[e("div",{staticClass:"size"},[t._v("推荐尺寸"),e("span",[t._v(" 2000px*800px")])]),e("div",{staticClass:"quality"},[t._v("打印质量:"),e("span",[t._v("优秀")])])])},function(){var t=this,e=t.$createElement,e=t._self._c||e;return e("div",{staticClass:"color"},[e("div",{staticClass:"title"},[t._v("颜色")]),e("p",[e("span"),t._v(" "),e("span"),t._v(" "),e("span"),t._v(" "),e("span")])])},function(){var t=this,e=t.$createElement,e=t._self._c||e;return e("div",{staticClass:"size"},[e("div",{staticClass:"title"},[t._v("规格")]),e("p",[e("span",[t._v("s")]),e("span",[t._v("m")]),e("span",[t._v("l")])])])}],!1,null,"e6074e54",null).exports,f=(e("cb29"),e("ac1f"),e("5319"),e("4d63"),e("7db0"),e("fb6a"),e("1276"),e("466d"),e("5cc6"),e("9a8c"),e("a975"),e("735e"),e("c1ac"),e("d139"),e("3a7b"),e("d5d6"),e("82f8"),e("e91f"),e("60bd"),e("5f96"),e("3280"),e("3fcc"),e("ca91"),e("25a1"),e("cd26"),e("3c5d"),e("2954"),e("649e"),e("219c"),e("170b"),e("b39a"),e("72f7"),e("caad"),e("99af"),e("1b62")),x=e("362d"),m=e("b85c"),p={name:"threed",components:{},props:{picimg:{type:String|Array,default:function(){return null}}},data:function(){return{LOADER:document.getElementById("js-loader"),DRAG_NOTICE:document.getElementById("js-drag-notice"),TRAY:document.getElementById("js-tray-slide"),theModel:"",number:0,numberf:0,MODEL_PATH:"https://www.didaplan.cn/3D/baozhen.glb",cameraFar:5,activeOption:"RootNode",BACKGROUND_COLOR:15856113,scene:"",canvas:"",renderer:"",camera:"",controls:"",index:0,texture:"",INITIAL_MTL:"",INITIAL_MAP:""}},methods:{initModel:function(t){var e=this,i=document.querySelector("#c"),a=new THREE.GLTFLoader;this.renderer=new THREE.WebGLRenderer({canvas:i,antialias:!0,alpha:!0}),this.renderer.shadowMap.enabled=!0,this.renderer.setPixelRatio(window.devicePixelRatio),this.scene=new THREE.Scene,this.scene.background=new THREE.Color(this.BACKGROUND_COLOR),this.scene.fog=new THREE.Fog(this.BACKGROUND_COLOR,20,100),this.camera=new THREE.PerspectiveCamera(50,window.innerWidth/window.innerHeight,.1,1e3),this.camera.position.z=this.cameraFar,this.camera.position.x=0,this.INITIAL_MTL=new THREE.MeshPhongMaterial({color:16777215,shininess:10}),this.INITIAL_MAP=[{index:0,childID:"RootNode",mtl:e.INITIAL_MTL},{index:1,childID:"RootNode2",mtl:e.INITIAL_MTL}],a.setDRACOLoader(new THREE.DRACOLoader),a.load(t,function(t){e.number=-1,e.numberf=1,e.scene.remove(e.theModel),e.theModel=t.scene,e.theModel.traverse(function(t){t.isMesh&&(t.castShadow=!0,t.receiveShadow=!0)}),e.initColor(e.theModel,e.INITIAL_MAP[0].childID,e.INITIAL_MAP[0].mtl),e.scene.add(e.theModel)},void 0,function(t){})},initColor:function(t,e,i){for(var a=t.children[0].children,n=0;n<a.length;n++)a[n].material=i,a[n].isMesh?this.number++:this.numberf++;this.index=this.numberf;var r,s=document.querySelectorAll(".option"),o=Object(m.a)(s);try{for(o.s();!(r=o.n()).done;)r.value.addEventListener("click",this.selectOption)}catch(t){o.e(t)}finally{o.f()}s[0].classList.add("--is-active");for(var l=0;l<s.length;l++)l>=this.number?s[l].style.display="none":s[l].style.display="flex";var t=new THREE.HemisphereLight(16777215,16777215,.61),t=(t.position.set(0,50,0),this.scene.add(t),new THREE.DirectionalLight(16777215,.54)),t=(t.position.set(-8,12,8),t.castShadow=!0,t.shadow.mapSize=new THREE.Vector2(1024,1024),this.scene.add(t),new THREE.PlaneGeometry(5e3,5e3,1,1)),c=new THREE.MeshPhongMaterial({color:15658734,shininess:0}),t=new THREE.Mesh(t,c);t.rotation.x=-.5*Math.PI,t.receiveShadow=!0,t.position.y=-1,this.scene.add(t),this.controls=new THREE.OrbitControls(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.enablePan=!0,this.controls.dampingFactor=.2,this.controls.autoRotate=!1,this.controls.autoRotateSpeed=.1,this.controls.maxDistance=1.5},selectOption:function(t){var e,i=t.target,t=(this.index=t.target.dataset.index,this.index=parseInt(this.index)+parseInt(this.numberf),this.activeOption=t.target.dataset.option,document.querySelectorAll(".option")),a=Object(m.a)(t);try{for(a.s();!(e=a.n()).done;)e.value.classList.remove("--is-active")}catch(t){a.e(t)}finally{a.f()}i.classList.add("--is-active")},animate:function(){var t;this.controls&&this.controls.update(),this.renderer.render(this.scene,this.camera),requestAnimationFrame(this.animate),this.resizeRendererToDisplaySize(this.renderer)&&(t=this.renderer.domElement,this.camera.aspect=t.clientWidth/t.clientHeight,this.camera.updateProjectionMatrix())},resizeRendererToDisplaySize:function(t){var e=t.domElement,i=window.innerWidth,a=window.innerHeight,n=e.width/window.devicePixelRatio,e=e.height/window.devicePixelRatio,n=n!==i||e!==a;return n&&t.setSize(i,a,!1),n},selectSwatch:function(t){var e=this,i=new Image,a=(i.src=t,(new THREE.TextureLoader).load(t)),n=new THREE.MeshPhongMaterial({map:a,shininess:10,opacity:1,transparent:!0});i.onload=function(){a.needsUpdate=!0,e.setMaterial(e.theModel,n)}},setMaterial:function(t,e){t.children[0].children[this.index].material=e}},watch:{picimg:function(t){this.selectSwatch(t)}},created:function(){},mounted:function(){this.initModel(this.MODEL_PATH),this.animate()}},p=(e("b7d9"),Object(g.a)(p,function(){var t=this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,t=this._self._c||t;return t("div",{staticClass:"body"},[t("div",{staticClass:"options"},[t("div",{staticClass:"option --is-active",attrs:{title:"拉链","data-option":"RootNode","data-index":"0"}},[t("img",{attrs:{src:"https://crossdiy.didaplan.cn/uploads/20220722/e58be1ad824657a29f54ae8e4b4a35fc.jpg"}})]),t("div",{staticClass:"option",attrs:{title:"正面","data-option":"RootNode2","data-index":"1"}},[t("img",{attrs:{src:"https://crossdiy.didaplan.cn/uploads/20220722/dc633ab40dfc030368fbcf7d825ca53c.jpg"}})])]),t("div",{staticClass:"controls"},[t("div",{staticClass:"info"}),t("div",{staticClass:"tray",attrs:{id:"js-tray"}},[t("div",{staticClass:"tray__slide",attrs:{id:"js-tray-slide"}})])]),t("canvas",{attrs:{id:"c"}})])}],!1,null,"56b6109b",null).exports);e("4de4");function y(c,d,u,h,t,g){var f;c.on("click tap ",function(t){var e;t.target!==c&&(Math.max.apply(Math,Object(l.a)(d.children.map(function(t){return t.zIndex()}))),e=d.children.filter(function(t){return"background"===t.attrs.status}),d.children.filter(function(t){return"fill"===t.attrs.name}),0!==e.length&&"background"===t.target.attrs.status?t.target.zIndex(0):(u.moveToTop(),0!==d.find(".grid").length&&d.find(".grid").forEach(function(t){t.moveToTop()})),d.find(".fill").forEach(function(t){t.zIndex(0)})),t.target===c||"fill"===t.target.attrs.name?(u.nodes([]),d.draw()):-1!==t.target.getName().indexOf("rectTransformer")&&t.target!==u.nodes()[0]&&(u.nodes([t.target]),d.draw())}),u.on("transform",function(t){}),h&&(h.on("dblclick",function(t){g(),h.hide(),u.hide(),d.draw();var e=h.absolutePosition(),i=c.container().getBoundingClientRect(),a=(1/(document.body.style.zoom||1)).toFixed(3),n=i.left*a+e.x,i=i.top*a+e.y,r=document.createElement("textarea"),a=(document.body.appendChild(r),r.value=h.text(),r.style.position="absolute",r.style.top=i+"px",r.style.left=n+"px",h.attrs.data||(r.style.width=h.width()-2*h.padding()+"px",r.style.height=h.height()-2*h.padding()+5+"px",r.style.lineHeight=h.lineHeight()),r.style.fontSize=h.fontSize()+"px",r.style.border="none",r.style.padding="0px",r.style.margin="0px",r.style.overflow="hidden",r.style.background="none",r.style.outline="none",r.style.resize="none",r.style.letterSpacing=h.letterSpacing()+"px",r.style.fontFamily=h.fontFamily(),r.style.textDecoration=h.textDecoration(),r.style.transformOrigin="left top",r.style.textAlign=h.align(),r.style.color=h.fill(),h.getRotation()),e="",i=(a&&(e+="rotateZ("+a+"deg)"),0);function s(){r.parentNode.removeChild(r),window.removeEventListener("click",o),h.show(),u.show(),u.forceUpdate(),d.draw()}function o(t){t.target!==r&&(h.text(r.value),s())}-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&(i+=2+Math.round(h.fontSize()/20)),r.style.transform=e+="translateY(-"+i+"px)",r.style.height="auto",r.style.height=r.scrollHeight+3+"px",r.focus(),r.addEventListener("keydown",function(t){13!==t.keyCode||t.shiftKey||(h.text(r.value),s()),27===t.keyCode&&s()}),r.addEventListener("keydown",function(t){var e,i,a=h.getAbsoluteScale().x;a=(a=h.width()*a)||h.placeholder.length*h.fontSize(),e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(e||i)&&(a=Math.ceil(a)),(document.documentMode||/Edge/.test(navigator.userAgent))&&(a+=1),r.style.width=a+"px",r.style.height="auto",r.style.height=r.scrollHeight+h.fontSize()+"px"}),setTimeout(function(){window.addEventListener("click",o)})}),f=0,h.on("tap",function(t){var e,n,i,a,r,s=(new Date).getTime();function o(){n.parentNode.removeChild(n),window.removeEventListener("touchstart",l),h.show(),u.show(),u.forceUpdate(),d.draw()}function l(t){t.target!==n&&(h.text(n.value),o())}s-f<300?(g(),h.hide(),u.hide(),d.draw(),i=h.absolutePosition(),r=c.container().getBoundingClientRect(),a=(1/(document.body.style.zoom||1)).toFixed(3),e=r.left*a+i.x,r=r.top*a+i.y,n=document.createElement("textarea"),document.body.appendChild(n),n.value=h.text(),n.style.position="absolute",n.style.top=r+"px",n.style.left=e+"px",n.style.width=h.width()-2*h.padding()+"px",n.style.height=h.height()-2*h.padding()+5+"px",n.style.fontSize=h.fontSize()+"px",n.style.border="none",n.style.padding="0px",n.style.margin="0px",n.style.overflow="hidden",n.style.background="none",n.style.outline="none",n.style.resize="none",n.style.letterSpacing=h.letterSpacing()+"px",n.style.lineHeight=h.lineHeight(),n.style.fontFamily=h.fontFamily(),n.style.transformOrigin="left top",n.style.textAlign=h.align(),n.style.color=h.fill(),a="",(i=h.getRotation())&&(a+="rotateZ("+i+"deg)"),r=0,-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&(r+=2+Math.round(h.fontSize()/20)),n.style.transform=a+="translateY(-"+r+"px)",n.style.height="auto",n.style.height=n.scrollHeight+3+"px",n.focus(),n.addEventListener("keydown",function(t){13!==t.keyCode||t.shiftKey||(h.text(n.value),o()),27===t.keyCode&&o()}),n.addEventListener("keydown",function(t){var e,i,a=h.getAbsoluteScale().x;a=(a=h.width()*a)||h.placeholder.length*h.fontSize(),e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(e||i)&&(a=Math.ceil(a)),(document.documentMode||/Edge/.test(navigator.userAgent))&&(a+=1),n.style.width=a+"px",n.style.height="auto",n.style.height=n.scrollHeight+h.fontSize()+"px"}),setTimeout(function(){window.addEventListener("touchstart",l)}),0):(f=s,0)}))}function v(e){e.on("mousemove touchmove ",function(t){(t.target===e||(e.container().style.cursor="move","gridLv"===t.target.attrs.name&&(e.container().style.cursor="col-resize"),"gridLh"===t.target.attrs.name&&(e.container().style.cursor="row-resize"),"fill"===t.target.attrs.name))&&(e.container().style.cursor="default")})}e("0481");function b(u,h){u.on("dragmove",function(e){var i,a,n,t,r,s,o,l,c,d;"rectTransformer"===e.target.attrs.name&&(h.find(".guid-line").forEach(function(t){t.destroy()}),i=e.target,a=[0,(c=u).width()/2,c.width()],n=[0,c.height()/2,c.height()],c.find(".rectTransformer").forEach(function(t){t!==i&&(t=t.getClientRect(),a.push([t.x,t.x+t.width,t.x+t.width/2]),n.push([t.y,t.y+t.height,t.y+t.height/2]))}),c.find(".gridLh").forEach(function(t){t.attrs.reference&&t!==i&&(t.attrs.reference,t=t.getClientRect(),a.push([t.x+t.width/2]),n.push([t.y+t.height/2]))}),c.find(".gridLv").forEach(function(t){t.attrs.reference&&t!==i&&(t.attrs.reference,t=t.getClientRect(),a.push([t.x+t.width/2]),n.push([t.y+t.height/2]))}),c={vertical:a.flat(),horizontal:n.flat()},l=e.target,t=l.getClientRect(),l={vertical:[{guide:Math.round(t.x),offset:Math.round(l.x()-t.x),snap:"start"},{guide:Math.round(t.x+t.width/2),offset:Math.round(l.x()-t.x-t.width/2),snap:"center"},{guide:Math.round(t.x+t.width),offset:Math.round(l.x()-t.x-t.width),snap:"end"}],horizontal:[{guide:Math.round(t.y),offset:Math.round(l.y()-t.y),snap:"start"},{guide:Math.round(t.y+t.height/2),offset:Math.round(l.y()-t.y-t.height/2),snap:"center"},{guide:Math.round(t.y+t.height),offset:Math.round(l.y()-t.y-t.height),snap:"end"}]},r=l,s=[],o=[],(t=c).vertical.forEach(function(i){r.vertical.forEach(function(t){var e=Math.abs(i-t.guide);e<5&&s.push({lineGuide:i,diff:e,snap:t.snap,offset:t.offset})})}),t.horizontal.forEach(function(i){r.horizontal.forEach(function(t){var e=Math.abs(i-t.guide);e<5&&o.push({lineGuide:i,diff:e,snap:t.snap,offset:t.offset})})}),t=[],l=s.sort(function(t,e){return t.diff-e.diff})[0],c=o.sort(function(t,e){return t.diff-e.diff})[0],l&&t.push({lineGuide:l.lineGuide,offset:l.offset,orientation:"V",snap:l.snap}),c&&t.push({lineGuide:c.lineGuide,offset:c.offset,orientation:"H",snap:c.snap}),(l=t).length)&&(d=h,l.forEach(function(t){var e;"H"===t.orientation?(e=new Konva.Line({points:[-6e3,t.lineGuide,6e3,t.lineGuide],stroke:"rgb(255, 232, 41)",strokeWidth:2.5,name:"guid-line",dash:[6,6]}),d.add(e),d.batchDraw()):"V"===t.orientation&&(e=new Konva.Line({points:[t.lineGuide,-5e3,t.lineGuide,5e3],stroke:"rgb(255, 232, 41)",strokeWidth:2.5,name:"guid-line",dash:[6,6]}),d.add(e),d.batchDraw())}),l.forEach(function(t){switch(t.snap){case"start":case"center":case"end":switch(t.orientation){case"V":e.target.x(t.lineGuide+t.offset);break;case"H":e.target.y(t.lineGuide+t.offset)}}}))}),u.on("dragend",function(e){h.find(".guid-line").forEach(function(t){t.destroy()}),"rectTransformer"===e.target.attrs.name&&(u.find(".gridLh").forEach(function(t){t.attrs.reference&&t.attrs.Linefollow&&(t.points()[1]=e.target.y()+t.attrs.imagey,t.points()[3]=e.target.y()+t.attrs.imagey)}),u.find(".gridLv").forEach(function(t){t.attrs.reference&&t.attrs.Linefollow&&(t.points()[0]=e.target.x()+t.attrs.imagex,t.points()[2]=e.target.x()+t.attrs.imagex)})),h.batchDraw()})}var H=e("c749"),w=e("ed95"),k=e("22fe"),A=e("099e"),I=e.n(A);function S(t){t.scale().x<0&&t.scale().y<0?t.scale({x:t.scale().x-.1,y:t.scale().y-.1}):t.scale().x<0?t.scale({x:t.scale().x-.1,y:t.scale().y+.1}):t.scale().y<0?t.scale({x:t.scale().x+.1,y:t.scale().y-.1}):t.scale({x:t.scale().x+.1,y:t.scale().y+.1})}function C(t){t.scale().x<0&&t.scale().y<0?t.scale({x:t.scale().x+.1,y:t.scale().y+.1}):t.scale().x<0?t.scale({x:t.scale().x+.1,y:t.scale().y-.1}):t.scale().y<0?t.scale({x:t.scale().x-.1,y:t.scale().y+.1}):t.scale({x:t.scale().x-.1,y:t.scale().y-.1})}function _(t){var e=t.attrs.width,i=t.attrs.height,a=0;i<e&&e<=600?(e=600*(a=e/i),i=600):e<i&&i<=600?(a=i/e,i=(e=600)*a):e==i&&i<=600&&(i=e=600,a=1),t.scale({x:a,y:a}),t.x((600-e)/2+e/2),t.y((600-i)/2+i/2)}function E(t,e){var i=t.attrs.width,a=t.attrs.height,n=0;!(e.width<=e.height&&i/a>=e.width/e.height)&&(e.width<=e.height&&i/a<e.width/e.height||e.height<e.width&&a/i>=e.height/e.width)?(n=e.width/i,i=e.width,a*=n):(n=e.height/a,a=e.height,i*=n),t.scale({x:n,y:n}),t.x(e.x+e.width/2),t.y(e.y+e.height/2)}function O(t){var e=t.attrs.width,i=t.attrs.height,a=0;i<e?(a=e/600,e=600,i/=a):(a=i/600,i=600,e/=a),t.scale({x:a,y:a}),t.x((600-e)/2+e/2),t.y((600-i)/2+i/2)}function L(t,e){var i=t.attrs.width,a=t.attrs.height,n=0;!(e.width<=e.height&&i/a>=e.width/e.height)&&(e.width<=e.height&&i/a<e.width/e.height||e.height<e.width&&a/i>=e.height/e.width)?(n=e.height/a,a=e.height,i*=n):(n=e.width/i,i=e.width,a*=n),t.scale({x:n,y:n}),t.x(e.x+e.width/2),t.y(e.y+e.height/2)}var $=e("5530");function D(t,e,i){this.fangda=i,this.canvas=document.createElement("canvas"),this.canvas.width=t*this.fangda,this.canvas.height=e*this.fangda,this.cWidth=t*this.fangda,this.cHeight=e*this.fangda,this._getImage=function(a){return new Promise(function(t,e){var i=new Image;i.crossOrigin="anonymous",i.onload=function(){t(i)},i.src=a})},this._dataURLToBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),a=i.length,n=new Uint8Array(a);a--;)n[a]=i.charCodeAt(a);return new Blob([n],{type:e})}}D.prototype._getImgConfig=function(t){var e=t.width*Math.abs(t.scaleX)*t.canvasZoom*this.fangda,i=t.height*Math.abs(t.scaleY)*t.canvasZoom*this.fangda,a=t.left*t.canvasZoom*this.fangda+t.viewportTransform[0]*this.fangda,n=t.top*t.canvasZoom*this.fangda+t.viewportTransform[1]*this.fangda,r=t.angle;return Object($.a)({orignW:e,orignH:i,orignL:a,orignT:n,marginLeft:0,marginTop:0,orignAngle:r},t)},D.prototype._returnJingxiangImg=function(r){var s=this;return new Promise(function(e,t){!function(){i.apply(this,arguments)}(function(t){e(t)})});function i(){return(i=Object(o.a)(regeneratorRuntime.mark(function t(e){var i,a,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.image,r.flipX||r.flipY||e(n),i=document.createElement("canvas"),a=i.getContext("2d"),i.width=r.naturalWidth,i.height=r.naturalHeight,r.flipX&&r.flipY?(a.translate(i.width,i.height),a.scale(-1,-1)):r.flipX?(a.translate(i.width,0),a.scale(-1,1)):r.flipY&&(a.translate(0,i.height),a.scale(1,-1)),a.drawImage(n,0,0),a=i.toDataURL("image/webp"),t.next=11,s._getImage(a);case 11:n=t.sent,e(n);case 13:case"end":return t.stop()}},t)}))).apply(this,arguments)}},D.prototype._patternInitData=function(t,e,i){var a,n,r=document.createElement("canvas"),s=r.getContext("2d"),o=t.orignW,l=t.orignH,c=t.marginLeft,d=t.marginTop;return"jichu"==e&&(r.width=c+o,r.height=d+l,s.drawImage(i,c/2,d/2,o,l)),"hengxiang"==e&&(r.width=2*c+2*o,r.height=2*d+2*l,s.drawImage(i,c/2,d/2,o,l),s.drawImage(i,1.5*c+o,d/2,o,l),s.drawImage(i,t.naturalWidth/2,0,t.naturalWidth/2,t.naturalHeight,0,1.5*d+l,o/2,l),s.drawImage(i,c+o/2,1.5*d+l,o,l),s.drawImage(i,0,0,t.naturalWidth/2,t.naturalHeight,2*c+1.5*o,1.5*d+l,o/2,l)),"zongxiang"==e&&(r.width=2*c+2*o,r.height=2*d+2*l,s.drawImage(i,c/2,d/2,o,l),s.drawImage(i,c/2,1.5*d+l,o,l),s.drawImage(i,0,t.naturalHeight/2,t.naturalWidth,t.naturalHeight/2,1.5*c+o,0,o,l/2),s.drawImage(i,1.5*c+o,d+l/2,o,l),s.drawImage(i,0,0,t.naturalWidth,t.naturalHeight/2,1.5*c+o,2*d+1.5*l,o,l/2)),"jingxiang"==e&&(r.width=2*c+2*o,r.height=2*d+2*l,t=-o-c/2,e=-l-d/2,a=o+1,n=l+1,s.save(),s.drawImage(i,c/2,d/2,a,n),s.restore(),s.save(),s.scale(-1,1),s.drawImage(i,t-o-c,d/2,a,n),s.restore(),s.save(),s.scale(1,-1),s.drawImage(i,c/2,e-l-d,a,n),s.restore(),s.save(),s.scale(-1,-1),s.drawImage(i,t-o-c,e-l-d,a,n)),s.restore(),r},D.prototype.setPattern=function(){var a=Object(o.a)(regeneratorRuntime.mark(function t(e,i,a){var n,r,s,o,l,c,d,u,h,g,f,m,p,y;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&i){t.next=3;break}return alert("参数传输不正确"),t.abrupt("return");case 3:return t.next=5,this._returnJingxiangImg(e);case 5:if(g=t.sent,n=this.canvas.getContext("2d"),h=this._getImgConfig(e),r=h.orignW,s=h.orignH,o=h.orignL,l=h.orignT,c=h.marginLeft,d=h.marginTop,u=h.orignAngle,n.clearRect(0,0,this.cWidth,this.cHeight),h=this._patternInitData(h,i,g),g=n.createPattern(h,"repeat"),f=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),g.setTransform){t.next=16;break}return alert("浏览器不支持，平铺效果，请切换到谷歌浏览器"),t.abrupt("return");case 16:return m=Math.sqrt(Math.pow(h.width,2)+Math.pow(h.height,2)),p=Math.atan(h.height/h.width),p=u*Math.PI/180+p,"left"==e.originX?(c+=2,d+=2,y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(-c/2,-d/2)):(c-=2,d-=2,"jichu"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(r/2+c/2,s/2+d/2):"jingxiang"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(-(r/2+c/2),-(s/2+d/2)):"zongxiang"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(r/2+c/2,0):"hengxiang"==i&&(y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(0,s/2+d/2))),g.setTransform(y),n.fillStyle=g,n.fillRect(0,0,this.cWidth,this.cHeight),t.t0=a,t.next=27,this._returnCanvasImg();case 27:t.t1=t.sent,(0,t.t0)(t.t1);case 29:case"end":return t.stop()}},t,this)}));return function(t,e,i){return a.apply(this,arguments)}}(),D.prototype._returnCanvasImg=Object(o.a)(regeneratorRuntime.mark(function t(){var i,e,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=function(){return(e=Object(o.a)(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,e){try{t(i.canvas.toDataURL())}catch(t){e(t)}}));case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)},a=function(){return e.apply(this,arguments)},i=this,t.next=6,a();case 6:return a=t.sent,t.abrupt("return",a);case 9:case"end":return t.stop()}},t,this)}));var A=e("90b9"),T=(e("9490"),e("bc3a")),P=e.n(T),T=e("ca08"),z=e.n(T),T=e("d581"),j=e("bab4"),Z=e.n(j);e("6107");r.a.use([d.a,u.a]);var j={name:"SelectAndTransform",status:"image",mixins:[f.c],components:{Swiper:n.Swiper,SwiperSlide:n.SwiperSlide,threed:p,SearchAccount:T.a},props:{category:{type:Array,default:[]},res:{type:Array,default:[]},category1:{type:Array,default:[]},level:{type:Array,default:[]},productList:{type:Object,default:{}},productDetail:{type:Object,default:{}},currentArea:{type:Object,default:{}},imgLoading:{type:Boolean,default:!1},productLoding:{type:Boolean,default:!1},materiaLoding:{type:Boolean,default:!1},sourceList:{type:Object,default:{}},folderList:{type:Array,default:[]},keywordList:{type:Array,default:[]},sizes:{type:Array,default:[]},attr_id:{type:Number,default:0},currentId:{type:String|Number,default:function(){return null}},initProductDetailPsd:{type:Array,default:function(){return[]}}},data:function(){var t=this;return{self_adaption:!1,Gradientcolor3:"#2D0EAD",Gradientcolor4:"#F2CA51",Gradientcolor5:"#522D97",Gradientcolor6:"#A700FD",Gradientcolor7:"#FF0084",blendmode:"screen",mixblendmode:[{name:"正常",value:"normal"},{name:"正片叠底",value:"multiply"},{name:"滤色",value:"screen"},{name:"叠加",value:"overlay"},{name:"变暗",value:"darken"},{name:"变亮",value:"lighten"},{name:"颜色减淡",value:"color-dodge"},{name:"颜色加深",value:"color-burn"},{name:"强光",value:"hard-light"},{name:"柔光",value:"soft-light"},{name:"差值",value:"difference"},{name:"排除",value:"exclusion"},{name:"色相",value:"hue"},{name:"饱和度",value:"saturation"},{name:"颜色",value:"color"},{name:"亮度",value:"luminosity"}],lvjingVisible:!1,lvjingVisible2:!1,lvjingVisible3:!1,lvjingVisible4:!1,lvjingLoading:!1,lvjingLoading2:!1,lvjingLoading3:!1,lvjingLoading4:!1,showcut:!1,htmlString:'<div id="lvjingboxx"  style="display: flex;"><div id="lvjing" style="background-image: linear-gradient(to right, Gradientcolor1, Gradientcolor2); visibility: visible; width:700px;margin: 0px; padding: 0px; font-size: 0px; border: 0;"><img id="lvjingimg" style="mix-blend-mode: screen; height: 100%; width: 100%;" src="srcpath"></div></div>',htmlString2:'<div id="lvjingboxx2" style="background-color:Gradientcolor5; visibility: visible;width: 700px;display: flex;"><img id="lvjingimg2" style="mix-blend-mode: hard-light;width: 100%;"src="srcpath"></div>',htmlString3:'<div id="lvjingboxx3" style="visibility: visible;;z-index: auto;width: 700px;font-size: 0;"><div style="background-color: Gradientcolor6;"><img style="width: 100%;opacity: 1;height: 100%;filter: grayscale(1);mix-blend-mode: multiply;object-fit: contain;" src="srcpath"></div><div style="background-color:Gradientcolor7;mix-blend-mode: lighten;position: absolute;top: 0;right: 0;bottom: 0;left: 0;overflow: hidden;"><img style="transform: translateY(10px) scale(-1.4, 1.4);width: 100%;height: 100%;opacity: 1;filter: grayscale(1);mix-blend-mode: multiply;object-fit: contain;" src="srcpath"></div></div>',htmlString4:'<div id="lvjingboxx4"style="visibility: visible;width: 700px;filter: grayscale(1) contrast(1.1) brightness(1.1);display: flex;"><img style="width: 100%;" src="srcpath"></div>',svgXml:[],svgpath:[],cutpiece_index:0,layerimages:{},layerimages2:[],imageindex:0,drawer:!1,drawerg:!1,picimg:"",images:[],color:"rgba(255,255,255,0)",defaultcolor:"#ffffff",stage:"",layer:"",fill:"",grid:"",transformer:"",tr:"",curImg:"",lucency:100,options:H.a,fontstyleoptions:[{value:"normal",style:"normal",weight:"normal",label:"正常"},{value:"italic",style:"italic",weight:"normal",label:"斜体"},{value:"bold",style:"normal",weight:"bold",label:"加粗"},{value:"italic bold",style:"italic",weight:"bold",label:"加粗斜体"}],textdecorationoptions:[{value:"",label:"无"},{value:"underline",label:"下划线"},{value:"line-through",label:"删除线"}],fontFamily:"Arial",fontColor:"#000000",fontstrokeColor:"#FFFFFF",fontstrokeWidth:0,fontletterSpacing:0,fontData:-200,fontgData:0,textDecoration:"",fontlineHeight:1,fillAfterStrokeEnabled:!1,fontSizeStr:40,fontStyle:"normal",textShadowEnabled:!1,textShadowColor:"#2D4571",textShadowOpacity:1,textShadowOffsetX:5,textShadowOffsetY:5,textShadowBlur:2,popovervisible:!1,gradientEnabled:!1,gradientStartX:0,gradientStartY:0,gradientEndX:0,gradientEndY:30,gradientColors:["#ff0000","#0087F5","#ffffff"],fontSize:[],tag:0,click_up:0,click_up2:0,sourceIds:[],shilihua:0,numgo:1,numgo1:2,dwarning:!1,gaoqingtag:0,changetag:1,changetag1:1,yuantulist:[0,0],vcolorpicker:!1,accelerate_img:e("fcb0"),product:{name:"",cid:"",pageNumber:1,pageSize:20,tag:"全部",level:"全部"},material:{userId:"",fid:"",pageNumber:1,pageSize:20,name:"",keywords:[]},cateListProps:{checkStrictly:!0,expandTrigger:"hover"},car:{num:1},currentProduct:"",currentProductIndex:0,currentMaterialIndex:0,swipeOptions:{initialSlide:0,speed:500,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}},swiperOptions1:{initialSlide:0,speed:500,on:{click:function(){alert("你点了Swiper")},slideChange:function(){t.active=t.$refs.redefineSwipe1.$swiper.activeIndex}}},active:0,leftButtonStatus:"product",keywordShow:!1,popShow:!1,layerLength:!0,layerLength1:!0,productColorIndex:0,productSizeIndex:0,scrollImg:0,allLoading:!1,myCropper:null,afterImg:"",ScaleX:1,ScaleY:1,fixed:!1,inputRotate:0,imgFile:"",autoCropWidth:0,autoCropHeight:0,dialogVisible:!1,croploading:!1,lvjingList:[e("97ca"),e("6cc0"),e("5ed4"),e("484f"),e("ea63"),e("bbe1"),e("eda5"),e("602f"),e("a280"),e("d95a"),e("a058"),e("9d6d"),e("5324"),e("cc51")],SyncJob:null,imageToCartoonLoading:!1,imageToCartoonShow:!1,imageToCartoonList:[{label:"改版-通用",value:"default",List:[{label:"复古漫画",value:0},{label:"3D童话",value:1},{label:"二次元",value:2},{label:"小清新",value:3},{label:"未来科技",value:4},{label:"国画古风",value:5},{label:"将军百战",value:6},{label:"炫彩卡通",value:7},{label:"清雅国风",value:8}]},{label:"人像素描",value:"imageToSketching",List:[{label:"大头照",value:"head"},{label:"全身照",value:"full"}]}],selectedType:"default",selectedSubType:0,showScale:!1,ScaleWidth:void 0,ScaleHeight:void 0,Scaleprop:void 0,MoveX:void 0,MoveY:void 0,randomList:["1","2","3","4","5","6","7","8","9","!0","!1","!2"],GradientNew:"",Gradientloading:!1,Gradientcolor1:"#FF0000",Gradientcolor2:"#000FFF",Gradient:'<svg id="visual" viewBox="0 0 2000 2000" width="2000" height="2000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><defs><filter id="blur1" x="-10%" y="-10%" width="120%" height="120%"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="210" result="effect1_foregroundBlur"></feGaussianBlur></filter></defs><rect width="2000" height="2000" fill="Gradientcolor1"></rect><g filter="url(#blur1)"><circle cx="random1" cy="random2" fill="Gradientcolor2" r="935"></circle><circle cx="random3" cy="random4" fill="Gradientcolor1" r="935"></circle><circle cx="random5" cy="random6" fill="Gradientcolor2" r="935"></circle><circle cx="random7" cy="random8" fill="Gradientcolor2" r="935"></circle><circle cx="random9" cy="random!0" fill=Gradientcolor1 r="935"></circle><circle cx="random!1" cy="random!2" fill="Gradientcolor2" r="935"></circle></g></svg>'}},methods:{handleCommandText:function(t){"a"==t?this.addFont():this.addFonts()},dragover:function(t){t.preventDefault(),this.isDragging=!0},dragleave:function(){this.isDragging=!1},handleDrop:function(t){var e,o=this,t=t.dataTransfer.files[0];20<Number(t.size/1024/1024)?this.$msgbox({title:"",message:"文件大小不能超过20MB，请重新上传。",type:"warning"}):((e=new FormData).append("file",t),e.append("fid",0),document.getElementsByClassName("input-opacity")[0].value="",this.allLoading=!0,P.a.post("http://crossdiy.didaplan.cn/api/my_source/upLoad",e,{headers:{token:z.a.get("token")}}).then(function(e){var i,a,n,r,s;1==e.data.code?((i=new window.Image).crossOrigin="anonymous",i.src=e.data.data.img_url+"?imageView2/2/w/1200",r=e.data.data.img_url+"?imageView2/2/w/1200",s=e.data.data.img_url,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:e.data.data.id,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:(600-a)/2+a/2,y:(600-n)/2+n/2,rotation:0,offset:{x:a/2,y:n/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};o.images.push(t),o.addElem(t),o.allLoading=!1,o.jilu(),o.clickChange("Material")}):(o.allLoading=!1,o.$message.error(e.data.msg))}).catch(function(t){o.allLoading=!1,o.$message.error(t.data.msg)}))},imgTheme:function(t,e){t&&(this.layer.children[e].attrs.isTheme=t)},changesucai:function(t){this.layer.children[t].attrs.hasOwnProperty("pingpu")?this.$message.warning("平铺图不可操作！"):(this.curImg=this.layer.children[t],this.transformer.children.forEach(function(t){t.nodes([])}),this.tr.nodes([this.curImg]),null!=this.curImg.attrs.text&&(this.fontSizeStr=this.curImg.attrs.fontSize,this.fontFamily=this.curImg.attrs.fontFamily,this.fontColor=this.curImg.attrs.fill))},goAdd:function(t){"product"==t?this.$router.push("/product"):this.$router.push("/workbenchmaterial")},svgToBase64image:function(i){"svghtml"==i&&(this.Gradientloading=!0),"svghtml2"==i&&(this.Bodianloading=!0);var a=document.createElement("canvas"),t=(a.width=2e3,a.height=2e3,document.getElementById(i).innerHTML),n=new Image,r=this;n.src="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(t))),n.onload=function(){a.getContext("2d").drawImage(n,0,0);var t,e=a.toDataURL("image/png"),e=r.dataURLtoFile(e,"svgToBase64image.png");20<Number(e.size/1024/1024)?("svghtml"==i&&(r.Gradientloading=!1),"svghtml2"==i&&(r.Bodianloading=!1),r.$msgbox({title:"",message:"图像大小已超过20MB，请重新生成。",type:"warning"})):((t=new FormData).append("file",e),Object(w.a)(t).then(function(t){"svghtml"==i&&(r.Gradientloading=!1),"svghtml2"==i&&(r.Bodianloading=!1),1==t.data.code?("svghtml"==i&&(r.drawerg=!1),"svghtml2"==i&&(r.drawer2=!1),r.lingshiceshi2(t.data.data.url)):r.messageBox(t)}))}},nativePickG1:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor1=e);case 3:case"end":return t.stop()}},t)}))()},nativePickG2:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor2=e);case 3:case"end":return t.stop()}},t)}))()},lingshiceshi2:function(a){var n=this,r=(this.allLoading=!0,new window.Image),t=(new Date).getTime().toString();r.crossOrigin="anonymous",r.timestamp=t,r.src=a+"?imageView2/2/w/1200",r.onerror=function(){n.allLoading=!1,n.$message.error("素材加载出错！")},r.onload=function(){n.transformer.children.forEach(function(t){t.nodes([])});var t,e=r.width,i=r.height,e=(i<e?(t=e/600,e=600,i/=t):(t=i/600,i=600,e/=t),t={sourceid:1,src:a+"?imageView2/2/w/1200",src1:a,name:"rectTransformer",image:r,width:e,height:i,draggable:!0,x:(600-e)/2+e/2,y:(600-i)/2+i/2,rotation:0,offset:{x:e/2,y:i/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:r.width,naturalHeight:r.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0},Object(c.a)(t,"rotation",0),Object(c.a)(t,"viewportTransform",[0,0]),t);n.images.push(e),n.addElem(e),n.allLoading=!1,n.jilu()}},svgToBase64:function(t){var e=document.createElement("canvas"),t=(e.width=2e3,e.height=2e3,document.getElementById(t).innerHTML),i=new Image;i.src="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(t))),i.onerror=function(t){},i.onload=function(){e.getContext("2d").drawImage(i,0,0);var t=document.createElement("a");t.href=e.toDataURL("image/png"),t.download="GradientNew",t.click()}},Gradientxml:function(){var e=this;this.GradientNew=this.Gradient.replace(new RegExp("<svg","gm"),"<svg style='width: 100%;height: 100%;'"),this.GradientNew=this.GradientNew.replace(new RegExp("Gradientcolor1","gm"),this.Gradientcolor1),this.GradientNew=this.GradientNew.replace(new RegExp("Gradientcolor2","gm"),this.Gradientcolor2),this.randomList.forEach(function(t){e.GradientNew=e.GradientNew.replace(new RegExp("random"+t,"gm"),Math.floor(1800*Math.random())+200)}),this.drawerg=!0},sureScale:function(){var t=this.ScaleHeight>this.ScaleWidth?this.ScaleHeight/this.MaxDesign:(this.ScaleHeight,this.ScaleWidth,this.ScaleWidth/this.MaxDesign);this.curImg.scale({x:t,y:t}),this.curImg.x((Number(this.MoveX)+this.ScaleWidth/2)/this.MaxDesign*600),this.curImg.y((Number(this.MoveY)+this.ScaleHeight/2)/this.MaxDesign*600),this.showScale=!1},ScaleWchange:function(t){this.ScaleHeight=this.Scaleprop*t},ScaleHchange:function(t){this.ScaleWidth=t/this.Scaleprop},ScaleXchange:function(t){t>this.MaxDesign?this.MoveX=this.MaxDesign:this.MoveX=t},ScaleYchange:function(t){t>this.MaxDesign?this.MoveY=this.MaxDesign:this.MoveY=t},imageToCartoon:function(){this.imageToCartoonShow=!0},handleTypeChange:function(t){this.selectedSubType=this.selectedTypeList[0].value},generateImage:function(){document.getElementById("lvjingboxx")&&document.getElementById("lvjingboxx").remove(),this.blendmode="screen";var t=this.htmlString.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1);t=(t=t.replace(new RegExp("Gradientcolor1","gm"),this.Gradientcolor3)).replace(new RegExp("Gradientcolor2","gm"),this.Gradientcolor4);t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer").appendChild(t.body.firstChild)},generateImage2:function(){document.getElementById("lvjingboxx2")&&document.getElementById("lvjingboxx2").remove();var t=(t=this.htmlString2.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1)).replace(new RegExp("Gradientcolor5","gm"),this.Gradientcolor5),t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer2").appendChild(t.body.firstChild)},generateImage3:function(){document.getElementById("lvjingboxx3")&&document.getElementById("lvjingboxx3").remove();var t=this.htmlString3.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1);t=(t=t.replace(new RegExp("Gradientcolor6","gm"),this.Gradientcolor6)).replace(new RegExp("Gradientcolor7","gm"),this.Gradientcolor7);t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer3").appendChild(t.body.firstChild)},generateImage4:function(){document.getElementById("lvjingboxx4")&&document.getElementById("lvjingboxx4").remove();var t=this.htmlString4.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1),t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer4").appendChild(t.body.firstChild),this.startlvjing4()},lvjingblendmode:function(){document.getElementById("lvjingimg").style.mixBlendMode=this.blendmode},startlvjing:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading=!0;var i=new Image,a=this;i.src=this.curImg.attrs.src1,i.onload=function(){var t=document.getElementById("lvjing"),e=(t.style.width=i.width,t.style.height=i.height,document.getElementById("lvjingimg"));e.style.width=i.width,e.style.height=i.height,I.a.toPng(t).then(function(t){var e,t=a.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(a.lvjingVisible=!1,a.lvjingLoading=!1,a.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(w.a)(e).then(function(t){1==t.data.code?(a.lvjingVisible=!1,a.lvjingLoading=!1,a.$message.success("合成完成 添加进画布"),a.lingshiceshi(t.data.data.url)):a.messageBox(t)}))}).catch(function(t){a.lvjingLoading=!1,a.$message.error(t)})}},startlvjing2:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading2=!0;var i=new Image,a=this;i.src=this.curImg.attrs.src1,i.onload=function(){var t=document.getElementById("lvjingboxx2"),e=(t.style.width=i.width,t.style.height=i.height,document.getElementById("lvjingimg2"));e.style.width=i.width,e.style.height=i.height,I.a.toPng(t).then(function(t){var e,t=a.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(a.lvjingVisible2=!1,a.lvjingLoading2=!1,a.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(w.a)(e).then(function(t){1==t.data.code?(a.lvjingVisible2=!1,a.lvjingLoading2=!1,a.$message.success("合成完成 添加进画布"),a.lingshiceshi(t.data.data.url)):a.messageBox(t)}))}).catch(function(t){a.lvjingLoading2=!1,a.lvjingVisible2=!1,a.$message.error(t)})}},startlvjing3:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading3=!0;var e=new Image,i=this;e.src=this.curImg.attrs.src1,e.onload=function(){var t=document.getElementById("lvjingboxx3");t.style.width=e.width,t.style.height=e.height,I.a.toPng(t).then(function(t){var e,t=i.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(i.lvjingVisible3=!1,i.lvjingLoading3=!1,i.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(w.a)(e).then(function(t){1==t.data.code?(i.lvjingVisible3=!1,i.lvjingLoading3=!1,i.$message.success("合成完成 添加进画布"),i.lingshiceshi(t.data.data.url)):i.messageBox(t)}))}).catch(function(t){i.lvjingLoading3=!1,i.lvjingVisible3=!1,i.$message.error(t)})}},startlvjing4:function(){this.$message.success("开始合成保存滤镜原图"),this.lvjingLoading4=!0;var e=new Image,i=this;e.src=this.curImg.attrs.src1,e.onload=function(){var t=document.getElementById("lvjingboxx4");t.style.width=e.width,t.style.height=e.height,I.a.toPng(t).then(function(t){var e,t=i.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(i.lvjingVisible4=!1,i.lvjingLoading4=!1,i.$msgbox({title:"",message:"图像大小已超过20MB。",type:"warning"})):((e=new FormData).append("file",t),Object(w.a)(e).then(function(t){1==t.data.code?(i.lvjingVisible4=!1,i.lvjingLoading4=!1,i.$message.success("合成完成 添加进画布"),i.lingshiceshi(t.data.data.url)):i.messageBox(t)}))}).catch(function(t){i.lvjingLoading4=!1,i.lvjingVisible4=!1,i.$message.error(t)})}},showlvjing:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage()},0)},showlvjing2:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage2()},0)},showlvjing3:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage3()},0)},showlvjing4:function(){var t=this;setTimeout(function(){t.$message.success("加载素材原图"),t.generateImage4()},0)},cuthead:function(){var e=this;this.allLoading=!0,Object(k.d)(this.curImg.attrs.src1+"?imageView2/2/w/1999/h/1999").then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t),e.showcut=!1})},cutout:function(){var e=this;this.allLoading=!0,Object(k.e)(this.curImg.attrs.src1+"?imageView2/2/w/1999/h/1999").then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t),e.showcut=!1})},styleTransfer:function(t){var e=this;this.allLoading=!0,Object(k.t)(this.curImg.attrs.src,-1!=t.indexOf("static")?t:"https://www.didaplan.cn/"+t).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},imageClarity:function(){var e=this;this.allLoading=!0,Object(k.o)(this.curImg.attrs.src1).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},imageToCartoonized:function(){var e=this;this.imageToCartoonLoading=!0,"imageToSketching"==this.selectedType?Object(k.q)(this.curImg.attrs.src1+"?imageView2/2/w/1999/h/1999",this.selectedSubType).then(function(t){e.imageToCartoonLoading=!1,1==t.data.code?(e.$message.success("生成成功"),e.lingshiceshi(t.data.data),e.imageToCartoonShow=!1):e.messageBox(t)}).catch(function(t){e.imageToCartoonLoading=!1}):Object(k.p)(this.curImg.attrs.src1,this.selectedType,this.selectedSubType.toString()).then(function(t){1==t.data.code?(e.$message.success("任务生成成功,AI生成中,开始查询AI任务结果"),e.getSyncJob(t.data.data)):(e.messageBox(t),e.imageToCartoonLoading=!1)}).catch(function(t){e.imageToCartoonLoading=!1})},getSyncJob:function(t){var e=this,i=(clearInterval(this.SyncJob),1);this.SyncJob=setInterval(function(){t&&(e.$message.warning("正在第".concat(i,"次查询结果.....")),Object(k.n)(t).then(function(t){i++,1==t.data.code?(e.imageToCartoonLoading=!1,e.messageBox(t),clearInterval(e.SyncJob),e.lingshiceshi(t.data.data),e.imageToCartoonShow=!1):0==t.data.code&&(e.imageToCartoonLoading=!1,e.messageBox(t),clearInterval(e.SyncJob))}).catch(function(t){clearInterval(e.SyncJob),e.imageToCartoonLoading=!1}))},2e3)},cropimage:function(){this.dialogVisible=!0},show:function(){var t=this;setTimeout(function(){t.initcrop()},0)},changeD:function(t){var e=document.getElementsByClassName("changeb"),i=document.getElementsByClassName("body");0==t?(e[0].classList.add("actionb"),e[1].classList.remove("actionb"),i[0].style.zIndex=1000001):(e[1].classList.add("actionb"),e[0].classList.remove("actionb"),i[0].style.zIndex=0)},clickChange:function(t){"product"===t?this.leftButtonStatus="product":"image"===t?this.$refs.file.click():"Material"==t?(this.material.userId="",this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("getMaterial"),this.leftButtonStatus="Material"):(this.material.pageNumber=1,this.$emit("getMaterial"),this.leftButtonStatus="background")},addFont:function(){var t=this.layer,e=this.transformer,i=this.stage,a=1/(this.gradientColors.length-1),n=[],r=(this.gradientColors.forEach(function(t,e){n.push(e*a,t)}),null==this.fontColor&&(this.fontColor="#000000"),new x.a.Text({text:"37POD DESIGN",x:20,y:80,fontSize:40,draggable:!0,width:400,name:"rectTransformer",rotation:0,fontStyle:this.fontStyle,textDecoration:this.textDecoration,fontFamily:this.fontFamily,shadowEnabled:this.textShadowEnabled,shadowColor:this.textShadowColor,shadowBlur:this.textShadowBlur,shadowOpacity:this.textShadowOpacity,shadowOffsetX:this.textShadowOffsetX,shadowOffsetY:this.textShadowOffsetY,stroke:this.fontstrokeColor,strokeWidth:this.fontstrokeWidth,shadowForStrokeEnabled:!1,gradientEnabled:!1,letterSpacing:this.fontletterSpacing,backgroundColor:"#000000",fill:this.fontColor,fillLinearGradientStartPoint:{x:this.gradientStartX,y:this.gradientStartY},fillLinearGradientEndPoint:{x:this.gradientEndX,y:this.gradientEndY},fillLinearGradientColorStops:n,align:"center",lineHeight:this.fontlineHeight,fillAfterStrokeEnabled:this.fillAfterStrokeEnabled})),s=(this.gradientEnabled=!1,t.add(r),this.curImg=r,new x.a.Transformer({node:r,centeredScaling:!0,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(r.fontSize()+70,e.width),e}}));r.on("transform",function(){r.setAttrs({width:r.width()*r.scaleX(),scaleY:1,scaleX:1})}),e.add(s),e.draw(),y(i,t,s,r,this.currentArea.id,this.deletCurImg),v(i),b(i,t),this.keydown(i,t,s),this.fontSizeStr=40,this.jilu()},addFonts:function(){var t=this.layer,e=this.transformer,i=this.stage,a=1/(this.gradientColors.length-1),n=[],r=(this.gradientColors.forEach(function(t,e){n.push(e*a,t)}),null==this.fontColor&&(this.fontColor="#000000"),new x.a.TextPath({x:100,y:200,fontSize:22,draggable:!0,name:"rectTransformer",rotation:0,fontStyle:this.fontStyle,textDecoration:this.textDecoration,fontFamily:this.fontFamily,shadowEnabled:this.textShadowEnabled,shadowColor:this.textShadowColor,shadowBlur:this.textShadowBlur,shadowOpacity:this.textShadowOpacity,shadowOffsetX:this.textShadowOffsetX,shadowOffsetY:this.textShadowOffsetY,stroke:this.fontstrokeColor,strokeWidth:this.fontstrokeWidth,shadowForStrokeEnabled:!1,gradientEnabled:!1,letterSpacing:this.fontletterSpacing,backgroundColor:"#000000",fill:this.fontColor,fillLinearGradientStartPoint:{x:this.gradientStartX,y:this.gradientStartY},fillLinearGradientEndPoint:{x:this.gradientEndX,y:this.gradientEndY},fillLinearGradientColorStops:n,align:"center",lineHeight:this.fontlineHeight,text:"37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN37PODDESIGN",data:"M 0,200 Q 200,200 400,200"})),s=(this.gradientEnabled=!1,t.add(r),this.curImg=r,new x.a.Transformer({node:r,centeredScaling:!0,boundBoxFunc:function(t,e){return e.width=Math.max(r.fontSize()+70,e.width),e}}));e.add(s),e.draw(),y(i,t,s,r,this.currentArea.id,this.deletCurImg),v(i),b(i,t),this.keydown(i,t,s),this.fontSizeStr=40,this.jilu()},deletCurImg:function(){this.curImg=""},colorPicker:function(){this.$refs.colorPicker.click()},handleClear:function(t){null==this.color&&(this.color="rgba(255,255,255,0)")},getcolor:function(){document.getElementById("getcolor").click()},nativePick:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.color=e);case 3:case"end":return t.stop()}},t)}))()},nativePick2:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor3=e);case 3:case"end":return t.stop()}},t)}))()},nativePick3:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor4=e);case 3:case"end":return t.stop()}},t)}))()},nativePick4:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor5=e);case 3:case"end":return t.stop()}},t)}))()},nativePick5:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor6=e);case 3:case"end":return t.stop()}},t)}))()},nativePick6:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor7=e);case 3:case"end":return t.stop()}},t)}))()},addImage:function(t){var e,o=this,t=t.target.files[0];20<Number(t.size/1024/1024)?this.$msgbox({title:"",message:"文件大小不能超过20MB，请重新上传。",type:"warning"}):((e=new FormData).append("file",t),e.append("fid",0),document.getElementsByClassName("input-opacity")[0].value="",this.allLoading=!0,P.a.post("http://crossdiy.didaplan.cn/api/my_source/upLoad",e,{headers:{token:z.a.get("token")}}).then(function(e){var i,a,n,r,s;1==e.data.code?((i=new window.Image).crossOrigin="anonymous",i.src=e.data.data.img_url+"?imageView2/2/w/1200",r=e.data.data.img_url+"?imageView2/2/w/1200",s=e.data.data.img_url,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:e.data.data.id,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:(600-a)/2+a/2,y:(600-n)/2+n/2,rotation:0,offset:{x:a/2,y:n/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};o.images.push(t),o.addElem(t),o.allLoading=!1,o.jilu()}):(o.allLoading=!1,o.$message.error(e.data.msg))}).catch(function(t){o.allLoading=!1,o.$message.error(t.data.msg)}))},drawGrid:function(){var t=this.grid;if(0==t.find(".grid").length){for(var e=0;e<10;e++){var i=new x.a.Line({points:[0,a=60*e,600,a],stroke:"#ededed",strokeWidth:.5,lineCap:"round",lineJoin:"round",name:"grid",visible:!0}),a=new x.a.Line({points:[a,0,a,600],stroke:"#ededed",strokeWidth:.5,lineCap:"round",lineJoin:"round",name:"grid",visible:!0});t.add(i,a)}t.batchDraw()}else t.find(".grid").forEach(function(t){t.destroy()})},addElemP:function(t){for(var e=0;e<this.layer.children.length;e++)if(this.layer.children[e].attrs.hasOwnProperty("pingpu")){this.layer.children.splice(e,1);break}this.transformer.children.forEach(function(t){t.nodes([])});var i=this.layer,t=(this.fill,this.transformer,this.grid,this.stage,new x.a.Image(t));t.cache(!1),i.add(t),t.moveToBottom(),this.save()},addElemnew:function(t){var e=this.layer,i=(this.fill,this.transformer,this.grid,this.stage),a=(this.transformer.children.forEach(function(t){t.nodes([])}),(new Date).getTime().toString(),new x.a.Image(t));a.cache(!1),e.add(a),this.curImg=a,1==t.putu&&this.setPatternf(t.putustr,a),"background"===t.status&&a.zIndex(0),t.status;y(i,e,this.tr,"",this.currentArea.id,this.deletCurImg),v(i),b(i,e),this.keydown(i,e,this.tr)},addElem:function(t){var e=this.layer,i=(this.fill,this.transformer,this.grid,this.stage),a=(this.transformer.children.forEach(function(t){t.nodes([])}),(new Date).getTime().toString(),new x.a.Image(t));a.cache(!1),e.add(a),this.curImg=a,"background"===t.status&&a.zIndex(0),t.status;y(i,e,this.tr,"",this.currentArea.id,this.deletCurImg),v(i),b(i,e),this.keydown(i,e,this.tr)},setPattern_change:function(t){var i,a,e,n;1==this.curImg.attrs.putu&&(this.click_up=0,this.click_up2=0,this.transformer.children.forEach(function(t){t.nodes([])}),this.pageLayer[1].layer.children.length)&&(e=new D(600,600,(i=this).numgo1),this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,(a=this.curImg.attrs).width=a.naturalWidth,a.height=a.naturalHeight,a.viewportTransform=[a.x,a.y],e.setPattern(a,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/i.numgo1,scaleY:1/i.numgo1,pingpu:1,sourceid:a.sourceid};i.curImg.moveToBottom(),i.addElemP(t)}}),e=a.naturalWidth,t=a.naturalHeight,Number(e)>Number(t)?(n=e/600,e=600,t/=n):(n=t/600,t=600,e/=n),a.width=e,a.height=t)},clearrect:function(){var t;this.layer.children[0]&&this.layer.children[0].attrs.hasOwnProperty("pingpu")&&(t=this.layer.children[0],this.transformer.children[0].nodes([]),t.destroy(),this.save())},chexiao:function(){0<=this.imageindex-1&&(this.imageindex--,this.imageDesign(this.layerimages2[this.imageindex]))},chonzuo:function(){this.imageindex+1<this.layerimages2.length&&(this.imageindex++,this.imageDesign(this.layerimages2[this.imageindex]))},setPattern:function(t){if(this.click_up2=0,this.transformer.children.forEach(function(t){t.nodes([])}),0!=this.tag&&this.layer.children.forEach(function(t){t.attrs.putu=0}),"jichu"==t){var e=document.getElementById("btn1"),i=document.getElementById("btn2"),a=document.getElementById("btn3"),n=document.getElementById("btn4");if(1==this.tag)return this.tag=0,this.clearrect(),e.style.color="black",void(e.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=1,e.style.color="white",e.style.backgroundColor="var(--style-color-design)",i.style.color="black",i.style.backgroundColor="#f5f5f5",a.style.color="black",a.style.backgroundColor="#f5f5f5",n.style.color="black",n.style.backgroundColor="#f5f5f5"}if("jingxiang"==t){if(2==this.tag)return this.tag=0,this.clearrect(),btn2.style.color="black",void(btn2.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=2,btn2.style.color="white",btn2.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn3.style.color="black",btn3.style.backgroundColor="#f5f5f5",btn4.style.color="black",btn4.style.backgroundColor="#f5f5f5"}if("zongxiang"==t){if(3==this.tag)return this.tag=0,this.clearrect(),btn3.style.color="black",void(btn3.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=3,btn3.style.color="white",btn3.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn2.style.color="black",btn2.style.backgroundColor="#f5f5f5",btn4.style.color="black",btn4.style.backgroundColor="#f5f5f5"}if("hengxiang"==t){if(4==this.tag)return this.tag=0,this.clearrect(),btn4.style.color="black",void(btn4.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=4,btn4.style.color="white",btn4.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn2.style.color="black",btn2.style.backgroundColor="#f5f5f5",btn3.style.color="black",btn3.style.backgroundColor="#f5f5f5"}var r,s;this.pageLayer[1].layer.children.length&&(e=new D(600,600,(r=this).numgo1),(s=r.curImg.attrs).width=s.naturalWidth,s.height=s.naturalHeight,s.viewportTransform=[s.x,s.y],e.setPattern(s,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/r.numgo1,scaleY:1/r.numgo1,pingpu:1,sourceid:s.sourceid};r.curImg.moveToBottom(),r.addElemP(t)}}),i=s.naturalWidth,a=s.naturalHeight,Number(i)>Number(a)?(n=i/600,i=600,a/=n):(e=a/600,a=600,i/=e),s.width=i,s.height=a)},setPatternf:function(t,i){var a,n,e,r,s,o;document.getElementById("btn1")?("jichu"==t&&(document.getElementById("btn1")&&(e=document.getElementById("btn1"),o=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),e.style.color="white",e.style.backgroundColor="var(--style-color-design)",o.style.color="black",o.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),this.tag=1),"jingxiang"==t&&(this.tag=2,document.getElementById("btn1"))&&(e=document.getElementById("btn1"),o=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),o.style.color="white",o.style.backgroundColor="var(--style-color-design)",e.style.color="black",e.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),"zongxiang"==t&&(this.tag=3,document.getElementById("btn1"))&&(o=document.getElementById("btn1"),e=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),r.style.color="white",r.style.backgroundColor="var(--style-color-design)",o.style.color="black",o.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),"hengxiang"==t&&(this.tag=4,document.getElementById("btn1"))&&(r=document.getElementById("btn1"),o=document.getElementById("btn2"),e=document.getElementById("btn3"),(s=document.getElementById("btn4")).style.color="white",s.style.backgroundColor="var(--style-color-design)",r.style.color="black",r.style.backgroundColor="#f5f5f5",o.style.color="black",o.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5")):("jichu"==t&&(this.tag=1),"jingxiang"==t&&(this.tag=2),"zongxiang"==t&&(this.tag=3),"hengxiang"==t&&(this.tag=4)),this.pageLayer[1].layer.children.length&&(s=new D(600,600,(a=this).numgo1),(n=i.attrs).width=n.naturalWidth,n.height=n.naturalHeight,n.viewportTransform=[n.x,n.y],s.setPattern(n,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/a.numgo1,scaleY:1/a.numgo1,pingpu:1,sourceid:n.sourceid};i.moveToBottom(),a.addElemP(t)}}),r=n.naturalWidth,o=n.naturalHeight,Number(r)>Number(o)?(e=r/600,r=600,o/=e):(s=o/600,o=600,r/=s),n.width=r,n.height=o)},rightButton:function(t){var e,i,a,n,r,s,o,l,c,d,u,h,g,f,m,p,y,v,b=this,w=this.curImg;if("rectTransformer"==w.attrs.name){switch(t){case"vertical":y=(p=w).scaleX(),v=p.scaleY(),p.scale({x:y,y:v*=-1}),0==p.attrs.flipY?p.attrs.flipY=1:p.attrs.flipY=0;break;case"horizontal":v=(y=w).scaleX(),p=y.scaleY(),y.scale({x:v*=-1,y:p}),0==y.attrs.flipX||-1==y.attrs.flipX?(y.attrs.flipX=1,y.attrs.angle1=y.attrs.rotation):y.attrs.flipX=0;break;case"top":this.save(),"background"!=(m=w).attrs.status&&m.moveToTop();break;case"bottom":this.save(),"background"!=(m=w).attrs.status&&m.moveToBottom();break;case"up":w.moveUp(),this.save();break;case"down":"background"!=(f=w).attrs.status&&f.moveDown(),this.save();break;case"copy":null==w.attrs.text?((e=JSON.parse(JSON.stringify(w.attrs))).x+=10,e.y+=10,(i=new window.Image).crossOrigin="anonymous",i.src=e.src,r=e.src,s=e.src1,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:-1,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:e.x,y:e.y,rotation:0,offset:{x:a/2,y:n/2},scaleX:e.scaleX,scaleY:e.scaleY,flipX:e.flipX,flipY:e.flipY,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,naturalWidthB:e.naturalWidthB,naturalHeightB:e.naturalHeightB,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};b.images.push(t),b.addElem(t),b.jilu()}):((f=JSON.parse(JSON.stringify(w.attrs))).x+=10,f.y+=10,g=new x.a.Text(f),this.layer.add(g),this.jilu());break;case"delet":null!=w.attrs.text?(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",w.destroy()):1!=w.attrs.putu?(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",w.destroy()):(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",w.destroy(),this.tag=0,this.clearrect());break;case"LeftAlignment":(g=w).x(g.width()*g.scaleX()/2);break;case"Center":w.x(300);break;case"RightAlignment":(h=w).x(600-h.width()*h.scaleX()/2);break;case"TopAlignment":(h=w).y(h.height()*h.scaleY()/2);break;case"VerticalAlignment":w.y(300);break;case"BottomAlignment":(u=w).y(600-u.height()*u.scaleY()/2);break;case"ClockwiseRotation":w.rotate(45);break;case"CounterclockwiseRotation":w.rotate(-45);break;case"amplification":null!=w.attrs.text?this.fontSizeStr<200&&(this.fontSizeStr+=2,this.curImg.setFontSize(this.fontSizeStr),this.MinwidthFontSize(this.curImg)):S(w),this.save();break;case"narrow":null!=w.attrs.text?12<this.fontSizeStr&&(this.fontSizeStr-=2,this.curImg.setFontSize(this.fontSizeStr)):C(w),this.save();break;case"imageFill":1===this.currentArea.auto_adapt_area?(u={x:this.currentArea.area_startx,y:this.currentArea.area_starty,width:this.currentArea.area_width,height:this.currentArea.area_height},E(w,u)):_(w);break;case"imageAdaptive":1===this.currentArea.auto_adapt_area?(l={x:this.currentArea.area_startx,y:this.currentArea.area_starty,width:this.currentArea.area_width,height:this.currentArea.area_height},L(w,l)):O(w);break;case"stretch":1===this.currentArea.auto_adapt_area?(l={x:this.currentArea.area_startx,y:this.currentArea.area_starty,width:this.currentArea.area_width,height:this.currentArea.area_height},l=l,c=(o=w).attrs.width,d=o.attrs.height,c=l.width/c,l.width,d=l.height/d,l.height,o.scale({x:c,y:d}),o.x(l.x+l.width/2),o.y(l.y+l.height/2)):(d=(c=w).attrs.width,o=c.attrs.height,c.scale({x:600/d,y:600/o}),c.x(300),c.y(300));break;case"fontLeft":w.setAlign("left");break;case"fontCenter":w.setAlign("center");break;case"fontRight":w.setAlign("right");break;default:return}"copy"!=t&&this.jilu()}},jilu:function(){var t=this,e=[];this.transformer.children.forEach(function(t){t.nodes([])}),this.save(),t.imageindex++,t.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(t.color),t.layerimages2[t.imageindex]=JSON.parse(JSON.stringify(e)),t.layerimages2=t.layerimages2.slice(0,t.imageindex+1)},addgroup:function(){this.curImg&&(this.curImg.draggable(!1),this.group.add(this.curImg))},keydown:function(r,t,s){var e=this,o=this,l="",i=(r.on("dblclick",function(t){t.target!=r&&"rectTransformer"===t.target.attrs.name&&null!=t.target.attrs.image&&(e.Scaleprop=t.target.attrs.height/t.target.attrs.width,e.ScaleHeight=Math.abs(t.target.attrs.height/600*e.MaxDesign*t.target.attrs.scaleY).toFixed(2),e.ScaleWidth=Math.abs(t.target.attrs.width/600*e.MaxDesign*t.target.attrs.scaleX).toFixed(2),e.MoveX=(t.target.attrs.x/600*e.MaxDesign-e.ScaleWidth/2).toFixed(2),e.MoveY=(t.target.attrs.y/600*e.MaxDesign-e.ScaleHeight/2).toFixed(2),e.showScale=!0)}),r.on("mousedown touchstart",function(e){if(e.target!=r){if("gridLv"!==e.target.attrs.name&&"gridLh"!==e.target.attrs.name){if(o.click_up2=1,"rectTransformer"===e.target.attrs.name){if(r.find(".gridLh").forEach(function(t){t.attrs.reference&&(t.attrs.imagey=t.points()[1]-e.target.y())}),r.find(".gridLv").forEach(function(t){t.attrs.reference&&(t.attrs.imagex=t.points()[0]-e.target.x())}),e.target.attrs.hasOwnProperty("sourceid")&&(o.click_up=1),o.curImg=e.target,l=e.target,null!=o.curImg.attrs.text){if(o.fontSizeStr=o.curImg.attrs.fontSize,o.fontFamily=o.curImg.attrs.fontFamily,o.fontstrokeColor=o.curImg.attrs.stroke,o.fontStyle=o.curImg.attrs.fontStyle,o.fontstrokeWidth=o.curImg.attrs.strokeWidth,o.fontlineHeight=o.curImg.attrs.lineHeight,o.textDecoration=o.curImg.attrs.textDecoration,o.textShadowEnabled=o.curImg.shadowEnabled(),o.fillAfterStrokeEnabled=o.curImg.fillAfterStrokeEnabled(),o.textShadowColor=o.curImg.shadowColor().toString(),o.textShadowBlur=o.curImg.shadowBlur(),o.textShadowOpacity=o.curImg.shadowOpacity(),o.textShadowOffsetX=o.curImg.shadowOffsetX(),o.textShadowOffsetY=o.curImg.shadowOffsetY(),o.gradientEnabled=o.curImg.attrs.gradientEnabled,o.gradientEnabled){for(var t=[],i=o.curImg.fillLinearGradientColorStops(),a=0;a<i.length;a+=2){var n=i[a+1];t.push(n)}o.gradientColors=t}else o.fontColor=o.curImg.attrs.fill;o.gradientStartX=o.curImg.fillLinearGradientStartPointX(),o.gradientStartY=o.curImg.fillLinearGradientStartPointY(),o.gradientEndX=o.curImg.fillLinearGradientEndPointX(),o.gradientEndY=o.curImg.fillLinearGradientEndPointY()}}else l="fill"===e.target.attrs.name?o.curImg="":(-1==e.target.attrs.name.indexOf("middle")&&-1==e.target.attrs.name.indexOf("center")?s.centeredScaling(!0):s.centeredScaling(!1),o.curImg=o.curImg,o.curImg);e.target.attrs.hasOwnProperty("pingpu")&&(o.curImg=o.curImg,""!=(l=o.curImg))&&s.nodes([l])}}else l="",o.curImg=""}),r.on("mouseup touchend",function(t){2==o.click_up2&&(o.click_up2=0,o.jilu()),2==o.click_up&&(1==o.tag&&e.setPattern_change("jichu"),2==o.tag&&e.setPattern_change("jingxiang"),3==o.tag&&e.setPattern_change("zongxiang"),4==o.tag)&&e.setPattern_change("hengxiang"),o.click_up=0}),r.on("mousemove touchmove",function(t){1==o.click_up2&&(o.click_up2=2)}),r.container());i.tabIndex=1,i.focus();i.addEventListener("keydown",function(t){var e,i=t.ctrlKey,a=t.altKey;if(t.shiftKey&&82===t.keyCode&&o.emptyCanvas2(),""!==l&&"rectTransformer"==l.attrs.name){if(37===t.keyCode)o.imgl();else if(38===t.keyCode)o.imgU();else if(39===t.keyCode)o.imgR();else if(40===t.keyCode)o.imgD();else if(i&&81===t.keyCode)l.rotate(-45);else if(a&&81===t.keyCode)l.rotate(45);else if(i&&90===t.keyCode)null!=l.attrs.text?o.fontSizeStr<200&&(o.fontSizeStr+=2,o.curImg.setFontSize(o.fontSizeStr),o.MinwidthFontSize(o.curImg)):S(l),o.save();else if(a&&90===t.keyCode)null!=l.attrs.text?12<o.fontSizeStr&&(o.fontSizeStr-=2,o.curImg.setFontSize(o.fontSizeStr)):C(l),o.save();else if(46===t.keyCode)null!=l.attrs.text?(o.transformer.children.forEach(function(t){t.nodes([])}),o.curImg="",l.destroy()):1!=l.attrs.putu?(o.transformer.children.forEach(function(t){t.nodes([])}),o.curImg="",l.destroy()):(o.transformer.children.forEach(function(t){t.nodes([])}),o.curImg="",l.destroy(),o.tag=0,o.clearrect());else if(i&&83===t.keyCode)alert("保存");else if(i&&67===t.keyCode)"background"===l.attrs.status?alert("背景图片不可复制"):null==l.attrs.text&&o.copyimg();else{if(i&&66===t.keyCode)1===o.currentArea.auto_adapt_area?(e={x:o.currentArea.area_startx,y:o.currentArea.area_starty,width:o.currentArea.area_width,height:o.currentArea.area_height},E(l,e)):_(l);else{if(!a||66!==t.keyCode)return;1===o.currentArea.auto_adapt_area?(e={x:o.currentArea.area_startx,y:o.currentArea.area_starty,width:this.currentArea.area_width,height:o.currentArea.area_height},L(l,e)):O(l)}s.nodes([])}i&&67===t.keyCode||o.jilu(),t.preventDefault()}})},imgl:Object(A.a)(function(){window._this.curImg.x(window._this.curImg.x()-1)},20),imgR:Object(A.a)(function(){window._this.curImg.x(window._this.curImg.x()+1)},20),imgU:Object(A.a)(function(){window._this.curImg.y(window._this.curImg.y()-1)},20),imgD:Object(A.a)(function(){window._this.curImg.y(window._this.curImg.y()+1)},20),copyimg:Object(A.a)(function(){var e,i,a=window._this,n=JSON.parse(JSON.stringify(a.curImg.attrs)),r=(n.x+=10,n.y+=10,new window.Image),s=(r.crossOrigin="anonymous",r.src=n.src,n.src),o=n.src1;r.onload=function(){e=r.width,(i=r.height)<e?(t=e/600,e=600,i/=t):(t=i/600,i=600,e/=t);var t={sourceid:-1,src:s,src1:o,name:"rectTransformer",image:r,width:e,height:i,draggable:!0,x:n.x,y:n.y,rotation:0,offset:{x:e/2,y:i/2},scaleX:n.scaleX,scaleY:n.scaleY,flipX:n.flipX,flipY:n.flipY,left:0,top:0,putu:0,naturalWidth:r.width,naturalHeight:r.height,naturalWidthB:n.naturalWidthB,naturalHeightB:n.naturalHeightB,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};a.images.push(t),a.addElem(t),a.jilu()}},200),save:Object(A.a)(function(){window._this.transformer.children.forEach(function(t){t.hide()});var e=[],t=(window._this.layer.find(".guid-line").forEach(function(t){e.push(t),t.destroy()}),window._this.grid.find(".grid").forEach(function(t){t.hide()}),window._this.grid.find(".gridLh").forEach(function(t){t.hide()}),window._this.grid.find(".gridLv").forEach(function(t){t.hide()}),window._this.stage.toDataURL({mimeType:"image/webp",pixelRatio:2}));window._this.transformer.children.forEach(function(t){t.show()}),e.forEach(function(t){window._this.layer.add(t),window._this.layer.batchDraw()}),window._this.grid.find(".grid").forEach(function(t){t.show()}),window._this.grid.find(".gridLh").forEach(function(t){t.show()}),window._this.grid.find(".gridLv").forEach(function(t){t.show()});window._this.$emit("getDesignTemp","",window._this.currentArea,window._this.scrollImg,t,t)},29),dataURLtoFile:function(t,e){for(var t=t.split(","),i=t[0].match(/:(.*?);/)[1],a=atob(t[1]),n=a.length,r=new Uint8Array(n);n--;)r[n]=a.charCodeAt(n);for(var s=0;s<window._this.layer.children.length;s++)if(window._this.layer.children[s].attrs.hasOwnProperty("pingpu")){window._this.layer.children[s].moveToBottom(),0==this.tag&&this.clearrect();break}return new File([r],e,{type:i})},emptyCanvas2:function(){var e=this,i=(this.click_up2=0,this.stage.off(),this.stageons(),this.layerimages2=[],this.imageindex=0,this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),this.fill.children.forEach(function(t){t.destroy()}),this.color="rgba(255,255,255,0)",0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),[]);this.color="rgba(255,255,255,0)",i.push(this.color),this.productDetail.design_list.forEach(function(t){t!=e.currentArea&&(e.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)))}),this.$emit("emptyC"),this.clearrect(),this.curImg="",this.save()},clearlayerimages:function(){this.layerimages={}},emptyCanvas:function(){this.stage.off(),this.stageons(),this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),this.fill.children.forEach(function(t){t.destroy()}),this.color="rgba(255,255,255,0)",0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),this.clearrect(),this.save()},chehuiemptyCanvas:function(){this.stage.off(),this.stageons(),this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),this.clearrect(),this.save()},pickFontFamily:function(){var t=this;this.curImg.setFontFamily(this.fontFamily),document.fonts.ready.then(function(){t.curImg.setFontFamily(""),t.curImg.setFontFamily(t.fontFamily)}),this.jilu()},pickFontColor:function(){this.gradientEnabled||(null==this.fontColor&&(this.fontColor="#000000"),this.curImg.setFill(this.fontColor),this.jilu())},pickFontStrokeColor:function(){this.curImg.setStroke(this.fontstrokeColor),this.jilu()},MinwidthFontSize:function(t){t.setAttr("width",Math.max(t.fontSize()+70,t.width()))},pickFontSize:function(){this.curImg.setFontSize(this.fontSizeStr),this.MinwidthFontSize(this.curImg),this.jilu()},pickFontStyle:function(){this.curImg.setAttrs({fontStyle:this.fontStyle}),this.jilu()},pickFontDecoration:function(){this.curImg.setAttrs({textDecoration:this.textDecoration}),this.jilu()},pickFontstrokeWidth:function(){this.curImg.strokeWidth(this.fontstrokeWidth),this.jilu()},pickFontlineHeight:function(){this.curImg.lineHeight(this.fontlineHeight),this.jilu()},pickfontletterSpacing:function(){this.curImg.letterSpacing(this.fontletterSpacing),this.jilu()},toggleGradient:function(t){this.gradientEnabled=t,(this.curImg.attrs.gradientEnabled=t)?(this.curImg.setFill(""),this.updateGradient()):(null==this.fontColor&&(this.fontColor="#000000"),this.curImg.setFill(this.fontColor))},getRandomColor:function(){for(var t="#",e=0;e<6;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t},addGradientColor:function(){var t;this.gradientColors.length<10&&(t=this.getRandomColor(),this.gradientColors.push(t),this.updateGradient())},delGradientColor:function(){2<this.gradientColors.length&&(this.gradientColors.pop(),this.updateGradient())},updateGradient:function(){var i=1/(this.gradientColors.length-1),a=[];this.gradientColors.forEach(function(t,e){a.push(e*i,t)}),this.curImg.fillLinearGradientColorStops(a),this.curImg.fillLinearGradientStartPoint({x:this.gradientStartX,y:this.gradientStartY}),this.curImg.fillLinearGradientEndPoint({x:this.gradientEndX,y:this.gradientEndY})},toggleTextShadow:function(t){this.textShadowEnabled=t,this.curImg.shadowEnabled(this.textShadowEnabled)},togglefillAfterStrokeEnabled:function(t){this.fillAfterStrokeEnabled=t,this.curImg.fillAfterStrokeEnabled(this.fillAfterStrokeEnabled)},pickTextShadowColor:function(){this.curImg.shadowColor(this.textShadowColor),this.jilu()},pickTextShadowOpacity:function(){this.curImg.shadowOpacity(this.textShadowOpacity),this.jilu()},pickTextShadowOffsetX:function(){this.curImg.shadowOffsetX(this.textShadowOffsetX),this.jilu()},pickTextShadowOffsetY:function(){this.curImg.shadowOffsetY(this.textShadowOffsetY),this.jilu()},pickTextShadowBlur:function(){this.curImg.shadowBlur(this.textShadowBlur),this.jilu()},setCategory:function(){this.$refs.selectDeptRef?this.$refs.selectDeptRef.dropDownVisible=!1:this.$refs.selectDeptRef1.dropDownVisible=!1,this.$refs.selectDeptRef.panel.initStore(),this.productSearch()},setCategory1:function(){this.$refs.selectDeptRef?this.$refs.selectDeptRef.dropDownVisible=!1:this.$refs.selectDeptRef1.dropDownVisible=!1,this.$refs.selectDeptRef1.panel.initStore(),this.materialSearch()},productMove:function(t){""==this.currentProduct&&(this.currentProduct=t)},cutpiece:function(){var a=this;this.svgXml=[],this.cutpiece_index=0,this.svgpath.forEach(function(t,i){P.a.get(t).then(function(t){var e=t.data;e=(e=e.replace(new RegExp("<svg","gm"),"<svg style='width: 100%;height: 100%;'")).replace(new RegExp("https://www.didaplan.cn/3D/ewm.png","gm"),"data:image/webp;base64,UklGRmwMAABXRUJQVlA4WAoAAAAwAAAArwQArwQASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBISwAAAAEHEBERAFCk//8pov+p//3vf//73//+97///e9///vf//73v//973//+9///ve///3vf//73//+97///e9///vf//73v//97/+kAQBWUDggKgoAAPAxAZ0BKrAEsAQ+bTaZSaQjIqEgCACADYlpbuF3YRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/6wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="),a.res.forEach(function(t){e=e.replace(new RegExp("https://www.didaplan.cn/3D/"+t.name+".png","gm"),t.content)}),a.svgXml.push(e),i==a.svgpath.length-1&&(a.drawer=!0)}).catch(function(t){a.$message.error("裁件配置错误！")})})},productDown:function(t){this.shilihua=0,this.scrollImg=0,this.$emit("clickProduct",t),this.productColorIndex=0,this.productSizeIndex=0},quproductDown:function(t){this.shilihua=0,this.scrollImg=0,this.$emit("quclickProduct",t),this.productColorIndex=0,this.productSizeIndex=0},materialDown:function(t,n){var r,s,o=this,l=this,e=0,c=(this.currentMaterialIndex=n,new window.Image),d=(c.crossOrigin="anonymous",c.src=t.thumb1200,t.thumb1200),u=t.img_url;c.onload=function(){var i,a;0==e&&(e=1,r=c.width,s=c.height,a=i=0,P.a.get(t.img_url+"?imageInfo").then(function(t){var e;200==t.status?(i=Number(t.data.width)/(72/2.54),a=Number(t.data.height)/(72/2.54),i&&a&&(o.ScaleHeight=Number(a.toFixed(2)),o.ScaleWidth=Number(i.toFixed(2)),t=o.ScaleHeight>o.ScaleWidth?o.ScaleHeight>o.MaxDesign?1:o.ScaleHeight/o.MaxDesign:(o.ScaleHeight,o.ScaleWidth,o.ScaleWidth>o.MaxDesign?1:o.ScaleWidth/o.MaxDesign),s<r?(e=r/600,r=600,s/=e):(e=s/600,s=600,r/=e),e={sourceid:l.sourceList.source_list[n].id,src:d,src1:u,name:"rectTransformer",image:c,width:r,height:s,draggable:!0,x:(600-r)/2+r/2,y:(600-s)/2+s/2,rotation:0,offset:{x:r/2,y:s/2},scaleX:t,scaleY:t,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:c.width,naturalHeight:c.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]},l.images.push(e),l.addElem(e),l.jilu())):(s<r?(t=r/600,r=600,s/=t):(e=s/600,s=600,r/=e),t={sourceid:l.sourceList.source_list[n].id,src:d,src1:u,name:"rectTransformer",image:c,width:r,height:s,draggable:!0,x:(600-r)/2+r/2,y:(600-s)/2+s/2,rotation:0,offset:{x:r/2,y:s/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:c.width,naturalHeight:c.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]},l.images.push(t),l.addElem(t),l.jilu())}).catch(function(t){o.$message.error(t)}))}},productLeave:function(t){this.currentProduct=""},moren:function(t){var i,a,n,r,s,o=this;null==t||""==t?this.$message.error("无素材"):(this.allLoading=!0,(i=new window.Image).crossOrigin="anonymous",i.src=t+"?imageView2/2/w/600/h/600",r=t+"?imageView2/2/w/600/h/600",s=t,i.onload=function(){a=i.width;var t=1,e=1,e=(n=i.height)<a?(t=a/600,(a=600)/(n/=t)):(t=n/600,(n=600)/(a/=t)),t={sourceid:0,src:r,src1:s,moren:1,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:(600-a)/2+a/2,y:(600-n)/2+n/2,rotation:0,offset:{x:a/2,y:n/2},scaleX:e,scaleY:e,left:0,top:0,flipX:0,flipY:0,putu:0,naturalWidth:Number(i.width),naturalHeight:Number(i.height),canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};o.images.push(t),o.addElem(t),o.allLoading=!1,o.copyCanvas("all")})},lingshiceshi:function(a){var n=this,r=(this.allLoading=!0,new window.Image),s=((new Date).getTime().toString(),r.crossOrigin="anonymous",r.src=a+"?imageView2/2/w/1200",this.curImg.attrs.sourceid),o=this.curImg.attrs.rotation;r.onerror=function(){n.allLoading=!1,n.$message.error("素材加载出错！")},r.onload=function(){n.transformer.children.forEach(function(t){t.nodes([])}),n.curImg.destroy();var t,e=r.width,i=r.height,e=(i<e?(t=e/600,e=600,i/=t):(t=i/600,i=600,e/=t),t={sourceid:s,src:a+"?imageView2/2/w/1200",src1:a,name:"rectTransformer",image:r,width:e,height:i,draggable:!0,x:(600-e)/2+e/2,y:(600-i)/2+i/2,rotation:0,offset:{x:e/2,y:i/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:r.width,naturalHeight:r.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:void 0},Object(c.a)(t,"rotation",o),Object(c.a)(t,"viewportTransform",[0,0]),t);n.images.push(e),n.addElem(e),n.allLoading=!1,n.jilu()}},imageDesign:function(t){var r,e,s=this,o=this;null!=t?(r=[],t.forEach(function(t,e){var i,a,n;null!=t.image?(i=new window.Image,(new Date).getTime().toString(),i.crossOrigin="anonymous",i.src=t.src,o.images.push(t),i.onload=function(){t.image=i,r[e]=t}):null!=t.text?r[e]=t:((a=o.fill).find(".fill").forEach(function(t){t.destroy()}),o.color=t,n=new x.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:t}),a.add(n),n.moveToBottom())}),e=setInterval(function(){r.length!=t.length-1||r.includes(void 0)||(o.chehuiemptyCanvas(),clearInterval(e),r.forEach(function(t){var e,i,a,n,r;null!=t.text?(e=o.layer,i=o.transformer,a=o.stage,n="",n=new(t.data?x.a.TextPath:x.a.Text)(t),e.add(n),r=new x.a.Transformer({centeredScaling:!0,node:n,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(n.fontSize()+70,e.width),e}}),t.data||n.on("transform",function(){n.setAttrs({width:n.width()*n.scaleX(),scaleY:1,scaleX:1})}),i.add(r),i.draw(),y(a,e,r,n,o.currentArea.id,s.deletCurImg),v(a),s.keydown(a,e,r),i.children.forEach(function(t){t.nodes([])})):o.addElemnew(t)}))},100)):o.emptyCanvas()},curDesign:function(t,e){var i,s,a,n,r,o,l,c,d=this,u=2<arguments.length&&void 0!==arguments[2]&&arguments[2];t.id!=this.currentArea.id&&(i=[],this.saveIds(),this.layerimages2=[],this.imageindex=0,(s=this).layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),this.layerimages[""+this.currentArea.id]=i,u&&(a=JSON.parse(JSON.stringify(this.layerimages)),this.layerimages={},this.productDetail.design_list.forEach(function(t){a[""+t.id]&&(d.layerimages[""+t.id]=JSON.parse(JSON.stringify(a[""+t.id])))}),this.$emit("newSize")),this.$emit("setCurrentArea",t,e),s.color="rgba(255,255,255,0)",i=JSON.stringify(i),sessionStorage.setItem(this.currentArea.id,i),this.emptyCanvas(),this.clearrect(),this.tag=0,document.getElementById("btn1")&&(u=document.getElementById("btn1"),e=document.getElementById("btn2"),n=document.getElementById("btn3"),r=document.getElementById("btn4"),u.style.color="black",u.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5",n.style.color="black",n.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5"),t.id)&&(setTimeout(function(){d.addRuler(d.MaxDesign,d.grid,1)},20),this.popovervisible=!1,null!=(o=JSON.parse(sessionStorage.getItem(t.id))))&&(this.layerimages2[this.imageindex]=JSON.parse(sessionStorage.getItem(t.id)),l=[],o.forEach(function(t,e){var i,a,n;null!=t.image?(i=new window.Image,(new Date).getTime().toString(),i.crossOrigin="anonymous",i.src=t.src,s.images.push(t),i.onload=function(){t.image=i,l[e]=t}):null!=t.text?l[e]=t:((a=s.fill).find(".fill").forEach(function(t){t.destroy()}),s.color=t,n=new x.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:t}),a.add(n),n.moveToBottom())}),c=setInterval(function(){l.length!=o.length-1||l.includes(void 0)||(clearInterval(c),l.forEach(function(t){var e,i,a,n,r;null!=t.text?(e=s.layer,i=s.transformer,a=s.stage,n="",n=new(t.data?x.a.TextPath:x.a.Text)(t),e.add(n),d.curImg=n,r=new x.a.Transformer({centeredScaling:!0,node:n,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(n.fontSize()+70,e.width),e}}),t.data||n.on("transform",function(){n.setAttrs({width:n.width()*n.scaleX(),scaleY:1,scaleX:1})}),i.add(r),i.draw(),y(a,e,r,n,s.currentArea.id,d.deletCurImg),v(a),d.keydown(a,e,r),i.children.forEach(function(t){t.nodes([])})):s.addElemnew(t)}))},100))},swiperNext:function(){this.shilihua=0,this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex+1,this.save()},swiperPrev:function(){this.shilihua=0,this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex-1,this.save()},setPage1:function(t){var e;this.material.keywords==[]?(e={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:t,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords},this.$emit("materialSearch",e)):(e={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:t,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords.join(",")},this.$emit("materialSearch",e))},setNum1:function(t){t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:t,name:this.material.name,keywords:this.material.keywords.join(",")};this.$emit("materialSearch",t)},setPage:function(t){this.product.pageNumber=t,"全部"==this.product.tag&&(this.product.tag=""),"全部"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},setNum:function(t){this.product.pageSize=t,"全部"==this.product.tag&&(this.product.tag=""),"全部"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},productSearch:function(){this.product.pageNumber=1,""!=this.product.cid&&(this.product.cid=this.product.cid[this.product.cid.length-1]),"全部"==this.product.tag&&(this.product.tag=""),"全部"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},materialSearch:function(){var t;this.material.pageNumber=1,this.material.keywords==[]?(t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords},this.$emit("materialSearch",t)):(t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords.join(",")},this.$emit("materialSearch",t))},resetProduct:function(){this.product.name="",this.product.cid="",this.product.pageNumber=1,this.product.pageSize=20,this.product.tag="",this.product.level="",this.$emit("productSearch",this.product)},resetProduct1:function(){this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("materialSearch",this.material)},carNum:function(t){""==t&&(this.car.num=1)},setProductColor:function(t){this.shilihua=0,this.productColorIndex=t,this.productSizeIndex=0,this.$emit("setSizes",t,this.currentId)},setProductColor2:function(t){this.shilihua=0,this.productColorIndex=t,this.productSizeIndex=0,this.$emit("setSizes2",t,this.currentId)},setProductSize:function(t,e){this.shilihua=0,this.productSizeIndex=e,this.$emit("setColor",e,this.productColorIndex,this.currentId),this.$emit("setAttrId",t.id)},setProductSize2:function(t,e){this.shilihua=0,this.productSizeIndex=e,this.$emit("setColor2",e,this.productColorIndex,this.currentId),this.$emit("setAttrId",t.id)},saveIds:function(){for(var t=this,i=(this.sourceIds=[],0);i<window._this.productDetail.design_list.length;i++)!function(){var e=[];t.layer.children.forEach(function(t){t=t.attrs.sourceid;e.push(t)}),e=JSON.stringify(e),sessionStorage.setItem(t.currentArea.id+"id",e),window._this.productDetail.design_list[i].id&&t.sourceIds.push(JSON.parse(sessionStorage.getItem(window._this.productDetail.design_list[i].id+"id")))}()},addCart:function(t){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("addCar",t,this.car,this.productColorIndex,this.sourceIds)},addCar:function(){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("addCar",this.productDetail.attr_list[this.productColorIndex].sizes[this.productSizeIndex].id,this.car,this.productColorIndex,this.sourceIds)},saveCanvas:function(){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("saveCanvas",this.productDetail.attr_list[this.productColorIndex].sizes[this.productSizeIndex].id,this.productColorIndex,this.sourceIds)},copyCanvas:function(t){var e,i,a=this;t==this.currentArea?this.$message.error("就在当前遮罩，无需复制。"):(window._this.transformer.children.forEach(function(t){t.nodes([])}),window._this.grid.find(".grid").forEach(function(t){t.hide()}),window._this.grid.find(".gridLh").forEach(function(t){t.hide()}),window._this.grid.find(".gridLv").forEach(function(t){t.hide()}),e=window._this.stage.toDataURL({mimeType:"image/webp",pixelRatio:2}),window._this.grid.find(".grid").forEach(function(t){t.show()}),window._this.grid.find(".gridLh").forEach(function(t){t.show()}),window._this.grid.find(".gridLv").forEach(function(t){t.show()}),i=[],this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),"all"==t?this.productDetail.design_list.forEach(function(t){t!=a.currentArea&&(a.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)),a.$emit("getDesignTemp","",t,a.scrollImg,e,e))}):(this.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)),this.$emit("getDesignTemp","",t,this.scrollImg,e,e)),this.$message({message:"复制成功",type:"success"}))},dcopyCanvas:function(t){var e,i=this;t==this.currentArea?this.$message.error("就在当前遮罩，无需复制。"):("all"==t?this.productDetail.design_list.forEach(function(t){var e;t!=i.currentArea&&(i.layerimages[""+t.id]?(i.layerimages[""+t.id].splice(i.layerimages[""+t.id].length-1,0,i.curImg.attrs),sessionStorage.setItem(t.id,JSON.stringify(i.layerimages[""+t.id]))):((e=[]).push(i.curImg.attrs),e.push(i.color),i.layerimages[""+t.id]=e,sessionStorage.setItem(t.id,JSON.stringify(e))))}):this.layerimages[""+t.id]?(this.layerimages[""+t.id].splice(this.layerimages[""+t.id].length-1,0,this.curImg.attrs),sessionStorage.setItem(t.id,JSON.stringify(this.layerimages[""+t.id]))):((e=[]).push(this.curImg.attrs),e.push(this.color),this.layerimages[""+t.id]=e,sessionStorage.setItem(t.id,JSON.stringify(e))),this.$message({message:"复制成功",type:"success"}))},setPop:function(){this.$emit("openBigImg",{colorIndex:this.productColorIndex})},keycodes:function(){document.oncontextmenu=function(){return!1},document.addEventListener("keydown",function(t){("F12"==t.key||"Ctrl"==t.key&&"shift"==t.key&&"i"==t.key||"shift"==t.key&&"F10"==t.key)&&t.preventDefault()})},closeCropper:function(){this.myCropper.destroy(),this.dialogVisible=!1},handleChangeRotate:function(t){this.cropperrotateTo(t)},initcrop:function(){this.myCropper=new Z.a(this.$refs.imagecrop,{viewMode:1,dragMode:"move",preview:".before",background:!1,autoCropArea:.5,zoomOnWheel:!0,aspectRatio:this.autoCropWidth/this.autoCropHeight,minCropBoxWidth:1,minCropBoxHeight:1}),this.myCropper.replace(this.curImg.attrs.src1)},sureSava:function(){var t,e=this,i=(this.croploading=!0,this.curImg.attrs.src1.match(/\.([^.]+)$/)),i=(this.afterImg=this.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toDataURL("image/".concat(i?i[1]:"png")),this.dataURLtoFile(this.afterImg,"crop.".concat(i?i[1]:"png")));20<Number(i.size/1024/1024)?(this.croploading=!1,this.$msgbox({title:"",message:"裁切画质较高，图像大小已超过20MB，请重新框选。",type:"warning"})):((t=new FormData).append("file",i),Object(w.a)(t).then(function(t){e.croploading=!1,1==t.data.code?(e.dialogVisible=!1,e.lingshiceshi(t.data.data.url)):e.messageBox(t)}))},cropperzoom:function(t){this.myCropper.zoom(t)},cropperReset:function(){this.myCropper.reset(),this.ScaleX=1,this.ScaleY=1},croppermove:function(t,e){this.myCropper.move(t,e)},cropperRotate:function(t){this.myCropper.rotate(t)},cropperrotateTo:function(t){this.myCropper.rotateTo(t)},cropperScaleX:function(){this.ScaleX=-this.ScaleX,-90===this.myCropper.getImageData().rotate||90===this.myCropper.getImageData().rotate?this.myCropper.scaleY(this.ScaleX):this.myCropper.scaleX(this.ScaleX)},cropperScaleY:function(){this.ScaleY=-this.ScaleY,-90===this.myCropper.getImageData().rotate||90===this.myCropper.getImageData().rotate?this.myCropper.scaleX(this.ScaleY):this.myCropper.scaleY(this.ScaleY)},getKonvaScale:function(){var t=document.body.style.zoom||1,e=document.getElementById("container"),i=(1/t).toFixed(3);e.style.transform="scale(".concat(t,")"),e.style.zoom=i,e.style.transformOrigin="0px 0px"},handleColorPickerClick:function(){var a=(1/(document.body.style.zoom||1)).toFixed(3);setTimeout(function(){var t=document.getElementsByClassName("el-color-dropdown el-color-picker__panel");0<t.length&&t.forEach(function(t){t.style.zoom=a;var e=parseInt(t.style.top,10),i=parseInt(t.style.left,10);t.style.top=(e/a).toFixed(2).toString()+"px",t.style.left=(i/a).toFixed(2).toString()+"px"})},10)}},mounted:function(){},watch:{Gradientcolor1:function(t,e){this.Gradientxml()},Gradientcolor2:function(t,e){this.Gradientxml()},"material.userId":{handler:function(t,e){this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("getFolderlist",this.material.userId),this.$emit("getKeywordlist",this.material.userId),this.materialSearch()}},color:function(t,e){var i=this.fill,a=(i.find(".fill").forEach(function(t){t.destroy()}),new x.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:this.color}));i.add(a),a.moveToBottom(),this.save()},Gradientcolor3:function(t,e){this.generateImage()},Gradientcolor4:function(t,e){this.generateImage()},Gradientcolor5:function(t,e){this.generateImage2()},Gradientcolor6:function(t,e){this.generateImage3()},Gradientcolor7:function(t,e){this.generateImage3()},lucency:function(t,e){this.curImg.setOpacity(t/100),this.save()},fontData:function(t,e){var i=0;-200==t?this.curImg.data("M 0,200 Q 200,200 400,200"):(0<t&&(i=t+200),i=t<0?t-200:i,t=200<i?1:0,this.curImg.data('"M 0,200 A '.concat(i,",").concat(i," 0 ").concat(t," ").concat(1,' 400,200"'))),this.save()},fontgData:function(t,e){this.curImg.attrs.text.length,this.curImg.fontSize();t=100-t;this.curImg.data('"M 0,100 Q '.concat(100,",").concat(t," 200,").concat(100,' "'))},active:function(t){this.$refs.redefineSwipe1.$swiper.slideTo(t)},layer:{handler:function(t,e){},deep:!0},"curImg.attrs":{handler:function(t,e){this.curImg&&null!=this.curImg.text||(this.popovervisible=!1),1==this.click_up&&(this.click_up=2),this.curImg&&(1==this.curImg.attrs.flipX&&this.curImg.attrs.angle1!=this.curImg.attrs.rotation?this.curImg.attrs.angle=this.curImg.attrs.rotation+180:this.curImg.attrs.angle=this.curImg.attrs.rotation),document.getElementsByClassName("changeb")[1]&&(0!=document.getElementsByClassName("body")[0].style.zIndex?(document.getElementsByClassName("changeb")[0].classList.add("actionb"),document.getElementsByClassName("changeb")[1]):(document.getElementsByClassName("changeb")[1].classList.add("actionb"),document.getElementsByClassName("changeb")[0])).classList.remove("actionb"),this.curImg&&document.getElementById("btn1")&&(1==this.tag&&(document.getElementById("btn1").style.backgroundColor="var(--style-color-design)"),2==this.tag&&(document.getElementById("btn2").style.backgroundColor="var(--style-color-design)"),3==this.tag&&(document.getElementById("btn3").style.backgroundColor="var(--style-color-design)"),4==this.tag)&&(document.getElementById("btn4").style.backgroundColor="var(--style-color-design)"),this.save()},deep:!0}},created:function(){var e=this;this.keycodes(),window._this=this;for(var t=200;11<t;t-=2)this.fontSize.unshift(t);setTimeout(function(t){e.stage=e.pageStage,e.fill=e.pageLayer[0].fillLayer,e.layer=e.pageLayer[1].layer,e.transformer=e.pageLayer[2].transformer,e.grid=e.pageLayer[3].gridLayer,e.tr=new x.a.Transformer({name:"tr",status:"",rotationSnaps:[0,45,90,135,180,225,270,315]}),e.transformer.add(e.tr),e.transformer.draw(),e.getKonvaScale()},20);var i=this.$route.query.type;sessionStorage.clear(),i&&this.clickChange(i)},computed:{selectedTypeList:function(){var e=this,t=this.imageToCartoonList.find(function(t){return t.value===e.selectedType});return t?t.List:[]},formatTooltip:function(){this.lucency=100*this.curImg.getOpacity()},Dpi:function(){return this.currentArea&&this.currentArea.dpi?this.currentArea.dpi:72},MaxDesign:function(){return this.currentArea&&this.currentArea.max_design?this.currentArea.max_design:105.84}}},r=(e("5449"),e("d8e8"),e("5a79"),Object(g.a)(j,function(){var a=this,t=a.$createElement,n=a._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.allLoading,expression:"allLoading"}],staticClass:"content",staticStyle:{width:"var(--min-width)"},on:{click:function(t){a.keywordShow=!1}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!a.popShow,expression:"!popShow"}],staticClass:"ct"},[n("div",{staticClass:"left"},[n("div",{staticClass:"button"},[n("input",{ref:"file",staticClass:"input-opacity",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpeg, image/png, image/jpg"},on:{change:function(t){return a.addImage(t)}}}),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:function(t){return a.clickChange("product")}}},[a._v("产品")]),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:function(t){return a.clickChange("Material")}}},[a._v("素材")]),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:function(t){return a.clickChange("image")}}},[a._v("本地图片")]),n("el-dropdown",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],on:{command:a.handleCommandText}},[n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"big",type:"primary"},on:{click:a.addFont}},[a._v(" 文字"),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{command:"a"}},[a._v("文字")]),n("el-dropdown-item",{attrs:{command:"b"}},[a._v("弯曲文本")])],1)],1)],1),"product"==a.leftButtonStatus?n("div",{staticClass:"productSearch"},[n("div",{staticClass:"search"},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入搜索内容",size:"small"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.productSearch.apply(null,arguments)}},model:{value:a.product.name,callback:function(t){a.$set(a.product,"name",t)},expression:"product.name"}},[n("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},on:{click:function(t){return a.productSearch()}},slot:"append"})],1)],1),n("div",{staticClass:"cascader"},[n("div",{staticClass:"item"},[n("el-cascader",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],ref:"selectDeptRef",attrs:{options:a.category,props:a.cateListProps,size:"small"},on:{change:a.setCategory},model:{value:a.product.cid,callback:function(t){a.$set(a.product,"cid",t)},expression:"product.cid"}})],1),n("div",{staticClass:"item"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{size:"small"},model:{value:a.product.tag,callback:function(t){a.$set(a.product,"tag",t)},expression:"product.tag"}},a._l(a.category1,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),n("div",{staticClass:"item"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{size:"small"},model:{value:a.product.level,callback:function(t){a.$set(a.product,"level",t)},expression:"product.level"}},a._l(a.level,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{type:"text",size:"small"},on:{click:a.resetProduct}},[a._v("重置")])],1)])]):a._e(),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.productLoding,expression:"productLoding"}],staticClass:"productShow"},["product"==a.leftButtonStatus?n("div",{staticClass:"productList"},[a._l(a.productList.product_list,function(e,t){return n("div",{staticClass:"item",class:a.currentId==e.id?"curItem":"",on:{mousemove:function(t){return a.productMove(e)},mouseleave:function(t){return a.productLeave(e)},click:function(t){return a.productDown(e)}}},[n("img",{attrs:{src:e.img_url,alt:""}})])}),a.productList.product_list?a._e():n("div",{staticClass:"item",on:{click:function(t){return a.goAdd("product")}}},[n("img",{attrs:{src:e("e960"),alt:""}})])],2):a._e(),"product"==a.leftButtonStatus?n("div",{staticClass:"imgPage"},[n("el-pagination",{attrs:{small:"","current-page":a.product.pageNumber,"page-sizes":[20,50,100,200],"page-size":a.product.pageSize,"pager-count":5,layout:" prev, pager, next, jumper",total:a.productList.num_total},on:{"size-change":a.setNum,"current-change":a.setPage,"update:currentPage":function(t){return a.$set(a.product,"pageNumber",t)},"update:current-page":function(t){return a.$set(a.product,"pageNumber",t)}}})],1):a._e()]),"Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"productSearch"},[n("div",{staticClass:"search"},[n("el-form",{ref:"form",staticStyle:{display:"flex","flex-wrap":"wrap",height:"31px"},attrs:{model:a.search,size:"small"}},[n("search-account",{staticStyle:{width:"98px"},attrs:{defaultMyself:!0,multiple:!1,label1:1,width1:0},model:{value:a.material.userId,callback:function(t){a.$set(a.material,"userId",t)},expression:"material.userId"}}),n("el-form-item",{staticStyle:{"margin-top":"1px"},attrs:{"label-width":"10px"}},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入搜索内容",size:"small"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.materialSearch.apply(null,arguments)}},model:{value:a.material.name,callback:function(t){a.$set(a.material,"name",t)},expression:"material.name"}},[n("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},on:{click:function(t){return a.materialSearch()}},slot:"append"})],1)],1)],1)],1),n("div",{staticClass:"cascader"},[a.folderList.length!=[]?n("div",{staticClass:"item"},[n("el-cascader",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],ref:"selectDeptRef1",attrs:{options:a.folderList,props:a.cateListProps,size:"small",placeholder:"文件夹"},on:{change:a.setCategory1},model:{value:a.material.fid,callback:function(t){a.$set(a.material,"fid",t)},expression:"material.fid"}})],1):a._e(),n("div",{staticClass:"item",staticStyle:{"line-height":"32px",cursor:"pointer"},on:{click:function(t){t.stopPropagation(),a.keywordShow=!a.keywordShow}}},[n("span",{staticStyle:{"font-size":"13px"}},[a._v("关键词")]),n("span",[a.keywordShow?n("i",{staticClass:"el-icon-arrow-up"}):n("i",{staticClass:"el-icon-arrow-down"})])]),a.keywordShow?n("div",{staticClass:"options",on:{click:function(t){t.stopPropagation()}}},[n("el-checkbox-group",{attrs:{size:"mini"},model:{value:a.material.keywords,callback:function(t){a.$set(a.material,"keywords",t)},expression:"material.keywords"}},a._l(a.keywordList,function(t){return n("el-checkbox-button",{key:t,attrs:{label:t},on:{change:function(t){return a.materialSearch()}}},[a._v(a._s(t))])}),1)],1):a._e(),n("div",{staticClass:"item"},[n("el-button",{attrs:{type:"text",size:"small"},on:{click:a.resetProduct1}},[a._v("重置")])],1)])]):a._e(),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.materiaLoding,expression:"materiaLoding"}],staticClass:"materialShow"},["Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"productList"},[a._l(a.sourceList.source_list,function(e,i){return n("div",{staticClass:"item",class:a.currentMaterialIndex==i?"curItem":"",on:{mousemove:function(t){return a.productMove(e)},mouseleave:function(t){return a.productLeave(e)},click:function(t){return a.materialDown(e,i)}}},[n("img",{attrs:{src:e.thumb,alt:""}})])}),a.sourceList.source_list?a._e():n("div",{staticClass:"item",on:{click:function(t){return a.goAdd("material")}}},[n("img",{attrs:{src:e("e960"),alt:""}})])],2):a._e(),"Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"imgPage"},[n("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{small:"","current-page":a.material.pageNumber,"page-sizes":[20,50,100,200],"page-size":a.material.pageSize,"pager-count":5,layout:" prev, pager, next, jumper",total:a.sourceList.num_total},on:{"size-change":a.setNum1,"current-change":a.setPage1,"update:currentPage":function(t){return a.$set(a.material,"pageNumber",t)},"update:current-page":function(t){return a.$set(a.material,"pageNumber",t)}}})],1):a._e()]),""!=a.currentProduct?n("div",{staticClass:"product"},[n("div",{staticClass:"img"},[n("img",{attrs:{src:a.currentProduct.thumb1200||a.currentProduct.img_url,alt:""}})]),n("div",{staticClass:"title"},[a._v(a._s(a.currentProduct.name))]),n("div",{staticClass:"detail"},[n("p",[a._v("图片编号："+a._s(a.currentProduct.code))]),1==a.currentProduct.level?n("p",[n("img",{attrs:{src:e("28e5"),alt:""}}),n("span",[a._v("创业版")])]):a._e(),2==a.currentProduct.level?n("p",[n("img",{attrs:{src:e("f027"),alt:""}}),n("span",[a._v("专业版")])]):a._e(),3==a.currentProduct.level?n("p",[n("img",{attrs:{src:e("5eae"),alt:""}}),n("span",[a._v("高级版")])]):a._e()]),a.currentProduct.price?n("div",{staticClass:"money"},[a._v(" ￥"+a._s(a.currentProduct.price)+" ")]):a._e(),a.currentProduct.colors?n("div",{staticClass:"color"},a._l(a.currentProduct.colors,function(t){return n("p",{style:{background:t.color}})}),0):a._e(),a.currentProduct.width?n("div",{staticClass:"size"},[a._v(" 图片尺寸: "),n("span",[a._v(a._s(a.currentProduct.width))]),a._v("px * "),n("span",[a._v(a._s(a.currentProduct.height))]),a._v("px ")]):a._e()]):a._e()]),n("div",{staticClass:"curProduct"},a._l(a.productDetail.design_list,function(e,i){return n("div",{staticClass:"item",class:e==a.currentArea?"curItem":"",on:{click:function(t){return a.curDesign(e,i)}}},[n("img",{attrs:{src:e?e.area_path:"",alt:""}}),e.show_diy_layername?n("div",{staticStyle:{"align-self":"center","text-align":"center"}},[a._v(a._s(e.diy_layername))]):n("div",{staticStyle:{"align-self":"center","text-align":"center"}},[a._v("图层"+a._s(i+1))])])}),0),n("div",{staticClass:"curProducth"},a._l(a.layer.children,function(t,e){return a.layer&&a.layer.children&&0<a.layer.children.length&&(null!=a.layer.children[a.layer.children.length-1-e].attrs.image||null!=a.layer.children[a.layer.children.length-1-e].attrs.text)?n("div",{staticClass:"item",on:{click:function(t){return a.changesucai(a.layer.children.length-1-e)}}},[null==a.layer.children[a.layer.children.length-1-e].attrs.image||a.layer.children[a.layer.children.length-1-e].attrs.hasOwnProperty("pingpu")?null!=a.layer.children[a.layer.children.length-1-e].attrs.text?n("div",{staticStyle:{"font-size":"12px","text-align":"center",padding:"7px"}},[a._v(a._s(a.layer.children[a.layer.children.length-1-e].attrs.text))]):n("img",{attrs:{src:a.layer.children[a.layer.children.length-1-e].attrs.image?a.layer.children[a.layer.children.length-1-e].attrs.image.currentSrc:"",alt:""}}):n("img",{attrs:{src:a.layer.children[a.layer.children.length-1-e].attrs.src,alt:""}}),null==a.layer.children[a.layer.children.length-1-e].attrs.image||a.layer.children[a.layer.children.length-1-e].attrs.hasOwnProperty("pingpu")?a._e():n("div",{staticStyle:{"align-self":"center"},on:{click:function(t){t.stopPropagation()}}},[n("el-switch",{staticStyle:{margin:"10px 0"},on:{change:function(t){return a.imgTheme(t,a.layer.children.length-1-e)}},model:{value:a.layer.children[a.layer.children.length-1-e].attrs.isTheme,callback:function(t){a.$set(a.layer.children[a.layer.children.length-1-e].attrs,"isTheme",t)},expression:"layer.children[layer.children.length - 1 - index].attrs.isTheme"}})],1)]):a._e()}),0),n("div",{staticClass:"canvas"},[n("div",{staticClass:"button"},[0<a.imageindex?n("p",{staticStyle:{"margin-right":"15px","margin-top":"4px"},attrs:{title:"撤销操作"},on:{click:a.chexiao}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("7661")}})]):n("p",{staticStyle:{"margin-right":"15px","margin-top":"4px"},attrs:{title:"撤销操作"}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("b2b5")}})]),a.imageindex+1<a.layerimages2.length?n("p",{staticStyle:{"margin-right":"20px","margin-top":"4px"},attrs:{title:"恢复操作"},on:{click:a.chonzuo}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("2c2b")}})]):n("p",{staticStyle:{"margin-right":"20px","margin-top":"4px"},attrs:{title:"恢复操作"}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("fd5f")}})]),n("p",[n("el-button",{attrs:{type:"primary",size:"big"},on:{click:a.drawGrid}},[a._v("辅助网格")])],1),n("p",[n("el-dropdown",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}]},[n("el-button",{staticStyle:{"margin-left":"15px"},attrs:{type:"primary",size:"big"}},[a._v(" 快捷键 "),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),n("el-dropdown-menu",{staticClass:"keylist",attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("上移动")]),n("p",{staticClass:"keybox"},[a._v("↑")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("下移动")]),n("p",{staticClass:"keybox"},[a._v("↓")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("左移动")]),n("p",{staticClass:"keybox"},[a._v("←")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("右移动")]),n("p",{staticClass:"keybox"},[a._v("→")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("逆时针45°旋转")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + Q")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("顺时针45°旋转")]),n("p",{staticClass:"keybox"},[a._v("Alt + Q")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("放大")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + Z")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("缩小")]),n("p",{staticClass:"keybox"},[a._v("Alt + Z")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("删除")]),n("p",{staticClass:"keybox"},[a._v("Delete")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("保存")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + S")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("复制")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + C")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("图片填充")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + B")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("图片适应")]),n("p",{staticClass:"keybox"},[a._v("Alt + B")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("清空全部设计")]),n("p",{staticClass:"keybox"},[a._v("Shift + R")])])])],1)],1)],1),n("p",[n("el-button",{staticStyle:{margin:"0 15px"},attrs:{type:"primary",size:"big"},on:{click:a.emptyCanvas2}},[a._v("清空画布")])],1),n("p"),n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{staticStyle:{"margin-right":"15px","margin-top":"2px"},attrs:{"show-alpha":"",size:"small"},on:{change:a.handleClear},model:{value:a.color,callback:function(t){a.color=t},expression:"color"}})],1),n("p",{staticStyle:{"margin-top":"4px"},attrs:{title:"吸色器(纯白色为默认色 不可吸 请手动选面板左上角)"},on:{touchstart:a.getcolor,click:a.getcolor}},[n("img",{staticStyle:{width:"70%",cursor:"pointer"},attrs:{src:e("889b")}})]),n("div",[n("input",{staticStyle:{width:"0px",height:"0px",opacity:"0"},attrs:{id:"getcolor",type:"color"},domProps:{value:a.defaultcolor},on:{input:a.nativePick}})]),n("p",{staticStyle:{"margin-right":"15px","font-size":"25px",color:"var(--style-color-design)",cursor:"pointer"},attrs:{title:"裁切"}},[a.curImg&&null!=a.curImg.attrs.image&&1!=a.curImg.attrs.putu?n("i",{staticClass:"el-icon-crop",on:{click:function(t){return a.cropimage()}}}):a._e()]),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"动漫化",placement:"top"}},[n("p",{staticStyle:{"font-size":"25px",color:"var(--style-color-design)",cursor:"pointer"}},[a.curImg&&null!=a.curImg.attrs.image&&1!=a.curImg.attrs.putu?n("i",{staticClass:"el-icon-video-camera-solid",on:{click:function(t){return a.imageToCartoon()}}}):a._e()])]),n("p"),n("p",{staticStyle:{"margin-left":"10px"}})],1),0==a.dwarning?n("div",{staticClass:"dwarn"},[a._m(0),n("div",[n("i",{staticClass:"el-icon-close icon",staticStyle:{"margin-top":"3px",cursor:"pointer"},on:{click:function(t){a.dwarning=!0}}})])]):a._e(),n("div",{staticClass:"konva",on:{dragover:a.dragover,dragleave:a.dragleave,drop:function(t){return t.preventDefault(),a.handleDrop.apply(null,arguments)}}},[a.productDetail.design_list&&1!=a.productDetail.design_list.length?n("div",{staticClass:"copy"},[n("p",[a._v("复制至")]),n("div",{staticClass:"copy-list"},[n("div",{staticClass:"item",on:{click:function(t){return a.copyCanvas("all")}}},[a._v("全部")]),a._l(a.productDetail.design_list,function(e,t){return n("div",{staticClass:"item",on:{click:function(t){return a.copyCanvas(e)}}},[e.show_diy_layername?n("a",[a._v(a._s(e.diy_layername))]):n("a",[a._v("图层"+a._s(t+1))])])})],2)]):a._e(),a.productDetail.design_list&&1!=a.productDetail.design_list.length&&a.curImg?n("div",{staticClass:"copyd"},[n("p",[a._v("单复制")]),n("div",{staticClass:"copy-list"},[n("div",{staticClass:"item",on:{click:function(t){return a.dcopyCanvas("all")}}},[a._v("全部")]),a._l(a.productDetail.design_list,function(e,t){return n("div",{staticClass:"item",on:{click:function(t){return a.dcopyCanvas(e)}}},[e.show_diy_layername?n("a",[a._v(a._s(e.diy_layername))]):n("a",[a._v("图层"+a._s(t+1))])])})],2)]):a._e(),n("div",{staticClass:"k-img"},[""!=a.currentArea?n("img",{ref:"myImg",attrs:{src:a.currentArea.cutpiece}}):a._e()]),n("div",{staticClass:"k-img1"},[a.curImg&&Math.abs(this.curImg.attrs.x-300)<2&&0!=a.click_up?n("img",{attrs:{src:e("52f9")}}):a._e()]),n("div",{staticClass:"k-img1"},[a.curImg&&Math.abs(this.curImg.attrs.y-300)<2&&0!=a.click_up?n("img",{attrs:{src:e("fb9f")}}):a._e()]),n("div",{ref:"container",staticClass:"container",attrs:{id:"container"}})]),n("div",[n("div",[n("i",{staticClass:"el-icon-full-screen icon"}),n("span",{staticStyle:{"margin-right":"7px"}}),n("span",{staticStyle:{color:"var(--info-color)","font-size":"14px"}},[a._v("当前最大设计面积为："+a._s(a.MaxDesign)+"CM X "+a._s(a.MaxDesign)+"CM ("+a._s((a.MaxDesign/2.54*a.Dpi).toFixed(0))+"px X "+a._s((a.MaxDesign/2.54*a.Dpi).toFixed(0))+"px)")]),n("span",{staticStyle:{"margin-left":"17px",color:"var(--info-color)","font-size":"14px"}},[a._v("DPI："+a._s(a.Dpi))])])]),a.curImg&&null!=a.curImg.attrs.image?n("div",[n("div",[n("i",{staticClass:"el-icon-picture-outline icon"}),n("span",{staticStyle:{"margin-right":"7px"}}),n("span",{staticStyle:{color:"var(--info-color)","font-size":"14px"}},[a._v("当前图片宽高为："+a._s(Math.abs(a.curImg.attrs.width/600*a.MaxDesign*a.curImg.attrs.scaleX).toFixed(2))+"CM X "+a._s(Math.abs(a.curImg.attrs.height/600*a.MaxDesign*a.curImg.attrs.scaleY).toFixed(2))+"CM ("+a._s(Math.abs((a.curImg.attrs.width/600*a.MaxDesign*a.curImg.attrs.scaleX).toFixed(2)/2.54*a.Dpi).toFixed(0))+"px X "+a._s(Math.abs((a.curImg.attrs.height/600*a.MaxDesign*a.curImg.attrs.scaleY).toFixed(2)/2.54*a.Dpi).toFixed(0))+"px)")])])]):a._e()]),n("div",{staticClass:"right"},[a.curImg?n("div",{staticClass:"edit"},[n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"置顶"},on:{click:function(t){return a.rightButton("top")}}},[n("img",{attrs:{src:e("aa70"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status||1==a.curImg.attrs.putu,type:"text",title:"置底"},on:{click:function(t){return a.rightButton("bottom")}}},[n("img",{attrs:{src:e("d780"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"上移"},on:{click:function(t){return a.rightButton("up")}}},[n("img",{attrs:{src:e("584e"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"下移"},on:{click:function(t){return a.rightButton("down")}}},[n("img",{attrs:{src:e("06db"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"复制图层"},on:{click:function(t){return a.rightButton("copy")}}},[n("img",{attrs:{src:e("27d4"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"删除图层"},on:{click:function(t){return a.rightButton("delet")}}},[n("img",{attrs:{src:e("a8cf"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"左对齐"},on:{click:function(t){return a.rightButton("LeftAlignment")}}},[n("img",{attrs:{src:e("8efd"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"水平居中"},on:{click:function(t){return a.rightButton("Center")}}},[n("img",{attrs:{src:e("66a3"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"右对齐"},on:{click:function(t){return a.rightButton("RightAlignment")}}},[n("img",{attrs:{src:e("570d"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"上对齐"},on:{click:function(t){return a.rightButton("TopAlignment")}}},[n("img",{attrs:{src:e("5f7f"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"垂直居中"},on:{click:function(t){return a.rightButton("VerticalAlignment")}}},[n("img",{attrs:{src:e("0768"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"下对齐"},on:{click:function(t){return a.rightButton("BottomAlignment")}}},[n("img",{attrs:{src:e("0958"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"放大"},on:{click:function(t){return a.rightButton("amplification")}}},[n("img",{attrs:{src:e("c1c5"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"缩小"},on:{click:function(t){return a.rightButton("narrow")}}},[n("img",{attrs:{src:e("81e5"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"逆时针旋转"},on:{click:function(t){return a.rightButton("CounterclockwiseRotation")}}},[n("img",{attrs:{src:e("619a"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"顺时针旋转"},on:{click:function(t){return a.rightButton("ClockwiseRotation")}}},[n("img",{attrs:{src:e("33b2"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"水平翻转"},on:{click:function(t){return a.rightButton("horizontal")}}},[n("img",{attrs:{src:e("4660"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"垂直翻转"},on:{click:function(t){return a.rightButton("vertical")}}},[n("img",{attrs:{src:e("97ca2"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"},on:{click:function(t){a.showcut=!0}}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"抠图",placement:"top"}},[n("img",{attrs:{src:e("3572"),alt:""}})])],1)],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"},on:{click:function(t){return a.imageClarity()}}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"清晰化",placement:"top"}},[n("img",{attrs:{src:e("0128"),alt:""}})])],1)],1),n("div",{staticClass:"item"},[n("el-dropdown",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}]},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"滤镜",placement:"top"}},[n("img",{attrs:{src:e("5ccf"),alt:""}})])],1),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("div",{staticStyle:{"margin-left":"10px","font-size":"15px",color:"var(--style-color-design)"}},[a._v("滤镜风格")]),n("div",{staticClass:"lvjing_box"},a._l(a.lvjingList,function(e){return n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:e.match(/[\u4e00-\u9fa5]+/)[0],placement:"top"}},[n("img",{attrs:{src:e,alt:""},on:{click:function(t){return a.styleTransfer(e)}}})])}),1)])],1)],1)]):a._e(),a.curImg?n("div",{staticClass:"opacity"},[n("p",[a._v("透明度：")]),n("div",{staticClass:"lucency"},[n("el-slider",{attrs:{"format-tooltip":a.formatTooltip},model:{value:a.lucency,callback:function(t){a.lucency=t},expression:"lucency"}})],1)]):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"imgEdit"},[n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small"},on:{click:function(t){return a.rightButton("imageFill")}}},[a._v("图片"),n("br"),a._v("填充")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small"},on:{click:function(t){return a.rightButton("imageAdaptive")}}},[a._v("图片"),n("br"),a._v("适应")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small"},on:{click:function(t){return a.rightButton("stretch")}}},[a._v("图片"),n("br"),a._v("拉伸")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){return a.Gradientxml()}}},[a._v("生成"),n("br"),a._v("渐变图")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible=!0}}},[a._v("渐变"),n("br"),a._v("滤镜")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible2=!0}}},[a._v("主色"),n("br"),a._v("滤镜")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible3=!0}}},[a._v("叠位"),n("br"),a._v("滤镜")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible4=!0}}},[a._v("灰度"),n("br"),a._v("滤镜")])],1)]):a._e(),a.curImg&&a.curImg.attrs.text?n("div",{staticClass:"fontEdit"},[n("div",{staticClass:"flex"},[n("div",{staticClass:"fontFamliy"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{filterable:"",placeholder:"",size:"big"},on:{change:a.pickFontFamily},model:{value:a.fontFamily,callback:function(t){a.fontFamily=t},expression:"fontFamily"}},a._l(a.options,function(t){return n("el-option",{key:t.value,style:{fontFamily:t.value,fontSize:"20px",width:"200px"},attrs:{label:t.label,value:t.value}})}),1)],1),n("el-popover",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placement:"bottom",width:"480",title:"文字效果",trigger:"manual"},model:{value:a.popovervisible,callback:function(t){a.popovervisible=t},expression:"popovervisible"}},[n("button",{staticClass:"close-button",staticStyle:{position:"absolute",right:"7px",top:"5px","font-size":"22px",cursor:"pointer"},on:{click:function(t){a.popovervisible=!1}}},[n("i",{staticClass:"el-icon-close"})]),n("div",{staticStyle:{height:"420px","overflow-y":"scroll"}},[n("el-form",{attrs:{"label-position":"right","label-width":"80px"}},[n("el-form-item",{attrs:{label:"是否渐变"}},[n("el-switch",{attrs:{"active-text":"是","inactive-text":"否"},on:{change:a.toggleGradient},model:{value:a.gradientEnabled,callback:function(t){a.gradientEnabled=t},expression:"gradientEnabled"}})],1),a.gradientEnabled?[n("el-form-item",{attrs:{label:"开始坐标"}},[a._v(" X "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientStartX,callback:function(t){a.gradientStartX=t},expression:"gradientStartX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientStartY,callback:function(t){a.gradientStartY=t},expression:"gradientStartY"}})],1),n("el-form-item",{attrs:{label:"结束坐标"}},[a._v(" X "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientEndX,callback:function(t){a.gradientEndX=t},expression:"gradientEndX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientEndY,callback:function(t){a.gradientEndY=t},expression:"gradientEndY"}})],1),n("el-form-item",{attrs:{label:"渐变颜色"}},[n("div",{staticStyle:{display:"flex","flex-wrap":"wrap","align-items":"center"}},[a._l(a.gradientColors,function(t,e){return[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"mini"},on:{change:a.updateGradient},model:{value:a.gradientColors[e],callback:function(t){a.$set(a.gradientColors,e,t)},expression:"gradientColors[index]"}})],1)]})],2)]),n("el-form-item",{attrs:{label:"颜色增减"}},[n("el-button",{attrs:{disabled:10<=a.gradientColors.length,type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:a.addGradientColor}}),n("el-button",{attrs:{disabled:a.gradientColors.length<=2,type:"primary",size:"mini",icon:"el-icon-minus"},on:{click:a.delGradientColor}})],1)]:a._e(),n("el-form-item",{attrs:{label:"外侧描边"}},[n("el-switch",{attrs:{"active-text":"开启","inactive-text":"关闭"},on:{change:a.togglefillAfterStrokeEnabled},model:{value:a.fillAfterStrokeEnabled,callback:function(t){a.fillAfterStrokeEnabled=t},expression:"fillAfterStrokeEnabled"}})],1),n("el-form-item",{attrs:{label:"描边厚度"}},[n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:0,max:100},on:{change:a.pickFontstrokeWidth},model:{value:a.fontstrokeWidth,callback:function(t){a.fontstrokeWidth=t},expression:"fontstrokeWidth"}})],1),n("el-form-item",{attrs:{label:"描边颜色"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"mini"},on:{change:a.pickFontStrokeColor},model:{value:a.fontstrokeColor,callback:function(t){a.fontstrokeColor=t},expression:"fontstrokeColor"}})],1)]),n("el-form-item",{attrs:{label:"文本行高"}},[n("el-input-number",{attrs:{size:"mini","controls-position":"right",step:.1,min:1,max:100},on:{change:a.pickFontlineHeight},model:{value:a.fontlineHeight,callback:function(t){a.fontlineHeight=t},expression:"fontlineHeight"}})],1),a.curImg&&a.curImg.attrs.text&&a.curImg.attrs.data?n("el-form-item",{attrs:{label:"文字弯曲"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:-200,max:200,step:1},model:{value:a.fontData,callback:function(t){a.fontData=t},expression:"fontData"}})],1):a._e(),a.curImg&&a.curImg.attrs.text&&a.curImg.attrs.data?n("el-form-item",{attrs:{label:"文字拱形"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:-100,max:100,step:1},model:{value:a.fontgData,callback:function(t){a.fontgData=t},expression:"fontgData"}})],1):a._e(),n("el-form-item",{attrs:{label:"文字间距"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:-50,max:250,step:5},on:{change:a.pickfontletterSpacing},model:{value:a.fontletterSpacing,callback:function(t){a.fontletterSpacing=t},expression:"fontletterSpacing"}})],1),n("el-form-item",{attrs:{label:"文本加线"}},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"mini"},on:{change:a.pickFontDecoration},model:{value:a.textDecoration,callback:function(t){a.textDecoration=t},expression:"textDecoration"}},a._l(a.textdecorationoptions,function(t){return n("el-option",{key:t.value,style:{textDecoration:t.value},attrs:{label:t.label,value:t.value}})}),1)],1),n("el-form-item",{attrs:{label:"文本阴影"}},[n("el-switch",{attrs:{"active-text":"开启","inactive-text":"关闭"},on:{change:a.toggleTextShadow},model:{value:a.textShadowEnabled,callback:function(t){a.textShadowEnabled=t},expression:"textShadowEnabled"}})],1),a.textShadowEnabled?[n("el-form-item",{attrs:{label:"阴影颜色"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"mini"},on:{change:a.pickTextShadowColor},model:{value:a.textShadowColor,callback:function(t){a.textShadowColor=t},expression:"textShadowColor"}})],1)]),n("el-form-item",{attrs:{label:"阴影透明"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:0,max:1,step:.1},on:{change:a.pickTextShadowOpacity},model:{value:a.textShadowOpacity,callback:function(t){a.textShadowOpacity=t},expression:"textShadowOpacity"}})],1),n("el-form-item",{attrs:{label:"阴影偏移"}},[a._v(" X "),n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:-100,max:100},on:{change:a.pickTextShadowOffsetX},model:{value:a.textShadowOffsetX,callback:function(t){a.textShadowOffsetX=t},expression:"textShadowOffsetX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:-100,max:100},on:{change:a.pickTextShadowOffsetY},model:{value:a.textShadowOffsetY,callback:function(t){a.textShadowOffsetY=t},expression:"textShadowOffsetY"}})],1),n("el-form-item",{attrs:{label:"模糊程度"}},[n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:0,max:100},on:{change:a.pickTextShadowBlur},model:{value:a.textShadowBlur,callback:function(t){a.textShadowBlur=t},expression:"textShadowBlur"}})],1)]:a._e()],2)],1),n("el-button",{staticStyle:{margin:"0 10px"},attrs:{slot:"reference"},on:{click:function(t){a.popovervisible=!a.popovervisible}},slot:"reference"},[a._v("文字效果")])],1),n("div",{staticClass:"fontColor",staticStyle:{display:"flex"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"small"},on:{change:a.pickFontColor},model:{value:a.fontColor,callback:function(t){a.fontColor=t},expression:"fontColor"}})],1)])],1),n("div",{staticClass:"flex"},[n("div",{staticClass:"fontSize"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"big"},on:{change:a.pickFontSize},model:{value:a.fontSizeStr,callback:function(t){a.fontSizeStr=t},expression:"fontSizeStr"}},a._l(a.fontSize,function(t,e){return n("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1),n("div",{staticClass:"fontButtom"},[n("el-button",{attrs:{size:"big",type:"text",title:"文本居左"},on:{click:function(t){return a.rightButton("fontLeft")}}},[n("img",{attrs:{src:e("e028"),alt:""}})])],1),n("div",{staticClass:"fontButtom"},[n("el-button",{attrs:{size:"big",type:"text",title:"文本居中"},on:{click:function(t){return a.rightButton("fontCenter")}}},[n("img",{attrs:{src:e("93f2"),alt:""}})])],1),n("div",{staticClass:"fontButtom"},[n("el-button",{attrs:{size:"big",type:"text",title:"文本居右"},on:{click:function(t){return a.rightButton("fontRight")}}},[n("img",{attrs:{src:e("ad16"),alt:""}})])],1)])]):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"btns"},[n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn1"},on:{click:function(t){return a.setPattern("jichu")}}},[a._v("基础平铺")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn2"},on:{click:function(t){return a.setPattern("jingxiang")}}},[a._v("镜像平铺")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn3"},on:{click:function(t){return a.setPattern("zongxiang")}}},[a._v("纵向平铺")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn4"},on:{click:function(t){return a.setPattern("hengxiang")}}},[a._v("横向平铺")])],1):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"changeD"}):a._e(),a.productDetail.attr_list?n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.imgLoading,expression:"imgLoading"}],staticClass:"swiper"},[n("div",{staticClass:"swiper-no-swiping",attrs:{id:"xtu"}}),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"查看大图",placement:"top"}},[n("i",{staticClass:"el-icon-zoom-in pop",on:{click:a.setPop}})]),0<a.svgpath.length?n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"查看裁件",placement:"top"}},[n("i",{staticClass:"el-icon-s-help pop2",on:{click:a.cutpiece}})]):a._e()],1):a._e()])]),n("div",{directives:[{name:"show",rawName:"v-show",value:!a.popShow,expression:"!popShow"}],staticClass:"pick"},[n("div",{staticClass:"colors"},a._l(a.productDetail.attr_list,function(t,e){return n("p",{key:e,class:a.productColorIndex==e?"boder":"",style:{background:t.color},on:{click:function(t){return a.setProductColor(e)}}})}),0),n("div",{staticClass:"colors"},a._l(a.sizes,function(e,i){return n("p",{key:i,class:a.productSizeIndex==i?"boder":"",on:{click:function(t){return a.setProductSize(e,i)}}},[a._v(" "+a._s(e.size)+" ")])}),0),n("div",{staticClass:"addcar"},[n("el-switch",{staticStyle:{"margin-right":"10px"},attrs:{"active-text":"尺码自适应","inactive-text":""},model:{value:a.self_adaption,callback:function(t){a.self_adaption=t},expression:"self_adaption"}}),n("el-input",{staticStyle:{width:"60px",height:"40px","margin-right":"10px"},attrs:{size:"big",type:"number",disabled:a.layerLength},on:{change:a.carNum},model:{value:a.car.num,callback:function(t){a.$set(a.car,"num",t)},expression:"car.num"}}),n("el-button",{staticStyle:{background:"#ec2755",color:"white",width:"220px",height:"39px",border:"1px solid rgb(236, 39, 85)","border-radius":"0"},attrs:{id:"save",size:"big",disabled:a.layerLength||a.imgLoading},on:{click:function(t){return a.addCar()}}},[a._v("加入购物车")]),n("el-button",{staticStyle:{height:"39px","border-radius":"0"},attrs:{size:"big",type:"primary",disabled:a.layerLength||a.imgLoading},on:{click:a.saveCanvas}},[a._v("保存")])],1)]),n("el-dialog",{attrs:{visible:a.drawer,title:"裁件预览",top:"60px",width:"30vw"},on:{"update:visible":function(t){a.drawer=t}}},[0<a.svgXml.length?n("div",[n("div",{staticClass:"vhtml",domProps:{innerHTML:a._s(a.svgXml[a.cutpiece_index])}})]):a._e(),n("div",{staticStyle:{display:"flex","justify-content":"center","margin-top":"20px"}},[n("el-button",{attrs:{disabled:a.cutpiece_index<=0,icon:"el-icon-arrow-left"},on:{click:function(t){a.cutpiece_index--}}}),n("el-button",{attrs:{disabled:a.cutpiece_index>=a.svgXml.length-1,icon:"el-icon-arrow-right"},on:{click:function(t){a.cutpiece_index++}}})],1),n("div",{staticClass:"cutp"},[a._v(" 颜色："),n("div",{staticClass:"colors"},a._l(a.productDetail.attr_list,function(t,e){return n("p",{key:e,class:a.productColorIndex==e?"boder":"",style:{background:t.color},on:{click:function(t){return a.setProductColor2(e)}}})}),0),a._v(" 规格："),n("div",{staticClass:"colors"},a._l(a.sizes,function(e,i){return n("p",{key:i,class:a.productSizeIndex==i?"boder":"",on:{click:function(t){return a.setProductSize2(e,i)}}},[a._v(" "+a._s(e.size)+" ")])}),0)])]),n("div",{directives:[{name:"show",rawName:"v-show",value:a.popShow,expression:"popShow"}],staticClass:"fiexd"},[n("div",{staticClass:"close"},[n("i",{staticClass:"el-icon-back",on:{click:function(t){a.popShow=!a.popShow,a.active=0}}})]),a.productDetail.attr_list?n("div",{staticClass:"swiper"},[n("div",{staticClass:"imgList"},a._l(a.productDetail.attr_list[this.productColorIndex].templates,function(t,e){return n("div",{key:e,class:{imgItem:!0,border:e==a.active},on:{click:function(t){a.active=e}}},[n("img",{attrs:{src:t,alt:""}})])}),0),n("swiper",{ref:"redefineSwipe1",staticClass:"swiperOptions1 swiper-no-swiping",attrs:{options:a.swiperOptions1}},a._l(a.productDetail.attr_list[this.productColorIndex].templates,function(t,e){return n("swiper-slide",{key:e,staticClass:"rs-box"},[n("img",{staticClass:"rs-icon",attrs:{src:t}})])}),1)],1):a._e()]),n("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:a.croploading,expression:"croploading"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!1,visible:a.dialogVisible,top:"20px",width:"80vw"},on:{"update:visible":function(t){a.dialogVisible=t},open:function(t){return a.show()},close:function(t){return a.closeCropper()}}},[n("div",[n("div",{staticClass:"cropper-head"},[n("div",{staticClass:"text1"},[a._v("请框选图片中要截取的区域")]),n("div",{staticClass:"text2"},[n("img",{attrs:{src:e("3c56")}}),a._v("截取图像时，请您注意保持框选区域的清晰度及完整性。")])]),n("div",{staticClass:"cropper-content"},[n("div",{staticClass:"movetext"},[n("img",{attrs:{src:e("6890")}}),a._v("您可以使用鼠标任意拖拽图片 ， 并用滚轮调整图片大小")]),n("div",{staticClass:"cropper"},[n("img",{ref:"imagecrop",attrs:{id:"imagecrop",src:a.imgFile,alt:""}})]),n("div",{staticClass:"show-preview",style:{overflow:"hidden",margin:"0 25px",display:"flex","align-items":"center"}},[n("div",{staticClass:"preview before"})])]),n("div",{staticClass:"footer-btn"},[n("div",{staticClass:"scope-btn"},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"放大",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-zoom-in"},on:{click:function(t){return a.cropperzoom(.05)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"缩小",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-zoom-out"},on:{click:function(t){return a.cropperzoom(-.05)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"逆时针旋转",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh-left"},on:{click:function(t){return a.cropperRotate(-90)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"顺时针旋转",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh-right"},on:{click:function(t){return a.cropperRotate(90)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"重置画布",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh"},on:{click:function(t){return a.cropperReset()}}})],1)],1),n("div",{staticClass:"upload-btn"},[n("el-button",{staticStyle:{border:"1px solid #efb15e",color:"#efb15e"},on:{click:function(t){a.dialogVisible=!1}}},[a._v("取消")]),n("el-button",{staticStyle:{"background-color":"#efb15e",color:"white",border:"0"},attrs:{type:"primary"},on:{click:function(t){return a.sureSava()}}},[a._v("确定")])],1)])])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible,title:"渐变色滤镜",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible=t},open:function(t){return a.showlvjing()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading,expression:"lvjingLoading"}]}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading,expression:"lvjingLoading"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{attrs:{id:"lvjingcontainer"}}),n("div",[n("div",{staticStyle:{display:"flex","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor3},on:{input:a.nativePick2}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor3)+" ")])]),n("div",{staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor4},on:{input:a.nativePick3}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor4)+" ")])]),n("div",{staticClass:"elradioBox",staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px","margin-bottom":"45px"}},[n("el-radio-group",{on:{input:function(t){return a.lvjingblendmode()}},model:{value:a.blendmode,callback:function(t){a.blendmode=t},expression:"blendmode"}},a._l(a.mixblendmode,function(t){return n("el-radio",{key:t.value,attrs:{label:t.value,size:"mini",border:""}},[a._v(a._s(t.name))])}),1)],1),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"40px",right:"40px"},attrs:{type:"big"},on:{click:function(t){return a.startlvjing()}}},[a._v("使用该滤镜")])],1)])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible2,title:"主色滤镜",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible2=t},open:function(t){return a.showlvjing2()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading2,expression:"lvjingLoading2"}]}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading2,expression:"lvjingLoading2"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{staticStyle:{position:"relative"},attrs:{id:"lvjingcontainer2"}}),n("div",[n("div",{staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor5},on:{input:a.nativePick4}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor5)+" ")])]),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"40px",right:"40px"},attrs:{type:"big"},on:{click:function(t){return a.startlvjing2()}}},[a._v("使用该滤镜")])],1)])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible3,title:"叠位滤镜",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible3=t},open:function(t){return a.showlvjing3()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading3,expression:"lvjingLoading3"}],staticStyle:{"z-index":"2"}}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading3,expression:"lvjingLoading3"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{staticStyle:{position:"relative"},attrs:{id:"lvjingcontainer3"}}),n("div",[n("div",{staticStyle:{display:"flex","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor6},on:{input:a.nativePick5}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor6)+" ")])]),n("div",{staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor7},on:{input:a.nativePick6}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor7)+" ")])]),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"40px",right:"40px"},attrs:{type:"big"},on:{click:function(t){return a.startlvjing3()}}},[a._v("使用该滤镜")])],1)])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible4,title:"灰度滤镜",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible4=t},open:function(t){return a.showlvjing4()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading4,expression:"lvjingLoading4"}]}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading4,expression:"lvjingLoading4"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{staticStyle:{position:"relative"},attrs:{id:"lvjingcontainer4"}})])]),n("el-dialog",{attrs:{width:"252px",visible:a.showcut,title:"分割抠图",top:"40vh"},on:{"update:visible":function(t){a.showcut=t}}},[n("el-button",{on:{click:function(t){return a.cutout()}}},[a._v("通用分割")]),n("el-button",{on:{click:function(t){return a.cuthead()}}},[a._v("头像分割")])],1),n("el-dialog",{attrs:{width:"1040px",visible:a.imageToCartoonShow,title:"动漫化",top:"40px"},on:{"update:visible":function(t){a.imageToCartoonShow=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.imageToCartoonLoading,expression:"imageToCartoonLoading"}]},[n("div",{staticStyle:{color:"#6d6d6d","font-size":"16px"}},[a._v("图片类型")]),n("el-radio-group",{on:{change:a.handleTypeChange},model:{value:a.selectedType,callback:function(t){a.selectedType=t},expression:"selectedType"}},a._l(a.imageToCartoonList,function(t){return n("el-radio",{key:t.value,attrs:{label:t.value,border:""}},[a._v(" "+a._s(t.label)+" ")])}),1),n("div",{staticStyle:{color:"#6d6d6d","font-size":"16px","margin-top":"20px"}},[a._v("风格类型")]),n("el-radio-group",{model:{value:a.selectedSubType,callback:function(t){a.selectedSubType=t},expression:"selectedSubType"}},a._l(a.selectedTypeList,function(t){return n("el-radio",{key:t.value,attrs:{label:t.value,border:""}},[a._v(" "+a._s(t.label)+" ")])}),1),n("div",{staticStyle:{"margin-top":"50px"}},[n("el-button",{staticStyle:{border:"1px solid #efb15e",color:"#efb15e"},on:{click:function(t){a.imageToCartoonShow=!1}}},[a._v("取消")]),n("el-button",{staticStyle:{"background-color":"#efb15e",color:"white",border:"0"},attrs:{type:"primary"},on:{click:function(t){return a.imageToCartoonized()}}},[a._v("确定")])],1)],1)]),n("el-dialog",{attrs:{width:"400px",visible:a.showScale,title:"图像缩放与定位",top:"40vh"},on:{"update:visible":function(t){a.showScale=t}}},[n("el-form",{attrs:{"label-width":"100px"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("el-form-item",{attrs:{label:"宽度(cm)"}},[n("el-input-number",{attrs:{placeholder:"宽",precision:2,min:.1},on:{change:a.ScaleWchange},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.sureScale.apply(null,arguments)}},model:{value:a.ScaleWidth,callback:function(t){a.ScaleWidth=t},expression:"ScaleWidth"}})],1)],1),n("el-form",{attrs:{"label-width":"100px"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("el-form-item",{attrs:{label:"高度(cm)"}},[n("el-input-number",{attrs:{placeholder:"高",precision:2,min:.1},on:{change:a.ScaleHchange},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.sureScale.apply(null,arguments)}},model:{value:a.ScaleHeight,callback:function(t){a.ScaleHeight=t},expression:"ScaleHeight"}})],1)],1),n("el-form",{attrs:{"label-width":"100px"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("el-form-item",{attrs:{label:"X(cm)"}},[n("el-input-number",{attrs:{placeholder:"X",step:.1,precision:2,min:0,max:a.MaxDesign},on:{change:a.ScaleXchange},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.sureScale.apply(null,arguments)}},model:{value:a.MoveX,callback:function(t){a.MoveX=t},expression:"MoveX"}})],1)],1),n("el-form",{attrs:{"label-width":"100px"},nativeOn:{submit:function(t){t.preventDefault()}}},[n("el-form-item",{attrs:{label:"Y(cm)"}},[n("el-input-number",{attrs:{placeholder:"Y",step:.1,precision:2,min:0,max:a.MaxDesign},on:{change:a.ScaleYchange},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.sureScale.apply(null,arguments)}},model:{value:a.MoveY,callback:function(t){a.MoveY=t},expression:"MoveY"}})],1)],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){a.showScale=!1}}},[a._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:function(t){return a.sureScale()}}},[a._v("确 定")])],1)],1),n("el-dialog",{attrs:{width:"900px",visible:a.drawerg,title:"生成渐变图",top:"40px"},on:{"update:visible":function(t){a.drawerg=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.Gradientloading,expression:"Gradientloading"}],staticStyle:{display:"flex","flex-direction":"row",position:"relative"}},[n("div",{staticClass:"vhtml",staticStyle:{width:"700px"},attrs:{id:"svghtml"},domProps:{innerHTML:a._s(a.GradientNew)}}),n("div",{staticStyle:{display:"flex","flex-direction":"column","margin-left":"20px"}},[n("div",{staticStyle:{display:"flex"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor1},on:{input:a.nativePickG1}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor1)+" ")])]),n("div",{staticStyle:{display:"flex","margin-top":"10px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor2},on:{input:a.nativePickG2}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor2)+" ")])]),n("div",{staticStyle:{display:"flex","margin-top":"240px","justify-content":"center"}},[n("el-button",{staticStyle:{background:"#000000",color:"white","font-size":"32px",width:"70%",height:"143%","border-radius":"50%"},attrs:{type:"big"},on:{click:function(t){return a.Gradientxml()}}},[n("i",{staticClass:"el-icon-refresh"})])],1),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"45px",right:"20px"},attrs:{type:"big"},on:{click:function(t){return a.svgToBase64image("svghtml")}}},[a._v("加入画布")]),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"0px",right:"20px"},attrs:{type:"big"},on:{click:function(t){return a.svgToBase64("svghtml")}}},[a._v("下载PNG")])],1)])])],1)},[function(){var t=this.$createElement,t=this._self._c||t;return t("div",[t("i",{staticClass:"el-icon-warning-outline icon"}),t("span",{staticStyle:{"margin-right":"7px"}}),this._v("绿色虚线范围内必须铺满，否则生产会留白。 ")])}],!1,null,"7a15ee64",null).exports),d=e("d662"),M=e.n(d),u={name:"Design",components:{ProductAnchor:i.a,ProductRecommend:a.a,diy:h,diys:r},props:{product:{type:Object,default:function(){return null}}},data:function(){return{res:[],simled:!1,category:[],XTUObj1:"",bigXTUObj1:"",psdsku_list:[],bigpsdsku_list:[],token:"",shilihua:0,category1:[{value:"",label:"全部"},{value:"0",label:"新品"},{value:"1",label:"促销"},{value:"2",label:"热卖"},{value:"3",label:"精品"}],level:[{value:"",label:"全部"},{value:"0",label:"v0"},{value:"1",label:"v1"},{value:"2",label:"v2"},{value:"3",label:"v3"}],productList:{},productDetail:{},currentArea:{},extends:{},extends1:{},sourceList:{},folderList:[],keywordList:[],imgLoading:!1,productLoding:!1,materiaLoding:!1,sizes:[],attr_id:0,initProductDetailPsd:[],vLoading:!1,currentId:null,srcList:[],colorIndex:0}},methods:{getProductcatelist:function(){var r=this;Object(k.k)().then(function(t){if(1===t.data.code){for(var e=t.data.data,i=[],a=0;a<e.length;a++){var n={};n.label=e[a].name,n.value=e[a].id,e[a].childlist&&(n.children=r.tree_childlist(e[a].childlist)),i.push(n)}r.category=i}})},tree_childlist:function(t){for(var e=[],i=0;i<t.length;i++){var a={};a.label=t[i].name,a.value=t[i].id,t[i].childlist&&(a.children=this.tree_childlist(t[i].childlist)),e.push(a)}return e},tree_childrens:function(t){for(var e=[],i=0;i<t.length;i++){var a={};a.label=t[i].title,a.value=t[i].id,0<t[i].children.length&&(a.children=this.tree_childrens(t[i].children)),e.push(a)}return e},productSearch:function(t){var e=this;this.productLoding=!0,Object(k.l)(t).then(function(t){1!==t.data.code||"暂无数据"==t.data.msg?e.productList={}:(e.productList=t.data.data,"18960442001"==e.cookie.get("username")&&e.productList.product_list.forEach(function(t){t.price="0.00"}),t.data.data.product_list[0]&&e.$refs.diys.productDown(t.data.data.product_list[0])),e.productLoding=!1})},materialSearch:function(t){var e=this;this.materiaLoding=!0,Object(k.m)(t).then(function(t){1==t.data.code?(e.materiaLoding=!1,e.sourceList=t.data.data):(e.sourceList={},e.materiaLoding=!1)})},getProductlist:function(){var e=this;this.productLoding=!0;Object(k.l)({name:"",cid:"",pageNumber:1,pageSize:20,tag:"",level:""}).then(function(t){1===t.data.code?("暂无数据"==t.data.msg?e.productList={}:(e.productList=t.data.data,"18960442001"==e.cookie.get("username")&&e.productList.product_list.forEach(function(t){t.price="0.00"})),e.$route.query&&e.$route.query.id?(e.currentId=e.$route.query.id,e.$refs.diys.quproductDown(e.$route.query)):"暂无数据"!=t.data.msg&&(e.currentId=t.data.data.product_list[0].id,e.$refs.diys.productDown(t.data.data.product_list[0]))):e.productList={},e.productLoding=!1})},quclickProduct:function(t){var a=this;this.productLoding=!0,this.currentId=t.id,this.colorIndex=0,this.extends={},this.extends1={},this.$refs.diys.dwarning=!1,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.$refs.diys.layerimages={},Object(k.h)(this.currentId).then(function(t){if(a.res=[],1==t.data.code)if(a.productDetail=t.data.data,a.sizes=t.data.data.attr_list[0].sizes,a.attr_id=t.data.data.attr_list[0].sizes[0].id,a.currentArea=t.data.data.design_list[0],a.psdsku_list=t.data.data.attr_list[0].svg_list,a.bigpsdsku_list=t.data.data.attr_list[0].big_sku_list,0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list),a.$route.query&&a.$route.query.size)a.productDetail.attr_list.forEach(function(t,i){t.sizes.forEach(function(t,e){t.id==a.$route.query.size&&(a.$refs.diys.productColorIndex=i,a.$refs.diys.productSizeIndex=e,a.qusetSizes(i,e,a.$route.query.id))})});else{for(var e=0;e<t.data.data.design_list.length;e++)a.res.push({name:t.data.data.design_list[e].templatelayer,content:""});a.imgLoading=!0,a.$refs.diys.save(),setTimeout(function(){a.$refs.diys.addRuler(a.$refs.diys.MaxDesign,a.$refs.diys.grid,1)},20)}else a.messageBox(t);a.productLoding=!1}),this.$emit("updateProduct")},clickProduct:function(t){var i=this;this.productLoding=!0,this.currentId=t.id,this.colorIndex=0,this.extends={},this.extends1={},this.$refs.diys.dwarning=!1,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.$refs.diys.layerimages={},Object(k.h)(this.currentId).then(function(t){if(i.res=[],1==t.data.code){i.productDetail=t.data.data,i.sizes=t.data.data.attr_list[0].sizes,i.attr_id=t.data.data.attr_list[0].sizes[0].id,i.currentArea=t.data.data.design_list[0],i.psdsku_list=t.data.data.attr_list[0].svg_list,i.bigpsdsku_list=t.data.data.attr_list[0].big_sku_list,0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list);for(var e=0;e<t.data.data.design_list.length;e++)i.res.push({name:t.data.data.design_list[e].templatelayer,content:""});i.imgLoading=!0,i.$refs.diys.save(),setTimeout(function(){i.$refs.diys.addRuler(i.$refs.diys.MaxDesign,i.$refs.diys.grid,1)},20)}else i.messageBox(t);i.productLoding=!1}),this.$emit("updateProduct")},qusetSizes:function(t,e,i){var a=this;this.imgLoading=!0,this.extends={},this.extends1={},this.res=[],this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,sessionStorage.clear(),this.$refs.diys.layerimages={},Object(k.f)(i,this.sizes[e].id).then(function(t){if(0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list),a.productDetail.design_list=t.data.data.design_list,a.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)a.res.push({name:t.data.data.design_list[e].templatelayer,content:""});a.psdsku_list=t.data.data.svg_list,a.bigpsdsku_list=t.data.data.big_sku_list,a.$refs.diys.save()}})},setSizes2:function(t,e){var i=this,a=(this.imgLoading=!0,this.extends={},this.extends1={},this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,JSON.parse(JSON.stringify(this.$refs.diys.layerimages))),n=[],r=JSON.parse(JSON.stringify(this.currentArea.templatelayer));this.productDetail.design_list.forEach(function(t){a[""+t.id]&&n.push({templatelayer:t.templatelayer,layerimage:a[""+t.id]})}),sessionStorage.clear(),this.$refs.diys.layerimages={},Object(k.f)(e,this.sizes[0].id).then(function(t){0==t.data.code&&i.$message.error(t.data.msg),1==t.data.code&&(0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list,i.$refs.diys.cutpiece()),i.productDetail.design_list=t.data.data.design_list,i.productDetail.design_list.forEach(function(e){e.templatelayer==r&&(i.currentArea=e),n.forEach(function(t){t.templatelayer==e.templatelayer&&(i.$refs.diys.layerimages[""+e.id]=t.layerimage,sessionStorage.setItem(e.id,JSON.stringify(t.layerimage)))})}),i.psdsku_list=t.data.data.svg_list,i.bigpsdsku_list=t.data.data.big_sku_list,i.$refs.diys.save())})},setColor2:function(t,e,i){var a=this;this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,Object(k.f)(i,this.sizes[t].id).then(function(t){0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code&&(0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list,a.$refs.diys.cutpiece()),a.productDetail.design_list=t.data.data.design_list,a.$refs.diys.curDesign(t.data.data.design_list[0],0,!0),a.psdsku_list=t.data.data.svg_list,a.bigpsdsku_list=t.data.data.big_sku_list,a.$refs.diys.save())})},setSizes:function(t,e){var i=this,a=(this.imgLoading=!0,this.extends={},this.extends1={},this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,JSON.parse(JSON.stringify(this.$refs.diys.layerimages))),n=[],r=JSON.parse(JSON.stringify(this.currentArea.templatelayer));this.productDetail.design_list.forEach(function(t){a[""+t.id]&&n.push({templatelayer:t.templatelayer,layerimage:a[""+t.id]})}),sessionStorage.clear(),this.$refs.diys.layerimages={},Object(k.f)(e,this.sizes[0].id).then(function(t){0==t.data.code&&i.$message.error(t.data.msg),1==t.data.code&&(0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list),i.productDetail.design_list=t.data.data.design_list,i.productDetail.design_list.forEach(function(e){e.templatelayer==r&&(i.currentArea=e),n.forEach(function(t){t.templatelayer==e.templatelayer&&(i.$refs.diys.layerimages[""+e.id]=t.layerimage,sessionStorage.setItem(e.id,JSON.stringify(t.layerimage)))})}),i.psdsku_list=t.data.data.svg_list,i.bigpsdsku_list=t.data.data.big_sku_list,i.$refs.diys.save())})},setColor:function(t,e,i){var a=this;this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,Object(k.f)(i,this.sizes[t].id).then(function(t){0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code&&(0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list),a.productDetail.design_list=t.data.data.design_list,a.$refs.diys.curDesign(t.data.data.design_list[0],0,!0),a.psdsku_list=t.data.data.svg_list,a.bigpsdsku_list=t.data.data.big_sku_list,a.$refs.diys.save())})},emptyC:function(){this.res.forEach(function(t,e){t.content=""}),this.$refs.diys.shilihua=0,this.extends1={},this.$refs.diys.layerimages={}},newSize:function(){var a=this,t=JSON.parse(JSON.stringify(this.res));this.res.forEach(function(t,e){t.content=""}),this.productDetail.design_list.forEach(function(i){a.$refs.diys.layerimages[""+i.id]&&t.forEach(function(t,e){t.name==i.templatelayer&&(a.res[e].content=t.content)})})},DesignTemp:function(t){this.shilihua=this.$refs.diys.shilihua,this.$refs.diys.layerLength=!0,0==this.shilihua&&(this.imgLoading=!0),this.extends1[""+t[1].id]=t[3];var e=0;this.$refs.diys.layerLength=!1;for(var i=0;i<this.res.length;i++)this.res[i].name==t[1].templatelayer&&(this.res[i].content=t[4],e=i);this.asyncCall(this.res,e)},setCurrentArea:function(t,e){this.currentArea=t},asyncCall:function(a,n){var r=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var i,e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0==(i=r).shilihua)return""!=r.XTUObj1&&(r.XTUObj1.destroy(),r.XTUObj1.qinchurul()),e=document.body.style.zoom||1,e=(1/e).toFixed(3),document.getElementById("xtu").style.zoom=e,r.XTUObj1="",r.bigXTUObj1="",r.shilihua=1,r.$refs.diys.shilihua=1,t.next=15,new Promise(function(t){var e=new M.a("xtu",{psdSkus:r.bigpsdsku_list,Autoken:z.a.get("token"),token:z.a.get("token"),onload:function(){i.$route.query&&i.$route.query.pic&&0==i.simled&&(i.$refs.diys.moren(i.$route.query.pic,i.$route.query.pic+"?imageView2/2/w/1200/h/1200"),i.simled=!0),a.forEach(function(t){e.changet({image:t.content,layers:t.name})}),t(e),this.imgLoading=!1}})});t.next=16;break;case 15:r.XTUObj1=t.sent;case 16:if(""!=r.XTUObj1)return t.next=19,r.XTUObj1.changet({image:a[n].content,layers:a[n].name});t.next=19;break;case 19:r.imgLoading=!1;case 20:case"end":return t.stop()}},t)}))()},getMaterial:function(){var e=this;this.materialLoding=!0;Object(k.m)({userId:"",fid:"",pageNumber:1,pageSize:20,name:"",keywords:""}).then(function(t){1==t.data.code?e.sourceList=t.data.data:e.sourceList={},e.materialLoding=!1})},addCar:function(t,e,i,a){var n,r,s=this,o=(a.join(","),a=a.toString(),{}),t=(this.$refs.diys.self_adaption?(n={},r=[],this.productDetail.attr_list[this.$refs.diys.productColorIndex].sizes.forEach(function(t){t.attr_list.forEach(function(t){r.push(t)})}),this.productDetail.all_design_list=Object(l.a)(new Set(r.map(JSON.stringify))).map(JSON.parse),this.productDetail.all_design_list.length==this.productDetail.design_list.length?(this.$message.warning("该产品非尺码独立设计图"),this.$refs.diys.self_adaption=!1,o=this.$refs.diys.layerimages):(this.productDetail.design_list.forEach(function(t){s.$refs.diys.layerimages[""+t.id]&&(n[t.templatelayer]=JSON.parse(JSON.stringify(s.$refs.diys.layerimages[""+t.id])))}),this.productDetail.all_design_list.forEach(function(i){n[i.templatelayer]&&(o[""+i.id]=JSON.parse(JSON.stringify(n[i.templatelayer])),null!=i.shiftx)&&null!=i.shifty&&s.productDetail.design_list.forEach(function(e){e.templatelayer==i.templatelayer&&o[""+i.id].forEach(function(t){(null!=t.image&&0==t.putu||null!=t.text)&&(t.x=t.x+Number(i.shiftx-e.shiftx),t.y=t.y+Number(i.shifty-e.shifty))})})}))):o=this.$refs.diys.layerimages,{product_id:this.currentId,attr_id:t,num:e.num,extends:JSON.stringify(this.$refs.diys.layerimages),other_extends:JSON.stringify(o),source_ids:a,self_adaption:this.$refs.diys.self_adaption?1:0});Object(k.b)(t).then(function(t){1!=t.data.code&&s.messageBox(t)}),setTimeout(function(){s.$message.success("保存成功")},1500)},saveCanvas:function(t,e,i){var a,n,r=this,s=(i.join(","),i=i.toString(),{}),t=(this.$refs.diys.self_adaption?(a={},n=[],this.productDetail.attr_list[this.$refs.diys.productColorIndex].sizes.forEach(function(t){t.attr_list.forEach(function(t){n.push(t)})}),this.productDetail.all_design_list=Object(l.a)(new Set(n.map(JSON.stringify))).map(JSON.parse),this.productDetail.all_design_list.length==this.productDetail.design_list.length?(this.$message.warning("该产品非尺码独立设计图"),this.$refs.diys.self_adaption=!1,s=this.$refs.diys.layerimages):(this.productDetail.design_list.forEach(function(t){r.$refs.diys.layerimages[""+t.id]&&(a[t.templatelayer]=JSON.parse(JSON.stringify(r.$refs.diys.layerimages[""+t.id])))}),this.productDetail.all_design_list.forEach(function(i){a[i.templatelayer]&&(s[""+i.id]=JSON.parse(JSON.stringify(a[i.templatelayer])),null!=i.shiftx)&&null!=i.shifty&&r.productDetail.design_list.forEach(function(e){e.templatelayer==i.templatelayer&&s[""+i.id].forEach(function(t){(null!=t.image&&0==t.putu||null!=t.text)&&(t.x=t.x+Number(i.shiftx-e.shiftx),t.y=t.y+Number(i.shifty-e.shifty))})})}))):s=this.$refs.diys.layerimages,{product_id:this.currentId,attr_id:t,extends:JSON.stringify(this.$refs.diys.layerimages),other_extends:JSON.stringify(s),source_ids:i,is_online:0,self_adaption:this.$refs.diys.self_adaption?1:0});Object(k.r)(t).then(function(t){1!=t.data.code&&r.messageBox(t)}),setTimeout(function(){r.$message.success("保存成功")},1500)},getFolderlist:function(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Object(k.g)(t).then(function(t){if(1===t.data.code){for(var e=t.data.data,i=[],a=0;a<e.length;a++){var n={};n.label=e[a].title,n.value=e[a].id,0<e[a].children.length&&(n.children=r.tree_childrens(e[a].children)),i.push(n)}r.folderList=i}})},getKeywordlist:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Object(k.i)(t).then(function(t){1==t.data.code&&(e.keywordList=t.data.data)})},setAttrId:function(t){this.attr_id=t},deletImg:function(i){this.productDetail.attr_list[0].templates.forEach(function(t,e){e!=i&&(t.url=" ")})},getBigImgs:function(t){},openBigImg:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.XTUObj1.getImg();case 2:e=t.sent,a.productDetail.attr_list[i.colorIndex].templates=e,a.$refs.diys.popShow=!a.$refs.diys.popShow;case 5:case"end":return t.stop()}},t)}))()}},created:function(){this.getProductcatelist(),this.getProductlist(),this.getFolderlist(),this.getKeywordlist()}},f=(e("31fb"),Object(g.a)(u,function(){var e=this,t=e.$createElement,t=e._self._c||t;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.vLoading,expression:"vLoading"}],staticClass:"design"},[e._v(" "+e._s(e.product)+" "),t("diys",{ref:"diys",attrs:{category:e.category,category1:e.category1,level:e.level,productList:e.productList,productDetail:e.productDetail,currentArea:e.currentArea,res:e.res,imgLoading:e.imgLoading,sourceList:e.sourceList,folderList:e.folderList,keywordList:e.keywordList,productLoding:e.productLoding,materiaLoding:e.materiaLoding,sizes:e.sizes,attr_id:e.attr_id,currentId:e.currentId,initProductDetailPsd:e.initProductDetailPsd},on:{clickProduct:e.clickProduct,quclickProduct:e.quclickProduct,getDesignTemp:function(t){return e.DesignTemp(arguments)},emptyC:e.emptyC,newSize:e.newSize,setCurrentArea:e.setCurrentArea,getMaterial:e.getMaterial,productSearch:e.productSearch,materialSearch:e.materialSearch,addCar:e.addCar,saveCanvas:e.saveCanvas,setAttrId:e.setAttrId,deletImg:e.deletImg,setSizes:e.setSizes,setColor:e.setColor,setSizes2:e.setSizes2,setColor2:e.setColor2,getBigImgs:e.getBigImgs,openBigImg:e.openBigImg,getFolderlist:e.getFolderlist,getKeywordlist:e.getKeywordlist}})],1)},[],!1,null,"c3e4b272",null));t.default=f.exports},5096:function(t,e,i){"use strict";i("1c0d")},5449:function(t,e,i){"use strict";i("0837")},5636:function(t,e,i){t.exports=i.p+"img/21-21.ca1bd243.png"},"563f":function(t,e,i){"use strict";i("c776")},5886:function(t,e,i){"use strict";i("7a38")},"5a79":function(t,e,i){"use strict";i("0d66")},"60b8":function(t,e,i){t.exports=i.p+"img/13-13.9a640c77.png"},"66b1":function(t,e,i){},7220:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAALSklEQVR4AeXBz6+l90Ef4Odz7r2Ox3ZiT1LFUezxKtmgRqkEacO7QWzYtTu2LEBiywKdVuIPaCWOWLBFFQu27PK9KzaoqvRiShZUQWxAGTttJFMcosT2Hc/Y93x6znnvnTue3Ens/AJ8nydjnH6B/krS38a/J/Zqpz7WIqjyvyp/JP0fGeP0t+jLSb+MO23eR1H/qsWV+qDYSQg9xv+p/O/G/83p6elftv120r/BN9q8ibdxhJVLQX1cbHGO5xL/Rn2p8m/pSzk9Pa326+L38aetRSzqSlAfIyFof538Z/pLOT09rfZV8Xvlz9UiFrWIRX1MxKJ2fpX8V/rVnJ6Oqr8Qv9P6K4uIulQfR0EtviL5Q/rLOR2jmMXvllfVIhZ1E3xV8gd0yhijmBNrzLVTBHVTTGKDKWOM0lmyxmyvCOqmmLDBlDFG6SxZY1aLWNRNMGGDKWOM0lmyxmyviEXdBBM2mDLGKGaxxmyvPrIi/tWasMGUMUYxizVme0VQN8WEDaaMMYpZrDF7VN0UE9nQKeN0VM1ijdle3SBBJ7KRThljFLNYY7ZXN0jQiWzolDFGMYs1Znt1MwS1N5ENnTLGKOYk6+psrz7+YlF7E9lIp4zTUTUnWdO5dupmiJ3QTpINnTLGKOYka8y107oRYifoRDZ0yhijmJOs6dz66OJKPRQ/O3WNoD6cWNTeJNnQKWOcNjpL1nRu/VTEz0ddSFBqEYu6EpSEulB7k2RDp4zT0dQsWdOZaOufSyyKuFJXgiKoCwmtDwixqEUs6kLtTUk21SljjCZmsqYz0ZagBPUj1IW6VItY1CIWRfwEEosirhWLIh6KS1E77STZ0CljjCZmsqazC61rtRYhrrR2KnZKLRIHtYhFLWJRxEcUFyJxIai6UMRDKeKh2qlJsqFTxhiNzGJNZ4Laa+0EdSXEB9VOEZT6oHgoFrWIRRVxpS4F9SSRIBEXStWlIihSxEN1MJENnTLGaJglazWLh6rUIg4iVkdHVgmJiKq9oLVTj0t8KC2xkyLauhTUB7UlROy11dZ2u1XEXuxVqYPEQWtvkmzolDFGwyxZa2dCHFSpRRwkK6tVnL9/7ny7tVodWVRbl5I4aB0EtVOPqkUsinhMUAdVitiJtqgklO22jo+PJfG4ti4lDmqnJsmGThljNMySdduZoB5VxE5I4sH997z5nTe99dbbVqtVdpqEVtFWQixaEk/UkjioRVxIaEk8KkhC2G63IkiyWvUzn/6M5z75rNVqRYuqnVqEWNROTZINnTLGaJjLGrMfYrWKo6Nj77xz5u7db/rOd/7JJ57+hNXqSJLjyFP0qbZH6I4IsVOL+LDqSlwIai84T/Lettv72/Pt+zuSlZdeesmLn3vRUyfH2q291pUQizqYyIZOGWMUc1iX2Q+xWsXx8Yl79+65e/duvve97/e5Tz7naLWy3fb5tp8Tt9WzOO+OhFZcKeJS7FU9Se20Yie0glWSs9Vq9d22b4jvPXjwnnfffddnP/vZvPzyS33q+MT59tx1Ege1U5NkQ6eMMYo5rMvsGkVUVnF8fOL+u/fdvfuad955J88++8yR5Avd9sttf0F8Sj2NLbauUztFCOpKUDtFFEmpRVArrCTvJt5q/W2Svz7fnv/9vbOz89u3P907d+44OTl2fr5FKWIRB0Ht1CTZ0CljjGIO6zK7RhFkxcnxiXv33vXaa6975+zs1q1bT3+u7a/hP2p/Ee9ji/qwapGg1CLUIn5AsCIn1a+Hr51vt392/8GDf3jh+RfuvXLnjpPjY9vtuXpMiEUdTGRDp4wxijmsy+wxtQhWqzg+PnJ2ds9rr3/L2dnZp27devqL6jfa/mb1OTvxqPjpKEIcxKVo+zb+eNv+yf379//u+U89//1XXnnFyfGJ7fZc1aKIvcRBHUxkgyljjGIOa8z1QVWXjlYrx8fHzs7OvPb6t5ydnX3q1q2nv9j2N9RvVp9LLGqROCjiSl0vFvWYOoidSEuCaPs2/ni73f7J/fv3/+7555///iuvvOKpk6ecn59r66EgHjeRDZ0yxijmsC6zx9Re7R0drZwcn3jn7Mxrr73unbffuXXrmVsvan+t7X/CLyXewxa1lzioh4pY1JWg6lJEFRH1mERWkpO2X8fYbrd/dv/+/TdeeP6Fe3deuePk5MT2/Fzt1CKIRwSdyIZOGWMUc1iX2TWKYLWKk5MT9+6965t3X/fWW2/l2WefOQpfaP078QvRT+JpssWWkjgoVYtY1CIWdSWovQhBa2dFVng3vFX9W/z1+fn27+/fv3/+6du3+/LLLzs6PrbdnqMIahHiURPZ0CljjGIO6zK7Ru20Vqs4eeop79571zfvvp5/+u53+9yzzzg6PpZ6Hp+r3qbPRLZolSJx0FqEoPVQHLSVBEEtIvZqJ2RFzuh3t92+of3ee++978GDB1588cXcufNyj1ZHzs/ft1d7tYiDuDSRDaaMMYo5rDHXhXioLWW1iuOTEw8evOfu3de88cY/+MQnnnJ8fGyVHOMTbU+qR6lKVCmxk/hBtYi9qtiLvdorRRxERJJVzul75+fn97vt++fn72vr85//vM+/9JLj42Pb83Nt1TViUZNkQ6eMMYo5rMvsUjzUopVwdHKi2/rH//eP3nzzTVmtkqhtVamD2EkchNRB7dUiqvZiUTutRVRdib0gidVqJasIghL09u3bXnjhtuPjI+fbrbZ+hIlspFPGGMWMNWaXYlGKoCqJVVa229qebwlabWkJsZPYizgILVoHCUotYlE7JdF6KKGIRRKEkJBEt7Xdbh0drRwdH2tru92qnRbxBBPZ0CljjGLGGrNLsShFEm21dbRaWa2OJCurlYMI6qCIg4iDOIjYq9qLOAgtsVdC7TQoobVoiZ1oa6+qrZRtt1raolo7RTzBJNnQKWOMYsYas0fFooiHImqniIME9YhaxF5QJLEoRWJRT1IX6qBIfEBbe6tE7bRaO0X8CJNkQ6eMMYoZa8weFdQiLsRBqZKg1GNqEXtxpYhaxKL2Kvaiai8WtYiHQuwFdSmirY9gkmzolDFGMYd1mT0qqCeIqiern5a6XlyKS/FDxJV61EQ20iljjGIOa8x26kJQT1SX6kpcrxaxqA+jCOoHxfViLw7ievWoiWykU8YYDTPWmF2onbhSxJPVIihiUYu4UgR1JRa1CK0nih8hFnUlqOtMZCOdMsZomLHG7EI9QVwjqEVcrxSJg9ZDcaUWQf28TGRDp4wxijmsMQtKXSMo4kOKRf3YahHUz8qEDaaMMRpmscbsQu3Ujy8WtYhFLWJRi1jUIhb1sxPU3kQ2dMrpGMUs1phdqJ36yQS1iEUtYlGLuF79PExkQ6eMMRpmscZsrzQW9dMRiyI+uvrJxZUiFjWRDZ0yxijmsMZc/8xiUT97Qe1N2GDKGKOYwxpz/QsQV+rnYSIbOmWMUcxYY3bjBJ3Ihk4ZY5TOZI3ZTZPQTmRDp4zxtWKWrNXsJomd0E5kQ6eM8bVilqzV7CZJqJ1OZEOnjDFK5yRrzK0bJuiEDaaMMUrnJGvMrRsm6IQNpowxSucka8y1UzfNhA2mjDGKOfG7eLUeUTfFV8UfqCljjOIvEr+Dv2rtBfXxFtRefAV/iF/OGKN4Vfxe+PPaKWJRH2+x96v4b/gPGaen1X5d/H7407pGLYJ6sqCuBHUlqEUs6kpQV4J6sqCuBPXj+HX8F/qLGaenf0m/jb8J3yhv4u1wVFZqEYtaxKIWsahFLGoRi1rEohaxqEUs6sOJRX0YW5zjOXwGX8KX6Ms5PT39Le2dxpfVHbyPrWjQ+rgKDY7It/ANfDunY3wRv1J+G19xKRZ1JagrQf3LEIv6CKqIvEr+e+J//n/AHf3BZgx/KAAAAABJRU5ErkJggg=="},"75c4":function(t,e,i){t.exports=i.p+"img/20-20.0bef1dcb.png"},7751:function(t,e,i){},"7a38":function(t,e,i){},"7b92":function(t,e,i){},"83ae":function(t,e,i){t.exports=i.p+"img/lvjing-1.2c82d05d.png"},"841c":function(t,e,i){"use strict";var a=i("d784"),s=i("825a"),o=i("1d80"),l=i("129f"),c=i("14c3");a("search",function(a,n,r){return[function(t){var e=o(this),i=null==t?void 0:t[a];return void 0!==i?i.call(t,e):new RegExp(t)[a](String(e))},function(t){var e,i=r(n,this,t);return i.done?i.value:(i=s(this),t=String(t),e=i.lastIndex,l(e,0)||(i.lastIndex=0),t=c(i,t),l(i.lastIndex,e)||(i.lastIndex=e),null===t?-1:t.index)}]})},"85fa":function(t,e,i){t.exports=i.p+"img/qingxihua-1.81ab60c0.png"},"86d7b":function(t,e,i){t.exports=i.p+"img/5-5.b613601a.png"},8893:function(t,e,i){t.exports=i.p+"img/7-7.80c72fa5.png"},"8f90":function(t,e,i){"use strict";i("2abd")},"91ce":function(t,e,i){t.exports=i.p+"img/9-9.5c1b29dc.png"},"96f1":function(t,e,i){},"978b":function(t,e,i){"use strict";i("0581")},"9a59":function(t,e,i){},"9cf2":function(t,e,i){t.exports=i.p+"img/18-18.4a8097b0.png"},a15b:function(t,e,i){"use strict";var a=i("23e7"),n=i("44ad"),r=i("fc6a"),i=i("a640"),s=[].join,n=n!=Object,i=i("join",",");a({target:"Array",proto:!0,forced:n||!i},{join:function(t){return s.call(r(this),void 0===t?",":t)}})},a60c:function(B,t,e){"use strict";e.d(t,"I",function(){return i}),e.d(t,"F",function(){return a}),e.d(t,"i",function(){return r}),e.d(t,"J",function(){return s}),e.d(t,"G",function(){return o}),e.d(t,"k",function(){return l}),e.d(t,"l",function(){return c}),e.d(t,"m",function(){return d}),e.d(t,"H",function(){return u}),e.d(t,"N",function(){return h}),e.d(t,"u",function(){return g}),e.d(t,"r",function(){return f}),e.d(t,"t",function(){return m}),e.d(t,"v",function(){return p}),e.d(t,"C",function(){return y}),e.d(t,"K",function(){return v}),e.d(t,"A",function(){return b}),e.d(t,"q",function(){return w}),e.d(t,"w",function(){return x}),e.d(t,"E",function(){return k}),e.d(t,"M",function(){return A}),e.d(t,"j",function(){return I}),e.d(t,"p",function(){return S}),e.d(t,"O",function(){return C}),e.d(t,"D",function(){return _}),e.d(t,"x",function(){return E}),e.d(t,"s",function(){return O}),e.d(t,"n",function(){return L}),e.d(t,"z",function(){return D}),e.d(t,"o",function(){return T}),e.d(t,"S",function(){return P}),e.d(t,"R",function(){return z}),e.d(t,"T",function(){return j}),e.d(t,"c",function(){return H}),e.d(t,"b",function(){return $}),e.d(t,"a",function(){return Z}),e.d(t,"y",function(){return M}),e.d(t,"B",function(){return R}),e.d(t,"U",function(){return N}),e.d(t,"Q",function(){return J}),e.d(t,"e",function(){return F}),e.d(t,"L",function(){return X}),e.d(t,"P",function(){return Q}),e.d(t,"X",function(){return G}),e.d(t,"V",function(){return Y}),e.d(t,"W",function(){return W}),e.d(t,"h",function(){return V}),e.d(t,"f",function(){return U}),e.d(t,"g",function(){return q}),e.d(t,"d",function(){return K});var n=e("1bab");function i(){return Object(n.b)({url:"/orders/getTemplate"})}function a(t){return Object(n.b)({url:"/orders/orderImport",method:"post",data:t})}function r(t){return Object(n.b)({url:"/amazon/orderImport",method:"post",data:t})}function s(t){return Object(n.b)({url:"/orders/getlist",params:t})}function o(){return Object(n.b)({url:"/orders/statistics"})}function l(t){return Object(n.b)({url:"/orders/associatedFinishedList",params:t})}function c(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return Object(n.b)({url:"/orders/chooseAssociated",method:"post",data:{union_id:t,finished_id:e,is_forever:i}})}function d(t){return Object(n.b)({url:"/orders/copyOrders",method:"post",data:{id:t}})}function u(t){return Object(n.b)({url:"/orders/cancel",method:"post",data:{order_ids:t}})}function h(t){return Object(n.b)({url:"/orders/update",method:"post",data:t})}function g(t,e,i,a){return Object(n.b)({url:"/orders/getLogisticsByOrdersId",method:"post",data:{country:t,province:e,city:i,orders_id:a}})}function f(t){return Object(n.b)({url:"/orders/getFinishBySku",params:{key_id:t}})}function m(t,e,i,a){return Object(n.b)({url:"/orders/getLogistics",params:{country:t,province:e,city:i,cartids:a}})}function p(t){return Object(n.b)({url:"/orders/getLogisticsEditList",params:{order_id:t}})}function y(t,e){return Object(n.b)({url:"/orders/logisticsEdit",method:"post",data:{order_id:t,logistics_id:e}})}function v(t){return Object(n.b)({url:"/orders/ordersPayment",method:"post",data:t})}function b(t){return Object(n.b)({url:"/alipress/get_service_names"})}function w(){return Object(n.b)({url:"/orders/getAllLogistics"})}function x(t){return Object(n.b)({url:"/orders/getLogisticsMutiEditList",method:"post",data:t})}function k(t){return Object(n.b)({url:"/orders/logisticsMutiEdit",method:"post",data:t})}function A(t){return Object(n.b)({url:"/orders/progress",params:{id:t}})}function I(t){return Object(n.b)({url:"/orders/applyaftersale",method:"post",data:t})}function S(t){return Object(n.b)({url:"/orders/getAftersaleList",params:t})}function C(t){return Object(n.b)({url:"/orders/resume",params:t})}function _(t,e){return Object(n.b)({url:"/orders/logisticsExport",method:"post",data:{order_ids:t,type:e}})}function E(t){return Object(n.b)({url:"/tk_design/getOrdersByThirdNo",method:"post",data:{third_no:t}})}function O(t){return Object(n.b)({url:"/tk_design/getInfoByUnionid",method:"post",data:{union_id:t}})}function L(t){return Object(n.b)({url:"/tk_design/createNewFinishedAndBind",method:"post",data:t})}function D(t){return Object(n.b)({url:"/Shopee/getShippingParameter",params:t})}function T(t){return Object(n.b)({url:"/Shopee/gelShippingDocument",params:t})}function P(t){return Object(n.b)({url:"/Shopee/synorder",params:t})}function z(){return Object(n.b)({url:"/Tkjtshop/stockupOrders",method:"post"})}function j(t){return Object(n.b)({url:"/Shopifyshop/syn_order",params:t})}function H(){return Object(n.b)({url:"/Jushuitan/syn_order"})}function $(){return Object(n.b)({url:"/Jushuitan/syn_skusn_ewm"})}function Z(){return Object(n.b)({url:"/Jushuitan/syn_skusn"})}function M(t){return Object(n.b)({url:"/lzd/getShipmentProvider",params:t})}function R(t){return Object(n.b)({url:"/temu/logisticsCompanies",params:{order_id:t}})}function N(t){return Object(n.b)({url:"/temu/warehouseList",params:{order_id:t}})}function J(t,e){return Object(n.b)({url:"/temu/shippingServices",params:{order_id:t,warehouse_id:e}})}function F(t,e,i){return Object(n.b)({url:"/temu/addToShipOrderStaging",method:"post",data:{store_id:t,third_no:e,order_id:i}})}function X(t){return Object(n.b)({url:"/orders/ordersPaymentOnline",method:"post",data:t})}function Q(t){return Object(n.b)({url:"/orders/settleCartsOnline",method:"post",data:t})}function G(t){return Object(n.b)({url:"/wxpay/orderpay",method:"post",data:{id:t}})}function Y(t){return Object(n.b)({url:"/wxpay/cartpay",method:"post",data:t})}function W(t){return Object(n.b)({url:"/wxpay/checkOrderPay",method:"post",data:{no:t}})}function V(t){return Object(n.b)({url:"/pay/orderpay",method:"post",data:{id:t}})}function U(t){return Object(n.b)({url:"/pay/cartpay",method:"post",data:t})}function q(t){return Object(n.b)({url:"/pay/checkOrderPay",method:"post",data:{no:t}})}function K(t){return Object(n.b)({url:"/Shein/Sheinlogistics"})}},b532:function(t,e,i){t.exports=i.p+"img/1-1.e3365bb9.png"},b7d9:function(t,e,i){"use strict";i("ed73")},b8a0:function(t,e,i){"use strict";i("e89d")},c12c:function(t,e,i){"use strict";i("3777")},c776:function(t,e,i){},c9c6:function(t,e,i){"use strict";i("7b92")},caad:function(t,e,i){"use strict";var a=i("23e7"),n=i("4d64").includes,i=i("44d2");a({target:"Array",proto:!0},{includes:function(t){return n(this,t,1<arguments.length?arguments[1]:void 0)}}),i("includes")},cc20:function(B,t,e){"use strict";e.r(t);var o=e("1da1"),i=(e("96cf"),e("b0c0"),e("159b"),e("b680"),e("d3b7"),e("a15b"),e("25f0"),e("1321")),a=e("2515"),l=e("ade3"),s=e("2909"),c=(e("d81d"),e("4e82"),e("a434"),e("a9e3"),e("8a5a")),n=e("7212"),r=(e("bbe3"),e("6d3b")),d=e("b42f"),u=e("8343");r.a.use([d.a,u.a]);var h={components:{Swiper:n.Swiper,SwiperSlide:n.SwiperSlide},data:function(){var t=this;return{c:null,ctx:null,dragArr:[],checkClickArea:[],swipeOptions:{initialSlide:0,speed:500,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}},swiperOptions1:{initialSlide:0,speed:500,on:{slideChange:function(){t.active=t.$refs.redefineSwipe1.$swiper.activeIndex}}},active:0,popShow:!1,num:1,product:{search:"",radio:"1"},buttons:["产品","素材","背景","图片"],buttonIndex:0,typeButton:["分类","类别","等级"],typeArr:[{name:"北京",children:[{name:"海淀区",children:[{name:"1环",children:[{name:"10环"},{name:"11环"}]},{name:"2环"}]},{name:"朝阳区"}]},{name:"浙江",children:[{name:"杭州"},{name:"宁波"}]},{name:"广东",children:[{name:"1环"},{name:"2环"}]}],pickShow:!1,pickShow1:!1,pickShow2:!1,pickShow3:!1,mouseIndex:-1,imgList:[e("ae45"),e("65ba"),e("ae45"),e("65ba"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("ae45"),e("65ba"),e("ae45"),e("ae45"),e("ae45")],curImgList:[e("ae45"),e("ae45")],imgIndex:-1,curimgIndex:0,scrollImg:1}},watch:{active:function(t){this.$refs.redefineSwipe1.$swiper.slideTo(t)}},methods:(h={swiperNext:function(){this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex+2},swiperPrev:function(){this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex},setButton:function(t){3==t?this.$refs.file.click():this.buttonIndex=t},enter:function(t){this.mouseIndex=t,0!=this.typeArr.length&&(this.pickShow=!this.pickShow)},leave:function(){this.mouseIndex=-1,this.pickShow=!this.pickShow},pickImg:function(t){this.imgIndex=t},curImgIndex:function(t){this.curimgIndex=t},handleBlur:function(){null==this.num&&(this.num=1)},popSwiper:function(t){this.active=t},openPop:function(){this.popShow=!this.popShow},closePop:function(){this.popShow=!this.popShow},addImage:function(t){var r=this,t=t.target.files[0],e=new FileReader;e.readAsDataURL(t),e.onload=function(t){var i,a,n=new Image;n.src=t.target.result,n.onload=function(t){i=n.width,(a=n.height)<i?(e=i/600,i=600,a/=e):(e=a/600,a=600,i/=e);var e={url:n,width:i,height:a};r.dragArr.push(new c.a(e,r.ctx)),r.draw()}}},draw:function(){this.ctx.clearRect(0,0,this.c.width,this.c.height),this.dragArr.forEach(function(t){t.paint()})},start:function(t){var a=this,n=(this.clickedkArr=[],t.offsetX),r=t.offsetY,t=(this.dragArr.forEach(function(t,e){var i=t.isInWhere(n,r);t.place=i,t.index=e,t.selected=!1,i&&a.checkClickArea.push(t)}),this.checkClickArea.length);if(0<t){t=this.checkClickArea[t-1];if(t.index=Math.max.apply(Math,Object(s.a)(this.dragArr.map(function(t){return t.index})))+1,this.dragArr.sort(function(t,e){return t.index-e.index}),"del"===t.place)return this.dragArr.splice(t.index-1,1),void this.draw();t.selected=!0,this.lastImg=t,this.initial={initialX:t.x,initialY:t.y,initialH:t.h,initialW:t.w,initialRotate:t.rotate,initialPointList:t.pointList}}this.draw(),this.startTouch={startX:n,startY:r}},move:function(t){var e,i,a,n,r,s,o,l,c;0<this.checkClickArea.length&&(e=this.lastImg,t.clientX,t.clientY,i=(a=this.startTouch).startX,a=a.startY,l=(c=this.initial).initialX,c=c.initialY,n=e.centerX,r=e.centerY,this.initial.initialRotate,s=(o=this.initial).initialH,o=o.initialW,"move"==e.place?(e.x=l+(t.offsetX-i),e.y=c+(t.offsetY-a)):"rotate"==e.place?(l=Math.atan2(a-r,i-n),(c=180*(Math.atan2(t.offsetY-r,t.offsetX-n)-l)/Math.PI)<0&&(c-=360),e.rotate=c):"transform"==e.place&&(l=Math.sqrt(Math.pow(n-i,2)+Math.pow(r-a,2)),c=Math.sqrt(Math.pow(n-t.offsetX,2)+Math.pow(r-t.offsetY,2))-l,o<s?(e.h=s+c,e.w=o+o/s*c):s==o?(e.h=s+c,e.w=o+c):(e.w=o+c,e.h=s+s/o*c)),this.draw())},up:function(){var t=this.lastImg,e=this.lastImg,i=e.place,a=e.rotate,n=e.centerX,r=e.centerY,s=(e.x,e.y,e.pointList),e=e.oldAngle;null==t?this.clickedkArr=[]:("move"==i?t.calculate():"rotate"==t.place?(e=360-(a-e),this.lastImg.oldAngle=a,a={x:n,y:-1*r},(n={x:0,y:0}).x=s[0].x,n.y=-1*s[0].y,r=this.XY(n,a,e),s[0].x=r.x,s[0].y=r.y,n.x=s[1].x,n.y=-1*s[1].y,r=this.XY(n,a,e),s[1].x=r.x,s[1].y=r.y,n.x=s[2].x,n.y=-1*s[2].y,r=this.XY(n,a,e),s[2].x=r.x,s[2].y=r.y,n.x=s[3].x,n.y=-1*s[3].y,r=this.XY(n,a,e),s[3].x=r.x,s[3].y=r.y):"transform"==i&&t.ratio(),this.checkClickArea=[])}},Object(l.a)(h,"leave",function(){}),Object(l.a)(h,"XY",function(t,e,i){var a=(t.x-e.x)*Math.cos(i*Math.PI/180)-(t.y-e.y)*Math.sin(i*Math.PI/180)+e.x,t=(t.x-e.x)*Math.sin(i*Math.PI/180)+(t.y-e.y)*Math.cos(i*Math.PI/180)+e.y;return t*=-1,{x:Number(a.toFixed(2)),y:Number(t.toFixed(2))}}),h),mounted:function(){var t=document.getElementById("myCanvas");(this.c=t).width=600,t.height=600,this.ctx=t.getContext("2d")}},g=(e("563f"),e("2398"),e("2877")),h=Object(g.a)(h,function(){var i=this,t=i.$createElement,a=i._self._c||t;return a("div",{staticClass:"diy"},[a("div",{directives:[{name:"show",rawName:"v-show",value:!i.popShow,expression:"!popShow"}],staticClass:"left"},[a("div",{staticClass:"left-button"},i._l(i.buttons,function(t,e){return a("el-button",{class:i.buttonIndex==e?"buttonStyle":"",attrs:{type:"primary",size:"small ",keys:"index"},on:{click:function(t){return i.setButton(e)}}},[i._v(i._s(t))])}),1),a("div",{staticClass:"product"},[a("div",{staticClass:"search"},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入搜索内容",size:"max"},model:{value:i.product.search,callback:function(t){i.$set(i.product,"search",t)},expression:"product.search"}},[a("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},slot:"append"})],1)],1),a("div",{staticClass:"options"},[a("div",{staticClass:"typeList"},[a("input",{ref:"file",staticClass:"input-opacity",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpeg, image/png, image/jpg"},on:{change:function(t){return i.addImage(t)}}}),i._l(i.typeButton,function(t,e){return a("div",{staticClass:"typeBtn",on:{mouseenter:function(t){return i.enter(e)},mouseleave:i.leave}},[i._v(" "+i._s(t)+" "),a("i",{class:i.mouseIndex==e?"el-icon-arrow-up":"el-icon-arrow-down"})])}),a("el-radio",{attrs:{label:"1"},model:{value:i.product.radio,callback:function(t){i.$set(i.product,"radio",t)},expression:"product.radio"}},[i._v("全部")]),a("el-radio",{attrs:{label:"2"},model:{value:i.product.radio,callback:function(t){i.$set(i.product,"radio",t)},expression:"product.radio"}},[i._v("常用")]),a("div",{staticClass:"typeBtn",staticStyle:{color:"#55afae"}},[i._v("重置")])],2),a("div",{staticClass:"pickList"},i._l(i.typeArr,function(t,e){return a("div",{directives:[{name:"show",rawName:"v-show",value:i.pickShow,expression:"pickShow"}],staticClass:"typePick",on:{mouseenter:function(t){return i.enter(e)},mouseleave:i.leave}},[a("ul",[a("li",[i._v(i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])]),a("ul",i._l(t.children,function(t,e){return a("li",[i._v(" "+i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])}),0),a("ul",i._l(t.children.children,function(t,e){return a("li",[i._v(" "+i._s(t.name)+" "),a("i",{staticClass:"el-icon-arrow-right"})])}),0)])}),0)])]),a("div",{staticClass:"imgList"},[i._l(i.imgList,function(t,e){return a("div",{staticClass:"imgItem",style:i.imgIndex==e?" border: 1px solid #55afae;":"",on:{click:function(t){return i.pickImg(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),a("div",{staticClass:"imgPage"},[a("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{small:"",layout:"prev, pager, next",total:100}}),a("p",[i._v("共有100件商品")])],1)],2)]),a("div",{directives:[{name:"show",rawName:"v-show",value:!i.popShow,expression:"!popShow"}],staticClass:"right"},[a("div",{staticClass:"flex"},[a("div",{staticClass:"imgList"},i._l(i.curImgList,function(t,e){return a("div",{staticClass:"curimg",style:i.curimgIndex==e?" border: 1px solid #55afae;":"",on:{click:function(t){return i.curImgIndex(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),0),a("div",{staticClass:"canvas"},[a("img",{ref:"myImg",attrs:{src:e("b3ba")}}),a("canvas",{ref:"myCanvas",attrs:{id:"myCanvas"},on:{mousedown:i.start,mousemove:i.move,mouseup:i.up,mouseleave:i.leave}})]),a("div",{staticClass:"swiper"},[a("swiper",{ref:"interSwiper",staticClass:"swiper-no-swiping",attrs:{options:i.swipeOptions}},[i._l(i.imgList,function(t,e){return a("swiper-slide",[a("img",{attrs:{src:t}})])}),a("div",{staticClass:"swiper-button-prev",attrs:{slot:"button-prev"},on:{click:i.swiperPrev},slot:"button-prev"}),a("div",{staticClass:"swiper-button-next",attrs:{slot:"button-next"},on:{click:i.swiperNext},slot:"button-next"})],2),a("div",{staticClass:"count"},[i._v(i._s(i.scrollImg)+"/"+i._s(i.imgList.length))]),a("i",{staticClass:"el-icon-zoom-in pop",on:{click:i.openPop}}),i._m(0),a("div",{staticClass:"specifications"},[i._m(1),i._m(2),a("div",{staticClass:"num"},[a("div",{staticClass:"title"},[i._v("数量")]),a("el-input-number",{attrs:{size:"mini",min:1},on:{blur:i.handleBlur},model:{value:i.num,callback:function(t){i.num=t},expression:"num"}})],1),a("div",{staticClass:"button"},[a("el-button",{staticClass:"but-car",attrs:{size:"small"}},[i._v("加入购物车")]),a("el-button",{staticClass:"but-save",attrs:{size:"small"}},[i._v("保存")])],1)])],1)])]),a("div",{directives:[{name:"show",rawName:"v-show",value:i.popShow,expression:"popShow"}],staticClass:"fiexd"},[a("div",{staticClass:"close"},[a("i",{staticClass:"el-icon-back",on:{click:i.closePop}})]),a("div",{staticClass:"swiper"},[a("div",{staticClass:"imgList"},i._l(i.imgList,function(t,e){return a("div",{class:{imgItem:!0,border:e==i.active},on:{click:function(t){return i.popSwiper(e)}}},[a("img",{attrs:{src:t,alt:""}})])}),0),a("swiper",{ref:"redefineSwipe1",staticClass:"swiperOptions1 swiper-no-swiping",attrs:{options:i.swiperOptions1}},i._l(i.imgList,function(t){return a("swiper-slide",{staticClass:"rs-box"},[a("img",{staticClass:"rs-icon",attrs:{src:t}})])}),1)],1)])])},[function(){var t=this.$createElement,t=this._self._c||t;return t("div",{staticClass:"detail"},[t("div",{staticClass:"size"},[this._v("推荐尺寸"),t("span",[this._v(" 2000px*800px")])]),t("div",{staticClass:"quality"},[this._v("打印质量:"),t("span",[this._v("优秀")])])])},function(){var t=this.$createElement,t=this._self._c||t;return t("div",{staticClass:"color"},[t("div",{staticClass:"title"},[this._v("颜色")]),t("p",[t("span"),this._v(" "),t("span"),this._v(" "),t("span"),this._v(" "),t("span")])])},function(){var t=this.$createElement,t=this._self._c||t;return t("div",{staticClass:"size"},[t("div",{staticClass:"title"},[this._v("规格")]),t("p",[t("span",[this._v("s")]),t("span",[this._v("m")]),t("span",[this._v("l")])])])}],!1,null,"f404770e",null).exports,f=(e("ac1f"),e("5319"),e("4d63"),e("7db0"),e("cb29"),e("fb6a"),e("1276"),e("466d"),e("5cc6"),e("9a8c"),e("a975"),e("735e"),e("c1ac"),e("d139"),e("3a7b"),e("d5d6"),e("82f8"),e("e91f"),e("60bd"),e("5f96"),e("3280"),e("3fcc"),e("ca91"),e("25a1"),e("cd26"),e("3c5d"),e("2954"),e("649e"),e("219c"),e("170b"),e("b39a"),e("72f7"),e("caad"),e("1b62")),y=e("362d"),m=e("b85c"),p={name:"threed",components:{},props:{picimg:{type:String|Array,default:function(){return null}}},data:function(){return{LOADER:document.getElementById("js-loader"),DRAG_NOTICE:document.getElementById("js-drag-notice"),TRAY:document.getElementById("js-tray-slide"),theModel:"",number:0,numberf:0,MODEL_PATH:"https://www.didaplan.cn/3D/baozhen.glb",cameraFar:5,activeOption:"RootNode",BACKGROUND_COLOR:15856113,scene:"",canvas:"",renderer:"",camera:"",controls:"",index:0,texture:"",INITIAL_MTL:"",INITIAL_MAP:""}},methods:{initModel:function(t){var e=this,i=document.querySelector("#c"),a=new THREE.GLTFLoader;this.renderer=new THREE.WebGLRenderer({canvas:i,antialias:!0,alpha:!0}),this.renderer.shadowMap.enabled=!0,this.renderer.setPixelRatio(window.devicePixelRatio),this.scene=new THREE.Scene,this.scene.background=new THREE.Color(this.BACKGROUND_COLOR),this.scene.fog=new THREE.Fog(this.BACKGROUND_COLOR,20,100),this.camera=new THREE.PerspectiveCamera(50,window.innerWidth/window.innerHeight,.1,1e3),this.camera.position.z=this.cameraFar,this.camera.position.x=0,this.INITIAL_MTL=new THREE.MeshPhongMaterial({color:16777215,shininess:10}),this.INITIAL_MAP=[{index:0,childID:"RootNode",mtl:e.INITIAL_MTL},{index:1,childID:"RootNode2",mtl:e.INITIAL_MTL}],a.setDRACOLoader(new THREE.DRACOLoader),a.load(t,function(t){e.number=-1,e.numberf=1,e.scene.remove(e.theModel),e.theModel=t.scene,e.theModel.traverse(function(t){t.isMesh&&(t.castShadow=!0,t.receiveShadow=!0)}),e.initColor(e.theModel,e.INITIAL_MAP[0].childID,e.INITIAL_MAP[0].mtl),e.scene.add(e.theModel)},void 0,function(t){})},initColor:function(t,e,i){for(var a=t.children[0].children,n=0;n<a.length;n++)a[n].material=i,a[n].isMesh?this.number++:this.numberf++;this.index=this.numberf;var r,s=document.querySelectorAll(".option"),o=Object(m.a)(s);try{for(o.s();!(r=o.n()).done;)r.value.addEventListener("click",this.selectOption)}catch(t){o.e(t)}finally{o.f()}s[0].classList.add("--is-active");for(var l=0;l<s.length;l++)l>=this.number?s[l].style.display="none":s[l].style.display="flex";var t=new THREE.HemisphereLight(16777215,16777215,.61),t=(t.position.set(0,50,0),this.scene.add(t),new THREE.DirectionalLight(16777215,.54)),t=(t.position.set(-8,12,8),t.castShadow=!0,t.shadow.mapSize=new THREE.Vector2(1024,1024),this.scene.add(t),new THREE.PlaneGeometry(5e3,5e3,1,1)),c=new THREE.MeshPhongMaterial({color:15658734,shininess:0}),t=new THREE.Mesh(t,c);t.rotation.x=-.5*Math.PI,t.receiveShadow=!0,t.position.y=-1,this.scene.add(t),this.controls=new THREE.OrbitControls(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.enablePan=!0,this.controls.dampingFactor=.2,this.controls.autoRotate=!1,this.controls.autoRotateSpeed=.1,this.controls.maxDistance=1.5},selectOption:function(t){var e,i=t.target,t=(this.index=t.target.dataset.index,this.index=parseInt(this.index)+parseInt(this.numberf),this.activeOption=t.target.dataset.option,document.querySelectorAll(".option")),a=Object(m.a)(t);try{for(a.s();!(e=a.n()).done;)e.value.classList.remove("--is-active")}catch(t){a.e(t)}finally{a.f()}i.classList.add("--is-active")},animate:function(){var t;this.controls&&this.controls.update(),this.renderer.render(this.scene,this.camera),requestAnimationFrame(this.animate),this.resizeRendererToDisplaySize(this.renderer)&&(t=this.renderer.domElement,this.camera.aspect=t.clientWidth/t.clientHeight,this.camera.updateProjectionMatrix())},resizeRendererToDisplaySize:function(t){var e=t.domElement,i=window.innerWidth,a=window.innerHeight,n=e.width/window.devicePixelRatio,e=e.height/window.devicePixelRatio,n=n!==i||e!==a;return n&&t.setSize(i,a,!1),n},selectSwatch:function(t){var e=this,i=new Image,a=(i.src=t,(new THREE.TextureLoader).load(t)),n=new THREE.MeshPhongMaterial({map:a,shininess:10,opacity:1,transparent:!0});i.onload=function(){a.needsUpdate=!0,e.setMaterial(e.theModel,n)}},setMaterial:function(t,e){t.children[0].children[this.index].material=e}},watch:{picimg:function(t){this.selectSwatch(t)}},created:function(){},mounted:function(){this.initModel(this.MODEL_PATH),this.animate()}},p=(e("c12c"),Object(g.a)(p,function(){var t=this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,t=this._self._c||t;return t("div",{staticClass:"body"},[t("div",{staticClass:"options"},[t("div",{staticClass:"option --is-active",attrs:{title:"拉链","data-option":"RootNode","data-index":"0"}},[t("img",{attrs:{src:"https://crossdiy.didaplan.cn/uploads/20220722/e58be1ad824657a29f54ae8e4b4a35fc.jpg"}})]),t("div",{staticClass:"option",attrs:{title:"正面","data-option":"RootNode2","data-index":"1"}},[t("img",{attrs:{src:"https://crossdiy.didaplan.cn/uploads/20220722/dc633ab40dfc030368fbcf7d825ca53c.jpg"}})])]),t("div",{staticClass:"controls"},[t("div",{staticClass:"info"}),t("div",{staticClass:"tray",attrs:{id:"js-tray"}},[t("div",{staticClass:"tray__slide",attrs:{id:"js-tray-slide"}})])]),t("canvas",{attrs:{id:"c"}})])}],!1,null,"66faf150",null).exports);e("4de4");function v(c,d,u,h,t,g){var f;c.on("click tap ",function(t){var e;t.target!==c&&(Math.max.apply(Math,Object(s.a)(d.children.map(function(t){return t.zIndex()}))),e=d.children.filter(function(t){return"background"===t.attrs.status}),d.children.filter(function(t){return"fill"===t.attrs.name}),0!==e.length&&"background"===t.target.attrs.status?t.target.zIndex(0):(u.moveToTop(),0!==d.find(".grid").length&&d.find(".grid").forEach(function(t){t.moveToTop()})),d.find(".fill").forEach(function(t){t.zIndex(0)})),t.target===c||"fill"===t.target.attrs.name?(u.nodes([]),d.draw()):-1!==t.target.getName().indexOf("rectTransformer")&&t.target!==u.nodes()[0]&&(u.nodes([t.target]),d.draw())}),u.on("transform",function(t){}),h&&(h.on("dblclick",function(t){g(),h.hide(),u.hide(),d.draw();var e=h.absolutePosition(),i=c.container().getBoundingClientRect(),a=(1/(document.body.style.zoom||1)).toFixed(3),n=i.left*a+e.x,i=i.top*a+e.y,r=document.createElement("textarea"),a=(document.body.appendChild(r),r.value=h.text(),r.style.position="absolute",r.style.top=i+"px",r.style.left=n+"px",r.style.width=h.width()-2*h.padding()+"px",r.style.height=h.height()-2*h.padding()+5+"px",r.style.fontSize=h.fontSize()+"px",r.style.border="none",r.style.padding="0px",r.style.margin="0px",r.style.overflow="hidden",r.style.background="none",r.style.outline="none",r.style.resize="none",r.style.letterSpacing=h.letterSpacing()+"px",r.style.lineHeight=h.lineHeight(),r.style.fontFamily=h.fontFamily(),r.style.textDecoration=h.textDecoration(),r.style.transformOrigin="left top",r.style.textAlign=h.align(),r.style.color=h.fill(),h.getRotation()),e="",i=(a&&(e+="rotateZ("+a+"deg)"),0);function s(){r.parentNode.removeChild(r),window.removeEventListener("click",o),h.show(),u.show(),u.forceUpdate(),d.draw()}function o(t){t.target!==r&&(h.text(r.value),s())}-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&(i+=2+Math.round(h.fontSize()/20)),r.style.transform=e+="translateY(-"+i+"px)",r.style.height="auto",r.style.height=r.scrollHeight+3+"px",r.focus(),r.addEventListener("keydown",function(t){13!==t.keyCode||t.shiftKey||(h.text(r.value),s()),27===t.keyCode&&s()}),r.addEventListener("keydown",function(t){var e,i,a=h.getAbsoluteScale().x;a=(a=h.width()*a)||h.placeholder.length*h.fontSize(),e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(e||i)&&(a=Math.ceil(a)),(document.documentMode||/Edge/.test(navigator.userAgent))&&(a+=1),r.style.width=a+"px",r.style.height="auto",r.style.height=r.scrollHeight+h.fontSize()+"px"}),setTimeout(function(){window.addEventListener("click",o)})}),f=0,h.on("tap",function(t){var e,n,i,a,r,s=(new Date).getTime();function o(){n.parentNode.removeChild(n),window.removeEventListener("touchstart",l),h.show(),u.show(),u.forceUpdate(),d.draw()}function l(t){t.target!==n&&(h.text(n.value),o())}s-f<300?(g(),h.hide(),u.hide(),d.draw(),i=h.absolutePosition(),r=c.container().getBoundingClientRect(),a=(1/(document.body.style.zoom||1)).toFixed(3),e=r.left*a+i.x,r=r.top*a+i.y,n=document.createElement("textarea"),document.body.appendChild(n),n.value=h.text(),n.style.position="absolute",n.style.top=r+"px",n.style.left=e+"px",n.style.width=h.width()-2*h.padding()+"px",n.style.height=h.height()-2*h.padding()+5+"px",n.style.fontSize=h.fontSize()+"px",n.style.border="none",n.style.padding="0px",n.style.margin="0px",n.style.overflow="hidden",n.style.background="none",n.style.outline="none",n.style.resize="none",n.style.letterSpacing=h.letterSpacing()+"px",n.style.lineHeight=h.lineHeight(),n.style.fontFamily=h.fontFamily(),n.style.transformOrigin="left top",n.style.textAlign=h.align(),n.style.color=h.fill(),a="",(i=h.getRotation())&&(a+="rotateZ("+i+"deg)"),r=0,-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&(r+=2+Math.round(h.fontSize()/20)),n.style.transform=a+="translateY(-"+r+"px)",n.style.height="auto",n.style.height=n.scrollHeight+3+"px",n.focus(),n.addEventListener("keydown",function(t){13!==t.keyCode||t.shiftKey||(h.text(n.value),o()),27===t.keyCode&&o()}),n.addEventListener("keydown",function(t){var e,i,a=h.getAbsoluteScale().x;a=(a=h.width()*a)||h.placeholder.length*h.fontSize(),e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),(e||i)&&(a=Math.ceil(a)),(document.documentMode||/Edge/.test(navigator.userAgent))&&(a+=1),n.style.width=a+"px",n.style.height="auto",n.style.height=n.scrollHeight+h.fontSize()+"px"}),setTimeout(function(){window.addEventListener("touchstart",l)}),0):(f=s,0)}))}function b(e){e.on("mousemove touchmove ",function(t){(t.target===e||(e.container().style.cursor="move","gridLv"===t.target.attrs.name&&(e.container().style.cursor="col-resize"),"gridLh"===t.target.attrs.name&&(e.container().style.cursor="row-resize"),"fill"===t.target.attrs.name))&&(e.container().style.cursor="default")})}e("0481");function w(u,h){u.on("dragmove",function(e){var i,a,n,t,r,s,o,l,c,d;"rectTransformer"===e.target.attrs.name&&(h.find(".guid-line").forEach(function(t){t.destroy()}),i=e.target,a=[0,(c=u).width()/2,c.width()],n=[0,c.height()/2,c.height()],c.find(".rectTransformer").forEach(function(t){t!==i&&(t=t.getClientRect(),a.push([t.x,t.x+t.width,t.x+t.width/2]),n.push([t.y,t.y+t.height,t.y+t.height/2]))}),c.find(".gridLh").forEach(function(t){t.attrs.reference&&t!==i&&(t.attrs.reference,t=t.getClientRect(),a.push([t.x+t.width/2]),n.push([t.y+t.height/2]))}),c.find(".gridLv").forEach(function(t){t.attrs.reference&&t!==i&&(t.attrs.reference,t=t.getClientRect(),a.push([t.x+t.width/2]),n.push([t.y+t.height/2]))}),c={vertical:a.flat(),horizontal:n.flat()},l=e.target,t=l.getClientRect(),l={vertical:[{guide:Math.round(t.x),offset:Math.round(l.x()-t.x),snap:"start"},{guide:Math.round(t.x+t.width/2),offset:Math.round(l.x()-t.x-t.width/2),snap:"center"},{guide:Math.round(t.x+t.width),offset:Math.round(l.x()-t.x-t.width),snap:"end"}],horizontal:[{guide:Math.round(t.y),offset:Math.round(l.y()-t.y),snap:"start"},{guide:Math.round(t.y+t.height/2),offset:Math.round(l.y()-t.y-t.height/2),snap:"center"},{guide:Math.round(t.y+t.height),offset:Math.round(l.y()-t.y-t.height),snap:"end"}]},r=l,s=[],o=[],(t=c).vertical.forEach(function(i){r.vertical.forEach(function(t){var e=Math.abs(i-t.guide);e<5&&s.push({lineGuide:i,diff:e,snap:t.snap,offset:t.offset})})}),t.horizontal.forEach(function(i){r.horizontal.forEach(function(t){var e=Math.abs(i-t.guide);e<5&&o.push({lineGuide:i,diff:e,snap:t.snap,offset:t.offset})})}),t=[],l=s.sort(function(t,e){return t.diff-e.diff})[0],c=o.sort(function(t,e){return t.diff-e.diff})[0],l&&t.push({lineGuide:l.lineGuide,offset:l.offset,orientation:"V",snap:l.snap}),c&&t.push({lineGuide:c.lineGuide,offset:c.offset,orientation:"H",snap:c.snap}),(l=t).length)&&(d=h,l.forEach(function(t){var e;"H"===t.orientation?(e=new Konva.Line({points:[-6e3,t.lineGuide,6e3,t.lineGuide],stroke:"rgb(255, 232, 41)",strokeWidth:2.5,name:"guid-line",dash:[6,6]}),d.add(e),d.batchDraw()):"V"===t.orientation&&(e=new Konva.Line({points:[t.lineGuide,-5e3,t.lineGuide,5e3],stroke:"rgb(255, 232, 41)",strokeWidth:2.5,name:"guid-line",dash:[6,6]}),d.add(e),d.batchDraw())}),l.forEach(function(t){switch(t.snap){case"start":case"center":case"end":switch(t.orientation){case"V":e.target.x(t.lineGuide+t.offset);break;case"H":e.target.y(t.lineGuide+t.offset)}}}))}),u.on("dragend",function(e){h.find(".guid-line").forEach(function(t){t.destroy()}),"rectTransformer"===e.target.attrs.name&&(u.find(".gridLh").forEach(function(t){t.attrs.reference&&t.attrs.Linefollow&&(t.points()[1]=e.target.y()+t.attrs.imagey,t.points()[3]=e.target.y()+t.attrs.imagey)}),u.find(".gridLv").forEach(function(t){t.attrs.reference&&t.attrs.Linefollow&&(t.points()[0]=e.target.x()+t.attrs.imagex,t.points()[2]=e.target.x()+t.attrs.imagex)})),h.batchDraw()})}var x=e("c749"),k=e("ed95"),A=e("22fe"),I=e("099e"),S=e.n(I);function C(t){t.scale().x<0&&t.scale().y<0?t.scale({x:t.scale().x-.1,y:t.scale().y-.1}):t.scale().x<0?t.scale({x:t.scale().x-.1,y:t.scale().y+.1}):t.scale().y<0?t.scale({x:t.scale().x+.1,y:t.scale().y-.1}):t.scale({x:t.scale().x+.1,y:t.scale().y+.1})}function _(t){t.scale().x<0&&t.scale().y<0?t.scale({x:t.scale().x+.1,y:t.scale().y+.1}):t.scale().x<0?t.scale({x:t.scale().x+.1,y:t.scale().y-.1}):t.scale().y<0?t.scale({x:t.scale().x-.1,y:t.scale().y+.1}):t.scale({x:t.scale().x-.1,y:t.scale().y-.1})}function E(t){var e=t.attrs.width,i=t.attrs.height,a=0;i<e&&e<=600?(e=600*(a=e/i),i=600):e<i&&i<=600?(a=i/e,i=(e=600)*a):e==i&&i<=600&&(i=e=600,a=1),t.scale({x:a,y:a}),t.x((600-e)/2+e/2),t.y((600-i)/2+i/2)}function O(t){var e=t.attrs.width,i=t.attrs.height,a=0;i<e?(a=e/600,e=600,i/=a):(a=i/600,i=600,e/=a),t.scale({x:a,y:a}),t.x((600-e)/2+e/2),t.y((600-i)/2+i/2)}var L=e("5530");function D(t,e,i){this.fangda=i,this.canvas=document.createElement("canvas"),this.canvas.width=t*this.fangda,this.canvas.height=e*this.fangda,this.cWidth=t*this.fangda,this.cHeight=e*this.fangda,this._getImage=function(a){return new Promise(function(t,e){var i=new Image;i.crossOrigin="anonymous",i.onload=function(){t(i)},i.src=a})},this._dataURLToBlob=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),a=i.length,n=new Uint8Array(a);a--;)n[a]=i.charCodeAt(a);return new Blob([n],{type:e})}}D.prototype._getImgConfig=function(t){var e=t.width*Math.abs(t.scaleX)*t.canvasZoom*this.fangda,i=t.height*Math.abs(t.scaleY)*t.canvasZoom*this.fangda,a=t.left*t.canvasZoom*this.fangda+t.viewportTransform[0]*this.fangda,n=t.top*t.canvasZoom*this.fangda+t.viewportTransform[1]*this.fangda,r=t.marginLeft*t.canvasZoom*this.fangda,s=t.marginTop*t.canvasZoom*this.fangda,o=t.angle;return Object(L.a)({orignW:e,orignH:i,orignL:a,orignT:n,marginLeft:r,marginTop:s,orignAngle:o},t)},D.prototype._returnJingxiangImg=function(r){var s=this;return new Promise(function(e,t){!function(){i.apply(this,arguments)}(function(t){e(t)})});function i(){return(i=Object(o.a)(regeneratorRuntime.mark(function t(e){var i,a,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.image,r.flipX||r.flipY||e(n),i=document.createElement("canvas"),a=i.getContext("2d"),i.width=r.naturalWidth,i.height=r.naturalHeight,r.flipX&&r.flipY?(a.translate(i.width,i.height),a.scale(-1,-1)):r.flipX?(a.translate(i.width,0),a.scale(-1,1)):r.flipY&&(a.translate(0,i.height),a.scale(1,-1)),a.drawImage(n,0,0),a=i.toDataURL("image/png",1),t.next=11,s._getImage(a);case 11:n=t.sent,e(n);case 13:case"end":return t.stop()}},t)}))).apply(this,arguments)}},D.prototype._patternInitData=function(t,e,i){var a=document.createElement("canvas"),n=a.getContext("2d"),r=t.orignW,s=t.orignH,o=t.marginLeft,l=t.marginTop;return"jichu"==e&&(a.width=o+r,a.height=l+s,n.drawImage(i,o/2,l/2,r,s)),"hengxiang"==e&&(a.width=2*o+2*r,a.height=2*l+2*s,n.drawImage(i,o/2,l/2,r,s),n.drawImage(i,1.5*o+r,l/2,r,s),n.drawImage(i,t.naturalWidth/2,0,t.naturalWidth/2,t.naturalHeight,0,1.5*l+s,r/2,s),n.drawImage(i,o+r/2,1.5*l+s,r,s),n.drawImage(i,0,0,t.naturalWidth/2,t.naturalHeight,2*o+1.5*r,1.5*l+s,r/2,s)),"zongxiang"==e&&(a.width=2*o+2*r,a.height=2*l+2*s,n.drawImage(i,o/2,l/2,r,s),n.drawImage(i,o/2,1.5*l+s,r,s),n.drawImage(i,0,t.naturalHeight/2,t.naturalWidth,t.naturalHeight/2,1.5*o+r,0,r,s/2),n.drawImage(i,1.5*o+r,l+s/2,r,s),n.drawImage(i,0,0,t.naturalWidth,t.naturalHeight/2,1.5*o+r,2*l+1.5*s,r,s/2)),"jingxiang"==e&&(a.width=2*o+2*r,a.height=2*l+2*s,t=-r-o/2,e=-s-l/2,n.save(),n.drawImage(i,o/2,l/2,r,s),n.restore(),n.save(),n.scale(-1,1),n.drawImage(i,t-r-o,l/2,r,s),n.restore(),n.save(),n.scale(1,-1),n.drawImage(i,o/2,e-s-l,r,s),n.restore(),n.save(),n.scale(-1,-1),n.drawImage(i,t-r-o,e-s-l,r,s)),n.restore(),a},D.prototype.setPattern=function(){var a=Object(o.a)(regeneratorRuntime.mark(function t(e,i,a){var n,r,s,o,l,c,d,u,h,g,f,m,p,y;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&i){t.next=3;break}return alert("参数传输不正确"),t.abrupt("return");case 3:return t.next=5,this._returnJingxiangImg(e);case 5:if(g=t.sent,n=this.canvas.getContext("2d"),h=this._getImgConfig(e),r=h.orignW,s=h.orignH,o=h.orignL,l=h.orignT,c=h.marginLeft,d=h.marginTop,u=h.orignAngle,n.clearRect(0,0,this.cWidth,this.cHeight),h=this._patternInitData(h,i,g),g=n.createPattern(h,"repeat"),f=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),g.setTransform){t.next=16;break}return alert("浏览器不支持，平铺效果，请切换到谷歌浏览器"),t.abrupt("return");case 16:m=Math.sqrt(Math.pow(h.width,2)+Math.pow(h.height,2)),p=Math.atan(h.height/h.width),p=u*Math.PI/180+p,"left"==e.originX?(c+=2,d+=2,y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(-c/2,-d/2)):(c-=2,d-=2,"jichu"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(r/2+c/2,s/2+d/2):"jingxiang"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(-(r/2+c/2),-(s/2+d/2)):"zongxiang"==i?y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(r/2+c/2,0):"hengxiang"==i&&(y=f.translate(o,l).translate(m*Math.cos(p),m*Math.sin(p)).rotate(u).translate(0,s/2+d/2))),g.setTransform(y),n.fillStyle=g,n.fillRect(0,0,this.cWidth,this.cHeight),a(this._returnCanvasImg());case 25:case"end":return t.stop()}},t,this)}));return function(t,e,i){return a.apply(this,arguments)}}(),D.prototype._returnCanvasImg=function(){return this.canvas.getContext("2d").setTransform(this.fangda,0,0,this.fangda,0,0),this.canvas.toDataURL()};var I=e("90b9"),T=(e("9490"),e("bc3a")),P=e.n(T),T=e("ca08"),z=e.n(T),T=e("d581"),j=(e("1503"),e("bab4")),H=e.n(j);e("6107");r.a.use([d.a,u.a]);var j={name:"SelectAndTransform",status:"image",mixins:[f.c],components:{Swiper:n.Swiper,SwiperSlide:n.SwiperSlide,threed:p,SearchAccount:T.a},props:{category:{type:Array,default:[]},res:{type:Array,default:[]},category1:{type:Array,default:[]},level:{type:Array,default:[]},productList:{type:Object,default:{}},productDetail:{type:Object,default:{}},currentArea:{type:Object,default:{}},imgLoading:{type:Boolean,default:!1},productLoding:{type:Boolean,default:!1},materiaLoding:{type:Boolean,default:!1},sourceList:{type:Object,default:{}},folderList:{type:Array,default:[]},keywordList:{type:Array,default:[]},sizes:{type:Array,default:[]},attr_id:{type:Number,default:0},currentId:{type:String|Number,default:function(){return null}},initProductDetailPsd:{type:Array,default:function(){return[]}}},data:function(){var t=this;return{Gradientcolor3:"#2D0EAD",Gradientcolor4:"#F2CA51",Gradientcolor5:"#522D97",Gradientcolor6:"#A700FD",Gradientcolor7:"#FF0084",blendmode:"screen",mixblendmode:[{name:"normal",value:"normal"},{name:"multiply",value:"multiply"},{name:"screen",value:"screen"},{name:"overlay",value:"overlay"},{name:"darken",value:"darken"},{name:"lighten",value:"lighten"},{name:"color-dodge",value:"color-dodge"},{name:"color-burn",value:"color-burn"},{name:"hard-light",value:"hard-light"},{name:"soft-light",value:"soft-light"},{name:"difference",value:"difference"},{name:"exclusion",value:"exclusion"},{name:"hue",value:"hue"},{name:"saturation",value:"saturation"},{name:"color",value:"color"},{name:"luminosity",value:"luminosity"}],lvjingVisible:!1,lvjingVisible2:!1,lvjingVisible3:!1,lvjingVisible4:!1,lvjingLoading:!1,lvjingLoading2:!1,lvjingLoading3:!1,lvjingLoading4:!1,htmlString:'<div id="lvjingboxx"  style="display: flex;"><div id="lvjing" style="background-image: linear-gradient(to right, Gradientcolor1, Gradientcolor2); visibility: visible; width:700px;margin: 0px; padding: 0px; font-size: 0px; border: 0;"><img id="lvjingimg" style="mix-blend-mode: screen; height: 100%; width: 100%;" src="srcpath"></div></div>',htmlString2:'<div id="lvjingboxx2" style="background-color:Gradientcolor5; visibility: visible;width: 700px;display: flex;"><img id="lvjingimg2" style="mix-blend-mode: hard-light;width: 100%;"src="srcpath"></div>',htmlString3:'<div id="lvjingboxx3" style="visibility: visible;;z-index: auto;width: 700px;font-size: 0;"><div style="background-color: Gradientcolor6;"><img style="width: 100%;opacity: 1;height: 100%;filter: grayscale(1);mix-blend-mode: multiply;object-fit: contain;" src="srcpath"></div><div style="background-color:Gradientcolor7;mix-blend-mode: lighten;position: absolute;top: 0;right: 0;bottom: 0;left: 0;overflow: hidden;"><img style="transform: translateY(10px) scale(-1.4, 1.4);width: 100%;height: 100%;opacity: 1;filter: grayscale(1);mix-blend-mode: multiply;object-fit: contain;" src="srcpath"></div></div>',htmlString4:'<div id="lvjingboxx4"style="visibility: visible;width: 700px;filter: grayscale(1) contrast(1.1) brightness(1.1);display: flex;"><img style="width: 100%;" src="srcpath"></div>',svgXml:[],svgpath:[],cutpiece_index:0,layerimages:{},layerimages2:[],imageindex:0,drawer:!1,picimg:"",images:[],color:"rgba(255,255,255,0)",defaultcolor:"#ffffff",stage:"",layer:"",fill:"",grid:"",transformer:"",tr:"",curImg:"",lucency:100,options:x.a,fontstyleoptions:[{value:"normal",style:"normal",weight:"normal",label:"正常"},{value:"italic",style:"italic",weight:"normal",label:"斜体"},{value:"bold",style:"normal",weight:"bold",label:"加粗"},{value:"italic bold",style:"italic",weight:"bold",label:"加粗斜体"}],textdecorationoptions:[{value:"",label:"NO"},{value:"underline",label:"underline"},{value:"line-through",label:"line-through"}],fontFamily:"Arial",fontColor:"#000000",fontstrokeColor:"#FFFFFF",fontstrokeWidth:0,fontletterSpacing:0,textDecoration:"",fontlineHeight:1,fontSizeStr:40,fontStyle:"normal",textShadowEnabled:!1,textShadowColor:"#2D4571",textShadowOpacity:1,textShadowOffsetX:5,textShadowOffsetY:5,textShadowBlur:2,popovervisible:!1,gradientEnabled:!1,gradientStartX:0,gradientStartY:0,gradientEndX:0,gradientEndY:30,gradientColors:["#ff0000","#0087F5","#ffffff"],fontSize:[],tag:0,click_up:0,click_up2:0,sourceIds:[],shilihua:0,numgo:1,numgo1:1,dwarning:!1,gaoqingtag:0,changetag:1,changetag1:1,yuantulist:[0,0],vcolorpicker:!1,accelerate_img:e("fcb0"),product:{name:"",cid:"",pageNumber:1,pageSize:20,tag:"ALL",level:"ALL"},material:{userId:"",fid:"",pageNumber:1,pageSize:20,name:"",keywords:[]},cateListProps:{checkStrictly:!0,expandTrigger:"hover"},car:{num:1},currentProduct:"",currentProductIndex:0,currentMaterialIndex:0,swipeOptions:{initialSlide:0,speed:500,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}},swiperOptions1:{initialSlide:0,speed:500,on:{click:function(){alert("你点了Swiper")},slideChange:function(){t.active=t.$refs.redefineSwipe1.$swiper.activeIndex}}},active:0,leftButtonStatus:"product",keywordShow:!0,popShow:!1,layerLength:!0,layerLength1:!0,productColorIndex:0,productSizeIndex:0,scrollImg:0,allLoading:!1,myCropper:null,afterImg:"",ScaleX:1,ScaleY:1,fixed:!1,inputRotate:0,imgFile:"",autoCropWidth:0,autoCropHeight:0,dialogVisible:!1,croploading:!1,lvjingList:[e("97ca"),e("6cc0"),e("5ed4"),e("484f"),e("ea63"),e("bbe1"),e("eda5"),e("602f"),e("a280"),e("d95a"),e("a058"),e("9d6d"),e("5324"),e("cc51")]}},methods:{generateImage:function(){document.getElementById("lvjingboxx")&&document.getElementById("lvjingboxx").remove(),this.blendmode="screen";var t=this.htmlString.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1);t=(t=t.replace(new RegExp("Gradientcolor1","gm"),this.Gradientcolor3)).replace(new RegExp("Gradientcolor2","gm"),this.Gradientcolor4);t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer").appendChild(t.body.firstChild)},generateImage2:function(){document.getElementById("lvjingboxx2")&&document.getElementById("lvjingboxx2").remove();var t=(t=this.htmlString2.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1)).replace(new RegExp("Gradientcolor5","gm"),this.Gradientcolor5),t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer2").appendChild(t.body.firstChild)},generateImage3:function(){document.getElementById("lvjingboxx3")&&document.getElementById("lvjingboxx3").remove();var t=this.htmlString3.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1);t=(t=t.replace(new RegExp("Gradientcolor6","gm"),this.Gradientcolor6)).replace(new RegExp("Gradientcolor7","gm"),this.Gradientcolor7);t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer3").appendChild(t.body.firstChild)},generateImage4:function(){document.getElementById("lvjingboxx4")&&document.getElementById("lvjingboxx4").remove();var t=this.htmlString4.replace(new RegExp("srcpath","gm"),this.curImg.attrs.src1),t=(new DOMParser).parseFromString(t,"text/html");document.getElementById("lvjingcontainer4").appendChild(t.body.firstChild),this.startlvjing4()},lvjingblendmode:function(){document.getElementById("lvjingimg").style.mixBlendMode=this.blendmode},startlvjing:function(){this.$message.success("Start synthesizing and saving the original image with filters."),this.lvjingLoading=!0;var i=new Image,a=this;i.src=this.curImg.attrs.src1,i.onload=function(){var t=document.getElementById("lvjing"),e=(t.style.width=i.width,t.style.height=i.height,document.getElementById("lvjingimg"));e.style.width=i.width,e.style.height=i.height,S.a.toPng(t).then(function(t){var e,t=a.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(a.lvjingVisible=!1,a.lvjingLoading=!1,a.$msgbox({title:"",message:"The image size exceeds 20MB.",type:"warning"})):((e=new FormData).append("file",t),Object(k.a)(e).then(function(t){1==t.data.code?(a.lvjingVisible=!1,a.lvjingLoading=!1,a.$message.success("Composition completed, add to canvas"),a.lingshiceshi(t.data.data.url)):a.messageBox(t)}))}).catch(function(t){a.lvjingLoading=!1,a.$message.error(t)})}},startlvjing2:function(){this.$message.success("Start synthesizing and saving the original image with filters."),this.lvjingLoading2=!0;var i=new Image,a=this;i.src=this.curImg.attrs.src1,i.onload=function(){var t=document.getElementById("lvjingboxx2"),e=(t.style.width=i.width,t.style.height=i.height,document.getElementById("lvjingimg2"));e.style.width=i.width,e.style.height=i.height,S.a.toPng(t).then(function(t){var e,t=a.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(a.lvjingVisible2=!1,a.lvjingLoading2=!1,a.$msgbox({title:"",message:"The image size exceeds 20MB.",type:"warning"})):((e=new FormData).append("file",t),Object(k.a)(e).then(function(t){1==t.data.code?(a.lvjingVisible2=!1,a.lvjingLoading2=!1,a.$message.success("Composition completed, add to canvas"),a.lingshiceshi(t.data.data.url)):a.messageBox(t)}))}).catch(function(t){a.lvjingLoading2=!1,a.lvjingVisible2=!1,a.$message.error(t)})}},startlvjing3:function(){this.$message.success("Start synthesizing and saving the original image with filters."),this.lvjingLoading3=!0;var e=new Image,i=this;e.src=this.curImg.attrs.src1,e.onload=function(){var t=document.getElementById("lvjingboxx3");t.style.width=e.width,t.style.height=e.height,S.a.toPng(t).then(function(t){var e,t=i.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(i.lvjingVisible3=!1,i.lvjingLoading3=!1,i.$msgbox({title:"",message:"The image size exceeds 20MB.",type:"warning"})):((e=new FormData).append("file",t),Object(k.a)(e).then(function(t){1==t.data.code?(i.lvjingVisible3=!1,i.lvjingLoading3=!1,i.$message.success("Composition completed, add to canvas"),i.lingshiceshi(t.data.data.url)):i.messageBox(t)}))}).catch(function(t){i.lvjingLoading3=!1,i.lvjingVisible3=!1,i.$message.error(t)})}},startlvjing4:function(){this.$message.success("Start synthesizing and saving the original image with filters."),this.lvjingLoading4=!0;var e=new Image,i=this;e.src=this.curImg.attrs.src1,e.onload=function(){var t=document.getElementById("lvjingboxx4");t.style.width=e.width,t.style.height=e.height,S.a.toPng(t).then(function(t){var e,t=i.dataURLtoFile(t,"lvjing.png");20<Number(t.size/1024/1024)?(i.lvjingVisible4=!1,i.lvjingLoading4=!1,i.$msgbox({title:"",message:"The image size exceeds 20MB.",type:"warning"})):((e=new FormData).append("file",t),Object(k.a)(e).then(function(t){1==t.data.code?(i.lvjingVisible4=!1,i.lvjingLoading4=!1,i.$message.success("Composition completed, add to canvas"),i.lingshiceshi(t.data.data.url)):i.messageBox(t)}))}).catch(function(t){i.lvjingLoading4=!1,i.lvjingVisible4=!1,i.$message.error(t)})}},showlvjing:function(){var t=this;setTimeout(function(){t.$message.success("Load original image"),t.generateImage()},0)},showlvjing2:function(){var t=this;setTimeout(function(){t.$message.success("Load original image"),t.generateImage2()},0)},showlvjing3:function(){var t=this;setTimeout(function(){t.$message.success("Load original image"),t.generateImage3()},0)},showlvjing4:function(){var t=this;setTimeout(function(){t.$message.success("Load original image"),t.generateImage4()},0)},cutout:function(){var e=this;this.allLoading=!0,Object(A.e)(this.curImg.attrs.src).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},styleTransfer:function(t){var e=this;this.allLoading=!0,Object(A.t)(this.curImg.attrs.src,-1!=t.indexOf("static")?t:"https://www.didaplan.cn/"+t).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},imageClarity:function(){var e=this;this.allLoading=!0,Object(A.o)(this.curImg.attrs.src1).then(function(t){e.allLoading=!1,1==t.data.code&&e.lingshiceshi(t.data.data),e.messageBox(t)})},cropimage:function(){this.dialogVisible=!0},show:function(){var t=this;setTimeout(function(){t.initcrop()},0)},changeD:function(t){var e=document.getElementsByClassName("changeb"),i=document.getElementsByClassName("body");0==t?(e[0].classList.add("actionb"),e[1].classList.remove("actionb"),i[0].style.zIndex=1000001):(e[1].classList.add("actionb"),e[0].classList.remove("actionb"),i[0].style.zIndex=0)},clickChange:function(t){"product"===t?this.leftButtonStatus="product":"image"===t?this.$refs.file.click():"Material"==t?(this.material.userId="",this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("getMaterial"),this.leftButtonStatus="Material"):(this.material.pageNumber=1,this.$emit("getMaterial"),this.leftButtonStatus="background")},addFont:function(){var t=this.layer,e=this.transformer,i=this.stage,a=1/(this.gradientColors.length-1),n=[],r=(this.gradientColors.forEach(function(t,e){n.push(e*a,t)}),null==this.fontColor&&(this.fontColor="#000000"),new y.a.Text({text:"37POD DESIGN",x:50,y:80,fontSize:40,draggable:!0,width:400,name:"rectTransformer",rotation:0,fontStyle:this.fontStyle,textDecoration:this.textDecoration,fontFamily:this.fontFamily,shadowEnabled:this.textShadowEnabled,shadowColor:this.textShadowColor,shadowBlur:this.textShadowBlur,shadowOpacity:this.textShadowOpacity,shadowOffsetX:this.textShadowOffsetX,shadowOffsetY:this.textShadowOffsetY,stroke:this.fontstrokeColor,strokeWidth:this.fontstrokeWidth,shadowForStrokeEnabled:!1,gradientEnabled:!1,letterSpacing:this.fontletterSpacing,backgroundColor:"#000000",fill:this.fontColor,fillLinearGradientStartPoint:{x:this.gradientStartX,y:this.gradientStartY},fillLinearGradientEndPoint:{x:this.gradientEndX,y:this.gradientEndY},fillLinearGradientColorStops:n,align:"center",lineHeight:this.fontlineHeight})),s=(this.gradientEnabled=!1,t.add(r),this.curImg=r,new y.a.Transformer({node:r,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(r.fontSize()+70,e.width),e}}));r.on("transform",function(){r.setAttrs({width:r.width()*r.scaleX(),scaleY:1,scaleX:1})}),e.add(s),e.draw(),v(i,t,s,r,this.currentArea.id,this.deletCurImg),b(i),w(i,t),this.keydown(i,t,s),this.fontSizeStr=40,this.jilu()},deletCurImg:function(){this.curImg=""},colorPicker:function(){this.$refs.colorPicker.click()},handleClear:function(t){null==this.color&&(this.color="rgba(255,255,255,0)")},getcolor:function(){document.getElementById("getcolor").click()},nativePick:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.color=e);case 3:case"end":return t.stop()}},t)}))()},nativePick2:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor3=e);case 3:case"end":return t.stop()}},t)}))()},nativePick3:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor4=e);case 3:case"end":return t.stop()}},t)}))()},nativePick4:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor5=e);case 3:case"end":return t.stop()}},t)}))()},nativePick5:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor6=e);case 3:case"end":return t.stop()}},t)}))()},nativePick6:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(e=i?i.target.value:null)&&(a.Gradientcolor7=e);case 3:case"end":return t.stop()}},t)}))()},addImage:function(t){var e,o=this,t=t.target.files[0];20<Number(t.size/1024/1024)?this.$msgbox({title:"",message:"文件大小不能超过20MB，请重新上传。",type:"warning"}):((e=new FormData).append("file",t),e.append("fid",0),document.getElementsByClassName("input-opacity")[0].value="",this.allLoading=!0,P.a.post("http://crossdiy.didaplan.cn/api/my_source/upLoad",e,{headers:{token:z.a.get("token")}}).then(function(e){var i,a,n,r,s;1==e.data.code?((i=new window.Image).crossOrigin="anonymous",i.src=e.data.data.img_url+"?imageView2/2/w/1200",r=e.data.data.img_url+"?imageView2/2/w/1200",s=e.data.data.img_url,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:e.data.data.id,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:(600-a)/2+a/2,y:(600-n)/2+n/2,rotation:0,offset:{x:a/2,y:n/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};o.images.push(t),o.addElem(t),o.allLoading=!1,o.jilu()}):(o.allLoading=!1,o.$message.error(e.data.msg))}).catch(function(t){o.allLoading=!1,o.$message.error(t.data.msg)}))},drawGrid:function(){var t=this.grid;if(0==t.find(".grid").length){for(var e=0;e<10;e++){var i=new y.a.Line({points:[0,a=60*e,600,a],stroke:"#ededed",strokeWidth:.5,lineCap:"round",lineJoin:"round",name:"grid",visible:!0}),a=new y.a.Line({points:[a,0,a,600],stroke:"#ededed",strokeWidth:.5,lineCap:"round",lineJoin:"round",name:"grid",visible:!0});t.add(i,a)}t.batchDraw()}else t.find(".grid").forEach(function(t){t.destroy()})},addElemP:function(t){for(var e=0;e<this.layer.children.length;e++)if(this.layer.children[e].attrs.hasOwnProperty("pingpu")){this.layer.children.splice(e,1);break}this.transformer.children.forEach(function(t){t.nodes([])});var i=this.layer,t=(this.fill,this.transformer,this.grid,this.stage,new y.a.Image(t));t.cache(!1),i.add(t),t.moveToBottom(),this.save()},addElemnew:function(t){var e=this.layer,i=(this.fill,this.transformer,this.grid,this.stage),a=(this.transformer.children.forEach(function(t){t.nodes([])}),(new Date).getTime().toString()),a=(t.timestamp=a,new y.a.Image(t));a.cache(!1),e.add(a),this.curImg=a,1==t.putu&&this.setPatternf(t.putustr,a),"background"===t.status&&a.zIndex(0),t.status;v(i,e,this.tr,"",this.currentArea.id,this.deletCurImg),b(i),w(i,e),this.keydown(i,e,this.tr)},addElem:function(t){var e=this.layer,i=(this.fill,this.transformer,this.grid,this.stage),a=(this.transformer.children.forEach(function(t){t.nodes([])}),(new Date).getTime().toString()),a=(t.timestamp=a,new y.a.Image(t));a.cache(!1),e.add(a),this.curImg=a,"background"===t.status&&a.zIndex(0),t.status;v(i,e,this.tr,"",this.currentArea.id,this.deletCurImg),b(i),w(i,e),this.keydown(i,e,this.tr)},setPattern_change:function(t){var i,a,e,n;1==this.curImg.attrs.putu&&(this.click_up=0,this.click_up2=0,this.transformer.children.forEach(function(t){t.nodes([])}),this.pageLayer[1].layer.children.length)&&(e=new D(600,600,(i=this).numgo1),this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,(a=this.curImg.attrs).width=a.naturalWidth,a.height=a.naturalHeight,a.viewportTransform=[a.x,a.y],e.setPattern(a,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/i.numgo1,scaleY:1/i.numgo1,pingpu:1,sourceid:a.sourceid};i.curImg.moveToBottom(),i.addElemP(t)}}),e=a.naturalWidth,t=a.naturalHeight,Number(e)>Number(t)?(n=e/600,e=600,t/=n):(n=t/600,t=600,e/=n),a.width=e,a.height=t)},clearrect:function(){var t;this.layer.children[0]&&this.layer.children[0].attrs.hasOwnProperty("pingpu")&&(t=this.layer.children[0],this.transformer.children[0].nodes([]),t.destroy(),this.save())},chexiao:function(){0<=this.imageindex-1&&(this.imageindex--,this.imageDesign(this.layerimages2[this.imageindex]))},chonzuo:function(){this.imageindex+1<this.layerimages2.length&&(this.imageindex++,this.imageDesign(this.layerimages2[this.imageindex]))},setPattern:function(t){if(this.click_up2=0,this.transformer.children.forEach(function(t){t.nodes([])}),0!=this.tag&&this.layer.children.forEach(function(t){t.attrs.putu=0}),"jichu"==t){var e=document.getElementById("btn1"),i=document.getElementById("btn2"),a=document.getElementById("btn3"),n=document.getElementById("btn4");if(1==this.tag)return this.tag=0,this.clearrect(),e.style.color="black",void(e.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=1,e.style.color="white",e.style.backgroundColor="var(--style-color-design)",i.style.color="black",i.style.backgroundColor="#f5f5f5",a.style.color="black",a.style.backgroundColor="#f5f5f5",n.style.color="black",n.style.backgroundColor="#f5f5f5"}if("jingxiang"==t){if(2==this.tag)return this.tag=0,this.clearrect(),btn2.style.color="black",void(btn2.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=2,btn2.style.color="white",btn2.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn3.style.color="black",btn3.style.backgroundColor="#f5f5f5",btn4.style.color="black",btn4.style.backgroundColor="#f5f5f5"}if("zongxiang"==t){if(3==this.tag)return this.tag=0,this.clearrect(),btn3.style.color="black",void(btn3.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=3,btn3.style.color="white",btn3.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn2.style.color="black",btn2.style.backgroundColor="#f5f5f5",btn4.style.color="black",btn4.style.backgroundColor="#f5f5f5"}if("hengxiang"==t){if(4==this.tag)return this.tag=0,this.clearrect(),btn4.style.color="black",void(btn4.style.backgroundColor="#f5f5f5");this.layer.children.forEach(function(t){t.attrs.putu=0}),this.curImg.attrs.putu=1,this.curImg.attrs.putustr=t,this.tag=4,btn4.style.color="white",btn4.style.backgroundColor="var(--style-color-design)",btn1.style.color="black",btn1.style.backgroundColor="#f5f5f5",btn2.style.color="black",btn2.style.backgroundColor="#f5f5f5",btn3.style.color="black",btn3.style.backgroundColor="#f5f5f5"}var r,s;this.pageLayer[1].layer.children.length&&(e=new D(600,600,(r=this).numgo1),(s=r.curImg.attrs).width=s.naturalWidth,s.height=s.naturalHeight,s.viewportTransform=[s.x,s.y],e.setPattern(s,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/r.numgo1,scaleY:1/r.numgo1,pingpu:1,sourceid:s.sourceid};r.curImg.moveToBottom(),r.addElemP(t)}}),i=s.naturalWidth,a=s.naturalHeight,Number(i)>Number(a)?(n=i/600,i=600,a/=n):(e=a/600,a=600,i/=e),s.width=i,s.height=a)},setPatternf:function(t,i){var a,n,e,r,s,o;document.getElementById("btn1")?("jichu"==t&&(document.getElementById("btn1")&&(e=document.getElementById("btn1"),o=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),e.style.color="white",e.style.backgroundColor="var(--style-color-design)",o.style.color="black",o.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),this.tag=1),"jingxiang"==t&&(this.tag=2,document.getElementById("btn1"))&&(e=document.getElementById("btn1"),o=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),o.style.color="white",o.style.backgroundColor="var(--style-color-design)",e.style.color="black",e.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),"zongxiang"==t&&(this.tag=3,document.getElementById("btn1"))&&(o=document.getElementById("btn1"),e=document.getElementById("btn2"),r=document.getElementById("btn3"),s=document.getElementById("btn4"),r.style.color="white",r.style.backgroundColor="var(--style-color-design)",o.style.color="black",o.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5",s.style.color="black",s.style.backgroundColor="#f5f5f5"),"hengxiang"==t&&(this.tag=4,document.getElementById("btn1"))&&(r=document.getElementById("btn1"),o=document.getElementById("btn2"),e=document.getElementById("btn3"),(s=document.getElementById("btn4")).style.color="white",s.style.backgroundColor="var(--style-color-design)",r.style.color="black",r.style.backgroundColor="#f5f5f5",o.style.color="black",o.style.backgroundColor="#f5f5f5",e.style.color="black",e.style.backgroundColor="#f5f5f5")):("jichu"==t&&(this.tag=1),"jingxiang"==t&&(this.tag=2),"zongxiang"==t&&(this.tag=3),"hengxiang"==t&&(this.tag=4)),this.pageLayer[1].layer.children.length&&(s=new D(600,600,(a=this).numgo1),(n=i.attrs).width=n.naturalWidth,n.height=n.naturalHeight,n.viewportTransform=[n.x,n.y],s.setPattern(n,t,function(t){var e=new window.Image;e.src=t,e.onload=function(){var t={image:e,scaleX:1/a.numgo1,scaleY:1/a.numgo1,pingpu:1,sourceid:n.sourceid};i.moveToBottom(),a.addElemP(t)}}),r=n.naturalWidth,o=n.naturalHeight,Number(r)>Number(o)?(e=r/600,r=600,o/=e):(s=o/600,o=600,r/=s),n.width=r,n.height=o)},rightButton:function(t){var e,i,a,n,r,s,o,l,c,d,u,h,g,f,m=this,p=this.curImg;if("rectTransformer"==p.attrs.name){switch(t){case"vertical":g=(h=p).scaleX(),f=h.scaleY(),h.scale({x:g,y:f*=-1}),0==h.attrs.flipY?h.attrs.flipY=1:h.attrs.flipY=0;break;case"horizontal":f=(g=p).scaleX(),h=g.scaleY(),g.scale({x:f*=-1,y:h}),0==g.attrs.flipX||-1==g.attrs.flipX?(g.attrs.flipX=1,g.attrs.angle1=g.attrs.rotation):g.attrs.flipX=0;break;case"top":this.save(),"background"!=(u=p).attrs.status&&u.moveToTop();break;case"bottom":this.save(),"background"!=(u=p).attrs.status&&u.moveToBottom();break;case"up":p.moveUp(),this.save();break;case"down":"background"!=(d=p).attrs.status&&d.moveDown(),this.save();break;case"copy":null==p.attrs.text?((e=JSON.parse(JSON.stringify(p.attrs))).x+=10,e.y+=10,(i=new window.Image).crossOrigin="anonymous",i.src=e.src,r=e.src,s=e.src1,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:-1,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:e.x,y:e.y,rotation:0,offset:{x:a/2,y:n/2},scaleX:e.scaleX,scaleY:e.scaleY,flipX:e.flipX,flipY:e.flipY,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,naturalWidthB:e.naturalWidthB,naturalHeightB:e.naturalHeightB,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};m.images.push(t),m.addElem(t),m.jilu()}):((d=JSON.parse(JSON.stringify(p.attrs))).x+=10,d.y+=10,c=new y.a.Text(d),this.layer.add(c),this.jilu());break;case"delet":null!=p.attrs.text?(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",p.destroy()):1!=p.attrs.putu&&(this.transformer.children.forEach(function(t){t.nodes([])}),this.curImg="",p.destroy());break;case"LeftAlignment":(c=p).x(c.width()*c.scaleX()/2);break;case"Center":p.x(300);break;case"RightAlignment":(l=p).x(600-l.width()*l.scaleX()/2);break;case"TopAlignment":(l=p).y(l.height()*l.scaleY()/2);break;case"VerticalAlignment":p.y(300);break;case"BottomAlignment":(o=p).y(600-o.height()*o.scaleY()/2);break;case"ClockwiseRotation":p.rotate(45);break;case"CounterclockwiseRotation":p.rotate(-45);break;case"amplification":null!=p.attrs.text?this.fontSizeStr<200&&(this.fontSizeStr+=2,this.curImg.setFontSize(this.fontSizeStr),this.MinwidthFontSize(this.curImg)):C(p),this.save();break;case"narrow":null!=p.attrs.text?12<this.fontSizeStr&&(this.fontSizeStr-=2,this.curImg.setFontSize(this.fontSizeStr)):_(p),this.save();break;case"imageFill":E(p);break;case"imageAdaptive":O(p);break;case"fontLeft":p.setAlign("left");break;case"fontCenter":p.setAlign("center");break;case"fontRight":p.setAlign("right");break;default:return}"copy"!=t&&this.jilu()}},jilu:function(){var t=this,e=[];this.transformer.children.forEach(function(t){t.nodes([])}),this.save(),t.imageindex++,t.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(t.color),t.layerimages2[t.imageindex]=JSON.parse(JSON.stringify(e)),t.layerimages2=t.layerimages2.slice(0,t.imageindex+1)},addgroup:function(){this.curImg&&(this.curImg.draggable(!1),this.group.add(this.curImg))},keydown:function(r,t,c){var e=this,d=this,u="",i=(r.on("mousedown touchstart",function(e){if(e.target!=r){if("gridLv"!==e.target.attrs.name&&"gridLh"!==e.target.attrs.name){if(d.click_up2=1,"rectTransformer"===e.target.attrs.name){if(r.find(".gridLh").forEach(function(t){t.attrs.reference&&(t.attrs.imagey=t.points()[1]-e.target.y())}),r.find(".gridLv").forEach(function(t){t.attrs.reference&&(t.attrs.imagex=t.points()[0]-e.target.x())}),e.target.attrs.hasOwnProperty("sourceid")&&(d.click_up=1),d.curImg=e.target,u=e.target,null!=d.curImg.attrs.text){if(d.fontSizeStr=d.curImg.attrs.fontSize,d.fontFamily=d.curImg.attrs.fontFamily,d.fontstrokeColor=d.curImg.attrs.stroke,d.fontStyle=d.curImg.attrs.fontStyle,d.fontstrokeWidth=d.curImg.attrs.strokeWidth,d.fontlineHeight=d.curImg.attrs.lineHeight,d.textDecoration=d.curImg.attrs.textDecoration,d.textShadowEnabled=d.curImg.shadowEnabled(),d.textShadowColor=d.curImg.shadowColor().toString(),d.textShadowBlur=d.curImg.shadowBlur(),d.textShadowOpacity=d.curImg.shadowOpacity(),d.textShadowOffsetX=d.curImg.shadowOffsetX(),d.textShadowOffsetY=d.curImg.shadowOffsetY(),d.gradientEnabled=d.curImg.attrs.gradientEnabled,d.gradientEnabled){for(var t=[],i=d.curImg.fillLinearGradientColorStops(),a=0;a<i.length;a+=2){var n=i[a+1];t.push(n)}d.gradientColors=t}else d.fontColor=d.curImg.attrs.fill;d.gradientStartX=d.curImg.fillLinearGradientStartPointX(),d.gradientStartY=d.curImg.fillLinearGradientStartPointY(),d.gradientEndX=d.curImg.fillLinearGradientEndPointX(),d.gradientEndY=d.curImg.fillLinearGradientEndPointY()}}else u="fill"===e.target.attrs.name?d.curImg="":(d.curImg=d.curImg,d.curImg);e.target.attrs.hasOwnProperty("pingpu")&&(d.curImg=d.curImg,""!=(u=d.curImg))&&c.nodes([u])}}else u="",d.curImg=""}),r.on("mouseup touchend",function(t){2==d.click_up2&&(d.click_up2=0,d.jilu()),2==d.click_up&&(1==d.tag&&e.setPattern_change("jichu"),2==d.tag&&e.setPattern_change("jingxiang"),3==d.tag&&e.setPattern_change("zongxiang"),4==d.tag)&&e.setPattern_change("hengxiang"),d.click_up=0}),r.on("mousemove touchmove",function(t){1==d.click_up2&&(d.click_up2=2)}),r.container());i.tabIndex=1,i.focus();i.addEventListener("keydown",function(t){var e,i,a,n,r,s,o=t.ctrlKey,l=t.altKey;if(t.shiftKey&&82===t.keyCode&&d.emptyCanvas2(),""!==u&&"rectTransformer"==u.attrs.name){if(37===t.keyCode)u.x(u.x()-1);else if(38===t.keyCode)u.y(u.y()-1);else if(39===t.keyCode)u.x(u.x()+1);else if(40===t.keyCode)u.y(u.y()+1);else if(o&&81===t.keyCode)u.rotate(-45);else if(l&&81===t.keyCode)u.rotate(45);else if(o&&90===t.keyCode)null!=u.attrs.text?d.fontSizeStr<200&&(d.fontSizeStr+=2,d.curImg.setFontSize(d.fontSizeStr),d.MinwidthFontSize(d.curImg)):C(u),d.save();else if(l&&90===t.keyCode)null!=u.attrs.text?12<d.fontSizeStr&&(d.fontSizeStr-=2,d.curImg.setFontSize(d.fontSizeStr)):_(u),d.save();else if(46===t.keyCode)null!=u.attrs.text?(d.transformer.children.forEach(function(t){t.nodes([])}),d.curImg="",u.destroy()):1!=u.attrs.putu&&(d.transformer.children.forEach(function(t){t.nodes([])}),d.curImg="",u.destroy());else if(o&&83===t.keyCode)alert("保存");else if(o&&67===t.keyCode)"background"===u.attrs.status?alert("背景图片不可复制"):null==u.attrs.text&&((e=JSON.parse(JSON.stringify(u.attrs))).x+=10,e.y+=10,(i=new window.Image).crossOrigin="anonymous",i.src=e.src,r=e.src,s=e.src1,i.onload=function(){a=i.width,(n=i.height)<a?(t=a/600,a=600,n/=t):(t=n/600,n=600,a/=t);var t={sourceid:-1,src:r,src1:s,name:"rectTransformer",image:i,width:a,height:n,draggable:!0,x:e.x,y:e.y,rotation:0,offset:{x:a/2,y:n/2},scaleX:e.scaleX,scaleY:e.scaleY,flipX:e.flipX,flipY:e.flipY,left:0,top:0,putu:0,naturalWidth:i.width,naturalHeight:i.height,naturalWidthB:e.naturalWidthB,naturalHeightB:e.naturalHeightB,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]};d.images.push(t),d.addElem(t),d.jilu()});else{if(o&&66===t.keyCode)E(u);else{if(!l||66!==t.keyCode)return;O(u)}c.nodes([])}o&&67===t.keyCode||d.jilu(),t.preventDefault()}})},save:Object(I.a)(function(){var e=[],t=(window._this.layer.find(".guid-line").forEach(function(t){e.push(t),t.destroy()}),window._this.grid.find(".grid").forEach(function(t){t.hide()}),window._this.grid.find(".gridLh").forEach(function(t){t.hide()}),window._this.grid.find(".gridLv").forEach(function(t){t.hide()}),window._this.stage.toDataURL({mimeType:"image/webp",pixelRatio:2}));e.forEach(function(t){window._this.layer.add(t),window._this.layer.batchDraw()}),window._this.grid.find(".grid").forEach(function(t){t.show()}),window._this.grid.find(".gridLh").forEach(function(t){t.show()}),window._this.grid.find(".gridLv").forEach(function(t){t.show()});window._this.$emit("getDesignTemp","",window._this.currentArea,window._this.scrollImg,t,t)},29),dataURLtoFile:function(t,e){for(var t=t.split(","),i=t[0].match(/:(.*?);/)[1],a=atob(t[1]),n=a.length,r=new Uint8Array(n);n--;)r[n]=a.charCodeAt(n);for(var s=0;s<window._this.layer.children.length;s++)if(window._this.layer.children[s].attrs.hasOwnProperty("pingpu")){window._this.layer.children[s].moveToBottom(),0==this.tag&&this.clearrect();break}return new File([r],e,{type:i})},emptyCanvas2:function(){var e=this,i=(this.click_up2=0,this.stage.off(),this.stageons(),this.layerimages2=[],this.imageindex=0,this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),this.fill.children.forEach(function(t){t.destroy()}),this.color="rgba(255,255,255,0)",0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),[]);this.color="rgba(255,255,255,0)",i.push(this.color),this.productDetail.design_list.forEach(function(t){t!=e.currentArea&&(e.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)))}),this.$emit("emptyC"),this.clearrect(),this.curImg="",this.save()},emptyCanvas:function(){this.stage.off(),this.stageons(),this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),this.fill.children.forEach(function(t){t.destroy()}),this.color="rgba(255,255,255,0)",0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),this.clearrect(),this.save()},chehuiemptyCanvas:function(){this.stage.off(),this.stageons(),this.layer.find(".rectTransformer").forEach(function(t){t.destroy()}),this.transformer.children.forEach(function(t){t.nodes([])}),0!==this.grid.find(".grid").length&&this.grid.find(".grid").forEach(function(t){t.destroy()}),this.clearrect(),this.save()},pickFontFamily:function(){var t=this;this.curImg.setFontFamily(this.fontFamily),document.fonts.ready.then(function(){t.curImg.setFontFamily(""),t.curImg.setFontFamily(t.fontFamily)}),this.jilu()},pickFontColor:function(){this.gradientEnabled||(null==this.fontColor&&(this.fontColor="#000000"),this.curImg.setFill(this.fontColor),this.jilu())},pickFontStrokeColor:function(){this.curImg.setStroke(this.fontstrokeColor),this.jilu()},MinwidthFontSize:function(t){t.setAttr("width",Math.max(t.fontSize()+70,t.width()))},pickFontSize:function(){this.curImg.setFontSize(this.fontSizeStr),this.MinwidthFontSize(this.curImg),this.jilu()},pickFontStyle:function(){this.curImg.setAttrs({fontStyle:this.fontStyle}),this.jilu()},pickFontDecoration:function(){this.curImg.setAttrs({textDecoration:this.textDecoration}),this.jilu()},pickFontstrokeWidth:function(){this.curImg.strokeWidth(this.fontstrokeWidth),this.jilu()},pickFontlineHeight:function(){this.curImg.lineHeight(this.fontlineHeight),this.jilu()},pickfontletterSpacing:function(){this.curImg.letterSpacing(this.fontletterSpacing),this.jilu()},toggleGradient:function(t){this.gradientEnabled=t,(this.curImg.attrs.gradientEnabled=t)?(this.curImg.setFill(""),this.updateGradient()):(null==this.fontColor&&(this.fontColor="#000000"),this.curImg.setFill(this.fontColor))},getRandomColor:function(){for(var t="#",e=0;e<6;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t},addGradientColor:function(){var t;this.gradientColors.length<10&&(t=this.getRandomColor(),this.gradientColors.push(t),this.updateGradient())},delGradientColor:function(){2<this.gradientColors.length&&(this.gradientColors.pop(),this.updateGradient())},updateGradient:function(){var i=1/(this.gradientColors.length-1),a=[];this.gradientColors.forEach(function(t,e){a.push(e*i,t)}),this.curImg.fillLinearGradientColorStops(a),this.curImg.fillLinearGradientStartPoint({x:this.gradientStartX,y:this.gradientStartY}),this.curImg.fillLinearGradientEndPoint({x:this.gradientEndX,y:this.gradientEndY})},toggleTextShadow:function(t){this.textShadowEnabled=t,this.curImg.shadowEnabled(this.textShadowEnabled)},pickTextShadowColor:function(){this.curImg.shadowColor(this.textShadowColor),this.jilu()},pickTextShadowOpacity:function(){this.curImg.shadowOpacity(this.textShadowOpacity),this.jilu()},pickTextShadowOffsetX:function(){this.curImg.shadowOffsetX(this.textShadowOffsetX),this.jilu()},pickTextShadowOffsetY:function(){this.curImg.shadowOffsetY(this.textShadowOffsetY),this.jilu()},pickTextShadowBlur:function(){this.curImg.shadowBlur(this.textShadowBlur),this.jilu()},setCategory:function(){this.$refs.selectDeptRef?this.$refs.selectDeptRef.dropDownVisible=!1:this.$refs.selectDeptRef1.dropDownVisible=!1,this.$refs.selectDeptRef.panel.initStore(),this.productSearch()},setCategory1:function(){this.$refs.selectDeptRef?this.$refs.selectDeptRef.dropDownVisible=!1:this.$refs.selectDeptRef1.dropDownVisible=!1,this.$refs.selectDeptRef1.panel.initStore(),this.materialSearch()},productMove:function(t){""==this.currentProduct&&(this.currentProduct=t)},cutpiece:function(){var a=this;this.svgXml=[],this.cutpiece_index=0,this.svgpath.forEach(function(t,i){P.a.get(t).then(function(t){var e=t.data;e=(e=e.replace(new RegExp("<svg","gm"),"<svg style='width: 100%;height: 100%;'")).replace(new RegExp("https://www.didaplan.cn/3D/ewm.png","gm"),"data:image/webp;base64,UklGRmwMAABXRUJQVlA4WAoAAAAwAAAArwQArwQASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBISwAAAAEHEBERAFCk//8pov+p//3vf//73//+97///e9///vf//73v//973//+9///ve///3vf//73//+97///e9///vf//73v//97/+kAQBWUDggKgoAAPAxAZ0BKrAEsAQ+bTaZSaQjIqEgCACADYlpbuF3YRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/6wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="),a.res.forEach(function(t){e=e.replace(new RegExp("https://www.didaplan.cn/3D/"+t.name+".png","gm"),t.content)}),a.svgXml.push(e),i==a.svgpath.length-1&&(a.drawer=!0)}).catch(function(t){a.$message.error("Cutting configuration error!")})})},productDown:function(t){this.shilihua=0,this.scrollImg=0,this.$emit("clickProduct",t),this.productColorIndex=0,this.productSizeIndex=0},materialDown:function(t,e){var i,a,n=this,r=0,s=(this.currentMaterialIndex=e,new window.Image),o=(s.crossOrigin="anonymous",s.src=t.thumb1200,t.thumb1200),l=t.img_url;s.onload=function(){var t;0==r&&(r=1,i=s.width,(a=s.height)<i?(t=i/600,i=600,a/=t):(t=a/600,a=600,i/=t),t={sourceid:n.sourceList.source_list[e].id,src:o,src1:l,name:"rectTransformer",image:s,width:i,height:a,draggable:!0,x:(600-i)/2+i/2,y:(600-a)/2+a/2,rotation:0,offset:{x:i/2,y:a/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:s.width,naturalHeight:s.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:0,viewportTransform:[0,0]},n.images.push(t),n.addElem(t),n.jilu())}},productLeave:function(t){this.currentProduct=""},lingshiceshi:function(a){var n=this,r=(this.allLoading=!0,new window.Image),t=(new Date).getTime().toString(),s=(r.crossOrigin="anonymous",r.timestamp=t,r.src=a+"?imageView2/2/w/1200",this.curImg.attrs.sourceid),o=this.curImg.attrs.rotation;r.onerror=function(){n.allLoading=!1,n.$message.error("Material loading error!")},r.onload=function(){n.transformer.children.forEach(function(t){t.nodes([])}),n.curImg.destroy();var t,e=r.width,i=r.height,e=(i<e?(t=e/600,e=600,i/=t):(t=i/600,i=600,e/=t),t={sourceid:s,src:a+"?imageView2/2/w/1200",src1:a,name:"rectTransformer",image:r,width:e,height:i,draggable:!0,x:(600-e)/2+e/2,y:(600-i)/2+i/2,rotation:0,offset:{x:e/2,y:i/2},scaleX:1,scaleY:1,flipX:0,flipY:0,left:0,top:0,putu:0,naturalWidth:r.width,naturalHeight:r.height,canvasZoom:1,marginLeft:0,marginTop:0,angle:void 0},Object(l.a)(t,"rotation",o),Object(l.a)(t,"viewportTransform",[0,0]),t);n.images.push(e),n.addElem(e),n.allLoading=!1,n.jilu()}},imageDesign:function(t){var r,e,s=this,o=this;null!=t?(r=[],t.forEach(function(t,e){var i,a,n;null!=t.image?(i=new window.Image,a=(new Date).getTime().toString(),i.crossOrigin="anonymous",i.timestamp=a,i.src=t.src,o.images.push(t),i.onload=function(){t.image=i,r[e]=t}):null!=t.text?r[e]=t:((a=o.fill).find(".fill").forEach(function(t){t.destroy()}),o.color=t,n=new y.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:t}),a.add(n),n.moveToBottom())}),e=setInterval(function(){r.length!=t.length-1||r.includes(void 0)||(o.chehuiemptyCanvas(),clearInterval(e),r.forEach(function(t){var e,i,a,n,r;null!=t.text?(e=o.layer,i=o.transformer,a=o.stage,n=new y.a.Text(t),e.add(n),r=new y.a.Transformer({node:n,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(n.fontSize()+70,e.width),e}}),n.on("transform",function(){n.setAttrs({width:n.width()*n.scaleX(),scaleY:1,scaleX:1})}),i.add(r),i.draw(),v(a,e,r,n,o.currentArea.id,s.deletCurImg),b(a),s.keydown(a,e,r),i.children.forEach(function(t){t.nodes([])})):o.addElem(t)}))},100)):o.emptyCanvas()},curDesign:function(t,e){var i,s,a,n,r,o,l,c,d=this;t.id!=this.currentArea.id&&(i=[],this.saveIds(),this.layerimages2=[],this.imageindex=0,(s=this).layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),this.layerimages[""+this.currentArea.id]=i,this.$emit("setCurrentArea",t,e),s.color="rgba(255,255,255,0)",i=JSON.stringify(i),sessionStorage.setItem(this.currentArea.id,i),this.emptyCanvas(),this.clearrect(),this.tag=0,document.getElementById("btn1")&&(e=document.getElementById("btn1"),a=document.getElementById("btn2"),n=document.getElementById("btn3"),r=document.getElementById("btn4"),e.style.color="black",e.style.backgroundColor="#f5f5f5",a.style.color="black",a.style.backgroundColor="#f5f5f5",n.style.color="black",n.style.backgroundColor="#f5f5f5",r.style.color="black",r.style.backgroundColor="#f5f5f5"),t.id)&&(this.popovervisible=!1,null!=(o=JSON.parse(sessionStorage.getItem(t.id))))&&(this.layerimages2[this.imageindex]=JSON.parse(sessionStorage.getItem(t.id)),l=[],o.forEach(function(t,e){var i,a,n;null!=t.image?(i=new window.Image,a=(new Date).getTime().toString(),i.crossOrigin="anonymous",i.timestamp=a,i.src=t.src,s.images.push(t),i.onload=function(){t.image=i,l[e]=t}):null!=t.text?l[e]=t:((a=s.fill).find(".fill").forEach(function(t){t.destroy()}),s.color=t,n=new y.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:t}),a.add(n),n.moveToBottom())}),c=setInterval(function(){l.length!=o.length-1||l.includes(void 0)||(clearInterval(c),l.forEach(function(t){var e,i,a,n,r;null!=t.text?(e=s.layer,i=s.transformer,a=s.stage,n=new y.a.Text(t),e.add(n),d.curImg=n,r=new y.a.Transformer({node:n,enabledAnchors:["middle-left","middle-right","top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(t,e){return e.width=Math.max(n.fontSize()+70,e.width),e}}),n.on("transform",function(){n.setAttrs({width:n.width()*n.scaleX(),scaleY:1,scaleX:1})}),i.add(r),i.draw(),v(a,e,r,n,s.currentArea.id,d.deletCurImg),b(a),d.keydown(a,e,r),i.children.forEach(function(t){t.nodes([])})):s.addElemnew(t)}))},100))},swiperNext:function(){this.shilihua=0,this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex+1,this.save()},swiperPrev:function(){this.shilihua=0,this.scrollImg=this.$refs.interSwiper.$swiper.activeIndex-1,this.save()},setPage1:function(t){var e;this.material.keywords==[]?(e={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:t,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords},this.$emit("materialSearch",e)):(e={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:t,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords.join(",")},this.$emit("materialSearch",e))},setNum1:function(t){t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:t,name:this.material.name,keywords:this.material.keywords.join(",")};this.$emit("materialSearch",t)},setPage:function(t){this.product.pageNumber=t,"ALL"==this.product.tag&&(this.product.tag=""),"ALL"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},setNum:function(t){this.product.pageSize=t,"ALL"==this.product.tag&&(this.product.tag=""),"ALL"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},productSearch:function(){this.product.pageNumber=1,""!=this.product.cid&&(this.product.cid=this.product.cid[this.product.cid.length-1]),"ALL"==this.product.tag&&(this.product.tag=""),"ALL"==this.product.level&&(this.product.level=""),this.$emit("productSearch",this.product)},materialSearch:function(){var t;this.material.pageNumber=1,this.material.keywords==[]?(t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords},this.$emit("materialSearch",t)):(t={userId:this.material.userId,fid:this.material.fid[this.material.fid.length-1],pageNumber:1,pageSize:this.material.pageSize,name:this.material.name,keywords:this.material.keywords.join(",")},this.$emit("materialSearch",t))},resetProduct:function(){this.product.name="",this.product.cid="",this.product.pageNumber=1,this.product.pageSize=20,this.product.tag="",this.product.level="",this.$emit("productSearch",this.product)},resetProduct1:function(){this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("materialSearch",this.material)},carNum:function(t){""==t&&(this.car.num=1)},setProductColor:function(t){this.shilihua=0,this.productColorIndex=t,this.productSizeIndex=0,this.$emit("setSizes",t,this.currentId)},setProductColor2:function(t){this.shilihua=0,this.productColorIndex=t,this.productSizeIndex=0,this.$emit("setSizes2",t,this.currentId)},setProductSize:function(t,e){this.shilihua=0,this.productSizeIndex=e,this.$emit("setColor",e,this.productColorIndex,this.currentId),this.$emit("setAttrId",t.id)},setProductSize2:function(t,e){this.shilihua=0,this.productSizeIndex=e,this.$emit("setColor2",e,this.productColorIndex,this.currentId),this.$emit("setAttrId",t.id)},saveIds:function(){for(var t=this,i=(this.sourceIds=[],0);i<window._this.productDetail.design_list.length;i++)!function(){var e=[];t.layer.children.forEach(function(t){t=t.attrs.sourceid;e.push(t)}),e=JSON.stringify(e),sessionStorage.setItem(t.currentArea.id+"id",e),window._this.productDetail.design_list[i].id&&t.sourceIds.push(JSON.parse(sessionStorage.getItem(window._this.productDetail.design_list[i].id+"id")))}()},addCart:function(t){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("addCar",t,this.car,this.productColorIndex,this.sourceIds)},addCar:function(){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("addCar",this.productDetail.attr_list[this.productColorIndex].sizes[this.productSizeIndex].id,this.car,this.productColorIndex,this.sourceIds)},saveCanvas:function(){var e=[];this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||e.push(t),null!=t.text&&e.push(t)}),e.push(this.color),this.layerimages[""+this.currentArea.id]=e,this.save(),this.saveIds(),this.$emit("saveCanvas",this.productDetail.attr_list[this.productColorIndex].sizes[this.productSizeIndex].id,this.productColorIndex,this.sourceIds)},copyCanvas:function(t){var e,i,a=this;t==this.currentArea?this.$message.error("At the current mask, there is no need to copy."):(window._this.transformer.children.forEach(function(t){t.nodes([])}),window._this.grid.find(".grid").forEach(function(t){t.hide()}),window._this.grid.find(".gridLh").forEach(function(t){t.hide()}),window._this.grid.find(".gridLv").forEach(function(t){t.hide()}),e=window._this.stage.toDataURL({mimeType:"image/webp",pixelRatio:2}),window._this.grid.find(".grid").forEach(function(t){t.show()}),window._this.grid.find(".gridLh").forEach(function(t){t.show()}),window._this.grid.find(".gridLv").forEach(function(t){t.show()}),0==this.layer.children.length?this.$message.error("There are no images on this layer"):(i=[],this.layer.children.forEach(function(t){t=t.attrs;null==t.image||t.hasOwnProperty("pingpu")||i.push(t),null!=t.text&&i.push(t)}),i.push(this.color),"all"==t?this.productDetail.design_list.forEach(function(t){t!=a.currentArea&&(a.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)),a.$emit("getDesignTemp","",t,a.scrollImg,e,e))}):(this.layerimages[""+t.id]=i,sessionStorage.setItem(t.id,JSON.stringify(i)),this.$emit("getDesignTemp","",t,this.scrollImg,e,e)),this.$message({message:"Copy successful",type:"success"})))},setPop:function(){this.$emit("openBigImg",{colorIndex:this.productColorIndex})},keycodes:function(){document.oncontextmenu=function(){return!1},document.addEventListener("keydown",function(t){("F12"==t.key||"Ctrl"==t.key&&"shift"==t.key&&"i"==t.key||"shift"==t.key&&"F10"==t.key)&&t.preventDefault()})},closeCropper:function(){this.myCropper.destroy(),this.dialogVisible=!1},handleChangeRotate:function(t){this.cropperrotateTo(t)},initcrop:function(){this.myCropper=new H.a(this.$refs.imagecrop,{viewMode:1,dragMode:"move",preview:".before",background:!1,autoCropArea:.5,zoomOnWheel:!0,aspectRatio:this.autoCropWidth/this.autoCropHeight,minCropBoxWidth:1,minCropBoxHeight:1}),this.myCropper.replace(this.curImg.attrs.src1)},sureSava:function(){var t,e=this,i=(this.croploading=!0,this.curImg.attrs.src1.match(/\.([^.]+)$/)),i=(this.afterImg=this.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toDataURL("image/".concat(i?i[1]:"png")),this.dataURLtoFile(this.afterImg,"crop.".concat(i?i[1]:"png")));20<Number(i.size/1024/1024)?(this.croploading=!1,this.$msgbox({title:"",message:"The cutting image quality is high, and the image size has exceeded 20MB. Please re frame the selection.",type:"warning"})):((t=new FormData).append("file",i),Object(k.a)(t).then(function(t){e.croploading=!1,1==t.data.code?(e.dialogVisible=!1,e.lingshiceshi(t.data.data.url)):e.messageBox(t)}))},cropperzoom:function(t){this.myCropper.zoom(t)},cropperReset:function(){this.myCropper.reset(),this.ScaleX=1,this.ScaleY=1},croppermove:function(t,e){this.myCropper.move(t,e)},cropperRotate:function(t){this.myCropper.rotate(t)},cropperrotateTo:function(t){this.myCropper.rotateTo(t)},cropperScaleX:function(){this.ScaleX=-this.ScaleX,-90===this.myCropper.getImageData().rotate||90===this.myCropper.getImageData().rotate?this.myCropper.scaleY(this.ScaleX):this.myCropper.scaleX(this.ScaleX)},cropperScaleY:function(){this.ScaleY=-this.ScaleY,-90===this.myCropper.getImageData().rotate||90===this.myCropper.getImageData().rotate?this.myCropper.scaleX(this.ScaleY):this.myCropper.scaleY(this.ScaleY)},getKonvaScale:function(){var t=document.body.style.zoom||1,e=document.getElementById("container"),i=(1/t).toFixed(3);e.style.transform="scale(".concat(t,")"),e.style.zoom=i,e.style.transformOrigin="0px 0px"},handleColorPickerClick:function(){var a=(1/(document.body.style.zoom||1)).toFixed(3);setTimeout(function(){var t=document.getElementsByClassName("el-color-dropdown el-color-picker__panel");0<t.length&&t.forEach(function(t){t.style.zoom=a;var e=parseInt(t.style.top,10),i=parseInt(t.style.left,10);t.style.top=(e/a).toFixed(2).toString()+"px",t.style.left=(i/a).toFixed(2).toString()+"px"})},10)}},mounted:function(){},watch:{"material.userId":{handler:function(t,e){this.material.name="",this.material.fid="",this.material.pageNumber=1,this.material.pageSize=20,this.material.keywords=[],this.$emit("getFolderlist",this.material.userId),this.$emit("getKeywordlist",this.material.userId),this.materialSearch()}},color:function(t,e){var i=this.fill,a=(i.find(".fill").forEach(function(t){t.destroy()}),new y.a.RegularPolygon({name:"fill",x:300,y:300,sides:4,radius:600,fill:this.color}));i.add(a),a.moveToBottom(),this.save()},Gradientcolor3:function(t,e){this.generateImage()},Gradientcolor4:function(t,e){this.generateImage()},Gradientcolor5:function(t,e){this.generateImage2()},Gradientcolor6:function(t,e){this.generateImage3()},Gradientcolor7:function(t,e){this.generateImage3()},lucency:function(t,e){this.curImg.setOpacity(t/100),this.save()},active:function(t){this.$refs.redefineSwipe1.$swiper.slideTo(t)},layer:{handler:function(t,e){},deep:!0},"curImg.attrs":{handler:function(t,e){this.curImg&&null!=this.curImg.text||(this.popovervisible=!1),1==this.click_up&&(this.click_up=2),this.curImg&&(1==this.curImg.attrs.flipX&&this.curImg.attrs.angle1!=this.curImg.attrs.rotation?this.curImg.attrs.angle=this.curImg.attrs.rotation+180:this.curImg.attrs.angle=this.curImg.attrs.rotation),document.getElementsByClassName("changeb")[1]&&(0!=document.getElementsByClassName("body")[0].style.zIndex?(document.getElementsByClassName("changeb")[0].classList.add("actionb"),document.getElementsByClassName("changeb")[1]):(document.getElementsByClassName("changeb")[1].classList.add("actionb"),document.getElementsByClassName("changeb")[0])).classList.remove("actionb"),this.curImg&&document.getElementById("btn1")&&(1==this.tag&&(document.getElementById("btn1").style.backgroundColor="var(--style-color-design)"),2==this.tag&&(document.getElementById("btn2").style.backgroundColor="var(--style-color-design)"),3==this.tag&&(document.getElementById("btn3").style.backgroundColor="var(--style-color-design)"),4==this.tag)&&(document.getElementById("btn4").style.backgroundColor="var(--style-color-design)"),this.save()},deep:!0}},created:function(){var e=this;this.keycodes(),window._this=this;for(var t=200;11<t;t-=2)this.fontSize.unshift(t);setTimeout(function(t){e.stage=e.pageStage,e.fill=e.pageLayer[0].fillLayer,e.layer=e.pageLayer[1].layer,e.transformer=e.pageLayer[2].transformer,e.grid=e.pageLayer[3].gridLayer,e.tr=new y.a.Transformer({name:"tr",status:"",centeredScaling:!0}),e.transformer.add(e.tr),e.transformer.draw(),e.getKonvaScale()},20);var i=this.$route.query.type;sessionStorage.clear(),i&&this.clickChange(i)},computed:{formatTooltip:function(){this.lucency=100*this.curImg.getOpacity()}}},r=(e("2e7e"),e("42ee"),e("37ca"),Object(g.a)(j,function(){var a=this,t=a.$createElement,n=a._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.allLoading,expression:"allLoading"}],staticClass:"content",staticStyle:{width:"var(--min-width)"},on:{click:function(t){a.keywordShow=!1}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!a.popShow,expression:"!popShow"}],staticClass:"ct"},[n("div",{staticClass:"left"},[n("div",{staticClass:"button"},[n("input",{ref:"file",staticClass:"input-opacity",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpeg, image/png, image/jpg"},on:{change:function(t){return a.addImage(t)}}}),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:function(t){return a.clickChange("product")}}},[a._v("Product")]),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:function(t){return a.clickChange("Material")}}},[a._v("Material")]),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:function(t){return a.clickChange("image")}}},[a._v("Local")]),n("el-button",{attrs:{type:"primary",size:"big",plain:""},on:{click:a.addFont}},[a._v("Text")])],1),"product"==a.leftButtonStatus?n("div",{staticClass:"productSearch"},[n("div",{staticClass:"search"},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"Please enter search content",size:"small"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.productSearch.apply(null,arguments)}},model:{value:a.product.name,callback:function(t){a.$set(a.product,"name",t)},expression:"product.name"}},[n("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},on:{click:function(t){return a.productSearch()}},slot:"append"})],1)],1),n("div",{staticClass:"cascader"},[n("div",{staticClass:"item"},[n("el-cascader",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],ref:"selectDeptRef",attrs:{options:a.category,props:a.cateListProps,size:"small",placeholder:"Select"},on:{change:a.setCategory},model:{value:a.product.cid,callback:function(t){a.$set(a.product,"cid",t)},expression:"product.cid"}})],1),n("div",{staticClass:"item"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{size:"small"},model:{value:a.product.tag,callback:function(t){a.$set(a.product,"tag",t)},expression:"product.tag"}},a._l(a.category1,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),n("div",{staticClass:"item"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{size:"small"},model:{value:a.product.level,callback:function(t){a.$set(a.product,"level",t)},expression:"product.level"}},a._l(a.level,function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}),1)],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{type:"text",size:"small"},on:{click:a.resetProduct}},[a._v("Reset")])],1)])]):a._e(),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.productLoding,expression:"productLoding"}],staticClass:"productShow"},["product"==a.leftButtonStatus?n("div",{staticClass:"productList"},a._l(a.productList.product_list,function(e,t){return n("div",{staticClass:"item",class:a.currentId==e.id?"curItem":"",on:{mousemove:function(t){return a.productMove(e)},mouseleave:function(t){return a.productLeave(e)},click:function(t){return a.productDown(e)}}},[n("img",{attrs:{src:e.img_url,alt:""}})])}),0):a._e(),"product"==a.leftButtonStatus?n("div",{staticClass:"imgPage"},[n("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{small:"","current-page":a.product.pageNumber,"page-sizes":[20,50,100,200],"page-size":a.product.pageSize,"pager-count":5,layout:" prev, pager, next",total:a.productList.num_total},on:{"size-change":a.setNum,"current-change":a.setPage,"update:currentPage":function(t){return a.$set(a.product,"pageNumber",t)},"update:current-page":function(t){return a.$set(a.product,"pageNumber",t)}}})],1):a._e()]),"Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"productSearch"},[n("div",{staticClass:"search"},[n("el-form",{ref:"form",staticStyle:{display:"flex","flex-wrap":"wrap",height:"31px"},attrs:{model:a.search,size:"small"}},[n("search-account",{staticStyle:{width:"98px"},attrs:{defaultMyself:!0,multiple:!1,English:!0,label1:1,width1:0},model:{value:a.material.userId,callback:function(t){a.$set(a.material,"userId",t)},expression:"material.userId"}}),n("el-form-item",{staticStyle:{"margin-top":"1px"},attrs:{"label-width":"10px"}},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"Please enter search content",size:"small"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&a._k(t.keyCode,"enter",13,t.key,"Enter")?null:a.materialSearch.apply(null,arguments)}},model:{value:a.material.name,callback:function(t){a.$set(a.material,"name",t)},expression:"material.name"}},[n("el-button",{attrs:{slot:"append",size:"mini",icon:"el-icon-search"},on:{click:function(t){return a.materialSearch()}},slot:"append"})],1)],1)],1)],1),n("div",{staticClass:"cascader"},[a.folderList.length!=[]?n("div",{staticClass:"item"},[n("el-cascader",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],ref:"selectDeptRef1",attrs:{options:a.folderList,props:a.cateListProps,size:"small",placeholder:"Folder"},on:{change:a.setCategory1},model:{value:a.material.fid,callback:function(t){a.$set(a.material,"fid",t)},expression:"material.fid"}})],1):a._e(),n("div",{staticClass:"item",staticStyle:{"line-height":"32px",cursor:"pointer"},on:{click:function(t){t.stopPropagation(),a.keywordShow=!a.keywordShow}}},[n("span",{staticStyle:{"font-size":"13px"}},[a._v("Keyword")]),n("span",[a.keywordShow?n("i",{staticClass:"el-icon-arrow-up"}):n("i",{staticClass:"el-icon-arrow-down"})])]),a.keywordShow?n("div",{staticClass:"options",on:{click:function(t){t.stopPropagation()}}},[n("el-checkbox-group",{attrs:{size:"mini"},model:{value:a.material.keywords,callback:function(t){a.$set(a.material,"keywords",t)},expression:"material.keywords"}},a._l(a.keywordList,function(t){return n("el-checkbox-button",{key:t,attrs:{label:t},on:{change:function(t){return a.materialSearch()}}},[a._v(a._s(t))])}),1)],1):a._e(),n("div",{staticClass:"item"},[n("el-button",{attrs:{type:"text",size:"small"},on:{click:a.resetProduct1}},[a._v("Reset")])],1)])]):a._e(),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.materiaLoding,expression:"materiaLoding"}],staticClass:"materialShow"},["Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"productList"},a._l(a.sourceList.source_list,function(e,i){return n("div",{staticClass:"item",class:a.currentMaterialIndex==i?"curItem":"",on:{mousemove:function(t){return a.productMove(e)},mouseleave:function(t){return a.productLeave(e)},click:function(t){return a.materialDown(e,i)}}},[n("img",{attrs:{src:e.thumb,alt:""}})])}),0):a._e(),"Material"==a.leftButtonStatus||"background"==a.leftButtonStatus?n("div",{staticClass:"imgPage"},[n("el-pagination",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{small:"","current-page":a.material.pageNumber,"page-sizes":[20,50,100,200],"page-size":a.material.pageSize,"pager-count":5,layout:" prev, pager, next",total:a.sourceList.num_total},on:{"size-change":a.setNum1,"current-change":a.setPage1,"update:currentPage":function(t){return a.$set(a.material,"pageNumber",t)},"update:current-page":function(t){return a.$set(a.material,"pageNumber",t)}}})],1):a._e()]),""!=a.currentProduct?n("div",{staticClass:"product"},[n("div",{staticClass:"img"},[n("img",{attrs:{src:a.currentProduct.thumb1200||a.currentProduct.img_url,alt:""}})]),n("div",{staticClass:"title"},[a._v(a._s(a.currentProduct.name))]),n("div",{staticClass:"detail"},[n("p",[a._v("Image Code："+a._s(a.currentProduct.code))]),1==a.currentProduct.level?n("p",[n("img",{attrs:{src:e("28e5"),alt:""}}),n("span",[a._v("Entrepreneur Edition")])]):a._e(),2==a.currentProduct.level?n("p",[n("img",{attrs:{src:e("f027"),alt:""}}),n("span",[a._v("Professional Edition")])]):a._e(),3==a.currentProduct.level?n("p",[n("img",{attrs:{src:e("5eae"),alt:""}}),n("span",[a._v("Advanced Edition")])]):a._e()]),a.currentProduct.price?n("div",{staticClass:"money"},[a._v(" ￥"+a._s(a.currentProduct.price)+" ")]):a._e(),a.currentProduct.colors?n("div",{staticClass:"color"},a._l(a.currentProduct.colors,function(t){return n("p",{style:{background:t.color}})}),0):a._e(),a.currentProduct.width?n("div",{staticClass:"size"},[a._v(" Image dimensions： "),n("span",[a._v(a._s(a.currentProduct.width))]),a._v("px * "),n("span",[a._v(a._s(a.currentProduct.height))]),a._v("px ")]):a._e()]):a._e()]),n("div",{staticClass:"curProduct"},a._l(a.productDetail.design_list,function(e,i){return n("div",{staticClass:"item",class:e==a.currentArea?"curItem":"",on:{click:function(t){return a.curDesign(e,i)}}},[n("img",{attrs:{src:e?e.area_path:"",alt:""}}),e.show_diy_layername?n("div",{staticStyle:{"align-self":"center"}},[a._v(a._s(e.diy_layername))]):n("div",{staticStyle:{"align-self":"center"}},[a._v("Layer"+a._s(i+1))])])}),0),n("div",{staticClass:"canvas"},[n("div",{staticClass:"button"},[0<a.imageindex?n("p",{staticStyle:{"margin-right":"10px","margin-top":"4px"},attrs:{title:"Undo"},on:{click:a.chexiao}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("7661")}})]):n("p",{staticStyle:{"margin-right":"10px","margin-top":"4px"},attrs:{title:"Undo"}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("b2b5")}})]),a.imageindex+1<a.layerimages2.length?n("p",{staticStyle:{"margin-right":"10px","margin-top":"4px"},attrs:{title:"Redo"},on:{click:a.chonzuo}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("2c2b")}})]):n("p",{staticStyle:{"margin-right":"10px","margin-top":"4px"},attrs:{title:"Redo"}},[n("img",{staticStyle:{width:"110%",cursor:"pointer"},attrs:{src:e("fd5f")}})]),n("p",[n("el-button",{attrs:{type:"primary",size:"big"},on:{click:a.drawGrid}},[a._v("Auxiliary grid")])],1),n("p",[n("el-dropdown",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}]},[n("el-button",{staticStyle:{"margin-left":"5px"},attrs:{type:"primary",size:"big"}},[a._v(" Shortcut keys "),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),n("el-dropdown-menu",{staticClass:"keylist",attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("move up")]),n("p",{staticClass:"keybox"},[a._v("↑")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("move down")]),n("p",{staticClass:"keybox"},[a._v("↓")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("move left")]),n("p",{staticClass:"keybox"},[a._v("←")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("move right")]),n("p",{staticClass:"keybox"},[a._v("→")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("Rotate counterclockwise 45°")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + Q")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("Clockwise 45° rotation")]),n("p",{staticClass:"keybox"},[a._v("Alt + Q")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("amplify")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + Z")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("reduce")]),n("p",{staticClass:"keybox"},[a._v("Alt + Z")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("delete")]),n("p",{staticClass:"keybox"},[a._v("Delete")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("save")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + S")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("copy")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + C")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("image fill")]),n("p",{staticClass:"keybox"},[a._v("Ctrl + B")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("image adaptation")]),n("p",{staticClass:"keybox"},[a._v("Alt + B")])])]),n("el-dropdown-item",[n("div",{staticClass:"keydow"},[n("p",[a._v("clear all designs")]),n("p",{staticClass:"keybox"},[a._v("Shift + R")])])])],1)],1)],1),n("p",[n("el-button",{staticStyle:{margin:"0 5px"},attrs:{type:"primary",size:"big"},on:{click:a.emptyCanvas2}},[a._v("Empty canvas")])],1),n("p"),n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{staticStyle:{"margin-right":"5px","margin-top":"2px"},attrs:{"show-alpha":"",size:"small"},on:{change:a.handleClear},model:{value:a.color,callback:function(t){a.color=t},expression:"color"}})],1),n("p",{staticStyle:{"margin-top":"4px"},attrs:{title:"Color absorber (pure white is the default color and cannot be absorbed. Please manually select the upper left corner of the panel)"},on:{touchstart:a.getcolor,click:a.getcolor}},[n("img",{staticStyle:{width:"70%",cursor:"pointer"},attrs:{src:e("889b")}})]),n("div",[n("input",{staticStyle:{width:"0px",height:"0px",opacity:"0"},attrs:{id:"getcolor",type:"color"},domProps:{value:a.defaultcolor},on:{input:a.nativePick}})]),n("p",{staticStyle:{"font-size":"25px",color:"var(--style-color-design)",cursor:"pointer"},attrs:{title:"Crop"}},[a.curImg&&null!=a.curImg.attrs.image&&1!=a.curImg.attrs.putu?n("i",{staticClass:"el-icon-crop",on:{click:function(t){return a.cropimage()}}}):a._e()]),n("p"),n("p",{staticStyle:{"margin-left":"5px"}})]),0==a.dwarning?n("div",{staticClass:"dwarn"},[a._m(0),n("div")]):a._e(),n("div",{staticClass:"konva"},[a.productDetail.design_list&&1!=a.productDetail.design_list.length?n("div",{staticClass:"copy"},[n("p",[a._v("Copy to")]),n("div",{staticClass:"copy-list"},[n("div",{staticClass:"item",on:{click:function(t){return a.copyCanvas("all")}}},[a._v("ALL")]),a._l(a.productDetail.design_list,function(e,t){return n("div",{staticClass:"item",on:{click:function(t){return a.copyCanvas(e)}}},[e.show_diy_layername?n("a",[a._v(a._s(e.diy_layername))]):n("a",[a._v("Layer"+a._s(t+1))])])})],2)]):a._e(),n("div",{staticClass:"k-img"},[""!=a.currentArea?n("img",{ref:"myImg",attrs:{src:a.currentArea.cutpiece}}):a._e()]),n("div",{staticClass:"k-img1"},[a.curImg&&Math.abs(this.curImg.attrs.x-300)<2&&0!=a.click_up?n("img",{attrs:{src:e("52f9")}}):a._e()]),n("div",{staticClass:"k-img1"},[a.curImg&&Math.abs(this.curImg.attrs.y-300)<2&&0!=a.click_up?n("img",{attrs:{src:e("fb9f")}}):a._e()]),n("div",{ref:"container",staticClass:"container",attrs:{id:"container"}})])]),n("div",{staticClass:"right"},[a.curImg?n("div",{staticClass:"edit"},[n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"Bring to front"},on:{click:function(t){return a.rightButton("top")}}},[n("img",{attrs:{src:e("aa70"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status||1==a.curImg.attrs.putu,type:"text",title:"Send to back"},on:{click:function(t){return a.rightButton("bottom")}}},[n("img",{attrs:{src:e("d780"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"Move up"},on:{click:function(t){return a.rightButton("up")}}},[n("img",{attrs:{src:e("584e"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:"background"==a.curImg.attrs.status,type:"text",title:"Move down"},on:{click:function(t){return a.rightButton("down")}}},[n("img",{attrs:{src:e("06db"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Copy layer"},on:{click:function(t){return a.rightButton("copy")}}},[n("img",{attrs:{src:e("27d4"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Delete layer"},on:{click:function(t){return a.rightButton("delet")}}},[n("img",{attrs:{src:e("a8cf"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Align left"},on:{click:function(t){return a.rightButton("LeftAlignment")}}},[n("img",{attrs:{src:e("8efd"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Align horizontal center"},on:{click:function(t){return a.rightButton("Center")}}},[n("img",{attrs:{src:e("66a3"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Align right"},on:{click:function(t){return a.rightButton("RightAlignment")}}},[n("img",{attrs:{src:e("570d"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Align top"},on:{click:function(t){return a.rightButton("TopAlignment")}}},[n("img",{attrs:{src:e("5f7f"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Align vertical center"},on:{click:function(t){return a.rightButton("VerticalAlignment")}}},[n("img",{attrs:{src:e("0768"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",disabled:null!=a.curImg.attrs.text,type:"text",title:"Align bottom"},on:{click:function(t){return a.rightButton("BottomAlignment")}}},[n("img",{attrs:{src:e("0958"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Zoom in"},on:{click:function(t){return a.rightButton("amplification")}}},[n("img",{attrs:{src:e("c1c5"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Zoom out"},on:{click:function(t){return a.rightButton("narrow")}}},[n("img",{attrs:{src:e("81e5"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Rotate counterclockwise"},on:{click:function(t){return a.rightButton("CounterclockwiseRotation")}}},[n("img",{attrs:{src:e("619a"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Rotate clockwise"},on:{click:function(t){return a.rightButton("ClockwiseRotation")}}},[n("img",{attrs:{src:e("33b2"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Flip horizontally"},on:{click:function(t){return a.rightButton("horizontal")}}},[n("img",{attrs:{src:e("4660"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{size:"small",type:"text",title:"Flip vertically"},on:{click:function(t){return a.rightButton("vertical")}}},[n("img",{attrs:{src:e("97ca2"),alt:""}})])],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"},on:{click:function(t){return a.cutout()}}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"Cut out",placement:"top"}},[n("img",{attrs:{src:e("3572"),alt:""}})])],1)],1),n("div",{staticClass:"item"},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"},on:{click:function(t){return a.imageClarity()}}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"Sharpen",placement:"top"}},[n("img",{attrs:{src:e("0128"),alt:""}})])],1)],1),n("div",{staticClass:"item"},[n("el-dropdown",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}]},[n("el-button",{attrs:{disabled:null!=a.curImg.attrs.text||1==a.curImg.attrs.putu,size:"small",type:"text"}},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{effect:"dark",content:"Filter",placement:"top"}},[n("img",{attrs:{src:e("5ccf"),alt:""}})])],1),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("div",{staticStyle:{"margin-left":"10px","font-size":"15px",color:"var(--style-color-design)"}},[a._v("Filter style")]),n("div",{staticClass:"lvjing_box"},a._l(a.lvjingList,function(e){return n("img",{attrs:{src:e,alt:""},on:{click:function(t){return a.styleTransfer(e)}}})}),0)])],1)],1)]):a._e(),a.curImg?n("div",{staticClass:"opacity"},[n("p",[a._v("Transparency：")]),n("div",{staticClass:"lucency"},[n("el-slider",{attrs:{"format-tooltip":a.formatTooltip},model:{value:a.lucency,callback:function(t){a.lucency=t},expression:"lucency"}})],1)]):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"imgEdit"},[n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small"},on:{click:function(t){return a.rightButton("imageFill")}}},[a._v(" Image"),n("br"),a._v("fill")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small"},on:{click:function(t){return a.rightButton("imageAdaptive")}}},[a._v("Image"),n("br"),a._v("adaptation")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible=!0}}},[a._v("Gradient"),n("br"),a._v("filter")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible2=!0}}},[a._v("Primary"),n("br"),a._v("color filter")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible3=!0}}},[a._v("Stack"),n("br"),a._v("filter")])],1),n("div",{staticClass:"item"},[n("el-button",{staticStyle:{height:"50px","background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"small",disabled:1==a.curImg.attrs.putu},on:{click:function(t){a.lvjingVisible4=!0}}},[a._v("Grayscale"),n("br"),a._v("filter")])],1)]):a._e(),a.curImg&&a.curImg.attrs.text?n("div",{staticClass:"fontEdit"},[n("div",{staticClass:"flex"},[n("div",{staticClass:"fontFamliy"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"big"},on:{change:a.pickFontFamily},model:{value:a.fontFamily,callback:function(t){a.fontFamily=t},expression:"fontFamily"}},a._l(a.options,function(t){return n("el-option",{key:t.value,style:{fontFamily:t.value,fontSize:"20px",width:"200px"},attrs:{label:t.label,value:t.value}})}),1)],1),n("el-popover",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placement:"bottom",width:"520",title:"Text effects",trigger:"manual"},model:{value:a.popovervisible,callback:function(t){a.popovervisible=t},expression:"popovervisible"}},[n("button",{staticClass:"close-button",staticStyle:{position:"absolute",right:"7px",top:"5px","font-size":"22px",cursor:"pointer"},on:{click:function(t){a.popovervisible=!1}}},[n("i",{staticClass:"el-icon-close"})]),n("div",{staticStyle:{height:"420px","overflow-y":"scroll"}},[n("el-form",{attrs:{"label-position":"right","label-width":"120px"}},[n("el-form-item",{attrs:{label:"Gradient enabled"}},[n("el-switch",{attrs:{"active-text":"Yes","inactive-text":"No"},on:{change:a.toggleGradient},model:{value:a.gradientEnabled,callback:function(t){a.gradientEnabled=t},expression:"gradientEnabled"}})],1),a.gradientEnabled?[n("el-form-item",{attrs:{label:"Start coordinates"}},[a._v(" X "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientStartX,callback:function(t){a.gradientStartX=t},expression:"gradientStartX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientStartY,callback:function(t){a.gradientStartY=t},expression:"gradientStartY"}})],1),n("el-form-item",{attrs:{label:"End coordinates"}},[a._v(" X "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientEndX,callback:function(t){a.gradientEndX=t},expression:"gradientEndX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"mini","controls-position":"right"},on:{change:a.updateGradient},model:{value:a.gradientEndY,callback:function(t){a.gradientEndY=t},expression:"gradientEndY"}})],1),n("el-form-item",{attrs:{label:"Gradient colors"}},[n("div",{staticStyle:{display:"flex","flex-wrap":"wrap","align-items":"center"}},[a._l(a.gradientColors,function(t,e){return[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"mini"},on:{change:a.updateGradient},model:{value:a.gradientColors[e],callback:function(t){a.$set(a.gradientColors,e,t)},expression:"gradientColors[index]"}})],1)]})],2)]),n("el-form-item",{attrs:{label:"Color increase/decrease"}},[n("el-button",{attrs:{disabled:10<=a.gradientColors.length,type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:a.addGradientColor}}),n("el-button",{attrs:{disabled:a.gradientColors.length<=2,type:"primary",size:"mini",icon:"el-icon-minus"},on:{click:a.delGradientColor}})],1)]:a._e(),n("el-form-item",{attrs:{label:"Stroke thickness"}},[n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:0,max:100},on:{change:a.pickFontstrokeWidth},model:{value:a.fontstrokeWidth,callback:function(t){a.fontstrokeWidth=t},expression:"fontstrokeWidth"}})],1),n("el-form-item",{attrs:{label:"Stroke color"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"mini"},on:{change:a.pickFontStrokeColor},model:{value:a.fontstrokeColor,callback:function(t){a.fontstrokeColor=t},expression:"fontstrokeColor"}})],1)]),n("el-form-item",{attrs:{label:"Line height"}},[n("el-input-number",{attrs:{size:"mini","controls-position":"right",step:.1,min:1,max:100},on:{change:a.pickFontlineHeight},model:{value:a.fontlineHeight,callback:function(t){a.fontlineHeight=t},expression:"fontlineHeight"}})],1),n("el-form-item",{attrs:{label:"Letter spacing"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:-50,max:250,step:5},on:{change:a.pickfontletterSpacing},model:{value:a.fontletterSpacing,callback:function(t){a.fontletterSpacing=t},expression:"fontletterSpacing"}})],1),n("el-form-item",{attrs:{label:"Text line"}},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"mini"},on:{change:a.pickFontDecoration},model:{value:a.textDecoration,callback:function(t){a.textDecoration=t},expression:"textDecoration"}},a._l(a.textdecorationoptions,function(t){return n("el-option",{key:t.value,style:{textDecoration:t.value},attrs:{label:t.label,value:t.value}})}),1)],1),n("el-form-item",{attrs:{label:"Text shadow"}},[n("el-switch",{attrs:{"active-text":"Open","inactive-text":"Close"},on:{change:a.toggleTextShadow},model:{value:a.textShadowEnabled,callback:function(t){a.textShadowEnabled=t},expression:"textShadowEnabled"}})],1),a.textShadowEnabled?[n("el-form-item",{attrs:{label:"Shadow color"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"mini"},on:{change:a.pickTextShadowColor},model:{value:a.textShadowColor,callback:function(t){a.textShadowColor=t},expression:"textShadowColor"}})],1)]),n("el-form-item",{attrs:{label:"Shadow transparency"}},[n("el-slider",{staticStyle:{width:"90%"},attrs:{min:0,max:1,step:.1},on:{change:a.pickTextShadowOpacity},model:{value:a.textShadowOpacity,callback:function(t){a.textShadowOpacity=t},expression:"textShadowOpacity"}})],1),n("el-form-item",{attrs:{label:"Shadow offset"}},[a._v(" X "),n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:-100,max:100},on:{change:a.pickTextShadowOffsetX},model:{value:a.textShadowOffsetX,callback:function(t){a.textShadowOffsetX=t},expression:"textShadowOffsetX"}}),a._v(" Y "),n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:-100,max:100},on:{change:a.pickTextShadowOffsetY},model:{value:a.textShadowOffsetY,callback:function(t){a.textShadowOffsetY=t},expression:"textShadowOffsetY"}})],1),n("el-form-item",{attrs:{label:"Blur intensity"}},[n("el-input-number",{attrs:{size:"mini","controls-position":"right",min:0,max:100},on:{change:a.pickTextShadowBlur},model:{value:a.textShadowBlur,callback:function(t){a.textShadowBlur=t},expression:"textShadowBlur"}})],1)]:a._e()],2)],1),n("el-button",{staticStyle:{margin:"0 10px"},attrs:{slot:"reference"},on:{click:function(t){a.popovervisible=!a.popovervisible}},slot:"reference"},[a._v("Text effects")])],1),n("div",{staticClass:"fontColor",staticStyle:{display:"flex"}},[n("p",{on:{click:a.handleColorPickerClick}},[n("el-color-picker",{attrs:{size:"small"},on:{change:a.pickFontColor},model:{value:a.fontColor,callback:function(t){a.fontColor=t},expression:"fontColor"}})],1)])],1),n("div",{staticClass:"flex"},[n("div",{staticClass:"fontSize"},[n("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{placeholder:"",size:"big"},on:{change:a.pickFontSize},model:{value:a.fontSizeStr,callback:function(t){a.fontSizeStr=t},expression:"fontSizeStr"}},a._l(a.fontSize,function(t,e){return n("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1),n("div",{staticClass:"fontButtom"},[n("el-button",{attrs:{size:"big",type:"text",title:"Text align left"},on:{click:function(t){return a.rightButton("fontLeft")}}},[n("img",{attrs:{src:e("e028"),alt:""}})])],1),n("div",{staticClass:"fontButtom"},[n("el-button",{attrs:{size:"big",type:"text",title:"Text align center"},on:{click:function(t){return a.rightButton("fontCenter")}}},[n("img",{attrs:{src:e("93f2"),alt:""}})])],1),n("div",{staticClass:"fontButtom"},[n("el-button",{attrs:{size:"big",type:"text",title:"Text align right"},on:{click:function(t){return a.rightButton("fontRight")}}},[n("img",{attrs:{src:e("ad16"),alt:""}})])],1)])]):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"btns"},[n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn1"},on:{click:function(t){return a.setPattern("jichu")}}},[a._v("Basic"),n("br"),a._v("tiling")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn2"},on:{click:function(t){return a.setPattern("jingxiang")}}},[a._v("Mirror"),n("br"),a._v("tiling")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn3"},on:{click:function(t){return a.setPattern("zongxiang")}}},[a._v("Vertical"),n("br"),a._v("tiling")]),n("el-button",{staticStyle:{"background-color":"#f5f5f5","border-radius":"0",border:"0"},attrs:{size:"big",id:"btn4"},on:{click:function(t){return a.setPattern("hengxiang")}}},[a._v("Horizontal"),n("br"),a._v("tiling")])],1):a._e(),a.curImg&&!a.curImg.attrs.text?n("div",{staticClass:"changeD"}):a._e(),a.productDetail.attr_list?n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.imgLoading,expression:"imgLoading"}],staticClass:"swiper"},[n("div",{staticClass:"swiper-no-swiping",attrs:{id:"xtu"}}),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"View larger image",placement:"top"}},[n("i",{staticClass:"el-icon-zoom-in pop",on:{click:a.setPop}})]),0<a.svgpath.length?n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"View cropped image",placement:"top"}},[n("i",{staticClass:"el-icon-s-help pop2",on:{click:a.cutpiece}})]):a._e()],1):a._e()])]),n("div",{directives:[{name:"show",rawName:"v-show",value:!a.popShow,expression:"!popShow"}],staticClass:"pick"},[n("div",{staticClass:"colors"},a._l(a.productDetail.attr_list,function(t,e){return n("p",{key:e,class:a.productColorIndex==e?"boder":"",style:{background:t.color},on:{click:function(t){return a.setProductColor(e)}}})}),0),n("div",{staticClass:"colors"},a._l(a.sizes,function(e,i){return n("p",{key:i,class:a.productSizeIndex==i?"boder":"",on:{click:function(t){return a.setProductSize(e,i)}}},[a._v(" "+a._s(e.size)+" ")])}),0),n("div",{staticClass:"addcar"},[n("el-input",{staticStyle:{width:"60px",height:"40px","margin-right":"10px"},attrs:{size:"big",type:"number",disabled:a.layerLength},on:{change:a.carNum},model:{value:a.car.num,callback:function(t){a.$set(a.car,"num",t)},expression:"car.num"}}),n("el-button",{staticStyle:{background:"#ec2755",color:"white",width:"220px",height:"39px",border:"1px solid rgb(236, 39, 85)","border-radius":"0"},attrs:{id:"save",size:"big",disabled:a.layerLength||a.imgLoading},on:{click:function(t){return a.addCar()}}},[a._v("Add to cart")]),n("el-button",{staticStyle:{height:"39px","border-radius":"0"},attrs:{size:"big",type:"primary",disabled:a.layerLength||a.imgLoading},on:{click:a.saveCanvas}},[a._v("Save")])],1)]),n("el-dialog",{attrs:{visible:a.drawer,title:"Crop preview",top:"60px",width:"30vw"},on:{"update:visible":function(t){a.drawer=t}}},[0<a.svgXml.length?n("div",[n("div",{staticClass:"vhtml",domProps:{innerHTML:a._s(a.svgXml[a.cutpiece_index])}})]):a._e(),n("div",{staticStyle:{display:"flex","justify-content":"center","margin-top":"20px"}},[n("el-button",{attrs:{disabled:a.cutpiece_index<=0,icon:"el-icon-arrow-left"},on:{click:function(t){a.cutpiece_index--}}}),n("el-button",{attrs:{disabled:a.cutpiece_index>=a.svgXml.length-1,icon:"el-icon-arrow-right"},on:{click:function(t){a.cutpiece_index++}}})],1),n("div",{staticClass:"cutp"},[a._v(" Color："),n("div",{staticClass:"colors"},a._l(a.productDetail.attr_list,function(t,e){return n("p",{key:e,class:a.productColorIndex==e?"boder":"",style:{background:t.color},on:{click:function(t){return a.setProductColor2(e)}}})}),0),a._v(" Specifications："),n("div",{staticClass:"colors"},a._l(a.sizes,function(e,i){return n("p",{key:i,class:a.productSizeIndex==i?"boder":"",on:{click:function(t){return a.setProductSize2(e,i)}}},[a._v(" "+a._s(e.size)+" ")])}),0)])]),n("div",{directives:[{name:"show",rawName:"v-show",value:a.popShow,expression:"popShow"}],staticClass:"fiexd"},[n("div",{staticClass:"close"},[n("i",{staticClass:"el-icon-back",on:{click:function(t){a.popShow=!a.popShow,a.active=0}}})]),a.productDetail.attr_list?n("div",{staticClass:"swiper"},[n("div",{staticClass:"imgList"},a._l(a.productDetail.attr_list[this.productColorIndex].templates,function(t,e){return n("div",{key:e,class:{imgItem:!0,border:e==a.active},on:{click:function(t){a.active=e}}},[n("img",{attrs:{src:t,alt:""}})])}),0),n("swiper",{ref:"redefineSwipe1",staticClass:"swiperOptions1 swiper-no-swiping",attrs:{options:a.swiperOptions1}},a._l(a.productDetail.attr_list[this.productColorIndex].templates,function(t,e){return n("swiper-slide",{key:e,staticClass:"rs-box"},[n("img",{staticClass:"rs-icon",attrs:{src:t}})])}),1)],1):a._e()]),n("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:a.croploading,expression:"croploading"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!1,visible:a.dialogVisible,top:"20px",width:"80vw"},on:{"update:visible":function(t){a.dialogVisible=t},open:function(t){return a.show()},close:function(t){return a.closeCropper()}}},[n("div",[n("div",{staticClass:"cropper-head"},[n("div",{staticClass:"text1"},[a._v("Please select the area you want to crop in the image")]),n("div",{staticClass:"text2"},[n("img",{attrs:{src:e("3c56")}}),a._v("When cropping the image, please ensure the selected area is clear and complete")])]),n("div",{staticClass:"cropper-content"},[n("div",{staticClass:"movetext"},[n("img",{attrs:{src:e("6890")}}),a._v("You can drag the image with the mouse and use the scroll wheel to adjust the image size")]),n("div",{staticClass:"cropper"},[n("img",{ref:"imagecrop",attrs:{id:"imagecrop",src:a.imgFile,alt:""}})]),n("div",{staticClass:"show-preview",style:{overflow:"hidden",margin:"0 25px",display:"flex","align-items":"center"}},[n("div",{staticClass:"preview before"})])]),n("div",{staticClass:"footer-btn"},[n("div",{staticClass:"scope-btn"},[n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"Zoom in",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-zoom-in"},on:{click:function(t){return a.cropperzoom(.05)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"Zoom out",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-zoom-out"},on:{click:function(t){return a.cropperzoom(-.05)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"Rotate counterclockwise",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh-left"},on:{click:function(t){return a.cropperRotate(-90)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"Rotate clockwise",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh-right"},on:{click:function(t){return a.cropperRotate(90)}}})],1),n("el-tooltip",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],staticClass:"item",attrs:{effect:"dark",content:"Reset",placement:"top"}},[n("el-button",{attrs:{icon:"el-icon-refresh"},on:{click:function(t){return a.cropperReset()}}})],1)],1),n("div",{staticClass:"upload-btn"},[n("el-button",{staticStyle:{border:"1px solid #efb15e",color:"#efb15e"},on:{click:function(t){a.dialogVisible=!1}}},[a._v("Close")]),n("el-button",{staticStyle:{"background-color":"#efb15e",color:"white",border:"0"},attrs:{type:"primary"},on:{click:function(t){return a.sureSava()}}},[a._v("Save")])],1)])])]),n("el-dialog",{attrs:{width:"920px",visible:a.lvjingVisible,title:"Gradient filter",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible=t},open:function(t){return a.showlvjing()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading,expression:"lvjingLoading"}]}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading,expression:"lvjingLoading"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{attrs:{id:"lvjingcontainer"}}),n("div",[n("div",{staticStyle:{display:"flex","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor3},on:{input:a.nativePick2}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor3)+" ")])]),n("div",{staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor4},on:{input:a.nativePick3}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor4)+" ")])]),n("div",{staticClass:"elradioBox",staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px","margin-bottom":"45px"}},[n("el-radio-group",{on:{input:function(t){return a.lvjingblendmode()}},model:{value:a.blendmode,callback:function(t){a.blendmode=t},expression:"blendmode"}},a._l(a.mixblendmode,function(t){return n("el-radio",{key:t.value,attrs:{label:t.value,size:"mini",border:""}},[a._v(a._s(t.name))])}),1)],1),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"40px",right:"40px"},attrs:{type:"big"},on:{click:function(t){return a.startlvjing()}}},[a._v("Use this filter")])],1)])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible2,title:"Primary color filter",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible2=t},open:function(t){return a.showlvjing2()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading2,expression:"lvjingLoading2"}]}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading2,expression:"lvjingLoading2"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{staticStyle:{position:"relative"},attrs:{id:"lvjingcontainer2"}}),n("div",[n("div",{staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor5},on:{input:a.nativePick4}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor5)+" ")])]),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"40px",right:"40px"},attrs:{type:"big"},on:{click:function(t){return a.startlvjing2()}}},[a._v("Use this filter")])],1)])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible3,title:"Stack filter",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible3=t},open:function(t){return a.showlvjing3()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading3,expression:"lvjingLoading3"}],staticStyle:{"z-index":"2"}}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading3,expression:"lvjingLoading3"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{staticStyle:{position:"relative"},attrs:{id:"lvjingcontainer3"}}),n("div",[n("div",{staticStyle:{display:"flex","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor6},on:{input:a.nativePick5}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor6)+" ")])]),n("div",{staticStyle:{display:"flex","margin-top":"10px","margin-left":"20px"}},[n("input",{staticStyle:{width:"40px",height:"40px"},attrs:{type:"color"},domProps:{value:a.Gradientcolor7},on:{input:a.nativePick6}}),n("div",{staticStyle:{"align-self":"center","font-size":"20px","margin-left":"10px","font-weight":"600","font-family":"fangsong"}},[a._v(" "+a._s(a.Gradientcolor7)+" ")])]),n("el-button",{staticStyle:{"border-radius":"0","background-color":"#efb15e",color:"white",border:"0",position:"absolute",bottom:"40px",right:"40px"},attrs:{type:"big"},on:{click:function(t){return a.startlvjing3()}}},[a._v("Use this filter")])],1)])]),n("el-dialog",{attrs:{width:"900px",visible:a.lvjingVisible4,title:"Grayscale filter",top:"40px"},on:{"update:visible":function(t){a.lvjingVisible4=t},open:function(t){return a.showlvjing4()}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading4,expression:"lvjingLoading4"}]}),n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.lvjingLoading4,expression:"lvjingLoading4"}],staticStyle:{display:"flex",overflow:"scroll"}},[n("div",{staticStyle:{position:"relative"},attrs:{id:"lvjingcontainer4"}})])])],1)},[function(){var t=this.$createElement,t=this._self._c||t;return t("div",[t("i",{staticClass:"el-icon-warning-outline icon"}),t("span",{staticStyle:{"margin-right":"7px"}}),this._v("The area within the green dashed line must be fully covered, otherwise there will be blank spaces during production. ")])}],!1,null,"e8da477e",null).exports),d=e("d662"),$=e.n(d),u={name:"Design",components:{ProductAnchor:i.a,ProductRecommend:a.a,diy:h,diys:r},props:{product:{type:Object,default:function(){return null}}},data:function(){return{res:[],category:[],XTUObj1:"",bigXTUObj1:"",psdsku_list:[],bigpsdsku_list:[],token:"",shilihua:0,category1:[{value:"",label:"ALL"},{value:"0",label:"New"},{value:"1",label:"Promotion"},{value:"2",label:"Hot Sale"},{value:"3",label:"Featured"}],level:[{value:"",label:"ALL"},{value:"0",label:"v0"},{value:"1",label:"v1"},{value:"2",label:"v2"},{value:"3",label:"v3"}],productList:{},productDetail:{},currentArea:{},extends:{},extends1:{},sourceList:{},folderList:[],keywordList:[],imgLoading:!1,productLoding:!1,materiaLoding:!1,sizes:[],attr_id:0,initProductDetailPsd:[],vLoading:!1,currentId:null,srcList:[],colorIndex:0}},methods:{getProductcatelist:function(){var r=this;Object(A.k)().then(function(t){if(1===t.data.code){for(var e=t.data.data,i=[],a=0;a<e.length;a++){var n={};n.label=e[a].name,n.value=e[a].id,e[a].childlist&&(n.children=r.tree_childlist(e[a].childlist)),i.push(n)}r.category=i}})},tree_childlist:function(t){for(var e=[],i=0;i<t.length;i++){var a={};a.label=t[i].name,a.value=t[i].id,t[i].childlist&&(a.children=this.tree_childlist(t[i].childlist)),e.push(a)}return e},tree_childrens:function(t){for(var e=[],i=0;i<t.length;i++){var a={};a.label=t[i].title,a.value=t[i].id,0<t[i].children.length&&(a.children=this.tree_childrens(t[i].children)),e.push(a)}return e},productSearch:function(t){var e=this;this.productLoding=!0,Object(A.l)(t).then(function(t){1!==t.data.code||"暂无数据"==t.data.msg?e.productList={}:(e.productList=t.data.data,"18960442001"==e.cookie.get("username")&&e.productList.product_list.forEach(function(t){t.price="0.00"}),t.data.data.product_list[0]&&e.$refs.diys.productDown(t.data.data.product_list[0])),e.productLoding=!1})},materialSearch:function(t){var e=this;this.materiaLoding=!0,Object(A.m)(t).then(function(t){1==t.data.code?(e.materiaLoding=!1,e.sourceList=t.data.data):(e.sourceList={},e.materiaLoding=!1)})},getProductlist:function(){var e=this;this.productLoding=!0;Object(A.l)({name:"",cid:"",pageNumber:1,pageSize:20,tag:"",level:""}).then(function(t){1===t.data.code?("暂无数据"==t.data.msg?e.productList={}:(e.productList=t.data.data,"18960442001"==e.cookie.get("username")&&e.productList.product_list.forEach(function(t){t.price="0.00"})),e.$route.query&&e.$route.query.id?(e.currentId=e.$route.query.id,e.$refs.diys.productDown(e.$route.query)):"暂无数据"!=t.data.msg&&(e.currentId=t.data.data.product_list[0].id,e.$refs.diys.productDown(t.data.data.product_list[0]))):e.productList={},e.productLoding=!1})},clickProduct:function(t){var i=this;this.productLoding=!0,this.currentId=t.id,this.colorIndex=0,this.extends={},this.extends1={},this.$refs.diys.dwarning=!1,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.$refs.diys.layerimages={},Object(A.h)(this.currentId).then(function(t){if(i.res=[],1==t.data.code){i.productDetail=t.data.data,i.sizes=t.data.data.attr_list[0].sizes,i.attr_id=t.data.data.attr_list[0].sizes[0].id,i.currentArea=t.data.data.design_list[0],i.psdsku_list=t.data.data.attr_list[0].svg_list,i.bigpsdsku_list=t.data.data.attr_list[0].big_sku_list,0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list),i.token=t.data.data.authorization;for(var e=0;e<t.data.data.design_list.length;e++)i.res.push({name:t.data.data.design_list[e].templatelayer,content:""});i.imgLoading=!0,i.$refs.diys.save()}else i.messageBox(t);i.productLoding=!1}),this.$emit("updateProduct")},setSizes2:function(t,e){var i=this;this.imgLoading=!0,this.extends={},this.extends1={},this.res=[],this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,sessionStorage.clear(),this.$refs.diys.layerimages={},Object(A.f)(e,this.sizes[0].id).then(function(t){if(0==t.data.code&&i.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list,i.$refs.diys.cutpiece()),i.productDetail.design_list=t.data.data.design_list,i.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)i.res.push({name:t.data.data.design_list[e].templatelayer,content:""});i.psdsku_list=t.data.data.svg_list,i.bigpsdsku_list=t.data.data.big_sku_list,i.$refs.diys.save()}})},setColor2:function(t,e,i){var a=this;this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,Object(A.f)(i,this.sizes[t].id).then(function(t){if(0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list,a.$refs.diys.cutpiece()),a.productDetail.design_list=t.data.data.design_list,a.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)a.res.push({name:t.data.data.design_list[e].templatelayer,content:""});a.psdsku_list=t.data.data.svg_list,a.bigpsdsku_list=t.data.data.big_sku_list,a.$refs.diys.save()}})},setSizes:function(t,e){var i=this;this.imgLoading=!0,this.extends={},this.extends1={},this.res=[],this.colorIndex=t,this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,this.sizes=this.productDetail.attr_list[t].sizes,sessionStorage.clear(),this.$refs.diys.layerimages={},Object(A.f)(e,this.sizes[0].id).then(function(t){if(0==t.data.code&&i.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(i.$refs.diys.svgpath=t.data.data.cutpiece_list),i.productDetail.design_list=t.data.data.design_list,i.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)i.res.push({name:t.data.data.design_list[e].templatelayer,content:""});i.psdsku_list=t.data.data.svg_list,i.bigpsdsku_list=t.data.data.big_sku_list,i.$refs.diys.save()}})},setColor:function(t,e,i){var a=this;this.$refs.diys.svgpath=[],this.$refs.diys.svgXml=[],this.$refs.diys.cutpiece_index=0,Object(A.f)(i,this.sizes[t].id).then(function(t){if(0==t.data.code&&a.$message.error(t.data.msg),1==t.data.code){0<t.data.data.cutpiece_list.length&&(a.$refs.diys.svgpath=t.data.data.cutpiece_list),a.productDetail.design_list=t.data.data.design_list,a.currentArea=t.data.data.design_list[0];for(var e=0;e<t.data.data.design_list.length;e++)a.res.push({name:t.data.data.design_list[e].templatelayer,content:""});a.psdsku_list=t.data.data.svg_list,a.bigpsdsku_list=t.data.data.big_sku_list,a.$refs.diys.save()}})},emptyC:function(){this.res.forEach(function(t,e){t.content=""}),this.$refs.diys.shilihua=0,this.extends1={},this.$refs.diys.layerimages={}},DesignTemp:function(t){this.shilihua=this.$refs.diys.shilihua,this.$refs.diys.layerLength=!0,0==this.shilihua&&(this.imgLoading=!0),this.extends1[""+t[1].id]=t[3];var e=0;this.$refs.diys.layerLength=!1;for(var i=0;i<this.res.length;i++)this.res[i].name==t[1].templatelayer&&(this.res[i].content=t[4],e=i);this.asyncCall(this.res,e)},setCurrentArea:function(t,e){this.currentArea=t},asyncCall:function(i,a){var n=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0==n.shilihua)return""!=n.XTUObj1&&(n.XTUObj1.destroy(),n.XTUObj1.qinchurul()),e=document.body.style.zoom||1,e=(1/e).toFixed(3),document.getElementById("xtu").style.zoom=e,n.XTUObj1="",n.bigXTUObj1="",n.shilihua=1,n.$refs.diys.shilihua=1,t.next=14,new Promise(function(t){var e=new $.a("xtu",{psdSkus:n.bigpsdsku_list,Autoken:z.a.get("token"),token:z.a.get("token"),onload:function(){i.forEach(function(t){e.changet({image:t.content,layers:t.name})}),t(e),this.imgLoading=!1}})});t.next=15;break;case 14:n.XTUObj1=t.sent;case 15:if(""!=n.XTUObj1)return t.next=18,n.XTUObj1.changet({image:i[a].content,layers:i[a].name});t.next=18;break;case 18:n.imgLoading=!1;case 19:case"end":return t.stop()}},t)}))()},getMaterial:function(){var e=this;this.materialLoding=!0;Object(A.m)({userId:"",fid:"",pageNumber:1,pageSize:20,name:"",keywords:""}).then(function(t){1==t.data.code?e.sourceList=t.data.data:e.sourceList={},e.materialLoding=!1})},addCar:function(t,e,i,a){var n=this,t=(a.join(","),a=a.toString(),{product_id:this.currentId,attr_id:t,num:e.num,extends:JSON.stringify(this.$refs.diys.layerimages),source_ids:a});Object(A.b)(t).then(function(t){1!=t.data.code&&n.messageBox(t)}),setTimeout(function(){n.$message.success("Add successful")},1500)},saveCanvas:function(t,e,i){var a=this,t=(i.join(","),i=i.toString(),{product_id:this.currentId,attr_id:t,extends:JSON.stringify(this.$refs.diys.layerimages),source_ids:i,is_online:0});Object(A.r)(t).then(function(t){1!=t.data.code&&a.messageBox(t)}),setTimeout(function(){a.$message.success("Svae successful")},1500)},getFolderlist:function(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Object(A.g)(t).then(function(t){if(1===t.data.code){for(var e=t.data.data,i=[],a=0;a<e.length;a++){var n={};n.label=e[a].title,n.value=e[a].id,0<e[a].children.length&&(n.children=r.tree_childrens(e[a].children)),i.push(n)}r.folderList=i}})},getKeywordlist:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";Object(A.i)(t).then(function(t){1==t.data.code&&(e.keywordList=t.data.data)})},setAttrId:function(t){this.attr_id=t},deletImg:function(i){this.productDetail.attr_list[0].templates.forEach(function(t,e){e!=i&&(t.url=" ")})},getBigImgs:function(t){},openBigImg:function(i){var a=this;return Object(o.a)(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.XTUObj1.getImg();case 2:e=t.sent,a.productDetail.attr_list[i.colorIndex].templates=e,a.$refs.diys.popShow=!a.$refs.diys.popShow;case 5:case"end":return t.stop()}},t)}))()}},created:function(){this.getProductcatelist(),this.getProductlist(),this.getFolderlist(),this.getKeywordlist()}},f=(e("c9c6"),Object(g.a)(u,function(){var e=this,t=e.$createElement,t=e._self._c||t;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.vLoading,expression:"vLoading"}],staticClass:"design"},[e._v(" "+e._s(e.product)+" "),t("diys",{ref:"diys",attrs:{category:e.category,category1:e.category1,level:e.level,productList:e.productList,productDetail:e.productDetail,currentArea:e.currentArea,res:e.res,imgLoading:e.imgLoading,sourceList:e.sourceList,folderList:e.folderList,keywordList:e.keywordList,productLoding:e.productLoding,materiaLoding:e.materiaLoding,sizes:e.sizes,attr_id:e.attr_id,currentId:e.currentId,initProductDetailPsd:e.initProductDetailPsd},on:{clickProduct:e.clickProduct,getDesignTemp:function(t){return e.DesignTemp(arguments)},emptyC:e.emptyC,setCurrentArea:e.setCurrentArea,getMaterial:e.getMaterial,productSearch:e.productSearch,materialSearch:e.materialSearch,addCar:e.addCar,saveCanvas:e.saveCanvas,setAttrId:e.setAttrId,deletImg:e.deletImg,setSizes:e.setSizes,setColor:e.setColor,setSizes2:e.setSizes2,setColor2:e.setColor2,getBigImgs:e.getBigImgs,openBigImg:e.openBigImg,getFolderlist:e.getFolderlist,getKeywordlist:e.getKeywordlist}})],1)},[],!1,null,"3520b28c",null));t.default=f.exports},cc9f:function(t,e,i){t.exports=i.p+"img/12-12.428397eb.png"},ccd8:function(t,e,i){t.exports=i.p+"img/19-19.60989d99.png"},d581:function(t,e,i){"use strict";var a=i("ed95"),n={name:"SearchAccount",props:{defaultMyself:{type:Boolean,default:!1},multiple:{type:Boolean,default:!0},English:{type:Boolean,default:!1},width1:{type:String,default:"70px"},label1:{type:String,default:"账号"}},data:function(){return{account:0,accountList:[],accountList2:[]}},methods:{getUserList:function(){var e=this;Object(a.e)().then(function(t){1==t.data.code&&(e.accountList=t.data.data,e.defaultMyself)&&e.accountList.unshift({id:0,nickname:e.English?"My":"本人",username:e.English?"My":"本人"})}),Object(a.f)().then(function(t){1==t.data.code&&(e.accountList2=t.data.data),e.defaultMyself&&e.accountList2.unshift({id:0,nickname:e.English?"My":"本人",username:e.English?"My":"本人"})})},changeAccount:function(t){this.$emit("input",String(t))}},created:function(){this.getUserList()}},i=i("2877"),i=Object(i.a)(n,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-form-item",{attrs:{label:"1"==e.label1?"":e.label1,"label-width":e.width1}},[i("el-select",{directives:[{name:"fixZoom",rawName:"v-fixZoom"}],attrs:{multiple:e.multiple,"collapse-tags":"",filterable:"",placeholder:e.English?"Please select":"请选择"},on:{change:e.changeAccount},model:{value:e.account,callback:function(t){e.account=t},expression:"account"}},[e._l(e.accountList2,function(t){return"1"==e.label1?i("el-option",{key:t.id,attrs:{label:t.username,value:t.id}}):e._e()}),e._l(e.accountList,function(t){return"1"!=e.label1?i("el-option",{key:t.id,attrs:{label:t.username,value:t.id}}):e._e()})],2)],1)},[],!1,null,"d8c59562",null);e.a=i.exports},d8e8:function(t,e,i){"use strict";i("96f1")},da8c:function(t,e,i){},dc8b:function(t,e,i){},ddd5:function(t,e,i){t.exports=i.p+"img/11-11.c3a34a73.png"},df6d:function(t,e,i){"use strict";i("1ede")},e511:function(t,e,i){t.exports=i.p+"img/6-6.9074081d.png"},e57f:function(t,e,i){t.exports=i.p+"img/16-16.f0ce4c84.png"},e7aa:function(t,e,i){"use strict";i("39a8")},e89d:function(t,e,i){},e960:function(t,e,i){t.exports=i.p+"img/goAdd.b008c1fb.png"},ea89:function(t,e,i){},ed73:function(t,e,i){},fb5f:function(t,e,i){t.exports=i.p+"img/14-14.ae83ebd5.png"}}]);