| 12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/environment/gshistory"],{927:function(t,e,n){"use strict";(function(t,e){var a=n(4);n(26);a(n(25));var i=a(n(928));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n(1)["default"],n(2)["createPage"])},928:function(t,e,n){"use strict";n.r(e);var a=n(929),i=n(931);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n(933);var o,s=n(32),c=Object(s["default"])(i["default"],a["render"],a["staticRenderFns"],!1,null,null,null,!1,a["components"],o);c.options.__file="pages/environment/gshistory.vue",e["default"]=c.exports},929:function(t,e,n){"use strict";n.r(e);var a=n(930);n.d(e,"render",(function(){return a["render"]})),n.d(e,"staticRenderFns",(function(){return a["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return a["recyclableRender"]})),n.d(e,"components",(function(){return a["components"]}))},930:function(t,e,n){"use strict";var a;n.r(e),n.d(e,"render",(function(){return i})),n.d(e,"staticRenderFns",(function(){return o})),n.d(e,"recyclableRender",(function(){return r})),n.d(e,"components",(function(){return a}));try{a={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 i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.timetab(t.begintime)),a=t.timetab(t.end),i=t.thdata.length,r=t.__map(t.historylistdata,(function(e,n){var a=t.__get_orig(e),i=t.forbidden?null:t._f("timeFormat")(e.uptime);return{$orig:a,f0:i}}));t._isMounted||(t.e0=function(e){t.tiemshow=!t.tiemshow}),t.$mp.data=Object.assign({},{$root:{m0:n,m1:a,g0:i,l0:r}})},r=!1,o=[];i._withStripped=!0},931:function(t,e,n){"use strict";n.r(e);var a=n(932),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=i.a},932:function(t,e,n){"use strict";(function(t){var a=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n(41)),r=a(n(43)),o=a(n(199)),s=null,c={data:function(){return{tiemshow:!1,begintime:"",end:"",dataloadingtf:!0,canvastishiTF:!1,device_id:"",thdata:["上传时间","空气湿度(%RH)","空气温度(℃)","10cm土壤温度(%RH)","20cm土壤温度(%RH)","30cm土壤温度(%RH)","10cm土壤湿度(%RH)","20cm土壤湿度(%RH)","30cm土壤湿度(%RH)","大气压强(Pa)"],forbidden:!1,historylistdata:[],pagesum:1,page:1,cWidth:"",cHeight:"",pixelRatio:1}},methods:{tiemchange:function(t){this.begintime=parseInt(+new Date(t.startDate)/1e3),this.end=parseInt(+new Date(t.endDate)/1e3),this.histprydatas()},timetab:function(t){t=new Date(1e3*t);var e=t.getFullYear(),n=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,a=t.getDate()<10?"0"+t.getDate():t.getDate(),i=e+"/"+n+"/"+a;return i},histprydatas:function(){var t=this;return(0,r.default)(i.default.mark((function e(){var n,a,r,o,s,c,d,u,l,h;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.dataloadingtf=!0,e.next=3,t.$myRequest({url:"/api/api_gateway?method=weather.weather.nd_data",data:{device_id:t.device_id,page:t.page,begin:t.begintime,end:t.end}});case 3:for(n=e.sent,t.dataloadingtf=!1,console.log(n.nums),t.pagesum=Math.ceil(n.nums/10)||1,t.historylistdata=n.dat_list,a=0;a<t.historylistdata.length;a++)t.historylistdata[a].temp=t.historylistdata[a].temp.split(","),t.historylistdata[a].swc=t.historylistdata[a].swc.split(","),t.historylistdata[a].ecs=t.historylistdata[a].ecs.split(",");for(r=[],o=[],s=[],c=[{name:"空气温度",data:[],color:"#00E29D"},{name:"空气湿度",data:[],color:"#6CBBFF"}],d=[],0,a=0;a<n.dat_char.length;a++){for(u=new Date(1e3*n.dat_char[a].uptime),s.unshift(u.getMonth()+1+"/"+u.getDate()+"-"+u.getHours()+":"+u.getMinutes()),r.unshift(""==n.dat_char[a].at?"0":n.dat_char[a].at),o.unshift(""==n.dat_char[a].ats?"0":n.dat_char[a].ats),n.dat_char[a].temp=n.dat_char[a].temp.split(","),n.dat_char[a].swc=n.dat_char[a].swc.split(","),n.dat_char[a].ecs=n.dat_char[a].ecs.split(","),l=0;l<n.dat_char[a].temp.length;l++)d.unshift(""==n.dat_char[a].temp[l]?"0":n.dat_char[a].temp[l]);t.thdata.length=1,n.depth.split(",").forEach((function(e,i){t.thdata.push("".concat(e,"cm土壤温度(℃)")),n.dat_char[a].temp.forEach((function(t,i){var r=[],o=[],s=[];r.push(Number(t)),o.push(Number(n.dat_char[a].swc[i])),n.dat_char[a].ecs[i]&&s.push(Number(n.dat_char[a].ecs[i]));var d={name:e+"cm土壤温度(℃)",data:r},u={name:e+"cm土壤湿度(%RH)",data:o},l={name:e+"cm电导率(ms/cm)",data:s};c.push(u),c.push(d),s.length>0&&c.push(l)}))})),n.depth.split(",").forEach((function(e,n){t.thdata.push("".concat(e,"cm土壤湿度(%RH)"))})),n.depth.split(",").forEach((function(e,n){t.thdata.push("".concat(e,"cm电导率(ms/cm)"))}))}c[0].data=r,c[1].data=o,h=[],c.forEach((function(t,e){for(var n=0;n<h.length;n++)if(h[n].name==t.name&&void 0!==t.data)return void h[n].data.unshift(t.data[0]);h.push({name:t.name,data:t.data})})),console.log(h),0==h.length?t.canvastishiTF=!1:t.canvastishiTF=!0,t.showColumn("canvasColumnA",s,h);case 23:case"end":return e.stop()}}),e)})))()},prev:function(){this.page>1&&(this.page--,this.histprydatas())},next:function(){this.page<this.pagesum&&(this.page++,this.histprydatas())},clickLeft:function(){t.navigateBack({delta:1})},showColumn:function(t,e,n){var a=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*a.cWidth,height:1*a.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+":"+t.data}})}},onLoad:function(e){this.cWidth=t.upx2px(650),this.cHeight=t.upx2px(500),this.device_id=e.id,this.end=parseInt(+new Date/1e3),this.begintime=parseInt(this.end-86400),this.histprydatas()}};e.default=c}).call(this,n(2)["default"])},933:function(t,e,n){"use strict";n.r(e);var a=n(934),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=i.a},934:function(t,e,n){}},[[927,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/environment/gshistory.js.map
|