diff --git a/src/components/ActiveChart/index.js b/src/components/ActiveChart/index.js deleted file mode 100644 index 051ae4484822ffd6fa7ce308c9cdb994fbebae3d..0000000000000000000000000000000000000000 --- a/src/components/ActiveChart/index.js +++ /dev/null @@ -1,102 +0,0 @@ -import React, { Component } from 'react'; -import { NumberInfo, Charts } from 'ant-design-pro'; - -import styles from './index.less'; - -const { MiniArea } = Charts; - -function fixedZero(val) { - return val * 1 < 10 ? `0${val}` : val; -} - -function getActiveData() { - const activeData = []; - for (let i = 0; i < 24; i += 1) { - activeData.push({ - x: `${fixedZero(i)}:00`, - y: Math.floor(Math.random() * 200) + i * 50, - }); - } - return activeData; -} - -export default class ActiveChart extends Component { - state = { - activeData: getActiveData(), - }; - - componentDidMount() { - this.loopData(); - } - - componentWillUnmount() { - clearTimeout(this.timer); - cancelAnimationFrame(this.requestRef); - } - - loopData = () => { - this.requestRef = requestAnimationFrame(() => { - this.timer = setTimeout(() => { - this.setState( - { - activeData: getActiveData(), - }, - () => { - this.loopData(); - } - ); - }, 1000); - }); - }; - - render() { - const { activeData = [] } = this.state; - - return ( -
- -
- -
- {activeData && ( -
-
-

{[...activeData].sort()[activeData.length - 1].y + 200} 亿元

-

{[...activeData].sort()[Math.floor(activeData.length / 2)].y} 亿元

-
-
-
-
-
-
-
-
- )} - {activeData && ( -
- 00:00 - {activeData[Math.floor(activeData.length / 2)].x} - {activeData[activeData.length - 1].x} -
- )} -
- ); - } -} diff --git a/src/components/ActiveChart/index.less b/src/components/ActiveChart/index.less deleted file mode 100644 index 99079a550aa6c3dbb25a82bd2f8b311bbc5d264c..0000000000000000000000000000000000000000 --- a/src/components/ActiveChart/index.less +++ /dev/null @@ -1,51 +0,0 @@ -.activeChart { - position: relative; -} -.activeChartGrid { - p { - position: absolute; - top: 80px; - } - p:last-child { - top: 115px; - } -} -.activeChartLegend { - position: relative; - font-size: 0; - margin-top: 8px; - height: 20px; - line-height: 20px; - span { - display: inline-block; - font-size: 12px; - text-align: center; - width: 33.33%; - } - span:first-child { - text-align: left; - } - span:last-child { - text-align: right; - } -} -.dashedLine { - position: relative; - height: 1px; - top: -70px; - left: -3px; - - .line { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-image: linear-gradient(to right, transparent 50%, #e9e9e9 50%); - background-size: 6px; - } -} - -.dashedLine:last-child { - top: -36px; -} diff --git a/src/components/ArticleListContent/index.js b/src/components/ArticleListContent/index.js deleted file mode 100644 index c4525d6a51a8e401740387f854200521891c7f46..0000000000000000000000000000000000000000 --- a/src/components/ArticleListContent/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import moment from 'moment'; -import { Avatar } from 'antd'; -import styles from './index.less'; - -const ArticleListContent = ({ data: { content, updatedAt, avatar, owner, href } }) => ( -
-
{content}
-
- - {owner} 发布在 {href} - {moment(updatedAt).format('YYYY-MM-DD HH:mm')} -
-
-); - -export default ArticleListContent; diff --git a/src/components/ArticleListContent/index.less b/src/components/ArticleListContent/index.less deleted file mode 100644 index acf2c919143d4ef858159dcb7470fe7728afb9bc..0000000000000000000000000000000000000000 --- a/src/components/ArticleListContent/index.less +++ /dev/null @@ -1,38 +0,0 @@ -@import '~antd/lib/style/themes/default.less'; - -.listContent { - .description { - line-height: 22px; - max-width: 720px; - } - .extra { - color: @text-color-secondary; - margin-top: 16px; - line-height: 22px; - & > :global(.ant-avatar) { - vertical-align: top; - margin-right: 8px; - width: 20px; - height: 20px; - position: relative; - top: 1px; - } - & > em { - color: @disabled-color; - font-style: normal; - margin-left: 16px; - } - } -} - -@media screen and (max-width: @screen-xs) { - .listContent { - .extra { - & > em { - display: block; - margin-left: 0; - margin-top: 8px; - } - } - } -} diff --git a/src/components/EditableItem/index.js b/src/components/EditableItem/index.js deleted file mode 100644 index 40034d0ac9d870967f9248dc34986fb085229278..0000000000000000000000000000000000000000 --- a/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.props; - if (onChange) { - onChange(value); - } - }; - - edit = () => { - this.setState({ editable: true }); - }; - - render() { - const { value, editable } = this.state; - return ( -
- {editable ? ( -
- - -
- ) : ( -
- {value || ' '} - -
- )} -
- ); - } -} diff --git a/src/components/EditableItem/index.less b/src/components/EditableItem/index.less deleted file mode 100644 index 457a18bd4b9b4775a5eb5619c8f80f212d1467f7..0000000000000000000000000000000000000000 --- a/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/src/components/EditableLinkGroup/index.js b/src/components/EditableLinkGroup/index.js deleted file mode 100644 index ae3d93c712b8b019078fe37bd07286716349ef3f..0000000000000000000000000000000000000000 --- a/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/src/components/EditableLinkGroup/index.less b/src/components/EditableLinkGroup/index.less deleted file mode 100644 index a421df6fe8d1f132c04db8f326e45660cd8621cb..0000000000000000000000000000000000000000 --- a/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/src/components/PageHeaderWrapper/GridContent.js b/src/components/PageHeaderWrapper/GridContent.js deleted file mode 100644 index 931ea20c91b21724f8680a7cf12f3aaefb2fda75..0000000000000000000000000000000000000000 --- a/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/src/components/PageHeaderWrapper/GridContent.less b/src/components/PageHeaderWrapper/GridContent.less deleted file mode 100644 index d5496e9ecb95318c38a30f1369d35e8fcf583758..0000000000000000000000000000000000000000 --- a/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/src/components/PageHeaderWrapper/index.js b/src/components/PageHeaderWrapper/index.js deleted file mode 100644 index b081ba03d735ebe15120e9fa5a78248f0d2da608..0000000000000000000000000000000000000000 --- a/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 { PageHeader } from 'ant-design-pro'; -import { connect } from 'dva'; -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.title; - }} - /> - )} - - {children ? ( -
- {children} -
- ) : null} -
-); - -export default connect(({ setting }) => ({ - contentWidth: setting.contentWidth, -}))(PageHeaderWrapper); diff --git a/src/components/PageHeaderWrapper/index.less b/src/components/PageHeaderWrapper/index.less deleted file mode 100644 index 39a449657a98b039c29e6654fd117267cbb5283a..0000000000000000000000000000000000000000 --- a/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/src/components/StandardFormRow/index.js b/src/components/StandardFormRow/index.js deleted file mode 100644 index 8cb0e444e6d488ae4cdfeceb8eb94ee4adbb9248..0000000000000000000000000000000000000000 --- a/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/src/components/StandardFormRow/index.less b/src/components/StandardFormRow/index.less deleted file mode 100644 index 83ab019f43217c2ee53d037b24a327e92c4a00c2..0000000000000000000000000000000000000000 --- a/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/src/components/StandardTable/index.js b/src/components/StandardTable/index.js deleted file mode 100644 index c0c17251edd43b2d1851cdc17fdfa6f0ac0e6f50..0000000000000000000000000000000000000000 --- a/src/components/StandardTable/index.js +++ /dev/null @@ -1,121 +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 = {}, rowKey, ...rest } = this.props; - const { list = [], pagination } = data; - - 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/src/components/StandardTable/index.less b/src/components/StandardTable/index.less deleted file mode 100644 index 817be991fecf735770e93f7846d22edf39f869ba..0000000000000000000000000000000000000000 --- a/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; - } -}