liulijun
2025-11-17 da4257bc32483409af02a06dd342c6981ec786ec
项目代码/BigScreen/src/common/echart/index.vue
文件名从 项目代码/BigScreen/src/components/echart/index.vue 修改
@@ -1,16 +1,11 @@
<!--
 * @Author: daidai
 * @Date: 2022-02-28 16:29:08
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-09-27 15:05:45
 * @FilePath: \web-pc\src\pages\big-screen\components\echart\index.vue
-->
<template>
  <div :id="id" :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import * as echarts from 'echarts';
import tdTheme from './theme.json' // 寮曞叆榛樿涓婚
import '../map/fujian.js'
export default {
  name: 'echart',
  props: {
@@ -28,7 +23,7 @@
    },
    height: {
      type: String,
      default: '100%'
      default: '2.5rem'
    },
    options: {
      type: Object,
@@ -50,6 +45,7 @@
    }
  },
  mounted () {
    this.$echarts.registerTheme('tdTheme', tdTheme); // 瑕嗙洊榛樿涓婚
    this.initChart();
  },
  beforeDestroy () {
@@ -59,7 +55,7 @@
  methods: {
    initChart () {
      // 鍒濆鍖杄chart
      this.chart = echarts.init(this.$el)
      this.chart = this.$echarts.init(this.$el, 'tdTheme')
      this.chart.setOption(this.options, true)
    }
  }