From 6272bb322307abce0c1a5490f059269c0c145301 Mon Sep 17 00:00:00 2001 From: lixg Date: Thu, 9 Feb 2023 09:35:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=80=BB=E7=A7=AF?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 9 + .env.boe | 6 +- .env.prod | 3 + .env.release | 5 +- src/api/index1.js | 6 +- .../drawers/project/AddCertificate.vue | 17 ++ .../student/TableCertificateStudent.vue | 11 +- src/views/learningpath/LevelAdd.vue | 212 +++++++++++++++++- 8 files changed, 250 insertions(+), 19 deletions(-) diff --git a/.env b/.env index c7f198b9..e0801577 100644 --- a/.env +++ b/.env @@ -23,3 +23,12 @@ VUE_APP_COURSE_STUDY=//u-pre.boe.com/pc/course/studyindex?id= # 导入学员模板 VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx + +#在线 +VITE_BOE_ONLINE_CLASS_URL=//u-pre.boe.com/pc/course/studyindex?id= +#案例 +VITE_BOE_CASS_DETAIL_URL=//u-pre.boe.com/pc/case/detail?id= +#考试 +VITE_BOE_EXAM_DETAIL_URL=//u-pre.boe.com/pc/exam/test?id= +#h5的基本url +VUE_APP_H5=//u-pre.boe.com/mobile/student-h5 \ No newline at end of file diff --git a/.env.boe b/.env.boe index 65a0c556..51519fda 100644 --- a/.env.boe +++ b/.env.boe @@ -7,4 +7,8 @@ VUE_APP_LOGIN_URL=//u-pre.boe.com/web VUE_APP_BOE_API_URL=//u-pre.boe.com # 导入学员模板 -VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx \ No newline at end of file +VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx +#在线 +VITE_BOE_ONLINE_CLASS_URL=//u-pre.boe.com/pc/course/studyindex?id= +VITE_BOE_CASS_DETAIL_URL=//u-pre.boe.com/pc/case/detail?id= +VITE_BOE_EXAM_DETAIL_URL=//u-pre.boe.com/pc/exam/test?id= \ No newline at end of file diff --git a/.env.prod b/.env.prod index f7f9f813..a8dc80ee 100644 --- a/.env.prod +++ b/.env.prod @@ -14,3 +14,6 @@ VUE_APP_IFRAME_STUDENT_URL=//u.boe.com/pc/loading VUE_APP_COURSE_STUDY=//u.boe.com/pc/course/studyindex?id= VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx +VITE_BOE_ONLINE_CLASS_URL=//u.boe.com/pc/course/studyindex?id= +VITE_BOE_CASS_DETAIL_URL=//u.boe.com/pc/case/detail?id= +VITE_BOE_EXAM_DETAIL_URL=//u.boe.com/pc/exam/test?id= \ No newline at end of file diff --git a/.env.release b/.env.release index 55d0b0e4..b61246c6 100644 --- a/.env.release +++ b/.env.release @@ -13,4 +13,7 @@ VUE_APP_IFRAME_STUDENT_URL=//u.boe.com/pc-release/loading VUE_APP_COURSE_STUDY=//u.boe.com/pc-release/course/studyindex?id= -VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx \ No newline at end of file +VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx +VITE_BOE_ONLINE_CLASS_URL=//u.boe.com/pc-release/course/studyindex?id= +VITE_BOE_CASS_DETAIL_URL=//u.boe.com/pc-release/case/detail?id= +VITE_BOE_EXAM_DETAIL_URL=//u.boe.com/pc-release/exam/test?id= \ No newline at end of file diff --git a/src/api/index1.js b/src/api/index1.js index 77df3b43..eec26d13 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-02-06 15:11:40 + * @LastEditTime: 2023-02-09 09:28:39 * @FilePath: /fe-manage/src/api/index1.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -209,4 +209,6 @@ export const getTaskList = (obj) => http.get('/admin/project/getTaskList', { par //查看证书学员列表 export const stuCertList = (obj) => http.get('/admin/certificate/stuCertList', { params: obj }) //更新学员证书 -export const updateStuCert = (obj) => http.post('/admin/certificate/updateStuCert', obj) +export const cancelOrAuth = (obj) => http.post('/admin/certificate/cancelOrAuth', obj) +//获取项目总积分 +export const allPoints = (obj) => http.get('/points/project/allPoints', { params: obj }) \ No newline at end of file diff --git a/src/components/drawers/project/AddCertificate.vue b/src/components/drawers/project/AddCertificate.vue index 8bfab55c..2b6684f1 100644 --- a/src/components/drawers/project/AddCertificate.vue +++ b/src/components/drawers/project/AddCertificate.vue @@ -458,8 +458,25 @@ export default { getStageList(); getTaskList(); getTaskExam(); + allPoints(); } }; + //获取项目积分 + const allPoints = () => { + let obj = { + projectId: props.projectId, + }; + api + .allPoints(obj) + .then((res) => { + if (res.data.code === 200) { + console.log("获取项目总积分", res); + } + }) + .catch((err) => { + console.log("获取总积分失败", err); + }); + }; //获取阶段 const getStageList = () => { let obj = { diff --git a/src/components/student/TableCertificateStudent.vue b/src/components/student/TableCertificateStudent.vue index 7fda64af..3afd43fe 100644 --- a/src/components/student/TableCertificateStudent.vue +++ b/src/components/student/TableCertificateStudent.vue @@ -179,7 +179,7 @@ export default {
{ - updateStuCert(record); + cancelOrAuth(record); }} > 取消证书 @@ -213,6 +213,7 @@ export default { id: props.ACertificateCheckId, pid: props.projectId, size: state.pageSize, + current: state.currentPage, }; state.tableDataTotal = -1; api @@ -244,15 +245,15 @@ export default { state.selectTime = null; }; - //取消授权 - const updateStuCert = (text) => { + //取消证书 + const cancelOrAuth = (text) => { console.log("text", text); let obj = { - id: text.record.id, + ids: [text.record.id], status: -1, }; api - .updateStuCert(obj) + .cancelOrAuth(obj) .then((res) => { console.log("取消证书成功", res); if (res.data.code === 200) { diff --git a/src/views/learningpath/LevelAdd.vue b/src/views/learningpath/LevelAdd.vue index 738fbf08..51c3ae72 100644 --- a/src/views/learningpath/LevelAdd.vue +++ b/src/views/learningpath/LevelAdd.vue @@ -326,7 +326,11 @@
任务大纲
- + @@ -592,7 +606,12 @@
关卡内容可见可学设置
-
+
编辑
@@ -1354,7 +1373,7 @@ import { handleLearnPath } from "../../api/index1"; import { GetRouterDetail } from "@/api/indexTask"; import * as api from "../../api/index1"; import { editRoutered } from "../../api/indexLearningPath"; -import { codeUrl } from "../../api/method"; +// import { codeUrl } from "../../api/method"; import TwoDimensionalCode from "../../components/TwoDimensionalCode.vue"; import TableStudent from "@/components/student/TableStudent"; // import * as student from "@/api/student"; @@ -1368,7 +1387,7 @@ import RouterHomeworkManage from "../../components/drawers/router/RouterHomework import RouterCommonManage from "../../components/drawers/router/RouterCommonManage"; import RouterVoteManage from "../../components/drawers/router/RouterVoteManage"; import RouterProjectManage from "../../components/drawers/router/RouterProjectManage"; -import {checkPer} from "@/utils/utils"; +import { checkPer } from "@/utils/utils"; export default { name: "LevelAdd", @@ -1889,10 +1908,10 @@ export default { // 考试点击管理弹框 const examinationModel = (data, levelname) => { console.log(data); - if(data.startTime==null && data.endTime==null){ + if (data.startTime == null && data.endTime == null) { // 外部考试 state.examinationExaminaModelVisible = true; - }else{ + } else { // 系统考试 state.examinationModelVisible = true; } @@ -2555,6 +2574,179 @@ export default { //显示二维码弹窗 const showCodeModel = (item) => { + console.log("二维码任务信息", item); + + let codeUrl = ""; + // 在线课 停用 -- 暂时没有在线课停用标记 + if (item.type == 1) { + if (item.taskStatus == 1 || item.taskStatus == 2) + return message.error("该任务无法学习,请联系管理员进行替换。"); + window.open( + window.location.protocol + + import.meta.env.VITE_BOE_ONLINE_CLASS_URL + + item.targetId, + "_top" + ); + } + if (item.type == 2) { + let date1 = new Date(item.endTime).getTime(); + let date2 = new Date().getTime(); + if (date1 < date2) return message.warning("当前面授课已结束"); + if (item.taskStatus == 1 || item.taskStatus == 2) + return message.error("该任务无法学习,请联系管理员进行替换。"); + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/externalexam?courseId=" + + item.courseId; + } + + if (item.type == 4) { + let date1 = new Date(item.endTime).getTime(); + let date2 = new Date().getTime(); + if (date1 < date2) return message.warning("当前作业已结束"); + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/homeworkpage?courseId=" + + item.courseId + + "&type=2&id=" + + item.routerTaskId; + } + // 考试 停用 + if (item.type == 5) { + if (item.taskStatus == 1 || item.taskStatus == 2) + return message.error("该任务无法学习,请联系管理员进行替换。"); + // 此处判断外部考试跳转 + if (item.startTime == null || item.endTime == null) { + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/externalexam?courseId=" + + item.courseId; + } + } + // 直播结束时间 + if (item.type == 6) { + let date1 = new Date(item.endTime).getTime(); + let date2 = new Date().getTime(); + if (date1 < date2) return message.warning("当前直播已结束"); + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/livebroadcast?courseId=" + + item.courseId + + "&type=2&id=" + + item.routerTaskId; + } + // 外链 + if (item.type == 7) { + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/outerchain?courseId=" + + item.courseId + + "&type=2&id=" + + item.routerTaskId + + "&status=" + + item.status + + "&chapterOrStageId=" + + item.chapterId + + "&infoId=" + + state.routerId; + } + //讨论 + if (item.type == 8) { + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/discusspage?courseId=" + + item.courseId + + "&type=2&id=" + + item.routerTaskId; + } + //活动 + if (item.type == 9) { + let date1 = new Date(item.endTime).getTime(); + let date2 = new Date().getTime(); + if (date1 < date2) return message.warning("当前活动已结束"); + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/activitiespage?courseId=" + + item.courseId + + "&type=2&id=" + + item.routerTaskId; + } + //活动 + if (item.type == 10) { + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/evaluation?courseId=" + + item.courseId + + "&evaType=" + + item.evaType + + "&targetId=" + + item.targetId; + } + + // 评估 停用 + if (item.type == 11) { + if (item.taskStatus == 1 || item.taskStatus == 2) + return message.error("该任务无法学习,请联系管理员进行替换。"); + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/investigatage?courseId=" + + item.courseId + + "&type=2&id=" + + item.routerTaskId + + "&chapterOrStageId=" + + item.chapterId + + "&infoId=" + + state.routerId; + } + // 投票 + if (item.type == 12) { + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/ballotpage?courseId=" + + item.courseId + + "&btype=2&id=" + + item.routerTaskId + + "&chapterOrStageId=" + + item.chapterId + + "&infoId=" + + state.routerId; + } + // 项目 + if (item.type == 13) { + codeUrl = + window.location.protocol + + process.env.VUE_APP_H5 + + "/projectdetails?courseId=" + + item.courseId + } + + + // let path = { + // 1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线 + // 2: "/faceteach", + // 3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例 + // 4: "/homeworkpage", + // 5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试 + // 6: "/livebroadcast", + // 7: "/outerchain", //外联 + // 8: "/discusspage", + // 9: "/moreactive", + // 10: "/evaluation", //测评 + // 11: "/surveydetail", + // 12: "/ballotpage", + // 13: "/projectdetails", + // }; + state.codevisible = true; let obj = { title: "[" + checkType(item.type) + "]二维码", @@ -2569,7 +2761,7 @@ export default { let obj = { title: "[学习路径]二维码", name: state.styTitle, - url: codeUrl, + // url: codeUrl, }; state.codeInfo = obj; }; @@ -2733,7 +2925,7 @@ export default { setLevels, selectProjectName4, changeLevel, - checkPer + checkPer, }; }, };