| | |
| | | <script> |
| | | import VolHeader from '@/components/basic/VolHeader.vue'; |
| | | import VolForm from '@/components/basic/VolForm.vue'; |
| | | let echarts = require('echarts'); |
| | | import options from './chartOptions'; |
| | | import { |
| | | formFields1, |
| | |
| | | formFields2, |
| | | formRules2 |
| | | } from './formOptions'; |
| | | |
| | | let echarts = null; |
| | | |
| | | async function loadEcharts() { |
| | | if (!echarts) { |
| | | const module = await import('echarts'); |
| | | echarts = module.default || module; |
| | | } |
| | | return echarts; |
| | | } |
| | | |
| | | export default { |
| | | components: { VolForm, VolHeader }, |
| | | data() { |
| | |
| | | options: options |
| | | }; |
| | | }, |
| | | mounted() { |
| | | async mounted() { |
| | | echarts = await loadEcharts(); |
| | | let $bar = echarts.init(document.getElementById(this.bar)); |
| | | $bar.setOption(this.options.bar); |
| | | |