diff --git a/src/view/components/projectModal.vue b/src/view/components/projectModal.vue index 52c725b..a8d1007 100644 --- a/src/view/components/projectModal.vue +++ b/src/view/components/projectModal.vue @@ -1,37 +1,15 @@ - @@ -253,8 +257,8 @@
-
+
{{ value.name }}
@@ -263,9 +267,11 @@
-
- +
+ +
+ +
{{ value.name }}
@@ -275,17 +281,20 @@
- -

基础大屏示列

-

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

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

{{ selectTemplateValue.name }}

+

{{ selectTemplateValue.description }}

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

项目名称

- +
- 取消 - 创建项目 + 取消 + 创建项目
@@ -296,38 +305,48 @@ \ No newline at end of file diff --git a/src/view/components/speechControl.vue b/src/view/components/speechControl.vue index eda99c9..8bd853e 100644 --- a/src/view/components/speechControl.vue +++ b/src/view/components/speechControl.vue @@ -66,74 +66,50 @@ const config = { commands: [ { command: "add_project", - description: "新建项目", + description: "新建", action: "click", selector: "#ai-speech-add-project", params: [], }, { - command: "input_username", - description: "在用户名输入框中填写用户名", + command: "search_project", + description: "搜索项目", action: "input", - selector: "#username, #username-input, input[type='text'][name*='user']", + selector: "#search_project", params: [ { - name: "username", + name: "projectname", type: "string", - description: "要输入的用户名", + description: "要输入的项目名称", }, ], }, { - command: "input_password", - description: "在密码输入框中填写密码", + command: "input_project_name", + description: "项目名称", action: "input", - selector: "#password, #password-input, input[type='password']", + selector: "#ai-speech-project-name", params: [ { - name: "password", + name: "projectname", type: "string", - description: "要输入的密码", + description: "输入项目名称", }, ], }, { - command: "submit_login", - description: "提交登录表单", + command: "build_project", + description: "创建项目", action: "click", - selector: "#submit-login, .login-submit, button[type='submit']", - params: [], - }, - { - command: "search_product", - description: "在搜索框中输入关键词", - action: "input", - selector: "#search-input, .search-box, input[type='search']", - params: [ - { - name: "keyword", - type: "string", - description: "搜索关键词", - }, - ], - }, - { - command: "perform_search", - description: "执行搜索操作", - action: "click", - selector: "#search-button, .search-btn, button[type='submit']", - params: [], - }, - { - command: "add_to_cart", - description: "将当前产品添加到购物车", - action: "click", - selector: ".add-to-cart, .cart-btn, [data-add-to-cart]", + selector: "#ai-speech-buildproject", params: [], }, + ], }; +const listenStatus = ref(false); + const props = defineProps({ config: { type: Object, @@ -397,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 @@ -407,6 +387,9 @@ class VoiceControl { } const element = document.querySelector(commandConfig.selector); + + console.log(element, "-----element"); + if (!element) { throw new Error(`找不到元素: ${commandConfig.selector}`); } @@ -518,8 +501,14 @@ const toggleListening = () => { } if (voiceControl.value.isListening) { + listenStatus.value = false; voiceControl.value.stopListening(); + const voiceBtn = document.getElementById("voice-btn"); + if (voiceBtn) { + voiceBtn.classList.remove("listening"); + } } else { + listenStatus.value = true; voiceControl.value.startListening(); } }; @@ -547,10 +536,6 @@ body { } .container { - max-width: 1200px; - width: 100%; - text-align: center; - padding: 20px; } h1 { diff --git a/src/view/index.vue b/src/view/index.vue index 7c76ccd..9b99887 100644 --- a/src/view/index.vue +++ b/src/view/index.vue @@ -6,7 +6,7 @@
- +
15586961409
@@ -32,22 +32,11 @@
- -
- +
@@ -102,7 +91,7 @@ @@ -127,7 +116,9 @@
-
+
+ +
@@ -183,13 +174,14 @@ const menu = ref([ active: false, }, ]); + const searchValue = ref(""); const tabName = ref("local"); const projects = ref([ { name: '苏州站基础大屏示例', - img: '' + img: '/src/assets/images/sjdp1.png' } ]) @@ -445,7 +437,7 @@ const addProject = () => { height: 1px; background: rgba(255, 255, 255, 0.9); position: absolute; - left: -220px; + left: -150px; top: 50%; transform: translateY(-50%); } @@ -456,7 +448,7 @@ const addProject = () => { height: 1px; background: rgba(255, 255, 255, 0.9); position: absolute; - right: -220px; + right: -150px; top: 50%; transform: translateY(-50%); } @@ -565,6 +557,11 @@ const addProject = () => { background: #444; border-radius: 4px; margin-bottom: 12px; + overflow: hidden; + img { + width: 100%; + height: 100%; + } } .card-title {