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 00000000..89d75b43 Binary files /dev/null and b/src/assets/images/leveladd/success.png differ 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 cd73aa9f..7ac029c8 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%
-
删除
+
@@ -152,7 +166,7 @@ export default { const handleChange = (info) => { console.log("info", info, props.id); setInterval(() => { - console.log('我是文件上传的进度---------->',info.file.percent) + console.log("我是文件上传的进度---------->", info.file.percent); }, 1000); const status = info.file.status; if (status !== "uploading") { @@ -162,24 +176,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, }; }, }; @@ -284,12 +335,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 @@ + + +