1 line
7.0 KiB
JavaScript
1 line
7.0 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/fertilizer_machine/fertilizer_machine"],{"0437":function(t,e,i){"use strict";i.r(e);var n=i("cc0a"),a=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);e["default"]=a.a},6498:function(t,e,i){"use strict";i.r(e);var n=i("f8ee"),a=i("0437");for(var r in a)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(r);i("a3e9");var u=i("f0c5"),o=Object(u["a"])(a["default"],n["b"],n["c"],!1,null,"0c2173b6",null,!1,n["a"],void 0);e["default"]=o.exports},"991d":function(t,e,i){},a3e9:function(t,e,i){"use strict";var n=i("991d"),a=i.n(n);a.a},a653:function(t,e,i){"use strict";(function(t,e){var n=i("4ea4");i("d913");n(i("66fd"));var a=n(i("6498"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(a.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},cc0a:function(t,e,i){"use strict";var n=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a,r=n(i("9523")),u={data:function(){return{background:{backgroundColor:"#24B383"},dataInfo2_list:[{image:"/static/icon_1.png",title:"灌溉剩余时长",timer:"0min"},{image:"/static/icon_2.png",title:"灌溉瞬时流量",timer:"0L/h"},{image:"/static/icon_3.png",title:"本次灌溉量",timer:"0L"},{image:"/static/icon_4.png",title:"启动方式",timer:"无"},{image:"/static/icon_5.png",title:"使用灌溉配方号",timer:"0"},{image:"/static/icon_6.png",title:"执行灌溉组号",timer:"0"}],signalCurrent:0,show:!1,rightList2:["外控信号2#","外控信号1#","外控信号3#","外控信号4#","高液位信号","中液位信号","低液位信号","电机信号"],irrigate_value1:0,irrigate_value2:0,irrigate_value3:0,deviceId:0,inputData:[],centerBottom:[],right2Index:[],openType:"",left1Act:-1,topActive:0,indexs:1,inputData1:[]}},watch:{},onLoad:function(t){this.deviceId=t.id,this.dataInit()},methods:(a={countData10:function(t){return t?t/10:0},dataInit:function(){var t=this,e=this,i=this.deviceId,n={equipmentId:i,pattern:0,regNum:71};this.$http({url:this.api.readFs_state,data:n}).then((function(i){200==i.code?(t.inputData=i.data,t.getData30(),t.getData29(),t.getDataInfo2(),t.getcenterBottom()):e.$refs.uToast.show({title:i.msg,type:"error"})}))},getReg:function(){var t=this,e=this,i={equipmentId:this.deviceId,pattern:this.indexs-1+10+"00",regNum:61};this.$http({url:this.api.readFs_reg,data:i}).then((function(i){console.log(i,11),200==i.code?(t.inputData1=i.data,t.getType00(),t.inputData1[t.indexs-1+10+"01"]=t.countData10(t.inputData1[t.indexs-1+10+"01"]),console.log(t.inputData1[t.indexs-1+10+"01"],111)):e.$refs.uToast.show({title:i.msg,type:"error"})}))},padString:function(t,e){return t.padStart(e,"0")},getType00:function(){var t=this.padString(this.inputData1[this.indexs-1+10+"00"].toString(2),3);console.log(t),Number(t[0])?this.topActive=1:Number(t[1])?this.topActive=2:Number(t[2])?this.topActive=3:this.topActive=0},change00:function(t){this.topActive=t;var e=["0","0","0"];e[0]=1==t?"1":"0",e[1]=2==t?"1":"0",e[2]=3==t?"1":"0";var i=e.join(""),n={target:{value:parseInt(i,2)}};this.change(this.indexs-1+10+"00",n)},getDataInfo2:function(){var t=this.inputData;this.dataInfo2_list[0].timer=this.countData(t["36"])+"min",this.dataInfo2_list[1].timer=this.countData(t["28"])+"L/h",this.dataInfo2_list[2].timer=this.countData(t["37"])+"L",this.dataInfo2_list[4].timer=this.countData(t["31"]),this.dataInfo2_list[5].timer=this.countData(t["38"])},getData29:function(){for(var t=this.padString(this.inputData["29"].toString(2),14),e=-1,i=0;i<6;i++)Number(t[i])&&(e=i);this.openType=this.getType29(e),this.dataInfo2_list[3].timer=this.getType29(e);for(var n=0;n<8;n++)Number(t[t.length-n])&&this.right2Index.push(n)},getData30:function(){var t=this.padString(this.inputData["30"].toString(2),2);Number(t[0])?this.left1Act=1:Number(t[1])?this.left1Act=0:this.left1Act=-1},changeData10:function(t,e){var i=10*e.target.value,n={target:{value:i}};this.change(t,n)},change:function(t,e){var i={equipmentId:this.deviceId,regAddress:t,num:e.target.value};this.delayTimer(0,i)},delayTimer:function(t,e){var i=this,n=this;this.timer&&clearInterval(this.timer),this.timer=setInterval((function(){++t,5==t&&(n.changeData(e),clearInterval(i.timer))}),100)},changeData:function(t){var e=this,i=this;this.$http({url:this.api.writeFs,data:t}).then((function(t){200==t.code?(e.getReg(),i.$refs.uToast.show({title:t.msg,type:"success"})):i.$refs.uToast.show({title:t.msg,type:"error"})}))},getcenterBottom:function(){this.centerBottom=[];for(var t=this.inputData,e=this.padString(t["32"].toString(2),16),i=this.padString(t["33"].toString(2),16),n=this.padString(t["34"].toString(2),16),a=this.padString(t["35"].toString(2),16),r=0;r<16;r++)Number(e[e.length-1-r])&&this.centerBottom.push(r);for(var u=0;u<16;u++)Number(i[i.length-1-u])&&this.centerBottom.push(u+16);for(var o=0;o<16;o++)Number(n[n.length-1-o])&&this.centerBottom.push(o+32);for(var s=0;s<16;s++)Number(a[a.length-1-s])&&this.centerBottom.push(s+48)},countData:function(t){return t||0}},(0,r.default)(a,"padString",(function(t,e){return t.padStart(e,"0")})),(0,r.default)(a,"countData100",(function(t){return t?t/100:0})),(0,r.default)(a,"getType29",(function(t){return 0==t?"手动开启动":1==t?"外控模式启动":2==t?"光照积累启动":3==t?"土壤湿度控制":4==t?"间隔启动":5==t?"定时启动":"无"})),(0,r.default)(a,"countType1",(function(t){return t-400})),(0,r.default)(a,"countType2",(function(t){return t/10})),(0,r.default)(a,"countType3",(function(t){return(t-400)/10})),(0,r.default)(a,"getTypeData",(function(t,e){var i=this,n=this.$store.state.typeList,a=0;return n.forEach((function(t,n){t.value==i.inputData1[e]&&(console.log(i.inputData1[e],111,t.countType),a=t.countType)})),0==a?this.inputData[t]:1==a?this.countType1(this.inputData[t]):2==a?this.countType2(this.inputData[t]):3==a?this.countType3(this.inputData[t]):void 0})),(0,r.default)(a,"signalHandler",(function(t){this.signalCurrent=t})),(0,r.default)(a,"showPop",(function(t){this.show=!0,this.indexs=t,this.getReg()})),(0,r.default)(a,"closePop",(function(){this.show=!1})),a)};e.default=u},f8ee:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return n}));var n={uNavbar:function(){return i.e("node-modules/uview-ui/components/u-navbar/u-navbar").then(i.bind(null,"ce19"))},uPopup:function(){return i.e("node-modules/uview-ui/components/u-popup/u-popup").then(i.bind(null,"de64"))},uToast:function(){return i.e("node-modules/uview-ui/components/u-toast/u-toast").then(i.bind(null,"d596"))}},a=function(){var t=this,e=t.$createElement,i=(t._self._c,t.__map(64,(function(e,i){var n=t.__get_orig(e),a=t.centerBottom.indexOf(i);return{$orig:n,g0:a}}))),n=t.countData100(t.inputData["6"]),a=t.countData100(t.inputData["8"]),r=t.countData100(t.inputData["7"]),u=t.countData100(t.inputData["9"]),o=t.__map(t.rightList2,(function(e,i){var n=t.__get_orig(e),a=t.right2Index.indexOf(i);return{$orig:n,g1:a}}));t.$mp.data=Object.assign({},{$root:{l0:i,m0:n,m1:a,m2:r,m3:u,l1:o}})},r=[]}},[["a653","common/runtime","common/vendor"]]]); |