From 4cfe2cc6b6d4e418c0d8665fa94a140756dcd537 Mon Sep 17 00:00:00 2001
From: chenzeping <ChenZeping02609@163.com>
Date: 星期五, 09 四月 2021 10:43:06 +0800
Subject: [PATCH] 弹框table样式修改
---
src/components/BaseNav/PublicBounced/GasComponents/Echarts.vue | 59 ++++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/src/components/BaseNav/PublicBounced/GasComponents/Echarts.vue b/src/components/BaseNav/PublicBounced/GasComponents/Echarts.vue
index 3ac2e52..ad97760 100644
--- a/src/components/BaseNav/PublicBounced/GasComponents/Echarts.vue
+++ b/src/components/BaseNav/PublicBounced/GasComponents/Echarts.vue
@@ -1,5 +1,5 @@
<template>
- <div style="width:100%;height:2rem;" ref="echarts"></div>
+ <div style="width:100%;height:2rem;margin-top: 0.3rem" ref="echarts"></div>
</template>
<script>
@@ -13,25 +13,18 @@
data () {
return {
myChart: [],
- dataDate: [],
+ result: [],
+ days: dayjs(new Date()).format('YYYYMMDDHHmmss'),
value: '',
seriesData: [],
- aseries: '',
- result: [],
- days: dayjs(new Date()).format('YYYYMMDDHHmmss')
+ aseries: ''
}
},
methods: {
- drawChart (result) {
- // const result = this.result
+ drawChart () {
this.myChart = this.$echarts.init(this.$refs.echarts)
- // setInterval(function () {
- // }, 3000)
const option = {
- title: {
- text: '鎶樼嚎鍥惧爢鍙�'
- },
tooltip: {
trigger: 'axis'
},
@@ -39,7 +32,7 @@
data: ['閭欢钀ラ攢', '鑱旂洘骞垮憡', '瑙嗛骞垮憡', '鐩存帴璁块棶', '鎼滅储寮曟搸']
},
grid: {
- containLabel: true
+ containLabel: false
},
toolbox: {
feature: {
@@ -51,17 +44,22 @@
xAxis: {
type: 'category',
boundaryGap: false,
- // data: seriesData,
+ splitLine: {
+ show: false
+ },
+ // data: this.seriesData,
data: ['鍛ㄤ竴', '鍛ㄤ簩', '鍛ㄤ笁', '鍛ㄥ洓', '鍛ㄤ簲', '鍛ㄥ叚', '鍛ㄦ棩'],
axisLine: {
lineStyle: {
color: '#FFFFFF',
- width: 1
+ // width: 1
+ show: false
}
}
},
yAxis: {
type: 'value',
+ boundaryGap: [0, '100%'],
axisLine: {
lineStyle: {
color: '#FFFFFF',
@@ -71,10 +69,11 @@
},
series: [
{
- name: '閭欢钀ラ攢',
+ name: '妯℃嫙鏁版嵁',
type: 'line',
- stack: '鎬婚噺',
- data: [120, 132, 101, 134, 90, 230, 210]
+ // showSymbol: false,
+ // hoverAnimation: false,
+ data: this.seriesData
},
{
name: '鑱旂洘骞垮憡',
@@ -114,6 +113,23 @@
}
const result = await mapApi.DataItems(data)
this.result = result.data
+ for (let i = 0; i < result.length; i++) {
+ // // console.log(result[i])
+
+ // const seriesData = []
+ const aseries = []
+ // let nameData = ''
+
+ this.seriesData.push(result[i].ReadTime)
+ aseries.push(result[i].TagValue)
+ // nameData = result[i].UnionTagCode
+ this.aseries = result[i].UnionTagCode
+ }
+ this.myChart.setOption({
+ series: [{
+ data: this.seriesData
+ }]
+ })
},
// 鏁版嵁鐨勮姹�
requestEcharts () {
@@ -130,18 +146,18 @@
for (let i = 0; i < result.length; i++) {
// // console.log(result[i])
- const seriesData = []
+ // const seriesData = []
const aseries = []
// let nameData = ''
- seriesData.push(result[i].ReadTime)
+ this.seriesData.push(result[i].ReadTime)
aseries.push(result[i].TagValue)
// nameData = result[i].UnionTagCode
this.aseries = result[i].UnionTagCode
}
this.myChart.setOption({
series: [{
- data: data
+ data: this.seriesData
}]
})
}, 3000)
@@ -151,6 +167,7 @@
this.$nextTick(() => {
this.requestEcharts()
this.drawChart()
+ this.echartsData()
})
}
}
--
Gitblit v1.8.0