Repository: ant-design/ant-design-pro Branch: master Commit: 607e63f4fdb4 Files: 148 Total size: 348.3 KB Directory structure: gitextract_xtrkxl0a/ ├── .commitlintrc.js ├── .editorconfig ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ ├── feature_request.md │ │ └── question.md │ ├── dependabot.yml │ └── workflows/ │ ├── ci.yml │ ├── coverage.yml │ ├── deploy.yml │ ├── emoji-helper.yml │ ├── issue-labeled.yml │ ├── issue-open-check.yml │ ├── preview-build.yml │ ├── preview-deploy.yml │ └── preview-start.yml ├── .gitignore ├── .husky/ │ ├── commit-msg │ └── pre-commit ├── .lintstagedrc ├── .npmrc ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.ar-DZ.md ├── README.es-ES.md ├── README.fr-FR.md ├── README.ja-JP.md ├── README.md ├── README.pt-BR.md ├── README.ru-RU.md ├── README.tr-TR.md ├── README.zh-CN.md ├── biome.json ├── config/ │ ├── config.ts │ ├── defaultSettings.ts │ ├── oneapi.json │ ├── proxy.ts │ └── routes.ts ├── jest.config.ts ├── mock/ │ ├── listTableList.ts │ ├── monitor.mock.ts │ ├── notices.ts │ ├── requestRecord.mock.js │ ├── route.ts │ └── user.ts ├── package.json ├── public/ │ ├── CNAME │ └── scripts/ │ └── loading.js ├── src/ │ ├── access.ts │ ├── app.tsx │ ├── components/ │ │ ├── Footer/ │ │ │ └── index.tsx │ │ ├── HeaderDropdown/ │ │ │ └── index.tsx │ │ ├── RightContent/ │ │ │ ├── AvatarDropdown.tsx │ │ │ └── index.tsx │ │ └── index.ts │ ├── global.less │ ├── global.style.ts │ ├── global.tsx │ ├── loading.tsx │ ├── locales/ │ │ ├── bn-BD/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── bn-BD.ts │ │ ├── en-US/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── en-US.ts │ │ ├── fa-IR/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── fa-IR.ts │ │ ├── id-ID/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── id-ID.ts │ │ ├── ja-JP/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── ja-JP.ts │ │ ├── pt-BR/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── pt-BR.ts │ │ ├── zh-CN/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ ├── zh-CN.ts │ │ ├── zh-TW/ │ │ │ ├── component.ts │ │ │ ├── globalHeader.ts │ │ │ ├── menu.ts │ │ │ ├── pages.ts │ │ │ ├── pwa.ts │ │ │ ├── settingDrawer.ts │ │ │ └── settings.ts │ │ └── zh-TW.ts │ ├── manifest.json │ ├── pages/ │ │ ├── 404.tsx │ │ ├── Admin.tsx │ │ ├── Welcome.tsx │ │ ├── table-list/ │ │ │ ├── components/ │ │ │ │ ├── CreateForm.tsx │ │ │ │ └── UpdateForm.tsx │ │ │ └── index.tsx │ │ └── user/ │ │ └── login/ │ │ ├── __snapshots__/ │ │ │ └── login.test.tsx.snap │ │ ├── index.tsx │ │ └── login.test.tsx │ ├── requestErrorConfig.ts │ ├── service-worker.js │ ├── services/ │ │ ├── ant-design-pro/ │ │ │ ├── api.ts │ │ │ ├── index.ts │ │ │ ├── login.ts │ │ │ └── typings.d.ts │ │ └── swagger/ │ │ ├── index.ts │ │ ├── pet.ts │ │ ├── store.ts │ │ ├── typings.d.ts │ │ └── user.ts │ └── typings.d.ts ├── tests/ │ └── setupTests.jsx ├── tsconfig.json └── types/ └── index.d.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .commitlintrc.js ================================================ module.exports = { extends: ['@commitlint/config-conventional'] }; ================================================ FILE: .editorconfig ================================================ # http://editorconfig.org root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [Makefile] indent_style = tab ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: ant-design ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: '报告 Bug | Report bug 🐛' about: 报告 Ant Design Pro 的 bug title: '🐛 [BUG]' labels: '🐛 bug' assignees: '' --- ### 🐛 bug 描述 ### 📷 复现步骤 | Recurrence steps ### 🏞 期望结果 | Expected results ### 💻 复现代码 | Recurrence code ### © 版本信息 - Ant Design Pro 版本: [e.g. 4.0.0] - umi 版本 - 浏览器环境 - 开发环境 [e.g. mac OS] ### 🚑 其他信息 ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: '功能需求 | Feature Requirements ✨' about: 对 Ant Design Pro 的需求或建议 title: '👑 [需求 | Feature]' labels: '👑 Feature Request' assignees: '' --- ### 🥰 需求描述 | Requirements description ### 🧐 解决方案 | Solution ### 🚑 其他信息 | Other information ================================================ FILE: .github/ISSUE_TEMPLATE/question.md ================================================ --- name: '疑问或需要帮助 | Questions or need help ❓' about: 对 Ant Design Pro 使用的疑问或需要帮助 title: '🧐[问题 | question]' labels: '🧐 question' assignees: '' --- ### 🧐 问题描述 | Problem description ### 💻 示例代码 | Sample code ### 🚑 其他信息 | Other information OS: Node: 浏览器 | browser: ================================================ FILE: .github/dependabot.yml ================================================ # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file version: 2 updates: - package-ecosystem: 'npm' # See documentation for possible values directory: '/' # Location of package manifests schedule: interval: 'daily' ================================================ FILE: .github/workflows/ci.yml ================================================ name: CI on: [push, pull_request] permissions: contents: read jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: node_version: [20] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node_version }} uses: actions/setup-node@v5 with: node-version: ${{ matrix.node_version }} - run: echo ${{github.ref}} - uses: oven-sh/setup-bun@v2 - run: bun install - run: bun run lint - run: bun run build env: CI: true PROGRESS: none NODE_ENV: test NODE_OPTIONS: --max_old_space_size=4096 ================================================ FILE: .github/workflows/coverage.yml ================================================ name: coverage CI on: [push, pull_request] permissions: contents: read jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Use Node.js 20 uses: actions/setup-node@v5 with: node-version: 20 - run: echo ${{github.ref}} - uses: oven-sh/setup-bun@v2 - run: bun install - run: bun run test:coverage - uses: codecov/codecov-action@v5 ================================================ FILE: .github/workflows/deploy.yml ================================================ name: Deploy to GitHub Pages on: push: branches: - all-blocks jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Install Bun uses: oven-sh/setup-bun@v2 - name: Install dependencies with Bun run: bun install - name: Build project run: bun run build - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist cname: preview.pro.ant.design ================================================ FILE: .github/workflows/emoji-helper.yml ================================================ name: Emoji Helper on: release: types: [published] jobs: emoji: runs-on: ubuntu-latest steps: - uses: actions-cool/emoji-helper@v1.0.0 with: type: 'release' emoji: '+1, laugh, heart, hooray, rocket, eyes' ================================================ FILE: .github/workflows/issue-labeled.yml ================================================ name: Issue labeled on: issues: types: [labeled] jobs: reply-helper: runs-on: ubuntu-latest steps: - name: help wanted if: github.event.label.name == '❤️ help wanted' || github.event.label.name == '🤝Welcome PR' uses: actions-cool/issues-helper@v1.11 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请务必提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。 ![giphy](https://user-images.githubusercontent.com/507615/62342668-4735dc00-b51a-11e9-92a7-d46fbb1cc0c7.gif) - name: Need Reproduce if: github.event.label.name == '🤔 Need Reproduce' uses: actions-cool/issues-helper@v1.11 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}. Please provide a online reproduction by forking this link https://codesandbox.io/ or a minimal GitHub repository. 你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 [此处](https://codesandbox.io/) 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。 ![](https://gw.alipayobjects.com/zos/antfincdn/y9kwg7DVCd/reproduce.gif) ================================================ FILE: .github/workflows/issue-open-check.yml ================================================ name: Issue Open Check on: issues: types: [opened, edited] jobs: check-issue: runs-on: ubuntu-latest steps: - uses: actions-cool/issues-helper@v2.2.0 id: check with: actions: 'check-issue' issue-number: ${{ github.event.issue.number }} title-excludes: '🐛 [BUG], 👑 [需求 | Feature], 🧐[问题 | question]' - if: steps.check.outputs.check-result == 'false' && github.event.issue.state == 'open' uses: actions-cool/issues-helper@v2.2.0 with: actions: 'create-comment, close-issue' issue-number: ${{ github.event.issue.number }} body: | 当前 Issue 未检测到标题,请规范填写,谢谢! The title of the current issue is not detected, please fill in according to the specifications, thank you! - if: steps.check.outputs.check-result == 'true' uses: actions-cool/issues-similarity-analysis@v1 with: filter-threshold: 0.8 title-excludes: '🐛[BUG], 👑 [需求 | Feature], 🧐[问题 | question]' comment-title: '### 以下的 Issues 可能会帮助到你 / The following issues may help you' show-footer: false ================================================ FILE: .github/workflows/preview-build.yml ================================================ name: Preview Build on: pull_request: types: [opened, synchronize, reopened] permissions: contents: read jobs: build-preview: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} - uses: oven-sh/setup-bun@v2 - run: bun install - run: bun run build - name: upload dist artifact uses: actions/upload-artifact@v4 with: name: dist path: dist/ retention-days: 5 - name: Save PR number if: ${{ always() }} run: echo ${{ github.event.number }} > ./pr-id.txt - name: Upload PR number if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: pr path: ./pr-id.txt ================================================ FILE: .github/workflows/preview-deploy.yml ================================================ name: Preview Deploy on: workflow_run: workflows: ['Preview Build'] types: - completed permissions: contents: read jobs: success: permissions: actions: read # for dawidd6/action-download-artifact to query and download artifacts issues: write # for actions-cool/maintain-one-comment to modify or create issue comments pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments runs-on: ubuntu-latest if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: - name: download pr artifact uses: dawidd6/action-download-artifact@v6 with: workflow: ${{ github.event.workflow_run.workflow_id }} name: pr - name: save PR id id: pr run: echo "::set-output name=id::$( body-include: '' number: ${{ steps.pr.outputs.id }} - name: The job failed if: ${{ failure() }} uses: actions-cool/maintain-one-comment@v1.2.1 with: token: ${{ secrets.GITHUB_TOKEN }} body: | 😭 Deploy PR Preview failed. body-include: '' number: ${{ steps.pr.outputs.id }} failed: permissions: actions: read # for dawidd6/action-download-artifact to query and download artifacts issues: write # for actions-cool/maintain-one-comment to modify or create issue comments pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments runs-on: ubuntu-latest if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' steps: - name: download pr artifact uses: dawidd6/action-download-artifact@v6 with: workflow: ${{ github.event.workflow_run.workflow_id }} name: pr - name: save PR id id: pr run: echo "::set-output name=id::$( body-include: '' number: ${{ steps.pr.outputs.id }} ================================================ FILE: .github/workflows/preview-start.yml ================================================ name: Preview Start on: pull_request_target permissions: contents: read jobs: preview: permissions: issues: write # for actions-cool/maintain-one-comment to modify or create issue comments pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments runs-on: ubuntu-latest steps: - name: create uses: actions-cool/maintain-one-comment@v1.2.1 with: token: ${{ secrets.GITHUB_TOKEN }} body: | ⚡️ Deploying PR Preview... body-include: '' ================================================ FILE: .gitignore ================================================ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies **/node_modules # roadhog-api-doc ignore /src/utils/request-temp.js _roadhog-api-doc # production /dist # misc .DS_Store npm-debug.log* yarn-error.log /coverage .idea yarn.lock package-lock.json *bak .vscode # visual studio code .history *.log functions/* .temp/** # umi .umi .umi-production .umi-test .turbopack # screenshot screenshot .firebase build ================================================ FILE: .husky/commit-msg ================================================ npx --no -- commitlint --edit $1 ================================================ FILE: .husky/pre-commit ================================================ lint-staged ================================================ FILE: .lintstagedrc ================================================ { "**/*.{js,jsx,tsx,ts,md,css,less,json}": [ "npx @biomejs/biome check --write" ] } ================================================ FILE: .npmrc ================================================ legacy-peer-deps=true ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences - Gracefully accepting constructive criticism - Focusing on what is best for the community - Showing empathy towards other community members Examples of unacceptable behavior by participants include: - The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or electronic address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at afc163@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2019-present Alipay.inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.ar-DZ.md ================================================ # Ant Design Pro اللغة: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

