Pārlūkot izejas kodu

进行中乐团调整学员不能删除学生

wolyshaw 4 gadi atpakaļ
vecāks
revīzija
c9e99f6001

+ 11 - 4
src/views/teamDetail/components/modals/select-student.vue

@@ -45,6 +45,7 @@
         v-model="seleched"
         :render-content="renderFunc"
         :data="data"
+        :class="{hideReturn: !canDelUser}"
       >
         <template #left-footer>
           <div class="footer line">
@@ -84,6 +85,9 @@ export default {
         gender: genderType[item.gender],
       }));
     },
+    canDelUser() {
+      return this.$route.query.type !== 'resetTeam' || !this.isOnlyChangeUser
+    }
   },
   data() {
     return {
@@ -97,16 +101,14 @@ export default {
   watch: {
     activeListStudent() {
       this.setSelectedUser()
-    }
+    },
   },
   mounted() {
-    console.log(this.isOnlyChangeUser)
     this.setSelectedUser()
   },
   methods: {
     setSelectedUser() {
       const ids = this.activeListStudent.map(item => item.userId)
-      console.log(ids, this.data)
       this.seleched = [...ids]
     },
     filterStudent(query, item) {
@@ -130,7 +132,7 @@ export default {
       this.$listeners.searchStudent()
     },
     submit() {
-      if (this.activeType == 'HIGH_ONLINE' && (this.seleched.length < 3 || this.seleched.length > 5)) {
+      if (!this.isOnlyChangeUser && this.activeType == 'HIGH_ONLINE' && (this.seleched.length < 3 || this.seleched.length > 5)) {
         return this.$message.error('线上技能班必须为3-5人')
       }
       if (this.seleched.length < 1) {
@@ -184,6 +186,11 @@ export default {
   height: 40px;
   line-height: 40px;
 }
+.hideReturn{
+  /deep/ .el-transfer__buttons button:first-child{
+    display: none;
+  }
+}
 /deep/ .line {
   width: 220px;
   display: flex;