fix(admin): 迁移 antd v6 弃用 API 并清理控制台警告

- Card bordered -> variant;Modal maskClosable -> mask.closable
- InputNumber addonBefore/After -> prefix/suffix;Statistic valueStyle -> styles.content
- Alert message -> title;Steps items.description -> items.content
- 移除考勤页未挂载 Form 上的 setFieldsValue,消除 useForm 警告
This commit is contained in:
2026-08-06 11:58:58 +08:00
parent 2e7bb81ebd
commit 026a9f35d8
12 changed files with 27 additions and 29 deletions

View File

@@ -98,7 +98,7 @@ const FormPreview: React.FC<FormPreviewProps> = ({ form, disabled, onAction }) =
</Typography.Text>
)}
{finished ? (
<Alert type="success" showIcon message="已提交AI 正在处理…" />
<Alert type="success" showIcon title="已提交AI 正在处理…" />
) : (
<Form
layout="vertical"

View File

@@ -341,7 +341,7 @@ const ReviewPreview: React.FC<ReviewPreviewProps> = ({ review, disabled, onActio
/>
)}
{activeStatus === 'failed' && (
<Alert type="error" showIcon message="本步导入失败,可重试" />
<Alert type="error" showIcon title="本步导入失败,可重试" />
)}
{activeSection.resultSummary && activeStatus === 'submitted' && (
<Typography.Text type="secondary" className="ai-chat-review-card__step-result">
@@ -377,7 +377,7 @@ const ReviewPreview: React.FC<ReviewPreviewProps> = ({ review, disabled, onActio
</Popconfirm>
)}
</Flex>
{submitted && <Alert type="success" showIcon message="已确认导入,数据已入库" />}
{submitted && <Alert type="success" showIcon title="已确认导入,数据已入库" />}
{review.error && (
<Alert
type="error"

View File

@@ -456,7 +456,7 @@ export const ImportWizardModal: React.FC<ImportWizardModalProps> = ({
</Flex>
) : allCommitted ? (
<Space orientation="vertical" size={12} style={{ width: '100%' }}>
<Alert type="success" showIcon message="全部阶段已提交完成" />
<Alert type="success" showIcon title="全部阶段已提交完成" />
<Descriptions
bordered
size="small"
@@ -607,7 +607,7 @@ export const ImportWizardModal: React.FC<ImportWizardModalProps> = ({
)}
</Space>
) : (
<Alert type="warning" showIcon message="当前没有可处理的阶段" />
<Alert type="warning" showIcon title="当前没有可处理的阶段" />
)}
</Space>
)}

View File

@@ -329,7 +329,7 @@ const JinshujuMatchModal: React.FC<MatchModalProps> = ({ open, onClose, onApplie
open={open && canEnterModal}
onCancel={handleClose}
width={step === 'match' || step === 'applying' ? 900 : 640}
maskClosable={false}
mask={{ closable: false }}
footer={
step === 'connection'
? [

View File

@@ -48,10 +48,10 @@ const DEFAULT_FORM_VALUES: FormValues = {
};
const STEP_ITEMS = [
{ title: '服务商', description: '选择 AI 服务商' },
{ title: '密钥', description: '配置 API 密钥' },
{ title: '模型', description: '获取并选择模型' },
{ title: '完成', description: '保存并测试连接' },
{ title: '服务商', content: '选择 AI 服务商' },
{ title: '密钥', content: '配置 API 密钥' },
{ title: '模型', content: '获取并选择模型' },
{ title: '完成', content: '保存并测试连接' },
];
const AiConfigPage: React.FC = () => {

View File

@@ -134,7 +134,7 @@ export const AttendanceAdminWorkspace: React.FC<{
</Spin>
</section>
<Card className="student-record-card" bordered={false} title="原始考勤明细">
<Card className="student-record-card" variant="borderless" title="原始考勤明细">
<Table<AttendanceRecordItem>
rowKey="id"
columns={columns}

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { useApiMutation } from '../../hooks/useApiMutation';
import { validateResponse } from '../../utils/validate';
@@ -134,10 +134,6 @@ export const AdminAttendanceArchive: React.FC<{ canEdit: boolean }> = ({ canEdit
? scheduleId
: undefined;
useEffect(() => {
periodForm.setFieldsValue({ periods });
}, [periods, periodForm]);
const enabledPeriods = useMemo(
() => periods.filter((period) => period.enabled).sort((a, b) => a.sortOrder - b.sortOrder),
[periods],

View File

@@ -531,22 +531,22 @@ export const ClassAttendanceTab: React.FC<{
{attendanceSummary && (
<Row gutter={[16, 16]}>
<Col xs={12} md={6}>
<Card bordered={false}>
<Card variant="borderless">
<Statistic title="总记录" value={attendanceSummary.total} />
</Card>
</Col>
<Col xs={12} md={6}>
<Card bordered={false}>
<Card variant="borderless">
<Statistic title="出勤率" value={attendanceSummary.presentRate} suffix="%" />
</Card>
</Col>
<Col xs={12} md={6}>
<Card bordered={false}>
<Card variant="borderless">
<Statistic title="缺勤率" value={attendanceSummary.absentRate} suffix="%" />
</Card>
</Col>
<Col xs={12} md={6}>
<Card bordered={false}>
<Card variant="borderless">
<Statistic title="迟到率" value={attendanceSummary.lateRate} suffix="%" />
</Card>
</Col>

View File

@@ -163,7 +163,7 @@ const ExamDetailPage: React.FC = () => {
</Space>
</div>
{detail.status === 'archived' ? (
<Alert type="info" showIcon message="该考试已归档,成绩仅供查看。如需继续录入,请先在考试列表中恢复。" />
<Alert type="info" showIcon title="该考试已归档,成绩仅供查看。如需继续录入,请先在考试列表中恢复。" />
) : null}
<Card className="exam-summary">
<Descriptions column={{ xs: 1, sm: 2, lg: 5 }}>

View File

@@ -212,7 +212,7 @@ export const CheckInModal: React.FC<{
label="押金金额"
rules={[{ required: true, message: '请输入押金金额' }]}
>
<InputNumber min={0.01} precision={2} addonAfter="元" style={{ width: '100%' }} />
<InputNumber min={0.01} precision={2} suffix="元" style={{ width: '100%' }} />
</Form.Item>
) : null
}

View File

@@ -176,7 +176,7 @@ export const ScheduleModal: React.FC<ScheduleModalProps> = ({
min={0}
max={1440}
step={5}
addonAfter="分钟"
suffix="分钟"
style={{ width: '100%' }}
placeholder="例如 30"
/>
@@ -422,7 +422,7 @@ export const SyncModal: React.FC<SyncModalProps> = ({
title="排班数"
value={syncResult.syncedItems}
suffix="条"
valueStyle={{ color: '#3f8600' }}
styles={{ content: { color: '#3f8600' } }}
/>
</Col>
</Row>
@@ -480,9 +480,11 @@ export const SyncModal: React.FC<SyncModalProps> = ({
title="已就绪班级"
value={syncStatus.mappedClasses}
suffix={`/ ${syncStatus.totalClasses}`}
valueStyle={{
color:
syncStatus.mappedClasses < syncStatus.totalClasses ? '#faad14' : '#3f8600',
styles={{
content: {
color:
syncStatus.mappedClasses < syncStatus.totalClasses ? '#faad14' : '#3f8600',
},
}}
/>
</Col>

View File

@@ -348,7 +348,7 @@ const WalletsPage: React.FC = () => {
extra="充值填正数;调减余额时填写负数。充值后会按最早账单优先自动补扣。"
rules={[{ required: true, message: '请输入金额' }]}
>
<InputNumber precision={2} style={{ width: '100%' }} addonBefore="¥" />
<InputNumber precision={2} style={{ width: '100%' }} prefix="¥" />
</Form.Item>
<Form.Item name="description" label="备注">
@@ -384,7 +384,7 @@ const WalletsPage: React.FC = () => {
extra="充值填正数;调减余额时填写负数。充值后会按最早账单优先自动补扣。"
rules={[{ required: true, message: '请输入金额' }]}
>
<InputNumber precision={2} style={{ width: '100%' }} addonBefore="¥" />
<InputNumber precision={2} style={{ width: '100%' }} prefix="¥" />
</Form.Item>
<Form.Item name="description" label="备注">