mo 4 anni fa
parent
commit
1c39ad7d30

+ 10 - 2
src/layout/components/Sidebar/SidebarItem.vue

@@ -3,7 +3,7 @@
     <template
       v-if="
         hasOneShowingChild(item.children, item) &&
-        (!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
+        (!onlyOneChild.children|| onlyOneChild.children.length<1 || onlyOneChild.noShowingChildren) &&
         !item.alwaysShow
       "
     >
@@ -86,7 +86,7 @@ export default {
       const showingChildren = children.filter((item) => {
         if (item.hidden) {
           return false;
-        } else {
+        } else  {
           // Temp set(will be used if only has one showing child)
           this.onlyOneChild = item;
           return true;
@@ -94,7 +94,15 @@ export default {
       });
 
       // When there is only one child router, the child router is displayed by default
+
       if (showingChildren.length === 1) {
+        if(showingChildren[0].meta.title == '网管课管理'){
+          console.log(showingChildren[0])
+            console.log(this.onlyOneChild,this.onlyOneChild.children,this.onlyOneChild.noShowingChildren,this.item.alwaysShow)
+        }
+        // console.log(showingChildren[0].meta.title)
+
+
         return true;
       }
 

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

@@ -13,7 +13,7 @@ function generateAsyncRouter (asyncRoutes, data) {
   if (!data) {
     return []
   }
-
+  // console.log(data)
   data.forEach((item) => {
     item.component = asyncRoutes[item.component]
     if (item.children && item.children.length > 0) {
@@ -49,6 +49,7 @@ const mutations = {
 // 路由
 // 递归遍历数组
 function recursionRouter (arr) {
+
   if (arr.length > 0) {
     let newArr = [];
     for (let i = 0; i < arr.length; i++) {

+ 23 - 12
src/views/teamBuild/components/teamBaseInfo.vue

@@ -373,10 +373,7 @@ import {
 import { findTechnician } from "@/api/repairManager";
 import dayjs from "dayjs";
 import merge from "webpack-merge";
-import {
-  queryByOrganId,
-  getSchool,
-} from "@/api/systemManage";
+import { queryByOrganId, getSchool } from "@/api/systemManage";
 import qrCode from "@/components/QrCode/index";
 import { classStatus } from "@/utils/searchArray";
 import { vaildStudentUrl, vaildTeacherUrl } from "@/utils/validate";
@@ -514,8 +511,13 @@ export default {
   },
   deactivated() {},
   beforeDestroy() {
-    this.topFrom.paymentExpireDate = this.paymentExpireDate;
-    sessionStorage.setItem(`${this.teamid}base`, JSON.stringify(this.topFrom));
+    // this.topFrom.paymentExpireDate = this.paymentExpireDate;
+    if(this.$route.query.id){
+         sessionStorage.setItem(`${this.$route.query.id}base`, JSON.stringify(this.topFrom));
+    }else{
+      sessionStorage.setItem(`newTeambase`, JSON.stringify(this.topFrom));
+    }
+
   },
 
   methods: {
@@ -600,16 +602,25 @@ export default {
           });
         } else {
           this.topFrom = sotrage;
-          this.applyExpireDate = sotrage.time;
-          this.paymentExpireDate = Storage.paymentExpireDate;
-          if (this.topFrom.section) {
+          // this.applyExpireDate = sotrage.time;
+          // this.paymentExpireDate = Storage.paymentExpireDate;
+          if (this.topFrom?.section) {
             // 获取员工
             this.getBaseList(this.topFrom.section);
           }
         }
+      } else {
+        // 如果是新建团
+        let sotrage = JSON.parse(sessionStorage.getItem(`newTeambase`));
+        sotrage?this.topFrom = sotrage:this.topFrom;
+            if (this.topFrom?.section) {
+            // 获取员工
+            this.getBaseList(this.topFrom.section);
+          }
+
       }
       this.getStudentStatus();
-      this.$emit("getName", this.topFrom.name);
+      this.$emit("getName", this.topFrom?.name);
       getEmployeeOrgan().then((res) => {
         if (res.code == 200) {
           this.sectionList = res.data;
@@ -798,8 +809,8 @@ export default {
                         team_status: "DRAFT",
                       }),
                     });
-                    this.$emit('handleClick',{name:'2'})
-                    this.$emit('getName', this.topFrom.name)
+                    this.$emit("handleClick", { name: "2" });
+                    this.$emit("getName", this.topFrom.name);
                   })
                   .catch(() => {});
               }

+ 4 - 4
src/views/teamBuild/components/teamSoundSet.vue

@@ -43,14 +43,14 @@
         v-permission="'musicGroup/auditFailed'"
         >驳回</el-button
       >
-      <div
-        class="submitBtn"
-        v-if="teamStatus == 'resetTeam'"
+      <el-button
+           type="primary"
+        v-if="teamStatus == 'resetTeam'||teamStatus == 'teamDraft'"
         v-permission="'musicGroup/updateSubjectInfo'"
         @click="submitInfo()"
       >
         保存
-      </div>
+      </el-button>
       <!--  v-if="teamStatus != 'teamAudit'" -->
       <!--
       <div

+ 3 - 2
src/views/teamDetail/teamList.vue

@@ -468,8 +468,9 @@ export default {
       });
     },
     createNewTeam() {
-      this.$store.dispatch("buildIndex", 0);
-      this.$store.dispatch("delVisitedViews", { path: "/business/teamBuild" });
+      // this.$store.dispatch("buildIndex", 0);
+      // this.$store.dispatch("delVisitedViews", { path: "/business/teamBuild" });
+       sessionStorage.removeItem(`newTeambase`);
     this.$router.push({
             path: "/resetTeaming",
               query: { type: "newTeam"}},