Преглед изворни кода

fix:修复AI对话组件在学生界面和教师界面存在的显示问题

BaiQi пре 1 година
родитељ
комит
ad426298dd

+ 5 - 21
src/components/AIChatter/AIChatter.module.scss

@@ -1,7 +1,8 @@
 .container {
   position: relative;
   width: 100%;
-  height: 90%; // 原值:60%
+  //height: 90%; // 原值:60%
+  height: var(--container-height);
   padding: 10px;
   box-sizing: border-box;
   background-color: #ffffff;
@@ -25,7 +26,8 @@
 
   .message-box {
     width: 100%;
-    height: 98%;
+    //height: 98%; // 80
+    height: var(--message-height);
     overflow-y: auto;
 
     .item {
@@ -74,7 +76,7 @@
 .teacher-view{
   position: relative;
   width: 100%;
-  height: 90%; 
+  height: 90%;
   padding: 5px;
   box-sizing: border-box;
   background-color: #ffffff;
@@ -100,22 +102,4 @@
       }
     }
   }
-
 }
-
-//  .question-box {
-//    height: 10%;
-//
-//    .input-group {
-//            border: 1px solid #d9d9d9;
-//            border-radius: 5px;
-//      .button {
-//        width: 40px;
-//        &:hover {
-//          background-color: #d9d9d9;
-//        }
-//      }
-//    }
-//  }
-//
-//}

+ 2 - 2
src/components/AIChatter/AIChatter.vue

@@ -143,8 +143,8 @@
 
   const props = defineProps<{
     dialogueId: string,
-    messages: IDialogue[]
-    isTeacher: boolean
+    messages: IDialogue[],
+    isTeacher: boolean,
   }>()
 
   const apis = useApis()

+ 4 - 1
src/views/CorrectPage/CorrectPage.vue

@@ -22,7 +22,10 @@
       <!-- update: 仅保留AI历史对话 -->
       <div class="my-correct-record">
         <h3>学生与AI对话历史记录</h3>
-        <AIChatter :dialogueId="dataForm.dialogueId" :messages="dataForm.messages" :is-teacher="true" />
+        <AIChatter :dialogueId="dataForm.dialogueId" :messages="dataForm.messages" :is-teacher="true" :style="{
+    '--container-height': '90%',
+    '--message-height': '98%'
+  }"/>
         <!-- <el-button @click="showDialog = true">查看行为记录</el-button> -->
         
       </div>

+ 4 - 1
src/views/EditPage/EditPage.vue

@@ -9,7 +9,10 @@
 
     <div class="my-work-slider">
       <el-button class="back" color="#597D3B" @click="handleBack">&lt;返回</el-button>
-      <AIChatter :dialogueId="dataForm.dialogueId" :messages="dataForm.messages" :is-teacher="false" />
+      <AIChatter :dialogueId="dataForm.dialogueId" :messages="dataForm.messages" :is-teacher="false" :style="{
+    '--container-height': '60%',
+    '--message-height': '80%'
+  }"/>
       <Dictionaries />
     </div>
     <div class="my-work-input">