From 72d2e7b987952dead3047bc5185427e79500b190 Mon Sep 17 00:00:00 2001 From: lixg Date: Sat, 7 Jan 2023 19:48:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 + .env.prod | 4 +- .env.release | 4 +- src/api/index1.js | 8 +- src/assets/images/leveladd/success.png | Bin 0 -> 1103 bytes src/components/Modals/ExportHomeWork.vue | 187 ++++++++++++++++++ src/components/drawers/AddLevelImportStu.vue | 7 +- src/components/drawers/ExportScore.vue | 95 +++++++-- .../drawers/project/ProjectFaceStu.vue | 4 +- .../drawers/project/ProjectFaceTaskManage.vue | 19 +- .../drawers/project/ProjectHomeWorkManage.vue | 19 +- .../drawers/router/RouterFaceStu.vue | 4 +- .../drawers/router/RouterFaceTeachManage.vue | 19 +- .../drawers/router/RouterHomeworkManage.vue | 19 +- src/components/student/TableStudent.vue | 25 ++- 15 files changed, 363 insertions(+), 53 deletions(-) create mode 100644 src/assets/images/leveladd/success.png create mode 100644 src/components/Modals/ExportHomeWork.vue diff --git a/.env b/.env index b2def4d2..42a95366 100644 --- a/.env +++ b/.env @@ -16,3 +16,5 @@ VUE_APP_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc/loading # 课程二维码 VUE_APP_COURSE_STUDY=https://u-pre.boe.com/pc/course/studyindex?id= +# 导入学员模板 +VUE_APP_TEMPLATE=https://u-pre.boe.com/upload/ diff --git a/.env.prod b/.env.prod index 003f27de..ab14c09c 100644 --- a/.env.prod +++ b/.env.prod @@ -9,4 +9,6 @@ VUE_APP_BOE_API_URL=https://u.boe.com VUE_APP_IFRAME_URL=https://u.boe.com/pc/iframe VUE_APP_IFRAME_STUDENT_URL=https://u.boe.com/pc/loading -VUE_APP_COURSE_STUDY=https://u.boe.com/pc/course/studyindex?id= \ No newline at end of file +VUE_APP_COURSE_STUDY=https://u.boe.com/pc/course/studyindex?id= + +VUE_APP_TEMPLATE=https://u-pre.boe.com/upload/ \ No newline at end of file diff --git a/.env.release b/.env.release index 57dd0d96..887d9220 100644 --- a/.env.release +++ b/.env.release @@ -9,4 +9,6 @@ VUE_APP_BOE_API_URL=https://u.boe.com VUE_APP_IFRAME_URL=https://u.boe.com/pc-release/iframe VUE_APP_IFRAME_STUDENT_URL=https://u.boe.com/pc-release/loading -VUE_APP_COURSE_STUDY=https://u.boe.com/pc-release/course/studyindex?id= \ No newline at end of file +VUE_APP_COURSE_STUDY=https://u.boe.com/pc-release/course/studyindex?id= + +VUE_APP_TEMPLATE=https://u-pre.boe.com/upload/ \ No newline at end of file diff --git a/src/api/index1.js b/src/api/index1.js index 271ca1b4..fdd23835 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-04 22:45:31 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2023-01-06 18:04:16 + * @LastEditTime: 2023-01-07 16:53:23 * @FilePath: /fe-manage/src/api/index1.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -173,5 +173,7 @@ export const batchFinishTask = (obj) => http.post('/admin/student/batchFinishTas //批量更新学员状态 export const batchUpdateStatus = (obj) => http.post('/admin/student/batchUpdateStatus', obj) // //面授课批量导入成绩 -export const batchImportScore = (offcoursePlanId, obj) => - http.post(`/admin/offcourse/batchImportScore?offcoursePlanId=${offcoursePlanId}`, obj); \ No newline at end of file +export const batchImportScore = (obj) => + http.post('/admin/student/importHomeWork', obj, { + headers: { "Content-Type": "multipart/form-data" }, + }); \ No newline at end of file diff --git a/src/assets/images/leveladd/success.png b/src/assets/images/leveladd/success.png new file mode 100644 index 0000000000000000000000000000000000000000..89d75b4347cd19d3e6abf30f37813017b03e7a05 GIT binary patch literal 1103 zcmV-V1hD&wP)Px(2}wjjR9HvNnO|reRTRd*GrJ~Rs$wyMp*%XmvQS0tNAAItm zQHhELr8}#{V6$sgRE*f_gT9DjXM&}ovC`}|Rf}Lt)rj~X#7bKm1@TXJw#j^QXR~&b zCT3kF{Bf78X# zw8sFs6F{q9=Zn}m0AGgdK4NZs^OvQ3EeSYW$!*q%5dv*XIScZ;08>cFK)&007X*Czkg>w4!Xnrgbigq70(rYN1!HTM zb$Y)396%Mh6j$&0zu+1`3bHDvZkr#;a{!0Ob36a*XO4Ao?ljY*_jpA~ zy?GU)%I_jb!cj3gZc46J6~_ZCj%P~{*%p=eNc@nGn?0j>sTcm-4L!L0FSl%(Sg)IEMG%vPRQdJ|l36KWFTeV#U}7vgA(? z)QVp_qO}j{)*s$ds^s1Rk@4+CBrn6|tSykNZ;@X^q9!6;`LuOp7Oo$}F28cmPGGAk zo&@B&Kteypf(K3AeoC1>F_B$6JtIc}tn?#2Ys1f_R54DG^w&xWf21p~X+V;K4FK8~ z8SuTlZr>~ddbJ&GACTw>2B#WxnUYdDSEc_Z^o!%wKd&F@9dmZmNPKgEmJplf4g7Ob zWZgr$b;8>iQJ;4l zG;W-kc0U9p86Ggm6nmqPr1TYf>@jcgmyK=##|b0=JZGlu`_=bP?z?GaEqUQl5v&aZ z=S5IWamY<_l5TBXVdLJDUL-5VcGAt9U;V4&zTPpX4xUpxwm&Rf9T1b@(~RIZQA#NI}&4-M(1nPntuf?Ese(Px?giU*C=nC2vaHKD;8LY1hO zS?U~$bQW~$lZMYyCAWvft;>e1ulLRj!rQ8T+FT1sUtZqsCOn z`uMFm*~az&b4~*g=Of@|(AXZL&#$k|*AS$;UR^_oXqPr$Ly+zXbqyh+9bV2g#NXYY V;e?a8%hCV<002ovPDHLkV1k!422}t6 literal 0 HcmV?d00001 diff --git a/src/components/Modals/ExportHomeWork.vue b/src/components/Modals/ExportHomeWork.vue new file mode 100644 index 00000000..ee02a9a3 --- /dev/null +++ b/src/components/Modals/ExportHomeWork.vue @@ -0,0 +1,187 @@ + + + + diff --git a/src/components/drawers/AddLevelImportStu.vue b/src/components/drawers/AddLevelImportStu.vue index 4730cec8..833b416a 100644 --- a/src/components/drawers/AddLevelImportStu.vue +++ b/src/components/drawers/AddLevelImportStu.vue @@ -18,7 +18,7 @@
请下载
-
模板
+ 模板
,按要求填写数据并导入
@@ -138,7 +138,10 @@ export default { }, }, setup(props, ctx) { - const state = reactive({}); + const state = reactive({ + template: + process.env.VUE_APP_TEMPLATE + "导入学员模版-1672998102528.xlsx", + }); const closeDrawer = () => { ctx.emit("update:AddImpStuvisible", false); }; diff --git a/src/components/drawers/ExportScore.vue b/src/components/drawers/ExportScore.vue index 8848d054..654f3c9a 100644 --- a/src/components/drawers/ExportScore.vue +++ b/src/components/drawers/ExportScore.vue @@ -28,10 +28,12 @@

@@ -60,8 +62,8 @@

55%
-
暂停
-
取消
+
@@ -79,10 +81,22 @@
55%
-
暂停
-
取消
+
+ 下载失败数据 +
+ +
+
+
+ 20条数据导入成功,5条数据导入失败 +
-
下载失败数据
@@ -99,7 +113,7 @@
100%
-
删除
+
@@ -150,7 +164,18 @@ export default { //上传文件 const handleChange = (info) => { - console.log("info", info, props.id); + console.log("info", info); + let timer = setInterval(() => { + if (info.file.percent < 100) { + console.log("info111", info.file.percent); + } else { + console.log("info22", info.file.percent); + clearInterval(timer); + } + }, 1000); + // if (info.event) { + // console.log("info.event", info.event); + // } const status = info.file.status; if (status !== "uploading") { console.log(info.file, info.fileList); @@ -159,24 +184,61 @@ export default { const formData = new FormData(); formData.append("uploadFile", info.file); // formData.append("offcoursePlanId", props.id); - console.log(info.file); - api.batchImportScore(props.id, formData).then((res) => { - // if (res.data.code === 200) { - // console.log('上传成功') - // } - console.log("上传成绩", res); - }); + console.log("info.file", info.file); + // api.batchImportScore(formData).then((res) => { + // // if (res.data.code === 200) { + // // console.log('上传成功') + // // } + // console.log("上传成绩", res); + // }); message.success(`${info.file.name} file uploaded successfully.`); } else if (status === "error") { message.error(`${info.file.name} file upload failed.`); } }; + const beforeUpload = (file) => { + return new Promise((resolve, reject) => { + // const isJpgOrPng = + // file.name.indexOf(".xlsx") !== "-1" || + // file.name.indexOf(".xls") !== "-1"; + + // if (!isJpgOrPng) { + // message.destroy(); + // message.error("仅支持xls、xlsx格式!"); + // return reject(false); + // } + const formData = new FormData(); + formData.append("uploadFile", file); + // let progress = { percent: 1 }; + + // const intervalId = setInterval(() => { + // if (progress.percent < 100) { + // progress.percent++; + // file.onProgress(progress); + // } else { + // clearInterval(intervalId); + // } + // }, 100); + api.batchImportScore(formData).then((res) => { + if (res.data.code === 200) { + console.log("上传成功", res); + return reject(true); + } + }); + return reject(false); + }); + }; + const handleUpload = (e) => { + console.log("handleUpload", e); + }; return { ...toRefs(state), afterVisibleChange, closeDrawer, handleChange, BATCH_IMPORT_SCORE, + beforeUpload, + handleUpload, }; }, }; @@ -281,12 +343,13 @@ export default { margin-left: 20px; position: relative; .defeat { + width: 400px; position: absolute; left: 46px; top: 38px; font-size: 14px; font-weight: 500; - color: #ff7474; + justify-content: space-between; } .img { width: 30px; diff --git a/src/components/drawers/project/ProjectFaceStu.vue b/src/components/drawers/project/ProjectFaceStu.vue index f3bcc15a..5c8ef367 100644 --- a/src/components/drawers/project/ProjectFaceStu.vue +++ b/src/components/drawers/project/ProjectFaceStu.vue @@ -709,9 +709,7 @@ export default { process.env.VUE_APP_PROXY_URL }admin/student/exportTaskStudent?currentStageId=${ props.projectTaskInfo.stageId - }&type=${1}&pid=${props.projectTaskInfo.projectId}&taskId=${ - props.projectTaskInfo.projectTaskId - }&taskType=${props.projectTaskInfo.type}` + }&type=${1}&pid=${props.projectTaskInfo.projectId}&taskType=0` ); // api // .exportTaskStudent({ diff --git a/src/components/drawers/project/ProjectFaceTaskManage.vue b/src/components/drawers/project/ProjectFaceTaskManage.vue index 81847f5c..7764a219 100644 --- a/src/components/drawers/project/ProjectFaceTaskManage.vue +++ b/src/components/drawers/project/ProjectFaceTaskManage.vue @@ -82,7 +82,7 @@
导出数据
-
+
导出作业
@@ -165,6 +165,9 @@ + + +