From 1fb89a7a927ea8ddd12249ad8c69f0b469d1b818 Mon Sep 17 00:00:00 2001 From: NanGua-QWQ Date: Tue, 3 Feb 2026 22:25:55 +0800 Subject: [PATCH] Change: add tineUnit --- .../src/components/AutoScoreManager.tsx | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/src/renderer/src/components/AutoScoreManager.tsx b/src/renderer/src/components/AutoScoreManager.tsx index d60b2d0..4787a27 100644 --- a/src/renderer/src/components/AutoScoreManager.tsx +++ b/src/renderer/src/components/AutoScoreManager.tsx @@ -11,7 +11,8 @@ import { Tag, Space, Switch, - Popconfirm + Popconfirm, + Radio, } from 'tdesign-react' interface AutoScoreRule { @@ -126,7 +127,14 @@ export const AutoScoreManager: React.FC = () => { if (res.success) { MessagePlugin.success(editingRuleId !== null ? '规则更新成功' : '规则创建成功') - form.reset() + // 手动清空表单字段,避免 form.reset() 导致的栈溢出 + form.setFieldsValue({ + name: '', + intervalMinutes: undefined, + studentNames: '', + scoreValue: undefined, + reason: '' + }) setEditingRuleId(null) fetchRules() // 刷新规则列表 } else { @@ -203,7 +211,14 @@ export const AutoScoreManager: React.FC = () => { } const handleResetForm = () => { - form.reset() + // 手动清空表单字段,避免 form.reset() 导致的栈溢出 + form.setFieldsValue({ + name: '', + intervalMinutes: undefined, + studentNames: '', + scoreValue: undefined, + reason: '' + }) setEditingRuleId(null) } @@ -308,15 +323,26 @@ export const AutoScoreManager: React.FC = () => { - - + + + + + + + + + 分钟 + + +