| 12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/irrigate/search"],{1023:function(t,e,n){"use strict";(function(t,e){var a=n(4);n(26);a(n(25));var i=a(n(1024));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n(1)["default"],n(2)["createPage"])},1024:function(t,e,n){"use strict";n.r(e);var a=n(1025),i=n(1027);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n(1029);var o,r=n(32),c=Object(r["default"])(i["default"],a["render"],a["staticRenderFns"],!1,null,null,null,!1,a["components"],o);c.options.__file="pages/irrigate/search.vue",e["default"]=c.exports},1025:function(t,e,n){"use strict";n.r(e);var a=n(1026);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"]}))},1026: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 s})),n.d(e,"components",(function(){return a}));try{a={uIcon:function(){return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null,1200))},uModal:function(){return n.e("uview-ui/components/u-modal/u-modal").then(n.bind(null,1243))},uInput:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,1264))}}}catch(r){if(-1===r.message.indexOf("Cannot find module")||-1===r.message.indexOf(".vue"))throw r;console.error(r.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.__map(t.eqlistdata,(function(e,n){var a=t.__get_orig(e),i=13==t.side_type?t._f("timeFormat")(e.uptime):null;return{$orig:a,f0:i}})));t.$mp.data=Object.assign({},{$root:{l0:n}})},s=!1,o=[];i._withStripped=!0},1027:function(t,e,n){"use strict";n.r(e);var a=n(1028),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},1028: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)),s=a(n(43)),o=n(86),r={data:function(){return{eqlistdata:[],imports:"",side_type:"",page:1,show:!1,showremark:!1,isTop:!1}},methods:{eqlist:function(){var t=this;return(0,s.default)(i.default.mark((function e(){var n,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingtf=!0,e.next=3,t.$myRequest({url:"/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_list",data:{page:t.page,page_size:10,content:t.imports}});case 3:for(n=e.sent,console.log(n),t.loadingtf=!1,a=0;a<n.data.length;a++)n.data[a]["status2"]=1==n.data[a].status;t.eqlistdata=t.eqlistdata.concat(n.data);case 8:case"end":return e.stop()}}),e)})))()},tubulareqlist:function(){var t=this;return(0,s.default)(i.default.mark((function e(){var n,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingtf=!0,e.next=3,t.$myRequest({url:"/api/api_gateway?method=irrigation_system.hydropower.hydropower_list",data:{page:t.page,page_size:10,content:t.imports}});case 3:for(n=e.sent,console.log(n),t.loadingtf=!1,a=0;a<n.data.length;a++)n.data[a]["water_pump_switch2"]=1==n.data[a].water_pump_switch;t.eqlistdata=t.eqlistdata.concat(n.data),console.log(t.eqlistdata);case 9:case"end":return e.stop()}}),e)})))()},sfeqlist:function(){var t=this;return(0,s.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingtf=!0,e.next=3,t.$myRequest({url:"/api/api_gateway?method=weather.weather.sf_page",data:{page:t.page,page_size:"10",device_id:t.imports}});case 3:n=e.sent,t.loadingtf=!1,t.eqlistdata=t.eqlistdata.concat(n.ids),console.log(t.eqlistdata);case 7:case"end":return e.stop()}}),e)})))()},eqdetails:function(e){13==this.side_type&&t.navigateTo({url:"../waterandfer/datails?shebei="+JSON.stringify(e)})},top:function(){t.pageScrollTo({scrollTop:0,duration:500})},search:function(){console.log(111),t.navigateTo({url:"./search?side_type="+this.side_type})},searchinp:function(){var t=this;(0,o.Debounce)((function(){t.page=1,t.eqlistdata=[],18==t.side_type?t.eqlist():17==t.side_type?t.tubulareqlist():13==t.side_type&&t.sfeqlist()}),1e3)()},tabClick:function(t,e){this.active=t,this.side_type=e,this.page=1,18==e?(this.eqlistdata=[],this.eqlist()):17==e?(this.eqlistdata=[],this.tubulareqlist()):13==e&&(this.eqlistdata=[],this.sfeqlist())},timezhuan:function(t){function e(t){return 1==String(t).length?"0"+t:t}var n=new Date(1e3*t),a=n.getFullYear(),i=n.getMonth()+1,s=n.getDate(),o=n.getHours(),r=n.getMinutes(),c=n.getSeconds();return"".concat(a,"-").concat(e(i),"-").concat(e(s)," ").concat(e(o),":").concat(e(r),":").concat(e(c))},newdata:function(e){17==this.side_type?t.navigateTo({url:"realtimedata?item="+JSON.stringify(e)}):t.navigateTo({url:"weathdata?item="+JSON.stringify(e)})},selectaddress:function(e,n){t.request({type:"GET",url:"https://restapi.amap.com/v3/geocode/geo?address="+e+"&key=78ce288400f4fc6d9458989875c833c2",dataType:"json",complete:function(e){console.log(e),1==e.data.status?t.navigateTo({url:"./irrmap?lnglat="+e.data.geocodes[0].location+"&basename="+n}):t.showToast({title:"地址编译失败",icon:"none"})}})},pumpcontrol:function(e){var n=this;return(0,s.default)(i.default.mark((function a(){var s;return i.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return console.log(e),a.next=3,n.$myRequest({url:"/api/api_gateway?method=irrigation_system.hydropower.water_pump_control",data:{times:Math.floor(60*n.timevalue),device_id:n.selid,status:e?1:0}});case 3:s=a.sent,console.log(s),200==s.code?t.showToast({title:"操作成功",icon:"none"}):(t.showToast({title:s.msg,icon:"none"}),n.eqlistdata[n.selindex].water_pump_switch2=!n.eqlistdata[n.selindex].water_pump_switch2),n.timevalue="";case 7:case"end":return a.stop()}}),a)})))()},switchchange:function(t,e,n){this.eqlistdata[n].water_pump_switch2=t.detail.value,t.detail.value?(this.show=!0,this.selindex=n,this.selid=e):(this.selid=e,this.pumpcontrol(!1))},switchchange2:function(e,n,a){var o=this;return(0,s.default)(i.default.mark((function s(){var r;return i.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return console.log(n),i.next=3,o.$myRequest({url:"/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_control",data:{device_ids:n,isopen:e?1:0}});case 3:r=i.sent,console.log(r),"ok"==r.info?t.showToast({title:"操作成功",icon:"none"}):(t.showToast({title:r.msg,icon:"none"}),o.eqlistdata[a].status2=!o.eqlistdata[a].status2);case 6:case"end":return i.stop()}}),s)})))()},modalcancel:function(){this.eqlistdata[this.selindex].water_pump_switch2=!this.eqlistdata[this.selindex].water_pump_switch2,this.timevalue=""},modalconfirm:function(){this.show=!0,""==this.timevalue?t.showToast({title:"请输入开泵时间",icon:"none"}):(this.show=!1,this.pumpcontrol(!0))},changeremark:function(t,e){this.timevalueremark=t.device_notes,this.showremark=!0,this.selindex=e,this.selid=t.device_id},modalcancelremark:function(){},modalconfirmremark:function(){this.showremark=!0,""==this.timevalueremark?t.showToast({title:"请输入设备备注",icon:"none"}):(this.showremark=!1,this.setchangeremark())},setchangeremark:function(){var e=this;return(0,s.default)(i.default.mark((function n(){var a;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$myRequest({url:"/api/api_gateway?method=irrigation_system.hydropower.water_pump_modify_device_notes",data:{device_id:e.selid,content:e.timevalueremark}});case 2:a=n.sent,console.log(a),a&&(t.showToast({title:"操作成功",icon:"none"}),e.eqlistdata[e.selindex].device_notes=e.timevalueremark);case 5:case"end":return n.stop()}}),n)})))()}},onLoad:function(t){this.side_type=t.side_type,console.log(this.side_type)},onReachBottom:function(){this.page++,18==this.side_type?this.eqlist():17==this.side_type?this.tubulareqlist():13==this.side_type&&this.sfeqlist()},onPageScroll:function(t){t.scrollTop>200?this.isTop=!0:this.isTop=!1}};e.default=r}).call(this,n(2)["default"])},1029:function(t,e,n){"use strict";n.r(e);var a=n(1030),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},1030:function(t,e,n){}},[[1023,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/irrigate/search.js.map
|