(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c5c50ed"],{"04f3":function(e,t,a){"use strict";a("5898")},"05384":function(e,t,a){},"0561":function(e,t,a){},"09c7":function(e,t,a){},"0fee":function(e,t,a){},1:function(e,t){},10:function(e,t){},11:function(e,t){},12:function(e,t){},13:function(e,t){},14:function(e,t){},15:function(e,t){},16:function(e,t){},1684:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-menus"},[a("div",{staticClass:"menus-out"},e._l(e.filteredMenus,(function(t,r){return a("div",{key:r,staticClass:"group-item",class:"group-item"+r},[a("div",{staticClass:"items-name"},[e._v(e._s(t.name))]),a("div",{staticClass:"menus"},[e._l(t.subMenus,(function(t,r){return[a("div",{key:r,staticClass:"menu",class:{disabled:"document"===e.type&&"ai"!==t.key||"article"===t.key&&"module"===e.type},on:{click:function(a){return e.onClickMenus(t)}}},[a("div",{staticClass:"icon"},[""!=t.icon?a("svg-icon",{attrs:{className:"svg-style",size:"120","icon-class":t.icon}}):e._e()],1),a("div",{staticClass:"menu-name"},[e._v(e._s(t.name))])])]}))],2)])})),0),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showFormula,"append-to-body":"",width:"60%","close-on-click-modal":!1,"custom-class":"prod-verify",top:"20px",title:"选择公式"},on:{"update:visible":function(t){e.showFormula=t}}},[a("Formula",{attrs:{comList:e.comArr},on:{onPicked:e.onPickedFormula}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showVariable,"append-to-body":"",width:"800px","close-on-click-modal":!1,"custom-class":"prod-verify",top:"20px",title:e.insertTitle},on:{"update:visible":function(t){e.showVariable=t}}},[a("Variable",{attrs:{type:e.type},on:{onPicked:e.onPickedVariable,onData:e.btnbianl}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showSourceData,"append-to-body":"",width:"300","close-on-click-modal":!1,top:"20px","custom-class":"prod-verify",title:"选择源数据"},on:{"update:visible":function(t){e.showSourceData=t}}},[a("sourceData",{on:{onPicked:e.onPickedTab}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showSourceAi,"append-to-body":"",width:"300","close-on-click-modal":!1,top:"20px","custom-class":"prod-verify",title:"AI"},on:{"update:visible":function(t){e.showSourceAi=t}}},[a("ChatBox")],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showSourceEs,"append-to-body":"",width:"300","close-on-click-modal":!1,"custom-class":"prod-verify",title:"AI随笔"},on:{"update:visible":function(t){e.showSourceEs=t}}},[a("sourceEs",{on:{onPicked:e.onPickedAi}})],1)],1)},_=[],n=a("5530"),s=(a("4de4"),a("d81d"),a("d3b7"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-formual"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.queryForm}},[a("el-form-item",{attrs:{label:"公式名称:"}},[a("el-input",{attrs:{placeholder:"请填写公式名称"},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name",t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnSearch}},[a("svg-icon",{attrs:{"icon-class":"search"}}),e._v(" 搜索")],1),a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnCreate}},[a("svg-icon",{attrs:{"icon-class":"plus"}}),e._v(" 新增公式")],1)],1)],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataList,"header-row-class-name":"headerBg","empty-text":"没有公式信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"50"}}),a("el-table-column",{attrs:{prop:"name",label:"名称",align:"left"}}),a("el-table-column",{attrs:{prop:"intro",label:"介绍",align:"center"}}),a("el-table-column",{attrs:{prop:"formula",label:"内容",align:"center","min-width":"150"}}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"350"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.btnPicked(t.row)}}},[a("svg-icon",{attrs:{"icon-class":"confirm"}}),e._v("使用")],1),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.btnOnEdit(t.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),e._v("编辑")],1),a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return e.btnDel(t.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),e._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:e.queryForm.page,"page-size":e.queryForm.pageSize,total:e.recordCount,"page-count":e.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":e.ChangePage}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.dialogVisible,"append-to-body":"","close-on-click-modal":!1,width:"300","custom-class":"prod-verify",title:e.title},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("dataInfo",{attrs:{id:e.dataId,list:e.comList},on:{onClose:e.onClose}})],1)],1)}),o=[],i=(a("ac1f"),a("841c"),a("f9e5")),c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{attrs:{model:e.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"公式名称:"}},[a("el-input",{model:{value:e.dataForm.name,callback:function(t){e.$set(e.dataForm,"name",t)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{label:"公式:"}},[a("el-input",{ref:"formulaInput",attrs:{type:"textarea"},on:{input:e.handleFormulaInput},model:{value:e.dataForm.formula,callback:function(t){e.$set(e.dataForm,"formula",t)},expression:"dataForm.formula"}}),a("div",{staticStyle:{display:"flex","justify-content":"flex-end"}},[a("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"primary"},on:{click:e.InsertModule}},[e._v("插入模块变量")])],1),a("div",{staticClass:"intro"},[e._v(" 公式说明: "),a("div",[e._v(" 格式一:[T][模块引用名][属性引用名] "),a("span",[e._v("*")]),e._v("其中 [T]表示的是模块引用。 ")]),a("div",[e._v("目前仅支持+、-、*、/ 四种计算符合")]),a("div",[e._v("示例: [T][模块01][attr01]+[T][模块01][attr02]")]),a("div",[e._v(" 格式二:[T][模块引用名][属性引用名] IF(判断条件,true值,false值)"),a("span",[e._v("*")]),e._v("其中 [T]表示的是模块引用。 ")]),a("div",[e._v(" 示例: [T][图文][测试1]+IF([T][图文][测试1]>30,[T][图文][测试2],11) ")]),a("div",[e._v(" 嵌套示例: [T][图文][测试1] + IF([T][图文][测试2] > 50, IF([T][图文][测试1] > 30, [T][图文][测试3], 20), IF([T][图文][测试3] > 40, 15, [T][图文][测试2]) ) ")])])],1),a("el-form-item",{attrs:{label:"保留小数点:"}},[a("el-input",{attrs:{type:"number",min:"0",max:"4",step:1},on:{input:e.validatePoint},model:{value:e.dataForm.point,callback:function(t){e.$set(e.dataForm,"point",e._n(t))},expression:"dataForm.point"}})],1),a("el-form-item",{attrs:{label:"介绍:"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.dataForm.intro,callback:function(t){e.$set(e.dataForm,"intro",t)},expression:"dataForm.intro"}})],1),a("el-form-item",{attrs:{label:"公式状态:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},model:{value:e.dataForm.status,callback:function(t){e.$set(e.dataForm,"status",t)},expression:"dataForm.status"}},e._l(e.statusOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:e.btnSave}},[e._v("确认保存")])],1),a("el-dialog",{attrs:{visible:e.variablesVisible,"append-to-body":"",width:"300","custom-class":"prod-verify",title:e.title,"close-on-click-modal":!1},on:{"update:visible":function(t){e.variablesVisible=t},close:e.close}},[a("el-form",{ref:"insertRef",attrs:{model:e.insertForm,rules:e.insertRules}},[a("el-form-item",{attrs:{label:"模块名称:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择模块",size:"large"},on:{change:e.changeModule},model:{value:e.insertForm.moduleName,callback:function(t){e.$set(e.insertForm,"moduleName",t)},expression:"insertForm.moduleName"}},e._l(e.list,(function(e,t){return a("el-option",{key:e.id+"-"+t,attrs:{label:e.name,value:e.attrs}})})),1)],1),a("el-form-item",{attrs:{label:"属性名称:",prop:"Variable"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择属性",size:"large"},model:{value:e.insertForm.Variable,callback:function(t){e.$set(e.insertForm,"Variable",t)},expression:"insertForm.Variable"}},e._l(e.attrList,(function(e,t){return a("el-option",{key:e.id+"-"+t,attrs:{label:e.name,value:e.id}})})),1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"warning"},on:{click:e.btnInster}},[e._v("确认插入")])],1)],1),a("el-dialog",{attrs:{visible:e.tableDataVisible,"append-to-body":"",width:"400","custom-class":"prod-verify",title:"插入表格数据","close-on-click-modal":!1},on:{"update:visible":function(t){e.tableDataVisible=t},close:e.close}},[a("div",{staticClass:"com-formual"},[a("el-form",[a("el-form-item",[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},on:{change:e.onChangeTab},model:{value:e.tableCode,callback:function(t){e.tableCode=t},expression:"tableCode"}},e._l(e.tableList,(function(e,t){return a("el-option",{key:e.id,attrs:{label:e.name,value:t}})})),1)],1),e.fileLoadStatus?a("el-form-item",{staticStyle:{"min-height":"500px"}},[a("div",{ref:"luckysheets",staticStyle:{width:"100%",height:"500px"},attrs:{id:"luckysheets"}})]):e._e()],1)],1)]),a("el-dialog",{attrs:{visible:e.showConfirm,title:"数据确认",width:"500","align-center":"","append-to-body":!0,"close-on-click-modal":!1},on:{"update:visible":function(t){e.showConfirm=t}},scopedSlots:e._u([{key:"footer",fn:function(){return[a("div",{staticClass:"dialog-footer"},[a("el-button",{on:{click:function(t){e.showConfirm=!1}}},[e._v("关闭")]),a("el-button",{attrs:{type:"primary"},on:{click:e.onConfirm}},[e._v("确认插入")])],1)]},proxy:!0}])},[a("div",[e._v("当前工作表:"+e._s(e.position.sheet))]),a("div",[e._v("当前取值:"+e._s(e.position.value))])])],1)},l=[],u=a("ade3"),d=(a("99af"),a("7db0"),a("c740"),a("caad"),a("b0c0"),a("a9e3"),a("b64b"),a("00b4"),a("2532"),a("498a"),a("1c4c")),m=(a("f7e6"),{emits:["onClose"],props:{id:{type:Number,default:0},list:{type:Array,default:[]}},watch:{id:{handler:function(e){var t=this;null!=e&&(0!=e?t.getInfo(e):this.dataForm={id:0,name:"",formula:"",intro:"",status:"",use_status:5,params:"[]",point:0})},immediate:!0,deep:!0},list:{handler:function(e,t){console.log("list changed:",e)},immediate:!0,deep:!0}},data:function(){return{activeName:"base",currentCategory:[],allCategories:[],dataForm:{id:0,name:"",formula:"",intro:"",status:5,use_status:5,params:"[]",point:0},statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"使用中"},{value:6,label:"已停用"}],variablesVisible:!1,title:"",insertForm:{moduleName:"",Variable:""},insertRules:{Variable:[{required:!0,message:"请选择变量",trigger:"change"}]},tableDataVisible:!1,tableCode:"",tableList:[],showConfirm:!1,fileLoadStatus:!1,position:{tb:"",c:0,r:0,sheet:"",value:""},attrList:[]}},mounted:function(){this.initTableList()},methods:{validatePoint:function(e){var t=parseInt(e);isNaN(t)||t<0||t>4?this.dataForm.point="":this.dataForm.point=t},close:function(){this.insertForm={}},handleFormulaInput:function(e){this.dataForm.formula=e},btnSave:function(e){var t=this;t.dataForm.id>0?Object(i["e"])(t.dataForm).then((function(e){t.dataForm={status:5,use_status:5,params:"[]",id:0,name:"",formula:"",intro:"",point:0},t.$message.success("公式更新成功")})):Object(i["a"])(t.dataForm).then((function(e){t.dataForm={status:5,use_status:5,params:"[]",id:0,name:"",formula:"",intro:"",point:0},t.$message.success("公式创建的成功")})),t.$emit("onClose")},getInfo:function(e){var t=this,a={id:e};Object(i["c"])(a).then((function(e){e&&200==e.status&&(t.dataForm=e.data)}))},onChangeStatus:function(e){this.dataForm.status=e},onChangeCategory:function(e){var t=this;t.dataForm.categoryId=e},InsertModule:function(){this.variablesVisible=!0,this.title="插入模块变量"},extractChineseTemplates:function(e){var t,a=/\{\{(.*?)\}\}/g,r=/[\u4e00-\u9fa5]/,_=[];while(null!==(t=a.exec(e)))r.test(t[1])&&_.push(t[1].trim());return _},processContent:function(e){if(console.log(e),e&&e.content){var t=this.extractChineseTemplates(e.content);console.log("Chinese templates:",t),e.attrs&&Array.isArray(e.attrs)&&(this.attrList=e.attrs.filter((function(e){return t.includes(e.id)})))}else this.attrList=[]},changeModule:function(e){var t=this.list.findIndex((function(t){return t.attrs===e}));this.processContent(this.list[t])},btnInster:function(){var e=this;this.$refs.insertRef.validate((function(t){if(!t)return!1;var a=e.list.find((function(t){return t.attrs===e.insertForm.moduleName}));if(a){var r,_=a.name,n=null===(r=e.attrList.find((function(t){return t.id===e.insertForm.Variable})))||void 0===r?void 0:r.name;if(n){var s="[T][".concat(_,"][").concat(n,"]");e.dataForm.formula+=s,e.variablesVisible=!1,e.$message.success("变量插入成功")}else e.$message.error("无法找到选中的变量")}else e.$message.error("无法找到选中的模块")}))},InsertTableData:function(){this.tableDataVisible=!0},onConfirm:function(e){this.showConfirm=!1;var t="[R][".concat(this.position.tb,"][").concat(this.position.sheet,"][").concat(this.position.r+1,",").concat(this.position.c+1,"]");this.dataForm.formula+=t,this.tableDataVisible=!1,this.$message.success("表格数据插入成功"),this.insertForm={moduleName:{},Variable:""}},onChangeTab:function(e){var t=this,a=t.tableList[e];t.fileLoadStatus=!0,a.sourceData=JSON.parse(a.source_data),console.log(a.sourceData.exportJson.sheets),t.position.tb=a.code,t.$nextTick((function(){luckysheet.destroy(),luckysheet.create(Object(u["a"])(Object(u["a"])(Object(u["a"])({container:"luckysheets",data:a.sourceData.exportJson.sheets,lang:"zh",showinfobar:!1,showstatisticBar:!1,sheetBottomConfig:!1,allowEdit:!1,enableAddRow:!1,enableAddCol:!1,sheetFormulaBar:!1,enableAddBackTop:!1,showsheetbar:!0},"enableAddRow",!1),"showsheetbarConfig",{add:!1,menu:!1}),"hook",{cellMousedown:function(e,a,r,_){t.position.sheet=r.name,t.position.r=a.r,t.position.c=a.c,e.v?t.position.value=e.v:(t.position.value="",e.ct.s.map((function(e){t.position.value+=e.v}))),t.showConfirm=!0}}))}))},initTableList:function(){var e=this;Object(d["b"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}}),p=m,b=(a("c7ff"),a("2877")),f=Object(b["a"])(p,c,l,!1,null,null,null),h=f.exports,E=a("a888"),v={name:"Formula",emits:["onPicked"],directives:{elDragDialog:E["a"]},components:{dataInfo:h},props:{comList:{type:Array,default:[]}},data:function(){return{dataId:0,dialogVisible:!1,title:"创建公式",queryForm:{page:1,pageSize:10,name:""},recordCount:0,pageTotal:1,dataList:[]}},mounted:function(){this.onBtnSearch()},methods:{onBtnCreate:function(e){var t=this;t.title="创建公式",t.dataId=0,t.dialogVisible=!0},btnOnEdit:function(e){this.title="编辑公式",this.dataId=e,this.dialogVisible=!0},onClose:function(e){var t=this;t.dialogVisible=!1,t.onBtnSearch()},onBtnSearch:function(e){var t=this;t.queryForm.page=1,t.search()},btnPicked:function(e){this.$emit("onPicked",e)},search:function(){var e=this;Object(i["d"])(e.queryForm).then((function(t){200==t.status&&(e.dataList=t.data.dataList,e.recordCount=t.data.totalPage,e.pageTotal=t.data.totalRecord)}))},ChangePage:function(e){var t=this;t.queryForm.page=e,t.search()},btnDel:function(e){var t=this;Object(i["b"])({id:e}).then((function(e){t.$message.success("删除成功!"),t.search()}))}}},O=v,g=(a("be00"),Object(b["a"])(O,s,o,!1,null,null,null)),j=g.exports,y=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-formual"},[a("el-form",[a("el-form-item",[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},on:{change:e.onChangeTab},model:{value:e.tableCode,callback:function(t){e.tableCode=t},expression:"tableCode"}},e._l(e.tableList,(function(e,t){return a("el-option",{key:e.id,attrs:{label:e.name,value:t}})})),1)],1),e.fileLoadStatus?a("el-form-item",{staticStyle:{"min-height":"500px"}},[a("div",{ref:"luckysheet",staticStyle:{width:"100%",height:"500px"},attrs:{id:"luckysheet"}})]):e._e()],1),a("el-dialog",{attrs:{visible:e.showConfirm,"close-on-click-modal":!1,title:"数据确认",width:"500","align-center":"","append-to-body":!0},on:{"update:visible":function(t){e.showConfirm=t}},scopedSlots:e._u([{key:"footer",fn:function(){return[a("div",{staticClass:"dialog-footer"},[a("el-button",{on:{click:function(t){e.showConfirm=!1}}},[e._v("关闭")]),a("el-button",{attrs:{type:"primary"},on:{click:e.onConfirm}},[e._v(" 确认选择 ")])],1)]},proxy:!0}])},[a("div",[e._v("当前工作表:"+e._s(e.position.sheet)+" ")]),a("div",[e._v("当前取值:"+e._s(e.position.value))])])],1)},D=[],C={name:"SourceData",emits:["onPicked"],components:{},data:function(){return{tableCode:"",tableList:[],showConfirm:!1,fileLoadStatus:!1,position:{tb:"",c:0,r:0,sheet:"",value:""}}},mounted:function(){this.initTableList()},methods:{onConfirm:function(e){this.showConfirm=!1,this.$emit("onPicked",this.position)},onChangeTab:function(e){var t=this,a=t.tableList[e];t.fileLoadStatus=!0,a.sourceData=JSON.parse(a.source_data),t.position.tb=a.code,t.$nextTick((function(){luckysheet.destroy(),luckysheet.create(Object(u["a"])(Object(u["a"])(Object(u["a"])({container:"luckysheet",data:a.sourceData.exportJson.sheets,lang:"zh",showinfobar:!1,showstatisticBar:!1,sheetBottomConfig:!1,allowEdit:!1,enableAddRow:!1,enableAddCol:!1,sheetFormulaBar:!1,enableAddBackTop:!1,showsheetbar:!0},"enableAddRow",!1),"showsheetbarConfig",{add:!1,menu:!1}),"hook",{cellMousedown:function(e,a,r,_){t.position.sheet=r.name,t.position.r=a.r,t.position.c=a.c,e.v?t.position.value=e.v:(t.position.value="",e.ct.s.map((function(e){t.position.value+=e.v}))),t.showConfirm=!0},cellUpdated:function(e,t,a,r,_){}}))}))},initTableList:function(){var e=this;Object(d["b"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}},x=C,P=(a("4b4d"),Object(b["a"])(x,y,D,!1,null,null,null)),k=P.exports,M=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-formual"},[a("el-form",[a("el-form-item",[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择模型",size:"large"},on:{change:e.onChangeTab},model:{value:e.tableCode,callback:function(t){e.tableCode=t},expression:"tableCode"}},[a("el-option",{attrs:{label:"测试模型",value:0}})],1)],1),a("el-form-item",[e.showSearch?a("el-input",{on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.retrieval(t)}},model:{value:e.dataIntro,callback:function(t){e.dataIntro=t},expression:"dataIntro"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.retrieval},slot:"append"})],1):e._e()],1),e.fileLoadStatus?a("el-form-item",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{"min-height":"200px"}},[a("div",[e._v("当前回答内容:"+e._s(e.textInfo))]),a("div",{staticClass:"dialog-footer",staticStyle:{display:"flex","justify-content":"flex-end"}},[a("el-button",{attrs:{type:"primary"},on:{click:e.onConfirm}},[e._v(" 确认选择 ")])],1)]):e._e()],1)],1)},I=[],w=a("c7eb"),A=a("1da1"),L=a("bc3a"),R=a.n(L),T={name:"SourceAi",emits:["onPicked"],components:{},data:function(){return{tableCode:"",tableList:[],showConfirm:!1,fileLoadStatus:!1,showSearch:!1,position:{tb:"",c:0,r:0,sheet:"",value:""},dataIntro:"",textInfo:"",loading:!1,searchResult:{}}},mounted:function(){this.initTableList()},methods:{retrieval:function(){var e=this;return Object(A["a"])(Object(w["a"])().mark((function t(){var a;return Object(w["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.fileLoadStatus=!0,e.loading=!0,t.prev=2,t.next=5,R.a.post("http://58.246.234.210:7860/api/v1/run/c7ea3a2d-f50c-4936-b96c-3fe7c34fa062?stream=false",{input_value:e.dataIntro,output_type:"chat",input_type:"chat",tweaks:{"ChatInput-MbQRf":{},"ParseData-UiiZo":{},"Prompt-L8PiG":{},"ChatOutput-MdiWR":{},"SplitText-JIbWW":{},"File-1i88L":{},"OllamaEmbeddings-4TSqH":{},"Milvus-Wotjl":{},"OllamaModel-j2Vj0":{},"Milvus-fivEN":{},"OllamaEmbeddings-e409J":{}}},{headers:{"Content-Type":"application/json"}});case 5:a=t.sent,200===a.status&&(e.textInfo=a.data.outputs[0].outputs[0].results.message.data.text,e.searchResult={searchTerm:e.dataIntro,result:e.textInfo}),t.next=13;break;case 9:t.prev=9,t.t0=t["catch"](2),console.error("Error during retrieval:",t.t0),e.$message.error("检索失败,请稍后重试");case 13:return t.prev=13,e.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[2,9,13,16]])})))()},onConfirm:function(e){this.$emit("onPicked",this.searchResult)},onChangeTab:function(e){var t=this;t.showSearch=!0},initTableList:function(){var e=this;Object(d["b"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}},U=T,B=(a("b82f"),Object(b["a"])(U,M,I,!1,null,null,null)),W=B.exports,K=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-formual"},[a("el-form",[a("el-form-item",[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择模型",size:"large"},on:{change:e.onChangeTab},model:{value:e.tableCode,callback:function(t){e.tableCode=t},expression:"tableCode"}},[a("el-option",{attrs:{label:"测试模型",value:0}})],1)],1),a("el-form-item",[e.showSearch?a("el-input",{on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.retrieval(t)}},model:{value:e.dataIntro,callback:function(t){e.dataIntro=t},expression:"dataIntro"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.retrieval},slot:"append"})],1):e._e()],1),e.fileLoadStatus?a("el-form-item",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{"min-height":"200px"}},[a("div",[e._v("当前回答内容:"+e._s(e.textInfo))])]):e._e()],1)],1)},S=[],F={name:"SourceEs",emits:["onPicked"],components:{},data:function(){return{tableCode:"",tableList:[],showConfirm:!1,fileLoadStatus:!1,showSearch:!1,position:{tb:"",c:0,r:0,sheet:"",value:""},dataIntro:"",textInfo:"",loading:!1,searchResult:{}}},mounted:function(){this.initTableList()},methods:{retrieval:function(){var e=this;return Object(A["a"])(Object(w["a"])().mark((function t(){var a;return Object(w["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.fileLoadStatus=!0,e.loading=!0,t.prev=2,t.next=5,R.a.post("http://58.246.234.210:7860/api/v1/run/3f84a841-cefd-44b3-9555-568cc3b6c2d2?stream=false",{input_value:e.dataIntro,output_type:"chat",input_type:"chat",tweaks:{"ChatInput-em6qC":{},"ParseData-yO3YQ":{},"Prompt-Wj75b":{},"ChatOutput-zy9na":{},"SplitText-O1knk":{},"File-4j6Zd":{},"OllamaEmbeddings-xbYXX":{},"Chroma-OIejP":{},"OllamaModel-04mEO":{},"OllamaEmbeddings-UGvLP":{},"Chroma-HzukO":{}}},{headers:{"Content-Type":"application/json"}});case 5:a=t.sent,200===a.status&&(e.textInfo=a.data.outputs[0].outputs[0].results.message.data.text),t.next=13;break;case 9:t.prev=9,t.t0=t["catch"](2),console.error("Error during retrieval:",t.t0),e.$message.error("检索失败,请稍后重试");case 13:return t.prev=13,e.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[2,9,13,16]])})))()},onConfirm:function(e){this.$emit("onPicked",this.searchResult)},onChangeTab:function(e){var t=this;t.showSearch=!0},initTableList:function(){var e=this;Object(d["b"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}},$=F,q=Object(b["a"])($,K,S,!1,null,null,null),N=q.exports,V=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-formual"},[1==e.type?a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.queryForm}},[a("el-form-item",{attrs:{label:"类型:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型",size:"large"},model:{value:e.queryForm.type,callback:function(t){e.$set(e.queryForm,"type",t)},expression:"queryForm.type"}},e._l(e.typeList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"变名称:"}},[a("el-input",{attrs:{placeholder:"请填写变量名称"},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name",t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnSearch}},[a("svg-icon",{attrs:{"icon-class":"search"}}),e._v(" 搜索")],1),a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnCreate}},[a("svg-icon",{attrs:{"icon-class":"plus"}}),e._v(" 新增变量")],1)],1)],1):e._e(),2==e.type?a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.queryForm}},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnConst}},[a("svg-icon",{attrs:{"icon-class":"plus"}}),e._v(" 新增常量")],1)],1)],1):e._e(),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataList,"header-row-class-name":"headerBg","empty-text":"没有数据信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center"}}),a("el-table-column",{attrs:{prop:"code",label:"编码",align:"left"}}),a("el-table-column",{attrs:{prop:"name",label:"名称",align:"left"}}),1==e.type?a("el-table-column",{attrs:{prop:"value",label:"取值","show-overflow-tooltip":"",align:"left","min-width":"150"}}):e._e(),a("el-table-column",{attrs:{label:"操作",align:"center",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.btnPicked(t.row)}}},[a("svg-icon",{attrs:{"icon-class":"confirm"}}),e._v("使用")],1),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.btnOnEdit(t.row.id,t.row)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),e._v("编辑")],1),a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return e.btnOnDelete(t.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),e._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:e.queryForm.page,"page-size":e.queryForm.pageSize,total:e.recordCount,"page-count":e.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":e.ChangePage}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.dialogVisible,"append-to-body":"",width:"300","close-on-click-modal":!1,"custom-class":"prod-verify",title:e.title},on:{"update:visible":function(t){e.dialogVisible=t},closed:e.handleDialogClosed}},[a("dataInfo",{ref:"dataInfoRef",attrs:{id:e.dataId,type:e.type},on:{onClose:e.onClose}})],1)],1)},z=[],H=(a("e9c4"),a("159b"),a("b775"));function G(e){return Object(H["a"])({url:"/params/search",method:"post",data:e})}function J(e){return Object(H["a"])({url:"/params/create",method:"post",data:e})}function Y(e){return Object(H["a"])({url:"/params/update",method:"post",data:e})}function X(e){return Object(H["a"])({url:"/params/delete",method:"post",data:e})}function Z(e){return Object(H["a"])({url:"/params/info",method:"post",data:e})}var Q=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{ref:"dataFormRef",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"名称 :"}},[a("el-input",{model:{value:e.dataForm.name,callback:function(t){e.$set(e.dataForm,"name",t)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{label:"取值类型:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择取值类型",size:"large",clearable:""},model:{value:e.dataForm.value_type,callback:function(t){e.$set(e.dataForm,"value_type",t)},expression:"dataForm.value_type"}},e._l(e.valueTypeList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),1==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),2==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),3==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:",prop:"value"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),4==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:",prop:"value"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}},[a("template",{slot:"append"},[e._v("%")])],2)],1):e._e(),5==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:",prop:"value"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),2==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值范围:"}},[a("el-select",{ref:"categorySelect",staticStyle:{width:"100%"},attrs:{multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"点击enter创建选择标签","popper-class":"custom-select-dropdown"},model:{value:e.dataForm.value_item,callback:function(t){e.$set(e.dataForm,"value_item",t)},expression:"dataForm.value_item"}})],1):e._e(),a("el-form-item",{attrs:{label:"介绍:"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.dataForm.intro,callback:function(t){e.$set(e.dataForm,"intro",t)},expression:"dataForm.intro"}})],1),a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},model:{value:e.dataForm.status,callback:function(t){e.$set(e.dataForm,"status",t)},expression:"dataForm.status"}},e._l(e.statusOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:e.btnSave}},[e._v("确认保存")])],1)],1)},ee=[],te=(a("a15b"),a("b680"),a("323e"),{emits:["onClose"],props:{id:{type:Number,default:0},type:{type:Number,default:1}},watch:{type:{handler:function(e){null==e&&e<=0||(this.dataForm.type=e)},immediate:!0,deep:!0},id:{handler:function(e){console.log(e);var t=this;null==e||e<=0||t.getInfo(e)},immediate:!0,deep:!0},hideDropdown:function(e){var t=document.querySelector(".custom-select-dropdown");t&&(t.style.display=e?"none":"")}},data:function(){var e=this,t=function(t,a,r){if(5==e.dataForm.value_type){var _=/^\d+$/;_.test(a)?r():r(new Error("请输入整数"))}else if(4==e.dataForm.value_type){var n=/^(?:100|\d{1,2}(?:\.\d+)?)$/;n.test(a)?r():r(new Error("请输入有效的百分数(0-100%)"))}else if(3==e.dataForm.value_type){var s=/^\d+(\.\d+)?$/;s.test(a)?r():r(new Error("请输入有效的小数"))}};return{activeName:"base",currentCategory:[],valueTypeList:[{value:0,name:"请选择取值类型"},{value:1,name:"输入框"},{value:2,name:"下拉选择"},{value:3,name:"小数"},{value:4,name:"百分比"},{value:5,name:"整数"}],allCategories:[],typeList:[{value:1,name:"变量"},{value:2,name:"常量"}],dataForm:{id:0,type:1,name:"",value:"",value_type:0,value_item:" ",intro:"",status:5},statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"使用中"},{value:6,label:"已停用"}],dataRule:{value:[{required:!0,message:"请输入取值",trigger:"blur"},{validator:t,trigger:"blur"}]},tags:[],shouldPreventDropdown:!0,hideDropdown:!1}},mounted:function(){},methods:{handleSelectFocus:function(e){this.$refs.categorySelect.blur()},createTag:function(){console.log("Enter key pressed, create a tag with:",this.dataForm.value_item),""!==this.dataForm.value_item.trim()&&(this.tags.push(this.dataForm.value_item.trim()),this.dataForm.value_item=""),console.log(this.tags)},resetForm:function(){var e=this;this.dataForm={id:0,type:this.type,name:"",value:"",value_type:0,value_item:"",intro:"",status:5},this.$nextTick((function(){e.$refs.dataFormRef&&e.$refs.dataFormRef.resetFields()}))},btnSave:function(e){var t=this;t.$refs.dataFormRef.validate((function(e){if(e){if(1==t.dataForm.value_type)t.dataForm.value_item=t.dataForm.value;else if(4==t.dataForm.value_type){var a=parseFloat(t.dataForm.value),r=a.toFixed(2)+"%";t.dataForm.value=r}else 2==t.dataForm.value_type&&(t.dataForm.value_item=t.dataForm.value_item.join(","));t.dataForm.code=t.dataForm.name,t.dataForm.id>0?Y(t.dataForm).then((function(e){200==e.status&&(t.resetForm(),t.$alert("信息更新成功"),t.$emit("onClose"))})):J(t.dataForm).then((function(e){200==e.status&&(t.resetForm(),t.$alert("信息创建成功"),t.$emit("onClose"))})),t.$emit("onClose")}else console.log("错误")}))},getInfo:function(e){var t=this,a={id:e};Z(a).then((function(e){e&&200==e.status&&(t.dataForm=e.data,2==t.dataForm.value_type&&t.dataForm.value_item&&(t.dataForm.value_item=t.dataForm.value_item.split(",")))}))},onChangeStatus:function(e){this.dataForm.status=e},onChangeCategory:function(e){var t=this;t.dataForm.categoryId=e}}}),ae=te,re=(a("b93f"),Object(b["a"])(ae,Q,ee,!1,null,null,null)),_e=re.exports,ne={name:"searchParams",emits:["onPicked","onData"],directives:{elDragDialog:E["a"]},components:{dataInfo:_e},props:{type:{type:Number,default:1}},watch:{type:{handler:function(e){console.log(e),this.queryForm.type=e,this.onBtnSearch()},immediate:!0,deep:!0},dataList:{handler:function(e,t){var a=this;e.forEach((function(e,r){JSON.stringify(e)!==JSON.stringify(t[r])&&a.$emit("onData",e)}))},deep:!0}},data:function(){return{dataId:0,dialogVisible:!1,title:"创建变量",queryForm:{page:1,pageSize:10,name:"",status:5,type:1},typeList:[{value:1,name:"变量"},{value:2,name:"常量"}],recordCount:0,pageTotal:1,dataList:[]}},mounted:function(){},methods:{handleDialogClosed:function(){this.$refs.dataInfoRef&&this.$refs.dataInfoRef.resetForm(),this.dataId=0},onClose:function(e){this.dialogVisible=!1,this.onBtnSearch(),this.handleDialogClosed()},btnOnEdit:function(e,t){var a=this;this.title=1==t.type?"修改变量":"修改常量",this.$nextTick((function(){a.dataId=e,a.dialogVisible=!0}))},btnOnDelete:function(e){var t=this,a={id:e};t.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(e){X(a).then((function(e){t.search()}))})).catch((function(){}))},onBtnCreate:function(e){var t=this;t.dataId=0,t.title="创建变量",t.dialogVisible=!0},onBtnSearch:function(e){var t=this;t.queryForm.page=1,t.search()},btnPicked:function(e){this.$emit("onPicked",e)},search:function(){var e=this;G(e.queryForm).then((function(t){t&&(e.dataList=t.data.dataList,e.recordCount=t.data.totalRecord,e.pageTotal=t.data.pageTotal)}))},ChangePage:function(e){var t=this;t.queryForm.page=e,t.search()},onBtnConst:function(){var e=this;e.dataId=0,e.type=2,e.title="创建常量",e.dialogVisible=!0}}},se=ne,oe=(a("41ff"),Object(b["a"])(se,V,z,!1,null,null,null)),ie=oe.exports,ce=a("c3b3"),le={name:"menus",emits:["onEvents","onVariable"],components:{Formula:j,Variable:ie,sourceData:k,sourceAi:W,sourceEs:N,ChatBox:ce["default"]},directives:{elDragDialog:E["a"]},props:{comArr:{type:Array,default:[]}},data:function(){var e=this;return{showFormula:!1,showVariable:!1,showSourceData:!1,showSourceAi:!1,showSourceEs:!1,type:null,insertTitle:"插入变量",menus:[{name:"插入",subMenus:[{key:"article",name:"图文",icon:"图文",disabled:function(){return"module"===e.type}},{key:"formual",name:"公式",icon:"公式"},{key:"variable",name:"变量",icon:"变量"},{key:"constant",name:"常量",icon:"常量"},{key:"attr",name:"属性",icon:"属性"},{key:"Directory",name:"目录",icon:"目录"},{key:"InsertNull",name:"插入空值",icon:"插入空值"},{key:"ai",name:"AI模块",icon:"AI模块"}]}]}},computed:{filteredMenus:function(){return this.menus.map((function(e){return Object(n["a"])(Object(n["a"])({},e),{},{subMenus:e.subMenus.filter((function(e){return"ai"===e.key}))})})).filter((function(e){return e.subMenus.length>0})),this.menus}},mounted:function(){this.type=this.$route.query.type},methods:{btnbianl:function(e){this.$emit("onVariable",e)},onPickedAi:function(e){var t={type:"insert",key:"ai",content:e};this.$emit("onEvents",t),this.showSourceAi=!1},onPickedTab:function(e){var t={type:"insert",key:"sourceData",content:e};this.$emit("onEvents",t),this.showSourceData=!1},onPickedFormula:function(e){var t={type:"insert",key:"formual",content:e};this.$emit("onEvents",t),console.log(t),this.showFormula=!1},onPickedVariable:function(e){var t={type:"insert",key:2==e.type?"constant":"variable",content:e};this.$emit("onEvents",t),this.showVariable=!1},onClickMenus:function(e){"document"===this.type&&"ai"!==e.key||"article"===e.key&&"module"===this.type||("formual"==e.key?this.showFormula=!0:"SourceData"==e.key?this.showSourceData=!0:"variable"==e.key||"constant"==e.key?("variable"==e.key?(this.type=1,this.insertTitle="插入变量"):(this.type=2,this.insertTitle="插入常量"),this.showVariable=!0):"ai"==e.key?this.showSourceAi=!0:"aiEs"==e.key?this.showSourceEs=!0:this.$emit("onEvents",e))}}},ue=le,de=(a("cbc8"),Object(b["a"])(ue,r,_,!1,null,null,null));t["a"]=de.exports},1995:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return null!=e.coms&&e.coms.length>0&&e.size>0?a("div",{staticClass:"com-directory"},[a("el-form",{staticClass:"dirceForm"},[e._l(e.coms,(function(t,r){return[e._l(t.attrs,(function(t,_){return["Directory"==t.type?a("el-form-item",{key:"item-"+r+"-"+_,attrs:{label:t.id}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}})],1):e._e()]}))]}))],2),a("div",{staticClass:"com-title"},[e._v("目录信息")]),a("div",{staticClass:"com-items"},[e._l(e.coms,(function(t,r){return[e._l(t.attrs,(function(t,_){return["Directory"==t.type?a("div",{key:"item-"+r+"-"+_,staticClass:"com-item"},[a("div",{staticClass:"icon"},[a("svg-icon",{attrs:{"icon-class":"directory"}})],1),a("div",{staticClass:"name"},[e._v(" "+e._s(""!=t.content?t.content:t.name)+" ")])]):e._e()]}))]}))],2)],1):e._e()},_=[],n={props:{coms:{type:Array,default:null}},watch:{coms:{handler:function(e){if(console.log(e),null!=e){this.size=0;for(var t=0;t0&&"module"!==e.type&&"document"==e.type?a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.renew}},[e._v("更新文档")]):e._e(),"admin"!=e.$store.state.user.name||"module"===e.type||"document"===e.type||e.articleId?e._e():a("el-button",{attrs:{type:"primary"},on:{click:e.onSaveUpload}},[e._v("保存")]),"admin"==e.$store.state.user.name&&"module"!==e.type&&"document"!==e.type&&e.articleId?a("el-button",{attrs:{type:"primary"},on:{click:e.onUpload}},[e._v("更新")]):e._e(),"module"!==e.type&&"document"==e.type?a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onOpenView}},[e._v("预览导出 ")]):e._e(),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onClose}},[e._v(" 关闭文档 ")])],1)]),a("div",{staticClass:"editor-content"},[a("div",{staticClass:"neary-doc"},[a("div",{staticClass:"left-content"},[a("div",{staticClass:"new-article"},[0==e.showView&&"module"!==e.type?a("div",[a("el-collapse",{model:{value:e.activeNames,callback:function(t){e.activeNames=t},expression:"activeNames"}},["document"==e.type?a("el-collapse-item",{attrs:{title:"最新文档",name:"-1"}},e._l(e.articleList,(function(t,r){return a("div",{key:t.id,staticClass:"sub-menus",attrs:{draggable:"","data-index":r,"data-type":"article"}},[a("div",{on:{click:function(a){return e.onLoadArticle(t.id)}}},[e._v(e._s(t.title))])])})),0):e._e(),0==e.showView?a("el-collapse-item",{attrs:{title:"模版列表",name:"-2"}},e._l(e.templateList,(function(t,r){return a("div",{key:t.id,staticClass:"sub-menus",attrs:{draggable:"","data-index":r,"data-type":"article"}},[a("div",{on:{click:function(a){return e.onTemplateInfo(t.id)}}},[e._v(e._s(t.title))])])})),0):e._e()],1)],1):e._e(),1==e.showView?a("div",{staticClass:"scrollable-container"},[a("el-collapse",{staticClass:"borderless-collapse",attrs:{accordion:!0},on:{change:e.handleItemClick},model:{value:e.activeModel,callback:function(t){e.activeModel=t},expression:"activeModel"}},e._l(e.categoryList,(function(t,r){return a("el-collapse-item",{key:r,staticClass:"min-width-content",attrs:{title:t.name,name:t.id}},[t.children&&t.children.length?a("el-collapse",{directives:[{name:"show",rawName:"v-show",value:t.children,expression:"item.children"}],staticClass:"borderless-collapse",on:{change:e.handleItemVal},model:{value:t.activeChildren,callback:function(a){e.$set(t,"activeChildren",a)},expression:"item.activeChildren"}},e._l(t.children,(function(t,r){return a("el-collapse-item",{key:r,staticClass:"min-width-content",attrs:{title:t.name,name:t.id}},[t.children&&t.children.length?a("el-collapse",{directives:[{name:"show",rawName:"v-show",value:t.children,expression:"child.children"}],staticClass:"borderless-collapse",on:{change:e.handleChildItemVal},model:{value:t.activeChildren,callback:function(a){e.$set(t,"activeChildren",a)},expression:"child.activeChildren"}},e._l(t.children,(function(t,r){return a("el-collapse-item",{key:r,staticClass:"min-width-content",attrs:{title:t.name,name:t.id}},[t.children&&t.children.length?a("el-collapse",{directives:[{name:"show",rawName:"v-show",value:t.children,expression:"grandChild.children"}],staticClass:"borderless-collapse",on:{change:e.handleGrandChildItemVal},model:{value:t.activeChildren,callback:function(a){e.$set(t,"activeChildren",a)},expression:"grandChild.activeChildren"}},e._l(t.children,(function(t,r){return a("el-collapse-item",{key:r,staticClass:"min-width-content",attrs:{title:t.name,name:t.id}},[t.children&&t.children.length?a("el-collapse",{directives:[{name:"show",rawName:"v-show",value:t.children,expression:"greatGrandChild.children"}],staticClass:"borderless-collapse",on:{change:e.handlegreatGrandChildItemVal},model:{value:t.activeChildren,callback:function(a){e.$set(t,"activeChildren",a)},expression:"greatGrandChild.activeChildren"}},e._l(t.children,(function(t,r){return a("el-collapse-item",{key:r,staticClass:"min-width-content",attrs:{title:t.name,name:t.id}},[a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0},disabled:"module"===e.type},model:{value:t.dataList,callback:function(a){e.$set(t,"dataList",a)},expression:"fiveChild.dataList"}},[a("transition-group",e._l(t.dataList,(function(t,r){return a("div",{key:r,staticClass:"sub-menus min-width-content"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1):e._e(),a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0},disabled:"module"==e.type},model:{value:t.dataList,callback:function(a){e.$set(t,"dataList",a)},expression:"greatGrandChild.dataList"}},[a("transition-group",e._l(t.dataList,(function(t,r){return a("div",{key:r,staticClass:"sub-menus min-width-content"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1):e._e(),a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0},disabled:"module"==e.type},model:{value:t.dataList,callback:function(a){e.$set(t,"dataList",a)},expression:"grandChild.dataList"}},[a("transition-group",e._l(t.dataList,(function(t,r){return a("div",{key:r,staticClass:"sub-menus min-width-content"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1):e._e(),a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0},disabled:"module"==e.type},model:{value:t.dataList,callback:function(a){e.$set(t,"dataList",a)},expression:"child.dataList"}},[a("transition-group",e._l(t.dataList,(function(t,r){return a("div",{key:r,staticClass:"sub-menus min-width-content"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1):e._e(),a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0},disabled:"module"==e.type},model:{value:t.dataList,callback:function(a){e.$set(t,"dataList",a)},expression:"item.dataList"}},[a("transition-group",e._l(t.dataList,(function(t,r){return a("div",{key:r,staticClass:"sub-menus min-width-content"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1)],1):e._e()])]),a("div",{staticClass:"right-sidebarew"},["module"!==e.type?a("div",{staticClass:"sidebar-item",class:0==e.showView?"active-item":"",on:{click:e.viewDocument}},["document"==e.type?a("span",[e._v("查看文档")]):a("span",[e._v("查看模版")])]):e._e(),a("div",{staticClass:"sidebar-item",class:1==e.showView?"active-item":"",on:{click:e.viewModule}},[e._v(" 模块列表 ")])])]),a("div",{staticClass:"editor-main"},[a("div",{staticClass:"menus-box"},[a("menus",{attrs:{comArr:e.coms},on:{onEvents:e.onInsert,onVariable:e.uptadeVariable}})],1),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"tabHtml",staticClass:"editor-box",attrs:{"element-loading-text":"加载中...","element-loading-spinner":"el-icon-loading"}},[a("editor",{attrs:{coms:e.coms,comIndex:e.comIndex,isAdmin:e.isAdmin,templateCate:e.categoryList,insertCmd:e.insertCmd},on:{onSetActiveIndex:e.onSetActiveIndex,onInsert:e.onInsert,onLoadArticle:e.onLoadArticle,onRebuild:e.onRebuild,onDelete:e.onRemove,onSetComs:e.onSetComs}})],1)]),a("div",{staticClass:"editor-option"},[a("div",{staticClass:"editor-menu"},["module"!==e.type&&"document"!==e.type?a("div",{staticClass:"item",class:3==e.docuComIndex?"active-item":"",on:{click:function(t){return e.onSetActiveIndexs(3)}}},[a("span",{staticClass:"name"},[e._v("模版属性")])]):e._e(),"module"!==e.type?a("div",{staticClass:"item",class:9998==e.comIndex?"active-item":"",on:{click:function(t){return e.onSetActiveIndex(9998)}}},[a("span",{staticClass:"name"},[e._v("模块管理")])]):e._e(),a("div",{staticClass:"item",class:9997==e.catalogIndex?"active-item":"",on:{click:function(t){return e.onCatalogIndex(9997)}}},[a("span",{staticClass:"name"},[e._v("目录信息")])]),a("div",{staticClass:"item",class:1==e.AttributeIndex?"active-item":"",on:{click:function(t){return e.onAttributeIndex(1)}}},[a("span",{staticClass:"name"},[e._v("属性变量")])])]),3==e.docuComIndex&&"module"!==e.type&&"document"!==e.type?[a("docAttr",{attrs:{attrs:e.docAttr}})]:e._e(),9998==e.comIndex?[a("comList",{attrs:{coms:e.coms},on:{onRemove:e.onRemove,onSetActive:e.onSetActiveIndex,onRebuild:e.onRebuild}})]:e._e(),9997==e.catalogIndex?[a("Directory",{attrs:{coms:e.coms}})]:e._e(),1==e.AttributeIndex?[a("attributeVar",{attrs:{com:e.coms[e.comIndex]},on:{onRefresh:e.initCategoryList}})]:e._e()],2)]),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showViewForm,"close-on-click-modal":!1,"append-to-body":"",width:"850px","custom-class":"prod-verify",title:"文档预览"},on:{"update:visible":function(t){e.showViewForm=t}}},[a("ViewForm",{attrs:{coms:e.coms,docAttr:e.docAttr}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.showProductAttr,"append-to-body":"","close-on-click-modal":!1,width:"850px","custom-class":"prod-verify",title:"插入产品属性"},on:{"update:visible":function(t){e.showProductAttr=t}}},[a("ProductAttr",{attrs:{docAttr:e.docAttr},on:{onInsertProductAttr:e.onInsertProductAttr}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.docVisible,"append-to-body":"","close-on-click-modal":!1,width:"500px","custom-class":"prod-verify",title:"文档信息"},on:{"update:visible":function(t){e.docVisible=t}}},[a("el-form",{ref:"docRef",attrs:{model:e.docForm,rules:e.docRules,"label-position":"left","label-width":"100"}},[a("el-form-item",{attrs:{label:"文档名称:",prop:"title"}},[a("el-input",{staticClass:"input-item",staticStyle:{width:"60%"},attrs:{placeholder:"请填写文档名称",disabled:e.docAttr.id>0},model:{value:e.docForm.title,callback:function(t){e.$set(e.docForm,"title",t)},expression:"docForm.title"}})],1),a("el-form-item",{attrs:{label:"文档分类:",prop:"category_id"}},[a("el-select",{staticStyle:{width:"60%"},attrs:{placeholder:"请选择所属分类",disabled:e.docAttr.id>0},model:{value:e.docForm.category_id,callback:function(t){e.$set(e.docForm,"category_id",t)},expression:"docForm.category_id"}},e._l(e.articleCategoryList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"创建人:"}},[e._v(" "+e._s(e.userInfo&&e.userInfo.username)+" ")])],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.closeDoc}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.submitDoc}},[e._v("确 定")])],1)],1)],1)},_=[],n=a("e397"),s=n["a"],o=(a("3116"),a("2877")),i=Object(o["a"])(s,r,_,!1,null,null,null);t["default"]=i.exports},"33b9":function(e,t,a){},"35d5":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"editor"},[a("draggable",{style:e.draggableStyle,attrs:{group:"itxst",animation:"300",handle:".drag-handle",scroll:!0,scrollSensitivity:100,scrollSpeed:20},on:{add:e.onAdd,update:e.onDragEnd},model:{value:e.comList,callback:function(t){e.comList=t},expression:"comList"}},[a("transition-group",{staticStyle:{display:"block","min-height":"100vh"}},[e._l(e.comList,(function(t,r){return[a("div",{key:r,staticClass:"layers",class:e.comIndex==r?"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:8,xl:8}},[a("el-form-item",{attrs:{label:"模块分类:"}},[a("span",{staticStyle:{cursor:"pointer"},on:{click:function(a){return e.enableSelect(t)}}},[e._v(e._s(e.getCategory(t.category_id)))])])],1),a("el-col",{attrs:{xs:24,sm:24,md:12,lg:8,xl:8}},[a("el-form-item",{attrs:{label:"模块名称:"}},[a("span",{staticStyle:{cursor:"pointer"},on:{click:function(a){return e.enableName(t)}}},[e._v(e._s(t.name))])])],1),a("el-col",{attrs:{xs:24,sm:24,md:12,lg:8,xl:8}},[2==e.$store.state.user.id?a("el-form-item",[a("div",{staticClass:"btn-save"},["document"!==e.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 e.onSaveTemplate(t)}}})],1):e._e(),1!==t.isEdit?a("el-button",{attrs:{circle:"",size:"mini"},on:{click:function(t){return e.onEdit(r,1)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}})],1):a("el-button",{attrs:{circle:"",size:"mini",icon:"el-icon-view"},on:{click:function(t){return e.onEdit(r,2)}}}),e.templateId||"document"===e.type?e._e():a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"删除",placement:"top"}},[a("el-button",{attrs:{circle:"",size:"mini"},on:{click:function(t){return e.onRemove(r)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}})],1)],1)],1)]):e._e()],1)],1)],1)],1),a("div",{staticClass:"main",on:{click:function(t){return e.onSetActive(r)}}},[a(t.type,{tag:"component",attrs:{com:t,coms:e.comList,currentIndex:r,isAdmin:e.isAdmin,insertCmd:e.insertCmd,isEdit:t.isEdit},on:{onUpdate:e.onUpdate,onUpdateAttr:e.onUpdateAttr,onUpdata:e.onUpdata,onUpdateProdAttr:e.onUpdateProdAttr}})],1)])]})),e.comList.length<=0?[a("div",{key:-1,staticClass:"editor-empty"},[a("el-empty",{attrs:{description:"请拖放组件至当前页面"}})],1)]:e._e()],2)],1)],1)},_=[],n=a("5530"),s=a("c7eb"),o=a("1da1"),i=a("b85c"),c=(a("4de4"),a("caad"),a("d81d"),a("b0c0"),a("e9c4"),a("4ec9"),a("a9e3"),a("b64b"),a("d3b7"),a("2532"),a("3ca3"),a("159b"),a("ddb0"),a("b76a")),l=a.n(c),u=function(){var e=this,t=e.$createElement,a=e._self._c||t;return null!=e.com?a("div",{staticClass:"template-table"},[a("div",{staticClass:"table"},[a("hot-table",{ref:"hotTable",staticStyle:{width:"100%"},attrs:{settings:e.settings,licenseKey:"non-commercial-and-evaluation"}})],1)]):e._e()},d=[],m=a("ade3"),p=(a("ac1f"),a("5319"),a("e437"),a("c24d")),b=a("8c7e"),f=a("cc6f");a("8033"),a("c1cf"),f["a"].buildEmpty({licenseKey:"internal-use-in-handsontable",precisionRounding:10,nullDate:{year:1900,month:1,day:1}});var h,E={name:"table",components:{HotTable:p["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(e){if(null!=e&&void 0!=e){var t=this;console.log("watch com",e),t.initSetting()}},immediate:!0,deep:!0},isActive:{handler:function(e){void 0==e&&null!=e||(this.settings.readOnly=!e,this.settings.colHeaders=e,this.settings.rowHeaders=e)},immediate:!0,deep:!0},insertCmd:{handler:function(e){null!=e&&this.isActive&&console.log("insertCmd table val",e)},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(e){var t=this.$refs.hotTable.hotInstance.getPlugin("exportFile"),a=t.exportAsString("csv",{filename:"MyFile"});console.log("str",a)},initSetting:function(){var e,t=this,a=this;a.settings=(e={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(e,t,r){if(console.log("callback",e,t,r),void 0==a.cellStyle&&(a.cellStyle=[]),"importExcel"!=e)if("clearColor"!=e){if(e.length>=8){if("bgColor"==e.substr(0,7)){var _=e.replace("bgColor:",""),n="whiteBg";switch(_){case"red":n="redBg";break;case"gray":n="grayBg";break}for(l=t[0].start.col;l<=t[0].end.col;l++)for(u=t[0].start.row;u<=t[0].end.row;u++){var s=a.cellStyle.filter((function(e){return e.col==l&&e.row==u}));s.length>0?s[0].className.indexOf(n)<0&&(s[0].className+=" "+n):a.cellStyle.push({col:l,row:u,className:n})}return}if("fontColor"==e.substr(0,9)){var o=e.replace("fontColor:",""),i="blackFont";switch(o){case"white":i="whiteFont";break;case"black":i="blackFont";break}void 0==a.cellStyle&&(a.cellStyle=[]);for(l=t[0].start.col;l<=t[0].end.col;l++)for(u=t[0].start.row;u<=t[0].end.row;u++){var c=a.cellStyle.filter((function(e){return e.col==l&&e.row==u}));c.length>0?c[0].className.indexOf(i)<0&&(c[0].className+=" "+i):a.cellStyle.push({col:l,row:u,className:i})}return}}}else{for(var l=t[0].start.col;l<=t[0].end.col;l++)for(var u=t[0].start.row;u<=t[0].end.row;u++)a.cellStyle=a.cellStyle.filter((function(e){return e.col!=l&&e.row!=u}));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(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(Object(m["a"])(e,"height","auto"),"colWidths","auto"),"allowHtml",!0),"filters",!0),"manualRowResize",!0),"manualColumnResize",!0),"manualRowMove",!0),"manualColumnMove",!0),"formulas",{engine:f["a"]}),"tableClassName","tb-class"),Object(m["a"])(e,"afterOnCellMouseDown",(function(e,a,r){t.currentFocus=a}))),Object(b["a"])()}}},v=E,O=(a("924b"),a("2877")),g=Object(O["a"])(v,u,d,!1,null,null,null),j=g.exports,y=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"template-textarea"},[1==e.isEdit?[a("div",{staticClass:"editor-area sticky-editor"},[a("ckeditor",{ref:"editor",attrs:{config:e.editorConfig,editorUrl:e.editorUrl},on:{focus:e.onFocus,blur:e.onBlur,input:e.onInputText,ready:e.onEditorReady},model:{value:e.com.content,callback:function(t){e.$set(e.com,"content",t)},expression:"com.content"}})],1)]:[a("div",{staticClass:"rich-editor",domProps:{innerHTML:e._s(e.content)}})],e.loading?a("div",{staticClass:"overlay"},[a("el-progress",{staticClass:"full-width-progress",attrs:{percentage:e.progress}})],1):e._e()],2)},D=[],C=a("4478"),x=a("2909"),P=(a("99af"),a("b680"),a("07ac"),a("4d63"),a("2c3e"),a("25f0"),a("466d"),a("1c4c")),k=(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(e){var t=this;null==t.com&&t.replaceData(t.com.content).then((function(e){t.content=e,t.$nextTick((function(){t.bindEvents()}))}))},immediate:!0,deep:!0},com:{handler:function(e){var t=this;return Object(o["a"])(Object(s["a"])().mark((function a(){var r,_;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=t,null!=e){a.next=3;break}return a.abrupt("return");case 3:if(void 0!=e.content&&null!=e.content){a.next=5;break}return a.abrupt("return");case 5:return a.prev=5,a.next=8,r.replaceData(e.content);case 8:_=a.sent,r.content=_,r.$nextTick((function(){r.bindEvents(),r.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(e){if(null!=e&&1==this.isEdit){var t=this.$refs.editor.instance.getSelection().getSelectedText();e.content.indexOf("Directory",0)>=0&&(this.$emit("onUpdateAttr",this.currentIndex,this.com.attrs.length-1,t),this.$refs.editor.instance.execCommand("delete")),this.$refs.editor.instance.insertHtml(e.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 e=this;this.$nextTick((function(){e.initializeInputWidths()}))},beforeDestroy:function(){this.$el.removeEventListener("input",this.handleInputChange),this.$el.removeEventListener("input",this.handleVariableNullInput),this.$el.removeEventListener("blur",this.handleVariableNullBlur,!0)},methods:(h={replaceData:function(e){var t=this;return Object(o["a"])(Object(s["a"])().mark((function a(){var r,_,n,o,c;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,IF:function(e,t,a){return e?t:a}},n=Object(s["a"])().mark((function a(){var n,l,u,d,m,p,b,f,h,E,v,O,g,j,y,D,P,k,M,I,w,A,L,R;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=r.com.attrs[c].id,"variable"!=r.com.attrs[c].type){a.next=6;break}if(l=r.com.attrs[c],2==l.data.value_type){for(u=l.data.value_item.split(","),d='",e=e.replace("{{"+l.id+"}}",d)}else e=e.replace("{{"+n+"}}",'');a.next=43;break;case 6:if("variableNull"!=r.com.attrs[c].type){a.next=12;break}m=r.com.attrs[c],t.variableNullInputs[n]=m.content,e=e.replace("{{"+n+"}}",''),a.next=43;break;case 12:if("ProductAttr"!=r.com.attrs[c].type){a.next=19;break}if(p=r.com.attrs[c],b=p.id+"_"+c,""==p.content&&(p.content=p.attrs.value),1==p.attrs.type)e=e.replace("{{"+p.id+"}}",'');else{for(f=p.attrs.valueItems.split(","),h='",e=e.replace("{{"+p.id+"}}",h)}a.next=43;break;case 19:if("formual"!=r.com.attrs[c].type){a.next=35;break}return a.next=22,r.analysisFormual(r.com.attrs[c]);case 22:return E=a.sent,v=r.com.attrs[c].data.point,a.next=26,r.getRemote(E);case 26:if(E=a.sent,O={},g=/\b[a-zA-Z_][a-zA-Z0-9_]*\b/g,j=E.match(g),j){y=Object(i["a"])(j);try{for(y.s();!(D=y.n()).done;)P=D.value,"IF"===P||Object.keys(_).includes(P)||(O[P]="".concat(P))}catch(s){y.e(s)}finally{y.f()}}k=function(e,t){var a=Object(C["a"])(Function,Object(x["a"])(Object.keys(_)).concat(Object(x["a"])(Object.keys(t)),["return ".concat(e)]));return a.apply(void 0,Object(x["a"])(Object.values(_)).concat(Object(x["a"])(Object.values(t))))};try{M=k(E,O),I="number"!==typeof M||isNaN(M)?"boolean"===typeof M?M?"1":"0":String(M):M.toFixed(v),r.com.attrs[c].content=I,e=e.replace("{{"+r.com.attrs[c].id+"}}",I)}catch(T){console.error("处理公式时出错:",T),console.error("错误的公式:",E),r.com.attrs[c].content="计算错误",e=e.replace("{{"+r.com.attrs[c].id+"}}","计算错误")}a.next=43;break;case 35:if("sourceData"!=r.com.attrs[c].type){a.next=42;break}return a.next=38,r.getRemote1(r.com.attrs[c].formula);case 38:w=a.sent,e=e.replace("{{"+n+"}}",w),a.next=43;break;case 42:"Directory"==r.com.attrs[c].type?(A=r.com.attrs[c].content,L=r.com.attrs[c].id,R=new RegExp("{{\\s*".concat(L,"\\s*}}"),"g"),e=e.replace(R,(function(e,t,a){var r=a.substring(0,t),_=a.substring(t+e.length);r.match(/<([^>]+)>$/),_.match(/^<\/([^>]+)>/);return"

".concat(A,"

")}))):e=e.replace("{{"+n+"}}",r.com.attrs[c].content);case 43:case"end":return a.stop()}}),a)})),c=0;case 4:if(!(c3&&void 0!==arguments[3]&&arguments[3];this.com&&this.com.attrs&&this.com.attrs[e]&&this.com.attrs[e].id===t&&(this.$set(this.com.attrs[e],"content",a),this.$nextTick((function(){var e=r.$el.querySelector("#".concat(t));e&&(e.value=a)})),_&&this.$emit("onUpdata",this.currentIndex,e,t,a))},addInputListeners:function(){this.$el.addEventListener("blur",this.handleInputChange,!0),this.$el.addEventListener("input",this.adjustInputWidth,!0)},initializeInputWidths:function(){var e=this,t=this.$el.querySelectorAll(".text-input-box");t.forEach((function(t){return e.adjustInputWidth({target:t})}))},adjustInputWidth:function(e){if(e.target.classList.contains("text-input-box")){var t=e.target,a=document.createElement("span");a.className="size-calculator",a.textContent=t.value||t.placeholder||"0",document.body.appendChild(a);var r=window.getComputedStyle(t);a.style.font=r.font,a.style.fontSize=r.fontSize,a.style.fontWeight=r.fontWeight,a.style.letterSpacing=r.letterSpacing;var _=a.offsetWidth;t.style.width="".concat(_+10,"px"),document.body.removeChild(a)}},handleInputChange:function(e){var t=this;if(e.target.classList.contains("text-input-box")){e.target.id;var a=e.target.name,r=parseInt(e.target.dataset.index,10),_=e.target.value;this.com&&this.com.attrs&&this.com.attrs[r]?(this.$set(this.com.attrs[r],"content",_),this.com.attrs.forEach((function(e){e.name===a&&t.$set(e,"content",_)})),this.$emit("onUpdateAttr",this.currentIndex,r,_)):console.warn("Unable to find attribute at index ".concat(r))}},bindEvents:function(){for(var e=this,t=0;t1?t-1:0),n=1;n1?t-1:0),n=1;n0)){r.next=6;break}if(o=n[0].attrs.filter((function(e){return e.name==t})),!(o.length>0)){r.next=6;break}return r.abrupt("return",o[0].content);case 6:return r.abrupt("return","");case 7:case"end":return r.stop()}}),r)})))()})),"handleChangeProduct",(function(e){var t=e.target.dataset.index;this.$emit("onUpdateProdAttr",this.currentIndex,t,e.target.value)})),"handleInputProduct",(function(e){var t=e.target.dataset.index;this.$emit("onUpdateProdAttr",this.currentIndex,t,e.target.value)})),Object(m["a"])(Object(m["a"])(Object(m["a"])(h,"handleInput",(function(e){var t=e.target.dataset.index;this.$emit("onUpdateAttr",this.currentIndex,t,e.target.value)})),"onEditorReady",(function(e){})),"onInputText",(function(e){this.$emit("onUpdate",this.currentIndex,e)})))}),M=k,I=(a("4c17"),Object(O["a"])(M,y,D,!1,null,null,null)),w=I.exports,A=a("37de"),L=a("c621"),R={name:"editor",emits:["onSetActiveIndex","onDelete","onInsert","onLoadArticle","onRebuild","onSetComs"],components:{Table:j,TextArea:w,draggable:l.a,Empty:A["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(e){null!=e&&(this.comList=JSON.parse(JSON.stringify(e)),console.log("comList",this.comList))},immediate:!0,deep:!0},comIndex:{handler:function(e){e<=0||(this.comList=this.comList.map((function(e){return e.isEdit=2,e.selDisabled=!0,e.valDisabled=!0,"string"===typeof e.category_id&&e.category_id.includes(" ")?e.category_id=e.category_id.split(" "):Array.isArray(e.category_id)||(e.category_id=[e.category_id].filter(Boolean)),e})))},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(){this.initCategoryList(),this.type=this.$route.query.type,this.templateId=this.$route.query.templateId},methods:{showCategoryName:function(e){return"module"==this.type&&2==this.$store.state.user.id&&!e.valDisabled},enableName:function(e){e.valDisabled=!1,this.$forceUpdate()},showCategorySelect:function(e){return"module"===this.type&&2===this.$store.state.user.id&&!e.selDisabled},enableSelect:function(e){e.selDisabled=!0,console.log(e),this.$forceUpdate()},getCategory:function(e){var t=function e(t,a){var r,_=Object(i["a"])(t);try{for(_.s();!(r=_.n()).done;){var n=r.value;if(n.id===a)return n.name;if(n.children){var s=e(n.children,a);if(s)return s}}}catch(o){_.e(o)}finally{_.f()}return null};return t(this.categoryList,e)||"请选择分类"},onSaveAs:function(e){this.saveAs=!0,this.onSaveTemplate(e)},onSaveTemplate:function(e){var t=this,a=this,r=JSON.parse(JSON.stringify(e));console.log(r),r.category&&delete r.category,r.attrs=JSON.stringify(r.attrs),r.code=r.name,r.status=5,Array.isArray(e.category_id)?r.category_id=e.category_id[e.category_id.length-1]:r.category_id=e.category_id,void 0==r.id||this.saveAs?Object(L["a"])(r).then((function(_){200==_.status&&(r.id=_.data,e.id=_.data,a.$alert("模板信息保存成功"),a.$emit("onRefresh"),t.saveAs=!1,r.selDisabled=!1,r.valDisabled=!1,t.$forceUpdate())})):Object(L["g"])(r).then((function(e){200==e.status&&(a.$alert("模板信息更新成功"),a.$emit("onRefresh"),r.selDisabled=!1,r.valDisabled=!1,t.$forceUpdate())}))},initCategoryList:function(){var e=this;return Object(o["a"])(Object(s["a"])().mark((function t(){var a;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e,t.next=3,Object(L["f"])();case 3:a=t.sent,console.log(a),e.categoryList=a.data;case 6:case"end":return t.stop()}}),t)})))()},processDataForCascader:function(e){console.log("Raw data:",e);var t=new Map,a=[];return e.forEach((function(e){var a=Object(n["a"])(Object(n["a"])({},e),{},{children:[]});t.set(e.id,a)})),e.forEach((function(e){if("0"===e.parent_id||0===e.parent_id)a.push(t.get(e.id));else{var r=t.get(parseInt(e.parent_id));r?r.children.push(t.get(e.id)):(console.warn("Parent with id ".concat(e.parent_id," not found for item:"),e),a.push(t.get(e.id)))}})),console.log("Processed data:",a),a},onChangeCategory:function(e,t){var a=t[t.length-1];e.category_id=a},onUpdateProdAttr:function(e,t,a){this.comList[e].attrs[t].content=a;for(var r=this.comList[e].attrs[t].attrs.name,_=this.comList[e].attrs[t].attrs.type,n=0;n0?a("div",{staticClass:"com-list"},[a("div",{staticClass:"com-list-title"},[e._v("模块管理")]),a("div",{staticClass:"com-items"},[a("draggable",{staticStyle:{width:"100%"},attrs:{options:{animation:200}},on:{update:e.datadragEnd},model:{value:e.coms,callback:function(t){e.coms=t},expression:"coms"}},[e._l(e.coms,(function(t,r){return[a("div",{key:r,staticClass:"com-item",attrs:{draggable:""}},[a("div",{staticClass:"icon"},[a("svg-icon",{attrs:{"icon-class":"dashBoard1"}})],1),a("div",{staticClass:"name",on:{click:function(t){return e.onSetActive(r)}}},[e._v(e._s(t.name))]),"document"!==e.type?a("div",{staticClass:"remove",on:{click:function(t){return e.onRemove(r)}}},[a("svg-icon",{staticStyle:{cursor:"pointer"},attrs:{"icon-class":"delete"}})],1):e._e()])]}))],2)],1)]):e._e()},_=[],n=a("c7eb"),s=a("1da1"),o=a("b76a"),i=a.n(o),c={name:"comList",emits:["onRemove","onRebuild","onSetActive"],components:{draggable:i.a},props:{coms:{type:Array,default:[]}},data:function(){return{type:""}},mounted:function(){this.type=this.$route.query.type},methods:{datadragEnd:function(e){var t=this;return Object(s["a"])(Object(n["a"])().mark((function a(){var r;return Object(n["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.preventDefault(),r=t.coms,t.$emit("onRebuild",r);case 3:case"end":return a.stop()}}),a)})))()},onSetActive:function(e){this.$emit("onSetActive",e)},onRemove:function(e){this.$emit("onRemove",e)}}},l=c,u=(a("2ebb"),a("2877")),d=Object(u["a"])(l,r,_,!1,null,null,null);t["a"]=d.exports},"7cfb":function(e,t,a){},"7e4c":function(e,t,a){"use strict";a("33b9")},8:function(e,t){},8475:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"template-textarea"},[a("div",{staticClass:"rich-editor",domProps:{innerHTML:e._s(e.processedContent)}})])},_=[],n=a("a2d4"),s=n["a"],o=(a("dad3"),a("2877")),i=Object(o["a"])(s,r,_,!1,null,null,null);t["a"]=i.exports},9:function(e,t){},9097:function(e,t,a){"use strict";a("281e")},"924b":function(e,t,a){"use strict";a("42e7")},9828:function(e,t,a){},a2d4:function(module,__webpack_exports__,__webpack_require__){"use strict";var C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("c7eb"),C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("1da1"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("7db0"),core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("4d63"),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("2c3e"),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("25f0"),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("466d"),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__),ckeditor4_vue__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("25ae"),ckeditor4_vue__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(ckeditor4_vue__WEBPACK_IMPORTED_MODULE_16__),_api_sourceData__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("1c4c");__webpack_exports__["a"]={name:"app",emits:["onUpdateData"],compnents:{},props:{coms:{type:Array,default:function(){return[]}},currentIndex:{type:Number,default:0},com:{type:Object,default:null}},watch:{com:{handler:function(e){e&&e.content&&this.updateProcessedContent()},immediate:!0,deep:!0}},data:function(){return{content:"",processedContent:""}},methods:{updateProcessedContent:function(){var e=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function t(){return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.replaceData(e.com.content);case 2:e.processedContent=t.sent;case 3:case"end":return t.stop()}}),t)})))()},replaceData:function replaceData(data){var _this3=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function _callee2(){var _this,_loop,l,i;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_this=_this3,_loop=Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function _loop(){var attrId,item,dataItem,selectHtml,_item,_item2,prodAttrId,_dataItem,_selectHtml,formual,result,directoryContent,_attrId,directoryRegex;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function _loop$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(attrId=_this.com.attrs[i].id,"variable"!=_this.com.attrs[i].type){_context2.next=6;break}if(item=_this.com.attrs[i],2==item.data.value_type){for(dataItem=item.data.value_item.split(","),selectHtml='",data=data.replace("{{"+item.id+"}}",selectHtml)}else data=data.replace("{{"+attrId+"}}",'');_context2.next=37;break;case 6:if("variableNull"!=_this.com.attrs[i].type){_context2.next=11;break}_item=_this.com.attrs[i],data=data.replace("{{"+attrId+"}}",''),_context2.next=37;break;case 11:if("ProductAttr"!=_this.com.attrs[i].type){_context2.next=18;break}if(_item2=_this.com.attrs[i],prodAttrId=_item2.id+"_"+i,""==_item2.content&&(_item2.content=_item2.attrs.value),1==_item2.attrs.type)data=data.replace("{{"+_item2.id+"}}",'');else{for(_dataItem=_item2.attrs.valueItems.split(","),_selectHtml='",data=data.replace("{{"+_item2.id+"}}",_selectHtml)}_context2.next=37;break;case 18:if("formual"!=_this.com.attrs[i].type){_context2.next=29;break}return _context2.next=21,_this.analysisFormual(_this.com.attrs[i]);case 21:return formual=_context2.sent,_context2.next=24,_this.getRemote(formual);case 24:formual=_context2.sent,_this.com.attrs[i].content=eval(formual),data=data.replace("{{"+attrId+"}}",eval(formual)),_context2.next=37;break;case 29:if("sourceData"!=_this.com.attrs[i].type){_context2.next=36;break}return _context2.next=32,_this.getRemote1(_this.com.attrs[i].formula);case 32:result=_context2.sent,data=data.replace("{{"+attrId+"}}",result),_context2.next=37;break;case 36:"Directory"==_this.com.attrs[i].type?(directoryContent=_this.com.attrs[i].content,_attrId=_this.com.attrs[i].id,directoryRegex=new RegExp("{{\\s*".concat(_attrId,"\\s*}}"),"g"),data=data.replace(directoryRegex,(function(e,t,a){var r=a.substring(0,t),_=a.substring(t+e.length),n=r.match(/<([^>]+)>$/),s=_.match(/^<\/([^>]+)>/);return n&&s&&n[1]===s[1]?"

".concat(directoryContent,"

"):directoryContent}))):data=data.replace("{{"+attrId+"}}",_this.com.attrs[i].content);case 37:case"end":return _context2.stop()}}),_loop)})),i=0;case 3:if(!(i<_this.com.attrs.length)){_context3.next=8;break}return _context3.delegateYield(_loop(),"t0",5);case 5:i++,_context3.next=3;break;case 8:return _this3.$nextTick((function(){_this3.addInputListeners(),_this3.autoWidths()})),_context3.abrupt("return",data);case 10:case"end":return _context3.stop()}}),_callee2)})))()},addInputListeners:function(){this.$el.addEventListener("input",this.adjustAutoWidth,!0)},autoWidths:function(){var e=this,t=this.$el.querySelectorAll(".text-input-boxs");t.forEach((function(t){return e.adjustAutoWidth({target:t})}))},adjustAutoWidth:function(e){if(e.target.classList.contains("text-input-boxs")){var t=e.target,a=document.createElement("span");a.className="size-calculator",a.textContent=t.value||t.placeholder||"0",document.body.appendChild(a);var r=window.getComputedStyle(t);a.style.font=r.font,a.style.fontSize=r.fontSize,a.style.fontWeight=r.fontWeight,a.style.letterSpacing=r.letterSpacing;var _=a.offsetWidth;t.style.width="".concat(_+10,"px"),document.body.removeChild(a)}},analysisFormual:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/(\[.*?\]){3}/,n=e.formula,s=new RegExp(_);case 4:if(o=n.match(s),null!=o){a.next=8;break}return a.abrupt("break",22);case 8:return i=o[0],a.prev=9,a.next=12,r.getFormualData(i);case 12:c=a.sent,null===c||void 0===c||isNaN(c)?(console.warn("获取到的数据无效: ".concat(i)),n=n.replace(i,"(0)")):n=n.replace(i,"(".concat(parseFloat(c),")")),a.next=20;break;case 16:a.prev=16,a.t0=a["catch"](9),console.error("处理 ".concat(i," 时出错:"),a.t0),n=n.replace(i,"(0)");case 20:a.next=4;break;case 22:return a.abrupt("return",n);case 23:case"end":return a.stop()}}),a,null,[[9,16]])})))()},getFormualData:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_),s=e.match(n),o=0,!s||"T"!=s[1]){a.next=11;break}return a.next=8,r.getModuleData(s[2],s[3]);case 8:o=a.sent,a.next=12;break;case 11:console.warn("无法解析公式项:",e);case 12:return a.abrupt("return",o);case 13:case"end":return a.stop()}}),a)})))()},updateContent:function(e,t){var a=this.com.attrs.find((function(t){return t.id===e}));a&&(a.content=t.target.value)},analysisformula:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/(\[.*?\]){3}/,n=e.formula,s=new RegExp(_);case 4:if(o=n.match(s),null!=o){a.next=8;break}return a.abrupt("break",18);case 8:return i=o[0],a.next=11,r.getformulaData(i);case 11:return c=a.sent,a.next=14,r.getRemote(c);case 14:c=a.sent,n=n.replace(i,"("+parseFloat(c)+")"),a.next=4;break;case 18:return a.abrupt("return",n);case 19:case"end":return a.stop()}}),a)})))()},getformulaData:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_),s=e.match(n),o=0,"T"!=s[1]){a.next=9;break}return a.next=8,r.getModuleData(s[2],s[3]);case 8:o=a.sent;case 9:return a.abrupt("return",o);case 10:case"end":return a.stop()}}),a)})))()},getRemote:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_);case 3:if(s=e.match(n),null!=s){a.next=7;break}return a.abrupt("break",17);case 7:if("R"!=s[1]){a.next=15;break}return o=s[4],o=s[4].split(","),a.next=12,r.getRemoteData(s[2],s[3],o[0],o[1]);case 12:i=a.sent,c=s[0],e=e.replace(c,"("+parseFloat(i)+")");case 15:a.next=3;break;case 17:return a.abrupt("return",e);case 18:case"end":return a.stop()}}),a)})))()},getRemote1:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_);case 3:if(s=e.match(n),null!=s){a.next=7;break}return a.abrupt("break",17);case 7:if("R"!=s[1]){a.next=15;break}return o=s[4],o=s[4].split(","),a.next=12,r.getRemoteData(s[2],s[3],o[0],o[1]);case 12:i=a.sent,c=s[0],e=e.replace(c,parseFloat(i));case 15:a.next=3;break;case 17:return a.abrupt("return",e);case 18:case"end":return a.stop()}}),a)})))()},getRemoteData:function(e,t,a,r){var _=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function n(){var s,o,i;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return _,0,s={code:e,sheetName:t,row:a,col:r},n.next=6,Object(_api_sourceData__WEBPACK_IMPORTED_MODULE_17__["a"])(s);case 6:if(o=n.sent,200!=o.status){n.next=12;break}if(console.log("result:",o.data),i=parseFloat(o.data.result),isNaN(i)){n.next=12;break}return n.abrupt("return",i);case 12:return n.abrupt("return",0);case 13:case"end":return n.stop()}}),n)})))()},getModuleData:function(e,t){var a=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function r(){var _,n,s;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(_=a,n=_.coms.filter((function(t){return t.name==e})),!(n.length>0)){r.next=6;break}if(s=n[0].attrs.filter((function(e){return e.name==t})),!(s.length>0)){r.next=6;break}return r.abrupt("return",parseFloat(s[0].content));case 6:return r.abrupt("return",0);case 7:case"end":return r.stop()}}),r)})))()}}}},a888:function(e,t,a){"use strict";a("99af"),a("caad"),a("ac1f"),a("2532"),a("5319");var r={bind:function(e,t,a){var r=e.querySelector(".el-dialog__header"),_=e.querySelector(".el-dialog");r.style.cssText+=";cursor:move;",_.style.cssText+=";top:0px;";var n=function(){return window.document.currentStyle?function(e,t){return e.currentStyle[t]}:function(e,t){return getComputedStyle(e,!1)[t]}}();r.onmousedown=function(e){var t=e.clientX-r.offsetLeft,s=e.clientY-r.offsetTop,o=_.offsetWidth,i=_.offsetHeight,c=document.body.clientWidth,l=document.body.clientHeight,u=_.offsetLeft,d=c-_.offsetLeft-o,m=_.offsetTop,p=l-_.offsetTop-i,b=n(_,"left"),f=n(_,"top");b.includes("%")?(b=+document.body.clientWidth*(+b.replace(/\%/g,"")/100),f=+document.body.clientHeight*(+f.replace(/\%/g,"")/100)):(b=+b.replace(/\px/g,""),f=+f.replace(/\px/g,"")),document.onmousemove=function(e){var r=e.clientX-t,n=e.clientY-s;-r>u?r=-u:r>d&&(r=d),-n>m?n=-m:n>p&&(n=p),_.style.cssText+=";left:".concat(r+b,"px;top:").concat(n+f,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null}}}},_=function(e){e.directive("el-drag-dialog",r)};window.Vue&&(window["el-drag-dialog"]=r,Vue.use(_)),r.install=_;t["a"]=r},a990:function(e,t,a){"use strict";a("05384")},b390:function(e,t,a){"use strict";a("bdbd")},b82f:function(e,t,a){"use strict";a("09c7")},b93f:function(e,t,a){"use strict";a("548d")},bdbd:function(e,t,a){},be00:function(e,t,a){"use strict";a("c7ed")},c412:function(e,t,a){},c4c8:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var r=a("b775");function _(e){return Object(r["a"])({url:"/product/search",method:"post",data:e})}},c621:function(e,t,a){"use strict";a.d(t,"e",(function(){return _})),a.d(t,"d",(function(){return n})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return o})),a.d(t,"g",(function(){return i})),a.d(t,"b",(function(){return c})),a.d(t,"f",(function(){return l}));var r=a("b775");function _(e){return Object(r["a"])({url:"/template/category/search",method:"post",data:e})}function n(e){return Object(r["a"])({url:"/template/search",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/template/info",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/template/create",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/template/update",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/template/category/allList",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/template/category/treeCategory",method:"post",data:e})}},c74a:function(e,t,a){},c7ed:function(e,t,a){},c7ff:function(e,t,a){"use strict";a("4030")},c9e6:function(e,t){},cbc8:function(e,t,a){"use strict";a("e3b1")},d4a5:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return null!=e.com?a("div",{staticClass:"editor-attribute"},[a("el-form",[a("el-form-item",{attrs:{label:"模块分类:"}},[a("el-cascader",{attrs:{options:e.categoryList,clearable:"",props:e.props,"show-all-levels":!1,placeholder:"请选择模块分类"},on:{change:e.onChangeCategory},model:{value:e.com.category_id,callback:function(t){e.$set(e.com,"category_id",t)},expression:"com.category_id"}})],1),a("el-form-item",{attrs:{label:"模块名称:"}},[a("el-input",{staticClass:"input-item",attrs:{placeholder:"请填写模块名称"},model:{value:e.com.name,callback:function(t){e.$set(e.com,"name",t)},expression:"com.name"}})],1),a("el-form-item",{attrs:{label:"模块描述:"}},[a("el-input",{staticClass:"input-item",attrs:{type:"textarea",placeholder:"请填写模块介绍"},model:{value:e.com.intro,callback:function(t){e.$set(e.com,"intro",t)},expression:"com.intro"}})],1),a("el-form-item",[a("div",{staticClass:"btn-save"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.onSaveTemplate(e.com)}}},[e._v("保存模块")]),e.com.id>0?a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.onSaveAs(e.com)}}},[e._v("另存为")]):e._e()],1)])],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.dialogVisible,"append-to-body":"",width:"300","custom-class":"prod-verify",title:"编辑表头"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("headerSetting",{attrs:{headerItemName:e.headerItemName},on:{onSetHeader:e.onSetHeader}})],1)],1):e._e()},_=[],n=a("2909"),s=a("c7eb"),o=a("1da1"),i=a("5530"),c=(a("d81d"),a("a434"),a("b0c0"),a("e9c4"),a("4ec9"),a("b64b"),a("d3b7"),a("4d63"),a("ac1f"),a("2c3e"),a("25f0"),a("3ca3"),a("466d"),a("159b"),a("ddb0"),a("1b35")),l=a("a888"),u=a("c621"),d=(a("1c4c"),a("424e"),{name:"attributes",components:{headerSetting:c["a"]},directives:{elDragDialog:l["a"]},emits:["onRefresh"],props:{com:{type:Object,default:function(){return null}}},watch:{},data:function(){return{dialogVisible:!1,activeNames:"0",categoryList:[],articleCategoryList:[],activeHeaderIndex:-1,headerItemName:"",props:{value:"id",label:"name",children:"children",checkStrictly:!0}}},mounted:function(){this.initCategoryList()},methods:{formatSourceData:function(e,t){var a=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,r=new RegExp(a),_=t.match(r),n=e+"="+_[2]+"."+_[3],s=_[4];return s=_[4].split(","),n+="."+String.fromCharCode(65+parseInt(s[1]))+(parseInt(s[0])+1),n},onSaveAs:function(e){this.saveAs=!0,this.onSaveTemplate()},onChangeCategory:function(e){this.com.category_id=e[e.length-1]},onSaveTemplate:function(e){var t=this,a=this,r=JSON.parse(JSON.stringify(e));r.attrs=JSON.stringify(r.attrs),r.code=r.name,r.status=5,r.category_id=this.com.category_id,void 0==r.id||this.saveAs?Object(u["a"])(r).then((function(e){200==e.status&&(r.id=e.data,a.com.id=e.data,a.$alert("模板信息保存成功"),a.$emit("onRefresh"),t.saveAs=!1)})):Object(u["g"])(r).then((function(e){200==e.status&&(a.$alert("模板信息更新成功"),a.$emit("onRefresh"))}))},processDataForCascader:function(e){console.log("Raw data:",e);var t=new Map,a=[];return e.forEach((function(e){var a=Object(i["a"])(Object(i["a"])({},e),{},{children:[]});t.set(e.id,a)})),e.forEach((function(e){if("0"===e.parent_id||0===e.parent_id)a.push(t.get(e.id));else{var r=t.get(parseInt(e.parent_id));r?r.children.push(t.get(e.id)):(console.warn("Parent with id ".concat(e.parent_id," not found for item:"),e),a.push(t.get(e.id)))}})),console.log("Processed data:",a),a},initCategoryList:function(){var e=this;return Object(o["a"])(Object(s["a"])().mark((function t(){var a;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e,t.next=3,Object(u["b"])();case 3:a=t.sent,e.categoryList=e.processDataForCascader(a.data);case 5:case"end":return t.stop()}}),t)})))()},onModify:function(e,t,a){this.currentIndex=e,this.componentIndex=t,this.activeHeaderIndex=a,this.headerItemName=this.components[e].components[t].attrs.tableHeader[a],this.dialogVisible=!0},onSetHeader:function(e){this.currentIndex>=0&&(this.activeHeaderIndex>=0?this.components[this.currentIndex].components[this.componentIndex].attrs.tableHeader[this.activeHeaderIndex]=e:this.components[this.currentIndex].components[this.componentIndex].attrs.tableHeader.push(e)),this.$emit("onSetComponents",Object(n["a"])(this.components)),this.dialogVisible=!1},onInsert:function(e,t){this.currentIndex=e,this.componentIndex=t,this.headerItemName="",this.dialogVisible=!0},onDeleteHeaderItem:function(e,t,a){this.components[e].components[t].attrs.tableHeader.splice(a,1),this.$emit("onSetComponents",Object(n["a"])(this.components))},onSetActiveIndex:function(e){e==this.activeHeaderIndex?this.activeHeaderIndex=-1:this.activeHeaderIndex=e},getTemplateList:function(e){var t=this;return Object(o["a"])(Object(s["a"])().mark((function a(){var r,_;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t,a.next=3,Object(u["d"])({page:1,pageSize:999,category_id:e,status:5});case 3:if(r=a.sent,200==r.status){a.next=6;break}return a.abrupt("return",[]);case 6:return _=r.data.dataList.map((function(e){return e.attrs=JSON.parse(e.attrs),e})),a.abrupt("return",_);case 8:case"end":return a.stop()}}),a)})))()}}}),m=d,p=(a("69b2"),a("2877")),b=Object(p["a"])(m,r,_,!1,null,null,null);t["a"]=b.exports},dad3:function(e,t,a){"use strict";a("0561")},e397:function(module,__webpack_exports__,__webpack_require__){"use strict";var C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("2909"),C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("5530"),C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("b85c"),C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("c7eb"),C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("1da1"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("7db0"),core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("a434"),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("e9c4"),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("4d63"),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("2c3e"),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("25f0"),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("466d"),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("841c"),core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_21__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_22__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_23__),_api_sourceData__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("1c4c"),_utils_fun__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("639e"),_api_document__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("424e"),_com_menus__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("1684"),_com_editor__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("35d5"),_com_components_Attribute__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("d4a5"),_com_components_Attribute_attributeVar_index_vue__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("f6f9"),_com_components_ProductAttr__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("2b1e"),_api_template__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("c621"),_com_components_Attribute_docAttr__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("6c9d"),_com_components_Attribute_comList__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("7a34"),_com_components_Attribute_Directory__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__("1995"),_api_api__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__("4ec3"),_com_view__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__("5d1d"),_directive_el_drag_dialog__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__("a888"),vuedraggable__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__("b76a"),vuedraggable__WEBPACK_IMPORTED_MODULE_39___default=__webpack_require__.n(vuedraggable__WEBPACK_IMPORTED_MODULE_39__),html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__("4f15"),html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_40___default=__webpack_require__.n(html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_40__),_api_formula__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__("f9e5"),axios__WEBPACK_IMPORTED_MODULE_42__=__webpack_require__("bc3a"),axios__WEBPACK_IMPORTED_MODULE_42___default=__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_42__);__webpack_exports__["a"]={name:"create",components:{menus:_com_menus__WEBPACK_IMPORTED_MODULE_27__["a"],editor:_com_editor__WEBPACK_IMPORTED_MODULE_28__["a"],Attribute:_com_components_Attribute__WEBPACK_IMPORTED_MODULE_29__["a"],comList:_com_components_Attribute_comList__WEBPACK_IMPORTED_MODULE_34__["a"],docAttr:_com_components_Attribute_docAttr__WEBPACK_IMPORTED_MODULE_33__["a"],ViewForm:_com_view__WEBPACK_IMPORTED_MODULE_37__["a"],ProductAttr:_com_components_ProductAttr__WEBPACK_IMPORTED_MODULE_31__["a"],Directory:_com_components_Attribute_Directory__WEBPACK_IMPORTED_MODULE_35__["a"],draggable:vuedraggable__WEBPACK_IMPORTED_MODULE_39___default.a,attributeVar:_com_components_Attribute_attributeVar_index_vue__WEBPACK_IMPORTED_MODULE_30__["a"]},directives:{elDragDialog:_directive_el_drag_dialog__WEBPACK_IMPORTED_MODULE_38__["a"]},data:function(){return{activeNames:"-1",nestedActiveNames:[],articleList:[],activeModel:"",templateList:[],categoryList:[],coms:[],comIndex:9999,showProductAttr:!1,comList:[],docAttr:{id:0,category_id:"",title:"",content:"",status:5,links:"",linkProduct:[],linkProject:[],projects:""},insertCmd:null,showViewForm:!1,isAdmin:2,tabExt:{row:0,col:0},userInfo:null,articleId:0,loading:!1,showView:0,childrenList:"",value:[],AttributeIndex:0,catalogIndex:0,docuComIndex:3,type:"",docVisible:!1,docForm:{title:"",category_id:""},docRules:{title:[{required:!0,message:"请输文档名称",trigger:"blur"}],category_id:[{required:!0,message:"请选择文档分类",trigger:"change"}]},articleCategoryList:[]}},watch:{coms:{handler:function(e,t){this.updateAttrs(e,t)},immediate:!0,deep:!0},articleId:{handler:function(e){null==e||void 0==e||e<=0||this.loadArticle(e)},immediate:!0,deep:!0}},mounted:function(){var e=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function t(){var a;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.articleId=e.$route.query.articleId,e.type=e.$route.query.type,"module"==e.type&&(e.showView=1),e.searchArticle(),t.next=6,e.initCategoryList();case 6:return t.next=8,e.initCurrentUser();case 8:a=e.$route.query.templateId,a>0&&e.loadTemplateInfo(a),e.isAdmin=e.userInfo?e.userInfo.roleInfo.is_admin:2,e.initArticleCategoryList(),"module"!==e.type&&"document"!==e.type&&(document.title="新建模版-轻良实业"),"module"!==e.type&&"document"!==e.type&&void 0!==e.articleId&&(document.title=e.docAttr.title+"-轻良实业"),e.$nextTick((function(){var e=document.querySelectorAll(".el-collapse-item__arrow");e.forEach((function(e){e.style.margin="0"}))}));case 15:case"end":return t.stop()}}),t)})))()},methods:{handleItemVal:function(e){this.$forceUpdate(),this.loadChildren(e)},handleChildItemClick:function(e){e.children||this.loadChildren(e)},handleChildItemVal:function(e){this.$forceUpdate(),this.loadChildren(e)},handleGrandChildItemClick:function(e){e.children||this.loadChildren(e)},handleGrandChildItemVal:function(e){this.loadChildren(e),this.$forceUpdate()},handlegreatGrandChildItemVal:function(e){this.loadChildren(e),this.$forceUpdate()},loadChildren:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function a(){var r,_,n,s;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return r=e[e.length-1],a.prev=1,a.next=4,Object(_api_template__WEBPACK_IMPORTED_MODULE_32__["e"])({parent_id:r});case 4:if(_=a.sent,200==_.status&&0!=_.data.length){a.next=7;break}return a.abrupt("return");case 7:n=_.data,s=0;case 9:if(!(s0){var s=this.insertChildrenById(n.children,t,a);if(s)return!0}}}catch(o){_.e(o)}finally{_.f()}return!1},closeDoc:function(){this.docVisible=!1,this.docForm={title:"",category_id:""}},submitDoc:function(){var e=this;this.$refs.docRef.validate((function(t){t&&(e.docAttr.title=e.docForm.title,e.docAttr.category_id=e.docForm.category_id,e.onSave())}))},initArticleCategoryList:function(){var e=this;Object(_api_document__WEBPACK_IMPORTED_MODULE_26__["e"])({page:1,pageSize:99,status:5}).then((function(t){200==t.status&&(e.articleCategoryList=t.data.dataList)}))},updateAttrs:function(e,t){var a=this;e.forEach((function(e,r){var _=t[r];_&&e.attrs.forEach((function(e,t){var r=_.attrs[t];r&&e.content!==r.content&&a.updateGlobalAttr(e.name,e.content)}))}))},updateGlobalAttr:function(e,t){this.coms.forEach((function(a){a.attrs.forEach((function(a){a.name===e&&"variableNull"!==a.type&&(a.content=t)})),"TextArea"===a.type&&(a.content=a.content.replace(new RegExp("{{".concat(e,"}}"),"g"),(function(r){var _=a.attrs.find((function(t){return t.id===e}));return _&&"variableNull"!==_.type?t:r})))})),this.replaceData(this.coms),this.$forceUpdate()},replaceData:function replaceData(data){var _this6=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function _callee3(){var _iterator2,_step2,item,_iterator3,_step3,el,attrId,formual;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_iterator2=Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(_this6.coms),_context3.prev=1,_iterator2.s();case 3:if((_step2=_iterator2.n()).done){_context3.next=40;break}item=_step2.value,_iterator3=Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(item.attrs),_context3.prev=6,_iterator3.s();case 8:if((_step3=_iterator3.n()).done){_context3.next=30;break}if(el=_step3.value,attrId=el.id,"formual"!==el.type){_context3.next=27;break}return _context3.prev=12,_context3.next=15,_this6.analysisFormual(el);case 15:return formual=_context3.sent,_context3.next=18,_this6.getRemote(formual);case 18:formual=_context3.sent,el.content=eval(formual),_context3.next=25;break;case 22:_context3.prev=22,_context3.t0=_context3["catch"](12),console.error("处理公式时出错:",_context3.t0);case 25:_context3.next=28;break;case 27:"variableNull"===el.type&&(el.content=el.content||"请输入");case 28:_context3.next=8;break;case 30:_context3.next=35;break;case 32:_context3.prev=32,_context3.t1=_context3["catch"](6),_iterator3.e(_context3.t1);case 35:return _context3.prev=35,_iterator3.f(),_context3.finish(35);case 38:_context3.next=3;break;case 40:_context3.next=45;break;case 42:_context3.prev=42,_context3.t2=_context3["catch"](1),_iterator2.e(_context3.t2);case 45:return _context3.prev=45,_iterator2.f(),_context3.finish(45);case 48:return _context3.abrupt("return",data);case 49:case"end":return _context3.stop()}}),_callee3,null,[[1,42,45,48],[6,32,35,38],[12,22]])})))()},analysisFormual:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/(\[.*?\]){3}/,n=e.formula,s=new RegExp(_);case 4:if(o=n.match(s),null!=o){a.next=8;break}return a.abrupt("break",22);case 8:return i=o[0],a.prev=9,a.next=12,r.getFormualData(i);case 12:c=a.sent,null===c||void 0===c||isNaN(c)?(console.warn("获取到的数据无效: ".concat(i)),n=n.replace(i,"(0)")):n=n.replace(i,"(".concat(parseFloat(c),")")),a.next=20;break;case 16:a.prev=16,a.t0=a["catch"](9),console.error("处理 ".concat(i," 时出错:"),a.t0),n=n.replace(i,"(0)");case 20:a.next=4;break;case 22:return a.abrupt("return",n);case 23:case"end":return a.stop()}}),a,null,[[9,16]])})))()},getFormualData:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function a(){var r,_,n,s,o;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_),s=e.match(n),o=0,!s||"T"!=s[1]){a.next=11;break}return a.next=8,r.getModuleData(s[2],s[3]);case 8:o=a.sent,a.next=12;break;case 11:console.warn("无法解析公式项:",e);case 12:return a.abrupt("return",o);case 13:case"end":return a.stop()}}),a)})))()},getModuleData:function(e,t){var a=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function r(){var _,n,s;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(_=a,n=_.coms.filter((function(t){return t.name==e})),!(n.length>0)){r.next=6;break}if(s=n[0].attrs.filter((function(e){return e.name==t})),!(s.length>0)){r.next=6;break}return r.abrupt("return",parseFloat(s[0].content));case 6:return r.abrupt("return",0);case 7:case"end":return r.stop()}}),r)})))()},getRemote:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_);case 3:if(s=e.match(n),null!=s){a.next=7;break}return a.abrupt("break",18);case 7:if("R"!=s[1]){a.next=16;break}return o=s[4],o=s[4].split(","),a.next=12,r.getRemoteData(s[2],s[3],o[0],o[1]);case 12:i=a.sent,c=s[0],e=isNaN(i)?e.replace(c,'"'.concat(i,'"')):e.replace(c,"("+parseFloat(i)+")"),e=e.replace(c,"("+parseFloat(i)+")");case 16:a.next=3;break;case 18:return a.abrupt("return",e);case 19:case"end":return a.stop()}}),a)})))()},getRemoteData:function(e,t,a,r){var _=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function n(){var s,o,i;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return _,s=0,o={code:e,sheetName:t,row:a,col:r},n.prev=3,n.next=6,Object(_api_sourceData__WEBPACK_IMPORTED_MODULE_24__["a"])(o);case 6:i=n.sent,200==i.status&&(s=i.data.result,"string"!==typeof s||isNaN(s)||(s=parseFloat(s))),n.next=13;break;case 10:n.prev=10,n.t0=n["catch"](3),console.error("获取远程数据错误:",n.t0);case 13:return n.abrupt("return",s);case 14:case"end":return n.stop()}}),n,null,[[3,10]])})))()},handleItemClick:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function a(){var r,_,n;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=t.categoryList.find((function(t){return t.id===e})),r){a.next=3;break}return a.abrupt("return");case 3:if(r.children){a.next=24;break}return a.prev=4,a.next=7,Object(_api_template__WEBPACK_IMPORTED_MODULE_32__["e"])({parent_id:e});case 7:if(_=a.sent,200==_.status&&0!=_.data.length){a.next=10;break}return a.abrupt("return");case 10:r.children=_.data,n=0;case 12:if(!(n0?Object(_api_document__WEBPACK_IMPORTED_MODULE_26__["f"])(t.docAttr).then((function(e){200==e.status&&(t.docAttr.id=e.data,t.$alert("文档更新成功"),t.docVisible=!1,t.docForm={title:"",category_id:""},t.searchArticle())})):Object(_api_document__WEBPACK_IMPORTED_MODULE_26__["a"])(t.docAttr).then((function(e){200==e.status&&(t.docAttr.id=e.data,t.$alert("文档保存成功"),t.docVisible=!1,t.docForm={title:"",category_id:""},t.searchArticle())}))):t.$alert("请填写文档标题")},onUpload:function(){var e=this;e.coms.length<=0?e.$alert("增加组件"):""!=e.docAttr.title?(e.docAttr.links=JSON.stringify(e.docAttr.linkProduct),e.docAttr.projects=JSON.stringify(e.docAttr.linkProject),e.docAttr.data=JSON.stringify(e.coms),e.docAttr.is_template=1,e.docAttr.user_name=e.$store.state.user.name,e.docAttr.user_id=e.$store.state.user.id,Object(_api_document__WEBPACK_IMPORTED_MODULE_26__["f"])(e.docAttr).then((function(t){200==t.status&&(e.docAttr.id=t.data,e.$alert("模版更新成功"),e.searchArticle())}))):e.$alert("请填写模版标题")},onSaveUpload:function(e){var t=this;t.coms.length<=0?t.$alert("增加组件"):""!=t.docAttr.title?(t.docAttr.links=JSON.stringify(t.docAttr.linkProduct),t.docAttr.projects=JSON.stringify(t.docAttr.linkProject),t.docAttr.data=JSON.stringify(t.coms),t.docAttr.is_template=1,t.docAttr.user_name=t.$store.state.user.name,t.docAttr.user_id=t.$store.state.user.id,Object(_api_document__WEBPACK_IMPORTED_MODULE_26__["a"])(t.docAttr).then((function(e){200==e.status&&(t.docAttr.id=e.data,t.$alert("模版保存成功"),t.searchArticle())}))):t.$alert("请填写模版标题")},onSetComs:function(e){var t=this;t.coms=Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0__["a"])(e)},onAddLayer:function(e,t){var a=this,r=a.categoryList[e].dataList[t],_=Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["a"])({},r),{},{attrs:JSON.parse(r.attrs)});delete _.category,a.coms.push(_),a.comIndex=a.coms.length-1},onInsert:function(e){var t=this;switch(e.key){case"article":t.insertArticle();break;case"table":t.insertTable();break;case"sourceData":t.insertSourceData(e);break;case"formual":t.insertFormual(e);break;case"constant":t.insertConstant(e);break;case"variable":t.insertVariable(e);break;case"pager":t.insertPager();break;case"attr":this.insertProductAttr();break;case"Directory":t.insertDirectory();break;case"addNew":t.insertNew(e);break;case"InsertNull":t.insertVal();break;case"ai":t.insertAI(e);break}},insertVal:function(){var e=this;if(e.comIndex<0)return e.$alert("请选择插入图层"),!1;var t=e.coms[e.comIndex],a="val"+Date.now(),r={type:"variableNull",id:a,dataId:"",name:"非变量",intro:"",content:"请输入",data:""};t.attrs.push(r),"TextArea"==t.type?e.insertCmd={content:"{{"+r.id+"}}"}:e.comIndex>=0&&e.setTableData(r.id)},insertAI:function(e){var t=this;if(t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r={type:"ai",id:"ai"+(a.attrs.length+1),dataId:"",name:"AI",intro:"插入AI",content:e.content.result,search:e.content.searchTerm};a.attrs.push(r),"TextArea"==a.type&&(t.insertCmd={content:"{{"+r.id+"}}"})},insertProductAttr:function(){if(this.docAttr.linkProduct.length<=0)return this.$alert("请选择文档关联商品信息"),!1;this.showProductAttr=!0},insertDirectory:function(e){var t=this;if(t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r="Directory"+(a.attrs.length+1),_={type:"Directory",id:r,name:"目录信息",intro:"目录信息",content:"目录信息"};a.attrs.push(_),console.log(t.coms),t.insertCmd={content:"
{{"+r+"}}
"}},onInsertProductAttr:function(e){var t=this;if(this.showProductAttr=!1,t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r={type:"ProductAttr",id:"ProductAttr"+(a.attrs.length+1),dataId:e.id,name:"商品属性",intor:"商品属性",content:"",attrs:e};a.attrs.push(r),t.insertCmd={content:"{{"+r.id+"}}"}},insertNew:function(e){var t=this;t.coms.push(e)},insertPager:function(){var e=this;if(e.comIndex<0)return e.$alert("请选择插入图层"),!1;var t=e.coms[e.comIndex],a={type:"pager",id:"pager"+(t.attrs.length+1),name:"分页符",intor:"强制分页",content:""};t.attrs.push(a),"TextArea"==t.type&&(e.insertCmd={content:"
{{"+a.id+"}}
"})},insertArticle:function(){var e=this,t={type:"TextArea",lay_id:"textArea",code:"模块名",name:"图文",intro:"图文介绍",isEdit:2,content:"请填写内容",attrs:[]};e.coms.push(t),e.comIndex=e.coms.length-1,console.log("New article added:",t),console.log("Current coms:",e.coms),console.log("New comIndex:",e.comIndex)},insertTable:function(){var e=this;e.coms.push({type:"Table",lay_id:"Table",code:"模块名",name:"图表名称",intro:"图表介绍",isEdit:2,tableHeader:this.initTableHeader(),tableData:[{}],htmlData:"",attrs:[]}),e.comIndex=e.coms.length-1},initTableHeader:function(){for(var e=65,t=[],a=e;a<=e+25;a++)t.push(String.fromCharCode(a));return t},insertConstant:function(e){var t=this;if(t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r={type:"constant",id:e.content.code+(a.attrs.length+1),dataId:e.id,name:e.content.code,intro:e.content.intro,content:e.content.value,data:e.content};a.attrs.push(r),"TextArea"==a.type?t.insertCmd={content:"{{"+r.id+"}}"}:t.comIndex>=0&&t.setTableData(r.id)},insertVariable:function(e){var t=this;if(t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r={type:"variable",id:e.content.code+(a.attrs.length+1),dataId:e.id,name:e.content.code,intro:e.content.intro,content:e.content.value,data:e.content};a.attrs.push(r),"TextArea"==a.type?t.insertCmd={content:"{{"+r.id+"}}"}:t.comIndex>=0&&t.setTableData(r.id)},insertSourceData:function(e){var t=this;if(t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r={type:"sourceData",id:"sourceData"+(a.attrs.length+1),dataId:"",name:"源数据",intro:"插入源数据",formula:"[R]["+e.content.tb+"]["+e.content.sheet+"]["+e.content.r+","+e.content.c+"]",content:e.content.value,data:e.content};a.attrs.push(r),"TextArea"==a.type&&(t.insertCmd={content:"{{"+r.id+"}}"})},insertFormual:function(e){var t=this;if(t.comIndex<0)return t.$alert("请选择插入图层"),!1;var a=t.coms[t.comIndex],r={type:"formual",id:"formual"+(a.attrs.length+1),dataId:e.id,name:e.content.name,intro:e.content.intro,formula:e.content.formula,content:0,data:e.content};a.attrs.push(r),"TextArea"==a.type?t.insertCmd={content:"{{"+r.id+"}}"}:t.comIndex>=0&&t.setTableData(r.id)},initCategoryList:function(){var e=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function t(){var a,r,_;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e,t.next=3,Object(_api_template__WEBPACK_IMPORTED_MODULE_32__["e"])({page:1,pageSize:99,parent_id:0,status:5});case 3:if(r=t.sent,200==r.status){t.next=6;break}return t.abrupt("return");case 6:a.categoryList=r.data.dataList,_=0;case 8:if(!(_0)){r.next=6;break}if(s=n[0].attrs.filter((function(e){return e.name==t})),!(s.length>0)){r.next=6;break}return r.abrupt("return",parseFloat(s[0].content));case 6:return r.abrupt("return",0);case 7:case"end":return r.stop()}}),r)})))()},getRemote:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,_=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,n=new RegExp(_);case 3:if(s=e.match(n),null!=s){a.next=7;break}return a.abrupt("break",18);case 7:if("R"!=s[1]){a.next=16;break}return o=s[4],o=s[4].split(","),a.next=12,r.getRemoteData(s[2],s[3],o[0],o[1]);case 12:i=a.sent,c=s[0],e=isNaN(i)?e.replace(c,'"'.concat(i,'"')):e.replace(c,"("+parseFloat(i)+")"),e=e.replace(c,"("+parseFloat(i)+")");case 16:a.next=3;break;case 18:return a.abrupt("return",e);case 19:case"end":return a.stop()}}),a)})))()},getRemoteData:function(e,t,a,r){var _=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function n(){var s,o,i;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return _,s=0,o={code:e,sheetName:t,row:a,col:r},n.prev=3,n.next=6,Object(_api_sourceData__WEBPACK_IMPORTED_MODULE_28__["a"])(o);case 6:i=n.sent,200==i.status&&(s=i.data.result,"string"!==typeof s||isNaN(s)||(s=parseFloat(s))),n.next=13;break;case 10:n.prev=10,n.t0=n["catch"](3),console.error("获取远程数据错误:",n.t0);case 13:return n.abrupt("return",s);case 14:case"end":return n.stop()}}),n,null,[[3,10]])})))()},getComponentType:function(e){return"textarea"===e?_components_TextView__WEBPACK_IMPORTED_MODULE_24__["a"]:e},onUpdateData:function(e,t){this.comList[e].content=t,this.rebuildContent()},rebuildContent:function(){this.content=this.comList.map((function(e){return e.content})).join("")},onExport:function(){var e=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function t(){var a,r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exporting){t.next=2;break}return t.abrupt("return");case 2:return e.exporting=!0,t.prev=3,a=e.$refs.content.cloneNode(!0),r=a.querySelectorAll(".template-textarea"),r.length>0&&(_=document.createElement("div"),_.className="blank-page",_.innerHTML='
',n=document.createElement("div"),n.className="toc-page",n.innerHTML='\n
\n

目录

\n
\n
\n ',r[0].parentNode.insertBefore(n,r[0].nextSibling),r[0].parentNode.insertBefore(_,n),s="",r.forEach((function(e,t){var a=e.querySelector("h1, h2, h3, h4, h5, h6");a&&(s+='\n
\n '.concat(a.textContent,'\n ').concat(t+2,"\n
\n "),a.id="section-".concat(t+2))})),a.querySelector("#toc").innerHTML=s),a.querySelectorAll('input[type="text"]').forEach((function(e){var t=document.createElement("span");t.textContent=e.value,e.parentNode.replaceChild(t,e)})),o=''.concat(a.innerHTML,""),o=o.replaceAll("",'
'),t.next=12,Object(_api_document__WEBPACK_IMPORTED_MODULE_23__["b"])({content:o,title:e.docAttr.title});case 12:if(i=t.sent,200==i.status){t.next=16;break}return e.$alert(i.errMsg),t.abrupt("return");case 16:c=document.createElement("a"),c.href=i.data.file_path,c.download=i.data.file_name,document.body.appendChild(c),c.click(),document.body.removeChild(c),t.next=27;break;case 24:t.prev=24,t.t0=t["catch"](3),e.$alert("导出文档时发生错误,请稍后重试。");case 27:return t.prev=27,e.exporting=!1,t.finish(27);case 30:case"end":return t.stop()}}),t,null,[[3,24,27,30]])})))()},onExports:function(){var e=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function t(){var a,r,_,n,s,o,i,c;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exporting){t.next=2;break}return t.abrupt("return");case 2:e.exporting=!0,t.prev=3,a=e.$refs.content.cloneNode(!0),console.log("Original content:",a.innerHTML),a.querySelectorAll("span > img").forEach((function(e){var t=e.parentElement,a=t.parentElement;a.insertBefore(e,t),0===t.childNodes.length&&a.removeChild(t)})),a.querySelectorAll("table").forEach((function(e,t){e.style.cssText="\n border-collapse: separate !important;\n width: 100% !important;\n border: none !important;\n ",e.querySelectorAll("tr").forEach((function(e,t){e.querySelectorAll("td, th").forEach((function(e,a){var r="\n padding: 5px !important;\n border: 0.1px solid #000000 !important;\n ";0!==t&&(r+="border-top: none !important;"),0!==a&&(r+="border-left: none !important;"),e.style.cssText+=r}))}))})),r=a.querySelectorAll("img"),_=Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__["a"])(r),t.prev=10,_.s();case 12:if((n=_.n()).done){t.next=21;break}return s=n.value,t.next=16,e.convertImageToBase64(s);case 16:s.style.maxWidth="100%",s.style.height="auto","P"===s.parentElement.tagName&&(console.log(s),s.parentElement.style.textAlign=s===r[0]?"left":"right");case 19:t.next=12;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t["catch"](10),_.e(t.t0);case 26:return t.prev=26,_.f(),t.finish(26);case 29:return console.log("Content after image processing:",a.innerHTML),a.querySelectorAll('input[type="text"]').forEach((function(e){var t=document.createElement("span");t.textContent=e.value,e.parentNode.replaceChild(t,e)})),o='\n \n \n \n \n \n \n '.concat(a.innerHTML,"\n \n "),console.log("Final HTML content:",o),i={margin:{top:"2cm",right:"2cm",bottom:"2cm",left:"2cm"},table:{row:{cantSplit:!0}},footer:{default:'

页码: {page} / {pages}

'},pageNumber:!0},t.next=36,Object(html_to_docx__WEBPACK_IMPORTED_MODULE_29__["a"])(o,null,i);case 36:c=t.sent,Object(file_saver__WEBPACK_IMPORTED_MODULE_30__["saveAs"])(c,"".concat(e.docAttr.title,".docx")),e.$message.success("文档导出成功"),t.next=45;break;case 41:t.prev=41,t.t1=t["catch"](3),console.error("导出文档时发生错误:",t.t1),e.$message.error("导出文档时发生错误,请稍后重试");case 45:return t.prev=45,e.exporting=!1,t.finish(45);case 48:case"end":return t.stop()}}),t,null,[[3,41,45,48],[10,23,26,29]])})))()},processAllTables:function(e){e.querySelectorAll("table").forEach((function(e){e.style.borderCollapse="separate",e.style.width="100%",e.style.border="none",e.style.backgroundColor="#000000",e.querySelectorAll("tr").forEach((function(e){e.querySelectorAll("td, th").forEach((function(e){e.style.padding="5px",e.style.borderRight="0.1px solid #ffffff",e.style.borderBottom="0.1px solid #ffffff",e.style.backgroundColor="#ffffff"}))}))}))},convertImageToBase64:function(e){var t=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.abrupt("return",new Promise((function(a,r){e.complete?t.toDataURL(e.src,(function(t){e.src=t,a()})):(e.onload=function(){t.toDataURL(e.src,(function(t){e.src=t,a()}))},e.onerror=r)})));case 1:case"end":return a.stop()}}),a)})))()},toDataURL:function(e,t){var a=new XMLHttpRequest;a.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(a.response)},a.open("GET",e),a.responseType="blob",a.send()},onExportPDF:function(){var e=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function t(){var a,r,_,n,s,o;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exporting){t.next=2;break}return t.abrupt("return");case 2:return e.exporting=!0,e.exportProgress=0,t.prev=4,a=e.$refs.content,console.log("Content element:",a),r={height:a.style.height,overflow:a.style.overflow,position:a.style.position},a.style.height="auto",a.style.overflow="visible",a.style.position="absolute",t.next=13,e.waitForImages(a);case 13:return _=new jspdf__WEBPACK_IMPORTED_MODULE_26__["a"]("p","pt","a4"),n=_.internal.pageSize.getHeight(),s=_.internal.pageSize.getWidth(),o=setTimeout((function(){throw new Error("PDF export timed out")}),6e4),t.next=19,e.addContentToPDF(a,_,s,n);case 19:clearTimeout(o),_.save("".concat(e.docAttr.title||"document",".pdf")),Object.assign(a.style,r),e.$message.success("PDF导出成功"),t.next=29;break;case 25:t.prev=25,t.t0=t["catch"](4),console.error("Export to PDF failed:",t.t0),e.$message.error("PDF导出失败:".concat(t.t0.message));case 29:return t.prev=29,e.exporting=!1,e.exportProgress=0,t.finish(29);case 33:case"end":return t.stop()}}),t,null,[[4,25,29,33]])})))()},waitForImages:function(e){return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function t(){var a,r;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.getElementsByTagName("img"),r=Array.from(a).map((function(e){return e.complete?Promise.resolve():new Promise((function(t){e.onload=e.onerror=t}))})),t.next=4,Promise.all(r);case 4:case"end":return t.stop()}}),t)})))()},addContentToPDF:function(e,t,a,r){var _=arguments,n=this;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function s(){var o,i,c,l,u,d;return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(s){while(1)switch(s.prev=s.next){case 0:return o=_.length>4&&void 0!==_[4]?_[4]:0,i=e.scrollHeight,s.next=4,html2canvas__WEBPACK_IMPORTED_MODULE_27___default()(e,{scale:2,useCORS:!0,logging:!1,windowWidth:a,windowHeight:r,y:o,ignoreElements:function(e){var t=window.getComputedStyle(e);return"none"!==t.getPropertyValue("-ms-high-contrast")},onclone:function(e){var t=e.body.querySelector(".content");t&&(t.style.height="auto",t.style.overflow="visible",t.style.position="static")}});case 4:if(c=s.sent,l=c.toDataURL("image/jpeg",1),u=a,d=c.height*u/c.width,t.addImage(l,"JPEG",0,0,u,d),n.exportProgress=Math.min(100,Math.round((o+r)/i*100)),!(c.height>r)){s.next=14;break}return t.addPage(),s.next=14,n.addContentToPDF(e,t,a,r,o+r);case 14:case"end":return s.stop()}}),s)})))()},onExportPdfApi:function(){return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function e(){return Object(C_Users_0_Desktop_yl_project_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()}}}},f6f9:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return null!=e.com?a("div",{staticClass:"editor-attribute"},[a("el-form",[e._l(e.filteredAttrs,(function(t,r){return["TextArea"==e.com.type?[e.isTextAreaType(t.type)?[a("el-form-item",{attrs:{label:t.id+":"}},[a("span",{staticStyle:{cursor:"pointer"},on:{click:function(a){return e.toggleBackground(t.id)}}},[e._v(e._s(t.content))])])]:e._e(),"formual"==t.type?[a("el-form-item",{attrs:{label:t.id+":"}},[a("span",{staticStyle:{cursor:"pointer"},on:{click:function(a){return e.toggleBackground(t.id)}}},[e._v(e._s(t.formula))])])]:e._e(),"sourceData"==t.type?[a("el-form-item",{attrs:{label:t.id+":"}},[e._v(" "+e._s(e.formatSourceData(t.id,t.formula))+" ")])]:e._e()]:e._e()]}))],2),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.dialogVisible,"append-to-body":"",width:"300","custom-class":"prod-verify",title:"编辑表头"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("headerSetting",{attrs:{headerItemName:e.headerItemName},on:{onSetHeader:e.onSetHeader}})],1)],1):e._e()},_=[],n=a("2909"),s=a("b85c"),o=a("c7eb"),i=a("5530"),c=a("1da1"),l=(a("99af"),a("4de4"),a("caad"),a("d81d"),a("a434"),a("b0c0"),a("e9c4"),a("b64b"),a("d3b7"),a("ac1f"),a("00b4"),a("2532"),a("466d"),a("498a"),a("1b35")),u=a("a888"),d=a("c621"),m=(a("1c4c"),a("424e"),{name:"attributes",components:{headerSetting:l["a"]},directives:{elDragDialog:u["a"]},emits:["onRefresh"],props:{com:{type:Object,default:function(){return null}}},watch:{com:{handler:function(e){e&&e.content&&this.processContent()},deep:!0}},data:function(){return{dialogVisible:!1,activeNames:"0",categoryList:[],articleCategoryList:[],activeHeaderIndex:-1,headerItemName:"",props:{value:"id",label:"name",children:"children"},processedAttrs:[]}},computed:{filteredAttrs:function(){return console.log("processedAttrs",this.processedAttrs),this.processedAttrs}},mounted:function(){this.initCategoryList(),this.com&&this.com.content&&this.processContent()},methods:{toggleBackground:function(e){var t=document.getElementById(e);t&&("yellow"===t.style.backgroundColor?t.style.backgroundColor="":t.style.backgroundColor="yellow")},updateAllReferences:function(e,t){this.com.attrs.map((function(a){a.name==e.name&&(a.content=t)}))},isTextAreaType:function(e){return!["pager","constant","attr","formual","sourceData","Directory"].includes(e)},extractChineseTemplates:function(e){var t,a=/\{\{(.*?)\}\}/g,r=/[\u4e00-\u9fa5]/,_=[];while(null!==(t=a.exec(e)))r.test(t[1])&&_.push(t[1].trim());return _},processContent:function(){if(this.com&&this.com.content){var e=this.extractChineseTemplates(this.com.content);this.com.attrs&&Array.isArray(this.com.attrs)&&(this.processedAttrs=this.com.attrs.filter((function(t){return e.includes(t.id)||"formual"===t.type})))}else this.processedAttrs=[]},formatSourceData:function(e,t){var a=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,r=t.match(a),_=r[4].split(",");return"".concat(e,"=").concat(r[2],".").concat(r[3],".").concat(String.fromCharCode(65+parseInt(_[1]))).concat(parseInt(_[0])+1)},onSaveTemplate:function(e){var t=this;return Object(c["a"])(Object(o["a"])().mark((function a(){var r,_,n;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=Object(i["a"])(Object(i["a"])({},e),{},{attrs:JSON.stringify(e.attrs),status:5}),delete r.category,void 0!==r.id&&!t.saveAs){a.next=9;break}return a.next=5,Object(d["a"])(r);case 5:_=a.sent,200===_.status&&(r.id=_.data,t.com.id=_.data,t.$alert("模板信息保存成功"),t.$emit("onRefresh"),t.saveAs=!1),a.next=13;break;case 9:return a.next=11,Object(d["g"])(r);case 11:n=a.sent,200===n.status&&(t.$alert("模板信息更新成功"),t.$emit("onRefresh"));case 13:case"end":return a.stop()}}),a)})))()},initCategoryList:function(){var e=this;return Object(c["a"])(Object(o["a"])().mark((function t(){var a,r,_,n;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["e"])({page:1,pageSize:99,status:5});case 2:if(a=t.sent,200!==a.status){t.next=23;break}e.categoryList=a.data.dataList||[],r=Object(s["a"])(e.categoryList),t.prev=6,r.s();case 8:if((_=r.n()).done){t.next=15;break}return n=_.value,t.next=12,e.getTemplateList(n.id);case 12:n.dataList=t.sent;case 13:t.next=8;break;case 15:t.next=20;break;case 17:t.prev=17,t.t0=t["catch"](6),r.e(t.t0);case 20:return t.prev=20,r.f(),t.finish(20);case 23:case"end":return t.stop()}}),t,null,[[6,17,20,23]])})))()},getTemplateList:function(e){return Object(c["a"])(Object(o["a"])().mark((function t(){var a;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["d"])({page:1,pageSize:999,category_id:e,status:5});case 2:if(a=t.sent,200!==a.status){t.next=5;break}return t.abrupt("return",a.data.dataList.map((function(e){return Object(i["a"])(Object(i["a"])({},e),{},{attrs:JSON.parse(e.attrs)})})));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}}),t)})))()},onModify:function(e,t,a){this.currentIndex=e,this.componentIndex=t,this.activeHeaderIndex=a,this.headerItemName=this.components[e].components[t].attrs.tableHeader[a],this.dialogVisible=!0},onSetHeader:function(e){if(this.currentIndex>=0){var t=this.components[this.currentIndex].components[this.componentIndex].attrs.tableHeader;this.activeHeaderIndex>=0?t[this.activeHeaderIndex]=e:t.push(e)}this.$emit("onSetComponents",Object(n["a"])(this.components)),this.dialogVisible=!1},onInsert:function(e,t){this.currentIndex=e,this.componentIndex=t,this.headerItemName="",this.dialogVisible=!0},onDeleteHeaderItem:function(e,t,a){this.components[e].components[t].attrs.tableHeader.splice(a,1),this.$emit("onSetComponents",Object(n["a"])(this.components))},onSetActiveIndex:function(e){this.activeHeaderIndex=e===this.activeHeaderIndex?-1:e}}}),p=m,b=(a("b390"),a("2877")),f=Object(b["a"])(p,r,_,!1,null,null,null);t["a"]=f.exports},f746:function(e,t,a){"use strict";var r=a("c9e6"),_=a.n(r);t["default"]=_.a},f9e5:function(e,t,a){"use strict";a.d(t,"d",(function(){return _})),a.d(t,"a",(function(){return n})),a.d(t,"e",(function(){return s})),a.d(t,"c",(function(){return o})),a.d(t,"b",(function(){return i}));var r=a("b775");function _(e){return Object(r["a"])({url:"/formula/search",method:"post",data:e})}function n(e){return Object(r["a"])({url:"/formula/create",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/formula/update",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/formula/info",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/formula/delete",method:"post",data:e})}}}]);