pages-weather-history.d0e68368.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-weather-history"],{"05f6":function(t,e,r){var n=r("8d8f");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=r("4f06").default;a("f5478158",n,!0,{sourceMap:!1,shadowMode:!1})},"2bec":function(t,e,r){"use strict";r.r(e);var n=r("f650"),a=r.n(n);for(var i in n)"default"!==i&&function(t){r.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a},"311d":function(t,e,r){"use strict";var n=r("4ea4");r("a9e3"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r("96cf");var a=n(r("1da1")),i={name:"w-line-charts",data:function(){return{loading:!0,opts:{color:["#317afd"],padding:[10,10,0,15],enableScroll:!0,legend:{position:"top",float:"left"},dataLabel:!1,dataPointShapeType:"hollow",xAxis:{disableGrid:!0,fontColor:"#999",fontSize:10,axisLineColor:"#F4F7F9",scrollShow:!0,itemCount:5},yAxis:{gridColor:"#F4F7F9",gridType:"solid",dashLength:2,data:[{axisLineColor:"#F4F7F9",fontColor:"#999",fontSize:10}]},extra:{line:{type:"curve",width:3},tooltip:{showArrow:!0,gridType:"dash",labelBgColor:"#66ccff",gridColor:"#317afd"},markLine:{type:"dash",dashLength:5,data:[{lineColor:"#1A6EFE"}]}}}}},props:{chartData:{type:[Array,Object],default:function(){return[]}},width:{type:[Number],default:0},height:{type:[Number],default:0}},watch:{chartData:{deep:!0,handler:function(t){}}},mounted:function(){var t=this;return(0,a.default)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.width){e.next=2;break}return e.abrupt("return");case 2:case"end":return e.stop()}}),e)})))()},methods:{}};e.default=i},"33a6":function(t,e,r){var n=r("99cb");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=r("4f06").default;a("da485762",n,!0,{sourceMap:!1,shadowMode:!1})},"416c":function(t,e,r){"use strict";r.r(e);var n=r("b0e3"),a=r.n(n);for(var i in n)"default"!==i&&function(t){r.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a},4519:function(t,e,r){"use strict";var n=r("4ea4");r("99af"),r("4160"),r("b64b"),r("acd8"),r("ac1f"),r("1276"),r("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.getWeatherWarning=e.getWeatherDayData=e.getWeatherChart=e.getWeatherHistory=e.getWeatherDeviceDetail=e.getWeatherDeviceList=void 0,r("96cf");var a=n(r("1da1")),i=n(r("be72")),u=r("21f4"),s=function(){var t=(0,a.default)(regeneratorRuntime.mark((function t(e,r){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i.default.post("api/api_gateway?method=weather.weather.".concat(e),r);case 2:return n=t.sent,t.abrupt("return",null===n||void 0===n?void 0:n.data);case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),c=function(t){return s("qxz_page",t)};e.getWeatherDeviceList=c;var o=function(){var t=(0,a.default)(regeneratorRuntime.mark((function t(e){var r,n,a,i,u,c,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s("qxz_status",e);case 2:for(u in r=t.sent,n=r.dat,a=r.conf,i=[],n)n[u]&&"uptime"!=u&&(console.log(n[u]),c=n[u].split("#"),o=a[u].split("#"),i.push({el:u,markId:c[1],text:"".concat(o[0]," ").concat(o[1]),value:"".concat(c[0])}));return t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();e.getWeatherDeviceDetail=o;var d=function(){var t=(0,a.default)(regeneratorRuntime.mark((function t(e){var r,n,a,i,c,o,d,l,f,p,h,v,g;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s("qxz_detail",e);case 2:for(d in r=t.sent,n=r.data,a=r.nums,i=r.conf,c=r.rainFall,o=[{text:"日期",value:"date"}],i)i[d]&&(l=i[d].split("#"),o.push({text:l[0]+l[1],value:d}));for(f=[],p=0;p<n.length;p++){for(v in h={date:(0,u.timeFormat)(n[p].time,"yyyy-mm-dd hh:MM:ss")},n[p].dat)n[p].dat[v]&&(g=n[p].dat[v].split("#"),h[v]=g[0]);f.push(h)}return t.abrupt("return",{headers:o,list:f,nums:a,rainFall:c});case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();e.getWeatherHistory=d;var l=function(){var t=(0,a.default)(regeneratorRuntime.mark((function t(e){var r,n,a,i,c,o,d,l,f,p;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s("qxz_data_chart",e);case 2:if(r=t.sent,n=r.data,a=r.conf,n){t.next=7;break}return t.abrupt("return");case 7:for(i=[],c=[],o={},Object.keys(a).forEach((function(t){a[t]&&(c.push({text:a[t].split("#").join(" "),value:t}),o[t]=[])})),d=0;d<n.length;d++){for(l in o)f=n[d].dat[l],f&&(p=f.split("#")[0],o[l].push(parseFloat(p)));i.push((0,u.timeFormat)(n[d].time,"mm月dd日"))}return t.abrupt("return",{times:i,pickes:c,charts:o});case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();e.getWeatherChart=l;var f=function(){var t=(0,a.default)(regeneratorRuntime.mark((function t(e){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s("qxz_day_data",e);case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();e.getWeatherDayData=f;var p=function(t){return s("qxz_warning",t)};e.getWeatherWarning=p},"4f54":function(t,e,r){"use strict";r.r(e);var n=r("a32b"),a=r("416c");for(var i in a)"default"!==i&&function(t){r.d(e,t,(function(){return a[t]}))}(i);r("7ce6");var u,s=r("f0c5"),c=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"33faf0d5",null,!1,n["a"],u);e["default"]=c.exports},"7ce6":function(t,e,r){"use strict";var n=r("05f6"),a=r.n(n);a.a},"81dc":function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return n}));var n={uiCharts:r("291c").default},a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-uni-view",[r("ui-charts",{ref:"wLineCharts",attrs:{type:"line",loadingType:0,ontouch:!0,opts:t.opts,chartData:t.chartData}})],1)},i=[]},"8d8f":function(t,e,r){var n=r("24fb");e=n(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是app内置的常用样式变量\r\n *\r\n * app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 水平间距 */\r\n/* 水平间距 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.picker[data-v-33faf0d5]{width:%?240?%;height:%?60?%;margin-left:%?18?%;font-size:%?24?%;border:#ddd %?1?% solid;border-radius:%?8?%}.picker-wrapper[data-v-33faf0d5]{display:flex;align-items:center;justify-content:space-between;height:%?60?%;padding:0 %?24?%;color:#999;line-height:1}',""]),t.exports=e},9977:function(t,e,r){"use strict";var n=r("33a6"),a=r.n(n);a.a},"99cb":function(t,e,r){var n=r("24fb");e=n(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是app内置的常用样式变量\r\n *\r\n * app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 水平间距 */\r\n/* 水平间距 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.history-chart[data-v-c6422ccc]{padding:%?32?% %?24?%}.history-panel[data-v-c6422ccc]{padding:%?24?% %?26?%;margin-bottom:%?100?%}',""]),t.exports=e},a32b:function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return n}));var n={uniIcons:r("1e47").default},a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-uni-view",[r("v-uni-picker",{staticClass:"picker",attrs:{range:t.list,"range-key":"text"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.bindPickerChange.apply(void 0,arguments)}}},[r("v-uni-view",{staticClass:"picker-wrapper"},[r("v-uni-view",{},[t._v(t._s(t.text))]),r("uni-icons",{attrs:{type:"bottom",size:12,color:"#DDDDDD"}})],1)],1)],1)},i=[]},b0e3:function(t,e,r){"use strict";r("7db0"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"ui-picker",data:function(){return{text:""}},props:{value:{type:String,default:""},list:{type:Array,default:function(){return[]}}},watch:{value:function(t){var e,r=this.list.find((function(e){return e.value==t}));return null!==(e=null===r||void 0===r?void 0:r.text)&&void 0!==e?e:""}},mounted:function(){var t,e=this,r=this.list.find((function(t){return t.value==e.value}));this.text=null!==(t=null===r||void 0===r?void 0:r.text)&&void 0!==t?t:""},methods:{bindPickerChange:function(t){var e=t.detail.value;this.text=this.list[e].text,this.$emit("onChagne",this.list[e])}}};e.default=n},c08b:function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return n}));var n={uiPicker:r("4f54").default,uniDatetimePicker:r("33ee").default,uniTable:r("7a71").default,uniTr:r("6afe").default,uniTh:r("fdf7").default,uniTd:r("54e4").default,uniPagination:r("611d").default},a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.loading?r("v-uni-view",[r("v-uni-view",{staticClass:"ui-card history-chart"},[r("v-uni-view",{staticClass:"row-end"},[r("ui-picker",{attrs:{value:t.pickesId,list:t.pickerList},on:{onChagne:function(e){arguments[0]=e=t.$handleEvent(e),t.changeChartData.apply(void 0,arguments)}}})],1),r("line-charts",{attrs:{chartData:t.chartShowData}})],1),r("v-uni-view",{staticClass:"ui-card history-panel"},[r("v-uni-view",{staticClass:"mb"},[r("uni-datetime-picker",{attrs:{type:"daterange",rangeSeparator:"-"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.changeSearchTime.apply(void 0,arguments)}},model:{value:t.searchTime,callback:function(e){t.searchTime=e},expression:"searchTime"}})],1),r("uni-table",{ref:"table",staticClass:"table-style",attrs:{loading:t.pageLoading,emptyText:"暂无更多数据"}},[r("uni-tr",[t._l(t.historyHeader,(function(e,n){return[r("uni-th",{key:n+"_0",attrs:{align:"center"}},[t._v(t._s(e.text))])]}))],2),t._l(t.historyList,(function(e,n){return r("uni-tr",{key:n},[t._l(e,(function(n,a,i){return[r("uni-td",{key:i+"_0",attrs:{align:"center"}},[t._v(t._s(e[a]))])]}))],2)}))],2),r("uni-pagination",{attrs:{current:t.params.page,total:t.total,title:"标题文字"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.changePagination.apply(void 0,arguments)}}})],1)],1):t._e()},i=[]},c5e1:function(t,e,r){"use strict";r.r(e);var n=r("311d"),a=r.n(n);for(var i in n)"default"!==i&&function(t){r.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a},cf4f:function(t,e,r){"use strict";r.r(e);var n=r("c08b"),a=r("2bec");for(var i in a)"default"!==i&&function(t){r.d(e,t,(function(){return a[t]}))}(i);r("9977");var u,s=r("f0c5"),c=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"c6422ccc",null,!1,n["a"],u);e["default"]=c.exports},f650:function(t,e,r){"use strict";var n=r("4ea4");r("d3b7"),r("3ca3"),r("ddb0"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r("96cf");var a=n(r("1da1")),i=n(r("f7f1")),u=r("4519"),s=r("21f4"),c={data:function(){return{loading:!1,pageLoading:!1,deviceId:"",chartShowData:{categories:[],series:[]},pickesId:"",pickerList:[],chartData:null,params:{start_time:(0,s.timeFrame)("start"),end_time:(0,s.timeFrame)("end"),device_id:"",page:1,page_size:10},searchTime:["",""],historyHeader:[],historyList:[],total:0}},components:{lineCharts:i.default},onLoad:function(t){var e=this;return(0,a.default)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.deviceId=t.id,e.params.device_id=t.id,e.$api.loading("加载中..."),r.next=5,Promise.all([e.getHistoryList(),e.getWeatherChart()]);case 5:e.loading=!0,e.$api.hide();case 7:case"end":return r.stop()}}),r)})))()},methods:{changeSearchTime:function(t){this.params.start_time=t[0]?(0,s.dateToUnix)(t[0]):(0,s.timeFrame)("start"),this.params.end_time=t[0]?(0,s.dateToUnix)(t[1]):(0,s.timeFrame)("end"),this.searchTime=t,this.params.page=1,this.getHistoryList(),this.getWeatherChart()},changeChartData:function(t){var e;this.pickesId=t.value,this.chartShowData.series=[{name:t.text,data:null!==(e=this.chartData[t.value])&&void 0!==e?e:[]}]},changePagination:function(t){this.params.page=t.current,this.getHistoryList()},getHistoryList:function(){var t=this;return(0,a.default)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.pageLoading=!0,e.next=3,(0,u.getWeatherHistory)(t.params);case 3:r=e.sent,t.historyHeader=r.headers,t.historyList=r.list,t.total=r.nums,t.pageLoading=!1;case 8:case"end":return e.stop()}}),e)})))()},getWeatherChart:function(){var t=this;return(0,a.default)(regeneratorRuntime.mark((function e(){var r,n,a,i,s,c,o,d,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,u.getWeatherChart)({device_id:t.params.device_id,begin:t.params.start_time,end:t.params.end_time});case 2:c=e.sent,o=c.times,d=c.pickes,l=c.charts,t.chartData=l,t.pickerList=d,t.pickesId=null!==(r=null===(n=d[0])||void 0===n?void 0:n.value)&&void 0!==r?r:"",t.chartShowData={categories:o,series:[{name:null!==(a=null===(i=d[0])||void 0===i?void 0:i.text)&&void 0!==a?a:"",data:null!==(s=l[t.pickesId])&&void 0!==s?s:[]}]};case 10:case"end":return e.stop()}}),e)})))()}}};e.default=c},f7f1:function(t,e,r){"use strict";r.r(e);var n=r("81dc"),a=r("c5e1");for(var i in a)"default"!==i&&function(t){r.d(e,t,(function(){return a[t]}))}(i);var u,s=r("f0c5"),c=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,"1ec94d18",null,!1,n["a"],u);e["default"]=c.exports}}]);