Prechádzať zdrojové kódy

选科报名志愿排序bug 修复

shilipojs 3 rokov pred
rodič
commit
8bf5977e9e

+ 8 - 5
src/views/system/user/profile/components/report-table.vue

@@ -101,14 +101,11 @@ export default {
           width:'100',
           fixed: 'right'
         }
-      }
+      },
+      selectedList: []
     }
   },
   computed: {
-    selectedList() {
-      if (!this.list.length) return []
-      return this.list.filter(item => item.selected)
-    },
     formatList() {
       if (!this.list.length) return []
       if (!this.optionalMajors.length) return []
@@ -141,6 +138,7 @@ export default {
         return
       }
       row.selected = true
+      this.selectedList.push(row)
       this.$refs.drage.init(this.selectedList)
     },
     toUnSelect(row) {
@@ -150,6 +148,11 @@ export default {
         type: 'warning'
       }).then(() => {
         row.selected = false
+        this.selectedList.splice(
+          this.selectedList.indexOf(this.selectedList.find((selected) => {
+              return selected.groupId === row.groupId }
+            )
+          ), 1);
         this.$refs.drage.init(this.selectedList)
       }).catch(() => {
         this.$message({