ucharts.js 10 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/prevention/ucharts"],{855:function(t,e,n){"use strict";(function(t,e){var i=n(4);n(26);i(n(25));var a=i(n(856));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n(1)["default"],n(2)["createPage"])},856:function(t,e,n){"use strict";n.r(e);var i=n(857),a=n(859);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n(861);var o,s=n(32),u=Object(s["default"])(a["default"],i["render"],i["staticRenderFns"],!1,null,null,null,!1,i["components"],o);u.options.__file="pages/prevention/ucharts.vue",e["default"]=u.exports},857:function(t,e,n){"use strict";n.r(e);var i=n(858);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},858:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return a})),n.d(e,"staticRenderFns",(function(){return o})),n.d(e,"recyclableRender",(function(){return r})),n.d(e,"components",(function(){return i}));try{i={uniNavBar:function(){return n.e("components/uni-nav-bar/uni-nav-bar").then(n.bind(null,1236))},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 t=this,e=t.$createElement,n=(t._self._c,t.timetab(t.oldtime)),i=t.timetab(t.newtime),a=t.$QueryPermission(264),r=a?t.__map(t.eqlistdata,(function(e,n){var i=t.__get_orig(e),a=t.forbidden?t._f("timeFormat")(e.d_h_t.addtime):null;return{$orig:i,f0:a}})):null,o=a||t.allqingchong?null:t.__map(t.eqlistdata,(function(e,n){var i=t.__get_orig(e),a=t.forbidden?t._f("timeFormat")(e.d_h_t.addtime):null;return{$orig:i,f1:a}})),s=!a&&t.allqingchong?t.__map(t.eqlistdata,(function(e,n){var i=t.__get_orig(e),a=t.forbidden?t._f("timeFormat")(e.d_h_t.addtime):null;return{$orig:i,f2:a}})):null;t._isMounted||(t.e0=function(e){t.pickshow=!t.pickshow}),t.$mp.data=Object.assign({},{$root:{m0:n,m1:i,m2:a,l0:r,l1:o,l2:s}})},r=!1,o=[];a._withStripped=!0},859:function(t,e,n){"use strict";n.r(e);var i=n(860),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},860:function(t,e,n){"use strict";(function(t){var i=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n(41)),r=i(n(43)),o=i(n(199)),s=null,u=null,d=null,l={data:function(){return{thdata:["上报时间","设备开关","工作状态","雨控状态","温控状态","倾倒状态","定时(h)","电击次数","温度(℃)","湿度(%)","充电电压(v)","电压状态","电池电压(v)","信号强度"],thdata2:["上报时间","设备开关","工作状态","雨控状态","温控状态","倾倒状态","定时(h)","电击次数","温度(℃)","湿度(%)"],thdata3:["上报时间","设备开关","工作状态","温控状态","定时(h)","温度(℃)","湿度(%)"],eqlistdata:[],cWidth:"400",cHeight:"400",pixelRatio:1,titletext:["24小时","近一个月","近半年","近一年"],titleidnex:0,oldtime:"",newtime:"",page:1,forbidden:!1,params:{year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!1},pickshow:!1,picktwoshow:!1,tishiTF:!1,times:{d_id:null,start_time:null,end_time:null,device_id:null},canvastishiTF:!1,dataloadingtf:!0,pagesum:1,allqingchong:!1}},onLoad:function(e){this.times.d_id=e.d_id,this.times.imei=e.imei,this.cWidth=t.upx2px(650),this.cHeight=t.upx2px(500),this.getworm()},onShow:function(){var t=this;d=+new Date,this.oldtime=parseInt((d-864e5)/1e3),this.newtime=parseInt(d/1e3),setTimeout((function(){t.getServerData(parseInt(d/1e3),parseInt((d-864e5)/1e3)),t.historydata(parseInt(d/1e3),parseInt((d-864e5)/1e3))}),1e3)},methods:{getServerData:function(t,e){var n=this;return(0,r.default)(a.default.mark((function i(){var r,o,s,u,d,l,c,h,m,f,p,g;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=forecast.worm_lamp.device_polyline_data",data:{device_type_id:2,d_id:n.times.d_id,end_time:t,start_time:e}});case 3:if(r=i.sent,n.dataloadingtf=!1,0==r.length)n.canvastishiTF=!1;else{for(n.canvastishiTF=!0,o=[],s=[],u=[],d=[],l=[],c=[],h=[],m=0;m<r.length;m++)f=new Date(1e3*r[m].addtime),o.unshift(f.getMonth()+1+"/"+f.getDate()+"-"+f.getHours()+":"+f.getMinutes()),u.unshift(r[m].temperature),d.unshift(r[m].humidity),l.unshift(Number(r[m].others.bv)),c.unshift(Number(r[m].others.cv)),h.unshift(r[m].others.ct);s.unshift(u,d,l,c),p=[{name:"温度",data:s[0],color:"#F97000"},{name:"湿度",data:s[1],color:"#00E29D"},{name:"电池电压",data:s[2],color:"#FF3F3F"},{name:"充电电压",data:s[3],color:"#6CBBFF"}],g=[{name:"击虫次数",data:h,color:"#00E29D"}],n.showColumn("canvasColumnA",o,p),n.showColumnb("canvasColumnB",o,g)}case 6:case"end":return i.stop()}}),i)})))()},changeindex:function(t){this.titleidnex=t;var e=new Date;if(0==t)this.newtime=parseInt(+new Date(e)/1e3),this.oldtime=parseInt((d-864e5)/1e3),this.getServerData(parseInt(d/1e3),parseInt((d-864e5)/1e3)),this.historydata(parseInt(d/1e3),parseInt((d-864e5)/1e3));else if(1==t){this.newtime=parseInt(+new Date(e)/1e3);var n=e.setMonth(e.getMonth()-1)/1e3;this.oldtime=parseInt(n),this.getServerData(parseInt(d/1e3),parseInt(n)),this.historydata(parseInt(d/1e3),parseInt(n))}else if(2==t){this.newtime=parseInt(+new Date(e)/1e3);n=e.setMonth(e.getMonth()-6)/1e3;this.oldtime=parseInt(n),this.getServerData(parseInt(d/1e3),parseInt(n)),this.historydata(parseInt(d/1e3),parseInt(n))}else if(3==t){this.newtime=parseInt(+new Date(e)/1e3);n=e.setFullYear(e.getFullYear()-1)/1e3;this.oldtime=parseInt(n),this.getServerData(parseInt(d/1e3),parseInt(n)),this.historydata(parseInt(d/1e3),parseInt(n))}this.newtime<this.oldtime?this.tishiTF=!0:this.tishiTF=!1},historydata:function(t,e){var n=this;return(0,r.default)(a.default.mark((function i(){var r;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=forecast.worm_lamp.device_history_data",data:{device_type_id:2,device_id:n.times.imei,page:n.page,page_size:10,start_time:e,end_time:t}});case 2:r=i.sent,console.log(r.data),n.pagesum=Math.ceil(r.counts/10)||1,n.eqlistdata=r.data,0==r.data.length?n.forbidden=!1:n.forbidden=!0;case 7: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(t){console.log(t),this.oldtime=+new Date(t.startDate)/1e3,this.newtime=+new Date(t.endDate)/1e3+57600,this.getServerData(this.newtime,this.oldtime),this.historydata(this.newtime,this.oldtime)},timetab:function(t){t=new Date(1e3*t);var e=t.getFullYear(),n=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,i=t.getDate()<10?"0"+t.getDate():t.getDate(),a=e+"/"+n+"/"+i;return a},pickone:function(t){this.oldtime=+new Date(t.year,t.month-1,t.day,t.hour,t.minute)/1e3,this.newtime<this.oldtime?this.tishiTF=!0:this.tishiTF=!1},picktwo:function(t){this.newtime=+new Date(t.year,t.month-1,t.day,t.hour,t.minute)/1e3,this.newtime<this.oldtime?this.tishiTF=!0:this.tishiTF=!1},serter:function(){0==this.tishiTF&&(this.getServerData(parseInt(d/1e3),parseInt(this.oldtime)),this.historydata(this.newtime,this.oldtime),t.showToast({title:"搜索成功",duration:2e3}))},clickLeft:function(){t.navigateBack({delta:1})},showColumn:function(t,e,n){var i=this;s=new o.default({canvasId:t,type:"line",legend:{position:"top"},fontSize:11,background:"#FFFFFF",pixelRatio:1,animation:!0,dataLabel:!1,categories:e,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(t,e,n){var i=this;u=new o.default({canvasId:t,type:"line",legend:{position:"top"},fontSize:11,background:"#FFFFFF",pixelRatio:1,animation:!0,dataLabel:!1,categories:e,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(t){console.log(t),s.scrollStart(t)},moveLineA:function(t){s.scroll(t)},touchEndLineA:function(t){s.scrollEnd(t),s.showToolTip(t,{format:function(t,e){return e+" "+t.name+":"+Number(t.data).toFixed(3)}})},touchLineBb:function(t){console.log(t),u.scrollStart(t)},moveLineBb:function(t){u.scroll(t)},touchEndLineBb:function(t){u.scrollEnd(t),u.showToolTip(t,{format:function(t,e){return e+" "+t.name+":"+t.data}})},newdata:function(){var e=this;return(0,r.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,e.$myRequest({url:"/api/api_gateway?method=forecast.send_control.get_device_config",data:{device_type_id:2,d_id:e.times.d_id,control_type:"data"}});case 2:i=n.sent,i?t.showToast({title:"刷新成功",duration:2e3,icon:"none"}):t.showToast({title:"刷新失败",duration:2e3,icon:"none"});case 4:case"end":return n.stop()}}),n)})))()},refresh:function(){this.newdata()},getworm:function(){var t=this;return(0,r.default)(a.default.mark((function e(){var n;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$myRequest({url:"/api/api_gateway?method=forecast.send_control.clear_insects_permission",data:{}});case 2:n=e.sent,console.log(n),t.allqingchong=1!=n[2];case 5:case"end":return e.stop()}}),e)})))()}}};e.default=l}).call(this,n(2)["default"])},861:function(t,e,n){"use strict";n.r(e);var i=n(862),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},862:function(t,e,n){}},[[855,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/prevention/ucharts.js.map