Commit 72d74e36 authored by xiexingan's avatar xiexingan

提交

parent 0d3619b1
...@@ -174,6 +174,8 @@ export default { ...@@ -174,6 +174,8 @@ export default {
this.initWebSocket() this.initWebSocket()
this.initWebSocket2() this.initWebSocket2()
this.getDateList() this.getDateList()
let paramsList = JSON.parse(sessionStorage.getItem('paramsList'))
this.$store.dispatch('d2admin/paramsList/set', paramsList)
}, },
destroyed: function () { destroyed: function () {
this.websocketclose() this.websocketclose()
...@@ -503,7 +505,9 @@ export default { ...@@ -503,7 +505,9 @@ export default {
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.paramsList = data.bean this.paramsList = data.bean
sessionStorage.setItem('paramsList', JSON.stringify(this.paramsList))
console.log('paramsList:', this.paramsList) console.log('paramsList:', this.paramsList)
this.$store.dispatch('d2admin/paramsList/set', this.paramsList)
} }
}) })
} else { } else {
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<!-- <energy-total-charts></energy-total-charts> --> <!-- <energy-total-charts></energy-total-charts> -->
<chart <chart
id="home" id="home"
:data="data" :data="dataList.energyList"
title="能耗统计" title="能耗统计"
color="#21ACFC" color="#21ACFC"
ref="chart" ref="chart"
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
cardListLeftTitle: '能耗统计', cardListLeftTitle: '能耗统计',
cardListRightTitle: '旅客满意度调查', cardListRightTitle: '旅客满意度调查',
activeIndex: 0, activeIndex: 0,
dataList: [], dataList: this.$store.state.d2admin.paramsList.list.syBean || [],
dateList: [ dateList: [
{ {
value: 0, value: 0,
...@@ -215,7 +215,6 @@ export default { ...@@ -215,7 +215,6 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
console.log('首页:', data) console.log('首页:', data)
this.dataList = data.bean this.dataList = data.bean
this.data = this.dataList.energyList
} }
}) })
}, },
......
...@@ -162,7 +162,10 @@ export default { ...@@ -162,7 +162,10 @@ export default {
}, },
data() { data() {
return { return {
formData: {}, formData: {
name: '',
code: ''
},
historyVisible: false, historyVisible: false,
chartListVisible: false, chartListVisible: false,
showList: false, showList: false,
...@@ -172,7 +175,7 @@ export default { ...@@ -172,7 +175,7 @@ export default {
pageSize: 50, pageSize: 50,
totalPage: 0, totalPage: 0,
typeList: [ typeList: [
{ type: '温度', num: '37', unit: '℃', color: '#21ACFC' }, { type: '温度', num: '36', unit: '℃', color: '#21ACFC' },
{ type: '湿度', num: '25', unit: '%', color: '#36CBCB' }, { type: '湿度', num: '25', unit: '%', color: '#36CBCB' },
{ type: '风速', num: '3', unit: 'm/s', color: '#3AA0FF' }, { type: '风速', num: '3', unit: 'm/s', color: '#3AA0FF' },
{ type: '风向', num: '东南', unit: '', color: '#3AA0FF' }, { type: '风向', num: '东南', unit: '', color: '#3AA0FF' },
...@@ -195,11 +198,47 @@ export default { ...@@ -195,11 +198,47 @@ export default {
type: 1 type: 1
} }
}, },
computed: {
socketData() {
return this.$store.state.d2admin.paramsList.list.swqxzList[0]
}
},
watch: {
socketData: {
handler(n, o) {
this.setTypeList()
},
deep: true
}
},
mounted() { mounted() {
this.getDataList() this.getDataList()
this.getDataListTb() this.getDataListTb()
}, },
methods: { methods: {
// 设置数字变化
setTypeList() {
this.typeList[0].num = this.socketData.temperature
this.typeList[1].num = this.socketData.humidity
this.typeList[2].num = this.socketData.wind_speed
this.typeList[3].num = this.socketData.wind_direction
this.typeList[4].num = this.socketData.Illuminance
this.typeList[5].num = this.socketData.carbon_dioxide
this.typeList[6].num = this.socketData.fine_particles
this.typeList[7].num = this.socketData.radiation
this.typeList[8].num = this.socketData.region
//列表
this.dataList[0].temperature = this.socketData.temperature
this.dataList[0].humidity = this.socketData.humidity
this.dataList[0].wind_speed = this.socketData.wind_speed
this.dataList[0].Illuminance = this.socketData.Illuminance
this.dataList[0].carbon_dioxide = this.socketData.carbon_dioxide
this.dataList[0].fine_particles = this.socketData.fine_particles
this.dataList[0].radiation = this.socketData.radiation
// for (var i = 0; i < this.dataList.length; i++) {
// this.$set(this.dataList[i], 'temperature', this.socketData.temperature)
// }
},
// 获取数据列表 // 获取数据列表
getDataList(page, size) { getDataList(page, size) {
this.$http({ this.$http({
...@@ -217,6 +256,7 @@ export default { ...@@ -217,6 +256,7 @@ export default {
this.formData.name = this.dataList[0].name this.formData.name = this.dataList[0].name
this.formData.code = this.dataList[0].code this.formData.code = this.dataList[0].code
this.totalPage = data.page.total this.totalPage = data.page.total
this.setTypeList()
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
...@@ -232,7 +272,7 @@ export default { ...@@ -232,7 +272,7 @@ export default {
}) })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
console.log('数据', data) console.log('charts数据', data)
this.chartList[0].data = data.temperatureList this.chartList[0].data = data.temperatureList
this.chartList[1].data = data.humidityList this.chartList[1].data = data.humidityList
this.chartList[2].data = data.windSpeedList this.chartList[2].data = data.windSpeedList
...@@ -309,7 +349,7 @@ export default { ...@@ -309,7 +349,7 @@ export default {
color: #000000; color: #000000;
line-height: 40px; line-height: 40px;
&::before { &::before {
content: ''; content: "";
display: inline-block; display: inline-block;
width: 10px; width: 10px;
height: 10px; height: 10px;
...@@ -321,7 +361,7 @@ export default { ...@@ -321,7 +361,7 @@ export default {
} }
} }
.clearfix:after { .clearfix:after {
content: ''; content: "";
display: block; display: block;
height: 0; height: 0;
clear: both; clear: both;
......
...@@ -17,6 +17,7 @@ import alramfj from './modules/alramfj' ...@@ -17,6 +17,7 @@ import alramfj from './modules/alramfj'
import takeover from './modules/takeover' import takeover from './modules/takeover'
import bjCode from './modules/bjCode' import bjCode from './modules/bjCode'
import bim from './modules/bim' import bim from './modules/bim'
import paramsList from './modules/paramsList'
export default { export default {
namespaced: true, namespaced: true,
...@@ -39,6 +40,7 @@ export default { ...@@ -39,6 +40,7 @@ export default {
alramfj, alramfj,
takeover, takeover,
bjCode, bjCode,
bim bim,
paramsList
} }
} }
export default {
namespaced: true,
state: {
list: [] //数据集合
},
actions: {
/**
* @description 设置尺寸
* @param {Object} state vuex state
* @param {Array} data 数据集合
*/
set ({ state, dispatch }, data) {
return new Promise(async resolve => {
// store 赋值
state.list = 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