pull/127/head
孙萌 2024-03-06 11:31:40 +08:00
parent 7a684e3d73
commit 679ab7e1e5
2 changed files with 39 additions and 43 deletions

View File

@ -200,7 +200,7 @@ export function realTimeLine(id, data,pageId) {
return item.name === el1.name;
});
if (containsIndex == -1) {
dataList.push({ name: el1.name, value: [] })
dataList.push({ name: el1.name, value: [el1.value] })
} else {
dataList[containsIndex].value.push(el1.value)
}
@ -568,7 +568,7 @@ export function realTimeLine1(id, data,pageId) {
return item.name === el1.name;
});
if (containsIndex == -1) {
dataList.push({ name: el1.name, value: [] })
dataList.push({ name: el1.name, value: [el1.value] })
} else {
dataList[containsIndex].value.push(el1.value)
}
@ -581,7 +581,6 @@ export function realTimeLine1(id, data,pageId) {
// selList[el.name]=(index==0?true:false)
// })
// }
dataList.forEach((el, index) => {
list.push({
name: el.name,

View File

@ -6,9 +6,9 @@
</div>
<div class="header-center">
<div class="header-warning" v-if="statusData[1114]">
<img src="../assets/img/warning.gif" alt="">
</div>
<div class="header-warning" v-if="statusData[1114]">
<img src="../assets/img/warning.gif" alt="">
</div>
<div @click="toRouter(item)" :class="item.routerList.indexOf(routerNow) != -1 ? 'active' : ''"
v-for="item, index in headerList" :key="index">
<div class="img"> <img :src="item.img" alt=""></div>
@ -38,7 +38,7 @@
v-for="item1, index1 in item.list" :key="index1">{{ item1.deviceTypeName }} <div
class="status" :class="item1.deviceState == 0 ? 'outline' : 'online'"
v-if="item1.deviceState >= 0">{{
item1.deviceState == 0 ? '离线' : '在线' }}</div>
item1.deviceState == 0 ? '离线' : '在线' }}</div>
</li>
</ul>
</el-collapse-item>
@ -56,6 +56,7 @@
</div>
</div>
</template>
<script>
import { getnowtime } from '../assets/js/nowTime'
export default {
@ -66,7 +67,7 @@ export default {
headerList: [
{ name: '实时数据', router: 'realTime', routerList: ['realTime'], img: require('../assets/image/header-img1.png') },
// { name: '', router: 'status', index: 1, routerList: ['formula', 'irrigateSet', 'PIDSet', 'systemSet', 'upload', 'sensorSet'], img: require('../assets/image/header-img0.png') },
{ name: '设定值参数', router: 'status', index: 1, routerList: ['status','exitSettings', 'skylight','systemSet-con', 'fan', 'upload-con', 'sensorSet-con','alarmSettings', 'synthesis-con','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/header-img0.png') },
{ name: '设定值参数', router: 'formula', index: 1, routerList: ['formula', 'status', 'exitSettings', 'skylight', 'systemSet-con', 'fan', 'upload-con', 'sensorSet-con', 'alarmSettings', 'synthesis-con', '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/header-img0.png') },
{ name: '图库数据', router: '', routerList: [], img: require('../assets/image/header-img1.png') },
{ name: '视频监控', router: 'videoMonitoring', routerList: ['videoMonitoring'], img: require('../assets/image/header-img2.png') },
// history history
@ -83,10 +84,10 @@ export default {
activeNames: [3],
leftList: [
{ name: '首页', img: require('../assets/image/index-icon.png'), list: [], router: 'realTime', isRouter: true, },
{ name: '温室', routerList: ['realTime','dataAnalysis','historyData','exitSettings','videoMonitoring', 'skylight', 'control','systemSet-con', '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-img0.png'), list: [] },
{ name: '温室', routerList: ['realTime', 'dataAnalysis', 'historyData', 'exitSettings', 'videoMonitoring', 'skylight', 'control', 'systemSet-con', '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-img0.png'), list: [] },
// { name: '', img: require('../assets/image/left-img1.png'), list: [] },
{ name: '施肥机', routerList: ['formula','historyData', 'irrigateSet','videoMonitoring', 'PIDSet', 'systemSet', 'upload', 'sensorSet', 'realTime', 'history', 'dataAnalysis'], img: require('../assets/image/left-img2.png'), list: [] },
{ name: '生态气象站', routerList: ['realTime','historyData','exitSettings', 'skylight', 'control','systemSet-con', '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: ['formula', 'dataAnalysis', 'historyData', 'irrigateSet', 'videoMonitoring', 'PIDSet', 'systemSet', 'upload', 'sensorSet', 'realTime', 'history', 'dataAnalysis'], img: require('../assets/image/left-img2.png'), list: [] },
{ name: '生态气象站', routerList: ['realTime', 'historyData', 'exitSettings', 'skylight', 'control', 'systemSet-con', '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: [] },
],
routerNow: 'realTime',
@ -98,7 +99,7 @@ export default {
IDTimer: null,
deviceId: '',
limitUserId: [],
statusData:[]
statusData: []
}
},
watch: {
@ -144,7 +145,7 @@ export default {
methods: {
// id
get_user_getjurisdiction() {
let userInfo = localStorage.getItem("userInfo")?JSON.parse(localStorage.getItem("userInfo")):{userid:-1};
let userInfo = localStorage.getItem("userInfo") ? JSON.parse(localStorage.getItem("userInfo")) : { userid: -1 };
let userId = userInfo.userid
this.api.user_getjurisdiction(userId).then(res => {
if (res.data.code == 200) {
@ -192,9 +193,9 @@ export default {
},
//
getEqbyid(selTrue) {
var userInfo =localStorage.getItem('userInfo')? JSON.parse(localStorage.getItem('userInfo')):{userid:-1}
var store=this.$store.state
this.api.getEqbyid(userInfo.userid).then((res) => {
var userInfo = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : { userid: -1 }
var store = this.$store.state
this.api.getEqbyid(userInfo.userid).then((res) => {
if (res.data.code == 200) {
this.$store.state.equipmentList = res.data.data.map((item, index) => {
return {
@ -203,7 +204,7 @@ export default {
index: index + 1,
};
});
if(!localStorage.getItem('equipmentSelList')){
if (!localStorage.getItem('equipmentSelList')) {
localStorage.setItem('equipmentSelList', JSON.stringify(res.data.data))
// this.$store.state.equipmentSelList=res.data.data
}
@ -221,13 +222,13 @@ export default {
this.leftList[index1].list.push(el)
}
})
} else if (el.deviceName == 10) {
} else if (el.deviceName == 10) {
this.leftList.forEach((el1, index1) => {
if (el1.name == '温室') {
this.leftList[index1].list.push(el)
}
})
}else{
} else {
this.leftList.forEach((el1, index1) => {
if (el1.name == '生态气象站') {
this.leftList[index1].list.push(el)
@ -248,15 +249,15 @@ export default {
})
this.gerRouter()
this.getByid()
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
this.api.getControlGetState(data).then(res=>{
if(res.data.code==200){
this.statusData = res.data.data;
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
this.api.getControlGetState(data).then(res => {
if (res.data.code == 200) {
this.statusData = res.data.data;
}
})
}
})
}
})
},
@ -303,9 +304,9 @@ export default {
this.$router.push({ path: `/history?index=${item.index ? item.index : 1}` })
} else if (item.router == 'dataAnalysis' && this.$route.query.index != item.index) {
this.$router.push({ path: `/dataAnalysis?index=${item.index ? item.index : 1}` })
this.$router.push({ path: `/dataAnalysis` })
} else if (item.router == 'status' && (this.deviceName == '10'||this.deviceName == '30')) {
} else if (item.router == 'status' && (this.deviceName == '10' || this.deviceName == '30')) {
this.$router.push({ path: `/control` })
} else if (item.router == 'realTime') {
@ -343,25 +344,21 @@ export default {
if (this.routerNow == 'realTime') {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/realTime?index=${item.index ? item.index : 1}&name=${item.deviceName}` })
} else if (this.routerNow == 'formula') {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/formula?index=${item.index ? item.index : 1}` })
} else if (this.routerNow == 'history') {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/history?index=${item.index ? item.index : 1}` })
} else if (this.routerNow == 'dataAnalysis') {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/dataAnalysis?index=${item.index ? item.index : 1}` })
} else if (this.routerNow == 'historyData') {
} else if (this.routerNow == 'historyData') {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/historyData?index=${item.index ? item.index : 1}` })
} else if (item.router == 'formula') {
} else if (item.router == 'formula') {
this.$store.state.equipmentIndex = item.index
this.routerIndex = item.index
if (item.deviceName == 10||item.deviceName == 30) {
if (item.deviceName == 10 || item.deviceName == 30) {
//
if(this.routerNow!='skylight'&&this.leftList[1].routerList.indexOf(this.$route.name)!=-1){
if (this.routerNow != 'skylight' && this.leftList[1].routerList.indexOf(this.$route.name) != -1) {
return
}
this.$router.push({ path: `/control?change=${item.index}` })
@ -389,5 +386,5 @@ export default {
}
</script>
<style lang="scss"></style>
<style lang="scss"></style>