8 天以前 fdd158306bf6dc3584f5110a385323f4a8dfb463
src/views/dashboard/bagCodeHome/modules/shortcuts.vue
@@ -9,12 +9,74 @@
const router = useRouter();
/** 快捷入口列表,按业务域精简为 4 个核心入口 */
const shortcuts = [
  { bgColor: '#409EFF', icon: 'lucide:package', name: '品种管理', routeName: 'MdmItem' },
  { bgColor: '#E6A23C', icon: 'lucide:folder-tree', name: '品种分类', routeName: 'MesMdItemType' },
  { bgColor: '#f59e0b', icon: 'lucide:layers', name: '批次生产', routeName: 'MesProBatch' },
  { bgColor: '#ec4899', icon: 'lucide:scan-barcode', name: '赋码管理', routeName: 'MesProBagCode' },
interface Shortcut {
  icon: string;
  name: string;
  routeName: string;
}
interface ShortcutGroup {
  title: string;
  items: Shortcut[];
}
/** 按业务域分组的快捷入口 */
const groups: ShortcutGroup[] = [
  {
    title: '基础数据',
    items: [
      { icon: 'lucide:package', name: '品种管理', routeName: 'MdmItem' },
      { icon: 'lucide:folder-tree', name: '品种分类', routeName: 'MesMdItemType' },
      { icon: 'lucide:ruler', name: '计量单位', routeName: 'MdmUnit' },
    ],
  },
  {
    title: '一袋一码生产',
    items: [
      { icon: 'lucide:factory', name: '产线维护', routeName: 'MesProLine' },
      { icon: 'lucide:layers', name: '批次生产', routeName: 'MesProBatch' },
      { icon: 'lucide:scan-barcode', name: '赋码管理', routeName: 'MesProBagCode' },
      { icon: 'lucide:grid-2x2', name: '托盘码', routeName: 'MesProPallet' },
      { icon: 'lucide:scan-line', name: '扫码入库', routeName: 'MesProScanIn' },
    ],
  },
  {
    title: '出库流通',
    items: [
      { icon: 'lucide:send', name: '发货通知', routeName: 'MesWmSalesNotice' },
      { icon: 'lucide:truck', name: '销售出库', routeName: 'MesWmProductSales' },
      { icon: 'lucide:rotate-ccw', name: '销售退货', routeName: 'MesWmReturnSales' },
    ],
  },
  {
    title: '防伪防窜货',
    items: [
      { icon: 'lucide:shield-alert', name: '窜货预警', routeName: 'MesTraceCrossRegion' },
      { icon: 'lucide:map-pin', name: '扫码地理分布', routeName: 'MesConsumerScanDistribution' },
      { icon: 'lucide:database-check', name: '完整性校验', routeName: 'MesTraceIntegrity' },
    ],
  },
  {
    title: '溯源分析',
    items: [{ icon: 'lucide:scan-line', name: '消费者扫码统计', routeName: 'MesConsumerScanStatistics' }],
  },
  {
    title: '仓储物流',
    items: [
      { icon: 'lucide:warehouse', name: '仓库设置', routeName: 'MesWmWarehouse' },
      { icon: 'lucide:boxes', name: '库存现有量', routeName: 'MesWmMaterialStock' },
      { icon: 'lucide:bell-alert', name: '库存预警', routeName: 'MesWmStockWarning' },
      { icon: 'lucide:move-right', name: '转移调拨', routeName: 'MesWmTransfer' },
    ],
  },
  {
    title: '质量管理',
    items: [
      { icon: 'lucide:list-tree', name: '批次追溯', routeName: 'BatchTrace' },
      { icon: 'lucide:shield-x', name: '不合格品', routeName: 'MesQcNcr' },
      { icon: 'lucide:bean', name: '种子质检', routeName: 'MesQcSeedQuality' },
    ],
  },
];
/** 跳转到目标页面(按路由 name,未加载时提示) */
@@ -30,18 +92,20 @@
<template>
  <Card title="快捷入口" class="h-full">
    <Row :gutter="16">
      <Col v-for="item in shortcuts" :key="item.name" :lg="6" :md="8" :sm="12" :xs="12" class="mb-4">
        <div
          class="hover:bg-accent flex cursor-pointer flex-col items-center gap-2 rounded-lg py-3 transition-all hover:-translate-y-0.5"
          @click="handleNavigate(item.routeName)"
        >
          <div
            class="flex size-12 items-center justify-center rounded-xl text-white"
            :style="{ background: item.bgColor }"
          >
            <IconifyIcon class="size-6" :icon="item.icon" />
      <Col v-for="group in groups" :key="group.title" :lg="8" :md="12" :sm="24" :xs="24" class="mb-4">
        <div class="rounded-xl border border-[rgba(16,185,129,0.16)] bg-[rgba(255,255,255,0.55)] p-3 backdrop-blur">
          <div class="text-muted-foreground mb-2 text-xs font-medium">{{ group.title }}</div>
          <div class="flex flex-wrap gap-2">
            <div
              v-for="item in group.items"
              :key="item.name"
              class="flex cursor-pointer items-center gap-1.5 rounded-lg border border-[rgba(16,185,129,0.22)] px-2 py-1.5 text-sm transition-colors hover:bg-[rgba(16,185,129,0.12)]"
              @click="handleNavigate(item.routeName)"
            >
              <IconifyIcon class="size-4 text-[#0d9488]" :icon="item.icon" />
              <span>{{ item.name }}</span>
            </div>
          </div>
          <span class="text-sm">{{ item.name }}</span>
        </div>
      </Col>
    </Row>