From f5e39e13f6ef33ca462e36b89352c12a88abaee0 Mon Sep 17 00:00:00 2001 From: SeasonsChange <1204992313@qq.com> Date: Tue, 26 Aug 2025 00:49:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96):?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E8=8A=82=E6=B5=81=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96UI=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增通用节流函数工具 - 移除不必要的模糊滤镜提升渲染性能 - 隐藏暂时不用的右侧边栏和分隔条 - 调整布局样式增强灵活性 --- .../testnode/controller/AIDemoController.java | 60 ------------------- prompto-lab-ui/src/App.vue | 13 ++-- .../src/components/Chat/AIChatPage.vue | 8 +-- .../src/components/layout/AppHeader.vue | 2 +- prompto-lab-ui/src/utils/common.ts | 11 ++++ prompto-lab-ui/src/views/HomeView.vue | 30 +++++----- 6 files changed, 38 insertions(+), 86 deletions(-) delete mode 100644 prompto-lab-app/src/test/java/io/github/timemachinelab/testnode/controller/AIDemoController.java create mode 100644 prompto-lab-ui/src/utils/common.ts diff --git a/prompto-lab-app/src/test/java/io/github/timemachinelab/testnode/controller/AIDemoController.java b/prompto-lab-app/src/test/java/io/github/timemachinelab/testnode/controller/AIDemoController.java deleted file mode 100644 index b7b6a6b..0000000 --- a/prompto-lab-app/src/test/java/io/github/timemachinelab/testnode/controller/AIDemoController.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.github.timemachinelab.testnode.controller; - -import com.suifeng.sfchain.core.AIService; -import io.github.timemachinelab.testnode.ainode.AIChatOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; - -/** - * 描述: AI服务Demo控制器 - * 演示如何使用AIService调用AI节点 - * - * @author suifeng - * 日期: 2025/1/20 - */ -@RestController -@RequestMapping("/api/ai") -@Slf4j -public class AIDemoController { - - @Resource - private AIService aiService; - - /** - * 简单AI对话接口 - * - * @param question 用户问题 - * @return AI回答 - */ - @PostMapping("/chat") - public Map chat(@RequestParam String question) { - try { - // 创建请求对象 - AIChatOperation.ChatRequest request = new AIChatOperation.ChatRequest(question); - - // 调用AI服务 - AIChatOperation.ChatResponse response = aiService.execute("AI_CHAT_OP", request); - - // 返回结果 - Map result = new HashMap<>(); - result.put("success", true); - result.put("data", response); - result.put("message", "AI对话成功"); - - return result; - - } catch (Exception e) { - log.error("AI对话失败: {}", e.getMessage(), e); - - Map result = new HashMap<>(); - result.put("success", false); - result.put("message", "AI对话失败: " + e.getMessage()); - - return result; - } - } -} \ No newline at end of file diff --git a/prompto-lab-ui/src/App.vue b/prompto-lab-ui/src/App.vue index 590fbbf..f01d342 100644 --- a/prompto-lab-ui/src/App.vue +++ b/prompto-lab-ui/src/App.vue @@ -3,6 +3,7 @@ import { RouterView } from 'vue-router' import { useRoute } from 'vue-router' import { ref,onMounted,onUnmounted,computed } from 'vue' import AppHeader from '@/components/layout/AppHeader.vue' +import { throttle } from './utils/common' const route = useRoute() const appRef = ref() @@ -14,10 +15,10 @@ const isScrolled = ref(false) const headerHeight = 88 // AppHeader的高度 // 滚动监听函数 -const handleScroll = () => { +const handleScroll = throttle(() => { const scrollTop = appRef.value?.scrollTop || 0 isScrolled.value = scrollTop > headerHeight -} +},100) // 组件挂载时添加滚动监听 onMounted(() => { @@ -58,14 +59,14 @@ onUnmounted(() => { /* 主要内容区域 */ .app-main { flex: 1; - background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%); + /* background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%); */ margin: 0; border-radius: 0; min-height: 0; /* 重要:允许flex子项收缩 */ } .app-main.fullscreen { - background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%); + /* background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%); */ margin: 0; border-radius: 0; } @@ -75,8 +76,8 @@ onUnmounted(() => { left: 0; right: 0; z-index: 1001; - background: rgba(8, 8, 8, 0.1); - backdrop-filter: blur(20px) saturate(180%); + background: rgba(8, 8, 8, 0.8); + /* backdrop-filter: blur(20px) saturate(180%); */ border-bottom: 1px solid rgba(212, 175, 55, 0.2); box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), diff --git a/prompto-lab-ui/src/components/Chat/AIChatPage.vue b/prompto-lab-ui/src/components/Chat/AIChatPage.vue index 7b8d8e5..9db3bd2 100644 --- a/prompto-lab-ui/src/components/Chat/AIChatPage.vue +++ b/prompto-lab-ui/src/components/Chat/AIChatPage.vue @@ -41,7 +41,7 @@ -
+
@@ -53,7 +53,7 @@
-