This commit is contained in:
Pengxiansen
2025-02-25 15:34:11 +08:00
parent c05f473ef3
commit deba79c17d
3 changed files with 99 additions and 161 deletions

View File

@@ -338,86 +338,55 @@
</el-dialog> </el-dialog>
<!-- 开课列表弹框 --> <!-- 开课列表弹框 -->
<el-dialog <el-dialog
title="" title="开课列表"
v-model="openCourseVisible" v-model="openCourseVisible"
:show-close="false" :show-close="true"
style=" style="padding: 0; border-radius: 4px"
display: flex; width="600px"
justify-content: center;
align-items: center;
min-height: 320px;
padding: 0;
border-radius: 4px;
"
width="502px"
> >
<div <el-scrollbar height="400px">
style=" <div>
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 22px;
"
>
<div
style="
width: 288px;
color: #333333;
font-size: 16px;
font-weight: 600;
"
>
开课列表
</div>
<div
@click="openCourseVisible = false"
style="font-size: 12px; cursor: pointer"
>
X
</div>
</div>
<div style="width: 100%; min-height: 210px; margin-top: 12px">
<div
v-for="(item, key) in openCourseList"
style="
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
background: rgb(247, 251, 253);
height: 40px;
padding: 5px;
border-radius: 5px;
"
>
<div <div
v-for="(item, key) in openCourseList"
style=" style="
overflow: hidden; display: flex;
white-space: nowrap; justify-content: space-between;
text-overflow: ellipsis; align-items: center;
width: 320px; margin-bottom: 12px;
" background: rgb(247, 251, 253);
> height: 40px;
{{ item.name }} padding: 5px 20px;
</div>
<div
@click="toOffcoursePlanPage(item)"
style="
width: 60px;
height: 30px;
text-align: center;
line-height: 30px;
background: #0078fc;
border-radius: 5px; border-radius: 5px;
color: #fff;
cursor: pointer;
" "
> >
去上课 <div
style="
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 320px;
"
>
{{ item.name }}
</div>
<div
@click="toOffcoursePlanPage(item)"
style="
width: 60px;
height: 30px;
text-align: center;
line-height: 30px;
background: #0078fc;
border-radius: 5px;
color: #fff;
cursor: pointer;
"
>
去上课
</div>
</div> </div>
</div> </div>
</div> </el-scrollbar>
</el-dialog> </el-dialog>
<el-backtop :right="100" :bottom="100" /> <el-backtop :right="100" :bottom="100" />
@@ -605,10 +574,6 @@ async function toFinish(d) {
ElMessage.warning(`请先完成“${d.superTaskName}”的学习任务`); ElMessage.warning(`请先完成“${d.superTaskName}”的学习任务`);
return; return;
} }
if (!d.canLearn && d.courseType != 2) {
ElMessage.warning(`学习任务暂未开始`);
return;
}
//更新学员当前任务 //更新学员当前任务
await growthRequest(PROFESSIONAL_STUDENT_LEARN, { await growthRequest(PROFESSIONAL_STUDENT_LEARN, {

View File

@@ -231,86 +231,55 @@
</el-dialog> </el-dialog>
<!-- 开课列表弹框 --> <!-- 开课列表弹框 -->
<el-dialog <el-dialog
title="" title="开课列表"
v-model="openCourseVisible" v-model="openCourseVisible"
:show-close="false" :show-close="true"
style=" style="padding: 0; border-radius: 4px"
display: flex; width="600px"
justify-content: center;
align-items: center;
min-height: 320px;
padding: 0;
border-radius: 4px;
"
width="502px"
> >
<div <el-scrollbar height="400px">
style=" <div>
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 22px;
"
>
<div
style="
width: 288px;
color: #333333;
font-size: 16px;
font-weight: 600;
"
>
开课列表
</div>
<div
@click="openCourseVisible = false"
style="font-size: 12px; cursor: pointer"
>
X
</div>
</div>
<div style="width: 100%; min-height: 210px; margin-top: 12px">
<div
v-for="(item, key) in openCourseList"
style="
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
background: rgb(247, 251, 253);
height: 40px;
padding: 5px;
border-radius: 5px;
"
>
<div <div
v-for="(item, key) in openCourseList"
style=" style="
overflow: hidden; display: flex;
white-space: nowrap; justify-content: space-between;
text-overflow: ellipsis; align-items: center;
width: 320px; margin-bottom: 12px;
" background: rgb(247, 251, 253);
> height: 40px;
{{ item }} padding: 5px 20px;
</div>
<div
@click="toOffcoursePlanPage(openCourseIdList[key])"
style="
width: 60px;
height: 30px;
text-align: center;
line-height: 30px;
background: #0078fc;
border-radius: 5px; border-radius: 5px;
color: #fff;
cursor: pointer;
" "
> >
去上课 <div
style="
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 320px;
"
>
{{ item.name }}
</div>
<div
@click="toOffcoursePlanPage(item)"
style="
width: 60px;
height: 30px;
text-align: center;
line-height: 30px;
background: #0078fc;
border-radius: 5px;
color: #fff;
cursor: pointer;
"
>
去上课
</div>
</div> </div>
</div> </div>
</div> </el-scrollbar>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -463,7 +432,6 @@ watch(
); );
const openCourseVisible = ref(false); const openCourseVisible = ref(false);
const openCourseList = ref([]); const openCourseList = ref([]);
const openCourseIdList = ref([]);
const dialogVisible = ref(false); const dialogVisible = ref(false);
const dialogVisibleTip = ref("该任务无法学习,请联系管理员进行替换!"); const dialogVisibleTip = ref("该任务无法学习,请联系管理员进行替换!");
@@ -477,7 +445,7 @@ async function toFinish(d) {
ElMessage.warning(`请先完成“${d.superTaskName}”的学习任务`); ElMessage.warning(`请先完成“${d.superTaskName}”的学习任务`);
return; return;
} }
if (!d.canLearn && d.courseType != 2) { if (!d.canLearn && d.completionStatus === '0') {
ElMessage.warning(`学习任务暂未开始`); ElMessage.warning(`学习任务暂未开始`);
return; return;
} }
@@ -492,8 +460,7 @@ async function toFinish(d) {
return ElMessage.error("还未添加开课,请联系管理员!"); return ElMessage.error("还未添加开课,请联系管理员!");
} }
if (d.targetId.split(",").length > 1) { if (d.targetId.split(",").length > 1) {
openCourseList.value = d.targetName?.split(","); openCourseList.value = d.offcoursePlanList;
openCourseIdList.value = d.targetId?.split(",");
openCourseVisible.value = true; openCourseVisible.value = true;
return; return;
} }
@@ -710,11 +677,17 @@ async function toFinish(d) {
} }
} }
function toOffcoursePlanPage(id) { function toOffcoursePlanPage(item) {
let date1 = new Date(item.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
ElMessage.warning(`当前开课已结束`);
return;
}
window.open( window.open(
`${location.protocol}//${location.host}${ `${location.protocol}//${location.host}${
import.meta.env.VITE_BASE_API import.meta.env.VITE_BASE_API
}/stu/project/redirectDetail?courseId=${id}`, }/stu/project/redirectDetail?courseId=${item.id}`,
"_top" "_top"
); );
} }

View File

@@ -38,16 +38,16 @@ export default defineConfig(({ command, mode }) =>
}, },
server: { server: {
proxy: { proxy: {
"/professional": { // "/professional": {
// target: 'http://192.168.16.195:32002', // // target: 'http://192.168.16.195:32002',
// target: 'http://192.168.150.97:32002', // // target: 'http://192.168.150.97:32002',
target: 'http://192.168.38.211:32002', // target: 'http://192.168.38.211:32002',
changeOrigin: true,
},
// '/growth': {
// target: 'https://u-pre.boe.com',
// changeOrigin: true, // changeOrigin: true,
// }, // },
'/growth': {
target: 'https://u-pre.boe.com',
changeOrigin: true,
},
'/file/upload': { '/file/upload': {
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL, target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
changeOrigin: true, changeOrigin: true,