From f45915324679f6ea296359047e441f45c3c3aa60 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 8 Jul 2025 19:04:39 +0800 Subject: [PATCH 1/6] Update README.md --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 5baa78f9..37ebbd72 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -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) +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

@@ -22,14 +22,6 @@ An out-of-box UI solution for enterprise applications as a React boilerplate. - ChangeLog: http://pro.ant.design/docs/changelog - FAQ: http://pro.ant.design/docs/faq -## 5.0 is out! 🎉🎉🎉 - -[Ant Design Pro 5.0.0](https://github.com/ant-design/ant-design-pro/issues/8656) - -## Translation Recruitment :loudspeaker: - -We need your help: https://github.com/ant-design/ant-design-pro/issues/120 - ## Features - :bulb: **TypeScript**: A language for application-scale JavaScript From 5753706db99d77b8ebaded962a11c8d1fe6f249d Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 8 Jul 2025 22:34:04 +0800 Subject: [PATCH 2/6] test: add @types/node in devDeps --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b9b616e..039e12c2 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,8 @@ "typescript": "^5.6.3", "umi-presets-pro": "^2.0.3", "umi-serve": "^1.9.11", - "@biomejs/biome": "^2.0.6" + "@biomejs/biome": "^2.0.6", + "@types/node": "^24.0.10" }, "engines": { "node": ">=20.0.0" From fe31163b33ae43ea6f730d281622cec57f1d2ed7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:52:41 +0800 Subject: [PATCH 3/6] chore(deps): bump dawidd6/action-download-artifact (#11395) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: afc163 --- .github/workflows/preview-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml index 35cfb5ba..21a07cc1 100644 --- a/.github/workflows/preview-deploy.yml +++ b/.github/workflows/preview-deploy.yml @@ -19,7 +19,7 @@ jobs: if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: - name: download pr artifact - uses: dawidd6/action-download-artifact@v4 + uses: dawidd6/action-download-artifact@v6 with: workflow: ${{ github.event.workflow_run.workflow_id }} name: pr @@ -29,7 +29,7 @@ jobs: run: echo "::set-output name=id::$( Date: Mon, 14 Jul 2025 11:18:18 +0800 Subject: [PATCH 4/6] docs: Update screenshot --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37ebbd72..8d23e4c9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ An out-of-box UI solution for enterprise applications as a React boilerplate. [![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/) -![](https://github.com/user-attachments/assets/fde29061-3d9a-4397-8ac2-397b0e033ef5) +light theme preview +dark theme preview From a1b37b4630c772f7d7f7243474acab6152b284dd Mon Sep 17 00:00:00 2001 From: ice <49827327+coding-ice@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:18:40 +0800 Subject: [PATCH 5/6] chore: add biome tooling and format codebase (#11572) --- biome.json | 25 ++++---- mock/listTableList.ts | 38 ++++------- mock/notices.ts | 6 +- mock/requestRecord.mock.js | 63 +++++++------------ mock/user.ts | 6 +- package.json | 1 + public/scripts/loading.js | 2 +- src/app.tsx | 3 +- .../center/components/Applications/index.tsx | 30 +++++---- .../center/components/Articles/index.tsx | 17 ++--- .../account/settings/components/base.tsx | 39 +++++++----- src/pages/list/basic-list/index.tsx | 50 ++++++++------- src/pages/list/mock/index.ts | 2 +- src/pages/list/search/articles/index.tsx | 62 +++++++++--------- src/pages/list/table-list/service.ts | 2 - .../login/__snapshots__/login.test.tsx.snap | 58 ++++++++--------- types/cache/mock/login.mock.cache.js | 63 +++++++------------ 17 files changed, 211 insertions(+), 256 deletions(-) diff --git a/biome.json b/biome.json index 2f4e4e0c..8d4ab507 100644 --- a/biome.json +++ b/biome.json @@ -4,17 +4,17 @@ "ignoreUnknown": true, "includes": [ "**/*", - "!**/.umi/**", - "!**/.umi-production/**", - "!**/.umi-test/**", - "!**/.umi-test-production/**", - "!**/src/services/**", - "!**/mock/**", - "!**/dist/**", - "!**/server/**", - "!**/public/**", - "!**/coverage/**", - "!**/node_modules/**", + "!**/.umi", + "!**/.umi-production", + "!**/.umi-test", + "!**/.umi-test-production", + "!**/src/services", + "!**/mock", + "!**/dist", + "!**/server", + "!**/public", + "!**/coverage", + "!**/node_modules", "!biome.json" ] }, @@ -30,7 +30,8 @@ "noExplicitAny": "off" }, "correctness": { - "useExhaustiveDependencies": "off" + "useExhaustiveDependencies": "off", + "useUniqueElementIds": "off" }, "a11y": { "noStaticElementInteractions": "off", diff --git a/mock/listTableList.ts b/mock/listTableList.ts index dd88bf91..ddb857c2 100644 --- a/mock/listTableList.ts +++ b/mock/listTableList.ts @@ -34,10 +34,7 @@ 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]' - ) { + if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') { realUrl = req.url; } const { current = 1, pageSize = 10 } = req.query; @@ -81,25 +78,21 @@ function getRule(req: Request, res: Response, u: 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; - }, - ); + 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 || ''), - ); + dataSource = dataSource.filter((data) => data?.name?.includes(params.name || '')); } const result = { data: dataSource, @@ -114,10 +107,7 @@ function getRule(req: Request, res: Response, u: string) { function postRule(req: Request, res: Response, u: string, b: Request) { let realUrl = u; - if ( - !realUrl || - Object.prototype.toString.call(realUrl) !== '[object String]' - ) { + if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') { realUrl = req.url; } @@ -126,9 +116,7 @@ function postRule(req: Request, res: Response, u: string, b: Request) { switch (method) { case 'delete': - tableListDataSource = tableListDataSource.filter( - (item) => key.indexOf(item.key) === -1, - ); + tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1); break; case 'post': (() => { diff --git a/mock/notices.ts b/mock/notices.ts index d8963113..a8a28d9b 100644 --- a/mock/notices.ts +++ b/mock/notices.ts @@ -85,8 +85,7 @@ const getNotices = (_req: Request, res: Response) => { { id: '000000010', title: '第三方紧急代码变更', - description: - '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', + description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', extra: '马上到期', status: 'urgent', type: 'event', @@ -102,8 +101,7 @@ const getNotices = (_req: Request, res: Response) => { { id: '000000012', title: 'ABCD 版本发布', - description: - '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', + description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', extra: '进行中', status: 'processing', type: 'event', diff --git a/mock/requestRecord.mock.js b/mock/requestRecord.mock.js index 7c8f0de5..6c59e198 100644 --- a/mock/requestRecord.mock.js +++ b/mock/requestRecord.mock.js @@ -2,8 +2,7 @@ module.exports = { 'GET /api/currentUser': { data: { name: 'Serati Ma', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', userid: '00000001', email: 'antdesign@alipay.com', signature: '海纳百川,有容乃大', @@ -34,8 +33,7 @@ module.exports = { key: 99, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 99', owner: '曲丽丽', desc: '这是一段描述', @@ -49,8 +47,7 @@ module.exports = { key: 98, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 98', owner: '曲丽丽', desc: '这是一段描述', @@ -64,8 +61,7 @@ module.exports = { key: 97, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 97', owner: '曲丽丽', desc: '这是一段描述', @@ -79,8 +75,7 @@ module.exports = { key: 96, disabled: true, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 96', owner: '曲丽丽', desc: '这是一段描述', @@ -94,8 +89,7 @@ module.exports = { key: 95, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 95', owner: '曲丽丽', desc: '这是一段描述', @@ -109,8 +103,7 @@ module.exports = { key: 94, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 94', owner: '曲丽丽', desc: '这是一段描述', @@ -124,8 +117,7 @@ module.exports = { key: 93, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 93', owner: '曲丽丽', desc: '这是一段描述', @@ -139,8 +131,7 @@ module.exports = { key: 92, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 92', owner: '曲丽丽', desc: '这是一段描述', @@ -154,8 +145,7 @@ module.exports = { key: 91, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 91', owner: '曲丽丽', desc: '这是一段描述', @@ -169,8 +159,7 @@ module.exports = { key: 90, disabled: true, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 90', owner: '曲丽丽', desc: '这是一段描述', @@ -184,8 +173,7 @@ module.exports = { key: 89, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 89', owner: '曲丽丽', desc: '这是一段描述', @@ -199,8 +187,7 @@ module.exports = { key: 88, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 88', owner: '曲丽丽', desc: '这是一段描述', @@ -214,8 +201,7 @@ module.exports = { key: 87, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 87', owner: '曲丽丽', desc: '这是一段描述', @@ -229,8 +215,7 @@ module.exports = { key: 86, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 86', owner: '曲丽丽', desc: '这是一段描述', @@ -244,8 +229,7 @@ module.exports = { key: 85, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 85', owner: '曲丽丽', desc: '这是一段描述', @@ -259,8 +243,7 @@ module.exports = { key: 84, disabled: true, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 84', owner: '曲丽丽', desc: '这是一段描述', @@ -274,8 +257,7 @@ module.exports = { key: 83, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 83', owner: '曲丽丽', desc: '这是一段描述', @@ -289,8 +271,7 @@ module.exports = { key: 82, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 82', owner: '曲丽丽', desc: '这是一段描述', @@ -304,8 +285,7 @@ module.exports = { key: 81, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', name: 'TradeCode 81', owner: '曲丽丽', desc: '这是一段描述', @@ -319,8 +299,7 @@ module.exports = { key: 80, disabled: false, href: 'https://ant.design', - avatar: - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', + avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', name: 'TradeCode 80', owner: '曲丽丽', desc: '这是一段描述', diff --git a/mock/user.ts b/mock/user.ts index 06125bf5..2c78c5bb 100644 --- a/mock/user.ts +++ b/mock/user.ts @@ -20,8 +20,7 @@ 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' : ''; +let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : ''; const getAccess = () => { return access; @@ -46,8 +45,7 @@ export default { success: true, data: { name: 'Serati Ma', - avatar: - 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', userid: '00000001', email: 'antdesign@alipay.com', signature: '海纳百川,有容乃大', diff --git a/package.json b/package.json index 039e12c2..3e07ce98 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "lint": "npm run biome:lint && npm run tsc", "lint-staged": "lint-staged", "biome:lint": "npx @biomejs/biome lint", + "biome": "biome check --write", "openapi": "max openapi", "prepare": "husky", "preview": "npm run build && max preview --port 8000", diff --git a/public/scripts/loading.js b/public/scripts/loading.js index a4fdb3d5..16e3ff4a 100644 --- a/public/scripts/loading.js +++ b/public/scripts/loading.js @@ -2,7 +2,7 @@ * loading 占位 * 解决首次加载时白屏的问题 */ -(function () { +(() => { const _root = document.querySelector('#root'); if (_root && _root.innerHTML === '') { _root.innerHTML = ` diff --git a/src/app.tsx b/src/app.tsx index 96483655..621489e9 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -16,8 +16,7 @@ import defaultSettings from '../config/defaultSettings'; import { errorConfig } from './requestErrorConfig'; import '@ant-design/v5-patch-for-react-19'; -const isDev = - process.env.NODE_ENV === 'development' || process.env.CI; +const isDev = process.env.NODE_ENV === 'development' || process.env.CI; const loginPath = '/user/login'; /** diff --git a/src/pages/account/center/components/Applications/index.tsx b/src/pages/account/center/components/Applications/index.tsx index e8c273f5..2cf4d832 100644 --- a/src/pages/account/center/components/Applications/index.tsx +++ b/src/pages/account/center/components/Applications/index.tsx @@ -11,6 +11,7 @@ import React from 'react'; import type { ListItemDataType } from '../../data.d'; import { queryFakeList } from '../../service'; import useStyles from './index.style'; + export function formatWan(val: number) { const v = val * 1; if (!v || Number.isNaN(v)) return ''; @@ -35,19 +36,13 @@ export function formatWan(val: number) { } return result; } -const Applications: React.FC = () => { - const { styles: stylesApplications } = useStyles(); - // 获取tab列表数据 - const { data: listData } = useRequest(() => { - return queryFakeList({ - count: 30, - }); - }); - const CardInfo: React.FC<{ - activeUser: React.ReactNode; - newUser: React.ReactNode; - }> = ({ activeUser, newUser }) => ( +const CardInfo: React.FC<{ + activeUser: React.ReactNode; + newUser: React.ReactNode; +}> = ({ activeUser, newUser }) => { + const { styles: stylesApplications } = useStyles(); + return (

