{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/echartsNew/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/echartsNew/index.vue","mtime":1701742078546},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n\n// +----------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\nimport echarts from 'echarts';\nexport default {\n  name: 'Index',\n  props: {\n    styles: {\n      type: Object,\n      default: null,\n    },\n    optionData: {\n      type: Object,\n      default: null,\n    },\n  },\n  data() {\n    return {\n      myChart: null,\n    };\n  },\n  computed: {\n    echarts() {\n      return 'echarts' + Math.ceil(Math.random() * 100);\n    },\n  },\n  watch: {\n    optionData: {\n      handler(newVal, oldVal) {\n        this.handleSetVisitChart();\n      },\n      deep: true, // 对象内部属性的监听，关键。\n    },\n  },\n  mounted: function () {\n    const vm = this;\n    vm.$nextTick(() => {\n      vm.handleSetVisitChart();\n      window.addEventListener('resize', this.wsFunc);\n    });\n  },\n  beforeDestroy() {\n    window.removeEventListener('resize', this.wsFunc);\n    if (!this.myChart) {\n      return;\n    }\n    this.myChart.dispose();\n    this.myChart = null;\n  },\n  methods: {\n    wsFunc() {\n      this.myChart.resize();\n    },\n    handleSetVisitChart() {\n      this.myChart = echarts.init(document.getElementById(this.echarts));\n      let option = null;\n      option = this.optionData;\n      // 基于准备好的dom，初始化echarts实例\n      this.myChart.setOption(option, true);\n    },\n  },\n};\n",null]}