| | |
| | | import dayjs from 'dayjs'; |
| | | import { selectDevicePage } from '@/api/home/machineNest'; |
| | | import { useStore } from 'vuex' |
| | | import useEchartsResize from '@/hooks/useEchartsResize' |
| | | |
| | | const echartsOption = { |
| | | tooltip: { |
| | |
| | | }; |
| | | |
| | | const eventTypeList = ref([ |
| | | { name: '待审核', value: 0, img: overviewImg1, color: '#FF8E8E', status: '2' }, |
| | | { name: '待分拨', value: 0, img: overviewImg2, color: '#6FCAFF', status: '1' }, |
| | | { name: '待处理', value: 0, img: overviewImg3, color: '#6FCAFF', status: '0' }, |
| | | { name: '处理中', value: 0, img: overviewImg4, color: '#FFD509', status: '3' }, |
| | | { name: '已完成', value: 0, img: overviewImg5, color: '#FF8E8E', status: '4' }, |
| | | { name: '已完结', value: 0, img: overviewImg6, color: '#8EFFAC', status: '5' }, |
| | | { name: '待审核', value: 0, img: overviewImg1, color: '#8CFEA7', status: '2' }, |
| | | // { name: '待分拨', value: 0, img: overviewImg2, color: '#6FCAFF', status: '1' }, |
| | | { name: '待处理', value: 0, img: overviewImg3, color: '#E36913', status: '0' }, |
| | | { name: '处理中', value: 0, img: overviewImg4, color: '#FFC398', status: '3' }, |
| | | { name: '已完成', value: 0, img: overviewImg5, color: '#AFD9FB', status: '4' }, |
| | | { name: '已完结', value: 0, img: overviewImg6, color: '#11C4FF', status: '5' }, |
| | | ]); |
| | | const seriesObj = {}; |
| | | eventTypeList.value.forEach(item => { |
| | |
| | | }; |
| | | }); |
| | | const echartsRef = ref(null); |
| | | let chart = null; |
| | | let { chart } = useEchartsResize(echartsRef) |
| | | const deviceList = ref([]); |
| | | const today = dayjs().format('YYYY-MM-DD'); |
| | | const timeArr = ref([today, today]); |
| | |
| | | |
| | | const store = useStore() |
| | | const details = () =>{ |
| | | store.commit('setIsEventOverviewDetail',true) |
| | | store.commit('setFootActiveIndex',1) |
| | | store.commit('setIsEventOverviewDetail',true) |
| | | } |
| | | |
| | | // 远程查询 |
| | |
| | | Object.keys(seriesObj).forEach(key => {seriesObj[key].data = []}) |
| | | list.forEach(item => { |
| | | item.data.forEach((item1, index) => { |
| | | if (!seriesObj?.[item1.status]) return |
| | | seriesObj[item1.status].data.push(item1.value); |
| | | }); |
| | | }); |
| | | completionRateSeries.data = list.map(item => item.rate); |
| | | echartsOption.series = Object.values(seriesObj); |
| | | echartsOption.series.push(completionRateSeries); |
| | | chart.setOption(echartsOption); |
| | | chart.value.setOption(echartsOption); |
| | | }); |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | chart = echarts.init(echartsRef.value); |
| | | window.addEventListener('resize', chart.resize); |
| | | getJobEventTotal().then(res => { |
| | | eventTotal.value = res?.data?.data || 0; |
| | | }); |