活跃用户

@@ -59,6 +54,17 @@ const Applications: React.FC = () => {
); +}; + +const Applications: React.FC = () => { + const { styles: stylesApplications } = useStyles(); + // 获取tab列表数据 + const { data: listData } = useRequest(() => { + return queryFakeList({ + count: 30, + }); + }); + return ( rowKey="id" diff --git a/src/pages/account/center/components/Articles/index.tsx b/src/pages/account/center/components/Articles/index.tsx index d2a69eee..896ba3c2 100644 --- a/src/pages/account/center/components/Articles/index.tsx +++ b/src/pages/account/center/components/Articles/index.tsx @@ -7,16 +7,17 @@ import { queryFakeList } from '../../service'; import ArticleListContent from '../ArticleListContent'; import useStyles from './index.style'; +const IconText: React.FC<{ + icon: React.ReactNode; + text: React.ReactNode; +}> = ({ icon, text }) => ( + + {icon} {text} + +); + const Articles: React.FC = () => { const { styles } = useStyles(); - const IconText: React.FC<{ - icon: React.ReactNode; - text: React.ReactNode; - }> = ({ icon, text }) => ( - - {icon} {text} - - ); // 获取tab列表数据 const { data: listData } = useRequest(() => { diff --git a/src/pages/account/settings/components/base.tsx b/src/pages/account/settings/components/base.tsx index 5fe63cb9..a295b518 100644 --- a/src/pages/account/settings/components/base.tsx +++ b/src/pages/account/settings/components/base.tsx @@ -29,23 +29,7 @@ const validatorPhone = ( const BaseView: React.FC = () => { const { styles } = useStyles(); - // 头像组件 方便以后独立,增加裁剪之类的功能 - const AvatarView = ({ avatar }: { avatar: string }) => ( - <> -
头像
-
- avatar -
- -
- -
-
- - ); + const { data: currentUser, loading } = useRequest(() => { return queryCurrent(); }); @@ -232,3 +216,24 @@ const BaseView: React.FC = () => { ); }; export default BaseView; + +const AvatarView = ({ avatar }: { avatar: string }) => { + const { styles } = useStyles(); + + return ( + <> +
头像
+
+ avatar +
+ +
+ +
+
+ + ); +}; diff --git a/src/pages/list/basic-list/index.tsx b/src/pages/list/basic-list/index.tsx index 3ac9e29a..af97803c 100644 --- a/src/pages/list/basic-list/index.tsx +++ b/src/pages/list/basic-list/index.tsx @@ -154,29 +154,31 @@ export const BasicList: FC = () => { /> ); - const MoreBtn: React.FC<{ - item: BasicListItemDataType; - }> = ({ item }) => ( - editAndDelete(key, item), - items: [ - { - key: 'edit', - label: '编辑', - }, - { - key: 'delete', - label: '删除', - }, - ], - }} - > - - 更多 - - - ); + + const renderMoreBtn = (item: BasicListItemDataType) => { + return ( + editAndDelete(key, item), + items: [ + { + key: 'edit', + label: '编辑', + }, + { + key: 'delete', + label: '删除', + }, + ], + }} + > + + 更多 + + + ); + }; + const handleDone = () => { setDone(false); setVisible(false); @@ -237,7 +239,7 @@ export const BasicList: FC = () => { > 编辑 , - , + renderMoreBtn(item), ]} > ({ value: `cat${index + 1}`, diff --git a/src/pages/list/search/articles/index.tsx b/src/pages/list/search/articles/index.tsx index 868a11cf..df44ede0 100644 --- a/src/pages/list/search/articles/index.tsx +++ b/src/pages/list/search/articles/index.tsx @@ -21,6 +21,37 @@ const FormItem = Form.Item; const pageSize = 5; +const IconText: React.FC<{ + type: string; + text: React.ReactNode; +}> = ({ type, text }) => { + switch (type) { + case 'star-o': + return ( + + + {text} + + ); + case 'like-o': + return ( + + + {text} + + ); + case 'message': + return ( + + + {text} + + ); + default: + return null; + } +}; + const Articles: FC = () => { const [form] = Form.useForm(); @@ -68,37 +99,6 @@ const Articles: FC = () => { }, ]; - const IconText: React.FC<{ - type: string; - text: React.ReactNode; - }> = ({ type, text }) => { - switch (type) { - case 'star-o': - return ( - - - {text} - - ); - case 'like-o': - return ( - - - {text} - - ); - case 'message': - return ( - - - {text} - - ); - default: - return null; - } - }; - const formItemLayout = { wrapperCol: { xs: { span: 24 }, diff --git a/src/pages/list/table-list/service.ts b/src/pages/list/table-list/service.ts index 29168469..046cdcb4 100644 --- a/src/pages/list/table-list/service.ts +++ b/src/pages/list/table-list/service.ts @@ -1,5 +1,3 @@ -// @ts-ignore -/* eslint-disable */ import { request } from '@umijs/max'; import type { TableListItem } from './data'; diff --git a/src/pages/user/login/__snapshots__/login.test.tsx.snap b/src/pages/user/login/__snapshots__/login.test.tsx.snap index a9134557..b4c7ec93 100644 --- a/src/pages/user/login/__snapshots__/login.test.tsx.snap +++ b/src/pages/user/login/__snapshots__/login.test.tsx.snap @@ -1,9 +1,9 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing exports[`Login Page should login success 1`] = `