Browse Source

docs: update snapshot

pull/11096/head
期贤 2 years ago
parent
commit
0db71a03c3
  1. 2
      README.es-ES.md
  2. 14
      package.json
  3. 25722
      pnpm-lock.yaml
  4. 3
      src/app.tsx
  5. 4
      src/components/HeaderDropdown/index.tsx
  6. 2
      src/pages/account/center/components/AvatarList/index.tsx
  7. 1
      src/pages/dashboard/workplace/style.style.ts
  8. 8
      src/pages/list/search/applications/index.tsx
  9. 24
      src/pages/list/search/articles/index.tsx
  10. 3
      src/pages/list/search/index.tsx
  11. 10
      src/pages/list/search/projects/index.tsx
  12. 2
      src/pages/user/login/index.tsx

2
README.es-ES.md

@ -87,6 +87,7 @@ Proporcionamos `pro-cli` para inicializar rápidamente la estructura del proyect
npm i @ant-design/pro-cli -g npm i @ant-design/pro-cli -g
pro create myapp pro create myapp
``` ```
Selecciona la versión de umi Selecciona la versión de umi
``` ```
@ -95,6 +96,7 @@ Selecciona la versión de umi
umi@3 umi@3
``` ```
> Si seleccionas la versión umi@4, los bloques completos aún no son compatibles. > Si seleccionas la versión umi@4, los bloques completos aún no son compatibles.
Si eliges umi@3, también puedes elegir la plantilla "pro". "Pro" es la plantilla básica, que solo proporciona el contenido básico de la operación del marco. "Complete" contiene todos los bloques, lo cual no es adecuado para el desarrollo secundario como una plantilla básica. Si eliges umi@3, también puedes elegir la plantilla "pro". "Pro" es la plantilla básica, que solo proporciona el contenido básico de la operación del marco. "Complete" contiene todos los bloques, lo cual no es adecuado para el desarrollo secundario como una plantilla básica.

14
package.json

@ -39,14 +39,14 @@
], ],
"dependencies": { "dependencies": {
"@ant-design/icons": "^4.8.1", "@ant-design/icons": "^4.8.1",
"@ant-design/plots": "^2.1.0", "@ant-design/plots": "^2.1.1",
"@ant-design/pro-components": "^2.6.43", "@ant-design/pro-components": "^2.6.44",
"@antv/l7": "^2.20.5", "@antv/l7": "^2.20.5",
"@antv/l7-maps": "^2.20.5", "@antv/l7-maps": "^2.20.5",
"@antv/l7-react": "^2.4.3", "@antv/l7-react": "^2.4.3",
"@umijs/route-utils": "^2.2.2", "@umijs/route-utils": "^2.2.2",
"antd": "^5.12.1", "antd": "^5.12.2",
"antd-style": "^3.5.2", "antd-style": "^3.6.1",
"classnames": "^2.3.2", "classnames": "^2.3.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"numeral": "^2.0.6", "numeral": "^2.0.6",
@ -67,7 +67,7 @@
"@types/jest": "^29.5.11", "@types/jest": "^29.5.11",
"@types/lodash": "^4.14.202", "@types/lodash": "^4.14.202",
"@types/lodash.debounce": "^4.0.9", "@types/lodash.debounce": "^4.0.9",
"@types/react": "^18.2.42", "@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17", "@types/react-dom": "^18.2.17",
"@types/react-helmet": "^6.1.11", "@types/react-helmet": "^6.1.11",
"@umijs/fabric": "^2.14.1", "@umijs/fabric": "^2.14.1",
@ -81,13 +81,13 @@
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0", "jest-environment-jsdom": "^29.7.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"prettier": "^3.1.0", "prettier": "^3.1.1",
"prettier-plugin-organize-imports": "^3.2.4", "prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-packagejson": "^2.4.7", "prettier-plugin-packagejson": "^2.4.7",
"prettier-plugin-two-style-order": "^1.0.1", "prettier-plugin-two-style-order": "^1.0.1",
"react-dev-inspector": "^1.9.0", "react-dev-inspector": "^1.9.0",
"swagger-ui-dist": "^4.19.1", "swagger-ui-dist": "^4.19.1",
"ts-node": "^10.9.1", "ts-node": "^10.9.2",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"umi-presets-pro": "^2.0.3" "umi-presets-pro": "^2.0.3"
}, },

25722
pnpm-lock.yaml

File diff suppressed because it is too large

3
src/app.tsx

@ -1,4 +1,4 @@
import { Footer, Question, SelectLang, AvatarDropdown, AvatarName } from '@/components'; import { AvatarDropdown, AvatarName, Footer, Question, SelectLang } from '@/components';
import { LinkOutlined } from '@ant-design/icons'; import { LinkOutlined } from '@ant-design/icons';
import type { Settings as LayoutSettings } from '@ant-design/pro-components'; import type { Settings as LayoutSettings } from '@ant-design/pro-components';
import { SettingDrawer } from '@ant-design/pro-components'; import { SettingDrawer } from '@ant-design/pro-components';
@ -7,7 +7,6 @@ import { history, Link } from '@umijs/max';
import defaultSettings from '../config/defaultSettings'; import defaultSettings from '../config/defaultSettings';
import { errorConfig } from './requestErrorConfig'; import { errorConfig } from './requestErrorConfig';
import { currentUser as queryCurrentUser } from './services/ant-design-pro/api'; import { currentUser as queryCurrentUser } from './services/ant-design-pro/api';
import React from 'react';
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const loginPath = '/user/login'; const loginPath = '/user/login';

