Skip to content

Commit a409cdb

Browse files
committed
重构ChallengeContributePage组件:优化UI/UX,添加步骤式表单、备份恢复功能和响应式设计
1 parent 0248754 commit a409cdb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+6490
-2503
lines changed
1.7 MB
Loading

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
**在线访问**: [https://jsrep.github.io/crawler-leetcode/](https://jsrep.github.io/crawler-leetcode/)
88

9+
![image-20250413185708120](./README.assets/image-20250413185708120.png)
10+
911
## 项目结构
1012

1113
```

docs/challenges/kaitorishouten买取商店价格加密.yml

Lines changed: 17 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
id: 112
2+
id-alias: 国家标准全文公开系统
3+
platform: Web
4+
name: 国家标准全文公开系统
5+
name_en: China National Standards Public Service Platform
6+
difficulty-level: 3
7+
description-markdown: |-
8+
点"在线预览",跳转有检测
9+
tags:
10+
- js-reverse
11+
solutions: []
12+
create-time: 2025-04-13 16:53:26
13+
update-time: 2025-04-13 08:54:06

package-lock.json

Lines changed: 138 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
"dependencies": {
1616
"@ant-design/icons": "^5.6.1",
1717
"@types/markdown-it": "^14.1.2",
18+
"@types/react-beautiful-dnd": "^13.1.8",
1819
"@types/react-responsive": "^8.0.8",
1920
"antd": "^5.16.4",
2021
"fuse.js": "^7.1.0",
2122
"i18next": "^24.2.2",
2223
"i18next-browser-languagedetector": "^8.0.4",
2324
"markdown-it": "^14.1.0",
2425
"react": "^18.2.0",
26+
"react-beautiful-dnd": "^13.1.1",
2527
"react-dom": "^18.2.0",
2628
"react-ga4": "^2.1.0",
2729
"react-i18next": "^15.4.1",
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import * as React from 'react';
2+
import { Modal, List, Button, Space, Empty, Typography, Divider } from 'antd';
3+
import { ReloadOutlined, HistoryOutlined, DeleteOutlined } from '@ant-design/icons';
4+
5+
const { Text, Title } = Typography;
6+
7+
interface BackupHistoryModalProps {
8+
visible: boolean;
9+
onClose: () => void;
10+
backupOptions: { label: string; value: string }[];
11+
onRecover: (timestamp: string) => void;
12+
}
13+
14+
/**
15+
* 备份历史模态框组件
16+
* 用于显示和恢复历史备份
17+
*/
18+
const BackupHistoryModal: React.FC<BackupHistoryModalProps> = ({
19+
visible,
20+
onClose,
21+
backupOptions,
22+
onRecover
23+
}) => {
24+
return (
25+
<Modal
26+
title={
27+
<Space>
28+
<HistoryOutlined />
29+
<span>备份历史</span>
30+
</Space>
31+
}
32+
open={visible}
33+
onCancel={onClose}
34+
footer={[
35+
<Button key="close" onClick={onClose}>
36+
关闭
37+
</Button>
38+
]}
39+
width={600}
40+
>
41+
{backupOptions.length === 0 ? (
42+
<Empty description="没有找到可用的备份历史" />
43+
) : (
44+
<>
45+
<Text type="secondary" style={{ display: 'block', marginBottom: 16 }}>
46+
您可以恢复以下任一备份。点击"恢复"按钮将用所选备份替换当前表单数据。
47+
</Text>
48+
49+
<Divider />
50+
51+
<List
52+
itemLayout="horizontal"
53+
dataSource={backupOptions}
54+
renderItem={item => (
55+
<List.Item
56+
key={item.value}
57+
actions={[
58+
<Button
59+
key="recover"
60+
type="primary"
61+
icon={<ReloadOutlined />}
62+
onClick={() => onRecover(item.value)}
63+
>
64+
恢复
65+
</Button>
66+
]}
67+
>
68+
<List.Item.Meta
69+
avatar={<HistoryOutlined style={{ fontSize: 24 }} />}
70+
title={<Title level={5}>备份时间: {item.label}</Title>}
71+
description="点击恢复按钮将用此备份替换当前表单数据。此操作不可撤销。"
72+
/>
73+
</List.Item>
74+
)}
75+
/>
76+
</>
77+
)}
78+
</Modal>
79+
);
80+
};
81+
82+
export default BackupHistoryModal;

0 commit comments

Comments
 (0)