学生端选课进课闭环

This commit is contained in:
CakeCN
2025-09-06 21:27:28 +08:00
parent a0d154b434
commit 6883a999e9
24 changed files with 634 additions and 217 deletions

View File

@@ -17,10 +17,10 @@
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>
<div class="maxcontainer" id="maxcontainer">
<div class="maxcontainer" id="maxcontainer" style="height: 100%;">
<!-- 左侧内容 -->
<div class="sidebar" id="leftSidebar" style="width: 100%;height: 100%;">
<div id="markdown-content"style="width: 100%;height: 95%;">
<div id="markdown-content"style="width: 100%;height: 93%;">
<!-- 动态加载的 HTML 会显示在这里 -->
</div>
<div id="markdown-content-process"style="width: 100%;height: 5%;">
@@ -30,14 +30,14 @@
<!-- 这里将显示鼠标悬停的详情 -->
</div>
</div>
<div id="dragbar"></div>
<div id="dragbar" class="resizer"></div>
<!-- 中间嵌入的 Vscode-web 窗口,带有 tkn 参数 -->
<div class="vscode-web"id="vscodeWeb">
</div>
<div class="vscode-web"id="vscodeWeb" >
</div>
<div id="dragbar2"></div>
<div id="dragbar2" class="resizer"></div>
<!-- 右侧内容 -->
<div class="sidebar" id="rightSidebar"style="width: 100%;height: 100%;">
<div class="chatbox-header">
@@ -54,7 +54,8 @@
</label>
</div>
</div>
<div class="chatbox" id="chatbox" style="width: 100%;height: 80%;">
<div class="chatbox" id="chatbox" >
<!-- 消息会在这里显示 -->
</div>
<div class="input-area">
@@ -66,7 +67,8 @@
window.appData = {
user_uuid:"{{user_uuid}}",
course_id:"{{course_id}}",
chapter_id:"{{chapter_id}}",
lesson_name:"{{lesson_name}}",
chapter_name:"{{chapter_name}}",
folder:"{{workspace_path}}"
}
</script>
@@ -112,12 +114,19 @@
let isDraggingLeft = false;
let isDraggingRight = false;
dragbar.addEventListener('mousedown', function() {
isDraggingLeft = true;
// 当鼠标按下时,禁用 iframe 的鼠标事件
dragbar.addEventListener('mousedown', function(e) {
isDraggingLeft = true;
document.querySelectorAll('iframe').forEach(function(iframe) {
iframe.style.pointerEvents = 'none'; // 禁止 iframe 捕获鼠标事件
});
});
dragbar2.addEventListener('mousedown', function() {
isDraggingRight = true;
dragbar2.addEventListener('mousedown', function(e) {
isDraggingRight = true;
document.querySelectorAll('iframe').forEach(function(iframe) {
iframe.style.pointerEvents = 'none'; // 禁止 iframe 捕获鼠标事件
});
});
document.addEventListener('mousemove', function(e) {
@@ -131,8 +140,11 @@
});
document.addEventListener('mouseup', function() {
isDraggingLeft = false;
isDraggingRight = false;
isDraggingLeft = false;
isDraggingRight = false;
document.querySelectorAll('iframe').forEach(function(iframe) {
iframe.style.pointerEvents = 'auto'; // 恢复 iframe 的鼠标事件
});
});
@@ -156,7 +168,7 @@
const sessionInfo = data
iframe.src = '{{vscode_web_url}}/?workspace={{workspace_path}}&folder={{workspace_path}}';
iframe.style.width = '100%';
iframe.style.height = '100%';
iframe.style.height = '99%';
// 将 iframe 插入到指定的 div 中
document.getElementById('vscodeWeb').appendChild(iframe);
@@ -174,8 +186,8 @@
// 动态加载 Markdown 文件
function loadMarkdown(course_id, filename) {
fetch(`/${course_id}-${filename}-markdown`)
function loadMarkdown(course_id, chapter_name, lesson_name) {
fetch(`/${course_id}-${chapter_name}-${lesson_name}-markdown`)
.then(response => response.json())
.then(data => {
if (data.html_url) {
@@ -194,7 +206,7 @@
});
}
document.addEventListener('DOMContentLoaded', function() {
loadMarkdown('{{course_id}}','{{chapter_id}}');
loadMarkdown('{{course_id}}','{{chapter_name}}','{{lesson_name}}');
});