chunk-6ec5c8f6.0bdff326.js 56 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6ec5c8f6"],{"0311":function(t,e,a){"use strict";a("57c2")},"0fee":function(t,e,a){},"17ea":function(t,e,a){},"1c4c":function(t,e,a){"use strict";a.d(e,"i",(function(){return r})),a.d(e,"b",(function(){return o})),a.d(e,"k",(function(){return s})),a.d(e,"d",(function(){return c})),a.d(e,"g",(function(){return i})),a.d(e,"h",(function(){return l})),a.d(e,"a",(function(){return u})),a.d(e,"j",(function(){return d})),a.d(e,"f",(function(){return m})),a.d(e,"c",(function(){return f})),a.d(e,"e",(function(){return p}));var n=a("b775");function r(t){return Object(n["a"])({url:"source/data/categories/",method:"post",data:t})}function o(t){return Object(n["a"])({url:"source/data/categories/create/",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/source/data/category/update",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/source/data/category/delete",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/source/data/category/info",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/source/data/search",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/source/data/create",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/source/data/update",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/source/data/info",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/source/data/delete",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/source/data/find",method:"post",data:t})}},"203e":function(t,e,a){"use strict";a("0fee")},"24d2":function(t,e,a){"use strict";a.d(e,"k",(function(){return r})),a.d(e,"b",(function(){return o})),a.d(e,"n",(function(){return s})),a.d(e,"f",(function(){return c})),a.d(e,"d",(function(){return i})),a.d(e,"l",(function(){return l})),a.d(e,"c",(function(){return u})),a.d(e,"o",(function(){return d})),a.d(e,"g",(function(){return m})),a.d(e,"e",(function(){return f})),a.d(e,"j",(function(){return p})),a.d(e,"m",(function(){return b})),a.d(e,"h",(function(){return h})),a.d(e,"i",(function(){return g})),a.d(e,"a",(function(){return v}));var n=a("b775");function r(t){return Object(n["a"])({url:"/project/category/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/project/category/create",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/project/category/update",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/project/category/info",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/project/category/delete",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/project/search",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/project/create",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/project/update",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/project/info",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/project/delete",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/project/relate",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/template/searchTemplateList",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/project/getphases",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/project/getstatus",method:"post",data:t})}function v(t){return Object(n["a"])({url:"/project/calculate",method:"post",data:t})}},"35d5":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"editor"},[a("draggable",{style:t.draggableStyle,attrs:{group:"itxst",animation:"300",handle:".drag-handle",scroll:!0,scrollSensitivity:100,scrollSpeed:20},on:{add:t.onAdd,update:t.onDragEnd,end:t.onDragComplete},model:{value:t.comList,callback:function(e){t.comList=e},expression:"comList"}},[a("transition-group",{staticStyle:{display:"block","min-height":"100vh"}},[t._l(t.comList,(function(e,n){return[a("div",{key:n,staticClass:"layers",class:t.comIndex==n?"active-layer":""},[a("div",{staticClass:"drag-handle",attrs:{draggable:""}},[a("svg-icon",{attrs:{"icon-class":"drag"}})],1),a("div",{staticStyle:{padding:"10px 0"}},[a("el-form",{staticClass:"inline-form",attrs:{"label-position":"left"}},[a("el-row",{staticStyle:{"margin-left":"0","margin-right":"0"},attrs:{gutter:24}},[a("el-col",{attrs:{xs:24,sm:24,md:12,lg:4,xl:4}},[a("el-form-item",{attrs:{label:"模块分类:"}},[a("span",{staticStyle:{cursor:"pointer"},on:{click:function(a){return t.enableSelect(e)}}},[t._v(t._s(t.getCategory(e.category_id)))])])],1),a("el-col",{attrs:{xs:24,sm:24,md:12,lg:12,xl:12}},[a("el-form-item",{attrs:{label:"模块名称:"}},[a("div",{staticStyle:{cursor:"pointer","max-width":"400px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"},attrs:{title:e.name},on:{click:function(a){return t.enableName(e)}}},[t._v(" "+t._s(e.name)+" ")])])],1),a("el-col",{attrs:{xs:24,sm:24,md:12,lg:8,xl:8}},[1==t.$store.state.user.roleInfo.id?a("el-form-item",[a("div",{staticClass:"btn-save"},["document"!==t.type?a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"保存模块",placement:"top"}},[a("el-button",{attrs:{size:"mini",icon:"el-icon-document-add",circle:""},on:{click:function(a){return t.onSaveTemplate(e)}}})],1):t._e(),1!==e.isEdit&&"document"!==t.type?a("el-button",{attrs:{circle:"",size:"mini"},on:{click:function(e){return t.onEdit(n,1)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}})],1):a("el-button",{attrs:{circle:"",size:"mini",icon:"el-icon-view"},on:{click:function(e){return t.onEdit(n,2)}}}),t.templateId||"document"===t.type?t._e():a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"删除",placement:"top"}},[a("el-button",{attrs:{circle:"",size:"mini"},on:{click:function(e){return t.onRemove(n)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}})],1)],1)],1)]):t._e()],1)],1)],1)],1),a("div",{staticClass:"main",on:{click:function(e){return t.onSetActive(n)}}},[a(e.type,{tag:"component",attrs:{com:e,coms:t.comList,currentIndex:n,isAdmin:t.isAdmin,insertCmd:t.insertCmd,isEdit:e.isEdit},on:{onUpdate:t.onUpdate,onUpdateAttr:t.onUpdateAttr,onUpdata:t.onUpdata,onUpdateProdAttr:t.onUpdateProdAttr,updateComContent:t.handleComContentUpdate}})],1)])]})),t.comList.length<=0?[a("div",{key:-1,staticClass:"editor-empty"},[a("el-empty",{attrs:{description:"请拖放组件至当前页面"}})],1)]:t._e()],2)],1)],1)},r=[],o=a("c7eb"),s=a("1da1"),c=a("b85c"),i=a("2909"),l=a("53ca"),u=a("5530"),d=(a("4de4"),a("caad"),a("a15b"),a("d81d"),a("fb6a"),a("b0c0"),a("e9c4"),a("4ec9"),a("a9e3"),a("b64b"),a("d3b7"),a("ac1f"),a("2532"),a("3ca3"),a("466d"),a("498a"),a("159b"),a("ddb0"),a("b76a")),m=a.n(d),f=function(){var t=this,e=t.$createElement,a=t._self._c||e;return null!=t.com?a("div",{staticClass:"template-table"},[a("div",{staticClass:"table"},[a("hot-table",{ref:"hotTable",staticStyle:{width:"100%"},attrs:{settings:t.settings,licenseKey:"non-commercial-and-evaluation"}})],1)]):t._e()},p=[],b=a("ade3"),h=(a("5319"),a("e437"),a("c24d")),g=a("8c7e"),v=a("cc6f");a("8033"),a("c1cf"),v["a"].buildEmpty({licenseKey:"internal-use-in-handsontable",precisionRounding:10,nullDate:{year:1900,month:1,day:1}});var y,j={name:"table",components:{HotTable:h["a"]},emits:["onUploadAttr","onUploadItemIndex"],props:{isActive:{type:Boolean,default:!1},currentIndex:{type:Number,default:0},com:{type:Object,default:null},insertCmd:{type:Object,default:null}},watch:{com:{handler:function(t){if(null!=t&&void 0!=t){var e=this;console.log("watch com",t),e.initSetting()}},immediate:!0,deep:!0},isActive:{handler:function(t){void 0==t&&null!=t||(this.settings.readOnly=!t,this.settings.colHeaders=t,this.settings.rowHeaders=t)},immediate:!0,deep:!0},insertCmd:{handler:function(t){null!=t&&this.isActive&&console.log("insertCmd table val",t)},immediate:!0,deep:!0}},data:function(){return{cellStyle:[],settings:{language:"zh-CN",startRows:5,startCols:3},currentFocus:{row:0,col:0}}},created:function(){},methods:{onExport:function(t){var e=this.$refs.hotTable.hotInstance.getPlugin("exportFile"),a=e.exportAsString("csv",{filename:"MyFile"});console.log("str",a)},initSetting:function(){var t,e=this,a=this;a.settings=(t={language:"zh-CN",startRows:1,startCols:6,height:"auto",stretchH:"all",customBorders:!0,licenseKey:"non-commercial-and-evaluation",comments:!0,mergeCells:!0,allowRemoveColumn:!0,allowRemoveRow:!0,copyPaste:{columnsLimit:25,rowsLimit:50,pasteMode:"shift_down",uiContainer:document.body},cell:a.cellStyle,contextMenu:{callback:function(t,e,n){if(console.log("callback",t,e,n),void 0==a.cellStyle&&(a.cellStyle=[]),"importExcel"!=t)if("clearColor"!=t){if(t.length>=8){if("bgColor"==t.substr(0,7)){var r=t.replace("bgColor:",""),o="whiteBg";switch(r){case"red":o="redBg";break;case"gray":o="grayBg";break}for(u=e[0].start.col;u<=e[0].end.col;u++)for(d=e[0].start.row;d<=e[0].end.row;d++){var s=a.cellStyle.filter((function(t){return t.col==u&&t.row==d}));s.length>0?s[0].className.indexOf(o)<0&&(s[0].className+=" "+o):a.cellStyle.push({col:u,row:d,className:o})}return}if("fontColor"==t.substr(0,9)){var c=t.replace("fontColor:",""),i="blackFont";switch(c){case"white":i="whiteFont";break;case"black":i="blackFont";break}void 0==a.cellStyle&&(a.cellStyle=[]);for(u=e[0].start.col;u<=e[0].end.col;u++)for(d=e[0].start.row;d<=e[0].end.row;d++){var l=a.cellStyle.filter((function(t){return t.col==u&&t.row==d}));l.length>0?l[0].className.indexOf(i)<0&&(l[0].className+=" "+i):a.cellStyle.push({col:u,row:d,className:i})}return}}}else{for(var u=e[0].start.col;u<=e[0].end.col;u++)for(var d=e[0].start.row;d<=e[0].end.row;d++)a.cellStyle=a.cellStyle.filter((function(t){return t.col!=u&&t.row!=d}));a.initSetting()}},items:{row_above:{name:"上方插入行",disabled:function(){return 0===this.getSelectedLast()[0]}},row_below:{name:"下方插入行"},col_left:{name:"左侧插入列"},col_right:{name:"右侧插入列"},remove_row:{name:"删除行"},remove_col:{name:"删除列"},sp1:"---------",mergeCells:{name:"合并单元格"},alignment:{name:"对齐"},borders:{name:"边框"},sp2:"---------",importExcel:{name:"导入Excel",key:"importExcel"},sp3:"---------",clearColor:{name:"清除样式",key:"clearColor"},bgColor:{name:"背景颜色",submenu:{items:[{key:"bgColor:red",name:"红色"},{key:"bgColor:gray",name:"灰色"}]}},fontColor:{name:"文字颜色",submenu:{items:[{key:"fontColor:white",name:"白色"},{key:"fontColor:black",name:"黑色"}]}}}},colHeaders:!0,rowHeaders:!0,width:"100%"},Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(t,"height","auto"),"colWidths","auto"),"allowHtml",!0),"filters",!0),"manualRowResize",!0),"manualColumnResize",!0),"manualRowMove",!0),"manualColumnMove",!0),"formulas",{engine:v["a"]}),"tableClassName","tb-class"),Object(b["a"])(t,"afterOnCellMouseDown",(function(t,a,n){e.currentFocus=a}))),Object(g["a"])()}}},x=j,O=(a("924b"),a("2877")),k=Object(O["a"])(x,f,p,!1,null,null,null),w=k.exports,C=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"template-textarea"},[1==t.isEdit?[a("div",{staticClass:"editor-area sticky-editor"},[a("ckeditor",{ref:"editor",attrs:{config:t.editorConfig,editorUrl:t.editorUrl},on:{focus:t.onFocus,blur:t.onBlur,input:t.onInputText,ready:t.onEditorReady},model:{value:t.com.content,callback:function(e){t.$set(t.com,"content",e)},expression:"com.content"}})],1)]:[a("div",{ref:"richEditor",staticClass:"rich-editor",domProps:{innerHTML:t._s(t.content)},on:{click:t.handleImageClick}})],t.loading?a("div",{staticClass:"overlay"},[a("el-progress",{staticClass:"full-width-progress",attrs:{percentage:t.progress}})],1):t._e()],2)},_=[],F=a("4478"),$=(a("99af"),a("b680"),a("07ac"),a("4d63"),a("2c3e"),a("25f0"),a("1c4c")),L=a("bc3a"),I=a.n(L),S=(a("1157"),{name:"app",emits:["onUpdate","onUpdateAttr","onUpdateProdAttr"],compnents:{},props:{coms:{type:Array,default:function(){return[]}},isEdit:{type:Number,default:2},isAdmin:{type:Number,default:2},currentIndex:{type:Number,default:0},com:{type:Object,default:null},insertCmd:{type:Object,default:null}},watch:{isEdit:{handler:function(t){var e=this;null==e.com&&e.replaceData(e.com.content).then((function(t){e.content=t,e.$nextTick((function(){e.bindEvents()}))}))},immediate:!0,deep:!0},com:{handler:function(t){var e=this;return Object(s["a"])(Object(o["a"])().mark((function a(){var n,r;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=e,null!=t){a.next=3;break}return a.abrupt("return");case 3:if(void 0!=t.content&&null!=t.content){a.next=5;break}return a.abrupt("return");case 5:return a.prev=5,a.next=8,n.replaceData(t.content);case 8:r=a.sent,n.content=r,n.$nextTick((function(){n.bindEvents(),n.initializeInputWidths()})),a.next=16;break;case 13:a.prev=13,a.t0=a["catch"](5),console.error("处理 com 时出错:",a.t0);case 16:case"end":return a.stop()}}),a,null,[[5,13]])})))()},immediate:!0,deep:!0},insertCmd:{handler:function(t){if(null!=t&&1==this.isEdit){var e=this.$refs.editor.instance.getSelection().getSelectedText();t.content.indexOf("Directory",0)>=0&&(this.$emit("onUpdateAttr",this.currentIndex,this.com.attrs.length-1,e),this.$refs.editor.instance.execCommand("delete")),this.$refs.editor.instance.insertHtml(t.content)}},immediate:!0,deep:!0}},data:function(){return{editorUrl:"/ckeditor/ckeditor.js",editorConfig:{language:"zh-cn",height:"650px"},content:"",editor:null,loading:!1,progress:0,isEditing:!1,focusedInputId:null,variableNullInputs:{}}},mounted:function(){var t=this;this.$nextTick((function(){t.initializeInputWidths()}))},beforeDestroy:function(){this.$el.removeEventListener("input",this.handleInputChange),this.$el.removeEventListener("input",this.handleVariableNullInput),this.$el.removeEventListener("blur",this.handleVariableNullBlur,!0)},methods:(y={replaceData:function(t){var e=this;return Object(s["a"])(Object(o["a"])().mark((function a(){var n,r,s,l,u;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=e,r={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,IF:function(t,e,a){return t?e:a}},s=Object(o["a"])().mark((function a(){var s,d,m,f,p,b,h,g,v,y,j,x,O,k,w,C,_,$,L,I,S,E,N,A,z;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(s=n.com.attrs[u].id,"variable"!=n.com.attrs[u].type){a.next=6;break}if(d=n.com.attrs[u],2==d.data.value_type){for(m=d.data.value_item.split(","),f='<select id="'+s+'" data-index="'+u+'" class="text-input-box">',l=0;l<m.length;l++)d.content==m[l]?f+='<option value="'+m[l]+'" selected>'+m[l]+"</option>":f+='<option value="'+m[l]+'">'+m[l]+"</option>";f+="</select>",t=t.replace("{{"+d.id+"}}",f)}else t=t.replace("{{"+s+"}}",'<input type="text" ref="input_'+s+'" name="'+n.com.attrs[u].name+'" id="'+s+'" data-index="'+u+'" class="text-input-box auto-width" value="'+n.com.attrs[u].content+'">');a.next=43;break;case 6:if("variableNull"!=n.com.attrs[u].type){a.next=12;break}p=n.com.attrs[u],e.variableNullInputs[s]=p.content,t=t.replace("{{"+s+"}}",'<input type="text" ref="input_'+s+'" name="'+p.name+'" id="'+s+'" data-index="'+u+'" data-attr-id="'+s+'" class="text-input-boxs auto-width" value="'+p.content+'">'),a.next=43;break;case 12:if("ProductAttr"!=n.com.attrs[u].type){a.next=19;break}if(b=n.com.attrs[u],h=b.id+"_"+u,""==b.content&&(b.content=b.attrs.value),1==b.attrs.type)t=t.replace("{{"+b.id+"}}",'<input type="text" id="'+h+'" data-index="'+u+'" class="text-input-box" value="'+b.content+'">');else{for(g=b.attrs.valueItems.split(","),v='<select id="'+h+'" data-index="'+u+'" class="text-input-box">',l=0;l<g.length;l++)b.content==g[l]?v+='<option value="'+g[l]+'" selected>'+g[l]+"</option>":v+='<option value="'+g[l]+'">'+g[l]+"</option>";v+="</select>",t=t.replace("{{"+b.id+"}}",v)}a.next=43;break;case 19:if("formual"!=n.com.attrs[u].type){a.next=35;break}return a.next=22,n.analysisFormual(n.com.attrs[u]);case 22:return y=a.sent,j=n.com.attrs[u].data.point,a.next=26,n.getRemote(y);case 26:if(y=a.sent,x={},O=/\b[a-zA-Z_][a-zA-Z0-9_]*\b/g,k=y.match(O),k){w=Object(c["a"])(k);try{for(w.s();!(C=w.n()).done;)_=C.value,"IF"===_||Object.keys(r).includes(_)||(x[_]="".concat(_))}catch(o){w.e(o)}finally{w.f()}}$=function(t,e){var a=Object(F["a"])(Function,Object(i["a"])(Object.keys(r)).concat(Object(i["a"])(Object.keys(e)),["return ".concat(t)]));return a.apply(void 0,Object(i["a"])(Object.values(r)).concat(Object(i["a"])(Object.values(e))))};try{L=$(y,x),I="number"!==typeof L||isNaN(L)?"boolean"===typeof L?L?"1":"0":String(L):L.toFixed(j),n.com.attrs[u].content=I,t=t.replace("{{"+n.com.attrs[u].id+"}}",I)}catch(D){console.error("处理公式时出错:",D),console.error("错误的公式:",y),n.com.attrs[u].content="计算错误",t=t.replace("{{"+n.com.attrs[u].id+"}}","计算错误")}a.next=43;break;case 35:if("sourceData"!=n.com.attrs[u].type){a.next=42;break}return a.next=38,n.getRemote1(n.com.attrs[u].formula);case 38:S=a.sent,t=t.replace("{{"+s+"}}",S),a.next=43;break;case 42:"Directory"==n.com.attrs[u].type?(E=n.com.attrs[u].number+". "+n.com.attrs[u].content,N=n.com.attrs[u].level||1,A=n.com.attrs[u].id,z=new RegExp("<div[^>]*>\\s*{{\\s*".concat(A,"\\s*}}\\s*</div>|{{\\s*").concat(A,"\\s*}}"),"g"),t=t.replace(z,(function(t,e,a){var n="h".concat(Math.min(N,6)),r="directory-level-".concat(N);return"<".concat(n,' class="').concat(r,'">').concat(E,"</").concat(n,">")}))):t=t.replace("{{"+s+"}}",n.com.attrs[u].content);case 43:case"end":return a.stop()}}),a)})),u=0;case 4:if(!(u<n.com.attrs.length)){a.next=9;break}return a.delegateYield(s(),"t0",6);case 6:u++,a.next=4;break;case 9:return e.$nextTick((function(){e.addInputListeners(),e.initializeInputWidths(),e.addVariableNullListeners()})),a.abrupt("return",t);case 11:case"end":return a.stop()}}),a)})))()},addVariableNullListeners:function(){this.$el.addEventListener("input",this.handleVariableNullInput),this.$el.addEventListener("blur",this.handleVariableNullBlur,!0)},handleVariableNullInput:function(t){if(t.target.classList.contains("text-input-boxs")){var e=t.target.dataset.attrId,a=t.target.value;this.$set(this.variableNullInputs,e,a)}},handleVariableNullBlur:function(t){if(t.target.classList.contains("text-input-boxs")){var e=parseInt(t.target.dataset.index,10),a=t.target.dataset.attrId,n=this.variableNullInputs[a];this.updateVariableNullContent(e,a,n,!0)}},updateVariableNullContent:function(t,e,a){var n=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.com&&this.com.attrs&&this.com.attrs[t]&&this.com.attrs[t].id===e&&(this.$set(this.com.attrs[t],"content",a),this.$nextTick((function(){var t=n.$el.querySelector("#".concat(e));t&&(t.value=a)})),r&&this.$emit("onUpdata",this.currentIndex,t,e,a))},addInputListeners:function(){this.$el.addEventListener("blur",this.handleInputChange,!0),this.$el.addEventListener("input",this.adjustInputWidth,!0)},initializeInputWidths:function(){var t=this,e=this.$el.querySelectorAll(".text-input-box, .text-input-boxs");e.forEach((function(e){return t.adjustInputWidth({target:e})}))},adjustInputWidth:function(t){if(t.target.classList.contains("text-input-box")||t.target.classList.contains("text-input-boxs")){var e=t.target,a=document.createElement("span");a.className="size-calculator",a.textContent=e.value||e.placeholder||"0",document.body.appendChild(a);var n=window.getComputedStyle(e);a.style.font=n.font,a.style.fontSize=n.fontSize,a.style.fontWeight=n.fontWeight,a.style.letterSpacing=n.letterSpacing;var r=a.offsetWidth;e.style.width="".concat(r+10,"px"),document.body.removeChild(a)}},handleInputChange:function(t){var e=this;if(t.target.classList.contains("text-input-box")||t.target.classList.contains("text-input-boxs")){t.target.id;var a=t.target.name,n=parseInt(t.target.dataset.index,10),r=t.target.value;this.com&&this.com.attrs&&this.com.attrs[n]?(this.$set(this.com.attrs[n],"content",r),this.com.attrs.forEach((function(t){t.name===a&&e.$set(t,"content",r)})),this.$emit("onUpdateAttr",this.currentIndex,n,r)):console.warn("Unable to find attribute at index ".concat(n))}},bindEvents:function(){for(var t=this,e=0;e<t.com.attrs.length;e++){var a=t.com.attrs[e].id,n=t.com.attrs[e];if("variable"==t.com.attrs[e].type){var r=t.$el.querySelector("#"+a);r&&(2==n.data.value_type?r.addEventListener("change",t.handleInput):r.addEventListener("blur",t.handleInput))}else if("ProductAttr"==t.com.attrs[e].type){var o=n.id+"_"+e,s=t.$el.querySelector("#"+o);s&&(1==n.attrs.type?s.addEventListener("blur",t.handleInputProduct):s.addEventListener("change",t.handleChangeProduct))}}},analysisFormual:function(t){var e=this;return Object(s["a"])(Object(o["a"])().mark((function a(){var n,r,c,i,l;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e,r=t.formula,c=/\[T\]\[(.*?)\]\[(.*?)\]/g,a.next=5,e.replaceAsync(r,c,function(){var t=Object(s["a"])(Object(o["a"])().mark((function t(e,a,r){var s;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.getModuleData(a,r);case 3:if(s=t.sent,null!==s&&void 0!==s){t.next=9;break}return console.warn("获取到的数据无效: ".concat(e)),t.abrupt("return","''");case 9:return t.abrupt("return","string"===typeof s?"".concat(s):s);case 10:t.next=16;break;case 12:return t.prev=12,t.t0=t["catch"](0),console.error("处理 ".concat(e," 时出错:"),t.t0),t.abrupt("return","''");case 16:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e,a,n){return t.apply(this,arguments)}}());case 5:r=a.sent,i=/IF\s*\((.*?),(.*?),(.*?)\)/gi,l=0;while(r.match(i)&&l<10)r=r.replace(i,(function(t,e,a,n){return a.includes("IF(")||n.includes("IF(")||a.includes("if(")||n.includes("if(")?"(".concat(e," ? (").concat(a,") : (").concat(n,"))"):"(".concat(e," ? ").concat(a," : ").concat(n,")")})),l++;return a.abrupt("return",r);case 10:case"end":return a.stop()}}),a)})))()},replaceAsync:function(t,e,a){return Object(s["a"])(Object(o["a"])().mark((function n(){var r,s;return Object(o["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=[],t.replace(e,(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var s=a.apply(void 0,[t].concat(n));r.push(s)})),n.next=4,Promise.all(r);case 4:return s=n.sent,n.abrupt("return",t.replace(e,(function(){return s.shift()})));case 6:case"end":return n.stop()}}),n)})))()}},Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(y,"replaceAsync",(function(t,e,a){return Object(s["a"])(Object(o["a"])().mark((function n(){var r,s;return Object(o["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=[],t.replace(e,(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var s=a.apply(void 0,[t].concat(n));r.push(s)})),n.next=4,Promise.all(r);case 4:return s=n.sent,n.abrupt("return",t.replace(e,(function(){return s.shift()})));case 6:case"end":return n.stop()}}),n)})))()})),"getFormualData",(function(t,e){var a=this;return Object(s["a"])(Object(o["a"])().mark((function e(){var n,r,s,c,i;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=a,r=/\[(.*?)\]\[(.*?)\]\[(.*?)\]/,s=new RegExp(r),c=t.match(s),i=0,!c||"T"!=c[1]){e.next=11;break}return e.next=8,n.getModuleData(c[2],c[3]);case 8:i=e.sent,e.next=12;break;case 11:console.warn("无法解析公式项:",t);case 12:return e.abrupt("return",i);case 13:case"end":return e.stop()}}),e)})))()})),"getRemote",(function(t){var e=this;return Object(s["a"])(Object(o["a"])().mark((function a(){var n,r,s,c,i,l,u;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=e,r=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,s=new RegExp(r);case 3:if(c=t.match(s),null!=c){a.next=7;break}return a.abrupt("break",18);case 7:if("R"!=c[1]){a.next=16;break}return i=c[4],i=c[4].split(","),a.next=12,n.getRemoteData(c[2],c[3],i[0],i[1]);case 12:l=a.sent,u=c[0],t=isNaN(l)?t.replace(u,'"'.concat(l,'"')):t.replace(u,"("+parseFloat(l)+")"),t=t.replace(u,"("+parseFloat(l)+")");case 16:a.next=3;break;case 18:return a.abrupt("return",t);case 19:case"end":return a.stop()}}),a)})))()})),"getRemote1",(function(t){var e=this;return Object(s["a"])(Object(o["a"])().mark((function a(){var n,r,s,c,i,l,u;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=e,r=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,s=new RegExp(r);case 3:if(c=t.match(s),null!=c){a.next=7;break}return a.abrupt("break",17);case 7:if("R"!=c[1]){a.next=15;break}return i=c[4],i=c[4].split(","),a.next=12,n.getRemoteData(c[2],c[3],i[0],i[1]);case 12:l=a.sent,u=c[0],t=isNaN(l)?t.replace(u,'"'.concat(l,'"')):t.replace(u,"("+parseFloat(l)+")");case 15:a.next=3;break;case 17:return a.abrupt("return",t);case 18:case"end":return a.stop()}}),a)})))()})),"onFocus",(function(){this.isEditing=!0})),"onBlur",(function(){this.isEditing=!1})),"getRemoteData",(function(t,e,a,n){var r=this;return Object(s["a"])(Object(o["a"])().mark((function s(){var c,i,l;return Object(o["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return r,c=0,i={code:t,sheetName:e,row:a,col:n},o.prev=3,o.next=6,Object($["e"])(i);case 6:if(l=o.sent,l){o.next=10;break}return console.warn("No response received from findData"),o.abrupt("return",c);case 10:200===l.status&&l.data?(c=l.data.result,"string"!==typeof c||isNaN(c)||(c=parseFloat(c))):console.warn("Invalid response format:",l),o.next=17;break;case 13:o.prev=13,o.t0=o["catch"](3),console.error("获取远程数据错误:",o.t0),r.$message&&r.$message.error("获取远程数据失败");case 17:return o.abrupt("return",c);case 18:case"end":return o.stop()}}),s,null,[[3,13]])})))()})),"getModuleData",(function(t,e){var a=this;return Object(s["a"])(Object(o["a"])().mark((function n(){var r,s,c;return Object(o["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=a,s=r.coms.filter((function(e){return e.name==t})),!(s.length>0)){n.next=6;break}if(c=s[0].attrs.filter((function(t){return t.name==e})),!(c.length>0)){n.next=6;break}return n.abrupt("return",c[0].content);case 6:return n.abrupt("return","");case 7:case"end":return n.stop()}}),n)})))()})),"handleChangeProduct",(function(t){var e=t.target.dataset.index;this.$emit("onUpdateProdAttr",this.currentIndex,e,t.target.value)})),"handleInputProduct",(function(t){var e=t.target.dataset.index;this.$emit("onUpdateProdAttr",this.currentIndex,e,t.target.value)})),Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(Object(b["a"])(y,"handleInput",(function(t){var e=t.target.dataset.index;this.$emit("onUpdateAttr",this.currentIndex,e,t.target.value)})),"onEditorReady",(function(t){})),"onInputText",(function(t){this.$emit("onUpdate",this.currentIndex,t)})),"handleImageClick",(function(t){"IMG"===t.target.tagName&&this.replaceImage(t.target)})),"selectImage",(function(){return new Promise((function(t){var e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=function(e){return t(e.target.files[0])},e.click()}))})),"uploadImage",(function(t){return Object(s["a"])(Object(o["a"])().mark((function e(){var a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,I.a.post("http://58.246.234.210:8084/upload/image",t,{headers:{"Content-Type":"multipart/form-data"}});case 3:if(a=e.sent,console.log("Upload response:",a),200!==a.status||!a.data||!a.data.url){e.next=9;break}return e.abrupt("return",a.data.url);case 9:throw new Error("Invalid upload response");case 10:e.next=16;break;case 12:throw e.prev=12,e.t0=e["catch"](0),console.error("Error uploading image:",e.t0),e.t0;case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))()})),"replaceImage",(function(t){var e=this;return Object(s["a"])(Object(o["a"])().mark((function a(){var n,r,s;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,e.selectImage();case 3:if(n=a.sent,!n){a.next=12;break}return r=new FormData,r.append("upload",n),a.next=9,e.uploadImage(r);case 9:s=a.sent,t.src=s,e.$nextTick((function(){e.updateContentWithNewImage(t,s)}));case 12:a.next=17;break;case 14:a.prev=14,a.t0=a["catch"](0),console.error("Error replacing image:",a.t0);case 17:case"end":return a.stop()}}),a,null,[[0,14]])})))()})),"updateContentWithNewImage",(function(t,e){var a=this.$refs.richEditor,n=document.createElement("img");n.src=e;var r,o=Object(c["a"])(t.attributes);try{for(o.s();!(r=o.n()).done;){var s=r.value;"src"!==s.name&&n.setAttribute(s.name,s.value)}}catch(i){o.e(i)}finally{o.f()}t.parentNode.replaceChild(n,t),this.content=a.innerHTML,this.com.content=this.content,this.$emit("updateComContent",this.currentIndex,this.com)})))}),E=S,N=(a("754e"),Object(O["a"])(E,C,_,!1,null,"100acbfb",null)),A=N.exports,z=a("37de"),D=a("c621"),R={name:"editor",emits:["onSetActiveIndex","onDelete","onInsert","onLoadArticle","onRebuild","onSetComs"],components:{Table:w,TextArea:A,draggable:m.a,Empty:z["default"]},props:{coms:{type:Array,default:null},comIndex:{type:Number,default:0},templateCate:{type:Array,default:function(){return[]}},insertCmd:{type:Object,default:null},isAdmin:{type:Number,default:2}},watch:{coms:{handler:function(t){null!=t&&(console.log("val",t),this.comList=JSON.parse(JSON.stringify(t)),console.log("comList",this.comList))},immediate:!0,deep:!0},comIndex:{handler:function(t){t<=0||(this.comList=this.comList.map((function(t){return t.isEdit=2,t.selDisabled=!0,t.valDisabled=!0,"string"===typeof t.category_id&&t.category_id.includes(" ")?t.category_id=t.category_id.split(" "):Array.isArray(t.category_id)||(t.category_id=[t.category_id].filter(Boolean)),t})))},immediate:!0,deep:!0}},data:function(){return{showEditor:!1,operation:"",id:0,comList:[],categoryList:[],props:{value:"id",label:"name",children:"children",checkStrictly:!0},saveAs:!1,draggableStyle:{width:"100%",overflowY:"auto"},type:""}},mounted:function(){var t=this;console.log(this.$store.state),this.initCategoryList(),this.type=this.$route.query.type,this.templateId=this.$route.query.templateId,this.$nextTick((function(){t.updateDirectoryNumbers()}))},methods:{onDragComplete:function(){var t=this;console.log("拖动结束"),this.$nextTick((function(){t.updateDirectoryNumbers(),t.$emit("onRebuild",t.comList)}))},updateDirectoryNumbers:function(){var t=this,e={};this.comList.forEach((function(a,n){a.attrs&&a.attrs.forEach((function(a){if("Directory"===a.type){var r=t.generateNumberedContent(n,a.level,e);a.hasOwnProperty("number")?a.number=r:t.$set(a,"number",r)}}))}))},generateNumberedContent:function(t,e,a){return this.generateLevelPrefix(t,e,a)},generateLevelPrefix:function(t,e,a){for(var n=[],r=1;r<=e;r++)1===r?n.push(t+1):(a[r]?a[r]++:a[r]=1,n.push(a[r]));return n.join(".")},carefulCopy:function(t){return t.map((function(t){var e=Object(u["a"])({},t);return Array.isArray(e.attrs)&&(e.attrs=e.attrs.map((function(t){return Object(u["a"])({},t)}))),"object"===Object(l["a"])(e.content)&&null!==e.content&&(e.content=JSON.parse(JSON.stringify(e.content))),"Table"===e.type&&(e.tableHeader=Object(i["a"])(e.tableHeader),e.tableData=e.tableData.map((function(t){return Object(u["a"])({},t)}))),e}))},handleComContentUpdate:function(t,e){this.$set(this.coms,t,e),this.$emit("onRebuild",this.coms)},showCategoryName:function(t){return"module"==this.type&&1==this.$store.state.user.roleInfo.id&&!t.valDisabled},enableName:function(t){t.valDisabled=!1,this.$forceUpdate()},showCategorySelect:function(t){return"module"===this.type&&1===this.$store.state.user.roleInfo.id&&!t.selDisabled},enableSelect:function(t){t.selDisabled=!0,console.log(t),this.$forceUpdate()},getCategory:function(t){var e=function t(e,a){var n,r=Object(c["a"])(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.id===a)return o.name;if(o.children){var s=t(o.children,a);if(s)return s}}}catch(i){r.e(i)}finally{r.f()}return null};return e(this.categoryList,t)||"请选择分类"},onSaveAs:function(t){this.saveAs=!0,this.onSaveTemplate(t)},onSaveTemplate:function(t){var e=this,a=this,n=JSON.parse(JSON.stringify(t));console.log(n),n.category&&delete n.category,n.attrs=JSON.stringify(n.attrs),n.code=n.name,n.status=5,Array.isArray(t.category_id)?n.category_id=t.category_id[t.category_id.length-1]:n.category_id=t.category_id,void 0==n.id||this.saveAs?Object(D["a"])(n).then((function(r){200==r.status&&(n.id=r.data,t.id=r.data,a.$alert("模板信息保存成功"),a.$emit("onRefresh"),e.saveAs=!1,n.selDisabled=!1,n.valDisabled=!1,e.$forceUpdate())})):Object(D["l"])(n).then((function(t){200==t.status&&(a.$alert("模板信息更新成功"),a.$emit("onRefresh"),n.selDisabled=!1,n.valDisabled=!1,e.$forceUpdate())}))},initCategoryList:function(){var t=this;return Object(s["a"])(Object(o["a"])().mark((function e(){var a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t,e.next=3,Object(D["k"])();case 3:a=e.sent,console.log(a),t.categoryList=a.data;case 6:case"end":return e.stop()}}),e)})))()},processDataForCascader:function(t){console.log("Raw data:",t);var e=new Map,a=[];return t.forEach((function(t){var a=Object(u["a"])(Object(u["a"])({},t),{},{children:[]});e.set(t.id,a)})),t.forEach((function(t){if("0"===t.parent_id||0===t.parent_id)a.push(e.get(t.id));else{var n=e.get(parseInt(t.parent_id));n?n.children.push(e.get(t.id)):(console.warn("Parent with id ".concat(t.parent_id," not found for item:"),t),a.push(e.get(t.id)))}})),console.log("Processed data:",a),a},onChangeCategory:function(t,e){var a=e[e.length-1];t.category_id=a},onUpdateProdAttr:function(t,e,a){this.comList[t].attrs[e].content=a;for(var n=this.comList[t].attrs[e].attrs.name,r=this.comList[t].attrs[e].attrs.type,o=0;o<this.comList.length;o++)for(var s=0;s<this.comList[o].attrs.length;s++)"ProductAttr"==this.comList[o].attrs[s].type&&this.comList[o].attrs[s].attrs.name==n&&this.comList[o].attrs[s].attrs.type==r&&(this.comList[o].attrs[s].content=a);this.$emit("onRebuild",this.comList)},onUpdateAttr:function(t,e,a){this.comList[t].attrs[e].content=a;for(var n=this.comList[t].attrs[e].type,r=this.comList[t].attrs[e].data,o=0;o<this.comList.length;o++)for(var s=0;s<this.comList[o].attrs.length;s++)this.comList[o].attrs[s].type==n&&this.comList[o].attrs[s].id==r&&(this.comList[o].attrs[s].content=a);this.$emit("onRebuild",this.comList)},onUpdata:function(t,e,a,n,r){var o=this,s=o.coms[t];if("variableNull"===r)s&&s.attrs&&s.attrs[e]&&s.attrs[e].id===a&&this.$set(s.attrs[e],"content",n);else for(var c=s.attrs[e].type,i=0;i<o.coms.length;i++)for(var l=0;l<o.coms[i].attrs.length;l++)o.coms[i].attrs[l].type==c&&o.coms[i].attrs[l].id==a&&(o.coms[i].attrs[l].content=n);o.$emit("onRebuild",o.coms)},onRemove:function(t){this.$emit("onDelete",t)},onEdit:function(t,e){var a=this;this.comList=this.comList.map((function(n,r){return n.isEdit=2,r===t&&1===e&&a.filterAttrs(n),n})),1==e&&(this.comList[t].isEdit=1,this.onSetActive(t)),this.$emit("onRebuild",this.comList)},filterAttrs:function(t){var e=(t.content.match(/{{([^}]+)}}/g)||[]).map((function(t){return t.slice(2,-2).trim()}));t.attrs=t.attrs.filter((function(t){return e.includes(t.id)}))},onAdd:function(t){t.preventDefault(),t.stopPropagation(),this.$emit("onRebuild",this.comList)},onDragEnd:function(t){t.preventDefault(),t.stopPropagation(),this.$emit("onRebuild",this.comList)},onUpdate:function(t,e){this.coms[t].content=e,this.$emit("onRebuild",this.coms)},onSetActive:function(t){this.$emit("onSetActiveIndex",t)}}},q=R,U=(a("716d"),Object(O["a"])(q,n,r,!1,null,null,null));e["a"]=U.exports},"37de":function(t,e,a){"use strict";var n=a("f3c2"),r=a("f746"),o=(a("203e"),a("2877")),s=Object(o["a"])(r["default"],n["a"],n["b"],!1,null,null,null);e["default"]=s.exports},"42e7":function(t,e,a){},4678:function(t,e,a){var n={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d7167","./ca.js":"d7167","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df48","./fa.js":"8df48","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120b","./ga.js":"5120b","./gd":"f6b46","./gd.js":"f6b46","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540a","./jv.js":"b540a","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e9","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e9","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd3","./sv.js":"5fbd3","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function r(t){var e=o(t);return a(e)}function o(t){if(!a.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}r.keys=function(){return Object.keys(n)},r.resolve=o,t.exports=r,r.id="4678"},"516a3":function(t,e,a){},"57c2":function(t,e,a){},5930:function(t,e,a){"use strict";a("a782")},"716d":function(t,e,a){"use strict";a("a21c")},"754e":function(t,e,a){"use strict";a("516a3")},"924b":function(t,e,a){"use strict";a("42e7")},a21c:function(t,e,a){},a307:function(t,e,a){},a782:function(t,e,a){},ac24:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"project-search"},[a("dataSearch",{on:{bindSetQuery:t.setQuery}}),a("dataList",{attrs:{queryForm:t.queryForm}})],1)},r=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-search"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.queryForm}},[a("el-form-item",{attrs:{label:"模块名称:"}},[a("el-input",{attrs:{placeholder:"请选择模块名称"},model:{value:t.queryForm.name,callback:function(e){t.$set(t.queryForm,"name",e)},expression:"queryForm.name"}})],1),a("el-form-item",{attrs:{label:"所属分类:"}},[a("el-select",{staticClass:"m-2",attrs:{clearable:"",placeholder:"请选择分类",size:"large"},model:{value:t.queryForm.category_id,callback:function(e){t.$set(t.queryForm,"category_id",e)},expression:"queryForm.category_id"}},t._l(t.categoryList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"模块状态:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择模板块态",size:"large"},model:{value:t.queryForm.status,callback:function(e){t.$set(t.queryForm,"status",e)},expression:"queryForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[a("svg-icon",{attrs:{"icon-class":"search"}}),t._v(" 搜索")],1),a("el-button",{attrs:{type:"success"},on:{click:t.onCreate}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v(" 创建模块")],1)],1)],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"","close-on-click-modal":!1,width:"30%","custom-class":"prod-verify",title:"创建模块"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{ref:"moduleRef",attrs:{model:t.moduleForm,rules:t.moduleRules,"label-position":"right","label-width":"100px"}},[a("el-form-item",{attrs:{label:"模块名称:",prop:"name"}},[a("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请选择模块名称"},model:{value:t.moduleForm.name,callback:function(e){t.$set(t.moduleForm,"name",e)},expression:"moduleForm.name"}})],1),a("el-form-item",{attrs:{label:"所属分类:",prop:"category_id"}},[a("el-cascader",{attrs:{clearable:"",options:t.categoryList,props:t.props,"show-all-levels":!1,placeholder:"请选择模块分类"},on:{change:t.onChangeCategory},model:{value:t.moduleForm.category_id,callback:function(e){t.$set(t.moduleForm,"category_id",e)},expression:"moduleForm.category_id"}})],1),a("el-form-item",{attrs:{label:"模块状态:",prop:"status"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择模板块态",size:"large"},model:{value:t.moduleForm.status,callback:function(e){t.$set(t.moduleForm,"status",e)},expression:"moduleForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:t.closeModule}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submitModule}},[t._v("确 定")])],1)],1)],1)},s=[],c=a("c7eb"),i=a("1da1"),l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{attrs:{model:t.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"组件类型:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型",size:"large"},on:{change:t.onChangeStatus},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.typeList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.text,value:t.value}})})),1)],1),a("el-form-item",{attrs:{label:"组件名称:"}},[a("el-input",{model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),a("el-form-item",{attrs:{label:"产品状态:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},on:{change:t.onChangeStatus},model:{value:t.dataForm.statusName,callback:function(e){t.$set(t.dataForm,"statusName",e)},expression:"dataForm.statusName"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.status,attrs:{label:t.name,value:t.status}})})),1)],1),a("el-form-item",{attrs:{label:"说明介绍:"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),1==t.dataForm.type?a("el-form-item",{attrs:{label:"组件内容:"}},[a("Tinymce")],1):t._e()],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)},u=[],d=(a("a9e3"),a("8256")),m=(a("24d2"),{components:{Tinymce:d["default"]},emits:["onClose"],props:{id:{type:Number,default:0}},watch:{id:{handler:function(t){var e=this;null==t||t<0||e.getInfo(t)},immediate:!0,deep:!0}},data:function(){return{activeName:"base",currentCategory:[],allCategories:[],typeList:[{value:1,text:"文本"},{value:2,text:"二维表"}],dataForm:{type:1,prod:{items:[]}},statusOptions:[{status:5,name:"启用"},{status:6,name:"停用"}]}},mounted:function(){var t=this;t.initAllCategory()},methods:{btnSave:function(t){var e=this;if(""!=e.dataForm.title)e.dataForm.id,e.dataForm.title,e.dataForm.status,e.dataForm.categoryId,e.dataForm.sku;else e.$alert("产品标题不能为空")},getInfo:function(t){},onChangeStatus:function(t){this.dataForm.status=t},onChangeCategory:function(t){var e=this;e.dataForm.categoryId=t},initAllCategory:function(){}}}),f=m,p=(a("0311"),a("2877")),b=Object(p["a"])(f,l,u,!1,null,null,null),h=b.exports,g=a("a888"),v=a("c621"),y={components:{dataInfo:h},directives:{elDragDialog:g["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",category_id:"",status:""}}}},data:function(){return{statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}],categoryList:[],dialogVisible:!1,moduleForm:{name:"",status:5,category_id:""},props:{value:"id",label:"name",children:"children",checkStrictly:!0},moduleRules:{name:[{required:!0,message:"请输模块名称",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"change"}],category_id:[{required:!0,message:"请选择分类",trigger:"change"}]}}},mounted:function(){this.initCategoryList()},methods:{onChangeCategory:function(){},closeModule:function(){this.dialogVisible=!1,this.moduleForm={name:"",status:5,category_id:""}},submitModule:function(){var t=this;this.$refs.moduleRef.validate((function(e){e&&(t.moduleForm.category_id=t.moduleForm.category_id[t.moduleForm.category_id.length-1],Object(v["a"])(t.moduleForm).then((function(e){200===e.status&&(t.$message.success("创建成功!"),t.dialogVisible=!1,t.moduleForm={name:"",status:5,category_id:""},t.onSubmit())})))}))},initCategoryList:function(){var t=this;return Object(i["a"])(Object(c["a"])().mark((function e(){var a;return Object(c["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t,e.next=3,Object(v["k"])();case 3:a=e.sent,t.categoryList=a.data;case 5:case"end":return e.stop()}}),e)})))()},onCreate:function(t){this.dialogVisible=!0},onSubmit:function(){this.$emit("bindSetQuery",this.$props.queryForm)}}},j=y,x=(a("d3fb"),Object(p["a"])(j,o,s,!1,null,null,null)),O=x.exports,k=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-list"},[a("el-table",{attrs:{data:t.dataList,"header-row-class-name":"headerBg","empty-text":"没有项目信息","max-height":t.tableMaxHeight}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"name",label:"模块名称",align:"left"}}),a("el-table-column",{attrs:{prop:"type_name",label:"所属分类",align:"left"}}),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间",align:"center"}}),a("el-table-column",{attrs:{prop:"status",label:"模板状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[5==e.row.status?a("div",[t._v("启用")]):t._e(),6==e.row.status?a("div",[t._v("停用")]):t._e()]}}])}),a("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnEdit(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑模块")],1),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.EditorInfo(e.row)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("修改信息")],1),a("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(a){return t.btnDelete(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage},model:{value:t.queryForm.page,callback:function(e){t.$set(t.queryForm,"page",e)},expression:"queryForm.page"}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"","close-on-click-modal":!1,width:"30%","custom-class":"prod-verify",title:"修改模块信息"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{ref:"moduleRef",attrs:{model:t.moduleForm,rules:t.moduleRules,"label-position":"left","label-width":"100px"}},[a("el-form-item",{attrs:{label:"模块名称:",prop:"name"}},[a("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请选择模块名称"},model:{value:t.moduleForm.name,callback:function(e){t.$set(t.moduleForm,"name",e)},expression:"moduleForm.name"}})],1),a("el-form-item",{attrs:{label:"所属分类:",prop:"category_id"}},[a("el-cascader",{attrs:{clearable:"",options:t.categoryList,props:t.props,"show-all-levels":!1,placeholder:"请选择模块分类"},on:{change:t.onChangeCategory},model:{value:t.moduleForm.category_id,callback:function(e){t.$set(t.moduleForm,"category_id",e)},expression:"moduleForm.category_id"}})],1),a("el-form-item",{attrs:{label:"模块状态:",prop:"status"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择模板块态",size:"large"},model:{value:t.moduleForm.status,callback:function(e){t.$set(t.moduleForm,"status",e)},expression:"moduleForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.closeModule}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submitModule}},[t._v("确 定")])],1)],1)],1)},w=[],C=a("ade3"),_=a("5530"),F=(a("4de4"),a("d3b7"),a("ac1f"),a("841c"),a("2f62")),$=(a("35d5"),{components:{dataInfo:h},directives:{elDragDialog:g["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",sign:""}}}},watch:{queryForm:{handler:function(t){this.search()},deep:!0}},computed:Object(_["a"])({},Object(F["b"])(["roleInfo","authList"])),data:function(){return Object(C["a"])(Object(C["a"])(Object(C["a"])(Object(C["a"])(Object(C["a"])(Object(C["a"])(Object(C["a"])({dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{}},"dialogVisible",!1),"moduleForm",{name:"",status:5,category_id:""}),"moduleRules",{name:[{required:!0,message:"请输模块名称",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"change"}],category_id:[{required:!0,message:"请选择分类",trigger:"change"}]}),"props",{value:"id",label:"name",children:"children",checkStrictly:!0}),"statusOptions",[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}]),"categoryList",[]),"tableMaxHeight",500)},mounted:function(){this.search(),this.initCategoryList()},methods:{onChangeCategory:function(){},closeModule:function(){this.dialogVisible=!1,this.moduleForm={name:"",status:5,category_id:""}},submitModule:function(){var t=this;this.$refs.moduleRef.validate((function(e){e&&Object(v["l"])(t.moduleForm).then((function(e){200===e.status&&(t.$message.success("修改成功!"),t.dialogVisible=!1,t.moduleForm={name:"",status:5,category_id:""},t.onSubmit())}))}))},initCategoryList:function(){var t=this;return Object(i["a"])(Object(c["a"])().mark((function e(){var a;return Object(c["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t,e.next=3,Object(v["k"])();case 3:a=e.sent,t.categoryList=a.data;case 5:case"end":return e.stop()}}),e)})))()},EditorInfo:function(t){this.dialogVisible=!0,this.moduleForm=t},checkAuth:function(t){if(1==this.roleInfo.is_admin)return!0;var e=this.authList.filter((function(e){return 999==e.type&&e.path==t}));return e.length>0},btnDelete:function(t){var e=this,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(v["c"])(a).then((function(t){e.search()}))})).catch((function(){}))},searchData:function(){var t=this;t.dialogVisible=!1,t.search()},btnEdit:function(t){var e=document.createElement("a");e.href="#/document/create?templateId="+t+"&type=module",e.target="_blank",e.click()},handleClose:function(){var t=this;t.currentDataId=0,t.dialogVisible=!1,t.search()},search:function(){var t=this;Object(v["h"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage)}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}}),L=$,I=(a("f2e1"),Object(p["a"])(L,k,w,!1,null,null,null)),S=I.exports,E={components:{dataSearch:O,dataList:S},data:function(){return{queryForm:{page:1,pageSize:10,name:"",parent_id:0,status:""}}},mounted:function(){this.queryForm.parent_id=void 0==this.$route.query.parent_id?0:this.$route.query.parent_id},methods:{setQuery:function(t){this.queryForm=t}}},N=E,A=(a("5930"),Object(p["a"])(N,n,r,!1,null,null,null));e["default"]=A.exports},c621:function(t,e,a){"use strict";a.d(e,"j",(function(){return r})),a.d(e,"b",(function(){return o})),a.d(e,"m",(function(){return s})),a.d(e,"f",(function(){return c})),a.d(e,"d",(function(){return i})),a.d(e,"h",(function(){return l})),a.d(e,"i",(function(){return u})),a.d(e,"g",(function(){return d})),a.d(e,"c",(function(){return m})),a.d(e,"a",(function(){return f})),a.d(e,"l",(function(){return p})),a.d(e,"e",(function(){return b})),a.d(e,"k",(function(){return h}));var n=a("b775");function r(t){return Object(n["a"])({url:"/template/category/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/template/category/create",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/template/category/update",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/template/category/info",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/template/category/delete",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/template/pageTemplate",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/template/search",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/template/info",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/template/delete",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/template/create",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/template/update",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/template/category/allList",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/template/category/treeCategory",method:"post",data:t})}},c9e6:function(t,e){},d3fb:function(t,e,a){"use strict";a("a307")},f2e1:function(t,e,a){"use strict";a("17ea")},f3c2:function(t,e,a){"use strict";a.d(e,"a",(function(){return n})),a.d(e,"b",(function(){return r}));var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"com-empty"})},r=[]},f746:function(t,e,a){"use strict";var n=a("c9e6"),r=a.n(n);e["default"]=r.a}}]);