Explorar el Código

Merge branch 'refactor-admin' of http://gogs.seec.seecoder.cn/FanYanPeng/EAIFrontend into refactor-admin

chenjiayao hace 1 año
padre
commit
ef553a84ca

+ 37 - 6
package-lock.json

@@ -10,7 +10,7 @@
       "dependencies": {
         "@onlyoffice/document-editor-vue": "^1.4.0",
         "@vue-office/docx": "^1.6.2",
-        "@vueup/vue-quill": "^1.0.0-alpha.40",
+        "@vueup/vue-quill": "^1.2.0",
         "axios": "^1.7.2",
         "dayjs": "^1.11.13",
         "docx-preview": "^0.3.2",
@@ -1614,15 +1614,33 @@
       "dev": true
     },
     "node_modules/@vueup/vue-quill": {
-      "version": "1.0.0-alpha.40",
-      "resolved": "https://registry.npmmirror.com/@vueup/vue-quill/-/vue-quill-1.0.0-alpha.40.tgz",
-      "integrity": "sha512-Cn6li+LxOiPQSvmZE+F9jKGsemksQq2VDfTBdgFIlNfNv3+BcBN+DblQstj9NDV5BBF97BHmM2dk7E84yYJI+Q==",
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/@vueup/vue-quill/-/vue-quill-1.2.0.tgz",
+      "integrity": "sha512-kd5QPSHMDpycklojPXno2Kw2JSiKMYduKYQckTm1RJoVDA557MnyUXgcuuDpry4HY/Rny9nGNcK+m3AHk94wag==",
+      "license": "MIT",
       "dependencies": {
         "quill": "^1.3.7",
-        "quill-delta": "^3.6.3"
+        "quill-delta": "^4.2.2"
       },
       "peerDependencies": {
-        "vue": "^3.0.11"
+        "vue": "^3.2.41"
+      }
+    },
+    "node_modules/@vueup/vue-quill/node_modules/fast-diff": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/fast-diff/-/fast-diff-1.2.0.tgz",
+      "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+      "license": "Apache-2.0"
+    },
+    "node_modules/@vueup/vue-quill/node_modules/quill-delta": {
+      "version": "4.2.2",
+      "resolved": "https://registry.npmmirror.com/quill-delta/-/quill-delta-4.2.2.tgz",
+      "integrity": "sha512-qjbn82b/yJzOjstBgkhtBjN2TNK+ZHP/BgUQO+j6bRhWQQdmj2lH6hXG7+nwwLF41Xgn//7/83lxs9n2BkTtTg==",
+      "license": "MIT",
+      "dependencies": {
+        "fast-diff": "1.2.0",
+        "lodash.clonedeep": "^4.5.0",
+        "lodash.isequal": "^4.5.0"
       }
     },
     "node_modules/@vueuse/core": {
@@ -3141,6 +3159,19 @@
         "lodash-es": "*"
       }
     },
