| | |
| | | |
| | | import { getProductionTrend } from '#/api/mes/home'; |
| | | |
| | | import { useHomeAccess } from '../use-home-access'; |
| | | import { useHomeAccess } from '#/utils/use-home-access'; |
| | | |
| | | defineOptions({ name: 'DashboardProductionTrend' }); |
| | | |
| | | const chartRef = ref<EchartsUIType>(); |
| | | const { renderEcharts } = useEcharts(chartRef); |
| | | const { canViewHome } = useHomeAccess(); |
| | | const { canSeeMenu } = useHomeAccess(); |
| | | |
| | | async function loadTrend() { |
| | | if (!canViewHome.value) return; |
| | | // 生产趋势取自生产报工,报工菜单没开就不请求 |
| | | if (!canSeeMenu('MesProFeedback')) 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); |