(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1964e97b"],{
/***/"07b51":
/***/function(e,t,a){"use strict";
/* harmony import */a("2228");
/* harmony import */},
/***/"1b8a8":
/***/function(e,t,a){"use strict";
/* harmony import */a("caf7");
/* harmony import */},
/***/2228:
/***/function(e,t,a){
// extracted by mini-css-extract-plugin
/***/},
/***/"37cd":
/***/function(e,t,a){"use strict";
// ESM COMPAT FLAG
a.r(t);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
a("b0c0");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/reporting/diyReport/diyReport.vue?vue&type=template&id=015fb71b
var o=a("600d"),i=a("c2ec"),n=a("c1df"),s=a.n(n),r=a("f7e6"),l=a.n(r),c=a("cf45"),d=a("0340"),m=(a("d3b7"),a("f64d")),p={name:"deviceDataModel",i18n:a("89fe"),data:function(){return{pagination:{pageSize:15,showSizeChanger:!0},loading:!1,addVisible:!1,columns:[{slotName:"diyReportTemplete.Name",width:"20%",scopedSlots:{customRender:"Name",title:"diyReportTemplete.Name"},dataIndex:"Name"},{width:"20%",slotName:"diyReportTemplete.Describe",scopedSlots:{customRender:"Describe",title:"diyReportTemplete.Describe"},dataIndex:"Describe"},{slotName:"configComponent.video.TableVideoOpt",width:"10%",scopedSlots:{customRender:"Opt",title:"configComponent.video.TableVideoOpt"}}],dataSource:[]}},watch:{$route:function(){}},mounted:function(){this.GetReportTempletes()},create:function(){this.GetReportTempletes()},methods:{showModal:function(){this.addVisible=!0,this.GetReportTempletes()},handleCancel:function(){this.addVisible=!1},SelectTemplete:function(e){this.$emit("OnSelectTemplete",e),this.addVisible=!1},GetReportTempletes:function(){var e=this;e.loading=!0,this.dataSource=[],Object(m.d)().then((function(t){e.loading=!1,0==t.data.code&&(null==t.data.list?e.dataSource=[]:e.dataSource=t.data.list)})).finally((function(t){e.loading=!1}))}}},u=(a("07b51"),a("2877")),y=Object(u.a)(p,(function(){var e=this,t=e._self._c;return t("a-card",[t("a-modal",{directives:[{name:"drag-modal",rawName:"v-drag-modal"}],attrs:{width:"800px",footer:null,title:e.$t("diyReportTemplete.TempleteList")},model:{value:e.addVisible,callback:function(t){e.addVisible=t},expression:"addVisible"}},[t("a-spin",{attrs:{tip:"Loading...",spinning:e.loading}},[t("a-table",{attrs:{rowKey:"Name",pagination:e.pagination,columns:e.columns,"data-source":e.dataSource},scopedSlots:e._u([{key:"Status",fn:function(a){return t("span",{},[1==a?t("div",{staticStyle:{color:"#74f808"}},[e._v(" "+e._s(e.$t("configComponent.video.VideoOnline"))+" ")]):0==a?t("div",{staticStyle:{color:"#ea1111"}},[e._v(" "+e._s(e.$t("configComponent.video.VideoOffline"))+" ")]):e._e()])}},{key:"Opt",fn:function(a,o){return t("div",{},[t("a",{staticStyle:{cursor:"pointer",color:"#13C2C2"},attrs:{type:"link"},on:{click:function(t){return e.SelectTemplete(o)}}},[t("a-icon",{attrs:{type:"download"}}),t("span",{staticStyle:{"margin-left":"2px"}},[e._v(e._s(e.$t("diyReportTemplete.Load")))])],1)])}}])},[e._l(e.columns,(function(a,o){return t("template",{slot:a.slotName},[t("span",{key:o},[e._v(e._s(e.$t(a.slotName)))])])}))],2)],1)],1)],1)}),[],!1,null,"1d703557",null)
/* harmony default export */.exports,h=(a("5c3a"),a("e1d3"),a("90ea"),{name:"diyDataHistory",i18n:a("89fe"),components:{reportTempleteModel:y},data:function(){return{moment:s.a,pagination:{pageSize:15,showSizeChanger:!0},TempleteName:"",isMaskShow:!1,selectRow:0,selectCol:0,loadExecl:null,isLoadExecl:!1,exportName:"",json_fields_cn:{"数据名称":"DataName",
//常规字段
"设备":"DeviceName",
//支持嵌套属性
"数据值":"DataValue","数据单位":"DataUnit","记录时间":{field:"RecordTime",
//自定义回调函数
callback:function(e){var t=new Date(e);return Object(c.a)(t,"yyyy-MM-dd hh:mm:ss")}}},json_fields_en:{DataName:"DataName",
//常规字段
DeviceName:"DeviceName",
//支持嵌套属性
DataValue:"DataValue",DataUnit:"DataUnit",RecordTime:{field:"RecordTime",
//自定义回调函数
callback:function(e){var t=new Date(e);return Object(c.a)(t,"yyyy-MM-dd hh:mm:ss")}}},json_fields:{},json_meta:[[{" key ":" charset "," value ":" utf- 8 "}]],SelectDateType:"Day",SelectDevice:[],SelectDateRange:s()().format("YYYY-MM-DD"),SelectAlarmData:7,deviceTreeData:[],AlarmDataTree:[],TimeGeList:[{value:1,name:"diyReport.TimeGeOneMin"},{value:2,name:"diyReport.TimeGeFiveMin"},{value:3,name:"diyReport.TimeGeTenMin"},{value:4,name:"diyReport.TimeGeTenFiveMin"},{value:5,name:"diyReport.TimeGeTenThreeMin"},{value:6,name:"diyReport.TimeGeTenOneHour"},{value:7,name:"diyReport.TimeGeTenOneDay"}],form:this.$form.createForm(this),messageShowLoad:!1,advanced:!0,refIconLoading:!1,templeteUuid:"",columns:[{slotName:"reporting.DataHistory.DeviceName",width:"10%",scopedSlots:{customRender:"serial",title:"reporting.DataHistory.DeviceName"},dataIndex:"DeviceName"},{width:"10%",slotName:"reporting.DataHistory.DataName",scopedSlots:{customRender:"serial",title:"reporting.DataHistory.DataName"},dataIndex:"DataName"},{width:"10%",slotName:"reporting.DataHistory.DataValue",scopedSlots:{customRender:"DataValue",title:"reporting.DataHistory.DataValue"},dataIndex:"DataValue"},{width:"10%",slotName:"reporting.DataHistory.DataUnit",scopedSlots:{customRender:"DataUnit",title:"reporting.DataHistory.DataUnit"},dataIndex:"DataUnit"},{width:"10%",slotName:"reporting.DataHistory.RecordTime",scopedSlots:{customRender:"RecordTime",title:"reporting.DataHistory.RecordTime"},dataIndex:"RecordTime"}],dataSource:[],conditionExpress:"",selectedRows:[],sheetOptions:{}}},authorize:{},mounted:function(){var e=this;this.sheetOptions={container:"luckysheetQuery",
// 设定DOM容器的id
lang:"zh",
// 设定表格语言
plugins:["chart"],allowEdit:!1,showinfobar:!1,showtoolbar:!1},"CN"==this.$i18n.locale?(this.sheetOptions.lang="zh",this.json_fields=this.json_fields_cn):(this.sheetOptions.lang="en",this.json_fields=this.json_fields_en),this.exportName=this.$t("reporting.DataHistory.exportName")+"."+Object(c.a)(new Date,"yyyy-MM-dd hh:mm:ss")+".xlsx";luckysheet.destroy(),
// In some cases, you need to use $nextTick
this.$nextTick((function(){e.luckysheetOpt=luckysheet.create(e.sheetOptions)}))},activated:function(){},filters:{formatDate:function(e){var t=new Date(e);return Object(c.a)(t,"yyyy-MM-dd hh:mm:ss")}},created:function(){var e=this;this.getMonitorTree();luckysheet.destroy(),
// In some cases, you need to use $nextTick
this.$nextTick((function(){e.luckysheetOpt=luckysheet.create(e.sheetOptions)}))},watch:{$route:function(){luckysheet.destroy()}},methods:{chargeDateType:function(e){var t=e.target.value;if("Day"==t)this.SelectDateRange=s()().format("YYYY-MM-DD");else if("Weekly"==t){var a=s()().day(1).format("YYYY-MM-DD"),o=s()().day(7).format("YYYY-MM-DD");// 周一日期
// 周日日期
this.SelectDateRange=[a,o]}else this.SelectDateRange="Month"==t?s()().format("YYYY-MM"):[s()().add(-1,"day"),s()()]},loadTemplete:function(){this.$refs.reportTempleteModel.showModal()},onSelectTemplete:function(e){this.TempleteName=this.$t("diyReportTemplete.LoadTempleteName")+e.Name,this.templeteUuid=e.Uuid,this.LoadReportTemplete(e.Uuid)},onDateChange:function(e,t){this.SelectDateRange=t},onWeeklyDateChange:function(e,t){var a=s()(e).day(1).format("YYYY-MM-DD"),o=s()(e).day(7).format("YYYY-MM-DD");// 周一日期
// 周日日期
this.SelectDateRange=[a,o]},getMonitorTree:function(){var e=this;this.deviceTreeData=[],Object(o.j)().then((function(t){0==t.data.code&&(e.deviceTreeData=t.data.list)}))},exportExcelBtn:function(){
// console.log(luckysheet.getluckysheetfile())
Object(d.a)(luckysheet.getluckysheetfile(),this.exportName)},LoadReportTemplete:function(e){var t="/static/reportTemplete/"+e+".xlsx?"+(new Date).getMilliseconds(),a=e,o=this;l.a.transformExcelToLuckyByUrl(t,a,(function(e,t){null!=e.sheets&&0!=e.sheets.length&&(luckysheet.destroy(),o.sheetOptions.data=e.sheets,o.sheetOptions.title=e.info.name,o.sheetOptions.userInfo=e.info.name.creator,luckysheet.create(o.sheetOptions))}))},LoadRemoteReport:function(e){var t="/"+e+"?"+(new Date).getMilliseconds(),a=Object(c.a)(new Date,"yyyy-MM-dd hh:mm:ss"),o=this;l.a.transformExcelToLuckyByUrl(t,a,(function(e,t){null!=e.sheets&&0!=e.sheets.length&&(luckysheet.destroy(),o.sheetOptions.data=e.sheets,o.sheetOptions.title=e.info.name,o.sheetOptions.userInfo=e.info.name.creator,luckysheet.create(o.sheetOptions))}))},QueryHistoryDataList:function(){var e=this;""!=e.templeteUuid?Object(d.b)(luckysheet.getluckysheetfile(),(function(t){e.dataSource=[];var a={deviceList:e.SelectDevice,dataList:e.SelectAlarmData,dateRange:e.SelectDateRange,dateType:e.SelectDateType,timeIn:e.SelectAlarmData,tUuid:e.templeteUuid};""!=a.dateRange&&""!=a.dateRange[0]?""!=a.deviceList?0!=a.timeIn?(e.$message.loading({content:e.$t("diyReport.QueryLoading"),duration:0}),e.messageShowLoad=!0,Object(i.f)(a).then((function(t){if(0==t.data.code){e.$message.destroy(),e.LoadRemoteReport(t.data.path);var a=document.createElement("a");a.href=t.data.path,a.setAttribute("download",e.exportName),a.style.display="none",document.body.appendChild(a),setTimeout((function(){a.click(),document.body.removeChild(a)}),66)}e.messageShowLoad=!1})).catch((function(){e.messageShowLoad=!1,e.$message.destroy(),e.$message.error(e.$t("loginPage.serverError"),3)}))):e.$message.error(e.$t("diyReport.SelectInTips")):e.$message.error(e.$t("diyReport.SelectDeviceTips")):e.$message.error(e.$t("reporting.DataHistory.SelectDateError"))})):e.$message.error(e.$t("diyReportTemplete.TempleteEmpty"))}}}),f=(a("1b8a8"),Object(u.a)(h,(function(){var e=this,t=e._self._c;return t("a-card",[t("div",[t("a-form",{attrs:{layout:"horizontal"}},[t("div",{class:e.advanced?null:"fold"},[t("a-row",[t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:e.$t("reporting.AlarmHistory.DeviceList"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{"show-search":"","tree-node-filter-prop":"title","allow-clear":"","dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":e.deviceTreeData,"replace-fields":{value:"key",title:"text"},placeholder:e.$t("reporting.AlarmHistory.DeviceList"),"tree-default-expand-all":""},model:{value:e.SelectDevice,callback:function(t){e.SelectDevice=t},expression:"SelectDevice"}})],1)],1),t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:e.$t("diyReport.TimeGe"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[t("a-select",{staticStyle:{width:"100%"},model:{value:e.SelectAlarmData,callback:function(t){e.SelectAlarmData=t},expression:"SelectAlarmData"}},e._l(e.TimeGeList,(function(a,o){return t("a-select-option",{key:o,attrs:{value:a.value}},[e._v(" "+e._s(e.$t(a.name))+" ")])})),1)],1)],1),t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:e.$t("reporting.AlarmHistory.DateType"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[t("a-radio-group",{on:{change:e.chargeDateType},model:{value:e.SelectDateType,callback:function(t){e.SelectDateType=t},expression:"SelectDateType"}},[t("a-radio-button",{attrs:{value:"Day"}},[e._v(" "+e._s(e.$t("reporting.AlarmHistory.DateDayType"))+" ")]),t("a-radio-button",{attrs:{value:"Weekly"}},[e._v(" "+e._s(e.$t("reporting.AlarmHistory.DateWeeklyType"))+" ")]),t("a-radio-button",{attrs:{value:"Month"}},[e._v(" "+e._s(e.$t("reporting.AlarmHistory.DateMonthType"))+" ")]),t("a-radio-button",{attrs:{value:"Diy"}},[e._v(" "+e._s(e.$t("reporting.AlarmHistory.DateDiyType"))+" ")])],1)],1)],1)],1),t("a-row",[t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:e.$t("reporting.AlarmHistory.SelectDate"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},["Day"==e.SelectDateType?t("a-date-picker",{staticStyle:{width:"100%"},attrs:{defaultValue:e.moment(),size:"default",placeholder:e.$t("reporting.AlarmHistory.DateDayType")},on:{change:e.onDateChange}}):e._e(),"Month"==e.SelectDateType?t("a-month-picker",{staticStyle:{width:"100%"},attrs:{defaultValue:e.moment(),size:"default",placeholder:e.$t("reporting.AlarmHistory.DateMonthType")},on:{change:e.onDateChange}}):e._e(),"Weekly"==e.SelectDateType?t("a-week-picker",{staticStyle:{width:"100%"},attrs:{defaultValue:e.moment(),size:"default",placeholder:e.$t("reporting.AlarmHistory.DateWeeklyType")},on:{change:e.onWeeklyDateChange}}):e._e(),"Diy"==e.SelectDateType?t("a-range-picker",{attrs:{"default-value":[e.moment().add(-1,"day"),e.moment()],showTime:!0,size:"default"},on:{change:e.onDateChange}}):e._e()],1)],1),"Diy"==e.SelectDateType?t("a-col",{attrs:{md:4,sm:24}},[t("span",{staticStyle:{float:"right","margin-top":"3px"}},[t("a-button",{attrs:{disabled:e.messageShowLoad,type:"primary"},on:{click:e.QueryHistoryDataList}},[e._v(e._s(e.$t("reporting.AlarmHistory.Query")))])],1)]):t("a-col",{attrs:{md:2,sm:24}},[t("span",{staticStyle:{float:"right","margin-top":"3px"}},[t("a-button",{attrs:{disabled:e.messageShowLoad,type:"primary"},on:{click:e.QueryHistoryDataList}},[e._v(e._s(e.$t("reporting.AlarmHistory.Query")))])],1)]),t("a-col",{attrs:{md:2,sm:24}},[t("span",{staticStyle:{"margin-left":"10px",float:"left","margin-top":"3px"}},[t("a-button",{attrs:{type:"default",icon:"download"},on:{click:e.loadTemplete}},[e._v(e._s(e.$t("diyReportTemplete.Load")))])],1)]),t("a-col",{attrs:{md:10,sm:24}},[t("span",{staticStyle:{float:"right","margin-top":"3px"}},[""!=e.TempleteName?t("a-alert",{attrs:{message:e.TempleteName,type:"info","show-icon":""}}):e._e()],1)])],1)],1)])],1),t("div",{staticClass:"hello"},[t("div",{staticStyle:{margin:"0px",padding:"0px",height:"600px",width:"100%",left:"0px",top:"100px",bottom:"0px"},attrs:{id:"luckysheetQuery"}}),t("report-templete-model",{ref:"reportTempleteModel",on:{OnSelectTemplete:e.onSelectTemplete}})],1)])}),[],!1,null,null,null)
/* harmony default export */);t.default=f.exports},
/***/caf7:
/***/function(e,t,a){
// extracted by mini-css-extract-plugin
/***/}}]);