;
-
-export type IReactComponent =
- | React.StatelessComponent
- | React.ComponentClass
- | React.ClassicComponentClass
;
-
-interface Secured {
- (authority: authority, error?: React.ReactNode): (target: T) => T;
-}
-
-export interface AuthorizedRouteProps extends RouteProps {
- authority: authority;
-}
-export class AuthorizedRoute extends React.Component {}
-
-interface check {
- (
- authority: authority,
- target: T,
- Exception: S
- ): T | S;
-}
-
-export interface AuthorizedProps {
- authority: authority;
- noMatch?: React.ReactNode;
-}
-
-export class Authorized extends React.Component {
- static Secured: Secured;
- static AuthorizedRoute: typeof AuthorizedRoute;
- static check: check;
-}
-
-declare function renderAuthorize(currentAuthority: string): typeof Authorized;
-
-export default renderAuthorize;
diff --git a/app/web/src/components/Authorized/index.js b/app/web/src/components/Authorized/index.js
deleted file mode 100644
index 22ac664d..00000000
--- a/app/web/src/components/Authorized/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import Authorized from './Authorized';
-import AuthorizedRoute from './AuthorizedRoute';
-import Secured from './Secured';
-import check from './CheckPermissions';
-import renderAuthorize from './renderAuthorize';
-
-Authorized.Secured = Secured;
-Authorized.AuthorizedRoute = AuthorizedRoute;
-Authorized.check = check;
-
-export default renderAuthorize(Authorized);
diff --git a/app/web/src/components/Authorized/index.md b/app/web/src/components/Authorized/index.md
deleted file mode 100644
index f3b2f80a..00000000
--- a/app/web/src/components/Authorized/index.md
+++ /dev/null
@@ -1,58 +0,0 @@
----
-title:
- en-US: Authorized
- zh-CN: Authorized
-subtitle: 权限
-cols: 1
-order: 15
----
-
-权限组件,通过比对现有权限与准入权限,决定相关元素的展示。
-
-## API
-
-### RenderAuthorized
-
-`RenderAuthorized: (currentAuthority: string | () => string) => Authorized`
-
-权限组件默认 export RenderAuthorized 函数,它接收当前权限作为参数,返回一个权限对象,该对象提供以下几种使用方式。
-
-
-### Authorized
-
-最基础的权限控制。
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| children | 正常渲染的元素,权限判断通过时展示 | ReactNode | - |
-| authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - |
-| noMatch | 权限异常渲染元素,权限判断不通过时展示 | ReactNode | - |
-
-### Authorized.AuthorizedRoute
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - |
-| redirectPath | 权限异常时重定向的页面路由 | string | - |
-
-其余参数与 `Route` 相同。
-
-### Authorized.Secured
-
-注解方式,`@Authorized.Secured(authority, error)`
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - |
-| error | 权限异常时渲染元素 | ReactNode | |
-
-### Authorized.check
-
-函数形式的 Authorized,用于某些不能被 HOC 包裹的组件。 `Authorized.check(authority, target, Exception)`
-注意:传入一个 Promise 时,无论正确还是错误返回的都是一个 ReactClass。
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - |
-| target | 权限判断通过时渲染的元素 | ReactNode | - |
-| Exception | 权限异常时渲染元素 | ReactNode | - |
diff --git a/app/web/src/components/Authorized/renderAuthorize.js b/app/web/src/components/Authorized/renderAuthorize.js
deleted file mode 100644
index be373d99..00000000
--- a/app/web/src/components/Authorized/renderAuthorize.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* eslint-disable import/no-mutable-exports */
-let CURRENT = 'NULL';
-/**
- * use authority or getAuthority
- * @param {string|()=>String} currentAuthority
- */
-const renderAuthorize = Authorized => currentAuthority => {
- if (currentAuthority) {
- if (typeof currentAuthority === 'function') {
- CURRENT = currentAuthority();
- }
- if (
- Object.prototype.toString.call(currentAuthority) === '[object String]' ||
- Array.isArray(currentAuthority)
- ) {
- CURRENT = currentAuthority;
- }
- } else {
- CURRENT = 'NULL';
- }
- return Authorized;
-};
-
-export { CURRENT };
-export default Authorized => renderAuthorize(Authorized);
diff --git a/app/web/src/components/AvatarList/AvatarItem.d.ts b/app/web/src/components/AvatarList/AvatarItem.d.ts
deleted file mode 100644
index 5681de77..00000000
--- a/app/web/src/components/AvatarList/AvatarItem.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-export interface IAvatarItemProps {
- tips: React.ReactNode;
- src: string;
- style?: React.CSSProperties;
-}
-
-export default class AvatarItem extends React.Component {
- constructor(props: IAvatarItemProps);
-}
diff --git a/app/web/src/components/AvatarList/demo/simple.md b/app/web/src/components/AvatarList/demo/simple.md
deleted file mode 100644
index e941aea9..00000000
--- a/app/web/src/components/AvatarList/demo/simple.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基础样例
- en-US: Basic Usage
----
-
-Simplest of usage.
-
-````jsx
-import AvatarList from 'ant-design-pro/lib/AvatarList';
-
-ReactDOM.render(
-
-
-
-
-
-, mountNode);
-````
diff --git a/app/web/src/components/AvatarList/index.d.ts b/app/web/src/components/AvatarList/index.d.ts
deleted file mode 100644
index 5b9352ef..00000000
--- a/app/web/src/components/AvatarList/index.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import * as React from 'react';
-import AvatarItem from './AvatarItem';
-
-export interface IAvatarListProps {
- size?: 'large' | 'small' | 'mini' | 'default';
- style?: React.CSSProperties;
- children: React.ReactElement | Array>;
-}
-
-export default class AvatarList extends React.Component {
- public static Item: typeof AvatarItem;
-}
diff --git a/app/web/src/components/AvatarList/index.en-US.md b/app/web/src/components/AvatarList/index.en-US.md
deleted file mode 100644
index 862446f2..00000000
--- a/app/web/src/components/AvatarList/index.en-US.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: AvatarList
-order: 1
-cols: 1
----
-
-A list of user's avatar for project or group member list frequently. If a large or small AvatarList is desired, set the `size` property to either `large` or `small` and `mini` respectively. Omit the `size` property for a AvatarList with the default size.
-
-## API
-
-### AvatarList
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|-------|
-| size | size of list | `large`、`small` 、`mini`, `default` | `default` |
-
-### AvatarList.Item
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|-------|
-| tips | title tips for avatar item | ReactNode | - |
-| src | the address of the image for an image avatar | string | - |
diff --git a/app/web/src/components/AvatarList/index.js b/app/web/src/components/AvatarList/index.js
deleted file mode 100644
index 6fc59273..00000000
--- a/app/web/src/components/AvatarList/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React from 'react';
-import { Tooltip, Avatar } from 'antd';
-import classNames from 'classnames';
-
-import styles from './index.less';
-
-const AvatarList = ({ children, size, ...other }) => {
- const childrenWithProps = React.Children.map(children, child =>
- React.cloneElement(child, {
- size,
- })
- );
-
- return (
-
- );
-};
-
-const Item = ({ src, size, tips, onClick = () => {} }) => {
- const cls = classNames(styles.avatarItem, {
- [styles.avatarItemLarge]: size === 'large',
- [styles.avatarItemSmall]: size === 'small',
- [styles.avatarItemMini]: size === 'mini',
- });
-
- return (
-
- {tips ? (
-
-
-
- ) : (
-
- )}
-
- );
-};
-
-AvatarList.Item = Item;
-
-export default AvatarList;
diff --git a/app/web/src/components/AvatarList/index.less b/app/web/src/components/AvatarList/index.less
deleted file mode 100644
index 8660ba43..00000000
--- a/app/web/src/components/AvatarList/index.less
+++ /dev/null
@@ -1,45 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.avatarList {
- display: inline-block;
- ul {
- display: inline-block;
- margin-left: 8px;
- font-size: 0;
- }
-}
-
-.avatarItem {
- display: inline-block;
- font-size: @font-size-base;
- margin-left: -8px;
- width: @avatar-size-base;
- height: @avatar-size-base;
- :global {
- .ant-avatar {
- border: 1px solid #fff;
- }
- }
-}
-
-.avatarItemLarge {
- width: @avatar-size-lg;
- height: @avatar-size-lg;
-}
-
-.avatarItemSmall {
- width: @avatar-size-sm;
- height: @avatar-size-sm;
-}
-
-.avatarItemMini {
- width: 20px;
- height: 20px;
- :global {
- .ant-avatar {
- width: 20px;
- height: 20px;
- line-height: 20px;
- }
- }
-}
diff --git a/app/web/src/components/AvatarList/index.zh-CN.md b/app/web/src/components/AvatarList/index.zh-CN.md
deleted file mode 100644
index 4ec0c136..00000000
--- a/app/web/src/components/AvatarList/index.zh-CN.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: AvatarList
-subtitle: 用户头像列表
-order: 1
-cols: 1
----
-
-一组用户头像,常用在项目/团队成员列表。可通过设置 `size` 属性来指定头像大小。
-
-## API
-
-### AvatarList
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| size | 头像大小 | `large`、`small` 、`mini`, `default` | `default` |
-
-### AvatarList.Item
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| tips | 头像展示文案 | ReactNode | - |
-| src | 头像图片连接 | string | - |
diff --git a/app/web/src/components/Charts/Bar/index.d.ts b/app/web/src/components/Charts/Bar/index.d.ts
deleted file mode 100644
index 48990825..00000000
--- a/app/web/src/components/Charts/Bar/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IBarProps {
- title: React.ReactNode;
- color?: string;
- padding?: [number, number, number, number];
- height: number;
- data: Array<{
- x: string;
- y: number;
- }>;
- autoLabel?: boolean;
- style?: React.CSSProperties;
-}
-
-export default class Bar extends React.Component {}
diff --git a/app/web/src/components/Charts/Bar/index.js b/app/web/src/components/Charts/Bar/index.js
deleted file mode 100644
index f0cb65ff..00000000
--- a/app/web/src/components/Charts/Bar/index.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Axis, Tooltip, Geom } from 'bizcharts';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import autoHeight from '../autoHeight';
-import styles from '../index.less';
-
-@autoHeight()
-class Bar extends Component {
- state = {
- autoHideXLabels: false,
- };
-
- componentDidMount() {
- window.addEventListener('resize', this.resize, { passive: true });
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resize);
- }
-
- handleRoot = n => {
- this.root = n;
- };
-
- handleRef = n => {
- this.node = n;
- };
-
- @Bind()
- @Debounce(400)
- resize() {
- if (!this.node) {
- return;
- }
- const canvasWidth = this.node.parentNode.clientWidth;
- const { data = [], autoLabel = true } = this.props;
- if (!autoLabel) {
- return;
- }
- const minWidth = data.length * 30;
- const { autoHideXLabels } = this.state;
-
- if (canvasWidth <= minWidth) {
- if (!autoHideXLabels) {
- this.setState({
- autoHideXLabels: true,
- });
- }
- } else if (autoHideXLabels) {
- this.setState({
- autoHideXLabels: false,
- });
- }
- }
-
- render() {
- const {
- height,
- title,
- forceFit = true,
- data,
- color = 'rgba(24, 144, 255, 0.85)',
- padding,
- } = this.props;
-
- const { autoHideXLabels } = this.state;
-
- const scale = {
- x: {
- type: 'cat',
- },
- y: {
- min: 0,
- },
- };
-
- const tooltip = [
- 'x*y',
- (x, y) => ({
- name: x,
- value: y,
- }),
- ];
-
- return (
-
-
- {title &&
{title} }
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Bar;
diff --git a/app/web/src/components/Charts/ChartCard/index.d.ts b/app/web/src/components/Charts/ChartCard/index.d.ts
deleted file mode 100644
index ae25ec64..00000000
--- a/app/web/src/components/Charts/ChartCard/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import * as React from 'react';
-import { CardProps } from 'antd/lib/card';
-
-export interface IChartCardProps extends CardProps {
- title: React.ReactNode;
- action?: React.ReactNode;
- total?: React.ReactNode | number | (() => React.ReactNode | number);
- footer?: React.ReactNode;
- contentHeight?: number;
- avatar?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class ChartCard extends React.Component {}
diff --git a/app/web/src/components/Charts/ChartCard/index.js b/app/web/src/components/Charts/ChartCard/index.js
deleted file mode 100644
index ca6bcb2e..00000000
--- a/app/web/src/components/Charts/ChartCard/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import React from 'react';
-import { Card } from 'antd';
-import classNames from 'classnames';
-
-import styles from './index.less';
-
-const renderTotal = total => {
- let totalDom;
- switch (typeof total) {
- case 'undefined':
- totalDom = null;
- break;
- case 'function':
- totalDom = {total()}
;
- break;
- default:
- totalDom = {total}
;
- }
- return totalDom;
-};
-
-class ChartCard extends React.PureComponent {
- renderConnet = () => {
- const { contentHeight, title, avatar, action, total, footer, children, loading } = this.props;
- if (loading) {
- return false;
- }
- return (
-
-
-
{avatar}
-
-
- {title}
- {action}
-
- {renderTotal(total)}
-
-
- {children && (
-
- )}
- {footer && (
-
- {footer}
-
- )}
-
- );
- };
-
- render() {
- const {
- loading = false,
- contentHeight,
- title,
- avatar,
- action,
- total,
- footer,
- children,
- ...rest
- } = this.props;
- return (
-
- {this.renderConnet()}
-
- );
- }
-}
-
-export default ChartCard;
diff --git a/app/web/src/components/Charts/ChartCard/index.less b/app/web/src/components/Charts/ChartCard/index.less
deleted file mode 100644
index bee44938..00000000
--- a/app/web/src/components/Charts/ChartCard/index.less
+++ /dev/null
@@ -1,74 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.chartCard {
- position: relative;
- .chartTop {
- position: relative;
- overflow: hidden;
- width: 100%;
- }
- .chartTopMargin {
- margin-bottom: 12px;
- }
- .chartTopHasMargin {
- margin-bottom: 20px;
- }
- .metaWrap {
- float: left;
- }
- .avatar {
- position: relative;
- top: 4px;
- float: left;
- margin-right: 20px;
- img {
- border-radius: 100%;
- }
- }
- .meta {
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- height: 22px;
- }
- .action {
- cursor: pointer;
- position: absolute;
- top: 0;
- right: 0;
- }
- .total {
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- white-space: nowrap;
- color: @heading-color;
- margin-top: 4px;
- margin-bottom: 0;
- font-size: 30px;
- line-height: 38px;
- height: 38px;
- }
- .content {
- margin-bottom: 12px;
- position: relative;
- width: 100%;
- }
- .contentFixed {
- position: absolute;
- left: 0;
- bottom: 0;
- width: 100%;
- }
- .footer {
- border-top: 1px solid @border-color-split;
- padding-top: 9px;
- margin-top: 8px;
- & > * {
- position: relative;
- }
- }
- .footerMargin {
- margin-top: 20px;
- }
-}
diff --git a/app/web/src/components/Charts/Field/index.d.ts b/app/web/src/components/Charts/Field/index.d.ts
deleted file mode 100644
index 975fb667..00000000
--- a/app/web/src/components/Charts/Field/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import * as React from 'react';
-export interface IFieldProps {
- label: React.ReactNode;
- value: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class Field extends React.Component {}
diff --git a/app/web/src/components/Charts/Field/index.js b/app/web/src/components/Charts/Field/index.js
deleted file mode 100644
index 0f9ace22..00000000
--- a/app/web/src/components/Charts/Field/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react';
-
-import styles from './index.less';
-
-const Field = ({ label, value, ...rest }) => (
-
- {label}
- {value}
-
-);
-
-export default Field;
diff --git a/app/web/src/components/Charts/Field/index.less b/app/web/src/components/Charts/Field/index.less
deleted file mode 100644
index aeafbcb8..00000000
--- a/app/web/src/components/Charts/Field/index.less
+++ /dev/null
@@ -1,16 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.field {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0;
- span {
- font-size: @font-size-base;
- line-height: 22px;
- }
- span:last-child {
- margin-left: 8px;
- color: @heading-color;
- }
-}
diff --git a/app/web/src/components/Charts/Gauge/index.d.ts b/app/web/src/components/Charts/Gauge/index.d.ts
deleted file mode 100644
index 66e3c003..00000000
--- a/app/web/src/components/Charts/Gauge/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface IGaugeProps {
- title: React.ReactNode;
- color?: string;
- height: number;
- bgColor?: number;
- percent: number;
- style?: React.CSSProperties;
-}
-
-export default class Gauge extends React.Component {}
diff --git a/app/web/src/components/Charts/Gauge/index.js b/app/web/src/components/Charts/Gauge/index.js
deleted file mode 100644
index 2249211a..00000000
--- a/app/web/src/components/Charts/Gauge/index.js
+++ /dev/null
@@ -1,167 +0,0 @@
-import React from 'react';
-import { Chart, Geom, Axis, Coord, Guide, Shape } from 'bizcharts';
-import autoHeight from '../autoHeight';
-
-const { Arc, Html, Line } = Guide;
-
-const defaultFormatter = val => {
- switch (val) {
- case '2':
- return '差';
- case '4':
- return '中';
- case '6':
- return '良';
- case '8':
- return '优';
- default:
- return '';
- }
-};
-
-Shape.registerShape('point', 'pointer', {
- drawShape(cfg, group) {
- let point = cfg.points[0];
- point = this.parsePoint(point);
- const center = this.parsePoint({
- x: 0,
- y: 0,
- });
- group.addShape('line', {
- attrs: {
- x1: center.x,
- y1: center.y,
- x2: point.x,
- y2: point.y,
- stroke: cfg.color,
- lineWidth: 2,
- lineCap: 'round',
- },
- });
- return group.addShape('circle', {
- attrs: {
- x: center.x,
- y: center.y,
- r: 6,
- stroke: cfg.color,
- lineWidth: 3,
- fill: '#fff',
- },
- });
- },
-});
-
-@autoHeight()
-class Gauge extends React.Component {
- render() {
- const {
- title,
- height,
- percent,
- forceFit = true,
- formatter = defaultFormatter,
- color = '#2F9CFF',
- bgColor = '#F0F2F5',
- } = this.props;
- const cols = {
- value: {
- type: 'linear',
- min: 0,
- max: 10,
- tickCount: 6,
- nice: true,
- },
- };
- const data = [{ value: percent / 10 }];
- return (
-
-
-
-
-
-
-
-
-
-
- `
-
-
${title}
-
- ${data[0].value * 10}%
-
-
`}
- />
-
-
-
- );
- }
-}
-
-export default Gauge;
diff --git a/app/web/src/components/Charts/MiniArea/index.d.ts b/app/web/src/components/Charts/MiniArea/index.d.ts
deleted file mode 100644
index b223b68c..00000000
--- a/app/web/src/components/Charts/MiniArea/index.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as React from 'react';
-
-// g2已经更新到3.0
-// 不带的写了
-
-export interface IAxis {
- title: any;
- line: any;
- gridAlign: any;
- labels: any;
- tickLine: any;
- grid: any;
-}
-
-export interface IMiniAreaProps {
- color?: string;
- height: number;
- borderColor?: string;
- line?: boolean;
- animate?: boolean;
- xAxis?: IAxis;
- yAxis?: IAxis;
- data: Array<{
- x: number | string;
- y: number;
- }>;
-}
-
-export default class MiniArea extends React.Component {}
diff --git a/app/web/src/components/Charts/MiniArea/index.js b/app/web/src/components/Charts/MiniArea/index.js
deleted file mode 100644
index d3209bec..00000000
--- a/app/web/src/components/Charts/MiniArea/index.js
+++ /dev/null
@@ -1,108 +0,0 @@
-import React from 'react';
-import { Chart, Axis, Tooltip, Geom } from 'bizcharts';
-import autoHeight from '../autoHeight';
-import styles from '../index.less';
-
-@autoHeight()
-class MiniArea extends React.PureComponent {
- render() {
- const {
- height,
- data = [],
- forceFit = true,
- color = 'rgba(24, 144, 255, 0.2)',
- borderColor = '#1089ff',
- scale = {},
- borderWidth = 2,
- line,
- xAxis,
- yAxis,
- animate = true,
- } = this.props;
-
- const padding = [36, 5, 30, 5];
-
- const scaleProps = {
- x: {
- type: 'cat',
- range: [0, 1],
- ...scale.x,
- },
- y: {
- min: 0,
- ...scale.y,
- },
- };
-
- const tooltip = [
- 'x*y',
- (x, y) => ({
- name: x,
- value: y,
- }),
- ];
-
- const chartHeight = height + 54;
-
- return (
-
-
- {height > 0 && (
-
-
-
-
-
- {line ? (
-
- ) : (
-
- )}
-
- )}
-
-
- );
- }
-}
-
-export default MiniArea;
diff --git a/app/web/src/components/Charts/MiniBar/index.d.ts b/app/web/src/components/Charts/MiniBar/index.d.ts
deleted file mode 100644
index 0c4bd6cc..00000000
--- a/app/web/src/components/Charts/MiniBar/index.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import * as React from 'react';
-export interface IMiniBarProps {
- color?: string;
- height: number;
- data: Array<{
- x: number | string;
- y: number;
- }>;
- style?: React.CSSProperties;
-}
-
-export default class MiniBar extends React.Component {}
diff --git a/app/web/src/components/Charts/MiniBar/index.js b/app/web/src/components/Charts/MiniBar/index.js
deleted file mode 100644
index 18e4d8c6..00000000
--- a/app/web/src/components/Charts/MiniBar/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import React from 'react';
-import { Chart, Tooltip, Geom } from 'bizcharts';
-import autoHeight from '../autoHeight';
-import styles from '../index.less';
-
-@autoHeight()
-class MiniBar extends React.Component {
- render() {
- const { height, forceFit = true, color = '#1890FF', data = [] } = this.props;
-
- const scale = {
- x: {
- type: 'cat',
- },
- y: {
- min: 0,
- },
- };
-
- const padding = [36, 5, 30, 5];
-
- const tooltip = [
- 'x*y',
- (x, y) => ({
- name: x,
- value: y,
- }),
- ];
-
- // for tooltip not to be hide
- const chartHeight = height + 54;
-
- return (
-
- );
- }
-}
-export default MiniBar;
diff --git a/app/web/src/components/Charts/MiniProgress/index.d.ts b/app/web/src/components/Charts/MiniProgress/index.d.ts
deleted file mode 100644
index aaeb7261..00000000
--- a/app/web/src/components/Charts/MiniProgress/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-export interface IMiniProgressProps {
- target: number;
- color?: string;
- strokeWidth?: number;
- percent?: number;
- style?: React.CSSProperties;
-}
-
-export default class MiniProgress extends React.Component {}
diff --git a/app/web/src/components/Charts/MiniProgress/index.js b/app/web/src/components/Charts/MiniProgress/index.js
deleted file mode 100644
index 795c79b1..00000000
--- a/app/web/src/components/Charts/MiniProgress/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import { Tooltip } from 'antd';
-
-import styles from './index.less';
-
-const MiniProgress = ({ target, color = 'rgb(19, 194, 194)', strokeWidth, percent }) => (
-
-);
-
-export default MiniProgress;
diff --git a/app/web/src/components/Charts/MiniProgress/index.less b/app/web/src/components/Charts/MiniProgress/index.less
deleted file mode 100644
index e5f148cb..00000000
--- a/app/web/src/components/Charts/MiniProgress/index.less
+++ /dev/null
@@ -1,35 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.miniProgress {
- padding: 5px 0;
- position: relative;
- width: 100%;
- .progressWrap {
- background-color: @background-color-base;
- position: relative;
- }
- .progress {
- transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;
- border-radius: 1px 0 0 1px;
- background-color: @primary-color;
- width: 0;
- height: 100%;
- }
- .target {
- position: absolute;
- top: 0;
- bottom: 0;
- span {
- border-radius: 100px;
- position: absolute;
- top: 0;
- left: 0;
- height: 4px;
- width: 2px;
- }
- span:last-child {
- top: auto;
- bottom: 0;
- }
- }
-}
diff --git a/app/web/src/components/Charts/Pie/index.d.ts b/app/web/src/components/Charts/Pie/index.d.ts
deleted file mode 100644
index 66c93eeb..00000000
--- a/app/web/src/components/Charts/Pie/index.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import * as React from 'react';
-export interface IPieProps {
- animate?: boolean;
- color?: string;
- colors?: string[];
- height: number;
- hasLegend?: boolean;
- padding?: [number, number, number, number];
- percent?: number;
- data?: Array<{
- x: string | string;
- y: number;
- }>;
- total?: React.ReactNode | number | (() => React.ReactNode | number);
- title?: React.ReactNode;
- tooltip?: boolean;
- valueFormat?: (value: string) => string | React.ReactNode;
- subTitle?: React.ReactNode;
-}
-
-export default class Pie extends React.Component {}
diff --git a/app/web/src/components/Charts/Pie/index.js b/app/web/src/components/Charts/Pie/index.js
deleted file mode 100644
index 7dff5123..00000000
--- a/app/web/src/components/Charts/Pie/index.js
+++ /dev/null
@@ -1,271 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Tooltip, Geom, Coord } from 'bizcharts';
-import { DataView } from '@antv/data-set';
-import { Divider } from 'antd';
-import classNames from 'classnames';
-import ReactFitText from 'react-fittext';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import autoHeight from '../autoHeight';
-
-import styles from './index.less';
-
-/* eslint react/no-danger:0 */
-@autoHeight()
-class Pie extends Component {
- state = {
- legendData: [],
- legendBlock: false,
- };
-
- componentDidMount() {
- window.addEventListener(
- 'resize',
- () => {
- this.requestRef = requestAnimationFrame(() => this.resize());
- },
- { passive: true }
- );
- }
-
- componentDidUpdate(preProps) {
- const { data } = this.props;
- if (data !== preProps.data) {
- // because of charts data create when rendered
- // so there is a trick for get rendered time
- this.getLegendData();
- }
- }
-
- componentWillUnmount() {
- window.cancelAnimationFrame(this.requestRef);
- window.removeEventListener('resize', this.resize);
- this.resize.cancel();
- }
-
- getG2Instance = chart => {
- this.chart = chart;
- requestAnimationFrame(() => {
- this.getLegendData();
- this.resize();
- });
- };
-
- // for custom lengend view
- getLegendData = () => {
- if (!this.chart) return;
- const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形
- if (!geom) return;
- const items = geom.get('dataArray') || []; // 获取图形对应的
-
- const legendData = items.map(item => {
- /* eslint no-underscore-dangle:0 */
- const origin = item[0]._origin;
- origin.color = item[0].color;
- origin.checked = true;
- return origin;
- });
-
- this.setState({
- legendData,
- });
- };
-
- handleRoot = n => {
- this.root = n;
- };
-
- handleLegendClick = (item, i) => {
- const newItem = item;
- newItem.checked = !newItem.checked;
-
- const { legendData } = this.state;
- legendData[i] = newItem;
-
- const filteredLegendData = legendData.filter(l => l.checked).map(l => l.x);
-
- if (this.chart) {
- this.chart.filter('x', val => filteredLegendData.indexOf(val) > -1);
- }
-
- this.setState({
- legendData,
- });
- };
-
- // for window resize auto responsive legend
- @Bind()
- @Debounce(300)
- resize() {
- const { hasLegend } = this.props;
- const { legendBlock } = this.state;
- if (!hasLegend || !this.root) {
- window.removeEventListener('resize', this.resize);
- return;
- }
- if (this.root.parentNode.clientWidth <= 380) {
- if (!legendBlock) {
- this.setState({
- legendBlock: true,
- });
- }
- } else if (legendBlock) {
- this.setState({
- legendBlock: false,
- });
- }
- }
-
- render() {
- const {
- valueFormat,
- subTitle,
- total,
- hasLegend = false,
- className,
- style,
- height,
- forceFit = true,
- percent,
- color,
- inner = 0.75,
- animate = true,
- colors,
- lineWidth = 1,
- } = this.props;
-
- const { legendData, legendBlock } = this.state;
- const pieClassName = classNames(styles.pie, className, {
- [styles.hasLegend]: !!hasLegend,
- [styles.legendBlock]: legendBlock,
- });
-
- const {
- data: propsData,
- selected: propsSelected = true,
- tooltip: propsTooltip = true,
- } = this.props;
-
- let data = propsData || [];
- let selected = propsSelected;
- let tooltip = propsTooltip;
-
- const defaultColors = colors;
- data = data || [];
- selected = selected || true;
- tooltip = tooltip || true;
- let formatColor;
-
- const scale = {
- x: {
- type: 'cat',
- range: [0, 1],
- },
- y: {
- min: 0,
- },
- };
-
- if (percent || percent === 0) {
- selected = false;
- tooltip = false;
- formatColor = value => {
- if (value === '占比') {
- return color || 'rgba(24, 144, 255, 0.85)';
- }
- return '#F0F2F5';
- };
-
- data = [
- {
- x: '占比',
- y: parseFloat(percent),
- },
- {
- x: '反比',
- y: 100 - parseFloat(percent),
- },
- ];
- }
-
- const tooltipFormat = [
- 'x*percent',
- (x, p) => ({
- name: x,
- value: `${(p * 100).toFixed(2)}%`,
- }),
- ];
-
- const padding = [12, 0, 12, 0];
-
- const dv = new DataView();
- dv.source(data).transform({
- type: 'percent',
- field: 'y',
- dimension: 'x',
- as: 'percent',
- });
-
- return (
-
-
-
-
- {!!tooltip && }
-
-
-
-
- {(subTitle || total) && (
-
- {subTitle &&
{subTitle} }
- {/* eslint-disable-next-line */}
- {total && (
-
{typeof total === 'function' ? total() : total}
- )}
-
- )}
-
-
-
- {hasLegend && (
-
- {legendData.map((item, i) => (
- this.handleLegendClick(item, i)}>
-
- {item.x}
-
-
- {`${(Number.isNaN(item.percent) ? 0 : item.percent * 100).toFixed(2)}%`}
-
- {valueFormat ? valueFormat(item.y) : item.y}
-
- ))}
-
- )}
-
- );
- }
-}
-
-export default Pie;
diff --git a/app/web/src/components/Charts/Pie/index.less b/app/web/src/components/Charts/Pie/index.less
deleted file mode 100644
index 7249d093..00000000
--- a/app/web/src/components/Charts/Pie/index.less
+++ /dev/null
@@ -1,94 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.pie {
- position: relative;
- .chart {
- position: relative;
- }
- &.hasLegend .chart {
- width: ~'calc(100% - 240px)';
- }
- .legend {
- position: absolute;
- right: 0;
- min-width: 200px;
- top: 50%;
- transform: translateY(-50%);
- margin: 0 20px;
- list-style: none;
- padding: 0;
- li {
- cursor: pointer;
- margin-bottom: 16px;
- height: 22px;
- line-height: 22px;
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- .dot {
- border-radius: 8px;
- display: inline-block;
- margin-right: 8px;
- position: relative;
- top: -1px;
- height: 8px;
- width: 8px;
- }
- .line {
- background-color: @border-color-split;
- display: inline-block;
- margin-right: 8px;
- width: 1px;
- height: 16px;
- }
- .legendTitle {
- color: @text-color;
- }
- .percent {
- color: @text-color-secondary;
- }
- .value {
- position: absolute;
- right: 0;
- }
- .title {
- margin-bottom: 8px;
- }
- .total {
- position: absolute;
- left: 50%;
- top: 50%;
- text-align: center;
- max-height: 62px;
- transform: translate(-50%, -50%);
- & > h4 {
- color: @text-color-secondary;
- font-size: 14px;
- line-height: 22px;
- height: 22px;
- margin-bottom: 8px;
- font-weight: normal;
- }
- & > p {
- color: @heading-color;
- display: block;
- font-size: 1.2em;
- height: 32px;
- line-height: 32px;
- white-space: nowrap;
- }
- }
-}
-
-.legendBlock {
- &.hasLegend .chart {
- width: 100%;
- margin: 0 0 32px 0;
- }
- .legend {
- position: relative;
- transform: none;
- }
-}
diff --git a/app/web/src/components/Charts/Radar/index.d.ts b/app/web/src/components/Charts/Radar/index.d.ts
deleted file mode 100644
index 963ac8c3..00000000
--- a/app/web/src/components/Charts/Radar/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IRadarProps {
- title?: React.ReactNode;
- height: number;
- padding?: [number, number, number, number];
- hasLegend?: boolean;
- data: Array<{
- name: string;
- label: string;
- value: string;
- }>;
- style?: React.CSSProperties;
-}
-
-export default class Radar extends React.Component {}
diff --git a/app/web/src/components/Charts/Radar/index.js b/app/web/src/components/Charts/Radar/index.js
deleted file mode 100644
index fdeed9e2..00000000
--- a/app/web/src/components/Charts/Radar/index.js
+++ /dev/null
@@ -1,184 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Tooltip, Geom, Coord, Axis } from 'bizcharts';
-import { Row, Col } from 'antd';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-/* eslint react/no-danger:0 */
-@autoHeight()
-class Radar extends Component {
- state = {
- legendData: [],
- };
-
- componentDidMount() {
- this.getLegendData();
- }
-
- componentDidUpdate(preProps) {
- const { data } = this.props;
- if (data !== preProps.data) {
- this.getLegendData();
- }
- }
-
- getG2Instance = chart => {
- this.chart = chart;
- };
-
- // for custom lengend view
- getLegendData = () => {
- if (!this.chart) return;
- const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形
- if (!geom) return;
- const items = geom.get('dataArray') || []; // 获取图形对应的
-
- const legendData = items.map(item => {
- // eslint-disable-next-line
- const origins = item.map(t => t._origin);
- const result = {
- name: origins[0].name,
- color: item[0].color,
- checked: true,
- value: origins.reduce((p, n) => p + n.value, 0),
- };
-
- return result;
- });
-
- this.setState({
- legendData,
- });
- };
-
- handleRef = n => {
- this.node = n;
- };
-
- handleLegendClick = (item, i) => {
- const newItem = item;
- newItem.checked = !newItem.checked;
-
- const { legendData } = this.state;
- legendData[i] = newItem;
-
- const filteredLegendData = legendData.filter(l => l.checked).map(l => l.name);
-
- if (this.chart) {
- this.chart.filter('name', val => filteredLegendData.indexOf(val) > -1);
- this.chart.repaint();
- }
-
- this.setState({
- legendData,
- });
- };
-
- render() {
- const defaultColors = [
- '#1890FF',
- '#FACC14',
- '#2FC25B',
- '#8543E0',
- '#F04864',
- '#13C2C2',
- '#fa8c16',
- '#a0d911',
- ];
-
- const {
- data = [],
- height = 0,
- title,
- hasLegend = false,
- forceFit = true,
- tickCount = 4,
- padding = [35, 30, 16, 30],
- animate = true,
- colors = defaultColors,
- } = this.props;
-
- const { legendData } = this.state;
-
- const scale = {
- value: {
- min: 0,
- tickCount,
- },
- };
-
- const chartHeight = height - (hasLegend ? 80 : 22);
-
- return (
-
- {title &&
{title} }
-
-
-
-
-
-
-
-
- {hasLegend && (
-
- {legendData.map((item, i) => (
- this.handleLegendClick(item, i)}
- >
-
-
-
- {item.name}
-
-
{item.value}
-
-
- ))}
-
- )}
-
- );
- }
-}
-
-export default Radar;
diff --git a/app/web/src/components/Charts/Radar/index.less b/app/web/src/components/Charts/Radar/index.less
deleted file mode 100644
index 15b8725c..00000000
--- a/app/web/src/components/Charts/Radar/index.less
+++ /dev/null
@@ -1,46 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.radar {
- .legend {
- margin-top: 16px;
- .legendItem {
- position: relative;
- text-align: center;
- cursor: pointer;
- color: @text-color-secondary;
- line-height: 22px;
- p {
- margin: 0;
- }
- h6 {
- color: @heading-color;
- padding-left: 16px;
- font-size: 24px;
- line-height: 32px;
- margin-top: 4px;
- margin-bottom: 0;
- }
- &:after {
- background-color: @border-color-split;
- position: absolute;
- top: 8px;
- right: 0;
- height: 40px;
- width: 1px;
- content: '';
- }
- }
- > :last-child .legendItem:after {
- display: none;
- }
- .dot {
- border-radius: 6px;
- display: inline-block;
- margin-right: 6px;
- position: relative;
- top: -1px;
- height: 6px;
- width: 6px;
- }
- }
-}
diff --git a/app/web/src/components/Charts/TagCloud/index.d.ts b/app/web/src/components/Charts/TagCloud/index.d.ts
deleted file mode 100644
index 462650c4..00000000
--- a/app/web/src/components/Charts/TagCloud/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface ITagCloudProps {
- data: Array<{
- name: string;
- value: number;
- }>;
- height: number;
- style?: React.CSSProperties;
-}
-
-export default class TagCloud extends React.Component {}
diff --git a/app/web/src/components/Charts/TagCloud/index.js b/app/web/src/components/Charts/TagCloud/index.js
deleted file mode 100644
index 49ebc947..00000000
--- a/app/web/src/components/Charts/TagCloud/index.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Geom, Coord, Shape } from 'bizcharts';
-import DataSet from '@antv/data-set';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import classNames from 'classnames';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-/* eslint no-underscore-dangle: 0 */
-/* eslint no-param-reassign: 0 */
-
-const imgUrl = 'https://gw.alipayobjects.com/zos/rmsportal/gWyeGLCdFFRavBGIDzWk.png';
-
-@autoHeight()
-class TagCloud extends Component {
- state = {
- dv: null,
- };
-
- componentDidMount() {
- requestAnimationFrame(() => {
- this.initTagCloud();
- this.renderChart();
- });
- window.addEventListener('resize', this.resize, { passive: true });
- }
-
- componentDidUpdate(preProps) {
- const { data } = this.props;
- if (JSON.stringify(preProps.data) !== JSON.stringify(data)) {
- this.renderChart(this.props);
- }
- }
-
- componentWillUnmount() {
- this.isUnmount = true;
- window.cancelAnimationFrame(this.requestRef);
- window.removeEventListener('resize', this.resize);
- }
-
- resize = () => {
- this.requestRef = requestAnimationFrame(() => {
- this.renderChart();
- });
- };
-
- saveRootRef = node => {
- this.root = node;
- };
-
- initTagCloud = () => {
- function getTextAttrs(cfg) {
- return Object.assign(
- {},
- {
- fillOpacity: cfg.opacity,
- fontSize: cfg.origin._origin.size,
- rotate: cfg.origin._origin.rotate,
- text: cfg.origin._origin.text,
- textAlign: 'center',
- fontFamily: cfg.origin._origin.font,
- fill: cfg.color,
- textBaseline: 'Alphabetic',
- },
- cfg.style
- );
- }
-
- // 给point注册一个词云的shape
- Shape.registerShape('point', 'cloud', {
- drawShape(cfg, container) {
- const attrs = getTextAttrs(cfg);
- return container.addShape('text', {
- attrs: Object.assign(attrs, {
- x: cfg.x,
- y: cfg.y,
- }),
- });
- },
- });
- };
-
- @Bind()
- @Debounce(500)
- renderChart(nextProps) {
- // const colors = ['#1890FF', '#41D9C7', '#2FC25B', '#FACC14', '#9AE65C'];
- const { data, height } = nextProps || this.props;
-
- if (data.length < 1 || !this.root) {
- return;
- }
-
- const h = height * 4;
- const w = this.root.offsetWidth * 4;
-
- const onload = () => {
- const dv = new DataSet.View().source(data);
- const range = dv.range('value');
- const [min, max] = range;
- dv.transform({
- type: 'tag-cloud',
- fields: ['name', 'value'],
- imageMask: this.imageMask,
- font: 'Verdana',
- size: [w, h], // 宽高设置最好根据 imageMask 做调整
- padding: 5,
- timeInterval: 5000, // max execute time
- rotate() {
- return 0;
- },
- fontSize(d) {
- // eslint-disable-next-line
- return Math.pow((d.value - min) / (max - min), 2) * (70 - 20) + 20;
- },
- });
-
- if (this.isUnmount) {
- return;
- }
-
- this.setState({
- dv,
- w,
- h,
- });
- };
-
- if (!this.imageMask) {
- this.imageMask = new Image();
- this.imageMask.crossOrigin = '';
- this.imageMask.src = imgUrl;
-
- this.imageMask.onload = onload;
- } else {
- onload();
- }
- }
-
- render() {
- const { className, height } = this.props;
- const { dv, w, h } = this.state;
-
- return (
-
- {dv && (
-
-
-
-
- )}
-
- );
- }
-}
-
-export default TagCloud;
diff --git a/app/web/src/components/Charts/TagCloud/index.less b/app/web/src/components/Charts/TagCloud/index.less
deleted file mode 100644
index f5c12ad4..00000000
--- a/app/web/src/components/Charts/TagCloud/index.less
+++ /dev/null
@@ -1,7 +0,0 @@
-.tagCloud {
- overflow: hidden;
- canvas {
- transform: scale(0.25);
- transform-origin: 0 0;
- }
-}
diff --git a/app/web/src/components/Charts/TimelineChart/index.d.ts b/app/web/src/components/Charts/TimelineChart/index.d.ts
deleted file mode 100644
index 40b94325..00000000
--- a/app/web/src/components/Charts/TimelineChart/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import * as React from 'react';
-export interface ITimelineChartProps {
- data: Array<{
- x: number;
- y1: number;
- y2?: number;
- }>;
- titleMap: { y1: string; y2?: string };
- padding?: [number, number, number, number];
- height?: number;
- style?: React.CSSProperties;
-}
-
-export default class TimelineChart extends React.Component {}
diff --git a/app/web/src/components/Charts/TimelineChart/index.js b/app/web/src/components/Charts/TimelineChart/index.js
deleted file mode 100644
index b76e782f..00000000
--- a/app/web/src/components/Charts/TimelineChart/index.js
+++ /dev/null
@@ -1,124 +0,0 @@
-import React from 'react';
-import { Chart, Tooltip, Geom, Legend, Axis } from 'bizcharts';
-import DataSet from '@antv/data-set';
-import Slider from 'bizcharts-plugin-slider';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-@autoHeight()
-class TimelineChart extends React.Component {
- render() {
- const {
- title,
- height = 400,
- padding = [60, 20, 40, 40],
- titleMap = {
- y1: 'y1',
- y2: 'y2',
- },
- borderWidth = 2,
- data = [
- {
- x: 0,
- y1: 0,
- y2: 0,
- },
- ],
- } = this.props;
-
- data.sort((a, b) => a.x - b.x);
-
- let max;
- if (data[0] && data[0].y1 && data[0].y2) {
- max = Math.max(
- [...data].sort((a, b) => b.y1 - a.y1)[0].y1,
- [...data].sort((a, b) => b.y2 - a.y2)[0].y2
- );
- }
-
- const ds = new DataSet({
- state: {
- start: data[0].x,
- end: data[data.length - 1].x,
- },
- });
-
- const dv = ds.createView();
- dv.source(data)
- .transform({
- type: 'filter',
- callback: obj => {
- const date = obj.x;
- return date <= ds.state.end && date >= ds.state.start;
- },
- })
- .transform({
- type: 'map',
- callback(row) {
- const newRow = { ...row };
- newRow[titleMap.y1] = row.y1;
- newRow[titleMap.y2] = row.y2;
- return newRow;
- },
- })
- .transform({
- type: 'fold',
- fields: [titleMap.y1, titleMap.y2], // 展开字段集
- key: 'key', // key字段
- value: 'value', // value字段
- });
-
- const timeScale = {
- type: 'time',
- tickInterval: 60 * 60 * 1000,
- mask: 'HH:mm',
- range: [0, 1],
- };
-
- const cols = {
- x: timeScale,
- value: {
- max,
- min: 0,
- },
- };
-
- const SliderGen = () => (
- {
- ds.setState('start', startValue);
- ds.setState('end', endValue);
- }}
- />
- );
-
- return (
-
-
- {title &&
{title} }
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default TimelineChart;
diff --git a/app/web/src/components/Charts/TimelineChart/index.less b/app/web/src/components/Charts/TimelineChart/index.less
deleted file mode 100644
index 17519756..00000000
--- a/app/web/src/components/Charts/TimelineChart/index.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.timelineChart {
- background: #fff;
-}
diff --git a/app/web/src/components/Charts/WaterWave/index.d.ts b/app/web/src/components/Charts/WaterWave/index.d.ts
deleted file mode 100644
index 8f5588d2..00000000
--- a/app/web/src/components/Charts/WaterWave/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-export interface IWaterWaveProps {
- title: React.ReactNode;
- color?: string;
- height: number;
- percent: number;
- style?: React.CSSProperties;
-}
-
-export default class WaterWave extends React.Component {}
diff --git a/app/web/src/components/Charts/WaterWave/index.js b/app/web/src/components/Charts/WaterWave/index.js
deleted file mode 100644
index 055f7c73..00000000
--- a/app/web/src/components/Charts/WaterWave/index.js
+++ /dev/null
@@ -1,213 +0,0 @@
-import React, { PureComponent } from 'react';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-/* eslint no-return-assign: 0 */
-/* eslint no-mixed-operators: 0 */
-// riddle: https://riddle.alibaba-inc.com/riddles/2d9a4b90
-
-@autoHeight()
-class WaterWave extends PureComponent {
- state = {
- radio: 1,
- };
-
- componentDidMount() {
- this.renderChart();
- this.resize();
- window.addEventListener(
- 'resize',
- () => {
- requestAnimationFrame(() => this.resize());
- },
- { passive: true }
- );
- }
-
- componentDidUpdate(props) {
- const { percent } = this.props;
- if (props.percent !== percent) {
- // 不加这个会造成绘制缓慢
- this.renderChart('update');
- }
- }
-
- componentWillUnmount() {
- cancelAnimationFrame(this.timer);
- if (this.node) {
- this.node.innerHTML = '';
- }
- window.removeEventListener('resize', this.resize);
- }
-
- resize = () => {
- if (this.root) {
- const { height } = this.props;
- const { offsetWidth } = this.root.parentNode;
- this.setState({
- radio: offsetWidth < height ? offsetWidth / height : 1,
- });
- }
- };
-
- renderChart(type) {
- const { percent, color = '#1890FF' } = this.props;
- const data = percent / 100;
- const self = this;
- cancelAnimationFrame(this.timer);
-
- if (!this.node || (data !== 0 && !data)) {
- return;
- }
-
- const canvas = this.node;
- const ctx = canvas.getContext('2d');
- const canvasWidth = canvas.width;
- const canvasHeight = canvas.height;
- const radius = canvasWidth / 2;
- const lineWidth = 2;
- const cR = radius - lineWidth;
-
- ctx.beginPath();
- ctx.lineWidth = lineWidth * 2;
-
- const axisLength = canvasWidth - lineWidth;
- const unit = axisLength / 8;
- const range = 0.2; // 振幅
- let currRange = range;
- const xOffset = lineWidth;
- let sp = 0; // 周期偏移量
- let currData = 0;
- const waveupsp = 0.005; // 水波上涨速度
-
- let arcStack = [];
- const bR = radius - lineWidth;
- const circleOffset = -(Math.PI / 2);
- let circleLock = true;
-
- for (let i = circleOffset; i < circleOffset + 2 * Math.PI; i += 1 / (8 * Math.PI)) {
- arcStack.push([radius + bR * Math.cos(i), radius + bR * Math.sin(i)]);
- }
-
- const cStartPoint = arcStack.shift();
- ctx.strokeStyle = color;
- ctx.moveTo(cStartPoint[0], cStartPoint[1]);
-
- function drawSin() {
- ctx.beginPath();
- ctx.save();
-
- const sinStack = [];
- for (let i = xOffset; i <= xOffset + axisLength; i += 20 / axisLength) {
- const x = sp + (xOffset + i) / unit;
- const y = Math.sin(x) * currRange;
- const dx = i;
- const dy = 2 * cR * (1 - currData) + (radius - cR) - unit * y;
-
- ctx.lineTo(dx, dy);
- sinStack.push([dx, dy]);
- }
-
- const startPoint = sinStack.shift();
-
- ctx.lineTo(xOffset + axisLength, canvasHeight);
- ctx.lineTo(xOffset, canvasHeight);
- ctx.lineTo(startPoint[0], startPoint[1]);
-
- const gradient = ctx.createLinearGradient(0, 0, 0, canvasHeight);
- gradient.addColorStop(0, '#ffffff');
- gradient.addColorStop(1, color);
- ctx.fillStyle = gradient;
- ctx.fill();
- ctx.restore();
- }
-
- function render() {
- ctx.clearRect(0, 0, canvasWidth, canvasHeight);
- if (circleLock && type !== 'update') {
- if (arcStack.length) {
- const temp = arcStack.shift();
- ctx.lineTo(temp[0], temp[1]);
- ctx.stroke();
- } else {
- circleLock = false;
- ctx.lineTo(cStartPoint[0], cStartPoint[1]);
- ctx.stroke();
- arcStack = null;
-
- ctx.globalCompositeOperation = 'destination-over';
- ctx.beginPath();
- ctx.lineWidth = lineWidth;
- ctx.arc(radius, radius, bR, 0, 2 * Math.PI, 1);
-
- ctx.beginPath();
- ctx.save();
- ctx.arc(radius, radius, radius - 3 * lineWidth, 0, 2 * Math.PI, 1);
-
- ctx.restore();
- ctx.clip();
- ctx.fillStyle = color;
- }
- } else {
- if (data >= 0.85) {
- if (currRange > range / 4) {
- const t = range * 0.01;
- currRange -= t;
- }
- } else if (data <= 0.1) {
- if (currRange < range * 1.5) {
- const t = range * 0.01;
- currRange += t;
- }
- } else {
- if (currRange <= range) {
- const t = range * 0.01;
- currRange += t;
- }
- if (currRange >= range) {
- const t = range * 0.01;
- currRange -= t;
- }
- }
- if (data - currData > 0) {
- currData += waveupsp;
- }
- if (data - currData < 0) {
- currData -= waveupsp;
- }
-
- sp += 0.07;
- drawSin();
- }
- self.timer = requestAnimationFrame(render);
- }
- render();
- }
-
- render() {
- const { radio } = this.state;
- const { percent, title, height } = this.props;
- return (
- (this.root = n)}
- style={{ transform: `scale(${radio})` }}
- >
-
- (this.node = n)}
- width={height * 2}
- height={height * 2}
- />
-
-
- {title && {title} }
-
{percent}%
-
-
- );
- }
-}
-
-export default WaterWave;
diff --git a/app/web/src/components/Charts/WaterWave/index.less b/app/web/src/components/Charts/WaterWave/index.less
deleted file mode 100644
index 43ba05ca..00000000
--- a/app/web/src/components/Charts/WaterWave/index.less
+++ /dev/null
@@ -1,28 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.waterWave {
- display: inline-block;
- position: relative;
- transform-origin: left;
- .text {
- position: absolute;
- left: 0;
- top: 32px;
- text-align: center;
- width: 100%;
- span {
- color: @text-color-secondary;
- font-size: 14px;
- line-height: 22px;
- }
- h4 {
- color: @heading-color;
- line-height: 32px;
- font-size: 24px;
- }
- }
- .waterWaveCanvasWrapper {
- transform: scale(0.5);
- transform-origin: 0 0;
- }
-}
diff --git a/app/web/src/components/Charts/autoHeight.js b/app/web/src/components/Charts/autoHeight.js
deleted file mode 100644
index 6ee9e098..00000000
--- a/app/web/src/components/Charts/autoHeight.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* eslint eqeqeq: 0 */
-import React from 'react';
-
-function computeHeight(node) {
- const totalHeight = parseInt(getComputedStyle(node).height, 10);
- const padding =
- parseInt(getComputedStyle(node).paddingTop, 10) +
- parseInt(getComputedStyle(node).paddingBottom, 10);
- return totalHeight - padding;
-}
-
-function getAutoHeight(n) {
- if (!n) {
- return 0;
- }
-
- let node = n;
-
- let height = computeHeight(node);
-
- while (!height) {
- node = node.parentNode;
- if (node) {
- height = computeHeight(node);
- } else {
- break;
- }
- }
-
- return height;
-}
-
-const autoHeight = () => WrappedComponent =>
- class extends React.Component {
- state = {
- computedHeight: 0,
- };
-
- componentDidMount() {
- const { height } = this.props;
- if (!height) {
- const h = getAutoHeight(this.root);
- // eslint-disable-next-line
- this.setState({ computedHeight: h });
- }
- }
-
- handleRoot = node => {
- this.root = node;
- };
-
- render() {
- const { height } = this.props;
- const { computedHeight } = this.state;
- const h = height || computedHeight;
- return (
- {h > 0 && }
- );
- }
- };
-
-export default autoHeight;
diff --git a/app/web/src/components/Charts/bizcharts.d.ts b/app/web/src/components/Charts/bizcharts.d.ts
deleted file mode 100644
index 0815ffee..00000000
--- a/app/web/src/components/Charts/bizcharts.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import * as BizChart from 'bizcharts';
-
-export = BizChart;
diff --git a/app/web/src/components/Charts/bizcharts.js b/app/web/src/components/Charts/bizcharts.js
deleted file mode 100644
index e08db8d6..00000000
--- a/app/web/src/components/Charts/bizcharts.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import * as BizChart from 'bizcharts';
-
-export default BizChart;
diff --git a/app/web/src/components/Charts/demo/bar.md b/app/web/src/components/Charts/demo/bar.md
deleted file mode 100644
index 955f44e0..00000000
--- a/app/web/src/components/Charts/demo/bar.md
+++ /dev/null
@@ -1,26 +0,0 @@
----
-order: 4
-title: 柱状图
----
-
-通过设置 `x`,`y` 属性,可以快速的构建出一个漂亮的柱状图,各种纬度的关系则是通过自定义的数据展现。
-
-````jsx
-import { Bar } from 'ant-design-pro/lib/Charts';
-
-const salesData = [];
-for (let i = 0; i < 12; i += 1) {
- salesData.push({
- x: `${i + 1}月`,
- y: Math.floor(Math.random() * 1000) + 200,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/chart-card.md b/app/web/src/components/Charts/demo/chart-card.md
deleted file mode 100644
index 4da852b7..00000000
--- a/app/web/src/components/Charts/demo/chart-card.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-order: 1
-title: 图表卡片
----
-
-用于展示图表的卡片容器,可以方便的配合其它图表套件展示丰富信息。
-
-```jsx
-import { ChartCard, yuan, Field } from 'ant-design-pro/lib/Charts';
-import Trend from 'ant-design-pro/lib/Trend';
-import { Row, Col, Icon, Tooltip } from 'antd';
-import numeral from 'numeral';
-
-ReactDOM.render(
-
-
-
-
-
- }
- total={() => (
-
- )}
- footer={
-
- }
- contentHeight={46}
- >
-
- 周同比
-
- 12%
-
-
-
- 日环比
-
- 11%
-
-
-
-
-
-
- }
- action={
-
-
-
- }
- total={() => (
-
- )}
- footer={
-
- }
- />
-
-
-
- }
- action={
-
-
-
- }
- total={() => (
-
- )}
- />
-
-
,
- mountNode,
-);
-```
diff --git a/app/web/src/components/Charts/demo/gauge.md b/app/web/src/components/Charts/demo/gauge.md
deleted file mode 100644
index f53465d8..00000000
--- a/app/web/src/components/Charts/demo/gauge.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-order: 7
-title: 仪表盘
----
-
-仪表盘是一种进度展示方式,可以更直观的展示当前的进展情况,通常也可表示占比。
-
-````jsx
-import { Gauge } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/mini-area.md b/app/web/src/components/Charts/demo/mini-area.md
deleted file mode 100644
index 2b9bfb47..00000000
--- a/app/web/src/components/Charts/demo/mini-area.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 2
-col: 2
-title: 迷你区域图
----
-
-````jsx
-import { MiniArea } from 'ant-design-pro/lib/Charts';
-import moment from 'moment';
-
-const visitData = [];
-const beginDay = new Date().getTime();
-for (let i = 0; i < 20; i += 1) {
- visitData.push({
- x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
- y: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/mini-bar.md b/app/web/src/components/Charts/demo/mini-bar.md
deleted file mode 100644
index fef301bc..00000000
--- a/app/web/src/components/Charts/demo/mini-bar.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 2
-col: 2
-title: 迷你柱状图
----
-
-迷你柱状图更适合展示简单的区间数据,简洁的表现方式可以很好的减少大数据量的视觉展现压力。
-
-````jsx
-import { MiniBar } from 'ant-design-pro/lib/Charts';
-import moment from 'moment';
-
-const visitData = [];
-const beginDay = new Date().getTime();
-for (let i = 0; i < 20; i += 1) {
- visitData.push({
- x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
- y: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/mini-pie.md b/app/web/src/components/Charts/demo/mini-pie.md
deleted file mode 100644
index 9b1abf05..00000000
--- a/app/web/src/components/Charts/demo/mini-pie.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-order: 6
-title: 迷你饼状图
----
-
-通过简化 `Pie` 属性的设置,可以快速的实现极简的饼状图,可配合 `ChartCard` 组合展
-现更多业务场景。
-
-```jsx
-import { Pie } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
- ,
- mountNode
-);
-```
diff --git a/app/web/src/components/Charts/demo/mini-progress.md b/app/web/src/components/Charts/demo/mini-progress.md
deleted file mode 100644
index 6308a8fa..00000000
--- a/app/web/src/components/Charts/demo/mini-progress.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-order: 3
-title: 迷你进度条
----
-
-````jsx
-import { MiniProgress } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/mix.md b/app/web/src/components/Charts/demo/mix.md
deleted file mode 100644
index fc64110a..00000000
--- a/app/web/src/components/Charts/demo/mix.md
+++ /dev/null
@@ -1,84 +0,0 @@
----
-order: 0
-title: 图表套件组合展示
----
-
-利用 Ant Design Pro 提供的图表套件,可以灵活组合符合设计规范的图表来满足复杂的业务需求。
-
-````jsx
-import { ChartCard, Field, MiniArea, MiniBar, MiniProgress } from 'ant-design-pro/lib/Charts';
-import Trend from 'ant-design-pro/lib/Trend';
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import { Row, Col, Icon, Tooltip } from 'antd';
-import numeral from 'numeral';
-import moment from 'moment';
-
-const visitData = [];
-const beginDay = new Date().getTime();
-for (let i = 0; i < 20; i += 1) {
- visitData.push({
- x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
- y: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-
-
- 本周访问}
- total={numeral(12321).format('0,0')}
- status="up"
- subTotal={17.1}
- />
-
-
-
-
- }
- total={numeral(8846).format('0,0')}
- footer={ }
- contentHeight={46}
- >
-
-
-
-
- }
- total="78%"
- footer={
-
-
- 周同比
- 12%
-
-
- 日环比
- 11%
-
-
- }
- contentHeight={46}
- >
-
-
-
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/pie.md b/app/web/src/components/Charts/demo/pie.md
deleted file mode 100644
index 9c87161a..00000000
--- a/app/web/src/components/Charts/demo/pie.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-order: 5
-title: 饼状图
----
-
-```jsx
-import { Pie, yuan } from 'ant-design-pro/lib/Charts';
-
-const salesPieData = [
- {
- x: '家用电器',
- y: 4544,
- },
- {
- x: '食用酒水',
- y: 3321,
- },
- {
- x: '个护健康',
- y: 3113,
- },
- {
- x: '服饰箱包',
- y: 2341,
- },
- {
- x: '母婴产品',
- y: 1231,
- },
- {
- x: '其他',
- y: 1231,
- },
-];
-
-ReactDOM.render(
- (
- now.y + pre, 0))
- }}
- />
- )}
- data={salesPieData}
- valueFormat={val => }
- height={294}
- />,
- mountNode,
-);
-```
diff --git a/app/web/src/components/Charts/demo/radar.md b/app/web/src/components/Charts/demo/radar.md
deleted file mode 100644
index 584344aa..00000000
--- a/app/web/src/components/Charts/demo/radar.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-order: 7
-title: 雷达图
----
-
-````jsx
-import { Radar, ChartCard } from 'ant-design-pro/lib/Charts';
-
-const radarOriginData = [
- {
- name: '个人',
- ref: 10,
- koubei: 8,
- output: 4,
- contribute: 5,
- hot: 7,
- },
- {
- name: '团队',
- ref: 3,
- koubei: 9,
- output: 6,
- contribute: 3,
- hot: 1,
- },
- {
- name: '部门',
- ref: 4,
- koubei: 1,
- output: 6,
- contribute: 5,
- hot: 7,
- },
-];
-const radarData = [];
-const radarTitleMap = {
- ref: '引用',
- koubei: '口碑',
- output: '产量',
- contribute: '贡献',
- hot: '热度',
-};
-radarOriginData.forEach((item) => {
- Object.keys(item).forEach((key) => {
- if (key !== 'name') {
- radarData.push({
- name: item.name,
- label: radarTitleMap[key],
- value: item[key],
- });
- }
- });
-});
-
-ReactDOM.render(
-
-
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/tag-cloud.md b/app/web/src/components/Charts/demo/tag-cloud.md
deleted file mode 100644
index c66f6fe6..00000000
--- a/app/web/src/components/Charts/demo/tag-cloud.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-order: 9
-title: 标签云
----
-
-标签云是一套相关的标签以及与此相应的权重展示方式,一般典型的标签云有 30 至 150 个标签,而权重影响使用的字体大小或其他视觉效果。
-
-````jsx
-import { TagCloud } from 'ant-design-pro/lib/Charts';
-
-const tags = [];
-for (let i = 0; i < 50; i += 1) {
- tags.push({
- name: `TagClout-Title-${i}`,
- value: Math.floor((Math.random() * 50)) + 20,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/timeline-chart.md b/app/web/src/components/Charts/demo/timeline-chart.md
deleted file mode 100644
index 60773b57..00000000
--- a/app/web/src/components/Charts/demo/timeline-chart.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-order: 9
-title: 带有时间轴的图表
----
-
-使用 `TimelineChart` 组件可以实现带有时间轴的柱状图展现,而其中的 `x` 属性,则是时间值的指向,默认最多支持同时展现两个指标,分别是 `y1` 和 `y2`。
-
-````jsx
-import { TimelineChart } from 'ant-design-pro/lib/Charts';
-
-const chartData = [];
-for (let i = 0; i < 20; i += 1) {
- chartData.push({
- x: (new Date().getTime()) + (1000 * 60 * 30 * i),
- y1: Math.floor(Math.random() * 100) + 1000,
- y2: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/demo/waterwave.md b/app/web/src/components/Charts/demo/waterwave.md
deleted file mode 100644
index 74d290f5..00000000
--- a/app/web/src/components/Charts/demo/waterwave.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 8
-title: 水波图
----
-
-水波图是一种比例的展示方式,可以更直观的展示关键值的占比。
-
-````jsx
-import { WaterWave } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
-
-
-
-, mountNode);
-````
diff --git a/app/web/src/components/Charts/g2.js b/app/web/src/components/Charts/g2.js
deleted file mode 100644
index 21e22c28..00000000
--- a/app/web/src/components/Charts/g2.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// 全局 G2 设置
-import { track, setTheme } from 'bizcharts';
-
-track(false);
-
-const config = {
- defaultColor: '#1089ff',
- shape: {
- interval: {
- fillOpacity: 1,
- },
- },
-};
-
-setTheme(config);
diff --git a/app/web/src/components/Charts/index.d.ts b/app/web/src/components/Charts/index.d.ts
deleted file mode 100644
index 1ff27af2..00000000
--- a/app/web/src/components/Charts/index.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import * as numeral from 'numeral';
-export { default as ChartCard } from './ChartCard';
-export { default as Bar } from './Bar';
-export { default as Pie } from './Pie';
-export { default as Radar } from './Radar';
-export { default as Gauge } from './Gauge';
-export { default as MiniArea } from './MiniArea';
-export { default as MiniBar } from './MiniBar';
-export { default as MiniProgress } from './MiniProgress';
-export { default as Field } from './Field';
-export { default as WaterWave } from './WaterWave';
-export { default as TagCloud } from './TagCloud';
-export { default as TimelineChart } from './TimelineChart';
-
-declare const yuan: (value: number | string) => string;
-
-export { yuan };
diff --git a/app/web/src/components/Charts/index.js b/app/web/src/components/Charts/index.js
deleted file mode 100644
index 78863fab..00000000
--- a/app/web/src/components/Charts/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import numeral from 'numeral';
-import './g2';
-import ChartCard from './ChartCard';
-import Bar from './Bar';
-import Pie from './Pie';
-import Radar from './Radar';
-import Gauge from './Gauge';
-import MiniArea from './MiniArea';
-import MiniBar from './MiniBar';
-import MiniProgress from './MiniProgress';
-import Field from './Field';
-import WaterWave from './WaterWave';
-import TagCloud from './TagCloud';
-import TimelineChart from './TimelineChart';
-
-const yuan = val => `¥ ${numeral(val).format('0,0')}`;
-
-const Charts = {
- yuan,
- Bar,
- Pie,
- Gauge,
- Radar,
- MiniBar,
- MiniArea,
- MiniProgress,
- ChartCard,
- Field,
- WaterWave,
- TagCloud,
- TimelineChart,
-};
-
-export {
- Charts as default,
- yuan,
- Bar,
- Pie,
- Gauge,
- Radar,
- MiniBar,
- MiniArea,
- MiniProgress,
- ChartCard,
- Field,
- WaterWave,
- TagCloud,
- TimelineChart,
-};
diff --git a/app/web/src/components/Charts/index.less b/app/web/src/components/Charts/index.less
deleted file mode 100644
index 190428bc..00000000
--- a/app/web/src/components/Charts/index.less
+++ /dev/null
@@ -1,19 +0,0 @@
-.miniChart {
- position: relative;
- width: 100%;
- .chartContent {
- position: absolute;
- bottom: -28px;
- width: 100%;
- > div {
- margin: 0 -5px;
- overflow: hidden;
- }
- }
- .chartLoading {
- position: absolute;
- top: 16px;
- left: 50%;
- margin-left: -7px;
- }
-}
diff --git a/app/web/src/components/Charts/index.md b/app/web/src/components/Charts/index.md
deleted file mode 100644
index cb7c9c96..00000000
--- a/app/web/src/components/Charts/index.md
+++ /dev/null
@@ -1,132 +0,0 @@
----
-title:
- en-US: Charts
- zh-CN: Charts
-subtitle: 图表
-order: 2
-cols: 2
----
-
-Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https://antv.alipay.com/g2/doc/index.html) 按照 Ant Design 图表规范封装,需要注意的是 Ant Design Pro 的图表组件以套件形式提供,可以任意组合实现复杂的业务需求。
-
-因为结合了 Ant Design 的标准设计,本着极简的设计思想以及开箱即用的理念,简化了大量 API 配置,所以如果需要灵活定制图表,可以参考 Ant Design Pro 图表实现,自行基于 [G2](https://antv.alipay.com/g2/doc/index.html) 封装图表组件使用。
-
-## API
-
-### ChartCard
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 卡片标题 | ReactNode\|string | - |
-| action | 卡片操作 | ReactNode | - |
-| total | 数据总量 | ReactNode \| number \| function | - |
-| footer | 卡片底部 | ReactNode | - |
-| contentHeight | 内容区域高度 | number | - |
-| avatar | 右侧图标 | React.ReactNode | - |
-### MiniBar
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| color | 图表颜色 | string | `#1890FF` |
-| height | 图表高度 | number | - |
-| data | 数据 | array<{x, y}> | - |
-
-### MiniArea
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| color | 图表颜色 | string | `rgba(24, 144, 255, 0.2)` |
-| borderColor | 图表边颜色 | string | `#1890FF` |
-| height | 图表高度 | number | - |
-| line | 是否显示描边 | boolean | false |
-| animate | 是否显示动画 | boolean | true |
-| xAxis | [x 轴配置](http://antvis.github.io/g2/doc/tutorial/start/axis.html) | object | - |
-| yAxis | [y 轴配置](http://antvis.github.io/g2/doc/tutorial/start/axis.html) | object | - |
-| data | 数据 | array<{x, y}> | - |
-
-### MiniProgress
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| target | 目标比例 | number | - |
-| color | 进度条颜色 | string | - |
-| strokeWidth | 进度条高度 | number | - |
-| percent | 进度比例 | number | - |
-
-### Bar
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
-| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
-| height | 图表高度 | number | - |
-| data | 数据 | array<{x, y}> | - |
-| autoLabel | 在宽度不足时,自动隐藏 x 轴的 label | boolean | `true` |
-
-### Pie
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| animate | 是否显示动画 | boolean | true |
-| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
-| height | 图表高度 | number | - |
-| hasLegend | 是否显示 legend | boolean | `false` |
-| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
-| percent | 占比 | number | - |
-| tooltip | 是否显示 tooltip | boolean | true |
-| valueFormat | 显示值的格式化函数 | function | - |
-| title | 图表标题 | ReactNode\|string | - |
-| subTitle | 图表子标题 | ReactNode\|string | - |
-| total | 图标中央的总数 | string | function | - |
-
-### Radar
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| height | 图表高度 | number | - |
-| hasLegend | 是否显示 legend | boolean | `false` |
-| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
-| data | 图标数据 | array<{name,label,value}> | - |
-
-### Gauge
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| height | 图表高度 | number | - |
-| color | 图表颜色 | string | `#2F9CFF` |
-| bgColor | 图表背景颜色 | string | `#F0F2F5` |
-| percent | 进度比例 | number | - |
-
-### WaterWave
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| height | 图表高度 | number | - |
-| color | 图表颜色 | string | `#1890FF` |
-| percent | 进度比例 | number | - |
-
-### TagCloud
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| data | 标题 | Array | - |
-| height | 高度值 | number | - |
-
-### TimelineChart
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| data | 标题 | Array | - |
-| titleMap | 指标别名 | Object{y1: '客流量', y2: '支付笔数'} | - |
-| height | 高度值 | number | 400 |
-
-### Field
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| label | 标题 | ReactNode\|string | - |
-| value | 值 | ReactNode\|string | - |
diff --git a/app/web/src/components/CountDown/demo/simple.md b/app/web/src/components/CountDown/demo/simple.md
deleted file mode 100644
index e42cbf1d..00000000
--- a/app/web/src/components/CountDown/demo/simple.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基本
- en-US: Basic
----
-
-## zh-CN
-
-简单的倒计时组件使用。
-
-## en-US
-
-The simplest usage.
-
-````jsx
-import CountDown from 'ant-design-pro/lib/CountDown';
-
-const targetTime = new Date().getTime() + 3900000;
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/CountDown/index.d.ts b/app/web/src/components/CountDown/index.d.ts
deleted file mode 100644
index d39a2e95..00000000
--- a/app/web/src/components/CountDown/index.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import * as React from 'react';
-export interface ICountDownProps {
- format?: (time: number) => void;
- target: Date | number;
- onEnd?: () => void;
- style?: React.CSSProperties;
-}
-
-export default class CountDown extends React.Component {}
diff --git a/app/web/src/components/CountDown/index.en-US.md b/app/web/src/components/CountDown/index.en-US.md
deleted file mode 100644
index 7b452406..00000000
--- a/app/web/src/components/CountDown/index.en-US.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: CountDown
-cols: 1
-order: 3
----
-
-Simple CountDown Component.
-
-## API
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|-------|
-| format | Formatter of time | Function(time) | |
-| target | Target time | Date | - |
-| onEnd | Countdown to the end callback | funtion | -|
diff --git a/app/web/src/components/CountDown/index.js b/app/web/src/components/CountDown/index.js
deleted file mode 100644
index 7565bd82..00000000
--- a/app/web/src/components/CountDown/index.js
+++ /dev/null
@@ -1,121 +0,0 @@
-import React, { Component } from 'react';
-
-function fixedZero(val) {
- return val * 1 < 10 ? `0${val}` : val;
-}
-const initTime = props => {
- let lastTime = 0;
- let targetTime = 0;
- try {
- if (Object.prototype.toString.call(props.target) === '[object Date]') {
- targetTime = props.target.getTime();
- } else {
- targetTime = new Date(props.target).getTime();
- }
- } catch (e) {
- throw new Error('invalid target prop', e);
- }
-
- lastTime = targetTime - new Date().getTime();
- return {
- lastTime: lastTime < 0 ? 0 : lastTime,
- };
-};
-
-class CountDown extends Component {
- timer = 0;
-
- interval = 1000;
-
- constructor(props) {
- super(props);
- const { lastTime } = initTime(props);
- this.state = {
- lastTime,
- };
- }
-
- static getDerivedStateFromProps(nextProps, preState) {
- const { lastTime } = initTime(nextProps);
- if (preState.lastTime !== lastTime) {
- return {
- lastTime,
- };
- }
- return null;
- }
-
- componentDidMount() {
- this.tick();
- }
-
- componentDidUpdate(prevProps) {
- const { target } = this.props;
- if (target !== prevProps.target) {
- clearTimeout(this.timer);
- this.tick();
- }
- }
-
- componentWillUnmount() {
- clearTimeout(this.timer);
- }
-
- // defaultFormat = time => (
- // {moment(time).format('hh:mm:ss')}
- // );
- defaultFormat = time => {
- const hours = 60 * 60 * 1000;
- const minutes = 60 * 1000;
-
- const h = Math.floor(time / hours);
- const m = Math.floor((time - h * hours) / minutes);
- const s = Math.floor((time - h * hours - m * minutes) / 1000);
- return (
-
- {fixedZero(h)}:{fixedZero(m)}:{fixedZero(s)}
-
- );
- };
-
- tick = () => {
- const { onEnd } = this.props;
- let { lastTime } = this.state;
-
- this.timer = setTimeout(() => {
- if (lastTime < this.interval) {
- clearTimeout(this.timer);
- this.setState(
- {
- lastTime: 0,
- },
- () => {
- if (onEnd) {
- onEnd();
- }
- }
- );
- } else {
- lastTime -= this.interval;
- this.setState(
- {
- lastTime,
- },
- () => {
- this.tick();
- }
- );
- }
- }, this.interval);
- };
-
- render() {
- const { format = this.defaultFormat, onEnd, ...rest } = this.props;
- const { lastTime } = this.state;
- const result = format(lastTime);
-
- return {result} ;
- }
-}
-
-export default CountDown;
diff --git a/app/web/src/components/CountDown/index.zh-CN.md b/app/web/src/components/CountDown/index.zh-CN.md
deleted file mode 100644
index 7e00ba1d..00000000
--- a/app/web/src/components/CountDown/index.zh-CN.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: CountDown
-subtitle: 倒计时
-cols: 1
-order: 3
----
-
-倒计时组件。
-
-## API
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| format | 时间格式化显示 | Function(time) | |
-| target | 目标时间 | Date | - |
-| onEnd | 倒计时结束回调 | funtion | -|
diff --git a/app/web/src/components/DescriptionList/Description.d.ts b/app/web/src/components/DescriptionList/Description.d.ts
deleted file mode 100644
index 2a17be37..00000000
--- a/app/web/src/components/DescriptionList/Description.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import * as React from 'react';
-
-export default class Description extends React.Component<
- {
- term: React.ReactNode;
- style?: React.CSSProperties;
- },
- any
-> {}
diff --git a/app/web/src/components/DescriptionList/Description.js b/app/web/src/components/DescriptionList/Description.js
deleted file mode 100644
index fce9fd3c..00000000
--- a/app/web/src/components/DescriptionList/Description.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { Col } from 'antd';
-import styles from './index.less';
-import responsive from './responsive';
-
-const Description = ({ term, column, children, ...restProps }) => (
-
- {term && {term}
}
- {children !== null && children !== undefined && {children}
}
-
-);
-
-Description.defaultProps = {
- term: '',
-};
-
-Description.propTypes = {
- term: PropTypes.node,
-};
-
-export default Description;
diff --git a/app/web/src/components/DescriptionList/DescriptionList.js b/app/web/src/components/DescriptionList/DescriptionList.js
deleted file mode 100644
index 73bb5f5f..00000000
--- a/app/web/src/components/DescriptionList/DescriptionList.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { Row } from 'antd';
-import styles from './index.less';
-
-const DescriptionList = ({
- className,
- title,
- col = 3,
- layout = 'horizontal',
- gutter = 32,
- children,
- size,
- ...restProps
-}) => {
- const clsString = classNames(styles.descriptionList, styles[layout], className, {
- [styles.small]: size === 'small',
- [styles.large]: size === 'large',
- });
- const column = col > 4 ? 4 : col;
- return (
-
- {title ?
{title}
: null}
-
- {React.Children.map(
- children,
- child => (child ? React.cloneElement(child, { column }) : child)
- )}
-
-
- );
-};
-
-export default DescriptionList;
diff --git a/app/web/src/components/DescriptionList/demo/basic.md b/app/web/src/components/DescriptionList/demo/basic.md
deleted file mode 100644
index 87954551..00000000
--- a/app/web/src/components/DescriptionList/demo/basic.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基本
- en-US: Basic
----
-
-## zh-CN
-
-基本描述列表。
-
-## en-US
-
-Basic DescriptionList.
-
-````jsx
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-
-const { Description } = DescriptionList;
-
-ReactDOM.render(
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
-, mountNode);
-````
diff --git a/app/web/src/components/DescriptionList/demo/vertical.md b/app/web/src/components/DescriptionList/demo/vertical.md
deleted file mode 100644
index 2742f7c9..00000000
--- a/app/web/src/components/DescriptionList/demo/vertical.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-order: 1
-title:
- zh-CN: 垂直型
- en-US: Vertical
----
-
-## zh-CN
-
-垂直布局。
-
-## en-US
-
-Vertical layout.
-
-````jsx
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-
-const { Description } = DescriptionList;
-
-ReactDOM.render(
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
-, mountNode);
-````
diff --git a/app/web/src/components/DescriptionList/index.d.ts b/app/web/src/components/DescriptionList/index.d.ts
deleted file mode 100644
index 96ccfa7d..00000000
--- a/app/web/src/components/DescriptionList/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-import Description from './Description';
-
-export interface IDescriptionListProps {
- layout?: 'horizontal' | 'vertical';
- col?: number;
- title: React.ReactNode;
- gutter?: number;
- size?: 'large' | 'small';
- style?: React.CSSProperties;
-}
-
-export default class DescriptionList extends React.Component {
- public static Description: typeof Description;
-}
diff --git a/app/web/src/components/DescriptionList/index.en-US.md b/app/web/src/components/DescriptionList/index.en-US.md
deleted file mode 100644
index 089f30b1..00000000
--- a/app/web/src/components/DescriptionList/index.en-US.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-title: DescriptionList
-cols: 1
-order: 4
----
-
-Groups display multiple read-only fields, which are common to informational displays on detail pages.
-
-## API
-
-### DescriptionList
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|---------|
-| layout | type of layout | Enum{'horizontal', 'vertical'} | 'horizontal' |
-| col | specify the maximum number of columns to display, the final columns number is determined by col setting combined with [Responsive Rules](/components/DescriptionList#Responsive-Rules) | number(0 < col <= 4) | 3 |
-| title | title | ReactNode | - |
-| gutter | specify the distance between two items, unit is `px` | number | 32 |
-| size | size of list | Enum{'large', 'small'} | - |
-
-#### Responsive Rules
-
-| Window Width | Columns Number |
-|---------------------|---------------------------------------------|
-| `≥768px` | `col` |
-| `≥576px` | `col < 2 ? col : 2` |
-| `<576px` | `1` |
-
-### DescriptionList.Description
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|-------|
-| term | item title | ReactNode | - |
diff --git a/app/web/src/components/DescriptionList/index.js b/app/web/src/components/DescriptionList/index.js
deleted file mode 100644
index 357f479f..00000000
--- a/app/web/src/components/DescriptionList/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import DescriptionList from './DescriptionList';
-import Description from './Description';
-
-DescriptionList.Description = Description;
-export default DescriptionList;
diff --git a/app/web/src/components/DescriptionList/index.less b/app/web/src/components/DescriptionList/index.less
deleted file mode 100644
index bfb33fcc..00000000
--- a/app/web/src/components/DescriptionList/index.less
+++ /dev/null
@@ -1,77 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.descriptionList {
- // offset the padding-bottom of last row
- :global {
- .ant-row {
- margin-bottom: -16px;
- overflow: hidden;
- }
- }
-
- .title {
- font-size: 14px;
- color: @heading-color;
- font-weight: 500;
- margin-bottom: 16px;
- }
-
- .term {
- // Line-height is 22px IE dom height will calculate error
- line-height: 20px;
- padding-bottom: 16px;
- margin-right: 8px;
- color: @heading-color;
- white-space: nowrap;
- display: table-cell;
-
- &:after {
- content: ':';
- margin: 0 8px 0 2px;
- position: relative;
- top: -0.5px;
- }
- }
-
- .detail {
- line-height: 20px;
- width: 100%;
- padding-bottom: 16px;
- color: @text-color;
- display: table-cell;
- }
-
- &.small {
- // offset the padding-bottom of last row
- :global {
- .ant-row {
- margin-bottom: -8px;
- }
- }
- .title {
- margin-bottom: 12px;
- color: @text-color;
- }
- .term,
- .detail {
- padding-bottom: 8px;
- }
- }
-
- &.large {
- .title {
- font-size: 16px;
- }
- }
-
- &.vertical {
- .term {
- padding-bottom: 8px;
- display: block;
- }
-
- .detail {
- display: block;
- }
- }
-}
diff --git a/app/web/src/components/DescriptionList/index.zh-CN.md b/app/web/src/components/DescriptionList/index.zh-CN.md
deleted file mode 100644
index b16a7fe7..00000000
--- a/app/web/src/components/DescriptionList/index.zh-CN.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: DescriptionList
-subtitle: 描述列表
-cols: 1
-order: 4
----
-
-成组展示多个只读字段,常见于详情页的信息展示。
-
-## API
-
-### DescriptionList
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| layout | 布局方式 | Enum{'horizontal', 'vertical'} | 'horizontal' |
-| col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 |
-| title | 列表标题 | ReactNode | - |
-| gutter | 列表项间距,单位为 `px` | number | 32 |
-| size | 列表型号 | Enum{'large', 'small'} | - |
-
-#### 响应式规则
-
-| 窗口宽度 | 展示列数 |
-|---------------------|---------------------------------------------|
-| `≥768px` | `col` |
-| `≥576px` | `col < 2 ? col : 2` |
-| `<576px` | `1` |
-
-### DescriptionList.Description
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| term | 列表项标题 | ReactNode | - |
-
-
-
diff --git a/app/web/src/components/DescriptionList/responsive.js b/app/web/src/components/DescriptionList/responsive.js
deleted file mode 100644
index a5aa73f7..00000000
--- a/app/web/src/components/DescriptionList/responsive.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 1: { xs: 24 },
- 2: { xs: 24, sm: 12 },
- 3: { xs: 24, sm: 12, md: 8 },
- 4: { xs: 24, sm: 12, md: 6 },
-};
diff --git a/app/web/src/components/EditableItem/index.js b/app/web/src/components/EditableItem/index.js
deleted file mode 100644
index 5b2ef002..00000000
--- a/app/web/src/components/EditableItem/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Input, Icon } from 'antd';
-import styles from './index.less';
-
-export default class EditableItem extends PureComponent {
- constructor(props) {
- super(props);
- this.state = {
- value: props.value,
- editable: false,
- };
- }
-
- handleChange = e => {
- const { value } = e.target;
- this.setState({ value });
- };
-
- check = () => {
- this.setState({ editable: false });
- const { value } = this.state;
- const { onChange } = this.state;
- if (onChange) {
- onChange(value);
- }
- };
-
- edit = () => {
- this.setState({ editable: true });
- };
-
- render() {
- const { value, editable } = this.state;
- return (
-
- {editable ? (
-
-
-
-
- ) : (
-
- {value || ' '}
-
-
- )}
-
- );
- }
-}
diff --git a/app/web/src/components/EditableItem/index.less b/app/web/src/components/EditableItem/index.less
deleted file mode 100644
index 457a18bd..00000000
--- a/app/web/src/components/EditableItem/index.less
+++ /dev/null
@@ -1,25 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.editableItem {
- line-height: @input-height-base;
- display: table;
- width: 100%;
- margin-top: (@font-size-base * @line-height-base - @input-height-base) / 2;
-
- .wrapper {
- display: table-row;
-
- & > * {
- display: table-cell;
- }
-
- & > *:first-child {
- width: 85%;
- }
-
- .icon {
- cursor: pointer;
- text-align: right;
- }
- }
-}
diff --git a/app/web/src/components/EditableLinkGroup/index.js b/app/web/src/components/EditableLinkGroup/index.js
deleted file mode 100644
index ae3d93c7..00000000
--- a/app/web/src/components/EditableLinkGroup/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { PureComponent, createElement } from 'react';
-import PropTypes from 'prop-types';
-import { Button } from 'antd';
-import styles from './index.less';
-
-// TODO: 添加逻辑
-
-class EditableLinkGroup extends PureComponent {
- static propTypes = {
- links: PropTypes.array,
- onAdd: PropTypes.func,
- linkElement: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
- };
-
- static defaultProps = {
- links: [],
- onAdd: () => {},
- linkElement: 'a',
- };
-
- render() {
- const { links, linkElement, onAdd } = this.props;
- return (
-
- {links.map(link =>
- createElement(
- linkElement,
- {
- key: `linkGroup-item-${link.id || link.title}`,
- to: link.href,
- href: link.href,
- },
- link.title
- )
- )}
- {
-
- 添加
-
- }
-
- );
- }
-}
-
-export default EditableLinkGroup;
diff --git a/app/web/src/components/EditableLinkGroup/index.less b/app/web/src/components/EditableLinkGroup/index.less
deleted file mode 100644
index a421df6f..00000000
--- a/app/web/src/components/EditableLinkGroup/index.less
+++ /dev/null
@@ -1,16 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.linkGroup {
- padding: 20px 0 8px 24px;
- font-size: 0;
- & > a {
- color: @text-color;
- display: inline-block;
- font-size: @font-size-base;
- margin-bottom: 13px;
- width: 25%;
- &:hover {
- color: @primary-color;
- }
- }
-}
diff --git a/app/web/src/components/Ellipsis/demo/line.md b/app/web/src/components/Ellipsis/demo/line.md
deleted file mode 100644
index bc31170d..00000000
--- a/app/web/src/components/Ellipsis/demo/line.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-order: 1
-title:
- zh-CN: 按照行数省略
- en-US: Truncate according to the number of rows
----
-
-## zh-CN
-
-通过设置 `lines` 属性指定最大行数,如果超过这个行数的文本会自动截取。但是在这种模式下所有 `children` 将会被转换成纯文本。
-
-并且注意在这种模式下,外容器需要有指定的宽度(或设置自身宽度)。
-
-## en-US
-
-`lines` attribute specifies the maximum number of rows where the text will automatically be truncated when exceeded. In this mode, all children will be converted to plain text.
-
-Also note that, in this mode, the outer container needs to have a specified width (or set its own width).
-
-
-````jsx
-import Ellipsis from 'ant-design-pro/lib/Ellipsis';
-
-const article = There were injuries alleged in three cases in 2015 , and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.
;
-
-ReactDOM.render(
-
- {article}
-
-, mountNode);
-````
diff --git a/app/web/src/components/Ellipsis/demo/number.md b/app/web/src/components/Ellipsis/demo/number.md
deleted file mode 100644
index 0bc1a0ff..00000000
--- a/app/web/src/components/Ellipsis/demo/number.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 0
-title:
- zh-CN: 按照字符数省略
- en-US: Truncate according to the number of character
----
-
-## zh-CN
-
-通过设置 `length` 属性指定文本最长长度,如果超过这个长度会自动截取。
-
-## en-US
-
-`length` attribute specifies the maximum length where the text will automatically be truncated when exceeded.
-
-````jsx
-import Ellipsis from 'ant-design-pro/lib/Ellipsis';
-
-const article = 'There were injuries alleged in three cases in 2015, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.';
-
-ReactDOM.render(
-
- {article}
-
Show Tooltip
- {article}
-
-, mountNode);
-````
diff --git a/app/web/src/components/Ellipsis/index.d.ts b/app/web/src/components/Ellipsis/index.d.ts
deleted file mode 100644
index 03264aa9..00000000
--- a/app/web/src/components/Ellipsis/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import * as React from 'react';
-export interface IEllipsisProps {
- tooltip?: boolean;
- length?: number;
- lines?: number;
- style?: React.CSSProperties;
- className?: string;
- fullWidthRecognition?: boolean;
-}
-
-export function getStrFullLength(str: string): number;
-export function cutStrByFullLength(str: string, maxLength: number): number;
-
-export default class Ellipsis extends React.Component {}
diff --git a/app/web/src/components/Ellipsis/index.en-US.md b/app/web/src/components/Ellipsis/index.en-US.md
deleted file mode 100644
index 15139cc9..00000000
--- a/app/web/src/components/Ellipsis/index.en-US.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: Ellipsis
-cols: 1
-order: 10
----
-
-When the text is too long, the Ellipsis automatically shortens it according to its length or the maximum number of lines.
-
-## API
-
-Property | Description | Type | Default
-----|------|-----|------
-tooltip | tooltip for showing the full text content when hovering over | boolean | -
-length | maximum number of characters in the text before being truncated | number | -
-lines | maximum number of rows in the text before being truncated | number | `1`
-fullWidthRecognition | whether consider full-width character length as 2 when calculate string length | boolean | -
diff --git a/app/web/src/components/Ellipsis/index.js b/app/web/src/components/Ellipsis/index.js
deleted file mode 100644
index 72fae052..00000000
--- a/app/web/src/components/Ellipsis/index.js
+++ /dev/null
@@ -1,269 +0,0 @@
-import React, { Component } from 'react';
-import { Tooltip } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-/* eslint react/no-did-mount-set-state: 0 */
-/* eslint no-param-reassign: 0 */
-
-const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
-
-const TooltipOverlayStyle = {
- overflowWrap: 'break-word',
- wordWrap: 'break-word',
-};
-
-export const getStrFullLength = (str = '') =>
- str.split('').reduce((pre, cur) => {
- const charCode = cur.charCodeAt(0);
- if (charCode >= 0 && charCode <= 128) {
- return pre + 1;
- }
- return pre + 2;
- }, 0);
-
-export const cutStrByFullLength = (str = '', maxLength) => {
- let showLength = 0;
- return str.split('').reduce((pre, cur) => {
- const charCode = cur.charCodeAt(0);
- if (charCode >= 0 && charCode <= 128) {
- showLength += 1;
- } else {
- showLength += 2;
- }
- if (showLength <= maxLength) {
- return pre + cur;
- }
- return pre;
- }, '');
-};
-
-const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) => {
- if (typeof text !== 'string') {
- throw new Error('Ellipsis children must be string.');
- }
- const textLength = fullWidthRecognition ? getStrFullLength(text) : text.length;
- if (textLength <= length || length < 0) {
- return {text} ;
- }
- const tail = '...';
- let displayText;
- if (length - tail.length <= 0) {
- displayText = '';
- } else {
- displayText = fullWidthRecognition ? cutStrByFullLength(text, length) : text.slice(0, length);
- }
-
- if (tooltip) {
- return (
-
-
- {displayText}
- {tail}
-
-
- );
- }
-
- return (
-
- {displayText}
- {tail}
-
- );
-};
-
-export default class Ellipsis extends Component {
- state = {
- text: '',
- targetCount: 0,
- };
-
- componentDidMount() {
- if (this.node) {
- this.computeLine();
- }
- }
-
- componentDidUpdate(perProps) {
- const { lines } = this.props;
- if (lines !== perProps.lines) {
- this.computeLine();
- }
- }
-
- computeLine = () => {
- const { lines } = this.props;
- if (lines && !isSupportLineClamp) {
- const text = this.shadowChildren.innerText || this.shadowChildren.textContent;
- const lineHeight = parseInt(getComputedStyle(this.root).lineHeight, 10);
- const targetHeight = lines * lineHeight;
- this.content.style.height = `${targetHeight}px`;
- const totalHeight = this.shadowChildren.offsetHeight;
- const shadowNode = this.shadow.firstChild;
-
- if (totalHeight <= targetHeight) {
- this.setState({
- text,
- targetCount: text.length,
- });
- return;
- }
-
- // bisection
- const len = text.length;
- const mid = Math.ceil(len / 2);
-
- const count = this.bisection(targetHeight, mid, 0, len, text, shadowNode);
-
- this.setState({
- text,
- targetCount: count,
- });
- }
- };
-
- bisection = (th, m, b, e, text, shadowNode) => {
- const suffix = '...';
- let mid = m;
- let end = e;
- let begin = b;
- shadowNode.innerHTML = text.substring(0, mid) + suffix;
- let sh = shadowNode.offsetHeight;
-
- if (sh <= th) {
- shadowNode.innerHTML = text.substring(0, mid + 1) + suffix;
- sh = shadowNode.offsetHeight;
- if (sh > th || mid === begin) {
- return mid;
- }
- begin = mid;
- if (end - begin === 1) {
- mid = 1 + begin;
- } else {
- mid = Math.floor((end - begin) / 2) + begin;
- }
- return this.bisection(th, mid, begin, end, text, shadowNode);
- }
- if (mid - 1 < 0) {
- return mid;
- }
- shadowNode.innerHTML = text.substring(0, mid - 1) + suffix;
- sh = shadowNode.offsetHeight;
- if (sh <= th) {
- return mid - 1;
- }
- end = mid;
- mid = Math.floor((end - begin) / 2) + begin;
- return this.bisection(th, mid, begin, end, text, shadowNode);
- };
-
- handleRoot = n => {
- this.root = n;
- };
-
- handleContent = n => {
- this.content = n;
- };
-
- handleNode = n => {
- this.node = n;
- };
-
- handleShadow = n => {
- this.shadow = n;
- };
-
- handleShadowChildren = n => {
- this.shadowChildren = n;
- };
-
- render() {
- const { text, targetCount } = this.state;
- const {
- children,
- lines,
- length,
- className,
- tooltip,
- fullWidthRecognition,
- ...restProps
- } = this.props;
-
- const cls = classNames(styles.ellipsis, className, {
- [styles.lines]: lines && !isSupportLineClamp,
- [styles.lineClamp]: lines && isSupportLineClamp,
- });
-
- if (!lines && !length) {
- return (
-
- {children}
-
- );
- }
-
- // length
- if (!lines) {
- return (
-
- );
- }
-
- const id = `antd-pro-ellipsis-${`${new Date().getTime()}${Math.floor(Math.random() * 100)}`}`;
-
- // support document.body.style.webkitLineClamp
- if (isSupportLineClamp) {
- const style = `#${id}{-webkit-line-clamp:${lines};-webkit-box-orient: vertical;}`;
-
- const node = (
-
-
- {children}
-
- );
-
- return tooltip ? (
-
- {node}
-
- ) : (
- node
- );
- }
-
- const childNode = (
-
- {targetCount > 0 && text.substring(0, targetCount)}
- {targetCount > 0 && targetCount < text.length && '...'}
-
- );
-
- return (
-
-
- {tooltip ? (
-
- {childNode}
-
- ) : (
- childNode
- )}
-
- {children}
-
-
- {text}
-
-
-
- );
- }
-}
diff --git a/app/web/src/components/Ellipsis/index.less b/app/web/src/components/Ellipsis/index.less
deleted file mode 100644
index 2c4a867c..00000000
--- a/app/web/src/components/Ellipsis/index.less
+++ /dev/null
@@ -1,24 +0,0 @@
-.ellipsis {
- overflow: hidden;
- display: inline-block;
- word-break: break-all;
- width: 100%;
-}
-
-.lines {
- position: relative;
- .shadow {
- display: block;
- position: absolute;
- color: transparent;
- opacity: 0;
- z-index: -999;
- }
-}
-
-.lineClamp {
- position: relative;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
-}
diff --git a/app/web/src/components/Ellipsis/index.test.js b/app/web/src/components/Ellipsis/index.test.js
deleted file mode 100644
index 4d057b24..00000000
--- a/app/web/src/components/Ellipsis/index.test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { getStrFullLength, cutStrByFullLength } from './index';
-
-describe('test calculateShowLength', () => {
- it('get full length', () => {
- expect(getStrFullLength('一二,a,')).toEqual(8);
- });
- it('cut str by full length', () => {
- expect(cutStrByFullLength('一二,a,', 7)).toEqual('一二,a');
- });
- it('cut str when length small', () => {
- expect(cutStrByFullLength('一22三', 5)).toEqual('一22');
- });
-});
diff --git a/app/web/src/components/Ellipsis/index.zh-CN.md b/app/web/src/components/Ellipsis/index.zh-CN.md
deleted file mode 100644
index f7a70ead..00000000
--- a/app/web/src/components/Ellipsis/index.zh-CN.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: Ellipsis
-subtitle: 文本自动省略号
-cols: 1
-order: 10
----
-
-文本过长自动处理省略号,支持按照文本长度和最大行数两种方式截取。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-tooltip | 移动到文本展示完整内容的提示 | boolean | -
-length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | -
-lines | 在按照行数截取下最大的行数,超过则截取省略 | number | `1`
-fullWidthRecognition | 是否将全角字符的长度视为2来计算字符串长度 | boolean | -
diff --git a/app/web/src/components/Exception/demo/403.md b/app/web/src/components/Exception/demo/403.md
deleted file mode 100644
index bb46037f..00000000
--- a/app/web/src/components/Exception/demo/403.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-order: 2
-title:
- zh-CN: 403
- en-US: 403
----
-
-## zh-CN
-
-403 页面,配合自定义操作。
-
-## en-US
-
-403 page with custom operations.
-
-````jsx
-import Exception from 'ant-design-pro/lib/Exception';
-import { Button } from 'antd';
-
-const actions = (
-
- Home
- Detail
-
-);
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Exception/demo/404.md b/app/web/src/components/Exception/demo/404.md
deleted file mode 100644
index db50de65..00000000
--- a/app/web/src/components/Exception/demo/404.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-order: 0
-title:
- zh-CN: 404
- en-US: 404
----
-
-## zh-CN
-
-404 页面。
-
-## en-US
-
-404 page.
-
-````jsx
-import Exception from 'ant-design-pro/lib/Exception';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Exception/demo/500.md b/app/web/src/components/Exception/demo/500.md
deleted file mode 100644
index 096ca8e5..00000000
--- a/app/web/src/components/Exception/demo/500.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-order: 1
-title:
- zh-CN: 500
- en-US: 500
----
-
-## zh-CN
-
-500 页面。
-
-## en-US
-
-500 page.
-
-````jsx
-import Exception from 'ant-design-pro/lib/Exception';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Exception/index.d.ts b/app/web/src/components/Exception/index.d.ts
deleted file mode 100644
index d62c1771..00000000
--- a/app/web/src/components/Exception/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IExceptionProps {
- type?: '403' | '404' | '500';
- title?: React.ReactNode;
- desc?: React.ReactNode;
- img?: string;
- actions?: React.ReactNode;
- linkElement?: React.ReactNode;
- style?: React.CSSProperties;
- className?: string;
- backText?: React.ReactNode;
- redirect?: string;
-}
-
-export default class Exception extends React.Component {}
diff --git a/app/web/src/components/Exception/index.en-US.md b/app/web/src/components/Exception/index.en-US.md
deleted file mode 100644
index 37e7e807..00000000
--- a/app/web/src/components/Exception/index.en-US.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: Exception
-cols: 1
-order: 5
----
-
-Exceptions page is used to provide feedback on specific abnormal state. Usually, it contains an explanation of the error status, and provides users with suggestions or operations, to prevent users from feeling lost and confused.
-
-## API
-
-Property | Description | Type | Default
----------|-------------|------|--------
-| backText | default return button text | ReactNode | back to home |
-type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | -
-title | title | ReactNode | -
-desc | supplementary description | ReactNode | -
-img | the url of background image | string | -
-actions | suggested operations, a default 'Home' link will show if not set | ReactNode | -
-linkElement | to specify the element of link | string\|ReactElement | 'a'
-redirect | redirect path | string | '/'
\ No newline at end of file
diff --git a/app/web/src/components/Exception/index.js b/app/web/src/components/Exception/index.js
deleted file mode 100644
index 2c7223cc..00000000
--- a/app/web/src/components/Exception/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React, { createElement } from 'react';
-import classNames from 'classnames';
-import { Button } from 'antd';
-import config from './typeConfig';
-import styles from './index.less';
-
-class Exception extends React.PureComponent {
- static defaultProps = {
- backText: 'back to home',
- redirect: '/',
- };
-
- constructor(props) {
- super(props);
- this.state = {};
- }
-
- render() {
- const {
- className,
- backText,
- linkElement = 'a',
- type,
- title,
- desc,
- img,
- actions,
- redirect,
- ...rest
- } = this.props;
- const pageType = type in config ? type : '404';
- const clsString = classNames(styles.exception, className);
- return (
-
-
-
-
{title || config[pageType].title}
-
{desc || config[pageType].desc}
-
- {actions ||
- createElement(
- linkElement,
- {
- to: redirect,
- href: redirect,
- },
- {backText}
- )}
-
-
-
- );
- }
-}
-
-export default Exception;
diff --git a/app/web/src/components/Exception/index.less b/app/web/src/components/Exception/index.less
deleted file mode 100644
index b55fe3a9..00000000
--- a/app/web/src/components/Exception/index.less
+++ /dev/null
@@ -1,89 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.exception {
- display: flex;
- align-items: center;
- height: 80%;
- min-height: 500px;
-
- .imgBlock {
- flex: 0 0 62.5%;
- width: 62.5%;
- padding-right: 152px;
- zoom: 1;
- &:before,
- &:after {
- content: ' ';
- display: table;
- }
- &:after {
- clear: both;
- visibility: hidden;
- font-size: 0;
- height: 0;
- }
- }
-
- .imgEle {
- height: 360px;
- width: 100%;
- max-width: 430px;
- float: right;
- background-repeat: no-repeat;
- background-position: 50% 50%;
- background-size: contain;
- }
-
- .content {
- flex: auto;
-
- h1 {
- color: #434e59;
- font-size: 72px;
- font-weight: 600;
- line-height: 72px;
- margin-bottom: 24px;
- }
-
- .desc {
- color: @text-color-secondary;
- font-size: 20px;
- line-height: 28px;
- margin-bottom: 16px;
- }
-
- .actions {
- button:not(:last-child) {
- margin-right: 8px;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-xl) {
- .exception {
- .imgBlock {
- padding-right: 88px;
- }
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .exception {
- display: block;
- text-align: center;
- .imgBlock {
- padding-right: 0;
- margin: 0 auto 24px;
- }
- }
-}
-
-@media screen and (max-width: @screen-xs) {
- .exception {
- .imgBlock {
- margin-bottom: -24px;
- overflow: hidden;
- }
- }
-}
diff --git a/app/web/src/components/Exception/index.zh-CN.md b/app/web/src/components/Exception/index.zh-CN.md
deleted file mode 100644
index 2e64399f..00000000
--- a/app/web/src/components/Exception/index.zh-CN.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: Exception
-subtitle: 异常
-cols: 1
-order: 5
----
-
-异常页用于对页面特定的异常状态进行反馈。通常,它包含对错误状态的阐述,并向用户提供建议或操作,避免用户感到迷失和困惑。
-
-## API
-
-| 参数 | 说明| 类型 | 默认值 |
-|-------------|------------------------------------------|-------------|-------|
-| backText| 默认的返回按钮文本 | ReactNode| back to home |
-| type| 页面类型,若配置,则自带对应类型默认的 `title`,`desc`,`img`,此默认设置可以被 `title`,`desc`,`img` 覆盖 | Enum {'403', '404', '500'} | - |
-| title | 标题 | ReactNode| -|
-| desc| 补充描述| ReactNode| -|
-| img | 背景图片地址 | string| -|
-| actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -|
-| linkElement | 定义链接的元素 | string\|ReactElement | 'a' |
-| redirect | 返回按钮的跳转地址 | string | '/'
diff --git a/app/web/src/components/Exception/typeConfig.js b/app/web/src/components/Exception/typeConfig.js
deleted file mode 100644
index b6e1ee5a..00000000
--- a/app/web/src/components/Exception/typeConfig.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const config = {
- 403: {
- img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg',
- title: '403',
- desc: '抱歉,你无权访问该页面',
- },
- 404: {
- img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg',
- title: '404',
- desc: '抱歉,你访问的页面不存在',
- },
- 500: {
- img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',
- title: '500',
- desc: '抱歉,服务器出错了',
- },
-};
-
-export default config;
diff --git a/app/web/src/components/FooterToolbar/demo/basic.md b/app/web/src/components/FooterToolbar/demo/basic.md
deleted file mode 100644
index 3043dbf7..00000000
--- a/app/web/src/components/FooterToolbar/demo/basic.md
+++ /dev/null
@@ -1,44 +0,0 @@
----
-order: 0
-title:
- zh-CN: 演示
- en-US: demo
-iframe: 400
----
-
-## zh-CN
-
-浮动固定页脚。
-
-## en-US
-
-Fixed to the footer.
-
-````jsx
-import FooterToolbar from 'ant-design-pro/lib/FooterToolbar';
-import { Button } from 'antd';
-
-ReactDOM.render(
-
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
- Cancel
- Submit
-
-
-, mountNode);
-````
\ No newline at end of file
diff --git a/app/web/src/components/FooterToolbar/index.d.ts b/app/web/src/components/FooterToolbar/index.d.ts
deleted file mode 100644
index 9c6ac5b4..00000000
--- a/app/web/src/components/FooterToolbar/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import * as React from 'react';
-export interface IFooterToolbarProps {
- extra: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class FooterToolbar extends React.Component {}
diff --git a/app/web/src/components/FooterToolbar/index.en-US.md b/app/web/src/components/FooterToolbar/index.en-US.md
deleted file mode 100644
index 69fd80bd..00000000
--- a/app/web/src/components/FooterToolbar/index.en-US.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: FooterToolbar
-cols: 1
-order: 6
----
-
-A toolbar fixed at the bottom.
-
-## Usage
-
-It is fixed at the bottom of the content area and does not move along with the scroll bar, which is usually used for data collection and submission for long pages.
-
-## API
-
-Property | Description | Type | Default
----------|-------------|------|--------
-children | toolbar content, align to the right | ReactNode | -
-extra | extra information, align to the left | ReactNode | -
\ No newline at end of file
diff --git a/app/web/src/components/FooterToolbar/index.js b/app/web/src/components/FooterToolbar/index.js
deleted file mode 100644
index d43f72fb..00000000
--- a/app/web/src/components/FooterToolbar/index.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-import styles from './index.less';
-
-export default class FooterToolbar extends Component {
- static contextTypes = {
- isMobile: PropTypes.bool,
- };
-
- state = {
- width: undefined,
- };
-
- componentDidMount() {
- window.addEventListener('resize', this.resizeFooterToolbar);
- this.resizeFooterToolbar();
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resizeFooterToolbar);
- }
-
- resizeFooterToolbar = () => {
- const sider = document.querySelector('.ant-layout-sider');
- if (sider == null) {
- return;
- }
- const { isMobile } = this.context;
- const width = isMobile ? null : `calc(100% - ${sider.style.width})`;
- const { width: stateWidth } = this.state;
- if (stateWidth !== width) {
- this.setState({ width });
- }
- };
-
- render() {
- const { children, className, extra, ...restProps } = this.props;
- const { width } = this.state;
- return (
-
- );
- }
-}
diff --git a/app/web/src/components/FooterToolbar/index.less b/app/web/src/components/FooterToolbar/index.less
deleted file mode 100644
index de6606bd..00000000
--- a/app/web/src/components/FooterToolbar/index.less
+++ /dev/null
@@ -1,33 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.toolbar {
- position: fixed;
- width: 100%;
- bottom: 0;
- right: 0;
- height: 56px;
- line-height: 56px;
- box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
- background: #fff;
- border-top: 1px solid @border-color-split;
- padding: 0 24px;
- z-index: 9;
-
- &:after {
- content: '';
- display: block;
- clear: both;
- }
-
- .left {
- float: left;
- }
-
- .right {
- float: right;
- }
-
- button + button {
- margin-left: 8px;
- }
-}
diff --git a/app/web/src/components/FooterToolbar/index.zh-CN.md b/app/web/src/components/FooterToolbar/index.zh-CN.md
deleted file mode 100644
index 421ac08e..00000000
--- a/app/web/src/components/FooterToolbar/index.zh-CN.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: FooterToolbar
-subtitle: 底部工具栏
-cols: 1
-order: 6
----
-
-固定在底部的工具栏。
-
-## 何时使用
-
-固定在内容区域的底部,不随滚动条移动,常用于长页面的数据搜集和提交工作。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-children | 工具栏内容,向右对齐 | ReactNode | -
-extra | 额外信息,向左对齐 | ReactNode | -
diff --git a/app/web/src/components/GlobalFooter/demo/basic.md b/app/web/src/components/GlobalFooter/demo/basic.md
deleted file mode 100644
index 9a06bade..00000000
--- a/app/web/src/components/GlobalFooter/demo/basic.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-order: 0
-title: 演示
-iframe: 400
----
-
-基本页脚。
-
-````jsx
-import GlobalFooter from 'ant-design-pro/lib/GlobalFooter';
-import { Icon } from 'antd';
-
-const links = [{
- key: '帮助',
- title: '帮助',
- href: '',
-}, {
- key: 'github',
- title: ,
- href: 'https://github.com/ant-design/ant-design-pro',
- blankTarget: true,
-}, {
- key: '条款',
- title: '条款',
- href: '',
- blankTarget: true,
-}];
-
-const copyright = Copyright 2017 蚂蚁金服体验技术部出品
;
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/GlobalFooter/index.d.ts b/app/web/src/components/GlobalFooter/index.d.ts
deleted file mode 100644
index 3fa5c423..00000000
--- a/app/web/src/components/GlobalFooter/index.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as React from 'react';
-export interface IGlobalFooterProps {
- links?: Array<{
- key?: string;
- title: React.ReactNode;
- href: string;
- blankTarget?: boolean;
- }>;
- copyright?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class GlobalFooter extends React.Component {}
diff --git a/app/web/src/components/GlobalFooter/index.js b/app/web/src/components/GlobalFooter/index.js
deleted file mode 100644
index 1c2fb74e..00000000
--- a/app/web/src/components/GlobalFooter/index.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const GlobalFooter = ({ className, links, copyright }) => {
- const clsString = classNames(styles.globalFooter, className);
- return (
-
- {links && (
-
- )}
- {copyright && {copyright}
}
-
- );
-};
-
-export default GlobalFooter;
diff --git a/app/web/src/components/GlobalFooter/index.less b/app/web/src/components/GlobalFooter/index.less
deleted file mode 100644
index 101dcf04..00000000
--- a/app/web/src/components/GlobalFooter/index.less
+++ /dev/null
@@ -1,29 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.globalFooter {
- padding: 0 16px;
- margin: 48px 0 24px 0;
- text-align: center;
-
- .links {
- margin-bottom: 8px;
-
- a {
- color: @text-color-secondary;
- transition: all 0.3s;
-
- &:not(:last-child) {
- margin-right: 40px;
- }
-
- &:hover {
- color: @text-color;
- }
- }
- }
-
- .copyright {
- color: @text-color-secondary;
- font-size: @font-size-base;
- }
-}
diff --git a/app/web/src/components/GlobalFooter/index.md b/app/web/src/components/GlobalFooter/index.md
deleted file mode 100644
index 55b4be46..00000000
--- a/app/web/src/components/GlobalFooter/index.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title:
- en-US: GlobalFooter
- zh-CN: GlobalFooter
-subtitle: 全局页脚
-cols: 1
-order: 7
----
-
-页脚属于全局导航的一部分,作为对顶部导航的补充,通过传递数据控制展示内容。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-links | 链接数据 | array<{ title: ReactNode, href: string, blankTarget?: boolean }> | -
-copyright | 版权信息 | ReactNode | -
diff --git a/app/web/src/components/GlobalHeader/RightContent.js b/app/web/src/components/GlobalHeader/RightContent.js
deleted file mode 100644
index c8d32c2a..00000000
--- a/app/web/src/components/GlobalHeader/RightContent.js
+++ /dev/null
@@ -1,161 +0,0 @@
-import React, { PureComponent } from 'react';
-import { FormattedMessage, formatMessage } from 'umi';
-import { Spin, Tag, Menu, Icon, Dropdown, Avatar, Tooltip } from 'antd';
-import moment from 'moment';
-import groupBy from 'lodash/groupBy';
-import NoticeIcon from '../NoticeIcon';
-import HeaderSearch from '../HeaderSearch';
-import SelectLang from '../SelectLang';
-import styles from './index.less';
-
-export default class GlobalHeaderRight extends PureComponent {
- getNoticeData() {
- const { notices = [] } = this.props;
- if (notices.length === 0) {
- return {};
- }
- const newNotices = notices.map(notice => {
- const newNotice = { ...notice };
- if (newNotice.datetime) {
- newNotice.datetime = moment(notice.datetime).fromNow();
- }
- if (newNotice.id) {
- newNotice.key = newNotice.id;
- }
- if (newNotice.extra && newNotice.status) {
- const color = {
- todo: '',
- processing: 'blue',
- urgent: 'red',
- doing: 'gold',
- }[newNotice.status];
- newNotice.extra = (
-
- {newNotice.extra}
-
- );
- }
- return newNotice;
- });
- return groupBy(newNotices, 'type');
- }
-
- render() {
- const {
- currentUser,
- fetchingNotices,
- onNoticeVisibleChange,
- onMenuClick,
- onNoticeClear,
- theme,
- } = this.props;
- const menu = (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- const noticeData = this.getNoticeData();
- let className = styles.right;
- if (theme === 'dark') {
- className = `${styles.right} ${styles.dark}`;
- }
- return (
-
-
{
- console.log('input', value); // eslint-disable-line
- }}
- onPressEnter={value => {
- console.log('enter', value); // eslint-disable-line
- }}
- />
-
-
-
-
-
- {
- console.log(item, tabProps); // eslint-disable-line
- }}
- locale={{
- emptyText: formatMessage({ id: 'component.noticeIcon.empty' }),
- clear: formatMessage({ id: 'component.noticeIcon.clear' }),
- }}
- onClear={onNoticeClear}
- onPopupVisibleChange={onNoticeVisibleChange}
- loading={fetchingNotices}
- popupAlign={{ offset: [20, -16] }}
- >
-
-
-
-
- {currentUser.name ? (
-
-
-
- {currentUser.name}
-
-
- ) : (
-
- )}
-
-
- );
- }
-}
diff --git a/app/web/src/components/GlobalHeader/index.js b/app/web/src/components/GlobalHeader/index.js
deleted file mode 100644
index dee43270..00000000
--- a/app/web/src/components/GlobalHeader/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Icon } from 'antd';
-import {Link} from 'umi';
-import Debounce from 'lodash-decorators/debounce';
-import styles from './index.less';
-import RightContent from './RightContent';
-
-export default class GlobalHeader extends PureComponent {
- componentWillUnmount() {
- this.triggerResizeEvent.cancel();
- }
- /* eslint-disable*/
- @Debounce(600)
- triggerResizeEvent() {
- // eslint-disable-line
- const event = document.createEvent('HTMLEvents');
- event.initEvent('resize', true, false);
- window.dispatchEvent(event);
- }
- toggle = () => {
- const { collapsed, onCollapse } = this.props;
- onCollapse(!collapsed);
- this.triggerResizeEvent();
- };
- render() {
- const { collapsed, isMobile, logo } = this.props;
- return (
-
- {isMobile && (
-
-
-
- )}
-
-
-
- );
- }
-}
diff --git a/app/web/src/components/GlobalHeader/index.less b/app/web/src/components/GlobalHeader/index.less
deleted file mode 100644
index 5ed7fbaf..00000000
--- a/app/web/src/components/GlobalHeader/index.less
+++ /dev/null
@@ -1,129 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-@pro-header-hover-bg: rgba(0, 0, 0, 0.025);
-
-.header {
- height: 64px;
- padding: 0;
- background: #fff;
- box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
- position: relative;
-}
-
-.logo {
- height: 64px;
- line-height: 58px;
- vertical-align: top;
- display: inline-block;
- padding: 0 0 0 24px;
- cursor: pointer;
- font-size: 20px;
- img {
- display: inline-block;
- vertical-align: middle;
- }
-}
-
-.menu {
- :global(.anticon) {
- margin-right: 8px;
- }
- :global(.ant-dropdown-menu-item) {
- width: 160px;
- }
-}
-
-i.trigger {
- font-size: 20px;
- height: 64px;
- cursor: pointer;
- transition: all 0.3s, padding 0s;
- padding: 22px 24px;
- &:hover {
- background: @pro-header-hover-bg;
- }
-}
-
-.right {
- float: right;
- height: 100%;
- overflow: hidden;
- .action {
- cursor: pointer;
- padding: 0 12px;
- display: inline-block;
- transition: all 0.3s;
- height: 100%;
- > i {
- vertical-align: middle;
- color: @text-color;
- }
- &:hover {
- background: @pro-header-hover-bg;
- }
- :global(&.ant-popover-open) {
- background: @pro-header-hover-bg;
- }
- }
- .search {
- padding: 0 12px;
- &:hover {
- background: transparent;
- }
- }
- .account {
- .avatar {
- margin: 20px 8px 20px 0;
- color: @primary-color;
- background: rgba(255, 255, 255, 0.85);
- vertical-align: top;
- }
- }
-}
-
-.dark {
- height: 64px;
- .action {
- color: rgba(255, 255, 255, 0.85);
- > i {
- color: rgba(255, 255, 255, 0.85);
- }
- &:hover,
- &:global(.ant-popover-open) {
- background: @primary-color;
- }
- :global(.ant-badge) {
- color: rgba(255, 255, 255, 0.85);
- }
- }
-}
-
-@media only screen and (max-width: @screen-md) {
- .header {
- :global(.ant-divider-vertical) {
- vertical-align: unset;
- }
- .name {
- display: none;
- }
- i.trigger {
- padding: 22px 12px;
- }
- .logo {
- padding-left: 12px;
- padding-right: 12px;
- position: relative;
- }
- .right {
- position: absolute;
- right: 12px;
- top: 0;
- background: #fff;
- .account {
- .avatar {
- margin-right: 0;
- }
- }
- }
- }
-}
diff --git a/app/web/src/components/HeaderSearch/demo/basic.md b/app/web/src/components/HeaderSearch/demo/basic.md
deleted file mode 100644
index 2139207c..00000000
--- a/app/web/src/components/HeaderSearch/demo/basic.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-order: 0
-title: 全局搜索
----
-
-通常放置在导航工具条右侧。(点击搜索图标预览效果)
-
-````jsx
-import HeaderSearch from 'ant-design-pro/lib/HeaderSearch';
-
-ReactDOM.render(
-
- {
- console.log('input', value); // eslint-disable-line
- }}
- onPressEnter={(value) => {
- console.log('enter', value); // eslint-disable-line
- }}
- />
-
-, mountNode);
-````
diff --git a/app/web/src/components/HeaderSearch/index.d.ts b/app/web/src/components/HeaderSearch/index.d.ts
deleted file mode 100644
index d78fde47..00000000
--- a/app/web/src/components/HeaderSearch/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IHeaderSearchProps {
- placeholder?: string;
- dataSource?: string[];
- defaultOpen?: boolean;
- open?: boolean;
- onSearch?: (value: string) => void;
- onChange?: (value: string) => void;
- onVisibleChange?: (visible: boolean) => void;
- onPressEnter?: (value: string) => void;
- style?: React.CSSProperties;
- className?: string;
-}
-
-export default class HeaderSearch extends React.Component {}
diff --git a/app/web/src/components/HeaderSearch/index.en-US.md b/app/web/src/components/HeaderSearch/index.en-US.md
deleted file mode 100644
index a1cf841f..00000000
--- a/app/web/src/components/HeaderSearch/index.en-US.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title:
- en-US: HeaderSearch
- zh-CN: HeaderSearch
-subtitle: Top search box
-cols: 1
-order: 8
----
-
-Usually placed as an entry to the global search, placed on the right side of the navigation toolbar.
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-placeholder | placeholder text | string | -
-dataSource | current list of prompts | string[] | -
-onSearch | Callback when selecting an item or pressing Enter | function(value) | -
-onChange | Enter a callback for the search text | function(value) | -
-onPressEnter | Callback when pressing Enter | function(value) | -
-onVisibleChange | Show or hide the callback of the text box | function(value) |-
-defaultOpen | The input box is displayed for the first time. | boolean | false
-open | The input box is displayed | booelan |false
\ No newline at end of file
diff --git a/app/web/src/components/HeaderSearch/index.js b/app/web/src/components/HeaderSearch/index.js
deleted file mode 100644
index 95d946c0..00000000
--- a/app/web/src/components/HeaderSearch/index.js
+++ /dev/null
@@ -1,140 +0,0 @@
-import React, { PureComponent } from 'react';
-import PropTypes from 'prop-types';
-import { Input, Icon, AutoComplete } from 'antd';
-import classNames from 'classnames';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import styles from './index.less';
-
-export default class HeaderSearch extends PureComponent {
- static propTypes = {
- className: PropTypes.string,
- placeholder: PropTypes.string,
- onSearch: PropTypes.func,
- onPressEnter: PropTypes.func,
- defaultActiveFirstOption: PropTypes.bool,
- dataSource: PropTypes.array,
- defaultOpen: PropTypes.bool,
- onVisibleChange: PropTypes.func,
- };
-
- static defaultProps = {
- defaultActiveFirstOption: false,
- onPressEnter: () => {},
- onSearch: () => {},
- className: '',
- placeholder: '',
- dataSource: [],
- defaultOpen: false,
- onVisibleChange: () => {},
- };
-
- static getDerivedStateFromProps(props) {
- if ('open' in props) {
- return {
- searchMode: props.open,
- };
- }
- return null;
- }
-
- constructor(props) {
- super(props);
- this.state = {
- searchMode: props.defaultOpen,
- value: '',
- };
- }
-
- componentWillUnmount() {
- clearTimeout(this.timeout);
- }
-
- onKeyDown = e => {
- if (e.key === 'Enter') {
- const { onPressEnter } = this.props;
- const { value } = this.state;
- this.timeout = setTimeout(() => {
- onPressEnter(value); // Fix duplicate onPressEnter
- }, 0);
- }
- };
-
- onChange = value => {
- const { onChange } = this.props;
- this.setState({ value });
- if (onChange) {
- onChange(value);
- }
- };
-
- enterSearchMode = () => {
- const { onVisibleChange } = this.props;
- onVisibleChange(true);
- this.setState({ searchMode: true }, () => {
- const { searchMode } = this.state;
- if (searchMode) {
- this.input.focus();
- }
- });
- };
-
- leaveSearchMode = () => {
- this.setState({
- searchMode: false,
- value: '',
- });
- };
-
- // NOTE: 不能小于500,如果长按某键,第一次触发auto repeat的间隔是500ms,小于500会导致触发2次
- @Bind()
- @Debounce(500, {
- leading: true,
- trailing: false,
- })
- debouncePressEnter() {
- const { onPressEnter } = this.props;
- const { value } = this.state;
- onPressEnter(value);
- }
-
- render() {
- const { className, placeholder, open, ...restProps } = this.props;
- const { searchMode, value } = this.state;
- delete restProps.defaultOpen; // for rc-select not affected
- const inputClass = classNames(styles.input, {
- [styles.show]: searchMode,
- });
- return (
- {
- if (propertyName === 'width' && !searchMode) {
- const { onVisibleChange } = this.props;
- onVisibleChange(searchMode);
- }
- }}
- >
-
-
- {
- this.input = node;
- }}
- aria-label={placeholder}
- placeholder={placeholder}
- onKeyDown={this.onKeyDown}
- onBlur={this.leaveSearchMode}
- />
-
-
- );
- }
-}
diff --git a/app/web/src/components/HeaderSearch/index.less b/app/web/src/components/HeaderSearch/index.less
deleted file mode 100644
index e97386d8..00000000
--- a/app/web/src/components/HeaderSearch/index.less
+++ /dev/null
@@ -1,32 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.headerSearch {
- :global(.anticon-search) {
- cursor: pointer;
- font-size: 16px;
- }
- .input {
- transition: width 0.3s, margin-left 0.3s;
- width: 0;
- background: transparent;
- border-radius: 0;
- :global(.ant-select-selection) {
- background: transparent;
- }
- input {
- border: 0;
- padding-left: 0;
- padding-right: 0;
- box-shadow: none !important;
- }
- &,
- &:hover,
- &:focus {
- border-bottom: 1px solid @border-color-base;
- }
- &.show {
- width: 210px;
- margin-left: 8px;
- }
- }
-}
diff --git a/app/web/src/components/HeaderSearch/index.zh-CN.md b/app/web/src/components/HeaderSearch/index.zh-CN.md
deleted file mode 100644
index a9a04754..00000000
--- a/app/web/src/components/HeaderSearch/index.zh-CN.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title:
- en-US: HeaderSearch
- zh-CN: HeaderSearch
-subtitle: 顶部搜索框
-cols: 1
-order: 8
----
-
-通常作为全局搜索的入口,放置在导航工具条右侧。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-placeholder | 占位文字 | string | -
-dataSource | 当前提示内容列表 | string[] | -
-onSearch | 选择某项或按下回车时的回调 | function(value) | -
-onChange | 输入搜索字符的回调 | function(value) | -
-onPressEnter | 按下回车时的回调 | function(value) | -
-onVisibleChange | 显示或隐藏文本框的回调 | function(value) |-
-defaultOpen | 输入框首次显示是否显示 | boolean | false
-open | 控制输入框是否显示 | booelan |false
\ No newline at end of file
diff --git a/app/web/src/components/Login/LoginItem.js b/app/web/src/components/Login/LoginItem.js
deleted file mode 100644
index cc32ec1d..00000000
--- a/app/web/src/components/Login/LoginItem.js
+++ /dev/null
@@ -1,145 +0,0 @@
-import React, { Component } from 'react';
-import { Form, Input, Button, Row, Col } from 'antd';
-import omit from 'omit.js';
-import styles from './index.less';
-import ItemMap from './map';
-import LoginContext from './loginContext';
-
-const FormItem = Form.Item;
-
-class WrapFormItem extends Component {
- static defaultProps = {
- buttonText: '获取验证码',
- };
-
- constructor(props) {
- super(props);
- this.state = {
- count: 0,
- };
- }
-
- componentDidMount() {
- const { updateActive, name } = this.props;
- if (updateActive) {
- updateActive(name);
- }
- }
-
- componentWillUnmount() {
- clearInterval(this.interval);
- }
-
- onGetCaptcha = () => {
- const { onGetCaptcha } = this.props;
- const result = onGetCaptcha ? onGetCaptcha() : null;
- if (result === false) {
- return;
- }
- if (result instanceof Promise) {
- result.then(this.runGetCaptchaCountDown);
- } else {
- this.runGetCaptchaCountDown();
- }
- };
-
- getFormItemOptions = ({ onChange, defaultValue, customprops, rules }) => {
- const options = {
- rules: rules || customprops.rules,
- };
- if (onChange) {
- options.onChange = onChange;
- }
- if (defaultValue) {
- options.initialValue = defaultValue;
- }
- return options;
- };
-
- runGetCaptchaCountDown = () => {
- const { countDown } = this.props;
- let count = countDown || 59;
- this.setState({ count });
- this.interval = setInterval(() => {
- count -= 1;
- this.setState({ count });
- if (count === 0) {
- clearInterval(this.interval);
- }
- }, 1000);
- };
-
- render() {
- const { count } = this.state;
-
- const {
- form: { getFieldDecorator },
- } = this.props;
-
- // 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props
- const {
- onChange,
- customprops,
- defaultValue,
- rules,
- name,
- buttonText,
- updateActive,
- type,
- ...restProps
- } = this.props;
-
- // get getFieldDecorator props
- const options = this.getFormItemOptions(this.props);
-
- const otherProps = restProps || {};
- if (type === 'Captcha') {
- const inputProps = omit(otherProps, ['onGetCaptcha', 'countDown']);
- return (
-
-
-
- {getFieldDecorator(name, options)( )}
-
-
-
- {count ? `${count} s` : buttonText}
-
-
-
-
- );
- }
- return (
-
- {getFieldDecorator(name, options)( )}
-
- );
- }
-}
-
-const LoginItem = {};
-Object.keys(ItemMap).forEach(key => {
- const item = ItemMap[key];
- LoginItem[key] = props => (
-
- {context => (
-
- )}
-
- );
-});
-
-export default LoginItem;
diff --git a/app/web/src/components/Login/LoginSubmit.js b/app/web/src/components/Login/LoginSubmit.js
deleted file mode 100644
index 4aebabf8..00000000
--- a/app/web/src/components/Login/LoginSubmit.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { Button, Form } from 'antd';
-import styles from './index.less';
-
-const FormItem = Form.Item;
-
-const LoginSubmit = ({ className, ...rest }) => {
- const clsString = classNames(styles.submit, className);
- return (
-
-
-
- );
-};
-
-export default LoginSubmit;
diff --git a/app/web/src/components/Login/LoginTab.js b/app/web/src/components/Login/LoginTab.js
deleted file mode 100644
index 7c46db53..00000000
--- a/app/web/src/components/Login/LoginTab.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React, { Component } from 'react';
-import { Tabs } from 'antd';
-import LoginContext from './loginContext';
-
-const { TabPane } = Tabs;
-
-const generateId = (() => {
- let i = 0;
- return (prefix = '') => {
- i += 1;
- return `${prefix}${i}`;
- };
-})();
-
-class LoginTab extends Component {
- constructor(props) {
- super(props);
- this.uniqueId = generateId('login-tab-');
- }
-
- componentDidMount() {
- const { tabUtil } = this.props;
- tabUtil.addTab(this.uniqueId);
- }
-
- render() {
- const { children } = this.props;
- return {children} ;
- }
-}
-
-const wrapContext = props => (
-
- {value => }
-
-);
-
-// 标志位 用来判断是不是自定义组件
-wrapContext.typeName = 'LoginTab';
-
-export default wrapContext;
diff --git a/app/web/src/components/Login/demo/basic.md b/app/web/src/components/Login/demo/basic.md
deleted file mode 100644
index 5fbd0ca2..00000000
--- a/app/web/src/components/Login/demo/basic.md
+++ /dev/null
@@ -1,115 +0,0 @@
----
-order: 0
-title:
- zh-CN: 标准登录
- en-US: Standard Login
----
-
-Support login with account and mobile number.
-
-````jsx
-import Login from 'ant-design-pro/lib/Login';
-import { Alert, Checkbox } from 'antd';
-
-const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
-
-class LoginDemo extends React.Component {
- state = {
- notice: '',
- type: 'tab2',
- autoLogin: true,
- }
- onSubmit = (err, values) => {
- console.log('value collected ->', { ...values, autoLogin: this.state.autoLogin });
- if (this.state.type === 'tab1') {
- this.setState({
- notice: '',
- }, () => {
- if (!err && (values.username !== 'admin' || values.password !== '888888')) {
- setTimeout(() => {
- this.setState({
- notice: 'The combination of username and password is incorrect!',
- });
- }, 500);
- }
- });
- }
- }
- onTabChange = (key) => {
- this.setState({
- type: key,
- });
- }
- changeAutoLogin = (e) => {
- this.setState({
- autoLogin: e.target.checked,
- });
- }
- render() {
- return (
-
-
- {
- this.state.notice &&
-
- }
-
-
-
-
-
- console.log('Get captcha!')} name="captcha" />
-
-
- Login
-
- Other login methods
-
-
-
-
Register
-
-
- );
- }
-}
-
-ReactDOM.render( , mountNode);
-````
-
-
diff --git a/app/web/src/components/Login/index.d.ts b/app/web/src/components/Login/index.d.ts
deleted file mode 100644
index 9c072867..00000000
--- a/app/web/src/components/Login/index.d.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import * as React from 'react';
-import Button from 'antd/lib/button';
-export interface LoginProps {
- defaultActiveKey?: string;
- onTabChange?: (key: string) => void;
- style?: React.CSSProperties;
- onSubmit?: (error: any, values: any) => void;
-}
-
-export interface TabProps {
- key?: string;
- tab?: React.ReactNode;
-}
-export class Tab extends React.Component {}
-
-export interface LoginItemProps {
- name?: string;
- rules?: any[];
- style?: React.CSSProperties;
- onGetCaptcha?: () => void;
- placeholder?: string;
- buttonText?: React.ReactNode;
-}
-
-export class LoginItem extends React.Component {}
-
-export default class Login extends React.Component {
- static Tab: typeof Tab;
- static UserName: typeof LoginItem;
- static Password: typeof LoginItem;
- static Mobile: typeof LoginItem;
- static Captcha: typeof LoginItem;
- static Submit: typeof Button;
-}
diff --git a/app/web/src/components/Login/index.en-US.md b/app/web/src/components/Login/index.en-US.md
deleted file mode 100644
index 3b5992e2..00000000
--- a/app/web/src/components/Login/index.en-US.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-title: Login
-cols: 1
-order: 15
----
-
-Support multiple common ways of login with built-in controls. You can choose your own combinations and use with your custom controls.
-
-## API
-
-### Login
-
-Property | Description | Type | Default
-----|------|-----|------
-defaultActiveKey | default key to activate the tab panel | String | -
-onTabChange | callback on changing tabs | (key) => void | -
-onSubmit | callback on submit | (err, values) => void | -
-
-### Login.Tab
-
-Property | Description | Type | Default
-----|------|-----|------
-key | key of the tab | String | -
-tab | displayed text of the tab | ReactNode | -
-
-### Login.UserName
-
-Property | Description | Type | Default
-----|------|-----|------
-name | name of the control, also the key of the submitted data | String | -
-rules | validation rules, same with [option.rules](getFieldDecorator(id, options)) in Form getFieldDecorator(id, options) | object[] | -
-
-Apart from the above properties, Login.Username also support all properties of antd.Input, together with the default values of basic settings, such as _placeholder_, _size_ and _prefix_. All of these default values can be over-written.
-
-### Login.Password, Login.Mobile are the same as Login.UserName
-
-### Login.Captcha
-
-Property | Description | Type | Default
-----|------|-----|------
-onGetCaptcha | callback on getting a new Captcha | () => (void \| false \| Promise) | -
-countDown | count down | number |-
-buttonText | text on getting a new Captcha | ReactNode | '获取验证码'
-
-Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_.
-
-### Login.Submit
-
-Support all properties of _antd.Button_.
\ No newline at end of file
diff --git a/app/web/src/components/Login/index.js b/app/web/src/components/Login/index.js
deleted file mode 100644
index 5ddb70c7..00000000
--- a/app/web/src/components/Login/index.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { Form, Tabs } from 'antd';
-import classNames from 'classnames';
-import LoginItem from './LoginItem';
-import LoginTab from './LoginTab';
-import LoginSubmit from './LoginSubmit';
-import styles from './index.less';
-import LoginContext from './loginContext';
-
-class Login extends Component {
- static propTypes = {
- className: PropTypes.string,
- defaultActiveKey: PropTypes.string,
- onTabChange: PropTypes.func,
- onSubmit: PropTypes.func,
- };
-
- static defaultProps = {
- className: '',
- defaultActiveKey: '',
- onTabChange: () => {},
- onSubmit: () => {},
- };
-
- constructor(props) {
- super(props);
- this.state = {
- type: props.defaultActiveKey,
- tabs: [],
- active: {},
- };
- }
-
- onSwitch = type => {
- this.setState({
- type,
- });
- const { onTabChange } = this.props;
- onTabChange(type);
- };
-
- getContext = () => {
- const { tabs } = this.state;
- const { form } = this.props;
- return {
- tabUtil: {
- addTab: id => {
- this.setState({
- tabs: [...tabs, id],
- });
- },
- removeTab: id => {
- this.setState({
- tabs: tabs.filter(currentId => currentId !== id),
- });
- },
- },
- form,
- updateActive: activeItem => {
- const { type, active } = this.state;
- if (active[type]) {
- active[type].push(activeItem);
- } else {
- active[type] = [activeItem];
- }
- this.setState({
- active,
- });
- },
- };
- };
-
- handleSubmit = e => {
- e.preventDefault();
- const { active, type } = this.state;
- const { form, onSubmit } = this.props;
- const activeFileds = active[type];
- form.validateFields(activeFileds, { force: true }, (err, values) => {
- onSubmit(err, values);
- });
- };
-
- render() {
- const { className, children } = this.props;
- const { type, tabs } = this.state;
- const TabChildren = [];
- const otherChildren = [];
- React.Children.forEach(children, item => {
- if (!item) {
- return;
- }
- // eslint-disable-next-line
- if (item.type.typeName === 'LoginTab') {
- TabChildren.push(item);
- } else {
- otherChildren.push(item);
- }
- });
- return (
-
-
-
-
-
- );
- }
-}
-
-Login.Tab = LoginTab;
-Login.Submit = LoginSubmit;
-Object.keys(LoginItem).forEach(item => {
- Login[item] = LoginItem[item];
-});
-
-export default Form.create()(Login);
diff --git a/app/web/src/components/Login/index.less b/app/web/src/components/Login/index.less
deleted file mode 100644
index 995b68d2..00000000
--- a/app/web/src/components/Login/index.less
+++ /dev/null
@@ -1,48 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.login {
- :global {
- .ant-tabs .ant-tabs-bar {
- border-bottom: 0;
- margin-bottom: 24px;
- text-align: center;
- }
-
- .ant-form-item {
- margin: 0 2px 24px;
- }
- }
-
- .icon {
- font-size: 24px;
- color: rgba(0, 0, 0, 0.2);
- margin-left: 16px;
- vertical-align: middle;
- cursor: pointer;
- transition: color 0.3s;
-
- &:hover {
- color: @primary-color;
- }
- }
-
- .other {
- text-align: left;
- margin-top: 24px;
- line-height: 22px;
-
- .register {
- float: right;
- }
- }
-
- .prefixIcon {
- font-size: @font-size-base;
- color: @disabled-color;
- }
-
- .submit {
- width: 100%;
- margin-top: 24px;
- }
-}
diff --git a/app/web/src/components/Login/index.zh-CN.md b/app/web/src/components/Login/index.zh-CN.md
deleted file mode 100644
index a869e96c..00000000
--- a/app/web/src/components/Login/index.zh-CN.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-title: Login
-subtitle: 登录
-cols: 1
-order: 15
----
-
-支持多种登录方式切换,内置了几种常见的登录控件,可以灵活组合,也支持和自定义控件配合使用。
-
-## API
-
-### Login
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-defaultActiveKey | 默认激活 tab 面板的 key | String | -
-onTabChange | 切换页签时的回调 | (key) => void | -
-onSubmit | 点击提交时的回调 | (err, values) => void | -
-
-### Login.Tab
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-key | 对应选项卡的 key | String | -
-tab | 选项卡头显示文字 | ReactNode | -
-
-### Login.UserName
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-name | 控件标记,提交数据中同样以此为 key | String | -
-rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules 的规则](getFieldDecorator(id, options)) | object[] | -
-
-除上述属性以外,Login.UserName 还支持 antd.Input 的所有属性,并且自带默认的基础配置,包括 `placeholder` `size` `prefix` 等,这些基础配置均可被覆盖。
-## Login.Password、Login.Mobile 同 Login.UserName
-
-### Login.Captcha
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-onGetCaptcha | 点击获取校验码的回调 | () => (void \| false \| Promise) | -
-countDown | 倒计时 | number |-
-buttonText | 点击获取校验码的说明文字 | ReactNode | '获取验证码'
-
-除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。
-
-### Login.Submit
-
-支持 antd.Button 的所有属性。
diff --git a/app/web/src/components/Login/loginContext.js b/app/web/src/components/Login/loginContext.js
deleted file mode 100644
index a13e6599..00000000
--- a/app/web/src/components/Login/loginContext.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { createContext } from 'react';
-
-const LoginContext = createContext();
-export default LoginContext;
diff --git a/app/web/src/components/Login/map.js b/app/web/src/components/Login/map.js
deleted file mode 100644
index 72e547c2..00000000
--- a/app/web/src/components/Login/map.js
+++ /dev/null
@@ -1,63 +0,0 @@
-import React from 'react';
-import { Icon } from 'antd';
-import styles from './index.less';
-
-export default {
- UserName: {
- props: {
- size: 'large',
- prefix: ,
- placeholder: 'admin',
- },
- rules: [
- {
- required: true,
- message: 'Please enter username!',
- },
- ],
- },
- Password: {
- props: {
- size: 'large',
- prefix: ,
- type: 'password',
- placeholder: '888888',
- },
- rules: [
- {
- required: true,
- message: 'Please enter password!',
- },
- ],
- },
- Mobile: {
- props: {
- size: 'large',
- prefix: ,
- placeholder: 'mobile number',
- },
- rules: [
- {
- required: true,
- message: 'Please enter mobile number!',
- },
- {
- pattern: /^1\d{10}$/,
- message: 'Wrong mobile number format!',
- },
- ],
- },
- Captcha: {
- props: {
- size: 'large',
- prefix: ,
- placeholder: 'captcha',
- },
- rules: [
- {
- required: true,
- message: 'Please enter Captcha!',
- },
- ],
- },
-};
diff --git a/app/web/src/components/NoticeIcon/NoticeIconTab.d.ts b/app/web/src/components/NoticeIcon/NoticeIconTab.d.ts
deleted file mode 100644
index 061cdb6d..00000000
--- a/app/web/src/components/NoticeIcon/NoticeIconTab.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import * as React from 'react';
-export interface INoticeIconData {
- avatar?: string|React.ReactNode;
- title?: React.ReactNode;
- description?: React.ReactNode;
- datetime?: React.ReactNode;
- extra?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export interface INoticeIconTabProps {
- list?: INoticeIconData[];
- title?: string;
- name?: string;
- emptyText?: React.ReactNode;
- emptyImage?: string;
- style?: React.CSSProperties;
- showClear?: boolean;
-}
-
-export default class NoticeIconTab extends React.Component {}
diff --git a/app/web/src/components/NoticeIcon/NoticeList.js b/app/web/src/components/NoticeIcon/NoticeList.js
deleted file mode 100644
index d0de9af5..00000000
--- a/app/web/src/components/NoticeIcon/NoticeList.js
+++ /dev/null
@@ -1,71 +0,0 @@
-import React from 'react';
-import { Avatar, List } from 'antd';
-import classNames from 'classnames';
-import styles from './NoticeList.less';
-
-export default function NoticeList({
- data = [],
- onClick,
- onClear,
- title,
- locale,
- emptyText,
- emptyImage,
- showClear = true,
-}) {
- if (data.length === 0) {
- return (
-
- {emptyImage ?
: null}
-
{emptyText || locale.emptyText}
-
- );
- }
- return (
-
-
- {data.map((item, i) => {
- const itemCls = classNames(styles.item, {
- [styles.read]: item.read,
- });
- // eslint-disable-next-line no-nested-ternary
- const leftIcon = item.avatar ? (
- typeof item.avatar === 'string' ? (
-
- ) : (
- item.avatar
- )
- ) : null;
-
- return (
- onClick(item)}>
- {leftIcon}}
- title={
-
- {item.title}
-
{item.extra}
-
- }
- description={
-
-
- {item.description}
-
-
{item.datetime}
-
- }
- />
-
- );
- })}
-
- {showClear ? (
-
- {locale.clear} {title}
-
- ) : null}
-
- );
-}
diff --git a/app/web/src/components/NoticeIcon/NoticeList.less b/app/web/src/components/NoticeIcon/NoticeList.less
deleted file mode 100644
index e34efdc9..00000000
--- a/app/web/src/components/NoticeIcon/NoticeList.less
+++ /dev/null
@@ -1,81 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.list {
- max-height: 400px;
- overflow: auto;
- .item {
- transition: all 0.3s;
- overflow: hidden;
- cursor: pointer;
- padding-left: 24px;
- padding-right: 24px;
-
- .meta {
- width: 100%;
- }
-
- .avatar {
- background: #fff;
- margin-top: 4px;
- }
- .iconElement {
- font-size: 32px;
- }
-
- &.read {
- opacity: 0.4;
- }
- &:last-child {
- border-bottom: 0;
- }
- &:hover {
- background: @primary-1;
- }
- .title {
- font-weight: normal;
- margin-bottom: 8px;
- }
- .description {
- font-size: 12px;
- line-height: @line-height-base;
- }
- .datetime {
- font-size: 12px;
- margin-top: 4px;
- line-height: @line-height-base;
- }
- .extra {
- float: right;
- color: @text-color-secondary;
- font-weight: normal;
- margin-right: 0;
- margin-top: -1.5px;
- }
- }
-}
-
-.notFound {
- text-align: center;
- padding: 73px 0 88px 0;
- color: @text-color-secondary;
- img {
- display: inline-block;
- margin-bottom: 16px;
- height: 76px;
- }
-}
-
-.clear {
- height: 46px;
- line-height: 46px;
- text-align: center;
- color: @text-color;
- border-radius: 0 0 @border-radius-base @border-radius-base;
- border-top: 1px solid @border-color-split;
- transition: all 0.3s;
- cursor: pointer;
-
- &:hover {
- color: @heading-color;
- }
-}
diff --git a/app/web/src/components/NoticeIcon/demo/basic.md b/app/web/src/components/NoticeIcon/demo/basic.md
deleted file mode 100644
index dc9afeaa..00000000
--- a/app/web/src/components/NoticeIcon/demo/basic.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-order: 1
-title: 通知图标
----
-
-通常用在导航工具栏上。
-
-````jsx
-import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
-
-ReactDOM.render( , mountNode);
-````
diff --git a/app/web/src/components/NoticeIcon/demo/popover.md b/app/web/src/components/NoticeIcon/demo/popover.md
deleted file mode 100644
index 6c047b7e..00000000
--- a/app/web/src/components/NoticeIcon/demo/popover.md
+++ /dev/null
@@ -1,176 +0,0 @@
----
-order: 2
-title: 带浮层卡片
----
-
-点击展开通知卡片,展现多种类型的通知,通常放在导航工具栏。
-
-````jsx
-import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
-import moment from 'moment';
-import groupBy from 'lodash/groupBy';
-import { Tag } from 'antd';
-
-const data = [{
- id: '000000001',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
- title: '你收到了 14 份新周报',
- datetime: '2017-08-09',
- type: '通知',
-}, {
- id: '000000002',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
- title: '你推荐的 曲妮妮 已通过第三轮面试',
- datetime: '2017-08-08',
- type: '通知',
-}, {
- id: '000000003',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
- title: '这种模板可以区分多种通知类型',
- datetime: '2017-08-07',
- read: true,
- type: '通知',
-}, {
- id: '000000004',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
- title: '左侧图标用于区分不同的类型',
- datetime: '2017-08-07',
- type: '通知',
-}, {
- id: '000000005',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
- title: '内容不要超过两行字,超出时自动截断',
- datetime: '2017-08-07',
- type: '通知',
-}, {
- id: '000000006',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
- title: '曲丽丽 评论了你',
- description: '描述信息描述信息描述信息',
- datetime: '2017-08-07',
- type: '消息',
-}, {
- id: '000000007',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
- title: '朱偏右 回复了你',
- description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
- datetime: '2017-08-07',
- type: '消息',
-}, {
- id: '000000008',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
- title: '标题',
- description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
- datetime: '2017-08-07',
- type: '消息',
-}, {
- id: '000000009',
- title: '任务名称',
- description: '任务需要在 2017-01-12 20:00 前启动',
- extra: '未开始',
- status: 'todo',
- type: '待办',
-}, {
- id: '000000010',
- title: '第三方紧急代码变更',
- description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
- extra: '马上到期',
- status: 'urgent',
- type: '待办',
-}, {
- id: '000000011',
- title: '信息安全考试',
- description: '指派竹尔于 2017-01-09 前完成更新并发布',
- extra: '已耗时 8 天',
- status: 'doing',
- type: '待办',
-}, {
- id: '000000012',
- title: 'ABCD 版本发布',
- description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
- extra: '进行中',
- status: 'processing',
- type: '待办',
-}];
-
-function onItemClick(item, tabProps) {
- console.log(item, tabProps);
-}
-
-function onClear(tabTitle) {
- console.log(tabTitle);
-}
-
-function getNoticeData(notices) {
- if (notices.length === 0) {
- return {};
- }
- const newNotices = notices.map((notice) => {
- const newNotice = { ...notice };
- if (newNotice.datetime) {
- newNotice.datetime = moment(notice.datetime).fromNow();
- }
- // transform id to item key
- if (newNotice.id) {
- newNotice.key = newNotice.id;
- }
- if (newNotice.extra && newNotice.status) {
- const color = ({
- todo: '',
- processing: 'blue',
- urgent: 'red',
- doing: 'gold',
- })[newNotice.status];
- newNotice.extra = {newNotice.extra} ;
- }
- return newNotice;
- });
- return groupBy(newNotices, 'type');
-}
-
-const noticeData = getNoticeData(data);
-
-ReactDOM.render(
-
-
-
-
-
-
-
-, mountNode);
-````
-
-```css
-
-```
diff --git a/app/web/src/components/NoticeIcon/index.d.ts b/app/web/src/components/NoticeIcon/index.d.ts
deleted file mode 100644
index 6f7c8c11..00000000
--- a/app/web/src/components/NoticeIcon/index.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as React from 'react';
-import NoticeIconTab, { INoticeIconData } from './NoticeIconTab';
-
-export interface INoticeIconProps {
- count?: number;
- bell?: React.ReactNode;
- className?: string;
- loading?: boolean;
- onClear?: (tabName: string) => void;
- onItemClick?: (item: INoticeIconData, tabProps: INoticeIconProps) => void;
- onTabChange?: (tabTile: string) => void;
- popupAlign?: {
- points?: [string, string];
- offset?: [number, number];
- targetOffset?: [number, number];
- overflow?: any;
- useCssRight?: boolean;
- useCssBottom?: boolean;
- useCssTransform?: boolean;
- };
- style?: React.CSSProperties;
- onPopupVisibleChange?: (visible: boolean) => void;
- popupVisible?: boolean;
- locale?: { emptyText: string; clear: string };
-}
-
-export default class NoticeIcon extends React.Component {
- public static Tab: typeof NoticeIconTab;
-}
diff --git a/app/web/src/components/NoticeIcon/index.en-US.md b/app/web/src/components/NoticeIcon/index.en-US.md
deleted file mode 100644
index 5352ce6c..00000000
--- a/app/web/src/components/NoticeIcon/index.en-US.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: NoticeIcon
-subtitle: Notification Menu
-cols: 1
-order: 9
----
-
-用在导航工具栏上,作为整个产品统一的通知中心。
-
-## API
-
-Property | Description | Type | Default
-----|------|-----|------
-count | Total number of messages | number | -
-bell | Change the bell Icon | ReactNode | ` `
-loading | Popup card loading status | boolean | false
-onClear | Click to clear button the callback | function(tabName) | -
-onItemClick | Click on the list item's callback | function(item, tabProps) | -
-onTabChange | Switching callbacks for tabs | function(tabTitle) | -
-popupAlign | Popup card location configuration | Object [alignConfig](https://github.com/yiminghe/dom-align#alignconfig-object-details) | -
-onPopupVisibleChange | Popup Card Showing or Hiding Callbacks | function(visible) | -
-popupVisible | Popup card display state | boolean | -
-locale | Default message text | Object | `{ emptyText: '暂无数据', clear: '清空' }`
-
-### NoticeIcon.Tab
-
-Property | Description | Type | Default
-----|------|-----|------
-title | header for message Tab | string | -
-name | identifier for message Tab | string | -
-list | List data, format refer to the following table | Array | `[]`
-showClear | Clear button display status | boolean | true
-emptyText | message text when list is empty | ReactNode | -
-emptyImage | image when list is empty | string | -
-
-
-### Tab data
-
-Property | Description | Type | Default
-----|------|-----|------
-avatar | avatar img url | string \| ReactNode | -
-title | title | ReactNode | -
-description | description info | ReactNode | -
-datetime | Timestamps | ReactNode | -
-extra |Additional information in the upper right corner of the list item | ReactNode | -
diff --git a/app/web/src/components/NoticeIcon/index.js b/app/web/src/components/NoticeIcon/index.js
deleted file mode 100644
index 61f56b92..00000000
--- a/app/web/src/components/NoticeIcon/index.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Popover, Icon, Tabs, Badge, Spin } from 'antd';
-import classNames from 'classnames';
-import List from './NoticeList';
-import styles from './index.less';
-
-const { TabPane } = Tabs;
-
-export default class NoticeIcon extends PureComponent {
- static Tab = TabPane;
-
- static defaultProps = {
- onItemClick: () => {},
- onPopupVisibleChange: () => {},
- onTabChange: () => {},
- onClear: () => {},
- loading: false,
- locale: {
- emptyText: 'No notifications',
- clear: 'Clear',
- },
- emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
- };
-
- onItemClick = (item, tabProps) => {
- const { onItemClick } = this.props;
- onItemClick(item, tabProps);
- };
-
- onTabChange = tabType => {
- const { onTabChange } = this.props;
- onTabChange(tabType);
- };
-
- getNotificationBox() {
- const { children, loading, locale, onClear } = this.props;
- if (!children) {
- return null;
- }
- const panes = React.Children.map(children, child => {
- const title =
- child.props.list && child.props.list.length > 0
- ? `${child.props.title} (${child.props.list.length})`
- : child.props.title;
- return (
-
- this.onItemClick(item, child.props)}
- onClear={() => onClear(child.props.name)}
- title={child.props.title}
- locale={locale}
- />
-
- );
- });
- return (
-
-
- {panes}
-
-
- );
- }
-
- render() {
- const { className, count, popupAlign, popupVisible, onPopupVisibleChange, bell } = this.props;
- const noticeButtonClass = classNames(className, styles.noticeButton);
- const notificationBox = this.getNotificationBox();
- const NoticeBellIcon = bell || ;
- const trigger = (
-
-
- {NoticeBellIcon}
-
-
- );
- if (!notificationBox) {
- return trigger;
- }
- const popoverProps = {};
- if ('popupVisible' in this.props) {
- popoverProps.visible = popupVisible;
- }
- return (
-
- {trigger}
-
- );
- }
-}
diff --git a/app/web/src/components/NoticeIcon/index.less b/app/web/src/components/NoticeIcon/index.less
deleted file mode 100644
index 794376b5..00000000
--- a/app/web/src/components/NoticeIcon/index.less
+++ /dev/null
@@ -1,29 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.popover {
- width: 336px;
- :global(.ant-popover-inner-content) {
- padding: 0;
- }
-}
-
-.noticeButton {
- cursor: pointer;
- display: inline-block;
- transition: all 0.3s;
-}
-
-.icon {
- padding: 4px;
-}
-
-.tabs {
- :global {
- .ant-tabs-nav-scroll {
- text-align: center;
- }
- .ant-tabs-bar {
- margin-bottom: 4px;
- }
- }
-}
diff --git a/app/web/src/components/NoticeIcon/index.zh-CN.md b/app/web/src/components/NoticeIcon/index.zh-CN.md
deleted file mode 100644
index 056e3768..00000000
--- a/app/web/src/components/NoticeIcon/index.zh-CN.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: NoticeIcon
-subtitle: 通知菜单
-cols: 1
-order: 9
----
-
-用在导航工具栏上,作为整个产品统一的通知中心。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-count | 图标上的消息总数 | number | -
-bell | translate this please -> Change the bell Icon | ReactNode | ` `
-loading | 弹出卡片加载状态 | boolean | false
-onClear | 点击清空按钮的回调 | function(tabName) | -
-onItemClick | 点击列表项的回调 | function(item, tabProps) | -
-onTabChange | 切换页签的回调 | function(tabTitle) | -
-popupAlign | 弹出卡片的位置配置 | Object [alignConfig](https://github.com/yiminghe/dom-align#alignconfig-object-details) | -
-onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | -
-popupVisible | 控制弹层显隐 | boolean | -
-locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' }`
-
-### NoticeIcon.Tab
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-title | 消息分类的页签标题 | string | -
-name | 消息分类的标识符 | string | -
-list | 列表数据,格式参照下表 | Array | `[]`
-showClear | 是否显示清空按钮 | boolean | true
-emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | -
-emptyImage | 针对每个 Tab 定制空数据图片 | string | -
-
-
-### Tab data
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-avatar | 头像图片链接 | string \| ReactNode | -
-title | 标题 | ReactNode | -
-description | 描述信息 | ReactNode | -
-datetime | 时间戳 | ReactNode | -
-extra | 额外信息,在列表项右上角 | ReactNode | -
diff --git a/app/web/src/components/NumberInfo/demo/basic.md b/app/web/src/components/NumberInfo/demo/basic.md
deleted file mode 100644
index b399655e..00000000
--- a/app/web/src/components/NumberInfo/demo/basic.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-order: 0
-title:
- zh-CN: 演示
- en-US: Demo
----
-
-## zh-CN
-
-各种数据文案的展现方式。
-
-## en-US
-
-Used for presenting various numerical data.
-
-````jsx
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import numeral from 'numeral';
-
-ReactDOM.render(
-
- Visits this week}
- total={numeral(12321).format('0,0')}
- status="up"
- subTotal={17.1}
- />
-
-, mountNode);
-````
diff --git a/app/web/src/components/NumberInfo/index.d.ts b/app/web/src/components/NumberInfo/index.d.ts
deleted file mode 100644
index ca93ba5d..00000000
--- a/app/web/src/components/NumberInfo/index.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as React from 'react';
-export interface INumberInfoProps {
- title?: React.ReactNode | string;
- subTitle?: React.ReactNode | string;
- total?: React.ReactNode | string;
- status?: 'up' | 'down';
- theme?: string;
- gap?: number;
- subTotal?: number;
- style?: React.CSSProperties;
-}
-
-export default class NumberInfo extends React.Component {}
diff --git a/app/web/src/components/NumberInfo/index.en-US.md b/app/web/src/components/NumberInfo/index.en-US.md
deleted file mode 100644
index b82afbe4..00000000
--- a/app/web/src/components/NumberInfo/index.en-US.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: NumberInfo
-cols: 1
-order: 10
----
-
-Often used in data cards for highlighting the business data.
-
-## API
-
-Property | Description | Type | Default
-----|------|-----|------
-title | title | ReactNode\|string | -
-subTitle | subtitle | ReactNode\|string | -
-total | total amount | ReactNode\|string | -
-subTotal | total amount of additional information | ReactNode\|string | -
-status | increase state | 'up \| down' | -
-theme | state style | string | 'light'
-gap | set the spacing (pixels) between numbers and descriptions | number | 8
diff --git a/app/web/src/components/NumberInfo/index.js b/app/web/src/components/NumberInfo/index.js
deleted file mode 100644
index 717aee9d..00000000
--- a/app/web/src/components/NumberInfo/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import { Icon } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const NumberInfo = ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...rest }) => (
-
- {title && (
-
- {title}
-
- )}
- {subTitle && (
-
- {subTitle}
-
- )}
-
-
- {total}
- {suffix && {suffix} }
-
- {(status || subTotal) && (
-
- {subTotal}
- {status && }
-
- )}
-
-
-);
-
-export default NumberInfo;
diff --git a/app/web/src/components/NumberInfo/index.less b/app/web/src/components/NumberInfo/index.less
deleted file mode 100644
index c8fad650..00000000
--- a/app/web/src/components/NumberInfo/index.less
+++ /dev/null
@@ -1,68 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.numberInfo {
- .suffix {
- color: @text-color;
- font-size: 16px;
- font-style: normal;
- margin-left: 4px;
- }
- .numberInfoTitle {
- color: @text-color;
- font-size: @font-size-lg;
- margin-bottom: 16px;
- transition: all 0.3s;
- }
- .numberInfoSubTitle {
- color: @text-color-secondary;
- font-size: @font-size-base;
- height: 22px;
- line-height: 22px;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- white-space: nowrap;
- }
- .numberInfoValue {
- margin-top: 4px;
- font-size: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- white-space: nowrap;
- & > span {
- color: @heading-color;
- display: inline-block;
- line-height: 32px;
- height: 32px;
- font-size: 24px;
- margin-right: 32px;
- }
- .subTotal {
- color: @text-color-secondary;
- font-size: @font-size-lg;
- vertical-align: top;
- margin-right: 0;
- i {
- font-size: 12px;
- transform: scale(0.82);
- margin-left: 4px;
- }
- :global {
- .anticon-caret-up {
- color: @red-6;
- }
- .anticon-caret-down {
- color: @green-6;
- }
- }
- }
- }
-}
-.numberInfolight {
- .numberInfoValue {
- & > span {
- color: @text-color;
- }
- }
-}
diff --git a/app/web/src/components/NumberInfo/index.zh-CN.md b/app/web/src/components/NumberInfo/index.zh-CN.md
deleted file mode 100644
index 71985394..00000000
--- a/app/web/src/components/NumberInfo/index.zh-CN.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: NumberInfo
-subtitle: 数据文本
-cols: 1
-order: 10
----
-
-常用在数据卡片中,用于突出展示某个业务数据。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-title | 标题 | ReactNode\|string | -
-subTitle | 子标题 | ReactNode\|string | -
-total | 总量 | ReactNode\|string | -
-subTotal | 子总量 | ReactNode\|string | -
-status | 增加状态 | 'up \| down' | -
-theme | 状态样式 | string | 'light'
-gap | 设置数字和描述之间的间距(像素)| number | 8
diff --git a/app/web/src/components/PageHeader/breadcrumb.d.ts b/app/web/src/components/PageHeader/breadcrumb.d.ts
deleted file mode 100644
index ce6e6244..00000000
--- a/app/web/src/components/PageHeader/breadcrumb.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import * as React from 'react';
-import { IPageHeaderProps } from './index'
-
-export default class BreadcrumbView extends React.Component {}
-
-export function getBreadcrumb(breadcrumbNameMap: Object, url: string): Object;
diff --git a/app/web/src/components/PageHeader/breadcrumb.js b/app/web/src/components/PageHeader/breadcrumb.js
deleted file mode 100644
index 28c71b06..00000000
--- a/app/web/src/components/PageHeader/breadcrumb.js
+++ /dev/null
@@ -1,176 +0,0 @@
-import React, { PureComponent, createElement } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { Breadcrumb } from 'antd';
-import styles from './index.less';
-import { urlToList } from '../_utils/pathTools';
-
-export const getBreadcrumb = (breadcrumbNameMap, url) => {
- let breadcrumb = breadcrumbNameMap[url];
- if (!breadcrumb) {
- Object.keys(breadcrumbNameMap).forEach(item => {
- if (pathToRegexp(item).test(url)) {
- breadcrumb = breadcrumbNameMap[item];
- }
- });
- }
- return breadcrumb || {};
-};
-
-export default class BreadcrumbView extends PureComponent {
- state = {
- breadcrumb: null,
- };
-
- componentDidMount() {
- this.getBreadcrumbDom();
- }
-
- componentDidUpdate(preProps) {
- const { location } = this.props;
- if (!location || !preProps.location) {
- return;
- }
- const prePathname = preProps.location.pathname;
- if (prePathname !== location.pathname) {
- this.getBreadcrumbDom();
- }
- }
-
- getBreadcrumbDom = () => {
- const breadcrumb = this.conversionBreadcrumbList();
- this.setState({
- breadcrumb,
- });
- };
-
- getBreadcrumbProps = () => {
- const { routes, params, location, breadcrumbNameMap } = this.props;
- return {
- routes,
- params,
- routerLocation: location,
- breadcrumbNameMap,
- };
- };
-
- // Generated according to props
- conversionFromProps = () => {
- const { breadcrumbList, breadcrumbSeparator, itemRender, linkElement = 'a' } = this.props;
- return (
-
- {breadcrumbList.map(item => {
- const title = itemRender ? itemRender(item) : item.title;
- return (
-
- {item.href
- ? createElement(
- linkElement,
- {
- [linkElement === 'a' ? 'href' : 'to']: item.href,
- },
- title
- )
- : title}
-
- );
- })}
-
- );
- };
-
- conversionFromLocation = (routerLocation, breadcrumbNameMap) => {
- const { breadcrumbSeparator, home, itemRender, linkElement = 'a' } = this.props;
- // Convert the url to an array
- const pathSnippets = urlToList(routerLocation.pathname);
- // Loop data mosaic routing
- const extraBreadcrumbItems = pathSnippets.map((url, index) => {
- const currentBreadcrumb = getBreadcrumb(breadcrumbNameMap, url);
- if (currentBreadcrumb.inherited) {
- return null;
- }
- const isLinkable = index !== pathSnippets.length - 1 && currentBreadcrumb.component;
- const name = itemRender ? itemRender(currentBreadcrumb) : currentBreadcrumb.name;
- return currentBreadcrumb.name && !currentBreadcrumb.hideInBreadcrumb ? (
-
- {createElement(
- isLinkable ? linkElement : 'span',
- { [linkElement === 'a' ? 'href' : 'to']: url },
- name
- )}
-
- ) : null;
- });
- // Add home breadcrumbs to your head
- extraBreadcrumbItems.unshift(
-
- {createElement(
- linkElement,
- {
- [linkElement === 'a' ? 'href' : 'to']: '/',
- },
- home || 'Home'
- )}
-
- );
- return (
-
- {extraBreadcrumbItems}
-
- );
- };
-
- /**
- * 将参数转化为面包屑
- * Convert parameters into breadcrumbs
- */
- conversionBreadcrumbList = () => {
- const { breadcrumbList, breadcrumbSeparator } = this.props;
- const { routes, params, routerLocation, breadcrumbNameMap } = this.getBreadcrumbProps();
- if (breadcrumbList && breadcrumbList.length) {
- return this.conversionFromProps();
- }
- // 如果传入 routes 和 params 属性
- // If pass routes and params attributes
- if (routes && params) {
- return (
- route.breadcrumbName)}
- params={params}
- itemRender={this.itemRender}
- separator={breadcrumbSeparator}
- />
- );
- }
- // 根据 location 生成 面包屑
- // Generate breadcrumbs based on location
- if (routerLocation && routerLocation.pathname) {
- return this.conversionFromLocation(routerLocation, breadcrumbNameMap);
- }
- return null;
- };
-
- // 渲染Breadcrumb 子节点
- // Render the Breadcrumb child node
- itemRender = (route, params, routes, paths) => {
- const { linkElement = 'a' } = this.props;
- const last = routes.indexOf(route) === routes.length - 1;
- return last || !route.component ? (
- {route.breadcrumbName}
- ) : (
- createElement(
- linkElement,
- {
- href: paths.join('/') || '/',
- to: paths.join('/') || '/',
- },
- route.breadcrumbName
- )
- );
- };
-
- render() {
- const { breadcrumb } = this.state;
- return breadcrumb;
- }
-}
diff --git a/app/web/src/components/PageHeader/demo/image.md b/app/web/src/components/PageHeader/demo/image.md
deleted file mode 100644
index 511bac5d..00000000
--- a/app/web/src/components/PageHeader/demo/image.md
+++ /dev/null
@@ -1,75 +0,0 @@
----
-order: 2
-title: With Image
----
-
-带图片的页头。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-
-const content = (
-
-
段落示意:蚂蚁金服务设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。
-
-
-);
-
-const extra = (
-
-
-
-);
-
-const breadcrumbList = [{
- title: '一级菜单',
- href: '/',
-}, {
- title: '二级菜单',
- href: '/',
-}, {
- title: '三级菜单',
-}];
-
-ReactDOM.render(
-
-, mountNode);
-````
-
-
diff --git a/app/web/src/components/PageHeader/demo/simple.md b/app/web/src/components/PageHeader/demo/simple.md
deleted file mode 100644
index d0ad1f7d..00000000
--- a/app/web/src/components/PageHeader/demo/simple.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-order: 3
-title: Simple
----
-
-简单的页头。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-
-const breadcrumbList = [{
- title: '一级菜单',
- href: '/',
-}, {
- title: '二级菜单',
- href: '/',
-}, {
- title: '三级菜单',
-}];
-
-ReactDOM.render(
-
-, mountNode);
-````
-
-
diff --git a/app/web/src/components/PageHeader/demo/standard.md b/app/web/src/components/PageHeader/demo/standard.md
deleted file mode 100644
index 5c59c933..00000000
--- a/app/web/src/components/PageHeader/demo/standard.md
+++ /dev/null
@@ -1,102 +0,0 @@
----
-order: 1
-title: Standard
----
-
-标准页头。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-import { Button, Menu, Dropdown, Icon, Row, Col } from 'antd';
-
-const { Description } = DescriptionList;
-const ButtonGroup = Button.Group;
-
-const description = (
-
- 曲丽丽
- XX 服务
- 2017-07-07
- 12421
-
-);
-
-const menu = (
-
- 选项一
- 选项二
- 选项三
-
-);
-
-const action = (
-
-
- 操作
- 操作
-
-
-
-
- 主操作
-
-);
-
-const extra = (
-
-
- 状态
- 待审批
-
-
- 订单金额
- ¥ 568.08
-
-
-);
-
-const breadcrumbList = [{
- title: '一级菜单',
- href: '/',
-}, {
- title: '二级菜单',
- href: '/',
-}, {
- title: '三级菜单',
-}];
-
-const tabList = [{
- key: 'detail',
- tab: '详情',
-}, {
- key: 'rule',
- tab: '规则',
-}];
-
-function onTabChange(key) {
- console.log(key);
-}
-
-ReactDOM.render(
-
-
}
- action={action}
- content={description}
- extraContent={extra}
- breadcrumbList={breadcrumbList}
- tabList={tabList}
- tabActiveKey="detail"
- onTabChange={onTabChange}
- />
-
-, mountNode);
-````
-
-
diff --git a/app/web/src/components/PageHeader/demo/structure.md b/app/web/src/components/PageHeader/demo/structure.md
deleted file mode 100644
index 429eed63..00000000
--- a/app/web/src/components/PageHeader/demo/structure.md
+++ /dev/null
@@ -1,68 +0,0 @@
----
-order: 0
-title: Structure
----
-
-基本结构,具备响应式布局功能,主要断点为 768px 和 576px,拖动窗口改变大小试试看。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-
-const breadcrumbList = [{
- title: '面包屑',
-}];
-
-const tabList = [{
- key: '1',
- tab: '页签一',
-}, {
- key: '2',
- tab: '页签二',
-}, {
- key: '3',
- tab: '页签三',
-}];
-
-ReactDOM.render(
- }
- logo={logo
}
- action={action
}
- content={content
}
- extraContent={extraContent
}
- breadcrumbList={breadcrumbList}
- tabList={tabList}
- tabActiveKey="1"
- />
-
-, mountNode);
-````
-
-
diff --git a/app/web/src/components/PageHeader/index.d.ts b/app/web/src/components/PageHeader/index.d.ts
deleted file mode 100644
index c64e592b..00000000
--- a/app/web/src/components/PageHeader/index.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import * as React from 'react';
-export interface IPageHeaderProps {
- title?: React.ReactNode | string;
- logo?: React.ReactNode | string;
- action?: React.ReactNode | string;
- content?: React.ReactNode;
- extraContent?: React.ReactNode;
- routes?: any[];
- params?: any;
- breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>;
- tabList?: Array<{ key: string; tab: React.ReactNode }>;
- tabActiveKey?: string;
- tabDefaultActiveKey?: string;
- onTabChange?: (key: string) => void;
- tabBarExtraContent?: React.ReactNode;
- linkElement?: React.ReactNode;
- style?: React.CSSProperties;
- home?: React.ReactNode;
- wide?: boolean;
- hiddenBreadcrumb?:boolean;
-}
-
-export default class PageHeader extends React.Component {}
diff --git a/app/web/src/components/PageHeader/index.js b/app/web/src/components/PageHeader/index.js
deleted file mode 100644
index 5d47b345..00000000
--- a/app/web/src/components/PageHeader/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Tabs, Skeleton } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-import BreadcrumbView from './breadcrumb';
-
-const { TabPane } = Tabs;
-export default class PageHeader extends PureComponent {
- onChange = key => {
- const { onTabChange } = this.props;
- if (onTabChange) {
- onTabChange(key);
- }
- };
-
- render() {
- const {
- title,
- logo,
- action,
- content,
- extraContent,
- tabList,
- className,
- tabActiveKey,
- tabDefaultActiveKey,
- tabBarExtraContent,
- loading = false,
- wide = false,
- hiddenBreadcrumb = false,
- } = this.props;
-
- const clsString = classNames(styles.pageHeader, className);
- const activeKeyProps = {};
- if (tabDefaultActiveKey !== undefined) {
- activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
- }
- if (tabActiveKey !== undefined) {
- activeKeyProps.activeKey = tabActiveKey;
- }
- return (
-
-
-
- {hiddenBreadcrumb ? null : }
-
- {logo &&
{logo}
}
-
-
- {title &&
{title} }
- {action &&
{action}
}
-
-
- {content &&
{content}
}
- {extraContent &&
{extraContent}
}
-
-
-
- {tabList && tabList.length ? (
-
- {tabList.map(item => (
-
- ))}
-
- ) : null}
-
-
-
- );
- }
-}
diff --git a/app/web/src/components/PageHeader/index.less b/app/web/src/components/PageHeader/index.less
deleted file mode 100644
index a5e95670..00000000
--- a/app/web/src/components/PageHeader/index.less
+++ /dev/null
@@ -1,159 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.pageHeader {
- background: @component-background;
- padding: 16px 32px 0 32px;
- border-bottom: @border-width-base @border-style-base @border-color-split;
- .wide {
- max-width: 1200px;
- margin: auto;
- }
- .detail {
- display: flex;
- }
-
- .row {
- display: flex;
- width: 100%;
- }
-
- .breadcrumb {
- margin-bottom: 16px;
- }
-
- .tabs {
- margin: 0 0 0 -8px;
-
- :global {
- .ant-tabs-bar {
- border-bottom: @border-width-base @border-style-base @border-color-split;
- }
- }
- }
-
- .logo {
- flex: 0 1 auto;
- margin-right: 16px;
- padding-top: 1px;
- > img {
- width: 28px;
- height: 28px;
- border-radius: @border-radius-base;
- display: block;
- }
- }
-
- .title {
- font-size: 20px;
- font-weight: 500;
- color: @heading-color;
- }
-
- .action {
- margin-left: 56px;
- min-width: 266px;
-
- :global {
- .ant-btn-group:not(:last-child),
- .ant-btn:not(:last-child) {
- margin-right: 8px;
- }
-
- .ant-btn-group > .ant-btn {
- margin-right: 0;
- }
- }
- }
-
- .title,
- .content {
- flex: auto;
- }
-
- .action,
- .extraContent,
- .main {
- flex: 0 1 auto;
- }
-
- .main {
- width: 100%;
- }
-
- .title,
- .action {
- margin-bottom: 16px;
- }
-
- .logo,
- .content,
- .extraContent {
- margin-bottom: 16px;
- }
-
- .action,
- .extraContent {
- text-align: right;
- }
-
- .extraContent {
- margin-left: 88px;
- min-width: 242px;
- }
-}
-
-@media screen and (max-width: @screen-xl) {
- .pageHeader {
- .extraContent {
- margin-left: 44px;
- }
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .pageHeader {
- .extraContent {
- margin-left: 20px;
- }
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .pageHeader {
- .row {
- display: block;
- }
-
- .action,
- .extraContent {
- margin-left: 0;
- text-align: left;
- }
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .pageHeader {
- .detail {
- display: block;
- }
- }
-}
-
-@media screen and (max-width: @screen-xs) {
- .pageHeader {
- .action {
- :global {
- .ant-btn-group,
- .ant-btn {
- display: block;
- margin-bottom: 8px;
- }
- .ant-btn-group > .ant-btn {
- display: inline-block;
- margin-bottom: 0;
- }
- }
- }
- }
-}
diff --git a/app/web/src/components/PageHeader/index.md b/app/web/src/components/PageHeader/index.md
deleted file mode 100644
index e82c8b89..00000000
--- a/app/web/src/components/PageHeader/index.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title:
- en-US: PageHeader
- zh-CN: PageHeader
-subtitle: 页头
-cols: 1
-order: 11
----
-
-页头用来声明页面的主题,包含了用户所关注的最重要的信息,使用户可以快速理解当前页面是什么以及它的功能。
-
-## API
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | title 区域 | ReactNode | - |
-| logo | logo区域 | ReactNode | - |
-| action | 操作区,位于 title 行的行尾 | ReactNode | - |
-| home | 默认的主页说明文字 | ReactNode | - |
-| content | 内容区 | ReactNode | - |
-| extraContent | 额外内容区,位于content的右侧 | ReactNode | - |
-| breadcrumbList | 面包屑数据,配置了此属性时 `routes` `params` `location` `breadcrumbNameMap` 无效 | array<{title: ReactNode, href?: string}> | - |
-| hiddenBreadcrumb |隐藏面包屑 | boolean | false |
-| routes | 面包屑相关属性,router 的路由栈信息 | object[] | - |
-| params | 面包屑相关属性,路由的参数 | object | - |
-| location | 面包屑相关属性,当前的路由信息 | object | - |
-| breadcrumbNameMap | 面包屑相关属性,路由的地址-名称映射表 | object | - |
-| tabList | tab 标题列表 | array<{key: string, tab: ReactNode}> | - |
-| tabActiveKey | 当前高亮的 tab 项 | string | - |
-| tabDefaultActiveKey | 默认高亮的 tab 项 | string | 第一项 |
-| wide | 是否定宽 | boolean | false |
-| onTabChange | 切换面板的回调 | (key) => void | - |
-| itemRender | 自定义节点方法 | (menuItem) => ReactNode | - |
-| linkElement | 定义链接的元素,默认为 `a`,可传入 react-router 的 Link | string\|ReactElement | - |
-
-> 面包屑的配置方式有三种,一是直接配置 `breadcrumbList`,二是结合 `react-router@2` `react-router@3`,配置 `routes` 及 `params` 实现,类似 [面包屑 Demo](https://ant.design/components/breadcrumb-cn/#components-breadcrumb-demo-router),三是结合 `react-router@4`,配置 `location` `breadcrumbNameMap`,优先级依次递减,脚手架中使用最后一种。 对于后两种用法,你也可以将 `routes` `params` 及 `location` `breadcrumbNameMap` 放到 context 中,组件会自动获取。
diff --git a/app/web/src/components/PageHeader/index.test.js b/app/web/src/components/PageHeader/index.test.js
deleted file mode 100644
index d22706e9..00000000
--- a/app/web/src/components/PageHeader/index.test.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { getBreadcrumb } from './breadcrumb';
-import { urlToList } from '../_utils/pathTools';
-
-const routerData = {
- '/dashboard/analysis': {
- name: '分析页',
- },
- '/userinfo': {
- name: '用户列表',
- },
- '/userinfo/:id': {
- name: '用户信息',
- },
- '/userinfo/:id/addr': {
- name: '收货订单',
- },
-};
-describe('test getBreadcrumb', () => {
- it('Simple url', () => {
- expect(getBreadcrumb(routerData, '/dashboard/analysis').name).toEqual('分析页');
- });
- it('Parameters url', () => {
- expect(getBreadcrumb(routerData, '/userinfo/2144').name).toEqual('用户信息');
- });
- it('The middle parameter url', () => {
- expect(getBreadcrumb(routerData, '/userinfo/2144/addr').name).toEqual('收货订单');
- });
- it('Loop through the parameters', () => {
- const urlNameList = urlToList('/userinfo/2144/addr').map(
- url => getBreadcrumb(routerData, url).name
- );
- expect(urlNameList).toEqual(['用户列表', '用户信息', '收货订单']);
- });
-
- it('a path', () => {
- const urlNameList = urlToList('/userinfo').map(url => getBreadcrumb(routerData, url).name);
- expect(urlNameList).toEqual(['用户列表']);
- });
- it('Secondary path', () => {
- const urlNameList = urlToList('/userinfo/2144').map(url => getBreadcrumb(routerData, url).name);
- expect(urlNameList).toEqual(['用户列表', '用户信息']);
- });
-});
diff --git a/app/web/src/components/PageHeaderWrapper/GridContent.js b/app/web/src/components/PageHeaderWrapper/GridContent.js
deleted file mode 100644
index 931ea20c..00000000
--- a/app/web/src/components/PageHeaderWrapper/GridContent.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import styles from './GridContent.less';
-
-class GridContent extends PureComponent {
- render() {
- const { contentWidth, children } = this.props;
- let className = `${styles.main}`;
- if (contentWidth === 'Fixed') {
- className = `${styles.main} ${styles.wide}`;
- }
- return {children}
;
- }
-}
-
-export default connect(({ setting }) => ({
- contentWidth: setting.contentWidth,
-}))(GridContent);
diff --git a/app/web/src/components/PageHeaderWrapper/GridContent.less b/app/web/src/components/PageHeaderWrapper/GridContent.less
deleted file mode 100644
index d5496e9e..00000000
--- a/app/web/src/components/PageHeaderWrapper/GridContent.less
+++ /dev/null
@@ -1,10 +0,0 @@
-.main {
- width: 100%;
- height: 100%;
- min-height: 100%;
- transition: 0.3s;
- &.wide {
- max-width: 1200px;
- margin: 0 auto;
- }
-}
diff --git a/app/web/src/components/PageHeaderWrapper/index.js b/app/web/src/components/PageHeaderWrapper/index.js
deleted file mode 100644
index 7338659b..00000000
--- a/app/web/src/components/PageHeaderWrapper/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import { FormattedMessage } from 'umi/locale';
-import Link from 'umi/link';
-import { connect } from 'dva';
-import PageHeader from '@/components/PageHeader';
-import GridContent from './GridContent';
-import styles from './index.less';
-import MenuContext from '@/layouts/MenuContext';
-
-const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...restProps }) => (
-
- {top}
-
- {value => (
- }
- {...value}
- key="pageheader"
- {...restProps}
- linkElement={Link}
- itemRender={item => {
- if (item.locale) {
- return ;
- }
- return item.name;
- }}
- />
- )}
-
- {children ? (
-
- {children}
-
- ) : null}
-
-);
-
-export default connect(({ setting }) => ({
- contentWidth: setting.contentWidth,
-}))(PageHeaderWrapper);
diff --git a/app/web/src/components/PageHeaderWrapper/index.less b/app/web/src/components/PageHeaderWrapper/index.less
deleted file mode 100644
index 39a44965..00000000
--- a/app/web/src/components/PageHeaderWrapper/index.less
+++ /dev/null
@@ -1,11 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.content {
- margin: 24px 24px 0;
-}
-
-@media screen and (max-width: @screen-sm) {
- .content {
- margin: 24px 0 0;
- }
-}
diff --git a/app/web/src/components/PageLoading/index.js b/app/web/src/components/PageLoading/index.js
deleted file mode 100644
index 77c0f165..00000000
--- a/app/web/src/components/PageLoading/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import React from 'react';
-import { Spin } from 'antd';
-
-// loading components from code split
-// https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
-export default () => (
-
-
-
-);
diff --git a/app/web/src/components/Result/demo/classic.md b/app/web/src/components/Result/demo/classic.md
deleted file mode 100644
index 0cd9d14b..00000000
--- a/app/web/src/components/Result/demo/classic.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-order: 1
-title: Classic
----
-
-典型结果页面。
-
-````jsx
-import Result from 'ant-design-pro/lib/Result';
-import { Button, Row, Col, Icon, Steps } from 'antd';
-
-const { Step } = Steps;
-
-const desc1 = (
-
-
- 曲丽丽
-
-
-
2016-12-12 12:32
-
-);
-
-const desc2 = (
-
-);
-
-const extra = (
-
-
- 项目名称
-
-
-
- 项目 ID:
- 23421
-
-
- 负责人:
- 曲丽丽
-
-
- 生效时间:
- 2016-12-12 ~ 2017-12-12
-
-
-
-
-
-
-
-
-
-);
-
-const actions = (
-
- 返回列表
- 查看项目
- 打 印
-
-);
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Result/demo/error.md b/app/web/src/components/Result/demo/error.md
deleted file mode 100644
index 5fd25cfd..00000000
--- a/app/web/src/components/Result/demo/error.md
+++ /dev/null
@@ -1,39 +0,0 @@
----
-order: 2
-title: Failed
----
-
-提交失败。
-
-````jsx
-import Result from 'ant-design-pro/lib/Result';
-import { Button, Icon } from 'antd';
-
-const extra = (
-
-);
-
-const actions = 返回修改 ;
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/app/web/src/components/Result/demo/structure.md b/app/web/src/components/Result/demo/structure.md
deleted file mode 100644
index 7fcecfd6..00000000
--- a/app/web/src/components/Result/demo/structure.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 0
-title: Structure
----
-
-结构包含 `处理结果`,`补充信息` 以及 `操作建议` 三个部分,其中 `处理结果` 由 `提示图标`,`标题` 和 `结果描述` 组成。
-
-````jsx
-import Result from 'ant-design-pro/lib/Result';
-
-ReactDOM.render(
- 标题}
- description={结果描述
}
- extra="其他补充信息,自带灰底效果"
- actions={操作建议,一般放置按钮组
}
- />
-, mountNode);
-````
diff --git a/app/web/src/components/Result/index.d.ts b/app/web/src/components/Result/index.d.ts
deleted file mode 100644
index 0c34c254..00000000
--- a/app/web/src/components/Result/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface IResultProps {
- type: 'success' | 'error';
- title: React.ReactNode;
- description?: React.ReactNode;
- extra?: React.ReactNode;
- actions?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class Result extends React.Component {}
diff --git a/app/web/src/components/Result/index.js b/app/web/src/components/Result/index.js
deleted file mode 100644
index 89f9f31a..00000000
--- a/app/web/src/components/Result/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { Icon } from 'antd';
-import styles from './index.less';
-
-export default function Result({
- className,
- type,
- title,
- description,
- extra,
- actions,
- ...restProps
-}) {
- const iconMap = {
- error: ,
- success: ,
- };
- const clsString = classNames(styles.result, className);
- return (
-
-
{iconMap[type]}
-
{title}
- {description &&
{description}
}
- {extra &&
{extra}
}
- {actions &&
{actions}
}
-
- );
-}
diff --git a/app/web/src/components/Result/index.less b/app/web/src/components/Result/index.less
deleted file mode 100644
index 5cd2aff5..00000000
--- a/app/web/src/components/Result/index.less
+++ /dev/null
@@ -1,58 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.result {
- text-align: center;
- width: 72%;
- margin: 0 auto;
- @media screen and (max-width: @screen-xs) {
- width: 100%;
- }
-
- .icon {
- font-size: 72px;
- line-height: 72px;
- margin-bottom: 24px;
-
- & > .success {
- color: @success-color;
- }
-
- & > .error {
- color: @error-color;
- }
- }
-
- .title {
- font-size: 24px;
- color: @heading-color;
- font-weight: 500;
- line-height: 32px;
- margin-bottom: 16px;
- }
-
- .description {
- font-size: 14px;
- line-height: 22px;
- color: @text-color-secondary;
- margin-bottom: 24px;
- }
-
- .extra {
- background: #fafafa;
- padding: 24px 40px;
- border-radius: @border-radius-sm;
- text-align: left;
-
- @media screen and (max-width: @screen-xs) {
- padding: 18px 20px;
- }
- }
-
- .actions {
- margin-top: 32px;
-
- button:not(:last-child) {
- margin-right: 8px;
- }
- }
-}
diff --git a/app/web/src/components/Result/index.md b/app/web/src/components/Result/index.md
deleted file mode 100644
index dc11206c..00000000
--- a/app/web/src/components/Result/index.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title:
- en-US: Result
- zh-CN: Result
-subtitle: 处理结果
-cols: 1
-order: 12
----
-
-结果页用于对用户进行的一系列任务处理结果进行反馈。
-
-## API
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| type | 类型,不同类型自带对应的图标 | Enum {'success', 'error'} | - |
-| title | 标题 | ReactNode | - |
-| description | 结果描述 | ReactNode | - |
-| extra | 补充信息,有默认的灰色背景 | ReactNode | - |
-| actions | 操作建议,推荐放置跳转链接,按钮组等 | ReactNode | - |
diff --git a/app/web/src/components/SelectLang/index.js b/app/web/src/components/SelectLang/index.js
deleted file mode 100644
index a8568e75..00000000
--- a/app/web/src/components/SelectLang/index.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, { PureComponent } from 'react';
-import { formatMessage, setLocale, getLocale } from 'umi';
-import { Menu, Icon, Dropdown } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-export default class SelectLang extends PureComponent {
- changLang = ({ key }) => {
- setLocale(key);
- };
-
- render() {
- const { className } = this.props;
- const selectedLang = getLocale();
- const langMenu = (
-
-
-
- 🇨🇳
- {' '}
- 简体中文
-
-
-
- 🇭🇰
- {' '}
- 繁体中文
-
-
-
- 🇬🇧
- {' '}
- English
-
-
-
- 🇵🇹
- {' '}
- Português
-
-
- );
- return (
-
-
-
- );
- }
-}
diff --git a/app/web/src/components/SelectLang/index.less b/app/web/src/components/SelectLang/index.less
deleted file mode 100644
index 819c0f8c..00000000
--- a/app/web/src/components/SelectLang/index.less
+++ /dev/null
@@ -1,21 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.menu {
- :global(.anticon) {
- margin-right: 8px;
- }
- :global(.ant-dropdown-menu-item) {
- width: 160px;
- }
-}
-
-.dropDown {
- cursor: pointer;
- font-size: 14px;
- vertical-align: top;
- line-height: 64px;
- > svg {
- position: relative;
- top: 2px;
- }
-}
diff --git a/app/web/src/components/SettingDrawer/BlockChecbox.js b/app/web/src/components/SettingDrawer/BlockChecbox.js
deleted file mode 100644
index 49af42c7..00000000
--- a/app/web/src/components/SettingDrawer/BlockChecbox.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-import { Tooltip, Icon } from 'antd';
-import style from './index.less';
-
-const BlockChecbox = ({ value, onChange, list }) => (
-
- {list.map(item => (
-
- onChange(item.key)}>
-
-
-
-
-
-
- ))}
-
-);
-
-export default BlockChecbox;
diff --git a/app/web/src/components/SettingDrawer/ThemeColor.js b/app/web/src/components/SettingDrawer/ThemeColor.js
deleted file mode 100644
index c40e0559..00000000
--- a/app/web/src/components/SettingDrawer/ThemeColor.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import React from 'react';
-import { Tooltip, Icon } from 'antd';
-import { formatMessage } from 'umi';
-import styles from './ThemeColor.less';
-
-const Tag = ({ color, check, ...rest }) => (
-
- {check ? : ''}
-
-);
-
-const ThemeColor = ({ colors, title, value, onChange }) => {
- let colorList = colors;
- if (!colors) {
- colorList = [
- {
- key: 'dust',
- color: '#F5222D',
- },
- {
- key: 'volcano',
- color: '#FA541C',
- },
- {
- key: 'sunset',
- color: '#FAAD14',
- },
- {
- key: 'cyan',
- color: '#13C2C2',
- },
- {
- key: 'green',
- color: '#52C41A',
- },
- {
- key: 'daybreak',
- color: '#1890FF',
- },
- {
- key: 'geekblue',
- color: '#2F54EB',
- },
- {
- key: 'purple',
- color: '#722ED1',
- },
- ];
- }
- return (
-
-
{title}
-
- {colorList.map(({ key, color }) => (
-
- onChange && onChange(color)}
- />
-
- ))}
-
-
- );
-};
-
-export default ThemeColor;
diff --git a/app/web/src/components/SettingDrawer/ThemeColor.less b/app/web/src/components/SettingDrawer/ThemeColor.less
deleted file mode 100644
index 4983eb9c..00000000
--- a/app/web/src/components/SettingDrawer/ThemeColor.less
+++ /dev/null
@@ -1,21 +0,0 @@
-.themeColor {
- overflow: hidden;
- margin-top: 24px;
- .title {
- font-size: 14px;
- color: rgba(0, 0, 0, 0.65);
- line-height: 22px;
- margin-bottom: 12px;
- }
- .colorBlock {
- width: 20px;
- height: 20px;
- border-radius: 2px;
- float: left;
- cursor: pointer;
- margin-right: 8px;
- text-align: center;
- color: #fff;
- font-weight: bold;
- }
-}
diff --git a/app/web/src/components/SettingDrawer/index.js b/app/web/src/components/SettingDrawer/index.js
deleted file mode 100644
index 7d892fae..00000000
--- a/app/web/src/components/SettingDrawer/index.js
+++ /dev/null
@@ -1,254 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Select, message, Drawer, List, Switch, Divider, Icon, Button, Alert, Tooltip } from 'antd';
-import { formatMessage } from 'umi';
-import { CopyToClipboard } from 'react-copy-to-clipboard';
-import { connect } from 'dva';
-import omit from 'omit.js';
-import styles from './index.less';
-import ThemeColor from './ThemeColor';
-import BlockChecbox from './BlockChecbox';
-
-const { Option } = Select;
-
-const Body = ({ children, title, style }) => (
-
-
{title}
- {children}
-
-);
-
-@connect(({ setting }) => ({ setting }))
-class SettingDrawer extends PureComponent {
- state = {
- collapse: false,
- };
-
- getLayoutSetting = () => {
- const {
- setting: { contentWidth, fixedHeader, layout, autoHideHeader, fixSiderbar },
- } = this.props;
- return [
- {
- title: formatMessage({ id: 'app.setting.content-width' }),
- action: (
- this.changeSetting('contentWidth', value)}
- style={{ width: 80 }}
- >
- {layout === 'sidemenu' ? null : (
-
- {formatMessage({ id: 'app.setting.content-width.fixed' })}
-
- )}
-
- {formatMessage({ id: 'app.setting.content-width.fluid' })}
-
-
- ),
- },
- {
- title: formatMessage({ id: 'app.setting.fixedheader' }),
- action: (
- this.changeSetting('fixedHeader', checked)}
- />
- ),
- },
- {
- title: formatMessage({ id: 'app.setting.hideheader' }),
- disabled: !fixedHeader,
- disabledReason: formatMessage({ id: 'app.setting.hideheader.hint' }),
- action: (
- this.changeSetting('autoHideHeader', checked)}
- />
- ),
- },
- {
- title: formatMessage({ id: 'app.setting.fixedsidebar' }),
- disabled: layout === 'topmenu',
- disabledReason: formatMessage({ id: 'app.setting.fixedsidebar.hint' }),
- action: (
- this.changeSetting('fixSiderbar', checked)}
- />
- ),
- },
- ];
- };
-
- changeSetting = (key, value) => {
- const { setting } = this.props;
- const nextState = { ...setting };
- nextState[key] = value;
- if (key === 'layout') {
- nextState.contentWidth = value === 'topmenu' ? 'Fixed' : 'Fluid';
- } else if (key === 'fixedHeader' && !value) {
- nextState.autoHideHeader = false;
- }
- this.setState(nextState, () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'setting/changeSetting',
- payload: this.state,
- });
- });
- };
-
- togglerContent = () => {
- const { collapse } = this.state;
- this.setState({ collapse: !collapse });
- };
-
- renderLayoutSettingItem = item => {
- const action = React.cloneElement(item.action, {
- disabled: item.disabled,
- });
- return (
-
-
- {item.title}
-
-
- );
- };
-
- render() {
- const { setting } = this.props;
- const { navTheme, primaryColor, layout, colorWeak } = setting;
- const { collapse } = this.state;
- return (
-
-
-
- }
- onHandleClick={this.togglerContent}
- style={{
- zIndex: 999,
- }}
- >
-
-
-
this.changeSetting('navTheme', value)}
- />
-
-
- this.changeSetting('primaryColor', color)}
- />
-
-
-
-
- this.changeSetting('layout', value)}
- />
-
-
-
-
-
-
-
- this.changeSetting('colorWeak', checked)}
- />,
- ]}
- >
- {formatMessage({ id: 'app.setting.weakmode' })}
-
-
-
- message.success(formatMessage({ id: 'app.setting.copyinfo' }))}
- >
-
- {formatMessage({ id: 'app.setting.copy' })}
-
-
-
- {formatMessage({ id: 'app.setting.production.hint' })}{' '}
-
- src/defaultSettings.js
-
-
- }
- />
-
-
- );
- }
-}
-
-export default SettingDrawer;
diff --git a/app/web/src/components/SettingDrawer/index.less b/app/web/src/components/SettingDrawer/index.less
deleted file mode 100644
index af4109be..00000000
--- a/app/web/src/components/SettingDrawer/index.less
+++ /dev/null
@@ -1,74 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.content {
- min-height: 100%;
- background: #fff;
- position: relative;
-}
-
-.blockChecbox {
- display: flex;
- .item {
- margin-right: 16px;
- position: relative;
- // box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
- border-radius: @border-radius-base;
- cursor: pointer;
- img {
- width: 48px;
- }
- }
- .selectIcon {
- position: absolute;
- top: 0;
- right: 0;
- width: 100%;
- padding-top: 15px;
- padding-left: 24px;
- height: 100%;
- color: @primary-color;
- font-size: 14px;
- font-weight: bold;
- }
-}
-
-.color_block {
- width: 38px;
- height: 22px;
- margin: 4px;
- border-radius: 4px;
- cursor: pointer;
- margin-right: 12px;
- display: inline-block;
- vertical-align: middle;
-}
-
-.title {
- font-size: 14px;
- color: @heading-color;
- line-height: 22px;
- margin-bottom: 12px;
-}
-
-.handle {
- position: absolute;
- top: 240px;
- background: @primary-color;
- width: 48px;
- height: 48px;
- right: 300px;
- display: flex;
- justify-content: center;
- align-items: center;
- cursor: pointer;
- pointer-events: auto;
- z-index: 0;
- text-align: center;
- font-size: 16px;
- border-radius: 4px 0 0 4px;
-}
-
-.productionHint {
- font-size: 12px;
- margin-top: 16px;
-}
diff --git a/app/web/src/components/SiderMenu/BaseMenu.js b/app/web/src/components/SiderMenu/BaseMenu.js
deleted file mode 100644
index ecb469ba..00000000
--- a/app/web/src/components/SiderMenu/BaseMenu.js
+++ /dev/null
@@ -1,195 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Menu, Icon } from 'antd';
-import {Link} from 'umi';
-import isEqual from 'lodash/isEqual';
-import memoizeOne from 'memoize-one';
-import { formatMessage } from 'umi';
-import pathToRegexp from 'path-to-regexp';
-import { urlToList } from '../_utils/pathTools';
-import styles from './index.less';
-
-const { SubMenu } = Menu;
-
-// Allow menu.js config icon as string or ReactNode
-// icon: 'setting',
-// icon: 'http://demo.com/icon.png',
-// icon: ,
-const getIcon = icon => {
- if (typeof icon === 'string' && icon.indexOf('http') === 0) {
- return ;
- }
- if (typeof icon === 'string') {
- return ;
- }
- return icon;
-};
-
-export const getMenuMatches = memoizeOne(
- (flatMenuKeys, path) => flatMenuKeys.filter(item => item && pathToRegexp(item).test(path)),
- isEqual
-);
-
-export default class BaseMenu extends PureComponent {
- constructor(props) {
- super(props);
- this.getSelectedMenuKeys = memoizeOne(this.getSelectedMenuKeys, isEqual);
- this.flatMenuKeys = this.getFlatMenuKeys(props.menuData);
- }
-
- /**
- * Recursively flatten the data
- * [{path:string},{path:string}] => {path,path2}
- * @param menus
- */
- getFlatMenuKeys(menus) {
- let keys = [];
- menus.forEach(item => {
- if (item.children) {
- keys = keys.concat(this.getFlatMenuKeys(item.children));
- }
- keys.push(item.path);
- });
- return keys;
- }
-
- /**
- * 获得菜单子节点
- * @memberof SiderMenu
- */
- getNavMenuItems = (menusData, parent) => {
- if (!menusData) {
- return [];
- }
- return menusData
- .filter(item => item.name && !item.hideInMenu)
- .map(item => {
- // make dom
- const ItemDom = this.getSubMenuOrItem(item, parent);
- return this.checkPermissionItem(item.authority, ItemDom);
- })
- .filter(item => item);
- };
-
- // Get the currently selected menu
- getSelectedMenuKeys = pathname =>
- urlToList(pathname).map(itemPath => getMenuMatches(this.flatMenuKeys, itemPath).pop());
-
- /**
- * get SubMenu or Item
- */
- getSubMenuOrItem = item => {
- // doc: add hideChildrenInMenu
- if (item.children && !item.hideChildrenInMenu && item.children.some(child => child.name)) {
- const name = item.locale ? formatMessage({ id: item.locale }) : item.name;
- return (
-
- {getIcon(item.icon)}
- {name}
-
- ) : (
- name
- )
- }
- key={item.path}
- >
- {this.getNavMenuItems(item.children)}
-
- );
- }
- return {this.getMenuItemPath(item)} ;
- };
-
- /**
- * 判断是否是http链接.返回 Link 或 a
- * Judge whether it is http link.return a or Link
- * @memberof SiderMenu
- */
- getMenuItemPath = item => {
- const name = item.locale ? formatMessage({ id: item.locale }) : item.name;
- const itemPath = this.conversionPath(item.path);
- const icon = getIcon(item.icon);
- const { target } = item;
- // Is it a http link
- if (/^https?:\/\//.test(itemPath)) {
- return (
-
- {icon}
- {name}
-
- );
- }
- const { location, isMobile, onCollapse } = this.props;
- return (
- {
- onCollapse(true);
- }
- : undefined
- }
- >
- {icon}
- {name}
-
- );
- };
-
- // permission to check
- checkPermissionItem = (authority, ItemDom) => {
- const { Authorized } = this.props;
- if (Authorized && Authorized.check) {
- const { check } = Authorized;
- return check(authority, ItemDom);
- }
- return ItemDom;
- };
-
- conversionPath = path => {
- if (path && path.indexOf('http') === 0) {
- return path;
- }
- return `/${path || ''}`.replace(/\/+/g, '/');
- };
-
- render() {
- const {
- openKeys,
- theme,
- mode,
- location: { pathname },
- } = this.props;
- // if pathname can't match, use the nearest parent's key
- let selectedKeys = this.getSelectedMenuKeys(pathname);
- if (!selectedKeys.length && openKeys) {
- selectedKeys = [openKeys[openKeys.length - 1]];
- }
- let props = {};
- if (openKeys) {
- props = {
- openKeys,
- };
- }
- const { handleOpenChange, style, menuData } = this.props;
- return (
-
- {this.getNavMenuItems(menuData)}
-
- );
- }
-}
diff --git a/app/web/src/components/SiderMenu/SiderMenu.js b/app/web/src/components/SiderMenu/SiderMenu.js
deleted file mode 100644
index d1c62fd0..00000000
--- a/app/web/src/components/SiderMenu/SiderMenu.js
+++ /dev/null
@@ -1,127 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Layout } from 'antd';
-import pathToRegexp from 'path-to-regexp';
-import classNames from 'classnames';
-import {Link} from 'umi';
-import styles from './index.less';
-import BaseMenu, { getMenuMatches } from './BaseMenu';
-import { urlToList } from '../_utils/pathTools';
-
-const { Sider } = Layout;
-
-/**
- * 获得菜单子节点
- * @memberof SiderMenu
- */
-const getDefaultCollapsedSubMenus = props => {
- const {
- location: { pathname },
- flatMenuKeys,
- } = props;
- return urlToList(pathname)
- .map(item => getMenuMatches(flatMenuKeys, item)[0])
- .filter(item => item);
-};
-
-/**
- * Recursively flatten the data
- * [{path:string},{path:string}] => {path,path2}
- * @param menu
- */
-export const getFlatMenuKeys = menu =>
- menu.reduce((keys, item) => {
- keys.push(item.path);
- if (item.children) {
- return keys.concat(getFlatMenuKeys(item.children));
- }
- return keys;
- }, []);
-
-/**
- * Find all matched menu keys based on paths
- * @param flatMenuKeys: [/abc, /abc/:id, /abc/:id/info]
- * @param paths: [/abc, /abc/11, /abc/11/info]
- */
-export const getMenuMatchKeys = (flatMenuKeys, paths) =>
- paths.reduce(
- (matchKeys, path) =>
- matchKeys.concat(flatMenuKeys.filter(item => pathToRegexp(item).test(path))),
- []
- );
-
-export default class SiderMenu extends PureComponent {
- constructor(props) {
- super(props);
- this.flatMenuKeys = getFlatMenuKeys(props.menuData);
- this.state = {
- openKeys: getDefaultCollapsedSubMenus(props),
- };
- }
-
- static getDerivedStateFromProps(props, state) {
- const { pathname } = state;
- if (props.location.pathname !== pathname) {
- return {
- pathname: props.location.pathname,
- openKeys: getDefaultCollapsedSubMenus(props),
- };
- }
- return null;
- }
-
- isMainMenu = key => {
- const { menuData } = this.props;
- return menuData.some(item => {
- if (key) {
- return item.key === key || item.path === key;
- }
- return false;
- });
- };
-
- handleOpenChange = openKeys => {
- const moreThanOne = openKeys.filter(openKey => this.isMainMenu(openKey)).length > 1;
- this.setState({
- openKeys: moreThanOne ? [openKeys.pop()] : [...openKeys],
- });
- };
-
- render() {
- const { logo, collapsed, onCollapse, fixSiderbar, theme } = this.props;
- const { openKeys } = this.state;
- const defaultProps = collapsed ? {} : { openKeys };
-
- const siderClassName = classNames(styles.sider, {
- [styles.fixSiderbar]: fixSiderbar,
- [styles.light]: theme === 'light',
- });
-
- return (
-
-
-
-
-
Logging Center
-
-
-
-
- );
- }
-}
diff --git a/app/web/src/components/SiderMenu/SiderMenu.test.js b/app/web/src/components/SiderMenu/SiderMenu.test.js
deleted file mode 100644
index 8f01f669..00000000
--- a/app/web/src/components/SiderMenu/SiderMenu.test.js
+++ /dev/null
@@ -1,72 +0,0 @@
-import { urlToList } from '../_utils/pathTools';
-import { getFlatMenuKeys, getMenuMatchKeys } from './SiderMenu';
-
-const menu = [
- {
- path: '/dashboard',
- children: [
- {
- path: '/dashboard/name',
- },
- ],
- },
- {
- path: '/userinfo',
- children: [
- {
- path: '/userinfo/:id',
- children: [
- {
- path: '/userinfo/:id/info',
- },
- ],
- },
- ],
- },
-];
-
-const flatMenuKeys = getFlatMenuKeys(menu);
-
-describe('test convert nested menu to flat menu', () => {
- it('simple menu', () => {
- expect(flatMenuKeys).toEqual([
- '/dashboard',
- '/dashboard/name',
- '/userinfo',
- '/userinfo/:id',
- '/userinfo/:id/info',
- ]);
- });
-});
-
-describe('test menu match', () => {
- it('simple path', () => {
- expect(getMenuMatchKeys(flatMenuKeys, urlToList('/dashboard'))).toEqual(['/dashboard']);
- });
-
- it('error path', () => {
- expect(getMenuMatchKeys(flatMenuKeys, urlToList('/dashboardname'))).toEqual([]);
- });
-
- it('Secondary path', () => {
- expect(getMenuMatchKeys(flatMenuKeys, urlToList('/dashboard/name'))).toEqual([
- '/dashboard',
- '/dashboard/name',
- ]);
- });
-
- it('Parameter path', () => {
- expect(getMenuMatchKeys(flatMenuKeys, urlToList('/userinfo/2144'))).toEqual([
- '/userinfo',
- '/userinfo/:id',
- ]);
- });
-
- it('three parameter path', () => {
- expect(getMenuMatchKeys(flatMenuKeys, urlToList('/userinfo/2144/info'))).toEqual([
- '/userinfo',
- '/userinfo/:id',
- '/userinfo/:id/info',
- ]);
- });
-});
diff --git a/app/web/src/components/SiderMenu/index.js b/app/web/src/components/SiderMenu/index.js
deleted file mode 100644
index bc803db4..00000000
--- a/app/web/src/components/SiderMenu/index.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import React from 'react';
-import { Drawer } from 'antd';
-import SiderMenu from './SiderMenu';
-
-/**
- * Recursively flatten the data
- * [{path:string},{path:string}] => {path,path2}
- * @param menus
- */
-const getFlatMenuKeys = menuData => {
- let keys = [];
- menuData.forEach(item => {
- if (item.children) {
- keys = keys.concat(getFlatMenuKeys(item.children));
- }
- keys.push(item.path);
- });
- return keys;
-};
-
-const SiderMenuWrapper = props => {
- const { isMobile, menuData, collapsed, onCollapse } = props;
- return isMobile ? (
- onCollapse(true)}
- style={{
- padding: 0,
- height: '100vh',
- }}
- >
-
-
- ) : (
-
- );
-};
-
-export default SiderMenuWrapper;
diff --git a/app/web/src/components/SiderMenu/index.less b/app/web/src/components/SiderMenu/index.less
deleted file mode 100644
index 06d5f6ab..00000000
--- a/app/web/src/components/SiderMenu/index.less
+++ /dev/null
@@ -1,91 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-@nav-header-height: 64px;
-
-.logo {
- height: @nav-header-height;
- position: relative;
- line-height: @nav-header-height;
- padding-left: (@menu-collapsed-width - 32px) / 2;
- transition: all 0.3s;
- background: #002140;
- overflow: hidden;
- img {
- display: inline-block;
- vertical-align: middle;
- height: 32px;
- }
- h1 {
- color: white;
- display: inline-block;
- vertical-align: middle;
- font-size: 20px;
- margin: 0 0 0 12px;
- font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
- font-weight: 600;
- }
-}
-
-.sider {
- min-height: 100vh;
- box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
- position: relative;
- z-index: 10;
- &.fixSiderbar {
- position: fixed;
- top: 0;
- left: 0;
- :global(.ant-menu-root) {
- overflow-y: auto;
- height: ~'calc(100vh - @{nav-header-height})';
- }
- }
- &.light {
- box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
- background-color: white;
- .logo {
- background: white;
- box-shadow: 1px 1px 0 0 @border-color-split;
- h1 {
- color: @primary-color;
- }
- }
- :global(.ant-menu-light) {
- border-right-color: transparent;
- }
- }
-}
-
-.icon {
- width: 14px;
- margin-right: 10px;
-}
-
-:global {
- .top-nav-menu li.ant-menu-item {
- height: @nav-header-height;
- line-height: @nav-header-height;
- }
- .drawer .drawer-content {
- 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 0.3s @ease-in-out, width 0.3s @ease-in-out;
- opacity: 1;
- }
-}
diff --git a/app/web/src/components/StandardFormRow/index.js b/app/web/src/components/StandardFormRow/index.js
deleted file mode 100644
index 8cb0e444..00000000
--- a/app/web/src/components/StandardFormRow/index.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
- const cls = classNames(styles.standardFormRow, {
- [styles.standardFormRowBlock]: block,
- [styles.standardFormRowLast]: last,
- [styles.standardFormRowGrid]: grid,
- });
-
- return (
-
- {title && (
-
- {title}
-
- )}
-
{children}
-
- );
-};
-
-export default StandardFormRow;
diff --git a/app/web/src/components/StandardFormRow/index.less b/app/web/src/components/StandardFormRow/index.less
deleted file mode 100644
index 83ab019f..00000000
--- a/app/web/src/components/StandardFormRow/index.less
+++ /dev/null
@@ -1,72 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.standardFormRow {
- border-bottom: 1px dashed @border-color-split;
- padding-bottom: 16px;
- margin-bottom: 16px;
- display: flex;
- :global {
- .ant-form-item {
- margin-right: 24px;
- }
- .ant-form-item-label label {
- color: @text-color;
- margin-right: 0;
- }
- .ant-form-item-label,
- .ant-form-item-control {
- padding: 0;
- line-height: 32px;
- }
- }
- .label {
- color: @heading-color;
- font-size: @font-size-base;
- margin-right: 24px;
- flex: 0 0 auto;
- text-align: right;
- & > span {
- display: inline-block;
- height: 32px;
- line-height: 32px;
- &:after {
- content: ':';
- }
- }
- }
- .content {
- flex: 1 1 0;
- :global {
- .ant-form-item:last-child {
- margin-right: 0;
- }
- }
- }
-}
-
-.standardFormRowLast {
- border: none;
- padding-bottom: 0;
- margin-bottom: 0;
-}
-
-.standardFormRowBlock {
- :global {
- .ant-form-item,
- div.ant-form-item-control-wrapper {
- display: block;
- }
- }
-}
-
-.standardFormRowGrid {
- :global {
- .ant-form-item,
- div.ant-form-item-control-wrapper {
- display: block;
- }
- .ant-form-item-label {
- float: left;
- }
- }
-}
diff --git a/app/web/src/components/StandardTable/index.js b/app/web/src/components/StandardTable/index.js
deleted file mode 100644
index 9e8c85ad..00000000
--- a/app/web/src/components/StandardTable/index.js
+++ /dev/null
@@ -1,126 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { Table, Alert } from 'antd';
-import styles from './index.less';
-
-function initTotalList(columns) {
- const totalList = [];
- columns.forEach(column => {
- if (column.needTotal) {
- totalList.push({ ...column, total: 0 });
- }
- });
- return totalList;
-}
-
-class StandardTable extends PureComponent {
- constructor(props) {
- super(props);
- const { columns } = props;
- const needTotalList = initTotalList(columns);
-
- this.state = {
- selectedRowKeys: [],
- needTotalList,
- };
- }
-
- static getDerivedStateFromProps(nextProps) {
- // clean state
- if (nextProps.selectedRows.length === 0) {
- const needTotalList = initTotalList(nextProps.columns);
- return {
- selectedRowKeys: [],
- needTotalList,
- };
- }
- return null;
- }
-
- handleRowSelectChange = (selectedRowKeys, selectedRows) => {
- let { needTotalList } = this.state;
- needTotalList = needTotalList.map(item => ({
- ...item,
- total: selectedRows.reduce((sum, val) => sum + parseFloat(val[item.dataIndex], 10), 0),
- }));
- const { onSelectRow } = this.props;
- if (onSelectRow) {
- onSelectRow(selectedRows);
- }
-
- this.setState({ selectedRowKeys, needTotalList });
- };
-
- handleTableChange = (pagination, filters, sorter) => {
- const { onChange } = this.props;
- if (onChange) {
- onChange(pagination, filters, sorter);
- }
- };
-
- cleanSelectedKeys = () => {
- this.handleRowSelectChange([], []);
- };
-
- render() {
- const { selectedRowKeys, needTotalList } = this.state;
- const {
- data: { list, pagination },
- loading,
- columns,
- rowKey,
- } = this.props;
-
- const paginationProps = {
- showSizeChanger: true,
- showQuickJumper: true,
- ...pagination,
- };
-
- const rowSelection = {
- selectedRowKeys,
- onChange: this.handleRowSelectChange,
- getCheckboxProps: record => ({
- disabled: record.disabled,
- }),
- };
-
- return (
-
-
-
- 已选择 {selectedRowKeys.length} 项
- {needTotalList.map(item => (
-
- {item.title}
- 总计
-
- {item.render ? item.render(item.total) : item.total}
-
-
- ))}
-
- 清空
-
-
- }
- type="info"
- showIcon
- />
-
-
-
- );
- }
-}
-
-export default StandardTable;
diff --git a/app/web/src/components/StandardTable/index.less b/app/web/src/components/StandardTable/index.less
deleted file mode 100644
index 817be991..00000000
--- a/app/web/src/components/StandardTable/index.less
+++ /dev/null
@@ -1,13 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.standardTable {
- :global {
- .ant-table-pagination {
- margin-top: 24px;
- }
- }
-
- .tableAlert {
- margin-bottom: 16px;
- }
-}
diff --git a/app/web/src/components/TagSelect/TagSelectOption.d.ts b/app/web/src/components/TagSelect/TagSelectOption.d.ts
deleted file mode 100644
index 366b297a..00000000
--- a/app/web/src/components/TagSelect/TagSelectOption.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import * as React from 'react';
-
-export interface ITagSelectOptionProps {
- value: string | number;
- style?: React.CSSProperties;
-}
-
-export default class TagSelectOption extends React.Component {}
diff --git a/app/web/src/components/TagSelect/demo/controlled.md b/app/web/src/components/TagSelect/demo/controlled.md
deleted file mode 100644
index 4e9defa7..00000000
--- a/app/web/src/components/TagSelect/demo/controlled.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-order: 3
-title: 受控模式
----
-
-结合 `Tag` 的 `TagSelect` 组件,方便的应用于筛选类目的业务场景中。
-
-```jsx
-import { Button } from 'antd';
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-
-class Demo extends React.Component {
- state = {
- value: ['cat1'],
- };
- handleFormSubmit = value => {
- this.setState({
- value,
- });
- };
- checkAll = () => {
- this.setState({
- value: ['cat1', 'cat2', 'cat3', 'cat4', 'cat5', 'cat6'],
- });
- };
- render() {
- return (
-
-
全部
-
-
- 类目一
- 类目二
- 类目三
- 类目四
- 类目五
- 类目六
-
-
-
- );
- }
-}
-
-ReactDOM.render( , mountNode);
-```
diff --git a/app/web/src/components/TagSelect/demo/expandable.md b/app/web/src/components/TagSelect/demo/expandable.md
deleted file mode 100644
index c45a30a3..00000000
--- a/app/web/src/components/TagSelect/demo/expandable.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-order: 1
-title: 可展开和收起
----
-
-使用 `expandable` 属性,让标签组可以收起,避免过高。
-
-````jsx
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-
-function handleFormSubmit(checkedValue) {
- console.log(checkedValue);
-}
-
-ReactDOM.render(
-
- 类目一
- 类目二
- 类目三
- 类目四
- 类目五
- 类目六
- 类目七
- 类目八
- 类目九
- 类目十
- 类目十一
- 类目十二
-
-, mountNode);
-````
diff --git a/app/web/src/components/TagSelect/demo/simple.md b/app/web/src/components/TagSelect/demo/simple.md
deleted file mode 100644
index 9e7a13a4..00000000
--- a/app/web/src/components/TagSelect/demo/simple.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-order: 0
-title: 基础样例
----
-
-结合 `Tag` 的 `TagSelect` 组件,方便的应用于筛选类目的业务场景中。
-
-````jsx
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-
-function handleFormSubmit(checkedValue) {
- console.log(checkedValue);
-}
-
-ReactDOM.render(
-
- 类目一
- 类目二
- 类目三
- 类目四
- 类目五
- 类目六
-
-, mountNode);
-````
diff --git a/app/web/src/components/TagSelect/index.d.ts b/app/web/src/components/TagSelect/index.d.ts
deleted file mode 100644
index 736ca52f..00000000
--- a/app/web/src/components/TagSelect/index.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import * as React from 'react';
-import TagSelectOption from './TagSelectOption';
-
-export interface ITagSelectProps {
- onChange?: (value: string[]) => void;
- expandable?: boolean;
- value?: string[] | number[];
- style?: React.CSSProperties;
- hideCheckAll?: boolean;
-}
-
-export default class TagSelect extends React.Component {
- public static Option: typeof TagSelectOption;
- private children:
- | React.ReactElement
- | Array>;
-}
diff --git a/app/web/src/components/TagSelect/index.js b/app/web/src/components/TagSelect/index.js
deleted file mode 100644
index c36cd672..00000000
--- a/app/web/src/components/TagSelect/index.js
+++ /dev/null
@@ -1,130 +0,0 @@
-import React, { Component } from 'react';
-import classNames from 'classnames';
-import { Tag, Icon } from 'antd';
-
-import styles from './index.less';
-
-const { CheckableTag } = Tag;
-
-const TagSelectOption = ({ children, checked, onChange, value }) => (
- onChange(value, state)}>
- {children}
-
-);
-
-TagSelectOption.isTagSelectOption = true;
-
-class TagSelect extends Component {
- static defaultProps = {
- hideCheckAll: false,
- };
-
- constructor(props) {
- super(props);
- this.state = {
- expand: false,
- value: props.value || props.defaultValue || [],
- };
- }
-
- static getDerivedStateFromProps(nextProps) {
- if ('value' in nextProps && nextProps.value) {
- return { value: nextProps.value };
- }
- return null;
- }
-
- onChange = value => {
- const { onChange } = this.props;
- if (!('value' in this.props)) {
- this.setState({ value });
- }
- if (onChange) {
- onChange(value);
- }
- };
-
- onSelectAll = checked => {
- let checkedTags = [];
- if (checked) {
- checkedTags = this.getAllTags();
- }
- this.onChange(checkedTags);
- };
-
- getAllTags() {
- let { children } = this.props;
- children = React.Children.toArray(children);
- const checkedTags = children
- .filter(child => this.isTagSelectOption(child))
- .map(child => child.props.value);
- return checkedTags || [];
- }
-
- handleTagChange = (value, checked) => {
- const { value: StateValue } = this.state;
- const checkedTags = [...StateValue];
-
- const index = checkedTags.indexOf(value);
- if (checked && index === -1) {
- checkedTags.push(value);
- } else if (!checked && index > -1) {
- checkedTags.splice(index, 1);
- }
- this.onChange(checkedTags);
- };
-
- handleExpand = () => {
- const { expand } = this.state;
- this.setState({
- expand: !expand,
- });
- };
-
- isTagSelectOption = node =>
- node &&
- node.type &&
- (node.type.isTagSelectOption || node.type.displayName === 'TagSelectOption');
-
- render() {
- const { value, expand } = this.state;
- const { children, hideCheckAll, className, style, expandable } = this.props;
-
- const checkedAll = this.getAllTags().length === value.length;
-
- const cls = classNames(styles.tagSelect, className, {
- [styles.hasExpandTag]: expandable,
- [styles.expanded]: expand,
- });
- return (
-
- {hideCheckAll ? null : (
-
- 全部
-
- )}
- {value &&
- React.Children.map(children, child => {
- if (this.isTagSelectOption(child)) {
- return React.cloneElement(child, {
- key: `tag-select-${child.props.value}`,
- value: child.props.value,
- checked: value.indexOf(child.props.value) > -1,
- onChange: this.handleTagChange,
- });
- }
- return child;
- })}
- {expandable && (
-
- {expand ? '收起' : '展开'}
-
- )}
-
- );
- }
-}
-
-TagSelect.Option = TagSelectOption;
-
-export default TagSelect;
diff --git a/app/web/src/components/TagSelect/index.less b/app/web/src/components/TagSelect/index.less
deleted file mode 100644
index 834b39a6..00000000
--- a/app/web/src/components/TagSelect/index.less
+++ /dev/null
@@ -1,33 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.tagSelect {
- user-select: none;
- margin-left: -8px;
- position: relative;
- overflow: hidden;
- max-height: 32px;
- line-height: 32px;
- transition: all 0.3s;
- :global {
- .ant-tag {
- padding: 0 8px;
- margin-right: 24px;
- font-size: @font-size-base;
- }
- }
- &.expanded {
- transition: all 0.3s;
- max-height: 200px;
- }
- .trigger {
- position: absolute;
- top: 0;
- right: 0;
- i {
- font-size: 12px;
- }
- }
- &.hasExpandTag {
- padding-right: 50px;
- }
-}
diff --git a/app/web/src/components/TagSelect/index.md b/app/web/src/components/TagSelect/index.md
deleted file mode 100644
index 25a42b57..00000000
--- a/app/web/src/components/TagSelect/index.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title:
- en-US: TagSelect
- zh-CN: TagSelect
-subtitle: 标签选择器
-cols: 1
-order: 13
----
-
-可进行多选,带折叠收起和展开更多功能,常用于对列表进行筛选。
-
-## API
-
-### TagSelect
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| value |选中的项 |string[] \| number[] | |
-| defaultValue |默认选中的项 |string[] \| number[] | |
-| onChange | 标签选择的回调函数 | Function(checkedTags) | |
-| expandable | 是否展示 `展开/收起` 按钮 | Boolean | false |
-| hideCheckAll | 隐藏 `全部` 按钮 | Boolean | false |
-
-### TagSelectOption
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| value | TagSelect的值 | string\| number | - |
-| children | tag的内容 | string \| ReactNode | - |
diff --git a/app/web/src/components/TopNavHeader/index.js b/app/web/src/components/TopNavHeader/index.js
deleted file mode 100644
index b2dbf818..00000000
--- a/app/web/src/components/TopNavHeader/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import React, { PureComponent } from 'react';
-import {Link} from 'umi';
-import RightContent from '../GlobalHeader/RightContent';
-import BaseMenu from '../SiderMenu/BaseMenu';
-import styles from './index.less';
-
-export default class TopNavHeader extends PureComponent {
- state = {
- maxWidth: undefined,
- };
-
- static getDerivedStateFromProps(props) {
- return {
- maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 280 - 165 - 40,
- };
- }
-
- render() {
- const { theme, contentWidth, logo } = this.props;
- const { maxWidth } = this.state;
- return (
-
-
{
- this.maim = ref;
- }}
- className={`${styles.main} ${contentWidth === 'Fixed' ? styles.wide : ''}`}
- >
-
-
-
-
-
Logging Center
-
-
-
-
-
-
-
-
-
- );
- }
-}
diff --git a/app/web/src/components/TopNavHeader/index.less b/app/web/src/components/TopNavHeader/index.less
deleted file mode 100644
index 9883019e..00000000
--- a/app/web/src/components/TopNavHeader/index.less
+++ /dev/null
@@ -1,64 +0,0 @@
-.head {
- width: 100%;
- transition: background 0.3s, width 0.2s;
- height: 64px;
- box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
- position: relative;
- :global {
- .ant-menu-submenu.ant-menu-submenu-horizontal {
- line-height: 64px;
- height: 100%;
- .ant-menu-submenu-title {
- height: 100%;
- }
- }
- }
- &.light {
- background-color: #fff;
- }
- .main {
- display: flex;
- height: 64px;
- padding-left: 24px;
- &.wide {
- max-width: 1200px;
- margin: auto;
- padding-left: 0;
- }
- .left {
- flex: 1;
- display: flex;
- }
- .right {
- width: 324px;
- }
- }
-}
-
-.logo {
- width: 165px;
- height: 64px;
- position: relative;
- line-height: 64px;
- transition: all 0.3s;
- overflow: hidden;
- img {
- display: inline-block;
- vertical-align: middle;
- height: 32px;
- }
- h1 {
- color: #fff;
- display: inline-block;
- vertical-align: top;
- font-size: 16px;
- margin: 0 0 0 12px;
- font-weight: 400;
- }
-}
-
-.light {
- h1 {
- color: #002140;
- }
-}
diff --git a/app/web/src/components/Trend/demo/basic.md b/app/web/src/components/Trend/demo/basic.md
deleted file mode 100644
index 63c415dc..00000000
--- a/app/web/src/components/Trend/demo/basic.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-order: 0
-title: 演示
----
-
-在数值背后添加一个小图标来标识涨跌情况。
-
-````jsx
-import Trend from 'ant-design-pro/lib/Trend';
-
-ReactDOM.render(
-
- 12%
- 11%
-
-, mountNode);
-````
diff --git a/app/web/src/components/Trend/demo/reverse.md b/app/web/src/components/Trend/demo/reverse.md
deleted file mode 100644
index 143ed023..00000000
--- a/app/web/src/components/Trend/demo/reverse.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-order: 0
-title: 颜色反转
----
-
-在数值背后添加一个小图标来标识涨跌情况。
-
-````jsx
-import Trend from 'ant-design-pro/lib/Trend';
-
-ReactDOM.render(
-
- 12%
- 11%
-
-, mountNode);
-````
diff --git a/app/web/src/components/Trend/index.d.ts b/app/web/src/components/Trend/index.d.ts
deleted file mode 100644
index 7dc02010..00000000
--- a/app/web/src/components/Trend/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-
-export interface ITrendProps {
- colorful?: boolean;
- flag: 'up' | 'down';
- style?: React.CSSProperties;
- reverseColor?: boolean;
-}
-
-export default class Trend extends React.Component {}
diff --git a/app/web/src/components/Trend/index.js b/app/web/src/components/Trend/index.js
deleted file mode 100644
index 1cdceb2e..00000000
--- a/app/web/src/components/Trend/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import { Icon } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const Trend = ({ colorful = true, reverseColor = false, flag, children, className, ...rest }) => {
- const classString = classNames(
- styles.trendItem,
- {
- [styles.trendItemGrey]: !colorful,
- [styles.reverseColor]: reverseColor && colorful,
- },
- className
- );
- return (
-
- {children}
- {flag && (
-
-
-
- )}
-
- );
-};
-
-export default Trend;
diff --git a/app/web/src/components/Trend/index.less b/app/web/src/components/Trend/index.less
deleted file mode 100644
index b14b802c..00000000
--- a/app/web/src/components/Trend/index.less
+++ /dev/null
@@ -1,37 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.trendItem {
- display: inline-block;
- font-size: @font-size-base;
- line-height: 22px;
-
- .up,
- .down {
- margin-left: 4px;
- position: relative;
- top: 1px;
- i {
- font-size: 12px;
- transform: scale(0.83);
- }
- }
- .up {
- color: @red-6;
- }
- .down {
- color: @green-6;
- top: -1px;
- }
-
- &.trendItemGrey .up,
- &.trendItemGrey .down {
- color: @text-color;
- }
-
- &.reverseColor .up {
- color: @green-6;
- }
- &.reverseColor .down {
- color: @red-6;
- }
-}
diff --git a/app/web/src/components/Trend/index.md b/app/web/src/components/Trend/index.md
deleted file mode 100644
index 3e3ac07a..00000000
--- a/app/web/src/components/Trend/index.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title:
- en-US: Trend
- zh-CN: Trend
-subtitle: 趋势标记
-cols: 1
-order: 14
----
-
-趋势符号,标记上升和下降趋势。通常用绿色代表“好”,红色代表“不好”,股票涨跌场景除外。
-
-## API
-
-```html
-50%
-```
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| colorful | 是否彩色标记 | Boolean | true |
-| flag | 上升下降标识:`up|down` | string | - |
-| reverseColor | 颜色反转 | Boolean | false |
diff --git a/app/web/src/components/_utils/pathTools.js b/app/web/src/components/_utils/pathTools.js
deleted file mode 100644
index bfb94e74..00000000
--- a/app/web/src/components/_utils/pathTools.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// /userinfo/2144/id => ['/userinfo','/useinfo/2144,'/userindo/2144/id']
-// eslint-disable-next-line import/prefer-default-export
-export function urlToList(url) {
- const urllist = url.split('/').filter(i => i);
- return urllist.map((urlItem, index) => `/${urllist.slice(0, index + 1).join('/')}`);
-}
diff --git a/app/web/src/components/_utils/pathTools.test.js b/app/web/src/components/_utils/pathTools.test.js
deleted file mode 100644
index a9b93155..00000000
--- a/app/web/src/components/_utils/pathTools.test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { urlToList } from './pathTools';
-
-describe('test urlToList', () => {
- it('A path', () => {
- expect(urlToList('/userinfo')).toEqual(['/userinfo']);
- });
- it('Secondary path', () => {
- expect(urlToList('/userinfo/2144')).toEqual(['/userinfo', '/userinfo/2144']);
- });
- it('Three paths', () => {
- expect(urlToList('/userinfo/2144/addr')).toEqual([
- '/userinfo',
- '/userinfo/2144',
- '/userinfo/2144/addr',
- ]);
- });
-});
diff --git a/app/web/src/defaultSettings.js b/app/web/src/defaultSettings.js
deleted file mode 100644
index c254c74e..00000000
--- a/app/web/src/defaultSettings.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.exports = {
- navTheme: 'dark', // theme for nav menu
- primaryColor: '#1890FF', // primary color of ant design
- layout: 'sidemenu', // nav menu position: sidemenu or topmenu
- contentWidth: 'Fluid', // layout of content: Fluid or Fixed, only works when layout is topmenu
- fixedHeader: false, // sticky header
- autoHideHeader: false, // auto hide header
- fixSiderbar: false, // sticky siderbar
-};
diff --git a/app/web/src/layouts/BasicLayout.js b/app/web/src/layouts/BasicLayout.js
deleted file mode 100644
index 989c54f2..00000000
--- a/app/web/src/layouts/BasicLayout.js
+++ /dev/null
@@ -1,297 +0,0 @@
-import React from 'react';
-import { Layout } from 'antd';
-import DocumentTitle from 'react-document-title';
-import isEqual from 'lodash/isEqual';
-import memoizeOne from 'memoize-one';
-import { connect } from 'dva';
-import { ContainerQuery } from 'react-container-query';
-import classNames from 'classnames';
-import pathToRegexp from 'path-to-regexp';
-import { enquireScreen, unenquireScreen } from 'enquire-js';
-import { formatMessage } from 'umi';
-import SiderMenu from '@/components/SiderMenu';
-import Authorized from '@/utils/Authorized';
-import SettingDrawer from '@/components/SettingDrawer';
-import logo from '../assets/logo.svg';
-import Footer from './Footer';
-import Header from './Header';
-import Context from './MenuContext';
-import Exception403 from '../pages/Exception/403';
-
-
-const { Content } = Layout;
-
-// Conversion router to menu.
-function formatter(data, parentAuthority, parentName) {
- return data
- .map(item => {
- let locale = 'menu';
- if (parentName && item.name) {
- locale = `${parentName}.${item.name}`;
- } else if (item.name) {
- locale = `menu.${item.name}`;
- } else if (parentName) {
- locale = parentName;
- }
- if (item.path) {
- const result = {
- ...item,
- locale,
- authority: item.authority || parentAuthority,
- };
- if (item.routes) {
- const children = formatter(item.routes, item.authority, locale);
- // Reduce memory usage
- result.children = children;
- }
- delete result.routes;
- return result;
- }
-
- return null;
- })
- .filter(item => item);
-}
-
-const memoizeOneFormatter = memoizeOne(formatter, isEqual);
-
-const query = {
- 'screen-xs': {
- maxWidth: 575,
- },
- 'screen-sm': {
- minWidth: 576,
- maxWidth: 767,
- },
- 'screen-md': {
- minWidth: 768,
- maxWidth: 991,
- },
- 'screen-lg': {
- minWidth: 992,
- maxWidth: 1199,
- },
- 'screen-xl': {
- minWidth: 1200,
- maxWidth: 1599,
- },
- 'screen-xxl': {
- minWidth: 1600,
- },
-};
-
-class BasicLayout extends React.PureComponent {
- constructor(props) {
- super(props);
- this.getPageTitle = memoizeOne(this.getPageTitle);
- this.getBreadcrumbNameMap = memoizeOne(this.getBreadcrumbNameMap, isEqual);
- this.breadcrumbNameMap = this.getBreadcrumbNameMap();
- this.matchParamsPath = memoizeOne(this.matchParamsPath, isEqual);
- }
-
- state = {
- rendering: true,
- isMobile: false,
- menuData: this.getMenuData(),
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'user/fetchCurrent',
- });
- dispatch({
- type: 'setting/getSetting',
- });
- this.renderRef = requestAnimationFrame(() => {
- this.setState({
- rendering: false,
- });
- });
- this.enquireHandler = enquireScreen(mobile => {
- const { isMobile } = this.state;
- if (isMobile !== mobile) {
- this.setState({
- isMobile: mobile,
- });
- }
- });
- }
-
- componentDidUpdate(preProps) {
- // After changing to phone mode,
- // if collapsed is true, you need to click twice to display
- this.breadcrumbNameMap = this.getBreadcrumbNameMap();
- const { isMobile } = this.state;
- const { collapsed } = this.props;
- if (isMobile && !preProps.isMobile && !collapsed) {
- this.handleMenuCollapse(false);
- }
- }
-
- componentWillUnmount() {
- cancelAnimationFrame(this.renderRef);
- unenquireScreen(this.enquireHandler);
- }
-
- getContext() {
- const { location } = this.props;
- return {
- location,
- breadcrumbNameMap: this.breadcrumbNameMap,
- };
- }
-
- getMenuData() {
- const {
- route: { routes },
- } = this.props;
- return memoizeOneFormatter(routes);
- }
-
- /**
- * 获取面包屑映射
- * @param {Object} menuData 菜单配置
- */
- getBreadcrumbNameMap() {
- const routerMap = {};
- const mergeMenuAndRouter = data => {
- data.forEach(menuItem => {
- if (menuItem.children) {
- mergeMenuAndRouter(menuItem.children);
- }
- // Reduce memory usage
- routerMap[menuItem.path] = menuItem;
- });
- };
- mergeMenuAndRouter(this.getMenuData());
- return routerMap;
- }
-
- matchParamsPath = pathname => {
- const pathKey = Object.keys(this.breadcrumbNameMap).find(key =>
- pathToRegexp(key).test(pathname)
- );
- return this.breadcrumbNameMap[pathKey];
- };
-
- getPageTitle = pathname => {
- const currRouterData = this.matchParamsPath(pathname);
-
- if (!currRouterData) {
- return 'Logging Center';
- }
- const message = formatMessage({
- id: currRouterData.locale || currRouterData.name,
- defaultMessage: currRouterData.name,
- });
- return `${message} - Logging Center`;
- };
-
- getLayoutStyle = () => {
- const { isMobile } = this.state;
- const { fixSiderbar, collapsed, layout } = this.props;
- if (fixSiderbar && layout !== 'topmenu' && !isMobile) {
- return {
- paddingLeft: collapsed ? '80px' : '256px',
- };
- }
- return null;
- };
-
- getContentStyle = () => {
- const { fixedHeader } = this.props;
- return {
- margin: '24px 24px 0',
- paddingTop: fixedHeader ? 64 : 0,
- };
- };
-
- handleMenuCollapse = collapsed => {
- const { dispatch } = this.props;
- dispatch({
- type: 'global/changeLayoutCollapsed',
- payload: collapsed,
- });
- };
-
- renderSettingDrawer() {
- // Do not render SettingDrawer in production
- // unless it is deployed in preview.pro.ant.design as demo
- const { rendering } = this.state;
- if ((rendering || process.env.NODE_ENV === 'production') && APP_TYPE !== 'site') {
- return null;
- }
- return ;
- }
-
- render() {
- const {
- navTheme,
- layout: PropsLayout,
- children,
- location: { pathname },
- } = this.props;
- const { isMobile, menuData } = this.state;
- const isTop = PropsLayout === 'topmenu';
- const routerConfig = this.matchParamsPath(pathname);
- const layout = (
-
- {isTop && !isMobile ? null : (
-
- )}
-
-
-
- }
- >
- {children}
-
-
-
-
-
- );
- return (
-
-
-
- {params => (
-
- {layout}
-
- )}
-
-
- {this.renderSettingDrawer()}
-
- );
- }
-}
-
-export default connect(({ global, setting }) => ({
- collapsed: global.collapsed,
- layout: setting.layout,
- ...setting,
-}))(BasicLayout);
diff --git a/app/web/src/layouts/BlankLayout.js b/app/web/src/layouts/BlankLayout.js
deleted file mode 100644
index 505270f8..00000000
--- a/app/web/src/layouts/BlankLayout.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import React from 'react';
-
-export default props =>
;
diff --git a/app/web/src/layouts/Footer.js b/app/web/src/layouts/Footer.js
deleted file mode 100644
index ae3380a7..00000000
--- a/app/web/src/layouts/Footer.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import React, { Fragment } from 'react';
-import { Layout, Icon } from 'antd';
-import GlobalFooter from '@/components/GlobalFooter';
-
-const { Footer } = Layout;
-const FooterView = () => (
-
- ,
- href: 'https://github.com/ant-design/ant-design-pro',
- blankTarget: true,
- },
- {
- key: 'Ant Design',
- title: 'Ant Design',
- href: 'https://ant.design',
- blankTarget: true,
- },*/
- ]}
- copyright={
-
- ©INFINI, All Rights Reserved.
-
- }
- />
-
-);
-export default FooterView;
diff --git a/app/web/src/layouts/Header.js b/app/web/src/layouts/Header.js
deleted file mode 100644
index 73463f91..00000000
--- a/app/web/src/layouts/Header.js
+++ /dev/null
@@ -1,161 +0,0 @@
-import React, { PureComponent } from 'react';
-import { formatMessage } from 'umi';
-import { Layout, message } from 'antd';
-import Animate from 'rc-animate';
-import { connect } from 'dva';
-import {history} from 'umi';
-import GlobalHeader from '@/components/GlobalHeader';
-import TopNavHeader from '@/components/TopNavHeader';
-import styles from './Header.less';
-import Authorized from '@/utils/Authorized';
-
-const { Header } = Layout;
-
-class HeaderView extends PureComponent {
- state = {
- visible: true,
- };
-
- static getDerivedStateFromProps(props, state) {
- if (!props.autoHideHeader && !state.visible) {
- return {
- visible: true,
- };
- }
- return null;
- }
-
- componentDidMount() {
- document.addEventListener('scroll', this.handScroll, { passive: true });
- }
-
- componentWillUnmount() {
- document.removeEventListener('scroll', this.handScroll);
- }
-
- getHeadWidth = () => {
- const { isMobile, collapsed, setting } = this.props;
- const { fixedHeader, layout } = setting;
- if (isMobile || !fixedHeader || layout === 'topmenu') {
- return '100%';
- }
- return collapsed ? 'calc(100% - 80px)' : 'calc(100% - 256px)';
- };
-
- handleNoticeClear = type => {
- message.success(`${formatMessage({ id: 'component.noticeIcon.cleared' })} ${formatMessage({ id: `component.globalHeader.${type}` })}`);
- const { dispatch } = this.props;
- dispatch({
- type: 'global/clearNotices',
- payload: type,
- });
- };
-
- handleMenuClick = ({ key }) => {
- const { dispatch } = this.props;
- if (key === 'userCenter') {
- history.push('/account/center');
- return;
- }
- if (key === 'triggerError') {
- history.push('/exception/trigger');
- return;
- }
- if (key === 'userinfo') {
- history.push('/account/settings/base');
- return;
- }
- if (key === 'logout') {
- dispatch({
- type: 'login/logout',
- });
- }
- };
-
- handleNoticeVisibleChange = visible => {
- if (visible) {
- const { dispatch } = this.props;
- dispatch({
- type: 'global/fetchNotices',
- });
- }
- };
-
- handScroll = () => {
- const { autoHideHeader } = this.props;
- const { visible } = this.state;
- if (!autoHideHeader) {
- return;
- }
- const scrollTop = document.body.scrollTop + document.documentElement.scrollTop;
- if (!this.ticking) {
- requestAnimationFrame(() => {
- if (this.oldScrollTop > scrollTop) {
- this.setState({
- visible: true,
- });
- this.scrollTop = scrollTop;
- return;
- }
- if (scrollTop > 300 && visible) {
- this.setState({
- visible: false,
- });
- }
- if (scrollTop < 300 && !visible) {
- this.setState({
- visible: true,
- });
- }
- this.oldScrollTop = scrollTop;
- this.ticking = false;
- });
- }
- this.ticking = false;
- };
-
- render() {
- const { isMobile, handleMenuCollapse, setting } = this.props;
- const { navTheme, layout, fixedHeader } = setting;
- const { visible } = this.state;
- const isTop = layout === 'topmenu';
- const width = this.getHeadWidth();
- const HeaderDom = visible ? (
-
- {isTop && !isMobile ? (
-
- ) : (
-
- )}
-
- ) : null;
- return (
-
- {HeaderDom}
-
- );
- }
-}
-
-export default connect(({ user, global, setting, loading }) => ({
- currentUser: user.currentUser,
- collapsed: global.collapsed,
- fetchingNotices: loading.effects['global/fetchNotices'],
- notices: global.notices,
- setting,
-}))(HeaderView);
diff --git a/app/web/src/layouts/Header.less b/app/web/src/layouts/Header.less
deleted file mode 100644
index 394bfda1..00000000
--- a/app/web/src/layouts/Header.less
+++ /dev/null
@@ -1,8 +0,0 @@
-.fixedHeader {
- position: fixed;
- top: 0;
- right: 0;
- width: 100%;
- z-index: 9;
- transition: width 0.2s;
-}
diff --git a/app/web/src/layouts/MenuContext.js b/app/web/src/layouts/MenuContext.js
deleted file mode 100644
index 860f1068..00000000
--- a/app/web/src/layouts/MenuContext.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { createContext } from 'react';
-
-export default createContext();
diff --git a/app/web/src/layouts/UserLayout.js b/app/web/src/layouts/UserLayout.js
deleted file mode 100644
index 81f51d95..00000000
--- a/app/web/src/layouts/UserLayout.js
+++ /dev/null
@@ -1,72 +0,0 @@
-import React, { Fragment } from 'react';
-import { formatMessage } from 'umi';
-import {Link} from 'umi';
-import { Icon } from 'antd';
-import GlobalFooter from '@/components/GlobalFooter';
-import SelectLang from '@/components/SelectLang';
-import styles from './UserLayout.less';
-import logo from '../assets/logo.svg';
-
-const links = [
- {
- key: 'help',
- title: formatMessage({ id: 'layout.user.link.help' }),
- href: '',
- },
- {
- key: 'privacy',
- title: formatMessage({ id: 'layout.user.link.privacy' }),
- href: '',
- },
- {
- key: 'terms',
- title: formatMessage({ id: 'layout.user.link.terms' }),
- href: '',
- },
-];
-
-const copyright = (
-
- Copyright 2018 ©极限科技
-
-);
-
-class UserLayout extends React.PureComponent {
- // @TODO title
- // getPageTitle() {
- // const { routerData, location } = this.props;
- // const { pathname } = location;
- // let title = 'Ant Design Pro';
- // if (routerData[pathname] && routerData[pathname].name) {
- // title = `${routerData[pathname].name} - Ant Design Pro`;
- // }
- // return title;
- // }
-
- render() {
- const { children } = this.props;
- return (
- // @TODO
-
-
-
-
-
-
-
-
-
-
Logging Center
-
-
-
Logging Center
-
- {children}
-
-
-
- );
- }
-}
-
-export default UserLayout;
diff --git a/app/web/src/layouts/UserLayout.less b/app/web/src/layouts/UserLayout.less
deleted file mode 100644
index d4ac3861..00000000
--- a/app/web/src/layouts/UserLayout.less
+++ /dev/null
@@ -1,71 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.container {
- display: flex;
- flex-direction: column;
- height: 100vh;
- overflow: auto;
- background: @layout-body-background;
-}
-
-.lang {
- text-align: right;
- width: 100%;
- height: 40px;
- line-height: 44px;
- :global(.ant-dropdown-trigger) {
- margin-right: 24px;
- }
-}
-
-.content {
- padding: 32px 0;
- flex: 1;
-}
-
-@media (min-width: @screen-md-min) {
- .container {
- background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
- background-repeat: no-repeat;
- background-position: center 110px;
- background-size: 100%;
- }
-
- .content {
- padding: 72px 0 24px 0;
- }
-}
-
-.top {
- text-align: center;
-}
-
-.header {
- height: 44px;
- line-height: 44px;
- a {
- text-decoration: none;
- }
-}
-
-.logo {
- height: 44px;
- vertical-align: top;
- margin-right: 16px;
-}
-
-.title {
- font-size: 33px;
- color: @heading-color;
- font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
- font-weight: 600;
- position: relative;
- top: 2px;
-}
-
-.desc {
- font-size: @font-size-base;
- color: @text-color-secondary;
- margin-top: 12px;
- margin-bottom: 40px;
-}
diff --git a/app/web/src/locales/en-US.js b/app/web/src/locales/en-US.js
deleted file mode 100644
index 39ace0f8..00000000
--- a/app/web/src/locales/en-US.js
+++ /dev/null
@@ -1,293 +0,0 @@
-export default {
- 'navBar.lang': 'Languages',
- 'layout.user.link.help': 'Help',
- 'layout.user.link.privacy': 'Privacy',
- 'layout.user.link.terms': 'Terms',
- 'validation.email.required': 'Please enter your email!',
- 'validation.email.wrong-format': 'The email address is in the wrong format!',
- 'validation.password.required': 'Please enter your password!',
- 'validation.password.twice': 'The passwords entered twice do not match!',
- 'validation.password.strength.msg':
- "Please enter at least 6 characters and don't use passwords that are easy to guess.",
- 'validation.password.strength.strong': 'Strength: strong',
- 'validation.password.strength.medium': 'Strength: medium',
- 'validation.password.strength.short': 'Strength: too short',
- 'validation.confirm-password.required': 'Please confirm your password!',
- 'validation.phone-number.required': 'Please enter your phone number!',
- 'validation.phone-number.wrong-format': 'Malformed phone number!',
- 'validation.verification-code.required': 'Please enter the verification code!',
- 'validation.title.required': 'Please enter a title',
- 'validation.date.required': 'Please select the start and end date',
- 'validation.goal.required': 'Please enter a description of the goal',
- 'validation.standard.required': 'Please enter a metric',
- 'form.optional': ' (optional) ',
- 'form.submit': 'Submit',
- 'form.save': 'Save',
- 'form.email.placeholder': 'Email',
- 'form.password.placeholder': 'Password',
- 'form.confirm-password.placeholder': 'Confirm password',
- 'form.phone-number.placeholder': 'Phone number',
- 'form.verification-code.placeholder': 'Verification code',
- 'form.title.label': 'Title',
- 'form.title.placeholder': 'Give the target a name',
- 'form.date.label': 'Start and end date',
- 'form.date.placeholder.start': 'Start date',
- 'form.date.placeholder.end': 'End date',
- 'form.goal.label': 'Goal description',
- 'form.goal.placeholder': 'Please enter your work goals',
- 'form.standard.label': 'Metrics',
- 'form.standard.placeholder': 'Please enter a metric',
- 'form.client.label': 'Client',
- 'form.client.label.tooltip': 'Target service object',
- 'form.client.placeholder':
- 'Please describe your customer service, internal customers directly @ Name / job number',
- 'form.invites.label': 'Inviting critics',
- 'form.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people',
- 'form.weight.label': 'Weight',
- 'form.weight.placeholder': 'Please enter weight',
- 'form.public.label': 'Target disclosure',
- 'form.public.label.help': 'Customers and invitees are shared by default',
- 'form.public.radio.public': 'Public',
- 'form.public.radio.partially-public': 'Partially public',
- 'form.public.radio.private': 'Private',
- 'form.publicUsers.placeholder': 'Open to',
- 'form.publicUsers.option.A': 'Colleague A',
- 'form.publicUsers.option.B': 'Colleague B',
- 'form.publicUsers.option.C': 'Colleague C',
- 'component.globalHeader.search': 'Search',
- 'component.globalHeader.search.example1': 'Search example 1',
- 'component.globalHeader.search.example2': 'Search example 2',
- 'component.globalHeader.search.example3': 'Search example 3',
- 'component.globalHeader.help': 'Help',
- 'component.globalHeader.notification': 'Notification',
- 'component.globalHeader.notification.empty': 'You have viewed all notifications.',
- 'component.globalHeader.message': 'Message',
- 'component.globalHeader.message.empty': 'You have viewed all messsages.',
- 'component.globalHeader.event': 'Event',
- 'component.globalHeader.event.empty': 'You have viewed all events.',
- 'component.noticeIcon.clear': 'Clear',
- 'component.noticeIcon.cleared': 'Cleared',
- 'component.noticeIcon.empty': 'No notifications',
- 'menu.home': 'Home',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': 'Analysis',
- 'menu.dashboard.monitor': 'Monitor',
- 'menu.dashboard.workplace': 'Workplace',
- 'menu.form': 'Form',
- 'menu.form.basicform': 'Basic Form',
- 'menu.form.stepform': 'Step Form',
- 'menu.form.stepform.info': 'Step Form(write transfer information)',
- 'menu.form.stepform.confirm': 'Step Form(confirm transfer information)',
- 'menu.form.stepform.result': 'Step Form(finished)',
- 'menu.form.advancedform': 'Advanced Form',
- 'menu.list': 'List',
- 'menu.list.searchtable': 'Search Table',
- 'menu.list.basiclist': 'Basic List',
- 'menu.list.cardlist': 'Card List',
- 'menu.list.searchlist': 'Search List',
- 'menu.list.searchlist.articles': 'Search List(articles)',
- 'menu.list.searchlist.projects': 'Search List(projects)',
- 'menu.list.searchlist.applications': 'Search List(applications)',
- 'menu.profile': 'Profile',
- 'menu.profile.basic': 'Basic Profile',
- 'menu.profile.advanced': 'Advanced Profile',
- 'menu.result': 'Result',
- 'menu.result.success': 'Success',
- 'menu.result.fail': 'Fail',
- 'menu.exception': 'Exception',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': 'Trigger',
- 'menu.account': 'Account',
- 'menu.account.center': 'Account Center',
- 'menu.account.settings': 'Account Settings',
- 'menu.account.trigger': 'Trigger Error',
- 'menu.account.logout': 'Logout',
- 'app.login.message-invalid-credentials': 'Invalid username or password(admin/888888)',
- 'app.login.message-invalid-verification-code': 'Invalid verification code',
- 'app.login.tab-login-credentials': 'Credentials',
- 'app.login.tab-login-mobile': 'Mobile number',
- 'app.login.remember-me': 'Remember me',
- 'app.login.forgot-password': 'Forgot your password?',
- 'app.login.sign-in-with': 'Sign in with',
- 'app.login.signup': 'Sign up',
- 'app.login.login': 'Login',
- 'app.register.register': 'Register',
- 'app.register.get-verification-code': 'Get code',
- 'app.register.sing-in': 'Already have an account?',
- 'app.register-result.msg': 'Account:registered at {email}',
- 'app.register-result.activation-email':
- 'The activation email has been sent to your email address and is valid for 24 hours. Please log in to the email in time and click on the link in the email to activate the account.',
- 'app.register-result.back-home': 'Back to home',
- 'app.register-result.view-mailbox': 'View mailbox',
- 'app.home.introduce': 'introduce',
- 'app.analysis.test': 'Gongzhuan No.{no} shop',
- 'app.analysis.introduce': 'Introduce',
- 'app.analysis.total-sales': 'Total Sales',
- 'app.analysis.day-sales': 'Day Sales',
- 'app.analysis.visits': 'Visits',
- 'app.analysis.visits-trend': 'Visits Trend',
- 'app.analysis.visits-ranking': 'Visits Ranking',
- 'app.analysis.day-visits': 'Day Visits',
- 'app.analysis.week': 'Week Ratio',
- 'app.analysis.day': 'Day Ratio',
- 'app.analysis.payments': 'Payments',
- 'app.analysis.conversion-rate': 'Conversion Rate',
- 'app.analysis.operational-effect': 'Operational Effect',
- 'app.analysis.sales-trend': 'Stores Sales Trend',
- 'app.analysis.sales-ranking': 'Sales Ranking',
- 'app.analysis.all-year': 'All Year',
- 'app.analysis.all-month': 'All Month',
- 'app.analysis.all-week': 'All Week',
- 'app.analysis.all-day': 'All day',
- 'app.analysis.search-users': 'Search Users',
- 'app.analysis.per-capita-search': 'Per Capita Search',
- 'app.analysis.online-top-search': 'Online Top Search',
- 'app.analysis.the-proportion-of-sales': 'The Proportion Of Sales',
- 'app.analysis.channel.all': 'ALL',
- 'app.analysis.channel.online': 'Online',
- 'app.analysis.channel.stores': 'Stores',
- 'app.analysis.sales': 'Sales',
- 'app.analysis.traffic': 'Traffic',
- 'app.analysis.table.rank': 'Rank',
- 'app.analysis.table.search-keyword': 'Keyword',
- 'app.analysis.table.users': 'Users',
- 'app.analysis.table.weekly-range': 'Weekly Range',
- 'app.forms.basic.title': 'Basic form',
- 'app.forms.basic.description':
- 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.',
- 'app.monitor.trading-activity': 'Real-Time Trading Activity',
- 'app.monitor.total-transactions': 'Total transactions today',
- 'app.monitor.sales-target': 'Sales target completion rate',
- 'app.monitor.remaining-time': 'Remaining time of activity',
- 'app.monitor.total-transactions-per-second': 'Total transactions per second',
- 'app.monitor.activity-forecast': 'Activity forecast',
- 'app.monitor.efficiency': 'Efficiency',
- 'app.monitor.ratio': 'Ratio',
- 'app.monitor.proportion-per-category': 'Proportion Per Category',
- 'app.monitor.fast-food': 'Fast food',
- 'app.monitor.western-food': 'Western food',
- 'app.monitor.hot-pot': 'Hot pot',
- 'app.monitor.waiting-for-implementation': 'Waiting for implementation',
- 'app.monitor.popular-searches': 'Popular Searches',
- 'app.monitor.resource-surplus': 'Resource Surplus',
- 'app.monitor.fund-surplus': 'Fund Surplus',
- 'app.settings.menuMap.basic': 'Basic Settings',
- 'app.settings.menuMap.security': 'Security Settings',
- 'app.settings.menuMap.binding': 'Account Binding',
- 'app.settings.menuMap.notification': 'New Message Notification',
- 'app.settings.basic.avatar': 'Avatar',
- 'app.settings.basic.change-avatar': 'Change avatar',
- 'app.settings.basic.email': 'Email',
- 'app.settings.basic.email-message': 'Please input your email!',
- 'app.settings.basic.nickname': 'Nickname',
- 'app.settings.basic.nickname-message': 'Please input your Nickname!',
- 'app.settings.basic.profile': 'Personal profile',
- 'app.settings.basic.profile-message': 'Please input your personal profile!',
- 'app.settings.basic.profile-placeholder': 'Brief introduction to yourself',
- 'app.settings.basic.country': 'Country/Region',
- 'app.settings.basic.country-message': 'Please input your country!',
- 'app.settings.basic.geographic': 'Province or city',
- 'app.settings.basic.geographic-message': 'Please input your geographic info!',
- 'app.settings.basic.address': 'Street Address',
- 'app.settings.basic.address-message': 'Please input your address!',
- 'app.settings.basic.phone': 'Phone Number',
- 'app.settings.basic.phone-message': 'Please input your phone!',
- 'app.settings.basic.update': 'Update Information',
- 'app.settings.security.strong': 'Strong',
- 'app.settings.security.medium': 'Medium',
- 'app.settings.security.weak': 'Weak',
- 'app.settings.security.password': 'Account Password',
- 'app.settings.security.password-description': 'Current password strength:',
- 'app.settings.security.phone': 'Security Phone',
- 'app.settings.security.phone-description': 'Bound phone:',
- 'app.settings.security.question': 'Security Question',
- 'app.settings.security.question-description':
- 'The security question is not set, and the security policy can effectively protect the account security',
- 'app.settings.security.email': 'Backup Email',
- 'app.settings.security.email-description': 'Bound Email:',
- 'app.settings.security.mfa': 'MFA Device',
- 'app.settings.security.mfa-description':
- 'Unbound MFA device, after binding, can be confirmed twice',
- 'app.settings.security.modify': 'Modify',
- 'app.settings.security.set': 'Set',
- 'app.settings.security.bind': 'Bind',
- 'app.settings.binding.taobao': 'Binding Taobao',
- 'app.settings.binding.taobao-description': 'Currently unbound Taobao account',
- 'app.settings.binding.alipay': 'Binding Alipay',
- 'app.settings.binding.alipay-description': 'Currently unbound Alipay account',
- 'app.settings.binding.dingding': 'Binding DingTalk',
- 'app.settings.binding.dingding-description': 'Currently unbound DingTalk account',
- 'app.settings.binding.bind': 'Bind',
- 'app.settings.notification.password': 'Account Password',
- 'app.settings.notification.password-description':
- 'Messages from other users will be notified in the form of a station letter',
- 'app.settings.notification.messages': 'System Messages',
- 'app.settings.notification.messages-description':
- 'System messages will be notified in the form of a station letter',
- 'app.settings.notification.todo': 'To-do Notification',
- 'app.settings.notification.todo-description':
- 'The to-do list will be notified in the form of a letter from the station',
- 'app.settings.open': 'Open',
- 'app.settings.close': 'Close',
- 'app.exception.back': 'Back to home',
- 'app.exception.description.403': "Sorry, you don't have access to this page",
- 'app.exception.description.404': 'Sorry, the page you visited does not exist',
- 'app.exception.description.500': 'Sorry, the server is reporting an error',
- 'app.result.error.title': 'Submission Failed',
- 'app.result.error.description':
- 'Please check and modify the following information before resubmitting.',
- 'app.result.error.hint-title': 'The content you submitted has the following error:',
- 'app.result.error.hint-text1': 'Your account has been frozen',
- 'app.result.error.hint-btn1': 'Thaw immediately',
- 'app.result.error.hint-text2': 'Your account is not yet eligible to apply',
- 'app.result.error.hint-btn2': 'Upgrade immediately',
- 'app.result.error.btn-text': 'Return to modify',
- 'app.result.success.title': 'Submission Success',
- 'app.result.success.description':
- 'The submission results page is used to feed back the results of a series of operational tasks. If it is a simple operation, use the Message global prompt feedback. This text area can show a simple supplementary explanation. If there is a similar requirement for displaying “documents”, the following gray area can present more complicated content.',
- 'app.result.success.operate-title': 'Project Name',
- 'app.result.success.operate-id': 'Project ID:',
- 'app.result.success.principal': 'Principal:',
- 'app.result.success.operate-time': 'Effective time:',
- 'app.result.success.step1-title': 'Create project',
- 'app.result.success.step1-operator': 'Qu Lili',
- 'app.result.success.step2-title': 'Departmental preliminary review',
- 'app.result.success.step2-operator': 'Zhou Maomao',
- 'app.result.success.step2-extra': 'Urge',
- 'app.result.success.step3-title': 'Financial review',
- 'app.result.success.step4-title': 'Finish',
- 'app.result.success.btn-return': 'Back to list',
- 'app.result.success.btn-project': 'View project',
- 'app.result.success.btn-print': 'Print',
- 'app.setting.pagestyle': 'Page style setting',
- 'app.setting.pagestyle.dark': 'Dark style',
- 'app.setting.pagestyle.light': 'Light style',
- 'app.setting.content-width': 'Content Width',
- 'app.setting.content-width.fixed': 'Fixed',
- 'app.setting.content-width.fluid': 'Fluid',
- 'app.setting.themecolor': 'Theme Color',
- 'app.setting.themecolor.dust': 'Dust Red',
- 'app.setting.themecolor.volcano': 'Volcano',
- 'app.setting.themecolor.sunset': 'Sunset Orange',
- 'app.setting.themecolor.cyan': 'Cyan',
- 'app.setting.themecolor.green': 'Polar Green',
- 'app.setting.themecolor.daybreak': 'Daybreak Blue (default)',
- 'app.setting.themecolor.geekblue': 'Geek Glue',
- 'app.setting.themecolor.purple': 'Golden Purple',
- 'app.setting.navigationmode': 'Navigation Mode',
- 'app.setting.sidemenu': 'Side Menu Layout',
- 'app.setting.topmenu': 'Top Menu Layout',
- 'app.setting.fixedheader': 'Fixed Header',
- 'app.setting.fixedsidebar': 'Fixed Sidebar',
- 'app.setting.fixedsidebar.hint': 'Works on Side Menu Layout',
- 'app.setting.hideheader': 'Hidden Header when scrolling',
- 'app.setting.hideheader.hint': 'Works when Hidden Header is enabled',
- 'app.setting.othersettings': 'Other Settings',
- 'app.setting.weakmode': 'Weak Mode',
- 'app.setting.copy': 'Copy Setting',
- 'app.setting.copyinfo': 'copy success,please replace defaultSettings in src/models/setting.js',
- 'app.setting.production.hint':
- 'Setting panel shows in development environment only, please manually modify',
-};
diff --git a/app/web/src/locales/pt-BR.js b/app/web/src/locales/pt-BR.js
deleted file mode 100644
index d11f1444..00000000
--- a/app/web/src/locales/pt-BR.js
+++ /dev/null
@@ -1,242 +0,0 @@
-export default {
- 'navBar.lang': 'Idiomas',
- 'layout.user.link.help': 'ajuda',
- 'layout.user.link.privacy': 'política de privacidade',
- 'layout.user.link.terms': 'termos de serviços',
- 'validation.email.required': 'Por favor insira seu email!',
- 'validation.email.wrong-format': 'O email está errado!',
- 'validation.password.required': 'Por favor insira sua senha!',
- 'validation.password.twice': 'As senhas não estão iguais!',
- 'validation.password.strength.msg':
- 'Por favor insira pelo menos 6 caracteres e não use senhas fáceis de adivinhar.',
- 'validation.password.strength.strong': 'Força: forte',
- 'validation.password.strength.medium': 'Força: média',
- 'validation.password.strength.short': 'Força: curta',
- 'validation.confirm-password.required': 'Por favor confirme sua senha!',
- 'validation.phone-number.required': 'Por favor insira seu telefone!',
- 'validation.phone-number.wrong-format': 'Formato de telefone errado!',
- 'validation.verification-code.required': 'Por favor insira seu código de verificação!',
- 'form.email.placeholder': 'Email',
- 'form.password.placeholder': 'Senha',
- 'form.confirm-password.placeholder': 'Confirme a senha',
- 'form.phone-number.placeholder': 'Telefone',
- 'form.verification-code.placeholder': 'Código de verificação',
- 'component.globalHeader.search': 'Busca',
- 'component.globalHeader.search.example1': 'Exemplo de busca 1',
- 'component.globalHeader.search.example2': 'Exemplo de busca 2',
- 'component.globalHeader.search.example3': 'Exemplo de busca 3',
- 'component.globalHeader.help': 'Ajuda',
- 'component.globalHeader.notification': 'Notificação',
- 'component.globalHeader.notification.empty': 'Você visualizou todas as notificações.',
- 'component.globalHeader.message': 'Mensagem',
- 'component.globalHeader.message.empty': 'Você visualizou todas as mensagens.',
- 'component.globalHeader.event': 'Evento',
- 'component.globalHeader.event.empty': 'Você visualizou todos os eventos.',
- 'component.noticeIcon.clear': 'Limpar',
- 'component.noticeIcon.cleared': 'Limpo',
- 'component.noticeIcon.empty': 'Sem notificações',
- 'menu.home': 'Início',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': 'Análise',
- 'menu.dashboard.monitor': 'Monitor',
- 'menu.dashboard.workplace': 'Ambiente de Trabalho',
- 'menu.form': 'Formulário',
- 'menu.form.basicform': 'Formulário Básico',
- 'menu.form.stepform': 'Formulário Assistido',
- 'menu.form.stepform.info': 'Formulário Assistido(gravar informações de transferência)',
- 'menu.form.stepform.confirm': 'Formulário Assistido(confirmar informações de transferência)',
- 'menu.form.stepform.result': 'Formulário Assistido(finalizado)',
- 'menu.form.advancedform': 'Formulário Avançado',
- 'menu.list': 'Lista',
- 'menu.list.searchtable': 'Tabela de Busca',
- 'menu.list.basiclist': 'Lista Básica',
- 'menu.list.cardlist': 'Lista de Card',
- 'menu.list.searchlist': 'Lista de Busca',
- 'menu.list.searchlist.articles': 'Lista de Busca(artigos)',
- 'menu.list.searchlist.projects': 'Lista de Busca(projetos)',
- 'menu.list.searchlist.applications': 'Lista de Busca(aplicações)',
- 'menu.profile': 'Perfil',
- 'menu.profile.basic': 'Perfil Básico',
- 'menu.profile.advanced': 'Perfil Avançado',
- 'menu.result': 'Resultado',
- 'menu.result.success': 'Sucesso',
- 'menu.result.fail': 'Falha',
- 'menu.exception': 'Exceção',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': 'Disparar',
- 'menu.account': 'Conta',
- 'menu.account.center': 'Central da Conta',
- 'menu.account.settings': 'Configurar Conta',
- 'menu.account.trigger': 'Disparar Erro',
- 'menu.account.logout': 'Sair',
- 'app.login.message-invalid-credentials': 'Nome de usuário ou senha inválidosd(admin/888888)',
- 'app.login.message-invalid-verification-code': 'Código de verificação inválido',
- 'app.login.tab-login-credentials': 'Credenciais',
- 'app.login.tab-login-mobile': 'Telefone',
- 'app.login.remember-me': 'Lembre-me',
- 'app.login.forgot-password': 'Esqueceu sua senha?',
- 'app.login.sign-in-with': 'Login com',
- 'app.login.signup': 'Cadastre-se',
- 'app.login.login': 'Login',
- 'app.register.register': 'Cadastro',
- 'app.register.get-verification-code': 'Recuperar código',
- 'app.register.sing-in': 'Já tem uma conta?',
- 'app.register-result.msg': 'Conta:registrada em {email}',
- 'app.register-result.activation-email':
- 'Um email de ativação foi enviado para o seu email e é válido por 24 horas. Por favor entre no seu email e clique no link de ativação da conta.',
- 'app.register-result.back-home': 'Voltar ao Início',
- 'app.register-result.view-mailbox': 'Visualizar a caixa de email',
- 'app.home.introduce': 'introduzir',
- 'app.analysis.test': 'Gongzhuan No.{no} shop',
- 'app.analysis.introduce': 'Introduzir',
- 'app.analysis.total-sales': 'Vendas Totais',
- 'app.analysis.day-sales': 'Vendas do Dia',
- 'app.analysis.visits': 'Visitas',
- 'app.analysis.visits-trend': 'Tendência de Visitas',
- 'app.analysis.visits-ranking': 'Ranking de Visitas',
- 'app.analysis.day-visits': 'Visitas do Dia',
- 'app.analysis.week': 'Taxa Semanal',
- 'app.analysis.day': 'Taxa Diária',
- 'app.analysis.payments': 'Pagamentos',
- 'app.analysis.conversion-rate': 'Taxa de Conversão',
- 'app.analysis.operational-effect': 'Efeito Operacional',
- 'app.analysis.sales-trend': 'Tendência de Vendas das Lojas',
- 'app.analysis.sales-ranking': 'Ranking de Vendas',
- 'app.analysis.all-year': 'Todo ano',
- 'app.analysis.all-month': 'Todo mês',
- 'app.analysis.all-week': 'Toda semana',
- 'app.analysis.all-day': 'Todo dia',
- 'app.analysis.search-users': 'Pesquisa de Usuários',
- 'app.analysis.per-capita-search': 'Busca Per Capta',
- 'app.analysis.online-top-search': 'Mais Buscadas Online',
- 'app.analysis.the-proportion-of-sales': 'The Proportion Of Sales',
- 'app.analysis.channel.all': 'Tudo',
- 'app.analysis.channel.online': 'Online',
- 'app.analysis.channel.stores': 'Lojas',
- 'app.analysis.sales': 'Vendas',
- 'app.analysis.traffic': 'Tráfego',
- 'app.analysis.table.rank': 'Rank',
- 'app.analysis.table.search-keyword': 'Palavra chave',
- 'app.analysis.table.users': 'Usuários',
- 'app.analysis.table.weekly-range': 'Faixa Semanal',
- 'app.settings.menuMap.basic': 'Configurações Básicas',
- 'app.settings.menuMap.security': 'Configurações de Segurança',
- 'app.settings.menuMap.binding': 'Vinculação de Conta',
- 'app.settings.menuMap.notification': 'Mensagens de Notificação',
- 'app.settings.basic.avatar': 'Avatar',
- 'app.settings.basic.change-avatar': 'Alterar avatar',
- 'app.settings.basic.email': 'Email',
- 'app.settings.basic.email-message': 'Por favor insira seu email!',
- 'app.settings.basic.nickname': 'Nome de usuário',
- 'app.settings.basic.nickname-message': 'Por favor insira seu nome de usuário!',
- 'app.settings.basic.profile': 'Perfil pessoal',
- 'app.settings.basic.profile-message': 'Por favor insira seu perfil pessoal!',
- 'app.settings.basic.profile-placeholder': 'Breve introdução sua',
- 'app.settings.basic.country': 'País/Região',
- 'app.settings.basic.country-message': 'Por favor insira país!',
- 'app.settings.basic.geographic': 'Província, estado ou cidade',
- 'app.settings.basic.geographic-message': 'Por favor insira suas informações geográficas!',
- 'app.settings.basic.address': 'Endereço',
- 'app.settings.basic.address-message': 'Por favor insira seu endereço!',
- 'app.settings.basic.phone': 'Número de telefone',
- 'app.settings.basic.phone-message': 'Por favor insira seu número de telefone!',
- 'app.settings.basic.update': 'Atualizar Informações',
- 'app.settings.security.strong': 'Forte',
- 'app.settings.security.medium': 'Média',
- 'app.settings.security.weak': 'Fraca',
- 'app.settings.security.password': 'Senha da Conta',
- 'app.settings.security.password-description': 'Força da senha',
- 'app.settings.security.phone': 'Telefone de Seguraça',
- 'app.settings.security.phone-description': 'Telefone vinculado',
- 'app.settings.security.question': 'Pergunta de Segurança',
- 'app.settings.security.question-description':
- 'A pergunta de segurança não está definida e a política de segurança pode proteger efetivamente a segurança da conta',
- 'app.settings.security.email': 'Email de Backup',
- 'app.settings.security.email-description': 'Email vinculado',
- 'app.settings.security.mfa': 'Dispositivo MFA',
- 'app.settings.security.mfa-description':
- 'O dispositivo MFA não vinculado, após a vinculação, pode ser confirmado duas vezes',
- 'app.settings.security.modify': 'Modificar',
- 'app.settings.security.set': 'Atribuir',
- 'app.settings.security.bind': 'Vincular',
- 'app.settings.binding.taobao': 'Vincular Taobao',
- 'app.settings.binding.taobao-description': 'Atualmente não vinculado à conta Taobao',
- 'app.settings.binding.alipay': 'Vincular Alipay',
- 'app.settings.binding.alipay-description': 'Atualmente não vinculado à conta Alipay',
- 'app.settings.binding.dingding': 'Vincular DingTalk',
- 'app.settings.binding.dingding-description': 'Atualmente não vinculado à conta DingTalk',
- 'app.settings.binding.bind': 'Vincular',
- 'app.settings.notification.password': 'Senha da Conta',
- 'app.settings.notification.password-description':
- 'Mensagens de outros usuários serão notificadas na forma de uma estação de letra',
- 'app.settings.notification.messages': 'Mensagens de Sistema',
- 'app.settings.notification.messages-description':
- 'Mensagens de sistema serão notificadas na forma de uma estação de letra',
- 'app.settings.notification.todo': 'Notificação de To-do',
- 'app.settings.notification.todo-description':
- 'A lista de to-do será notificada na forma de uma estação de letra',
- 'app.settings.open': 'Aberto',
- 'app.settings.close': 'Fechado',
- 'app.exception.back': 'Voltar para Início',
- 'app.exception.description.403': 'Desculpe, você não tem acesso a esta página',
- 'app.exception.description.404': 'Desculpe, a página que você visitou não existe',
- 'app.exception.description.500': 'Desculpe, o servidor está reportando um erro',
- 'app.result.error.title': 'A Submissão Falhou',
- 'app.result.error.description':
- 'Por favor, verifique e modifique as seguintes informações antes de reenviar.',
- 'app.result.error.hint-title': 'O conteúdo que você enviou tem o seguinte erro:',
- 'app.result.error.hint-text1': 'Sua conta foi congelada',
- 'app.result.error.hint-btn1': 'Descongele imediatamente',
- 'app.result.error.hint-text2': 'Sua conta ainda não está qualificada para se candidatar',
- 'app.result.error.hint-btn2': 'Atualizar imediatamente',
- 'app.result.error.btn-text': 'Retornar para modificar',
- 'app.result.success.title': 'A Submissão foi um Sucesso',
- 'app.result.success.description':
- 'A página de resultados de envio é usada para fornecer os resultados de uma série de tarefas operacionais. Se for uma operação simples, use o prompt de feedback de Mensagem global. Esta área de texto pode mostrar uma explicação suplementar simples. Se houver um requisito semelhante para exibir "documentos", a área cinza a seguir pode apresentar um conteúdo mais complicado.',
- 'app.result.success.operate-title': 'Nome do Projeto',
- 'app.result.success.operate-id': 'ID do Projeto:',
- 'app.result.success.principal': 'Principal:',
- 'app.result.success.operate-time': 'Tempo efetivo:',
- 'app.result.success.step1-title': 'Criar projeto',
- 'app.result.success.step1-operator': 'Qu Lili',
- 'app.result.success.step2-title': 'Revisão preliminar do departamento',
- 'app.result.success.step2-operator': 'Zhou Maomao',
- 'app.result.success.step2-extra': 'Urge',
- 'app.result.success.step3-title': 'Revisão financeira',
- 'app.result.success.step4-title': 'Terminar',
- 'app.result.success.btn-return': 'Voltar a lista',
- 'app.result.success.btn-project': 'Ver projeto',
- 'app.result.success.btn-print': 'imprimir',
- 'app.setting.pagestyle': 'Configuração de estilo da página',
- 'app.setting.pagestyle.dark': 'Dark style',
- 'app.setting.pagestyle.light': 'Light style',
- 'app.setting.content-width': 'Largura do conteúdo',
- 'app.setting.content-width.fixed': 'Fixo',
- 'app.setting.content-width.fluid': 'Fluido',
- 'app.setting.themecolor': 'Cor do Tema',
- 'app.setting.themecolor.dust': 'Dust Red',
- 'app.setting.themecolor.volcano': 'Volcano',
- 'app.setting.themecolor.sunset': 'Sunset Orange',
- 'app.setting.themecolor.cyan': 'Cyan',
- 'app.setting.themecolor.green': 'Polar Green',
- 'app.setting.themecolor.daybreak': 'Daybreak Blue (default)',
- 'app.setting.themecolor.geekblue': 'Geek Glue',
- 'app.setting.themecolor.purple': 'Golden Purple',
- 'app.setting.navigationmode': 'Modo de Navegação',
- 'app.setting.sidemenu': 'Layout do Menu Lateral',
- 'app.setting.topmenu': 'Layout do Menu Superior',
- 'app.setting.fixedheader': 'Cabeçalho fixo',
- 'app.setting.fixedsidebar': 'Barra lateral fixa',
- 'app.setting.fixedsidebar.hint': 'Funciona no layout do menu lateral',
- 'app.setting.hideheader': 'Esconder o cabeçalho quando rolar',
- 'app.setting.hideheader.hint': 'Funciona quando o esconder cabeçalho está abilitado',
- 'app.setting.othersettings': 'Outras configurações',
- 'app.setting.weakmode': 'Weak Mode',
- 'app.setting.copy': 'Copiar Configuração',
- 'app.setting.copyinfo':
- 'copiado com sucesso,por favor trocar o defaultSettings em src/models/setting.js',
- 'app.setting.production.hint':
- 'O painel de configuração apenas é exibido no ambiente de desenvolvimento, por favor modifique manualmente o',
-};
diff --git a/app/web/src/locales/zh-CN.js b/app/web/src/locales/zh-CN.js
deleted file mode 100644
index 5b66534d..00000000
--- a/app/web/src/locales/zh-CN.js
+++ /dev/null
@@ -1,288 +0,0 @@
-export default {
- 'navBar.lang': '语言',
- 'layout.user.link.help': '帮助',
- 'layout.user.link.privacy': '隐私',
- 'layout.user.link.terms': '条款',
- 'validation.email.required': '请输入邮箱地址!',
- 'validation.email.wrong-format': '邮箱地址格式错误!',
- 'validation.password.required': '请输入密码!',
- 'validation.password.twice': '两次输入的密码不匹配!',
- 'validation.password.strength.msg': '请至少输入 6 个字符。请不要使用容易被猜到的密码。',
- 'validation.password.strength.strong': '强度:强',
- 'validation.password.strength.medium': '强度:中',
- 'validation.password.strength.short': '强度:太短',
- 'validation.confirm-password.required': '请确认密码!',
- 'validation.phone-number.required': '请输入手机号!',
- 'validation.phone-number.wrong-format': '手机号格式错误!',
- 'validation.verification-code.required': '请输入验证码!',
- 'validation.title.required': '请输入标题',
- 'validation.date.required': '请选择起止日期',
- 'validation.goal.required': '请输入目标描述',
- 'validation.standard.required': '请输入衡量标准',
- 'form.optional': '(选填)',
- 'form.submit': '提交',
- 'form.save': '保存',
- 'form.email.placeholder': '邮箱',
- 'form.password.placeholder': '至少6位密码,区分大小写',
- 'form.confirm-password.placeholder': '确认密码',
- 'form.phone-number.placeholder': '位手机号',
- 'form.verification-code.placeholder': '验证码',
- 'form.title.label': '标题',
- 'form.title.placeholder': '给目标起个名字',
- 'form.date.label': '起止日期',
- 'form.date.placeholder.start': '开始日期',
- 'form.date.placeholder.end': '结束日期',
- 'form.goal.label': '目标描述',
- 'form.goal.placeholder': '请输入你的阶段性工作目标',
- 'form.standard.label': '衡量标准',
- 'form.standard.placeholder': '请输入衡量标准',
- 'form.client.label': '客户',
- 'form.client.label.tooltip': '目标的服务对象',
- 'form.client.placeholder': '请描述你服务的客户,内部客户直接 @姓名/工号',
- 'form.invites.label': '邀评人',
- 'form.invites.placeholder': '请直接 @姓名/工号,最多可邀请 5 人',
- 'form.weight.label': '权重',
- 'form.weight.placeholder': '请输入',
- 'form.public.label': '目标公开',
- 'form.public.label.help': '客户、邀评人默认被分享',
- 'form.public.radio.public': '公开',
- 'form.public.radio.partially-public': '部分公开',
- 'form.public.radio.private': '不公开',
- 'form.publicUsers.placeholder': '公开给',
- 'form.publicUsers.option.A': '同事甲',
- 'form.publicUsers.option.B': '同事乙',
- 'form.publicUsers.option.C': '同事丙',
- 'component.globalHeader.search': '站内搜索',
- 'component.globalHeader.search.example1': '搜索提示一',
- 'component.globalHeader.search.example2': '搜索提示二',
- 'component.globalHeader.search.example3': '搜索提示三',
- 'component.globalHeader.help': '使用文档',
- 'component.globalHeader.notification': '通知',
- 'component.globalHeader.notification.empty': '你已查看所有通知',
- 'component.globalHeader.message': '消息',
- 'component.globalHeader.message.empty': '您已读完所有消息',
- 'component.globalHeader.event': '待办',
- 'component.globalHeader.event.empty': '你已完成所有待办',
- 'component.noticeIcon.clear': '清空',
- 'component.noticeIcon.cleared': '清空了',
- 'component.noticeIcon.empty': '暂无数据',
- 'menu.home': '首页',
- 'menu.dashboard': '平台概述',
- 'menu.dashboard.collect': '采集端统计',
- 'menu.dashboard.notification': '告警统计',
- 'menu.dashboard.logging': '日志数据统计',
- 'menu.dashboard.gateway': '采集网关统计',
- 'menu.agents': '终端管理',
- 'menu.agents.overview': '终端统计',
- 'menu.form': '表单页',
- 'menu.form.basicform': '基础表单',
- 'menu.form.stepform': '分步表单',
- 'menu.form.stepform.info': '分步表单(填写转账信息)',
- 'menu.form.stepform.confirm': '分步表单(确认转账信息)',
- 'menu.form.stepform.result': '分步表单(完成)',
- 'menu.form.advancedform': '高级表单',
- 'menu.list': '列表页',
- 'menu.list.searchtable': '查询表格',
- 'menu.list.basiclist': '标准列表',
- 'menu.list.cardlist': '卡片列表',
- 'menu.list.searchlist': '搜索列表',
- 'menu.list.searchlist.articles': '搜索列表(文章)',
- 'menu.list.searchlist.projects': '搜索列表(项目)',
- 'menu.list.searchlist.applications': '搜索列表(应用)',
- 'menu.profile': '详情页',
- 'menu.profile.basic': '基础详情页',
- 'menu.profile.advanced': '高级详情页',
- 'menu.result': '结果页',
- 'menu.result.success': '成功页',
- 'menu.result.fail': '失败页',
- 'menu.exception': '异常页',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': '触发错误',
- 'menu.account': '个人页',
- 'menu.account.center': '个人中心',
- 'menu.account.settings': '个人设置',
- 'menu.account.trigger': '触发报错',
- 'menu.account.logout': '退出登录',
- 'app.login.message-invalid-credentials': '账户或密码错误(admin/888888)',
- 'app.login.message-invalid-verification-code': '验证码错误',
- 'app.login.tab-login-credentials': '账户密码登录',
- 'app.login.tab-login-mobile': '手机号登录',
- 'app.login.remember-me': '自动登录',
- 'app.login.forgot-password': '忘记密码',
- 'app.login.sign-in-with': '其他登录方式',
- 'app.login.signup': '注册账户',
- 'app.login.login': '登录',
- 'app.register.register': '注册',
- 'app.register.get-verification-code': '获取验证码',
- 'app.register.sing-in': '使用已有账户登录',
- 'app.register-result.msg': '你的账户:{email} 注册成功',
- 'app.register-result.activation-email':
- '激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。',
- 'app.register-result.back-home': '返回首页',
- 'app.register-result.view-mailbox': '查看邮箱',
- 'app.home.introduce': '介绍',
- 'app.analysis.test': '工专路 {no} 号店',
- 'app.analysis.introduce': '指标说明',
- 'app.analysis.total-sales': '总销售额',
- 'app.analysis.day-sales': '日销售额',
- 'app.analysis.visits': '访问量',
- 'app.analysis.visits-trend': '访问量趋势',
- 'app.analysis.visits-ranking': '门店访问量排名',
- 'app.analysis.day-visits': '日访问量',
- 'app.analysis.week': '周同比',
- 'app.analysis.day': '日同比',
- 'app.analysis.payments': '支付笔数',
- 'app.analysis.conversion-rate': '转化率',
- 'app.analysis.operational-effect': '运营活动效果',
- 'app.analysis.sales-trend': '销售趋势',
- 'app.analysis.sales-ranking': '门店销售额排名',
- 'app.analysis.all-year': '全年',
- 'app.analysis.all-month': '本月',
- 'app.analysis.all-week': '本周',
- 'app.analysis.all-day': '今日',
- 'app.analysis.search-users': '搜索用户数',
- 'app.analysis.per-capita-search': '人均搜索次数',
- 'app.analysis.online-top-search': '线上热门搜索',
- 'app.analysis.the-proportion-of-sales': '销售额类别占比',
- 'app.analysis.channel.all': '全部渠道',
- 'app.analysis.channel.online': '线上',
- 'app.analysis.channel.stores': '门店',
- 'app.analysis.sales': '销售额',
- 'app.analysis.traffic': '客流量',
- 'app.analysis.table.rank': '排名',
- 'app.analysis.table.search-keyword': '搜索关键词',
- 'app.analysis.table.users': '用户数',
- 'app.analysis.table.weekly-range': '周涨幅',
- 'app.forms.basic.title': '基础表单',
- 'app.forms.basic.description':
- '表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。',
- 'app.monitor.trading-activity': '活动实时交易情况',
- 'app.monitor.total-transactions': '今日交易总额',
- 'app.monitor.sales-target': '销售目标完成率',
- 'app.monitor.remaining-time': '活动剩余时间',
- 'app.monitor.total-transactions-per-second': '每秒交易总额',
- 'app.monitor.activity-forecast': '活动情况预测',
- 'app.monitor.efficiency': '券核效率',
- 'app.monitor.ratio': '跳出率',
- 'app.monitor.proportion-per-category': '各品类占比',
- 'app.monitor.fast-food': '中式快餐',
- 'app.monitor.western-food': '西餐',
- 'app.monitor.hot-pot': '火锅',
- 'app.monitor.waiting-for-implementation': 'Waiting for implementation',
- 'app.monitor.popular-searches': '热门搜索',
- 'app.monitor.resource-surplus': '资源剩余',
- 'app.monitor.fund-surplus': '补贴资金剩余',
- 'app.settings.menuMap.basic': '基本设置',
- 'app.settings.menuMap.security': '安全设置',
- 'app.settings.menuMap.binding': '账号绑定',
- 'app.settings.menuMap.notification': '新消息通知',
- 'app.settings.basic.avatar': '头像',
- 'app.settings.basic.change-avatar': '更换头像',
- 'app.settings.basic.email': '邮箱',
- 'app.settings.basic.email-message': '请输入您的邮箱!',
- 'app.settings.basic.nickname': '昵称',
- 'app.settings.basic.nickname-message': '请输入您的昵称!',
- 'app.settings.basic.profile': '个人简介',
- 'app.settings.basic.profile-message': '请输入个人简介!',
- 'app.settings.basic.profile-placeholder': '个人简介',
- 'app.settings.basic.country': '国家/地区',
- 'app.settings.basic.country-message': '请输入您的国家或地区!',
- 'app.settings.basic.geographic': '所在省市',
- 'app.settings.basic.geographic-message': '请输入您的所在省市!',
- 'app.settings.basic.address': '街道地址',
- 'app.settings.basic.address-message': '请输入您的街道地址!',
- 'app.settings.basic.phone': '联系电话',
- 'app.settings.basic.phone-message': '请输入您的联系电话!',
- 'app.settings.basic.update': '更新基本信息',
- 'app.settings.security.strong': '强',
- 'app.settings.security.medium': '中',
- 'app.settings.security.weak': '弱',
- 'app.settings.security.password': '账户密码',
- 'app.settings.security.password-description': '当前密码强度:',
- 'app.settings.security.phone': '密保手机',
- 'app.settings.security.phone-description': '已绑定手机:',
- 'app.settings.security.question': '密保问题',
- 'app.settings.security.question-description': '未设置密保问题,密保问题可有效保护账户安全',
- 'app.settings.security.email': '备用邮箱',
- 'app.settings.security.email-description': '已绑定邮箱:',
- 'app.settings.security.mfa': 'MFA 设备',
- 'app.settings.security.mfa-description': '未绑定 MFA 设备,绑定后,可以进行二次确认',
- 'app.settings.security.modify': '修改',
- 'app.settings.security.set': '设置',
- 'app.settings.security.bind': '绑定',
- 'app.settings.binding.taobao': '绑定淘宝',
- 'app.settings.binding.taobao-description': '当前未绑定淘宝账号',
- 'app.settings.binding.alipay': '绑定支付宝',
- 'app.settings.binding.alipay-description': '当前未绑定支付宝账号',
- 'app.settings.binding.dingding': '绑定钉钉',
- 'app.settings.binding.dingding-description': '当前未绑定钉钉账号',
- 'app.settings.binding.bind': '绑定',
- 'app.settings.notification.password': '账户密码',
- 'app.settings.notification.password-description': '其他用户的消息将以站内信的形式通知',
- 'app.settings.notification.messages': '系统消息',
- 'app.settings.notification.messages-description': '系统消息将以站内信的形式通知',
- 'app.settings.notification.todo': '账户密码',
- 'app.settings.notification.todo-description': '账户密码',
- 'app.settings.open': '开',
- 'app.settings.close': '关',
- 'app.exception.back': '返回首页',
- 'app.exception.description.403': '抱歉,你无权访问该页面',
- 'app.exception.description.404': '抱歉,你访问的页面不存在',
- 'app.exception.description.500': '抱歉,服务器出错了',
- 'app.result.error.title': '提交失败',
- 'app.result.error.description': '请核对并修改以下信息后,再重新提交。',
- 'app.result.error.hint-title': '您提交的内容有如下错误:',
- 'app.result.error.hint-text1': '您的账户已被冻结',
- 'app.result.error.hint-btn1': '立即解冻',
- 'app.result.error.hint-text2': '您的账户还不具备申请资格',
- 'app.result.error.hint-btn2': '立即升级',
- 'app.result.error.btn-text': '返回修改',
- 'app.result.success.title': '提交成功',
- 'app.result.success.description':
- '提交结果页用于反馈一系列操作任务的处理结果, 如果仅是简单操作,使用 Message 全局提示反馈即可。 本文字区域可以展示简单的补充说明,如果有类似展示 “单据”的需求,下面这个灰色区域可以呈现比较复杂的内容。',
- 'app.result.success.operate-title': '项目名称',
- 'app.result.success.operate-id': '项目 ID:',
- 'app.result.success.principal': '负责人:',
- 'app.result.success.operate-time': '生效时间:',
- 'app.result.success.step1-title': '创建项目',
- 'app.result.success.step1-operator': '曲丽丽',
- 'app.result.success.step2-title': '部门初审',
- 'app.result.success.step2-operator': '周毛毛',
- 'app.result.success.step2-extra': '催一下',
- 'app.result.success.step3-title': '财务复核',
- 'app.result.success.step4-title': '完成',
- 'app.result.success.btn-return': '返回列表',
- 'app.result.success.btn-project': '查看项目',
- 'app.result.success.btn-print': '打印',
- 'app.setting.pagestyle': '整体风格设置',
- 'app.setting.pagestyle.dark': '暗色菜单风格',
- 'app.setting.pagestyle.light': '亮色菜单风格',
- 'app.setting.content-width': '内容区域宽度',
- 'app.setting.content-width.fixed': '定宽',
- 'app.setting.content-width.fluid': '流式',
- 'app.setting.themecolor': '主题色',
- 'app.setting.themecolor.dust': '薄暮',
- 'app.setting.themecolor.volcano': '火山',
- 'app.setting.themecolor.sunset': '日暮',
- 'app.setting.themecolor.cyan': '明青',
- 'app.setting.themecolor.green': '极光绿',
- 'app.setting.themecolor.daybreak': '拂晓蓝(默认)',
- 'app.setting.themecolor.geekblue': '极客蓝',
- 'app.setting.themecolor.purple': '酱紫',
- 'app.setting.navigationmode': '导航模式',
- 'app.setting.sidemenu': '侧边菜单布局',
- 'app.setting.topmenu': '顶部菜单布局',
- 'app.setting.fixedheader': '固定 Header',
- 'app.setting.fixedsidebar': '固定侧边菜单',
- 'app.setting.fixedsidebar.hint': '侧边菜单布局时可配置',
- 'app.setting.hideheader': '下滑时隐藏 Header',
- 'app.setting.hideheader.hint': '固定 Header 时可配置',
- 'app.setting.othersettings': '其他设置',
- 'app.setting.weakmode': '色弱模式',
- 'app.setting.copy': '拷贝设置',
- 'app.setting.copyinfo': '拷贝成功,请到 src/defaultSettings.js 中替换默认配置',
- 'app.setting.production.hint':
- '配置栏只在开发环境用于预览,生产环境不会展现,请拷贝后手动修改配置文件',
-};
diff --git a/app/web/src/locales/zh-TW.js b/app/web/src/locales/zh-TW.js
deleted file mode 100644
index 8f588fe5..00000000
--- a/app/web/src/locales/zh-TW.js
+++ /dev/null
@@ -1,285 +0,0 @@
-export default {
- 'navBar.lang': '語言',
- 'layout.user.link.help': '幫助',
- 'layout.user.link.privacy': '隱私',
- 'layout.user.link.terms': '條款',
- 'validation.email.required': '請輸入郵箱地址!',
- 'validation.email.wrong-format': '郵箱地址格式錯誤!',
- 'validation.password.required': '請輸入密碼!',
- 'validation.password.twice': '兩次輸入的密碼不匹配!',
- 'validation.password.strength.msg': '請至少輸入 6 個字符。請不要使用容易被猜到的密碼。',
- 'validation.password.strength.strong': '強度:強',
- 'validation.password.strength.medium': '強度:中',
- 'validation.password.strength.short': '強度:太短',
- 'validation.confirm-password.required': '請確認密碼!',
- 'validation.phone-number.required': '請輸入手機號!',
- 'validation.phone-number.wrong-format': '手機號格式錯誤!',
- 'validation.verification-code.required': '請輸入驗證碼!',
- 'validation.title.required': '請輸入標題',
- 'validation.date.required': '請選擇起止日期',
- 'validation.goal.required': '請輸入目標描述',
- 'validation.standard.required': '請輸入衡量標淮',
- 'form.optional': '(選填)',
- 'form.submit': '提交',
- 'form.save': '保存',
- 'form.email.placeholder': '郵箱',
- 'form.password.placeholder': '至少6位密碼,區分大小寫',
- 'form.confirm-password.placeholder': '確認密碼',
- 'form.phone-number.placeholder': '位手機號',
- 'form.verification-code.placeholder': '驗證碼',
- 'form.title.label': '標題',
- 'form.title.placeholder': '給目標起個名字',
- 'form.date.label': '起止日期',
- 'form.date.placeholder.start': '開始日期',
- 'form.date.placeholder.end': '結束日期',
- 'form.goal.label': '目標描述',
- 'form.goal.placeholder': '請輸入妳的階段性工作目標',
- 'form.standard.label': '衡量標淮',
- 'form.standard.placeholder': '請輸入衡量標淮',
- 'form.client.label': '客戶',
- 'form.client.label.tooltip': '目標的服務對象',
- 'form.client.placeholder': '請描述妳服務的客戶,內部客戶直接 @姓名/工號',
- 'form.invites.label': '邀評人',
- 'form.invites.placeholder': '請直接 @姓名/工號,最多可邀請 5 人',
- 'form.weight.label': '權重',
- 'form.weight.placeholder': '請輸入',
- 'form.public.label': '目標公開',
- 'form.public.label.help': '客戶、邀評人默認被分享',
- 'form.public.radio.public': '公開',
- 'form.public.radio.partially-public': '部分公開',
- 'form.public.radio.private': '不公開',
- 'form.publicUsers.placeholder': '公開給',
- 'form.publicUsers.option.A': '同事甲',
- 'form.publicUsers.option.B': '同事乙',
- 'form.publicUsers.option.C': '同事丙',
- 'component.globalHeader.search': '站內搜索',
- 'component.globalHeader.search.example1': '搜索提示壹',
- 'component.globalHeader.search.example2': '搜索提示二',
- 'component.globalHeader.search.example3': '搜索提示三',
- 'component.globalHeader.help': '使用文檔',
- 'component.globalHeader.notification': '通知',
- 'component.globalHeader.notification.empty': '妳已查看所有通知',
- 'component.globalHeader.message': '消息',
- 'component.globalHeader.message.empty': '您已讀完所有消息',
- 'component.globalHeader.event': '待辦',
- 'component.globalHeader.event.empty': '妳已完成所有待辦',
- 'component.noticeIcon.clear': '清空',
- 'component.noticeIcon.cleared': '清空了',
- 'component.noticeIcon.empty': '暫無數據',
- 'menu.home': '首頁',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': '分析頁',
- 'menu.dashboard.monitor': '監控頁',
- 'menu.dashboard.workplace': '工作臺',
- 'menu.form': '表單頁',
- 'menu.form.basicform': '基礎表單',
- 'menu.form.stepform': '分步表單',
- 'menu.form.stepform.info': '分步表單(填寫轉賬信息)',
- 'menu.form.stepform.confirm': '分步表單(確認轉賬信息)',
- 'menu.form.stepform.result': '分步表單(完成)',
- 'menu.form.advancedform': '高級表單',
- 'menu.list': '列表頁',
- 'menu.list.searchtable': '查詢表格',
- 'menu.list.basiclist': '標淮列表',
- 'menu.list.cardlist': '卡片列表',
- 'menu.list.searchlist': '搜索列表',
- 'menu.list.searchlist.articles': '搜索列表(文章)',
- 'menu.list.searchlist.projects': '搜索列表(項目)',
- 'menu.list.searchlist.applications': '搜索列表(應用)',
- 'menu.profile': '詳情頁',
- 'menu.profile.basic': '基礎詳情頁',
- 'menu.profile.advanced': '高級詳情頁',
- 'menu.result': '結果頁',
- 'menu.result.success': '成功頁',
- 'menu.result.fail': '失敗頁',
- 'menu.exception': '異常頁',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': '觸發錯誤',
- 'menu.account': '個人頁',
- 'menu.account.center': '個人中心',
- 'menu.account.settings': '個人設置',
- 'menu.account.trigger': '觸發報錯',
- 'menu.account.logout': '退出登錄',
- 'app.login.message-invalid-credentials': '賬戶或密碼錯誤(admin/888888)',
- 'app.login.message-invalid-verification-code': '驗證碼錯誤',
- 'app.login.tab-login-credentials': '賬戶密碼登錄',
- 'app.login.tab-login-mobile': '手機號登錄',
- 'app.login.remember-me': '自動登錄',
- 'app.login.forgot-password': '忘記密碼',
- 'app.login.sign-in-with': '其他登錄方式',
- 'app.login.signup': '註冊賬戶',
- 'app.login.login': '登錄',
- 'app.register.register': '註冊',
- 'app.register.get-verification-code': '獲取驗證碼',
- 'app.register.sing-in': '使用已有賬戶登錄',
- 'app.register-result.msg': '妳的賬戶:{email} 註冊成功',
- 'app.register-result.activation-email':
- '激活郵件已發送到妳的郵箱中,郵件有效期為24小時。請及時登錄郵箱,點擊郵件中的鏈接激活帳戶。',
- 'app.register-result.back-home': '返回首頁',
- 'app.register-result.view-mailbox': '查看郵箱',
- 'app.home.introduce': '介紹',
- 'app.analysis.test': '工專路 {no} 號店',
- 'app.analysis.introduce': '指標說明',
- 'app.analysis.total-sales': '總銷售額',
- 'app.analysis.day-sales': '日銷售額',
- 'app.analysis.visits': '訪問量',
- 'app.analysis.visits-trend': '訪問量趨勢',
- 'app.analysis.visits-ranking': '門店訪問量排名',
- 'app.analysis.day-visits': '日訪問量',
- 'app.analysis.week': '周同比',
- 'app.analysis.day': '日同比',
- 'app.analysis.payments': '支付筆數',
- 'app.analysis.conversion-rate': '轉化率',
- 'app.analysis.operational-effect': '運營活動效果',
- 'app.analysis.sales-trend': '銷售趨勢',
- 'app.analysis.sales-ranking': '門店銷售額排名',
- 'app.analysis.all-year': '全年',
- 'app.analysis.all-month': '本月',
- 'app.analysis.all-week': '本周',
- 'app.analysis.all-day': '今日',
- 'app.analysis.search-users': '搜索用戶數',
- 'app.analysis.per-capita-search': '人均搜索次數',
- 'app.analysis.online-top-search': '線上熱門搜索',
- 'app.analysis.the-proportion-of-sales': '銷售額類別占比',
- 'app.analysis.channel.all': '全部渠道',
- 'app.analysis.channel.online': '線上',
- 'app.analysis.channel.stores': '門店',
- 'app.analysis.sales': '銷售額',
- 'app.analysis.traffic': '客流量',
- 'app.analysis.table.rank': '排名',
- 'app.analysis.table.search-keyword': '搜索關鍵詞',
- 'app.analysis.table.users': '用戶數',
- 'app.analysis.table.weekly-range': '周漲幅',
- 'app.forms.basic.title': '基礎表單',
- 'app.forms.basic.description':
- '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。',
- 'app.monitor.trading-activity': '活動實時交易情況',
- 'app.monitor.total-transactions': '今日交易總額',
- 'app.monitor.sales-target': '銷售目標完成率',
- 'app.monitor.remaining-time': '活動剩余時間',
- 'app.monitor.total-transactions-per-second': '每秒交易總額',
- 'app.monitor.activity-forecast': '活動情況預測',
- 'app.monitor.efficiency': '券核效率',
- 'app.monitor.ratio': '跳出率',
- 'app.monitor.proportion-per-category': '各品類占比',
- 'app.monitor.fast-food': '中式快餐',
- 'app.monitor.western-food': '西餐',
- 'app.monitor.hot-pot': '火鍋',
- 'app.monitor.waiting-for-implementation': 'Waiting for implementation',
- 'app.monitor.popular-searches': '熱門搜索',
- 'app.monitor.resource-surplus': '資源剩余',
- 'app.monitor.fund-surplus': '補貼資金剩余',
- 'app.settings.menuMap.basic': '基本設置',
- 'app.settings.menuMap.security': '安全設置',
- 'app.settings.menuMap.binding': '賬號綁定',
- 'app.settings.menuMap.notification': '新消息通知',
- 'app.settings.basic.avatar': '頭像',
- 'app.settings.basic.change-avatar': '更換頭像',
- 'app.settings.basic.email': '郵箱',
- 'app.settings.basic.email-message': '請輸入您的郵箱!',
- 'app.settings.basic.nickname': '昵稱',
- 'app.settings.basic.nickname-message': '請輸入您的昵稱!',
- 'app.settings.basic.profile': '個人簡介',
- 'app.settings.basic.profile-message': '請輸入個人簡介!',
- 'app.settings.basic.profile-placeholder': '個人簡介',
- 'app.settings.basic.country': '國家/地區',
- 'app.settings.basic.country-message': '請輸入您的國家或地區!',
- 'app.settings.basic.geographic': '所在省市',
- 'app.settings.basic.geographic-message': '請輸入您的所在省市!',
- 'app.settings.basic.address': '街道地址',
- 'app.settings.basic.address-message': '請輸入您的街道地址!',
- 'app.settings.basic.phone': '聯系電話',
- 'app.settings.basic.phone-message': '請輸入您的聯系電話!',
- 'app.settings.basic.update': '更新基本信息',
- 'app.settings.security.strong': '強',
- 'app.settings.security.medium': '中',
- 'app.settings.security.weak': '弱',
- 'app.settings.security.password': '賬戶密碼',
- 'app.settings.security.password-description': '當前密碼強度:',
- 'app.settings.security.phone': '密保手機',
- 'app.settings.security.phone-description': '已綁定手機:',
- 'app.settings.security.question': '密保問題',
- 'app.settings.security.question-description': '未設置密保問題,密保問題可有效保護賬戶安全',
- 'app.settings.security.email': '備用郵箱',
- 'app.settings.security.email-description': '已綁定郵箱:',
- 'app.settings.security.mfa': 'MFA 設備',
- 'app.settings.security.mfa-description': '未綁定 MFA 設備,綁定後,可以進行二次確認',
- 'app.settings.security.modify': '修改',
- 'app.settings.security.set': '設置',
- 'app.settings.security.bind': '綁定',
- 'app.settings.binding.taobao': '綁定淘寶',
- 'app.settings.binding.taobao-description': '當前未綁定淘寶賬號',
- 'app.settings.binding.alipay': '綁定支付寶',
- 'app.settings.binding.alipay-description': '當前未綁定支付寶賬號',
- 'app.settings.binding.dingding': '綁定釘釘',
- 'app.settings.binding.dingding-description': '當前未綁定釘釘賬號',
- 'app.settings.binding.bind': '綁定',
- 'app.settings.notification.password': '賬戶密碼',
- 'app.settings.notification.password-description': '其他用戶的消息將以站內信的形式通知',
- 'app.settings.notification.messages': '系統消息',
- 'app.settings.notification.messages-description': '系統消息將以站內信的形式通知',
- 'app.settings.notification.todo': '賬戶密碼',
- 'app.settings.notification.todo-description': '賬戶密碼',
- 'app.settings.open': '開',
- 'app.settings.close': '關',
- 'app.exception.back': '返回首頁',
- 'app.exception.description.403': '抱歉,妳無權訪問該頁面',
- 'app.exception.description.404': '抱歉,妳訪問的頁面不存在',
- 'app.exception.description.500': '抱歉,服務器出錯了',
- 'app.result.error.title': '提交失敗',
- 'app.result.error.description': '請核對並修改以下信息後,再重新提交。',
- 'app.result.error.hint-title': '您提交的內容有如下錯誤:',
- 'app.result.error.hint-text1': '您的賬戶已被凍結',
- 'app.result.error.hint-btn1': '立即解凍',
- 'app.result.error.hint-text2': '您的賬戶還不具備申請資格',
- 'app.result.error.hint-btn2': '立即升級',
- 'app.result.error.btn-text': '返回修改',
- 'app.result.success.title': '提交成功',
- 'app.result.success.description':
- '提交結果頁用於反饋壹系列操作任務的處理結果, 如果僅是簡單操作,使用 Message 全局提示反饋即可。 本文字區域可以展示簡單的補充說明,如果有類似展示 “單據”的需求,下面這個灰色區域可以呈現比較復雜的內容。',
- 'app.result.success.operate-title': '項目名稱',
- 'app.result.success.operate-id': '項目 ID:',
- 'app.result.success.principal': '負責人:',
- 'app.result.success.operate-time': '生效時間:',
- 'app.result.success.step1-title': '創建項目',
- 'app.result.success.step1-operator': '曲麗麗',
- 'app.result.success.step2-title': '部門初審',
- 'app.result.success.step2-operator': '周毛毛',
- 'app.result.success.step2-extra': '催壹下',
- 'app.result.success.step3-title': '財務復核',
- 'app.result.success.step4-title': '完成',
- 'app.result.success.btn-return': '返回列表',
- 'app.result.success.btn-project': '查看項目',
- 'app.result.success.btn-print': '打印',
- 'app.setting.pagestyle': '整體風格設置',
- 'app.setting.pagestyle.dark': '暗色菜單風格',
- 'app.setting.pagestyle.light': '亮色菜單風格',
- 'app.setting.content-width': '內容區域寬度',
- 'app.setting.content-width.fixed': '定寬',
- 'app.setting.content-width.fluid': '流式',
- 'app.setting.themecolor': '主題色',
- 'app.setting.themecolor.dust': '薄暮',
- 'app.setting.themecolor.volcano': '火山',
- 'app.setting.themecolor.sunset': '日暮',
- 'app.setting.themecolor.cyan': '明青',
- 'app.setting.themecolor.green': '極光綠',
- 'app.setting.themecolor.daybreak': '拂曉藍(默認)',
- 'app.setting.themecolor.geekblue': '極客藍',
- 'app.setting.themecolor.purple': '醬紫',
- 'app.setting.navigationmode': '導航模式',
- 'app.setting.sidemenu': '側邊菜單布局',
- 'app.setting.topmenu': '頂部菜單布局',
- 'app.setting.fixedheader': '固定 Header',
- 'app.setting.fixedsidebar': '固定側邊菜單',
- 'app.setting.fixedsidebar.hint': '側邊菜單布局時可配置',
- 'app.setting.hideheader': '下滑時隱藏 Header',
- 'app.setting.hideheader.hint': '固定 Header 時可配置',
- 'app.setting.othersettings': '其他設置',
- 'app.setting.weakmode': '色弱模式',
- 'app.setting.copy': '拷貝設置',
- 'app.setting.copyinfo': '拷貝成功,請到 src/defaultSettings.js 中替換默認配置',
- 'app.setting.production.hint':
- '配置欄只在開發環境用於預覽,生產環境不會展現,請拷貝後手動修改配置文件',
-};
diff --git a/app/web/src/models/global.js b/app/web/src/models/global.js
deleted file mode 100644
index 62f5c6a2..00000000
--- a/app/web/src/models/global.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import { queryNotices } from '@/services/api';
-
-export default {
- namespace: 'global',
-
- state: {
- collapsed: false,
- notices: [],
- },
-
- effects: {
- *fetchNotices(_, { call, put }) {
- const data = yield call(queryNotices);
- yield put({
- type: 'saveNotices',
- payload: data,
- });
- yield put({
- type: 'user/changeNotifyCount',
- payload: data.length,
- });
- },
- *clearNotices({ payload }, { put, select }) {
- yield put({
- type: 'saveClearedNotices',
- payload,
- });
- const count = yield select(state => state.global.notices.length);
- yield put({
- type: 'user/changeNotifyCount',
- payload: count,
- });
- },
- },
-
- reducers: {
- changeLayoutCollapsed(state, { payload }) {
- return {
- ...state,
- collapsed: payload,
- };
- },
- saveNotices(state, { payload }) {
- return {
- ...state,
- notices: payload,
- };
- },
- saveClearedNotices(state, { payload }) {
- return {
- ...state,
- notices: state.notices.filter(item => item.type !== payload),
- };
- },
- },
-
- subscriptions: {
- setup({ history }) {
- // Subscribe history(url) change, trigger `load` action if pathname is `/`
- return history.listen(({ pathname, search }) => {
- if (typeof window.ga !== 'undefined') {
- window.ga('send', 'pageview', pathname + search);
- }
- });
- },
- },
-};
diff --git a/app/web/src/models/setting.js b/app/web/src/models/setting.js
deleted file mode 100644
index 171da48d..00000000
--- a/app/web/src/models/setting.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { message } from 'antd';
-import defaultSettings from '../defaultSettings';
-
-let lessNodesAppended;
-const updateTheme = primaryColor => {
- // Don't compile less in production!
- if (APP_TYPE !== 'site') {
- return;
- }
- // Determine if the component is remounted
- if (!primaryColor) {
- return;
- }
- const hideMessage = message.loading('正在编译主题!', 0);
- function buildIt() {
- if (!window.less) {
- return;
- }
- setTimeout(() => {
- window.less
- .modifyVars({
- '@primary-color': primaryColor,
- })
- .then(() => {
- hideMessage();
- })
- .catch(() => {
- message.error('Failed to update theme');
- hideMessage();
- });
- }, 200);
- }
- if (!lessNodesAppended) {
- // insert less.js and color.less
- const lessStyleNode = document.createElement('link');
- const lessConfigNode = document.createElement('script');
- const lessScriptNode = document.createElement('script');
- lessStyleNode.setAttribute('rel', 'stylesheet/less');
- lessStyleNode.setAttribute('href', '/color.less');
- lessConfigNode.innerHTML = `
- window.less = {
- async: true,
- env: 'production',
- javascriptEnabled: true
- };
- `;
- lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js';
- lessScriptNode.async = true;
- lessScriptNode.onload = () => {
- buildIt();
- lessScriptNode.onload = null;
- };
- document.body.appendChild(lessStyleNode);
- document.body.appendChild(lessConfigNode);
- document.body.appendChild(lessScriptNode);
- lessNodesAppended = true;
- } else {
- buildIt();
- }
-};
-
-const updateColorWeak = colorWeak => {
- document.body.className = colorWeak ? 'colorWeak' : '';
-};
-
-export default {
- namespace: 'setting',
- state: defaultSettings,
- reducers: {
- getSetting(state) {
- const setting = {};
- const urlParams = new URL(window.location.href);
- Object.keys(state).forEach(key => {
- if (urlParams.searchParams.has(key)) {
- const value = urlParams.searchParams.get(key);
- setting[key] = value === '1' ? true : value;
- }
- });
- const { primaryColor, colorWeak } = setting;
- if (state.primaryColor !== primaryColor) {
- updateTheme(primaryColor);
- }
- updateColorWeak(colorWeak);
- return {
- ...state,
- ...setting,
- };
- },
- changeSetting(state, { payload }) {
- const urlParams = new URL(window.location.href);
- Object.keys(defaultSettings).forEach(key => {
- if (urlParams.searchParams.has(key)) {
- urlParams.searchParams.delete(key);
- }
- });
- Object.keys(payload).forEach(key => {
- if (key === 'collapse') {
- return;
- }
- let value = payload[key];
- if (value === true) {
- value = 1;
- }
- if (defaultSettings[key] !== value) {
- urlParams.searchParams.set(key, value);
- }
- });
- const { primaryColor, colorWeak, contentWidth } = payload;
- if (state.primaryColor !== primaryColor) {
- updateTheme(primaryColor);
- }
- if (state.contentWidth !== contentWidth && window.dispatchEvent) {
- window.dispatchEvent(new Event('resize'));
- }
- updateColorWeak(colorWeak);
- window.history.replaceState(null, 'setting', urlParams.href);
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/app/web/src/models/user.js b/app/web/src/models/user.js
deleted file mode 100644
index 3ceb127c..00000000
--- a/app/web/src/models/user.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import { query as queryUsers, queryCurrent } from '@/services/user';
-
-export default {
- namespace: 'user',
-
- state: {
- list: [],
- currentUser: {},
- },
-
- effects: {
- *fetch(_, { call, put }) {
- const response = yield call(queryUsers);
- yield put({
- type: 'save',
- payload: response,
- });
- },
- *fetchCurrent(_, { call, put }) {
- const response = yield call(queryCurrent);
- yield put({
- type: 'saveCurrentUser',
- payload: response,
- });
- },
- },
-
- reducers: {
- save(state, action) {
- return {
- ...state,
- list: action.payload,
- };
- },
- saveCurrentUser(state, action) {
- return {
- ...state,
- currentUser: action.payload || {},
- };
- },
- changeNotifyCount(state, action) {
- return {
- ...state,
- currentUser: {
- ...state.currentUser,
- notifyCount: action.payload,
- },
- };
- },
- },
-};
diff --git a/app/web/src/pages/Exception/403.js b/app/web/src/pages/Exception/403.js
deleted file mode 100644
index 0e564154..00000000
--- a/app/web/src/pages/Exception/403.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { formatMessage } from 'umi';
-import {Link} from 'umi';
-import Exception from '@/components/Exception';
-
-const Exception403 = () => (
-
-);
-
-export default Exception403;
diff --git a/app/web/src/pages/Exception/404.js b/app/web/src/pages/Exception/404.js
deleted file mode 100644
index 84c986c5..00000000
--- a/app/web/src/pages/Exception/404.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { formatMessage } from 'umi/locale';
-import Link from 'umi/link';
-import Exception from '@/components/Exception';
-
-const Exception404 = () => (
-
-);
-
-export default Exception404;
diff --git a/app/web/src/pages/Exception/500.js b/app/web/src/pages/Exception/500.js
deleted file mode 100644
index 9d96f212..00000000
--- a/app/web/src/pages/Exception/500.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { formatMessage } from 'umi/locale';
-import Link from 'umi/link';
-import Exception from '@/components/Exception';
-
-const Exception500 = () => (
-
-);
-
-export default Exception500;
diff --git a/app/web/src/pages/Exception/TriggerException.js b/app/web/src/pages/Exception/TriggerException.js
deleted file mode 100644
index 15ace510..00000000
--- a/app/web/src/pages/Exception/TriggerException.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Button, Spin, Card } from 'antd';
-import { connect } from 'dva';
-import styles from './style.less';
-
-@connect(state => ({
- isloading: state.error.isloading,
-}))
-class TriggerException extends PureComponent {
- state = {
- isloading: false,
- };
-
- triggerError = code => {
- this.setState({
- isloading: true,
- });
- const { dispatch } = this.props;
- dispatch({
- type: 'error/query',
- payload: {
- code,
- },
- });
- };
-
- render() {
- const { isloading } = this.state;
- return (
-
-
- this.triggerError(401)}>
- 触发401
-
- this.triggerError(403)}>
- 触发403
-
- this.triggerError(500)}>
- 触发500
-
- this.triggerError(404)}>
- 触发404
-
-
-
- );
- }
-}
-
-export default TriggerException;
diff --git a/app/web/src/pages/Exception/models/error.js b/app/web/src/pages/Exception/models/error.js
deleted file mode 100644
index 1bfd9392..00000000
--- a/app/web/src/pages/Exception/models/error.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import queryError from '@/services/error';
-
-export default {
- namespace: 'error',
-
- state: {
- error: '',
- isloading: false,
- },
-
- effects: {
- *query({ payload }, { call, put }) {
- yield call(queryError, payload.code);
- yield put({
- type: 'trigger',
- payload: payload.code,
- });
- },
- },
-
- reducers: {
- trigger(state, action) {
- return {
- error: action.payload,
- };
- },
- },
-};
diff --git a/app/web/src/pages/Exception/style.less b/app/web/src/pages/Exception/style.less
deleted file mode 100644
index 91ec7dcf..00000000
--- a/app/web/src/pages/Exception/style.less
+++ /dev/null
@@ -1,7 +0,0 @@
-.trigger {
- background: 'red';
- :global(.ant-btn) {
- margin-right: 8px;
- margin-bottom: 12px;
- }
-}
diff --git a/app/web/src/pages/helloworld.js b/app/web/src/pages/helloworld.js
deleted file mode 100644
index 24e6acc3..00000000
--- a/app/web/src/pages/helloworld.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import {Component} from 'react';
-import {Card} from 'antd';
-import { Steps } from 'antd';
-import {LoadingOutlined} from '@ant-design/icons';
-
-const { Step } = Steps;
-
-class Helloworld extends Component {
- render() {
- return (
-
-
- }
- title="Alipay"
- description="在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。"
- />
-
-
-
-
- } description="This is a description." />
-
-
-
-
-
- );
- }
-}
-
-export default Helloworld;
diff --git a/app/web/src/services/api.js b/app/web/src/services/api.js
deleted file mode 100644
index b85a0a63..00000000
--- a/app/web/src/services/api.js
+++ /dev/null
@@ -1,126 +0,0 @@
-//import { stringify } from 'qs';
-import request from '@/utils/request';
-
-export async function queryProjectNotice() {
- return request('/api/project/notice');
-}
-
-export async function queryActivities() {
- return request('/api/activities');
-}
-
-export async function queryRule(params) {
- return request(`/api/rule?${stringify(params)}`);
-}
-
-export async function removeRule(params) {
- return request('/api/rule', {
- method: 'POST',
- body: {
- ...params,
- method: 'delete',
- },
- });
-}
-
-export async function addRule(params) {
- return request('/api/rule', {
- method: 'POST',
- body: {
- ...params,
- method: 'post',
- },
- });
-}
-
-export async function updateRule(params) {
- return request('/api/rule', {
- method: 'POST',
- body: {
- ...params,
- method: 'update',
- },
- });
-}
-
-export async function fakeSubmitForm(params) {
- return request('/api/forms', {
- method: 'POST',
- body: params,
- });
-}
-
-export async function fakeChartData() {
- return request('/api/fake_chart_data');
-}
-
-export async function queryTags() {
- return request('/api/tags');
-}
-
-export async function queryBasicProfile() {
- return request('/api/profile/basic');
-}
-
-export async function queryAdvancedProfile() {
- return request('/api/profile/advanced');
-}
-
-export async function queryFakeList(params) {
- return request(`/api/fake_list?${stringify(params)}`);
-}
-
-export async function removeFakeList(params) {
- const { count = 5, ...restParams } = params;
- return request(`/api/fake_list?count=${count}`, {
- method: 'POST',
- body: {
- ...restParams,
- method: 'delete',
- },
- });
-}
-
-export async function addFakeList(params) {
- const { count = 5, ...restParams } = params;
- return request(`/api/fake_list?count=${count}`, {
- method: 'POST',
- body: {
- ...restParams,
- method: 'post',
- },
- });
-}
-
-export async function updateFakeList(params) {
- const { count = 5, ...restParams } = params;
- return request(`/api/fake_list?count=${count}`, {
- method: 'POST',
- body: {
- ...restParams,
- method: 'update',
- },
- });
-}
-
-export async function fakeAccountLogin(params) {
- return request('/api/login/account', {
- method: 'POST',
- body: params,
- });
-}
-
-export async function fakeRegister(params) {
- return request('/api/register', {
- method: 'POST',
- body: params,
- });
-}
-
-export async function queryNotices() {
- return request('/api/notices');
-}
-
-export async function getFakeCaptcha(mobile) {
- return request(`/api/captcha?mobile=${mobile}`);
-}
diff --git a/app/web/src/services/error.js b/app/web/src/services/error.js
deleted file mode 100644
index 13f2e942..00000000
--- a/app/web/src/services/error.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import request from '@/utils/request';
-
-export default async function queryError(code) {
- return request(`/api/${code}`);
-}
diff --git a/app/web/src/services/user.js b/app/web/src/services/user.js
deleted file mode 100644
index 89e03c6f..00000000
--- a/app/web/src/services/user.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import request from '@/utils/request';
-
-export async function query() {
- return request('/api/users');
-}
-
-export async function queryCurrent() {
- return request('/api/currentUser');
-}
diff --git a/app/web/src/utils/Authorized.js b/app/web/src/utils/Authorized.js
deleted file mode 100644
index 8c420cba..00000000
--- a/app/web/src/utils/Authorized.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import RenderAuthorized from '@/components/Authorized';
-import { getAuthority } from './authority';
-
-let Authorized = RenderAuthorized(getAuthority()); // eslint-disable-line
-
-// Reload the rights component
-const reloadAuthorized = () => {
- Authorized = RenderAuthorized(getAuthority());
-};
-
-export { reloadAuthorized };
-export default Authorized;
diff --git a/app/web/src/utils/Yuan.js b/app/web/src/utils/Yuan.js
deleted file mode 100644
index 434a57fb..00000000
--- a/app/web/src/utils/Yuan.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { yuan } from '@/components/Charts';
-/**
- * 减少使用 dangerouslySetInnerHTML
- */
-export default class Yuan extends React.PureComponent {
- componentDidMount() {
- this.rendertoHtml();
- }
-
- componentDidUpdate() {
- this.rendertoHtml();
- }
-
- rendertoHtml = () => {
- const { children } = this.props;
- if (this.main) {
- this.main.innerHTML = yuan(children);
- }
- };
-
- render() {
- return (
- {
- this.main = ref;
- }}
- />
- );
- }
-}
diff --git a/app/web/src/utils/authority.js b/app/web/src/utils/authority.js
deleted file mode 100644
index 3d2e7b34..00000000
--- a/app/web/src/utils/authority.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// use localStorage to store the authority info, which might be sent from server in actual project.
-export function getAuthority(str) {
- // return localStorage.getItem('antd-pro-authority') || ['admin', 'user'];
- const authorityString =
- typeof str === 'undefined' ? localStorage.getItem('antd-pro-authority') : str;
- // authorityString could be admin, "admin", ["admin"]
- let authority;
- try {
- authority = JSON.parse(authorityString);
- } catch (e) {
- authority = authorityString;
- }
- if (typeof authority === 'string') {
- return [authority];
- }
- return authority || ['admin'];
-}
-
-export function setAuthority(authority) {
- const proAuthority = typeof authority === 'string' ? [authority] : authority;
- return localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority));
-}
diff --git a/app/web/src/utils/authority.test.js b/app/web/src/utils/authority.test.js
deleted file mode 100644
index 8a6cd41f..00000000
--- a/app/web/src/utils/authority.test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getAuthority } from './authority';
-
-describe('getAuthority should be strong', () => {
- it('empty', () => {
- expect(getAuthority(null)).toEqual(['admin']); // default value
- });
- it('string', () => {
- expect(getAuthority('admin')).toEqual(['admin']);
- });
- it('array with double quotes', () => {
- expect(getAuthority('"admin"')).toEqual(['admin']);
- });
- it('array with single item', () => {
- expect(getAuthority('["admin"]')).toEqual(['admin']);
- });
- it('array with multiple items', () => {
- expect(getAuthority('["admin", "guest"]')).toEqual(['admin', 'guest']);
- });
-});
diff --git a/app/web/src/utils/request.js b/app/web/src/utils/request.js
deleted file mode 100644
index 98d1319f..00000000
--- a/app/web/src/utils/request.js
+++ /dev/null
@@ -1,158 +0,0 @@
-import fetch from 'dva/fetch';
-import { notification } from 'antd';
-import {history} from 'umi';
-import hash from 'hash.js';
-import { isAntdPro } from './utils';
-
-const codeMessage = {
- 200: '服务器成功返回请求的数据。',
- 201: '新建或修改数据成功。',
- 202: '一个请求已经进入后台排队(异步任务)。',
- 204: '删除数据成功。',
- 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
- 401: '用户没有权限(令牌、用户名、密码错误)。',
- 403: '用户得到授权,但是访问是被禁止的。',
- 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
- 406: '请求的格式不可得。',
- 410: '请求的资源被永久删除,且不会再得到的。',
- 422: '当创建一个对象时,发生一个验证错误。',
- 500: '服务器发生错误,请检查服务器。',
- 502: '网关错误。',
- 503: '服务不可用,服务器暂时过载或维护。',
- 504: '网关超时。',
-};
-
-const checkStatus = response => {
- if (response.status >= 200 && response.status < 300) {
- return response;
- }
- const errortext = codeMessage[response.status] || response.statusText;
- notification.error({
- message: `请求错误 ${response.status}: ${response.url}`,
- description: errortext,
- });
- const error = new Error(errortext);
- error.name = response.status;
- error.response = response;
- throw error;
-};
-
-const cachedSave = (response, hashcode) => {
- /**
- * Clone a response data and store it in sessionStorage
- * Does not support data other than json, Cache only json
- */
- const contentType = response.headers.get('Content-Type');
- if (contentType && contentType.match(/application\/json/i)) {
- // All data is saved as text
- response
- .clone()
- .text()
- .then(content => {
- sessionStorage.setItem(hashcode, content);
- sessionStorage.setItem(`${hashcode}:timestamp`, Date.now());
- });
- }
- return response;
-};
-
-/**
- * Requests a URL, returning a promise.
- *
- * @param {string} url The URL we want to request
- * @param {object} [option] The options we want to pass to "fetch"
- * @return {object} An object containing either "data" or "err"
- */
-export default function request(
- url,
- option,
-) {
- const options = {
- expirys: isAntdPro(),
- ...option,
- };
- /**
- * Produce fingerprints based on url and parameters
- * Maybe url has the same parameters
- */
- const fingerprint = url + (options.body ? JSON.stringify(options.body) : '');
- const hashcode = hash
- .sha256()
- .update(fingerprint)
- .digest('hex');
-
- const defaultOptions = {
- credentials: 'include',
- };
- const newOptions = { ...defaultOptions, ...options };
- if (
- newOptions.method === 'POST' ||
- newOptions.method === 'PUT' ||
- newOptions.method === 'DELETE'
- ) {
- if (!(newOptions.body instanceof FormData)) {
- newOptions.headers = {
- Accept: 'application/json',
- 'Content-Type': 'application/json; charset=utf-8',
- ...newOptions.headers,
- };
- newOptions.body = JSON.stringify(newOptions.body);
- } else {
- // newOptions.body is FormData
- newOptions.headers = {
- Accept: 'application/json',
- ...newOptions.headers,
- };
- }
- }
-
- const expirys = options.expirys && 60;
- // options.expirys !== false, return the cache,
- if (options.expirys !== false) {
- const cached = sessionStorage.getItem(hashcode);
- const whenCached = sessionStorage.getItem(`${hashcode}:timestamp`);
- if (cached !== null && whenCached !== null) {
- const age = (Date.now() - whenCached) / 1000;
- if (age < expirys) {
- const response = new Response(new Blob([cached]));
- return response.json();
- }
- sessionStorage.removeItem(hashcode);
- sessionStorage.removeItem(`${hashcode}:timestamp`);
- }
- }
- return fetch(url, newOptions)
- .then(checkStatus)
- .then(response => cachedSave(response, hashcode))
- .then(response => {
- // DELETE and 204 do not return data by default
- // using .json will report an error.
- if (newOptions.method === 'DELETE' || response.status === 204) {
- return response.text();
- }
- return response.json();
- })
- .catch(e => {
- const status = e.name;
- if (status === 401) {
- // @HACK
- /* eslint-disable no-underscore-dangle */
- window.g_app._store.dispatch({
- type: 'login/logout',
- });
- return;
- }
- // environment should not be used
- if (status === 403) {
- history.push('/exception/403');
- return;
- }
- if (status <= 504 && status >= 500) {
- history.push('/exception/500');
- return;
- }
- if (status >= 404 && status < 422) {
- history.push('/exception/404');
- }
- });
-}
diff --git a/app/web/src/utils/utils.js b/app/web/src/utils/utils.js
deleted file mode 100644
index 3c795c22..00000000
--- a/app/web/src/utils/utils.js
+++ /dev/null
@@ -1,183 +0,0 @@
-import moment from 'moment';
-import React from 'react';
-import nzh from 'nzh/cn';
-import { parse, stringify } from 'qs';
-
-export function fixedZero(val) {
- return val * 1 < 10 ? `0${val}` : val;
-}
-
-export function getTimeDistance(type) {
- const now = new Date();
- const oneDay = 1000 * 60 * 60 * 24;
-
- if (type === 'today') {
- now.setHours(0);
- now.setMinutes(0);
- now.setSeconds(0);
- return [moment(now), moment(now.getTime() + (oneDay - 1000))];
- }
-
- if (type === 'week') {
- let day = now.getDay();
- now.setHours(0);
- now.setMinutes(0);
- now.setSeconds(0);
-
- if (day === 0) {
- day = 6;
- } else {
- day -= 1;
- }
-
- const beginTime = now.getTime() - day * oneDay;
-
- return [moment(beginTime), moment(beginTime + (7 * oneDay - 1000))];
- }
-
- if (type === 'month') {
- const year = now.getFullYear();
- const month = now.getMonth();
- const nextDate = moment(now).add(1, 'months');
- const nextYear = nextDate.year();
- const nextMonth = nextDate.month();
-
- return [
- moment(`${year}-${fixedZero(month + 1)}-01 00:00:00`),
- moment(moment(`${nextYear}-${fixedZero(nextMonth + 1)}-01 00:00:00`).valueOf() - 1000),
- ];
- }
-
- const year = now.getFullYear();
- return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
-}
-
-export function getPlainNode(nodeList, parentPath = '') {
- const arr = [];
- nodeList.forEach(node => {
- const item = node;
- item.path = `${parentPath}/${item.path || ''}`.replace(/\/+/g, '/');
- item.exact = true;
- if (item.children && !item.component) {
- arr.push(...getPlainNode(item.children, item.path));
- } else {
- if (item.children && item.component) {
- item.exact = false;
- }
- arr.push(item);
- }
- });
- return arr;
-}
-
-export function digitUppercase(n) {
- return nzh.toMoney(n);
-}
-
-function getRelation(str1, str2) {
- if (str1 === str2) {
- console.warn('Two path are equal!'); // eslint-disable-line
- }
- const arr1 = str1.split('/');
- const arr2 = str2.split('/');
- if (arr2.every((item, index) => item === arr1[index])) {
- return 1;
- }
- if (arr1.every((item, index) => item === arr2[index])) {
- return 2;
- }
- return 3;
-}
-
-function getRenderArr(routes) {
- let renderArr = [];
- renderArr.push(routes[0]);
- for (let i = 1; i < routes.length; i += 1) {
- // 去重
- renderArr = renderArr.filter(item => getRelation(item, routes[i]) !== 1);
- // 是否包含
- const isAdd = renderArr.every(item => getRelation(item, routes[i]) === 3);
- if (isAdd) {
- renderArr.push(routes[i]);
- }
- }
- return renderArr;
-}
-
-/**
- * Get router routing configuration
- * { path:{name,...param}}=>Array<{name,path ...param}>
- * @param {string} path
- * @param {routerData} routerData
- */
-export function getRoutes(path, routerData) {
- let routes = Object.keys(routerData).filter(
- routePath => routePath.indexOf(path) === 0 && routePath !== path
- );
- // Replace path to '' eg. path='user' /user/name => name
- routes = routes.map(item => item.replace(path, ''));
- // Get the route to be rendered to remove the deep rendering
- const renderArr = getRenderArr(routes);
- // Conversion and stitching parameters
- const renderRoutes = renderArr.map(item => {
- const exact = !routes.some(route => route !== item && getRelation(route, item) === 1);
- return {
- exact,
- ...routerData[`${path}${item}`],
- key: `${path}${item}`,
- path: `${path}${item}`,
- };
- });
- return renderRoutes;
-}
-
-export function getPageQuery() {
- return parse(window.location.href.split('?')[1]);
-}
-
-export function getQueryPath(path = '', query = {}) {
- const search = stringify(query);
- if (search.length) {
- return `${path}?${search}`;
- }
- return path;
-}
-
-/* eslint no-useless-escape:0 */
-const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
-
-export function isUrl(path) {
- return reg.test(path);
-}
-
-export function formatWan(val) {
- const v = val * 1;
- if (!v || Number.isNaN(v)) return '';
-
- let result = val;
- if (val > 10000) {
- result = Math.floor(val / 10000);
- result = (
-
- {result}
-
- 万
-
-
- );
- }
- return result;
-}
-
-export function isAntdPro() {
- return window.location.hostname === 'preview.pro.ant.design';
-}
diff --git a/app/web/src/utils/utils.less b/app/web/src/utils/utils.less
deleted file mode 100644
index 72579225..00000000
--- a/app/web/src/utils/utils.less
+++ /dev/null
@@ -1,50 +0,0 @@
-.textOverflow() {
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- white-space: nowrap;
-}
-
-.textOverflowMulti(@line: 3, @bg: #fff) {
- overflow: hidden;
- position: relative;
- line-height: 1.5em;
- max-height: @line * 1.5em;
- text-align: justify;
- margin-right: -1em;
- padding-right: 1em;
- &:before {
- background: @bg;
- content: '...';
- padding: 0 1px;
- position: absolute;
- right: 14px;
- bottom: 0;
- }
- &:after {
- background: white;
- content: '';
- margin-top: 0.2em;
- position: absolute;
- right: 14px;
- width: 1em;
- height: 1em;
- }
-}
-
-// mixins for clearfix
-// ------------------------
-.clearfix() {
- zoom: 1;
- &:before,
- &:after {
- content: ' ';
- display: table;
- }
- &:after {
- clear: both;
- visibility: hidden;
- font-size: 0;
- height: 0;
- }
-}
diff --git a/app/web/src/utils/utils.test.js b/app/web/src/utils/utils.test.js
deleted file mode 100644
index 282db154..00000000
--- a/app/web/src/utils/utils.test.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import { fixedZero, isUrl } from './utils';
-
-describe('fixedZero tests', () => {
- it('should not pad large numbers', () => {
- expect(fixedZero(10)).toEqual(10);
- expect(fixedZero(11)).toEqual(11);
- expect(fixedZero(15)).toEqual(15);
- expect(fixedZero(20)).toEqual(20);
- expect(fixedZero(100)).toEqual(100);
- expect(fixedZero(1000)).toEqual(1000);
- });
-
- it('should pad single digit numbers and return them as string', () => {
- expect(fixedZero(0)).toEqual('00');
- expect(fixedZero(1)).toEqual('01');
- expect(fixedZero(2)).toEqual('02');
- expect(fixedZero(3)).toEqual('03');
- expect(fixedZero(4)).toEqual('04');
- expect(fixedZero(5)).toEqual('05');
- expect(fixedZero(6)).toEqual('06');
- expect(fixedZero(7)).toEqual('07');
- expect(fixedZero(8)).toEqual('08');
- expect(fixedZero(9)).toEqual('09');
- });
-
-});
-
-describe('isUrl tests', () => {
- it('should return false for invalid and corner case inputs', () => {
- expect(isUrl([])).toBeFalsy();
- expect(isUrl({})).toBeFalsy();
- expect(isUrl(false)).toBeFalsy();
- expect(isUrl(true)).toBeFalsy();
- expect(isUrl(NaN)).toBeFalsy();
- expect(isUrl(null)).toBeFalsy();
- expect(isUrl(undefined)).toBeFalsy();
- expect(isUrl()).toBeFalsy();
- expect(isUrl('')).toBeFalsy();
- });
-
- it('should return false for invalid URLs', () => {
- expect(isUrl('foo')).toBeFalsy();
- expect(isUrl('bar')).toBeFalsy();
- expect(isUrl('bar/test')).toBeFalsy();
- expect(isUrl('http:/example.com/')).toBeFalsy();
- expect(isUrl('ttp://example.com/')).toBeFalsy();
- });
-
- it('should return true for valid URLs', () => {
- expect(isUrl('http://example.com/')).toBeTruthy();
- expect(isUrl('https://example.com/')).toBeTruthy();
- expect(isUrl('http://example.com/test/123')).toBeTruthy();
- expect(isUrl('https://example.com/test/123')).toBeTruthy();
- expect(isUrl('http://example.com/test/123?foo=bar')).toBeTruthy();
- expect(isUrl('https://example.com/test/123?foo=bar')).toBeTruthy();
- expect(isUrl('http://www.example.com/')).toBeTruthy();
- expect(isUrl('https://www.example.com/')).toBeTruthy();
- expect(isUrl('http://www.example.com/test/123')).toBeTruthy();
- expect(isUrl('https://www.example.com/test/123')).toBeTruthy();
- expect(isUrl('http://www.example.com/test/123?foo=bar')).toBeTruthy();
- expect(isUrl('https://www.example.com/test/123?foo=bar')).toBeTruthy();
- });
-
-});
diff --git a/config/config.default.js b/config/config.default.js
deleted file mode 100644
index 2e411347..00000000
--- a/config/config.default.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* eslint valid-jsdoc: "off" */
-
-'use strict';
-const path = require('path');
-
-/**
- * @param {Egg.EggAppInfo} appInfo app info
- */
-module.exports = appInfo => {
- /**
- * built-in config
- * @type {Egg.EggAppConfig}
- **/
- const config = exports = {};
-
- // use for cookie sign key, should change to your own and keep security
- config.keys = appInfo.name + '_1583417062947_4667';
-
- // add your middleware config here
- config.middleware = [];
-
- // add your user config here
- const userConfig = {
- // myAppName: 'egg',
- };
- config.view = {
- root: path.join(appInfo.baseDir, 'app/view'),
- mapping: {
- '.html': 'nunjucks',
- },
- };
-
- config.assets = {
- publicPath: '/public',
- devServer: {
- autoPort: true,
- command: 'umi dev --port={port}',
- env: {
- APP_ROOT: path.resolve('app/web'),
- BROWSER: 'none',
- SOCKET_SERVER: 'http://127.0.0.1:{port}',
- },
- debug: true,
- },
- };
-
- config.security = {
- csrf: false,
- };
-
-
- return {
- ...config,
- ...userConfig,
- };
-};
diff --git a/config/config.js b/config/config.js
deleted file mode 100644
index 4abeef60..00000000
--- a/config/config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- routes: [{
- path: '/',
- component: './HelloWorld',
- }],
-}
\ No newline at end of file
diff --git a/config/plugin.js b/config/plugin.js
deleted file mode 100644
index 9d17b821..00000000
--- a/config/plugin.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict';
-
-/** @type Egg.EggPlugin */
-module.exports = {
- // had enabled by egg
- // static: {
- // enable: true,
- // }
- assets: {
- enable: true,
- package: 'egg-view-assets',
- },
- nunjucks: {
- enable: true,
- package: 'egg-view-nunjucks',
- },
-};
diff --git a/package.json b/package.json
deleted file mode 100644
index 0c9085d1..00000000
--- a/package.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "name": "logging-center",
- "version": "1.0.0",
- "description": "极限日志分析中心",
- "private": true,
- "egg": {
- "declarations": true
- },
- "dependencies": {
- "egg": "^2.15.1",
- "egg-scripts": "^2.11.0",
- "egg-view-assets": "^1.6.0",
- "egg-view-nunjucks": "^2.2.0",
- "enquire-js": "^0.2.1",
- "lodash-decorators": "^6.0.1",
- "nzh": "^1.0.4",
- "react-container-query": "^0.11.1"
- },
- "devDependencies": {
- "@umijs/preset-react": "^1.3.9",
- "autod": "^3.0.1",
- "autod-egg": "^1.1.0",
- "egg-bin": "^4.11.0",
- "egg-ci": "^1.11.0",
- "egg-mock": "^3.21.0",
- "eslint": "^5.13.0",
- "eslint-config-egg": "^7.1.0",
- "react-container-query": "^0.11.1",
- "react-document-title": "^2.0.3",
- "umi": "^3.0.4"
- },
- "engines": {
- "node": ">=10.0.0"
- },
- "scripts": {
- "start": "egg-scripts start --daemon --title=egg-server-ctest --env=prod",
- "stop": "egg-scripts stop --title=egg-server-ctest",
- "dev": "egg-bin dev",
- "debug": "egg-bin debug",
- "build": "npm run umi:build",
- "test": "npm run lint -- --fix && npm run test-local",
- "test-local": "egg-bin test",
- "cov": "egg-bin cov",
- "lint": "eslint .",
- "ci": "npm run lint && npm run cov",
- "autod": "autod",
- "umi:build": "UMI_ENV=prod CI=true APP_ROOT=$PWD/app/web umi build"
- },
- "ci": {
- "version": "10"
- },
- "repository": {
- "type": "git",
- "url": "ssh://git@git.infini.ltd:64221/infini/logging-center.git"
- },
- "author": "",
- "license": "INFINI-EULA"
-}