feat:合并

This commit is contained in:
lixg
2023-03-17 11:53:12 +08:00
parent 3c24123b48
commit f0d1d1b33f
6 changed files with 115 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-13 11:42:48
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-10 00:56:52
* @LastEditTime: 2023-03-17 09:44:50
* @FilePath: /stu_h5/src/api/api.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -86,4 +86,6 @@ export const FILE_UPLOAD_IMG = import.meta.env.VITE_BASE_API + '/file/img'
// 查询单个测评的状态
export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStatusOne`
// 投票浏览和参与数目
export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post`
export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post`
//任务是否删除
export const checkStudentExist = `/admin/taskmanage/checkStudentExist post`

View File

@@ -230,6 +230,7 @@ const closeLoading = () => {
// ],
// });
// closeLoading();
const { data } = useRequest(
ROUTERTASK_LIST,
{ routerId: props.routerId },

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-02-06 18:26:23
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-03 09:37:16
* @LastEditTime: 2023-03-17 11:27:21
* @FilePath: /stu_h5/src/views/examination/ExternalExam.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -41,11 +41,11 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import { useRequest, request } from "@/api/request";
import { EXTERNALEXAM } from "@/api/api";
import { EXTERNALEXAM, checkStudentExist } from "@/api/api";
import { reactive } from "vue";
import { useRoute, useRouter } from "vue-router/dist/vue-router";
const {
query: { courseId, type },
query: { courseId, type, id: taskId, infoId, chapterOrStageId },
} = useRoute();
const router = useRouter();
const state = reactive({
@@ -53,14 +53,33 @@ const state = reactive({
});
//获取基本信息
request(EXTERNALEXAM, { externalId: courseId, type })
.then((res) => {
console.log("获取考试", res);
if (res.code === 6) {
router.push({
path: "/notpath",
});
}
state.datainfo = res.data;
.then((e) => {
useRequest(
checkStudentExist,
{
targetId: infoId,
type: type,
chapterId: chapterOrStageId,
courseId: taskId,
},
(res) => {
console.log("判断任务是否删除", res);
closeLoading();
if (res.code === 7) {
router.push({
path: "/loseefficacy",
});
} else {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
}
}
);
state.datainfo = e.data;
})
.catch((err) => {
console.log(err);

View File

@@ -100,6 +100,7 @@ import {
TASK_WORK_DETAIL,
TASK_WORK_SUBMIT_LIST,
WORK_HISTROY,
checkStudentExist,
} from "@/api/api";
import dayjs from "dayjs";
import { useRouter } from "vue-router";
@@ -123,7 +124,7 @@ const returnclick = () => {
router.back();
};
const {
query: { courseId: workId, type, id: taskId, infoId },
query: { courseId: workId, type, id: taskId, infoId, chapterOrStageId },
} = useRoute();
// 从报错信息来看 是因为内部 把这个组件看成了个异步组件 中间有代码是异步执行的 导致unmounted执行的时机不对。。放上面就好了
onBeforeUnmount(() => {
@@ -146,17 +147,36 @@ openLoading();
const closeLoading = () => {
loading.value.close();
};
console.log("infoId", infoId);
const { data } =
taskId && taskId !== "undefined"
? useRequest(TASK_WORK_DETAIL, { workId, taskId, type }, (e) => {
closeLoading();
if (e.code === 6) {
console.log("作业判断", e);
router.push({
path: "/notpath",
});
}
useRequest(
checkStudentExist,
{
targetId: infoId,
type: type,
chapterId: chapterOrStageId,
courseId: taskId,
},
(res) => {
console.log("判断任务是否删除", res);
closeLoading();
if (res.code === 7) {
router.push({
path: "/loseefficacy",
});
} else {
if (e.code === 6) {
console.log("作业判断", e);
router.push({
path: "/notpath",
});
}
}
}
);
})
: useRequest(TASK_WORK_DETAIL, { workId, type }, (e) => {
closeLoading();

View File

@@ -208,7 +208,11 @@ import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, onUnmounted, ref, watch } from "vue";
import img from "@/assets/image/uploadimg.png";
import { request, useRequest } from "@/api/request";
import { TASK_BROADCAST_DETAIL, TASK_BROADCAST_SIGN } from "@/api/api";
import {
TASK_BROADCAST_DETAIL,
TASK_BROADCAST_SIGN,
checkStudentExist,
} from "@/api/api";
import { useRoute } from "vue-router/dist/vue-router";
import { useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
@@ -225,6 +229,8 @@ const {
projectStatus,
projectEndTime,
targetId,
infoId,
chapterOrStageId,
},
} = useRoute();
const router = useRouter();
@@ -238,11 +244,30 @@ onUnmounted(() => {
});
const { data } = useRequest(TASK_BROADCAST_DETAIL, { liveId, type }, (e) => {
console.log("直播判断", e);
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
useRequest(
checkStudentExist,
{
targetId: infoId,
type: type,
chapterId: chapterOrStageId,
courseId: taskId,
},
(res) => {
console.log("判断任务是否删除", res);
closeLoading();
if (res.code === 7) {
router.push({
path: "/loseefficacy",
});
} else {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
}
}
);
});
console.log("直播信息", data);

View File

@@ -0,0 +1,21 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-03-01 20:41:06
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-17 10:15:42
* @FilePath: /stu_h5/src/views/nottask/LoseEfficacy.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-result icon="success" title="二维码已失效">
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</template>
<script setup>
function toIndex() {
window.location.href =
window.location.protocol + import.meta.env.VITE_BOE_HOME;
}
</script>