From d7862b2890b68743ec9c4fc05800bb23ec9b412e Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期日, 27 四月 2025 16:05:02 +0800
Subject: [PATCH] 完成新增报修单

---
 eims-ui-mobile/src/pages/home/index.vue |  118 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 73 insertions(+), 45 deletions(-)

diff --git a/eims-ui-mobile/src/pages/home/index.vue b/eims-ui-mobile/src/pages/home/index.vue
index 636a1e2..0d22564 100644
--- a/eims-ui-mobile/src/pages/home/index.vue
+++ b/eims-ui-mobile/src/pages/home/index.vue
@@ -71,33 +71,18 @@
         <template #title>
           <view class="flex items-center menu-title-box">
             <view class="menu-indicator"></view>
-            <view class="ml-1 text-xs">鏁版嵁鎬昏</view>
+            <view class="ml-1 text-xs">璁惧绠$悊</view>
           </view>
         </template>
         <wd-grid :column="4">
-          <wd-grid-item use-slot class="flex justify-center items-center">
-            <image class="slot-img text-center" src="/static/menu/menu2.png" />
-            <text>12</text>
-          </wd-grid-item>
-          <wd-grid-item use-slot class="flex justify-center items-center">
-            <image class="slot-img text-center" src="/static/menu/menu2.png" />
-            <text>12</text>
-          </wd-grid-item>
-          <wd-grid-item use-slot class="flex justify-center items-center">
-            <image class="slot-img text-center" src="/static/menu/menu2.png" />
-            <text>12</text>
-          </wd-grid-item>
-          <wd-grid-item use-slot is-dot class="flex justify-center items-center">
-            <image class="slot-img text-center" src="/static/menu/menu2.png" />
-            <text>12</text>
-          </wd-grid-item>
-          <wd-grid-item use-slot class="flex justify-center items-center">
-            <image class="slot-img text-center" src="/static/menu/menu2.png" />
-            <text>12</text>
-          </wd-grid-item>
-          <wd-grid-item use-slot class="flex justify-center items-center">
-            <image class="slot-img text-center" src="/static/menu/menu2.png" />
-            <text>12</text>
+          <wd-grid-item
+            use-slot
+            class="flex justify-center items-center"
+            v-for="(item, index) in equMenu"
+            @click.stop="goItemPage(item.path)"
+          >
+            <image class="slot-img text-center" :src="item.icon" />
+            <text>{{ item.name }}</text>
           </wd-grid-item>
         </wd-grid>
       </wd-card>
@@ -108,17 +93,18 @@
         <template #title>
           <view class="flex items-center menu-title-box">
             <view class="menu-indicator"></view>
-            <view class="ml-1 text-xs">鏁版嵁鎬昏</view>
+            <view class="ml-1 text-xs">璁惧鐐规</view>
           </view>
         </template>
         <wd-grid :column="4">
           <wd-grid-item
             use-slot
             class="flex justify-center items-center"
-            v-for="(item, index) in menuList"
+            v-for="(item, index) in inspectMenu"
             :key="item.id"
+            @click.stop="goItemPage(item.path)"
           >
-            <image class="slot-img text-center" :src="item.url" />
+            <image class="slot-img text-center" :src="item.icon" />
             <text>{{ item.name }}</text>
           </wd-grid-item>
         </wd-grid>
@@ -128,8 +114,7 @@
 </template>
 
 <script lang="ts" setup>
-import { TestEnum } from '@/typings'
-import PLATFORM from '@/utils/platform'
+import { getAllMenusApi } from '@/service/menu'
 
 defineOptions({
   name: 'Home',
@@ -137,34 +122,74 @@
 
 // 鑾峰彇灞忓箷杈圭晫鍒板畨鍏ㄥ尯鍩熻窛绂�
 const { safeAreaInsets } = uni.getSystemInfoSync()
-const author = ref('鑿查附')
-const description = ref(
-  'unibest 鏄竴涓泦鎴愪簡澶氱宸ュ叿鍜屾妧鏈殑 uniapp 寮�鍙戞ā鏉匡紝鐢� uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI + VSCode 鏋勫缓锛屾ā鏉垮叿鏈変唬鐮佹彁绀恒�佽嚜鍔ㄦ牸寮忓寲銆佺粺涓�閰嶇疆銆佷唬鐮佺墖娈电瓑鍔熻兘锛屽苟鍐呯疆浜嗚澶氬父鐢ㄧ殑鍩烘湰缁勪欢鍜屽熀鏈姛鑳斤紝璁╀綘缂栧啓 uniapp 鎷ユ湁 best 浣撻獙銆�',
-)
-// 娴嬭瘯 uni API 鑷姩寮曞叆
+
+const getAllMenus = async () => {
+  const menuList = await getAllMenusApi()
+  console.error(menuList)
+}
+
+const goItemPage = (path: string) => {
+  const url = `/${path}`
+  uni.navigateTo({
+    url,
+  })
+}
+
 onLoad(() => {
-  console.log(author)
-  console.log(TestEnum.A)
+  // getAllMenus()
 })
 
-const menuList = reactive([
+const equMenu = reactive([
   {
     id: 1,
-    name: '娴嬭瘯',
-    url: '/static/menu/menu1.png',
+    name: '璁惧绠$悊',
+    icon: '/static/menu/menu1.png',
+    path: 'pages/equ/equ-list',
   },
   {
     id: 2,
-    name: '娴嬭瘯',
-    url: '/static/menu/menu1.png',
+    name: '宸ュ叿绠$悊',
+    icon: '/static/menu/menu1.png',
+    path: 'pages/fixture/fixture-list',
+  },
+])
+
+const inspectMenu = reactive([
+  /*  {
+    id: 0,
+    name: '璁惧鐐规',
+    icon: '/static/menu/menu0.png',
+    path: 'pages/inspect/insp-add',
+  }, */
+  {
+    id: 1,
+    name: '鐐规姹囨��',
+    icon: '/static/menu/menu4.png',
+    path: 'pages/inspect/insp-st',
+  },
+  {
+    id: 2,
+    name: '淇濆吇姹囨��',
+    icon: '/static/menu/menu3.png',
+    path: 'pages/maint/maint-st',
+  },
+  {
+    id: 3,
+    name: '璁惧鎶ヤ慨',
+    icon: '/static/menu/menu1.png',
+    path: 'pages/repair/req-list',
+  },
+  {
+    id: 4,
+    name: '璁惧缁翠慨',
+    icon: '/static/menu/menu2.png',
+    path: 'pages/repair/res-list',
   },
 ])
 
 function handleUserInfo() {
-  console.error('12121')
+  getAllMenus()
 }
-
-
 </script>
 
 <style lang="scss" scoped>
@@ -202,6 +227,9 @@
 .slot-img {
   width: 72rpx;
   height: 72rpx;
-  border-radius: 8rpx;
+  margin-left: 4rpx;
+}
+:deep(.wd-grid-item__content){
+  align-items: center;
 }
 </style>

--
Gitblit v1.9.3