1 line
5.3 KiB
JavaScript
1 line
5.3 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4dd8"],{"+N4U":function(e,t,a){"use strict";a.r(t);var r=a("YEIV"),n=a.n(r),o=a("P2sY"),c=a.n(o),s=a("14Xm"),i=a.n(s),u=a("gDS+"),l=a.n(u),d=a("D3Ub"),p=a.n(d),f=a("Fzjc"),h={name:"Login",components:{},data:function(){return{options:{},sheet:{},reportId:null,reportCode:null,reportName:null,dataSet:null,tableData2:[],excelData:{},params:{reportCode:"",setParam:""}}},mounted:function(){this.preview()},created:function(){this.reportCode=this.$route.query.reportCode},methods:{searchPreview:function(){var e=this;return p()(i.a.mark(function t(){var a;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=e.toObject(e.tableData2),e.params.setParam=l()(a),e.preview();case 3:case"end":return t.stop()}},t,e)}))()},preview:function(){var e=this;return p()(i.a.mark(function t(){var a,r,n,o,c,s,u,l;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.excelData={},e.params.reportCode=e.reportCode,t.next=4,Object(f.d)(e.params);case 4:if(a=t.sent,r=a.code,n=a.data,200==r){t.next=9;break}return t.abrupt("return");case 9:for(s in e.reportName=JSON.parse(n.jsonStr).name,e.params.setParam=JSON.parse(n.setParam),o=[],c=e.params.setParam){for(l in u=[],c[s])u.push({name:l,value:c[s][l]});o.push({name:s,children:u})}e.tableData2=o,e.excelData=n.jsonStr,e.sheetData=null==n?[{}]:JSON.parse(n.jsonStr),e.createSheet();case 18:case"end":return t.stop()}},t,e)}))()},download:function(e){var t=this;return p()(i.a.mark(function a(){var r,n,o,c;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if("gaea_template_pdf"!=e){a.next=3;break}return t.$message("暂不支持pdf"),a.abrupt("return");case 3:return(r={}).reportCode=t.reportCode,r.setParam=l()(t.params.setParam),""!=e&&(r.exportType=e),a.next=9,Object(f.c)(r);case 9:if(n=a.sent,o=n.code,c=n.message,200==o){a.next=14;break}return a.abrupt("return");case 14:t.$message.success(c);case 15:case"end":return a.stop()}},a,t)}))()},toObject:function(e){var t={},a={};e.forEach(function(e){e.name&&(t[e.name]=e.children)});var r=function(e){var r={};t[e].map(function(e){c()(r,n()({},e.name,e.value))}),a[e]=r};for(var o in t)r(o);return a},createSheet:function(){var e={container:"luckysheet",title:"",lang:"zh",plugins:["chart"],data:[{name:"report",color:"",index:0,status:1,order:0,hide:0,row:36,column:18,defaultRowHeight:19,defaultColWidth:73,celldata:[],config:{merge:{},rowlen:{},columnlen:{},rowhidden:{},colhidden:{},borderInfo:{},authority:{}},scrollLeft:0,scrollTop:315,luckysheet_select_save:[],calcChain:[],isPivotTable:!1,pivotTable:{},filter_select:{},filter:null,luckysheet_alternateformat_save:[],luckysheet_alternateformat_save_modelCustom:[],luckysheet_conditionformat_save:{},frozen:{},chart:[],zoomRatio:1,image:[],showGridLines:1,dataVerification:{}}]};e.data=this.sheetData,$(function(){luckysheet.create(e)})}}},m=(a("qkZ5"),a("6KbP"),a("KHd+")),v=Object(m.a)(h,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"layout"},[a("div",{staticClass:"layout-right"},[a("div",{staticClass:"block"},[a("div",{staticClass:"download"},[null!=e.reportCode?a("a",{attrs:{download:"xxx.xlsx"}},[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.download("gaea_template_excel")}}},[a("i",{staticClass:"iconfont iconexcel"}),e._v("导出excel\n ")])],1):e._e(),e._v(" "),null!=e.reportCode?a("a",{attrs:{download:"xxx.pdf"}},[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.download("gaea_template_pdf")}}},[a("i",{staticClass:"iconfont iconpdf"}),e._v("导出pdf\n ")])],1):e._e()]),e._v(" "),a("el-form",{},[a("h2",[e._v("表格查询")]),e._v(" "),e._l(e.tableData2,function(t,r){return a("div",{key:r+"excel"},[a("h4",[e._v(e._s(t.name))]),e._v(" "),e._l(t.children,function(t,r){return a("div",{key:r+"excel2",staticClass:"search_input"},[a("label",[e._v(e._s(t.name)+":")]),e._v(" "),a("el-input",{model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"son.value"}})],1)})],2)}),e._v(" "),a("el-button",{staticStyle:{width:"100%"},on:{click:e.searchPreview}},[e._v("查询")])],2)],1)]),e._v(" "),e._m(0)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"layout-middle"},[t("div",{staticStyle:{margin:"0px",padding:"0px",position:"absolute",width:"100%",height:"95vh",left:"0px",top:"30px",bottom:"0px"},attrs:{id:"luckysheet"}})])}],!1,null,"630f4890",null);v.options.__file="index.vue";t.default=v.exports},"6KbP":function(e,t,a){"use strict";var r=a("PiJ0");a.n(r).a},Fzjc:function(e,t,a){"use strict";a.d(t,"d",function(){return o}),a.d(t,"c",function(){return c}),a.d(t,"e",function(){return s}),a.d(t,"a",function(){return i}),a.d(t,"b",function(){return u});var r=a("t3Un"),n=a("X4fA");function o(e){return Object(r.a)({url:"reportExcel/preview",method:"post",headers:{"Share-Token":Object(n.e)(),Authorization:Object(n.f)()},data:e})}function c(e){return Object(r.a)({url:"reportExcel/exportExcel",method:"post",data:e})}function s(){return Object(r.a)({url:"dataSet/queryAllDataSet",method:"get"})}function i(e){return Object(r.a)({url:"dataSet/detailBysetId/"+e,method:"get"})}function u(e){return Object(r.a)({url:"reportExcel/detailByReportCode/"+e,method:"get"})}},Kkr9:function(e,t,a){},PiJ0:function(e,t,a){},qkZ5:function(e,t,a){"use strict";var r=a("Kkr9");a.n(r).a}}]); |