diff --git a/src/api/index.js b/src/api/index.js index 1cf0687..c3a0d68 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -196,6 +196,10 @@ export default { //气象站显示 geteqetdata(data) { return sendGetRequest(`/getcontrol/geteqetdata?userId=`+data ,"") +}, +// 数据采集器的实时数据 +getdataRtdata(data) { + return sendGetRequest(`/getdata/rtdata?deviceId=` + data, '') }, //测试施肥机读取设备状态信息 //读取数据 根据文档编号读取 所有数据展示都出自这个接口 postReg(data) { diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 7375fff..e18cce7 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -791,6 +791,10 @@ textarea { height: 44px; } +.input-main-60.input-main-100 input { + width: 100px; +} + .input-main-60 input { width: 60px; height: 34px; diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index 67cac27..95a4bb6 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -826,6 +826,11 @@ textarea{ input{ height: 44px; } +} +&.input-main-100{ + input{ + width: 100px; + } } input { width: 60px; diff --git a/src/views/index.vue b/src/views/index.vue index 05425c9..611732b 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -116,6 +116,7 @@ export default { // { name: '二号温室', img: require('../assets/image/left-img1.png'), list: [] }, { name: '施肥机', routerList: ['status-soil','formula', 'dataAnalysis', 'historyData', 'irrigateSet', 'videoMonitoring','imageData', 'PIDSet', 'systemSet', 'upload', 'sensorSet', 'realTime', 'history', 'dataAnalysis'], img: require('../assets/image/left-img2.png'), list: [] }, { name: '智能灌溉', routerList: ['realTime', 'dataAnalysis', 'historyData','irrigateSet-soil', 'videoMonitoring','imageData','PIDSet-soil', 'systemSet-soil', 'upload-soil', 'sensorSet-soil', 'realTime', 'history', 'dataAnalysis'], img: require('../assets/image/irrigateSet-icon1-act.png'), list: [] }, + { name: '数据采集器', routerList: ['realTime', 'historyData', 'exitSettings', 'skylight', 'control', 'systemSet-con','imageData', 'fan', 'upload-con', 'sensorSet-con', 'synthesis-con', 'alarmSettings', 'waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval', "targetTemperature", "targetHumidity", "targetCo2", "sunroofControl", "outsizeSunshade", "insizeSunshade", "wetFan", "LED", 'electromagneticControl', "coercionMist", "circulationCan", "internalInsulation", "forceOutput", "intrinsicParameter", "parameterSet"], img: require('../assets/image/left-img3.png'), list: [] }, { name: '生态气象站', routerList: ['realTime', 'historyData', 'exitSettings', 'skylight', 'control', 'systemSet-con','imageData', 'fan', 'upload-con', 'sensorSet-con', 'synthesis-con', 'alarmSettings', 'waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval', "targetTemperature", "targetHumidity", "targetCo2", "sunroofControl", "outsizeSunshade", "insizeSunshade", "wetFan", "LED", 'electromagneticControl', "coercionMist", "circulationCan", "internalInsulation", "forceOutput", "intrinsicParameter", "parameterSet"], img: require('../assets/image/left-img3.png'), list: [] }, ], leftList1: [ @@ -201,44 +202,13 @@ export default { }, methods: { getRole(){ - var user= JSON.parse(localStorage.getItem('userInfo')) - this.api.selUserbyid(user.userid).then(res=>{ - if(res.data.code==200){ - this.roleId=res.data.data.roleId - if(this.roleId==1){ - this.leftList1= [ - { name: '管理', img: require('../assets/image/index-icon.png'), list: [], router: 'manage', isRouter: true, }, - { name: '用户管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [ - {deviceTypeName:'控制器设备状态值设置',router:'deviceStatusSet',index:0}, - {deviceTypeName:'控制器设备设定值设置',router:'deviceSet',index:1}, - {deviceTypeName:'设备信息管理',router:'deviceInfoManage',index:2}, - {deviceTypeName:'设备绑定气象站数据',router:'weatherData',index:3}, - {deviceTypeName:'大数据设备信息',router:'dataDevice',index:4}, - {deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5}, - ] }, - { name: '管理员管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [ - {deviceTypeName:'用户信息管理',router:'userInfoControl',index:6}, - {deviceTypeName:'设备管理',router:'deviceManage',index:7}, - // {deviceTypeName:'摄像头信息管理',router:'videoManage',index:8}, - ] }, - ] - }else{ - this.leftList1= [ - { name: '管理', img: require('../assets/image/index-icon.png'), list: [], router: 'manage', isRouter: true, }, - { name: '用户管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [ - {deviceTypeName:'控制器设备状态值设置',router:'deviceStatusSet',index:0}, - {deviceTypeName:'控制器设备设定值设置',router:'deviceSet',index:1}, - {deviceTypeName:'设备信息管理',router:'deviceInfoManage',index:2}, - {deviceTypeName:'设备绑定气象站数据',router:'weatherData',index:3}, - {deviceTypeName:'大数据设备信息',router:'dataDevice',index:4}, - {deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5}, - ] }, - ] - } - this.mainData=res.data.data.project + // var user= JSON.parse(localStorage.getItem('userInfo')) + // this.api.selUserbyid(user.userid).then(res=>{ + // if(res.data.code==200){ + - } - }) + // } + // }) }, // 获取用户id权限 get_user_getjurisdiction() { @@ -305,9 +275,10 @@ export default { const that = this var userInfo = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : { userid: -1 } var store = this.$store.state - this.api.getEqbyid(userInfo.userid).then((res) => { + this.api.selUserbyid(userInfo.userid).then((res) => { if (res.data.code == 200) { - this.$store.state.equipmentList = res.data.data.map((item, index) => { + var data=res.data.data.devices + this.$store.state.equipmentList =data.map((item, index) => { return { ...item, router: that.deviceNameRouter(item.deviceName), @@ -315,13 +286,15 @@ export default { }; }); if (!localStorage.getItem('equipmentSelList')) { - localStorage.setItem('equipmentSelList', JSON.stringify(res.data.data)) + localStorage.setItem('equipmentSelList', JSON.stringify(data)) // this.$store.state.equipmentSelList=res.data.data } this.leftList[1].list = [] this.leftList[2].list = [] this.leftList[3].list = [] + this.leftList[4].list = [] + this.leftList[5].list = [] this.$store.state.equipmentList.forEach((el, index) => { //链接中的deviceId if (this.deviceId && this.deviceId == el.deviceId) { @@ -345,6 +318,12 @@ export default { this.leftList[index1].list.push(el) } }) + }else if (el.deviceName == 40) { + this.leftList.forEach((el1, index1) => { + if (el1.name == '数据采集器') { + this.leftList[index1].list.push(el) + } + }) } // else if (el.deviceName == 30) { // this.leftList.forEach((el1, index1) => { @@ -390,6 +369,9 @@ export default { if (el1.name == '生态气象站') { this.leftList[index1].list.sort(this.compare('equipmentStatu')) } + if (el1.name == '数据采集器') { + this.leftList[index1].list.sort(this.compare('equipmentStatu')) + } }) this.gerRouter() @@ -406,6 +388,39 @@ export default { } }) + + this.roleId=res.data.data.roleId + if(this.roleId==1){ + this.leftList1= [ + { name: '管理', img: require('../assets/image/index-icon.png'), list: [], router: 'manage', isRouter: true, }, + { name: '用户管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [ + {deviceTypeName:'控制器设备状态值设置',router:'deviceStatusSet',index:0}, + {deviceTypeName:'控制器设备设定值设置',router:'deviceSet',index:1}, + {deviceTypeName:'设备信息管理',router:'deviceInfoManage',index:2}, + {deviceTypeName:'设备绑定气象站数据',router:'weatherData',index:3}, + {deviceTypeName:'大数据设备信息',router:'dataDevice',index:4}, + {deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5}, + ] }, + { name: '管理员管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [ + {deviceTypeName:'用户信息管理',router:'userInfoControl',index:6}, + {deviceTypeName:'设备管理',router:'deviceManage',index:7}, + // {deviceTypeName:'摄像头信息管理',router:'videoManage',index:8}, + ] }, + ] + }else{ + this.leftList1= [ + { name: '管理', img: require('../assets/image/index-icon.png'), list: [], router: 'manage', isRouter: true, }, + { name: '用户管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [ + {deviceTypeName:'控制器设备状态值设置',router:'deviceStatusSet',index:0}, + {deviceTypeName:'控制器设备设定值设置',router:'deviceSet',index:1}, + {deviceTypeName:'设备信息管理',router:'deviceInfoManage',index:2}, + {deviceTypeName:'设备绑定气象站数据',router:'weatherData',index:3}, + {deviceTypeName:'大数据设备信息',router:'dataDevice',index:4}, + {deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5}, + ] }, + ] + } + this.mainData=res.data.data.project } }) @@ -460,6 +475,10 @@ export default { if (this.deviceName == '30') { this.$message('气象站无该页面'); return + } + if (this.deviceName == '40') { + this.$message('数据采集器无该页面'); + return } if (this.deviceName == '10') { this.$router.push({ path: `/control` }) @@ -557,6 +576,8 @@ export default { } else if (item.deviceName == 30) { this.$message('气象站无该页面'); + } else if (item.deviceName == 40) { + this.$message('数据采集器无该页面'); } } } else if ( this.$route.query.index == item.index) { diff --git a/src/views/manage/deviceInfoManage.vue b/src/views/manage/deviceInfoManage.vue index f084873..7349c29 100644 --- a/src/views/manage/deviceInfoManage.vue +++ b/src/views/manage/deviceInfoManage.vue @@ -15,6 +15,14 @@