CoursePage.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583
  1. <!--
  2. Description: 我的批改页面
  3. Author: BaiQi
  4. Created Date: 2024-7-25
  5. -->
  6. <template>
  7. <div class="course-page">
  8. <!-- 左侧菜单栏 -->
  9. <div class="left-sidebar">
  10. <!-- EAI平台装饰栏 -->
  11. <div class="platform-header">
  12. <div class="platform-name">EAI专业英语平台</div>
  13. </div>
  14. <!-- 搜索框 -->
  15. <div class="search-section">
  16. <div class="search-input-container" @click="openSearchDialog">
  17. <el-icon class="search-icon"><Search /></el-icon>
  18. <input type="text" placeholder="搜索" class="search-input" readonly />
  19. </div>
  20. </div>
  21. <!-- 菜单列表 -->
  22. <div class="menu-section">
  23. <!-- 加载状态 -->
  24. <div v-if="loading" class="loading-container">
  25. <div class="loading-text">加载中...</div>
  26. </div>
  27. <div class="menu-item" v-for="course in courseList" :key="course.courseId">
  28. <div class="course-header" @click="toggleCourse(course.courseId)">
  29. <el-icon class="expand-icon" :class="{ 'expanded': course.expanded }">
  30. <ArrowDown v-if="course.expanded" />
  31. <ArrowRight v-else />
  32. </el-icon>
  33. <el-icon class="course-icon"><Document /></el-icon>
  34. <span class="course-name">{{ course.courseName }}</span>
  35. </div>
  36. <!-- 作业子菜单 -->
  37. <div class="assignment-list" v-if="course.expanded">
  38. <div
  39. class="assignment-item"
  40. v-for="assignment in course.assignments"
  41. :key="assignment.assignmentId"
  42. :class="{ 'active': assignment.active }"
  43. @click="selectAssignment(assignment.assignmentId)"
  44. >
  45. <el-icon class="assignment-icon" :class="{ 'active-icon': assignment.active }">
  46. <Document />
  47. </el-icon>
  48. <span class="assignment-name">{{ assignment.assignmentName }}</span>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- 右侧内容区域 -->
  55. <div class="right-content">
  56. <!-- 当没有选中作业时显示空白状态 -->
  57. <div v-if="!selectedAssignment" class="empty-state">
  58. <div class="empty-content">
  59. <el-icon class="empty-icon"><Document /></el-icon>
  60. <div class="empty-text">请选择一个作业开始批改</div>
  61. </div>
  62. </div>
  63. <!-- 当选中作业时显示内容 -->
  64. <div v-else class="assignment-content">
  65. <!-- 右上角数据看板按钮 -->
  66. <div class="top-actions">
  67. <el-button type="primary" class="dashboard-button">数据看板</el-button>
  68. </div>
  69. <!-- 统计卡片区域 -->
  70. <div class="stats-container">
  71. <div class="stats-card">
  72. <div class="stats-icon user-icon">
  73. <el-icon><User /></el-icon>
  74. </div>
  75. <div class="stats-content">
  76. <div class="stats-label">作业总人数</div>
  77. <div class="stats-value">{{ statsData.totalStudents }}</div>
  78. </div>
  79. </div>
  80. <div class="stats-card">
  81. <div class="stats-icon completed-icon">
  82. <el-icon><CircleCheck /></el-icon>
  83. </div>
  84. <div class="stats-content">
  85. <div class="stats-label">已批改人数</div>
  86. <div class="stats-value">{{ statsData.correctedCount }}</div>
  87. </div>
  88. </div>
  89. <div class="stats-card">
  90. <div class="stats-icon pending-icon">
  91. <el-icon><Document /></el-icon>
  92. </div>
  93. <div class="stats-content">
  94. <div class="stats-label">已提交未批改人数</div>
  95. <div class="stats-value">{{ statsData.submittedNotCorrectedCount }}</div>
  96. </div>
  97. </div>
  98. <div class="stats-card">
  99. <div class="stats-icon not-submitted-icon">
  100. <el-icon><WarningFilled /></el-icon>
  101. </div>
  102. <div class="stats-content">
  103. <div class="stats-label">未提交人数</div>
  104. <div class="stats-value">{{ statsData.notSubmittedCount }}</div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="assignment-body">
  109. <!-- 课程作业标题 -->
  110. <div class="assignment-title-section">
  111. <h3 class="assignment-full-title">{{ selectedAssignment.courseName }}:{{ selectedAssignment.assignmentName }}</h3>
  112. </div>
  113. <!-- 搜索筛选栏 -->
  114. <div class="filter-section">
  115. <div class="filter-controls">
  116. <el-icon class="reset-icon" @click="resetFilters"><Refresh /></el-icon>
  117. <div class="search-input-wrapper">
  118. <input
  119. type="text"
  120. placeholder="请输入内容"
  121. class="filter-search-input"
  122. v-model="filterQuery"
  123. />
  124. </div>
  125. <el-select v-model="statusFilter" placeholder="状态" class="filter-select">
  126. <el-option label="全部" value=""></el-option>
  127. <el-option label="未提交" value="未提交"></el-option>
  128. <el-option label="已提交未批改" value="已提交未批改"></el-option>
  129. <el-option label="已批改" value="已批改"></el-option>
  130. <el-option label="补交_未批改" value="补交_未批改"></el-option>
  131. <el-option label="补交_已批改" value="补交_已批改"></el-option>
  132. </el-select>
  133. <el-select v-model="classFilter" placeholder="班级" class="filter-select" @change="handleClassFilterChange">
  134. <el-option label="全部" value=""></el-option>
  135. <el-option
  136. v-for="classItem in classList"
  137. :key="classItem.classId"
  138. :label="classItem.className"
  139. :value="classItem.classId.toString()"
  140. ></el-option>
  141. </el-select>
  142. <el-button type="primary" class="search-button">搜索</el-button>
  143. </div>
  144. </div>
  145. <!-- 学生作业表格 -->
  146. <div class="table-section">
  147. <el-table :data="filteredStudentList" class="student-table" stripe>
  148. <el-table-column prop="status" label="状态" width="230" align="left">
  149. <template #default="scope">
  150. <span :class="getStatusClass(scope.row.status)" class="status-badge">
  151. {{ statusMap[scope.row.status] || scope.row.status }}
  152. </span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column prop="stuName" label="学生姓名" width="230"></el-table-column>
  156. <el-table-column label="班级" width="230">
  157. <template #default="scope">
  158. {{ getStudentClassName(scope.row) }}
  159. </template>
  160. </el-table-column>
  161. <el-table-column prop="score" label="得分" width="230">
  162. <template #header>
  163. <div class="score-header" @click="toggleSort">
  164. <span>得分</span>
  165. <el-icon class="sort-icon" :class="getSortIconClass()">
  166. <Sort />
  167. </el-icon>
  168. </div>
  169. </template>
  170. <template #default="scope">
  171. <span :class="getScoreClass(scope.row)" class="score-badge">
  172. {{ getScoreDisplay(scope.row) }}
  173. </span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="备注" width="230">
  177. <template #default="scope">
  178. <span v-if="isLateSubmission(scope.row.status)" class="late-submission-badge">
  179. 补交
  180. </span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="操作" width="230">
  184. <template #default="scope">
  185. <el-button
  186. type="primary"
  187. size="small"
  188. class="action-button"
  189. :disabled="scope.row.status === 'NOT_SUBMITTED'"
  190. @click="handleCorrect(scope.row)"
  191. >
  192. <el-icon class="correct-icon"><ZoomIn /></el-icon>
  193. 批改
  194. </el-button>
  195. </template>
  196. </el-table-column>
  197. </el-table>
  198. </div>
  199. <div class="example-pagination-block">
  200. <el-pagination
  201. v-model:current-page="currentPage"
  202. :page-size="pageSize"
  203. layout="total, prev, pager, next"
  204. :total="total"
  205. :page-count="totalPages"
  206. @current-change="handleCurrentChange"
  207. />
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. <!-- 搜索弹窗 -->
  213. <el-dialog
  214. v-model="searchDialogVisible"
  215. title="搜索课程和作业"
  216. width="50%"
  217. :before-close="handleCloseSearchDialog"
  218. class="search-dialog"
  219. >
  220. <div class="search-dialog-container">
  221. <!-- 搜索框部分 -->
  222. <div class="dialog-search-section">
  223. <div class="dialog-search-input-container">
  224. <el-icon class="dialog-search-icon"><Search /></el-icon>
  225. <input
  226. type="text"
  227. placeholder="输入课程或作业名称..."
  228. class="dialog-search-input"
  229. v-model="searchQuery"
  230. @input="performSearch"
  231. ref="dialogSearchInput"
  232. />
  233. </div>
  234. </div>
  235. <!-- 搜索结果部分 -->
  236. <div class="search-results-section">
  237. <div v-if="searchResults.length === 0" class="no-results">
  238. <span>{{ searchQuery ? '没有找到相关结果' : '请输入搜索内容' }}</span>
  239. </div>
  240. <div v-else class="search-results-list">
  241. <div
  242. v-for="result in searchResults"
  243. :key="result.id"
  244. class="search-result-item"
  245. @click="handleSearchResultClick(result)"
  246. >
  247. <el-icon class="result-icon" v-if="result.type === 'course'">
  248. <Document />
  249. </el-icon>
  250. <el-icon class="result-icon assignment-result-icon" v-else>
  251. <Document />
  252. </el-icon>
  253. <div class="result-content">
  254. <div class="result-title">{{ result.name }}</div>
  255. <div class="result-path" v-if="result.type === 'assignment'">
  256. 课程: {{ result.courseName }}
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. </el-dialog>
  264. </div>
  265. </template>
  266. <script lang="ts" setup>
  267. import useApis from "@/apis";
  268. import {ref, reactive, computed, onMounted} from "vue";
  269. import {useRouter, useRoute} from "vue-router";
  270. import {Refresh, Search, Document, ArrowDown, ArrowRight, User, CircleCheck, WarningFilled, Sort, ZoomIn} from "@element-plus/icons-vue";
  271. import type {ClassDTO, StudentAssignmentStatusDTO} from "@/types/dto";
  272. import type {CourseVO, IAssignment} from "@/types/vo";
  273. import "./CoursePage.scss"
  274. import {useStore} from "@/store";
  275. const store = useStore()
  276. const router = useRouter()
  277. const route = useRoute()
  278. const apis = useApis()
  279. const selectedAssignment = ref(null)
  280. // 定义课程和作业的数据结构
  281. interface CourseWithAssignments {
  282. courseId: number;
  283. courseName: string;
  284. expanded: boolean;
  285. assignments: AssignmentWithStatus[];
  286. }
  287. interface AssignmentWithStatus {
  288. assignmentId: number;
  289. assignmentName: string;
  290. active: boolean;
  291. courseId: number;
  292. }
  293. // 真实数据 - 课程和作业列表
  294. const courseList = reactive<CourseWithAssignments[]>([])
  295. // 原始课程数据(从API获取)
  296. const rawCourses = reactive<CourseVO[]>([])
  297. // 原始作业数据(从API获取)
  298. const rawAssignments = reactive<IAssignment[]>([])
  299. // 加载状态
  300. const loading = ref(false)
  301. // 加载所有课程
  302. const loadCourses = async () => {
  303. try {
  304. loading.value = true
  305. // 使用正确的CourseQuery来获取所有课程
  306. const courseQuery = {
  307. courseId: null,
  308. teacherId: store.user.id,
  309. teacherPid: Number(store.user.pid),
  310. studentId: null,
  311. courseName: null,
  312. semester: null,
  313. }
  314. const response = await apis.getAllCourse(courseQuery, 1, 1000)
  315. if (response.data.code === 200) {
  316. // 根据其他代码,数据可能在response.data.data.records中
  317. const courseData = response.data.data.records || response.data.data.content || response.data.data
  318. console.log('加载到的课程数据 1:', courseData)
  319. rawCourses.splice(0, rawCourses.length, ...courseData)
  320. await loadAllAssignments()
  321. buildCourseTree()
  322. }
  323. } catch (error) {
  324. console.error('加载课程失败 :', error)
  325. } finally {
  326. loading.value = false
  327. }
  328. }
  329. // 加载所有作业
  330. const loadAllAssignments = async () => {
  331. try {
  332. // 使用正确的AssignmentQuery来获取所有作业
  333. const assignmentQuery = {
  334. assignmentId: null,
  335. teacherId: store.user.id,
  336. courseId: null,
  337. assignmentName: null,
  338. status: null,
  339. type: null,
  340. }
  341. const response = await apis.getAssignmentByQuery(assignmentQuery, 1, 1000)
  342. if (response.data.code === 200) {
  343. // 数据可能在不同的路径中
  344. const assignmentData = response.data.data.records || response.data.data.content || response.data.data
  345. console.log('加载到的作业数据:', assignmentData)
  346. rawAssignments.splice(0, rawAssignments.length, ...assignmentData)
  347. }
  348. } catch (error) {
  349. console.error('加载作业失败:', error)
  350. }
  351. }
  352. // 构建课程树结构
  353. const buildCourseTree = () => {
  354. const courseMap = new Map<number, CourseWithAssignments>()
  355. console.log('构建课程树 - 课程数量:', rawCourses.length, '作业数量:', rawAssignments.length)
  356. // 初始化课程
  357. rawCourses.forEach(course => {
  358. courseMap.set(course.courseId, {
  359. courseId: course.courseId,
  360. courseName: course.courseName,
  361. expanded: false,
  362. assignments: []
  363. })
  364. })
  365. // 添加作业到对应课程
  366. rawAssignments.forEach(assignment => {
  367. const course = courseMap.get(assignment.courseId)
  368. if (course) {
  369. course.assignments.push({
  370. assignmentId: assignment.assignmentId,
  371. assignmentName: assignment.assignmentName,
  372. active: false,
  373. courseId: assignment.courseId
  374. })
  375. }
  376. })
  377. // 更新courseList
  378. courseList.splice(0, courseList.length, ...Array.from(courseMap.values()))
  379. console.log('构建完成的课程树:', courseList.length, '个课程')
  380. }
  381. // 切换课程展开/收起
  382. const toggleCourse = (courseId: number) => {
  383. const course = courseList.find(c => c.courseId === courseId)
  384. if (course) {
  385. course.expanded = !course.expanded
  386. }
  387. }
  388. // 选择作业
  389. const selectAssignment = async (assignmentId: number) => {
  390. // 清除所有作业的active状态
  391. courseList.forEach(course => {
  392. course.assignments.forEach(assignment => {
  393. assignment.active = false
  394. })
  395. })
  396. // 设置选中的作业为active
  397. courseList.forEach(course => {
  398. const assignment = course.assignments.find(a => a.assignmentId === assignmentId)
  399. if (assignment) {
  400. assignment.active = true
  401. // 设置选中的作业信息
  402. selectedAssignment.value = {
  403. assignmentId: assignment.assignmentId,
  404. assignmentName: assignment.assignmentName,
  405. courseName: course.courseName,
  406. courseId: course.courseId
  407. }
  408. // 加载相关数据
  409. onAssignmentSelected({
  410. assignmentId: assignment.assignmentId,
  411. courseId: course.courseId
  412. })
  413. }
  414. })
  415. }
  416. // 搜索弹窗相关逻辑
  417. const searchDialogVisible = ref(false)
  418. const searchQuery = ref('')
  419. const searchResults = ref([])
  420. const dialogSearchInput = ref(null)
  421. // 筛选相关逻辑
  422. const filterQuery = ref('')
  423. const statusFilter = ref('')
  424. const classFilter = ref('')
  425. // 监听班级筛选变化
  426. const handleClassFilterChange = async () => {
  427. if (selectedAssignment.value && classFilter.value) {
  428. // 重新加载选中班级的学生数据
  429. studentList.splice(0, studentList.length)
  430. await loadStudentAssignmentStatus(classFilter.value, selectedAssignment.value.assignmentId.toString())
  431. } else if (selectedAssignment.value && !classFilter.value) {
  432. // 如果选择了"全部",重新加载所有班级的数据
  433. await loadAllStudentAssignmentStatus(selectedAssignment.value.assignmentId)
  434. }
  435. }
  436. // 排序相关逻辑
  437. const sortOrder = ref(0) // 0: 原始顺序, 1: 高到低, 2: 低到高
  438. // 学生数据
  439. const studentList = reactive<StudentAssignmentStatusDTO[]>([])
  440. // 班级列表数据
  441. const classList = reactive<ClassDTO[]>([])
  442. // 统计卡片数据
  443. const statsData = reactive({
  444. totalStudents: 0,
  445. correctedCount: 0,
  446. submittedNotCorrectedCount: 0,
  447. notSubmittedCount: 0
  448. })
  449. // 学生班级映射数据(用于存储学生ID到班级名称的映射)
  450. const studentClassMap = reactive(new Map<number, string>())
  451. // 状态映射
  452. const statusMap = {
  453. 'NOT_SUBMITTED': '未提交',
  454. 'SUBMITTED': '已提交未批改',
  455. 'CORRECTED': '已批改',
  456. 'LATE_SUBMITTED': '补交_未批改',
  457. 'LATE_SUBMITTED_CORRECTED': '补交_已批改'
  458. }
  459. // 当前页码
  460. const currentPage = ref(1)
  461. // 每页显示条数
  462. const pageSize = 10
  463. // 计算筛选后的学生列表(包含分页)
  464. const filteredStudentList = computed(() => {
  465. let filtered = [...studentList]
  466. // 筛选逻辑
  467. if (filterQuery.value) {
  468. filtered = filtered.filter(student =>
  469. student.stuName.toLowerCase().includes(filterQuery.value.toLowerCase())
  470. )
  471. }
  472. if (statusFilter.value) {
  473. filtered = filtered.filter(student => statusMap[student.status] === statusFilter.value)
  474. }
  475. if (classFilter.value) {
  476. // 根据选中的班级ID重新加载数据
  477. // 这里可以实现按班级筛选的逻辑
  478. // 暂时保持原有的筛选逻辑
  479. }
  480. // 排序逻辑
  481. if (sortOrder.value === 1) {
  482. // 高到低排序
  483. filtered.sort((a, b) => {
  484. const scoreA = getScoreForSort(a)
  485. const scoreB = getScoreForSort(b)
  486. return scoreB - scoreA
  487. })
  488. } else if (sortOrder.value === 2) {
  489. // 低到高排序
  490. filtered.sort((a, b) => {
  491. const scoreA = getScoreForSort(a)
  492. const scoreB = getScoreForSort(b)
  493. return scoreA - scoreB
  494. })
  495. }
  496. // sortOrder.value === 0 时保持原始顺序
  497. // 分页逻辑
  498. const startIndex = (currentPage.value - 1) * pageSize
  499. const endIndex = startIndex + pageSize
  500. return filtered.slice(startIndex, endIndex)
  501. })
  502. // 单独的计算属性来获取总页数
  503. const totalPages = computed(() => {
  504. let filtered = [...studentList]
  505. if (filterQuery.value) {
  506. filtered = filtered.filter(student =>
  507. student.stuName.toLowerCase().includes(filterQuery.value.toLowerCase())
  508. )
  509. }
  510. if (statusFilter.value) {
  511. filtered = filtered.filter(student => statusMap[student.status] === statusFilter.value)
  512. }
  513. if (classFilter.value) {
  514. // 根据选中的班级ID重新加载数据
  515. // 这里可以实现按班级筛选的逻辑
  516. // 暂时保持原有的筛选逻辑
  517. }
  518. return Math.ceil(filtered.length / pageSize)
  519. })
  520. // 总条目数
  521. const total = computed(() => {
  522. let filtered = [...studentList]
  523. if (filterQuery.value) {
  524. filtered = filtered.filter(student =>
  525. student.stuName.toLowerCase().includes(filterQuery.value.toLowerCase())
  526. )
  527. }
  528. if (statusFilter.value) {
  529. filtered = filtered.filter(student => statusMap[student.status] === statusFilter.value)
  530. }
  531. if (classFilter.value) {
  532. // 根据选中的班级ID重新加载数据
  533. // 这里可以实现按班级筛选的逻辑
  534. // 暂时保持原有的筛选逻辑
  535. }
  536. return filtered.length
  537. })
  538. // 重置筛选条件
  539. const resetFilters = () => {
  540. filterQuery.value = ''
  541. statusFilter.value = ''
  542. classFilter.value = ''
  543. sortOrder.value = 0
  544. currentPage.value = 1 // 重置页码
  545. // 重新加载所有数据并更新统计
  546. if (selectedAssignment.value) {
  547. loadAllStudentAssignmentStatus(selectedAssignment.value.assignmentId)
  548. }
  549. }
  550. // 处理页码改变
  551. const handleCurrentChange = (val: number) => {
  552. currentPage.value = val
  553. }
  554. // 获取用于排序的分数值
  555. const getScoreForSort = (student: StudentAssignmentStatusDTO) => {
  556. if ((student.status === 'CORRECTED' || student.status === 'LATE_SUBMITTED_CORRECTED') && student.score !== null) {
  557. return student.score
  558. } else if (student.status === 'SUBMITTED' || student.status === 'LATE_SUBMITTED') {
  559. return -1 // 未批改排在未提交前面
  560. } else {
  561. return -2 // 未提交排在最后
  562. }
  563. }
  564. // 切换排序状态
  565. const toggleSort = () => {
  566. sortOrder.value = (sortOrder.value + 1) % 3
  567. }
  568. // 获取排序图标样式
  569. const getSortIconClass = () => {
  570. return {
  571. 'sort-asc': sortOrder.value === 2,
  572. 'sort-desc': sortOrder.value === 1,
  573. 'sort-default': sortOrder.value === 0
  574. }
  575. }
  576. // 获取状态样式类
  577. const getStatusClass = (status: string) => {
  578. const mappedStatus = statusMap[status] || status
  579. return `status-${mappedStatus.replace(/[^a-zA-Z0-9]/g, '')}`
  580. }
  581. // 获取分数样式类
  582. const getScoreClass = (row: StudentAssignmentStatusDTO) => {
  583. if (row.status === 'NOT_SUBMITTED') return 'score-not-submitted'
  584. if (row.status === 'SUBMITTED' || row.status === 'LATE_SUBMITTED') return 'score-not-graded'
  585. if ((row.status === 'CORRECTED' || row.status === 'LATE_SUBMITTED_CORRECTED') && row.score !== null) {
  586. return row.score < 60 ? 'score-low' : 'score-high'
  587. }
  588. return ''
  589. }
  590. // 获取分数显示内容
  591. const getScoreDisplay = (row: StudentAssignmentStatusDTO) => {
  592. if (row.status === 'NOT_SUBMITTED') return '未提交'
  593. if (row.status === 'SUBMITTED' || row.status === 'LATE_SUBMITTED') return '未批改'
  594. if (row.status === 'CORRECTED' || row.status === 'LATE_SUBMITTED_CORRECTED') {
  595. return row.score !== null ? row.score : '未批改'
  596. }
  597. return '未批改'
  598. }
  599. // 判断是否为补交状态
  600. const isLateSubmission = (status: string) => {
  601. return status === 'LATE_SUBMITTED' || status === 'LATE_SUBMITTED_CORRECTED'
  602. }
  603. // 处理批改操作
  604. const handleCorrect = (row: StudentAssignmentStatusDTO) => {
  605. console.log('批改学生作业:', row)
  606. // 跳转到批改页面,路径为 home/assignment/:assignmentId/correct,并传递studentId参数
  607. if (selectedAssignment.value) {
  608. router.push({
  609. path: `/home/assignment/${selectedAssignment.value.assignmentId}/correct`,
  610. query: {
  611. studentId: row.studentId.toString()
  612. }
  613. })
  614. }
  615. }
  616. // 加载班级列表
  617. const loadClassList = async (courseId: number) => {
  618. try {
  619. const response = await apis.getClassesByCourse(courseId)
  620. if (response.data.code === 200) {
  621. classList.splice(0, classList.length, ...response.data.data)
  622. }
  623. } catch (error) {
  624. console.error('加载班级列表失败:', error)
  625. }
  626. }
  627. // 加载学生作业状态
  628. const loadStudentAssignmentStatus = async (classId: string, assignmentId: string) => {
  629. try {
  630. const response = await apis.getAssignmentStatusByClass(classId, assignmentId)
  631. if (response.data.code === 200) {
  632. // 获取班级名称
  633. const classItem = classList.find(c => c.classId.toString() === classId)
  634. const className = classItem ? classItem.className : '未知班级'
  635. // console.log(response.data.data)
  636. // 为每个学生建立班级映射关系
  637. response.data.data.forEach((student: StudentAssignmentStatusDTO) => {
  638. studentClassMap.set(student.studentId, className)
  639. })
  640. // 追加数据而不是替换
  641. studentList.push(...response.data.data)
  642. }
  643. } catch (error) {
  644. console.error('加载学生作业状态失败:', error)
  645. }
  646. }
  647. // 当选择作业时加载相关数据
  648. const onAssignmentSelected = async (assignment: any) => {
  649. if (assignment && assignment.courseId) {
  650. // 首先加载班级列表
  651. await loadClassList(assignment.courseId)
  652. // 加载所有班级的学生作业状态
  653. if (classList.length > 0) {
  654. await loadAllStudentAssignmentStatus(assignment.assignmentId)
  655. }
  656. }
  657. }
  658. // 加载所有班级的学生作业状态
  659. const loadAllStudentAssignmentStatus = async (assignmentId: number) => {
  660. try {
  661. // 清空现有学生数据
  662. studentList.splice(0, studentList.length)
  663. // 遍历所有班级,加载每个班级的学生数据
  664. for (const classItem of classList) {
  665. await loadStudentAssignmentStatus(classItem.classId.toString(), assignmentId.toString())
  666. }
  667. // 更新统计数据
  668. updateStatsData()
  669. } catch (error) {
  670. console.error('加载所有学生作业状态失败:', error)
  671. }
  672. }
  673. // 获取学生班级名称
  674. const getStudentClassName = (student: StudentAssignmentStatusDTO) => {
  675. // 由于StudentAssignmentStatusDTO中没有班级信息,我们需要通过其他方式获取
  676. // 这里暂时返回一个默认值,实际项目中可能需要通过API获取学生班级信息
  677. return studentClassMap.get(student.studentId) || '未知班级'
  678. }
  679. // 更新统计数据
  680. const updateStatsData = () => {
  681. console.log(studentList)
  682. const total = studentList.length
  683. const corrected = studentList.filter(student =>
  684. student.status === 'CORRECTED' || student.status === 'LATE_SUBMITTED_CORRECTED'
  685. ).length
  686. const submittedNotCorrected = studentList.filter(student =>
  687. student.status === 'SUBMITTED' || student.status === 'LATE_SUBMITTED'
  688. ).length
  689. const notSubmitted = studentList.filter(student => student.status === 'NOT_SUBMITTED').length
  690. statsData.totalStudents = total
  691. statsData.correctedCount = corrected
  692. statsData.submittedNotCorrectedCount = submittedNotCorrected
  693. statsData.notSubmittedCount = notSubmitted
  694. }
  695. const openSearchDialog = () => {
  696. searchDialogVisible.value = true
  697. // 延迟聚焦,确保对话框渲染完成
  698. setTimeout(() => {
  699. if (dialogSearchInput.value) {
  700. dialogSearchInput.value.focus()
  701. }
  702. }, 100)
  703. }
  704. const handleCloseSearchDialog = (done) => {
  705. searchQuery.value = ''
  706. searchResults.value = []
  707. done()
  708. }
  709. const performSearch = () => {
  710. const query = searchQuery.value.trim().toLowerCase()
  711. if (!query) {
  712. searchResults.value = []
  713. return
  714. }
  715. const results = []
  716. // 搜索课程和作业
  717. courseList.forEach(course => {
  718. // 搜索课程
  719. if (course.courseName.toLowerCase().includes(query)) {
  720. results.push({
  721. id: course.courseId,
  722. name: course.courseName,
  723. type: 'course'
  724. })
  725. }
  726. // 搜索作业
  727. course.assignments.forEach(assignment => {
  728. if (assignment.assignmentName.toLowerCase().includes(query)) {
  729. results.push({
  730. id: assignment.assignmentId,
  731. name: assignment.assignmentName,
  732. courseName: course.courseName,
  733. type: 'assignment'
  734. })
  735. }
  736. })
  737. })
  738. searchResults.value = results
  739. }
  740. const handleSearchResultClick = (result) => {
  741. if (result.type === 'course') {
  742. // 展开对应的课程
  743. const course = courseList.find(c => c.courseId === result.id)
  744. if (course) {
  745. course.expanded = true
  746. }
  747. } else {
  748. // 选中对应的作业并展开对应课程
  749. courseList.forEach(course => {
  750. const assignment = course.assignments.find(a => a.assignmentId === result.id)
  751. if (assignment) {
  752. course.expanded = true
  753. }
  754. })
  755. selectAssignment(result.id)
  756. }
  757. // 关闭弹窗
  758. searchDialogVisible.value = false
  759. searchQuery.value = ''
  760. searchResults.value = []
  761. }
  762. // 自动选中课程和作业的函数
  763. const autoSelectFromRoute = () => {
  764. const courseIdFromRoute = route.query.courseId
  765. const assignmentIdFromRoute = route.query.assignmentId
  766. const fromCorrect = route.query.fromCorrect
  767. if (fromCorrect && courseIdFromRoute && assignmentIdFromRoute) {
  768. const courseId = Number(courseIdFromRoute)
  769. const assignmentId = Number(assignmentIdFromRoute)
  770. console.log('准备自动选中:', { courseId, assignmentId })
  771. // 使用递归检查数据是否加载完成
  772. const checkAndSelect = (attempts = 0) => {
  773. if (attempts > 20) { // 最多尝试20次,避免无限循环
  774. console.warn('自动选中超时,数据可能未加载完成')
  775. return
  776. }
  777. const course = courseList.find(c => c.courseId === courseId)
  778. if (course && course.assignments.length > 0) {
  779. // 数据已加载,执行选中
  780. course.expanded = true
  781. // 确保作业存在
  782. const assignment = course.assignments.find(a => a.assignmentId === assignmentId)
  783. if (assignment) {
  784. selectAssignment(assignmentId)
  785. console.log('自动选中成功:', { courseName: course.courseName, assignmentName: assignment.assignmentName })
  786. // 清理URL参数,避免刷新时重复执行
  787. router.replace({
  788. name: 'myCorrectWithCourse'
  789. })
  790. } else {
  791. console.warn('未找到指定的作业:', assignmentId)
  792. }
  793. } else {
  794. // 数据未加载完成,继续等待
  795. setTimeout(() => checkAndSelect(attempts + 1), 200)
  796. }
  797. }
  798. checkAndSelect()
  799. }
  800. }
  801. // 组件挂载时加载数据
  802. onMounted(async () => {
  803. await loadCourses()
  804. // 检查是否需要自动选中
  805. autoSelectFromRoute()
  806. })
  807. </script>
  808. <script lang="ts">
  809. export default {
  810. name: "CoursePage"
  811. }
  812. </script>
  813. <style scoped>
  814. .course-page {
  815. display: flex;
  816. height: 95vh;
  817. background-color: #f5f5f5;
  818. font-family: "Noto Sans SC", sans-serif;
  819. }
  820. .left-sidebar {
  821. width: 280px;
  822. background-color: #F0F2F5;
  823. border-right: 1px solid #e8e8e8;
  824. display: flex;
  825. flex-direction: column;
  826. height: 100vh;
  827. flex-shrink: 0; /* 防止侧边栏被压缩 */
  828. }
  829. .platform-header {
  830. height: 60px;
  831. background-color: #F0F2F5;
  832. border-bottom: 1px solid #e8e8e8;
  833. display: flex;
  834. align-items: center;
  835. justify-content: center;
  836. padding: 0 20px;
  837. }
  838. .platform-name {
  839. color: #606266;
  840. font-size: 24px;
  841. font-weight: 400;
  842. font-family: "Noto Sans SC", sans-serif;
  843. }
  844. .search-section {
  845. padding: 16px 20px;
  846. border-bottom: 1px solid #e8e8e8;
  847. background-color: #F0F2F5;
  848. }
  849. .search-input-container {
  850. position: relative;
  851. display: flex;
  852. align-items: center;
  853. font-family: "Noto Sans SC", sans-serif;
  854. }
  855. .search-icon {
  856. position: absolute;
  857. left: 12px;
  858. color: #999;
  859. font-size: 16px;
  860. }
  861. .search-input {
  862. width: 100%;
  863. height: 36px;
  864. padding: 0 12px 0 36px;
  865. border: 1px solid #d9d9d9;
  866. border-radius: 6px;
  867. font-size: 14px;
  868. outline: none;
  869. background-color: #FFFFFF;
  870. font-family: "Noto Sans SC", sans-serif;
  871. }
  872. .search-input:focus {
  873. border-color: #1890ff;
  874. background-color: white;
  875. }
  876. .menu-section {
  877. flex: 1;
  878. overflow-y: auto;
  879. overflow-x: hidden; /* 防止水平滚动 */
  880. padding: 0;
  881. height: calc(100vh - 120px);
  882. width: 100%; /* 确保宽度不超过父容器 */
  883. }
  884. .menu-item {
  885. margin-bottom: 0px;
  886. }
  887. .course-header {
  888. display: flex;
  889. align-items: center;
  890. padding: 12px 20px;
  891. cursor: pointer;
  892. transition: background-color 0.2s;
  893. font-family: "Noto Sans SC", sans-serif;
  894. background-color: #F0F2F5;
  895. color: #606266;
  896. }
  897. .course-header:hover {
  898. background-color: #FFFFFF;
  899. }
  900. .expand-icon {
  901. font-size: 12px;
  902. color: #666;
  903. margin-right: 8px;
  904. transition: transform 0.2s;
  905. }
  906. .expand-icon.expanded {
  907. transform: rotate(0deg);
  908. }
  909. .course-icon {
  910. font-size: 16px;
  911. color: #666;
  912. margin-right: 8px;
  913. }
  914. .course-name {
  915. font-size: 14px;
  916. color: #606266;
  917. font-weight: 500;
  918. font-family: "Noto Sans SC", sans-serif;
  919. }
  920. .assignment-list {
  921. background-color: #fafafa;
  922. }
  923. .assignment-item {
  924. display: flex;
  925. align-items: center;
  926. padding: 8px 20px 8px 48px;
  927. cursor: pointer;
  928. transition: background-color 0.2s;
  929. font-family: "Noto Sans SC", sans-serif;
  930. background-color: #F0F2F5;
  931. color: #606266;
  932. white-space: nowrap; /* 防止文本换行 */
  933. overflow: hidden; /* 隐藏超出部分 */
  934. text-overflow: ellipsis; /* 显示省略号 */
  935. }
  936. .assignment-item:hover {
  937. background-color: #FFFFFF;
  938. }
  939. .assignment-item.active {
  940. background-color: rgba(112, 187, 219, 0.50);
  941. border-radius: 10px;
  942. opacity: 0.8;
  943. }
  944. .assignment-icon {
  945. font-size: 14px;
  946. color: #606266;
  947. margin-right: 8px;
  948. }
  949. .assignment-icon.active-icon {
  950. color: #435FE9;
  951. }
  952. .assignment-name {
  953. font-size: 13px;
  954. font-weight: 500;
  955. color: #606266;
  956. font-family: "Noto Sans SC", sans-serif;
  957. flex: 1;
  958. overflow: hidden;
  959. text-overflow: ellipsis;
  960. white-space: nowrap;
  961. }
  962. .assignment-item.active .assignment-name {
  963. color: #435FE9;
  964. font-weight: 500;
  965. }
  966. /* 加载状态样式 */
  967. .loading-container {
  968. display: flex;
  969. justify-content: center;
  970. align-items: center;
  971. padding: 20px;
  972. }
  973. .loading-text {
  974. color: #606266;
  975. font-size: 14px;
  976. font-family: "Noto Sans SC", sans-serif;
  977. }
  978. .right-content {
  979. flex: 1;
  980. background-color: white;
  981. padding: 20px;
  982. height: 100vh;
  983. }
  984. /* 空白状态样式 */
  985. .empty-state {
  986. height: 100%;
  987. display: flex;
  988. align-items: center;
  989. justify-content: center;
  990. }
  991. .empty-content {
  992. text-align: center;
  993. color: #999;
  994. }
  995. .empty-icon {
  996. font-size: 64px;
  997. color: #d9d9d9;
  998. margin-bottom: 16px;
  999. }
  1000. .empty-text {
  1001. font-size: 16px;
  1002. font-family: "Noto Sans SC", sans-serif;
  1003. }
  1004. /* 作业内容样式 */
  1005. .assignment-content {
  1006. height: 100%;
  1007. display: flex;
  1008. flex-direction: column;
  1009. }
  1010. /* 右上角按钮样式 */
  1011. .top-actions {
  1012. display: flex;
  1013. justify-content: flex-end;
  1014. margin-bottom: 10px;
  1015. }
  1016. .dashboard-button {
  1017. background-color: #4A90C4;
  1018. border-color: #4A90C4;
  1019. border-radius: 4px;
  1020. padding: 6px 12px;
  1021. font-size: 12px;
  1022. font-family: "Noto Sans SC", sans-serif;
  1023. }
  1024. /* 统计卡片区域样式 */
  1025. .stats-container {
  1026. display: flex;
  1027. justify-content: space-around;
  1028. align-items: center;
  1029. margin-bottom: 5px;
  1030. padding: 0;
  1031. gap: 16px;
  1032. }
  1033. .stats-card {
  1034. display: flex;
  1035. align-items: center;
  1036. background: white;
  1037. border-radius: 8px;
  1038. padding: 16px;
  1039. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  1040. min-width: 180px;
  1041. max-width: 220px;
  1042. }
  1043. .stats-icon {
  1044. width: 48px;
  1045. height: 48px;
  1046. border-radius: 8px;
  1047. display: flex;
  1048. align-items: center;
  1049. justify-content: center;
  1050. margin-right: 12px;
  1051. font-size: 24px;
  1052. color: white;
  1053. }
  1054. .user-icon {
  1055. background-color: #70BBD9;
  1056. }
  1057. .completed-icon {
  1058. background-color: #90D7B4;
  1059. }
  1060. .pending-icon {
  1061. background-color: #B8B8B8;
  1062. }
  1063. .not-submitted-icon {
  1064. background-color: #F5A658;
  1065. }
  1066. .stats-content {
  1067. flex: 1;
  1068. }
  1069. .stats-label {
  1070. font-size: 14px;
  1071. color: #666;
  1072. margin-bottom: 4px;
  1073. font-family: "Noto Sans SC", sans-serif;
  1074. }
  1075. .stats-value {
  1076. font-size: 24px;
  1077. font-weight: 600;
  1078. color: #333;
  1079. font-family: "Noto Sans SC", sans-serif;
  1080. }
  1081. .assignment-body {
  1082. flex: 1;
  1083. padding: 20px 0;
  1084. }
  1085. /* 作业标题区域 */
  1086. .assignment-title-section {
  1087. margin-bottom: 20px;
  1088. }
  1089. .assignment-full-title {
  1090. font-size: 18px;
  1091. font-weight: 600;
  1092. color: #333;
  1093. margin: 0;
  1094. font-family: "Noto Sans SC", sans-serif;
  1095. }
  1096. /* 筛选区域样式 */
  1097. .filter-section {
  1098. margin-bottom: 20px;
  1099. }
  1100. .filter-controls {
  1101. display: flex;
  1102. align-items: center;
  1103. gap: 12px;
  1104. }
  1105. .reset-icon {
  1106. font-size: 18px;
  1107. color: #666;
  1108. cursor: pointer;
  1109. padding: 8px;
  1110. border-radius: 4px;
  1111. transition: background-color 0.2s;
  1112. }
  1113. .reset-icon:hover {
  1114. background-color: #f5f5f5;
  1115. }
  1116. .search-input-wrapper {
  1117. flex: 1;
  1118. max-width: 300px;
  1119. }
  1120. .filter-search-input {
  1121. width: 90%;
  1122. height: 32px;
  1123. padding: 0 12px;
  1124. border: 1px solid #d9d9d9;
  1125. border-radius: 4px;
  1126. font-size: 14px;
  1127. outline: none;
  1128. font-family: "Noto Sans SC", sans-serif;
  1129. }
  1130. .filter-search-input:focus {
  1131. border-color: #4A90C4;
  1132. }
  1133. .filter-select {
  1134. width: 120px;
  1135. }
  1136. .search-button {
  1137. background-color: #4A90C4;
  1138. border-color: #4A90C4;
  1139. font-family: "Noto Sans SC", sans-serif;
  1140. }
  1141. /* 表格区域样式 */
  1142. .table-section {
  1143. margin-bottom: 20px;
  1144. }
  1145. .student-table {
  1146. width: 100%;
  1147. font-family: "Noto Sans SC", sans-serif;
  1148. }
  1149. /* 状态标签样式 */
  1150. .status-badge {
  1151. padding: 4px 8px;
  1152. border-radius: 4px;
  1153. font-size: 12px;
  1154. font-weight: 500;
  1155. display: inline-block;
  1156. width: 100%;
  1157. text-align: left;
  1158. font-family: "Noto Sans SC", sans-serif;
  1159. }
  1160. /* 状态列单元格左对齐 */
  1161. .student-table .el-table__cell {
  1162. text-align: left !important;
  1163. }
  1164. .student-table .el-table__header-wrapper .el-table__cell {
  1165. text-align: left !important;
  1166. }
  1167. .status-未提交 {
  1168. background-color: #F4A261;
  1169. color: white;
  1170. }
  1171. .status-已提交未批改 {
  1172. background-color: #D9D9D9;
  1173. color: #666;
  1174. }
  1175. .status-已批改 {
  1176. background-color: #7ADBB0;
  1177. color: white;
  1178. }
  1179. .status-补交未批改 {
  1180. background-color: #F2A947;
  1181. color: white;
  1182. }
  1183. .status-补交已批改 {
  1184. background-color: #52C41A;
  1185. color: white;
  1186. }
  1187. /* 分数标签样式 */
  1188. .score-badge {
  1189. padding: 4px 8px;
  1190. border-radius: 4px;
  1191. font-size: 12px;
  1192. font-weight: 500;
  1193. display: inline-block;
  1194. min-width: 60px;
  1195. text-align: center;
  1196. font-family: "Noto Sans SC", sans-serif;
  1197. }
  1198. .score-not-submitted {
  1199. background-color: #F4A261;
  1200. color: white;
  1201. }
  1202. .score-not-graded {
  1203. background-color: #D9D9D9;
  1204. color: #666;
  1205. }
  1206. .score-low {
  1207. background-color: #F0C05A;
  1208. color: white;
  1209. }
  1210. .score-high {
  1211. background-color: #7ADBB0;
  1212. color: white;
  1213. }
  1214. /* 操作按钮样式 */
  1215. .action-button {
  1216. width: 60px;
  1217. height: 30px;
  1218. border-radius: 4px;
  1219. background-color: #4A90C4;
  1220. border-color: #4A90C4;
  1221. padding: 4px 8px;
  1222. font-size: 13px;
  1223. font-family: "Noto Sans SC", sans-serif;
  1224. }
  1225. /* 禁用状态的按钮样式 */
  1226. .action-button:disabled {
  1227. background-color: #f5f5f5;
  1228. border-color: #d9d9d9;
  1229. color: #bfbfbf;
  1230. cursor: not-allowed;
  1231. }
  1232. .action-button:disabled .correct-icon {
  1233. color: #bfbfbf;
  1234. }
  1235. /* 批改按钮图标样式 */
  1236. .correct-icon {
  1237. font-size: 16px;
  1238. margin-right: 4px;
  1239. }
  1240. /* 排序头部样式 */
  1241. .score-header {
  1242. display: flex;
  1243. align-items: center;
  1244. justify-content: space-between;
  1245. cursor: pointer;
  1246. user-select: none;
  1247. font-family: "Noto Sans SC", sans-serif;
  1248. }
  1249. .sort-icon {
  1250. font-size: 14px;
  1251. color: #999;
  1252. transition: color 0.2s;
  1253. }
  1254. .sort-icon.sort-asc {
  1255. color: #4A90C4;
  1256. transform: rotate(0deg);
  1257. }
  1258. .sort-icon.sort-desc {
  1259. color: #4A90C4;
  1260. transform: rotate(180deg);
  1261. }
  1262. .sort-icon.sort-default {
  1263. color: #999;
  1264. }
  1265. .score-header:hover .sort-icon {
  1266. color: #4A90C4;
  1267. }
  1268. /* 补交标识样式 */
  1269. .late-submission-badge {
  1270. padding: 4px 8px;
  1271. background-color: #C45C4A;
  1272. color: white;
  1273. border-radius: 4px;
  1274. font-size: 12px;
  1275. font-weight: 500;
  1276. display: inline-block;
  1277. min-width: 60px;
  1278. text-align: center;
  1279. font-family: "Noto Sans SC", sans-serif;
  1280. }
  1281. /* 搜索弹窗样式 */
  1282. .search-dialog-container {
  1283. display: flex;
  1284. flex-direction: column;
  1285. height: 60vh;
  1286. }
  1287. .dialog-search-section {
  1288. padding-bottom: 16px;
  1289. border-bottom: 1px solid #e8e8e8;
  1290. margin-bottom: 16px;
  1291. }
  1292. .dialog-search-input-container {
  1293. position: relative;
  1294. display: flex;
  1295. align-items: center;
  1296. font-family: "Noto Sans SC", sans-serif;
  1297. }
  1298. .dialog-search-icon {
  1299. position: absolute;
  1300. left: 12px;
  1301. color: #999;
  1302. font-size: 18px;
  1303. }
  1304. .dialog-search-input {
  1305. width: 100%;
  1306. height: 40px;
  1307. padding: 0 12px 0 40px;
  1308. border: 1px solid #d9d9d9;
  1309. border-radius: 6px;
  1310. font-size: 16px;
  1311. outline: none;
  1312. background-color: #FFFFFF;
  1313. font-family: "Noto Sans SC", sans-serif;
  1314. }
  1315. .dialog-search-input:focus {
  1316. border-color: #1890ff;
  1317. }
  1318. .search-results-section {
  1319. flex: 1;
  1320. overflow-y: auto;
  1321. }
  1322. .no-results {
  1323. height: 100%;
  1324. display: flex;
  1325. align-items: center;
  1326. justify-content: center;
  1327. color: #999;
  1328. font-size: 14px;
  1329. font-family: "Noto Sans SC", sans-serif;
  1330. }
  1331. .search-results-list {
  1332. height: 100%;
  1333. overflow-y: auto;
  1334. }
  1335. .search-result-item {
  1336. display: flex;
  1337. align-items: center;
  1338. padding: 12px 16px;
  1339. cursor: pointer;
  1340. border-bottom: 1px solid #e8e8e8;
  1341. transition: background-color 0.2s;
  1342. font-family: "Noto Sans SC", sans-serif;
  1343. }
  1344. .search-result-item:hover {
  1345. background-color: #F0F2F5;
  1346. }
  1347. .result-icon {
  1348. font-size: 18px;
  1349. color: #606266;
  1350. margin-right: 12px;
  1351. }
  1352. .assignment-result-icon {
  1353. font-size: 16px;
  1354. margin-left: 16px;
  1355. }
  1356. .result-content {
  1357. flex: 1;
  1358. display: flex;
  1359. flex-direction: column;
  1360. }
  1361. .result-title {
  1362. font-size: 14px;
  1363. font-weight: 500;
  1364. color: #606266;
  1365. font-family: "Noto Sans SC", sans-serif;
  1366. }
  1367. .result-path {
  1368. font-size: 12px;
  1369. color: #999;
  1370. margin-top: 4px;
  1371. font-family: "Noto Sans SC", sans-serif;
  1372. }
  1373. .example-pagination-block {
  1374. margin-top: 10px;
  1375. }
  1376. </style>