Commit 55896f3c authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 18a9609e
...@@ -49,7 +49,9 @@ export default { ...@@ -49,7 +49,9 @@ export default {
activeName: '0', activeName: '0',
level: {}, level: {},
status: {}, status: {},
chartData: null chartData: null,
typeNameList: [],
typeNumList: []
} }
}, },
components: { components: {
...@@ -62,9 +64,7 @@ export default { ...@@ -62,9 +64,7 @@ export default {
}) })
this.getGroupList() this.getGroupList()
}, },
mounted() { mounted() {},
this.alarmsInit()
},
methods: { methods: {
alarmsInit() { alarmsInit() {
let dom = document.getElementById('alarms') let dom = document.getElementById('alarms')
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
data: ['CO', 'C02', '烟雾浓度', '温度', '音视频'], data: this.typeNameList,
axisTick: { axisTick: {
alignWithLabel: true alignWithLabel: true
}, },
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
name: '', name: '',
type: 'bar', type: 'bar',
barWidth: '60%', barWidth: '60%',
data: [7, 4, 3, 5, 6], data: this.typeNumList,
itemStyle: { itemStyle: {
normal: { normal: {
...@@ -157,11 +157,7 @@ export default { ...@@ -157,11 +157,7 @@ export default {
normal: { normal: {
color: function(params) { color: function(params) {
//自定义颜色 //自定义颜色
let colorList = [ let colorList = ['#F56C6C', '#E6A23C', '#409EFF']
'#F56C6C',
'#E6A23C',
'#409EFF'
]
return colorList[params.dataIndex] return colorList[params.dataIndex]
} }
} }
...@@ -179,18 +175,19 @@ export default { ...@@ -179,18 +175,19 @@ export default {
getGroupList() { getGroupList() {
this.leftLoading = true this.leftLoading = true
this.$http({ this.$http({
url: this.$http.adornUrlAlarm( url: this.$http.adornUrlAlarm(`/alarmsInfo/queryGroupUntreated`),
`/alarmsInfo/queryGroupUntreated`
),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({})
stationId: localStorage.getItem('stationId')
})
}).then((data) => { }).then((data) => {
this.leftLoading = false this.leftLoading = false
if (data && data.code === 0) { if (data && data.code === 0) {
console.log('data:', data)
this.level = data.level this.level = data.level
this.status = data.status this.status = data.status
data.list.forEach((element) => {
this.typeNameList.push(element.eventTypeName)
this.typeNumList.push(element.num)
})
this.chartData = [ this.chartData = [
{ value: this.level.oneCount, name: '特别重大' }, { value: this.level.oneCount, name: '特别重大' },
...@@ -198,6 +195,7 @@ export default { ...@@ -198,6 +195,7 @@ export default {
{ value: this.level.threeCount, name: '一般' } { value: this.level.threeCount, name: '一般' }
] ]
this.groupInit() this.groupInit()
this.alarmsInit()
} }
}) })
}, },
......
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