chunk-7bfd84a5.044cc5df.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7bfd84a5"],{"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})}},2763:function(t,e,a){},"34a1":function(t,e,a){},"5dd2":function(t,e,a){"use strict";a("e00d")},7589:function(t,e,a){"use strict";a("34a1")},"7dae":function(t,e,a){"use strict";a("2763")},a888:function(t,e,a){"use strict";a("99af"),a("caad"),a("ac1f"),a("2532"),a("5319");var o={bind:function(t,e,a){var o=t.querySelector(".el-dialog__header"),n=t.querySelector(".el-dialog");o.style.cssText+=";cursor:move;",n.style.cssText+=";top:0px;";var i=function(){return window.document.currentStyle?function(t,e){return t.currentStyle[e]}:function(t,e){return getComputedStyle(t,!1)[e]}}();o.onmousedown=function(t){var e=t.clientX-o.offsetLeft,r=t.clientY-o.offsetTop,l=n.offsetWidth,s=n.offsetHeight,c=document.body.clientWidth,u=document.body.clientHeight,d=n.offsetLeft,f=c-n.offsetLeft-l,m=n.offsetTop,p=u-n.offsetTop-s,h=i(n,"left"),g=i(n,"top");h.includes("%")?(h=+document.body.clientWidth*(+h.replace(/\%/g,"")/100),g=+document.body.clientHeight*(+g.replace(/\%/g,"")/100)):(h=+h.replace(/\px/g,""),g=+g.replace(/\px/g,"")),document.onmousemove=function(t){var o=t.clientX-e,i=t.clientY-r;-o>d?o=-d:o>f&&(o=f),-i>m?i=-m:i>p&&(i=p),n.style.cssText+=";left:".concat(o+h,"px;top:").concat(i+g,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},n=function(t){t.directive("el-drag-dialog",o)};window.Vue&&(window["el-drag-dialog"]=o,Vue.use(n)),o.install=n;e["a"]=o},ae6b:function(t,e,a){"use strict";a.d(e,"c",(function(){return v})),a.d(e,"b",(function(){return q})),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",{staticClass:"data-info"},[a("el-card",[a("el-form",{attrs:{model:t.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"数据表编码:"}},[a("el-input",{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:"100%"},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",{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:{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}]),model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}},[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:"100%"},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("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,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,status:5}).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};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.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}))},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){e.dataForm.sourceData={exportJson:t,luckysheetfile:a},e.initExcel()}),(function(t){e.$message.error(t)}))):this.$message("请选择excel文件")}}},d=u,f=(a("7589"),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:"/document/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("7dae"),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"}}),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:{"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage},model:{value:t.queryForm.page,callback:function(e){t.$set(t.queryForm,"page",e)},expression:"queryForm.page"}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",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("d3b7"),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=[],S={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"])(_,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}},mounted:function(){this.search()},methods:{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:"/document/dataCenter/info",query:{id:t}})},btnCloseView:function(t){this.currentDataId=0,this.dialogView=!1},btnEdit:function(t){var e=this;e.$router.push({path:"/document/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("5dd2"),Object(f["a"])(j,w,x,!1,null,null,null)),q=D.exports},b39e:function(t,e,a){},c4b0:function(t,e,a){"use strict";a("b39e")},e00d:function(t,e,a){}}]);