diff --git a/src/components/admin/MyResources.vue b/src/components/admin/MyResources.vue index eb74f40..253c9e5 100644 --- a/src/components/admin/MyResources.vue +++ b/src/components/admin/MyResources.vue @@ -1,14 +1,736 @@ - +.resources-content { + padding: 0; + background: #F5F7FA; + min-height: 100vh; + width: 100%; +} + +/* 头部操作区域 */ +.resources-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 0; + background: white; + padding: 20px 30px; + border-bottom: 1px solid #E8E8E8; + width: 100%; +} + +.resources-title h1 { + margin: 0; + color: #333; + font-size: 20px; + font-weight: 500; +} + +.resources-actions { + display: flex; + align-items: center; + gap: 12px; +} + +.upload-btn, +.new-folder-btn, +.recycle-bin-btn { + padding: 6px 16px; + border: 1px solid #0288D1; + border-radius: 4px; + cursor: pointer; + font-size: 14px; + transition: all 0.3s ease; + background: white; + color: #0288D1; + min-width: 70px; + text-align: center; + height: 32px; +} + +.upload-btn { + background: #0288D1; + color: white; +} + +.upload-btn:hover { + background: #0277BD; +} + +.new-folder-btn:hover, +.recycle-bin-btn:hover { + background: #F5F8FB; + color: #0288D1; +} + +.search-container { + display: flex; + align-items: center; + background: white; + border: 1px solid #D9D9D9; + border-radius: 4px; + overflow: hidden; + height: 32px; +} + +.search-input { + padding: 6px 12px; + border: none; + outline: none; + width: 180px; + font-size: 14px; + height: 30px; +} + +.search-btn { + padding: 6px 16px; + background: #0288D1; + color: white; + border: none; + cursor: pointer; + transition: background 0.3s ease; + font-size: 14px; + height: 30px; +} + +.search-btn:hover { + background: #0277BD; +} + + +/* 文件网格 */ +.files-grid { + display: grid; + grid-template-columns: repeat(8, 1fr); + gap: 20px; + background: white; + padding: 30px; + margin: 0; +} + +.file-item { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + padding: 20px 15px; + border-radius: 2px; + cursor: pointer; + transition: all 0.3s ease; + border: 1.5px solid #D8D8D8; + background: white; +} + +.file-item:hover { + background: #F5F8FB; + border-color: #0288D1; +} + +.file-item.selected { + background: #E3F2FD; + border-color: #0288D1; +} + +.file-menu { + position: absolute; + top: 8px; + right: 8px; + z-index: 10; +} + +.file-menu-btn { + width: 6px; + height: 24px; + border: none; + background: transparent; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + padding: 0; +} + +.file-menu-btn:hover { + background: rgba(0, 0, 0, 0.1); + border-radius: 4px; +} + +.more-icon { + width: 16px; + height: 16px; +} + +.file-menu-dropdown { + position: absolute; + top: 100%; + right: 0; + background: white; + border: 1px solid #D9D9D9; + border-radius: 6px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + min-width: 120px; + z-index: 1000; +} + +.menu-item { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + cursor: pointer; + font-size: 14px; + transition: background 0.2s ease; +} + +.menu-item:hover { + background: #F5F5F5; +} + +.menu-item.delete { + color: #FF4D4F; +} + +.menu-item.delete:hover { + background: #FFF2F0; +} + +.file-icon { + margin-bottom: 8px; +} + +.folder-icon { + width: 48px; + height: 48px; +} + +.file-name { + font-size: 12px; + color: #333; + text-align: center; + word-break: break-all; + max-width: 100px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.file-details { + position: absolute; + top: -10px; + left: 50%; + transform: translateX(-50%); + background: white; + border: 1px solid #D9D9D9; + border-radius: 6px; + padding: 12px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + z-index: 1000; + min-width: 200px; +} + +.detail-item { + display: flex; + justify-content: space-between; + margin-bottom: 4px; + font-size: 12px; +} + +.detail-label { + color: #666; +} + +.detail-value { + color: #333; + font-weight: 500; +} + +/* 模态框样式 */ +.modal-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 2000; +} + +.modal-content { + background: white; + border-radius: 8px; + padding: 24px; + min-width: 400px; + max-width: 500px; +} + +.modal-content h3 { + margin: 0 0 20px 0; + color: #333; + font-size: 18px; +} + +.modal-content input { + width: 100%; + padding: 10px 12px; + border: 1px solid #D9D9D9; + border-radius: 6px; + font-size: 14px; + outline: none; + margin-bottom: 20px; +} + +.upload-area { + border: 2px dashed #D9D9D9; + border-radius: 6px; + padding: 40px 20px; + text-align: center; + cursor: pointer; + transition: border-color 0.3s ease; + margin-bottom: 20px; +} + +.upload-area:hover { + border-color: #0288D1; +} + +.upload-icon { + font-size: 48px; + margin-bottom: 12px; + display: block; +} + +.upload-area p { + margin: 0; + color: #666; + font-size: 14px; +} + +.modal-actions { + display: flex; + justify-content: flex-end; + gap: 12px; +} + +.cancel-btn, +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 6px; + cursor: pointer; + font-size: 14px; + transition: all 0.3s ease; +} + +.cancel-btn { + background: #F5F5F5; + color: #666; +} + +.cancel-btn:hover { + background: #E6E6E6; +} + +.confirm-btn { + background: #0288D1; + color: white; +} + +.confirm-btn:hover { + background: #0277BD; +} + +/* 响应式设计 */ +@media (max-width: 768px) { + .resources-header { + flex-direction: column; + gap: 15px; + padding: 20px; + } + + .resources-actions { + flex-wrap: wrap; + justify-content: center; + } + + .search-input { + width: 150px; + } + + .files-grid { + grid-template-columns: repeat(4, 1fr); + gap: 15px; + padding: 20px; + } + + .modal-content { + min-width: 300px; + margin: 20px; + } +} + +/* 更小屏幕的响应式设计 */ +@media (max-width: 480px) { + .files-grid { + grid-template-columns: repeat(3, 1fr); + gap: 10px; + padding: 15px; + } +} + \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index dce623e..18722a6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -84,6 +84,7 @@ import ExamTaking from '@/views/teacher/ExamPages/ExamTaking.vue' import ExamNoticeBeforeStart from '@/views/teacher/ExamPages/ExamNoticeBeforeStart.vue' import ChapterEditor from '@/views/teacher/course/ChapterEditor.vue' +import TeacherCourseDetail from '@/views/teacher/course/CourseDetail.vue' // ========== 路由配置 ========== const routes: RouteRecordRaw[] = [ @@ -509,6 +510,12 @@ const routes: RouteRecordRaw[] = [ component: CourseDetail, meta: { title: '课程详情' } }, + { + path: '/teacher/course-detail/:id', + name: 'TeacherCourseDetail', + component: TeacherCourseDetail, + meta: { title: '教师端课程详情', requiresAuth: true } + }, { path: '/course/:id/enrolled', name: 'CourseDetailEnrolled', diff --git a/src/views/teacher/course/CourseDetail.vue b/src/views/teacher/course/CourseDetail.vue new file mode 100644 index 0000000..7a7a409 --- /dev/null +++ b/src/views/teacher/course/CourseDetail.vue @@ -0,0 +1,3 @@ + \ No newline at end of file