首页看板、电表报表接口联调,部分接口参数更新

This commit is contained in:
白菜
2025-07-09 21:16:54 +08:00
parent b3b4d9c0dc
commit b8827248cb
10 changed files with 159 additions and 134 deletions

View File

@ -11,7 +11,6 @@
<style scoped lang="scss"></style>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from '@/mixins/ems/resize'
export default {
@ -21,11 +20,6 @@ export default {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
@ -34,11 +28,15 @@ export default {
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(document.querySelector('#xtxlChart'), 'macarons')
this.setOptions()
initChart(data) {
this.chart = echarts.init(document.querySelector('#xtxlChart'))
this.setOption(data)
},
setOptions() {
setOption(data) {
const source=[['日期','系统效率']]
data.forEach(item => {
source.push([item.dateMonth,item.systemEfficiency])
})
this.chart.setOption({
color:['#FFBE01'],
legend: {
@ -55,7 +53,7 @@ export default {
color:"#333333",
},
xAxis: {
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
type: 'category',
axisLine: {
lineStyle:{
color: '#333333',
@ -70,10 +68,10 @@ export default {
}
}
},
dataset:{source},
series: [
{
name:'系统效率',
data: [80,92,1,34,90,130,320,80,9,91,34,90],
type: 'line',
}]
})