Parcourir la source

修复了bug第三项,最后差一个响应式布局没有搞

Jiang Pengyu il y a 8 mois
Parent
commit
1c7ebb8dc7

+ 4 - 2
src/apis/evaluation.ts

@@ -8,7 +8,8 @@ const evaluationApis = {
             params: {
                 assignmentId,
                 studentId
-            }
+            },
+            timeout: 40000 // 设置超时时间为 40 秒
         })
     },
     sentenceEvaluation(assignmentId: number, studentId: number){
@@ -16,7 +17,8 @@ const evaluationApis = {
             params: {
                 assignmentId,
                 studentId
-            }
+            },
+            timeout: 40000 // 设置超时时间为 40 秒
         })
     },
     getOverall(assignmentId: number, studentId: number, version: number){

+ 2 - 0
src/views/Home/component/Edit/index.vue

@@ -114,6 +114,8 @@
       console.log(props)
       const _res = await apis.engagementStage(store.user.id, props.engagement.assignmentId, JSON.stringify(getQuillContent), getText.value, getHTML.value);
       emitter.emit('click-stage');
+      // 通知 Silder 组件暂存成功,可以启用批改按钮
+      emitter.emit('stage-success');
       success(_res.data.data);
       return _res;
     } catch (error) {

+ 41 - 10
src/views/Home/component/Silder/index.scss

@@ -35,7 +35,6 @@
     flex-direction: column;
     gap: 20px;
     margin-top: 20px;
-    cursor: pointer;
     padding: 0 15px 15px 15px;
     box-sizing: border-box;
     height: 100%;
@@ -61,21 +60,52 @@
 
   .capacity-item {
     width: 100%;
-    height: 40vh;
-    background-color: #d9d9d9;
-    border-radius: 10px;
+    height: 48vh;
+    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
+    border-radius: 12px;
+    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
+    transition: all 0.3s ease;
+
+    &:hover {
+      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
+    }
 
     .remark {
       box-sizing: border-box;
       width: 100%;
       height: 100%;
-      //max-height: 70vh;
-      border-radius: 10px;
-      overflow-y: auto; /* 添加垂直滚动 */
+      border-radius: 12px;
+      overflow-y: auto; /* 垂直方向滚动 */
+      overflow-x: hidden; /* 隐藏水平滚动条 */
       white-space: pre-wrap; /* 保留换行和空格,允许自动换行 */
-      //background-color: #f0f0f0;
-      padding: 10px;
-      //background-color: rgba(255, 75, 75, 0.3);
+      word-wrap: break-word; /* 长单词自动换行 */
+      word-break: break-word; /* 确保单词在边界处断开 */
+      padding: 16px;
+      line-height: 1.8; /* 增加行高,提高可读性 */
+      color: #2c3e50; /* 深色文字,提高对比度 */
+      font-size: 14px;
+      background-color: rgba(255, 255, 255, 0.6); /* 半透明白色背景 */
+      backdrop-filter: blur(10px); /* 毛玻璃效果 */
+      
+      /* 自定义滚动条样式 */
+      &::-webkit-scrollbar {
+        width: 6px;
+      }
+      
+      &::-webkit-scrollbar-track {
+        background: rgba(0, 0, 0, 0.05);
+        border-radius: 10px;
+      }
+      
+      &::-webkit-scrollbar-thumb {
+        background: rgba(74, 144, 196, 0.5);
+        border-radius: 10px;
+        transition: background 0.3s ease;
+        
+        &:hover {
+          background: rgba(74, 144, 196, 0.8);
+        }
+      }
     }
   }
 
@@ -92,6 +122,7 @@
   background-color: #d9d9d9;
   border-radius: 100px;
   box-shadow: rgba(0, 0, 0, 0.1) 0 4px 10px;
+  cursor: pointer;
 }
 
 .edit-text {

+ 19 - 4
src/views/Home/component/Silder/index.vue

@@ -54,7 +54,7 @@
 </template>
 
 <script lang="ts" setup>
-import {defineProps, nextTick, onMounted, reactive, ref, watch, watchEffect} from 'vue'
+import {defineProps, nextTick, onMounted, onUnmounted, reactive, ref, watch, watchEffect} from 'vue'
   import "./index.scss"
 import type {engagementVO, IAssignment} from "@/types/vo";
   import useApis from "@/apis";
@@ -66,6 +66,7 @@ import {useRoute} from "vue-router";
 import {ElMessage} from "element-plus";
 import router from "@/router";
 import * as path from "node:path";
+import emitter from "@/utils/emitter";
 
 
   interface IPreviewProps {
@@ -183,7 +184,9 @@ import * as path from "node:path";
   const handleCorrectToPage = () => {
     router.push({
       path: `/home/assignment/${props.engagement.assignmentId}/AIEvaluation`,
-    })
+    }).then(() => {
+      window.location.reload()
+    });
   }
 
   const openEditor = (url: string, title: string) => {
@@ -251,13 +254,13 @@ import * as path from "node:path";
   // 使用节流包装 handleCorrectTip
   const handleCorrectTip = throttle(() => {
     if(!showCorrectBtn.value) {
-      ElMessage.error("请更新作文内容并暂存后批改");
+      ElMessage.info("请更新作文内容并暂存后批改");
     }
   }, 2000); // 2秒的节流时间
 
   const handleCorrectToPageTip = throttle(() => {
     if(!showCorrectToPageBtn.value)
-      ElMessage.error("批改后查看报告")
+      ElMessage.info("批改后查看报告")
   },1000);
 
   // 监听props变化
@@ -267,9 +270,21 @@ import * as path from "node:path";
     }
   }, { immediate: true });
 
+  // 监听暂存成功事件
+  emitter.on('stage-success', () => {
+    console.log('收到暂存成功事件,启用批改按钮')
+    // 暂存成功后,启用"开始批改"按钮
+    showCorrectBtn.value = true
+  })
+
   onMounted(() => {
     fetchData()
   });
+
+  onUnmounted(() => {
+    // 清理事件监听器
+    emitter.off('stage-success');
+  });
 </script>
 
 <script lang="ts">