|
@@ -1,4 +1,5 @@
|
|
|
<template>
|
|
|
+<!-- <el-input v-model="input" placeholder="请输入内容"></el-input> -->
|
|
|
<base-line
|
|
|
:options="lineOptions"
|
|
|
:width="width"
|
|
@@ -9,13 +10,16 @@
|
|
|
import BaseLine from '@/components/Charts/BaseLineChart'
|
|
|
|
|
|
export default {
|
|
|
- name: 'TotalAlarmGrowth',
|
|
|
+ name: 'MaintenanceAlarmChart',
|
|
|
props: {
|
|
|
width: {
|
|
|
type: String,
|
|
|
default: '50%'
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
+ options:{type:Object}
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
components: {
|
|
|
BaseLine,
|
|
|
},
|
|
@@ -45,33 +49,66 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getData() {
|
|
|
- this.$http.get('WorkLocationChart/total')
|
|
|
- .then(resp => {
|
|
|
- if (resp.code === 10000) {
|
|
|
- Object.keys(resp.data).forEach(index => {
|
|
|
- let data = [];
|
|
|
- this.lineDataX = resp.data[index].map(item => {
|
|
|
- data.push(item.value)
|
|
|
- return item.date;
|
|
|
- })
|
|
|
- this.seriesData.push({
|
|
|
- name: index,
|
|
|
- type: 'line',
|
|
|
- data: data,
|
|
|
- smooth: false,
|
|
|
- })
|
|
|
- })
|
|
|
+ this.lineDataX=['2020-05-06','2020-05-06 09:49:01','2020-05-06 09:49:02','2020-05-06 09:49:03','2020-05-07','2020-05-08','2020-05-09','2020-05-10','2020-05-11','2020-05-12']
|
|
|
+ this.seriesData=[
|
|
|
+ {
|
|
|
+ name: 'SWT-4.0-146',
|
|
|
+ type: 'line',
|
|
|
+ smooth: false,
|
|
|
+ data:[20,18,20,20,20,20,20]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'SWT-2.38-101',
|
|
|
+ type: 'line',
|
|
|
+ smooth: false,
|
|
|
+ data:[12,12,12,12,11,12,12]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'SWT-6.0-154',
|
|
|
+ type: 'line',
|
|
|
+ smooth: false,
|
|
|
+ data:[10,10,10,10,10,10,11]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'SG-8.0-167',
|
|
|
+ type: 'line',
|
|
|
+ smooth: false,
|
|
|
+ data:[8,9,5,8,7,8,9,9,9]
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ ];
|
|
|
+ this.lineOptions = this.getOption();
|
|
|
+ // this.$http.get('WorkLocationChart/total')
|
|
|
+ // .then(resp => {
|
|
|
+
|
|
|
+ // if (resp.code === 10000) {
|
|
|
+ // console.log(resp.data);
|
|
|
+ // Object.keys(resp.data).forEach(index => {
|
|
|
+ // let data = [];
|
|
|
+ // console.log(index.name)
|
|
|
+ // this.lineDataX = resp.data[index].map(item => {
|
|
|
+ // data.push(item.value)
|
|
|
+ // return item.date;
|
|
|
+ // })
|
|
|
+ // this.seriesData.push({
|
|
|
+ // name: index.name,
|
|
|
+ // type: 'line',
|
|
|
+ // data: data,
|
|
|
+ // smooth: false,
|
|
|
+ // })
|
|
|
+ // })
|
|
|
|
|
|
- this.lineOptions = this.getOption()
|
|
|
- }
|
|
|
- }).catch(()=>{
|
|
|
- console.error('TotalAlarmGrowth get data error!');
|
|
|
- })
|
|
|
+ // this.lineOptions = this.getOption()
|
|
|
+ // }
|
|
|
+ // }).catch(()=>{
|
|
|
+ // console.error('TotalAlarmGrowth get data error!');
|
|
|
+ // })
|
|
|
},
|
|
|
getOption() {
|
|
|
return {
|
|
|
title: {
|
|
|
- text: '告警总量趋势',
|
|
|
+ text: this.options.name,
|
|
|
textStyle: {
|
|
|
fontWeight: '600',
|
|
|
fontSize: '15',
|