From aca7aa9ce32acc4c8795342f945b027d3bc9f62a Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期二, 10 六月 2025 17:37:34 +0800
Subject: [PATCH] feat: 添加时效报工,修复扫码内存泄漏

---
 src/pages/index/index.vue |   81 ++++++++++++++++++++++------------------
 1 files changed, 45 insertions(+), 36 deletions(-)

diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index a1fa7f1..844ab8b 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -6,9 +6,6 @@
       <view class="text-[#0D867F] font-medium py-2 text-lg">
         <text>浜ㄦ椇鐗瑰绾跨紗涓婃姤绯荤粺</text>
       </view>
-      <view>
-        <ReportWorkTime />
-      </view>
     </view>
     <WorkerCallingCard />
 
@@ -20,19 +17,15 @@
       </template>
     </wd-notice-bar>
     <!-- 蹇嵎瀵艰埅 -->
-    <wd-grid clickable :column="4" class="mt-2">
-      <wd-grid-item
-        v-for="(item, index) in navList"
-        :key="index"
-        use-slot
-        link-type="navigateTo"
-        :url="item.url"
-      >
-        <view class="p-2">
-          <image class="w-72rpx h-72rpx rounded-8rpx" :src="item.icon" />
-        </view>
-        <view class="text">{{ item.title }}</view>
-      </wd-grid-item>
+    <wd-grid clickable :column="1" class="mt-2">
+      <view v-for="(item, index) in navList">
+        <wd-grid-item v-if="item.show" :key="index" use-slot link-type="navigateTo" :url="item.url">
+          <view class="p-2">
+            <image class="w-72rpx h-72rpx rounded-8rpx" :src="item.icon" />
+          </view>
+          <view class="text">{{ item.title }}</view>
+        </wd-grid-item>
+      </view>
     </wd-grid>
 
     <!-- 鏁版嵁缁熻 -->
@@ -87,10 +80,11 @@
 </template>
 
 <script setup lang="ts">
+import { reactive } from "vue";
 import { dayjs } from "wot-design-uni";
 import LogAPI, { VisitStatsVO } from "@/api/system/log";
 import WorkerCallingCard from "@/components/worker-calling-card/index.vue";
-import ReportWorkTime from "./components/ReportWorkTime.vue";
+import HomeApi from "@/api/home";
 
 const visitStatsData = ref<VisitStatsVO>({
   todayUvCount: 0,
@@ -141,24 +135,31 @@
     icon: "/static/icons/user.png",
     title: "鐢熶骇绠$悊",
     url: "/pages/production/index",
+    show: false,
   },
+  // {
+  //   icon: "/static/icons/role.png",
+  //   title: "瑙掕壊绠$悊",
+  //   url: "/pages/work/role/index",
+  //   prem: "sys:role:query",
+  // },
+  // {
+  //   icon: "/static/icons/notice.png",
+  //   title: "閫氱煡鍏憡",
+  //   url: "/pages/work/notice/index",
+  //   prem: "sys:notice:query",
+  // },
+  // {
+  //   icon: "/static/icons/setting.png",
+  //   title: "绯荤粺閰嶇疆",
+  //   url: "/pages/work/config/index",
+  //   prem: "sys:config:query",
+  // },
   {
-    icon: "/static/icons/role.png",
-    title: "瑙掕壊绠$悊",
-    url: "/pages/work/role/index",
-    prem: "sys:role:query",
-  },
-  {
-    icon: "/static/icons/notice.png",
-    title: "閫氱煡鍏憡",
-    url: "/pages/work/notice/index",
-    prem: "sys:notice:query",
-  },
-  {
-    icon: "/static/icons/setting.png",
-    title: "绯荤粺閰嶇疆",
-    url: "/pages/work/config/index",
-    prem: "sys:config:query",
+    icon: "/static/icons/log.png",
+    title: "鏃舵晥鎶ュ伐",
+    url: "/pages/timely/index",
+    show: false,
   },
 ]);
 
@@ -205,9 +206,17 @@
   loadVisitTrendData();
 };
 
-onReady(() => {
-  // loadVisitStatsData();
-  // loadVisitTrendData();
+const init = async () => {
+  const { data } = await HomeApi.getIndex();
+  if (data.deviceGroupName == "鏃舵晥缁�") {
+    navList[1].show = true;
+  } else {
+    navList[0].show = true;
+  }
+};
+
+onMounted(() => {
+  init();
 });
 </script>
 

--
Gitblit v1.9.3