(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e0db0afa"],{4430:function(e,t,i){"use strict";i("a20b")},a20b:function(e,t,i){},cb45:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"oiling-detail"},[i("detail-header",{attrs:{"query-time":e.queryTime,title:e.$t("record.oildailyDetail"),"show-count":!1},on:{"select-time":e.selectTime}}),i("div",{staticClass:"detail-item-content"},[0==e.selectedRecords.length?i("div",{staticClass:"full",staticStyle:{"background-color":"#fff"}},[i("van-empty",{staticClass:"custom-image",attrs:{description:e.$t("tips.noData"),image:e.imageSrc}})],1):e._e(),e._l(e.selectedRecords,(function(t,a){return[i("div",{key:a,staticClass:"detail-item-wrapper",on:{click:function(i){return e.qeuryReportOilTime(t.createtime)}}},[i("div",{staticClass:"detail-item-left"},[i("div",{staticClass:"detail-item-left-icon"},[i("Icon",{attrs:{"icon-name":"iconxinxinicon","font-size":18,"font-color":"#23B96A"}})],1)]),i("div",{staticClass:"detail-item-content"},[i("div",[i("b",[e._v(e._s(e.$t("record.dataDate"))+" : "+e._s(t.createtime))])]),i("div",[e._v(e._s(e.$t("record.travelMileage"))+" : "+e._s(t.mileage)+"Km")]),i("div",[e._v(e._s(e.$t("record.travelOil"))+" : "+e._s(t.oil)+"L")]),i("div",[e._v(e._s(e.$t("record.km100Oil"))+" : "+e._s(t.oil_100km)+"L")])])])]})),i("van-overlay",{attrs:{show:e.show,"z-index":"2000"}},[i("div",{staticClass:"wrapper"},[i("div",{staticClass:"block",on:{click:function(e){e.stopPropagation()}}},[i("div",{staticClass:"close-btn",on:{click:function(t){e.show=!1}}},[i("van-icon",{attrs:{name:"cross",size:"20"}})],1),i("div",{style:{height:"390px",width:e.chartsHeight+"px"},attrs:{id:"charts"}})])])])],2)],1)},s=[],c=i("5530"),o=(i("159b"),i("b680"),i("a9e3"),i("5101")),r=i("43c8"),d=i.n(r),n=i("2f62"),l=i("ae60"),u=i("2236"),h=i("b562"),m=i("c276"),v={name:"OildailyDetail",components:{DetailHeader:u["a"],Icon:l["a"]},data:function(){return{imageSrc:i("6095"),queryTime:0,dataList:[],show:!1,chartsHeight:0}},methods:{back:function(){this.$router.back()},selectTime:function(e){this.queryTime=e.time,this.dataList=[],this.queryOilingRecord()},getChartsData:function(e){var t=[],i=[],a=[],s=[],c=[],r=[],d=[],n=[],l=[],u=0;return e.forEach((function(e){console.log(e),e.records&&e.records.forEach((function(e,h){0==h&&(u=e.totaldistance);var m=e.totalad,v=e.ad0,f=e.ad1,p=e.ad2,b=e.ad3;v<0&&(v=0),f<0&&(f=0),p<0&&(p=0),b<0&&(b=0),e.totalad=m/100,e.ad0=v/100,e.ad1=f/100,e.ad2=p/100,e.ad3=b/100;var g=o["a"].longToDateTimeStr(e.updatetime,o["a"].getOffset());t.push(e.totalad),i.push((e.speed/1e3).toFixed(2)),e.totaldistance=((e.totaldistance-u)/1e3).toFixed(2),a.push(e.totaldistance),s.push(g),c.push(e.ad0),r.push(e.ad1),d.push(e.ad2),n.push(e.ad3),l.push(e.strstatus)}))})),{totalads:t,veo:i,distance:a,recvtime:s,oil1:c,oil2:r,oil3:d,oil4:n,devStates:l,disMin:u}},qeuryReportOilTime:function(e){var t=this,i=[this.selectedDeviceId],a=o["a"].getOffset(),s={startday:e+" 00:00:00",endday:e+" 23:59:59",offset:a,devices:i};Object(h["l"])(s).then((function(e){var i=e.status,a=e.records;if(0==i){t.show=!0,t.$toast.clear();var s=t.getChartsData(a);setTimeout((function(){t.charts.setOption(Object(m["g"])(s)),t.charts.resize()}),800)}}))},queryOilingRecord:function(){var e=this,t=[this.selectedDeviceId],i=Object(m["h"])(this.queryTime);i.devices=t,Object(h["j"])(i).then((function(t){var i=t.status,a=t.records;if(0===i){var s=[];a.forEach((function(e){var t=e.records;t.forEach((function(e){var t=e.totaldistance/1e3;s.push({createtime:e.statisticsday,mileage:t,oil:e.totaloil/100,oil_100km:e.oilper100km})}))})),e.$store.commit("setSelectedRecords",{deviceid:e.selectedDeviceId,records:s,devicename:e.selectedDeviceName})}else e.$store.commit("setSelectedRecords",{deviceid:e.selectedDeviceId,records:[],devicename:e.selectedDeviceName})})).catch((function(t){e.$store.commit("setSelectedRecords",{deviceid:e.selectedDeviceId,records:[],devicename:e.selectedDeviceName}),e.$toast(e.$t("tips.networkError"))}))}},computed:Object(c["a"])({},Object(n["d"])(["selectedRecords","selectedDeviceId","selectedDeviceName"])),beforeDestroy:function(){this.$toast.clear()},watch:{show:function(e){e||this.charts.clear()}},mounted:function(){this.queryTime=Number(this.$route.query.queryTime),this.charts=d.a.init(document.getElementById("charts")),this.chartsHeight=(document.documentElement.clientWidth||document.body.clientWidth)-20}},f=v,p=(i("4430"),i("2877")),b=Object(p["a"])(f,a,s,!1,null,null,null);t["default"]=b.exports}}]);