songxy před 1 týdnem
rodič
revize
a4ebb1aa5f

+ 14 - 11
web_ui/src/views/industrial-land/AiIndustriaLandDetail.vue

@@ -1948,11 +1948,6 @@ export default {
                             that.xgdk = [];
                             that.mContentVisabled = false;
                           }
-                          const _timer = setTimeout(() => {
-                            const container = that.$refs["container"];
-                            container.scrollTop = 0;
-                            clearTimeout(_timer)
-                          }, 500)
                         }
                       );
                     } catch (e) {
@@ -1973,13 +1968,21 @@ export default {
                   that.btnSendDisabled = false;
                   break;
               }
-
+              let timer = null;
+              if (data.type === 'sql_generation') {
+                timer = setTimeout(() => {
+                  that.scrollToBottom();
+                  clearTimeout(timer);
+                  timer = null;
+                }, 200);
+              } else {
+                if (timer) {
+                  clearTimeout(timer)
+                  const container = that.$refs["container"];
+                  container.scrollTop = 0;
+                }
+              }
               // 使用 requestAnimationFrame 来优化滚动性能
-              let timer = setTimeout(() => {
-                that.scrollToBottom();
-                clearTimeout(timer);
-                timer = null;
-              }, 200);
             } catch (e) {
               console.error("Error processing SSE message:", e);
             }