index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div class="working">
  3. <div class="card" v-for="i in routerData" :key="i.path">
  4. <div class="title">{{ i.meta.title }}</div>
  5. <ul>
  6. <li v-for="j in i.children" :key="j.path">
  7. <div class="icon">
  8. <van-icon class-prefix="icon" name="icon_gd" />
  9. </div>
  10. <div class="text">{{ j.meta.title }}</div>
  11. </li>
  12. </ul>
  13. </div>
  14. <div class="card">
  15. <div class="title">出入库</div>
  16. <ul>
  17. <li @click="handleGo(1)">
  18. <div class="icon">
  19. <van-icon class-prefix="icon" name="icon_gd" />
  20. </div>
  21. <div class="text">手动出库</div>
  22. </li>
  23. <li @click="handleGo(2)">
  24. <div class="icon">
  25. <van-icon class-prefix="icon" name="icon_gd" />
  26. </div>
  27. <div class="text">手动入库</div>
  28. </li>
  29. </ul>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. import { ref, reactive, getCurrentInstance, toRaw } from "vue";
  35. const proxy = getCurrentInstance().proxy;
  36. console.log(toRaw(proxy), "asss");
  37. const routerData = ref([]);
  38. const getRouter = () => {
  39. proxy.get("getRouters", {}).then((res) => {
  40. routerData.value = res.data;
  41. });
  42. };
  43. getRouter();
  44. const handleGo = (type) => {
  45. if (type === 1) {
  46. proxy.$router.push({
  47. path: "/purchase-sales/manualOutbound",
  48. });
  49. }
  50. if (type === 2) {
  51. proxy.$router.push({
  52. path: "/purchase-sales/manualInbound",
  53. });
  54. }
  55. if (type === 3) {
  56. proxy.$router.push({
  57. path: "/purchase-sales/manualOutbound",
  58. });
  59. }
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .working {
  64. background-color: #f1f1f1;
  65. padding: 12px;
  66. color: #333;
  67. .card {
  68. background: #fff;
  69. border-radius: 5px;
  70. margin-top: 12px;
  71. .title {
  72. height: 52px;
  73. line-height: 52px;
  74. color: #333;
  75. font-size: 16px;
  76. font-weight: bold;
  77. position: relative;
  78. padding: 0 16px;
  79. }
  80. .title::before {
  81. content: "";
  82. display: inline-block;
  83. width: 4px;
  84. height: 12px;
  85. background: #409eff;
  86. position: absolute;
  87. left: 0;
  88. top: 20px;
  89. background: #0084ff;
  90. border-radius: 2px 2px 2px 2px;
  91. }
  92. ul {
  93. display: flex;
  94. flex-wrap: wrap;
  95. padding-bottom: 30px;
  96. li {
  97. width: 25%;
  98. text-align: center;
  99. margin-top: 10px;
  100. .icon {
  101. height: 40px;
  102. width: 40px;
  103. margin: 0 auto;
  104. background: #1989fa;
  105. line-height: 40px;
  106. border-radius: 5px;
  107. color: #fff;
  108. font-size: 20px;
  109. }
  110. .text {
  111. font-size: 12px;
  112. height: 24px;
  113. line-height: 24px;
  114. }
  115. }
  116. }
  117. }
  118. }
  119. </style>