chunk-254ac533.30f5dec3.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-254ac533"],{"1c4c":function(t,e,a){"use strict";a.d(e,"i",(function(){return n})),a.d(e,"b",(function(){return i})),a.d(e,"k",(function(){return r})),a.d(e,"d",(function(){return l})),a.d(e,"g",(function(){return s})),a.d(e,"h",(function(){return c})),a.d(e,"a",(function(){return u})),a.d(e,"j",(function(){return d})),a.d(e,"f",(function(){return f})),a.d(e,"c",(function(){return m})),a.d(e,"e",(function(){return p}));var o=a("b775");function n(t){return Object(o["a"])({url:"source/data/categories/",method:"post",data:t})}function i(t){return Object(o["a"])({url:"source/data/categories/create/",method:"post",data:t})}function r(t){return Object(o["a"])({url:"/source/data/category/update",method:"post",data:t})}function l(t){return Object(o["a"])({url:"/source/data/category/delete",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/source/data/category/info",method:"post",data:t})}function c(t){return Object(o["a"])({url:"/source/data/search",method:"post",data:t})}function u(t){return Object(o["a"])({url:"/source/data/create",method:"post",data:t})}function d(t){return Object(o["a"])({url:"/source/data/update",method:"post",data:t})}function f(t){return Object(o["a"])({url:"/source/data/info",method:"post",data:t})}function m(t){return Object(o["a"])({url:"/source/data/delete",method:"post",data:t})}function p(t){return Object(o["a"])({url:"/source/data/find",method:"post",data:t})}},3177:function(t,e,a){},"496a":function(t,e,a){"use strict";a("b38d")},"5cc7":function(t,e,a){"use strict";a("f258")},7864:function(t,e,a){"use strict";a("3177")},ae6b:function(t,e,a){"use strict";a.d(e,"c",(function(){return v})),a.d(e,"b",(function(){return L})),a.d(e,"a",(function(){return p}));var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-search"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.queryForm}},[a("el-form-item",{attrs:{label:"编码:"}},[a("el-input",{attrs:{placeholder:"请选择编码"},model:{value:t.queryForm.code,callback:function(e){t.$set(t.queryForm,"code",e)},expression:"queryForm.code"}})],1),a("el-form-item",{attrs:{label:"表名:"}},[a("el-input",{attrs:{placeholder:"请选择表名"},model:{value:t.queryForm.name,callback:function(e){t.$set(t.queryForm,"name",e)},expression:"queryForm.name"}})],1),a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择状态",size:"large"},model:{value:t.queryForm.status,callback:function(e){t.$set(t.queryForm,"status",e)},expression:"queryForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[a("svg-icon",{attrs:{"icon-class":"search"}}),t._v(" 搜索")],1),t.allowCreate?a("el-button",{attrs:{type:"success"},on:{click:t.onCreate}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v(" 创建数据表")],1):t._e()],1)],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"80%","custom-class":"prod-verify",title:"创建数据表"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{on:{onClose:t.onClose}})],1)],1)},n=[],i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.isLoading,expression:"isLoading"}],staticClass:"data-info",attrs:{"element-loading-text":"Excel文件加载中..."}},[a("el-card",[a("el-form",{attrs:{model:t.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"数据表编码:"}},[a("el-input",{staticStyle:{width:"30%"},attrs:{placeholder:"请输入数据表编码"},model:{value:t.dataForm.code,callback:function(e){t.$set(t.dataForm,"code",e)},expression:"dataForm.code"}})],1),a("el-form-item",{attrs:{label:"所属分类:"}},[a("el-select",{staticStyle:{width:"30%"},attrs:{clearable:"",placeholder:"请选择所属分类",size:"large"},model:{value:t.dataForm.category_id,callback:function(e){t.$set(t.dataForm,"category_id",e)},expression:"dataForm.category_id"}},t._l(t.categoryList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"数据表名称:"}},[a("el-input",{staticStyle:{width:"30%"},attrs:{placeholder:"请输入数据表名称"},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{label:"选择文件:"}},[a("el-upload",{attrs:{"l:file-list":"fileList",limit:1,action:"",multiple:!1,"show-file-list":!1,"before-upload":t.beforeAvatarUpload},scopedSlots:t._u([{key:"tip",fn:function(){return[a("div",{staticClass:"el-upload__tip"})]},proxy:!0}])},[a("el-button",{attrs:{type:"primary"}},[t._v("请选择Excel文件")])],1)],1),t.fileLoadStatus?a("el-form-item",{staticStyle:{"min-height":"500px"},attrs:{label:"表格内容预览:"}},[a("div",{ref:"luckysheet",staticStyle:{width:"100%",height:"500px"},attrs:{id:"luckysheet"}})]):t._e(),a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticStyle:{width:"30%"},attrs:{placeholder:"请选择状态",size:"large"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)},r=[],l=(a("d81d"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("d3b7"),a("f7e6")),s=a.n(l),c=a("1c4c"),u={emits:["onClose"],props:{dataId:{type:Number,default:0}},watch:{dataId:{handler:function(t){null!=t&&0!=t&&this.loadData(t)},immediate:!0,deep:!0}},data:function(){return{isMaskShow:!1,isLoading:!1,dataForm:{id:0,code:"",name:"",sourceData:{exportJson:null,luckysheetfile:""},status:5},categoryList:[],fileLoadStatus:!1,file:"",fileList:[],statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}]}},mounted:function(){this.initCategory()},methods:{initCategory:function(){var t=this;Object(c["i"])({page:1,pageSize:9999}).then((function(e){200==e.status&&(t.categoryList=e.data.sourcecategories.map((function(t){return{id:t.id,value:t.id,name:t.name}})))}))},loadData:function(t){var e=this,a=this,o={id:t};a.isLoading=!0,Object(c["f"])(o).then((function(t){200==t.status?(a.dataForm=t.data,a.dataForm.sourceData=JSON.parse(a.dataForm.source_data),t.data.category&&t.data.category.id&&(a.dataForm.category_id=t.data.category.category_id),a.fileLoadStatus=!0,a.$nextTick((function(){luckysheet.destroy(),luckysheet.create({container:"luckysheet",data:a.dataForm.sourceData.exportJson.sheets,lang:"zh",hook:{cellUpdated:function(t,e,a,o,n){}}})}))):e.dataForm.id=0})).finally((function(){a.isLoading=!1}))},btnSave:function(t){var e=this;if(""==e.dataForm.code)return e.$alert("请填写数据表编码"),!1;if(""==e.dataForm.name)return e.$alert("请填写数据表名称"),!1;if(null==e.dataForm.sourceData.exportJson)return e.$alert("请选择上传excel文件"),!1;var a=JSON.parse(JSON.stringify(e.dataForm));a.source_data=JSON.stringify(a.sourceData),delete a.sourceData,a.id>0?Object(c["j"])(a).then((function(t){200==t.status?(e.$message.success("数据表更新成功"),e.$emit("onClose"),e.$router.go(-1)):e.$message(t.message)})):Object(c["a"])(a).then((function(t){200==t.status?(e.$message.success("数据表创建成功"),e.$emit("onClose"),e.$router.go(-1)):e.$message(t.message)}))},initExcel:function(){var t=this;luckysheet.destroy(),luckysheet.create({container:"luckysheet",data:t.dataForm.sourceData.exportJson.sheets,lang:"zh",hook:{cellUpdated:function(t,e,a,o,n){}}})},beforeAvatarUpload:function(t){var e=this,a=this;a.fileLoadStatus=!1,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===t.type?(a.fileLoadStatus=!0,a.fileList=[t],s.a.transformExcelToLucky(t,(function(t,a){if(!t||!t.sheets)return console.error("Invalid exportJson:",t),void e.$message.error("无法解析Excel文件,请检查文件格式是否正确");e.dataForm.sourceData={exportJson:t,luckysheetfile:a},e.initExcel()}),(function(t){console.error("LuckyExcel转换错误:",t),e.$message.error("Excel文件处理失败: ".concat(t.message||"未知错误"))}))):this.$message.error("请选择正确的Excel文件格式(.xlsx)")}}},d=u,f=(a("5cc7"),a("2877")),m=Object(f["a"])(d,i,r,!1,null,null,null),p=m.exports,h=a("a888"),g={components:{dataInfo:p},directives:{elDragDialog:h["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,code:"",name:"",status:""}}},allowCreate:{type:Boolean,default:!1}},data:function(){return{statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}],dialogVisible:!1}},created:function(){},methods:{onCreate:function(t){this.$router.push({path:"/knowledge/dataCenter/create"})},onClose:function(t){this.dialogVisible=!1,this.queryForm.isUpdate=!this.queryForm.isUpdate},onSubmit:function(){this.$emit("bindSetQuery",this.$props.queryForm)}}},b=g,y=(a("496a"),Object(f["a"])(b,o,n,!1,null,null,null)),v=y.exports,w=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"data-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.dataList,"header-row-class-name":"headerBg","table-layout":"auto","empty-text":"没有原始数据信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"code",label:"编码",align:"center","min-width":"120"}}),a("el-table-column",{attrs:{prop:"name",label:"名称",align:"center","min-width":"200"}}),a("el-table-column",{attrs:{prop:"category.name",label:"所属分类",align:"center","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(t.categoryName(e.row.category_id))+" ")]}}])}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center","min-width":"150"}}),a("el-table-column",{attrs:{prop:"status",label:"分类状态",align:"center","min-width":"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[5==e.row.status?a("div",[t._v("启用")]):t._e(),6==e.row.status?a("div",[t._v("停用")]):t._e()]}}])}),a("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnEdit(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑")],1),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnView(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("预览")],1),a("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(a){return t.btnDelete(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:t.queryForm.page,"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"80%","custom-class":"prod-verify",title:"修改原始数据"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{attrs:{id:t.currentDataId},on:{onClose:t.onClose}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogView,"append-to-body":"",width:"80%","custom-class":"prod-verify",title:"查看原始数据"},on:{"update:visible":function(e){t.dialogView=e}}},[a("dataView",{attrs:{fileOjb:t.fileOjb},on:{onClose:t.onClose}})],1)],1)},x=[],k=(a("7db0"),a("ac1f"),a("841c"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"com-data-view"},[a("div",{staticStyle:{margin:"0px",padding:"0px",position:"absolute",width:"100%",left:"0px",top:"0px",bottom:"0px"},attrs:{id:"luckysheet"}}),a("div",{directives:[{name:"show",rawName:"v-show",value:t.isMaskShow,expression:"isMaskShow"}],staticStyle:{position:"absolute","z-index":"1000000",left:"0px",top:"0px",bottom:"0px",right:"0px",background:"rgba(255, 255, 255, 0.8)","text-align":"center","font-size":"40px","align-items":"center","justify-content":"center",display:"flex"}},[t._v(" Downloading")])])}),F=[],_={props:{fileOjb:{type:Object,default:null}},watch:{fileOjb:{handler:function(t){var e=this;null!=t&&setTimeout((function(){e.loadExcel(t)}),1e3)},immediate:!0,deep:!0}},data:function(){return{isMaskShow:!1}},mounted:function(){},methods:{loadExcel:function(t){var e=this;if(null!=t){var a=t.url,o=t.name;this.isMaskShow=!0,s.a.transformExcelToLuckyByUrl(a,o,(function(t,a){null!=t.sheets&&0!=t.sheets.length?(e.isMaskShow=!1,window.luckysheet.destroy(),window.luckysheet.create({container:"luckysheet",showinfobar:!0,data:t.sheets,title:t.info.name,userInfo:t.info.name.creator})):alert("Failed to read the content of the excel file, currently does not support xls files!")}))}else this.$alert("请选择正确的文件")}}},S=_,O=(a("c4b0"),Object(f["a"])(S,k,F,!1,null,null,null)),C=O.exports,$={components:{dataInfo:p,dataView:C},directives:{elDragDialog:h["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,code:"",name:"",status:""}}},allowEdit:{type:Boolean,default:!1},allowDelete:{type:Boolean,default:!1}},watch:{queryForm:{handler:function(t){this.search()},immediate:!0,deep:!0}},data:function(){return{dialogVisible:!1,dialogView:!1,currentDataId:0,fileOjb:null,recordCount:0,pageTotal:1,dataList:[],currentData:{},loading:!1,categoryList:[]}},mounted:function(){this.search(),this.authority(),this.initCategory()},methods:{categoryName:function(t){var e;return null===(e=this.categoryList.find((function(e){return e.id===t})))||void 0===e?void 0:e.name},initCategory:function(){var t=this;Object(c["i"])({page:1,pageSize:9999}).then((function(e){200==e.status&&(t.categoryList=e.data.sourcecategories.map((function(t){return{id:t.id,value:t.id,name:t.name}})))}))},authority:function(){console.log(this.$store.state.user.roleInfo.id)},editWidth:function(t){return this.allowDelete&&this.allowEdit?200:this.allowDelete||this.allowEdit?120:100},btnDelete:function(t){var e=this,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(c["c"])(a).then((function(t){e.search()}))})).catch((function(){}))},searchData:function(){var t=this;t.dialogVisible=!1,t.search()},btnView:function(t){var e=this;e.$router.push({path:"/knowledge/dataCenter/info",query:{id:t}})},btnCloseView:function(t){this.currentDataId=0,this.dialogView=!1},btnEdit:function(t){var e=this;e.$router.push({path:"/knowledge/dataCenter/create",query:{id:t}})},onClose:function(){var t=this;t.currentDataId=0,t.dialogVisible=!1,t.search()},search:function(){var t=this;t.loading=!0,Object(c["h"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage)})).finally((function(){t.loading=!1}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}},j=$,D=(a("7864"),Object(f["a"])(j,w,x,!1,null,null,null)),L=D.exports},b38d:function(t,e,a){},b39e:function(t,e,a){},c4b0:function(t,e,a){"use strict";a("b39e")},f258:function(t,e,a){}}]);