AdvancedProfile.js 8.12 KB
Newer Older
1 2 3
import React, { Component } from 'react';
import { connect } from 'dva';
import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip } from 'antd';
ddcat1115's avatar
ddcat1115 committed
4 5
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import DescriptionList from '../../components/DescriptionList';
ddcat1115's avatar
ddcat1115 committed
6
import EditableItem from '../../components/EditableItem';
ddcat1115's avatar
ddcat1115 committed
7
import styles from './AdvancedProfile.less';
8 9

const { Step } = Steps;
ddcat1115's avatar
ddcat1115 committed
10
const ButtonGroup = Button.Group;
11 12 13 14 15 16 17 18 19 20 21 22
const { Description } = DescriptionList;

const menu = (
  <Menu>
    <Menu.Item key="1">选项一</Menu.Item>
    <Menu.Item key="2">选项二</Menu.Item>
    <Menu.Item key="3">选项三</Menu.Item>
  </Menu>
);

const action = (
  <div>
ddcat1115's avatar
ddcat1115 committed
23 24 25 26 27 28 29 30 31
    <ButtonGroup style={{ marginRight: 8 }}>
      <Button size="large">操作</Button>
      <Button size="large">操作</Button>
      <Dropdown overlay={menu}>
        <Button size="large">
          更多操作 <Icon type="down" />
        </Button>
      </Dropdown>
    </ButtonGroup>
32 33 34 35 36 37
    <Button size="large" type="primary">主操作</Button>
  </div>
);

const extra = (
  <Row>
ddcat1115's avatar
ddcat1115 committed
38
    <Col xs={24} sm={12}>
39 40 41
      <div className={styles.textSecondary}>状态</div>
      <div className={styles.heading}>待审批</div>
    </Col>
ddcat1115's avatar
ddcat1115 committed
42
    <Col xs={24} sm={12}>
43 44 45 46 47 48 49 50 51
      <div className={styles.textSecondary}>订单金额</div>
      <div className={styles.heading}>¥ 568.08</div>
    </Col>
  </Row>
);

const description = (
  <DescriptionList col="2">
    <Description term="创建人">曲丽丽</Description>
ddcat1115's avatar
ddcat1115 committed
52
    <Description term="订购产品">XX 服务</Description>
53
    <Description term="创建时间">2017-07-07</Description>
ddcat1115's avatar
ddcat1115 committed
54
    <Description term="关联单据"><a href="">12421</a></Description>
55
    <Description term="生效日期">2017-07-07 ~ 2017-08-08</Description>
ddcat1115's avatar
ddcat1115 committed
56
    <Description term="备注">请于两个工作日内确认</Description>
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
  </DescriptionList>
);

const tabList = [{
  key: 'detail',
  tab: '详情',
}, {
  key: 'rule',
  tab: '规则',
}];

const desc1 = (
  <div style={{ fontSize: 14 }}>
    <div style={{ marginTop: 4, marginBottom: 8 }}>
      曲丽丽 <Icon type="dingding-o" />
    </div>
    <div>2016-12-12 12:32</div>
  </div>
);

const desc2 = (
  <div style={{ fontSize: 14 }}>
    <div style={{ marginTop: 4, marginBottom: 8 }}>
      周毛毛 <Icon type="dingding-o" style={{ color: '#00A0E9' }} />
    </div>
    <div><a href="">催一下</a></div>
  </div>
);

const popoverContent = (
  <div style={{ width: 160 }}>
    吴加号
    <span className={styles.textSecondary} style={{ float: 'right' }}>
      <Badge status="default" text="未响应" />
    </span>
    <p className={styles.textSecondary} style={{ marginTop: 8 }} >耗时2小时25分钟</p>
  </div>
);

const customDot = (dot, { status }) => (status === 'process' ?
  <Popover content={popoverContent}>
    {dot}
  </Popover>
  : dot
);

const operationTabList = [{
  key: 'tab1',
  tab: '操作日志一',
}, {
  key: 'tab2',
  tab: '操作日志二',
}, {
  key: 'tab3',
  tab: '操作日志三',
}];

const columns = [{
  title: '操作类型',
  dataIndex: 'type',
  key: 'type',
}, {
  title: '操作人',
  dataIndex: 'name',
  key: 'name',
}, {
  title: '执行结果',
  dataIndex: 'status',
  key: 'status',
  render: text => (
    text === 'agree' ? <Badge status="success" text="成功" /> : <Badge status="error" text="驳回" />
  ),
}, {
  title: '操作时间',
  dataIndex: 'updatedAt',
  key: 'updatedAt',
}, {
  title: '备注',
  dataIndex: 'memo',
  key: 'memo',
}];

