From 006a2bf3bceb04a28d48a7f46c31b21cab02838e Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 09 一月 2026 16:39:52 +0800
Subject: [PATCH] fix: 调整文字
---
src/pages/index/index.vue | 56 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 46174fc..662e7a6 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -93,6 +93,7 @@
import WorkerCallingCard from "@/components/worker-calling-card/index.vue";
import HomeApi from "@/api/home";
import { useUserStore } from "@/store/modules/user";
+import { setTeamId, setPrepareId } from "@/utils/cache";
const visitStatsData = ref<VisitStatsVO>({
todayUvCount: 0,
@@ -120,6 +121,18 @@
userInfo.value.roles.some((role: any) => role.roleKey === "qualitative-inspector")
);
return userInfo.value.roles.some((role: any) => role.roleKey === "qualitative-inspector");
+});
+
+// 鍒ゆ柇鏄惁涓哄嚭搴撹鑹�
+const isStorage = 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 === "storage")
+ );
+ return userInfo.value.roles.some((role: any) => role.roleKey === "storage");
});
const fileProgress = reactive({
@@ -188,16 +201,22 @@
// url: "/pages/work/config/index",
// prem: "sys:config:query",
// },
- {
- icon: "/static/icons/log.png",
- title: "鏃舵晥鎶ュ伐",
- url: "/pages/timely/index",
- show: false,
- },
+ // {
+ // icon: "/static/icons/log.png",
+ // title: "鏃舵晥鎶ュ伐",
+ // url: "/pages/timely/index",
+ // show: false,
+ // },
{
icon: "/static/icons/routingInspection.png",
title: "宸℃",
url: "/pages/routingInspection/index",
+ show: false,
+ },
+ {
+ icon: "/static/icons/log.png",
+ title: "鍑哄簱",
+ url: "/pages/outbound/index",
show: false,
},
]);
@@ -249,14 +268,31 @@
checkVersion();
const { data } = await HomeApi.getIndex();
- // 鍒ゆ柇鏄惁涓哄贰妫�鍛樿鑹�
- if (data.deviceGroupName == "鏃舵晥缁�") {
- navList[1].show = true;
- } else {
+ // 瀛樺偍鐝粍ID鍜岀敓浜у噯澶嘔D
+ if (data) {
+ if (data.id) {
+ setTeamId(data.id);
+ }
+ if (data.prepareId) {
+ setPrepareId(data.prepareId);
+ }
+ }
+
+ if (
+ (data.deviceGroupName && data.deviceGroupName.includes("涓�")) ||
+ (data.deviceGroupName && data.deviceGroupName.includes("缁�"))
+ ) {
+ // 濡傛灉鏄笣鎴栫粸锛屾樉绀虹敓浜х鐞嗚彍鍗�
navList[0].show = true;
}
+ console.log("isInspector.value", isInspector.value);
if (isInspector.value) {
// 濡傛灉鏄贰妫�鍛橈紝鏄剧ず宸℃鑿滃崟
+ navList[1].show = true;
+ }
+ console.log("isStorage.value", isStorage.value);
+ if (isStorage.value) {
+ // 濡傛灉鏄嚭搴撹鑹诧紝鏄剧ず鍑哄簱鑿滃崟
navList[2].show = true;
}
};
--
Gitblit v1.9.3