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

@ -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,8 +193,8 @@ export default {
},
//
getEqbyid(selTrue) {
var userInfo =localStorage.getItem('userInfo')? JSON.parse(localStorage.getItem('userInfo')):{userid:-1}
var store=this.$store.state
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) => {
@ -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
}
@ -227,7 +228,7 @@ export default {
this.leftList[index1].list.push(el)
}
})
}else{
} else {
this.leftList.forEach((el1, index1) => {
if (el1.name == '生态气象站') {
this.leftList[index1].list.push(el)
@ -251,8 +252,8 @@ export default {
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
this.api.getControlGetState(data).then(res=>{
if(res.data.code==200){
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,9 +344,6 @@ 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}` })
@ -356,12 +354,11 @@ export default {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/historyData?index=${item.index ? item.index : 1}` })
} 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>