| | |
| | | <script setup> |
| | | import * as echarts from 'echarts'; |
| | | import { industryJobNumPieChart } from '@/api/home/task'; |
| | | import useEchartsResize from '@/hooks/useEchartsResize' |
| | | import useEchartsResize from '@/hooks/useEchartsResize'; |
| | | import { useStore } from 'vuex'; |
| | | |
| | | const store = useStore(); |
| | | const chartRef = ref(null); |
| | | let { chart } = useEchartsResize(chartRef) |
| | | let { chart } = useEchartsResize(chartRef); |
| | | |
| | | const option = { |
| | | tooltip: { |
| | |
| | | }; |
| | | |
| | | // 获取行业统计数据 |
| | | const getIndustryJobNumPieChart = () => { |
| | | industryJobNumPieChart().then(res => { |
| | | const getIndustryJobNumPieChart = (value) => { |
| | | industryJobNumPieChart(value).then(res => { |
| | | if (res.data.code !== 0) return; |
| | | option.series[0].data.forEach(item => { |
| | | const matchData = res.data.data.find(d => d.name === item.name); |
| | |
| | | // }); |
| | | // }; |
| | | |
| | | // 添加监听 |
| | | watch(() => store.state.task.taskSearchParams, (newVal) => { |
| | | console.log(newVal, '2222'); |
| | | if (newVal) { |
| | | getIndustryJobNumPieChart(newVal); |
| | | } |
| | | }, { deep: true }); |
| | | |
| | | onMounted(() => { |
| | | getIndustryJobNumPieChart(); |
| | | getIndustryJobNumPieChart({date_enum: 'TODAY'}); |
| | | }); |
| | | </script> |
| | | |