From d9ddb1982b5078c1675962d06d9f19e1a89e69d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Wed, 16 Oct 2024 09:22:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BD=9C=E4=B8=9A=E6=89=B9=E6=94=B9]=20-=20?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E4=BC=98=E5=8C=96=E5=B8=B8=E8=A7=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/api/classTask/index.js | 8 ++++++++ .../classTask/container/item-dialog-score.vue | 11 ++++++----- .../views/classTask/container/item-dialog.vue | 18 +++++++++--------- .../src/views/classTask/teachClassTask.vue | 18 +++++++++--------- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/renderer/src/api/classTask/index.js b/src/renderer/src/api/classTask/index.js index 56f662d..bf03614 100644 --- a/src/renderer/src/api/classTask/index.js +++ b/src/renderer/src/api/classTask/index.js @@ -18,6 +18,14 @@ export function listClassworkdataByDeadDate(query) { }) } +// 查询classworkdata详细 +export function getClassworkdata(id) { + return request({ + url: '/education/classworkdata/' + id, + method: 'get' + }) +} + // 查询classworkdata列表 班级作业列表 export function listClassworkdata(query) { return request({ diff --git a/src/renderer/src/views/classTask/container/item-dialog-score.vue b/src/renderer/src/views/classTask/container/item-dialog-score.vue index dd8851b..c1fadd6 100644 --- a/src/renderer/src/views/classTask/container/item-dialog-score.vue +++ b/src/renderer/src/views/classTask/container/item-dialog-score.vue @@ -460,12 +460,13 @@ import useUserStore from '@/store/modules/user' import { ref, reactive } from 'vue' // import { Plus } from '@element-plus/icons-vue' import { ElMessageBox, ElMessage } from 'element-plus' -import { updateClassworkeval, updateClassworkdata } from '@/api/classTask' +import { updateClassworkeval, updateClassworkdata, getClassworkdata } from '@/api/classTask' import { getTimeDate } from '@/utils/date' import ReFilePreview from '@/components/refile-preview/index.vue' import { quizStrToList } from '@/utils/comm'; + const userStore = useUserStore() const router = useRouter() const route = useRoute() @@ -644,7 +645,7 @@ const selectScore = (score) => { } // 接收父组件传过来的参数 -const acceptParams = (params) => { +const acceptParams = async (params) => { console.log(params) console.log(dialogProps, 'dialogProps') // 先重置一下 参数 @@ -709,8 +710,9 @@ const acceptParams = (params) => { if (params.studentObj.worktype == '常规作业') { try { // 老师布置的附件 datacontent TODO:常规作业、其他类型还未接入 - if (params.studentObj.datacontent != '') { - const teachWorkFileList = JSON.parse(params.studentObj.datacontent) + const res = await getClassworkdata(params.studentObj.id); + if(res.data.datacontent != ''){ + const teachWorkFileList = JSON.parse(res.data.datacontent); console.log(teachWorkFileList, '老师filelist-------------') teachWorkFileList && teachWorkFileList.forEach((item) => { @@ -727,7 +729,6 @@ const acceptParams = (params) => { teacherFeedContentList.value.push(teachWorkFileList) } - dialogProps.value.studentObj.datacontent = dialogProps.value.studentObj.datacontent } catch (error) { console.error('Invalid JSON:', error) } diff --git a/src/renderer/src/views/classTask/container/item-dialog.vue b/src/renderer/src/views/classTask/container/item-dialog.vue index baf2a41..2c19638 100644 --- a/src/renderer/src/views/classTask/container/item-dialog.vue +++ b/src/renderer/src/views/classTask/container/item-dialog.vue @@ -418,15 +418,15 @@ const getStudentClassWorkDataDetail = (row) => { wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0 // 参考答案 去除下html标签 - wevalres.rows[w].rightanswer = - wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null - ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') - : wevalres.rows[w].rightanswer - // 学生回答 去除下html标签 - wevalres.rows[w].feedcontent = - wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null - ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') - : wevalres.rows[w].feedcontent + // wevalres.rows[w].rightanswer = + // wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null + // ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') + // : wevalres.rows[w].rightanswer + // // 学生回答 去除下html标签 + // wevalres.rows[w].feedcontent = + // wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null + // ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') + // : wevalres.rows[w].feedcontent if (classWorkAnalysis.row.worktype == '常规作业') { wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent) diff --git a/src/renderer/src/views/classTask/teachClassTask.vue b/src/renderer/src/views/classTask/teachClassTask.vue index c492bd3..3e8a453 100644 --- a/src/renderer/src/views/classTask/teachClassTask.vue +++ b/src/renderer/src/views/classTask/teachClassTask.vue @@ -410,15 +410,15 @@ const getStudentClassWorkDataDetail = (row) => { wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0 // 参考答案 去除下html标签 - wevalres.rows[w].rightanswer = - wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null - ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') - : wevalres.rows[w].rightanswer - // 学生回答 去除下html标签 - wevalres.rows[w].feedcontent = - wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null - ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') - : wevalres.rows[w].feedcontent + // wevalres.rows[w].rightanswer = + // wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null + // ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') + // : wevalres.rows[w].rightanswer + // // 学生回答 去除下html标签 + // wevalres.rows[w].feedcontent = + // wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null + // ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') + // : wevalres.rows[w].feedcontent if (classWorkAnalysis.row.worktype == '常规作业') { wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)