From 4bcb966bdc555293eeecf7b36eed4caa81672fe9 Mon Sep 17 00:00:00 2001 From: Megghy Date: Fri, 2 May 2025 02:34:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=B5=8B=E8=AF=95=E4=B8=8A=E4=B8=8B=E6=96=87=E5=92=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A8=A1=E6=9D=BF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 AutoActionEditor 和 TemplateSettings 组件中添加 customTestContext 属性 - 更新 CheckInSettings 组件以使用 customTestContext - 移除 TemplateEditor 中的操作按钮部分 --- .../autoaction/AutoActionEditor.vue | 6 ++- .../components/autoaction/TemplateEditor.vue | 15 ------- .../autoaction/settings/CheckInSettings.vue | 43 ++++++++++++------- .../autoaction/settings/TemplateSettings.vue | 5 +++ src/components.d.ts | 1 + 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/client/components/autoaction/AutoActionEditor.vue b/src/client/components/autoaction/AutoActionEditor.vue index d273cff..58a5732 100644 --- a/src/client/components/autoaction/AutoActionEditor.vue +++ b/src/client/components/autoaction/AutoActionEditor.vue @@ -26,6 +26,10 @@ const props = defineProps({ hideEnabled: { type: Boolean, default: false + }, + customTestContext: { + type: Object, + default: undefined } }); @@ -58,7 +62,7 @@ const TriggerSettings = getTriggerSettings();
- + - - - - 占位符转表达式 - - -
+ + 签到成功回复 + + - - - - - - - - + + 签到冷却回复 + + @@ -398,6 +400,15 @@ const config = autoActionStore.checkInModule.checkInConfig; const accountInfo = useAccount(); const isLoading = ref(false); +const customTestContext = ref({ + checkin: { + points: 0, + consecutiveDays: 0, + todayRank: 0, + time: new Date() + } +}); + // 签到模板的特定占位符 const checkInPlaceholders = [ { name: '{{checkin.points}}', description: '获得的总积分' }, diff --git a/src/client/components/autoaction/settings/TemplateSettings.vue b/src/client/components/autoaction/settings/TemplateSettings.vue index fcada7b..97df7f3 100644 --- a/src/client/components/autoaction/settings/TemplateSettings.vue +++ b/src/client/components/autoaction/settings/TemplateSettings.vue @@ -8,6 +8,10 @@ const props = defineProps({ action: { type: Object as () => AutoActionItem, required: true + }, + customTestContext: { + type: Object, + default: undefined } }); @@ -61,6 +65,7 @@ function handleTemplateUpdate(payload: { index: number, value: string }) { :title="templateTitle" :description="templateDescription" :check-length="action.actionType === ActionType.SEND_DANMAKU" + :custom-test-context="customTestContext" class="template-editor" @update:template="handleTemplateUpdate" /> diff --git a/src/components.d.ts b/src/components.d.ts index af3268b..62cbed1 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -22,6 +22,7 @@ declare module 'vue' { NAvatar: typeof import('naive-ui')['NAvatar'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] + NDi: typeof import('naive-ui')['NDi'] NEmpty: typeof import('naive-ui')['NEmpty'] NFlex: typeof import('naive-ui')['NFlex'] NFormItemGi: typeof import('naive-ui')['NFormItemGi']