gaoluyang
6 天以前 8151c3253dc287a79914bc08414af17dfb380c96
src/views/mes/home/modules/alert-panel.vue
@@ -7,6 +7,10 @@
import { Badge, Card } from 'ant-design-vue';
import { useHomeAccess } from '#/utils/use-home-access';
import { HOME_BLOCK_MENUS } from '../data';
defineOptions({ name: 'MesHomeAlertPanel' });
const props = defineProps<{
@@ -17,15 +21,18 @@
  navigate: [name: string];
}>();
/** 待办提醒列表:标签、描述、图标、目标路由名称、数量 */
const alertItems = computed(() => [
const { canSeeMenu } = useHomeAccess();
/** 待办提醒列表:标签、描述、图标、目标路由名称、数量;菜单没开的条目不展示 */
const alertItems = computed(() =>
  [
  {
    count: props.summary.andonActiveCount,
    desc: '未处置的安灯呼叫',
    icon: 'lucide:bell-ring',
    iconClass: 'bg-red-50 text-red-500',
    label: '安灯报警',
    routeName: 'MesProAndonRecord',
      routeName: HOME_BLOCK_MENUS.andon,
  },
  {
    count: props.summary.repairActiveCount,
@@ -33,7 +40,7 @@
    icon: 'lucide:wrench',
    iconClass: 'bg-orange-50 text-orange-500',
    label: '设备维修',
    routeName: 'MesDvRepair',
      routeName: HOME_BLOCK_MENUS.repair,
  },
  {
    count: props.summary.workOrderPrepareCount,
@@ -41,13 +48,14 @@
    icon: 'lucide:clipboard-list',
    iconClass: 'bg-blue-50 text-blue-500',
    label: '待排产订单',
    routeName: 'MesProWorkOrder',
      routeName: HOME_BLOCK_MENUS.workOrder,
  },
]);
  ].filter((item) => canSeeMenu(item.routeName)),
);
</script>
<template>
  <Card title="待办与异常" class="h-full">
  <Card v-if="alertItems.length" title="待办与异常" class="h-full">
    <div class="flex flex-col">
      <div
        v-for="item in alertItems"