| | |
| | | import type { MesHomeApi } from '#/api/mes/home'; |
| | | import type { EchartsUIType } from '@vben/plugins/echarts'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | |
| | | import { CountTo } from '@vben/common-ui'; |
| | | import { IconifyIcon } from '@vben/icons'; |
| | |
| | | import { Spin } from 'ant-design-vue'; |
| | | |
| | | import { getWorkOrderStatusDistribution } from '#/api/mes/home'; |
| | | |
| | | import { useHomeAccess } from '#/utils/use-home-access'; |
| | | |
| | | defineOptions({ name: 'DashboardAlertPanel' }); |
| | | |
| | |
| | | navigate: [name: string]; |
| | | }>(); |
| | | |
| | | const { canQuery, canSeeMenu } = useHomeAccess(); |
| | | |
| | | /** 工单状态分布取自生产订单,接口权限和菜单都要有 */ |
| | | const canViewStatus = computed( |
| | | () => canQuery('mes:home:query') && canSeeMenu('MesProWorkOrder'), |
| | | ); |
| | | |
| | | const chartRef = ref<EchartsUIType>(); |
| | | const { renderEcharts } = useEcharts(chartRef); |
| | | const loading = ref(false); |
| | | |
| | | async function loadStatus() { |
| | | if (!canViewStatus.value) return; |
| | | loading.value = true; |
| | | try { |
| | | const data = await getWorkOrderStatusDistribution(); |
| | |
| | | <!-- 预警卡片行 --> |
| | | <div class="grid grid-cols-1 gap-3"> |
| | | <div |
| | | v-if="canSeeMenu('MesDvRepair')" |
| | | class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0 p-4" |
| | | @click="emit('navigate', 'MesProRepair')" |
| | | @click="emit('navigate', 'MesDvRepair')" |
| | | > |
| | | <div class="relative z-10 flex items-center gap-3"> |
| | | <div class="flex size-10 items-center justify-center rounded-lg bg-amber-50 text-amber-600 shadow-sm dark:bg-amber-500/15 dark:text-amber-400"> |
| | |
| | | </div> |
| | | |
| | | <!-- 工单状态图 --> |
| | | <div class="glass-tilt rounded-2xl p-5"> |
| | | <div v-if="canViewStatus" class="glass-tilt rounded-2xl p-5"> |
| | | <h4 class="mb-3 text-sm font-semibold text-gray-800 dark:text-gray-100"> |
| | | 工单状态分布 |
| | | </h4> |