standard.md 2.16 KB
Newer Older
1 2 3 4 5 6 7 8
---
order: 1
title: Standard
---

标准页头。

````jsx
nikogu's avatar
nikogu committed
9
import PageHeader from 'ant-design-pro/lib/PageHeader';
ddcat1115's avatar
ddcat1115 committed
10
import DescriptionList from 'ant-design-pro/lib/DescriptionList';
ddcat1115's avatar
ddcat1115 committed
11
import { Button, Menu, Dropdown, Icon, Row, Col } from 'antd';
12

ddcat1115's avatar
ddcat1115 committed
13
const { Description } = DescriptionList;
ddcat1115's avatar
ddcat1115 committed
14
const ButtonGroup = Button.Group;
ddcat1115's avatar
ddcat1115 committed
15 16 17 18 19 20

const description = (
  <DescriptionList col="2">
    <Description term="创建人">曲丽丽</Description>
    <Description term="订购产品">XX 服务</Description>
    <Description term="创建时间">2017-07-07</Description>
ddcat1115's avatar
ddcat1115 committed
21
    <Description term="关联单据"><a href="">12421</a></Description>
ddcat1115's avatar
ddcat1115 committed
22 23 24
  </DescriptionList>
);

25 26 27 28 29 30 31 32 33 34
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
35 36 37 38 39 40 41
    <ButtonGroup>
      <Button>操作</Button>
      <Button>操作</Button>
      <Dropdown overlay={menu} placement="bottomRight">
        <Button><Icon type="ellipsis" /></Button>
      </Dropdown>
    </ButtonGroup>
ddcat1115's avatar
ddcat1115 committed
42
    <Button type="primary">主操作</Button>
43 44 45 46 47
  </div>
);

const extra = (
  <Row>
ddcat1115's avatar
ddcat1115 committed
48
    <Col sm={24} md={12}>
49 50 51
      <div style={{ color: 'rgba(0, 0, 0, 0.43)' }}>状态</div>
      <div style={{ color: 'rgba(0, 0, 0, 0.85)', fontSize: 20 }}>待审批</div>
    </Col>
ddcat1115's avatar
ddcat1115 committed
52
    <Col sm={24} md={12}>
53 54 55 56 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
      <div style={{ color: 'rgba(0, 0, 0, 0.43)' }}>订单金额</div>
      <div style={{ color: 'rgba(0, 0, 0, 0.85)', fontSize: 20 }}>¥ 568.08</div>
    </Col>
  </Row>
);

const breadcrumbList = [{
  title: '一级菜单',
  href: '/',
}, {
  title: '二级菜单',
  href: '/',
}, {
  title: '三级菜单',
}];

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

function onTabChange(key) {
  console.log(key);
}

ReactDOM.render(
  <div>
    <PageHeader
      title="单号:234231029431"
afc163's avatar
afc163 committed
85
      logo={<img alt="" src="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png" />}
86
      action={action}
ddcat1115's avatar
ddcat1115 committed
87
      content={description}
88 89 90 91 92 93 94 95
      extraContent={extra}
      breadcrumbList={breadcrumbList}
      tabList={tabList}
      onTabChange={onTabChange}
    />
  </div>
, mountNode);
````