حل واجهة مستخدم جاهز لتطبيقات المؤسسات مبني على React. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) معاينة السمة الفاتحة معاينة السمة الداكنة
- المعاينة: http://preview.pro.ant.design - الصفحة الرئيسية: http://pro.ant.design - التوثيق: http://pro.ant.design/docs/getting-started - سجل التغييرات: http://pro.ant.design/docs/changelog - الأسئلة الشائعة: http://pro.ant.design/docs/faq ## الميزات - :bulb: **TypeScript**: لغة لتطبيقات JavaScript على نطاق واسع - :scroll: **الكتل**: بناء الصفحات باستخدام قوالب الكتل - :gem: **تصميم أنيق**: يتبع [مواصفات Ant Design](http://ant.design/) - :triangular_ruler: **قوالب شائعة**: قوالب نموذجية لتطبيقات المؤسسات - :rocket: **تطوير حديث**: أحدث تقنيات React/umi/dva/antd - :iphone: **متجاوب**: مصمم لأحجام شاشات مختلفة - :art: **تخصيص السمة**: سمة قابلة للتخصيص بإعداد بسيط - :globe_with_meridians: **دعم اللغات**: حل i18n مدمج - :gear: **أفضل الممارسات**: سير عمل قوي للحفاظ على صحة الكود - :1234: **تطوير وهمي**: حل تطوير وهمي سهل الاستخدام - :white_check_mark: **اختبار الواجهة**: أمان مع اختبارات الوحدة وe2e ## القوالب ``` - لوحة القيادة - تحليلات - مراقبة - مساحة العمل - النماذج - نموذج أساسي - نموذج متعدد الخطوات - نموذج متقدم - القوائم - جدول قياسي - قائمة قياسية - قائمة البطاقات - قائمة البحث (مشروع/تطبيقات/مقال) - الملف الشخصي - ملف شخصي بسيط - ملف شخصي متقدم - الحساب - مركز الحساب - إعدادات الحساب - النتائج - نجاح - فشل - الاستثناءات - 403 - 404 - 500 - المستخدم - تسجيل الدخول - التسجيل - نتيجة التسجيل ``` ## الاستخدام ### استخدام bash نوفر pro-cli لبدء المشروع بسرعة. ```bash # استخدم npm npm i @ant-design/pro-cli -g pro create myapp ``` اختر قالب pro. Simple هو القالب الأساسي الذي يوفر فقط المحتوى الأساسي لتشغيل الإطار. Complete يحتوي على جميع الكتل، وهو غير مناسب كقالب أساسي للتطوير الثانوي. ```shell ? 🚀 مشروع كامل أم هيكل بسيط؟ (استخدم الأسهم) ➥ simple complete ``` تهيئة مستودع Git: ```shell $ git init myapp ``` تثبيت التبعيات: ```shell $ cd myapp && tyarn // أو $ cd myapp && npm install ``` ## المتصفحات المدعومة المتصفحات الحديثة. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | آخر إصدارين | آخر إصدارين | آخر إصدارين | آخر إصدارين | ## المساهمة أي مساهمة مرحب بها. إليك بعض الطرق للمساهمة في هذا المشروع: - استخدم Ant Design Pro في عملك اليومي. - أرسل [issues](http://github.com/ant-design/ant-design-pro/issues) للإبلاغ عن الأخطاء أو طرح الأسئلة. - اقترح [pull requests](http://github.com/ant-design/ant-design-pro/pulls) لتحسين الكود الخاص بنا. ================================================ FILE: README.es-ES.md ================================================ # Ant Design Pro Idioma: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

Una solución de interfaz de usuario lista para usar para aplicaciones empresariales basada en React. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) vista previa del tema claro vista previa del tema oscuro
- Vista previa: http://preview.pro.ant.design - Página principal: http://pro.ant.design - Documentación: http://pro.ant.design/docs/getting-started - Registro de cambios: http://pro.ant.design/docs/changelog - Preguntas frecuentes: http://pro.ant.design/docs/faq ## Características - :bulb: **TypeScript**: Un lenguaje para aplicaciones JavaScript a gran escala - :scroll: **Bloques**: Construye páginas con plantillas de bloques - :gem: **Diseño elegante**: Sigue la [especificación de Ant Design](http://ant.design/) - :triangular_ruler: **Plantillas comunes**: Plantillas típicas para aplicaciones empresariales - :rocket: **Desarrollo de vanguardia**: Stack de desarrollo más reciente con React/umi/dva/antd - :iphone: **Responsivo**: Diseñado para diferentes tamaños de pantalla - :art: **Tematización**: Tema personalizable con configuración sencilla - :globe_with_meridians: **Internacionalización**: Solución i18n integrada - :gear: **Buenas prácticas**: Flujo de trabajo sólido para mantener tu código saludable - :1234: **Desarrollo mock**: Solución de desarrollo mock fácil de usar - :white_check_mark: **Pruebas de UI**: Seguridad con pruebas unitarias y e2e ## Plantillas ``` - Panel de control - Analítica - Monitorización - Espacio de trabajo - Formulario - Formulario básico - Formulario por pasos - Formulario avanzado - Lista - Tabla estándar - Lista estándar - Lista de tarjetas - Lista de búsqueda (Proyecto/Aplicaciones/Artículo) - Perfil - Perfil simple - Perfil avanzado - Cuenta - Centro de cuenta - Configuración de cuenta - Resultado - Éxito - Fallo - Excepción - 403 - 404 - 500 - Usuario - Iniciar sesión - Registrarse - Resultado del registro ``` ## Uso ### Usar bash Proporcionamos pro-cli para inicializar rápidamente el proyecto. ```bash # usar npm npm i @ant-design/pro-cli -g pro create myapp ``` Elige la plantilla pro. Simple es la plantilla básica, que solo proporciona el contenido esencial para el funcionamiento del framework. Complete contiene todos los bloques, por lo que no es adecuada como plantilla base para desarrollo secundario. ```shell ? 🚀 ¿Proyecto completo o un esqueleto simple? (Usa las flechas) ➥ simple complete ``` Inicializa el repositorio Git: ```shell $ git init myapp ``` Instala las dependencias: ```shell $ cd myapp && tyarn // o $ cd myapp && npm install ``` ## Navegadores soportados Navegadores modernos. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | últimas 2 versiones | últimas 2 versiones | últimas 2 versiones | últimas 2 versiones | ## Contribución Cualquier tipo de contribución es bienvenida. Aquí tienes algunos ejemplos de cómo puedes contribuir a este proyecto: - Usa Ant Design Pro en tu trabajo diario. - Envía [issues](http://github.com/ant-design/ant-design-pro/issues) para informar de errores o hacer preguntas. - Propón [pull requests](http://github.com/ant-design/ant-design-pro/pulls) para mejorar nuestro código. ================================================ FILE: README.fr-FR.md ================================================ # Ant Design Pro Langue : 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

