feat:增加学习路径图 共享文档 继续学习功能

This commit is contained in:
wyx
2023-02-01 10:30:38 +08:00
parent 873e90bded
commit 253ff1c77c

View File

@@ -123,30 +123,29 @@
{{ data.remark || "暂无说明" }}
</div>
</el-tab-pane>
<!--
<el-tab-pane label="共享文档" name="second"> -->
<!-- <div style="padding: 19px 30px 17px 28px">-->
<!-- <div-->
<!-- v-for="(value, index) in sharedoc"-->
<!-- :key="index"-->
<!-- style="-->
<!-- display: flex;-->
<!-- align-items: center;-->
<!-- margin-bottom: 15px;-->
<!-- "-->
<!-- >-->
<!-- <img :src="value.img" style="width: 22px; height: 26px"/>-->
<!-- <div class="sharedocname">{{ value.name }}</div>-->
<!-- <div class="download">-->
<!-- <img-->
<!-- src="../../assets/image/download.png"-->
<!-- style="width: 16px; height: 15px"-->
<!-- />-->
<!-- <div style="margin-left: 7px">下载</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="共享文档" name="second">
<div style="padding: 19px 30px 17px 28px">
<div
v-for="(value, index) in JSON.parse(data.attach?data.attach:'[]')"
:key="index"
style="
display: flex;
align-items: center;
margin-bottom: 15px;">
<!-- <img :src="value.img" style="width: 22px; height: 26px"/> -->
<FileTypeImg :v-model="value.name? value.name : value.slice(value.lastIndexOf('/')+1,value.indexOf('-')) + value.slice(value.lastIndexOf('.'))" :style="{width: '22px',height: '26px'}"></FileTypeImg>
<div class="sharedocname">{{ value.name }}</div>
<div class="download">
<img
src="../../assets/image/download.png"
style="width: 16px; height: 15px"
/>
<div style="margin-left: 7px" @click="downloadFile(value.response.data)">下载</div>
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<!-- 课程公告及共享文档 -->
@@ -180,11 +179,11 @@
<div class="text" style="margin-left: 9px">学习进度</div>
<div class="box"></div>
</div>
<!--
<div class="rate">
<div class="ratetext">上次学到:{{ data.lastLearned }}</div>
<div class="ratebtn">继续学习</div>
</div>-->
<div class="rate">
<div class="ratetext">上次学到:{{ data.lastLearned }}</div>
<div v-if="data.lastLearned" class="ratebtn" @click="continueLearn(data.lastLearned, data.taskBoList)">继续学习</div>
</div>
<div style="margin-top: 16px">
<div class="progressBox">
<div>总进度</div>
@@ -283,6 +282,7 @@ import { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import store from "@/store";
import {ROUTER} from "@/api/CONST";
import FileTypeImg from "@/components/FileTypeImg.vue";
const {
query: { routerId, routerName },
@@ -476,9 +476,30 @@ function toFinish(d) {
}
}
function whiteTypes(type) {
return import.meta.env.VITE_TASK_WHITE_TYPE.includes("-" + type + "-");
}
// 共享文档下载
function downloadFile(url){
window.open(url);
}
// 继续学习
function continueLearn(taskname, datas){
console.log('我是当前的列表展示信息',data)
console.log(datas)
let jumpinfo
for(let i=0; i<datas.length; i++){
if(datas[i].name==taskname){
jumpinfo = datas[i]
}
}
console.log(jumpinfo)
toFinish(jumpinfo)
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->