spring
4 天以前 755e7038caf74126eb4d696ef88f11f0871ff0ee
fix: 完成菜单权限调整
已修改2个文件
38 ■■■■■ 文件已修改
src/manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/index/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/manifest.json
@@ -2,7 +2,7 @@
    "name" : "线缆上报",
    "appid" : "__UNI__F64E0A4",
    "description" : "",
    "versionName" : "1.0.25",
    "versionName" : "1.0.26",
    "versionCode" : "100",
    "transformPx" : false,
    /* 5+App特有相关 */
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;
  }
};