Browse Source

[feat][ai生涯访谈][输入框清除]

hizhangling 1 month ago
parent
commit
3f319dd753

+ 6 - 1
src/views/xjc-integratedmachine/environment/ai_interview/ai_career_interview.vue

@@ -13,7 +13,7 @@
                                     @input="byKeyword"
                             >
                                 <template #suffix>
-                                    <span style="font-size: 38px;color: #444040;margin-left: 37px;">
+                                    <span style="font-size: 38px;color: #444040;margin-left: 37px;cursor: pointer" @click="clearInput">
                                       X
                                     </span>
                                 </template>
@@ -93,6 +93,11 @@
         }
     }
 
+    // 清除输入框
+    function clearInput(){
+        form.value.name = '';
+    }
+
     // 定义一个函数,用于将关键词变为红色
     function highlightKeywords(text, keywords) {
         // 遍历关键词列表

+ 9 - 11
src/views/xjc-integratedmachine/environment/ai_interview/ai_career_interview_chat.vue

@@ -80,12 +80,11 @@
                     <el-input
                             v-model="inputMessage"
                             style="width: 1220px;height: 84px"
-                            type="textarea"
                             placeholder="请输入消息"
                             @keyup.enter="sendMessage"
                     >
                         <template #suffix>
-                                    <span style="font-size: 38px;color: #444040;margin-left: 37px;">
+                                    <span style="font-size: 38px;color: #444040;margin-left: 37px;cursor: pointer" @click="clearInput">
                                       X
                                     </span>
                         </template>
@@ -185,17 +184,16 @@
         })
     }
 
+    // 第一次聊天发送消息
     function sayHi() {
- /*       const botMsg = {
-            isUser: true,
-            content: '',
-            isTyping: false
-        }
-        chatRecordList.value.push(botMsg);*/
-
         sendRequest(HELLO_MSG)
     }
 
+    // 清除输入框
+    function clearInput(){
+        inputMessage.value = '';
+    }
+
     function quickSendMsg(item){
         sendRequest(item.question);
     }
@@ -990,7 +988,7 @@
             }
 
             ::v-deep .el-input__wrapper {
-                background: #E2E2E2;
+                background-color: #F5F9FA;;
                 box-shadow: none;
                 height: 84px;
                 width: 1220px;
@@ -1012,7 +1010,7 @@
     }
     .iat-box-default{
         position: absolute;
-        right: 10vw;
+        right: 97px;
         top:50vh;
         display: flex;
         justify-content: center;