@connect(state => ({
  profile: state.profile,
}))
ddcat1115's avatar
ddcat1115 committed
142
export default class AdvancedProfile extends Component {
143 144 145 146 147 148 149
  state = {
    operationkey: 'tab1',
  }

  componentDidMount() {
    const { dispatch } = this.props;
    dispatch({
ddcat1115's avatar
ddcat1115 committed
150
      type: 'profile/fetchAdvanced',
151 152 153 154 155 156 157 158 159
    });
  }

  onOperationTabChange = (key) => {
    this.setState({ operationkey: key });
  }

  render() {
    const { profile } = this.props;
ddcat1115's avatar
ddcat1115 committed
160
    const { advancedLoading, advancedOperation1, advancedOperation2, advancedOperation3 } = profile;
161 162 163
    const contentList = {
      tab1: <Table
        pagination={false}
ddcat1115's avatar
ddcat1115 committed
164 165
        loading={advancedLoading}
        dataSource={advancedOperation1}
166 167 168 169
        columns={columns}
      />,
      tab2: <Table
        pagination={false}
ddcat1115's avatar
ddcat1115 committed
170 171
        loading={advancedLoading}
        dataSource={advancedOperation2}
172 173 174 175
        columns={columns}
      />,
      tab3: <Table
        pagination={false}
ddcat1115's avatar
ddcat1115 committed
176 177
        loading={advancedLoading}
        dataSource={advancedOperation3}
178 179 180 181 182 183 184 185 186 187 188 189 190
        columns={columns}
      />,
    };

    return (
      <PageHeaderLayout
        title="单号:234231029431"
        logo={<img alt="" src="https://gw.alipayobjects.com/zos/rmsportal/JcBAEvlHGhVvBekIJCWT.svg" />}
        action={action}
        content={description}
        extraContent={extra}
        tabList={tabList}
      >
191
        <Card title="流程进度" style={{ marginBottom: 24 }} bordered={false}>
192 193 194 195 196 197 198
          <Steps progressDot={customDot} current={1}>
            <Step title="创建项目" description={desc1} />
            <Step title="部门初审" description={desc2} />
            <Step title="财务复核" />
            <Step title="完成" />
          </Steps>
        </Card>
199
        <Card title="用户信息" style={{ marginBottom: 24 }} bordered={false}>
200 201 202 203
          <DescriptionList style={{ marginBottom: 24 }}>
            <Description term="用户姓名">付小小</Description>
            <Description term="会员卡号">32943898021309809423</Description>
            <Description term="身份证">3321944288191034921</Description>
ddcat1115's avatar
ddcat1115 committed
204 205 206
            <Description term="联系方式">
              <EditableItem value="18112345678" />
            </Description>
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
            <Description term="联系地址">曲丽丽  18100000000  浙江省杭州市西湖区黄姑山路工专路交叉路口</Description>
          </DescriptionList>
          <DescriptionList style={{ marginBottom: 24 }} title="信息组" col="2">
            <Description term="某某数据">725</Description>
            <Description term="该数据更新时间">2017-08-08</Description>
            <Description term={
              <span>
                某某数据
                <Tooltip title="数据说明">
                  <Icon style={{ color: 'rgba(0, 0, 0, 0.43)', marginLeft: 4 }} type="info-circle-o" />
                </Tooltip>
              </span>
              }
            >
              725
            </Description>
            <Description term="该数据更新时间">2017-08-08</Description>
          </DescriptionList>
225
          <Card type="inner" title="多层级信息组">
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
            <DescriptionList style={{ marginBottom: 16 }} title="组名称">
              <Description term="负责人">林东东</Description>
              <Description term="角色码">1234567</Description>
              <Description term="所属部门">XX公司 - YY部</Description>
              <Description term="过期时间">2017-08-08</Description>
              <Description term="描述">这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长...</Description>
            </DescriptionList>
            <div className={styles.divider} />
            <DescriptionList style={{ marginBottom: 16 }} title="组名称" col="1">
              <Description term="学名">
                Citrullus lanatus (Thunb.) Matsum. et Nakai一年生蔓生藤本枝粗壮具明显的棱卷须较粗..
              </Description>
            </DescriptionList>
            <div className={styles.divider} />
            <DescriptionList title="组名称">
              <Description term="负责人">付小小</Description>
              <Description term="角色码">1234568</Description>
            </DescriptionList>
          </Card>
        </Card>
246
        <Card title="用户近半年来电记录" style={{ marginBottom: 24 }} bordered={false}>
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
          <div className={styles.noData}>
            <Icon type="frown-o" /> 暂无数据
          </div>
        </Card>
        <Card
          className={styles.tabsCard}
          bordered={false}
          tabList={operationTabList}
          onTabChange={this.onOperationTabChange}
        >
          {contentList[this.state.operationkey]}
        </Card>
      </PageHeaderLayout>
    );
  }
}