Skip to content

Commit

Permalink
fix: 优化antdp-base 组件页和实例页
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenlingasMx committed Jun 9, 2023
1 parent 9395941 commit fe7ec86
Show file tree
Hide file tree
Showing 34 changed files with 1,542 additions and 1,008 deletions.
2 changes: 2 additions & 0 deletions examples/antdp-base/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/config
/src/pages/.umi/
14 changes: 14 additions & 0 deletions examples/antdp-base/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint'), 'eslint:recommended'],
// in antd-design-pro
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
page: true,
REACT_APP_ENV: true,
},
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error',
'no-unused-vars': 'error',
},
};
11 changes: 0 additions & 11 deletions examples/antdp-base/.prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions examples/antdp-base/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.prettier,
};
6 changes: 6 additions & 0 deletions examples/antdp-base/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/stylelint')],
rules: {
// your rules
},
};
4 changes: 2 additions & 2 deletions examples/antdp-base/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export default config(router, {
// 是否显示 head头部
// ANTD_HEAD_IS_SHOW: false,
// 是否展示tab栏
ANTD_IS_TABS: true,
ANTD_IS_TABS: false,
// 是否展示面包屑
ANTD_IS_BREADCRUMB: false,
ANTD_IS_BREADCRUMB: true,
ANTD_AUTH_CONF: {
auth_menu: 'authMenu',
auth_btn: 'authBtn',
Expand Down
56 changes: 28 additions & 28 deletions examples/antdp-base/config/router.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@
"icon": "form",
"routes": [
{
"path": "/components/quickform",
"name": "快速表单",
"locale": "quickform",
"component": "@/pages/Components/QuickForm"
"path": "/components/proform",
"name": "ProForm",
"locale": "proform",
"component": "@/pages/Components/ProForm"
},
{
"path": "/components/formdetail",
"name": "详情表单",
"locale": "formdetail",
"component": "@/pages/Components/FormDetail"
"path": "/components/proDescriptions",
"name": "ProDescriptions",
"locale": "proDescriptions",
"component": "@/pages/Components/ProDescriptions"
},
{
"path": "/components/edittable",
"name": "编辑表格",
"locale": "edittable",
"component": "@/pages/Components/EditTable"
"path": "/components/editableProTable",
"name": "EditableProTable",
"locale": "editableProTable",
"component": "@/pages/Components/EditableProTable"
},
{
"path": "/components/proform",
"name": "ProForm",
"locale": "proform",
"component": "@/pages/Components/ProForm"
"path": "/components/quickform",
"name": "快速表单",
"locale": "quickform",
"component": "@/pages/Components/QuickForm"
}
]
},
Expand All @@ -68,18 +68,6 @@
"icon": "table",
"locale": "list",
"routes": [
{
"path": "/list/basiclist",
"name": "基础列表",
"locale": "basiclist",
"component": "@/pages/List/BasicList"
},
{
"path": "/list/cardlist",
"name": "卡片列表",
"locale": "cardlist",
"component": "@/pages/List/CardList"
},
{
"path": "/list/tablelist",
"name": "ProTable",
Expand All @@ -91,6 +79,18 @@
"name": "ProList",
"locale": "prolist",
"component": "@/pages/List/ProList"
},
{
"path": "/list/basiclist",
"name": "基础列表",
"locale": "basiclist",
"component": "@/pages/List/BasicList"
},
{
"path": "/list/cardlist",
"name": "卡片列表",
"locale": "cardlist",
"component": "@/pages/List/CardList"
}
]
},
Expand Down
17 changes: 6 additions & 11 deletions examples/antdp-base/mock/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
list[i] = {
id: i,
name: '霞仔',
title: '16',
age: '16',
address: '上海市',
};
}
Expand Down Expand Up @@ -240,40 +240,35 @@ export default {
avatar: 'https://xsgames.co/randomusers/avatar.php?g=pixel',
title: 'Card title',
descriptio: 'antdp 好用',
image:
'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
image: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
},
{
id: 'trend-2',
avatar: 'https://xsgames.co/randomusers/avatar.php?g=pixel',
title: 'Card title',
descriptio: 'antdp 好用',
image:
'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
image: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
},
{
id: 'trend-3',
avatar: 'https://xsgames.co/randomusers/avatar.php?g=pixel',
title: 'Card title',
descriptio: 'antdp 好用',
image:
'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
image: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
},
{
id: 'trend-4',
avatar: 'https://xsgames.co/randomusers/avatar.php?g=pixel',
title: 'Card title',
descriptio: 'antdp 好用',
image:
'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
image: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
},
{
id: 'trend-5',
avatar: 'https://xsgames.co/randomusers/avatar.php?g=pixel',
title: 'Card title',
descriptio: 'antdp 好用',
image:
'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
image: 'https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png',
},
],
});
Expand Down
6 changes: 3 additions & 3 deletions examples/antdp-base/mock/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const menus = [
'/chart',
'/dashboard',
'/components',
'/components/quickform',
'/components/formdetail',
'/components/edittable',
'/components/proform',
'/components/proDescriptions',
'/components/editableProTable',
'/components/quickform',
'/list',
'/list/basiclist',
'/list/cardlist',
Expand Down
26 changes: 13 additions & 13 deletions examples/antdp-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,25 @@
"start": "max dev",
"build": "max build",
"umiinstall": "max setup",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"precommit": "npm run lint",
"lint-staged": "lint-staged"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "eslint --fix",
"*.{js,jsx,less,md,json}": [
"prettier --write"
]
},
"dependencies": {
"@ant-design/pro-form": "1.74.7",
"@ant-design/pro-components": "^2.4.14",
"@antdp/antdp-ui": "2.0.16",
"@antdp/edit-table": "2.0.16",
"@antdp/authorized": "2.0.16",
"@antdp/basic-layouts": "2.0.16",
"@antdp/hooks": "2.0.16",
"@antdp/page-loading": "2.0.16",
"@antdp/request": "2.0.16",
"@antdp/user-login": "2.0.16",
"ahooks": "~3.7.2",
"antd": "5.4.7",
"rc-field-form": "~1.27.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand All @@ -44,9 +38,15 @@
"devDependencies": {
"@antdp/config": "2.0.16",
"@antdp/dependencies": "2.0.16",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@umijs/fabric": "~2.14.1",
"@umijs/max": "~4.0.47",
"@umijs/plugin-model": "~2.6.2",
"lint-staged": "~13.0.4",
"prettier": "2.8.1"
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "~4.2.1",
"eslint-plugin-unicorn": "^47.0.0",
"husky": "~8.0.3",
"lint-staged": "~13.2.2"
}
}
4 changes: 2 additions & 2 deletions examples/antdp-base/src/locales/en-US/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default {
'menu.dashboard': 'dashboard',
'menu.components': 'components pages',
'menu.components.quickform': 'quickform',
'menu.components.formdetail': 'formdetail',
'menu.components.edittable': 'edittable',
'menu.components.proDescriptions': 'proDescriptions',
'menu.components.editableProTable': 'editableProTable',
'menu.components.proform': 'proform',
'menu.list': 'list pages',
'menu.list.basiclist': 'basiclist',
Expand Down
4 changes: 2 additions & 2 deletions examples/antdp-base/src/locales/zh-CN/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default {
'menu.dashboard': '页面实例',
'menu.components': '组件页',
'menu.components.quickform': '快速表单',
'menu.components.formdetail': '详情表单',
'menu.components.edittable': '编辑表格',
'menu.components.proDescriptions': 'ProDescriptions',
'menu.components.editableProTable': 'EditableProTable',
'menu.components.proform': 'ProForm',
'menu.list': '列表页',
'menu.list.basiclist': '基础列表',
Expand Down
20 changes: 0 additions & 20 deletions examples/antdp-base/src/models/demo.js

This file was deleted.

Loading

0 comments on commit fe7ec86

Please sign in to comment.