diff --git a/src/App.vue b/src/App.vue index 8bee5e7..68b8ff5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,16 @@ + + diff --git a/src/pages/estate/estate-industry.vue b/src/pages/estate/estate-industry.vue new file mode 100644 index 0000000..b96a6a9 --- /dev/null +++ b/src/pages/estate/estate-industry.vue @@ -0,0 +1,600 @@ + + + + + diff --git a/src/pages/estate/estate-materiels.vue b/src/pages/estate/estate-materiels.vue new file mode 100644 index 0000000..b53d73c --- /dev/null +++ b/src/pages/estate/estate-materiels.vue @@ -0,0 +1,671 @@ + + + + + diff --git a/src/pages/estate/estate-price.vue b/src/pages/estate/estate-price.vue index 446ca32..f1467e9 100644 --- a/src/pages/estate/estate-price.vue +++ b/src/pages/estate/estate-price.vue @@ -33,9 +33,9 @@ 价格:{{ item.price }} - + @@ -83,7 +83,7 @@ - + @@ -161,7 +161,7 @@ + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 51f7c5b..f7e6561 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -5,7 +5,8 @@ - {{menu.label}} + {{menu.parent}}-{{menu.label}} + {{menu.label}} @@ -13,7 +14,7 @@ {{cdm.label}} - + @@ -51,8 +52,20 @@ }, ], }, + // { + // label:'基础数据管理', + // children:[ + // { + // label:'城镇数据', + // }, + // { + // label:'基地数据', + // }, + // ], + // }, { - label:'基础数据管理', + label:'全市基础数据', + parent:'基础数据管理', children:[ { label:'城镇数据', @@ -60,35 +73,57 @@ { label:'基地数据', }, + ], + }, + { + label:'农作物数据', + parent:'基础数据管理', + children:[ { label:'城镇农作物', }, { label:'基地农作物', - }, + } + ], + }, + { + label:'农作物产量', + parent:'基础数据管理', + children:[ { label:'城镇产量', }, { label:'基地产量', }, + ], + }, + { + label:'重点产业', + parent:'基础数据管理', + children:[ { label:'稻虾价格', url:'/pages/estate/estate-price' }, { label:'稻虾每周价格', + url:'/pages/estate/estate-week-price' }, { label:'稻虾产业', + url:'/pages/estate/estate-industry' }, { label:'稻虾流向', + url:'/pages/estate/estate-flows' }, { label:'大宗物资', + url:'/pages/estate/estate-materiels' }, - ], + ] }, { label:'设备管理', @@ -132,6 +167,7 @@ background-color: #f8f8f8; .content-box{ padding-top: 30rpx; + padding-bottom: 150rpx; } } .menus-section{ diff --git a/src/pages/index/meteorological.vue b/src/pages/index/meteorological.vue index c441459..c1ca965 100644 --- a/src/pages/index/meteorological.vue +++ b/src/pages/index/meteorological.vue @@ -44,7 +44,7 @@ @@ -187,6 +187,7 @@ components: { QiunDataCharts }, data() { return { + optsc:{}, opts: { dataLabel:false,//显示数据 padding:[10,40,25,25], @@ -197,6 +198,11 @@ yAxis: { gridType: "dash", dashLength: 5, + data:[ + { + min:0 + } + ] }, extra: { area: { @@ -207,6 +213,7 @@ }, } }, + opts2: { dataLabel:false,//显示数据 padding:[10,40,25,25], @@ -310,6 +317,7 @@ }, onLoad(){ this.queryDeviceBasics(); + this.optsc = JSON.parse(JSON.stringify(this.opts)); }, onReady() { @@ -324,13 +332,13 @@ }) console.log(narray); this.addressName = narray[0].name; - this.$refs.uDropdown.highlight(0); + this.$refs.uDropdown.highlight(); this.queryAddressDevicePoints(val); }, //地区下设备id change2(val){ - this.$refs.uDropdown.highlight(1); + this.$refs.uDropdown.highlight(); this.queryMonitoringData(); }, //日期范围 @@ -400,7 +408,6 @@ this.deviceAddressList = _data; this.addressValue = _data[0].id; this.addressName = _data[0].name; - this.$refs.uDropdown.highlight(0); this.queryAddressDevicePoints(this.addressValue); } }).catch(()=>{ @@ -446,12 +453,8 @@ if(data.code==200){ let info = data.data; let chartInfo = {}; - if(params.start_time!=params.end_time){//不是当天 - this.opts.xAxis.labelCount = 3; - this.opts2.xAxis.labelCount = 3; - this.opts3.xAxis.labelCount = 3; - this.opts4.xAxis.labelCount = 3; - } + + for(let fk in info){ let _item = { categories: [], @@ -472,6 +475,26 @@ chartInfo[fk] = _item; } console.log(chartInfo,'chartDatas--') + let labcount = 5; + if(params.start_time!=params.end_time){//不是当天 + labcount = 3; + }else{ + let len = chartInfo.air_temperature.categories.length-1; + labcount = 5; + let aw = len>10?len%6:len%5; + if(aw==3||aw==0||aw==1){ + labcount = 4; + }else if(aw==2){ + labcount = 3; + }else{ + labcount=5; + } + } + this.optsc.xAxis.labelCount = labcount; + this.opts.xAxis.labelCount = labcount; + this.opts2.xAxis.labelCount = labcount; + this.opts3.xAxis.labelCount = labcount; + this.opts4.xAxis.labelCount = labcount; //start 空气温度 air_temperature this.air_temperature = chartInfo.air_temperature; @@ -486,6 +509,16 @@ } ] }; + let min_temperature = 0; + for(let val of this.air_temperature.data){ + if(val<0){ + min_temperature = val; + } + } + if(min_temperature<0){ + this.optsc.yAxis.data = []; + } + this.chart_air_temperature = JSON.parse(JSON.stringify(res)); //end 空气温度 air_temperature //start 空气湿度 diff --git a/src/pages/index/soil-monitoring.vue b/src/pages/index/soil-monitoring.vue index 23d70da..f964d14 100644 --- a/src/pages/index/soil-monitoring.vue +++ b/src/pages/index/soil-monitoring.vue @@ -48,19 +48,19 @@ - + Ⅰ级预警 {{deviceWarning[1]?deviceWarning[1]:0}} - + Ⅱ级预警 {{deviceWarning[2]?deviceWarning[2]:0}} - + Ⅲ级预警 {{deviceWarning[3]?deviceWarning[3]:0}} - + Ⅳ级预警 {{deviceWarning[4]?deviceWarning[4]:0}} @@ -103,7 +103,7 @@ @@ -200,6 +200,7 @@ components: { QiunDataCharts }, data() { return { + optsc:{}, opts: { dataLabel:false,//显示数据 padding:[10,40,25,25], @@ -283,11 +284,19 @@ }, onLoad(){ this.queryDeviceBasics(); + this.optsc = JSON.parse(JSON.stringify(this.opts)); }, onShow(){ }, methods:{ + warningClickFn(lv){ + + let urlparams = `?lv=${lv}&base=${this.addressValue}&device=${this.device_id}&title=水质监控`; + uni.navigateTo({ + url:`/pages/index/warning-list${urlparams}` + }) + }, //设置预警值 setWarnInfo(){ this.getDeviceWarningRules(); @@ -403,7 +412,6 @@ this.deviceAddressList = _data; this.addressValue = _data[0].id; this.addressName = _data[0].name; - this.$refs.uDropdown.highlight(0); this.queryAddressDevicePoints(this.addressValue); } }).catch(()=>{ @@ -475,6 +483,7 @@ console.log(chartInfo,'chartDatas--') if(params.start_time!=params.end_time){//不是当天 this.opts.xAxis.labelCount = 3; + this.optsc.xAxis.labelCount = 3; }else{ let len = chartInfo.conductivity.categories.length-1; let v = 5; @@ -485,6 +494,7 @@ v = 3; }else{v=5} this.opts.xAxis.labelCount = v; + this.optsc.xAxis.labelCount = v; console.log(this.opts,v,len,'配置',aw) } @@ -528,7 +538,15 @@ } ] }; - + let min_temperature = 0; + for(let val of chartInfo.temperature.data){ + if(val<0){ + min_temperature = val; + } + } + if(min_temperature<0){ + this.optsc.yAxis.data = []; + } this.chart_temperature = JSON.parse(JSON.stringify(res3)); //end 温度 //start 氮 k diff --git a/src/pages/index/warning-list.vue b/src/pages/index/warning-list.vue new file mode 100644 index 0000000..eaedce0 --- /dev/null +++ b/src/pages/index/warning-list.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/pages/index/water-quality.vue b/src/pages/index/water-quality.vue index 2b82b35..f273429 100644 --- a/src/pages/index/water-quality.vue +++ b/src/pages/index/water-quality.vue @@ -48,19 +48,19 @@ - + Ⅰ级预警 {{deviceWarning[1]?deviceWarning[1]:0}} - + Ⅱ级预警 {{deviceWarning[2]?deviceWarning[2]:0}} - + Ⅲ级预警 {{deviceWarning[3]?deviceWarning[3]:0}} - + Ⅳ级预警 {{deviceWarning[4]?deviceWarning[4]:0}} @@ -132,7 +132,7 @@ @@ -201,6 +201,7 @@ components: { QiunDataCharts }, data() { return { + optsc:{}, opts: { dataLabel:false,//显示数据 padding:[10,40,25,25], @@ -285,11 +286,19 @@ }, onLoad(){ this.queryDeviceBasics(); + this.optsc = JSON.parse(JSON.stringify(this.opts)); }, onShow(){ }, methods:{ + warningClickFn(lv){ + + let urlparams = `?lv=${lv}&base=${this.addressValue}&device=${this.device_id}&title=水质监控`; + uni.navigateTo({ + url:`/pages/index/warning-list${urlparams}` + }) + }, //设置预警值 setWarnInfo(){ this.getDeviceWarningRules(); @@ -405,7 +414,7 @@ this.deviceAddressList = _data; this.addressValue = _data[0].id; this.addressName = _data[0].name; - this.$refs.uDropdown.highlight(0); + this.queryAddressDevicePoints(this.addressValue); } }).catch(()=>{ @@ -477,6 +486,7 @@ console.log(chartInfo,'chartDatas--') if(params.start_time!=params.end_time){//不是当天 this.opts.xAxis.labelCount = 3; + this.optsc.xAxis.labelCount = 3; }else{ let len = chartInfo.conductivity.categories.length-1; @@ -488,6 +498,7 @@ v = 3; }else{v=5} this.opts.xAxis.labelCount = v; + this.optsc.xAxis.labelCount = v; console.log(this.opts,v,len,'配置',aw) } //start 氯 @@ -558,6 +569,15 @@ } ] }; + let min_temperature = 0; + for(let val of chartInfo.temperature.data){ + if(val<0){ + min_temperature = val; + } + } + if(min_temperature<0){ + this.optsc.yAxis.data = []; + } this.chart_temperature = JSON.parse(JSON.stringify(res5)); //end 温度 temperature //start 浊度 turbidity diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index 8174667..30a85a7 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -36,7 +36,9 @@ export default { password: '' //密码 }; }, - onLoad() {}, + onLoad() { + + }, methods: { //当前登录按钮操作 login() { @@ -69,12 +71,13 @@ export default { uni.switchTab({ url:'/pages/index/index' }) + uni.showToast({ title: '登录成功!', icon: 'none' }); } }).catch(()=>{ - + uni.showToast({ title: '登录失败!', icon: 'none' }); }) - uni.showToast({ title: '登录成功!', icon: 'none' }); + }, } diff --git a/src/pages/system/account.vue b/src/pages/system/account.vue index a1089c8..b330e01 100644 --- a/src/pages/system/account.vue +++ b/src/pages/system/account.vue @@ -229,10 +229,12 @@ +