applist.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <!-- <ul class="flex space-x-2 rtl:space-x-reverse">
  3. <li>
  4. <a href="javascript:;" class="text-primary hover:underline">首页</a>
  5. </li>
  6. <li class="before:content-['/'] ltr:before:mr-2 rtl:before:ml-2">
  7. <span>所有应用</span>
  8. </li>
  9. </ul> -->
  10. <div class="grid grid-cols-2 gap-8">
  11. <div v-for="(item, index) in cols" :key="index" @click="goPageList(item)">
  12. <!-- {{ menuList }} -->
  13. <div v-for="(it) in menuList" :key="it.id">
  14. <img v-if="it.title==item.title" :src="it.icon" alt="">
  15. </div>
  16. <!-- <svg class="w-40 h-40 text-gray-500 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
  17. fill="currentColor" viewBox="0 0 24 24">
  18. <path fill-rule="evenodd"
  19. d="M11.32 6.176H5c-1.105 0-2 .949-2 2.118v10.588C3 20.052 3.895 21 5 21h11c1.105 0 2-.948 2-2.118v-7.75l-3.914 4.144A2.46 2.46 0 0 1 12.81 16l-2.681.568c-1.75.37-3.292-1.263-2.942-3.115l.536-2.839c.097-.512.335-.983.684-1.352l2.914-3.086Z"
  20. clip-rule="evenodd" />
  21. <path fill-rule="evenodd"
  22. d="M19.846 4.318a2.148 2.148 0 0 0-.437-.692 2.014 2.014 0 0 0-.654-.463 1.92 1.92 0 0 0-1.544 0 2.014 2.014 0 0 0-.654.463l-.546.578 2.852 3.02.546-.579a2.14 2.14 0 0 0 .437-.692 2.244 2.244 0 0 0 0-1.635ZM17.45 8.721 14.597 5.7 9.82 10.76a.54.54 0 0 0-.137.27l-.536 2.84c-.07.37.239.696.588.622l2.682-.567a.492.492 0 0 0 .255-.145l4.778-5.06Z"
  23. clip-rule="evenodd" />
  24. </svg> -->
  25. <div class="h-4 mx-10 my-2">
  26. <span class="text-center text-base font-bold whitespace-nowrap">{{
  27. item.title }}</span>
  28. </div>
  29. </div>
  30. <!-- <div>
  31. <svg class="w-40 h-40 text-gray-500 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
  32. fill="currentColor" viewBox="0 0 24 24">
  33. <path fill-rule="evenodd"
  34. d="M11.32 6.176H5c-1.105 0-2 .949-2 2.118v10.588C3 20.052 3.895 21 5 21h11c1.105 0 2-.948 2-2.118v-7.75l-3.914 4.144A2.46 2.46 0 0 1 12.81 16l-2.681.568c-1.75.37-3.292-1.263-2.942-3.115l.536-2.839c.097-.512.335-.983.684-1.352l2.914-3.086Z"
  35. clip-rule="evenodd" />
  36. <path fill-rule="evenodd"
  37. d="M19.846 4.318a2.148 2.148 0 0 0-.437-.692 2.014 2.014 0 0 0-.654-.463 1.92 1.92 0 0 0-1.544 0 2.014 2.014 0 0 0-.654.463l-.546.578 2.852 3.02.546-.579a2.14 2.14 0 0 0 .437-.692 2.244 2.244 0 0 0 0-1.635ZM17.45 8.721 14.597 5.7 9.82 10.76a.54.54 0 0 0-.137.27l-.536 2.84c-.07.37.239.696.588.622l2.682-.567a.492.492 0 0 0 .255-.145l4.778-5.06Z"
  38. clip-rule="evenodd" />
  39. </svg>
  40. <div class="h-4 mx-10 my-2"><span class="text-center text-base font-bold">订单查询</span></div>
  41. </div>
  42. <div class="goods-transfer">
  43. <svg class="w-40 h-40 text-gray-500 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
  44. fill="currentColor" viewBox="0 0 24 24">
  45. <path fill-rule="evenodd"
  46. d="M11.32 6.176H5c-1.105 0-2 .949-2 2.118v10.588C3 20.052 3.895 21 5 21h11c1.105 0 2-.948 2-2.118v-7.75l-3.914 4.144A2.46 2.46 0 0 1 12.81 16l-2.681.568c-1.75.37-3.292-1.263-2.942-3.115l.536-2.839c.097-.512.335-.983.684-1.352l2.914-3.086Z"
  47. clip-rule="evenodd" />
  48. <path fill-rule="evenodd"
  49. d="M19.846 4.318a2.148 2.148 0 0 0-.437-.692 2.014 2.014 0 0 0-.654-.463 1.92 1.92 0 0 0-1.544 0 2.014 2.014 0 0 0-.654.463l-.546.578 2.852 3.02.546-.579a2.14 2.14 0 0 0 .437-.692 2.244 2.244 0 0 0 0-1.635ZM17.45 8.721 14.597 5.7 9.82 10.76a.54.54 0 0 0-.137.27l-.536 2.84c-.07.37.239.696.588.622l2.682-.567a.492.492 0 0 0 .255-.145l4.778-5.06Z"
  50. clip-rule="evenodd" />
  51. </svg>
  52. <div class="h-4 mx-10 my-2"><span class="text-center text-base font-bold">订单查询</span></div>
  53. </div> -->
  54. </div>
  55. <!-- <div class="relative inline-flex align-middle">
  56. <button type="button" @click="godashbord" class="btn btn-dark ltr:rounded-r-none rtl:rounded-l-none">Left</button>
  57. <button type="button" class="btn btn-dark rounded-none">Middle</button>
  58. <button type="button" class="btn btn-dark ltr:rounded-l-none rtl:rounded-r-none">Right</button>
  59. </div>
  60. -->
  61. <!--
  62. <div class="relative inline-flex align-middle fixed-bottom button-group">
  63. <button type="button" @click="godashbord" class="btn btn-dark ltr:rounded-r-none rtl:rounded-l-none">Left</button>
  64. <button type="button" @click="godashbord" class="btn btn-dark rounded-none">Middle</button>
  65. <button type="button" class="btn btn-dark ltr:rounded-l-none rtl:rounded-r-none">Right</button>
  66. </div> -->
  67. </template>
  68. <script lang="ts" setup>
  69. import { ref, computed, onMounted, inject } from 'vue'; // Added onMounted here
  70. import { useAppStore } from '@/stores/index';
  71. import { useMeta } from '@/composables/use-meta';
  72. import router from '@/router';
  73. import { infoApi } from '@/api/api'
  74. import { AxiosInstance } from 'axios';
  75. const $axios = inject('axios') as AxiosInstance;
  76. const cols: any = ref([
  77. { path: 'InventoryList', title: '库存列表', },
  78. { path: 'locationList', title: '库位管理' },
  79. { path: 'InventoryLoss', title: '库存报损' },
  80. { path: 'warehouseList', title: '仓库列表' },
  81. /*{ path: 'locationArea', title: '库位区域' },
  82. { path: 'order_vo.pay_type', title: '冻结列表'},
  83. { path: 'orderList', title: '订单列表' },
  84. { path: 'actions', title: '售后列表'},
  85. { path: 'actions', title: '商品列表'} */
  86. ]);
  87. let menuList = ref('')
  88. const godashbord = () => {
  89. router.push(({ path: '/' }))
  90. }
  91. const goPageList = (item?: any) => {
  92. router.replace({
  93. name: item.path,
  94. });
  95. }
  96. useMeta({ title: 'Chat' });
  97. const store = useAppStore();
  98. const isShowUserChat = ref(false);
  99. const isShowChatMenu = ref(false);
  100. const loginUser = ref({
  101. id: 0,
  102. name: 'Alon Smith',
  103. path: 'profile-34.jpeg',
  104. designation: 'Software Developer',
  105. });
  106. const fetchData = async () => {
  107. try {
  108. const response = await $axios.get('/api-endpoint');
  109. console.log('API Response:', response.data);
  110. } catch (error) {
  111. console.error('API Error:', error);
  112. }
  113. };
  114. const init = async () => {
  115. try {
  116. const res:any = await infoApi.getPdaMenu();
  117. menuList.value = res.data;
  118. console.log(menuList.value);
  119. } catch (error) {
  120. console.error('Error fetching menu data:', error);
  121. }
  122. }
  123. // 在组件加载时调用 fetchData
  124. onMounted(() => {
  125. init()
  126. /* fetchData(); */
  127. });
  128. </script>
  129. <style>
  130. .btn {
  131. width: 100px;
  132. }
  133. .button-group {
  134. position: fixed;
  135. bottom: 0;
  136. left: 0;
  137. width: 100%;
  138. display: flex;
  139. justify-content: center;
  140. z-index: 1000;
  141. /* 确保按钮组在其他内容之上 */
  142. }
  143. </style>