| | |
| | | <script setup> |
| | | import * as echarts from 'echarts'; |
| | | import { industryJobNumPieChart } from '@/api/home/task'; |
| | | import useEchartsResize from '@/hooks/useEchartsResize' |
| | | const chartRef = ref(null); |
| | | let chart = null; |
| | | let { chart } = useEchartsResize(chartRef) |
| | | |
| | | const option = { |
| | | tooltip: { |
| | |
| | | item.value = matchData.value; |
| | | } |
| | | }); |
| | | chart.setOption(option); |
| | | chart.value.setOption(option); |
| | | }); |
| | | }; |
| | | |
| | |
| | | // } |
| | | // })); |
| | | // option.series[0].data = data; |
| | | // chart.setOption(option); |
| | | // chart.value.setOption(option); |
| | | // }); |
| | | // }; |
| | | |
| | | |
| | | onMounted(() => { |
| | | chart = echarts.init(chartRef.value); |
| | | getIndustryJobNumPieChart(); |
| | | |
| | | window.addEventListener('resize', () => { |
| | | chart?.resize(); |
| | | }); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | window.removeEventListener('resize', chart?.resize); |
| | | chart?.dispose(); |
| | | }); |
| | | </script> |
| | | |
| | |
| | | width: 244px; |
| | | height: 100%; |
| | | .title { |
| | | margin-top: 10px; |
| | | margin-top: 10px; |
| | | width: 244px; |
| | | height: 26px; |
| | | background: url('@/assets/images/task/title.png') no-repeat center / 100% 100%; |
| | |
| | | height: 200px; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |