From eb17456d4deacb59c6814d9b320f0a70ab2f6cc6 Mon Sep 17 00:00:00 2001 From: fofolee Date: Fri, 21 Feb 2025 23:45:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=94=B9=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=97=B6=E5=8C=B9=E9=85=8D=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=E8=87=AA=E5=8A=A8=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=E7=9A=84BUG=EF=BC=8C=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E7=95=8C=E9=9D=A2=E8=87=AA=E5=8A=A8=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/CommandConfig.vue | 7 +++---- src/components/editor/MatchRuleEditor.vue | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/editor/CommandConfig.vue b/src/components/editor/CommandConfig.vue index 47abd9e..9f8a6c5 100644 --- a/src/components/editor/CommandConfig.vue +++ b/src/components/editor/CommandConfig.vue @@ -29,7 +29,6 @@ :model-value="currentCommand.tags" @update:model-value="updateModelValue('tags', $event)" :options="allQuickCommandTags" - @focus="expandOnFocus && updateExpanded(true)" dense options-dense filled @@ -281,9 +280,9 @@ export default defineComponent({ // 如果面板已经折叠,不需要处理 if (!this.isExpanded) return; - // 检查点击是否在标签选择框的弹出菜单内 - const tagPopup = document.querySelector(".command-tag-popup"); - if (tagPopup?.contains(event.target)) return; + // 检查点击是否在标签选择框或文件类型选择框的弹出菜单内 + const popupMenu = document.querySelector(".command-tag-popup,.file-type-popup"); + if (popupMenu?.contains(event.target)) return; // 检查点击是否在组件内部 const componentEl = this.$el; diff --git a/src/components/editor/MatchRuleEditor.vue b/src/components/editor/MatchRuleEditor.vue index 4553e69..26b28ce 100644 --- a/src/components/editor/MatchRuleEditor.vue +++ b/src/components/editor/MatchRuleEditor.vue @@ -187,6 +187,7 @@ emit-value map-options class="col-2" + popup-content-class="file-type-popup" /> ({ - label: type.label, - value: type.name, - icon: type.icon, - color: type.color, - })), + ruleTypeOptions: Object.values(commandTypes).map((type) => ({ + label: type.label, + value: type.name, + icon: type.icon, + color: type.color, + })), commandTypes, isHovering: {}, };