zhangqi hai 1 mes
pai
achega
ab50f62cc7
Modificáronse 2 ficheiros con 11 adicións e 2 borrados
  1. 4 2
      src/components/AIDialog/data.js
  2. 7 0
      src/components/AIDialog/index.vue

+ 4 - 2
src/components/AIDialog/data.js

@@ -514,14 +514,16 @@ export function mockRequested(question) {
       test: /比价.*KITZ|比价.*沃茨|材质.*管道|不锈钢.*选型|选型.*产品图册/.test(q),
       build: () => ({ content: `
         <p style="line-height:25px;margin:0;">下次跟进计划?</p>
+        <div type="default" shape="round" class="cust-btn">结束</div>
       `}),
     }, 
     // 跟进报价进展
     {
       test: /报价.*进展|进展.*报价|进展/.test(q),
-      build: () => ({ content: `
+      build: () => ({
+        content:`<p style="line-height:25px;margin:0;">您填写的跟进记录如下:</p>`, 
+        card: `
         <div style="background:#fff;padding:10px;border-radius:8px;">
-          <p style="line-height:25px;margin:0;">您填写的跟进记录如下:</p>
           <p style="line-height:25px;margin:0;">跟进类型:现场交流</p>
           <p style="line-height:25px;margin:0;">跟进对象:袁永详</p>
           <p style="line-height:25px;margin:0;">目的:项目情况</p>

+ 7 - 0
src/components/AIDialog/index.vue

@@ -83,6 +83,7 @@
                       :show-overflow-tooltip="true"
                     />
                   </el-table>
+                  <div v-if="msg.card" v-html="msg.card"></div>
                   <div style="margin-top: 10px;" v-if="msg.button">
                     <el-button
                       v-for="btn in msg.button"
@@ -208,6 +209,12 @@ export default {
               this.scrollToBottom()
             })
           }
+          if (aiAns.card) {
+            this.messages.push({ role: 'ai', content: aiAns.content ? '' : '如下卡片所示:', card: aiAns.card, button: aiAns.button, time: formatTime(new Date()) })
+            this.$nextTick(() => {
+              this.scrollToBottom()
+            })
+          }
         } else {
           pendingMsg.pending = false
           pendingMsg.content = String(aiAns)