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> <button class="btn btn02" style="margin-left: 6px"></button>
</div> </div>
</div> </div>
<div @click="returnclick">返回</div>
<!-- 面包屑导航 --> <!-- 面包屑导航 -->
<div class="debateTitle" style="color: #fff"> <div class="debateTitle" style="color: #fff">
作业管理者进阶腾飞班 - 中级管理者作业 作业管理者进阶腾飞班 - 中级管理者作业
@@ -262,25 +263,29 @@ const fileList = ref([]);
const uploadRef = ref(); const uploadRef = ref();
const showFileList = ref(0); const showFileList = ref(0);
const sbValue = ref({ const sbValue = ref({
content: '', content: "",
attach: '' attach: "",
}) });
const router = useRouter(); const router = useRouter();
const returnclick = () => {
router.back();
};
const { const {
query: { courseId: workId, type, id: taskId, pName, sName }, query: { courseId: workId, type, id: taskId, pName, sName },
} = useRoute(); } = useRoute();
const { data } = useRequest(TASK_WORK_DETAIL, { workId, taskId }); const { data } = useRequest(TASK_WORK_DETAIL, { workId, taskId });
const {data: submitList} = useRequest(TASK_WORK_SUBMIT_LIST, {workerId:workId}); const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, {
workerId: workId,
});
const handleClick = () => { const handleClick = () => {
console.log(sbValue.value) console.log(sbValue.value);
console.log(fileList) console.log(fileList);
request(TASK_WORK_COMMIT, { request(TASK_WORK_COMMIT, {
projectOrRouterLogo: type, projectOrRouterLogo: type,
workUploadContent: sbValue.value.content, workUploadContent: sbValue.value.content,
workUploadAddress: fileList.value.map(e => e.url).join(',') || '', workUploadAddress: fileList.value.map((e) => e.url).join(",") || "",
workId, workId,
type, type,
taskId, taskId,

View File

@@ -112,7 +112,16 @@
prop="state" prop="state"
label="状态" 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" style="width: 99px; height: 99px"
/> />
</el-table-column> </el-table-column>
@@ -156,7 +165,7 @@ import store from "@/store";
const detail = ref(); const detail = ref();
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);
const { data } = usePage(ROUTER_LIST, {}); const { data } = usePage(ROUTER_LIST, {});
console.log("datadata", data);
const router = useRouter(); const router = useRouter();
// const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {}); // const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {});
@@ -176,17 +185,21 @@ async function gofun({routerId, name: routerName}) {
// detail.value = data.data // detail.value = data.data
// state.showmapdetail = true; // state.showmapdetail = true;
// router.push({path: "/pathdetails", query: {routerId}}); // router.push({path: "/pathdetails", query: {routerId}});
import.meta.env.MODE === 'development' ? router.push({ import.meta.env.MODE === "development"
? router.push({
path: "/pathdetails", path: "/pathdetails",
query: {routerId, routerName} query: { routerId, routerName },
}) : window.open(`http://u-pre.boe.com/pc/forward?to=/fe-student/pathdetails&params=${encodeURIComponent(`routerId=${routerId}&routerName=${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> </script>
<style lang="scss"> <style lang="scss">
.modal { .modal {
} }

View File

@@ -30,7 +30,9 @@
</div> </div>
<div <div
class="course" 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" :key="index"
> >
<div> <div>
@@ -149,7 +151,7 @@
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程公告" name="first"> <el-tab-pane label="课程公告" name="first">
<div class="notice"> <div class="notice">
{{ data.remark || '暂无公告' }} {{ data.remark || "暂无公告" }}
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="共享文档" name="second"> <el-tab-pane label="共享文档" name="second">
@@ -218,7 +220,7 @@
<div class="box"></div> <div class="box"></div>
</div> </div>
<div class="rate"> <div class="rate">
<div class="ratetext">上次学到启航班-领导寄语</div> <div class="ratetext">上次学到:{{ data.lastLearned }}</div>
<div class="ratebtn">继续学习</div> <div class="ratebtn">继续学习</div>
</div> </div>
<div style="margin-top: 16px"> <div style="margin-top: 16px">
@@ -227,11 +229,7 @@
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress <el-progress
:percentage=" :percentage="parseInt(data.totalProgress * 100)"
parseInt(
(data.currentChapterCnt / data.totalChapterCnt) * 100
)
"
:show-text="false" :show-text="false"
:stroke-width="8" :stroke-width="8"
:color=" :color="
@@ -242,11 +240,7 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[ }[parseInt(data.totalProgress)]
parseInt(
data.currentChapterCnt / data.totalChapterCnt
)
]
" "
/> />
</div> </div>
@@ -260,16 +254,10 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[ }[parseInt(data.totalProgress)],
parseInt(data.currentChapterCnt / data.totalChapterCnt)
],
}" }"
> >
{{ {{ parseInt(data.totalProgress * 100) }}%
parseInt(
(data.currentChapterCnt / data.totalChapterCnt) * 100
)
}}%
</div> </div>
</div> </div>
</div> </div>
@@ -280,9 +268,7 @@
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress <el-progress
:percentage=" :percentage="parseInt(data.compulsoryProgress * 100)"
parseInt((data.currentReqCnt / data.totalReqCnt) * 100)
"
:show-text="false" :show-text="false"
:stroke-width="8" :stroke-width="8"
:color=" :color="
@@ -293,7 +279,7 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt(data.currentReqCnt / data.totalReqCnt)] }[parseInt(data.compulsoryProgress)]
" "
/> />
</div> </div>
@@ -312,12 +298,10 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt(data.currentReqCnt / data.totalReqCnt)], }[parseInt(data.compulsoryProgress)],
}" }"
> >
{{ {{ parseInt(data.compulsoryProgress * 100) }}%
parseInt((data.currentReqCnt / data.totalReqCnt) * 100)
}}%
</div> </div>
</div> </div>
</div> </div>
@@ -354,9 +338,9 @@ const {
} = useRoute(); } = useRoute();
const router = useRouter(); 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); const userInfo = computed(() => store.state.userInfo);
console.log("userInfo", userInfo);
const activeName = ref("first"); const activeName = ref("first");
const handleClick = (tab, event) => { const handleClick = (tab, event) => {
@@ -402,13 +386,18 @@ const types = ref({
4: "/homeworkpage", 4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试 5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast", 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", 8: "/discusspage",
9: "/moreactive", 9: "/moreactive",
10: ({ 10: ({ evaTyp, targetId }) =>
evaTyp, window.open(
targetId (evaTyp === 1
}) => window.open((evaTyp === 1 ? import.meta.env.VITE_BOE_TEST_DETAIL_URL : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId), //测评 ? import.meta.env.VITE_BOE_TEST_DETAIL_URL
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId
), //测评
11: "/surveydetail", 11: "/surveydetail",
12: "/ballotpage", 12: "/ballotpage",
13: "/projectdetails", 13: "/projectdetails",
@@ -421,19 +410,29 @@ function toFinish(d, sName) {
return; return;
} }
if (typeof types.value.path[d.type] === 'string') { 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] && types.value.path[d.type].startsWith("/") && router.push({ 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], path: types.value.path[d.type],
query: {id: d.routerTaskId, type: 1, courseId: d.courseId, pName: data.value.name, sName}, query: {
}) id: d.routerTaskId,
} else if (typeof types.value.path[d.type] === 'function') { type: 1,
types.value.path[d.type](d) 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) { function whiteTypes(type) {
return import.meta.env.VITE_TASK_WHITE_TYPE.includes(type + '') return import.meta.env.VITE_TASK_WHITE_TYPE.includes(type + "");
} }
</script> </script>