Skip to content

Commit cc6114f

Browse files
author
lunarych
committed
frontend: update dataset
1 parent 6978722 commit cc6114f

35 files changed

+763
-986
lines changed

frontend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ dist
1212
dist-ssr
1313
*.local
1414

15+
src/mock/sessions/*
16+
1517
# Editor directories and files
1618
.vscode/*
1719
!.vscode/extensions.json

frontend/README.md

Lines changed: 91 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,96 @@
1-
# React + TypeScript + Vite
1+
🚀 快速开始
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4-
5-
Currently, two official plugins are available:
6-
7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9-
10-
## Expanding the ESLint configuration
11-
12-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13-
14-
```js
15-
export default tseslint.config([
16-
globalIgnores(['dist']),
17-
{
18-
files: ['**/*.{ts,tsx}'],
19-
extends: [
20-
// Other configs...
21-
22-
// Remove tseslint.configs.recommended and replace with this
23-
...tseslint.configs.recommendedTypeChecked,
24-
// Alternatively, use this for stricter rules
25-
...tseslint.configs.strictTypeChecked,
26-
// Optionally, add this for stylistic rules
27-
...tseslint.configs.stylisticTypeChecked,
28-
29-
// Other configs...
30-
],
31-
languageOptions: {
32-
parserOptions: {
33-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
34-
tsconfigRootDir: import.meta.dirname,
35-
},
36-
// other options...
37-
},
38-
},
39-
])
3+
```
4+
npm install # 安装依赖
5+
npm run dev # 启动项目
6+
npm run mock # 启动后台Mock服务(可选)
407
```
418

42-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43-
44-
```js
45-
// eslint.config.js
46-
import reactX from 'eslint-plugin-react-x'
47-
import reactDom from 'eslint-plugin-react-dom'
9+
📁 项目结构
4810

49-
export default tseslint.config([
50-
globalIgnores(['dist']),
51-
{
52-
files: ['**/*.{ts,tsx}'],
53-
extends: [
54-
// Other configs...
55-
// Enable lint rules for React
56-
reactX.configs['recommended-typescript'],
57-
// Enable lint rules for React DOM
58-
reactDom.configs.recommended,
59-
],
60-
languageOptions: {
61-
parserOptions: {
62-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
63-
tsconfigRootDir: import.meta.dirname,
64-
},
65-
// other options...
66-
},
67-
},
68-
])
11+
```
12+
frontend/
13+
├── public/ # 📖 文档中心
14+
│ ├── huawei-logo.webp/ # logo
15+
│ └── xxx/ # 标注工作台(可分离部署)
16+
17+
├── src/ # 🎨 前端应用
18+
│ ├── apps/ # 多前端应用
19+
│ │ ├── console/ # 数据工作台&运营控制台
20+
│ │ │ ├── next.config.js
21+
│ │ │ ├── package.json
22+
│ │ │ └── src/
23+
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
24+
│ │
25+
│ ├── assets/ # 共享UI组件/SDK
26+
│ │ ├── xxx/ # 数据工作台&运营控制台
27+
│ │ │ ├── next.config.js
28+
│ │ │ └── src/
29+
│ │ │
30+
│ │ │
31+
│ │ └── xxx/ # 数据工作台&运营控制台
32+
│ │ ├── package.json
33+
│ │ └── src/
34+
│ │
35+
│ ├── components/ # 构建与环境配置
36+
│ │ ├── CardView.tsx # 数据工作台&运营控制台
37+
│ │ ├── DetailHeader.tsx # 数据工作台&运营控制台
38+
│ │ ├── RadioCard.tsx # 数据工作台&运营控制台
39+
│ │ ├── SearchControls # 数据工作台&运营控制台
40+
│ │ ├── TagList # 标注工作台(可分离部署)
41+
│ │ └── TaskPopover # 标注工作台(可分离部署)
42+
│ │
43+
│ ├── hooks/ # 构建与环境配置
44+
│ │ ├── console/ # 数据工作台&运营控制台
45+
│ │ ├── next.config.js
46+
│ │ ├── next.config.js
47+
│ │ ├── next.config.js
48+
│ │ ├── next.config.js
49+
│ │ ├── next.config.js
50+
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
51+
│ │
52+
│ ├── mock/ # 构建与环境配置
53+
│ │ ├── console/ # 数据工作台&运营控制台
54+
│ │ ├── next.config.js
55+
│ │ ├── next.config.js
56+
│ │ ├── next.config.js
57+
│ │ ├── next.config.js
58+
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
59+
│ │
60+
│ ├── pages/ # 构建与环境配置
61+
│ │ ├── console/ # 数据工作台&运营控制台
62+
│ │ │ ├── next.config.js
63+
│ │ │ ├── package.json
64+
│ │ │ └── src/
65+
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
66+
│ │
67+
│ ├── providers/ # 构建与环境配置
68+
│ │ ├── console/ # 数据工作台&运营控制台
69+
│ │ │ ├── next.config.js
70+
│ │ │ ├── package.json
71+
│ │ │ └── src/
72+
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
73+
│ │
74+
│ ├── routes/ # 构建与环境配置
75+
│ │ └── next.config.js
76+
│ │
77+
│ ├── types/ # 构建与环境配置
78+
│ │ ├── next.config.js
79+
│ │ ├── next.config.js
80+
│ │ ├── next.config.js
81+
│ │ ├── next.config.js
82+
│ │ └── next.config.js
83+
│ │
84+
│ └── utils/ # 构建与环境配置
85+
│ ├── next.config.js
86+
│ ├── next.config.js
87+
│ └── next.config.js
88+
89+
├── eslint.config.js/ # 🔧 后端服务架构
90+
├── index.html/ # 🔧 后端服务架构
91+
├── package.json/ # 🔧 后端服务架构
92+
├── README.md # 项目说明
93+
├── tailwind.config.ts # 更新日志
94+
├── vite.config.ts # 开源协议
95+
└── pom.xml # Maven根配置
6996
```

frontend/public/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/src/app/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createRoot } from "react-dom/client";
33
import { RouterProvider } from "react-router";
44
import router from "../routes/routes";
55

6-
function App() {
6+
export function App() {
77
return (
88
<StrictMode>
99
<RouterProvider router={router} key="router" />

frontend/src/main.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { StrictMode } from "react";
1+
import { StrictMode, Suspense } from "react";
22
import { createRoot } from "react-dom/client";
33
import { RouterProvider } from "react-router";
44
import router from "./routes/routes";
5-
import { App as AntdApp } from "antd";
5+
import { App as AntdApp, Spin } from "antd";
66
import "./index.css";
77

88
createRoot(document.getElementById("root")!).render(
99
<StrictMode>
10-
<AntdApp>
11-
<RouterProvider router={router} />
12-
</AntdApp>
10+
<Suspense fallback={<Spin />}>
11+
<AntdApp>
12+
<RouterProvider router={router} />
13+
</AntdApp>
14+
</Suspense>
1315
</StrictMode>
1416
);

0 commit comments

Comments
 (0)