From 651025048285877e92da29ca9ffcad833e957f91 Mon Sep 17 00:00:00 2001 From: lgyg <1370861456@qq.com> Date: Sun, 10 Sep 2023 23:50:43 +0800 Subject: [PATCH 1/2] new --- src/api/index.js | 4 +- src/pages.json | 53 +- src/pages/estate/estate-flows.vue | 572 +++++++++++++++++++++ src/pages/estate/estate-industry.vue | 600 ++++++++++++++++++++++ src/pages/estate/estate-materiels.vue | 671 +++++++++++++++++++++++++ src/pages/estate/estate-price.vue | 43 +- src/pages/estate/estate-week-price.vue | 531 +++++++++++++++++++ src/pages/index/index.vue | 46 +- src/pages/index/meteorological.vue | 53 +- src/pages/index/soil-monitoring.vue | 32 +- src/pages/index/warning-list.vue | 278 ++++++++++ src/pages/index/water-quality.vue | 32 +- src/pages/login/login.vue | 5 +- src/pages/system/account.vue | 48 +- src/pages/system/links.vue | 65 ++- src/pages/system/role.vue | 26 +- src/pages/user/password-edit.vue | 7 +- 17 files changed, 2982 insertions(+), 84 deletions(-) create mode 100644 src/pages/estate/estate-flows.vue create mode 100644 src/pages/estate/estate-industry.vue create mode 100644 src/pages/estate/estate-materiels.vue create mode 100644 src/pages/estate/estate-week-price.vue create mode 100644 src/pages/index/warning-list.vue diff --git a/src/api/index.js b/src/api/index.js index 3c6abb1..76aeab4 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -2,8 +2,8 @@ import Request from './luch-request/index.js' import jwt from './jwt.js' import {toast} from '@/com/utils.js' //测试地址 -const baseApi = 'http://36.133.205.221:81'; - +// const baseApi = 'http://36.133.205.221:81'; +const baseApi = 'http://lcny.sk797.cn'; const http = new Request(); http.setConfig((config) => { /* 设置全局配置 */ diff --git a/src/pages.json b/src/pages.json index df9a09a..dcb46a6 100644 --- a/src/pages.json +++ b/src/pages.json @@ -14,7 +14,8 @@ "style" : { "navigationBarTitleText": "", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "navigationStyle": "custom" } } @@ -139,6 +140,56 @@ } } + ,{ + "path" : "pages/estate/estate-week-price", + "style" : + { + "navigationBarTitleText": "稻虾每周价格", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + + } + ,{ + "path" : "pages/estate/estate-industry", + "style" : + { + "navigationBarTitleText": "稻虾产业", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + + } + ,{ + "path" : "pages/estate/estate-flows", + "style" : + { + "navigationBarTitleText": "稻虾流向", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + + } + ,{ + "path" : "pages/estate/estate-materiels", + "style" : + { + "navigationBarTitleText": "大宗物资", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + + } + ,{ + "path" : "pages/index/warning-list", + "style" : + { + "navigationBarTitleText": "预警列表", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + + } ], "globalStyle": { "navigationBarTextStyle": "white", diff --git a/src/pages/estate/estate-flows.vue b/src/pages/estate/estate-flows.vue new file mode 100644 index 0000000..1311719 --- /dev/null +++ b/src/pages/estate/estate-flows.vue @@ -0,0 +1,572 @@ + + + + + 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 ec15cd9..27f59aa 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}} - + @@ -47,8 +48,20 @@ }, ], }, + // { + // label:'基础数据管理', + // children:[ + // { + // label:'城镇数据', + // }, + // { + // label:'基地数据', + // }, + // ], + // }, { - label:'基础数据管理', + label:'全市基础数据', + parent:'基础数据管理', children:[ { label:'城镇数据', @@ -56,35 +69,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:'设备管理', @@ -128,6 +163,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..dba7cae 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -69,12 +69,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 @@ +