| | |
| | | import * as echarts from 'echarts'; |
| | | import { jobEventBar } from '@/api/home/task'; |
| | | import dayjs from 'dayjs'; |
| | | import useEchartsResize from '@/hooks/useEchartsResize' |
| | | import useEchartsResize from '@/hooks/useEchartsResize'; |
| | | import { useStore } from 'vuex'; |
| | | |
| | | const store = useStore(); |
| | | |
| | | // const setTaskSearchParams = computed(() => store.state.task.setTaskSearchParams); |
| | | |
| | | // 日期 |
| | | const currenDate = dayjs().format('YYYY-MM-DD'); |
| | |
| | | }; |
| | | |
| | | // 获取行业统计数据 |
| | | const getJobEventBar = (value,date_enum) => { |
| | | jobEventBar({date_enum}).then(res => { |
| | | const getJobEventBar = (value) => { |
| | | jobEventBar(value).then(res => { |
| | | if (res.data.code !== 0) return; |
| | | option.xAxis.data = res.data.data.map(item => item.name); |
| | | option.series[0].data = res.data?.data.map(item => item.data[0].value); |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 添加监听 |
| | | watch(() => store.state.task.taskSearchParams, (newVal) => { |
| | | console.log(newVal, '1111'); |
| | | if (newVal) { |
| | | getJobEventBar(newVal); |
| | | } |
| | | }, { deep: true }); |
| | | |
| | | onMounted(() => { |
| | | getJobEventBar(newTime.value, 'CURRENT_YEAR'); |
| | | getJobEventBar({date_enum: 'TODAY'}); |
| | | }); |
| | | |
| | | </script> |