浏览代码

Merge branch '05/08permission' into test

mo 4 年之前
父节点
当前提交
4183a30ff0

+ 2 - 0
src/layout/components/Sidebar/index.vue

@@ -142,6 +142,8 @@ export default {
             });
             if (isChildrenList) {
               index = this.menuOperation(arr[i].children);
+            }else{
+              index = 1
             }
           } else {
             index++;

+ 9 - 7
src/permission.js

@@ -39,13 +39,15 @@ router.onError((error) => {
 });
 
 function getFirstMenu(routes) {
-  let firstMenu = null
-  routes.forEach(item => {
-    if(!firstMenu && item.children?.length > 0) {
-      firstMenu = pathErgodic(item)
-    }
-  })
-  return firstMenu
+  console.log(routes)
+  // let firstMenu = null
+  // routes.forEach(item => {
+  //   if(!firstMenu && item.children?.length > 0) {
+  //     firstMenu = pathErgodic(item)
+  //   }
+  // })
+  // console.log('firstMenu',firstMenu)
+  return routes[0].redirect
 }
 
 function pathErgodic(item) {

+ 9 - 1
src/store/modules/permission.js

@@ -51,6 +51,7 @@ function getFirstMenu(routes) {
   routes.forEach(item => {
     if (item.children?.length > 0 && !item.hidden) {
       firstMenu = pathErgodic(item)
+      console.log(firstMenu)
       item.redirect = firstMenu
     }
   })
@@ -71,7 +72,14 @@ function pathErgodic(item) {
       if(isChildrenList){
         firstMenu = pathErgodic(i)
       }else{
-        firstMenu = i.path
+
+        if (!firstMenu && checkPathUrl(i.path)) {
+          firstMenu = i.path
+        } else {
+          if (!firstMenu && !i.hidden) {
+            firstMenu = item.path + '/' + i.path
+          }
+        }
       }
 
     } else {

+ 1 - 1
src/views/businessManager/orderManager/backMoney.vue

@@ -285,7 +285,7 @@ export default {
         rows: this.pageInfo.limit,
         ...getTimes(orderDate, ["startTime", "endTime"]),
       };
-      //  (params)
+
       studentRefundsQueryPage(params).then((res) => {
         let result = res.data;
         if (res.code == 200) {

+ 2 - 2
src/views/businessManager/orderManager/financeManager-taoqi.vue

@@ -827,7 +827,7 @@ export default {
               this.getList();
             } else {
               this.$message.error(res.msg);
-               ("来了");
+
             }
           });
         } else {
@@ -1193,7 +1193,7 @@ export default {
     },
     handleError(err, file, fileList) {
       load.endLoading();
-       (err, file, fileList);
+
     },
     fomatStr(str) {
       let arr = str.split(";");

+ 1 - 1
src/views/businessManager/orderManager/payRecord.vue

@@ -405,7 +405,7 @@ export default {
     },
     handleError(err, file, fileList) {
       load.endLoading();
-       (err, file, fileList);
+
     },
     downloadFile() {
       Export(this, {

+ 1 - 1
src/views/teamBuild/signupList.vue

@@ -86,7 +86,7 @@
           >
             报表导出
           </div>
-          <auth :auths="'studentRegistration/queryPreApplyList'">
+          <auth :auths="'studentRegistration/queryPreApplyList/4263'">
             <div
               class="newBand"
               style="margin-right: 0"

+ 4 - 4
src/views/teamDetail/components/studentList.vue

@@ -347,20 +347,20 @@
               <el-button
                 type="text"
                 v-if="
-                  permission('musicGroupQuit/directQuitMusicGroup2') &&
+                  permission('musicGroupQuit/directQuitMusicGroup/3852') &&
                   scope.row.studentStatus != 'QUIT'
                 "
                 @click="quieTeamMask(scope.row)"
-                >退团退费</el-button
+                >退团</el-button
               >
               <el-button
                 type="text"
                 v-if="
-                  permission('musicGroupQuit/directQuitMusicGroup3') &&
+                  permission('musicGroupQuit/directQuitMusicGroup/3851') &&
                   scope.row.studentStatus != 'QUIT'
                 "
                 @click="quieTeam(scope.row)"
-                >退团</el-button
+                >退团不退费</el-button
               >
 
               <el-button

+ 23 - 25
src/views/teamDetail/teamCourseList.vue

@@ -1099,40 +1099,38 @@ export default {
         },
         params: this.getSearchForm(),
         url,
-        // responseType: "blob",
+        responseType: "blob",
       };
       this.$confirm("您确定导出报表", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
-        .then((data) => {
+        .then(() => {
           load.startLoading();
           axios(options)
             .then((res) => {
-              console.log(res)
-              this.$message.success(res.data.data)
-              // let blob = new Blob([res.data], {
-              //   // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
-              //   type: "application/vnd.ms-excel;charset=utf-8",
-              //   //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
-              // });
-              // let text = new Response(blob).text();
-              // text.then((res) => {
-              //   // 判断是否报错
-              //   if (res.indexOf("code") != -1) {
-              //     let json = JSON.parse(res);
-              //     this.$message.error(json.msg);
-              //   } else {
-              //     let objectUrl = URL.createObjectURL(blob);
-              //     let link = document.createElement("a");
-              //     let fname = "课表列表" + new Date().getTime() + ".xls"; //下载文件的名字
-              //     link.href = objectUrl;
-              //     link.setAttribute("download", fname);
-              //     document.body.appendChild(link);
-              //     link.click();
-              //   }
-              // });
+              let blob = new Blob([res.data], {
+                // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
+                type: "application/vnd.ms-excel;charset=utf-8",
+                //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
+              });
+              let text = new Response(blob).text();
+              text.then((res) => {
+                // 判断是否报错
+                if (res.indexOf("code") != -1) {
+                  let json = JSON.parse(res);
+                  this.$message.error(json.msg);
+                } else {
+                  let objectUrl = URL.createObjectURL(blob);
+                  let link = document.createElement("a");
+                  let fname = "课表列表" + new Date().getTime() + ".xls"; //下载文件的名字
+                  link.href = objectUrl;
+                  link.setAttribute("download", fname);
+                  document.body.appendChild(link);
+                  link.click();
+                }
+              });
               load.endLoading();
             })
             .catch((error) => {