From 2a07e05315f4ef38ff0c73e7926a5ae16e087869 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 3 Dec 2024 15:23:07 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E9=9D=A2=E6=8E=88=E8=AF=BE=E8=AE=B2?= =?UTF-8?q?=E5=B8=88=E5=90=8C=E6=AD=A5PC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ThirdApi.js | 3 +- src/hooks/useOrgName.js | 23 +++++++++++++ src/views/faceteach/FaceTeach.vue | 39 ++++++++++++++++++----- src/views/faceteach/FaceTeachNoCommon.vue | 38 ++++++++++++++++++---- src/views/faceteach/FaceTeachNoCourse.vue | 39 ++++++++++++++++++----- src/views/faceteach/FaceTeachSignUp.vue | 38 ++++++++++++++++++---- src/views/faceteach/FaceTeachStuSign.vue | 38 ++++++++++++++++++---- 7 files changed, 180 insertions(+), 38 deletions(-) create mode 100644 src/hooks/useOrgName.js diff --git a/src/api/ThirdApi.js b/src/api/ThirdApi.js index 060d116..948e68a 100644 --- a/src/api/ThirdApi.js +++ b/src/api/ThirdApi.js @@ -3,4 +3,5 @@ export const BASE = 'https://u-pre.boe.com' export const GET_USER_LIST = `/manageApi/admin/CheckUser/userInfo` export const GET_USER_INFO = `/manageApi/admin/thirdApi/user/searchList` // export const GET_USER_LIST = `/admin/CheckUser/userInfo` -// export const GET_USER_INFO = `/admin/thirdApi/user/searchList` \ No newline at end of file +// export const GET_USER_INFO = `/admin/thirdApi/user/searchList` +export const GET_USER_INFO_OLDURL = `/userbasic/user/getUserBaseInfoById` \ No newline at end of file diff --git a/src/hooks/useOrgName.js b/src/hooks/useOrgName.js new file mode 100644 index 0000000..8793564 --- /dev/null +++ b/src/hooks/useOrgName.js @@ -0,0 +1,23 @@ +/**截取机构名称路径namePath最后两段,不包含第一个 */ +const useOrgName = (namePath) => { + let newName = namePath; + if (newName) { + let names = newName.split('/'); + let len = names.length; + //使用最后两们 + if (len > 1) { + newName = names[1]; + if (!newName) { + newName = names[0] + } + } + } + return newName; +}; + + + + +export { + useOrgName +} \ No newline at end of file diff --git a/src/views/faceteach/FaceTeach.vue b/src/views/faceteach/FaceTeach.vue index 9fd2f2d..45aed4f 100644 --- a/src/views/faceteach/FaceTeach.vue +++ b/src/views/faceteach/FaceTeach.vue @@ -108,12 +108,12 @@
面授课讲师
-
- +
+
-
{{ data.planDto?.teacher }}
+
{{ item?.realName }}
- {{ data.planDto?.bandDesc }} + {{ useOrgName(item?.orgNamePath) }}
@@ -346,16 +346,17 @@ diff --git a/src/views/projectdetails/projectDetails.vue b/src/views/projectdetails/projectDetails.vue index 1f97ee9..b291cba 100644 --- a/src/views/projectdetails/projectDetails.vue +++ b/src/views/projectdetails/projectDetails.vue @@ -164,11 +164,41 @@ -
- {{ el.statusName || (item.studyModel==0 ? TASK_TYPES.toName[el.type] : '未解锁')}} +
+ {{ + el.statusName || + (item.studyModel == 0 + ? TASK_TYPES.toName[el.type] + : "未解锁") + }}
-
- {{ el.statusName || '未解锁' }} +
+ {{ el.statusName || "未解锁" }}
- -
@@ -202,23 +230,82 @@ --> - -
-
开课列表
+ +
+
+ 开课列表 +
X
+ style="font-size: 12px; cursor: pointer" + > + X +
-
-
-
{{ item }}
-
+
+
+ {{ item }} +
+
去上课
+ style=" + width: 60px; + height: 30px; + text-align: center; + line-height: 30px; + background: #0078fc; + border-radius: 5px; + color: #fff; + cursor: pointer; + " + > + 去上课 +
@@ -237,7 +324,7 @@ import { UPDATE_CURRENT_TASK, checkStudentExist, EvaluationToLearn, - QueryEvaluationTaskStatusOne + QueryEvaluationTaskStatusOne, } from "@/api/api"; import { useRoute, useRouter } from "vue-router"; import store from "@/store"; @@ -266,7 +353,10 @@ useRequest(PROJECT_PROCESS, { projectId: projectId, type }, (e) => { console.log("判断任务是否删除", res); if (res.code === 7) { router.push({ - path: "/loseefficacy", + path: "/loseEfficacyProject", + query: { + msg: res.message, + }, }); } else { if (res.code === 6) { @@ -377,7 +467,13 @@ const types = ref({ }, path: { 1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线 - 2: ({ targetId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${targetId}`, "_top"), + 2: ({ targetId }) => + window.open( + `${location.protocol}//${location.host}${ + import.meta.env.VITE_BASE_API + }/stu/project/redirectDetail?courseId=${targetId}`, + "_top" + ), 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, //考试 @@ -453,24 +549,28 @@ function judgeTaskIsEnd(type, endTimes, status) { return isEnd; } -function toFinish(d, sName, chapterOrStageId,studyModel) { +function toFinish(d, sName, chapterOrStageId, studyModel) { if (studyModel != 0 && !d.statusName) { - ElMessage.warning("当前未解锁") - return + ElMessage.warning("当前未解锁"); + return; } - if(d.statusName == '未解锁'|| d.statusName == ''||!d.hasOwnProperty('statusName')){ - ElMessage.warning("当前未解锁") - return + if ( + d.statusName == "未解锁" || + d.statusName == "" || + !d.hasOwnProperty("statusName") + ) { + ElMessage.warning("当前未解锁"); + return; } if (d.type === 2) { - if(!d.targetId){ - return ElMessage.error("还未添加开课,请联系管理员!") + if (!d.targetId) { + return ElMessage.error("还未添加开课,请联系管理员!"); } - if(d.targetId.split(',').length>1){ - openCourseList.value = d.targetName?.split(','); - openCourseIdList.value = d.targetId?.split(','); + if (d.targetId.split(",").length > 1) { + openCourseList.value = d.targetName?.split(","); + openCourseIdList.value = d.targetId?.split(","); openCourseVisible.value = true; - return + return; } } if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) { @@ -572,66 +672,72 @@ function toFinish(d, sName, chapterOrStageId,studyModel) { // 肯定没有完成测评 // 调用接口 跳转页面 request(EvaluationToLearn, { - "businessType": "project", - "chapterId": chapterOrStageId, - "courseId": d.courseId, - "quizKid": d.targetId, - "routerOrProjectId": projectId, - "studentId": userInfo.value.id, - "studentName": userInfo.value.realName - }).then(res => { - console.log(res) - if (res.code == 200) { - let jumpUrl = res.data.quizUrl - // 此处写跳转url - window.open(jumpUrl, '_top') - } - }).catch(err => { - console.log(err) + businessType: "project", + chapterId: chapterOrStageId, + courseId: d.courseId, + quizKid: d.targetId, + routerOrProjectId: projectId, + studentId: userInfo.value.id, + studentName: userInfo.value.realName, }) - return + .then((res) => { + console.log(res); + if (res.code == 200) { + let jumpUrl = res.data.quizUrl; + // 此处写跳转url + window.open(jumpUrl, "_top"); + } + }) + .catch((err) => { + console.log(err); + }); + return; } else { // 进行中 或者 已完成 // 调用接口 判断当前测评状态 跳转页面 - console.log('我是查询测评跳转链接所传递得参数', { - "quizTaskId": d.quizTaskId - }) + console.log("我是查询测评跳转链接所传递得参数", { + quizTaskId: d.quizTaskId, + }); request(QueryEvaluationTaskStatusOne, { - "quizTaskId": d.quizTaskId - }).then(res => { - console.log(res) - if (res.code == 200) { - if (res.data.complete_status == 2) { - ElMessage.error("您已完成测评") - return - } else { - // 重新查询跳转 - // 调用接口 跳转页面 - request(EvaluationToLearn, { - "businessType": "project", - "chapterId": chapterOrStageId, - "courseId": d.courseId, - "quizKid": d.targetId, - "routerOrProjectId": projectId, - "studentId": userInfo.value.id, - "studentName": userInfo.value.realName - }).then(res => { - console.log(res) - if (res.code == 200) { - let jumpUrl = res.data.quizUrl - // 此处写跳转url - window.open(jumpUrl, '_top') - } - }).catch(err => { - console.log(err) - }) - return - } - } - }).catch(err => { - console.log(err) + quizTaskId: d.quizTaskId, }) - return + .then((res) => { + console.log(res); + if (res.code == 200) { + if (res.data.complete_status == 2) { + ElMessage.error("您已完成测评"); + return; + } else { + // 重新查询跳转 + // 调用接口 跳转页面 + request(EvaluationToLearn, { + businessType: "project", + chapterId: chapterOrStageId, + courseId: d.courseId, + quizKid: d.targetId, + routerOrProjectId: projectId, + studentId: userInfo.value.id, + studentName: userInfo.value.realName, + }) + .then((res) => { + console.log(res); + if (res.code == 200) { + let jumpUrl = res.data.quizUrl; + // 此处写跳转url + window.open(jumpUrl, "_top"); + } + }) + .catch((err) => { + console.log(err); + }); + return; + } + } + }) + .catch((err) => { + console.log(err); + }); + return; } } @@ -708,8 +814,13 @@ function toFinish(d, sName, chapterOrStageId,studyModel) { // } } -function toOffcoursePlanPage(id){ - window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top') +function toOffcoursePlanPage(id) { + window.open( + `${location.protocol}//${location.host}${ + import.meta.env.VITE_BASE_API + }/stu/project/redirectDetail?courseId=${id}`, + "_top" + ); } function whiteTypes(type) { @@ -730,10 +841,10 @@ const queryAllStatus = (data) => {