spring
5 天以前 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,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,
  },
]);
@@ -252,22 +270,24 @@
  // 存储班组ID和生产准备ID
  if (data) {
    if (data.team) {
      setTeamId(data.team);
    if (data.id) {
      setTeamId(data.id);
    }
    if (data.prepareId) {
      setPrepareId(data.prepareId);
    }
  }
  // 判断是否为巡检员角色
  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;
  }
};