elementdata.js 8.5 KB

12
  1. require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/waterandfer/elementdata"],{1056:function(e,t,n){"use strict";(function(e,t){var i=n(4);n(26);i(n(25));var a=i(n(1057));e.__webpack_require_UNI_MP_PLUGIN__=n,t(a.default)}).call(this,n(1)["default"],n(2)["createPage"])},1057:function(e,t,n){"use strict";n.r(t);var i=n(1058),a=n(1060);for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n(1062);var r,s=n(32),u=Object(s["default"])(a["default"],i["render"],i["staticRenderFns"],!1,null,null,null,!1,i["components"],r);u.options.__file="pages/waterandfer/elementdata.vue",t["default"]=u.exports},1058:function(e,t,n){"use strict";n.r(t);var i=n(1059);n.d(t,"render",(function(){return i["render"]})),n.d(t,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(t,"components",(function(){return i["components"]}))},1059:function(e,t,n){"use strict";var i;n.r(t),n.d(t,"render",(function(){return a})),n.d(t,"staticRenderFns",(function(){return r})),n.d(t,"recyclableRender",(function(){return o})),n.d(t,"components",(function(){return i}));try{i={uIcon:function(){return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null,1200))},uCalendar:function(){return n.e("uview-ui/components/u-calendar/u-calendar").then(n.bind(null,1343))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var a=function(){var e=this,t=e.$createElement,n=(e._self._c,e.timetab(e.oldtime)),i=e.timetab(e.newtime);e._isMounted||(e.e0=function(t){e.tiemshow=!e.tiemshow}),e.$mp.data=Object.assign({},{$root:{m0:n,m1:i}})},o=!1,r=[];a._withStripped=!0},1060:function(e,t,n){"use strict";n.r(t);var i=n(1061),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},1061:function(e,t,n){"use strict";(function(e){var i=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(41)),o=i(n(43)),r=i(n(199)),s=null,u=null,c={data:function(){return{thdata:["上报时间"],eqlistdata:[[]],cWidth:"400",cHeight:"400",pixelRatio:1,oldtime:"",newtime:"",page:1,forbidden:!1,times:{d_id:null,start_time:null,end_time:null,device_id:null},canvastishiTF:!1,dataloadingtf:!0,pagesum:1,tiemshow:!1}},onLoad:function(t){var n=this;this.times.device_id=t.device_id,this.cWidth=e.upx2px(650),this.cHeight=e.upx2px(500),u=+new Date,this.oldtime=parseInt((u-2592e6)/1e3),this.newtime=parseInt(u/1e3),setTimeout((function(){n.getServerData(parseInt(u/1e3),parseInt((u-2592e6)/1e3)),n.historydata(parseInt(u/1e3),parseInt((u-2592e6)/1e3))}),1e3)},onShow:function(){},onPullDownRefresh:function(){console.log("refresh"),this.getServerData(parseInt(u/1e3),parseInt((u-864e5)/1e3)),this.historydata(parseInt(u/1e3),parseInt((u-864e5)/1e3)),setTimeout((function(){e.stopPullDownRefresh()}),1e3)},methods:{getServerData:function(e,t){var n=this;return(0,o.default)(a.default.mark((function i(){var o,r,s,u,c,l,d,f,h,g,m,p,v,w;return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n.dataloadingtf=!0,i.next=3,n.$myRequest({url:"/api/api_gateway?method=weather.weather.sf_data_chart",data:{device_id:n.times.device_id,end:e,begin:t}});case 3:if(o=i.sent,n.dataloadingtf=!1,0==o.length)n.canvastishiTF=!1;else{for(n.canvastishiTF=!0,r=o.conf.eleName.split("/"),o.conf.eleNum.split("/"),s=[],u=[],c=["#F97000","#00E29D","#FF3F3F","#6CBBFF","#00E29D"],l=0;l<r.length;l++)if("-"!=r[l]){for(d=[],f=0;f<o.dat.length;f++){for(h=JSON.stringify(o.dat[f].device_status).slice(2,-2),h=h.split(","),g={},m=0;m<h.length;m++)h[m]=h[m].split(":"),p=-1==h[m][0].indexOf("e")?h[m][0].indexOf("j"):h[m][0].indexOf("e"),g[h[m][0].slice(p,-1)]=Number(h[m][1]);d.unshift(g["e"+(l+1)]),v=new Date(1e3*o.dat[f].uptime),s.unshift(v.getMonth()+1+"/"+v.getDate()+"-"+v.getHours()+":"+v.getMinutes())}w={name:r[l],data:d,color:c[l]},u.push(w)}console.log(u),n.showColumn("canvasColumnA",s,u)}case 6:case"end":return i.stop()}}),i)})))()},historydata:function(e,t){var n=this;return(0,o.default)(a.default.mark((function i(){var o,r,s,u,c,l,d,f,h,g;return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,n.$myRequest({url:"/api/api_gateway?method=weather.weather.sf_data",data:{device_id:n.times.device_id,page:n.page,page_size:10,begin:t,end:e}});case 2:if(o=i.sent,console.log(o),0==o.length)n.forbidden=!1;else{for(n.pagesum=Math.floor(o.nums/10)+1,n.forbidden=!0,n.eqlistdata=[],r=o.conf.eleName.split("/"),o.conf.eleNum.split("/"),n.thdata=["上报时间"],s=[],u=0;u<r.length;u++)if("-"!=r[u]){for(n.thdata.push(r[u]),c=[],l=0;l<o.dat.length;l++){for(d=JSON.stringify(o.dat[l].device_status).slice(2,-2),d=d.split(","),f={},h=0;h<d.length;h++)d[h]=d[h].split(":"),g=d[h][0].indexOf("e"),f[d[h][0].slice(g,-1)]=Number(d[h][1]);c.push(f["e"+(u+1)])}console.log(c),n.eqlistdata.push(c)}for(l=0;l<o.dat.length;l++)s.push(n.tiemtag(o.dat[l].uptime));n.eqlistdata.unshift(s),console.log(n.eqlistdata)}case 5:case"end":return i.stop()}}),i)})))()},prev:function(){1!=this.page&&(this.page--,this.historydata(this.newtime,this.oldtime))},next:function(){this.page<this.pagesum&&(this.page++,this.historydata(this.newtime,this.oldtime))},tiemchange:function(e){console.log(e),this.oldtime=+new Date(e.startDate)/1e3,this.newtime=+new Date(e.endDate)/1e3+57600,this.getServerData(this.newtime,this.oldtime),this.historydata(this.newtime,this.oldtime)},timetab:function(e){e=new Date(1e3*e);var t=e.getFullYear(),n=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,i=e.getDate()<10?"0"+e.getDate():e.getDate(),a=t+"/"+n+"/"+i;return a},clickLeft:function(){e.navigateBack({delta:1})},showColumn:function(e,t,n){var i=this;s=new r.default({canvasId:e,type:"line",legend:{position:"top"},fontSize:11,background:"#FFFFFF",pixelRatio:1,animation:!0,dataLabel:!1,categories:t,series:n,enableScroll:!0,xAxis:{disableGrid:!0,type:"grid",gridType:"dash",itemCount:4,scrollShow:!0,scrollBackgroundColor:"#F7F7FF",scrollColor:"#DEE7F7"},yAxis:{},width:1*i.cWidth,height:1*i.cHeight,extra:{line:{type:"curve"}}})},showColumnb:function(e,t,n){var i=this;canvaColumnB=new r.default({canvasId:e,type:"line",legend:{position:"top"},fontSize:11,background:"#FFFFFF",pixelRatio:1,animation:!0,dataLabel:!1,categories:t,series:n,enableScroll:!0,xAxis:{disableGrid:!0,type:"grid",gridType:"dash",itemCount:4,scrollShow:!0,scrollBackgroundColor:"#F7F7FF",scrollColor:"#DEE7F7"},yAxis:{},width:1*i.cWidth,height:1*i.cHeight,extra:{line:{type:"curve"}}})},touchLineA:function(e){console.log(e),s.scrollStart(e)},moveLineA:function(e){s.scroll(e)},touchEndLineA:function(e){s.scrollEnd(e),s.showToolTip(e,{format:function(e,t){return t+" "+e.name+":"+Number(e.data).toFixed(3)}})},touchLineBb:function(e){console.log(e),canvaColumnB.scrollStart(e)},moveLineBb:function(e){canvaColumnB.scroll(e)},touchEndLineBb:function(e){canvaColumnB.scrollEnd(e),canvaColumnB.showToolTip(e,{format:function(e,t){return t+" "+e.name+":"+e.data}})},newdata:function(){var t=this;return(0,o.default)(a.default.mark((function n(){var i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$myRequest({url:"/api/api_gateway?method=forecast.send_control.get_device_config",data:{device_type_id:2,d_id:t.times.d_id,control_type:"data"}});case 2:i=n.sent,i?e.showToast({title:"刷新成功",duration:2e3,icon:"none"}):e.showToast({title:"刷新失败",duration:2e3,icon:"none"});case 4:case"end":return n.stop()}}),n)})))()},refresh:function(){this.newdata()},tiemtag:function(e){var t=new Date(1e3*e),n=t.getFullYear(),i=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,a=t.getDate()<10?"0"+t.getDate():t.getDate(),o=t.getHours()<10?"0"+t.getHours():t.getHours(),r=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),s=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return n+"-"+i+"-"+a+" "+o+":"+r+":"+s}}};t.default=c}).call(this,n(2)["default"])},1062:function(e,t,n){"use strict";n.r(t);var i=n(1063),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},1063:function(e,t,n){}},[[1056,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/waterandfer/elementdata.js.map