|
@@ -116,6 +116,7 @@ import workModel from './modal/workModel'
|
|
|
import StudentListModel from './modal/studentList'
|
|
|
import cleanDeep from 'clean-deep'
|
|
|
import deepClone from '@/helpers/deep-clone'
|
|
|
+import { postMessage, listenerMessage } from '@/helpers/native-message'
|
|
|
export default {
|
|
|
name: "teacherList",
|
|
|
components: { MHeader, workModel, StudentListModel },
|
|
@@ -177,6 +178,7 @@ export default {
|
|
|
if(browser().android || browser().iPhone) {
|
|
|
this.headerStatus = false
|
|
|
}
|
|
|
+ // 获取课程学员【根据接口初始化声部列表】
|
|
|
await getCourseStudents({ courseScheduleId: this.courseId }).then(res => {
|
|
|
const result = res.data
|
|
|
if(result.code != 200) { return }
|
|
@@ -201,6 +203,7 @@ export default {
|
|
|
musicScoreIdList: [{
|
|
|
id: null,
|
|
|
name: null,
|
|
|
+ songPart: null,
|
|
|
}], // 默认加一个空的,做占位
|
|
|
})
|
|
|
} else {
|
|
@@ -224,10 +227,25 @@ export default {
|
|
|
this.dataSubjectList = deepClone(params.subjectList)
|
|
|
this.params = params
|
|
|
})
|
|
|
+
|
|
|
+ // 获取当前课程的作业列表
|
|
|
+ listenerMessage('getAccompany', (res) => {
|
|
|
+ if(res) {
|
|
|
+ this.tabActiveList.musicScoreIdList[this.tabActiveIndex] = {
|
|
|
+ id: res.songId,
|
|
|
+ name: res.songName,
|
|
|
+ songPart: res.songPart,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
onSelectAccompany(item, index) {
|
|
|
- this.accompanimentStatus = true
|
|
|
+ // this.accompanimentStatus = true
|
|
|
+ // 唤起弹窗
|
|
|
+ postMessage({ api: 'openAccompany', content: {
|
|
|
+ subjectId: item.id
|
|
|
+ }})
|
|
|
this.tabActiveList = item
|
|
|
this.tabActiveIndex = index
|
|
|
},
|
|
@@ -287,9 +305,14 @@ export default {
|
|
|
let subjectLength = this.params.subjectIdList.length
|
|
|
tempSubjectList.forEach(subject => {
|
|
|
let scoreIdList = []
|
|
|
+ let scoreList = []
|
|
|
subject.musicScoreIdList.forEach(music => {
|
|
|
if(music.id) {
|
|
|
scoreIdList.push(music.id)
|
|
|
+ scoreList.push({
|
|
|
+ musicScoreId: music.id,
|
|
|
+ partIndex: music.songPart,
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
if(scoreIdList.length <= 0) {
|
|
@@ -297,7 +320,8 @@ export default {
|
|
|
}
|
|
|
musicScoreSubjectDto.push({
|
|
|
musicScoreIdList: scoreIdList,
|
|
|
- userIdList: subject.userIdList
|
|
|
+ userIdList: subject.userIdList,
|
|
|
+ musicScoreHomeworkDtoList: scoreList,
|
|
|
})
|
|
|
})
|
|
|
if(notAccompanySong.length - subjectLength <= 0 && notAccompanySong != 0 && type[0] != 1) {
|
|
@@ -314,12 +338,12 @@ export default {
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- this.$toast.loading({
|
|
|
- message: '加载中...',
|
|
|
- duration: 10000,
|
|
|
- forbidClick: true,
|
|
|
- loadingType: 'spinner',
|
|
|
- })
|
|
|
+ // this.$toast.loading({
|
|
|
+ // message: '加载中...',
|
|
|
+ // duration: 10000,
|
|
|
+ // forbidClick: true,
|
|
|
+ // loadingType: 'spinner',
|
|
|
+ // })
|
|
|
let params = {
|
|
|
title: this.title,
|
|
|
content: this.content,
|
|
@@ -327,6 +351,8 @@ export default {
|
|
|
expiryDate: dayjs(this.dateSection.currentDate).format('YYYY-MM-DD'),
|
|
|
musicScoreSubjectDto: musicScoreSubjectDto
|
|
|
}
|
|
|
+ console.log(params)
|
|
|
+ return
|
|
|
addHomeWork(cleanDeep({...params})).then(res => {
|
|
|
let result = res.data
|
|
|
this.$toast.clear()
|