|
@@ -1,137 +1,135 @@
|
|
-English | [简体中文](./README.zh-CN.md) | [Русский](./README.ru-RU.md)
|
|
|
|
|
|
+# 🚀 项目名称 xinkeaboard-admin
|
|
|
|
|
|
-<h1 align="center">Ant Design Pro</h1>
|
|
|
|
|
|
+> 基于 [UmiJS](https://umijs.org/) 和 Ant Design 的中后台管理系统,支持动态主题切换、高性能构建与模块化开发。
|
|
|
|
|
|
-<div align="center">
|
|
|
|
|
|
+---
|
|
|
|
|
|
-An out-of-box UI solution for enterprise applications as a React boilerplate.
|
|
|
|
|
|
+## 📦 技术栈
|
|
|
|
|
|
-[](https://circleci.com/gh/ant-design/ant-design-pro/)
|
|
|
|
-[](https://ci.appveyor.com/project/afc163/ant-design-pro/branch/master)
|
|
|
|
-[](https://david-dm.org/ant-design/ant-design-pro)
|
|
|
|
-[](https://david-dm.org/ant-design/ant-design-pro?type=dev)
|
|
|
|
-[](https://gitter.im/ant-design/pro-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)(🇺🇸)
|
|
|
|
-[](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)(🇨🇳)
|
|
|
|
|
|
+- **框架**:UmiJS
|
|
|
|
+- **UI 组件**:Ant Design
|
|
|
|
+- **语言**:TypeScript
|
|
|
|
+- **样式**:Less
|
|
|
|
+- **包管理器**:pnpm 10.12.1+
|
|
|
|
+- **运行环境**:Node.js 18.20.4+
|
|
|
|
|
|
|
|
+---
|
|
|
|
|
|
-
|
|
|
|
|
|
+## ⚙️ 环境准备
|
|
|
|
|
|
-</div>
|
|
|
|
|
|
+建议使用 [nvm](https://github.com/nvm-sh/nvm) 管理 Node.js 版本:
|
|
|
|
|
|
-- Preview: http://preview.pro.ant.design
|
|
|
|
-- Home Page: http://pro.ant.design
|
|
|
|
-- Documentation: http://pro.ant.design/docs/getting-started
|
|
|
|
-- ChangeLog: http://pro.ant.design/docs/changelog
|
|
|
|
-- FAQ: http://pro.ant.design/docs/faq
|
|
|
|
-- Mirror Site in China: http://ant-design-pro.gitee.io
|
|
|
|
|
|
+```bash
|
|
|
|
+nvm install 18.20.4
|
|
|
|
+nvm use 18.20.4
|
|
|
|
+```
|
|
|
|
|
|
-## 2.0 Released Now! 🎉🎉🎉
|
|
|
|
-[Announcing Ant Design Pro 2.0.0](https://medium.com/ant-design/beautiful-and-powerful-ant-design-pro-2-0-release-51358da5af95)
|
|
|
|
|
|
+安装 pnpm:
|
|
|
|
|
|
-## Translation Recruitment :loudspeaker:
|
|
|
|
|
|
+```bash
|
|
|
|
+npm install -g pnpm@10.12.1
|
|
|
|
+```
|
|
|
|
|
|
-We need your help: https://github.com/ant-design/ant-design-pro/issues/120
|
|
|
|
|
|
+---
|
|
|
|
|
|
-## Features
|
|
|
|
|
|
+## 🚀 快速开始
|
|
|
|
|
|
-- :gem: **Neat Design**: Follow [Ant Design specification](http://ant.design/)
|
|
|
|
-- :triangular_ruler: **Common Templates**: Typical templates for enterprise applications
|
|
|
|
-- :rocket: **State of The Art Development**: Newest development stack of React/umi/dva/antd
|
|
|
|
-- :iphone: **Responsive**: Designed for variable screen sizes
|
|
|
|
-- :art: **Theming**: Customizable theme with simple config
|
|
|
|
-- :globe_with_meridians: **International**: Built-in i18n solution
|
|
|
|
-- :gear: **Best Practices**: Solid workflow to make your code healthy
|
|
|
|
-- :1234: **Mock development**: Easy to use mock development solution
|
|
|
|
-- :white_check_mark: **UI Test**: Fly safely with unit and e2e tests
|
|
|
|
|
|
|
|
-## Templates
|
|
|
|
|
|
+### 1. 安装依赖
|
|
|
|
|
|
|
|
+```bash
|
|
|
|
+pnpm install
|
|
```
|
|
```
|
|
-- Dashboard
|
|
|
|
- - Analytic
|
|
|
|
- - Monitor
|
|
|
|
- - Workspace
|
|
|
|
-- Form
|
|
|
|
- - Basic Form
|
|
|
|
- - Step Form
|
|
|
|
- - Advanced From
|
|
|
|
-- List
|
|
|
|
- - Standard Table
|
|
|
|
- - Standard List
|
|
|
|
- - Card List
|
|
|
|
- - Search List (Project/Applications/Article)
|
|
|
|
-- Profile
|
|
|
|
- - Simple Profile
|
|
|
|
- - Advanced Profile
|
|
|
|
-- Account
|
|
|
|
- - Account Center
|
|
|
|
- - Account Settings
|
|
|
|
-- Result
|
|
|
|
- - Success
|
|
|
|
- - Failed
|
|
|
|
-- Exception
|
|
|
|
- - 403
|
|
|
|
- - 404
|
|
|
|
- - 500
|
|
|
|
-- User
|
|
|
|
- - Login
|
|
|
|
- - Register
|
|
|
|
- - Register Result
|
|
|
|
|
|
+
|
|
|
|
+### 3. 启动开发环境
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+pnpm start
|
|
```
|
|
```
|
|
|
|
|
|
-## Usage
|
|
|
|
|
|
+访问:http://localhost:8107
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
|
|
-### Use bash
|
|
|
|
|
|
+## 🛠️ 构建与预览
|
|
|
|
+
|
|
|
|
+### 构建生产版本
|
|
|
|
|
|
```bash
|
|
```bash
|
|
-$ git clone https://github.com/ant-design/ant-design-pro.git --depth=1
|
|
|
|
-$ cd ant-design-pro
|
|
|
|
-$ npm install
|
|
|
|
-$ npm start # visit http://localhost:8000
|
|
|
|
|
|
+pnpm build
|
|
```
|
|
```
|
|
|
|
|
|
-### Use by docker
|
|
|
|
|
|
+### 本地预览构建结果
|
|
|
|
|
|
```bash
|
|
```bash
|
|
-# preview
|
|
|
|
-$ docker pull chenshuai2144/ant-design-pro
|
|
|
|
-$ docker run -p 80:80 chenshuai2144/ant-design-pro
|
|
|
|
-# open http://localhost
|
|
|
|
|
|
+pnpm preview
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
|
|
-# dev
|
|
|
|
-$ npm run docker:dev
|
|
|
|
|
|
+## 📁 项目结构
|
|
|
|
|
|
-# build
|
|
|
|
-$ npm run docker:build
|
|
|
|
|
|
+```
|
|
|
|
+├── public/ # 公共资源
|
|
|
|
+├── src/ # 源码目录
|
|
|
|
+│ ├── assets/ # 图片、图标等资源
|
|
|
|
+│ ├── components/ # 通用组件
|
|
|
|
+│ ├── layouts/ # 页面布局
|
|
|
|
+│ ├── models/ # 状态模型(可选)
|
|
|
|
+│ ├── pages/ # 页面目录
|
|
|
|
+│ ├── services/ # 接口请求
|
|
|
|
+│ ├── styles/ # 全局样式
|
|
|
|
+│ ├── app.tsx # 应用入口
|
|
|
|
+│ └── global.less # 全局 less
|
|
|
|
+├── .umirc.ts # Umi 配置文件
|
|
|
|
+├── package.json
|
|
|
|
+├── tsconfig.json
|
|
|
|
+└── README.md
|
|
|
|
+```
|
|
|
|
|
|
|
|
+---
|
|
|
|
|
|
-# production dev
|
|
|
|
-$ npm run docker-prod:dev
|
|
|
|
|
|
+## 📦 常用命令
|
|
|
|
|
|
-# production build
|
|
|
|
-$ npm run docker-prod:build
|
|
|
|
-```
|
|
|
|
|
|
+| 命令 | 说明 |
|
|
|
|
+|------|------|
|
|
|
|
+| `pnpm start` | 启动开发服务器 |
|
|
|
|
+| `pnpm build` | 构建生产版本 |
|
|
|
|
+| `pnpm preview` | 预览构建产物 |
|
|
|
|
+| `pnpm lint` | 代码规范检查(可选) |
|
|
|
|
+| `pnpm format` | 格式化代码(可选) |
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
+
|
|
|
|
+## 🧠 常见问题
|
|
|
|
+
|
|
|
|
+###1. 启动或构建内存不足报错?
|
|
|
|
|
|
-More instructions at [documentation](http://pro.ant.design/docs/getting-started).
|
|
|
|
|
|
+可以提升 Node 内存限制:
|
|
|
|
|
|
-## Browsers support
|
|
|
|
|
|
+```bash
|
|
|
|
+export NODE_OPTIONS="--max_old_space_size=6666"
|
|
|
|
+```
|
|
|
|
|
|
-Modern browsers and IE11.
|
|
|
|
|
|
+或者在 `package.json` 中配置:
|
|
|
|
|
|
-| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
|
|
|
|
-| --------- | --------- | --------- | --------- | --------- |
|
|
|
|
-| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
|
|
|
|
|
|
+```json
|
|
|
|
+"scripts": {
|
|
|
|
+ "start": "cross-env APP_TYPE=site NODE_OPTIONS=--max_old_space_size=6666 umi dev --port=8107",
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
|
|
-## Contributing
|
|
|
|
|
|
+###2. 让 Node 使用 OpenSSL 旧版兼容模式,避免新版本加密错误
|
|
|
|
|
|
-Any type of contribution is welcome, here are some examples of how you may contribute to this project:
|
|
|
|
|
|
|
|
-- Use Ant Design Pro in your daily work.
|
|
|
|
-- Submit [issues](http://github.com/ant-design/ant-design-pro/issues) to report bugs or ask questions.
|
|
|
|
-- Propose [pull requests](http://github.com/ant-design/ant-design-pro/pulls) to improve our code.
|
|
|
|
|
|
+```bash
|
|
|
|
+export NODE_OPTIONS="--openssl-legacy-provider"
|
|
|
|
+```
|
|
|
|
|
|
|
|
+或者在 `package.json` 中配置:
|
|
|
|
|
|
-**主题色转换需要调整两处:**
|
|
|
|
-1.defaultSettings.js
|
|
|
|
-2.themeColor.less
|
|
|
|
-3.更新antd主题色要重新install
|
|
|
|
|
|
+```json
|
|
|
|
+"scripts": {
|
|
|
|
+ "start": "cross-env APP_TYPE=site NODE_OPTIONS=--openssl-legacy-provider umi dev --port=8107",
|
|
|
|
+}
|
|
|
|
+```
|