Quellcode durchsuchen

refactor: 移除菜单权限检查逻辑

yusheng vor 3 Monaten
Ursprung
Commit
177ad81f0d
1 geänderte Dateien mit 30 neuen und 34 gelöschten Zeilen
  1. 30 34
      src/views/inspectionWork/components/inspectionWorkList.vue

+ 30 - 34
src/views/inspectionWork/components/inspectionWorkList.vue

@@ -35,12 +35,9 @@
       </template>
 
       <template v-slot:code="{ row }">
-        <el-link
-          type="primary"
-          :underline="false"
-          @click="openDetails(row)"
-          >{{ row.code }}</el-link
-        >
+        <el-link type="primary" :underline="false" @click="openDetails(row)">{{
+          row.code
+        }}</el-link>
       </template>
 
       <template v-slot:sourceCode="{ row }">
@@ -121,8 +118,7 @@
           type="primary"
           :underline="false"
           v-if="
-            row.status == 0 &&
-            $hasPermission('qms:quality_work_order:transfer')
+            row.status == 0 && $hasPermission('qms:quality_work_order:transfer')
           "
           @click="openTransfer(row.id)"
           >转派</el-link
@@ -871,40 +867,40 @@
         return Object.keys(obj).length === 0;
       },
       async openEdit(type, row) {
-        const menusList = this.$store.state.user.menus;
-        let found = false;
+        // const menusList = this.$store.state.user.menus;
         if (type == 'edit') {
           const code = await verificationQualityInspector(row.id);
           if (code == '-1') {
             return;
           }
         }
-        for (const item of menusList) {
-          if (item.children) {
-            for (const item2 of item.children) {
-              if (item2.path === '/inspectionWork/edit') {
-                found = true;
-                const id = type !== 'add' ? row.id : '';
-                const qualityType = type !== 'add' ? row.qualityType : null;
-                const qualityTimeStart = row.qualityTimeStart || '';
-                this.$router.push({
-                  path: '/inspectionWork/edit',
-                  query: {
-                    type,
-                    id,
-                    qualityType,
-                    qualityTimeStart
-                  }
-                });
-                return;
-              }
-            }
+        const id = type !== 'add' ? row.id : '';
+        const qualityType = type !== 'add' ? row.qualityType : null;
+        const qualityTimeStart = row.qualityTimeStart || '';
+        this.$router.push({
+          path: '/inspectionWork/edit',
+          query: {
+            type,
+            id,
+            qualityType,
+            qualityTimeStart
           }
-        }
+        });
+        // for (const item of menusList) {
+        //   if (item.children) {
+        //     for (const item2 of item.children) {
+        //       if (item2.path === '/inspectionWork/edit') {
+        //         found = true;
 
-        if (!found) {
-          this.$message.error('请到角色管理配置菜单权限!');
-        }
+        //         return;
+        //       }
+        //     }
+        //   }
+        // }
+
+        // if (!found) {
+        //   this.$message.error('请到角色管理配置菜单权限!');
+        // }
       },
       openDetails(row) {
         let id = row.id;