|  |  | 
 |  |  |     </wd-notice-bar> | 
 |  |  |     <!-- 快捷导航 --> | 
 |  |  |     <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 v-for="(item, index) in navList" :key="index"> | 
 |  |  |         <wd-grid-item v-if="item.show" use-slot link-type="navigateTo" :url="item.url"> | 
 |  |  |           <view class="p-2"> | 
 |  |  |             <image class="w-72rpx h-72rpx rounded-8rpx" :src="item.icon" /> | 
 |  |  |           </view> | 
 |  |  | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script setup lang="ts"> | 
 |  |  | import { reactive } from "vue"; | 
 |  |  | import { reactive, computed } from "vue"; | 
 |  |  | import { dayjs, useMessage, useToast } from "wot-design-uni"; | 
 |  |  | import LogAPI, { VisitStatsVO } from "@/api/system/log"; | 
 |  |  | import WorkerCallingCard from "@/components/worker-calling-card/index.vue"; | 
 |  |  | import HomeApi from "@/api/home"; | 
 |  |  | import { useUserStore } from "@/store/modules/user"; | 
 |  |  |  | 
 |  |  | const visitStatsData = ref<VisitStatsVO>({ | 
 |  |  |   todayUvCount: 0, | 
 |  |  | 
 |  |  |  | 
 |  |  | const message = useMessage(); | 
 |  |  | const toast = useToast(); | 
 |  |  |  | 
 |  |  | // 获取当前登录用户信息 | 
 |  |  | const userStore = useUserStore(); | 
 |  |  | const userInfo: any = computed(() => userStore.userInfo); | 
 |  |  |  | 
 |  |  | // 判断是否为巡检员角色 | 
 |  |  | const isInspector = computed(() => { | 
 |  |  |   if (!userInfo.value || !userInfo.value.roles || !Array.isArray(userInfo.value.roles)) { | 
 |  |  |     return false; | 
 |  |  |   } | 
 |  |  |   console.log( | 
 |  |  |     "userInfo.value.roles", | 
 |  |  |     userInfo.value.roles.some((role: any) => role.roleKey === "qualitative-inspector") | 
 |  |  |   ); | 
 |  |  |   return userInfo.value.roles.some((role: any) => role.roleKey === "qualitative-inspector"); | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const fileProgress = reactive({ | 
 |  |  |   show: false, | 
 |  |  | 
 |  |  |     icon: "/static/icons/routingInspection.png", | 
 |  |  |     title: "巡检", | 
 |  |  |     url: "/pages/routingInspection/index", | 
 |  |  |     show: true, | 
 |  |  |     show: false, | 
 |  |  |   }, | 
 |  |  | ]); | 
 |  |  |  | 
 |  |  | 
 |  |  | const init = async () => { | 
 |  |  |   checkVersion(); | 
 |  |  |   const { data } = await HomeApi.getIndex(); | 
 |  |  |   if (data.deviceGroupName == "时效组") { | 
 |  |  |  | 
 |  |  |   // 判断是否为巡检员角色 | 
 |  |  |   if (isInspector.value) { | 
 |  |  |     // 如果是巡检员,显示巡检菜单 | 
 |  |  |     navList[2].show = true; | 
 |  |  |   } else if (data.deviceGroupName == "时效组") { | 
 |  |  |     navList[1].show = true; | 
 |  |  |   } else { | 
 |  |  |     navList[0].show = true; |