mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-07 01:46:46 +08:00
Merge remote-tracking branch 'origin/develop' into manage-release
This commit is contained in:
@@ -16,6 +16,10 @@ export function getCookie(name) {
|
||||
return document.cookie?.split(";").find(e => e.includes(name))?.replace(`${name}=`, '') || ''
|
||||
}
|
||||
|
||||
export function delCookie(name){
|
||||
setCookie(name, "", -1)
|
||||
}
|
||||
|
||||
export function useUserInfo(id) {
|
||||
const userInfo = ref({})
|
||||
watch(id, () => {
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
<template>
|
||||
<div
|
||||
class="pathDetail"
|
||||
v-if="visiable"
|
||||
<div
|
||||
class="pathDetail"
|
||||
v-if="visiable"
|
||||
:style="{
|
||||
background:`url('${imgAttr.backurl}') no-repeat`,
|
||||
backgroundSize: 'contain'
|
||||
}">
|
||||
<div v-if="detail.chapterDtoList" v-for="(item,i) in detail.chapterDtoList.slice(0,8)" :key="i" class="cha"
|
||||
:style="{top:`${imgAttr.positions[i]?.top - (current===i?5:0)}px`,left:`${imgAttr.positions[i]?.left - (current===i?10:0)}px`}">
|
||||
<div v-if="detail.chapterDtoList" v-for="(item,i) in showList" :key="i" class="cha"
|
||||
:style="{top:`${imgAttr.positions[i]?.top - (currentIndex===i?5:0)}px`,left:`${imgAttr.positions[i]?.left - (currentIndex===i?10:0)}px`}">
|
||||
<div @click="toDetail(i)"
|
||||
class="nameClass"
|
||||
:title="item.name"
|
||||
:style="{
|
||||
background: `url('${current===i?imgAttr.currentBack:imgAttr.nameBack}')`,
|
||||
background: `url('${currentIndex===i?imgAttr.currentBack:imgAttr.nameBack}')`,
|
||||
backgroundSize:'100%',
|
||||
width:`${current===i?107:93}px`,
|
||||
height:`${current===i?imgAttr.cheightC:imgAttr.cheight}px`,
|
||||
lineHeight:'50px',color: current===i?imgAttr.ccolors:imgAttr.colors}">
|
||||
width:`${currentIndex===i?107:93}px`,
|
||||
height:`${currentIndex===i?imgAttr.cheightC:imgAttr.cheight}px`,
|
||||
lineHeight:'50px',color: currentIndex===i?imgAttr.ccolors:imgAttr.colors}">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {computed, defineProps, ref} from "vue";
|
||||
import {computed, defineProps, ref, watch} from "vue";
|
||||
import {ElMessage} from "element-plus";
|
||||
import back from '@/assets/image/pathdetails/pathDetailBack.png'
|
||||
import nameBack from '@/assets/image/pathdetails/pathDetailImg.png'
|
||||
import currentBack from '@/assets/image/pathdetails/pathDetailImgSelect.png'
|
||||
import back1 from '@/assets/image/pathdetails/back1.png'
|
||||
import nameBack1 from '@/assets/image/pathdetails/nameBack1.png'
|
||||
import currentBack1 from '@/assets/image/pathdetails/currentBack1.png'
|
||||
import back2 from '@/assets/image/pathdetails/back2.png'
|
||||
import nameBack2 from '@/assets/image/pathdetails/nameBack2.png'
|
||||
import currentBack2 from '@/assets/image/pathdetails/currentBack2.png'
|
||||
import back from "@/assets/image/pathdetails/pathDetailBack.png";
|
||||
import nameBack from "@/assets/image/pathdetails/pathDetailImg.png";
|
||||
import currentBack from "@/assets/image/pathdetails/pathDetailImgSelect.png";
|
||||
import back1 from "@/assets/image/pathdetails/back1.png";
|
||||
import nameBack1 from "@/assets/image/pathdetails/nameBack1.png";
|
||||
import currentBack1 from "@/assets/image/pathdetails/currentBack1.png";
|
||||
import back2 from "@/assets/image/pathdetails/back2.png";
|
||||
import nameBack2 from "@/assets/image/pathdetails/nameBack2.png";
|
||||
import currentBack2 from "@/assets/image/pathdetails/currentBack2.png";
|
||||
import {useRouter} from "vue-router/dist/vue-router";
|
||||
|
||||
const props = defineProps({
|
||||
@@ -43,81 +43,94 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
});
|
||||
const router = useRouter();
|
||||
const visiable = ref(true)
|
||||
const visiable = ref(true);
|
||||
const imageAttrs = {
|
||||
'路径图背景': {
|
||||
"路径图背景": {
|
||||
width: 1437,
|
||||
height: 594,
|
||||
cheight:70,
|
||||
cheightC:80,
|
||||
cheight: 70,
|
||||
cheightC: 80,
|
||||
backurl: back,
|
||||
currentBack: currentBack,
|
||||
nameBack: nameBack,
|
||||
ccolors: '#FFF',
|
||||
colors: '#FFF',
|
||||
ccolors: "#FFF",
|
||||
colors: "#FFF",
|
||||
positions: [
|
||||
{left: 50, top: 425},
|
||||
{left: 440, top: 425},
|
||||
{left: 400, top: 315},
|
||||
{left: 515, top: 220},
|
||||
{left: 800, top: 200},
|
||||
{left: 660, top: 115},
|
||||
{left: 760, top: 35},
|
||||
{left: 1000, top: 25},
|
||||
{ left: 50, top: 425 },
|
||||
{ left: 440, top: 425 },
|
||||
{ left: 400, top: 315 },
|
||||
{ left: 515, top: 220 },
|
||||
{ left: 800, top: 200 },
|
||||
{ left: 660, top: 115 },
|
||||
{ left: 760, top: 35 },
|
||||
{ left: 1000, top: 25 },
|
||||
]
|
||||
},
|
||||
'路径图2': {
|
||||
"路径图2": {
|
||||
width: 1437,
|
||||
height: 594,
|
||||
cheight:100,
|
||||
cheightC:106,
|
||||
cheight: 100,
|
||||
cheightC: 106,
|
||||
backurl: back2,
|
||||
currentBack: currentBack2,
|
||||
nameBack: nameBack2,
|
||||
ccolors: '#FFF3E5',
|
||||
colors: '#FFF',
|
||||
ccolors: "#FFF3E5",
|
||||
colors: "#FFF",
|
||||
positions: [
|
||||
{left: 40, top: 380},
|
||||
{left: 160, top: 290},
|
||||
{left: 330, top: 270},
|
||||
{left: 440, top: 200},
|
||||
{left: 610, top: 170},
|
||||
{left: 780, top: 130},
|
||||
{left: 890, top: 60},
|
||||
{left: 1060, top: 30},
|
||||
{ left: 40, top: 380 },
|
||||
{ left: 160, top: 290 },
|
||||
{ left: 330, top: 270 },
|
||||
{ left: 440, top: 200 },
|
||||
{ left: 610, top: 170 },
|
||||
{ left: 780, top: 130 },
|
||||
{ left: 890, top: 60 },
|
||||
{ left: 1060, top: 30 },
|
||||
]
|
||||
},
|
||||
'路径图3': {
|
||||
"路径图3": {
|
||||
width: 1437,
|
||||
height: 594,
|
||||
cheight:70,
|
||||
cheightC:80,
|
||||
cheight: 70,
|
||||
cheightC: 80,
|
||||
backurl: back1,
|
||||
currentBack: currentBack1,
|
||||
nameBack: nameBack1,
|
||||
ccolors: '#FFF',
|
||||
colors: '#A06438',
|
||||
ccolors: "#FFF",
|
||||
colors: "#A06438",
|
||||
positions: [
|
||||
{left: 20, top: 390},
|
||||
{left: 210, top: 380},
|
||||
{left: 320, top: 275},
|
||||
{left: 485, top: 265},
|
||||
{left: 645, top: 220},
|
||||
{left: 820, top: 180},
|
||||
{left: 960, top: 150},
|
||||
{left: 1050, top:60},
|
||||
{ left: 20, top: 390 },
|
||||
{ left: 210, top: 380 },
|
||||
{ left: 320, top: 275 },
|
||||
{ left: 485, top: 265 },
|
||||
{ left: 645, top: 220 },
|
||||
{ left: 820, top: 180 },
|
||||
{ left: 960, top: 150 },
|
||||
{ left: 1050, top: 60 },
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const imgAttr = computed(() => imageAttrs[Object.keys(imageAttrs).find(e => props.img&&props.img.includes(e))] || {})
|
||||
console.log(imgAttr)
|
||||
const current = computed(() => props.detail.chapterDtoList.findIndex(e => e.id === props.detail.currentStageId))
|
||||
const imgAttr = computed(() => imageAttrs[Object.keys(imageAttrs).find(e => props.img && props.img.includes(e))] || {});
|
||||
const current = computed(() => props.detail.chapterDtoList.findIndex(e => e.id === props.detail.currentStageId));
|
||||
//当关卡太多时只显示 当前关卡中间8个
|
||||
const currentIndex = computed(() => {
|
||||
if (props.detail.chapterDtoList?.length <= 8) {
|
||||
return current.value;
|
||||
}
|
||||
return current.value < 3 ? current.value : props.detail.chapterDtoList.length - current.value <= 4 ? (8 - (props.detail.chapterDtoList.length - current.value)) : 3;
|
||||
});
|
||||
const startIndex = computed(() => {
|
||||
if (props.detail.chapterDtoList?.length <= 8) {
|
||||
return 0;
|
||||
}
|
||||
return current.value < 3 ? 0 : props.detail.chapterDtoList.length - current.value <= 4 ? props.detail.chapterDtoList.length - 8 : current.value - 3;
|
||||
});
|
||||
const showList = computed(() => props.detail.chapterDtoList?.length <= 8 ? props.detail.chapterDtoList : props.detail.chapterDtoList?.slice(startIndex.value, startIndex.value + 8));
|
||||
|
||||
function show() {
|
||||
visiable.value = true
|
||||
visiable.value = true;
|
||||
}
|
||||
|
||||
function toDetail(i) {
|
||||
@@ -125,53 +138,53 @@ function toDetail(i) {
|
||||
let previewSetting = props.detail.previewSetting;
|
||||
let studySetting = props.detail.studySetting;
|
||||
let isStudy = false;
|
||||
let chapterId = props.detail.chapterDtoList[i].id
|
||||
console.log(studySetting)
|
||||
if(previewSetting==null){
|
||||
let chapterId = props.detail.chapterDtoList[i].id;
|
||||
console.log(studySetting);
|
||||
if (previewSetting == null) {
|
||||
// 如果未设置预览 则只可以看当前关卡 其余关卡不让点击
|
||||
if (current.value !== i) {
|
||||
ElMessage.warning("当前关卡不可预览");
|
||||
return
|
||||
return;
|
||||
}
|
||||
isStudy = true;
|
||||
}else{
|
||||
} else {
|
||||
if (current.value !== i) {
|
||||
let lookArr = [];
|
||||
lookArr = previewSetting.split(',')
|
||||
if((i+1)>=lookArr[0] && (i+1)<=lookArr[1]){
|
||||
if(studySetting!==null){
|
||||
lookArr = previewSetting.split(",");
|
||||
if ((i + 1) >= lookArr[0] && (i + 1) <= lookArr[1]) {
|
||||
if (studySetting !== null) {
|
||||
let studyArr = [];
|
||||
studyArr = studySetting.split(',')
|
||||
if((i+1)>=studyArr[0] && (i+1)<=studyArr[1]){
|
||||
studyArr = studySetting.split(",");
|
||||
if ((i + 1) >= studyArr[0] && (i + 1) <= studyArr[1]) {
|
||||
isStudy = true;
|
||||
}else{
|
||||
} else {
|
||||
isStudy = false;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
isStudy = false;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
ElMessage.warning("当前关卡不可预览");
|
||||
return
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
isStudy = true;
|
||||
}
|
||||
}
|
||||
(import.meta.env.MODE === "development" || import.meta.env.MODE === "test")
|
||||
? router.push({
|
||||
path: "/pathdetails",
|
||||
query: {routerId: props.detail.id, routerName: props.detail.name, isStudy, chapterId},
|
||||
})
|
||||
: window.open(
|
||||
`${window.location.protocol + import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails¶ms=${encodeURIComponent(
|
||||
`routerId=${props.detail.id}&routerName=${props.detail.name}&chapterId=${chapterId}&isStudy=${isStudy}`
|
||||
)}`
|
||||
,'_top');
|
||||
? router.push({
|
||||
path: "/pathdetails",
|
||||
query: { routerId: props.detail.id, routerName: props.detail.name, isStudy, chapterId },
|
||||
})
|
||||
: window.open(
|
||||
`${window.location.protocol + import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails¶ms=${encodeURIComponent(
|
||||
`routerId=${props.detail.id}&routerName=${props.detail.name}&chapterId=${chapterId}&isStudy=${isStudy}`
|
||||
)}`
|
||||
, "_top");
|
||||
}
|
||||
|
||||
function close() {
|
||||
visiable.value = false
|
||||
visiable.value = false;
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@@ -186,12 +199,13 @@ function close() {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
}
|
||||
.nameClass{
|
||||
|
||||
.nameClass {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
padding:0 20px 0 50px;
|
||||
padding: 0 20px 0 50px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -51,19 +51,31 @@ function handleChange(file) {
|
||||
f.uid = file.uid;
|
||||
file.raw = f;
|
||||
console.log(file.raw)
|
||||
imageRef.value.submit();
|
||||
if(file.raw.name.includes('.mp4') || file.raw.name.includes('.MP4')){
|
||||
files.value = []
|
||||
emit('update:value', files.value)
|
||||
ElMessage.error(`暂不支持视频文件上传`);
|
||||
return
|
||||
}else if(file.raw.name.includes('.jpeg') || file.raw.name.includes('.JPEG')){
|
||||
files.value = []
|
||||
emit('update:value', files.value)
|
||||
ElMessage.error(`暂不支持jpeg格式图片文件上传`);
|
||||
return
|
||||
}else{
|
||||
imageRef.value.submit();
|
||||
|
||||
if (file.response && file.response.code === 200) {
|
||||
file.url = file.response.data
|
||||
}
|
||||
const index = files.value.findIndex(f => f.uid === file.uid)
|
||||
if (index === -1) {
|
||||
files.value.unshift(file)
|
||||
} else {
|
||||
files.value[index] = file
|
||||
}
|
||||
if (file.response && file.response.code === 200) {
|
||||
file.url = file.response.data
|
||||
}
|
||||
const index = files.value.findIndex(f => f.uid === file.uid)
|
||||
if (index === -1) {
|
||||
files.value.unshift(file)
|
||||
} else {
|
||||
files.value[index] = file
|
||||
}
|
||||
|
||||
emit('update:value', files.value)
|
||||
emit('update:value', files.value)
|
||||
}
|
||||
}
|
||||
|
||||
function remove(i) {
|
||||
|
||||
@@ -38,8 +38,8 @@ export default createStore({
|
||||
const stageState = t.taskProcessList?.some((s) => {
|
||||
s.unlock = true;
|
||||
s.statusName = "已完成";
|
||||
s.status === 2 ? (s.statusName = "进行中") : (!s.status && (s.statusName = TASK_TYPES.toName[s.type]));
|
||||
return state.projectInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag);
|
||||
s.status !== 1 && (s.statusName = TASK_TYPES.toName[s.type])
|
||||
return state.projectInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag)
|
||||
});
|
||||
stageState && (t.statusName = "进行中");
|
||||
return stageState;
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, reactive, toRefs, watch, onUnmounted } from "vue";
|
||||
import { computed, reactive, toRefs, watch, onUnmounted, ref } from "vue";
|
||||
import FileTypeImg from "@/components/FileTypeImg.vue";
|
||||
import { request, useRequest } from "@/api/request";
|
||||
import {
|
||||
@@ -343,8 +343,10 @@ const { activeName, enclosure, isAllowSign } = toRefs(state);
|
||||
const handleClick = (tab, event) => {
|
||||
console.log("附件", tab, event);
|
||||
};
|
||||
const fielPath = ref(import.meta.env.VITE_FILE_PATH);
|
||||
const download = (url) => {
|
||||
window.open(url);
|
||||
console.log(fielPath.value+url)
|
||||
window.open(fielPath.value+url);
|
||||
};
|
||||
const downloads = (url) => {
|
||||
ElMessage.warning("未到开始时间,请耐心等待!");
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<botton
|
||||
class="btn"
|
||||
style="margin-right: 20px;width: 160px;height: 46px;"
|
||||
v-if="data.hasTask || data.planDto.applyFlag"
|
||||
v-if="data.planDto.applyFlag"
|
||||
@click="onLineSignUp(false)"
|
||||
:style="{ background: isAllowSign?data.isSignUp || data.isRefused ? '#999' : 'rgb(57, 146, 249)':'#999'}">
|
||||
{{
|
||||
@@ -49,10 +49,9 @@
|
||||
}}
|
||||
</botton>
|
||||
<botton
|
||||
v-if="data.isRefused"
|
||||
v-if="data.isRefused && !data.isSignUpAgain"
|
||||
class="btn"
|
||||
style="margin-right: 20px;width: 160px;height: 46px;"
|
||||
:style="{ background: isAllowSign?'rgb(57, 146, 249)':'#999'}"
|
||||
@click="onLineSignUp(true)">
|
||||
重新报名
|
||||
</botton>
|
||||
@@ -278,12 +277,12 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="材料下载" name="four" >
|
||||
<div v-if="data.offcourseDto?.attach == ''"
|
||||
<div v-if="data.planDto?.attach == ''"
|
||||
style="font-size: 14px;font-weight: 400; line-height: 24px; cursor: pointer;margin-left: 40px; margin-top: 20px;">
|
||||
此课程无附件
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-for="(el, index) in formateArr(data.offcourseDto.attach)" :key="index" class="enclosure"
|
||||
<div v-for="(el, index) in formateArr(data.planDto.attach)" :key="index" class="enclosure"
|
||||
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }">
|
||||
<div class="enclosureL">
|
||||
<FileTypeImg :v-model="el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.'))" :style="{
|
||||
@@ -295,12 +294,12 @@
|
||||
</div>
|
||||
<div class="download">
|
||||
<img style="width: 16px; height: 15px" src="../../assets/image/download.png"/>
|
||||
<div style="margin-left: 5px;color:#999;">
|
||||
下载
|
||||
</div>
|
||||
<!-- <div style="margin-left: 5px;color:#999;" @click="download(el)">
|
||||
<!-- <div style="margin-left: 5px;color:#999;">
|
||||
下载
|
||||
</div> -->
|
||||
<div style="margin-left: 5px;color:#2478ff;" @click="download(el)">
|
||||
下载
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -373,9 +372,10 @@ const {activeName, enclosure, isAllowSign} = toRefs(state);
|
||||
const handleClick = (tab, event) => {
|
||||
console.log("附件", tab, event);
|
||||
};
|
||||
const fielPath = ref(import.meta.env.VITE_FILE_PATH);
|
||||
const download = (url) => {
|
||||
// console.log('下载url',url)
|
||||
window.open(url);
|
||||
console.log('下载url',fielPath.value+url)
|
||||
window.open(fielPath.value+url);
|
||||
};
|
||||
const downloads = (url) => {
|
||||
ElMessage.warning("未在有效时间范围内,请耐心等待!");
|
||||
@@ -582,7 +582,10 @@ function onLineSignUp(isAgain) {
|
||||
}
|
||||
request(FACETEACH_SIGNUP, {courseId})
|
||||
data.value.isSignUp = true
|
||||
ElMessage.success("报名成功");
|
||||
//重置按钮
|
||||
data.value.isSignUpAgain = isAgain;
|
||||
data.value.isRefused = false;
|
||||
ElMessage.success(isAgain? "重新报名成功" : "报名成功");
|
||||
}
|
||||
|
||||
function formateArr(strs) {
|
||||
|
||||
@@ -364,7 +364,7 @@ const { commit, dispatch, state } = useStore()
|
||||
const store = useStore()
|
||||
const userInfo = computed(() => state.userInfo)
|
||||
const data = computed(() => state.projectInfo)
|
||||
|
||||
console.log(data)
|
||||
onMounted(() => {
|
||||
dispatch('getProjectInfo', { projectId })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user