+    "node_modules/lodash.clonedeep": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmmirror.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
+      "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==",
+      "license": "MIT"
+    },
+    "node_modules/lodash.isequal": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmmirror.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
+      "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
+      "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.",
+      "license": "MIT"
+    },
     "node_modules/lodash.merge": {
       "version": "4.6.2",
       "resolved": "https://registry.npmmirror.com/lodash.merge/-/lodash.merge-4.6.2.tgz",

+ 1 - 1
package.json

@@ -14,7 +14,7 @@
   "dependencies": {
     "@onlyoffice/document-editor-vue": "^1.4.0",
     "@vue-office/docx": "^1.6.2",
-    "@vueup/vue-quill": "^1.0.0-alpha.40",
+    "@vueup/vue-quill": "^1.2.0",
     "axios": "^1.7.2",
     "dayjs": "^1.11.13",
     "docx-preview": "^0.3.2",

+ 4 - 4
src/components/AIChatter/AIChatter.module.scss

@@ -1,7 +1,7 @@
 .container {
   position: relative;
   width: 100%;
-  height: 60%; // 原值:60%
+  height: 90%; // 原值:60%
   padding: 10px;
   box-sizing: border-box;
   background-color: #ffffff;
@@ -25,7 +25,7 @@
 
   .message-box {
     width: 100%;
-    height: 80%;
+    height: 98%;
     overflow-y: auto;
 
     .item {
@@ -83,8 +83,8 @@
 
   .message-box {
     width: 100%;
-    height: 34vh;
-    overflow: auto;
+    height: 90vh;
+    overflow-y: auto;
 
     .item {
       display: flex;

+ 9 - 22
src/views/CorrectPage/CorrectPage.vue

@@ -21,9 +21,14 @@
     <div class="right-side">
       <!-- update: 仅保留AI历史对话 -->
       <div class="my-correct-record">
-        <h2>学生与AI对话历史记录</h2>
+        <h3>学生与AI对话历史记录</h3>
         <AIChatter :dialogueId="dataForm.dialogueId" :messages="dataForm.messages" :is-teacher="true" />
-        <el-button @click="showDialog = true">查看行为记录</el-button>
+        <!-- <el-button @click="showDialog = true">查看行为记录</el-button> -->
+        
+      </div>
+      <div class="my-correct-behavior ">
+        <h3>学生行为记录</h3>
+        <BehaviorDialog :fileList="fileList" />
       </div>
 
       <!-- 教师评分、修改意见及评价 -->
@@ -36,26 +41,7 @@
       </div>
     </div>
   </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">
-          <template #default="scope">
-            <a :href="scope.row.recordFileUrl" target="_blank">{{ scope.row.recordFileUrl }}</a>
-          </template>
-        </el-table-column>
-        <el-table-column prop="time" label="时间"></el-table-column>
-        <el-table-column prop="studentId" label="学生 ID"></el-table-column>
-      </el-table>
-
-    <template #footer>
-      <el-button @click="showDialog = false">取消</el-button>
-      <el-button type="primary" @click="downloadAllFiles">导出</el-button>
-    </template>
-  </el-dialog>
+  
 
 </template>
 
@@ -75,6 +61,7 @@ import { useRoute } from 'vue-router'
 import StudentEssay from "../Home/component/StudentEssay/StudentEssay.vue";
 import StudentWritingRequirements from "../Home/component/StudentEssay/StudentWritingRequirements.vue";
 import Remark from "../Home/component/Remark/Remark.vue";
+import BehaviorDialog from "../Home/component/BehaviorDialog/BehaviorDialog.vue";
 
 
 // 获得路由中的assignmentId

+ 20 - 5
src/views/CorrectPage/index.scss

@@ -4,37 +4,51 @@
     height: calc(100vh - 40px);
     display: flex;
     gap: 20px;
+    
     //border: 1px solid black;
 
     .my-correct-goback{
       position: absolute;  
-      bottom: 5vh;  
+      bottom: 1.8vh;  
       right: 3vh; 
     }
   
     .my-correct-header {
+      // display: flex;
       width: 50%;
       height: 100%;
-      flex-shrink: 0;
+      overflow-y: auto;
+      // flex-shrink: 0;
       //border: 1px solid black;
       // background-color:#fff;
     }
 
     .right-side{
       display: flex;
-      gap: 10px;
+      gap: 2vh;
       flex-direction: column;
       height: 100%;
       width: 50%;
 
       .my-correct-record {
-        height: 36vh;
+        height: 29vh;
         background-color: #f9f9f9;  
         border-radius: 5px;  
         padding: 15px;  
         box-shadow: 0 2px 4px rgba(0,0,0,0.1);
         //border: 1px solid black;
         background-color: #fff;
+        overflow-y: auto;
+      }
+
+      .my-correct-behavior {
+         background-color: #f9f9f9;
+         background-color: #fff; 
+         border-radius: 5px;  
+         padding: 15px;  
+         box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+         overflow-y: auto;
+         height: 29vh;  
       }
 
       .my-correct-remark {
@@ -42,9 +56,10 @@
         border-radius: 5px;  
         padding: 15px;  
         box-shadow: 0 2px 4px rgba(0,0,0,0.1);
-        height: 63vh;
+        height: 30vh;
         //border: 1px solid black;
         background-color: #fff;
+        // overflow-y: auto;
       }
 
 

+ 0 - 0
src/views/Home/component/BehaviorDialog/BehaviorDialog.scss


+ 39 - 0
src/views/Home/component/BehaviorDialog/BehaviorDialog.vue

@@ -0,0 +1,39 @@
+<!-- BehaviorDialog.vue -->
+<template>
+    <div>
+      <div style="color: gray; font-size: 12px; margin-bottom: 8px;">
+        注:学生每一次暂存作业 即 生成一个行为记录文件
+      </div>
+      <el-table :data="fileList" stripe>
+        <el-table-column type="index" label="暂存次数" :index="tableIndex" width="120vh"></el-table-column>
+        <!-- <el-table-column prop="assignmentId" label="作业 ID"></el-table-column> -->
+        <el-table-column prop="recordFileUrl" label="行为记录链接" >
+          <template #default="scope">
+            <a :href="scope.row.recordFileUrl" target="_blank">{{ scope.row.recordFileUrl }}</a>
+          </template>
+        </el-table-column>
+        <el-table-column prop="time" label="暂存时间" ></el-table-column>
+        <!-- <el-table-column prop="studentId" label="学生 ID"></el-table-column> -->
+      </el-table>
+    </div>
+  </template>
+  
+  <script lang="ts">
+  import { defineComponent, PropType } from 'vue';
+  
+  export default defineComponent({
+    name: 'BehaviorDialog',
+    props: {
+      fileList: {
+        type: Array as PropType<Array<{ id: number; assignmentId: number; recordFileUrl: string; time: string; studentId: number }>>,
+        required: true,
+      },
+    },
+    methods: {
+      tableIndex( index: number ) {
+        return index + 1;
+      },
+    },
+  });
+  </script>
+  

+ 15 - 2
src/views/Home/component/Remark/Remark.vue

@@ -3,7 +3,9 @@
     <div class="rating-component">
       <span>评分:&nbsp;&nbsp;</span>
       <input type="number" class="score-input" :min="1" :max="100" placeholder="暂无分数" title="请输入0~100间的数字"
-        v-model="correction.score" :disabled="isStudent" />
+        v-model="correction.score" :disabled="isStudent" />&nbsp;&nbsp;&nbsp;
+        <!-- TODO:判定是否有报告存在 -->
+      <el-button color="#597D3B" @click="handleCorrectToPage" >查看AI智能批改报告</el-button>
     </div>
 
     <div class="textarea-container">
@@ -11,6 +13,7 @@
     </div>
 
     <el-button color="#597D3B" @click="handleCorrect" v-if="!isStudent">提交批改</el-button>
+   
   </div>
 </template>
 
@@ -23,6 +26,7 @@ import "./index.scss"
 import { useStore } from "@/store";
 
 const store = useStore()
+const apis = useApis()
 
 
 export default defineComponent({
@@ -34,7 +38,8 @@ export default defineComponent({
     assignmentId: {
       type: Number,
       required: true
-    }
+    },
+    
   },
   setup(props) {
     const isStudent = computed(() => store.user.role === 'STUDENT');
@@ -63,6 +68,13 @@ export default defineComponent({
       }
     };
 
+    
+    const handleCorrectToPage = () => {
+    router.push({
+      path: `/home/assignment/${props.assignmentId}/AIEvaluation`,
+    })
+  }
+
 
     onMounted(() => {
       fetchCorrection();
@@ -93,6 +105,7 @@ export default defineComponent({
     return {
       correction,
       handleCorrect,
+      handleCorrectToPage,
       isStudent
     };
   }

+ 5 - 3
src/views/Home/component/Remark/index.scss

@@ -1,7 +1,8 @@
 
 .remark {  
   display: flex;  
-  flex-direction: column; // 垂直布局  
+  flex-direction: column; // 垂直布局 
+  display: flex; 
   gap: 10px; // 元素之间的间隙  
   padding: 10px; // 内边距  
   border: 1px solid #ccc; // 边框  
@@ -34,13 +35,14 @@
 
 // 文本区域样式  
 textarea { 
+  display: flex;
+  overflow-y: auto;
   margin-bottom: 10px; /* 为textarea底部留出空间给提交按钮 */ 
-  height:35vh;
+  height:18vh;
   width: 100%; // 宽度占满父容器
   box-sizing: border-box; // 内容区域包括内边距和边框,不会撑大元素
   padding: 10px; // 内边距   
   border: 1px solid #ccc; // 边框  
   border-radius: 4px; // 边框圆角  
   font-size: 18px;  
-  resize: none; // 禁止用户调整大小
 }   

+ 9 - 0
src/views/Home/component/StudentEssay/studentEssay.scss

@@ -3,6 +3,11 @@
     width: 800px;
     margin: 0 auto;
     padding: 20px;
+    max-height: 70vh;
+    min-height: 40vh;
+    overflow-y: auto;
+    display: flex;
+
     //background-color: #fff;
   
     .student-essay-info {
@@ -14,11 +19,15 @@
       gap: 20px;
       background-color: #fff;
       line-height: 30px;
+      overflow-y: auto;
+
   
       .student-essay-text {
         display: flex;
         flex-direction: column;
         gap: 15px;
+        overflow-y: auto;
+        min-height: 30vh;
       }
   
       .title {

+ 4 - 0
src/views/Home/component/StudentEssay/studentWritingRequirements.scss

@@ -3,6 +3,10 @@
     margin: 0 auto;
     // padding: 20px;
     //background-color: #fff;
+    display: flex;
+    overflow-y: auto;
+    max-height: 50vh;
+    min-height: 20vh;
   
     .homework-details-info {
       box-sizing: border-box;