|
@@ -650,7 +650,7 @@ export default {
|
|
|
curSubData.markers.push({
|
|
|
id: teacher.id,
|
|
|
name: teacher.name,
|
|
|
- qu: block.quNo.sort((a,b)=>{
|
|
|
+ qu: block.quNo.sort((a, b) => {
|
|
|
return a - b
|
|
|
}),
|
|
|
count: c
|
|
@@ -659,10 +659,10 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//如果先设置按题分配,然后切换成按人分配需要清空qu
|
|
|
- this.setting.subs.forEach(subItem=>{
|
|
|
- subItem.markers.forEach(t=>{
|
|
|
+ this.setting.subs.forEach(subItem => {
|
|
|
+ subItem.markers.forEach(t => {
|
|
|
t.qu = []
|
|
|
})
|
|
|
})
|
|
@@ -726,6 +726,35 @@ export default {
|
|
|
if (res.correct) {
|
|
|
this.setting = res.correct
|
|
|
this.isSetting = true
|
|
|
+ //如果是按题分配模式需要转换数据格式
|
|
|
+ if (this.setting.mode == 'qu') {
|
|
|
+ this.quBlockes = []
|
|
|
+ this.setting.subs.forEach(subItem => {
|
|
|
+ let item = {
|
|
|
+ id: subItem.id,
|
|
|
+ name: subItem.name,
|
|
|
+ quBlock: []
|
|
|
+ }
|
|
|
+ //根据题块进行分组
|
|
|
+ let group = this.$jsFn.groupBy(subItem.markers, 'qu')
|
|
|
+ group.forEach(gItem => {
|
|
|
+ let qItem = {
|
|
|
+ id: this.$jsFn.uuid(),
|
|
|
+ quNo: gItem[0].qu,
|
|
|
+ teachers: []
|
|
|
+ }
|
|
|
+ gItem.forEach(tItem => {
|
|
|
+ qItem.teachers.push({
|
|
|
+ id: tItem.id,
|
|
|
+ name: tItem.name
|
|
|
+ })
|
|
|
+ })
|
|
|
+ item.quBlock.push(qItem)
|
|
|
+ })
|
|
|
+ this.quBlockes.push(item)
|
|
|
+ })
|
|
|
+ console.log('处理结果',this.quBlockes)
|
|
|
+ }
|
|
|
} else {
|
|
|
this.isSetting = false
|
|
|
if (this.evInfo.subjects) {
|