This commit is contained in:
yuping
2022-12-23 17:01:20 +08:00
parent 47c1ea49cf
commit 6807c52fd0
3 changed files with 312 additions and 262 deletions

View File

@@ -0,0 +1,52 @@
<template>
<div class="pathDetail" v-if="visiable" :style="{background:`url('${img}') no-repeat`}">
<div v-for="(item,i) in chapters" :key="i" class="cha"
:style="{top:`${imgAttr.positions[i]?.top}px`,left:`${imgAttr.positions[i]?.left}px`}">
<div>{{ item.name }}</div>
</div>
</div>
</template>
<script setup>
import {computed, defineProps, ref, watch} from "vue";
const props = defineProps({
value: String,
img: String,
chapters: Array,
current: Number
})
const visiable = ref(true)
const imageAttrs = {
'路径图背景-1671015331292.png': {
width: 1437,
height: 594,
positions: [
{left: 50, top: 500},
{left: 150, top: 400},
{left: 250, top: 300},
{left: 450, top: 100},
]
}
}
const imgAttr = computed(() => imageAttrs[Object.keys(imageAttrs).find(e => props.img.includes(e))] || {})
function show() {
visiable.value = true
}
function close() {
visiable.value = false
}
</script>
<style lang="scss">
.pathDetail {
width: 100%;
height: 577px;
position: relative;
}
.cha {
position: absolute;
}
</style>

View File

