ShortcutCard.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <el-card shadow="never">
  3. <template #header>
  4. <CardTitle title="快捷入口" />
  5. </template>
  6. <div class="flex flex-row flex-wrap gap-8 p-4">
  7. <div
  8. v-for="menu in menuList"
  9. :key="menu.name"
  10. class="h-20 w-20% flex flex-col cursor-pointer items-center justify-center gap-2"
  11. @click="handleMenuClick(menu.routerName)"
  12. >
  13. <div :class="menu.bgColor" class="rounded p-3 text-white">
  14. <Icon :icon="menu.icon" class="text-7.5!" />
  15. </div>
  16. <span>{{ menu.name }}</span>
  17. </div>
  18. </div>
  19. </el-card>
  20. </template>
  21. <script lang="ts" setup>
  22. /** 快捷入口卡片 */
  23. import { CardTitle } from '@/components/Card'
  24. defineOptions({ name: 'ShortcutCard' })
  25. const router = useRouter() // 路由
  26. /** 菜单列表 */
  27. const menuList = [
  28. { name: '用户管理', icon: 'ep:user-filled', bgColor: 'bg-red-400', routerName: 'MemberUser' },
  29. {
  30. name: '商品管理',
  31. icon: 'fluent-mdl2:product',
  32. bgColor: 'bg-orange-400',
  33. routerName: 'ProductSpu'
  34. },
  35. { name: '订单管理', icon: 'ep:list', bgColor: 'bg-yellow-500', routerName: 'TradeOrder' },
  36. {
  37. name: '售后管理',
  38. icon: 'ri:refund-2-line',
  39. bgColor: 'bg-green-600',
  40. routerName: 'TradeAfterSale'
  41. },
  42. {
  43. name: '分销管理',
  44. icon: 'fa-solid:project-diagram',
  45. bgColor: 'bg-cyan-500',
  46. routerName: 'TradeBrokerageUser'
  47. },
  48. {
  49. name: '优惠券',
  50. icon: 'ep:ticket',
  51. bgColor: 'bg-blue-500',
  52. routerName: 'PromotionCoupon'
  53. },
  54. {
  55. name: '拼团活动',
  56. icon: 'fa:group',
  57. bgColor: 'bg-purple-500',
  58. routerName: 'PromotionBargainActivity'
  59. },
  60. {
  61. name: '佣金提现',
  62. icon: 'vaadin:money-withdraw',
  63. bgColor: 'bg-rose-500',
  64. routerName: 'TradeBrokerageWithdraw'
  65. }
  66. ]
  67. /**
  68. * 跳转到菜单对应页面
  69. *
  70. * @param routerName 路由页面组件的名称
  71. */
  72. const handleMenuClick = (routerName: string) => {
  73. router.push({ name: routerName })
  74. }
  75. </script>