| | |
| | | import type { MesHomeApi } from '#/api/mes/home'; |
| | | import type { EchartsUIType } from '@vben/plugins/echarts'; |
| | | |
| | | import { onMounted, ref, watch } from 'vue'; |
| | | import { onMounted, ref } from 'vue'; |
| | | |
| | | import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; |
| | | |
| | | import { getProductionTrend } from '#/api/mes/home'; |
| | | |
| | | import { useHomeAccess } from '../use-home-access'; |
| | | |
| | | defineOptions({ name: 'DashboardProductionTrend' }); |
| | | |
| | | const chartRef = ref<EchartsUIType>(); |
| | | const { renderEcharts } = useEcharts(chartRef); |
| | | const { canViewHome } = useHomeAccess(); |
| | | |
| | | async function loadTrend() { |
| | | if (!canViewHome.value) return; |
| | | const data = await getProductionTrend(7); |
| | | const dates = data.map((d: MesHomeApi.ProductionTrend) => d.date.slice(5)); |
| | | const quantities = data.map((d: MesHomeApi.ProductionTrend) => d.quantity); |