lex-xin 4 years ago
parent
commit
4ac4010db3
2 changed files with 13 additions and 6 deletions
  1. 11 2
      src/permission.js
  2. 2 4
      src/views/auditList/index.vue

+ 11 - 2
src/permission.js

@@ -43,12 +43,21 @@ function getFirstMenu(routes) {
   routes.forEach(item => {
     if(!firstMenu && item.children?.length > 0) {
       item.children.forEach(child => {
-        if(!firstMenu && !child.hidden) {
-          firstMenu = item.path + '/' + child.path
+        if(!firstMenu && child.children?.length > 0) {
+          child.children.forEach(sChild => {
+            if(!firstMenu && !sChild.hidden) {
+              firstMenu = child.path + '/' + sChild.path
+            }
+          })
+        } else {
+          if(!firstMenu && !child.hidden) {
+            firstMenu = item.path + '/' + child.path
+          }
         }
       })
     }
   })
+  console.log(firstMenu)
   return firstMenu
 }
 

+ 2 - 4
src/views/auditList/index.vue

@@ -219,11 +219,9 @@
             fixed="right"
           >
             <template slot-scope="scope">
-              <auth :auths="scope.row.auditStatus === 'AUDITING' ? 'musicGroupPaymentCalender/auditListDetail/update' : 'musicGroupPaymentCalender/auditListDetail/look'">
-                <el-button @click="lookDetail(scope.row)" type="text">
+              <el-button @click="lookDetail(scope.row)" type="text" v-if="$helpers.permission(scope.row.auditStatus === 'AUDITING' ? 'musicGroupPaymentCalender/auditListDetail/update' : 'musicGroupPaymentCalender/auditListDetail/look')">
                   {{ scope.row.auditStatus === "AUDITING" ? "审核" : "查看" }}
-                </el-button>
-              </auth>
+              </el-button>
             </template>
           </el-table-column>
         </el-table>