diff --git a/language/original-web.txt b/language/original-web.txt index b61cdc674..45575b1f6 100644 --- a/language/original-web.txt +++ b/language/original-web.txt @@ -2237,7 +2237,6 @@ Webhook事件 用户 应用此内容 -生成中... 等待 AI 回复... 请输入你的问题... 选择模型 @@ -2286,4 +2285,4 @@ AI 项目助手 AI 汇报分析 AI 整理汇报 AI 任务助手 -AI 消息助手 \ No newline at end of file +AI 消息助手 diff --git a/resources/assets/js/components/AIAssistant/float-button.vue b/resources/assets/js/components/AIAssistant/float-button.vue index f0caf89e8..8fdbf0df5 100644 --- a/resources/assets/js/components/AIAssistant/float-button.vue +++ b/resources/assets/js/components/AIAssistant/float-button.vue @@ -205,8 +205,8 @@ export default { this.savePosition(); this.dragging = false; - // 判断是否为点击(移动距离小于5px 或 按下时间小于200ms) - if (moveDistance < 5 || duration < 200) { + // 判断是否为点击(移动距离小于5px 且 按下时间小于200ms) + if (moveDistance < 5 && duration < 200) { this.onClick(); } }, diff --git a/resources/assets/js/components/AIAssistant/index.vue b/resources/assets/js/components/AIAssistant/index.vue index b45adc48d..e4db5fa59 100644 --- a/resources/assets/js/components/AIAssistant/index.vue +++ b/resources/assets/js/components/AIAssistant/index.vue @@ -70,8 +70,8 @@
@@ -90,13 +90,22 @@
- + + +
- 欢迎使用 AI 助手 + {{ $L('欢迎使用 AI 助手') }}
-
- +
+
+ + {{ prompt.text }} +
@@ -151,6 +160,7 @@ import {AIBotMap, AIModelNames} from "../../utils/ai"; import DialogMarkdown from "../../pages/manage/components/DialogMarkdown.vue"; import FloatButton from "./float-button.vue"; import AssistantModal from "./modal.vue"; +import {getWelcomePrompts} from "./welcome-prompts"; export default { name: 'AIAssistant', @@ -236,6 +246,9 @@ export default { hasSessionHistory() { return this.currentSessionList.length > 0; }, + welcomePrompts() { + return getWelcomePrompts(this.$store, this.$route?.params || {}); + }, }, watch: { inputModel(value) { @@ -250,6 +263,19 @@ export default { this.$refs.inputRef?.focus(); }, + /** + * 点击快捷提示,填入输入框 + */ + onPromptClick(prompt) { + if (!prompt || !prompt.text) { + return; + } + this.inputValue = prompt.text; + this.$nextTick(() => { + this.onFocus(); + }); + }, + /** * 挂载浮动按钮到 body */ @@ -1220,7 +1246,6 @@ export default {