From 6163fb06f92c0888bb2839036e9ef0fe9778e768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Wed, 16 Oct 2024 14:16:48 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=85=AC=E5=85=B1=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=9A=E5=B8=83=E7=BD=AE=E6=8E=A8=E9=80=81=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=EF=BC=8Crow=E6=94=B9=E4=B8=BA=E6=89=B9=E9=87=8Frows=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9B=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BA=E5=BD=93=E5=89=8D=E6=97=B6=E9=97=B43?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E4=B9=8B=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/set-homework/index.vue | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/src/renderer/src/components/set-homework/index.vue b/src/renderer/src/components/set-homework/index.vue index 380e381..fa41011 100644 --- a/src/renderer/src/components/set-homework/index.vue +++ b/src/renderer/src/components/set-homework/index.vue @@ -61,8 +61,8 @@ const props = defineProps({ entpcourseid: { default: '' }, - row: { - default: '' + rows: { + default: [] }, title: { type: String, @@ -222,31 +222,33 @@ const onSubmit = (formEl) => { let ary = [] for (const value in gradeObj) { //这些参数 参照AIx web端 作业推送 - let obj = { - id: 0, - parentid: props.row.id, - classid: value, - classcourseid: 0, - entpcourseid: props.entpcourseid, - studentlist: JSON.stringify(gradeObj[value]), - feedback: form.feedback, - workkey: '', - timelength: form.timelength, - weights: 1, - deaddate: form.deaddate, - workdate: getCurrentTime('YYYY-MM-DD'), - uniquekey: props.row.uniquekey, - entpcourseworklist: '[' + props.row.entpcourseworklist + ']', - needMsgNotifine: 'false', - msgkey: 'newclasswork', - title: '作业任务', - msgcontent: '', - teachername: userInfo.nickName, - unixstamp: new Date().getTime(), - worktype: props.row.worktype, - status: '1' + for (var i = 0; i < props.rows.length; i++) { + let obj = { + id: 0, + parentid: props.rows[i].id, + classid: value, + classcourseid: 0, + entpcourseid: props.entpcourseid, + studentlist: JSON.stringify(gradeObj[value]), + feedback: form.feedback, + workkey: '', + timelength: form.timelength, + weights: 1, + deaddate: form.deaddate, + workdate: getCurrentTime('YYYY-MM-DD'), + uniquekey: props.rows[i].uniquekey, + entpcourseworklist: '[' + props.rows[i].entpcourseworklist + ']', + needMsgNotifine: 'false', + msgkey: 'newclasswork', + title: '作业任务', + msgcontent: '', + teachername: userInfo.nickName, + unixstamp: new Date().getTime(), + worktype: props.rows[i].worktype, + status: '1' + } + ary.push(obj) } - ary.push(obj) } setLoading.value = true saveByClassWorkArray({ @@ -280,8 +282,9 @@ const cloneDialog = (formEl) => { } onMounted(() => { - // 默认当前 - form.deaddate = getCurrentTime('YYYY-MM-DD HH:mm') + // 默认当前 改为 延后3小时后截止 + // form.deaddate = getCurrentTime('YYYY-MM-DD HH:mm') + form.deaddate = `${getCurrentTime('YYYY-MM-DD')} ${getCurrentTime('HH+3')}:${getCurrentTime('mm')}`; }) From f3d59ca8ee07b12875f6893491da531e71d2f305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Wed, 16 Oct 2024 14:19:30 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=AE=9E=E8=B7=B5?= =?UTF-8?q?=EF=BC=9A=E4=BD=9C=E4=B8=9A-=E6=8E=A8=E9=80=81=E5=B8=83?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9=EF=BC=9B=E4=BD=9C=E4=B8=9A=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=A4=96=E9=93=BE=E6=94=B9=E4=B8=BApc=E7=AB=AF?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/index.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 06e709f..dfbc308 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -95,7 +95,8 @@
  - 作业设计 + + 作业设计
@@ -126,7 +127,7 @@
- + Date: Wed, 16 Oct 2024 14:20:46 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8E=A8=E9=80=81?= =?UTF-8?q?=EF=BC=9Arow=E6=94=B9=E4=B8=BArows=E7=BB=84=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/tool/components/homework.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/views/tool/components/homework.vue b/src/renderer/src/views/tool/components/homework.vue index f4a053f..b5af42b 100644 --- a/src/renderer/src/views/tool/components/homework.vue +++ b/src/renderer/src/views/tool/components/homework.vue @@ -47,7 +47,7 @@ - 推送 + 推送
@@ -56,7 +56,7 @@
-
@@ -110,8 +110,11 @@ const curNode = reactive({ data: {} }) -const sendHomework = (row) => { - curRow.value = row +const sendHomework = (row,type) => { + if(type == 'item'){ + // 布置推送单个作业 + curRow.value = [row] + } setTimeout(() => { ipcMsgSend('tool-sphere:set:ignore', false) }, 200) From 7c539614fdab9842d5159d7693d68c35b1cb0040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Wed, 16 Oct 2024 16:11:07 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=AE=9E=E8=B7=B5?= =?UTF-8?q?=EF=BC=9A=E4=BD=9C=E4=B8=9A=E7=BC=96=E8=BE=91=E5=A4=96=E9=93=BE?= =?UTF-8?q?=E6=94=B9=E4=B8=BApc=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/hooks/useClassTask.js | 117 ++++++++++++++++++ .../container/newTask/prevReadMsg-Dialog.vue | 2 +- src/renderer/src/views/prepare/index.vue | 112 ++++++++++------- 3 files changed, 185 insertions(+), 46 deletions(-) create mode 100644 src/renderer/src/hooks/useClassTask.js diff --git a/src/renderer/src/hooks/useClassTask.js b/src/renderer/src/hooks/useClassTask.js new file mode 100644 index 0000000..45760ad --- /dev/null +++ b/src/renderer/src/hooks/useClassTask.js @@ -0,0 +1,117 @@ +import { listEntpcoursework,getEvaluationclue } from '@/api/classTask'; +import { processList } from '@/hooks/useProcessList'; + +const isJson = (str) => { + if (typeof str == 'string') { + try { + let obj = JSON.parse(str) + if (typeof obj == 'object' && obj) { + return true + } else { + return false + } + } catch (e) { + return false + } + } +} + + +/** + * @description 编辑作业配置 + * @param {*} row + */ +export const editListItem = (row, courseObj) => { + return new Promise((resolve, reject) => { + // 作业内容编辑-跳转到设计界面-传参 + let classtaskObj = { + id: '', // + bookName: '', // 课程名称 + uniquekey: '', // 设计中的标题 + title: '', // 设计中的说明 + worktype: '', // 设计中的作业类型 + quizlist: [], // 设计中的试题列表 + chooseWorkLists: [],// 设计中的框架梳理list + fileHomeworkList: [],// 设计中的常规作业list + whiteboardObj: '',// 设计中的课堂展示对象 + }; + + + //重新更新[新任务]中右侧列表数据 + var listCourseWork = []; + for (var i=0; i < row.entpcourseworklistarray.length; i++) { + listCourseWork.push(row.entpcourseworklistarray[i]); + } + + if (listCourseWork.length > 0) { + classtaskObj.id= row.id; // + classtaskObj.bookObj = courseObj; // 教材对象 + classtaskObj.bookName = row.evaltitle? row.evalparenttitle? row.evalparenttitle+'/'+row.evaltitle : row.evaltitle: row.evalparenttitle// 课程名称:单元/章节: 单元 + classtaskObj.uniquekey= row.uniquekey; // 设计中的标题 + classtaskObj.title= row.title; // 设计中的说明 + classtaskObj.worktype= row.worktype; // 设计中的作业类型 + classtaskObj.quizlist= []; // 设计中的试题列表 + classtaskObj.chooseWorkLists = []; //设计中的 框架梳理list + classtaskObj.fileHomeworkList = []; //设计中的 常规作业list + classtaskObj.whiteboardObj = ''; //设计中的 课堂展示对象 + + + if (row.worktype == '框架梳理') { + // 框架梳理对应只有一个内容 + getEvaluationclue(listCourseWork[0].id).then(res => { + if ( res.data==null || res.data==undefined ) { + return ; + } + res.data.worktype = '框架梳理'; + res.data.score = listCourseWork[0].score; + classtaskObj.chooseWorkLists.push(res.data); + // + // console.log('框架梳理', classtaskObj); + return resolve(classtaskObj); + }); + } + else if (row.worktype == '习题训练') { + const ids = listCourseWork.map(item => item.id).join(","); + listEntpcoursework({ids: ids, pageSize: 50}).then(idres => { + // for (var i=0; i]+>/g, ''); + // } + // 格式化试题 + if(idres.rows&&idres.rows.length > 0){ + processList(idres.rows); + //重新将task中的分值更新 + row.entpcourseworklistarray.forEach(item => { + const quizItem = idres.rows.find(quiz => quiz.id === item.id); + if (quizItem) { + quizItem.score = item.score; + quizItem.scoreOrigin = item.score; + } + }); + + classtaskObj.quizlist = idres.rows; + // + // console.log('习题训练', classtaskObj); + return resolve(classtaskObj); + } + }) + } + else if (row.worktype == '课堂展示') { + console.log('row.课堂展示', row.workcodes); + const workcodes = JSON.parse(row.workcodes); + classtaskObj.whiteboardObj = JSON.stringify(workcodes.json); + // + // console.log('课堂展示', classtaskObj); + return resolve(classtaskObj); + } + else if (row.worktype == '常规作业') { + if(isJson(row.workcodes)){ + classtaskObj.fileHomeworkList = JSON.parse(row.workcodes); + // + // console.log('常规作业', classtaskObj); + return resolve(classtaskObj); + } + } + } + }); +} + diff --git a/src/renderer/src/views/classTask/container/newTask/prevReadMsg-Dialog.vue b/src/renderer/src/views/classTask/container/newTask/prevReadMsg-Dialog.vue index a96cd04..953e677 100644 --- a/src/renderer/src/views/classTask/container/newTask/prevReadMsg-Dialog.vue +++ b/src/renderer/src/views/classTask/container/newTask/prevReadMsg-Dialog.vue @@ -125,7 +125,7 @@ onMounted(() => { watch(() => props.bookobj.levelSecondId, (newVal) => { - console.log(props.bookobj,'课程选择') + // console.log(props.bookobj,'课程选择') }) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index dfbc308..a3d38c6 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -106,7 +106,7 @@ :item="item" :index="index" @on-set="openSet" - @on-reSet="openReSet" + @on-reSet="openReSet" @on-delhomework="delhomework" > @@ -170,6 +170,7 @@ import { delClasswork, listEntpcourse } from '@/api/teaching/classwork' import { updateClasscourse } from '@/api/teaching/classcourse' import { getClassInfo, getSelfReserv, endClass } from '@/api/classManage' import { useGetHomework } from '@/hooks/useGetHomework' +import { editListItem } from '@/hooks/useClassTask' import { addEntpcoursefileReturnId } from '@/api/education/entpcoursefile' import ClassReserv from '@/views/classManage/classReserv.vue' import classStart from './container/class-start.vue' // 预备上课 @@ -647,35 +648,35 @@ export default { this.$refs['reservDialog'].openDialog() }, - // 打开外部链接 - handleOutLink(key) { - if (key == 'homeWork') { - this.isOpenHomework = true - } - // key 对应的 linkConfig.js 外部链接配置 - let configObj = outLink()[key] - let fullPath = configObj.fullPath - //打开作业 高考 url增加unitId 章节ID - if (key != 'standard' && key != 'aiModel') { - let unitId = this.uploadData.levelSecondId - ? this.uploadData.levelSecondId - : this.uploadData.levelFirstId - let bookId = this.uploadData.textbookId; - if(fullPath.indexOf('?') == -1){ - fullPath += `?unitId=${unitId}&bookId=${bookId}&openDialog=newClassTask` - } - else{ - fullPath += `&unitId=${unitId}&bookId=${bookId}&openDialog=newClassTask` - } - } + // 打开外部链接 + // handleOutLink(key) { + // if (key == 'homeWork') { + // this.isOpenHomework = true + // } + // // key 对应的 linkConfig.js 外部链接配置 + // let configObj = outLink()[key] + // let fullPath = configObj.fullPath + // //打开作业 高考 url增加unitId 章节ID + // if (key != 'standard' && key != 'aiModel') { + // let unitId = this.uploadData.levelSecondId + // ? this.uploadData.levelSecondId + // : this.uploadData.levelFirstId + // let bookId = this.uploadData.textbookId; + // if(fullPath.indexOf('?') == -1){ + // fullPath += `?unitId=${unitId}&bookId=${bookId}&openDialog=newClassTask` + // } + // else{ + // fullPath += `&unitId=${unitId}&bookId=${bookId}&openDialog=newClassTask` + // } + // } - // 通知主进程 - ipcRenderer.send('openWindow', { - key, - fullPath: fullPath, - cookieData: { ...configObj.data } - }) - }, + // // 通知主进程 + // ipcRenderer.send('openWindow', { + // key, + // fullPath: fullPath, + // cookieData: { ...configObj.data } + // }) + // }, // 前往作业设计页面 goNewClassTask(){ // router.push({ path: '/newClassTask' }); @@ -694,24 +695,45 @@ export default { }, // 打开作业编辑窗口 openReSet(row) { - // 新窗口打开标识 - this.isOpenHomework = true; - // key 对应的 linkConfig.js 外部链接配置 - let configObj = outLink()['homeWork'] - let fullPath = configObj.fullPath + //跳转 作业设计 编辑页面 + const courseObj = { + textbookId: this.uploadData.textbookId, + levelFirstId: this.uploadData.levelFirstId, + levelSecondId: this.uploadData.levelSecondId, + coursetitle: this.currentNode.itemtitle, // (单元/章节) 名称, + node: this.currentNode, // 选择的课程节点 + } + console.log('courseObj', courseObj) + editListItem(row, courseObj).then((obj) => { + if(obj){ + //前往作业设计 + this.$router.push({ + path: '/newClassTask', + query: { + classtaskObj: JSON.stringify(obj), + } + }) + } + }); + //--------------------- + // 暂时弃用 外链 新窗口打开标识 + // this.isOpenHomework = true; + // // key 对应的 linkConfig.js 外部链接配置 + // let configObj = outLink()['homeWork'] + // let fullPath = configObj.fullPath - let unitId = this.uploadData.levelSecondId - ? this.uploadData.levelSecondId - : this.uploadData.levelFirstId - let bookId = this.uploadData.textbookId; - fullPath += `&unitId=${unitId}&bookId=${bookId}&courseWorkId=${row.id}` + // let unitId = this.uploadData.levelSecondId + // ? this.uploadData.levelSecondId + // : this.uploadData.levelFirstId + // let bookId = this.uploadData.textbookId; + // fullPath += `&unitId=${unitId}&bookId=${bookId}&courseWorkId=${row.id}` - // 通知主进程 - ipcRenderer.send('openWindow', { - key: 'homeWork', - fullPath: fullPath, - cookieData: { ...configObj.data } - }) + // // 通知主进程 + // ipcRenderer.send('openWindow', { + // key: 'homeWork', + // fullPath: fullPath, + // cookieData: { ...configObj.data } + // }) }, // 删除作业 delhomework(item) { From a1002a1f400802e009bce6737f037e939a53a24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Thu, 17 Oct 2024 10:19:22 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=B8=83=E7=BD=AE?= =?UTF-8?q?=EF=BC=9A=E5=88=97=E8=A1=A8=E9=80=BB=E8=BE=91=E6=94=B9=E4=B8=BA?= =?UTF-8?q?usegetHomework=E9=87=8C=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=9F=A5=E7=9C=8B=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E6=89=B9=E9=98=85=E8=AF=A6=E6=83=85=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/hooks/useClassTask.js | 2 +- src/renderer/src/hooks/useGetHomework.js | 21 +- .../src/views/classTask/classTaskAssign.vue | 813 +++++------------- 3 files changed, 257 insertions(+), 579 deletions(-) diff --git a/src/renderer/src/hooks/useClassTask.js b/src/renderer/src/hooks/useClassTask.js index 45760ad..85966bb 100644 --- a/src/renderer/src/hooks/useClassTask.js +++ b/src/renderer/src/hooks/useClassTask.js @@ -35,7 +35,7 @@ export const editListItem = (row, courseObj) => { fileHomeworkList: [],// 设计中的常规作业list whiteboardObj: '',// 设计中的课堂展示对象 }; - + console.log('编辑的行', row); //重新更新[新任务]中右侧列表数据 var listCourseWork = []; diff --git a/src/renderer/src/hooks/useGetHomework.js b/src/renderer/src/hooks/useGetHomework.js index c122d9f..e07a2de 100644 --- a/src/renderer/src/hooks/useGetHomework.js +++ b/src/renderer/src/hooks/useGetHomework.js @@ -71,6 +71,7 @@ const getHomeWorkList = async () => { return await homeworklist({ entpcourseid: chapterId, edituserid: userStore.user.userId, + orderby: "timestamp DESC", pageSize: 100, status: '10' }).then((res) => { @@ -79,7 +80,25 @@ const getHomeWorkList = async () => { for (var i = 0; i < res.rows.length; i++) { res.rows[i].taskconfig = [] - // 找child + // 处理任务类型的UI + // if (res.rows[i].worktype == '学习目标定位') { + // res.rows[i].workclass = 'success'; + // res.rows[i].workcodesList = JSON.parse(res.rows[i].workcodes); + // } else + // 课标研读 目标设定 教材研读 框架梳理 学科定位 TODO 后续接入在添加 + if (res.rows[i].worktype == '课堂展示') { + res.rows[i].workclass = 'primary'; + } else if (res.rows[i].worktype == '框架梳理') { + res.rows[i].workclass = 'warning'; + } else if (res.rows[i].worktype == '常规作业') { + res.rows[i].workclass = 'info'; + } else if (res.rows[i].worktype == '习题训练') { + res.rows[i].workclass = 'danger'; + } else { + res.rows[i].workclass = 'primary'; + } + + // 找child for (var j = 0; j < res.rows.length; j++) { if (res.rows[j].parentid == res.rows[i].id) { var ss = [] diff --git a/src/renderer/src/views/classTask/classTaskAssign.vue b/src/renderer/src/views/classTask/classTaskAssign.vue index 4816e4f..184eb2a 100644 --- a/src/renderer/src/views/classTask/classTaskAssign.vue +++ b/src/renderer/src/views/classTask/classTaskAssign.vue @@ -36,6 +36,7 @@
- 编辑 + 编辑
查看详情 @@ -75,10 +76,10 @@
- 编辑 + 编辑
- 查看详情 + 查看详情
@@ -92,10 +93,15 @@ + + +
@@ -197,8 +203,6 @@