From bbb56769844c6b6115c67f4009882395adc1c768 Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Wed, 30 Aug 2017 11:47:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=8C=E6=AC=A1List=20?= =?UTF-8?q?=E5=92=8C=20Dashboard=20=E7=9A=84=E4=BA=8C=E6=AC=A1=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Charts/index.less | 1 + src/routes/Dashboard/Analysis.less | 3 +++ src/routes/Dashboard/Monitor.js | 28 +++++++++++++++++----------- src/routes/List/BasicList.js | 3 ++- src/routes/List/CardList.js | 2 +- src/routes/List/CardList.less | 4 ++++ src/routes/List/CoverCardList.js | 23 ++++++++++++++++++++++- src/routes/List/FilterCardList.js | 26 +++++++++++++++++++++++--- src/routes/List/SearchList.js | 25 ++++++++++++++++++++++--- src/routes/List/TableList.js | 22 ++++++++++++---------- 10 files changed, 107 insertions(+), 30 deletions(-) diff --git a/src/components/Charts/index.less b/src/components/Charts/index.less index cc4387d0..33547992 100644 --- a/src/components/Charts/index.less +++ b/src/components/Charts/index.less @@ -1,4 +1,5 @@ .miniChart { + overflow: hidden; position: relative; width: 100%; & > div { diff --git a/src/routes/Dashboard/Analysis.less b/src/routes/Dashboard/Analysis.less index 390941ae..54476f4a 100644 --- a/src/routes/Dashboard/Analysis.less +++ b/src/routes/Dashboard/Analysis.less @@ -72,6 +72,9 @@ } @media screen and (max-width: @screen-lg) { + .salesExtra { + display: none; + } .rankingList { li { span:first-child { diff --git a/src/routes/Dashboard/Monitor.js b/src/routes/Dashboard/Monitor.js index b8b20568..b7977e73 100644 --- a/src/routes/Dashboard/Monitor.js +++ b/src/routes/Dashboard/Monitor.js @@ -3,7 +3,6 @@ import { connect } from 'dva'; import { Row, Col, Card } from 'antd'; import numeral from 'numeral'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import { NumberInfo, MiniArea, Pie, WaterWave, Gauge } from '../../components/Charts'; import MapChart from '../../components/MapChart'; import TagCloud from '../../components/TagCloud'; @@ -45,12 +44,10 @@ export default class Monitor extends PureComponent { const { tags } = monitor; return ( - +
- + - +
- + - + - + - + - +
); } } diff --git a/src/routes/List/BasicList.js b/src/routes/List/BasicList.js index 90063e51..b3e9a8d2 100644 --- a/src/routes/List/BasicList.js +++ b/src/routes/List/BasicList.js @@ -95,7 +95,7 @@ export default class BasicList extends PureComponent { return (
- + @@ -110,6 +110,7 @@ export default class BasicList extends PureComponent { - 这是一个标题 + 这是一个标题
); diff --git a/src/routes/List/CardList.less b/src/routes/List/CardList.less index 664da006..e8b4c44a 100644 --- a/src/routes/List/CardList.less +++ b/src/routes/List/CardList.less @@ -12,6 +12,10 @@ .extraImg { margin-top: -60px; text-align: center; + width: 195px; + img { + width: 100%; + } } .newButton { diff --git a/src/routes/List/CoverCardList.js b/src/routes/List/CoverCardList.js index 00cb75f0..2c4699a5 100644 --- a/src/routes/List/CoverCardList.js +++ b/src/routes/List/CoverCardList.js @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react'; import moment from 'moment'; import { connect } from 'dva'; +import { routerRedux } from 'dva/router'; import { Row, Col, Form, Card, Select, Spin } from 'antd'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; @@ -49,6 +50,23 @@ export default class CoverCardList extends PureComponent { }, 0); } + handleTabChange = (key) => { + const { dispatch } = this.props; + switch (key) { + case 'doc': + dispatch(routerRedux.push('/list/search')); + break; + case 'app': + dispatch(routerRedux.push('/list/filter-card-list')); + break; + case 'project': + dispatch(routerRedux.push('/list/cover-card-list')); + break; + default: + break; + } + } + render() { const { list: { list = [], loading }, form } = this.props; const { getFieldDecorator } = form; @@ -90,7 +108,7 @@ export default class CoverCardList extends PureComponent { const tabList = [ { - key: 'docs', + key: 'doc', tab: '文章', }, { @@ -100,6 +118,7 @@ export default class CoverCardList extends PureComponent { { key: 'project', tab: '项目', + default: true, }, ]; @@ -121,9 +140,11 @@ export default class CoverCardList extends PureComponent { title="带封面的卡片列表" content={pageHeaderContent} tabList={tabList} + onTabChange={this.handleTabChange} >
{ + const { dispatch } = this.props; + switch (key) { + case 'doc': + dispatch(routerRedux.push('/list/search')); + break; + case 'app': + dispatch(routerRedux.push('/list/filter-card-list')); + break; + case 'project': + dispatch(routerRedux.push('/list/cover-card-list')); + break; + default: + break; + } + } + render() { const { list: { list, loading }, form } = this.props; const { getFieldDecorator } = form; const tabList = [ { - key: 'docs', + key: 'doc', tab: '文章', }, { - key: 'apps', + key: 'app', tab: '应用', default: true, }, { - key: 'projects', + key: 'project', tab: '项目', }, ]; @@ -112,10 +130,12 @@ export default class FilterCardList extends PureComponent { title="带筛选卡片列表" content={pageHeaderContent} tabList={tabList} + onTabChange={this.handleTabChange} >
{ + const { dispatch } = this.props; + switch (key) { + case 'docs': + dispatch(routerRedux.push('/list/search')); + break; + case 'app': + dispatch(routerRedux.push('/list/filter-card-list')); + break; + case 'project': + dispatch(routerRedux.push('/list/cover-card-list')); + break; + default: + break; + } + } + render() { const { showLoadMore, loadingMore } = this.state; const { form, list: { list } } = this.props; @@ -100,7 +118,7 @@ export default class SearchList extends Component { const tabList = [ { - key: 'docs', + key: 'doc', tab: '文章', }, { @@ -148,9 +166,10 @@ export default class SearchList extends Component { title="搜索列表" content={pageHeaderContent} tabList={tabList} + onTabChange={this.handleTabChange} >
- + @@ -243,7 +262,7 @@ export default class SearchList extends Component { - + 0) && showLoadMore} diff --git a/src/routes/List/TableList.js b/src/routes/List/TableList.js index a0d9f4f8..c6a3d7dc 100644 --- a/src/routes/List/TableList.js +++ b/src/routes/List/TableList.js @@ -164,15 +164,13 @@ export default class TableList extends PureComponent { const menu = ( 删除 - { - selectedRows.length > 1 && 批量审批 - } + 批量审批 ); return ( - +
@@ -229,12 +227,16 @@ export default class TableList extends PureComponent {
- - - - + { + selectedRows.length > 0 && + + + + + + }