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']