|
@@ -339,8 +339,26 @@ export default {
|
|
|
},
|
|
|
saveGroup() {
|
|
|
this.tableLoading = true
|
|
|
+ // this.$api.schoolSetting.upsertGroup({
|
|
|
+ // classroom: this.classList[this.curClassIndex]
|
|
|
+ // }).then(
|
|
|
+ // (res) => {
|
|
|
+ // if (!res.error) {
|
|
|
+ // this.$Message.success(this.$t('cusMgt.saveOk'))
|
|
|
+ // } else {
|
|
|
+ // this.$Message.error('API error!')
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // (err) => {
|
|
|
+ // this.$Message.error('API error!')
|
|
|
+ // }
|
|
|
+ // ).finally(() => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.tableLoading = false
|
|
|
+ // }, 500)
|
|
|
+ // })
|
|
|
this.$api.schoolSetting.upsertGroup({
|
|
|
- classroom: this.classList[this.curClassIndex]
|
|
|
+ students: this.classList[this.curClassIndex].students
|
|
|
}).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
@@ -357,7 +375,6 @@ export default {
|
|
|
this.tableLoading = false
|
|
|
}, 500)
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
comfirmCustomRules() {
|
|
|
if (this.groupNum === 0) {
|
|
@@ -391,22 +408,11 @@ export default {
|
|
|
this.classList[this.curClassIndex].students = this.classList[this.curClassIndex].students.sort((a, b) => {
|
|
|
a.seatNo > b.seatNo
|
|
|
})
|
|
|
- // for (let i = 0; i < maxCount; i++) {
|
|
|
- // for (let j = 0; j < this.groupNum; j++) {
|
|
|
- // let startIndex = this.groupNum * i
|
|
|
- // if (startIndex + j < stuLen) {
|
|
|
- // this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupId', i + 1)
|
|
|
- // this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupName', (i + 1) + this.$t('cusMgt.groupUnit'))
|
|
|
- // } else {
|
|
|
- // break
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
for (let i = 0; i < this.groupNum; i++) {
|
|
|
let num = surplus == 0 ? maxCount : i < surplus ? maxCount : maxCount - 1 //每组实际人数
|
|
|
for (let j = 0; j < num; j++) {
|
|
|
let startIndex = i + (j * this.groupNum)
|
|
|
- this.$set(this.classList[this.curClassIndex].students[startIndex], 'groupId', i + 1)
|
|
|
+ this.$set(this.classList[this.curClassIndex].students[startIndex], 'groupId', (i + 1)+'')
|
|
|
this.$set(this.classList[this.curClassIndex].students[startIndex], 'groupName', (i + 1) + this.$t('cusMgt.groupUnit'))
|
|
|
}
|
|
|
}
|