@@ -1,79 +1,80 @@
<template> <template>
<div class="learnpath"> <div class="learnpath">
<div class="content"> <div class="content">
<div class="title"> <div class="title">
<div class="titleL"> <div class="titleL">
<div @click="returnfun" class="text">学习路径图</div> <div @click="returnfun" class="text">学习路径图</div>
<div class="info" style="margin-right: 14px" v-if="userInfo.jobName"> <div class="info" style="margin-right: 14px" v-if="userInfo.jobName">
<img style="width: 20px; height: 18px; margin-right: 10px" src="../../assets/image/pm.png" /> <img style="width: 20px; height: 18px; margin-right: 10px" src="../../assets/image/pm.png"/>
<div style="margin-top: 1px">{{ userInfo.jobName }}</div> <div style="margin-top: 1px">{{ userInfo.jobName }}</div>
</div> </div>
<div class="info" v-if="userInfo.bandDesc"> <div class="info" v-if="userInfo.bandDesc">
<img style="width: 18px; height: 17px; margin-right: 11px" src="../../assets/image/band.png" /> <img style="width: 18px; height: 17px; margin-right: 11px" src="../../assets/image/band.png"/>
<div style="margin-top: 2px">{{ userInfo.bandDesc }}</div> <div style="margin-top: 2px">{{ userInfo.bandDesc }}</div>
</div> </div>
</div> </div>
<div :style="{ display: !showmapdetail ? 'flex' : 'none' }"> <div :style="{ display: !showmapdetail ? 'flex' : 'none' }">
<!-- <el-popover width="475px" trigger="hover" popper-class="lppopover">--> <!-- <el-popover width="475px" trigger="hover" popper-class="lppopover">-->
<!-- <div>--> <!-- <div>-->
<!-- <div class="finish">--> <!-- <div class="finish">-->
<!-- <img--> <!-- <img-->
<!-- src="../../assets/image/circle.png"--> <!-- src="../../assets/image/circle.png"-->
<!-- style="width: 20px; height: 20px"--> <!-- style="width: 20px; height: 20px"-->
<!-- />--> <!-- />-->
<!-- <div class="text">未完成</div>--> <!-- <div class="text">未完成</div>-->
<!-- <div class="box"></div>--> <!-- <div class="box"></div>-->
<!-- </div>--> <!-- </div>-->
<!-- <div--> <!-- <div-->
<!-- v-for="(value, index) in unCompleteTaskList"--> <!-- v-for="(value, index) in unCompleteTaskList"-->
<!-- :key="index"--> <!-- :key="index"-->
<!-- class="tasks"--> <!-- class="tasks"-->
<!-- :style="{--> <!-- :style="{-->
<!-- 'border-bottom':--> <!-- 'border-bottom':-->
<!-- index === unCompleteTaskList.length - 1--> <!-- index === unCompleteTaskList.length - 1-->
<!-- ? null--> <!-- ? null-->
<!-- : '1px solid rgba(229, 228, 228, 1)',--> <!-- : '1px solid rgba(229, 228, 228, 1)',-->
<!-- }"--> <!-- }"-->
<!-- >--> <!-- >-->
<!-- <div style="font-size: 14px; font-weight: 500; color: #677d86">--> <!-- <div style="font-size: 14px; font-weight: 500; color: #677d86">-->
<!-- {{ value.name }}--> <!-- {{ value.name }}-->
<!-- </div>--> <!-- </div>-->
<!-- <img--> <!-- <img-->
<!-- style="width: 20px; height: 20px"--> <!-- style="width: 20px; height: 20px"-->
<!-- src="../../assets/image/go.png"--> <!-- src="../../assets/image/go.png"-->
<!-- @click="toUnTask(chapterId)"--> <!-- @click="toUnTask(chapterId)"-->
<!-- />--> <!-- />-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<!-- <template #reference>--> <!-- <template #reference>-->
<!-- todo #学习路径 只会有一个未完成任务么?是否是直接跳到任务详情--> <!-- todo #学习路径 只会有一个未完成任务么?是否是直接跳到任务详情-->
<!-- <div class="titleR">进入未完成任务</div>--> <!-- <div class="titleR">进入未完成任务</div>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-popover>--> <!-- </el-popover>-->
</div> </div>
<div :style="{ display: showmapdetail ? 'flex' : 'none' }" class="titleR" @click="returnfun"> <div :style="{ display: showmapdetail ? 'flex' : 'none' }" class="titleR" @click="returnfun">
返回列表 返回列表
</div> </div>
</div> </div>
<!-- 路径列表--> <!-- 路径列表-->
<div :style="{ display: !showmapdetail ? 'flex' : 'none' }" class="head"> <div :style="{ display: !showmapdetail ? 'flex' : 'none' }" class="head">
<div style="min-width: 770px; width: 100%"> <div style="min-width: 770px; width: 100%">
<el-table :data="data" style="width: 100%" @row-click="gofun"> <el-table :data="data" style="width: 100%" @row-click="gofun">
<el-table-column prop="img" label="缩略图" #default="scope" align="center" width="255"> <el-table-column prop="img" label="缩略图" #default="scope" align="center" width="255">
<img :src="scope.row.picUrl" style="width: 230px; height: 155px" /> <img :src="scope.row.picUrl" style="width: 230px; height: 155px"/>
</el-table-column> </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" label="路径介绍" #default="scope"> <el-table-column align="center" prop="introduce" label="路径介绍" #default="scope">
<el-popover placement="bottom-start" :width="400" title="路径介绍" trigger="hover" :content="scope.row.remark"> <el-popover placement="bottom-start" :width="400" title="路径介绍" trigger="hover"
<template #reference> :content="scope.row.remark">
<div>{{ scope.row.remark }}</div> <template #reference>
</template> <div>{{ scope.row.remark }}</div>
</el-popover> </template>
</el-table-column> </el-popover>
</el-table-column>
<el-table-column align="center" prop="organizationName" label="归属组织" /> <el-table-column align="center" prop="organizationName" label="归属组织"/>
<el-table-column #default="scope" align="center" :width="150" prop="state" label="状态"> <el-table-column #default="scope" align="center" :width="150" prop="state" label="状态">
<img :src=" <img :src="
scope.row.taskStatus === 1 scope.row.taskStatus === 1
? ongoing ? ongoing
: scope.row.taskStatus === 2 : scope.row.taskStatus === 2
@@ -81,243 +82,240 @@
: scope.row.taskStatus === 0 : scope.row.taskStatus === 0
? nostarted ? nostarted
: null : null
" style="width: 99px; height: 99px" /> " style="width: 99px; height: 99px"/>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<!-- :src="{ 0: nostarted, 1: completed, 2: ongoing }[scope.row.status]"-->
<!-- :src="{ 0: nostarted, 1: completed, 2: ongoing }[scope.row.status]"--> <!-- 路径列表-->
<!-- 路径列表--> <!-- 路径详情图 -->
<!-- 路径详情图 --> <div :style="{ display: showmapdetail ? 'flex' : 'none' }" class="mapdetail">
<div :style="{ display: showmapdetail ? 'flex' : 'none' }" class="mapdetail"> <PathDetailImage img="https://u-pre.boe.com/upload/路径图背景-1671015331292.png" :chapters="chapters"></PathDetailImage>
<div v-for="(item, i) in detail?.rows" :key="i"> </div>
<img :src="useImage(`222_0${i + 2}.png`)" /> <!-- 路径详情图 -->
</div> </div>
<!-- <div class="modal"--> </div>
<!-- style="width: calc(100% - 168px); height: 525px;background-image: url('../../src/assets/image/mapdetail.png');background-size: 100%;background-repeat: no-repeat;">-->
<!-- </div>-->
</div>
<!-- 路径详情图 -->
</div>
</div>
</template> </template>
<script setup> <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 nostarted from "../../assets/image/nostarted.png";
import completed from "../../assets/image/completed.png"; import completed from "../../assets/image/completed.png";
import ongoing from "../../assets/image/ongoing.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 { import {
ROUTER_CHAPTER_LIST, ROUTER_LIST,
ROUTER_LIST,
ROUTER_UNCOMPLETE_LIST,
} from "@/api/api"; } from "@/api/api";
import { useImage } from "@/api/utils"; import {useRouter} from "vue-router";
import { useRouter } from "vue-router";
import store from "@/store"; import store from "@/store";
import PathDetailImage from "@/components/PathDetailImage.vue";
const detail = ref(); const detail = ref();
const chapters = ref([]);
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);
const { data } = usePage(ROUTER_LIST, { pageSize: 60 }); const {data} = usePage(ROUTER_LIST, {pageSize: 60});
console.log("datadata", data);
const router = useRouter(); const router = useRouter();
const returnclick = () => { const returnclick = () => {
router.back(); router.back();
}; };
// const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {}); // const {unCompleteTaskList} = useRequest(ROUTER_UNCOMPLETE_LIST, {});
const state = reactive({ const state = reactive({
showmapdetail: false, showmapdetail: true,
}); });
const { showmapdetail } = toRefs(state); const {showmapdetail} = toRefs(state);
const returnfun = () => { const returnfun = () => {
state.showmapdetail = false; state.showmapdetail = false;
}; };
async function gofun({ routerId, name: routerName }) { async function gofun({routerId, name: routerName,chapterDtoList}) {
// console.log(routerId) // console.log(routerId)
// const data = await request(ROUTER_CHAPTER_LIST, {stuChapterListVo: {routerId}}) // const data = await request(ROUTER_CHAPTER_LIST, {stuChapterListVo: {routerId}})
// detail.value = data.data // detail.value = data.data
// state.showmapdetail = true; // state.showmapdetail = true;
// router.push({path: "/pathdetails", query: {routerId}}); chapters.value = chapterDtoList
import.meta.env.MODE === "development" // router.push({path: "/pathdetails", query: {routerId}});
? router.push({ import.meta.env.MODE === "development"
path: "/pathdetails", ? router.push({
query: { routerId, routerName }, path: "/pathdetails",
}) query: {routerId, routerName},
: window.open( })
`${import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails&params=${encodeURIComponent( : window.open(
`routerId=${routerId}&routerName=${routerName}` `${import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails&params=${encodeURIComponent(
)}` `routerId=${routerId}&routerName=${routerName}`
); )}`
);
}
function toUnTask() {
} }
function toUnTask() { }
</script> </script>
<style lang="scss"> <style lang="scss">
#app div:nth-child(1) { #app div:nth-child(1) {
// background: rgba(0, 0, 0, 0) !important; // background: rgba(0, 0, 0, 0) !important;
} }
.modal {} .modal {
}
.modal:after { .modal:after {
content: ""; content: "";
} }
.learnpath { .learnpath {
width: 100%; width: 100%;
min-height: 800px; min-height: 800px;
//border-radius: 8px; //border-radius: 8px;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
display: flex; display: flex;
.content { .content {
width: 100%; width: 100%;
// flex: 1; // flex: 1;
margin-top: 43px; margin-top: 43px;
position: relative;
// background-color: pink;
.title {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 53px;
margin-right: 54px;
}
// background-color: pink; .title .titleL {
.title { display: flex;
display: flex; align-items: center;
justify-content: space-between; }
align-items: center;
margin-left: 53px;
margin-right: 54px;
}
.title .titleL { .title .titleL .text {
display: flex; font-size: 18px;
align-items: center; font-weight: bold;
} color: #333333;
line-height: 24px;
margin-right: 26px;
}
.title .titleL .text { .title .titleL .info {
font-size: 18px; display: flex;
font-weight: bold; // align-items: center;
color: #333333; font-size: 14px;
line-height: 24px; font-weight: 400;
margin-right: 26px; color: #387df7;
} }
.title .titleL .info { .title .titleR {
display: flex; width: 157px;
// align-items: center; height: 48px;
font-size: 14px; border: 2px solid #0060ff;
font-weight: 400; border-radius: 8px;
color: #387df7; display: flex;
} align-items: center;
justify-content: center;
cursor: pointer;
font-size: 16px;
font-weight: bold;
color: #0060ff;
}
.title .titleR { .head {
width: 157px; // height: 50px;
height: 48px; background: #f9f9f9;
border: 2px solid #0060ff; margin-top: 50px;
border-radius: 8px; display: flex;
display: flex; justify-content: space-between;
align-items: center; align-items: center;
justify-content: center; font-size: 14px;
cursor: pointer; font-weight: 500;
font-size: 16px; color: #333333;
font-weight: bold; margin-left: 53px;
color: #0060ff; margin-right: 54px;
} width: calc(100% - 107px);
// min-width: 770px;
overflow-x: auto;
.head { .el-table th.el-table__cell {
// height: 50px; background: rgba(249, 249, 249, 1);
background: #f9f9f9; color: rgba(51, 51, 51, 1);
margin-top: 50px; font-size: 14px;
display: flex; font-weight: 500;
justify-content: space-between; }
align-items: center;
font-size: 14px;
font-weight: 500;
color: #333333;
margin-left: 53px;
margin-right: 54px;
width: calc(100% - 107px);
// min-width: 770px;
overflow-x: auto;
.el-table th.el-table__cell { .el-table .cell {
background: rgba(249, 249, 249, 1); overflow: hidden;
color: rgba(51, 51, 51, 1); text-overflow: ellipsis;
font-size: 14px; width: 100%;
font-weight: 500; display: -webkit-box;
} -webkit-box-orient: vertical;
-webkit-line-clamp: 3;
word-break: break-all;
}
.el-table .cell { .el-table__row {
overflow: hidden; height: 231px;
text-overflow: ellipsis; font-size: 14px;
width: 100%; color: rgba(102, 102, 102, 1);
display: -webkit-box; font-weight: 500;
-webkit-box-orient: vertical; }
-webkit-line-clamp: 3; }
word-break: break-all;
}
.el-table__row { .mapdetail {
height: 231px; width: calc(100% - 107px);
font-size: 14px; height: 577px;
color: rgba(102, 102, 102, 1); background: rgba(242, 245, 247, 0.6);
font-weight: 500; margin-top: 26px;
} border-radius: 8px;
} margin-left: 53px;
margin-right: 54px;
.mapdetail { display: flex;
width: calc(100% - 107px); align-items: center;
height: 577px; justify-content: center;
background: rgba(242, 245, 247, 0.6); }
margin-top: 26px; }
border-radius: 8px;
margin-left: 53px;
margin-right: 54px;
display: flex;
align-items: center;
justify-content: center;
}
}
} }
.lppopover { .lppopover {
.finish { .finish {
padding-left: 27px; padding-left: 27px;
padding-right: 18px; padding-right: 18px;
margin-top: 15px; margin-top: 15px;
margin-bottom: 17px; margin-bottom: 17px;
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.text { .text {
font-size: 16px; font-size: 16px;
font-weight: 800; font-weight: 800;
color: #333333; color: #333333;
margin-left: 8px; margin-left: 8px;
} }
.box { .box {
width: 59px; width: 59px;
height: 10px; height: 10px;
background-color: rgba(36, 120, 255, 0.15); background-color: rgba(36, 120, 255, 0.15);
position: absolute; position: absolute;
left: 50px; left: 50px;
top: 15px; top: 15px;
} }
.tasks {
width: 405px;
height: 52px;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 28px;
cursor: pointer;
}
.tasks {
width: 405px;
height: 52px;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 28px;
cursor: pointer;
}
.box-item { .box-item {
width: 200px; width: 200px;
margin-top: 10px; margin-top: 10px;
} }
} }
</style> </style>

View File

@@ -125,7 +125,7 @@
@click="toFinish(value)" @click="toFinish(value)"
> >
{{ {{
value.status === 1 value.currentRatio === 1
? "已完成" ? "已完成"
: types.path[value.type] : types.path[value.type]
? types.toName[value.type] ? types.toName[value.type]