Une solution d'interface utilisateur prête à l'emploi pour les applications d'entreprise, basée sur React. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) aperçu du thème clair aperçu du thème sombre
- Aperçu : http://preview.pro.ant.design - Page d'accueil : http://pro.ant.design - Documentation : http://pro.ant.design/docs/getting-started - Journal des modifications : http://pro.ant.design/docs/changelog - FAQ : http://pro.ant.design/docs/faq ## Fonctionnalités - :bulb: **TypeScript** : Un langage pour des applications JavaScript à grande échelle - :scroll: **Blocs** : Construisez des pages avec des modèles de blocs - :gem: **Design soigné** : Conforme à la [spécification Ant Design](http://ant.design/) - :triangular_ruler: **Modèles courants** : Modèles typiques pour les applications d'entreprise - :rocket: **Développement de pointe** : Stack de développement la plus récente avec React/umi/dva/antd - :iphone: **Responsive** : Conçu pour différentes tailles d'écran - :art: **Thématisation** : Thème personnalisable avec une configuration simple - :globe_with_meridians: **Internationalisation** : Solution i18n intégrée - :gear: **Bonnes pratiques** : Workflow solide pour garder votre code sain - :1234: **Développement mock** : Solution de développement mock facile à utiliser - :white_check_mark: **Tests UI** : Sécurité avec des tests unitaires et e2e ## Modèles ``` - Tableau de bord - Analytique - Surveillance - Espace de travail - Formulaire - Formulaire de base - Formulaire par étapes - Formulaire avancé - Liste - Tableau standard - Liste standard - Liste de cartes - Liste de recherche (Projet/Applications/Article) - Profil - Profil simple - Profil avancé - Compte - Centre de compte - Paramètres du compte - Résultat - Succès - Échec - Exception - 403 - 404 - 500 - Utilisateur - Connexion - Inscription - Résultat d'inscription ``` ## Utilisation ### Utiliser bash Nous fournissons pro-cli pour initialiser rapidement le projet. ```bash # utiliser npm npm i @ant-design/pro-cli -g pro create myapp ``` Choisissez le modèle pro. Simple est le modèle de base, qui ne fournit que le contenu de base pour le fonctionnement du framework. Complete contient tous les blocs, ce qui n'est pas adapté comme modèle de base pour un développement secondaire. ```shell ? 🚀 Un projet complet ou un simple squelette ? (Utilisez les flèches) ➥ simple complete ``` Initialisez le dépôt Git : ```shell $ git init myapp ``` Installez les dépendances : ```shell $ cd myapp && tyarn // ou $ cd myapp && npm install ``` ## Navigateurs supportés Navigateurs modernes. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | 2 dernières versions | 2 dernières versions | 2 dernières versions | 2 dernières versions | ## Contribution Toute contribution est la bienvenue, voici quelques exemples de comment vous pouvez contribuer à ce projet : - Utilisez Ant Design Pro dans votre travail quotidien. - Soumettez des [issues](http://github.com/ant-design/ant-design-pro/issues) pour signaler des bugs ou poser des questions. - Proposez des [pull requests](http://github.com/ant-design/ant-design-pro/pulls) pour améliorer notre code. ================================================ FILE: README.ja-JP.md ================================================ # Ant Design Pro 言語: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

エンタープライズアプリケーション向けの、Reactベースのすぐに使えるUIソリューション。 [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) ライトテーマのプレビュー ダークテーマのプレビュー
- プレビュー: http://preview.pro.ant.design - ホームページ: http://pro.ant.design - ドキュメント: http://pro.ant.design/docs/getting-started - 変更履歴: http://pro.ant.design/docs/changelog - FAQ: http://pro.ant.design/docs/faq ## 特徴 - :bulb: **TypeScript**: 大規模JavaScriptアプリケーション向けの言語 - :scroll: **ブロック**: ブロックテンプレートでページを構築 - :gem: **洗練されたデザイン**: [Ant Design仕様](http://ant.design/)に準拠 - :triangular_ruler: **一般的なテンプレート**: 企業向けアプリケーションの典型的なテンプレート - :rocket: **最新の開発環境**: React/umi/dva/antdの最新スタック - :iphone: **レスポンシブ**: 様々な画面サイズに対応 - :art: **テーマ**: シンプルな設定でカスタマイズ可能なテーマ - :globe_with_meridians: **国際化**: 組み込みのi18nソリューション - :gear: **ベストプラクティス**: 健全なコードを保つためのワークフロー - :1234: **モック開発**: 使いやすいモック開発ソリューション - :white_check_mark: **UIテスト**: ユニットテストとE2Eテストで安全に ## テンプレート ``` - ダッシュボード - 分析 - モニター - ワークスペース - フォーム - 基本フォーム - ステップフォーム - 高度なフォーム - リスト - 標準テーブル - 標準リスト - カードリスト - 検索リスト(プロジェクト/アプリケーション/記事) - プロフィール - シンプルプロフィール - 高度なプロフィール - アカウント - アカウントセンター - アカウント設定 - 結果 - 成功 - 失敗 - 例外 - 403 - 404 - 500 - ユーザー - ログイン - 登録 - 登録結果 ``` ## 使い方 ### bashを使う pro-cliを使って素早くプロジェクトを初期化できます。 ```bash # npmを使用 npm i @ant-design/pro-cli -g pro create myapp ``` proテンプレートを選択します。simpleは基本テンプレートで、フレームワークの基本的な内容のみを提供します。completeはすべてのブロックを含み、二次開発のベースとしては適していません。 ```shell ? 🚀 フル機能かシンプルなスキャフォールドか?(矢印キーで選択) ➥ simple complete ``` Gitリポジトリを初期化: ```shell $ git init myapp ``` 依存関係をインストール: ```shell $ cd myapp && tyarn // または $ cd myapp && npm install ``` ## 対応ブラウザ モダンブラウザ対応。 | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | 最新2バージョン | 最新2バージョン | 最新2バージョン | 最新2バージョン | ## コントリビュート どんな形の貢献も歓迎します。以下はこのプロジェクトに貢献する例です: - 日常業務でAnt Design Proを使う - [issues](http://github.com/ant-design/ant-design-pro/issues)でバグ報告や質問を投稿する - [pull requests](http://github.com/ant-design/ant-design-pro/pulls)でコード改善を提案する ================================================ FILE: README.md ================================================ Language: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇵🇹](./README.pt-BR.md) | [🇸🇦](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

An out-of-box UI solution for enterprise applications as a React boilerplate. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) light theme preview dark theme preview
- 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 ## Features - :bulb: **TypeScript**: A language for application-scale JavaScript - :scroll: **Blocks**: Build page with block template - :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 ``` - 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 ``` ## Usage ### Use bash We provide pro-cli to quickly initialize scaffolding. ```bash # use npm npm i @ant-design/pro-cli -g pro create myapp ``` Choose the pro template. Simple is the basic template, which only provides the basic content of the framework operation. Complete contains all blocks, which is not suitable for secondary development as a basic template. ```shell ? 🚀 Full or a simple scaffold? (Use arrow keys) ❯ simple complete ``` Initialized Git repository: ```shell $ git init myapp ``` Install dependencies: ```shell $ cd myapp && tyarn // or $ cd myapp && npm install ``` ## Browsers support Modern browsers. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | ## Contributing 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. Contribution Leaderboard ================================================ FILE: README.pt-BR.md ================================================ # Ant Design Pro Idioma: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

