浏览代码

布局修改

QuYueTing 1 月之前
父节点
当前提交
c5e57f3715

+ 21 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/components/AIChat.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="border-gray-200 border rounded p-3 h-full flex flex-col" style="min-height: 750px; max-height: 750px;">
+  <div class="border-gray-200 p-3 h-full flex flex-col" style="min-height: 750px; max-height: 750px;">
     <div class="text-sm font-medium mb-3 flex justify-between">
       <span style="color: #075985">DeepSeek大模型CRM数据分析</span>
-      <span class="text-gray-500">开会做PPT利器!</span>
+      <span class="text-gray-500 text-right">开会做PPT利器!</span>
     </div>
     
     <!-- Chat messages container with fixed height and scrolling -->
@@ -76,7 +76,7 @@
         <el-select 
           v-model="selectedReportId" 
           size="small" 
-          style="width: 120px"
+          style="width: 200px"
           placeholder="选择报表"
           @focus="loadCustomReports"
         >
@@ -100,7 +100,7 @@
         </el-upload>
       </div>
       
-      <div class="ml-auto">
+      <div v-if="dataSource === 'system'" class="ml-auto">
         <span class="text-sm mr-2">时间段</span>
         <el-date-picker
           v-model="dateRange"
@@ -396,6 +396,14 @@ onMounted(async () => {
     console.error('Failed to load chat history:', error);
     messages.push({ role: 'assistant', content: '你好,需要分析查询哪些数据,请交给我' });
   }
+
+  // 触发滚动到底部
+  nextTick(() => {
+    const container = document.querySelector('.overflow-y-auto');
+    if (container) {
+      container.scrollTop = container.scrollHeight;
+    }
+  });
 });
 
 const sendMessage = async () => {
@@ -466,7 +474,15 @@ const sendMessage = async () => {
     if (questionId.value) {
       params.questionId = questionId.value;
     }
-
+    // reset message input
+    inputMessage.value = '';
+    //上方聊天记录页面自动滚动到最下面
+    nextTick(() => {
+      const container = document.querySelector('.overflow-y-auto');
+      if (container) {
+        container.scrollTop = container.scrollHeight;
+      }
+    });
     const result = await askAIQuestion(params);
     messages[thinkingIndex] = {
       role: 'assistant',
@@ -483,7 +499,6 @@ const sendMessage = async () => {
     };
   }
 
-  inputMessage.value = '';
   loading.value = false;
   // 触发滚动到底部
   nextTick(() => {

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue

@@ -185,10 +185,10 @@ watchEffect(() => {
 </script>
 
 <template>
-  <div class="m-5 bg-white min-h-full p-4 rounded">
+  <div class="m-5 min-h-full">
     <section class="flex gap-4">
       <!-- Left side - Original functionality -->
-      <div class="w-1/2 min-w-[650px] flex-shrink-0">
+      <div class="w-1/2 min-w-[650px] flex-shrink-0 bg-white p-4 rounded">
         <div class="flex gap-3 mb-4">
           <div class="w-40">
             <el-select
@@ -465,7 +465,7 @@ watchEffect(() => {
       </div>
       
       <!-- Right side - AI Chat -->
-      <div class="w-1/2">
+      <div class="w-1/2 bg-white p-4 rounded">
         <AIChat />
       </div>
     </section>