zhujing 1 kuukausi sitten
vanhempi
sitoutus
caf283f279

+ 1 - 1
ui/smarttrade-platform/src/api/customer/index.js

@@ -4,4 +4,4 @@ export const getCustomerList = (data = {}) => post('/router/rest/customerTrade/l
 
 export const getCustomerDetail = (params = {}) => get('/router/rest/customerTrade/getById', params)
 
-export const streaming = (data = {}) => post('/router/rest/chat/streaming', data)
+export const blocking = (data = {}) => post('/router/rest/chat/blocking', data,{ timeout: 150000 })

+ 19 - 12
ui/smarttrade-platform/src/views/CustomersView.vue

@@ -97,7 +97,7 @@
             <div class="score-label">意向分</div>
           </div> -->
           <div class="customer-actions" @click.stop>
-            <button class="btn btn-secondary btn-sm" @click="showCustomerDetail(customer)"><i class="fas fa-eye"></i>更多详情</button>
+            <button class="btn btn-secondary btn-sm" @click="showCustomerDetail(customer.id)"><i class="fas fa-eye"></i>更多详情</button>
           </div>
         </div>
       </div>
@@ -124,7 +124,7 @@
 
     <!-- Customer Detail Modal -->
     <div v-if="showDetailModal && selectedCustomer" class="modal-overlay" @click.self="closeDetail()">
-      <div class="modal customer-detail-modal">
+      <div class="modal customer-detail-modal" v-loading="detailLoading" element-loading-background="rgba(0, 0, 0, 0.5)">
         <div class="modal-header">
           <div class="modal-title">
             <span class="detail-flag">{{ selectedCustomer.flag }}</span>
@@ -267,7 +267,7 @@
 
 <script setup>
 import { ref, computed } from 'vue'
-import { getCustomerList,getCustomerDetail,streaming } from '../api/customer'
+import { getCustomerList,getCustomerDetail,blocking } from '../api/customer'
 import {region} from '@/utils/region';
 // 引入添加客户组件
 import AddCustomerModal from '../components/addCustomer.vue'
@@ -285,6 +285,7 @@ const toastType = ref('success')
 const dataLoading = ref(false)
 const aiContentLoading = ref(false)
 const formattedText = ref('')
+const detailLoading = ref(false)
 
 const customerStats = ref({
   total: 0,
@@ -335,13 +336,20 @@ const getRegion = (value) => {
     getCustomer()
 }
 
-const showCustomerDetail = (customer) => {
-  getCustomerDetail({id:customer.id}).then(res => {
+const customerDetailId = ref()
+const showCustomerDetail = (id) => {
+  aiContentLoading.value = false
+  detailLoading.value = true
+  showDetailModal.value = true
+  customerDetailId.value = id
+  getCustomerDetail({id:id}).then(res => {
     if(res.success){
+      detailLoading.value = false
       selectedCustomer.value = res.result
-      showDetailModal.value = true
       if(selectedCustomer.value.customerAnalysisResult){
         formattedText.value = selectedCustomer.value.customerAnalysisResult.reasonSummary
+      }else{
+        formattedText.value = ''
       }
     }else{
       ElMessage.warning(res.message)
@@ -354,17 +362,17 @@ const aiStreaming= (id) =>{
     appId: "app-rQrSHhudWbi5LVRkIX4tfVrg",
     inputs: {"analysis_batch_no":"1","customer_id":+id},
     query: "1",
-    response_mode: "streaming",
+    response_mode: "blocking",
     user: "1",
     files:[]
   }
   if(aiContentLoading.value) return
   aiContentLoading.value = true
-  streaming(params).then(res => {
+  ElMessage.warning('AI分析时间大概为2-4分钟,请稍后查看')
+  blocking(params).then(res => {
     aiContentLoading.value = false
-    ElMessage.warning('AI分析时间大概为2-4分钟,请稍后查看')
     if(res.success){
-      aiContentLoading.value = true
+      showCustomerDetail(customerDetailId.value)
     }
     // else{
     //   return ElMessage.error('请求超时,请稍后再试')
@@ -373,7 +381,6 @@ const aiStreaming= (id) =>{
 }
 
 const goOtherProject = (data) => {
-  console.log(data)
   const baseUrl = 'https://sales.test.storlead.com/customer/followPanel' // 销售管理系统
   const params = {
     id: data.id,
@@ -392,7 +399,7 @@ const goOtherProject = (data) => {
 }
 const closeDetail = ()=>{
   showDetailModal.value = false
-  aiContentLoading.value=false
+  aiContentLoading.value = false
 }
 // const customers = ref([
 //   {