import React, { Component } from 'react'; import { connect } from 'dva'; import { Row, Col, Icon, Card, Tabs, Table, Radio, DatePicker, Tooltip } from 'antd'; import numeral from 'numeral'; import { ChartCard, Trend, yuan, MiniArea, MiniBar, MiniProgress, Field, Bar, Pie, NumberInfo, IconUp, IconDown } from '../../components/Charts'; import TimelineChart from '../../components/TimelineChart'; import { getTimeDistance } from '../../utils/utils'; import styles from './Analysis.less'; const TabPane = Tabs.TabPane; const { RangePicker } = DatePicker; const rankingListData = []; for (let i = 0; i < 7; i += 1) { rankingListData.push({ title: `工专路 ${i} 号店`, total: 323234, }); } @connect(state => ({ chart: state.chart, })) export default class Analysis extends Component { state = { salesType: 'all', currentTabKey: '', rangePickerValue: [], } componentDidMount() { this.props.dispatch({ type: 'chart/fetch', }); } componentWillUnmount() { const { dispatch } = this.props; dispatch({ type: 'chart/clear', }); } handleChangeSalesType = (e) => { this.setState({ salesType: e.target.value, }); } handleTabChange = (key) => { this.setState({ currentTabKey: key, }); } handleRangePickerChange = (rangePickerValue) => { this.setState({ rangePickerValue, }); this.props.dispatch({ type: 'chart/fetchSalesData', }); } selectDate = (type) => { this.setState({ rangePickerValue: getTimeDistance(type), }); this.props.dispatch({ type: 'chart/fetchSalesData', }); } render() { const { rangePickerValue, salesType, currentTabKey } = this.state; const { chart } = this.props; const { visitData, salesData, searchData, offlineData, offlineChartData, salesTypeData, salesTypeDataOnline, salesTypeDataOffline, } = chart; const salesPieData = salesType === 'all' ? salesTypeData : (salesType === 'online' ? salesTypeDataOnline : salesTypeDataOffline); const iconGroup = ( ); const salesExtra = (
this.selectDate('today')}>今日 this.selectDate('week')}>本周 this.selectDate('month')}>本月 this.selectDate('year')}>全年
); const columns = [ { title: '排名', dataIndex: 'index', key: 'index', }, { title: '搜索关键词', dataIndex: 'keyword', key: 'keyword', render: text => {text}, }, { title: '用户数', dataIndex: 'count', key: 'count', sorter: (a, b) => a.count - b.count, }, { title: '周涨幅', dataIndex: 'range', key: 'range', sorter: (a, b) => a.range - b.range, render: (text, record) => ( {text}% {record.status === 1 ? : } ), }, ]; const CustomTab = ({ data, currentTabKey: currentKey }) => ( ); const topColResponsiveProps = { xs: 24, sm: 12, md: 6, style: { marginBottom: 24 }, }; return (
} total={yuan(126560)} footer={} contentHeight={46} > 12.3% 11% } total={numeral(8846).format('0,0')} footer={} contentHeight={46} > } total={numeral(6560).format('0,0')} footer={} contentHeight={46} > } total="78%" footer={ 12.3% 11% } contentHeight={46} >

门店销售额排名

    { rankingListData.map((item, i) => (
  • {i + 1} {item.title} {numeral(item.total).format('0,0')}
  • )) }
访问量没有, 因为偷懒了
搜索用户数量 } total={numeral(12321).format('0,0')} status="up" subTotal={17.1} /> record.index} size="middle" columns={columns} dataSource={searchData} pagination={{ style: { marginBottom: 0 }, showSizeChanger: true, showQuickJumper: true, pageSize: 5, }} /> 全部渠道 线上 门店
now.y + pre, 0))} data={salesPieData} valueFormat={val => yuan(val)} height={294} />
{ offlineData.map(shop => ( } key={shop.name} >
) ) }
); } }