| | |
| | | const task = { |
| | | state: { |
| | | // 用于任务管理搜索条件 |
| | | taskSearchParams:getStore({ name: 'taskSearchParams' }) || {}, |
| | | taskSearchParams: {}, |
| | | }, |
| | | actions: {}, |
| | | mutations: { |
| | | setTaskSearchParams: (state, data) => { |
| | | setStore({ name: 'taskSearchParams', content: data }) |
| | | console.log(data) |
| | | // setStore({ name: 'taskSearchParams', content: data }) |
| | | state.taskSearchParams = data; |
| | | }, |
| | | }, |
| | |
| | | import { deptsByAreaCode, getDockInfo } from '@/api/home/common'; |
| | | import TaskAlgorithmBusiness from './components/TaskAlgorithmBusiness.vue'; |
| | | import dayjs from 'dayjs'; |
| | | import { useStore } from 'vuex' |
| | | |
| | | const store = useStore() |
| | | const isExpand = ref(false); |
| | | const toggleExpand = () => { |
| | | isExpand.value = !isExpand.value; |
| | |
| | | const emit = defineEmits(['search','addTask']); |
| | | |
| | | const handleSearch = () => { |
| | | emit('search', { |
| | | // 提交至store |
| | | let params = { |
| | | ...searchForm, |
| | | start_date: dateRange.value.length ? `${dateRange.value[0]} 00:00:00` : null, |
| | | end_date: dateRange.value.length ? `${dateRange.value[1]} 23:59:59` : null |
| | | }); |
| | | } |
| | | store.commit('setTaskSearchParams', params); |
| | | emit('search', params); |
| | | }; |
| | | |
| | | const handleReset = () => { |
| | |
| | | checked.value = item; |
| | | // model.value = dateRanges[item]; |
| | | // emit('change', dateRanges[item],timeListEnum[index]); |
| | | searchForm.value.date_enum = timeListEnum[index]; |
| | | searchForm.date_enum = timeListEnum[index]; |
| | | }; |
| | | |
| | | |
| | |
| | | |
| | | const jobListParams = reactive({ |
| | | current: 1, |
| | | size: 8, |
| | | size: 10, |
| | | searchParams:{} |
| | | }); |
| | | const jobListData = ref([]); |
| | |
| | | jobListParams.current = 1; |
| | | jobListParams.size = 10; |
| | | jobListParams.searchParams = params; |
| | | // 存储查询条件 ,用于统计图搜索 |
| | | |
| | | getJobList(); |
| | | }; |
| | | |
| | |
| | | .task-table { |
| | | height: 528px; |
| | | margin-top: 18px; |
| | | overflow: auto; |
| | | } |
| | | |
| | | .current-details { |
| | |
| | | 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> |
| | |
| | | <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> |
| | | |
| | |
| | | import { jobNumBar } from '@/api/home/task'; |
| | | import dayjs from 'dayjs'; |
| | | import useEchartsResize from '@/hooks/useEchartsResize' |
| | | import { useStore } from 'vuex'; |
| | | |
| | | const store = useStore(); |
| | | |
| | | // 日期 |
| | | const currenDate = dayjs().format('YYYY-MM-DD'); |
| | |
| | | }; |
| | | |
| | | // 获取任务时间统计数据 |
| | | const getJobNumBar = (value,date_enum) => { |
| | | jobNumBar({date_enum}).then(res => { |
| | | const getJobNumBar = (value) => { |
| | | jobNumBar(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.value); |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 添加监听 |
| | | watch(() => store.state.task.taskSearchParams, (newVal) => { |
| | | console.log(newVal, '33333'); |
| | | if (newVal) { |
| | | getJobNumBar(newVal); |
| | | (newVal); |
| | | } |
| | | }, { deep: true }); |
| | | |
| | | onMounted(() => { |
| | | getJobNumBar(newTime.value, 'CURRENT_YEAR'); |
| | | getJobNumBar({date_enum: 'TODAY'}); |
| | | }); |
| | | |
| | | </script> |