浏览代码

feat: 屏蔽机器排行

Ritchie 1 年之前
父节点
当前提交
b836acceb9
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      src/views/robotRanking.vue

+ 13 - 1
src/views/robotRanking.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="robotRanking flex-col">
+  <div class="robotRanking flex-col" v-if="showRobotRankingDiv">
     <div class="box1 flex-col">
     <div class="box1 flex-col">
       <s-header :name="$t('robotRanking.machineSalesRanking')" :noback="true" :isFixed="false"></s-header>
       <s-header :name="$t('robotRanking.machineSalesRanking')" :noback="true" :isFixed="false"></s-header>
       <div class="box3 flex-col">
       <div class="box3 flex-col">
@@ -726,6 +726,12 @@ export default {
       });
       });
     };
     };
     const user = getLoginUser();
     const user = getLoginUser();
+    // 默认能看到机器排行
+    const showRobotRankingDiv = ref(true);
+    console.log("user.menuCodeList>>>", user.menuCodeList);
+    console.log("user.type>>>", user.type);
+    const isM11Included = user.menuCodeList.some((item) => item === "M11");
+
     // 日、周、月、年的图表
     // 日、周、月、年的图表
     const dayChartBox = ref();
     const dayChartBox = ref();
     const weekChartBox = ref();
     const weekChartBox = ref();
@@ -745,6 +751,10 @@ export default {
         return item === "M4";
         return item === "M4";
       })
       })
 
 
+      if (user.type > 2 && !isM11Included) {
+        showRobotRankingDiv.value = false;
+      }
+
       // 如果是type为admin或者商家或者是有订单数据权限M4的子商家才可以查看
       // 如果是type为admin或者商家或者是有订单数据权限M4的子商家才可以查看
       if (user.type === 0 || user.type === 2 || isOrderData) {
       if (user.type === 0 || user.type === 2 || isOrderData) {
         init();
         init();
@@ -873,6 +883,8 @@ export default {
       maTypeDefaIdx,
       maTypeDefaIdx,
       chgTypeDefaIdx,
       chgTypeDefaIdx,
       isAdmin,
       isAdmin,
+
+      showRobotRankingDiv,
     };
     };
   },
   },
   components: { sHeader, kTabs, kDialog, kNoData },
   components: { sHeader, kTabs, kDialog, kNoData },