修复更改文件类型时匹配设置界面自动收起的BUG,以及修改匹配界面自动展开的策略

This commit is contained in:
fofolee
2025-02-21 23:45:22 +08:00
parent 84c47db7e0
commit eb17456d4d
2 changed files with 10 additions and 11 deletions

View File

@@ -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;

View File

@@ -187,6 +187,7 @@
emit-value
map-options
class="col-2"
popup-content-class="file-type-popup"
/>
<q-input
v-model.number="rule.minLength"
@@ -304,13 +305,12 @@ export default defineComponent({
data() {
return {
ruleTypeOptions: Object.values(commandTypes)
.map((type) => ({
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: {},
};