feat:修改学习路径图状态

This commit is contained in:
lixg
2022-12-16 18:20:04 +08:00
parent 7b7fe8568d
commit bc6eac5caf
3 changed files with 242 additions and 225 deletions

View File

@@ -15,6 +15,7 @@
<button class="btn btn02" style="margin-left: 6px"></button>
</div>
</div>
<div @click="returnclick">返回</div>
<!-- 面包屑导航 -->
<div class="debateTitle" style="color: #fff">
作业管理者进阶腾飞班 - 中级管理者作业
@@ -244,8 +245,8 @@
</template>
<script setup>
import {reactive, ref, toRefs} from "vue";
import {request, useRequest} from "@/api/request";
import { reactive, ref, toRefs } from "vue";
import { request, useRequest } from "@/api/request";
import {
TASK_WORK_COMMIT,
TASK_WORK_DETAIL,
@@ -253,34 +254,38 @@ import {
WORK_HISTROY,
} from "@/api/api";
import dayjs from "dayjs";
import {useRouter} from "vue-router";
import { useRouter } from "vue-router";
import UploadImg from "@/components/img/UploadImg.vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import {useRoute} from "vue-router/dist/vue-router";
import { useRoute } from "vue-router/dist/vue-router";
const fileList = ref([]);
const uploadRef = ref();
const showFileList = ref(0);
const sbValue = ref({
content: '',
attach: ''
})
content: "",
attach: "",
});
const router = useRouter();
const returnclick = () => {
router.back();
};
const {
query: {courseId: workId, type, id: taskId, pName, sName},
query: { courseId: workId, type, id: taskId, pName, sName },
} = useRoute();
const {data} = useRequest(TASK_WORK_DETAIL, {workId, taskId});
const {data: submitList} = useRequest(TASK_WORK_SUBMIT_LIST, {workerId:workId});
const { data } = useRequest(TASK_WORK_DETAIL, { workId, taskId });
const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, {
workerId: workId,
});
const handleClick = () => {
console.log(sbValue.value)
console.log(fileList)
console.log(sbValue.value);
console.log(fileList);
request(TASK_WORK_COMMIT, {
projectOrRouterLogo: type,
workUploadContent: sbValue.value.content,
workUploadAddress: fileList.value.map(e => e.url).join(',') || '',
workUploadAddress: fileList.value.map((e) => e.url).join(",") || "",
workId,
type,
taskId,

View File

@@ -81,7 +81,7 @@
style="width: 230px; height: 155px"
/>
</el-table-column>
<el-table-column align="center" prop="name" label="路径名称"/>
<el-table-column align="center" prop="name" label="路径名称" />
<el-table-column
align="center"
prop="introduce"
@@ -112,7 +112,16 @@
prop="state"
label="状态"
>
<img :src="ongoing"
<img
:src="
scope.row.status === 0
? ongoing
: scope.row.status === 1
? completed
: scope.row.status === -1
? nostarted
: null
"
style="width: 99px; height: 99px"
/>
</el-table-column>
@@ -128,7 +137,7 @@
class="mapdetail"
>
<div v-for="(item, i) in detail?.rows" :key="i">
<img :src="useImage(`222_0${i + 2}.png`)"/>
<img :src="useImage(`222_0${i + 2}.png`)" />
</div>
<!-- <div class="modal"-->
<!-- style="width: calc(100% - 168px); height: 525px;background-image: url('../../src/assets/image/mapdetail.png');background-size: 100%;background-repeat: no-repeat;">-->
@@ -139,24 +148,24 @@
</div>
</template>
<script setup>
import {reactive, toRefs, ref, onMounted, computed} from "vue";
import { reactive, toRefs, ref, onMounted, computed } from "vue";
import nostarted from "../../assets/image/nostarted.png";
import completed from "../../assets/image/completed.png";
import ongoing from "../../assets/image/ongoing.png";
import {boeRequest, request, usePage, useRequest} from "@/api/request";
import { boeRequest, request, usePage, useRequest } from "@/api/request";
import {
ROUTER_CHAPTER_LIST,
ROUTER_LIST,
ROUTER_UNCOMPLETE_LIST,
} from "@/api/api";
import {useImage} from "@/api/utils";
import {useRouter} from "vue-router";
import { useImage } from "@/api/utils";
import { useRouter } from "vue-router";
import store from "@/store";
const detail = ref();
const userInfo = computed(() => store.state.userInfo);
const {data} = usePage(ROUTER_LIST, {});
const { data } = usePage(ROUTER_LIST, {});
console.log("datadata", data);
const router = useRouter();
// const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {});
@@ -164,29 +173,33 @@ const router = useRouter();
const state = reactive({
showmapdetail: false,
});
const {showmapdetail} = toRefs(state);
const { showmapdetail } = toRefs(state);
const returnfun = () => {
state.showmapdetail = false;
};
async function gofun({routerId, name: routerName}) {
async function gofun({ routerId, name: routerName }) {
// console.log(routerId)
// const data = await request(ROUTER_CHAPTER_LIST, {stuChapterListVo: {routerId}})
// detail.value = data.data
// state.showmapdetail = true;
// router.push({path: "/pathdetails", query: {routerId}});
import.meta.env.MODE === 'development' ? router.push({
import.meta.env.MODE === "development"
? router.push({
path: "/pathdetails",
query: {routerId, routerName}
}) : window.open(`http://u-pre.boe.com/pc/forward?to=/fe-student/pathdetails&params=${encodeURIComponent(`routerId=${routerId}&routerName=${routerName}`)}`)
query: { routerId, routerName },
})
: window.open(
`http://u-pre.boe.com/pc/forward?to=/fe-student/pathdetails&params=${encodeURIComponent(
`routerId=${routerId}&routerName=${routerName}`
)}`
);
}
function toUnTask() {
}
function toUnTask() {}
</script>
<style lang="scss">
.modal {
}

View File

@@ -15,14 +15,14 @@
<div class="title">
<div class="titleL">{{ i.chapterName }}</div>
<div class="titleR" :style="{ display: 'flex' }">
<img src="../../assets/image/pathdetails/circle.png"/>
<img src="../../assets/image/pathdetails/circle.png" />
<div class="titleRT">进行中</div>
</div>
<div
class="titleR"
:style="{ display: i.status === 2 ? 'flex' : 'none' }"
>
<img src="../../assets/image/pathdetails/circle2.png"/>
<img src="../../assets/image/pathdetails/circle2.png" />
<div class="titleRT" style="color: rgba(102, 102, 102, 1)">
未开始
</div>
@@ -30,7 +30,9 @@
</div>
<div
class="course"
v-for="(value, index) in i.taskProcessList.filter(e=>!whiteTypes(e.type))"
v-for="(value, index) in i.taskProcessList.filter(
(e) => !whiteTypes(e.type)
)"
:key="index"
>
<div>
@@ -114,7 +116,7 @@
:style="{
background: `${types.path[value.type] ? '#2478ff' : '#999'}`,
}"
@click="toFinish(value,i.chapterName)"
@click="toFinish(value, i.chapterName)"
>
{{
value.status === 1
@@ -149,7 +151,7 @@
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程公告" name="first">
<div class="notice">
{{ data.remark || '暂无公告' }}
{{ data.remark || "暂无公告" }}
</div>
</el-tab-pane>
<el-tab-pane label="共享文档" name="second">
@@ -194,7 +196,7 @@
class="teacheritem"
:style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }"
>
<img class="peopleimg" :src="`/upload${userInfo.avatar}`"/>
<img class="peopleimg" :src="`/upload${userInfo.avatar}`" />
<div style="margin-left: 17px">
<div class="teacherName">
<div style="margin-right: 5px">
@@ -218,7 +220,7 @@
<div class="box"></div>
</div>
<div class="rate">
<div class="ratetext">上次学到启航班-领导寄语</div>
<div class="ratetext">上次学到:{{ data.lastLearned }}</div>
<div class="ratebtn">继续学习</div>
</div>
<div style="margin-top: 16px">
@@ -227,11 +229,7 @@
<div class="progress">
<div style="width: 291px">
<el-progress
:percentage="
parseInt(
(data.currentChapterCnt / data.totalChapterCnt) * 100
)
"
:percentage="parseInt(data.totalProgress * 100)"
:show-text="false"
:stroke-width="8"
:color="
@@ -242,11 +240,7 @@
3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)',
}[
parseInt(
data.currentChapterCnt / data.totalChapterCnt
)
]
}[parseInt(data.totalProgress)]
"
/>
</div>
@@ -260,16 +254,10 @@
3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)',
}[
parseInt(data.currentChapterCnt / data.totalChapterCnt)
],
}[parseInt(data.totalProgress)],
}"
>
{{
parseInt(
(data.currentChapterCnt / data.totalChapterCnt) * 100
)
}}%
{{ parseInt(data.totalProgress * 100) }}%
</div>
</div>
</div>
@@ -280,9 +268,7 @@
<div class="progress">
<div style="width: 291px">
<el-progress
:percentage="
parseInt((data.currentReqCnt / data.totalReqCnt) * 100)
"
:percentage="parseInt(data.compulsoryProgress * 100)"
:show-text="false"
:stroke-width="8"
:color="
@@ -293,7 +279,7 @@
3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)',
}[parseInt(data.currentReqCnt / data.totalReqCnt)]
}[parseInt(data.compulsoryProgress)]
"
/>
</div>
@@ -312,12 +298,10 @@
3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)',
}[parseInt(data.currentReqCnt / data.totalReqCnt)],
}[parseInt(data.compulsoryProgress)],
}"
>
{{
parseInt((data.currentReqCnt / data.totalReqCnt) * 100)
}}%
{{ parseInt(data.compulsoryProgress * 100) }}%
</div>
</div>
</div>
@@ -332,7 +316,7 @@
</template>
<script setup>
import {computed, reactive, ref, watch} from "vue";
import { computed, reactive, ref, watch } from "vue";
import word from "@/assets/image/file/word.png";
import ppt from "@/assets/image/file/ppt.png";
import pdf from "@/assets/image/file/pdf.png";
@@ -342,27 +326,27 @@ import medal1 from "@/assets/image/medal/medal1.png";
import medal2 from "@/assets/image/medal/medal2.png";
import medal3 from "@/assets/image/medal/medal3.png";
import img from "@/assets/image/uploadimg.png";
import {boeRequest, useRequest, request} from "@/api/request";
import {ROUTER_PROCESS, LINK_DETAILS} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {ElMessage} from "element-plus";
import {useUserInfo} from "@/api/utils";
import { boeRequest, useRequest, request } from "@/api/request";
import { ROUTER_PROCESS, LINK_DETAILS } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import { useUserInfo } from "@/api/utils";
import store from "@/store";
const {
query: {routerId, routerName},
query: { routerId, routerName },
} = useRoute();
const router = useRouter();
const {data} = useRequest(ROUTER_PROCESS, {routerId});
const { data } = useRequest(ROUTER_PROCESS, { routerId });
console.log("ROUTER_PROCESS", data);
const userInfo = computed(() => store.state.userInfo);
console.log("userInfo", userInfo);
const activeName = ref("first");
const handleClick = (tab, event) => {
console.log(tab, event);
};
const path = {1: "path"};
const path = { 1: "path" };
const types = ref({
typeName: {
@@ -402,13 +386,18 @@ const types = ref({
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast",
7: ({courseId}) => request(LINK_DETAILS(courseId), {}).then(({data: {linkAddress}}) => window.open(linkAddress)),//外联
7: ({ courseId }) =>
request(LINK_DETAILS(courseId), {}).then(({ data: { linkAddress } }) =>
window.open(linkAddress)
), //外联
8: "/discusspage",
9: "/moreactive",
10: ({
evaTyp,
targetId
}) => window.open((evaTyp === 1 ? import.meta.env.VITE_BOE_TEST_DETAIL_URL : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId), //测评
10: ({ evaTyp, targetId }) =>
window.open(
(evaTyp === 1
? import.meta.env.VITE_BOE_TEST_DETAIL_URL
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId
), //测评
11: "/surveydetail",
12: "/ballotpage",
13: "/projectdetails",
@@ -421,19 +410,29 @@ function toFinish(d, sName) {
return;
}
if (typeof types.value.path[d.type] === 'string') {
types.value.path[d.type] && types.value.path[d.type].startsWith("http") && window.open(types.value.path[d.type] + d.targetId)
types.value.path[d.type] && types.value.path[d.type].startsWith("/") && router.push({
if (typeof types.value.path[d.type] === "string") {
types.value.path[d.type] &&
types.value.path[d.type].startsWith("http") &&
window.open(types.value.path[d.type] + d.targetId);
types.value.path[d.type] &&
types.value.path[d.type].startsWith("/") &&
router.push({
path: types.value.path[d.type],
query: {id: d.routerTaskId, type: 1, courseId: d.courseId, pName: data.value.name, sName},
})
} else if (typeof types.value.path[d.type] === 'function') {
types.value.path[d.type](d)
query: {
id: d.routerTaskId,
type: 1,
courseId: d.courseId,
pName: data.value.name,
sName,
},
});
} else if (typeof types.value.path[d.type] === "function") {
types.value.path[d.type](d);
}
}
function whiteTypes(type) {
return import.meta.env.VITE_TASK_WHITE_TYPE.includes(type + '')
return import.meta.env.VITE_TASK_WHITE_TYPE.includes(type + "");
}
</script>