(function(t){function e(e){for(var i,o,r=e[0],c=e[1],l=e[2],u=0,p=[];ut.minLength&&!t.lockProportion.x?n("rect",{staticClass:"fp-point",style:t.getDragCursor("t"),attrs:{title:"tm",width:"16",height:"6",x:t.current.width/2-8,y:"-3",rx:"3",ry:"3"},on:{mousedown:t.dragTopMiddleHandle}}):t._e(),n("circle",{staticClass:"fp-point",style:t.getDragCursor("rt"),attrs:{title:"tr",cx:"100%",r:"4",cy:"0"},on:{mousedown:t.dragTopRightHandle}}),n("circle",{staticClass:"fp-point",style:t.getDragCursor("lb"),attrs:{title:"bl",cx:"0",r:"4",cy:"100%"},on:{mousedown:t.dragBottomLeftHandle}}),t.current.width>t.minLength&&!t.lockProportion.x?n("rect",{staticClass:"fp-point",style:t.getDragCursor("b"),attrs:{title:"bm",width:"16",height:"6",x:t.current.width/2-8,y:t.current.height-3,rx:"3",ry:"3"},on:{mousedown:t.dragBottomMiddleHandle}}):t._e(),n("circle",{staticClass:"fp-point",style:t.getDragCursor("rb"),attrs:{title:"br",cx:"100%",r:"4",cy:"100%"},on:{mousedown:t.dragBottomRightHandle}}),t.current.height>t.minLength&&!t.lockProportion.y?n("rect",{staticClass:"fp-point",style:t.getDragCursor("l"),attrs:{title:"ml",width:"6",height:"16",x:"-3",y:t.current.height/2-8,rx:"3",ry:"3"},on:{mousedown:t.dragMiddleLeftHandle}}):t._e(),t.current.height>t.minLength&&!t.lockProportion.y?n("rect",{staticClass:"fp-point",style:t.getDragCursor("r"),attrs:{title:"mr",width:"6",height:"16",x:t.current.width-3,y:t.current.height/2-8,rx:"3",ry:"3"},on:{mousedown:t.dragMiddleRightHandle}}):t._e()])])])])])},Bt=[],Rt={data:function(){return{tempSpan:document.createElement("div")}},mounted:function(){this.tempSpan.style.visibility="hidden",this.tempSpan.style.position="absolute",this.tempSpan.style["white-space"]="break-spaces",this.tempSpan.style["word-break"]="break-all",document.body.appendChild(this.tempSpan)},beforeDestroy:function(){document.body.removeChild(this.tempSpan)},methods:{getDivHeight:function(t,e,n,i){this.tempSpan.style.fontSize=t+"px";var a=Number(t||"0")+Number(e||"0");this.tempSpan.style.lineHeight=a+"px",this.tempSpan.style.width=n+"px",this.tempSpan.innerHTML=i;var s=this.tempSpan.getBoundingClientRect();return s.height}}},Tt=(n("b680"),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.x+e,a=t.x+t.width/2+e,s=t.x+t.width+e,o=t.y+n,r=t.y+t.height/2+n,c=t.y+t.height+n;return[[i,a,s],[o,r,c]]}),Ht=function(t){return{x:t[0][0],y:t[1][0],width:t[0][2]-t[0][0],height:t[1][2]-t[1][0]}},Ut=function(t,e){var n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;var i=n.matrixTransform(t.getScreenCTM().inverse());return{x:i.x,y:i.y}},Mt=function(t){return 2*Math.PI/360*t},zt=function(t,e,n){return{x:(t.x-e.x)*Math.cos(Mt(n))-(t.y-e.y)*Math.sin(Mt(n))+e.x,y:(t.x-e.x)*Math.sin(Mt(n))+(t.y-e.y)*Math.cos(Mt(n))+e.y}},Dt=function(t,e){return(t/e*100).toFixed(2)},Lt=function(t,e,n){var i;switch(n){case"tl":return i={x:t.x,y:t.y},zt(i,e,t.rotate);case"tm":return i={x:t.x+t.width/2,y:t.y},zt(i,e,t.rotate);case"tr":return i={x:t.x+t.width,y:t.y},zt(i,e,t.rotate);case"bl":return i={x:t.x,y:t.y+t.height},zt(i,e,t.rotate);case"bm":return i={x:t.x+t.width/2,y:t.y+t.height},zt(i,e,t.rotate);case"br":return i={x:t.x+t.width,y:t.y+t.height},zt(i,e,t.rotate);case"ml":return i={x:t.x,y:t.y+t.height/2},zt(i,e,t.rotate);case"mr":return i={x:t.x+t.width,y:t.y+t.height/2},zt(i,e,t.rotate);default:return i={x:t.x,y:t.y},zt(i,e,t.rotate)}},Nt=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},qt=function(t,e,n){if(e.x>n.x){if(t.xn.x)return!1;if(e.y>n.y){if(t.yn.y)return!1;return!0},Kt={getPoint:Lt,getCenterPoint:Nt,pointInRect:qt,sizeToPoints:Tt,pointsToSize:Ht,getPositionInSvg:Ut,degreeToRadian:Mt,getRotatedPoint:zt,absoluteZoom:Dt},Jt=["lt","t","rt","r","rb","b","lb","l"],Wt={lt:0,t:45,rt:90,r:135,rb:180,b:225,lb:270,l:315},Vt=[{start:338,end:23,cursor:"nwse"},{start:23,end:68,cursor:"ns"},{start:68,end:113,cursor:"nesw"},{start:113,end:158,cursor:"ew"},{start:158,end:203,cursor:"nwse"},{start:203,end:248,cursor:"ns"},{start:248,end:293,cursor:"nesw"},{start:293,end:338,cursor:"ew"}];function Gt(t){var e={},n=-1,i=!0;return Jt.forEach((function(a){var s=(Wt[a]+t)%360,o=Vt.length;while(i){n=(n+1)%o;var r=Vt[n];if(s<23||s>=338)return void(e[a]="nwse-resize");if(r.start<=s&&s=a.x&&i.y<=a.y?c=90-c:i.x<=a.x&&i.y<=a.y?c=270+c:i.x<=a.x&&i.y>=a.y?c=270-c:i.x>=a.x&&i.y>=a.y&&(c=90+c),e.current.rotate=360===c?0:parseInt(c),e.cursors=te.getCursor(e.current.rotate),e.$emit("change",e.id,"rotate",e.current)}),ee,{trailing:!1});this.configListener(s,this.id,"rotate")},dragTopLeftHandle:function(t){var e=this;this.stopEvent(t);var n=this.getKeyVariable("tl"),i=n.viewportRef,a=n.sPoint,s=n.rect,o=n.proportion,r=wt.a.throttle((function(t){var n=Kt.getPositionInSvg(i,t),r=Kt.getCenterPoint(n,a),c=Kt.getRotatedPoint(n,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=l.x-c.x,d=l.y-c.y;if(e.lockProportion.x){u/d>o?(c.x=c.x+Math.abs(u-d*o),u=d*o):(c.y=c.y+Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(c,r,s.rotate);r=Kt.getCenterPoint(p,a),c=Kt.getRotatedPoint(p,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=l.x-c.x,d=l.y-c.y}us.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};lo?(c.x=c.x-Math.abs(u-d*o),u=d*o):(c.y=c.y+Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(c,r,s.rotate);r=Kt.getCenterPoint(p,a),c=Kt.getRotatedPoint(p,r,-s.rotate),l=Kt.getRotatedPoint(a,r,-s.rotate),u=c.x-l.x,d=l.y-c.y}uo?(l.x=l.x+Math.abs(u-d*o),u=d*o):(l.y=l.y-Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(l,r,s.rotate);r=Kt.getCenterPoint(p,a),l=Kt.getRotatedPoint(p,r,-s.rotate),c=Kt.getRotatedPoint(a,r,-s.rotate),u=c.x-l.x,d=l.y-c.y}us.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};lo?(l.x=l.x-Math.abs(u-d*o),u=d*o):(l.y=l.y-Math.abs(d-u/o),d=u/o);var p=Kt.getRotatedPoint(l,r,s.rotate);r=Kt.getCenterPoint(p,a),l=Kt.getRotatedPoint(p,r,-s.rotate),c=Kt.getRotatedPoint(a,r,-s.rotate),u=l.x-c.x,d=l.y-c.y}us.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};ls.x?1:-1),y:c.y+Math.abs(s.y-c.y)/2*(c.y>s.y?-1:1)};l=t.maxZ},on:{click:t.toTop}},[n("i",{staticClass:"iconfont icon-top"})])]),n("el-tooltip",{attrs:{content:"向上",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z>=t.maxZ},on:{click:t.toUp}},[n("i",{staticClass:"iconfont icon-up"})])]),n("el-tooltip",{attrs:{content:"向下",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z<=1},on:{click:t.toDown}},[n("i",{staticClass:"iconfont icon-down"})])]),n("el-tooltip",{attrs:{content:"置底",placement:"top"}},[n("button",{attrs:{disabled:t.disabled||t.ai.z<=1},on:{click:t.toBottom}},[n("i",{staticClass:"iconfont icon-bottom"})])])],1),"text"===t.ai.t?n("div",{staticClass:"fp-settting-component-bar text",staticStyle:{"margin-top":"2px"}},[n("el-tooltip",{attrs:{content:"加粗",placement:"top"}},[n("button",{class:{active:/b/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("b")}}},[n("i",{staticClass:"iconfont icon-font-bold"})])]),n("el-tooltip",{attrs:{content:"斜体",placement:"top"}},[n("button",{class:{active:/i/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("i")}}},[n("i",{staticClass:"iconfont icon-font-italic"})])]),n("el-tooltip",{attrs:{content:"下划线",placement:"top"}},[n("button",{class:{active:/u/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("u")}}},[n("i",{staticClass:"iconfont icon-font-underline"})])]),n("el-tooltip",{attrs:{content:"删除线",placement:"top"}},[n("button",{class:{active:/s/.test(t.ai.bius)},attrs:{disabled:t.disabled},on:{click:function(e){return t.biusHandle("s")}}},[n("i",{staticClass:"iconfont icon-font-strickout"})])])],1):t._e(),"text"===t.ai.t?n("div",{staticClass:"fp-settting-component-bar text",staticStyle:{"margin-top":"2px"}},[n("el-tooltip",{attrs:{content:"左对齐",placement:"top"}},[n("button",{class:{active:"left"===t.ai.a},attrs:{disabled:t.disabled},on:{click:function(e){t.ai.a="left"}}},[n("i",{staticClass:"iconfont icon-align-left"})])]),n("el-tooltip",{attrs:{content:"居中对齐",placement:"top"}},[n("button",{class:{active:"center"===t.ai.a},attrs:{disabled:t.disabled},on:{click:function(e){t.ai.a="center"}}},[n("i",{staticClass:"iconfont icon-align-center"})])]),n("el-tooltip",{attrs:{content:"右对齐",placement:"top"}},[n("button",{class:{active:"right"===t.ai.a},attrs:{disabled:t.disabled},on:{click:function(e){t.ai.a="right"}}},[n("i",{staticClass:"iconfont icon-align-right"})])]),n("div",{staticStyle:{width:"32px"}})],1):t._e()])},Jn=[],Wn=(n("a15b"),{name:"FpSettingComponentBottomBar",data:function(){return{value1:0}},computed:Object(y["a"])(Object(y["a"])({},Object(P["c"])({ai:"poster/ai",maxZ:"poster/maxZ"})),{},{disabled:function(){return this.ai.lock}}),methods:Object(y["a"])(Object(y["a"])({},Object(P["d"])({removeActiveItem:"poster/removeActiveItem",copyActiveItem:"poster/copyActiveItem",record:"snapshots/record",top:"poster/top",bottom:"poster/bottom",up:"poster/up",down:"poster/down"})),{},{removeItem:function(){var t=this.ai;this.removeActiveItem(),this.record("删除组件: ".concat(t.name," - ").concat(t.uuid))},copyItem:function(){this.copyActiveItem(this.ai),this.record("复制组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toTop:function(){this.top(this.ai),this.record("置顶组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toBottom:function(){this.bottom(this.ai),this.record("置底组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toUp:function(){this.up(this.ai),this.record("上移组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},toDown:function(){this.down(this.ai),this.record("下移组件: ".concat(this.ai.name," - ").concat(this.ai.uuid))},biusHandle:function(t){var e=this.ai.bius.split("");"u"===t&&wt.a.remove(e,(function(t){return"s"===t})),"s"===t&&wt.a.remove(e,(function(t){return"u"===t})),wt.a.includes(e,t)?wt.a.remove(e,(function(e){return e===t})):e.push(t),e=wt.a.uniq(e).join(""),this.ai.bius=e}})}),Vn=Wn,Gn=(n("eaf8"),Object(c["a"])(Vn,Kn,Jn,!1,null,"4da293e3",null)),Zn=Gn.exports,Xn={text:"文字",image:"图片",avatar:"头像",qrcode:"二维码"},Yn={name:"FpSettingComponent",components:{FpButton:A,FpFileUpload:Un,FpSettingColorPicker:$n,FpSettingComponentBottomBar:Zn,FpSettingWrapper:On},mixins:[Rt],data:function(){return{scaleWH:1}},computed:Object(y["a"])(Object(y["a"])({},Object(P["c"])({w:"poster/w",h:"poster/h",ai:"poster/ai",fonts:"editor/fonts",scale:"poster/scale"})),{},{title:function(){var t=Xn[this.ai.t];return"undefined"!==typeof t?t:this.ai.name}}),mounted:function(){this.h&&(this.scaleWH=this.ai.w/this.ai.h)},methods:Object(y["a"])(Object(y["a"])({},Object(P["d"])({record:"snapshots/record"})),{},{changeImg:function(t){var e=this.ai;this.ai.v=t,this.record("更改图片: ".concat(e.name,", url=").concat(t))},onBeforeUpload:function(t){var e=this,n=new FileReader;n.onload=function(t){var n=new Image;n.onload=function(){e.ai.w=Math.round(n.width*e.scale),e.ai.h=Math.round(n.height*e.scale),e.ai.aspectRatio=!0},n.src=t.target.result},n.readAsDataURL(t)},changeHandler:function(t){t&&this.$EventBus.$emit(p.UPDATE_DRAG,t),t&&this.$EventBus.$emit(p.UPDATE_RECORD,t)},changeC:function(t){t||(this.ai.c="#000000")},changeW:function(){this.ai.aspectRatio&&(this.ai.h=Math.round(this.ai.w/this.scaleWH)),this.changeHandler("wh")},changeH:function(){this.ai.aspectRatio&&(this.ai.w=Math.round(this.ai.h*this.scaleWH)),this.changeHandler("wh")},changeAspectRatio:function(){this.ai.aspectRatio=!this.ai.aspectRatio,this.h&&(this.scaleWH=this.ai.w/this.ai.h)},changeDragHeight:function(){"text"===this.ai.t&&(this.ai.h=this.getDivHeight(this.ai.s,this.ai.vs,this.ai.w,this.ai.v))},changeImgSize:function(){var t=this.ai,e=new Image,n=this;e.src=$t.imgUrl(t.v),e.onload=function(){t.w=e.width,setTimeout((function(){t.h=e.height,n.record("更改图片原始尺寸: ".concat(t.name))}),10)}}})},Qn=Yn,ti=(n("acbe"),Object(c["a"])(Qn,Nn,qn,!1,null,"0d9f7451",null)),ei=ti.exports,ni={name:"FpSettingContainer",components:{FpSettingComponent:ei,FpSettingCanvas:Ln},computed:Object(y["a"])({},Object(P["c"])({ai:"poster/ai"}))},ii=ni,ai=(n("da01"),n("888c"),Object(c["a"])(ii,gn,bn,!1,null,"5872bc14",null)),si=ai.exports,oi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fp-debug-panel",class:{active:t.editor.debug},on:{click:function(e){return t.setDebug(!0)},dblclick:function(e){return t.setDebug(!1)}}},[n("pre",{staticClass:"code language-json line-numbers",domProps:{innerHTML:t._s(t.html)}})])},ri=[],ci=n("c197"),li=n.n(ci),ui=(n("f393"),{name:"FpDebugPanel",computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({p:function(t){return t.poster.p},editor:function(t){return t.editor}})),{},{html:function(){return li.a.highlight(JSON.stringify(this.p,"",2),li.a.languages.json,"json")}}),methods:Object(y["a"])({},Object(P["b"])({setDebug:"editor/setDebug"}))}),di=ui,pi=(n("7316"),Object(c["a"])(di,oi,ri,!1,null,"347529be",null)),fi=pi.exports,hi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[t._m(0),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items,(function(e){return n("fp-aside-panel-component-item",{key:e.t,attrs:{icon:e.t,title:e.name,desc:"点击创建"},on:{click:function(n){return t.addItemToEditor(e)}}})})),1)])])},mi=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"title"},[n("h3",[t._v("组件")])])}];n("4de4"),n("d81d");function vi(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,i=arguments.length>1?arguments[1]:void 0,a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(i=i||a.length,n)for(t=0;t=1?t[0]:void 0},maxZ:function(){return yi.p.items.length>=1?Object(bt["max"])(yi.p.items.map((function(t){return t.z}))):1},scale:function(){return yi.p.scale}},Ci={createPoster:function(t){var e=t.commit,n=JSON.parse(JSON.stringify(wi));e("loadPoster",n)},savePoster:function(){return new Promise((function(t){var e=yi.p,n=Object(y["a"])({},e);0===e.id?$t.savePoster(n,(function(n){0===n.code&&n.data.poster&&(e.id=n.data.poster.id,e.uuid=n.data.poster.uuid),t(n)})):$t.updatePoster(n,(function(e){t(e)}))}))},loadPoster:function(t,e){var n=t.commit;return new Promise((function(t){$t.loadPoster(e,(function(i){var a=i.data.poster,s=JSON.parse(a.json);s.id=e,s.uuid=a.uuid,n("loadPoster",s),s.items.filter((function(t){return""!==t.fn})).forEach((function(t){return $t.loadfont(t.fn)})),t(i)}))}))},getPoster:function(t,e){t.commit;return new Promise((function(t){$t.loadPoster(e,(function(e){var n=e.data.poster,i=JSON.parse(n.json);i.id=n.id,t(i)}))}))},copyPoster:function(t,e){t.commit;return new Promise((function(t){$t.copyPoster(e,(function(e){t(e)}))}))},removePoster:function(t,e){t.commit;return new Promise((function(t){$t.removePoster(e,(function(e){t(e)}))}))},previewPoster:function(){return new Promise((function(t){var e=yi.p;$t.previewPoster(e,(function(e){t(e)}))}))},shrink:function(t){var e=t.commit;e("changeScale",-.1)},magnify:function(t){var e=t.commit;e("changeScale",.1)},isTextEdit:function(t,e){var n=t.commit;n("isTextEdit",e)}},ki={changeScale:function(t,e){if(t.p.scale<=.35&&(e/=10),t.p.scale<=.05&&e<0||t.p.scale>=3&&e>0)console.warn("已到极致缩放比: ",t.p.scale);else{var n=t.p.scale+e;.36===n&&(n=.4),t.p.scale=Number(n.toFixed(2))}},loadPoster:function(t,e){var n=0;e.items.forEach((function(t){t.active=!1,"undefined"===typeof t.lock&&(t.lock=!1),"undefined"===typeof t.angle&&(t.angle=0),"undefined"===typeof t.aspectRatio&&(t.aspectRatio=!1),"undefined"===typeof t.vs&&(t.vs=0),"undefined"===typeof t.bool&&(t.bool=!1),"text"===t.t&&("undefined"===typeof t.a&&(t.a="left"),"undefined"===typeof t.wrap&&(t.wrap=!0),"undefined"!==typeof t.bius&&t.bius||(t.bius=""),"undefined"!==typeof t.ls&&t.ls||(t.ls=0)),t.z=++n})),"undefined"!==typeof e.editor&&delete e["editor"],"undefined"===typeof e.use&&(e.use=e.bgUrl?"bgUrl":"bgc"),"undefined"===typeof e.key&&(e.key=vi()),e.scale||(e.scale=.5),t.p=e},setActiveItemId:function(t,e){t.p.items.filter((function(t){return t.active&&t.uuid!==e})).forEach((function(t){return t.active=!1})),t.p.items.filter((function(t){return t.uuid===e})).forEach((function(t){return t.active=!0}))},setUnActiveItemId:function(t,e){t.p.items.filter((function(t){return t.uuid===e})).forEach((function(t){return t.active=!1}))},setUnActiveAllItem:function(t){t.p.items.forEach((function(t){return t.active=!1}))},addItem:function(t,e){if(t.p.items.length>=100)console.warn("元素超过最数量: ",t.p.items.length);else{this.commit("poster/setUnActiveAllItem");var n=t.p.items.length>=1?xi.maxZ()+1:1,i={t:e.t,name:e.name,uuid:vi(),x:e.x?e.x:100,y:e.y?e.y:100,w:e.w?e.w:200,h:e.h?e.h:200,z:n,angle:e.angle?e.angle:0,s:e.s?e.s:30,c:e.c?e.c:"#000000",bgc:e.bgc?e.bgc:"",v:e.v,vs:e.vs?e.vs:0,vd:e.vd?e.vd:"",fn:e.fn?e.fn:"",st:e.st?e.st:0,active:!0,lock:!1,aspectRatio:!1,bool:!1};"undefined"!==typeof e.p&&(i["p"]=e.p),"qrcode"!==e.t&&"avatar"!==e.t&&"image"!==e.t||(i.aspectRatio=!0),"text"===e.t&&(i.a=e.a?e.a:"left",i.fn=e.fn?e.fn:"01/0d44d315557a4a25.woff",i.wrap=!0,i.bius=e.bius?e.bius:"",i.ls=e.ls?e.ls:0),t.p.items.push(i)}},removeActiveItem:function(t){var e=t.p.items.filter((function(t){return!t.active})),n=0;e.forEach((function(t){t.z=++n})),t.p.items=e},copyActiveItem:function(t,e){var n=JSON.parse(JSON.stringify(e));n.y+=20,this.commit("poster/addItem",n)},changeActiveItem:function(t,e){for(var n=0;ne.z})).forEach((function(t){return t.z--})),e.z=n,t.p.items=Object(bt["sortBy"])(t.p.items,["z"])},bottom:function(t,e){t.p.items.filter((function(t){return t.z params = new HashMap<>();\n').concat(t,'\n\n // 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\n client.buildPoster("').concat(this.posterId||"未生成",'").params(params).build().save("demo.png");\n\n }\n}');return e}}},va=ma,ga=(n("d8cd"),Object(c["a"])(va,ra,ca,!1,null,"3fa1de92",null)),ba=ga.exports,wa=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-python line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},ya=[],xa=(n("3d21"),{name:"FpCodePython",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.python,"python")}},methods:{code:function(){var t=this.json()||" # 暂未指定任何动态参数\n",e='from fastposter import Client\n\n# 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n# 1.创建海报客户端对象\nclient = Client("'.concat(this.token,'", "').concat(this.apiUrl,'")\n\n# 2.准备海报参数(从实际业务系统中获取)\nparams = ').concat(t,'\n\n# 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\nclient.buildPoster("').concat(this.posterId||"未生成",'", params=params).save("demo.png")');return e}}}),Ca=xa,ka=(n("461a"),Object(c["a"])(Ca,wa,ya,!1,null,"f65933c8",null)),_a=ka.exports,ja=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-go line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},Oa=[],Pa=(n("1989"),{name:"FpCodeGo",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.go,"go")}},methods:{code:function(){var t=this.json()||" # 暂未指定任何动态参数\n",e='package main\n\nimport (\n\t"fmt"\n\t"github.com/psoho/fastposter-client-go/fastposter"\n)\n\nfunc main() {\n\n\t// 创建海报客户端\n\tclient := fastposter.Client("'.concat(this.token,'")\n\n\t// 设置参数\n\tparams := map[string]interface{}').concat(t,'\n\n\t// 生成海报\n\tposter, err := client.BuildPoster("').concat(this.posterId,'", params, "png")\n\tif err != nil {\n\t\tfmt.Println("Error:", err)\n\t\treturn\n\t}\n\n\tposter.Save()\n}\n');return e}}}),Fa=Pa,Ia=(n("dce8"),Object(c["a"])(Fa,ja,Oa,!1,null,"15e8fd9e",null)),Sa=Ia.exports,Ea=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-shell line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},$a=[],Aa=(n("8009"),{name:"FpCodeCurl",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.bash,"bash")}},methods:{code:function(){var t={};this.items.filter((function(t){return t.vd})).forEach((function(e){t[e.vd]=e.v})),t["id"]=this.posterId,t=JSON.stringify(t,""," ");var e="curl --location --request POST '".concat(this.apiUrl,"api/link' --header 'token: ").concat(this.token,"' --header 'Content-Type: application/json' \\\n--data-raw '").concat(t,"'");return e}}}),Ba=Aa,Ra=(n("fefd"),Object(c["a"])(Ba,Ea,$a,!1,null,"eef3d0a6",null)),Ta=(Ra.exports,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-php line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)}),Ha=[],Ua=(n("5b81"),n("6217"),n("8e9b"),{name:"FpCodePhp",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.php,"php")}},methods:{code:function(){var t=this.json().replaceAll('":','" =>');t="["+t.substring(1,t.length-1)+"]";var e='include_once "vendor/autoload.php";\n\n# 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n# 1.创建海报客户端对象\n$client = new Fastposter\\Client("'.concat(this.token,'", "').concat(this.apiUrl,'");\n\n# 2.准备海报参数(从实际业务系统中获取)\n$params = ').concat(t,';\n\n# 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\n$client->buildPoster("').concat(this.posterId||"未生成",'", $params)->save("demo.png");');return e}}}),Ma=Ua,za=(n("e5de"),Object(c["a"])(Ma,Ta,Ha,!1,null,"653b3ad6",null)),Da=za.exports,La=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("pre",{staticClass:"code language-javascript line-numbers",domProps:{innerHTML:t._s(t.html)}}),n("el-button",{ref:"btnCopy",staticStyle:{position:"absolute",top:"20px",right:"10px"},attrs:{type:"info"}},[t._v("复制")])],1)},Na=[],qa=(n("416b"),{name:"FpCodeJs",mixins:[ha],computed:{html:function(){return li.a.highlight(this.code(),li.a.languages.javascript,"javascript")}},methods:{code:function(){var t=this.json();return"import fastposter from 'fastposter';\n\n// 如需进一步了解,请参考开发文档 https://cloud.fastposter.net/doc/sdk/\n\n// 1.创建海报客户端对象\nlet client = fastposter.init({token: \"".concat(this.token,'", endpoint: "').concat(this.apiUrl,'"});\n\n// 2.准备海报参数(从实际业务系统中获取)\nlet params = ').concat(t,"\n\n// 3.生成海报并保存(提供图片流、二进制、base64等多种方式)\nclient.buildPoster('").concat(this.posterId||"未生成","', params)\n .then((res)=>{\n // 将res 信息直接复制到 img 标签的 src 属性上即可\n // document.getElementById('myImg').src = res\n })")}}}),Ka=qa,Ja=(n("25fa"),Object(c["a"])(Ka,La,Na,!1,null,"55653a6e",null)),Wa=Ja.exports,Va={name:"FpCodeContainer",components:{FpCodeJs:Wa,FpCodePhp:Da,FpCodePython:_a,FpCodeJava:ba,FpCodeGo:Sa},computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),data:function(){return{activeName:"JS"}},methods:{}},Ga=Va,Za=Object(c["a"])(Ga,sa,oa,!1,null,null,null),Xa=Za.exports,Ya=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"修改密码",visible:t.editor.showChangePwd,width:"35%"},on:{"update:visible":function(e){return t.$set(t.editor,"showChangePwd",e)}}},[n("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:t.ruleForm,rules:t.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"原密码",prop:"password"}},[n("el-input",{staticStyle:{width:"80%"},attrs:{"show-password":"",placeholder:"请输入原密码"},model:{value:t.ruleForm.password,callback:function(e){t.$set(t.ruleForm,"password",e)},expression:"ruleForm.password"}})],1),n("el-form-item",{attrs:{label:"新密码",prop:"passwordNew"}},[n("el-input",{staticStyle:{width:"80%"},attrs:{"show-password":"",placeholder:"请输入新密码"},model:{value:t.ruleForm.passwordNew,callback:function(e){t.$set(t.ruleForm,"passwordNew",e)},expression:"ruleForm.passwordNew"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("ruleForm")}}},[t._v("确定")])],1)],1)],1)},Qa=[],ts={name:"FpChangePwd",computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),data:function(){return{ruleForm:{password:"",passwordNew:""},rules:{password:[{required:!0,message:"请输入原密码",trigger:"blur"},{min:3,max:32,message:"长度在 3 到 32 个字符",trigger:"blur"}],passwordNew:[{required:!0,message:"请输入新密码",trigger:"blur"},{min:3,max:32,message:"长度在 3 到 32 个字符",trigger:"blur"}]}}},methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({changepwd:"editor/changepwd"})),{},{submitForm:function(t){var e=this;return this.$refs[t].validate((function(t){t&&e.changepwd(e.ruleForm).then((function(t){e.$message.success("操作成功"),e.editor.showChangePwd=!1}))})),!1}})},es=ts,ns=Object(c["a"])(es,Ya,Qa,!1,null,"99604cd0",null),is=ns.exports,as=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"凭证管理",visible:t.editor.showTokenManager,width:"50%","custom-class":"token-manager-dialog"},on:{"update:visible":function(e){return t.$set(t.editor,"showTokenManager",e)}}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list}},[n("el-table-column",{attrs:{prop:"code",label:"令牌",width:"300"}}),n("el-table-column",{attrs:{prop:"create_time",label:"创建时间",width:"180"}}),n("el-table-column",{attrs:{prop:"status",label:"启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-switch",{attrs:{"active-value":1,"inactive-value":2,"active-color":"#13ce66"},on:{change:function(n){return t.updateToken(e.row)}},model:{value:e.row.status,callback:function(n){t.$set(e.row,"status",n)},expression:"scope.row.status"}})]}}])}),n("el-table-column",{attrs:{prop:"remark",label:"备注",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-input",{on:{blur:function(n){return t.updateToken(e.row)}},model:{value:e.row.remark,callback:function(n){t.$set(e.row,"remark",n)},expression:"scope.row.remark"}})]}}])})],1)],1)},ss=[],os={name:"FpTokenManager",data:function(){return{list:[]}},watch:{"editor.showTokenManager":{handler:function(t){t&&this.query()}}},computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),methods:{query:function(){var t=this;$t.queryTokenList().then((function(e){0===e.code&&(t.list=e.data.list)}))},updateToken:function(t){$t.updateToken(t)}}},rs=os,cs=(n("660e"),Object(c["a"])(rs,as,ss,!1,null,null,null)),ls=cs.exports,us=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-dialog",{attrs:{title:"用户管理",visible:t.editor.showUserManager,width:"60%","custom-class":"user-manager-dialog"},on:{"update:visible":function(e){return t.$set(t.editor,"showUserManager",e)}}},[n("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.dataForm}},[n("el-form-item",[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"用户名"},model:{value:t.dataForm.keyword,callback:function(e){t.$set(t.dataForm,"keyword",e)},expression:"dataForm.keyword"}})],1),n("el-form-item",{attrs:{label:"状态"}},[n("el-select",{staticStyle:{width:"100px"},attrs:{clearable:"",placeholder:"状态"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},[n("el-option",{attrs:{label:"启用",value:1}}),n("el-option",{attrs:{label:"禁用",value:2}})],1)],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.query}},[t._v("查询")])],1),n("el-form-item",[n("el-button",{attrs:{type:"success"},on:{click:function(e){return t.editHandler({})}}},[t._v("新增")])],1)],1),n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list,height:"450"}},[n("el-table-column",{attrs:{prop:"id",label:"ID",width:"80"}}),n("el-table-column",{attrs:{prop:"username",label:"用户名",width:"150"}}),n("el-table-column",{attrs:{prop:"remark",label:"备注",width:"150"}}),n("el-table-column",{attrs:{prop:"create_time",label:"创建时间",width:"180"}}),n("el-table-column",{attrs:{prop:"status",label:"启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-switch",{attrs:{"active-value":1,"inactive-value":2,"active-color":"#13ce66"},on:{change:function(n){return t.update(e.row)}},model:{value:e.row.status,callback:function(n){t.$set(e.row,"status",n)},expression:"scope.row.status"}})]}}])}),n("el-table-column",{attrs:{label:"操作",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-tag",{staticStyle:{"margin-right":"10px"},on:{click:function(n){return t.editHandler(e.row)}}},[t._v("编辑")]),n("el-tag",{attrs:{type:"danger"},on:{click:function(n){return t.deleteHandler(e.row)}}},[t._v("删除")])]}}])})],1),n("el-pagination",{staticStyle:{position:"absolute",bottom:"20px"},attrs:{"current-page":t.page,"page-sizes":[10,20,30,40],"page-size":t.limit,layout:"total, sizes, prev, pager, next",total:t.total},on:{"current-change":function(e){return t.query()},"update:currentPage":function(e){t.page=e},"update:current-page":function(e){t.page=e},"update:pageSize":function(e){t.limit=e},"update:page-size":function(e){t.limit=e}}})],1),n("el-dialog",{attrs:{title:this.edit.title+"用户",visible:t.edit.show,width:"40%"},on:{"update:visible":function(e){return t.$set(t.edit,"show",e)}}},[n("el-form",{ref:"dataForm",attrs:{model:t.edit.dataForm,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"用户名",prop:"username"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"用户名"},model:{value:t.edit.dataForm.username,callback:function(e){t.$set(t.edit.dataForm,"username",e)},expression:"edit.dataForm.username"}})],1),n("el-form-item",{attrs:{label:"密码",prop:"password"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{"show-password":"",placeholder:"密码"},model:{value:t.edit.dataForm.password,callback:function(e){t.$set(t.edit.dataForm,"password",e)},expression:"edit.dataForm.password"}})],1),n("el-form-item",{attrs:{label:"备注",prop:"remark"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"备注"},model:{value:t.edit.dataForm.remark,callback:function(e){t.$set(t.edit.dataForm,"remark",e)},expression:"edit.dataForm.remark"}})],1),n("el-form-item",{attrs:{label:"状态",prop:"status"}},[n("el-select",{staticStyle:{width:"100px"},attrs:{clearable:"",placeholder:"状态"},model:{value:t.edit.dataForm.status,callback:function(e){t.$set(t.edit.dataForm,"status",e)},expression:"edit.dataForm.status"}},[n("el-option",{attrs:{label:"启用",value:1}}),n("el-option",{attrs:{label:"禁用",value:2}})],1)],1),n("el-form-item",[n("el-button",{on:{click:function(e){t.edit.show=!1}}},[t._v("取消")]),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.dataFormSubmitHandle()}}},[t._v("确认")])],1)],1)],1)],1)},ds=[],ps={name:"FpUserManager",data:function(){return{list:[],page:1,limit:10,total:0,dataForm:{keyword:""},edit:{show:!1,title:"",dataForm:{id:"",username:"",password:"",remark:"",status:1}}}},watch:{"editor.showUserManager":{handler:function(t){t&&this.query()}}},computed:Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor}})),methods:{query:function(t){var e=this;$t.http.get("api/admin/users",{params:Object(y["a"])(Object(y["a"])({},this.dataForm),{},{page:this.page,limit:this.limit})}).then((function(t){0===t.code&&(e.list=t.data.list,e.total=t.data.total)}))},update:function(t){var e=this;$t.http.put("api/admin/users",t).then((function(t){0===t.code&&(e.$message.success("操作成功"),e.edit.show=!1,e.query())}))},editHandler:function(t){var e=this;this.edit.show=!0,t&&t.id?this.edit.title="编辑":this.edit.title="新增",this.$nextTick((function(){e.$refs["dataForm"].resetFields(),t.id&&$t.http.get("api/admin/users/"+t.id).then((function(t){0===t.code&&(e.edit.dataForm=t.data.user)}))}))},deleteHandler:function(t){var e=this;this.$confirm("是否删除此[".concat(t.username,"]记录?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){$t.http.delete("api/admin/users/"+t.id).then((function(t){0===t.code&&(e.$message.success("操作成功"),e.query())}))}))},dataFormSubmitHandle:function(){var t=this,e=Object(y["a"])({},this.edit.dataForm);e.id?this.update(e):$t.http.post("api/admin/users",e).then((function(e){0===e.code&&(t.$message.success("操作成功"),t.edit.show=!1,t.query())}))}}},fs=ps,hs=(n("d461"),Object(c["a"])(fs,us,ds,!1,null,"26d826a8",null)),ms=hs.exports,vs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[n("div",{staticClass:"title",on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchHandler.apply(null,arguments)}}},[n("el-input",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"搜索素材",size:"normal"},model:{value:t.params.name,callback:function(e){t.$set(t.params,"name",e)},expression:"params.name"}},[n("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"prefix"},slot:"prefix"})])],1),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items2,(function(e){return n("div",{key:e.id,staticClass:"fp-img",attrs:{title:e.name},on:{click:function(n){return t.addItemToEditor(e)}}},[n("img",{attrs:{src:e.preview}}),n("div",{staticClass:"fp-material-tool"},[n("i",{staticClass:"iconfont icon-shanchu i-btn",attrs:{title:"删除"},on:{click:function(n){return n.stopPropagation(),t.remove(e.id)}}})])])})),0),n("fp-empty",{attrs:{data:t.items}})],1)])},gs=[],bs=(n("841c"),{name:"FpAsideMaterial",components:{FpEmpty:Li},data:function(){return{params:{name:""}}},computed:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["e"])({items:function(t){return t.panelmaterial.items},p:function(t){return t.poster.p}})),Object(P["c"])({scale:"poster/scale"})),{},{items2:function(){return this.items.map((function(t){return{id:t.id,t:"image",name:t.filename,desc:"点击创建",v:t.path,preview:t.preview,w:200,uid:t.uid}}))}}),created:function(){this.searchHandler()},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["b"])({search:"panelmaterial/search",_remove:"panelmaterial/remove"})),Object(P["d"])({addItem:"poster/addItem",record:"snapshots/record"})),{},{addItemToEditor:function(t){var e=new Image,n=this;e.src=$t.imgUrl(t.v),e.onload=function(){t.w=e.width,t.h=e.height,n.addItem(t),n.record("新增素材: ".concat(t.name))}},searchHandler:function(){this.search(Object(y["a"])({},this.params))},remove:function(t){var e=this;this.$confirm("确定要删除素材吗?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e._remove(t).then((function(){e.searchHandler()}))}))}})}),ws=bs,ys=(n("746b"),Object(c["a"])(ws,vs,gs,!1,null,"6b5a316c",null)),xs=ys.exports,Cs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{title:"批量生成",width:"80%",visible:t.editor.showBatch,"custom-class":"batch-dialog"},on:{"update:visible":function(e){return t.$set(t.editor,"showBatch",e)},open:t.openDialog}},[n("div",{staticClass:"batch-container"},[n("div",{staticClass:"batch-preview"},[n("img",{attrs:{src:t.poster.preview}}),n("fp-empty",{attrs:{data:t.poster.preview,size:"60"}})],1),n("div",{staticClass:"batch-form"},[n("el-form",{ref:"form",attrs:{inline:!0,model:t.form,"label-width":"100px"}},[n("div",[n("el-form-item",{attrs:{label:"海报"}},[n("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"请选择海报"},on:{change:t.changeHandler},model:{value:t.form.posterId,callback:function(e){t.$set(t.form,"posterId",e)},expression:"form.posterId"}},t._l(t.options,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),n("el-form-item",{attrs:{label:"类型"}},[n("el-radio-group",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[n("el-radio",{attrs:{value:"jpeg",label:"jpeg"}}),n("el-radio",{attrs:{value:"png",label:"png"}}),n("el-radio",{attrs:{value:"pdf",label:"pdf"}})],1)],1)],1),n("el-form-item",{attrs:{label:"数据"}},[n("div",{staticStyle:{display:"flex","justify-content":"left","align-items":"flex-start",width:"200px"}},[t.showDownTemplate?n("fp-button",{on:{click:t.downTemplateHandler}},[t._v("1.下载模板")]):n("fp-button",{staticStyle:{color:"#d84689"},attrs:{disabled:""}},[t._v(t._s(t.temlateTipText))]),n("fp-file-upload",{directives:[{name:"show",rawName:"v-show",value:t.showDownTemplate,expression:"showDownTemplate"}],staticStyle:{"margin-left":"12px"},attrs:{buttonText:"2.导入数据",accept:".xls,.xlsx,.csv","auto-upload":!1},on:{change:t.importHandler}})],1)]),n("el-form-item",{attrs:{label:"数量"}},[n("el-input-number",{staticStyle:{width:"100px"},attrs:{size:"small","controls-position":"right",min:0,max:t.raw.length},model:{value:t.form.num,callback:function(e){t.$set(t.form,"num",e)},expression:"form.num"}})],1),n("el-form-item",[n("el-button",{attrs:{loading:t.fullscreenLoading,type:"primary"},on:{click:t.onSubmit}},[t._v(" 生成 ")])],1)],1),n("div",{staticStyle:{height:"46.8vh"}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.raw,height:"100%",stripe:"",border:""}},t._l(t.table,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.prop,label:t.label}})})),1)],1)],1)])])},ks=[],_s=n("1da1"),js=(n("96cf"),n("25ca")),Os={name:"FpPatch",components:{FpEmpty:Li,FpButton:A,FpFileUpload:Un},data:function(){return{poster:{},row:[],table:[],raw:[],fullscreenLoading:!1,form:{id:"",name:"",type:"jpeg",posterId:"",num:0,doneNum:0,path:"",status:0}}},computed:Object(y["a"])(Object(y["a"])({},Object(P["e"])({editor:function(t){return t.editor},panelposter:function(t){return t.panelposter},p:function(t){return t.poster.p}})),{},{options:function(){return this.panelposter.items.map((function(t){return{value:t.id,label:t.name}}))},showDownTemplate:function(){return!Object(bt["isEmpty"])(this.row)},temlateTipText:function(){return"无法生成模板"+(this.poster.id?",请先设置海报参数":",请先选择海报")}}),methods:Object(y["a"])(Object(y["a"])({},Object(P["b"])({getPoster:"poster/getPoster",saveOrUpdate:"batch/saveOrUpdate",loadBatch:"batch/loadBatch",getItems:"batch/getItems"})),{},{openDialog:function(){this.getBatch(this.editor.batchId)},getBatch:function(t){var e=this;this.fullscreenLoading=!1,this.raw=[],0===t&&(this.row={},this.poster={},this.table=[],this.form={id:"",name:"",type:"jpeg",posterId:"",num:0,doneNum:0,path:"",status:0}),t?this.loadBatch(t).then((function(t){var n=t.raw;delete t["raw"],e.form=Object(y["a"])(Object(y["a"])({},e.form),t),e.getPoster(t.posterId).then((function(t){e.loadPoster(t),e.raw=JSON.parse(n),e.form.num=e.raw.length}))})):this.p.id&&this.changeHandler(this.p.id)},loadPoster:function(t){this.poster=this.panelposter.items.filter((function(e){return e.id===t.id}))[0];var e={},n=[];t.items.forEach((function(t){t.vd&&(e[t.vd]=t.v,n.push({key:t.uuid,prop:t.vd,label:t.vd}))})),this.row=e,this.table=n,this.form.name=this.poster.name,this.form.posterId=this.poster.id},changeHandler:function(t){var e=this;this.getPoster(t).then((function(t){return e.loadPoster(t)}))},onSubmit:function(){var t=this;if(this.form.posterId)if(Object(bt["isEmpty"])(this.raw))this.$message.warning("请先导入数据");else{var e=Object(y["a"])(Object(y["a"])({},this.form),{},{raw:JSON.stringify(this.raw)});this.fullscreenLoading=!0,this.saveOrUpdate(e).then((function(e){t.form=Object(y["a"])(Object(y["a"])({},t.form),e),t.fullscreenLoading=!1,t.$message.success("处理成功,请稍后"),t.editor.showBatch=!1,t.editor.batchPosterId=0,t.getItems().then((function(t){return console.info("重新加载")}))}))}else this.$message.warning("请先选择海报")},downTemplateHandler:function(){var t=[this.row],e=js["b"].json_to_sheet(t),n=js["b"].book_new();js["b"].book_append_sheet(n,e,"sheet"),js["c"](n,"".concat(this.poster.name,"-模板.xlsx"))},importHandler:function(t){var e=this;return Object(_s["a"])(regeneratorRuntime.mark((function n(){var i,a,s,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.raw,n.next=3,i.arrayBuffer();case 3:a=n.sent,s=js["a"](a),o=s.Sheets[s.SheetNames[0]],e.raw=js["b"].sheet_to_json(o),e.form.num=e.raw.length;case 8:case"end":return n.stop()}}),n)})))()}})},Ps=Os,Fs=(n("a268"),n("9a55"),Object(c["a"])(Ps,Cs,ks,!1,null,"69dd9502",null)),Is=Fs.exports,Ss=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"panel"},[n("div",{staticClass:"title"},[n("h3",[t._v("批量生成")]),n("fp-button",{staticStyle:{position:"absolute",right:"20px",top:"10px"},on:{click:t.createBatch}},[t._v("创建 ")])],1),n("div",{staticClass:"list-wrapper"},[n("div",{staticClass:"list"},t._l(t.items,(function(e){return n("div",{key:e.id+"-"+e.doneNum,staticClass:"batch-item",on:{click:function(n){return t.editBatch(e)}}},[n("h4",[t._v(t._s(e.name))]),n("p",{staticStyle:{color:"#606266"}},[t._v(t._s(e.doneNum)+"/"+t._s(e.num))]),n("el-progress",{attrs:{percentage:~~(e.doneNum/e.num*100)}}),n("div",[n("el-tag",{staticStyle:{"margin-right":"10px"},attrs:{type:"info",effect:"dark",title:"删除"},on:{click:function(n){return n.stopPropagation(),t.removeHandler(e)}}},[t._v("删除 ")]),n("el-tag",{attrs:{type:t._f("statusTypeFilter")(e.status),effect:"dark"}},[t._v(t._s(t._f("statusFilter")(e.status)))]),2===e.status?n("a",{staticStyle:{"text-decoration":"none","margin-left":"10px"},attrs:{href:t._f("downLoadUrl")(e.path),target:"_blank"},on:{click:t.downloadHandler}},[n("el-tag",{attrs:{type:"primary",effect:"dark",title:"点击下载"}},[t._v("下载")])],1):t._e()],1)],1)})),0),n("fp-empty",{attrs:{data:t.items}})],1)])},Es=[],$s={name:"FpAsideBatch",components:{FpButton:A,FpEmpty:Li},data:function(){return{params:{name:""},timer:null}},filters:{statusTypeFilter:function(t){var e="0info 1primary 2success 3warning".split(" ");return t>=e.length?"danger":e[t].slice(1)},statusFilter:function(t){var e="0暂未开始 1正在处理 2处理完成 3异常结束".split(" ");return t>=e.length?"未知状态":e[t].slice(1)},downLoadUrl:function(t){return t&&!t.startsWith("http")?window.API_URL+t:t}},computed:Object(y["a"])({},Object(P["e"])({items:function(t){return t.batch.items},p:function(t){return t.poster.p},editor:function(t){return t.editor}})),created:function(){this.search();var t=this;this.timer=setInterval((function(){t.search()}),5e3)},destroyed:function(){window.clearInterval(this.timer)},methods:Object(y["a"])(Object(y["a"])(Object(y["a"])({},Object(P["b"])({search:"batch/getItems",remove:"batch/remove"})),Object(P["d"])({})),{},{searchHandler:function(){this.search()},editBatch:function(t){this.editor.showBatch=!0,this.editor.batchPosterId=t.posterId,this.editor.batchId=t.id},createBatch:function(){this.editor.showBatch=!0,this.editor.batchPosterId=0,this.editor.batchId=0},downloadHandler:function(t){t.stopPropagation()},removeHandler:function(t,e){var n=this,i=t.id;this.$confirm("确定要删除该批量记录吗?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){n.remove(i).then((function(){n.search()}))}))}})},As=$s,Bs=(n("8d9a"),Object(c["a"])(As,Ss,Es,!1,null,"90643bea",null)),Rs=Bs.exports,Ts={name:"FpDesign",components:{FpAsideBatch:Rs,FpAsideMaterial:xs,FpUserManager:ms,FpTokenManager:ls,FpChangePwd:is,FpCodeContainer:Xa,FpAsidePanelPoster:aa,FpLogin:Yi,FpAsidePanelLayer:Ji,FpAsidePanelComponent:Bi,FpBatch:Is,FpDebugPanel:fi,FpSettingContainer:si,FpMainContainer:vn,FpAsideExtend:rt,FpAside:et,FpHeader:N},computed:Object(y["a"])({},Object(P["e"])({activeId:function(t){return t.aside.activeId}}))},Hs=Ts,Us=(n("68f4"),n("31bf"),Object(c["a"])(Hs,b,w,!1,null,"9ae2cca4",null)),Ms=Us.exports,zs={name:"Home",components:{FpDesign:Ms}},Ds=zs,Ls=(n("972d"),Object(c["a"])(Ds,v,g,!1,null,"1bb0581b",null)),Ns=Ls.exports;s["default"].use(m["a"]);var qs=[{path:"/",name:"Home",component:Ns},{path:"/about",name:"About",component:function(){return n.e("about").then(n.bind(null,"f820"))}},{path:"*",name:"HomePattern",component:Ns}],Ks=new m["a"]({mode:"history",routes:qs}),Js=Ks,Ws={items:[],activeId:0},Vs={isActived:function(){return 0!==Ws.activeId}},Gs={getItems:function(t){var e=t.commit;$t.loadAsideItems((function(t){e("set_items",t)}))},setActiveItem:function(t,e){var n=t.commit;n("set_active_id",e)},openPoster:function(t){var e=t.commit;e("set_active_id",{id:5,activated:!0})}},Zs={set_items:function(t,e){t.items=e,t.items.filter((function(t){return t.activated})).forEach((function(e){return t.activeId=e.id}))},set_active_id:function(t,e){var n=e.id,i=e.activated;e.extend;t.activeId!==n||i?(t.activeId=n,t.items.filter((function(t){return t.id!==n})).forEach((function(t){return t.activated=!1})),t.items.filter((function(t){return t.id===n})).forEach((function(t){return t.activated=!0}))):t.activeId=0}},Xs={namespaced:!0,state:Ws,getters:Vs,actions:Gs,mutations:Zs},Ys={snapshots:[],snapshots2:[],index:-1,maxIndex:100},Qs={canUndo:function(){return Ys.index>0},canRedo:function(){return Ys.index0){t.index--;var e=JSON.parse(t.snapshots2[t.index]);e.key=Object(bt["uniqueId"])(),s["default"].set(_i.state,"p",e)}},redo:function(t){if(t.index