Browse Source

把教师批改页面进行响应式改造,再测试一下

Jiang Pengyu 9 months ago
parent
commit
6ce02a0991
2 changed files with 350 additions and 180 deletions
  1. 28 14
      src/views/CorrectPage/CorrectPage.vue
  2. 322 166
      src/views/CorrectPage/index.scss

+ 28 - 14
src/views/CorrectPage/CorrectPage.vue

@@ -226,30 +226,33 @@
     </div>
     
     <!-- 行为记录对话框 -->
-        <el-dialog v-model="showDialog" title="文件信息">
-
-      <el-table :data="fileList" stripe>
-        <el-table-column prop="id" label="ID"></el-table-column>
-        <el-table-column prop="assignmentId" label="作业 ID"></el-table-column>
-        <el-table-column prop="recordFileUrl" label="文件链接 (复制粘贴到浏览器中打开)" width="300px">
+    <el-dialog 
+      v-model="showDialog" 
+      title="文件信息"
+      :width="dialogWidth"
+      class="behavior-dialog"
+    >
+      <el-table :data="fileList" stripe class="behavior-table">
+        <el-table-column prop="id" label="ID" min-width="60"></el-table-column>
+        <el-table-column prop="assignmentId" label="作业 ID" min-width="80"></el-table-column>
+        <el-table-column prop="recordFileUrl" label="文件链接" min-width="200">
           <template #default="scope">
-            <!-- <a :href="scope.row.recordFileUrl" target="_blank">{{ scope.row.recordFileUrl }}</a> -->
-            <span>{{ scope.row.recordFileUrl }}</span>
+            <span class="file-url">{{ scope.row.recordFileUrl }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="createdAt" label="时间">
+        <el-table-column prop="createdAt" label="时间" min-width="150">
           <template #default="scope">
-            {{ formatDateTime(scope.row.createdAt) }} <!-- 调用格式化函数 -->
+            {{ formatDateTime(scope.row.createdAt) }}
           </template>
         </el-table-column>
-        <el-table-column prop="studentId" label="学生 ID"></el-table-column>
+        <el-table-column prop="studentId" label="学生 ID" min-width="80"></el-table-column>
       </el-table>
 
       <template #footer>
-      <el-button @click="showDialog = false">取消</el-button>
-      <el-button type="primary" @click="downloadAllFiles">导出</el-button>
+        <el-button @click="showDialog = false">取消</el-button>
+        <el-button type="primary" @click="downloadAllFiles">导出</el-button>
       </template>
-      </el-dialog>
+    </el-dialog>
       
     <!-- 评语模板对话框 -->
     <el-dialog
@@ -379,6 +382,17 @@ const studentAnswer = ref('')
 // 课程ID(用于返回时保持菜单选中状态)
 const courseId = ref(0)
 
+// 响应式对话框宽度
+const dialogWidth = computed(() => {
+  if (window.innerWidth <= 767) {
+    return '95%'
+  } else if (window.innerWidth <= 1023) {
+    return '80%'
+  } else {
+    return '50%'
+  }
+})
+
 // 格式化消息数据用于显示
 const formattedMessages = ref<IDialogue[]>([])
 

File diff suppressed because it is too large
+ 322 - 166
src/views/CorrectPage/index.scss


Some files were not shown because too many files changed in this diff