4
src/components/HeaderDropdown/index.tsx

@ -1,8 +1,8 @@
import { Dropdown } from 'antd'; import { Dropdown } from 'antd';
import type { DropDownProps } from 'antd/es/dropdown';
import React from 'react';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import type { DropDownProps } from 'antd/es/dropdown';
import classNames from 'classnames'; import classNames from 'classnames';
import React from 'react';
const useStyles = createStyles(({ token }) => { const useStyles = createStyles(({ token }) => {
return { return {

2
src/pages/account/center/components/AvatarList/index.tsx

@ -18,7 +18,7 @@ export type AvatarListProps = {
style?: React.CSSProperties; style?: React.CSSProperties;
children: React.ReactElement<AvatarItemProps> | React.ReactElement<AvatarItemProps>[]; children: React.ReactElement<AvatarItemProps> | React.ReactElement<AvatarItemProps>[];
}; };
const Item: React.FC<AvatarItemProps> = ({ src, size, tips, onClick = () => { } }) => { const Item: React.FC<AvatarItemProps> = ({ src, size, tips, onClick = () => {} }) => {
const { styles } = useStyles(); const { styles } = useStyles();
const avatarSizeToClassName = (size?: SizeType | 'mini') => const avatarSizeToClassName = (size?: SizeType | 'mini') =>
classNames(styles.avatarItem, { classNames(styles.avatarItem, {

1
src/pages/dashboard/workplace/style.style.ts

@ -175,6 +175,7 @@ const useStyles = createStyles(({ token }) => {
marginTop: '8px', marginTop: '8px',
overflow: 'hidden', overflow: 'hidden',
fontSize: '12px', fontSize: '12px',
gap: 'epx',
lineHeight: '20px', lineHeight: '20px',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',

8
src/pages/list/search/applications/index.tsx

@ -9,12 +9,12 @@ import { Avatar, Card, Col, Dropdown, Form, List, Row, Select, Tooltip } from 'a
import numeral from 'numeral'; import numeral from 'numeral';
import type { FC } from 'react'; import type { FC } from 'react';
import React from 'react'; import React from 'react';
import { categoryOptions } from '../../mock';
import StandardFormRow from './components/StandardFormRow'; import StandardFormRow from './components/StandardFormRow';
import TagSelect from './components/TagSelect'; import TagSelect from './components/TagSelect';
import type { ListItemDataType } from './data.d'; import type { ListItemDataType } from './data.d';
import { queryFakeList } from './service'; import { queryFakeList } from './service';
import useStyles from './style.style'; import useStyles from './style.style';
import { categoryOptions } from '../../mock';
export function formatWan(val: number) { export function formatWan(val: number) {
const v = val * 1; const v = val * 1;
if (!v || Number.isNaN(v)) return ''; if (!v || Number.isNaN(v)) return '';
@ -96,7 +96,9 @@ export const Applications: FC<Record<string, any>> = () => {
<Form.Item name="category"> <Form.Item name="category">
<TagSelect expandable> <TagSelect expandable>
{categoryOptions.map((category) => ( {categoryOptions.map((category) => (
<TagSelect.Option value={category.value!} key={category.value}>{category.label}</TagSelect.Option> <TagSelect.Option value={category.value!} key={category.value}>
{category.label}
</TagSelect.Option>
))} ))}
</TagSelect> </TagSelect>
</Form.Item> </Form.Item>
@ -115,7 +117,7 @@ export const Applications: FC<Record<string, any>> = () => {
{ {
label: '王昭君', label: '王昭君',
value: 'lisa', value: 'lisa',
} },
]} ]}
/> />
</Form.Item> </Form.Item>

24
src/pages/list/search/articles/index.tsx

@ -1,16 +1,16 @@
import { LikeOutlined, LoadingOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; import { LikeOutlined, LoadingOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons';
import { useRequest } from '@umijs/max'; import { useRequest } from '@umijs/max';
import { Button, Card, Col, Form, List, Row, Select, Tag } from 'antd'; import { Button, Card, Col, Form, List, Row, Select, Tag } from 'antd';
import { DefaultOptionType } from 'antd/es/select';
import type { FC } from 'react'; import type { FC } from 'react';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { categoryOptions } from '../../mock';
import ArticleListContent from './components/ArticleListContent'; import ArticleListContent from './components/ArticleListContent';
import StandardFormRow from './components/StandardFormRow'; import StandardFormRow from './components/StandardFormRow';
import TagSelect from './components/TagSelect'; import TagSelect from './components/TagSelect';
import type { ListItemDataType } from './data.d'; import type { ListItemDataType } from './data.d';
import { queryFakeList } from './service'; import { queryFakeList } from './service';
import useStyles from './style.style'; import useStyles from './style.style';
import { categoryOptions } from '../../mock';
import { DefaultOptionType } from 'antd/es/select';
const FormItem = Form.Item; const FormItem = Form.Item;
@ -116,10 +116,14 @@ const Articles: FC = () => {
</div> </div>
); );
const ownerOptions = useMemo<DefaultOptionType[]>(() => owners.map(item => ({ const ownerOptions = useMemo<DefaultOptionType[]>(
label: item.name, () =>
value: item.id, owners.map((item) => ({
})), [owners]); label: item.name,
value: item.id,
})),
[owners],
);
return ( return (
<> <>
@ -136,7 +140,9 @@ const Articles: FC = () => {
<FormItem name="category"> <FormItem name="category">
<TagSelect expandable> <TagSelect expandable>
{categoryOptions.map((category) => ( {categoryOptions.map((category) => (
<TagSelect.Option value={category.value!} key={category.value}>{category.label}</TagSelect.Option> <TagSelect.Option value={category.value!} key={category.value}>
{category.label}
</TagSelect.Option>
))} ))}
</TagSelect> </TagSelect>
</FormItem> </FormItem>
@ -165,7 +171,7 @@ const Articles: FC = () => {
{ {
label: '李三', label: '李三',
value: 'lisa', value: 'lisa',
} },
]} ]}
/> />
</FormItem> </FormItem>
@ -179,7 +185,7 @@ const Articles: FC = () => {
{ {
label: '优秀', label: '优秀',
value: 'good', value: 'good',
} },
]} ]}
/> />
</FormItem> </FormItem>

3
src/pages/list/search/index.tsx

@ -26,7 +26,8 @@ const Search: FC<SearchProps> = () => {
const location = useLocation(); const location = useLocation();
let match = useMatch(location.pathname); let match = useMatch(location.pathname);
const handleTabChange = (key: string) => { const handleTabChange = (key: string) => {
const url = match?.pathname === '/' ? '' : match?.pathname.substring(0, match.pathname.lastIndexOf('/')); const url =
match?.pathname === '/' ? '' : match?.pathname.substring(0, match.pathname.lastIndexOf('/'));
switch (key) { switch (key) {
case 'articles': case 'articles':
history.push(`${url}/articles`); history.push(`${url}/articles`);

10
src/pages/list/search/projects/index.tsx

@ -3,13 +3,13 @@ import { Card, Col, Form, List, Row, Select, Typography } from 'antd';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime'; import relativeTime from 'dayjs/plugin/relativeTime';
import type { FC } from 'react'; import type { FC } from 'react';
import { categoryOptions } from '../../mock';
import AvatarList from './components/AvatarList'; import AvatarList from './components/AvatarList';
import StandardFormRow from './components/StandardFormRow'; import StandardFormRow from './components/StandardFormRow';
import TagSelect from './components/TagSelect'; import TagSelect from './components/TagSelect';
import type { ListItemDataType } from './data.d'; import type { ListItemDataType } from './data.d';
import { queryFakeList } from './service'; import { queryFakeList } from './service';
import useStyles from './style.style'; import useStyles from './style.style';
import { categoryOptions } from '../../mock';
dayjs.extend(relativeTime); dayjs.extend(relativeTime);
@ -104,7 +104,9 @@ const Projects: FC = () => {
<FormItem name="category"> <FormItem name="category">
<TagSelect expandable> <TagSelect expandable>
{categoryOptions.map((category) => ( {categoryOptions.map((category) => (
<TagSelect.Option value={category.value!} key={category.value}>{category.label}</TagSelect.Option> <TagSelect.Option value={category.value!} key={category.value}>
{category.label}
</TagSelect.Option>
))} ))}
</TagSelect> </TagSelect>
</FormItem> </FormItem>
@ -123,7 +125,7 @@ const Projects: FC = () => {
{ {
label: '王昭君', label: '王昭君',
value: 'lisa', value: 'lisa',
} },
]} ]}
/> />
</FormItem> </FormItem>
@ -144,7 +146,7 @@ const Projects: FC = () => {
{ {
label: '普通', label: '普通',
value: 'normal', value: 'normal',
} },
]} ]}
/> />
</FormItem> </FormItem>

2
src/pages/user/login/index.tsx

@ -17,10 +17,10 @@ import {
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { FormattedMessage, Helmet, SelectLang, useIntl, useModel } from '@umijs/max'; import { FormattedMessage, Helmet, SelectLang, useIntl, useModel } from '@umijs/max';
import { Alert, message, Tabs } from 'antd'; import { Alert, message, Tabs } from 'antd';
import { createStyles } from 'antd-style';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { flushSync } from 'react-dom'; import { flushSync } from 'react-dom';
import Settings from '../../../../config/defaultSettings'; import Settings from '../../../../config/defaultSettings';
import { createStyles } from 'antd-style';
const useStyles = createStyles(({ token }) => { const useStyles = createStyles(({ token }) => {
return { return {

Loading…
Cancel
Save