ソースを参照

style: AI BOT添加免责申明

zhouyuhao 6 ヶ月 前
コミット
16797f05b0
1 ファイル変更45 行追加5 行削除
  1. 45 5
      src/views/AIRobotChat/src/AIRobotChat.vue

+ 45 - 5
src/views/AIRobotChat/src/AIRobotChat.vue

@@ -131,7 +131,7 @@ const aiChat = (question, isPresetQuestion) => {
   serial_no.value = userStore.userInfo?.uname + Date.now().toString()
   let fixed_faq = ''
   if (!is_FixedAnswer.value) {
-    fixed_faq = messages.value[messages.value.length - 2].content
+    fixed_faq = messages.value[messages.value.length - 3].content
   } else if (isPresetQuestion) {
     fixed_faq = question
   }
@@ -145,7 +145,7 @@ const aiChat = (question, isPresetQuestion) => {
       fixed_faq: fixed_faq
     })
     .then((res) => {
-      if (isPause.value) {
+      if (isPause.value || queryTime.value === -1) {
         return
       }
       if (res.code === 200) {
@@ -196,8 +196,6 @@ const handleSend = (question, isPresetQuestion = true, isExternal = false) => {
   }
   isPause.value = false
   loadingAnswer.value = true
-
-  aiChat(question, isPresetQuestion)
   // 将用户内容添加到消息列表
   messages.value.push({
     type: 'user',
@@ -206,6 +204,8 @@ const handleSend = (question, isPresetQuestion = true, isExternal = false) => {
   })
   !isPresetQuestion ? (userQuestion.value = '') : ''
   queryTime.value = 0
+
+  aiChat(question, isPresetQuestion)
   messages.value.push({
     type: 'robot',
     content: progressStatus[0]
@@ -320,6 +320,11 @@ const clearData = () => {
   sessionStorage.removeItem('AIChat')
 }
 
+const liabilityExeDialog = ref(true) // 免责声明弹窗
+const handleLiabilityExeDialog = () => {
+  liabilityExeDialog.value = true
+}
+
 defineExpose({
   handleSend,
   handleOpen,
@@ -468,8 +473,31 @@ defineExpose({
           <span class="font_family icon-icon_send_b"></span>
         </div>
       </div>
-      <div class="liability-exemption">Content is generated by Al, please check carefully!</div>
+      <div class="liability-exemption">
+        <span> Content is generated by Al, please check carefully!</span>
+        <span class="liability-exemption-btn" @click="handleLiabilityExeDialog">Disclaimer</span>
+      </div>
     </div>
+    <el-dialog
+      class="liability-exemption-dialog"
+      v-model="liabilityExeDialog"
+      title="Disclaimer"
+      width="800"
+    >
+      <p style="line-height: 21px">
+        This feature generates automated answers summarised from FT articles. By using it, you are
+        interacting with an Al system (provided byAnthropic), not a human. Al can make mistakes.
+        Please refer to the source articles for verification and cifation purposes.
+      </p>
+      <p style="line-height: 21px">
+        Our staff do not check or moderate Ask FT is answers in advance, but may review some later.
+        Our journalists continue to write and edit all thearticles Ask FT uses as sources. Learn
+        more about our editorial principles for generative Al To helo us understand how you are
+        usina this feafure and how we can improve it, we use your data. This includes your query and
+        any personadata you have shared with us, like your job title. For more information about how
+        we use your data, please read our Privacy Policy.
+      </p>
+    </el-dialog>
   </div>
 </template>
 
@@ -747,6 +775,12 @@ defineExpose({
     color: var(--color-neutral-3);
     text-align: center;
   }
+  .liability-exemption-btn {
+    margin-left: 2px;
+    text-decoration: underline;
+    color: var(--color-theme);
+    cursor: pointer;
+  }
 
   @keyframes loading-rotate {
     0% {
@@ -758,4 +792,10 @@ defineExpose({
     }
   }
 }
+:deep(.liability-exemption-dialog) {
+  padding-bottom: 0;
+  .el-dialog__body {
+    padding-top: 8px;
+  }
+}
 </style>