Commit 5dcc9ecb authored by co_dengxiongwen's avatar co_dengxiongwen

页面调整

parent ac8fe3a0
......@@ -116,6 +116,8 @@ export default {
this.initWebSocket2()
this.getDateList()
this.getDateList2()
let typeList = JSON.parse(sessionStorage.getItem('typeList'))
this.$store.dispatch('d2admin/typeList/set', typeList)
},
destroyed: function() {
this.websocketclose()
......@@ -301,9 +303,10 @@ export default {
sessionStorage.getItem('token') &&
sessionStorage.getItem('token') != undefined
) {
// var paramsInfo = JSON.parse(e.data)
var paramsInfo = e.data
var paramsInfo = JSON.parse(e.data)
// var paramsInfo = e.data
console.log('paramsInfo:', e.data)
sessionStorage.setItem('paramsList', JSON.stringify(paramsInfo))
// 集合
this.$store.dispatch('d2admin/typeList/set', paramsInfo)
}
......@@ -364,6 +367,7 @@ export default {
}).then((data) => {
if (data && data.code === 0) {
console.log('typeList:', data.bean)
sessionStorage.setItem('paramsList', JSON.stringify(data.bean))
this.$store.dispatch('d2admin/typeList/set', data.bean)
}
})
......
......@@ -39,127 +39,82 @@ export default {
mapId: '',
mapList: [],
thresholdList: [],
dataList: [
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '水流压力',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// }
// ]
// },
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '一氧化碳',
// type: 'co',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '湿度',
// type: 'sd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '风速',
// type: 'fs',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '风速',
// type: 'fs',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// }
// ]
// },
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '风压',
// type: 'fy',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// },
// {
// leftName: '喷淋系统',
// rightName: '泵房温度',
// type: 'wd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// }
// ]
// },
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '水流压力',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// },
// {
// leftName: '喷淋系统',
// rightName: '泵房温度',
// type: 'wdh',
// value: '60.5℃',
// over: true,
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// }
// ]
// }
]
dataList: []
}
},
computed: {
// 类型列表
// typeList() {
// return this.$store.state.d2admin.typeList
// }
// },
fsyList() {
return this.$store.state.d2admin.typeList.typeList.fsyList
},
fyyList() {
return this.$store.state.d2admin.typeList.typeList.fyyList
},
hjtcqList() {
return this.$store.state.d2admin.typeList.typeList.hjtcqList
},
lljList() {
return this.$store.state.d2admin.typeList.typeList.lljList
},
wxyljList() {
return this.$store.state.d2admin.typeList.typeList.wxyljList
},
wxywyList() {
return this.$store.state.d2admin.typeList.typeList.wxywyList
}
},
watch: {
fsyList: {
handler(n, o) {
if (n) {
this.setDataList()
}
},
deep: true
},
fyyList: {
handler(n, o) {
if (n) {
this.setDataList()
}
},
deep: true
},
hjtcqList: {
handler(n, o) {
if (n) {
this.setDataList()
}
},
deep: true
},
lljList: {
handler(n, o) {
if (n) {
this.setDataList()
}
},
deep: true
},
wxyljList: {
handler(n, o) {
if (n) {
this.setDataList()
}
},
deep: true
},
wxywyList: {
handler(n, o) {
if (n) {
this.setDataList()
}
},
deep: true
}
},
created() {
this.getThresholdList()
......@@ -236,6 +191,7 @@ export default {
console.log('数据', data)
data.list.forEach((e) => {
let item = {
id: '',
name: '',
list: []
}
......@@ -250,7 +206,7 @@ export default {
leftName: el.resourceName,
rightName: element.typeName,
type: element.code,
value: '0.319mp',
value: '',
scope:
'参考值:' +
element.minValue +
......@@ -260,98 +216,102 @@ export default {
element.unit
})
})
// if (e.id === 'b47661ca1d454f9792ba5369f3cb2bc5') {
// //无线压力计
// list.push({
// leftName: el.resourceName,
// rightName: element.typeName,
// type: 'slyl',
// value: '0.319mp',
// scope:
// '参考值:' +
// element.minValue +
// '~' +
// element.maxValue +
// 'mp'
// })
// } else if (e.id === 'c788ce98c1f248f590434394da485ce4') {
// //4合1环境探测器
// list.push({
// leftName: el.resourceName,
// rightName: '一氧化碳',
// type: 'co',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// })
// list.push({
// leftName: el.resourceName,
// rightName: '二氧化碳',
// type: 'co2',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// })
// list.push({
// leftName: el.resourceName,
// rightName: '温度',
// type: 'wd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// })
// list.push({
// leftName: el.resourceName,
// rightName: '湿度',
// type: 'sd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// })
// } else if (e.id === 'b45827c068254695864ee3c1d42573cb') {
// //流量计
// list.push({
// leftName: el.resourceName,
// rightName: '水流流量',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// } else if (e.id === '303310efddb34a2e9bf269bdff8a7dc5') {
// //无线液位仪
// list.push({
// leftName: el.resourceName,
// rightName: '水流压力',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// } else if (e.id === 'f4c840711eae4bcb9536a890cdfda493') {
// //风速仪
// list.push({
// leftName: el.resourceName,
// rightName: '风速',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// } else if (e.id === '5b26f6c8f2a143048bd0e327ca5c186d') {
// //风压仪
// list.push({
// leftName: el.resourceName,
// rightName: '风压',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// }
console.log('list:', list)
})
item.id = e.id
item.name = e.name
item.list = list
this.dataList.push(item)
})
console.log('dataList:', this.dataList)
this.setDataList()
}
})
},
setDataList() {
// console.log('wxyljList:', this.wxyljList)
// console.log('hjtcqList:', this.hjtcqList)
// console.log('lljList:', this.lljList)
// console.log('wxywyList:', this.wxywyList)
// console.log('fsyList:', this.fsyList)
// console.log('fyyList:', this.fyyList)
for (var i = 0; i < this.dataList.length; i++) {
if (this.dataList[i].id === 'b47661ca1d454f9792ba5369f3cb2bc5') {
//无线压力计
this.dataList[i].list.forEach((element) => {
if (this.wxyljList) {
this.wxyljList.forEach((e) => {
if (element.id === e.resource_id) {
element.value = e.water_pressure + 'MPa'
}
})
}
})
} else if (this.dataList[i].id === 'c788ce98c1f248f590434394da485ce4') {
//4合1环境探测器
this.dataList[i].list.forEach((element) => {
if (this.hjtcqList) {
this.hjtcqList.forEach((e) => {
if (element.id === e.resource_id) {
if (element.rightName === '温度') {
element.value = e.temperature + '°C'
} else if (element.rightName === '湿度') {
element.value = e.humidity + '%RH'
} else if (element.rightName === '一氧化碳') {
element.value = e.carbon_monoxide + 'PPM'
} else if (element.rightName === '二氧化碳') {
element.value = e.carbon_dioxide + 'PPM'
}
}
})
}
})
} else if (this.dataList[i].id === 'b45827c068254695864ee3c1d42573cb') {
//流量计
this.dataList[i].list.forEach((element) => {
if (this.lljList) {
this.lljList.forEach((e) => {
if (element.id === e.resource_id) {
element.value = e.flow_rate + 'm3/h'
}
})
}
})
} else if (this.dataList[i].id === '303310efddb34a2e9bf269bdff8a7dc5') {
//无线液位仪
this.dataList[i].list.forEach((element) => {
if (this.wxywyList) {
this.wxywyList.forEach((e) => {
if (element.id === e.resource_id) {
element.value = e.gauge_height + 'cm'
}
})
}
})
} else if (this.dataList[i].id === 'f4c840711eae4bcb9536a890cdfda493') {
//风速仪
this.dataList[i].list.forEach((element) => {
if (this.fsyList) {
this.fsyList.forEach((e) => {
if (element.id === e.resource_id) {
element.value = e.wind_speed + 'm/s'
}
})
}
})
} else if (this.dataList[i].id === '5b26f6c8f2a143048bd0e327ca5c186d') {
//风压仪
this.dataList[i].list.forEach((element) => {
if (this.fyyList) {
this.fyyList.forEach((e) => {
if (element.id === e.resource_id) {
element.value = e.wind_pressure + 'pa'
}
})
}
})
}
}
}
}
}
......
......@@ -66,7 +66,7 @@ export default {
{ label: '编码', prop: 'code', sort: false },
{ label: '最小值', prop: 'minValue', sort: false },
{ label: '最大值', prop: 'maxValue', sort: false },
{ label: '单位', prop: 'unit', sort: true }
{ label: '单位', prop: 'unit', sort: false, slot: true }
],
tableOption: {
border: false, //是否边框
......@@ -78,6 +78,7 @@ export default {
AddOrUpdate,
dragTable
},
watch: {
totalPage() {
//注意这个函数的名字必须和你监听data中的属性的名字一样,这样才能当你data中的属性发生变化时,触发这个函数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment