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:
@@ -98,7 +98,7 @@ const FormPreview: React.FC<FormPreviewProps> = ({ form, disabled, onAction }) =
|
|||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
)}
|
)}
|
||||||
{finished ? (
|
{finished ? (
|
||||||
<Alert type="success" showIcon message="已提交,AI 正在处理…" />
|
<Alert type="success" showIcon title="已提交,AI 正在处理…" />
|
||||||
) : (
|
) : (
|
||||||
<Form
|
<Form
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ const ReviewPreview: React.FC<ReviewPreviewProps> = ({ review, disabled, onActio
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{activeStatus === 'failed' && (
|
{activeStatus === 'failed' && (
|
||||||
<Alert type="error" showIcon message="本步导入失败,可重试" />
|
<Alert type="error" showIcon title="本步导入失败,可重试" />
|
||||||
)}
|
)}
|
||||||
{activeSection.resultSummary && activeStatus === 'submitted' && (
|
{activeSection.resultSummary && activeStatus === 'submitted' && (
|
||||||
<Typography.Text type="secondary" className="ai-chat-review-card__step-result">
|
<Typography.Text type="secondary" className="ai-chat-review-card__step-result">
|
||||||
@@ -377,7 +377,7 @@ const ReviewPreview: React.FC<ReviewPreviewProps> = ({ review, disabled, onActio
|
|||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
{submitted && <Alert type="success" showIcon message="已确认导入,数据已入库" />}
|
{submitted && <Alert type="success" showIcon title="已确认导入,数据已入库" />}
|
||||||
{review.error && (
|
{review.error && (
|
||||||
<Alert
|
<Alert
|
||||||
type="error"
|
type="error"
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ export const ImportWizardModal: React.FC<ImportWizardModalProps> = ({
|
|||||||
</Flex>
|
</Flex>
|
||||||
) : allCommitted ? (
|
) : allCommitted ? (
|
||||||
<Space orientation="vertical" size={12} style={{ width: '100%' }}>
|
<Space orientation="vertical" size={12} style={{ width: '100%' }}>
|
||||||
<Alert type="success" showIcon message="全部阶段已提交完成" />
|
<Alert type="success" showIcon title="全部阶段已提交完成" />
|
||||||
<Descriptions
|
<Descriptions
|
||||||
bordered
|
bordered
|
||||||
size="small"
|
size="small"
|
||||||
@@ -607,7 +607,7 @@ export const ImportWizardModal: React.FC<ImportWizardModalProps> = ({
|
|||||||
)}
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
) : (
|
) : (
|
||||||
<Alert type="warning" showIcon message="当前没有可处理的阶段" />
|
<Alert type="warning" showIcon title="当前没有可处理的阶段" />
|
||||||
)}
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ const JinshujuMatchModal: React.FC<MatchModalProps> = ({ open, onClose, onApplie
|
|||||||
open={open && canEnterModal}
|
open={open && canEnterModal}
|
||||||
onCancel={handleClose}
|
onCancel={handleClose}
|
||||||
width={step === 'match' || step === 'applying' ? 900 : 640}
|
width={step === 'match' || step === 'applying' ? 900 : 640}
|
||||||
maskClosable={false}
|
mask={{ closable: false }}
|
||||||
footer={
|
footer={
|
||||||
step === 'connection'
|
step === 'connection'
|
||||||
? [
|
? [
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ const DEFAULT_FORM_VALUES: FormValues = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const STEP_ITEMS = [
|
const STEP_ITEMS = [
|
||||||
{ title: '服务商', description: '选择 AI 服务商' },
|
{ title: '服务商', content: '选择 AI 服务商' },
|
||||||
{ title: '密钥', description: '配置 API 密钥' },
|
{ title: '密钥', content: '配置 API 密钥' },
|
||||||
{ title: '模型', description: '获取并选择模型' },
|
{ title: '模型', content: '获取并选择模型' },
|
||||||
{ title: '完成', description: '保存并测试连接' },
|
{ title: '完成', content: '保存并测试连接' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const AiConfigPage: React.FC = () => {
|
const AiConfigPage: React.FC = () => {
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ export const AttendanceAdminWorkspace: React.FC<{
|
|||||||
</Spin>
|
</Spin>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<Card className="student-record-card" bordered={false} title="原始考勤明细">
|
<Card className="student-record-card" variant="borderless" title="原始考勤明细">
|
||||||
<Table<AttendanceRecordItem>
|
<Table<AttendanceRecordItem>
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -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 { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
import { useApiMutation } from '../../hooks/useApiMutation';
|
import { useApiMutation } from '../../hooks/useApiMutation';
|
||||||
import { validateResponse } from '../../utils/validate';
|
import { validateResponse } from '../../utils/validate';
|
||||||
@@ -134,10 +134,6 @@ export const AdminAttendanceArchive: React.FC<{ canEdit: boolean }> = ({ canEdit
|
|||||||
? scheduleId
|
? scheduleId
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
periodForm.setFieldsValue({ periods });
|
|
||||||
}, [periods, periodForm]);
|
|
||||||
|
|
||||||
const enabledPeriods = useMemo(
|
const enabledPeriods = useMemo(
|
||||||
() => periods.filter((period) => period.enabled).sort((a, b) => a.sortOrder - b.sortOrder),
|
() => periods.filter((period) => period.enabled).sort((a, b) => a.sortOrder - b.sortOrder),
|
||||||
[periods],
|
[periods],
|
||||||
|
|||||||
@@ -531,22 +531,22 @@ export const ClassAttendanceTab: React.FC<{
|
|||||||
{attendanceSummary && (
|
{attendanceSummary && (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col xs={12} md={6}>
|
<Col xs={12} md={6}>
|
||||||
<Card bordered={false}>
|
<Card variant="borderless">
|
||||||
<Statistic title="总记录" value={attendanceSummary.total} />
|
<Statistic title="总记录" value={attendanceSummary.total} />
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={12} md={6}>
|
<Col xs={12} md={6}>
|
||||||
<Card bordered={false}>
|
<Card variant="borderless">
|
||||||
<Statistic title="出勤率" value={attendanceSummary.presentRate} suffix="%" />
|
<Statistic title="出勤率" value={attendanceSummary.presentRate} suffix="%" />
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={12} md={6}>
|
<Col xs={12} md={6}>
|
||||||
<Card bordered={false}>
|
<Card variant="borderless">
|
||||||
<Statistic title="缺勤率" value={attendanceSummary.absentRate} suffix="%" />
|
<Statistic title="缺勤率" value={attendanceSummary.absentRate} suffix="%" />
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={12} md={6}>
|
<Col xs={12} md={6}>
|
||||||
<Card bordered={false}>
|
<Card variant="borderless">
|
||||||
<Statistic title="迟到率" value={attendanceSummary.lateRate} suffix="%" />
|
<Statistic title="迟到率" value={attendanceSummary.lateRate} suffix="%" />
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ const ExamDetailPage: React.FC = () => {
|
|||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
{detail.status === 'archived' ? (
|
{detail.status === 'archived' ? (
|
||||||
<Alert type="info" showIcon message="该考试已归档,成绩仅供查看。如需继续录入,请先在考试列表中恢复。" />
|
<Alert type="info" showIcon title="该考试已归档,成绩仅供查看。如需继续录入,请先在考试列表中恢复。" />
|
||||||
) : null}
|
) : null}
|
||||||
<Card className="exam-summary">
|
<Card className="exam-summary">
|
||||||
<Descriptions column={{ xs: 1, sm: 2, lg: 5 }}>
|
<Descriptions column={{ xs: 1, sm: 2, lg: 5 }}>
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export const CheckInModal: React.FC<{
|
|||||||
label="押金金额"
|
label="押金金额"
|
||||||
rules={[{ required: true, message: '请输入押金金额' }]}
|
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>
|
</Form.Item>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ export const ScheduleModal: React.FC<ScheduleModalProps> = ({
|
|||||||
min={0}
|
min={0}
|
||||||
max={1440}
|
max={1440}
|
||||||
step={5}
|
step={5}
|
||||||
addonAfter="分钟"
|
suffix="分钟"
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
placeholder="例如 30"
|
placeholder="例如 30"
|
||||||
/>
|
/>
|
||||||
@@ -422,7 +422,7 @@ export const SyncModal: React.FC<SyncModalProps> = ({
|
|||||||
title="排班数"
|
title="排班数"
|
||||||
value={syncResult.syncedItems}
|
value={syncResult.syncedItems}
|
||||||
suffix="条"
|
suffix="条"
|
||||||
valueStyle={{ color: '#3f8600' }}
|
styles={{ content: { color: '#3f8600' } }}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
@@ -480,9 +480,11 @@ export const SyncModal: React.FC<SyncModalProps> = ({
|
|||||||
title="已就绪班级"
|
title="已就绪班级"
|
||||||
value={syncStatus.mappedClasses}
|
value={syncStatus.mappedClasses}
|
||||||
suffix={`/ ${syncStatus.totalClasses}`}
|
suffix={`/ ${syncStatus.totalClasses}`}
|
||||||
valueStyle={{
|
styles={{
|
||||||
color:
|
content: {
|
||||||
syncStatus.mappedClasses < syncStatus.totalClasses ? '#faad14' : '#3f8600',
|
color:
|
||||||
|
syncStatus.mappedClasses < syncStatus.totalClasses ? '#faad14' : '#3f8600',
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ const WalletsPage: React.FC = () => {
|
|||||||
extra="充值填正数;调减余额时填写负数。充值后会按最早账单优先自动补扣。"
|
extra="充值填正数;调减余额时填写负数。充值后会按最早账单优先自动补扣。"
|
||||||
rules={[{ required: true, message: '请输入金额' }]}
|
rules={[{ required: true, message: '请输入金额' }]}
|
||||||
>
|
>
|
||||||
<InputNumber precision={2} style={{ width: '100%' }} addonBefore="¥" />
|
<InputNumber precision={2} style={{ width: '100%' }} prefix="¥" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item name="description" label="备注">
|
<Form.Item name="description" label="备注">
|
||||||
@@ -384,7 +384,7 @@ const WalletsPage: React.FC = () => {
|
|||||||
extra="充值填正数;调减余额时填写负数。充值后会按最早账单优先自动补扣。"
|
extra="充值填正数;调减余额时填写负数。充值后会按最早账单优先自动补扣。"
|
||||||
rules={[{ required: true, message: '请输入金额' }]}
|
rules={[{ required: true, message: '请输入金额' }]}
|
||||||
>
|
>
|
||||||
<InputNumber precision={2} style={{ width: '100%' }} addonBefore="¥" />
|
<InputNumber precision={2} style={{ width: '100%' }} prefix="¥" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item name="description" label="备注">
|
<Form.Item name="description" label="备注">
|
||||||
|
|||||||
Reference in New Issue
Block a user