优化看板图表

This commit is contained in:
qq787203167
2022-05-19 22:35:16 +08:00
parent d044a39f60
commit 3eaf49ce9e
@@ -53,6 +53,7 @@
<div class="box-top-content"> <div class="box-top-content">
<div id="main"></div> <div id="main"></div>
<div class="axis-tip"></div> <div class="axis-tip"></div>
<JLoading :loading="loadingMain">{{this.$t('dataLoading')}}</JLoading>
</div> </div>
</div> </div>
<div class="box-bottom"> <div class="box-bottom">
@@ -112,6 +113,7 @@
return { return {
queryParam: {}, queryParam: {},
loading: false, loading: false,
loadingMain: false,
dataSource: [], dataSource: [],
open: false, open: false,
getTime: [], getTime: [],
@@ -192,6 +194,7 @@
startTime: this.startTime, startTime: this.startTime,
endTime: this.endTime endTime: this.endTime
} }
this.loadingMain = true
getAction(this.url.timeline, query).then((res) => { getAction(this.url.timeline, query).then((res) => {
if (res.success) { if (res.success) {
this.getTimelineList(res.result) this.getTimelineList(res.result)
@@ -228,7 +231,6 @@
}) })
}, },
getEcharts(timeList, timeData) { getEcharts(timeList, timeData) {
var chartDom = document.getElementById('main') var chartDom = document.getElementById('main')
var myChart = echarts.init(chartDom) var myChart = echarts.init(chartDom)
var option var option
@@ -291,7 +293,7 @@
}, },
grid: { grid: {
top: 0, top: 0,
left: 2, left: 40,
right: 40, right: 40,
containLabel: true containLabel: true
}, },
@@ -313,7 +315,7 @@
fontFamily: 'Blue Sky Noto', fontFamily: 'Blue Sky Noto',
color: '#000F16', color: '#000F16',
fontSize: '16' fontSize: '16'
} },
}, },
axisLine: { axisLine: {
show: false show: false
@@ -364,8 +366,11 @@
} }
] ]
} }
this.loadingMain = false
option && myChart.setOption(option) option && myChart.setOption(option, true)
window.onresize = () => {
myChart.resize()
}
myChart.on('mouseover', 'yAxis.category', function(e) { myChart.on('mouseover', 'yAxis.category', function(e) {
console.log(e) console.log(e)
let axisTip = document.querySelector('.axis-tip') let axisTip = document.querySelector('.axis-tip')
@@ -452,7 +457,7 @@
width: 100%; width: 100%;
height: 400px; height: 400px;
margin-bottom: 20px; margin-bottom: 20px;
padding: 20px; padding: 20px 0;
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
} }
@@ -463,7 +468,7 @@
#main { #main {
width: 100%; width: 100%;
height: 200%; height: 100%;
} }
.axis-tip { .axis-tip {