lyc-dev #134

Merged
lyc merged 5 commits from lyc-dev into main 2024-08-15 09:59:08 +08:00
1 changed files with 8 additions and 67 deletions
Showing only changes of commit 4754ed641c - Show all commits

View File

@ -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'
@ -145,7 +144,7 @@ const openFileLink = (item) =>{
// //
const getResource = () => { const getResource = () => {
let querySearch = toRaw(toolStore.curSubjectNode).querySearch let querySearch = toRaw(toolStore.curSubjectNode).querySearch
querySearch.orderByColumn = 'uploadTime' querySearch.orderByColumn = 'uploadTime'
querySearch.isAsc = 'desc' querySearch.isAsc = 'desc'
querySearch.pageSize = 500 querySearch.pageSize = 500
@ -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>0PPT
// 2024-05-15jackyshen
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>