Uma solução de UI pronta para uso para aplicações empresariais baseada em React. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) visualização do tema claro visualização do tema escuro
- Visualizar: http://preview.pro.ant.design - Página inicial: http://pro.ant.design - Documentação: http://pro.ant.design/docs/getting-started - Registro de alterações: http://pro.ant.design/docs/changelog - FAQ: http://pro.ant.design/docs/faq ## Funcionalidades - :bulb: **TypeScript**: Uma linguagem para aplicações JavaScript em larga escala - :scroll: **Blocos**: Construa páginas com modelos de blocos - :gem: **Design elegante**: Segue a [especificação do Ant Design](http://ant.design/) - :triangular_ruler: **Modelos comuns**: Modelos típicos para aplicações empresariais - :rocket: **Desenvolvimento de ponta**: Stack mais recente de React/umi/dva/antd - :iphone: **Responsivo**: Projetado para diferentes tamanhos de tela - :art: **Temas**: Tema personalizável com configuração simples - :globe_with_meridians: **Internacionalização**: Solução i18n integrada - :gear: **Boas práticas**: Workflow sólido para manter seu código saudável - :1234: **Desenvolvimento mock**: Solução de mock fácil de usar - :white_check_mark: **Teste de UI**: Segurança com testes unitários e e2e ## Modelos ``` - Painel - Analítico - Monitoramento - Espaço de trabalho - Formulário - Formulário básico - Formulário em etapas - Formulário avançado - Lista - Tabela padrão - Lista padrão - Lista de cartões - Lista de busca (Projeto/Aplicações/Artigo) - Perfil - Perfil simples - Perfil avançado - Conta - Central da conta - Configurações da conta - Resultado - Sucesso - Falha - Exceção - 403 - 404 - 500 - Usuário - Login - Registro - Resultado do registro ``` ## Uso ### Usando bash Fornecemos o pro-cli para inicializar rapidamente o projeto. ```bash # usar npm npm i @ant-design/pro-cli -g pro create myapp ``` Escolha o modelo pro. Simple é o modelo básico, que fornece apenas o conteúdo essencial para o funcionamento do framework. Complete contém todos os blocos, não sendo adequado como modelo base para desenvolvimento secundário. ```shell ? 🚀 Projeto completo ou um esqueleto simples? (Use as setas) ➥ simple complete ``` Inicialize o repositório Git: ```shell $ git init myapp ``` Instale as dependências: ```shell $ cd myapp && tyarn // ou $ cd myapp && npm install ``` ## Navegadores suportados Navegadores modernos. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | últimas 2 versões | últimas 2 versões | últimas 2 versões | últimas 2 versões | ## Contribuindo Qualquer tipo de contribuição é bem-vinda. Aqui estão alguns exemplos de como você pode contribuir para este projeto: - Use o Ant Design Pro no seu trabalho diário. - Envie [issues](http://github.com/ant-design/ant-design-pro/issues) para relatar bugs ou fazer perguntas. - Proponha [pull requests](http://github.com/ant-design/ant-design-pro/pulls) para melhorar nosso código. ================================================ FILE: README.ru-RU.md ================================================ # Ant Design Pro Язык: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

Готовое решение UI для корпоративных приложений на базе React. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) светлая тема тёмная тема
- Превью: http://preview.pro.ant.design - Главная страница: http://pro.ant.design - Документация: http://pro.ant.design/docs/getting-started - Список изменений: http://pro.ant.design/docs/changelog - FAQ: http://pro.ant.design/docs/faq ## Возможности - :bulb: **TypeScript**: Язык для масштабируемых JavaScript-приложений - :scroll: **Блоки**: Построение страниц с помощью шаблонов блоков - :gem: **Элегантный дизайн**: Следует [спецификации Ant Design](http://ant.design/) - :triangular_ruler: **Типовые шаблоны**: Типовые шаблоны для корпоративных приложений - :rocket: **Современный стек**: Самые новые технологии React/umi/dva/antd - :iphone: **Адаптивность**: Поддержка разных размеров экранов - :art: **Темизация**: Кастомизация темы через простую конфигурацию - :globe_with_meridians: **Интернационализация**: Встроенное решение i18n - :gear: **Лучшие практики**: Надёжный workflow для поддержания качества кода - :1234: **Мок-разработка**: Удобное решение для разработки с мок-данными - :white_check_mark: **UI-тесты**: Безопасность с помощью unit и e2e тестов ## Шаблоны ``` - Дашборд - Аналитика - Мониторинг - Рабочее пространство - Форма - Базовая форма - Многошаговая форма - Продвинутая форма - Список - Стандартная таблица - Стандартный список - Список карточек - Поисковый список (Проект/Приложения/Статья) - Профиль - Простой профиль - Продвинутый профиль - Аккаунт - Центр аккаунта - Настройки аккаунта - Результат - Успех - Ошибка - Исключения - 403 - 404 - 500 - Пользователь - Вход - Регистрация - Результат регистрации ``` ## Использование ### Использование bash Мы предоставляем pro-cli для быстрой инициализации проекта. ```bash # использовать npm npm i @ant-design/pro-cli -g pro create myapp ``` Выберите шаблон pro. Simple — это базовый шаблон, который содержит только необходимый минимум для работы фреймворка. Complete включает все блоки и не подходит для вторичной разработки как базовый шаблон. ```shell ? 🚀 Полный или простой шаблон? (Используйте стрелки) ➥ simple complete ``` Инициализация репозитория Git: ```shell $ git init myapp ``` Установка зависимостей: ```shell $ cd myapp && tyarn // или $ cd myapp && npm install ``` ## Поддержка браузеров Современные браузеры. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | последние 2 версии | последние 2 версии | последние 2 версии | последние 2 версии | ## Вклад Любой вклад приветствуется. Вот несколько способов, как вы можете помочь проекту: - Используйте Ant Design Pro в своей повседневной работе. - Оставляйте [issues](http://github.com/ant-design/ant-design-pro/issues) для сообщений об ошибках или вопросов. - Предлагайте [pull requests](http://github.com/ant-design/ant-design-pro/pulls) для улучшения кода. ================================================ FILE: README.tr-TR.md ================================================ # Ant Design Pro Dil: 🇺🇸 | [🇨🇳](./README.zh-CN.md) | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇧🇷](./README.pt-BR.md) | [🇩🇿](./README.ar-DZ.md) | [🇪🇸](./README.es-ES.md)

Ant Design Pro

React tabanlı kurumsal uygulamalar için kutudan çıkan bir UI çözümü. [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design/) açık tema önizlemesi koyu tema önizlemesi
- Önizleme: http://preview.pro.ant.design - Ana Sayfa: http://pro.ant.design - Dokümantasyon: http://pro.ant.design/docs/getting-started - Değişiklik Günlüğü: http://pro.ant.design/docs/changelog - SSS: http://pro.ant.design/docs/faq ## Özellikler - :bulb: **TypeScript**: Büyük ölçekli JavaScript uygulamaları için bir dil - :scroll: **Bloklar**: Blok şablonlarıyla sayfa oluşturun - :gem: **Şık Tasarım**: [Ant Design spesifikasyonuna](http://ant.design/) uygun - :triangular_ruler: **Yaygın Şablonlar**: Kurumsal uygulamalar için tipik şablonlar - :rocket: **En Yeni Geliştirme**: React/umi/dva/antd'nin en yeni geliştirme yığını - :iphone: **Duyarlı**: Farklı ekran boyutları için tasarlandı - :art: **Tema**: Basit yapılandırmayla özelleştirilebilir tema - :globe_with_meridians: **Uluslararasılaştırma**: Dahili i18n çözümü - :gear: **En İyi Uygulamalar**: Kodunuzu sağlıklı tutmak için sağlam iş akışı - :1234: **Mock geliştirme**: Kullanımı kolay mock geliştirme çözümü - :white_check_mark: **UI Testi**: Birim ve e2e testleriyle güvenli geliştirme ## Şablonlar ``` - Gösterge Paneli - Analitik - İzleme - Çalışma Alanı - Form - Temel Form - Adım Adım Form - Gelişmiş Form - Liste - Standart Tablo - Standart Liste - Kart Listesi - Arama Listesi (Proje/Uygulamalar/Makale) - Profil - Basit Profil - Gelişmiş Profil - Hesap - Hesap Merkezi - Hesap Ayarları - Sonuç - Başarılı - Başarısız - İstisna - 403 - 404 - 500 - Kullanıcı - Giriş - Kayıt Ol - Kayıt Sonucu ``` ## Kullanım ### Bash kullanımı Projeyi hızlıca başlatmak için pro-cli sağlıyoruz. ```bash # npm kullan npm i @ant-design/pro-cli -g pro create myapp ``` Pro şablonunu seçin. Simple, yalnızca temel framework içeriğini sağlayan temel şablondur. Complete, tüm blokları içerir ve ikincil geliştirme için temel şablon olarak uygun değildir. ```shell ? 🚀 Tam veya basit bir iskelet mi? (Ok tuşlarını kullanın) ➥ simple complete ``` Git deposunu başlatın: ```shell $ git init myapp ``` Bağımlılıkları yükleyin: ```shell $ cd myapp && tyarn // veya $ cd myapp && npm install ``` ## Desteklenen Tarayıcılar Modern tarayıcılar. | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | son 2 sürüm | son 2 sürüm | son 2 sürüm | son 2 sürüm | ## Katkı Her türlü katkı memnuniyetle karşılanır. Bu projeye katkıda bulunmanın bazı yolları şunlardır: - Ant Design Pro'yu günlük işinizde kullanın. - Hataları bildirmek veya soru sormak için [issues](http://github.com/ant-design/ant-design-pro/issues) gönderin. - Kodumuzu geliştirmek için [pull requests](http://github.com/ant-design/ant-design-pro/pulls) önerin. ================================================ FILE: README.zh-CN.md ================================================ Language : [🇺🇸](./README.md) | 🇨🇳 | [🇷🇺](./README.ru-RU.md) | [🇹🇷](./README.tr-TR.md) | [🇯🇵](./README.ja-JP.md) | [🇫🇷](./README.fr-FR.md) | [🇵🇹](./README.pt-BR.md) | [🇸🇦](./README.ar-DZ.md)

