Переглянути джерело

Merge branch '03/12permission' into dev

lex-xin 4 роки тому
батько
коміт
ba9db994d4

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.3b8d23b6.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-20d42954.9e33947d.js


+ 23 - 13
src/permission.js

@@ -42,25 +42,35 @@ function getFirstMenu(routes) {
   let firstMenu = null
   routes.forEach(item => {
     if(!firstMenu && item.children?.length > 0) {
-      item.children.forEach(child => {
-        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
-          }
+      firstMenu = pathErgodic(item)
+    }
+  })
+  return firstMenu
+}
+
+function pathErgodic(item) {
+  let firstMenu = null
+  item.children.forEach(i => {
+    if(!firstMenu && i.children?.length > 0) {
+      firstMenu = pathErgodic(i)
+    } else {
+      if(!firstMenu && checkPathUrl(i.path)) {
+        firstMenu = i.path
+      } else {
+        if(!firstMenu && !i.hidden) {
+          firstMenu = item.path + '/' + i.path
         }
-      })
+      }
     }
   })
-  console.log(firstMenu)
   return firstMenu
 }
 
+// 判断path有没有带/,并且是第一个位置
+function checkPathUrl(path) {
+  return path.indexOf('/') === 0 ? true : false
+}
+
 
 router.beforeEach(async (to, from, next) => {
   // from.query = to.query

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

@@ -106,8 +106,8 @@ const actions = {
           // commit('SET_PERMISSION', recursionPermission(res.data).flat(Infinity))
           window.localStorage.removeItem('permission')
           window.localStorage.setItem('permission', tempArr)
-          resolve(accessedRoutes)
           this.dispatch('app/setDotStatus')
+          resolve(accessedRoutes)
         }
       })
     })

+ 1 - 1
src/views/adapayAccount/form.vue

@@ -377,7 +377,7 @@ export default {
       this.form.multipartFile = null
       this.$store.dispatch('delVisitedViews', this.$route)
       this.$router.push({
-        path: "/systemManager/sysBasics/adapayManager"
+        path: "/sysBasics/adapayManager"
       });
     }
   },

+ 1 - 1
src/views/adapayAccount/index.vue

@@ -286,7 +286,7 @@ export default {
         tagTitle = '修改'
       }
       this.$router.push({
-        path: '/systemManager/sysBasics/adapayOperation',
+        path: '/sysBasics/adapayOperation',
         query: {
           type: type,
           row: JSON.stringify(row)

+ 2 - 2
src/views/app/entryActivities.vue

@@ -157,7 +157,7 @@ export default {
         })
       } else if (type == 'create') {
         this.$router.push({
-          path: '/systemManager/sysBasics/entryOperation',
+          path: '/sysBasics/entryOperation',
           query: {
             type: 'create'
           }
@@ -166,7 +166,7 @@ export default {
         })
       } else if (type == 'look') {
         this.$router.push({
-          path: '/systemManager/sysBasics/entryOperation',
+          path: '/sysBasics/entryOperation',
           query: {
             id: row.id,
             type: 'look'

+ 2 - 2
src/views/app/entryOperation.vue

@@ -351,7 +351,7 @@ export default {
         this.$message.success(title + "成功");
         this.$store.dispatch('delVisitedViews', this.$route)
         this.$router.push({
-          path: "/systemManager/sysBasics/entryActivities"
+          path: "/sysBasics/entryActivities"
         });
       } else {
         this.$message.error(res.msg);
@@ -360,7 +360,7 @@ export default {
     onCancel () {
       this.$store.dispatch('delVisitedViews', this.$route)
       this.$router.push({
-        path: "/systemManager/sysBasics/entryActivities"
+        path: "/sysBasics/entryActivities"
       });
     },
     handleSuccess (res) {

+ 1 - 1
src/views/categroyManager/insideSetting/adminManager.vue

@@ -84,7 +84,7 @@ export default {
     },
     onAdminOperation (type, row) {
       let params = {
-        path: '/systemManager/parameter/adminoperation',
+        path: '/parameter/adminoperation',
         query: {
           type: type,
           page: this.pageInfo.page

+ 2 - 2
src/views/categroyManager/insideSetting/adminOperation.vue

@@ -135,7 +135,7 @@ export default {
       if (res.code == 200) {
         this.$message.success('修改成功')
         this.$store.dispatch('delVisitedViews', this.$route)
-        this.$router.push({ path: '/systemManager/parameter/adminManager', query: { page: this.page } })
+        this.$router.push({ path: '/parameter/adminManager', query: { page: this.page } })
       } else {
         this.$message.error(res.msg)
       }
@@ -240,7 +240,7 @@ export default {
     onCancel () {
       this.$store.dispatch('delVisitedViews', this.$route)
       this.$router.push({
-        path: '/systemManager/parameter/adminManager',
+        path: '/parameter/adminManager',
         query: {
           page: this.$route.query.page
         }

+ 21 - 3
src/views/operationalEarly/operationalList.vue

@@ -63,6 +63,7 @@
         <el-form-item>
           <el-button type="danger" native-type="submit">搜索</el-button>
           <el-button native-type="reset" type="primary">重置</el-button>
+          <el-button type="primary" @click="onExport" v-permission="'export/teacherCourseStatistics'">导出</el-button>
         </el-form-item>
       </save-form>
       <div class="tableWrap">
@@ -171,6 +172,8 @@ import {
   getTeacher,
 } from "@/api/buildTeam";
 import pagination from "@/components/Pagination/index";
+import { Export } from "@/utils/downLoadFile";
+import qs from 'qs'
 let nowDate = new Date();
 let nowMonth =
   nowDate.getFullYear() +
@@ -243,9 +246,9 @@ export default {
     },
     getList() {
       let params = this.searchForm;
-      params.page = this.pageInfo.page
-      params.rows = this.pageInfo.limit
-      teacherCourseStatistics(params).then((res) => {
+      // params.page = this.pageInfo.page
+      // params.rows = this.pageInfo.limit
+      teacherCourseStatistics({ ...params, page: this.pageInfo.page, rows: this.pageInfo.limit }).then((res) => {
         let result = res.data;
         if (res.code == 200) {
           this.tableList = result.rows;
@@ -253,6 +256,21 @@ export default {
         }
       });
     },
+    onExport() {
+      const { ...rest } = this.searchForm;
+      Export(
+        this,
+        {
+          url: "/api-web/export/teacherCourseStatistics",
+          fileName: "运营预警.xlsx",
+          method: "post",
+          params: qs.stringify({
+            ...rest
+          }),
+        },
+        "您确定导出运营预警?"
+      );
+    },
   },
 };
 </script>

Деякі файли не було показано, через те що забагато файлів було змінено