chunk-0882ce66.7ad717eb.js 151 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0882ce66"],{"09ec":function(e,t,a){},"0fee":function(e,t,a){},1:function(e,t){},10:function(e,t){},"101d":function(e,t,a){},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.menus,(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",{staticClass:"menu",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:"300","close-on-click-modal":!1,"custom-class":"prod-verify",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",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,"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,"custom-class":"prod-verify",title:"选择AI"},on:{"update:visible":function(t){e.showSourceAi=t}}},[a("sourceAi",{on:{onPicked:e.onPickedAi}})],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=[],_=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:"80"}}),a("el-table-column",{attrs:{prop:"name",label:"名称",align:"left",width:"180"}}),a("el-table-column",{attrs:{prop:"intro",label:"介绍",align:"center",width:"150"}}),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:{"page-size":e.queryForm.pageSize,total:e.recordCount,"page-count":e.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":e.ChangePage},model:{value:e.queryForm.page,callback:function(t){e.$set(e.queryForm,"page",t)},expression:"queryForm.page"}})],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)},s=[],o=(a("ac1f"),a("841c"),a("b775"));function i(e){return Object(o["a"])({url:"/formula/search",method:"post",data:e})}function c(e){return Object(o["a"])({url:"/formula/create",method:"post",data:e})}function l(e){return Object(o["a"])({url:"/formula/update",method:"post",data:e})}function u(e){return Object(o["a"])({url:"/formula/info",method:"post",data:e})}function d(e){return Object(o["a"])({url:"/formula/delete",method:"post",data:e})}var m=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"},on:{click:e.InsertTableData}},[e._v("插入表格数据")]),a("el-button",{staticStyle:{"margin-top":"10px"},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(" 格式二:[R][表名][Sheet名称][row,col] "),a("span",[e._v("*")]),e._v("其中 [R]表示引用的是原始数据。 其中row,col表示excel表中的行、列序号 ")]),a("div",[e._v("目前仅支持+、-、*、/ 四种计算符合")]),a("div",[e._v("示例 [T][模块01][attr01]+[T][模块01][attr02]")])])],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)},p=[],f=a("ade3"),b=(a("99af"),a("4de4"),a("7db0"),a("c740"),a("caad"),a("d81d"),a("b0c0"),a("a9e3"),a("b64b"),a("d3b7"),a("00b4"),a("2532"),a("498a"),a("1c4c")),h=(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:"[]"})},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:"[]"},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:{close:function(){this.insertForm={}},handleFormulaInput:function(e){this.dataForm.formula=e},btnSave:function(e){var t=this;t.dataForm.id>0?l(t.dataForm).then((function(e){t.dataForm={status:5,use_status:5,params:"[]"},t.$message.success("公式更新成功")})):c(t.dataForm).then((function(e){t.dataForm={status:5,use_status:5,params:"[]"},t.$message.success("公式创建的成功")})),t.$emit("onClose")},getInfo:function(e){var t=this,a={id:e};u(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]/,n=[];while(null!==(t=a.exec(e)))r.test(t[1])&&n.push(t[1].trim());return n},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,n=a.name,_=null===(r=e.attrList.find((function(t){return t.id===e.insertForm.Variable})))||void 0===r?void 0:r.name;if(_){var s="[T][".concat(n,"][").concat(_,"]");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(f["a"])(Object(f["a"])(Object(f["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,n){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(b["h"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}}),E=h,v=(a("f277"),a("2877")),O=Object(v["a"])(E,m,p,!1,null,null,null),g=O.exports,j=a("a888"),D={name:"Formula",emits:["onPicked"],directives:{elDragDialog:j["a"]},components:{dataInfo:g},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;i(e.queryForm).then((function(t){200==t.status&&(e.dataList=t.data.dataList,e.recordCount=t.data.recordCount,e.pageTotal=t.data.pageTotal)}))},ChangePage:function(e){var t=this;t.queryForm.page=e,t.search()},btnDel:function(e){var t=this;d({id:e}).then((function(e){t.$message.success("删除成功!"),t.search()}))}}},C=D,k=(a("6899"),Object(v["a"])(C,_,s,!1,null,null,null)),y=k.exports,P=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)},x=[],M={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(f["a"])(Object(f["a"])(Object(f["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,n){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,n){}}))}))},initTableList:function(){var e=this;Object(b["h"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}},I=M,w=(a("4b4d"),Object(v["a"])(I,P,x,!1,null,null,null)),A=w.exports,L=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)},R=[],T=a("c7eb"),U=a("1da1"),B=a("bc3a"),W=a.n(B),K={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(U["a"])(Object(T["a"])().mark((function t(){var a;return Object(T["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,W.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,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(b["h"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}},S=K,F=(a("2a84"),Object(v["a"])(S,L,R,!1,null,null,null)),q=F.exports,$=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)},N=[],V={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(U["a"])(Object(T["a"])().mark((function t(){var a;return Object(T["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,W.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(b["h"])({page:1,pageSize:999,status:5}).then((function(t){200==t.status&&(e.tableList=t.data.dataList)}))}}},z=V,H=Object(v["a"])(z,$,N,!1,null,null,null),J=H.exports,G=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:1==e.type?250:100},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),1==e.type?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):e._e(),1==e.type?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):e._e()],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{"page-size":e.queryForm.pageSize,total:e.recordCount,"page-count":e.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":e.ChangePage},model:{value:e.queryForm.page,callback:function(t){e.$set(e.queryForm,"page",t)},expression:"queryForm.page"}})],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: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)},Y=[];a("e9c4"),a("159b");function X(e){return Object(o["a"])({url:"/params/search",method:"post",data:e})}function Q(e){return Object(o["a"])({url:"/params/create",method:"post",data:e})}function Z(e){return Object(o["a"])({url:"/params/update",method:"post",data:e})}function ee(e){return Object(o["a"])({url:"/params/delete",method:"post",data:e})}function te(e){return Object(o["a"])({url:"/params/info",method:"post",data:e})}var ae=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,"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"},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),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),2==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值范围:"}},[a("el-input",{attrs:{type:"textarea"},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)},re=[],ne=(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){var t=this;null==e||e<=0||t.getInfo(e)},immediate:!0,deep:!0}},data:function(){return{activeName:"base",currentCategory:[],valueTypeList:[{value:1,name:"文本内容"},{value:2,name:"下拉选择"}],allCategories:[],typeList:[{value:1,name:"变量"},{value:2,name:"常量"}],dataForm:{id:0,type:1,name:"",value:"",value_type:1,value_item:" ",intro:"",status:""},statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"使用中"},{value:6,label:"已停用"}]}},mounted:function(){},methods:{resetForm:function(){this.dataForm={type:1,value_type:1,status:5},this.$refs.dataFormRef.resetFields()},btnSave:function(e){var t=this;1==t.dataForm.value_type&&(t.dataForm.value_item=t.dataForm.value),t.dataForm.code=t.dataForm.name,t.dataForm.id>0?Z(t.dataForm).then((function(e){200==e.status&&(t.dataForm={type:1,value_type:1,status:5},t.$alert("信息更新成功"),t.$emit("onClose"))})):Q(t.dataForm).then((function(e){200==e.status&&(t.dataForm={type:1,value_type:1,status:5},t.$alert("信息创建成功"),t.$emit("onClose"))})),t.$emit("onClose")},getInfo:function(e){var t=this,a={id:e};te(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}}}),_e=ne,se=(a("1c44"),Object(v["a"])(_e,ae,re,!1,null,null,null)),oe=se.exports,ie={name:"searchParams",emits:["onPicked","onData"],directives:{elDragDialog:j["a"]},components:{dataInfo:oe},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()},onClose:function(e){var t=this;t.dialogVisible=!1,t.onBtnSearch()},btnOnDelete:function(e){var t=this,a={id:e};t.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(e){ee(a).then((function(e){t.search()}))})).catch((function(){}))},onBtnCreate:function(e){var t=this;t.dataId=0,t.title="创建变量",t.dialogVisible=!0},btnOnEdit:function(e){this.title="修改变量",this.dataId=e,this.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;X(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}}},ce=ie,le=(a("fff4"),Object(v["a"])(ce,G,Y,!1,null,null,null)),ue=le.exports,de={name:"menus",emits:["onEvents","onVariable"],components:{Formula:y,Variable:ue,sourceData:A,sourceAi:q,sourceEs:J},directives:{elDragDialog:j["a"]},props:{comArr:{type:Array,default:[]}},data:function(){return{showFormula:!1,showVariable:!1,showSourceData:!1,showSourceAi:!1,showSourceEs:!1,type:null,insertTitle:"插入变量",menus:[{name:"插入",subMenus:[{key:"article",name:"图文",icon:"insertArticle"},{key:"SourceData",name:"源数据",icon:"sourceData"},{key:"formual",name:"公式",icon:"insertFormula"},{key:"variable",name:"变量",icon:"insertParams"},{key:"constant",name:"常量",icon:"constant"},{key:"attr",name:"属性",icon:"attr"},{key:"Directory",name:"目录",icon:"subject"},{key:"ai",name:"AI模块",icon:"insertAuth"}]}]}},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){e.type="insert","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)}}},me=de,pe=(a("b0be"),Object(v["a"])(me,r,n,!1,null,null,null));t["a"]=pe.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){return[e._l(t.attrs,(function(t,r){return["Directory"==t.type?a("el-form-item",{key:r,attrs:{label:t.name+" (引用名:["+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){return[e._l(t.attrs,(function(t,r){return["Directory"==t.type?a("div",{key: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;t<e.length;t++)for(var a=0;a<e[t].attrs.length;a++)"Directory"==e[t].attrs[a].type&&this.size++}},immediate:!0,deep:!0}},data:function(){return{size:0}}},s=_,o=(a("7fc6"),a("2877")),i=Object(o["a"])(s,r,n,!1,null,null,null);t["a"]=i.exports},"1b35":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"header-setting"},[a("el-input",{attrs:{placeholder:"请填写表头"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}}),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:e.btnSave}},[e._v("确认保存")])],1)],1)},n=[],_=(a("b0c0"),{emits:["onSetHeader"],props:{headerItemName:{type:String,default:""}},watch:{headerItemName:{handler:function(e){void 0!=e&&(this.form.name=e)},immediate:!0,deep:!0}},data:function(){return{form:{name:""}}},methods:{btnSave:function(e){var t=this;t.$emit("onSetHeader",t.form.name)}}}),s=_,o=(a("7e4c"),a("2877")),i=Object(o["a"])(s,r,n,!1,null,null,null);t["a"]=i.exports},"1c44":function(e,t,a){"use strict";a("8557")},"1c4c":function(e,t,a){"use strict";a.d(t,"i",(function(){return n})),a.d(t,"b",(function(){return _})),a.d(t,"k",(function(){return s})),a.d(t,"d",(function(){return o})),a.d(t,"g",(function(){return i})),a.d(t,"h",(function(){return c})),a.d(t,"a",(function(){return l})),a.d(t,"j",(function(){return u})),a.d(t,"f",(function(){return d})),a.d(t,"c",(function(){return m})),a.d(t,"e",(function(){return p}));var r=a("b775");function n(e){return Object(r["a"])({url:"source/data/categories/",method:"post",data:e})}function _(e){return Object(r["a"])({url:"source/data/categories/create/",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/source/data/category/update",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/source/data/category/delete",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/source/data/category/info",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/source/data/search",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/source/data/create",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/source/data/update",method:"post",data:e})}function d(e){return Object(r["a"])({url:"/source/data/info",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/source/data/delete",method:"post",data:e})}function p(e){return Object(r["a"])({url:"/source/data/find",method:"post",data:e})}},2:function(e,t){},"203e":function(e,t,a){"use strict";a("0fee")},2386:function(e,t,a){},"24d2":function(e,t,a){"use strict";a.d(t,"g",(function(){return n})),a.d(t,"a",(function(){return _})),a.d(t,"i",(function(){return s})),a.d(t,"e",(function(){return o})),a.d(t,"c",(function(){return i})),a.d(t,"h",(function(){return c})),a.d(t,"b",(function(){return l})),a.d(t,"j",(function(){return u})),a.d(t,"f",(function(){return d})),a.d(t,"d",(function(){return m}));var r=a("b775");function n(e){return Object(r["a"])({url:"/project/category/search",method:"post",data:e})}function _(e){return Object(r["a"])({url:"/project/category/create",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/project/category/update",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/project/category/info",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/project/category/delete",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/project/search",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/project/create",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/project/update",method:"post",data:e})}function d(e){return Object(r["a"])({url:"/project/info",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/project/delete",method:"post",data:e})}},"24d50":function(e,t,a){"use strict";a("7af1")},2515:function(e,t,a){},"2a84":function(e,t,a){"use strict";a("d59f")},"2b1e":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-product-attr"},[a("el-tree",{attrs:{data:e.dataList,props:e.defaultProps},on:{"node-click":e.handleNodeClick}})],1)},n=[],_=a("5530"),s=(a("d81d"),a("b0c0"),a("e9c4"),a("b64b"),a("ac1f"),a("841c"),a("c4c8")),o={name:"searchParams",emits:["onInsertProductAttr"],props:{docAttr:{type:Object,default:function(){return{linkProduct:[]}}}},watch:{docAttr:{handler:function(e){void 0==e&&null==e||(this.queryForm.ids=JSON.stringify(e.linkProduct),this.search())},immediate:!0,deep:!0}},data:function(){return{defaultProps:{children:"children",label:"label"},dataList:[],queryForm:{page:1,pageSize:999,status:5,ids:""}}},mounted:function(){},methods:{onClose:function(e){var t=this;t.dialogVisible=!1,t.onBtnSearch()},handleNodeClick:function(e){e&&void 0==e.children&&this.$emit("onInsertProductAttr",e)},search:function(){var e=this;Object(s["h"])(e.queryForm).then((function(t){t&&(e.dataList=t.data.dataList.map((function(e){var t=JSON.parse(e.attrs),a=t.map((function(t){return Object(_["a"])(Object(_["a"])({label:t.name},t),{},{parent:{id:e.id,name:e.name}})}));return{label:e.name,children:a}})))}))},ChangePage:function(e){var t=this;t.queryForm.page=e,t.search()}}},i=o,c=(a("37c8"),a("2877")),l=Object(c["a"])(i,r,n,!1,null,null,null);t["a"]=l.exports},3:function(e,t){},"323b":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"doc-container"},[a("div",{staticClass:"editor-top"},[a("div",{staticClass:"left"},[a("div",{staticClass:"doc"},[a("span",[e._v("当前打开文档:")]),e._v(e._s(""==e.docAttr.title?"新建文档":e.docAttr.title)+" ")]),null!=e.userInfo?a("div",{staticClass:"creator"},[a("span",[e._v("创建者:")]),e._v(e._s(e.userInfo.username)+" ")]):e._e()]),a("div",{staticClass:"right"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onSaveAs}},[e._v("保存文档")]),0==e.docAttr.is_template&&e.docAttr.id>0?a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onSave}},[e._v("更新文档")]):e._e(),a("el-popover",{attrs:{placement:"bottom",trigger:"click"}},[a("el-button",{on:{click:e.onSaveUpload}},[e._v("保存")]),a("el-button",{on:{click:e.onUpload}},[e._v("更新")]),"admin"==e.$store.state.user.name?a("el-button",{staticStyle:{margin:"0 10px"},attrs:{slot:"reference",type:"primary",size:"mini"},slot:"reference"},[e._v("保存并更新模版")]):e._e()],1),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onOpenView}},[e._v("预览导出 ")]),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:"search"},[a("el-input",{attrs:{placeholder:"搜索文档标题"}})],1),a("div",{staticClass:"new-article"},[a("el-collapse",{attrs:{accordion:!0},on:{change:e.handleItemClick},model:{value:e.activeNames,callback:function(t){e.activeNames=t},expression:"activeNames"}},[0==e.showView?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)}}},[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)}}},[e._v(e._s(t.title))])])})),0):e._e(),1==e.showView?a("div",e._l(e.categoryList,(function(t,r){return a("el-collapse-item",{key:r,attrs:{title:t.name,name:t.id}},[a("el-collapse",{directives:[{name:"show",rawName:"v-show",value:t.children,expression:"item.children"}],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,attrs:{title:t.name,name:t.id}},[a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0}},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"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1),a("draggable",{attrs:{options:{group:{name:"itxst",pull:"clone"},sort:!0}},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"},[a("div",[e._v(e._s(t.name))])])})),0)],1)],1)})),1):e._e()],1)],1)]),a("div",{staticClass:"right-sidebarew"},[a("div",{staticClass:"sidebar-item",class:0==e.showView?"active-item":"",on:{click:e.viewDocument}},[e._v(" 查看文档 ")]),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"},[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,onDelete:e.onRemove,onRebuild:e.onRebuild,onSetComs:e.onSetComs}})],1)]),a("div",{staticClass:"editor-option"},[a("div",{staticClass:"editor-menu"},[a("div",{staticClass:"item",class:9999==e.comIndex?"active-item":"",on:{click:function(t){return e.onSetActiveIndex(9999)}}},[a("span",{staticClass:"name"},[e._v("文档属性")])]),a("div",{staticClass:"item",class:9998==e.comIndex?"active-item":"",on:{click:function(t){return e.onSetActiveIndex(9998)}}},[a("span",{staticClass:"name"},[e._v("模块管理")])]),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("属性变量")])])]),9999==e.comIndex?[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(),9999!=e.comIndex&&9998!=e.comIndex&&9997!=e.catalogIndex&&1!=e.AttributeIndex?[a("Attribute",{attrs:{com:e.coms[e.comIndex]},on:{onRefresh:e.initCategoryList}})]: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)],1)},n=[],_=a("e397"),s=_["a"],o=(a("85ec"),a("2877")),i=Object(o["a"])(s,r,n,!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",{staticStyle:{width:"100%"},attrs:{group:"itxst",animation:"300"},on:{add:e.onAdd,update:e.onDragEnd},model:{value:e.comList,callback:function(t){e.comList=t},expression:"comList"}},[a("transition-group",[e._l(e.comList,(function(t,r){return[a("div",{key:r,staticClass:"layers",class:e.comIndex==r?"active-layer":"",attrs:{draggable:""}},[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,onUpdateProdAttr:e.onUpdateProdAttr}})],1),a("div",{staticClass:"label"},[e._v(" "+e._s(t.name)+" "),a("div",{staticClass:"del"},[1!==t.isEdit?a("svg-icon",{staticStyle:{color:"#FFF","margin-right":"10px"},attrs:{"icon-class":"edit"},on:{click:function(t){return e.onEdit(r,1)}}}):a("svg-icon",{staticStyle:{color:"#FFF","margin-right":"10px"},attrs:{"icon-class":"view"},on:{click:function(t){return e.onEdit(r,2)}}}),a("svg-icon",{staticStyle:{color:"#FFF","margin-left":"10px"},attrs:{"icon-class":"delete"},on:{click:function(t){return e.onRemove(r)}}})],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("d81d"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("b76a")),s=a.n(_),o=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()},i=[],c=a("ade3"),l=(a("4de4"),a("d3b7"),a("ac1f"),a("5319"),a("e437"),a("c24d")),u=a("8c7e"),d=a("cc6f");a("8033"),a("c1cf"),d["a"].buildEmpty({licenseKey:"internal-use-in-handsontable",precisionRounding:10,nullDate:{year:1900,month:1,day:1}});var m={name:"table",components:{HotTable:l["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 n=e.replace("bgColor:",""),_="whiteBg";switch(n){case"red":_="redBg";break;case"gray":_="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(_)<0&&(s[0].className+=" "+_):a.cellStyle.push({col:l,row:u,className:_})}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(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(e,"height","auto"),"colWidths","auto"),"allowHtml",!0),"filters",!0),"manualRowResize",!0),"manualColumnResize",!0),"manualRowMove",!0),"manualColumnMove",!0),"formulas",{engine:d["a"]}),"tableClassName","tb-class"),Object(c["a"])(e,"afterOnCellMouseDown",(function(e,a,r){t.currentFocus=a}))),Object(u["a"])()}}},p=m,f=(a("924b"),a("2877")),b=Object(f["a"])(p,o,i,!1,null,null,null),h=b.exports,E=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"},[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)},v=[],O=a("a27d"),g=O["a"],j=(a("7f00"),Object(f["a"])(g,E,v,!1,null,null,null)),D=j.exports,C=a("37de"),k={name:"editor",emits:["onSetActiveIndex","onDelete","onInsert","onLoadArticle","onRebuild","onSetComs"],components:{Table:h,TextArea:D,draggable:s.a,Empty:C["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)))},immediate:!0,deep:!0},comIndex:{handler:function(e){e<=0||(this.comList=this.comList.map((function(e){return e.isEdit=2,e})))},immediate:!0,deep:!0}},data:function(){return{showEditor:!1,operation:"",id:0,comList:[]}},methods:{onUpdateProdAttr:function(e,t,a){this.comList[e].attrs[t].content=a;for(var r=this.comList[e].attrs[t].attrs.name,n=this.comList[e].attrs[t].attrs.type,_=0;_<this.comList.length;_++)for(var s=0;s<this.comList[_].attrs.length;s++)"ProductAttr"==this.comList[_].attrs[s].type&&this.comList[_].attrs[s].attrs.name==r&&this.comList[_].attrs[s].attrs.type==n&&(this.comList[_].attrs[s].content=a);this.$emit("onRebuild",this.comList)},onUpdateAttr:function(e,t,a){this.comList[e].attrs[t].content=a;for(var r=this.comList[e].attrs[t].type,n=this.comList[e].attrs[t].data,_=0;_<this.comList.length;_++)for(var s=0;s<this.comList[_].attrs.length;s++)this.comList[_].attrs[s].type==r&&this.comList[_].attrs[s].id==n&&(this.comList[_].attrs[s].content=a);this.$emit("onRebuild",this.comList)},onRemove:function(e){this.$emit("onDelete",e)},onEdit:function(e,t){this.comList=this.comList.map((function(e){return e.isEdit=2,e})),1==t&&(this.comList[e].isEdit=1,this.onSetActive(e)),this.$emit("onRebuild",this.comList)},onAdd:function(e){e.preventDefault(),e.stopPropagation(),this.$emit("onRebuild",this.comList)},onDragEnd:function(e){e.preventDefault(),e.stopPropagation(),this.$emit("onRebuild",this.comList)},onUpdate:function(e,t){this.coms[e].content=t},onSetActive:function(e){this.$emit("onSetActiveIndex",e)}}},y=k,P=(a("a399"),Object(f["a"])(y,r,n,!1,null,null,null));t["a"]=P.exports},"37c8":function(e,t,a){"use strict";a("7cfb")},"37de":function(e,t,a){"use strict";var r=a("f3c2"),n=a("f746"),_=(a("203e"),a("2877")),s=Object(_["a"])(n["default"],r["a"],r["b"],!1,null,null,null);t["default"]=s.exports},"3cf6":function(e,t,a){},"3f1e":function(e,t,a){},"3fa9":function(e,t,a){},4:function(e,t){},4161:function(e,t,a){},"424e":function(e,t,a){"use strict";a.d(t,"h",(function(){return n})),a.d(t,"e",(function(){return _})),a.d(t,"j",(function(){return s})),a.d(t,"a",(function(){return o})),a.d(t,"g",(function(){return i})),a.d(t,"c",(function(){return c})),a.d(t,"i",(function(){return l})),a.d(t,"b",(function(){return u})),a.d(t,"k",(function(){return d})),a.d(t,"f",(function(){return m})),a.d(t,"d",(function(){return p}));var r=a("b775");function n(e){return Object(r["a"])({url:"/document/search",method:"post",data:e})}function _(e){return Object(r["a"])({url:"/document/export",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/document/update",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/document/create",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/document/info",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/document/delete",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/document/category/search",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/document/category/create",method:"post",data:e})}function d(e){return Object(r["a"])({url:"/document/category/update",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/document/category/info",method:"post",data:e})}function p(e){return Object(r["a"])({url:"/document/category/delete",method:"post",data:e})}},"42e7":function(e,t,a){},4678:function(e,t,a){var r={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c5","./az.js":"485c5","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d7167","./ca.js":"d7167","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df48","./fa.js":"8df48","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b46","./gd.js":"f6b46","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540a","./jv.js":"b540a","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e9","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e9","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function n(e){var t=_(e);return a(t)}function _(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=_,e.exports=n,n.id="4678"},"4b4d":function(e,t,a){"use strict";a("9828")},5:function(e,t){},"5d1d":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-viewer"},[a("div",{ref:"content",staticClass:"content"},[e._l(e.coms,(function(t,r){return[a(e.getComponentType(t.type),{key:r,tag:"component",attrs:{com:t,coms:e.comList,currentIndex:r,isActive:!1},on:{onUpdateData:e.onUpdateData}})]}))],2),a("div",{staticClass:"export"},[a("el-button",{attrs:{type:"primary"},on:{click:e.onExport}},[e._v("导出")])],1)])},n=[],_=a("f587"),s=_["a"],o=(a("87f0"),a("2877")),i=Object(o["a"])(s,r,n,!1,null,null,null);t["a"]=i.exports},6:function(e,t){},"639e":function(e,t,a){"use strict";var r=a("53ca"),n=a("d4ec"),_=a("bee2"),s=(a("fb6a"),a("d3b7"),a("25f0"),function(){function e(){Object(n["a"])(this,e)}return Object(_["a"])(e,[{key:"formatDate",value:function(e){var t=new Date(e),a=t.getFullYear(),r=t.getMonth()+1;r=r<10?"0"+r:r;var n=t.getDate();n=n<10?"0"+n:n;var _=t.getHours();_=_<10?"0"+_:_;var s=t.getMinutes();s=s<10?"0"+s:s;var o=t.getSeconds();return o=o<10?"0"+o:o,a+"-"+r+"-"+n+" "+_+":"+s+":"+o}},{key:"forEach",value:function(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==Object(r["a"])(e)&&(e=[e]),this.isArray(e))for(var a=0,n=e.length;a<n;a++)t.call(null,e[a],a,e);else for(var _ in e)Object.prototype.hasOwnProperty.call(e,_)&&t.call(null,e[_],_,e)}},{key:"isArray",value:function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{key:"getObjClass",value:function(e){return Object.prototype.toString.call(e).slice(8,-1)}},{key:"deepClone",value:function(e){var t,a=this.getObjClass(e);if("Object"===a)t={};else{if("Array"!==a)return e;t=[]}for(var r in e){var n=e[r];t[r]=this.deepClone(n)}return t}},{key:"assiginObj",value:function(e,t){var a=e;if("object"!=Object(r["a"])(e)||"object"!=Object(r["a"])(t)||Object(r["a"])(e))return t;for(var n in t)e.hasOwnProperty(n)?a[n]=this.assiginObj(e[n],t[n]):a[n]=t[n];return a}}])}());new s},6899:function(e,t,a){"use strict";a("9f5d")},"69b2":function(e,t,a){"use strict";a("2515")},"6c9d":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"doc-attr"},[a("el-form",[a("el-form-item",{attrs:{label:"标题:"}},[a("el-input",{staticClass:"input-item",staticStyle:{width:"100%"},attrs:{placeholder:"请填写文档名称"},model:{value:e.attrs.title,callback:function(t){e.$set(e.attrs,"title",t)},expression:"attrs.title"}})],1),a("el-form-item",{attrs:{label:"选择分类:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择所属分类"},model:{value:e.attrs.category_id,callback:function(t){e.$set(e.attrs,"category_id",t)},expression:"attrs.category_id"}},e._l(e.articleCategoryList,(function(e,t){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"适用产品:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{multiple:!0,placeholder:"请选择适用产品"},on:{change:e.onChangeProduct},model:{value:e.attrs.linkProduct,callback:function(t){e.$set(e.attrs,"linkProduct",t)},expression:"attrs.linkProduct"}},e._l(e.productList,(function(e,t){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"适用项目:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{multiple:!0,placeholder:"请选择适用项目"},on:{change:e.onChangeProject},model:{value:e.attrs.linkProject,callback:function(t){e.$set(e.attrs,"linkProject",t)},expression:"attrs.linkProject"}},e._l(e.projectList,(function(e,t){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1)],1)},n=[],_=a("424e"),s=a("c4c8"),o=a("24d2"),i={name:"docAttr",props:{attrs:{type:Object,default:function(){return{category_id:"",title:"",linkProduct:[],linkProject:[]}}}},watch:{attrs:{handler:function(e){},immediate:!0,deep:!0}},data:function(){return{articleCategoryList:[],productList:[],projectList:[]}},created:function(){this.initArticleCategoryList(),this.initProjectList(),this.initGoodsList()},methods:{onChangeProduct:function(e){},onChangeProject:function(e){},initProjectList:function(){var e=this;Object(o["h"])({page:1,pageSize:9999,status:5}).then((function(t){200==t.status&&(e.projectList=t.data.dataList)}))},initGoodsList:function(){var e=this;Object(s["h"])({page:1,pageSize:9999,status:5}).then((function(t){200==t.status&&(e.productList=t.data.dataList)}))},initArticleCategoryList:function(){var e=this;Object(_["i"])({page:1,pageSize:99,status:5}).then((function(t){200==t.status&&(e.articleCategoryList=t.data.dataList)}))}}},c=i,l=(a("71b5"),a("2877")),u=Object(l["a"])(c,r,n,!1,null,null,null);t["a"]=u.exports},7:function(e,t){},"71b5":function(e,t,a){"use strict";a("101d")},"7a34":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.coms.length>0?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",{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))]),a("div",{staticClass:"remove",on:{click:function(t){return e.onRemove(r)}}},[a("svg-icon",{staticStyle:{cursor:"pointer"},attrs:{"icon-class":"delete"}})],1)])]}))],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{}},methods:{datadragEnd:function(e){var t=this;return Object(s["a"])(Object(_["a"])().mark((function a(){var r;return Object(_["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("e77f"),a("2877")),d=Object(u["a"])(l,r,n,!1,null,null,null);t["a"]=d.exports},"7af1":function(e,t,a){},"7cfb":function(e,t,a){},"7e4c":function(e,t,a){"use strict";a("33b9")},"7f00":function(e,t,a){"use strict";a("3f1e")},"7fc6":function(e,t,a){"use strict";a("09ec")},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.replaceData(e.com.content))}})])},n=[],_=a("c7eb"),s=a("1da1"),o=(a("4de4"),a("b0c0"),a("a9e3"),a("d3b7"),a("4d63"),a("ac1f"),a("2c3e"),a("25f0"),a("466d"),a("5319"),a("1c4c")),i={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){console.log("val",e)},immediate:!0,deep:!0}},data:function(){return{content:""}},methods:{replaceData:function(e){for(var t=0;t<this.com.attrs.length;t++){var a=this.com.attrs[t].id;"variable"==this.com.attrs[t].type?e=e.replace("{{"+this.com.attrs[t].id+"}}",'<input type="text" class="text-input-box" value="'+this.com.attrs[t].content+'">'):"Directory"==this.com.attrs[t].type?(e=e.replace("<p>{{"+a+"}}</p>","<h1>"+this.com.attrs[t].content+"</h1>"),e=e.replace("<div>{{"+a+"}}</div>","<h1>"+this.com.attrs[t].content+"</h1>"),e=e.replace("<span>{{"+a+"}}</span>","<h1>"+this.com.attrs[t].content+"</h1>")):e=e.replace("{{"+this.com.attrs[t].id+"}}",this.com.attrs[t].content)}return e},analysisformula:function(e){var t=this;return Object(s["a"])(Object(_["a"])().mark((function a(){var r,n,s,o,i,c,l;return Object(_["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,n=/(\[.*?\]){3}/,s=e.formula,o=new RegExp(n);case 4:if(i=s.match(o),null!=i){a.next=8;break}return a.abrupt("break",18);case 8:return c=i[0],a.next=11,r.getformulaData(c);case 11:return l=a.sent,a.next=14,r.getRemote(l);case 14:l=a.sent,s=s.replace(c,"("+parseFloat(l)+")"),a.next=4;break;case 18:return a.abrupt("return",s);case 19:case"end":return a.stop()}}),a)})))()},getformulaData:function(e){var t=this;return Object(s["a"])(Object(_["a"])().mark((function a(){var r,n,s,o,i;return Object(_["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(r=t,n=/\[(.*?)\]\[(.*?)\]\[(.*?)\]/,s=new RegExp(n),o=e.match(s),i=0,"T"!=o[1]){a.next=9;break}return a.next=8,r.getModuleData(o[2],o[3]);case 8:i=a.sent;case 9:return a.abrupt("return",i);case 10:case"end":return a.stop()}}),a)})))()},getRemote:function(e){var t=this;return Object(s["a"])(Object(_["a"])().mark((function a(){var r,n,s,o,i,c,l;return Object(_["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,n=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,s=new RegExp(n);case 3:if(o=e.match(s),null!=o){a.next=7;break}return a.abrupt("break",17);case 7:if("R"!=o[1]){a.next=15;break}return i=o[4],i=o[4].split(","),a.next=12,r.getRemoteData(o[2],o[3],i[0],i[1]);case 12:c=a.sent,l=o[0],e=e.replace(l,"("+parseFloat(c)+")");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(s["a"])(Object(_["a"])().mark((function a(){var r,n,s,o,i,c,l;return Object(_["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=t,n=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,s=new RegExp(n);case 3:if(o=e.match(s),null!=o){a.next=7;break}return a.abrupt("break",17);case 7:if("R"!=o[1]){a.next=15;break}return i=o[4],i=o[4].split(","),a.next=12,r.getRemoteData(o[2],o[3],i[0],i[1]);case 12:c=a.sent,l=o[0],e=e.replace(l,parseFloat(c));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 n=this;return Object(s["a"])(Object(_["a"])().mark((function s(){var i,c,l;return Object(_["a"])().wrap((function(_){while(1)switch(_.prev=_.next){case 0:return n,0,i={code:e,sheetName:t,row:a,col:r},_.next=6,Object(o["e"])(i);case 6:if(c=_.sent,200!=c.status){_.next=12;break}if(console.log("result:",c.data),l=parseFloat(c.data.result),isNaN(l)){_.next=12;break}return _.abrupt("return",l);case 12:return _.abrupt("return",0);case 13:case"end":return _.stop()}}),s)})))()},getModuleData:function(e,t){var a=this;return Object(s["a"])(Object(_["a"])().mark((function r(){var n,s,o,i;return Object(_["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=a,s=n.coms.filter((function(t){return t.code==e})),!(s.length>0)){r.next=8;break}if(o=s[0].attrs.filter((function(e){return e.name==t})),!(o.length>0)){r.next=8;break}if(i=parseFloat(o[0].content),isNaN(i)){r.next=8;break}return r.abrupt("return",i);case 8:return r.abrupt("return",0);case 9:case"end":return r.stop()}}),r)})))()}}},c=i,l=(a("9597"),a("2877")),u=Object(l["a"])(c,r,n,!1,null,null,null);t["a"]=u.exports},8557:function(e,t,a){},"85ec":function(e,t,a){"use strict";a("967d")},"87f0":function(e,t,a){"use strict";a("3cf6")},9:function(e,t){},"924b":function(e,t,a){"use strict";a("42e7")},9597:function(e,t,a){"use strict";a("e373")},"967d":function(e,t,a){},9828:function(e,t,a){},"98f0":function(e,t,a){},"9f5d":function(e,t,a){},a27d:function(module,__webpack_exports__,__webpack_require__){"use strict";var C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("c7eb"),C_Users_0_Desktop_fronted_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_function_name_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("4d63"),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("2c3e"),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("25f0"),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("466d"),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_13__),_api_sourceData__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("1c4c");__webpack_exports__["a"]={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(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function a(){var r,n;return Object(C_Users_0_Desktop_fronted_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,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:n=a.sent,r.content=n,r.$nextTick((function(){r.bindEvents()})),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:"800px"},content:"",editor:null,loading:!1,progress:0,isEditing:!1}},mounted:function(){},methods:{replaceData:function replaceData(data){var _this3=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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:console.log(_this3.com.attrs),_this=_this3,_loop=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function _loop(){var attrId,item,dataItem,selectHtml,_item,prodAttrId,_dataItem,_selectHtml,formual,result,directoryContent,_attrId,directoryRegex;return Object(C_Users_0_Desktop_fronted_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='<select id="'+attrId+'" data-index="'+i+'" class="text-input-box">',l=0;l<dataItem.length;l++)item.content==dataItem[l]?selectHtml+='<option value="'+dataItem[l]+'" selected>'+dataItem[l]+"</option>":selectHtml+='<option value="'+dataItem[l]+'">'+dataItem[l]+"</option>";selectHtml+="</select>",data=data.replace("{{"+item.id+"}}",selectHtml)}else data=data.replace("{{"+attrId+"}}",'<input type="text" id="'+attrId+'" data-index="'+i+'" class="text-input-box" value="'+_this.com.attrs[i].content+'">');_context2.next=32;break;case 6:if("ProductAttr"!=_this.com.attrs[i].type){_context2.next=13;break}if(_item=_this.com.attrs[i],prodAttrId=_item.id+"_"+i,""==_item.content&&(_item.content=_item.attrs.value),1==_item.attrs.type)data=data.replace("{{"+_item.id+"}}",'<input type="text" id="'+prodAttrId+'" data-index="'+i+'" class="text-input-box" value="'+_item.content+'">');else{for(_dataItem=_item.attrs.valueItems.split(","),_selectHtml='<select id="'+prodAttrId+'" data-index="'+i+'" class="text-input-box">',l=0;l<_dataItem.length;l++)_item.content==_dataItem[l]?_selectHtml+='<option value="'+_dataItem[l]+'" selected>'+_dataItem[l]+"</option>":_selectHtml+='<option value="'+_dataItem[l]+'">'+_dataItem[l]+"</option>";_selectHtml+="</select>",data=data.replace("{{"+_item.id+"}}",_selectHtml)}_context2.next=32;break;case 13:if("formual"!=_this.com.attrs[i].type){_context2.next=24;break}return _context2.next=16,_this.analysisFormual(_this.com.attrs[i]);case 16:return formual=_context2.sent,_context2.next=19,_this.getRemote(formual);case 19:formual=_context2.sent,_this.com.attrs[i].content=eval(formual),data=data.replace("{{"+attrId+"}}",eval(formual)),_context2.next=32;break;case 24:if("sourceData"!=_this.com.attrs[i].type){_context2.next=31;break}return _context2.next=27,_this.getRemote1(_this.com.attrs[i].formula);case 27:result=_context2.sent,data=data.replace("{{"+attrId+"}}",result),_context2.next=32;break;case 31:"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),n=a.substring(t+e.length),_=r.match(/<([^>]+)>$/),s=n.match(/^<\/([^>]+)>/);return _&&s&&_[1]===s[1]?"<h1>".concat(directoryContent,"</h1>"):directoryContent}))):data=data.replace("{{"+attrId+"}}",_this.com.attrs[i].content);case 32:case"end":return _context2.stop()}}),_loop)})),i=0;case 4:if(!(i<_this.com.attrs.length)){_context3.next=9;break}return _context3.delegateYield(_loop(),"t0",6);case 6:i++,_context3.next=4;break;case 9:return _context3.abrupt("return",data);case 10:case"end":return _context3.stop()}}),_callee2)})))()},bindEvents:function(){for(var e=this,t=0;t<e.com.attrs.length;t++){var a=e.com.attrs[t].id,r=e.com.attrs[t];if("variable"==e.com.attrs[t].type){var n=e.$el.querySelector("#"+a);n&&(2==r.data.value_type?n.addEventListener("change",e.handleInput):n.addEventListener("blur",e.handleInput))}else if("ProductAttr"==e.com.attrs[t].type){var _=r.id+"_"+t,s=e.$el.querySelector("#"+_);s&&(1==r.attrs.type?s.addEventListener("blur",e.handleInputProduct):s.addEventListener("change",e.handleChangeProduct))}}},analysisFormual:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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=/(\[.*?\]){3}/,_=e.formula,s=new RegExp(n);case 4:if(o=_.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)),_=_.replace(i,"(0)")):_=_.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),_=_.replace(i,"(0)");case 20:a.next=4;break;case 22:return a.abrupt("return",_);case 23:case"end":return a.stop()}}),a,null,[[9,16]])})))()},getFormualData:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n),s=e.match(_),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)})))()},getRemote:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n);case 3:if(s=e.match(_),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)})))()},getRemote1:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n);case 3:if(s=e.match(_),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=isNaN(i)?e.replace(c,'"'.concat(i,'"')):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)})))()},onFocus:function(){this.isEditing=!0},onBlur:function(){this.isEditing=!1},getRemoteData:function(e,t,a,r){var n=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function _(){var s,o,i;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(_){while(1)switch(_.prev=_.next){case 0:return n,s=0,o={code:e,sheetName:t,row:a,col:r},_.prev=3,_.next=6,Object(_api_sourceData__WEBPACK_IMPORTED_MODULE_14__["e"])(o);case 6:i=_.sent,200==i.status&&(s=i.data.result,"string"!==typeof s||isNaN(s)||(s=parseFloat(s))),_.next=13;break;case 10:_.prev=10,_.t0=_["catch"](3),console.error("获取远程数据错误:",_.t0);case 13:return _.abrupt("return",s);case 14:case"end":return _.stop()}}),_,null,[[3,10]])})))()},getModuleData:function(e,t){var a=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n=a,_=n.coms.filter((function(t){return t.name==e})),!(_.length>0)){r.next=6;break}if(s=_[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)})))()},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)},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)}}}},a399:function(e,t,a){"use strict";a("d4f2")},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"),n=e.querySelector(".el-dialog");r.style.cssText+=";cursor:move;",n.style.cssText+=";top:0px;";var _=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=n.offsetWidth,i=n.offsetHeight,c=document.body.clientWidth,l=document.body.clientHeight,u=n.offsetLeft,d=c-n.offsetLeft-o,m=n.offsetTop,p=l-n.offsetTop-i,f=_(n,"left"),b=_(n,"top");f.includes("%")?(f=+document.body.clientWidth*(+f.replace(/\%/g,"")/100),b=+document.body.clientHeight*(+b.replace(/\%/g,"")/100)):(f=+f.replace(/\px/g,""),b=+b.replace(/\px/g,"")),document.onmousemove=function(e){var r=e.clientX-t,_=e.clientY-s;-r>u?r=-u:r>d&&(r=d),-_>m?_=-m:_>p&&(_=p),n.style.cssText+=";left:".concat(r+f,"px;top:").concat(_+b,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null}}}},n=function(e){e.directive("el-drag-dialog",r)};window.Vue&&(window["el-drag-dialog"]=r,Vue.use(n)),r.install=n;t["a"]=r},b0be:function(e,t,a){"use strict";a("2386")},c4c8:function(e,t,a){"use strict";a.d(t,"i",(function(){return n})),a.d(t,"b",(function(){return _})),a.d(t,"k",(function(){return s})),a.d(t,"e",(function(){return o})),a.d(t,"d",(function(){return i})),a.d(t,"g",(function(){return c})),a.d(t,"h",(function(){return l})),a.d(t,"a",(function(){return u})),a.d(t,"j",(function(){return d})),a.d(t,"f",(function(){return m})),a.d(t,"c",(function(){return p}));var r=a("b775");function n(e){return Object(r["a"])({url:"/product/category/search",method:"post",data:e})}function _(e){return Object(r["a"])({url:"/product/category/create",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/product/category/update",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/product/category/info",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/product/category/delete",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/product/category/all",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/product/search",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/product/create",method:"post",data:e})}function d(e){return Object(r["a"])({url:"/product/update",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/product/info",method:"post",data:e})}function p(e){return Object(r["a"])({url:"/product/delete",method:"post",data:e})}},c621:function(e,t,a){"use strict";a.d(t,"j",(function(){return n})),a.d(t,"e",(function(){return _})),a.d(t,"b",(function(){return s})),a.d(t,"l",(function(){return o})),a.d(t,"g",(function(){return i})),a.d(t,"d",(function(){return c})),a.d(t,"i",(function(){return l})),a.d(t,"h",(function(){return u})),a.d(t,"c",(function(){return d})),a.d(t,"a",(function(){return m})),a.d(t,"k",(function(){return p})),a.d(t,"f",(function(){return f}));var r=a("b775");function n(e){return Object(r["a"])({url:"/template/category/search",method:"post",data:e})}function _(e){return Object(r["a"])({url:"/template/category/all",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/template/category/create",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/template/category/update",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/template/category/info",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/template/category/delete",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/template/search",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/template/info",method:"post",data:e})}function d(e){return Object(r["a"])({url:"/template/delete",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/template/create",method:"post",data:e})}function p(e){return Object(r["a"])({url:"/template/update",method:"post",data:e})}function f(e){return Object(r["a"])({url:"/template/category/allList",method:"post",data:e})}},c9e6:function(e,t){},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),n=t.match(r),_=e+"="+n[2]+"."+n[3],s=n[4];return s=n[4].split(","),_+="."+String.fromCharCode(65+parseInt(s[1]))+(parseInt(s[0])+1),_},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["k"])(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["f"])();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(_["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(_["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,n;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t,a.next=3,Object(u["i"])({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 n=r.data.dataList.map((function(e){return e.attrs=JSON.parse(e.attrs),e})),a.abrupt("return",n);case 8:case"end":return a.stop()}}),a)})))()}}}),m=d,p=(a("69b2"),a("2877")),f=Object(p["a"])(m,r,n,!1,null,null,null);t["a"]=f.exports},d4f2:function(e,t,a){},d59f:function(e,t,a){},e373:function(e,t,a){},e397:function(module,__webpack_exports__,__webpack_require__){"use strict";var C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("2909"),C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("5530"),C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("b85c"),C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("c7eb"),C_Users_0_Desktop_fronted_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_object_keys_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("4d63"),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("2c3e"),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("25f0"),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("466d"),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("841c"),core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_19__),_api_sourceData__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("1c4c"),_utils_fun__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("639e"),_api_document__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("424e"),_com_menus__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("1684"),_com_editor__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("35d5"),_com_components_Attribute__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("d4a5"),_com_components_Attribute_attributeVar_index_vue__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("f6f9"),_com_components_ProductAttr__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("2b1e"),_api_template__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("c621"),_com_components_Attribute_docAttr__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("6c9d"),_com_components_Attribute_comList__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("7a34"),_com_components_Attribute_Directory__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("1995"),_api_api__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("4ec3"),_com_view__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("5d1d"),_directive_el_drag_dialog__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("a888"),vuedraggable__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__("b76a"),vuedraggable__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(vuedraggable__WEBPACK_IMPORTED_MODULE_35__),html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__("4f15"),html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_36___default=__webpack_require__.n(html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_36__),axios__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__("bc3a"),axios__WEBPACK_IMPORTED_MODULE_37___default=__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_37__);__webpack_exports__["a"]={name:"create",components:{menus:_com_menus__WEBPACK_IMPORTED_MODULE_23__["a"],editor:_com_editor__WEBPACK_IMPORTED_MODULE_24__["a"],Attribute:_com_components_Attribute__WEBPACK_IMPORTED_MODULE_25__["a"],comList:_com_components_Attribute_comList__WEBPACK_IMPORTED_MODULE_30__["a"],docAttr:_com_components_Attribute_docAttr__WEBPACK_IMPORTED_MODULE_29__["a"],ViewForm:_com_view__WEBPACK_IMPORTED_MODULE_33__["a"],ProductAttr:_com_components_ProductAttr__WEBPACK_IMPORTED_MODULE_27__["a"],Directory:_com_components_Attribute_Directory__WEBPACK_IMPORTED_MODULE_31__["a"],draggable:vuedraggable__WEBPACK_IMPORTED_MODULE_35___default.a,attributeVar:_com_components_Attribute_attributeVar_index_vue__WEBPACK_IMPORTED_MODULE_26__["a"]},directives:{elDragDialog:_directive_el_drag_dialog__WEBPACK_IMPORTED_MODULE_34__["a"]},data:function(){return{activeNames:"-1",nestedActiveNames:[],articleList:[],templateList:[],categoryList:[],coms:[],comIndex:0,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}},watch:{coms:{handler:function(e,t){this.replaceData(e)},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_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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,e.searchArticle(),t.next=4,e.initCategoryList();case 4:return t.next=6,e.initCurrentUser();case 6:e.articleId=e.$route.query.articleId,r=e.$route.query.templateId,r>0&&a.loadTemplateInfo(r),a.isAdmin=a.userInfo.roleInfo.is_admin;case 10:case"end":return t.stop()}}),t)})))()},methods:{replaceData:function replaceData(data){var _this3=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function _callee2(){var _iterator,_step,item,_iterator2,_step2,el,attrId,formual;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_iterator=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(_this3.coms),_context2.prev=1,_iterator.s();case 3:if((_step=_iterator.n()).done){_context2.next=37;break}item=_step.value,_iterator2=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(item.attrs),_context2.prev=6,_iterator2.s();case 8:if((_step2=_iterator2.n()).done){_context2.next=27;break}if(el=_step2.value,attrId=el.id,"formual"!=el.type){_context2.next=25;break}return _context2.prev=12,_context2.next=15,_this3.analysisFormual(el);case 15:return formual=_context2.sent,_context2.next=18,_this3.getRemote(formual);case 18:formual=_context2.sent,el.content=eval(formual),_context2.next=25;break;case 22:_context2.prev=22,_context2.t0=_context2["catch"](12),console.error("处理公式时出错:",_context2.t0);case 25:_context2.next=8;break;case 27:_context2.next=32;break;case 29:_context2.prev=29,_context2.t1=_context2["catch"](6),_iterator2.e(_context2.t1);case 32:return _context2.prev=32,_iterator2.f(),_context2.finish(32);case 35:_context2.next=3;break;case 37:_context2.next=42;break;case 39:_context2.prev=39,_context2.t2=_context2["catch"](1),_iterator.e(_context2.t2);case 42:return _context2.prev=42,_iterator.f(),_context2.finish(42);case 45:return console.log("this.coms",_this3.coms),_context2.abrupt("return",data);case 47:case"end":return _context2.stop()}}),_callee2,null,[[1,39,42,45],[6,29,32,35],[12,22]])})))()},analysisFormual:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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=/(\[.*?\]){3}/,_=e.formula,s=new RegExp(n);case 4:if(o=_.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)),_=_.replace(i,"(0)")):_=_.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),_=_.replace(i,"(0)");case 20:a.next=4;break;case 22:return a.abrupt("return",_);case 23:case"end":return a.stop()}}),a,null,[[9,16]])})))()},getFormualData:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n),s=e.match(_),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_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n=a,_=n.coms.filter((function(t){return t.name==e})),!(_.length>0)){r.next=6;break}if(s=_[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_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n);case 3:if(s=e.match(_),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 n=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function _(){var s,o,i;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().wrap((function(_){while(1)switch(_.prev=_.next){case 0:return n,s=0,o={code:e,sheetName:t,row:a,col:r},_.prev=3,_.next=6,Object(_api_sourceData__WEBPACK_IMPORTED_MODULE_20__["e"])(o);case 6:i=_.sent,200==i.status&&(s=i.data.result,"string"!==typeof s||isNaN(s)||(s=parseFloat(s))),_.next=13;break;case 10:_.prev=10,_.t0=_["catch"](3),console.error("获取远程数据错误:",_.t0);case 13:return _.abrupt("return",s);case 14:case"end":return _.stop()}}),_,null,[[3,10]])})))()},handleItemVal:function(e){this.$forceUpdate()},handleItemClick:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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_28__["j"])({parent_id:e});case 7:if(n=a.sent,200==n.status&&0!=n.data.length){a.next=10;break}return a.abrupt("return");case 10:r.children=n.data,_=0;case 12:if(!(_<r.children.length)){a.next=19;break}return a.next=15,t.getTemplateList(r.children[_].id);case 15:r.children[_].dataList=a.sent;case 16:_++,a.next=12;break;case 19:a.next=24;break;case 21:a.prev=21,a.t0=a["catch"](4),console.error("Error fetching template categories:",a.t0);case 24:t.$set(r,"activeChildren",r.activeChildren||[]);case 25:case"end":return a.stop()}}),a,null,[[4,21]])})))()},viewDocument:function(){this.showView=0},viewModule:function(){this.showView=1},uptadeVariable:function(e){var t,a=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(this.coms);try{for(a.s();!(t=a.n()).done;){var r,n=t.value,_=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(n.attrs);try{for(_.s();!(r=_.n()).done;){var s=r.value;"variable"===s.type&&s.data.id==e.id&&(s.content=e.value)}}catch(o){_.e(o)}finally{_.f()}}}catch(o){a.e(o)}finally{a.f()}},uptadeSearch:function(){var e=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function t(){var a,r,n,_,s,o;return Object(C_Users_0_Desktop_fronted_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:a=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(e.coms);try{for(a.s();!(r=a.n()).done;){n=r.value,_=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(n.attrs);try{for(_.s();!(s=_.n()).done;)o=s.value,o.type}catch(i){_.e(i)}finally{_.f()}}}catch(i){a.e(i)}finally{a.f()}case 2:case"end":return t.stop()}}),t)})))()},retrieval:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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 t.loading=!0,a.prev=1,a.next=4,axios__WEBPACK_IMPORTED_MODULE_37___default.a.post("http://58.246.234.210:7860/api/v1/run/3f84a841-cefd-44b3-9555-568cc3b6c2d2?stream=false",{input_value:e.search,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 4:r=a.sent,200===r.status&&(n=r.data.outputs[0].outputs[0].results.message.data.text,e.content=n),a.next=12;break;case 8:a.prev=8,a.t0=a["catch"](1),console.error("Error during retrieval:",a.t0),t.$message.error("检索失败,请稍后重试");case 12:return a.prev=12,t.loading=!1,a.finish(12);case 15:case"end":return a.stop()}}),a,null,[[1,8,12,15]])})))()},loadTemplateInfo:function(e){var t=this,a={id:e};Object(_api_template__WEBPACK_IMPORTED_MODULE_28__["h"])(a).then((function(e){200==e.status&&(e.data.attrs=JSON.parse(e.data.attrs),t.coms=[e.data])}))},onExport:function(e){var t=this;t.comIndex=-1;t.$refs.tabHtml.innerHTML},onOpenView:function(e){console.log("this.coms",this.coms),this.showViewForm=!0},onClose:function(){window.close()},loadArticle:function(e){var t=this;Object(_api_document__WEBPACK_IMPORTED_MODULE_22__["g"])({id:e}).then((function(e){200==e.status&&t.onLoadArticle(e.data)}))},handleDragStart:function(e){var t={};if("article"==e.target.dataset.type){var a=e.target.dataset.index;t={optType:e.target.dataset.type,item:this.articleList[a]}}else{var r=e.target.dataset.index,n=e.target.dataset.subIndex,_=this.categoryList[r].dataList[n];delete _.category,t=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["a"])({},_),{},{optType:e.target.dataset.type,key:"addNew",attrs:JSON.parse(_.attrs)})}e.dataTransfer.setData("item",JSON.stringify(t)),this.operation="drag"},onRebuild:function(e){var t=this;t.coms=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0__["a"])(e)},initCurrentUser:function(){var e=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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_api__WEBPACK_IMPORTED_MODULE_32__["a"])();case 3:if(r=t.sent,200==r.status){t.next=6;break}return t.abrupt("return");case 6:a.userInfo=r.data;case 7:case"end":return t.stop()}}),t)})))()},onLoadArticle:function(e){var t=this;t.docAttr={id:e.id,category_id:1*e.category_id,title:e.title,content:"",status:e.status,is_template:e.is_template,linkProduct:e.linkProduct,links:e.links,linkProject:e.linkProject,projects:e.projects},t.coms=JSON.parse(e.data),console.log(t.coms),this.uptadeSearch()},onTemplateInfo:function(e){var t=this;t.docAttr={id:e.id,category_id:1*e.category_id,title:e.title,content:"",status:e.status,is_template:e.is_template,linkProduct:e.linkProduct,links:e.links,linkProject:e.linkProject,projects:e.projects},t.coms=JSON.parse(e.data),console.log(JSON.parse(e.data)),this.uptadeSearch()},onRemove:function(e){this.coms.splice(e,1)},onCatalogIndex:function(e){var t=this;this.catalogIndex=e,9999!=this.comIndex&&9998!=this.comIndex&&1!=this.AttributeIndex||(this.comIndex=0,this.AttributeIndex=0),this.$nextTick((function(){t.$forceUpdate()}))},onSetActiveIndex:function(e){this.comIndex=e,9999!=this.comIndex&&9998!=this.comIndex&&9997!=this.catalogIndex||(this.catalogIndex=0,this.AttributeIndex=0)},onAttributeIndex:function(e){this.AttributeIndex=e,9999!=this.comIndex&&9998!=this.comIndex&&9997!=this.catalogIndex||(this.catalogIndex=0,this.comIndex=0)},onSaveAs:function(e){var t=this;t.docAttr.id="",t.onSave(e)},onSave:function(e){var t=this;t.coms.length<=0?t.$alert("增加组件"):""==t.docAttr.category_id||t.docAttr.category_id<=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=0,t.docAttr.user_name=t.$store.state.user.name,t.docAttr.user_id=t.$store.state.user.id,t.docAttr.id>0?Object(_api_document__WEBPACK_IMPORTED_MODULE_22__["j"])(t.docAttr).then((function(e){200==e.status&&(t.docAttr.id=e.data,t.$alert("文档更新成功"),t.searchArticle())})):Object(_api_document__WEBPACK_IMPORTED_MODULE_22__["a"])(t.docAttr).then((function(e){200==e.status&&(t.docAttr.id=e.data,t.$alert("文档保存成功"),t.searchArticle())}))):t.$alert("请填写文档标题")},onUpload:function(){var e=this;e.coms.length<=0?e.$alert("增加组件"):""==e.docAttr.category_id||e.docAttr.category_id<=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_22__["j"])(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.category_id||t.docAttr.category_id<=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_22__["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_fronted_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],n=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["a"])({},r),{},{attrs:JSON.parse(r.attrs)});delete n.category,a.coms.push(n),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"ai":t.insertAI(e);break}},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),console.log(a.attrs),"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),n={type:"Directory",id:r,name:"目录信息",intro:"目录信息",content:"目录信息"};a.attrs.push(n),console.log(t.coms),t.insertCmd={content:"<div>{{"+r+"}}</div>"}},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:"<div>{{"+a.id+"}}</div>"})},insertArticle:function(){var e=this;e.coms.push({type:"TextArea",lay_id:"textArea",code:"模块名",name:"图文",intro:"图文介绍",isEdit:2,content:"请填写内容",attrs:[]}),e.comIndex=e.coms.length-1},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_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__["a"])().mark((function t(){var a,r,n;return Object(C_Users_0_Desktop_fronted_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_28__["j"])({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,n=0;case 8:if(!(n<a.categoryList.length)){t.next=15;break}return t.next=11,a.getTemplateList(a.categoryList[n].id);case 11:a.categoryList[n].dataList=t.sent;case 12:n++,t.next=8;break;case 15:case"end":return t.stop()}}),t)})))()},getTemplateList:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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 t,a.next=3,Object(_api_template__WEBPACK_IMPORTED_MODULE_28__["i"])({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 n=r.data.dataList.map((function(e){return e.attrs=JSON.parse(e.attrs),e})),a.abrupt("return",n);case 8:case"end":return a.stop()}}),a)})))()},searchArticle:function(){var e=this;Object(_api_document__WEBPACK_IMPORTED_MODULE_22__["h"])({page:1,pageSize:99}).then((function(t){200==t.status&&(e.articleList=t.data.dataList.filter((function(e){return 0==e.is_template})),e.templateList=t.data.dataList.filter((function(e){return 1==e.is_template})))}))}}}},e77f:function(e,t,a){"use strict";a("4161")},f277:function(e,t,a){"use strict";a("98f0")},f3c2:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return n}));var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-empty"})},n=[]},f587:function(module,__webpack_exports__,__webpack_require__){"use strict";var C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("c7eb"),C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("2909"),C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("b85c"),C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("1da1"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("a15b"),core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("e9c4"),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("4d63"),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("2c3e"),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("25f0"),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("466d"),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_esnext_string_replace_all_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("ad9d"),core_js_modules_esnext_string_replace_all_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_esnext_string_replace_all_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_19__),_api_document__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("424e"),_components_TextView__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("8475"),html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("4f15"),html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(html_docx_js_dist_html_docx__WEBPACK_IMPORTED_MODULE_22__),file_saver__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("21a6"),file_saver__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(file_saver__WEBPACK_IMPORTED_MODULE_23__),jspdf__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("8baf"),_api_sourceData__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("1c4c"),html_to_docx__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("c5158");__webpack_exports__["a"]={name:"Viewer",components:{TextArea:_components_TextView__WEBPACK_IMPORTED_MODULE_21__["a"]},props:{id:{type:Number,default:0},coms:{type:Array,default:null},docAttr:{type:Object,default:function(){return{title:""}}}},watch:{coms:{handler:function(e){null!=e&&(this.comList=JSON.parse(JSON.stringify(e)),console.log("comList",this.comList),this.replaceData(e))},immediate:!0,deep:!0}},data:function(){return{comList:[],content:""}},methods:{replaceData:function replaceData(data){var _this2=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function _callee(){var _iterator,_step,item,_iterator2,_step2,el,attrId,formual;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_iterator=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(_this2.comList),_context.prev=1,_iterator.s();case 3:if((_step=_iterator.n()).done){_context.next=37;break}item=_step.value,_iterator2=Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__["a"])(item.attrs),_context.prev=6,_iterator2.s();case 8:if((_step2=_iterator2.n()).done){_context.next=27;break}if(el=_step2.value,attrId=el.id,"formual"!=el.type){_context.next=25;break}return _context.prev=12,_context.next=15,_this2.analysisFormual(el);case 15:return formual=_context.sent,_context.next=18,_this2.getRemote(formual);case 18:formual=_context.sent,el.content=eval(formual),_context.next=25;break;case 22:_context.prev=22,_context.t0=_context["catch"](12),console.error("处理公式时出错:",_context.t0);case 25:_context.next=8;break;case 27:_context.next=32;break;case 29:_context.prev=29,_context.t1=_context["catch"](6),_iterator2.e(_context.t1);case 32:return _context.prev=32,_iterator2.f(),_context.finish(32);case 35:_context.next=3;break;case 37:_context.next=42;break;case 39:_context.prev=39,_context.t2=_context["catch"](1),_iterator.e(_context.t2);case 42:return _context.prev=42,_iterator.f(),_context.finish(42);case 45:return _this2.$emit("update:coms",Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__["a"])(_this2.comList)),_context.abrupt("return",data);case 47:case"end":return _context.stop()}}),_callee,null,[[1,39,42,45],[6,29,32,35],[12,22]])})))()},analysisFormual:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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=/(\[.*?\]){3}/,_=e.formula,s=new RegExp(n);case 4:if(o=_.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)),_=_.replace(i,"(0)")):_=_.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),_=_.replace(i,"(0)");case 20:a.next=4;break;case 22:return a.abrupt("return",_);case 23:case"end":return a.stop()}}),a,null,[[9,16]])})))()},getFormualData:function(e){var t=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n),s=e.match(_),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_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n=a,_=n.comList.filter((function(t){return t.name==e})),!(_.length>0)){r.next=6;break}if(s=_[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_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__["a"])(Object(C_Users_0_Desktop_fronted_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_fronted_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(n);case 3:if(s=e.match(_),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 n=this;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__["a"])(Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().mark((function _(){var s,o,i;return Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__["a"])().wrap((function(_){while(1)switch(_.prev=_.next){case 0:return n,s=0,o={code:e,sheetName:t,row:a,col:r},_.prev=3,_.next=6,Object(_api_sourceData__WEBPACK_IMPORTED_MODULE_25__["e"])(o);case 6:i=_.sent,200==i.status&&(s=i.data.result,"string"!==typeof s||isNaN(s)||(s=parseFloat(s))),_.next=13;break;case 10:_.prev=10,_.t0=_["catch"](3),console.error("获取远程数据错误:",_.t0);case 13:return _.abrupt("return",s);case 14:case"end":return _.stop()}}),_,null,[[3,10]])})))()},getComponentType:function(e){return"textarea"===e?_components_TextView__WEBPACK_IMPORTED_MODULE_21__["a"]:e},onUpdateData:function(e,t){this.comList[e].content=t,this.rebuildContent(),this.$emit("update:coms",Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__["a"])(this.comList))},rebuildContent:function(){this.content=this.comList.map((function(e){return e.content})).join(""),console.log(this.content)},onExport:function(){var e=this;this.$emit("update:coms",Object(C_Users_0_Desktop_fronted_node_modules_babel_runtime_helpers_esm_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__["a"])(this.comList));var t=this.$refs.content.cloneNode(!0);t.querySelectorAll('input[type="text"]').forEach((function(e){var t=document.createElement("span");t.textContent=e.value,e.parentNode.replaceChild(t,e)})),console.log(t);var a='<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><p class="header1"></p> '.concat(t.innerHTML," </body></html>");a=a.replaceAll("<table ",'<table style="border-collapse: collapse;" ').replaceAll("<td>",'<td style="border: 1px solid black;">'),Object(_api_document__WEBPACK_IMPORTED_MODULE_20__["e"])({content:a,title:this.docAttr.title}).then((function(t){if(200==t.status){var a=document.createElement("a");a.href=t.data.file_path,a.download=t.data.file_name,document.body.appendChild(a),a.click(),document.body.removeChild(a)}else e.$alert(t.errMsg)}))}}}},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.name+" (引用名:["+t.id+"])"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"sub.content"}})],1)]:e._e(),"formual"==t.type?[a("el-form-item",{attrs:{label:t.name+" (引用名:["+t.id+"])"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.formula,callback:function(a){e.$set(t,"formula",a)},expression:"sub.formula"}})],1)]:e._e(),"sourceData"==t.type?[a("el-form-item",{attrs:{label:t.name+" (引用名:["+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("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 this.processedAttrs}},mounted:function(){this.initCategoryList(),this.com&&this.com.content&&this.processContent()},methods:{isTextAreaType:function(e){return!["pager","constant","attr","formual","sourceData","Directory"].includes(e)},extractChineseTemplates:function(e){var t,a=/\{\{(.*?)\}\}/g,r=/[\u4e00-\u9fa5]/,n=[];while(null!==(t=a.exec(e)))r.test(t[1])&&n.push(t[1].trim());return n},processContent:function(){if(this.com&&this.com.content){var e=this.extractChineseTemplates(this.com.content);console.log("Chinese templates:",e),this.com.attrs&&Array.isArray(this.com.attrs)&&(this.processedAttrs=this.com.attrs.filter((function(t){return e.includes(t.id)})))}else this.processedAttrs=[]},formatSourceData:function(e,t){var a=/\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]/,r=t.match(a),n=r[4].split(",");return"".concat(e,"=").concat(r[2],".").concat(r[3],".").concat(String.fromCharCode(65+parseInt(n[1]))).concat(parseInt(n[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:n=a.sent,200===n.status&&(r.id=n.data,t.com.id=n.data,t.$alert("模板信息保存成功"),t.$emit("onRefresh"),t.saveAs=!1),a.next=13;break;case 9:return a.next=11,Object(d["k"])(r);case 11:_=a.sent,200===_.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["j"])({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((n=r.n()).done){t.next=15;break}return _=n.value,t.next=12,e.getTemplateList(_.id);case 12:_.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["i"])({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(_["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(_["a"])(this.components))},onSetActiveIndex:function(e){this.activeHeaderIndex=e===this.activeHeaderIndex?-1:e}}}),p=m,f=(a("24d50"),a("2877")),b=Object(f["a"])(p,r,n,!1,null,null,null);t["a"]=b.exports},f746:function(e,t,a){"use strict";var r=a("c9e6"),n=a.n(r);t["default"]=n.a},fff4:function(e,t,a){"use strict";a("3fa9")}}]);