Commit e258747c authored by jim's avatar jim

merge master

parents 31052b29 303c5e43
{
"entry": "src/index.js",
"extraBabelPlugins": [
"transform-decorators-legacy",
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }]
],
"env": {
"development": {
"extraBabelPlugins": [
"dva-hmr"
]
}
},
"ignoreMomentLocale": true,
"theme": "./src/theme.js",
"html": {
"template": "./src/index.ejs"
},
"publicPath": "/",
"hash": true
}
const path = require("path");
export default {
entry: "src/index.js",
extraBabelPlugins: [
"transform-decorators-legacy",
["import", { libraryName: "antd", libraryDirectory: "es", style: true }]
],
env: {
development: {
extraBabelPlugins: ["dva-hmr"]
}
},
alias: {
components: path.resolve(__dirname, "src/components/")
},
ignoreMomentLocale: true,
theme: "./src/theme.js",
html: {
template: "./src/index.ejs"
},
disableDynamicImport: true,
publicPath: "/",
hash: true
};
...@@ -13,6 +13,7 @@ An out-of-box UI solution for enterprise applications as a React boilerplate. ...@@ -13,6 +13,7 @@ An out-of-box UI solution for enterprise applications as a React boilerplate.
- Documentation: http://pro.ant.design/docs/getting-started - Documentation: http://pro.ant.design/docs/getting-started
- ChangeLog: http://pro.ant.design/docs/changelog - ChangeLog: http://pro.ant.design/docs/changelog
- FAQ: http://pro.ant.design/docs/faq - FAQ: http://pro.ant.design/docs/faq
- Mirror Site in China: http://ant-design-pro.gitee.io
## Translation Recruitment :loudspeaker: ## Translation Recruitment :loudspeaker:
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
- 使用文档:http://pro.ant.design/docs/getting-started-cn - 使用文档:http://pro.ant.design/docs/getting-started-cn
- 更新日志: http://pro.ant.design/docs/changelog-cn - 更新日志: http://pro.ant.design/docs/changelog-cn
- 常见问题:http://pro.ant.design/docs/faq-cn - 常见问题:http://pro.ant.design/docs/faq-cn
- 国内镜像:http://ant-design-pro.gitee.io
## 特性 ## 特性
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
"private": true, "private": true,
"scripts": { "scripts": {
"precommit": "npm run lint-staged", "precommit": "npm run lint-staged",
"start": "cross-env DISABLE_ESLINT=true roadhog dev", "start": "cross-env ESLINT=none roadhog dev",
"start:no-proxy": "cross-env NO_PROXY=true DISABLE_ESLINT=true roadhog dev", "start:no-proxy": "cross-env NO_PROXY=true ESLINT=none roadhog dev",
"build": "cross-env DISABLE_ESLINT=true roadhog build", "build": "cross-env ESLINT=none roadhog build",
"site": "roadhog-api-doc static && gh-pages -d dist", "site": "roadhog-api-doc static && gh-pages -d dist",
"analyze": "cross-env ANALYZE=true roadhog build", "analyze": "cross-env ANALYZE=true roadhog build",
"lint:style": "stylelint \"src/**/*.less\" --syntax less", "lint:style": "stylelint \"src/**/*.less\" --syntax less",
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"dependencies": { "dependencies": {
"@antv/data-set": "^0.8.0", "@antv/data-set": "^0.8.0",
"@babel/polyfill": "^7.0.0-beta.36", "@babel/polyfill": "^7.0.0-beta.36",
"antd": "^3.2.0", "antd": "^3.3.0",
"babel-runtime": "^6.9.2", "babel-runtime": "^6.9.2",
"bizcharts": "^3.1.3-beta.1", "bizcharts": "^3.1.3-beta.1",
"bizcharts-plugin-slider": "^2.0.1", "bizcharts-plugin-slider": "^2.0.1",
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
"devDependencies": { "devDependencies": {
"babel-eslint": "^8.1.2", "babel-eslint": "^8.1.2",
"babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-dva-hmr": "^0.4.1",
"babel-plugin-import": "^1.6.3", "babel-plugin-import": "^1.6.7",
"babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-decorators-legacy": "^1.3.4",
"cross-env": "^5.1.1", "cross-env": "^5.1.1",
"cross-port-killer": "^1.0.1", "cross-port-killer": "^1.0.1",
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
"pro-download": "^1.0.1", "pro-download": "^1.0.1",
"redbox-react": "^1.5.0", "redbox-react": "^1.5.0",
"regenerator-runtime": "^0.11.1", "regenerator-runtime": "^0.11.1",
"roadhog": "^2.1.0", "roadhog": "^2.3.0",
"roadhog-api-doc": "^0.3.4", "roadhog-api-doc": "^0.3.4",
"stylelint": "^8.4.0", "stylelint": "^8.4.0",
"stylelint-config-standard": "^18.0.0" "stylelint-config-standard": "^18.0.0"
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
"**/*.{js,jsx}": "lint-staged:js", "**/*.{js,jsx}": "lint-staged:js",
"**/*.less": "stylelint --syntax less" "**/*.less": "stylelint --syntax less"
}, },
"engines": {
"node" : ">=8.0.0"
},
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
"last 2 versions", "last 2 versions",
......
import * as React from 'react';
export interface IAvatarItemProps {
tips: React.ReactNode;
src: string;
style?: React.CSSProperties;
}
export default class AvatarItem extends React.Component<IAvatarItemProps, any> {
constructor(props: IAvatarItemProps);
}
import * as React from "react"; import * as React from 'react';
export interface AvatarItemProps { import AvatarItem from './AvatarItem';
tips: React.ReactNode;
src: string;
style?: React.CSSProperties;
}
export interface AvatarListProps { export interface IAvatarListProps {
size?: "large" | "small" | "mini" | "default"; size?: 'large' | 'small' | 'mini' | 'default';
style?: React.CSSProperties; style?: React.CSSProperties;
children: children:
| React.ReactElement<AvatarItem> | React.ReactElement<AvatarItem>
| Array<React.ReactElement<AvatarItem>>; | Array<React.ReactElement<AvatarItem>>;
} }
declare class AvatarItem extends React.Component<AvatarItemProps, any> { export default class AvatarList extends React.Component<IAvatarListProps, any> {
constructor(props: AvatarItemProps); public static Item: typeof AvatarItem;
}
export default class AvatarList extends React.Component<AvatarListProps, any> {
constructor(props: AvatarListProps);
static Item: typeof AvatarItem;
} }
import * as React from "react"; import * as React from "react";
export interface BarProps { export interface IBarProps {
title: React.ReactNode; title: React.ReactNode;
color?: string; color?: string;
padding?: [number, number, number, number]; padding?: [number, number, number, number];
...@@ -12,4 +12,4 @@ export interface BarProps { ...@@ -12,4 +12,4 @@ export interface BarProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Bar extends React.Component<BarProps, any> {} export default class Bar extends React.Component<IBarProps, any> {}
import * as React from "react"; import * as React from "react";
export interface ChartCardProps { export interface IChartCardProps {
title: React.ReactNode; title: React.ReactNode;
action?: React.ReactNode; action?: React.ReactNode;
total?: React.ReactNode | number; total?: React.ReactNode | number;
...@@ -9,4 +9,4 @@ export interface ChartCardProps { ...@@ -9,4 +9,4 @@ export interface ChartCardProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class ChartCard extends React.Component<ChartCardProps, any> {} export default class ChartCard extends React.Component<IChartCardProps, any> {}
...@@ -4,6 +4,18 @@ import classNames from 'classnames'; ...@@ -4,6 +4,18 @@ import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
const renderTotal = (total) => {
let totalDom;
switch (typeof total) {
case undefined:
totalDom = null;
break;
default:
totalDom = <div className={styles.total}>{total}</div>;
}
return totalDom;
};
const ChartCard = ({ const ChartCard = ({
loading = false, contentHeight, title, avatar, action, total, footer, children, ...rest loading = false, contentHeight, title, avatar, action, total, footer, children, ...rest
}) => { }) => {
...@@ -22,10 +34,7 @@ const ChartCard = ({ ...@@ -22,10 +34,7 @@ const ChartCard = ({
<span className={styles.title}>{title}</span> <span className={styles.title}>{title}</span>
<span className={styles.action}>{action}</span> <span className={styles.action}>{action}</span>
</div> </div>
{ {renderTotal(total)}
// eslint-disable-next-line
(total !== undefined) && (<div className={styles.total} dangerouslySetInnerHTML={{ __html: total }} />)
}
</div> </div>
</div> </div>
{ {
......
import * as React from "react"; import * as React from "react";
export interface FieldProps { export interface IFieldProps {
label: React.ReactNode; label: React.ReactNode;
value: React.ReactNode; value: React.ReactNode;
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Field extends React.Component<FieldProps, any> {} export default class Field extends React.Component<IFieldProps, any> {}
import * as React from "react"; import * as React from "react";
export interface GaugeProps { export interface IGaugeProps {
title: React.ReactNode; title: React.ReactNode;
color?: string; color?: string;
height: number; height: number;
...@@ -8,4 +8,4 @@ export interface GaugeProps { ...@@ -8,4 +8,4 @@ export interface GaugeProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Gauge extends React.Component<GaugeProps, any> {} export default class Gauge extends React.Component<IGaugeProps, any> {}
import * as React from "react"; import * as React from 'react';
// g2已经更新到3.0 // g2已经更新到3.0
// 不带的写了 // 不带的写了
export interface Axis { export interface IAxis {
title: any; title: any;
line: any; line: any;
gridAlign: any; gridAlign: any;
...@@ -12,18 +12,18 @@ export interface Axis { ...@@ -12,18 +12,18 @@ export interface Axis {
grid: any; grid: any;
} }
export interface MiniAreaProps { export interface IMiniAreaProps {
color?: string; color?: string;
height: number; height: number;
borderColor?: string; borderColor?: string;
line?: boolean; line?: boolean;
animate?: boolean; animate?: boolean;
xAxis?: Axis; xAxis?: IAxis;
yAxis?: Axis; yAxis?: IAxis;
data: Array<{ data: Array<{
x: number; x: number;
y: number; y: number;
}>; }>;
} }
export default class MiniArea extends React.Component<MiniAreaProps, any> {} export default class MiniArea extends React.Component<IMiniAreaProps, any> {}
import * as React from 'react'; import * as React from 'react';
export interface MiniBarProps { export interface IMiniBarProps {
color?: string; color?: string;
height: number; height: number;
data: Array<{ data: Array<{
...@@ -9,4 +9,4 @@ export interface MiniBarProps { ...@@ -9,4 +9,4 @@ export interface MiniBarProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class MiniBar extends React.Component<MiniBarProps, any> {} export default class MiniBar extends React.Component<IMiniBarProps, any> {}
import * as React from "react"; import * as React from "react";
export interface MiniProgressProps { export interface IMiniProgressProps {
target: number; target: number;
color?: string; color?: string;
strokeWidth?: number; strokeWidth?: number;
...@@ -8,6 +8,6 @@ export interface MiniProgressProps { ...@@ -8,6 +8,6 @@ export interface MiniProgressProps {
} }
export default class MiniProgress extends React.Component< export default class MiniProgress extends React.Component<
MiniProgressProps, IMiniProgressProps,
any any
> {} > {}
import * as React from 'react'; import * as React from 'react';
export interface PieProps { export interface IPieProps {
animate?: boolean; animate?: boolean;
color?: string; color?: string;
height: number; height: number;
...@@ -17,4 +17,4 @@ export interface PieProps { ...@@ -17,4 +17,4 @@ export interface PieProps {
subTitle?: React.ReactNode; subTitle?: React.ReactNode;
} }
export default class Pie extends React.Component<PieProps, any> {} export default class Pie extends React.Component<IPieProps, any> {}
import * as React from "react"; import * as React from "react";
export interface RadarProps { export interface IRadarProps {
title?: React.ReactNode; title?: React.ReactNode;
height: number; height: number;
padding?: [number, number, number, number]; padding?: [number, number, number, number];
...@@ -12,4 +12,4 @@ export interface RadarProps { ...@@ -12,4 +12,4 @@ export interface RadarProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Radar extends React.Component<RadarProps, any> {} export default class Radar extends React.Component<IRadarProps, any> {}
import * as React from "react"; import * as React from "react";
export interface TagCloudProps { export interface ITagCloudProps {
data: Array<{ data: Array<{
name: string; name: string;
value: number; value: number;
...@@ -8,4 +8,4 @@ export interface TagCloudProps { ...@@ -8,4 +8,4 @@ export interface TagCloudProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class TagCloud extends React.Component<TagCloudProps, any> {} export default class TagCloud extends React.Component<ITagCloudProps, any> {}
import * as React from "react"; import * as React from "react";
export interface TimelineChartProps { export interface ITimelineChartProps {
data: Array<{ data: Array<{
x: string; x: string;
y1: string; y1: string;
...@@ -12,6 +12,6 @@ export interface TimelineChartProps { ...@@ -12,6 +12,6 @@ export interface TimelineChartProps {
} }
export default class TimelineChart extends React.Component< export default class TimelineChart extends React.Component<
TimelineChartProps, ITimelineChartProps,
any any
> {} > {}
import * as React from 'react'; import * as React from 'react';
export interface WaterWaveProps { export interface IWaterWaveProps {
title: React.ReactNode; title: React.ReactNode;
color?: string; color?: string;
height: number; height: number;
...@@ -7,4 +7,4 @@ export interface WaterWaveProps { ...@@ -7,4 +7,4 @@ export interface WaterWaveProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class WaterWave extends React.Component<WaterWaveProps, any> {} export default class WaterWave extends React.Component<IWaterWaveProps, any> {}
import * as React from "react"; import * as React from "react";
export interface CountDownProps { export interface ICountDownProps {
format?: (time: number) => void; format?: (time: number) => void;
target: Date | number; target: Date | number;
onEnd?: () => void; onEnd?: () => void;
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class CountDown extends React.Component<CountDownProps, any> {} export default class CountDown extends React.Component<ICountDownProps, any> {}
import * as React from 'react';
export default class Description extends React.Component<
{
term: React.ReactNode;
style?: React.CSSProperties;
},
any
> {}
import * as React from 'react'; import * as React from 'react';
export interface DescriptionListProps { import Description from './Description';
export interface IDescriptionListProps {
layout?: 'horizontal' | 'vertical'; layout?: 'horizontal' | 'vertical';
col?: number; col?: number;
title: React.ReactNode; title: React.ReactNode;
...@@ -8,17 +10,9 @@ export interface DescriptionListProps { ...@@ -8,17 +10,9 @@ export interface DescriptionListProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
declare class Description extends React.Component<
{
term: React.ReactNode;
style?: React.CSSProperties;
},
any
> {}
export default class DescriptionList extends React.Component< export default class DescriptionList extends React.Component<
DescriptionListProps, IDescriptionListProps,
any any
> { > {
static Description: typeof Description; public static Description: typeof Description;
} }
import * as React from 'react'; import * as React from 'react';
export interface EllipsisProps { export interface IEllipsisProps {
tooltip?: boolean; tooltip?: boolean;
length?: number; length?: number;
lines?: number; lines?: number;
...@@ -7,4 +7,4 @@ export interface EllipsisProps { ...@@ -7,4 +7,4 @@ export interface EllipsisProps {
className?: string; className?: string;
} }
export default class Ellipsis extends React.Component<EllipsisProps, any> {} export default class Ellipsis extends React.Component<IEllipsisProps, any> {}
import * as React from "react"; import * as React from "react";
export interface ExceptionProps { export interface IExceptionProps {
type?: "403" | "404" | "500"; type?: "403" | "404" | "500";
title?: React.ReactNode; title?: React.ReactNode;
desc?: React.ReactNode; desc?: React.ReactNode;
...@@ -9,4 +9,4 @@ export interface ExceptionProps { ...@@ -9,4 +9,4 @@ export interface ExceptionProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Exception extends React.Component<ExceptionProps, any> {} export default class Exception extends React.Component<IExceptionProps, any> {}
import * as React from 'react'; import * as React from 'react';
export interface FooterToolbarProps { export interface IFooterToolbarProps {
extra: React.ReactNode; extra: React.ReactNode;
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class FooterToolbar extends React.Component< export default class FooterToolbar extends React.Component<
FooterToolbarProps, IFooterToolbarProps,
any any
> {} > {}
import * as React from "react"; import * as React from "react";
export interface GlobalFooterProps { export interface IGlobalFooterProps {
links?: Array<{ links?: Array<{
title: React.ReactNode; title: React.ReactNode;
href: string; href: string;
...@@ -10,6 +10,6 @@ export interface GlobalFooterProps { ...@@ -10,6 +10,6 @@ export interface GlobalFooterProps {
} }
export default class GlobalFooter extends React.Component< export default class GlobalFooter extends React.Component<
GlobalFooterProps, IGlobalFooterProps,
any any
> {} > {}
import * as React from 'react'; import * as React from 'react';
export interface HeaderSearchProps { export interface IHeaderSearchProps {
placeholder?: string; placeholder?: string;
dataSource?: Array<string>; dataSource?: string[];
onSearch?: (value: string) => void; onSearch?: (value: string) => void;
onChange?: (value: string) => void; onChange?: (value: string) => void;
onPressEnter?: (value: string) => void; onPressEnter?: (value: string) => void;
...@@ -9,6 +9,6 @@ export interface HeaderSearchProps { ...@@ -9,6 +9,6 @@ export interface HeaderSearchProps {
} }
export default class HeaderSearch extends React.Component< export default class HeaderSearch extends React.Component<
HeaderSearchProps, IHeaderSearchProps,
any any
> {} > {}
import * as React from 'react';
export interface INoticeIconData {
avatar?: string;
title?: React.ReactNode;
description?: React.ReactNode;
datetime?: React.ReactNode;
extra?: React.ReactNode;
style?: React.CSSProperties;
}
export interface INoticeIconTabProps {
list?: INoticeIconData[];
title?: string;
emptyText?: React.ReactNode;
emptyImage?: string;
style?: React.CSSProperties;
}
export default class NoticeIconTab extends React.Component<
INoticeIconTabProps,
any
> {}
import * as React from 'react'; import React from 'react';
export interface NoticeIconData { import NoticeIconTab, { INoticeIconData } from './NoticeIconTab';
avatar?: string;
title?: React.ReactNode;
description?: React.ReactNode;
datetime?: React.ReactNode;
extra?: React.ReactNode;
style?: React.CSSProperties;
}
export interface NoticeIconProps { export interface INoticeIconProps {
count?: number; count?: number;
className?: string; className?: string;
loading?: boolean; loading?: boolean;
onClear?: (tableTile: string) => void; onClear?: (tableTile: string) => void;
onItemClick?: (item: NoticeIconData, tabProps: NoticeIconProps) => void; onItemClick?: (item: INoticeIconData, tabProps: INoticeIconProps) => void;
onTabChange?: (tableTile: string) => void; onTabChange?: (tableTile: string) => void;
popupAlign?: { popupAlign?: {
points?: [string, string]; points?: [string, string];
...@@ -30,16 +23,6 @@ export interface NoticeIconProps { ...@@ -30,16 +23,6 @@ export interface NoticeIconProps {
locale?: { emptyText: string; clear: string }; locale?: { emptyText: string; clear: string };
} }
export interface NoticeIconTabProps { export default class NoticeIcon extends React.Component<INoticeIconProps, any> {
list?: Array<NoticeIconData>; public static Tab: typeof NoticeIconTab;
title?: string;
emptyText?: React.ReactNode;
emptyImage?: string;
style?: React.CSSProperties;
}
export class NoticeIconTab extends React.Component<NoticeIconTabProps, any> {}
export default class NoticeIcon extends React.Component<NoticeIconProps, any> {
static Tab: typeof NoticeIconTab;
} }
import * as React from 'react'; import * as React from 'react';
export interface NumberInfoProps { export interface INumberInfoProps {
title?: React.ReactNode | string; title?: React.ReactNode | string;
subTitle?: React.ReactNode | string; subTitle?: React.ReactNode | string;
total?: React.ReactNode | string; total?: React.ReactNode | string;
...@@ -10,4 +10,7 @@ export interface NumberInfoProps { ...@@ -10,4 +10,7 @@ export interface NumberInfoProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class NumberInfo extends React.Component<NumberInfoProps, any> {} export default class NumberInfo extends React.Component<
INumberInfoProps,
any
> {}
import * as React from 'react'; import * as React from 'react';
export interface PageHeaderProps { export interface IPageHeaderProps {
title?: React.ReactNode | string; title?: React.ReactNode | string;
logo?: React.ReactNode | string; logo?: React.ReactNode | string;
action?: React.ReactNode | string; action?: React.ReactNode | string;
content?: React.ReactNode; content?: React.ReactNode;
extraContent?: React.ReactNode; extraContent?: React.ReactNode;
routes?: Array<any>; routes?: any[];
params?: any; params?: any;
breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>; breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>;
tabList?: Array<{ key: string; tab: React.ReactNode }>; tabList?: Array<{ key: string; tab: React.ReactNode }>;
tabActiveKey?: string; tabActiveKey?: string;
tabDefaultActiveKey?: string;
onTabChange?: (key: string) => void; onTabChange?: (key: string) => void;
tabBarExtraContent?: React.ReactNode; tabBarExtraContent?: React.ReactNode;
linkElement?: React.ReactNode; linkElement?: React.ReactNode;
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class PageHeader extends React.Component<PageHeaderProps, any> {} export default class PageHeader extends React.Component<IPageHeaderProps, any> {}
...@@ -166,18 +166,15 @@ export default class PageHeader extends PureComponent { ...@@ -166,18 +166,15 @@ export default class PageHeader extends PureComponent {
tabList, tabList,
className, className,
tabActiveKey, tabActiveKey,
tabDefaultActiveKey,
tabBarExtraContent, tabBarExtraContent,
} = this.props; } = this.props;
const clsString = classNames(styles.pageHeader, className); const clsString = classNames(styles.pageHeader, className);
let tabDefaultValue;
if (tabActiveKey !== undefined && tabList) {
tabDefaultValue = tabList.filter(item => item.default)[0] || tabList[0];
}
const breadcrumb = this.conversionBreadcrumbList(); const breadcrumb = this.conversionBreadcrumbList();
const activeKeyProps = { const activeKeyProps = {};
defaultActiveKey: tabDefaultValue && tabDefaultValue.key, if (tabDefaultActiveKey !== undefined) {
}; activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
}
if (tabActiveKey !== undefined) { if (tabActiveKey !== undefined) {
activeKeyProps.activeKey = tabActiveKey; activeKeyProps.activeKey = tabActiveKey;
} }
......
...@@ -25,6 +25,7 @@ order: 11 ...@@ -25,6 +25,7 @@ order: 11
| breadcrumbNameMap | 面包屑相关属性,路由的地址-名称映射表 | object | - | | breadcrumbNameMap | 面包屑相关属性,路由的地址-名称映射表 | object | - |
| tabList | tab 标题列表 | array<{key: string, tab: ReactNode}> | - | | tabList | tab 标题列表 | array<{key: string, tab: ReactNode}> | - |
| tabActiveKey | 当前高亮的 tab 项 | string | - | | tabActiveKey | 当前高亮的 tab 项 | string | - |
| tabDefaultActiveKey | 默认高亮的 tab 项 | string | 第一项 |
| onTabChange | 切换面板的回调 | (key) => void | - | | onTabChange | 切换面板的回调 | (key) => void | - |
| linkElement | 定义链接的元素,默认为 `a`,可传入 react-router 的 Link | string\|ReactElement | - | | linkElement | 定义链接的元素,默认为 `a`,可传入 react-router 的 Link | string\|ReactElement | - |
......
import * as React from 'react'; import * as React from 'react';
export interface ResultProps { export interface IResultProps {
type: 'success' | 'error'; type: 'success' | 'error';
title: React.ReactNode; title: React.ReactNode;
description?: React.ReactNode; description?: React.ReactNode;
...@@ -8,4 +8,4 @@ export interface ResultProps { ...@@ -8,4 +8,4 @@ export interface ResultProps {
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Result extends React.Component<ResultProps, any> {} export default class Result extends React.Component<IResultProps, any> {}
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Layout } from 'antd'; import { Layout, Menu, Icon } from 'antd';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import styles from './index.less'; import styles from './index.less';
import BaseMeun, { getMeunMatcheys } from './BaseMeun'; import BaseMeun, { getMeunMatcheys } from './BaseMeun';
import { urlToList } from '../utils/pathTools'; import { urlToList } from '../utils/pathTools';
const { Sider } = Layout; const { Sider } = Layout;
const { SubMenu } = Menu;
// Allow menu.js config icon as string or ReactNode
// icon: 'setting',
// icon: 'http://demo.com/icon.png',
// icon: <Icon type="setting" />,
const getIcon = (icon) => {
if (typeof icon === 'string' && icon.indexOf('http') === 0) {
return <img src={icon} alt="icon" className={`${styles.icon} sider-menu-item-img`} />;
}
if (typeof icon === 'string') {
return <Icon type={icon} />;
}
return icon;
};
export default class SiderMenu extends PureComponent { export default class SiderMenu extends PureComponent {
constructor(props) { constructor(props) {
...@@ -42,6 +58,77 @@ export default class SiderMenu extends PureComponent { ...@@ -42,6 +58,77 @@ export default class SiderMenu extends PureComponent {
* Convert pathname to openKeys * Convert pathname to openKeys
* /list/search/articles = > ['list','/list/search'] * /list/search/articles = > ['list','/list/search']
* @param props * @param props
* 判断是否是http链接.返回 Link 或 a
* Judge whether it is http link.return a or Link
* @memberof SiderMenu
*/
getMenuItemPath = (item) => {
const itemPath = this.conversionPath(item.path);
const icon = getIcon(item.icon);
const { target, name } = item;
// Is it a http link
if (/^https?:\/\//.test(itemPath)) {
return (
<a href={itemPath} target={target}>
{icon}
<span>{name}</span>
</a>
);
}
return (
<Link
to={itemPath}
target={target}
replace={itemPath === this.props.location.pathname}
onClick={
this.props.isMobile
? () => {
this.props.onCollapse(true);
}
: undefined
}
>
{icon}
<span>{name}</span>
</Link>
);
};
/**
* get SubMenu or Item
*/
getSubMenuOrItem = (item) => {
if (item.children && item.children.some(child => child.name)) {
const childrenItems = this.getNavMenuItems(item.children);
// 当无子菜单时就不展示菜单
if (childrenItems && childrenItems.length > 0) {
return (
<SubMenu
title={
item.icon ? (
<span>
{getIcon(item.icon)}
<span>{item.name}</span>
</span>
) : (
item.name
)
}
key={item.path}
>
{childrenItems}
</SubMenu>
);
}
return null;
} else {
return (
<Menu.Item key={item.path}>{this.getMenuItemPath(item)}</Menu.Item>
);
}
};
/**
* 获得菜单子节点
* @memberof SiderMenu
*/ */
getDefaultCollapsedSubMenus(props) { getDefaultCollapsedSubMenus(props) {
const { location: { pathname } } = props || this.props; const { location: { pathname } } = props || this.props;
......
...@@ -49,4 +49,18 @@ ...@@ -49,4 +49,18 @@
.drawer .drawer-content { .drawer .drawer-content {
background: #001529; background: #001529;
} }
.ant-menu-inline-collapsed {
& > .ant-menu-item .sider-menu-item-img + span,
& > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item .sider-menu-item-img + span,
& > .ant-menu-submenu > .ant-menu-submenu-title .sider-menu-item-img + span {
max-width: 0;
display: inline-block;
opacity: 0;
}
}
.ant-menu-item .sider-menu-item-img + span,
.ant-menu-submenu-title .sider-menu-item-img + span {
transition: opacity .3s @ease-in-out, width .3s @ease-in-out;
opacity: 1;
}
} }
import * as React from 'react';
export interface ITagSelectOptionProps {
value: string | number;
style?: React.CSSProperties;
}
export default class TagSelectOption extends React.Component<
ITagSelectOptionProps,
any
> {}
import * as React from 'react'; import * as React from 'react';
export interface TagSelectProps { import TagSelectOption from './TagSelectOption';
onChange?: (value: Array<string>) => void;
export interface ITagSelectProps {
onChange?: (value: string[]) => void;
expandable?: boolean; expandable?: boolean;
value?: Array<string>| Array<number>; value?: string[] | number[];
style?: React.CSSProperties;
}
export interface TagSelectOptionProps {
value: string| number;
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export class TagSelectOption extends React.Component< export default class TagSelect extends React.Component<ITagSelectProps, any> {
TagSelectOptionProps, public static Option: typeof TagSelectOption;
any private children:
> {}
export default class TagSelect extends React.Component<TagSelectProps, any> {
static Option: typeof TagSelectOption;
children:
| React.ReactElement<TagSelectOption> | React.ReactElement<TagSelectOption>
| Array<React.ReactElement<TagSelectOption>>; | Array<React.ReactElement<TagSelectOption>>;
} }
import * as React from 'react'; import * as React from 'react';
export interface TrendProps { export interface ITrendProps {
colorful?: boolean; colorful?: boolean;
flag: 'up' | 'down'; flag: 'up' | 'down';
style?: React.CSSProperties; style?: React.CSSProperties;
} }
export default class Trend extends React.Component<TrendProps, any> {} export default class Trend extends React.Component<ITrendProps, any> {}
...@@ -16,7 +16,7 @@ import Footer from './Footer'; ...@@ -16,7 +16,7 @@ import Footer from './Footer';
import Header from './Header'; import Header from './Header';
const { Content } = Layout; const { Content } = Layout;
const { AuthorizedRoute } = Authorized; const { AuthorizedRoute, check } = Authorized;
const RightSidebar = connect(({ setting }) => ({ ...setting }))(Sidebar); const RightSidebar = connect(({ setting }) => ({ ...setting }))(Sidebar);
...@@ -72,7 +72,11 @@ class BasicLayout extends React.PureComponent { ...@@ -72,7 +72,11 @@ class BasicLayout extends React.PureComponent {
urlParams.searchParams.delete('redirect'); urlParams.searchParams.delete('redirect');
window.history.replaceState(null, 'redirect', urlParams.href); window.history.replaceState(null, 'redirect', urlParams.href);
} else { } else {
return '/dashboard/analysis'; const { routerData } = this.props;
// get the first authorized route path in routerData
const authorizedPath = Object.keys(routerData).find(item =>
check(routerData[item].authority, item) && item !== '/');
return authorizedPath;
} }
return redirect; return redirect;
}; };
......
import { query403, query401, query404, query500 } from '../services/error'; import { routerRedux } from 'dva/router';
import { query } from '../services/error';
export default { export default {
namespace: 'error', namespace: 'error',
...@@ -9,32 +10,13 @@ export default { ...@@ -9,32 +10,13 @@ export default {
}, },
effects: { effects: {
*query403(_, { call, put }) { *query({ payload }, { call, put }) {
yield call(query403); yield call(query, payload.code);
// redirect on client when network broken
yield put(routerRedux.push(`/exception/${payload.code}`));
yield put({ yield put({
type: 'trigger', type: 'trigger',
payload: '403', payload: payload.code,
});
},
*query401(_, { call, put }) {
yield call(query401);
yield put({
type: 'trigger',
payload: '401',
});
},
*query500(_, { call, put }) {
yield call(query500);
yield put({
type: 'trigger',
payload: '500',
});
},
*query404(_, { call, put }) {
yield call(query404);
yield put({
type: 'trigger',
payload: '404',
}); });
}, },
}, },
......
...@@ -13,8 +13,6 @@ import { ...@@ -13,8 +13,6 @@ import {
Menu, Menu,
Dropdown, Dropdown,
} from 'antd'; } from 'antd';
import numeral from 'numeral';
import GridContent from '../../layouts/GridContent';
import { import {
ChartCard, ChartCard,
yuan, yuan,
...@@ -25,9 +23,12 @@ import { ...@@ -25,9 +23,12 @@ import {
Bar, Bar,
Pie, Pie,
TimelineChart, TimelineChart,
} from '../../components/Charts'; } from 'components/Charts';
import Trend from '../../components/Trend'; import Trend from 'components/Trend';
import NumberInfo from '../../components/NumberInfo'; import NumberInfo from 'components/NumberInfo';
import numeral from 'numeral';
import GridContent from '../../layouts/GridContent';
import { getTimeDistance } from '../../utils/utils'; import { getTimeDistance } from '../../utils/utils';
import styles from './Analysis.less'; import styles from './Analysis.less';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Card, Tooltip } from 'antd'; import { Row, Col, Card, Tooltip } from 'antd';
import { Pie, WaterWave, Gauge, TagCloud } from 'components/Charts';
import NumberInfo from 'components/NumberInfo';
import CountDown from 'components/CountDown';
import ActiveChart from 'components/ActiveChart';
import numeral from 'numeral'; import numeral from 'numeral';
import GridContent from '../../layouts/GridContent'; import GridContent from '../../layouts/GridContent';
import Authorized from '../../utils/Authorized'; import Authorized from '../../utils/Authorized';
import { Pie, WaterWave, Gauge, TagCloud } from '../../components/Charts';
import NumberInfo from '../../components/NumberInfo';
import CountDown from '../../components/CountDown';
import ActiveChart from '../../components/ActiveChart';
import styles from './Monitor.less'; import styles from './Monitor.less';
const { Secured } = Authorized; const { Secured } = Authorized;
...@@ -49,10 +50,7 @@ export default class Monitor extends PureComponent { ...@@ -49,10 +50,7 @@ export default class Monitor extends PureComponent {
/> />
</Col> </Col>
<Col md={6} sm={12} xs={24}> <Col md={6} sm={12} xs={24}>
<NumberInfo <NumberInfo subTitle="销售目标完成率" total="92%" />
subTitle="销售目标完成率"
total="92%"
/>
</Col> </Col>
<Col md={6} sm={12} xs={24}> <Col md={6} sm={12} xs={24}>
<NumberInfo subTitle="活动剩余时间" total={<CountDown target={targetTime} />} /> <NumberInfo subTitle="活动剩余时间" total={<CountDown target={targetTime} />} />
...@@ -67,7 +65,10 @@ export default class Monitor extends PureComponent { ...@@ -67,7 +65,10 @@ export default class Monitor extends PureComponent {
</Row> </Row>
<div className={styles.mapChart}> <div className={styles.mapChart}>
<Tooltip title="等待后期实现"> <Tooltip title="等待后期实现">
<img src="https://gw.alipayobjects.com/zos/rmsportal/HBWnDEUXCnGnGrRfrpKa.png" alt="map" /> <img
src="https://gw.alipayobjects.com/zos/rmsportal/HBWnDEUXCnGnGrRfrpKa.png"
alt="map"
/>
</Tooltip> </Tooltip>
</div> </div>
</Card> </Card>
...@@ -106,11 +107,7 @@ export default class Monitor extends PureComponent { ...@@ -106,11 +107,7 @@ export default class Monitor extends PureComponent {
</Row> </Row>
<Row gutter={24}> <Row gutter={24}>
<Col xl={12} lg={24} sm={24} xs={24}> <Col xl={12} lg={24} sm={24} xs={24}>
<Card <Card title="各品类占比" bordered={false} className={styles.pieCard}>
title="各品类占比"
bordered={false}
className={styles.pieCard}
>
<Row style={{ padding: '16px 0' }}> <Row style={{ padding: '16px 0' }}>
<Col span={8}> <Col span={8}>
<Pie <Pie
...@@ -148,20 +145,22 @@ export default class Monitor extends PureComponent { ...@@ -148,20 +145,22 @@ export default class Monitor extends PureComponent {
</Card> </Card>
</Col> </Col>
<Col xl={6} lg={12} sm={24} xs={24}> <Col xl={6} lg={12} sm={24} xs={24}>
<Card title="热门搜索" loading={loading} bordered={false} bodyStyle={{ overflow: 'hidden' }}> <Card
<TagCloud title="热门搜索"
data={tags} loading={loading}
height={161} bordered={false}
/> bodyStyle={{ overflow: 'hidden' }}
>
<TagCloud data={tags} height={161} />
</Card> </Card>
</Col> </Col>
<Col xl={6} lg={12} sm={24} xs={24}> <Col xl={6} lg={12} sm={24} xs={24}>
<Card title="资源剩余" bodyStyle={{ textAlign: 'center', fontSize: 0 }} bordered={false}> <Card
<WaterWave title="资源剩余"
height={161} bodyStyle={{ textAlign: 'center', fontSize: 0 }}
title="补贴资金剩余" bordered={false}
percent={34} >
/> <WaterWave height={161} title="补贴资金剩余" percent={34} />
</Card> </Card>
</Col> </Col>
</Row> </Row>
......
...@@ -4,9 +4,9 @@ import { connect } from 'dva'; ...@@ -4,9 +4,9 @@ import { connect } from 'dva';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { Row, Col, Card, List, Avatar, Spin } from 'antd'; import { Row, Col, Card, List, Avatar, Spin } from 'antd';
import { Radar } from 'components/Charts';
import EditableLinkGroup from 'components/EditableLinkGroup';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import EditableLinkGroup from '../../components/EditableLinkGroup';
import { Radar } from '../../components/Charts';
import styles from './Workplace.less'; import styles from './Workplace.less';
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Exception from '../../components/Exception'; import Exception from 'components/Exception';
export default () => ( export default () => (
<Exception type="403" style={{ minHeight: 500, height: '80%' }} linkElement={Link} /> <Exception type="403" style={{ minHeight: 500, height: '80%' }} linkElement={Link} />
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Exception from '../../components/Exception'; import Exception from 'components/Exception';
export default () => ( export default () => (
<Exception type="404" style={{ minHeight: 500, height: '80%' }} linkElement={Link} /> <Exception type="404" style={{ minHeight: 500, height: '80%' }} linkElement={Link} />
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Exception from '../../components/Exception'; import Exception from 'components/Exception';
export default () => ( export default () => (
<Exception type="500" style={{ minHeight: 500, height: '80%' }} linkElement={Link} /> <Exception type="500" style={{ minHeight: 500, height: '80%' }} linkElement={Link} />
......
...@@ -7,55 +7,34 @@ import styles from './style.less'; ...@@ -7,55 +7,34 @@ import styles from './style.less';
isloading: state.error.isloading, isloading: state.error.isloading,
})) }))
export default class TriggerException extends PureComponent { export default class TriggerException extends PureComponent {
state={ state = {
isloading: false, isloading: false,
}
trigger401 = () => {
this.setState({
isloading: true,
});
this.props.dispatch({
type: 'error/query401',
});
};
trigger403 = () => {
this.setState({
isloading: true,
});
this.props.dispatch({
type: 'error/query403',
});
};
trigger500 = () => {
this.setState({
isloading: true,
});
this.props.dispatch({
type: 'error/query500',
});
}; };
trigger404 = () => { triggerError = (code) => {
this.setState({ this.setState({
isloading: true, isloading: true,
}); });
this.props.dispatch({ this.props.dispatch({
type: 'error/query404', type: 'error/query',
payload: {
code,
},
}); });
}; };
render() { render() {
return ( return (
<Card> <Card>
<Spin spinning={this.state.isloading} wrapperClassName={styles.trigger}> <Spin spinning={this.state.isloading} wrapperClassName={styles.trigger}>
<Button type="danger" onClick={this.trigger401}> <Button type="danger" onClick={() => this.triggerError(401)}>
触发401 触发401
</Button> </Button>
<Button type="danger" onClick={this.trigger403}> <Button type="danger" onClick={() => this.triggerError(403)}>
触发403 触发403
</Button> </Button>
<Button type="danger" onClick={this.trigger500}> <Button type="danger" onClick={() => this.triggerError(500)}>
触发500 触发500
</Button> </Button>
<Button type="danger" onClick={this.trigger404}> <Button type="danger" onClick={() => this.triggerError(404)}>
触发404 触发404
</Button> </Button>
</Spin> </Spin>
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Card, Button, Form, Icon, Col, Row, DatePicker, TimePicker, Input, Select, Popover } from 'antd'; import { Card, Button, Form, Icon, Col, Row, DatePicker, TimePicker, Input, Select, Popover } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import FooterToolbar from 'components/FooterToolbar';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import FooterToolbar from '../../components/FooterToolbar';
import TableForm from './TableForm'; import TableForm from './TableForm';
import styles from './style.less'; import styles from './style.less';
......
...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Button, Row, Col } from 'antd'; import { Button, Row, Col } from 'antd';
import { routerRedux } from 'dva/router'; import { routerRedux } from 'dva/router';
import Result from '../../../components/Result'; import Result from 'components/Result';
import styles from './style.less'; import styles from './style.less';
class Step3 extends React.PureComponent { class Step3 extends React.PureComponent {
......
...@@ -2,11 +2,12 @@ import React, { PureComponent } from 'react'; ...@@ -2,11 +2,12 @@ import React, { PureComponent } from 'react';
import numeral from 'numeral'; import numeral from 'numeral';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd'; import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd';
import TagSelect from 'components/TagSelect';
import StandardFormRow from 'components/StandardFormRow';
import StandardFormRow from '../../components/StandardFormRow';
import TagSelect from '../../components/TagSelect';
import { formatWan } from '../../utils/utils'; import { formatWan } from '../../utils/utils';
import styles from './Applications.less'; import styles from './Applications.less';
const { Option } = Select; const { Option } = Select;
......
...@@ -3,8 +3,8 @@ import moment from 'moment'; ...@@ -3,8 +3,8 @@ import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd'; import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd';
import StandardFormRow from '../../components/StandardFormRow'; import TagSelect from 'components/TagSelect';
import TagSelect from '../../components/TagSelect'; import StandardFormRow from 'components/StandardFormRow';
import styles from './Articles.less'; import styles from './Articles.less';
const { Option } = Select; const { Option } = Select;
......
...@@ -2,8 +2,8 @@ import React, { PureComponent } from 'react'; ...@@ -2,8 +2,8 @@ import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Card, Button, Icon, List } from 'antd'; import { Card, Button, Icon, List } from 'antd';
import Ellipsis from 'components/Ellipsis';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import Ellipsis from '../../components/Ellipsis';
import styles from './CardList.less'; import styles from './CardList.less';
......
...@@ -3,10 +3,10 @@ import moment from 'moment'; ...@@ -3,10 +3,10 @@ import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Form, Card, Select, List } from 'antd'; import { Row, Col, Form, Card, Select, List } from 'antd';
import StandardFormRow from '../../components/StandardFormRow'; import TagSelect from 'components/TagSelect';
import TagSelect from '../../components/TagSelect'; import AvatarList from 'components/AvatarList';
import AvatarList from '../../components/AvatarList'; import Ellipsis from 'components/Ellipsis';
import Ellipsis from '../../components/Ellipsis'; import StandardFormRow from 'components/StandardFormRow';
import styles from './Projects.less'; import styles from './Projects.less';
...@@ -45,7 +45,7 @@ export default class CoverCardList extends PureComponent { ...@@ -45,7 +45,7 @@ export default class CoverCardList extends PureComponent {
} }
}); });
}, 0); }, 0);
} };
render() { render() {
const { list: { list = [] }, loading, form } = this.props; const { list: { list = [] }, loading, form } = this.props;
...@@ -72,15 +72,13 @@ export default class CoverCardList extends PureComponent { ...@@ -72,15 +72,13 @@ export default class CoverCardList extends PureComponent {
<span>{moment(item.updatedAt).fromNow()}</span> <span>{moment(item.updatedAt).fromNow()}</span>
<div className={styles.avatarList}> <div className={styles.avatarList}>
<AvatarList size="mini"> <AvatarList size="mini">
{ {item.members.map((member, i) => (
item.members.map((member, i) => ( <AvatarList.Item
<AvatarList.Item key={`${item.id}-avatar-${i}`}
key={`${item.id}-avatar-${i}`} src={member.avatar}
src={member.avatar} tips={member.name}
tips={member.name} />
/> ))}
))
}
</AvatarList> </AvatarList>
</div> </div>
</div> </div>
...@@ -121,17 +119,10 @@ export default class CoverCardList extends PureComponent { ...@@ -121,17 +119,10 @@ export default class CoverCardList extends PureComponent {
)} )}
</FormItem> </FormItem>
</StandardFormRow> </StandardFormRow>
<StandardFormRow <StandardFormRow title="其它选项" grid last>
title="其它选项"
grid
last
>
<Row gutter={16}> <Row gutter={16}>
<Col lg={8} md={10} sm={10} xs={24}> <Col lg={8} md={10} sm={10} xs={24}>
<FormItem <FormItem {...formItemLayout} label="作者">
{...formItemLayout}
label="作者"
>
{getFieldDecorator('author', {})( {getFieldDecorator('author', {})(
<Select <Select
onChange={this.handleFormSubmit} onChange={this.handleFormSubmit}
...@@ -144,10 +135,7 @@ export default class CoverCardList extends PureComponent { ...@@ -144,10 +135,7 @@ export default class CoverCardList extends PureComponent {
</FormItem> </FormItem>
</Col> </Col>
<Col lg={8} md={10} sm={10} xs={24}> <Col lg={8} md={10} sm={10} xs={24}>
<FormItem <FormItem {...formItemLayout} label="好评度">
{...formItemLayout}
label="好评度"
>
{getFieldDecorator('rate', {})( {getFieldDecorator('rate', {})(
<Select <Select
onChange={this.handleFormSubmit} onChange={this.handleFormSubmit}
...@@ -164,9 +152,7 @@ export default class CoverCardList extends PureComponent { ...@@ -164,9 +152,7 @@ export default class CoverCardList extends PureComponent {
</StandardFormRow> </StandardFormRow>
</Form> </Form>
</Card> </Card>
<div className={styles.cardList}> <div className={styles.cardList}>{cardList}</div>
{cardList}
</div>
</div> </div>
); );
} }
......
...@@ -3,7 +3,7 @@ import { connect } from 'dva'; ...@@ -3,7 +3,7 @@ import { connect } from 'dva';
import moment from 'moment'; import moment from 'moment';
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu, import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu,
InputNumber, DatePicker, Modal, message, Badge, Divider, Steps, Radio } from 'antd'; InputNumber, DatePicker, Modal, message, Badge, Divider, Steps, Radio } from 'antd';
import StandardTable from '../../components/StandardTable'; import StandardTable from 'components/StandardTable';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import styles from './TableList.less'; import styles from './TableList.less';
......
...@@ -4,8 +4,8 @@ import Bind from 'lodash-decorators/bind'; ...@@ -4,8 +4,8 @@ import Bind from 'lodash-decorators/bind';
import { connect } from 'dva'; import { connect } from 'dva';
import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd'; import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import DescriptionList from 'components/DescriptionList';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import DescriptionList from '../../components/DescriptionList';
import styles from './AdvancedProfile.less'; import styles from './AdvancedProfile.less';
const { Step } = Steps; const { Step } = Steps;
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Card, Badge, Table, Divider } from 'antd'; import { Card, Badge, Table, Divider } from 'antd';
import DescriptionList from 'components/DescriptionList';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import DescriptionList from '../../components/DescriptionList';
import styles from './BasicProfile.less'; import styles from './BasicProfile.less';
const { Description } = DescriptionList; const { Description } = DescriptionList;
const progressColumns = [{ const progressColumns = [
title: '时间', {
dataIndex: 'time', title: '时间',
key: 'time', dataIndex: 'time',
}, { key: 'time',
title: '当前进度', },
dataIndex: 'rate', {
key: 'rate', title: '当前进度',
}, { dataIndex: 'rate',
title: '状态', key: 'rate',
dataIndex: 'status', },
key: 'status', {
render: text => ( title: '状态',
text === 'success' ? <Badge status="success" text="成功" /> : <Badge status="processing" text="进行中" /> dataIndex: 'status',
), key: 'status',
}, { render: text =>
title: '操作员ID', (text === 'success' ? (
dataIndex: 'operator', <Badge status="success" text="成功" />
key: 'operator', ) : (
}, { <Badge status="processing" text="进行中" />
title: '耗时', )),
dataIndex: 'cost', },
key: 'cost', {
}]; title: '操作员ID',
dataIndex: 'operator',
key: 'operator',
},
{
title: '耗时',
dataIndex: 'cost',
key: 'cost',
},
];
@connect(({ profile, loading }) => ({ @connect(({ profile, loading }) => ({
profile, profile,
...@@ -71,60 +80,67 @@ export default class BasicProfile extends Component { ...@@ -71,60 +80,67 @@ export default class BasicProfile extends Component {
} }
return obj; return obj;
}; };
const goodsColumns = [{ const goodsColumns = [
title: '商品编号', {
dataIndex: 'id', title: '商品编号',
key: 'id', dataIndex: 'id',
render: (text, row, index) => { key: 'id',
if (index < basicGoods.length) { render: (text, row, index) => {
return <a href="">{text}</a>; if (index < basicGoods.length) {
} return <a href="">{text}</a>;
return { }
children: <span style={{ fontWeight: 600 }}>总计</span>, return {
props: { children: <span style={{ fontWeight: 600 }}>总计</span>,
colSpan: 4, props: {
}, colSpan: 4,
}; },
};
},
}, },
}, { {
title: '商品名称', title: '商品名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
render: renderContent, render: renderContent,
}, {
title: '商品条码',
dataIndex: 'barcode',
key: 'barcode',
render: renderContent,
}, {
title: '单价',
dataIndex: 'price',
key: 'price',
align: 'right',
render: renderContent,
}, {
title: '数量(件)',
dataIndex: 'num',
key: 'num',
align: 'right',
render: (text, row, index) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
}, },
}, { {
title: '金额', title: '商品条码',
dataIndex: 'amount', dataIndex: 'barcode',
key: 'amount', key: 'barcode',
align: 'right', render: renderContent,
render: (text, row, index) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
}, },
}]; {
title: '单价',
dataIndex: 'price',
key: 'price',
align: 'right',
render: renderContent,
},
{
title: '数量(件)',
dataIndex: 'num',
key: 'num',
align: 'right',
render: (text, row, index) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
},
{
title: '金额',
dataIndex: 'amount',
key: 'amount',
align: 'right',
render: (text, row, index) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
},
];
return ( return (
<PageHeaderLayout title="基础详情页"> <PageHeaderLayout title="基础详情页">
<Card bordered={false}> <Card bordered={false}>
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { Button, Icon, Card } from 'antd'; import { Button, Icon, Card } from 'antd';
import Result from '../../components/Result'; import Result from 'components/Result';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
const extra = ( const extra = (
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import { Button, Row, Col, Icon, Steps, Card } from 'antd';
import Result from '../../components/Result'; import Result from 'components/Result';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
const { Step } = Steps; const { Step } = Steps;
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { Checkbox, Alert, Icon } from 'antd'; import { Checkbox, Alert, Icon } from 'antd';
import Login from '../../components/Login'; import Login from 'components/Login';
import styles from './Login.less'; import styles from './Login.less';
const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
......
import React from 'react'; import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Result from '../../components/Result'; import Result from 'components/Result';
import styles from './RegisterResult.less'; import styles from './RegisterResult.less';
const actions = ( const actions = (
......
import request from '../utils/request'; import request from '../utils/request';
export async function query404() { export async function query(code) {
return request('/api/404'); return request(`/api/${code}`);
}
export async function query401() {
return request('/api/401');
}
export async function query403() {
return request('/api/403');
}
export async function query500() {
return request('/api/500');
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment