Commit 55896f3c authored by co_dengxiongwen's avatar co_dengxiongwen

tj

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