Ant Design Pro

开箱即用的中台前端/设计解决方案。 [![CI](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/ci.yml) [![Preview Deploy](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml/badge.svg)](https://github.com/ant-design/ant-design-pro/actions/workflows/preview-deploy.yml) [![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) ![](https://github.com/user-attachments/assets/fde29061-3d9a-4397-8ac2-397b0e033ef5)
- 预览:http://preview.pro.ant.design - 首页:http://pro.ant.design/index-cn - 使用文档:http://pro.ant.design/docs/getting-started-cn - 更新日志: http://pro.ant.design/docs/changelog-cn - 常见问题:http://pro.ant.design/docs/faq-cn ## 5.0 已经发布! 🎉🎉🎉 [Ant Design Pro 5.0](https://github.com/ant-design/ant-design-pro/issues/8656) ## 特性 - :bulb: **TypeScript**: 应用程序级 JavaScript 的语言 - :scroll: **区块**: 通过区块模板快速构建页面 - :gem: **优雅美观**:基于 Ant Design 体系精心设计 - :triangular_ruler: **常见设计模式**:提炼自中后台应用的典型页面和场景 - :rocket: **最新技术栈**:使用 React/umi/dva/antd 等前端前沿技术开发 - :iphone: **响应式**:针对不同屏幕大小设计 - :art: **主题**:可配置的主题满足多样化的品牌诉求 - :globe_with_meridians: **国际化**:内建业界通用的国际化方案 - :gear: **最佳实践**:良好的工程实践助您持续产出高质量代码 - :1234: **Mock 数据**:实用的本地数据调试方案 - :white_check_mark: **UI 测试**:自动化测试保障前端产品质量 ## 模板 ``` - Dashboard - 分析页 - 监控页 - 工作台 - 表单页 - 基础表单页 - 分步表单页 - 高级表单页 - 列表页 - 查询表格 - 标准列表 - 卡片列表 - 搜索列表(项目/应用/文章) - 详情页 - 基础详情页 - 高级详情页 - 用户 - 用户中心页 - 用户设置页 - 结果 - 成功页 - 失败页 - 异常 - 403 无权限 - 404 找不到 - 500 服务器出错 - 帐户 - 登录 - 注册 - 注册成功 ``` ## 使用 我们提供了 pro-cli 来快速的初始化脚手架。 ```bash # 使用 npm npm i @ant-design/pro-cli -g pro create myapp ``` 选择 pro 的模板,simple 是基础模板,只提供了框架运行的基本内容,complete 包含所有区块,不太适合当基础模板来进行二次开发。 ```shell ? 🚀 要全量的还是一个简单的脚手架? (Use arrow keys) ❯ simple complete ``` 安装依赖: ```shell $ cd myapp && tyarn // 或 $ cd myapp && npm install ``` 更多信息请参考 [使用文档](http://pro.ant.design/docs/getting-started)。 ## 支持环境 现代浏览器。 | [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | | --- | --- | --- | --- | --- | | Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | ## 参与贡献 我们非常欢迎你的贡献,你可以通过以下方式和我们一起共建 :smiley:: - 在你的公司或个人项目中使用 Ant Design Pro。 - 通过 [Issue](http://github.com/ant-design/ant-design-pro/issues) 报告 bug 或进行咨询。 - 提交 [Pull Request](http://github.com/ant-design/ant-design-pro/pulls) 改进 Pro 的代码。 ================================================ FILE: biome.json ================================================ { "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "files": { "ignoreUnknown": true, "includes": [ "**/*", "!**/.umi", "!**/.umi-production", "!**/.umi-test", "!**/.umi-test-production", "!**/src/services", "!**/mock", "!**/dist", "!**/server", "!**/public", "!**/coverage", "!**/node_modules", "!biome.json" ] }, "formatter": { "enabled": true, "indentStyle": "space" }, "linter": { "enabled": true, "rules": { "recommended": true, "suspicious": { "noExplicitAny": "off" }, "correctness": { "useUniqueElementIds": "off", "useExhaustiveDependencies": "off" }, "a11y": { "noStaticElementInteractions": "off", "useValidAnchor": "off", "useKeyWithClickEvents": "off" } } }, "javascript": { "jsxRuntime": "reactClassic", "formatter": { "quoteStyle": "single" } } } ================================================ FILE: config/config.ts ================================================ // https://umijs.org/config/ import { join } from 'node:path'; import { defineConfig } from '@umijs/max'; import defaultSettings from './defaultSettings'; import proxy from './proxy'; import routes from './routes'; const { UMI_ENV = 'dev' } = process.env; /** * @name 使用公共路径 * @description 部署时的路径,如果部署在非根目录下,需要配置这个变量 * @doc https://umijs.org/docs/api/config#publicpath */ const PUBLIC_PATH: string = '/'; export default defineConfig({ /** * @name 开启 hash 模式 * @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。 * @doc https://umijs.org/docs/api/config#hash */ hash: true, publicPath: PUBLIC_PATH, /** * @name 兼容性设置 * @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖 * @doc https://umijs.org/docs/api/config#targets */ // targets: { // ie: 11, // }, /** * @name 路由的配置,不在路由中引入的文件不会编译 * @description 只支持 path,component,routes,redirect,wrappers,title 的配置 * @doc https://umijs.org/docs/guides/routes */ // umi routes: https://umijs.org/docs/routing routes, /** * @name 主题的配置 * @description 虽然叫主题,但是其实只是 less 的变量设置 * @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn * @doc umi 的 theme 配置 https://umijs.org/docs/api/config#theme */ // theme: { '@primary-color': '#1DA57A' } /** * @name moment 的国际化配置 * @description 如果对国际化没有要求,打开之后能减少js的包大小 * @doc https://umijs.org/docs/api/config#ignoremomentlocale */ ignoreMomentLocale: true, /** * @name 代理配置 * @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了 * @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。 * @doc 代理介绍 https://umijs.org/docs/guides/proxy * @doc 代理配置 https://umijs.org/docs/api/config#proxy */ proxy: proxy[UMI_ENV as keyof typeof proxy], /** * @name 快速热更新配置 * @description 一个不错的热更新组件,更新时可以保留 state */ fastRefresh: true, //============== 以下都是max的插件配置 =============== /** * @name 数据流插件 * @@doc https://umijs.org/docs/max/data-flow */ model: {}, /** * 一个全局的初始数据流,可以用它在插件之间共享数据 * @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。 * @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81 */ initialState: {}, /** * @name layout 插件 * @doc https://umijs.org/docs/max/layout-menu */ title: 'Ant Design Pro', layout: { locale: true, ...defaultSettings, }, /** * @name moment2dayjs 插件 * @description 将项目中的 moment 替换为 dayjs * @doc https://umijs.org/docs/max/moment2dayjs */ moment2dayjs: { preset: 'antd', plugins: ['duration'], }, /** * @name 国际化插件 * @doc https://umijs.org/docs/max/i18n */ locale: { // default zh-CN default: 'zh-CN', antd: true, // default true, when it is true, will use `navigator.language` overwrite default baseNavigator: true, }, /** * @name antd 插件 * @description 内置了 babel import 插件 * @doc https://umijs.org/docs/max/antd#antd */ antd: { appConfig: {}, configProvider: { theme: { token: { fontFamily: 'AlibabaSans, sans-serif', }, }, }, }, /** * @name 网络请求配置 * @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。 * @doc https://umijs.org/docs/max/request */ request: {}, /** * @name 权限插件 * @description 基于 initialState 的权限插件,必须先打开 initialState * @doc https://umijs.org/docs/max/access */ access: {}, /** * @name 中额外的 script * @description 配置 中额外的 script */ headScripts: [ // 解决首次加载时白屏的问题 { src: join(PUBLIC_PATH, 'scripts/loading.js'), async: true }, ], //================ pro 插件配置 ================= presets: ['umi-presets-pro'], /** * @name openAPI 插件的配置 * @description 基于 openapi 的规范生成serve 和mock,能减少很多样板代码 * @doc https://pro.ant.design/zh-cn/docs/openapi/ */ openAPI: [ { requestLibPath: "import { request } from '@umijs/max'", // 或者使用在线的版本 // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json" schemaPath: join(__dirname, 'oneapi.json'), mock: false, }, { requestLibPath: "import { request } from '@umijs/max'", schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json', projectName: 'swagger', }, ], mock: { include: ['mock/**/*', 'src/pages/**/_mock.ts'], }, utoopack: {}, requestRecord: {}, exportStatic: {}, define: { 'process.env.CI': process.env.CI, }, }); ================================================ FILE: config/defaultSettings.ts ================================================ import type { ProLayoutProps } from '@ant-design/pro-components'; /** * @name */ const Settings: ProLayoutProps & { pwa?: boolean; logo?: string; } = { navTheme: 'light', // 拂晓蓝 colorPrimary: '#1890ff', layout: 'mix', contentWidth: 'Fluid', fixedHeader: false, fixSiderbar: true, colorWeak: false, title: 'Ant Design Pro', pwa: true, logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', iconfontUrl: '', token: { // 参见ts声明,demo 见文档,通过token 修改样式 //https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F }, }; export default Settings; ================================================ FILE: config/oneapi.json ================================================ { "openapi": "3.0.1", "info": { "title": "Ant Design Pro", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:8000/" }, { "url": "https://localhost:8000/" } ], "paths": { "/api/currentUser": { "get": { "tags": ["api"], "description": "获取当前的用户", "operationId": "currentUser", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CurrentUser" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "x-swagger-router-controller": "api" }, "/api/login/captcha": { "post": { "description": "发送验证码", "operationId": "getFakeCaptcha", "tags": ["login"], "parameters": [ { "name": "phone", "in": "query", "description": "手机号", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FakeCaptcha" } } } } } } }, "/api/login/outLogin": { "post": { "description": "登录接口", "operationId": "outLogin", "tags": ["login"], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "x-swagger-router-controller": "api" }, "/api/login/account": { "post": { "tags": ["login"], "description": "登录接口", "operationId": "login", "requestBody": { "description": "登录系统", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginParams" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResult" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-codegen-request-body-name": "body" }, "x-swagger-router-controller": "api" }, "/api/notices": { "summary": "getNotices", "description": "NoticeIconItem", "get": { "tags": ["api"], "operationId": "getNotices", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoticeIconList" } } } } } } }, "/api/rule": { "get": { "tags": ["rule"], "description": "获取规则列表", "operationId": "rule", "parameters": [ { "name": "current", "in": "query", "description": "当前的页码", "schema": { "type": "number" } }, { "name": "pageSize", "in": "query", "description": "页面的容量", "schema": { "type": "number" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleList" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["rule"], "description": "新建规则", "operationId": "addRule", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleListItem" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "put": { "tags": ["rule"], "description": "新建规则", "operationId": "updateRule", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleListItem" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["rule"], "description": "删除规则", "operationId": "removeRule", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object" } } } }, "401": { "description": "Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "x-swagger-router-controller": "api" }, "/swagger": { "x-swagger-pipe": "swagger_raw" } }, "components": { "schemas": { "CurrentUser": { "type": "object", "properties": { "name": { "type": "string" }, "avatar": { "type": "string" }, "userid": { "type": "string" }, "email": { "type": "string" }, "signature": { "type": "string" }, "title": { "type": "string" }, "group": { "type": "string" }, "tags": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" } } } }, "notifyCount": { "type": "integer", "format": "int32" }, "unreadCount": { "type": "integer", "format": "int32" }, "country": { "type": "string" }, "access": { "type": "string" }, "geographic": { "type": "object", "properties": { "province": { "type": "object", "properties": { "label": { "type": "string" }, "key": { "type": "string" } } }, "city": { "type": "object", "properties": { "label": { "type": "string" }, "key": { "type": "string" } } } } }, "address": { "type": "string" }, "phone": { "type": "string" } } }, "LoginResult": { "type": "object", "properties": { "status": { "type": "string" }, "type": { "type": "string" }, "currentAuthority": { "type": "string" } } }, "PageParams": { "type": "object", "properties": { "current": { "type": "number" }, "pageSize": { "type": "number" } } }, "RuleListItem": { "type": "object", "properties": { "key": { "type": "integer", "format": "int32" }, "disabled": { "type": "boolean" }, "href": { "type": "string" }, "avatar": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "desc": { "type": "string" }, "callNo": { "type": "integer", "format": "int32" }, "status": { "type": "integer", "format": "int32" }, "updatedAt": { "type": "string", "format": "datetime" }, "createdAt": { "type": "string", "format": "datetime" }, "progress": { "type": "integer", "format": "int32" } } }, "RuleList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RuleListItem" } }, "total": { "type": "integer", "description": "列表的内容总数", "format": "int32" }, "success": { "type": "boolean" } } }, "FakeCaptcha": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "status": { "type": "string" } } }, "LoginParams": { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string" }, "autoLogin": { "type": "boolean" }, "type": { "type": "string" } } }, "ErrorResponse": { "required": ["errorCode"], "type": "object", "properties": { "errorCode": { "type": "string", "description": "业务约定的错误码" }, "errorMessage": { "type": "string", "description": "业务上的错误信息" }, "success": { "type": "boolean", "description": "业务上的请求是否成功" } } }, "NoticeIconList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/NoticeIconItem" } }, "total": { "type": "integer", "description": "列表的内容总数", "format": "int32" }, "success": { "type": "boolean" } } }, "NoticeIconItemType": { "title": "NoticeIconItemType", "description": "已读未读列表的枚举", "type": "string", "properties": {}, "enum": ["notification", "message", "event"] }, "NoticeIconItem": { "type": "object", "properties": { "id": { "type": "string" }, "extra": { "type": "string", "format": "any" }, "key": { "type": "string" }, "read": { "type": "boolean" }, "avatar": { "type": "string" }, "title": { "type": "string" }, "status": { "type": "string" }, "datetime": { "type": "string", "format": "date" }, "description": { "type": "string" }, "type": { "extensions": { "x-is-enum": true }, "$ref": "#/components/schemas/NoticeIconItemType" } } } } } } ================================================ FILE: config/proxy.ts ================================================ /** * @name 代理的配置 * @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 * ------------------------------- * The agent cannot take effect in the production environment * so there is no configuration of the production environment * For details, please see * https://pro.ant.design/docs/deploy * * @doc https://umijs.org/docs/guides/proxy */ export default { // 如果需要自定义本地开发服务器 请取消注释按需调整 // dev: { // // localhost:8000/api/** -> https://preview.pro.ant.design/api/** // '/api/': { // // 要代理的地址 // target: 'https://preview.pro.ant.design', // // 配置了这个可以从 http 代理到 https // // 依赖 origin 的功能可能需要这个,比如 cookie // changeOrigin: true, // }, // }, /** * @name 详细的代理配置 * @doc https://github.com/chimurai/http-proxy-middleware */ test: { // localhost:8000/api/** -> https://preview.pro.ant.design/api/** '/api/': { target: 'https://proapi.azurewebsites.net', changeOrigin: true, pathRewrite: { '^': '' }, }, }, pre: { '/api/': { target: 'your pre url', changeOrigin: true, pathRewrite: { '^': '' }, }, }, }; ================================================ FILE: config/routes.ts ================================================ /** * @name umi 的路由配置 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置 * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。 * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。 * @param redirect 配置路由跳转 * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验 * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题 * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 则取值应为 user 或者 User * @doc https://umijs.org/docs/guides/routes */ export default [ { path: '/user', layout: false, routes: [ { name: 'login', path: '/user/login', component: './user/login', }, ], }, { path: '/welcome', name: 'welcome', icon: 'smile', component: './Welcome', }, { path: '/admin', name: 'admin', icon: 'crown', access: 'canAdmin', routes: [ { path: '/admin', redirect: '/admin/sub-page', }, { path: '/admin/sub-page', name: 'sub-page', component: './Admin', }, ], }, { name: 'list.table-list', icon: 'table', path: '/list', component: './table-list', }, { path: '/', redirect: '/welcome', }, { component: '404', layout: false, path: './*', }, ]; ================================================ FILE: jest.config.ts ================================================ import { configUmiAlias, createConfig } from '@umijs/max/test'; export default async (): Promise => { const config = await configUmiAlias({ ...createConfig({ target: 'browser', }), }); return { ...config, testEnvironmentOptions: { ...(config?.testEnvironmentOptions || {}), url: 'http://localhost:8000', }, setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'], globals: { ...config.globals, localStorage: null, }, }; }; ================================================ FILE: mock/listTableList.ts ================================================ import { parse } from 'node:url'; import dayjs from 'dayjs'; import type { Request, Response } from 'express'; // mock tableListDataSource const genList = (current: number, pageSize: number) => { const tableListDataSource: API.RuleListItem[] = []; for (let i = 0; i < pageSize; i += 1) { const index = (current - 1) * 10 + i; tableListDataSource.push({ key: index, disabled: i % 6 === 0, href: 'https://ant.design', avatar: [ 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', ][i % 2], name: `TradeCode ${index}`, owner: '曲丽丽', desc: '这是一段描述', callNo: Math.floor(Math.random() * 1000), status: Math.floor(Math.random() * 10) % 4, updatedAt: dayjs().format('YYYY-MM-DD'), createdAt: dayjs().format('YYYY-MM-DD'), progress: Math.ceil(Math.random() * 100), }); } tableListDataSource.reverse(); return tableListDataSource; }; let tableListDataSource = genList(1, 100); function getRule(req: Request, res: Response, u: string) { let realUrl = u; if ( !realUrl || Object.prototype.toString.call(realUrl) !== '[object String]' ) { realUrl = req.url; } const { current = 1, pageSize = 10 } = req.query; const params = parse(realUrl, true).query as unknown as API.PageParams & API.RuleListItem & { sorter: any; filter: any; }; let dataSource = [...tableListDataSource].slice( ((current as number) - 1) * (pageSize as number), (current as number) * (pageSize as number), ); if (params.sorter) { const sorter = JSON.parse(params.sorter); dataSource = dataSource.sort((prev, next) => { let sortNumber = 0; (Object.keys(sorter) as Array).forEach((key) => { const nextSort = next?.[key] as number; const preSort = prev?.[key] as number; if (sorter[key] === 'descend') { if (preSort - nextSort > 0) { sortNumber += -1; } else { sortNumber += 1; } return; } if (preSort - nextSort > 0) { sortNumber += 1; } else { sortNumber += -1; } }); return sortNumber; }); } if (params.filter) { const filter = JSON.parse(params.filter as any) as { [key: string]: string[]; }; if (Object.keys(filter).length > 0) { dataSource = dataSource.filter((item) => { return (Object.keys(filter) as Array).some( (key) => { if (!filter[key]) { return true; } if (filter[key].includes(`${item[key]}`)) { return true; } return false; }, ); }); } } if (params.name) { dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''), ); } const result = { data: dataSource, total: tableListDataSource.length, success: true, pageSize, current: parseInt(`${params.current}`, 10) || 1, }; return res.json(result); } function postRule(req: Request, res: Response, u: string, b: Request) { let realUrl = u; if ( !realUrl || Object.prototype.toString.call(realUrl) !== '[object String]' ) { realUrl = req.url; } const body = b?.body || req.body; const { method, name, desc, key } = body; switch (method) { case 'delete': tableListDataSource = tableListDataSource.filter( (item) => key.indexOf(item.key) === -1, ); break; case 'post': (() => { const i = Math.ceil(Math.random() * 10000); const newRule: API.RuleListItem = { key: tableListDataSource.length, href: 'https://ant.design', avatar: [ 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', ][i % 2], name, owner: '曲丽丽', desc, callNo: Math.floor(Math.random() * 1000), status: Math.floor(Math.random() * 10) % 2, updatedAt: dayjs().format('YYYY-MM-DD'), createdAt: dayjs().format('YYYY-MM-DD'), progress: Math.ceil(Math.random() * 100), }; tableListDataSource.unshift(newRule); return res.json(newRule); })(); return; case 'update': (() => { let newRule = {}; tableListDataSource = tableListDataSource.map((item) => { if (item.key === key) { newRule = { ...item, desc, name }; return { ...item, desc, name }; } return item; }); return res.json(newRule); })(); return; default: break; } const result = { list: tableListDataSource, pagination: { total: tableListDataSource.length, }, }; res.json(result); } export default { 'GET /api/rule': getRule, 'POST /api/rule': postRule, }; ================================================ FILE: mock/monitor.mock.ts ================================================ import type { Request, Response } from 'express'; import mockjs from 'mockjs'; const getTags = (_: Request, res: Response) => { return res.json({ data: mockjs.mock({ 'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }], }), }); }; export default { 'GET /api/tags': getTags, }; ================================================ FILE: mock/notices.ts ================================================ import type { Request, Response } from 'express'; const getNotices = (_req: Request, res: Response) => { res.json({ data: [ { id: '000000001', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/MSbDR4FR2MUAAAAAAAAAAAAAFl94AQBr', title: '你收到了 14 份新周报', datetime: '2017-08-09', type: 'notification', }, { id: '000000002', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/hX-PTavYIq4AAAAAAAAAAAAAFl94AQBr', title: '你推荐的 曲妮妮 已通过第三轮面试', datetime: '2017-08-08', type: 'notification', }, { id: '000000003', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/jHX5R5l3QjQAAAAAAAAAAAAAFl94AQBr', title: '这种模板可以区分多种通知类型', datetime: '2017-08-07', read: true, type: 'notification', }, { id: '000000004', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Wr4mQqx6jfwAAAAAAAAAAAAAFl94AQBr', title: '左侧图标用于区分不同的类型', datetime: '2017-08-07', type: 'notification', }, { id: '000000005', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Mzj_TbcWUj4AAAAAAAAAAAAAFl94AQBr', title: '内容不要超过两行字,超出时自动截断', datetime: '2017-08-07', type: 'notification', }, { id: '000000006', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/eXLzRbPqQE4AAAAAAAAAAAAAFl94AQBr', title: '曲丽丽 评论了你', description: '描述信息描述信息描述信息', datetime: '2017-08-07', type: 'message', clickClose: true, }, { id: '000000007', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/w5mRQY2AmEEAAAAAAAAAAAAAFl94AQBr', title: '朱偏右 回复了你', description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', datetime: '2017-08-07', type: 'message', clickClose: true, }, { id: '000000008', avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/wPadR5M9918AAAAAAAAAAAAAFl94AQBr', title: '标题', description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', datetime: '2017-08-07', type: 'message', clickClose: true, }, { id: '000000009', title: '任务名称', description: '任务需要在 2017-01-12 20:00 前启动', extra: '未开始', status: 'todo', type: 'event', }, { id: '000000010', title: '第三方紧急代码变更', description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', extra: '马上到期', status: 'urgent', type: 'event', }, { id: '000000011', title: '信息安全考试', description: '指派竹尔于 2017-01-09 前完成更新并发布', extra: '已耗时 8 天', status: 'doing', type: 'event', }, { id: '000000012', title: 'ABCD 版本发布', description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', extra: '进行中', status: 'processing', type: 'event', }, ], }); }; export default { 'GET /api/notices': getNotices, }; ================================================ FILE: mock/requestRecord.mock.js ================================================ module.exports = { 'GET /api/currentUser': { data: { name: 'Serati Ma', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', userid: '00000001', email: 'antdesign@alipay.com', signature: '海纳百川,有容乃大', title: '交互专家', group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', tags: [ { key: '0', label: '很有想法的' }, { key: '1', label: '专注设计' }, { key: '2', label: '辣~' }, { key: '3', label: '大长腿' }, { key: '4', label: '川妹子' }, { key: '5', label: '海纳百川' }, ], notifyCount: 12, unreadCount: 11, country: 'China', geographic: { province: { label: '浙江省', key: '330000' }, city: { label: '杭州市', key: '330100' }, }, address: '西湖区工专路 77 号', phone: '0752-268888888', }, }, 'GET /api/rule': { data: [ { key: 99, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 99', owner: '曲丽丽', desc: '这是一段描述', callNo: 503, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 81, }, { key: 98, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 98', owner: '曲丽丽', desc: '这是一段描述', callNo: 164, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 12, }, { key: 97, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 97', owner: '曲丽丽', desc: '这是一段描述', callNo: 174, status: '1', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 81, }, { key: 96, disabled: true, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 96', owner: '曲丽丽', desc: '这是一段描述', callNo: 914, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 7, }, { key: 95, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 95', owner: '曲丽丽', desc: '这是一段描述', callNo: 698, status: '2', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 82, }, { key: 94, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 94', owner: '曲丽丽', desc: '这是一段描述', callNo: 488, status: '1', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 14, }, { key: 93, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 93', owner: '曲丽丽', desc: '这是一段描述', callNo: 580, status: '2', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 77, }, { key: 92, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 92', owner: '曲丽丽', desc: '这是一段描述', callNo: 244, status: '3', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 58, }, { key: 91, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 91', owner: '曲丽丽', desc: '这是一段描述', callNo: 959, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 66, }, { key: 90, disabled: true, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 90', owner: '曲丽丽', desc: '这是一段描述', callNo: 958, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 72, }, { key: 89, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 89', owner: '曲丽丽', desc: '这是一段描述', callNo: 301, status: '2', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 2, }, { key: 88, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 88', owner: '曲丽丽', desc: '这是一段描述', callNo: 277, status: '1', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 12, }, { key: 87, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 87', owner: '曲丽丽', desc: '这是一段描述', callNo: 810, status: '1', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 82, }, { key: 86, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 86', owner: '曲丽丽', desc: '这是一段描述', callNo: 780, status: '3', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 22, }, { key: 85, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 85', owner: '曲丽丽', desc: '这是一段描述', callNo: 705, status: '3', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 12, }, { key: 84, disabled: true, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 84', owner: '曲丽丽', desc: '这是一段描述', callNo: 203, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 79, }, { key: 83, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 83', owner: '曲丽丽', desc: '这是一段描述', callNo: 491, status: '2', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 59, }, { key: 82, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 82', owner: '曲丽丽', desc: '这是一段描述', callNo: 73, status: '0', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 100, }, { key: 81, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 81', owner: '曲丽丽', desc: '这是一段描述', callNo: 406, status: '3', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 61, }, { key: 80, disabled: false, href: 'https://ant.design', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 80', owner: '曲丽丽', desc: '这是一段描述', callNo: 112, status: '2', updatedAt: '2022-12-06T05:00:57.040Z', createdAt: '2022-12-06T05:00:57.040Z', progress: 20, }, ], total: 100, success: true, pageSize: 20, current: 1, }, 'POST /api/login/outLogin': { data: {}, success: true }, 'POST /api/login/account': { status: 'ok', type: 'account', currentAuthority: 'admin', }, }; ================================================ FILE: mock/route.ts ================================================ export default { '/api/auth_routes': { '/form/advanced-form': { authority: ['admin', 'user'] }, }, }; ================================================ FILE: mock/user.ts ================================================ import type { Request, Response } from 'express'; const waitTime = (time: number = 100) => { return new Promise((resolve) => { setTimeout(() => { resolve(true); }, time); }); }; async function getFakeCaptcha(_req: Request, res: Response) { await waitTime(2000); return res.json('captcha-xxx'); } const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; /** * 当前用户的权限,如果为空代表没登录 * current user access, if is '', user need login * 如果是 pro 的预览,默认是有权限的 */ let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : ''; const getAccess = () => { return access; }; // 代码中会兼容本地 service mock 以及部署站点的静态数据 export default { // 支持值为 Object 和 Array 'GET /api/currentUser': (_req: Request, res: Response) => { if (!getAccess()) { res.status(401).send({ data: { isLogin: false, }, errorCode: '401', errorMessage: '请先登录!', success: true, }); return; } res.send({ success: true, data: { name: 'Serati Ma', avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', userid: '00000001', email: 'antdesign@alipay.com', signature: '海纳百川,有容乃大', title: '交互专家', group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', tags: [ { key: '0', label: '很有想法的', }, { key: '1', label: '专注设计', }, { key: '2', label: '辣~', }, { key: '3', label: '大长腿', }, { key: '4', label: '川妹子', }, { key: '5', label: '海纳百川', }, ], notifyCount: 12, unreadCount: 11, country: 'China', access: getAccess(), geographic: { province: { label: '浙江省', key: '330000', }, city: { label: '杭州市', key: '330100', }, }, address: '西湖区工专路 77 号', phone: '0752-268888888', }, }); }, // GET POST 可省略 'GET /api/users': [ { key: '1', name: 'John Brown', age: 32, address: 'New York No. 1 Lake Park', }, { key: '2', name: 'Jim Green', age: 42, address: 'London No. 1 Lake Park', }, { key: '3', name: 'Joe Black', age: 32, address: 'Sidney No. 1 Lake Park', }, ], 'POST /api/login/account': async (req: Request, res: Response) => { const { password, username, type } = req.body; await waitTime(2000); if (password === 'ant.design' && username === 'admin') { res.send({ status: 'ok', type, currentAuthority: 'admin', }); access = 'admin'; return; } if (password === 'ant.design' && username === 'user') { res.send({ status: 'ok', type, currentAuthority: 'user', }); access = 'user'; return; } if (type === 'mobile') { res.send({ status: 'ok', type, currentAuthority: 'admin', }); access = 'admin'; return; } res.send({ status: 'error', type, currentAuthority: 'guest', }); access = 'guest'; }, 'POST /api/login/outLogin': (_req: Request, res: Response) => { access = ''; res.send({ data: {}, success: true }); }, 'POST /api/register': (_req: Request, res: Response) => { res.send({ status: 'ok', currentAuthority: 'user', success: true }); }, 'GET /api/500': (_req: Request, res: Response) => { res.status(500).send({ timestamp: 1513932555104, status: 500, error: 'error', message: 'error', path: '/base/category/list', }); }, 'GET /api/404': (_req: Request, res: Response) => { res.status(404).send({ timestamp: 1513932643431, status: 404, error: 'Not Found', message: 'No message available', path: '/base/category/list/2121212', }); }, 'GET /api/403': (_req: Request, res: Response) => { res.status(403).send({ timestamp: 1513932555104, status: 403, error: 'Forbidden', message: 'Forbidden', path: '/base/category/list', }); }, 'GET /api/401': (_req: Request, res: Response) => { res.status(401).send({ timestamp: 1513932555104, status: 401, error: 'Unauthorized', message: 'Unauthorized', path: '/base/category/list', }); }, 'GET /api/login/captcha': getFakeCaptcha, }; ================================================ FILE: package.json ================================================ { "name": "ant-design-pro", "version": "6.0.0", "private": true, "description": "An out-of-box UI solution for enterprise applications", "repository": "git@github.com:ant-design/ant-design-pro.git", "scripts": { "analyze": "cross-env ANALYZE=1 max build", "build": "max build", "deploy": "npm run build && npm run gh-pages", "dev": "npm run start:dev", "gh-pages": "gh-pages -d dist", "i18n-remove": "pro i18n-remove --locale=zh-CN --write", "postinstall": "max setup", "jest": "jest", "lint": "npm run biome:lint && npm run tsc", "lint-staged": "lint-staged", "biome:lint": "npx @biomejs/biome lint", "openapi": "max openapi", "prepare": "husky", "preview": "npm run build && max preview --port 8000", "record": "cross-env NODE_ENV=development UMI_ENV=test max record --scene=login", "serve": "umi-serve", "start": "cross-env UMI_ENV=dev max dev", "start:dev": "cross-env UMI_ENV=dev MOCK=none max dev", "start:no-mock": "cross-env MOCK=none max dev", "start:pre": "cross-env UMI_ENV=pre MOCK=none max dev", "start:test": "cross-env UMI_ENV=test MOCK=none max dev", "test": "jest", "test:coverage": "npm run jest -- --coverage", "test:update": "npm run jest -- -u", "tsc": "tsc --noEmit" }, "browserslist": [ "defaults" ], "dependencies": { "@ant-design/icons": "^6.1.0", "@ant-design/pro-components": "3.1.2-0", "antd": "^6.2.2", "antd-style": "^4.1.0", "clsx": "^2.1.1", "dayjs": "^1.11.19", "react": "^19.2.4", "react-dom": "^19.2.4" }, "devDependencies": { "@ant-design/pro-cli": "^3.3.0", "@commitlint/cli": "^20.1.0", "@commitlint/config-conventional": "^20.0.0", "@testing-library/dom": "^10.4.0", "@testing-library/react": "^16.3.0", "@types/express": "^5.0.3", "@types/jest": "^30.0.0", "@types/react": "^19.2.10", "@types/react-dom": "^19.2.3", "@types/react-helmet": "^6.1.11", "@umijs/lint": "^4.6.13", "@umijs/max": "^4.6.25", "cross-env": "^10.1.0", "express": "^5.2.0", "gh-pages": "^6.1.1", "husky": "^9.1.7", "jest": "^30.0.4", "jest-environment-jsdom": "^30.0.5", "lint-staged": "^16.1.2", "mockjs": "^1.1.0", "ts-node": "^10.9.2", "typescript": "^5.6.3", "umi-presets-pro": "^2.0.3", "umi-serve": "^1.9.11", "@biomejs/biome": "^2.1.1", "@types/node": "^25.0.3" }, "engines": { "node": ">=20.0.0" }, "create-umi": { "ignoreScript": [ "docker*", "functions*", "site", "generateMock" ], "ignoreDependencies": [ "netlify*", "serverless" ], "ignore": [ ".dockerignore", ".git", ".github", ".gitpod.yml", "CODE_OF_CONDUCT.md", "Dockerfile", "Dockerfile.*", "lambda", "LICENSE", "netlify.toml", "README.*.md", "azure-pipelines.yml", "docker", "CNAME", "create-umi" ] } } ================================================ FILE: public/CNAME ================================================ preview.pro.ant.design ================================================ FILE: public/scripts/loading.js ================================================ /** * loading 占位 * 解决首次加载时白屏的问题 */ (function () { const _root = document.querySelector('#root'); if (_root && _root.innerHTML === '') { _root.innerHTML = `
正在加载资源
初次加载资源可能需要较多时间 请耐心等待
`; } })(); ================================================ FILE: src/access.ts ================================================ /** * @see https://umijs.org/docs/max/access#access * */ export default function access( initialState: { currentUser?: API.CurrentUser } | undefined, ) { const { currentUser } = initialState ?? {}; return { canAdmin: currentUser && currentUser.access === 'admin', }; } ================================================ FILE: src/app.tsx ================================================ import { LinkOutlined } from '@ant-design/icons'; import type { Settings as LayoutSettings } from '@ant-design/pro-components'; import { SettingDrawer } from '@ant-design/pro-components'; import type { RequestConfig, RunTimeLayoutConfig } from '@umijs/max'; import { history, Link } from '@umijs/max'; import React from 'react'; import { AvatarDropdown, AvatarName, Footer, Question, SelectLang, } from '@/components'; import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api'; import defaultSettings from '../config/defaultSettings'; import { errorConfig } from './requestErrorConfig'; const isDev = process.env.NODE_ENV === 'development'; const isDevOrTest = isDev || process.env.CI; const loginPath = '/user/login'; /** * @see https://umijs.org/docs/api/runtime-config#getinitialstate * */ export async function getInitialState(): Promise<{ settings?: Partial; currentUser?: API.CurrentUser; loading?: boolean; fetchUserInfo?: () => Promise; }> { const fetchUserInfo = async () => { try { const msg = await queryCurrentUser({ skipErrorHandler: true, }); return msg.data; } catch (_error) { history.push(loginPath); } return undefined; }; // 如果不是登录页面,执行 const { location } = history; if ( ![loginPath, '/user/register', '/user/register-result'].includes( location.pathname, ) ) { const currentUser = await fetchUserInfo(); return { fetchUserInfo, currentUser, settings: defaultSettings as Partial, }; } return { fetchUserInfo, settings: defaultSettings as Partial, }; } // ProLayout 支持的api https://procomponents.ant.design/components/layout export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState, }) => { return { actionsRender: () => [ , , ], avatarProps: { src: initialState?.currentUser?.avatar, title: , render: (_, avatarChildren) => ( {avatarChildren} ), }, waterMarkProps: { content: initialState?.currentUser?.name, }, footerRender: () =>