|
@@ -4,22 +4,22 @@
|
|
|
<el-row>
|
|
|
<el-col class="flex-center-column" :span="12">
|
|
|
<el-form-item>
|
|
|
- <mx-select @change="getStudents('from',$event)" :span="12" :list="display" v-model="fromClassId"
|
|
|
+ <mx-select @change="toGetStudents('from',$event)" :span="12" :list="display" v-model="fromClassId"
|
|
|
placeholder="请选择" item-label="className" item-value="classId"
|
|
|
></mx-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <class-table :list="studentsTableLeft" @confirm="studentSelected($event,'from')"></class-table>
|
|
|
+ <class-table ref="fromTable" :pageForm="pageFormFrom" :list="studentsTableLeft" @confirm="studentSelected($event,'from')"></class-table>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col class="flex-center-column" :span="12">
|
|
|
<el-form-item>
|
|
|
- <mx-select @change="getStudents('to',$event)" :span="12" :list="display" v-model="toClassId"
|
|
|
+ <mx-select @change="toGetStudents('to',$event)" :span="12" :list="display" v-model="toClassId"
|
|
|
placeholder="请选择" item-label="className" item-value="classId"
|
|
|
></mx-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <class-table :list="studentsTableRight" @confirm="studentSelected($event,'to')"></class-table>
|
|
|
+ <class-table ref="toTable" :pageForm="pageFormTo" :list="studentsTableRight" @confirm="studentSelected($event,'to')"></class-table>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -55,6 +55,20 @@ export default {
|
|
|
type: Array
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ pageFormFrom:{
|
|
|
+ deep:true,
|
|
|
+ handler() {
|
|
|
+ this.getStudents('from',this.fromClassId)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pageFormTo:{
|
|
|
+ deep:true,
|
|
|
+ handler() {
|
|
|
+ this.getStudents('to',this.toClassId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
inject: ['refreshData'],
|
|
|
mixins: [MxClassTreeTranslateMixin],
|
|
|
data() {
|
|
@@ -62,6 +76,17 @@ export default {
|
|
|
form: {},
|
|
|
studentsTableLeft: [],
|
|
|
studentsTableRight: [],
|
|
|
+ pageFormTo: {
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
+ total: 0,
|
|
|
+ },
|
|
|
+ pageFormFrom: {
|
|
|
+ paramsName: 'pageFormFrom',
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
+ total: 0,
|
|
|
+ },
|
|
|
fromClassId: '',
|
|
|
toClassId: '',
|
|
|
selectedLeft: [],
|
|
@@ -165,18 +190,32 @@ export default {
|
|
|
if (type == 'to') this.selectedRight = list
|
|
|
|
|
|
},
|
|
|
+ toGetStudents(type, classId) {
|
|
|
+ // 清空
|
|
|
+ if(type == 'from') {
|
|
|
+ this.$refs.fromTable.clearSelection()
|
|
|
+ this.selectedLeft = []
|
|
|
+ }
|
|
|
+ if(type == 'to') {
|
|
|
+ this.$refs.toTable.clearSelection()
|
|
|
+ this.selectedRight = []
|
|
|
+ }
|
|
|
+ this.getStudents(type, classId)
|
|
|
+ },
|
|
|
getStudents(type, classId) {
|
|
|
- console.log(type)
|
|
|
- console.log(classId)
|
|
|
classesResult({
|
|
|
groupId: this.group.groupId,
|
|
|
roundId: this.group.roundId,
|
|
|
+ pageSize: type == 'from' ? this.pageFormFrom.pageSize : this.pageFormTo.pageSize,
|
|
|
+ pageNum: type == 'from' ? this.pageFormFrom.pageNum : this.pageFormTo.pageNum,
|
|
|
classId: classId
|
|
|
}).then(res => {
|
|
|
if( type == 'from') {
|
|
|
this.studentsTableLeft = res.rows
|
|
|
+ this.pageFormFrom.total = res.total
|
|
|
}else if( type == 'to') {
|
|
|
this.studentsTableRight = res.rows
|
|
|
+ this.pageFormTo.total = res.total
|
|
|
}
|
|
|
})
|
|
|
},
|