From b593ca70ae8626ebbe483fd84234ffd07c7d3b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E4=B8=87=E4=BF=8A?= Date: Wed, 27 Aug 2025 10:59:05 +0800 Subject: [PATCH] =?UTF-8?q?fix/=E5=BC=B9=E7=AA=97=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E5=BC=B9=E7=AA=97=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BA=A4=E4=BA=92=EF=BC=8C=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E8=AF=AD=E9=9F=B3=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/components/projectModal.vue | 184 +++++++++++++++++++------- src/view/components/speechControl.vue | 31 ++++- src/view/index.vue | 8 +- 3 files changed, 166 insertions(+), 57 deletions(-) diff --git a/src/view/components/projectModal.vue b/src/view/components/projectModal.vue index d91eb6d..c34ad68 100644 --- a/src/view/components/projectModal.vue +++ b/src/view/components/projectModal.vue @@ -1,7 +1,7 @@ - @@ -240,7 +285,7 @@
-
{{ value.name }}
@@ -250,8 +295,11 @@
-
- +
+ +
+ +
{{ value.name }}
@@ -261,17 +309,20 @@
- -

基础大屏示列

-

包含所有2D基础元素的大屏示列

-
文件信息:大小3MB
+ +
+ +
+

{{ selectTemplateValue.name }}

+

{{ selectTemplateValue.description }}

+
项目信息:大小{{ selectTemplateValue.size }}MB

项目名称

- +
- 取消 - 创建项目 + 取消 + 创建项目
@@ -282,50 +333,72 @@ \ No newline at end of file diff --git a/src/view/components/speechControl.vue b/src/view/components/speechControl.vue index 01f5b92..8bd853e 100644 --- a/src/view/components/speechControl.vue +++ b/src/view/components/speechControl.vue @@ -66,7 +66,7 @@ const config = { commands: [ { command: "add_project", - description: "新建项目", + description: "新建", action: "click", selector: "#ai-speech-add-project", params: [], @@ -84,6 +84,27 @@ const config = { }, ], }, + { + command: "input_project_name", + description: "项目名称", + action: "input", + selector: "#ai-speech-project-name", + params: [ + { + name: "projectname", + type: "string", + description: "输入项目名称", + }, + ], + }, + { + command: "build_project", + description: "创建项目", + action: "click", + selector: "#ai-speech-buildproject", + params: [], + }, + ], }; @@ -218,7 +239,7 @@ class VoiceControl { if (this.isListening) { // 只有在用户希望继续聆听时才重启 setTimeout(() => { - this.recognition.start(); + this.recognition.start(); }, 100); // 短暂延迟后重启 } else { this.updateUI(); @@ -352,6 +373,10 @@ class VoiceControl { } } + delay(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); + } + async executeInstruction(instruction) { const commandConfig = this.config.commands.find( (c) => c.command === instruction.command @@ -363,7 +388,7 @@ class VoiceControl { const element = document.querySelector(commandConfig.selector); - console.log(element,"-----element"); + console.log(element, "-----element"); if (!element) { throw new Error(`找不到元素: ${commandConfig.selector}`); diff --git a/src/view/index.vue b/src/view/index.vue index 0702e74..65b4d0a 100644 --- a/src/view/index.vue +++ b/src/view/index.vue @@ -6,7 +6,7 @@
- +