From efad891f7f34a1a2e3e3c99d086317608e5796ea Mon Sep 17 00:00:00 2001 From: guopenghui Date: Thu, 14 May 2026 21:48:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(setting):=20=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E7=9A=84=E8=AF=A6=E6=83=85=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/CommandTag/CommandTag.vue | 30 +- .../MatchCommandDetailDialog.vue | 523 ++++++++++++++++++ .../common/MatchCommandDetailDialog/index.ts | 1 + .../common/PluginDetail/PluginDetailTabs.vue | 71 ++- .../setting/src/components/common/index.ts | 1 + .../AllCommandsSetting/AllCommandsSetting.vue | 168 ++++-- src/main/api/renderer/commands.ts | 11 +- 7 files changed, 754 insertions(+), 51 deletions(-) create mode 100644 internal-plugins/setting/src/components/common/MatchCommandDetailDialog/MatchCommandDetailDialog.vue create mode 100644 internal-plugins/setting/src/components/common/MatchCommandDetailDialog/index.ts diff --git a/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue b/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue index aaace254..0e0fdeed 100644 --- a/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue +++ b/internal-plugins/setting/src/components/common/CommandTag/CommandTag.vue @@ -7,7 +7,7 @@ interface Command { name?: string type?: 'text' | 'regex' | 'over' | 'img' | 'files' | 'window' | string match?: { - match?: string + match?: string | Record minLength?: number maxLength?: number extensions?: string[] @@ -32,6 +32,22 @@ const tagClass = computed(() => { // 否则使用 props.type return props.type ? `tag-${props.type}` : '' }) + +function getMinLength(command?: Command): number { + return command?.match?.minLength ?? 1 +} + +function getMaxLength(command?: Command): number { + return command?.match?.maxLength ?? 10000 +} + +function getExtensions(command?: Command): string[] { + return command?.match?.extensions ?? [] +} + +function getFileType(command?: Command): string | undefined { + return command?.match?.fileType +}