上课-作业 修改
This commit is contained in:
parent
94ae78bffc
commit
4754ed641c
|
@ -73,7 +73,6 @@
|
||||||
import { ref, onMounted, toRaw } from 'vue';
|
import { ref, onMounted, toRaw } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { homeworklist } from '@/api/teaching/classwork'
|
|
||||||
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
||||||
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
||||||
import FileImage from '@/components/file-image/index.vue'
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
|
@ -156,71 +155,13 @@ const getResource = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取作业数据
|
//获取作业数据
|
||||||
const getHomework = () => {
|
const getHomework = async () => {
|
||||||
|
const data = toRaw(toolStore.curSubjectNode).data.node
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
homeworklist({
|
const { res } = await useGetHomework(data)
|
||||||
entpcourseid: entpcourseid.value,
|
dataList.value = res
|
||||||
edituserid: usertore.userId,
|
|
||||||
pageSize: 100
|
|
||||||
}).then(res => {
|
|
||||||
//以下代码 参照AIx web端 作业布置
|
|
||||||
let list = []
|
|
||||||
for (var i = 0; i < res.rows.length; i++) {
|
|
||||||
res.rows[i].taskconfig = []
|
|
||||||
|
|
||||||
// 找child
|
|
||||||
for (var j = 0; j < res.rows.length; j++) {
|
|
||||||
if (res.rows[j].parentid == res.rows[i].id) {
|
|
||||||
var ss = []
|
|
||||||
if (res.rows[j].classworkdatastudentids != null) {
|
|
||||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
|
||||||
}
|
|
||||||
var js = {
|
|
||||||
id: res.rows[j].id,
|
|
||||||
classid: res.rows[j].classid,
|
|
||||||
classcaption: res.rows[j].classcaption,
|
|
||||||
parentid: 0,
|
|
||||||
worktype: '',
|
|
||||||
workkey: res.rows[j].workkey,
|
|
||||||
worktag: '',
|
|
||||||
entpcourseid: 0,
|
|
||||||
evalid: 0,
|
|
||||||
edusubject: '',
|
|
||||||
edudegree: '',
|
|
||||||
workdate: '',
|
|
||||||
title: '',
|
|
||||||
workcodes: '',
|
|
||||||
studentlist: ss,
|
|
||||||
deaddate: res.rows[j].deaddate,
|
|
||||||
timelength: res.rows[j].timelength,
|
|
||||||
weights: res.rows[j].weights,
|
|
||||||
feedtype: res.rows[j].feedtype
|
|
||||||
}
|
|
||||||
res.rows[i].taskconfig.push(js)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.rows[i].fileShowName = res.rows[i].uniquekey
|
|
||||||
|
|
||||||
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
|
||||||
// 2024-05-15,酉阳,jackyshen
|
|
||||||
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
|
||||||
list.push(res.rows[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果是习题训练任务,则检查一共有多少道
|
|
||||||
if (res.rows[i].entpcourseworklist != '') {
|
|
||||||
res.rows[i].entpcourseworklistarray = JSON.parse(
|
|
||||||
'[' + res.rows[i].entpcourseworklist + ']'
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
res.rows[i].entpcourseworklistarray = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dataList.value = list
|
|
||||||
})
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
@ -245,10 +186,10 @@ function leave(el, done) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
lesson.value = route.query.label
|
lesson.value = route.query.label
|
||||||
getHomework()
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
getHomework()
|
||||||
getResource()
|
getResource()
|
||||||
},1000)
|
},200)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue