feat:判断任务是否有学员

This commit is contained in:
lixg
2023-03-02 02:03:02 +08:00
parent 2546f61f04
commit b5beeeaa10
22 changed files with 315 additions and 75 deletions

View File

@@ -27,7 +27,7 @@ import { GET_USER_INFO } from "@/api/ThirdApi";
import { getCookie } from "@/api/utils";
import { USER_INFO } from "@/api/api";
console.log("版本1.2.13------------");
console.log("版本1.3.1------------");
const store = useStore();
const router = useRouter();

View File

@@ -162,4 +162,5 @@ export const fileUp = (data) => httpupload.post("/file/upload", data, {
});
export const videoUp = (data) => httpupload.post("/file/uploadunlimit", data, {
headers: { "Content-Type": "multipart/form-data" },
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,5 +1,14 @@
<template>
<div class="pathDetail pathDetailback" v-if="data?.list">
<div
:class="
imgAttrindex === 1
? 'pathDetail pathDetailback'
: imgAttrindex === 2
? 'pathDetail path3'
: 'pathDetail path2'
"
v-if="data?.list"
>
<div
v-for="(item, i) in data?.list"
:key="i"
@@ -11,17 +20,75 @@
>
<div
@click="toDetail(i)"
:class="current === i ? 'nameClass currentBack' : 'nameClass nameBack'"
:class="
imgAttrindex === 1
? current === i
? 'nameClass currentBack'
: 'nameClass nameBack'
: imgAttrindex === 2
? current === i
? 'nameClass pathselect3'
: 'nameClass pathnoselect3'
: current === i
? 'nameClass pathselect2'
: 'nameClass pathnoselect2'
"
:title="item.name"
:style="{
backgroundSize: '100%',
width: `${current === i ? 100 : 100}px`,
height: `${current === i ? 75 : 75}px`,
width: `${
imgAttrindex === 1
? current === i
? 100
: 100
: imgAttrindex === 2
? current === i
? 100
: 100
: current === i
? 100
: 100
}px`,
height: `${
imgAttrindex === 1
? current === i
? 75
: 75
: imgAttrindex === 2
? current === i
? 100
: 100
: current === i
? 75
: 75
}px`,
lineHeight: '50px',
color: '#FFF',
color:
imgAttrindex === 1
? '#FFF'
: imgAttrindex === 2
? '#FFF'
: imgAttrindex === 3 && current === i
? '#FFF'
: '#000',
}"
>
{{ item.name }}
<div
:style="{
'margin-left':
imgAttrindex === 1 ? '0px' : imgAttrindex === 2 ? '13px' : '17px',
'margin-top':
imgAttrindex === 1
? '0px'
: imgAttrindex === 2
? '5px'
: imgAttrindex === 3 && current === i
? '0px'
: '-5px',
}"
>
{{ item.name }}
</div>
</div>
</div>
</div>
@@ -59,12 +126,45 @@ const imageAttrs = {
{ left: 297, top: -63 },
],
},
路径图2: {
width: 1437,
height: 594,
positions: [
{ left: -26, top: 379 },
{ left: 91, top: 319 },
{ left: 28, top: 218 },
{ left: 114, top: 153 },
{ left: 40, top: 46 },
{ left: 184, top: -28 },
],
},
路径图3: {
width: 1437,
height: 594,
positions: [
{ left: -21, top: 398 },
{ left: 145, top: 324 },
{ left: 44, top: 252 },
{ left: 144, top: 165 },
{ left: 53, top: 63 },
{ left: 180, top: -15 },
],
},
};
const imgAttr = computed(
() =>
imageAttrs[Object.keys(imageAttrs).find((e) => props.img.includes(e))] || {}
);
const imgAttrindex = computed(() =>
Object.keys(imageAttrs).find((e) => props.img.includes(e)) === "路径图背景"
? 1
: Object.keys(imageAttrs).find((e) => props.img.includes(e)) === "路径图2"
? 2
: 3
);
console.log("imgAttrindex", imgAttrindex);
// 使用
const loading = ref(false); // loading
const openLoading = () => {
@@ -78,32 +178,40 @@ openLoading();
const closeLoading = () => {
loading.value.close();
};
// const data = ref([
// {
// name: "关卡一",
// },
// {
// name: "关卡二",
// },
// {
// name: "关卡三",
// },
// {
// name: "关卡四",
// },
// {
// name: "关卡五",
// },
// {
// name: "关卡六",
// },
// ]);
// const data = ref({
// list: [
// {
// name: "关卡一",
// },
// {
// name: "关卡二",
// },
// {
// name: "关卡三",
// },
// {
// name: "关卡四",
// },
// {
// name: "关卡五",
// },
// {
// name: "关卡六",
// },
// ],
// });
// closeLoading();
const { data } = useRequest(
ROUTERTASK_LIST,
{ routerId: props.routerId },
() => {
(e) => {
closeLoading();
console.log("获取路径图", e);
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
}
);
console.log("data", data);
@@ -152,6 +260,12 @@ function toIndex() {
.pathDetailback {
background-image: url("../assets/image/pathDetails/pathDetailBack.png");
}
.path2 {
background-image: url("../assets/image/pathDetails/path2.png");
}
.path3 {
background-image: url("../assets/image/pathDetails/path3.png");
}
.pathDetail {
width: 410px;
height: 500px;
@@ -181,5 +295,19 @@ function toIndex() {
.currentBack {
background-image: url("../assets/image/pathDetails/pathDetailImgSelect.png");
}
.pathselect2 {
background-image: url("../assets/image/pathDetails/pathselect2.png");
}
.pathnoselect2 {
background-image: url("../assets/image/pathDetails/pathnoselect2.png");
}
.pathselect3 {
background-image: url("../assets/image/pathDetails/pathselect3.png");
}
.pathnoselect3 {
background-image: url("../assets/image/pathDetails/pathnoselect3.png");
}
}
</style>

View File

@@ -151,7 +151,7 @@ import { request, useRequest } from "@/api/request";
import { useRouter } from "vue-router";
import { useRoute } from "vue-router/dist/vue-router";
import { ElMessage } from "element-plus";
import { reactive, onUnmounted, toRefs } from "vue";
import { reactive, onUnmounted, toRefs, watch } from "vue";
import ReturnHead from "@/components/ReturnHead.vue";
const router = useRouter();
const returnclick = () => {
@@ -168,7 +168,14 @@ const state = reactive({
const { isAllowSign, closeBtn } = toRefs(state);
const { data } = useRequest(ACTIVITY, { activityId });
const { data } = useRequest(ACTIVITY, { activityId }, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
});
console.log("data", data);
const signClick = (tab, event) => {
if (data.value.signFlag) {

View File

@@ -173,7 +173,7 @@
</template>
<script setup>
import { reactive, toRefs, computed, onUnmounted, ref } from "vue";
import { reactive, toRefs, computed, onUnmounted, ref, watch } from "vue";
import ReturnHead from "@/components/ReturnHead.vue";
// import TitleHead from "@/components/TitleHead.vue";
import { useRequest, request } from "@/api/request";
@@ -187,7 +187,14 @@ const {
query: { courseId, chapterOrStageId, infoId, id, btype },
} = useRoute();
const userInfo = computed(() => store.state.userInfo);
const { data } = useRequest(VOTE_DETAIL3(courseId), {});
const { data } = useRequest(VOTE_DETAIL3(courseId), {}, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
});
console.log("投票基本信息", data);
//投票倒计时
let hour = ref(0);

View File

@@ -108,7 +108,7 @@
</template>
<script setup>
import { reactive, toRefs } from "vue";
import { reactive, toRefs, watch } from "vue";
// import TitleHead from "@/components/TitleHead.vue";
import ReturnHead from "@/components/ReturnHead.vue";
import { request, useRequest } from "@/api/request";
@@ -165,6 +165,11 @@ request(DISCUSS_LIST, {
console.log("讨论详情", state.info);
state.discussId = e.data.discussDtoList[0].id;
getPostList(e.data.discussDtoList[0].id);
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
})
.catch((err) => {
console.log(err);

View File

@@ -68,7 +68,7 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, onUnmounted, ref } from "vue";
import { computed, reactive, toRefs, onUnmounted, ref, watch } from "vue";
import img from "@/assets/image/uploadimg.png";
import { request, useRequest } from "@/api/request";
import { EVALUATION_DETAIL, STUDY_RECORD, EvaluationToLearn } from "@/api/api";
@@ -89,8 +89,15 @@ const {
},
} = useRoute();
const router = useRouter();
const { data } = useRequest(EVALUATION_DETAIL(evaluationId));
const { data } = useRequest(EVALUATION_DETAIL(evaluationId), {}, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
});
console.log("测评信息222", data);
const userInfo = computed(() => store.state.userInfo);
//作业倒计时
let hour = ref(0);

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-01 18:27:31
* @LastEditTime: 2023-03-02 01:57:28
* @FilePath: /stu_h5/src/views/examination/ExternalExam.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -47,6 +47,7 @@ import { useRoute, useRouter } from "vue-router/dist/vue-router";
const {
query: { courseId },
} = useRoute();
const router = useRouter();
const state = reactive({
datainfo: {},
});
@@ -55,6 +56,11 @@ request(EXTERNALEXAM, { externalId: courseId })
.then((res) => {
console.log("获取考试", res);
state.datainfo = res.data;
if (res.code === 6) {
router.push({
path: "/notpath",
});
}
})
.catch((err) => {
console.log(err);

View File

@@ -83,7 +83,7 @@
</template>
<script setup>
import { computed, onUnmounted, reactive, ref, toRefs } from "vue";
import { computed, onUnmounted, reactive, ref, toRefs, watch } from "vue";
import { request, useRequest } from "@/api/request";
import {
TASK_WORK_COMMIT,
@@ -117,8 +117,20 @@ const {
// console.log("type", type);
const { data } =
taskId && taskId !== "undefined"
? useRequest(TASK_WORK_DETAIL, { workId, taskId })
: useRequest(TASK_WORK_DETAIL, { workId });
? useRequest(TASK_WORK_DETAIL, { workId, taskId }, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
})
: useRequest(TASK_WORK_DETAIL, { workId }, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
});
console.log("data==----->", data);
//作业倒计时

View File

@@ -217,7 +217,7 @@
</template>
<script setup>
import { ref, reactive, toRefs } from "vue";
import { ref, reactive, toRefs, watch } from "vue";
import checkbox from "@/assets/image/checkbox.png";
import checkbox2 from "@/assets/image/checkbox2.png";
import { useRoute, useRouter } from "vue-router/dist/vue-router";
@@ -246,12 +246,23 @@ const returnclick = () => {
router.back();
};
const { data } = useRequest(ASSESSMENT_QUERY(courseId), {
id: courseId,
type,
chapterOrStageId,
targetId: infoId ? infoId : 0,
});
const { data } = useRequest(
ASSESSMENT_QUERY(courseId),
{
id: courseId,
type,
chapterOrStageId,
targetId: infoId ? infoId : 0,
},
(e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
}
);
console.log("我是查询评估的参数", {
id: courseId,
type,

View File

@@ -196,7 +196,7 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, onUnmounted, ref } from "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";
@@ -222,8 +222,15 @@ const returnclick = () => {
router.back();
};
const { data } = useRequest(TASK_BROADCAST_DETAIL, { liveId });
const { data } = useRequest(TASK_BROADCAST_DETAIL, { liveId }, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
});
console.log("直播信息", data);
const teacherInfo = useUserInfo(computed(() => data.value.userInfoBo?.userId));
const state = reactive({

View File

@@ -0,0 +1,24 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-03-01 20:41:06
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-01 21:32:29
* @FilePath: /stu_h5/src/views/nottask/NotTask.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-result
icon="success"
title="您不是此学习路径/项目学员"
sub-title="请联系管理员"
>
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</template>
<script setup>
function toIndex() {
window.location.href = import.meta.env.VITE_BOE_API_URL;
}
</script>

View File

@@ -0,0 +1,20 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-03-01 20:41:06
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-01 20:43:40
* @FilePath: /stu_h5/src/views/nottask/NotTask.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-result icon="success" title="您不是此项目学员" sub-title="请联系管理员">
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</template>
<script setup>
function toIndex() {
window.location.href = import.meta.env.VITE_BOE_API_URL;
}
</script>

View File

@@ -54,7 +54,7 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, onUnmounted, ref } from "vue";
import { computed, reactive, toRefs, onUnmounted, ref, watch } from "vue";
import img from "@/assets/image/uploadimg.png";
import { request, useRequest } from "@/api/request";
import { LINK_DETAILS, STUDY_RECORD } from "@/api/api";
@@ -76,7 +76,15 @@ const {
} = useRoute();
const router = useRouter();
console.log("外链信息", linkId);
const { data } = useRequest(LINK_DETAILS(linkId));
const { data } = useRequest(LINK_DETAILS(linkId), {}, (e) => {
if (e.code === 6) {
router.push({
path: "/notpath",
});
}
});
console.log("外链信息", data);
const userInfo = computed(() => store.state.userInfo);
const goOuterChain = () => {

View File

@@ -2,12 +2,12 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-19 14:59:34
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-03-01 18:03:05
* @LastEditTime: 2023-03-02 01:59:54
* @FilePath: /stu_h5/src/views/pathmap/LevelList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="pathdetails" v-if="data">
<div class="pathdetails">
<ReturnHead
text="路径详情"
:showfile="true"
@@ -35,21 +35,10 @@
</div>
<!-- 关卡列表 -->
</div>
<div v-else class="pathdetails">
<el-result
icon="success"
title="您不是此学习路径学员"
sub-title="请联系管理员"
>
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</div>
</template>
<script setup>
import { computed, reactive, toRefs, onUnmounted, ref } from "vue";
import { computed, reactive, toRefs, onUnmounted, ref, watch } from "vue";
import ReturnHead from "@/components/ReturnHead.vue";
import PathDetailImage from "@/components/PathDetailImage.vue";
import { useRequest, request, usePage } from "@/api/request";
@@ -60,12 +49,13 @@ import {
TASK_LIST,
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
const router = useRouter();
const listheight = document.body.clientHeight - 310 + "px";
const {
query: { routerId },
} = useRoute();
const { data } = useRequest(ROUTER_PROCESS, { routerId: routerId });
console.log("获取路径图", data);
function toIndex() {
window.location.href = import.meta.env.VITE_BOE_API_URL;
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="projectdetails" v-if="data?.projectId">
<div class="projectdetails">
<ReturnHead
text="项目详情"
:showfile="true"
@@ -200,13 +200,6 @@
</div> -->
</div>
</div>
<div v-else>
<el-result icon="success" title="您不是此项目学员" sub-title="请联系管理员">
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</div>
</template>
<script setup>
@@ -233,7 +226,21 @@ const {
const router = useRouter();
const { commit, dispatch, state } = useStore();
const data = computed(() => state.projectInfo);
useRequest(PROJECT_PROCESS, { projectId: projectId }, (e) => {
if (e.code === 6) {
console.log("eee", e);
router.push({
path: "/notpath",
});
}
});
watch(data, () => {
if (data.value.code === 6) {
router.push({
path: "/notpath",
});
}
});
onMounted(() => {
dispatch("getProjectInfo", { projectId });
});