Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 正式发布 #332

Merged
merged 24 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f8690c6
feat: ResultFail & ResultSuccess & ProfileAdvanced to umi3 (#230) (#231)
zhangyanling77 May 12, 2020
b492b59
feat: ListSearch to umi3 (#229)
brickspert May 12, 2020
8c2bba6
feat: ListBasicList & ListCardList to umi3 (#238)
poyiding May 12, 2020
586d967
AccountCenter, AccounSettings, EditorFlow, EditKoni, EditMind to umi…
lambGirl May 12, 2020
7419386
Migrate FormAdvancedForm, FormBasicForm, FormStepForm to umi@3 (#237)
qhanw May 12, 2020
49194bf
fix:UserLogin/UserRegister/UserRegisterResult移除Dva和locale相关 (#232)
chj-damon May 13, 2020
4cdbcf1
ProfileBasic,Exception500 to umi3 (#235)
chenguzhen87 May 13, 2020
d14f10d
feat: DashboardAnalysis & DashboardMonitor & DashboardWorkplace to um…
wangxingkang May 28, 2020
2bb0a39
ProfileBasic中Table迁移到ProTable (#250)
chenguzhen87 May 28, 2020
b08e1ed
update login
chenshuai2144 Jul 1, 2020
0a68c80
feat: umi hooks upgrade to ahooks (#264)
brickspert Oct 12, 2020
bbdd70b
up layout version
chenshuai2144 Feb 22, 2021
f2976c9
fix list error
chenshuai2144 Feb 22, 2021
c9bef36
fix error
chenshuai2144 Feb 22, 2021
4df6a8c
fix test
chenshuai2144 Feb 23, 2021
c3402d3
remove code
chenshuai2144 Feb 23, 2021
c9c89ab
fix lint error
chenshuai2144 Feb 23, 2021
b7870e9
分布表单重置
chenshuai2144 Feb 23, 2021
462ed43
表格代码更新
chenshuai2144 Feb 23, 2021
53a3913
表格代码更新
chenshuai2144 Feb 23, 2021
6d0a302
表格代码更新
chenshuai2144 Feb 23, 2021
5b3eb6a
使用ProForm 来完成功能
chenshuai2144 Feb 23, 2021
a6c33c4
修复编辑不能用的问题
chenshuai2144 Feb 23, 2021
b6a38e4
merge master
chenshuai2144 Feb 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ProfileBasic,Exception500 to umi3 (#235)
* feat: remove Exception500/locales

* feat: ProfileBasic to umi3
  • Loading branch information
chenguzhen87 authored May 13, 2020
commit 4cdbcf1d6f18c4515cc2183af3e95b21b676b51a
4 changes: 0 additions & 4 deletions Exception500/src/locales/en-US.ts

This file was deleted.

4 changes: 0 additions & 4 deletions Exception500/src/locales/pt-BR.ts

This file was deleted.

4 changes: 0 additions & 4 deletions Exception500/src/locales/zh-CN.ts

This file was deleted.

4 changes: 0 additions & 4 deletions Exception500/src/locales/zh-TW.ts

This file was deleted.

14 changes: 9 additions & 5 deletions ProfileBasic/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ const basicProgress = [
},
];

const getProfileBasicData = {
basicGoods,
basicProgress,
};
function getProfileBasic(_: Request, res: Response) {
return res.json({
data: {
basicProgress,
basicGoods,
},
});
}

export default {
'GET /api/profile/basic': getProfileBasicData,
'GET /api/profile/basic': getProfileBasic,
};
5 changes: 0 additions & 5 deletions ProfileBasic/src/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ export interface BasicProgress {
operator: string;
cost: string;
}

export interface BasicProfileDataType {
basicGoods: BasicGood[];
basicProgress: BasicProgress[];
}
299 changes: 136 additions & 163 deletions ProfileBasic/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Badge, Card, Descriptions, Divider, Table } from 'antd';
import React, { Component } from 'react';

import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { connect, Dispatch } from 'umi';
import { BasicProfileDataType } from './data.d';
import { Badge, Card, Descriptions, Divider, Table } from 'antd';
import React, { FC } from 'react';
import { useRequest } from 'umi';
import { queryBasicProfile } from './service';
import styles from './style.less';

const progressColumns = [
Expand Down Expand Up @@ -41,169 +40,143 @@ const progressColumns = [
},
];

interface PAGE_NAME_UPPER_CAMEL_CASEProps {
loading: boolean;
dispatch: Dispatch<any>;
BLOCK_NAME_CAMEL_CASE: BasicProfileDataType;
}
interface PAGE_NAME_UPPER_CAMEL_CASEState {
visible: boolean;
}
const PAGE_NAME_UPPER_CAMEL_CASE: FC = () => {
const { data, loading } = useRequest(() => {
return queryBasicProfile();
});

class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
PAGE_NAME_UPPER_CAMEL_CASEProps,
PAGE_NAME_UPPER_CAMEL_CASEState
> {
componentDidMount() {
const { dispatch } = this.props;
dispatch({
type: 'BLOCK_NAME_CAMEL_CASE/fetchBasic',
const { basicGoods, basicProgress } = data || {
basicGoods: [],
basicProgress: [],
};
let goodsData: typeof basicGoods = [];
if (basicGoods.length) {
let num = 0;
let amount = 0;
basicGoods.forEach((item) => {
num += Number(item.num);
amount += Number(item.amount);
});
goodsData = basicGoods.concat({
id: '总计',
num,
amount,
});
}

render() {
const { BLOCK_NAME_CAMEL_CASE, loading } = this.props;
const { basicGoods, basicProgress } = BLOCK_NAME_CAMEL_CASE;
let goodsData: typeof basicGoods = [];
if (basicGoods.length) {
let num = 0;
let amount = 0;
basicGoods.forEach((item) => {
num += Number(item.num);
amount += Number(item.amount);
});
goodsData = basicGoods.concat({
id: '总计',
num,
amount,
});
}
const renderContent = (value: any, row: any, index: any) => {
const obj: {
children: any;
props: { colSpan?: number };
} = {
children: value,
props: {},
};
if (index === basicGoods.length) {
obj.props.colSpan = 0;
}
return obj;
const renderContent = (value: any, row: any, index: any) => {
const obj: {
children: any;
props: { colSpan?: number };
} = {
children: value,
props: {},
};
const goodsColumns = [
{
title: '商品编号',
dataIndex: 'id',
key: 'id',
render: (text: React.ReactNode, row: any, index: number) => {
if (index < basicGoods.length) {
return <a href="">{text}</a>;
}
return {
children: <span style={{ fontWeight: 600 }}>总计</span>,
props: {
colSpan: 4,
},
};
},
},
{
title: '商品名称',
dataIndex: 'name',
key: 'name',
render: renderContent,
},
{
title: '商品条码',
dataIndex: 'barcode',
key: 'barcode',
render: renderContent,
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
align: 'right' as 'left' | 'right' | 'center',
render: renderContent,
if (index === basicGoods.length) {
obj.props.colSpan = 0;
}
return obj;
};

const goodsColumns = [
{
title: '商品编号',
dataIndex: 'id',
key: 'id',
render: (text: React.ReactNode, row: any, index: number) => {
if (index < basicGoods.length) {
return <a href="">{text}</a>;
}
return {
children: <span style={{ fontWeight: 600 }}>总计</span>,
props: {
colSpan: 4,
},
};
},
{
title: '数量(件)',
dataIndex: 'num',
key: 'num',
align: 'right' as 'left' | 'right' | 'center',
render: (text: React.ReactNode, row: any, index: number) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
},
{
title: '商品名称',
dataIndex: 'name',
key: 'name',
render: renderContent,
},
{
title: '商品条码',
dataIndex: 'barcode',
key: 'barcode',
render: renderContent,
},
{
title: '单价',
dataIndex: 'price',
key: 'price',
align: 'right' as 'left' | 'right' | 'center',
render: renderContent,
},
{
title: '数量(件)',
dataIndex: 'num',
key: 'num',
align: 'right' as 'left' | 'right' | 'center',
render: (text: React.ReactNode, row: any, index: number) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
{
title: '金额',
dataIndex: 'amount',
key: 'amount',
align: 'right' as 'left' | 'right' | 'center',
render: (text: React.ReactNode, row: any, index: number) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
},
{
title: '金额',
dataIndex: 'amount',
key: 'amount',
align: 'right' as 'left' | 'right' | 'center',
render: (text: React.ReactNode, row: any, index: number) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
];
return (
<PageHeaderWrapper>
<Card bordered={false}>
<Descriptions title="退款申请" style={{ marginBottom: 32 }}>
<Descriptions.Item label="取货单号">1000000000</Descriptions.Item>
<Descriptions.Item label="状态">已取货</Descriptions.Item>
<Descriptions.Item label="销售单号">1234123421</Descriptions.Item>
<Descriptions.Item label="子订单">3214321432</Descriptions.Item>
</Descriptions>
<Divider style={{ marginBottom: 32 }} />
<Descriptions title="用户信息" style={{ marginBottom: 32 }}>
<Descriptions.Item label="用户姓名">付小小</Descriptions.Item>
<Descriptions.Item label="联系电话">18100000000</Descriptions.Item>
<Descriptions.Item label="常用快递">菜鸟仓储</Descriptions.Item>
<Descriptions.Item label="取货地址">浙江省杭州市西湖区万塘路18号</Descriptions.Item>
<Descriptions.Item label="备注">无</Descriptions.Item>
</Descriptions>
<Divider style={{ marginBottom: 32 }} />
<div className={styles.title}>退货商品</div>
<Table
style={{ marginBottom: 24 }}
pagination={false}
loading={loading}
dataSource={goodsData}
columns={goodsColumns}
rowKey="id"
/>
<div className={styles.title}>退货进度</div>
<Table
style={{ marginBottom: 16 }}
pagination={false}
loading={loading}
dataSource={basicProgress}
columns={progressColumns}
/>
</Card>
</PageHeaderWrapper>
);
}
}
},
];

export default connect(
({
BLOCK_NAME_CAMEL_CASE,
loading,
}: {
BLOCK_NAME_CAMEL_CASE: BasicProfileDataType;
loading: {
effects: { [key: string]: boolean };
};
}) => ({
BLOCK_NAME_CAMEL_CASE,
loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchBasic'],
}),
)(PAGE_NAME_UPPER_CAMEL_CASE);
return (
<PageHeaderWrapper>
<Card bordered={false}>
<Descriptions title="退款申请" style={{ marginBottom: 32 }}>
<Descriptions.Item label="取货单号">1000000000</Descriptions.Item>
<Descriptions.Item label="状态">已取货</Descriptions.Item>
<Descriptions.Item label="销售单号">1234123421</Descriptions.Item>
<Descriptions.Item label="子订单">3214321432</Descriptions.Item>
</Descriptions>
<Divider style={{ marginBottom: 32 }} />
<Descriptions title="用户信息" style={{ marginBottom: 32 }}>
<Descriptions.Item label="用户姓名">付小小</Descriptions.Item>
<Descriptions.Item label="联系电话">18100000000</Descriptions.Item>
<Descriptions.Item label="常用快递">菜鸟仓储</Descriptions.Item>
<Descriptions.Item label="取货地址">浙江省杭州市西湖区万塘路18号</Descriptions.Item>
<Descriptions.Item label="备注">无</Descriptions.Item>
</Descriptions>
<Divider style={{ marginBottom: 32 }} />
<div className={styles.title}>退货商品</div>
<Table
style={{ marginBottom: 24 }}
pagination={false}
loading={loading}
dataSource={goodsData}
columns={goodsColumns}
rowKey="id"
/>
<div className={styles.title}>退货进度</div>
<Table
style={{ marginBottom: 16 }}
pagination={false}
loading={loading}
dataSource={basicProgress}
columns={progressColumns}
/>
</Card>
</PageHeaderWrapper>
);
};

export default PAGE_NAME_UPPER_CAMEL_CASE;
Loading