feat: 添加自定义测试上下文和更新模板设置

- 在 AutoActionEditor 和 TemplateSettings 组件中添加 customTestContext 属性
- 更新 CheckInSettings 组件以使用 customTestContext
- 移除 TemplateEditor 中的操作按钮部分
This commit is contained in:
2025-05-02 02:34:56 +08:00
parent 993107c24c
commit 4bcb966bdc
5 changed files with 38 additions and 32 deletions

View File

@@ -188,23 +188,25 @@
</template>
</NAlert>
</div>
<NDivider title-placement="left">
签到成功回复
</NDivider>
<AutoActionEditor
:action="config.successAction"
:hide-name="true"
:hide-enabled="true"
:custom-test-context="customTestContext"
/>
<!-- 使用 AutoActionEditor 编辑 action 配置 -->
<NFormItem label="签到成功回复">
<AutoActionEditor
:action="config.successAction"
:hide-name="true"
:hide-enabled="true"
/>
</NFormItem>
<NFormItem label="签到冷却回复">
<AutoActionEditor
:action="config.cooldownAction"
:hide-name="true"
:hide-enabled="true"
/>
</NFormItem>
<NDivider title-placement="left">
签到冷却回复
</NDivider>
<AutoActionEditor
:action="config.cooldownAction"
:hide-name="true"
:hide-enabled="true"
:custom-test-context="customTestContext"
/>
</template>
<NFormItem>
@@ -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: '获得的总积分' },