spring
6 天以前 755e7038caf74126eb4d696ef88f11f0871ff0ee
src/pages/index/index.vue
@@ -123,6 +123,18 @@
  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({
  show: false,
  progress: 0,
@@ -189,12 +201,12 @@
  //   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: "巡检",
@@ -205,7 +217,7 @@
    icon: "/static/icons/log.png",
    title: "出库",
    url: "/pages/outbound/index",
    show: true,
    show: false,
  },
]);
@@ -266,14 +278,16 @@
    }
  }
  // 判断是否为巡检员角色
  if (data.deviceGroupName == "时效组") {
    navList[1].show = true;
  } else {
  if (data.deviceGroupName.includes("丝") || data.deviceGroupName.includes("绞")) {
    // 如果是丝或绞,显示生产管理菜单
    navList[0].show = true;
  }
  if (isInspector.value) {
    // 如果是巡检员,显示巡检菜单
    navList[1].show = true;
  }
  if (isStorage.value) {
    // 如果是出库角色,显示出库菜单
    navList[2].show = true;
  }
};