standard.md 2.08 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';
11 12
import { Button, Menu, Dropdown, Icon, Row, Col } from 'antd';

ddcat1115's avatar
ddcat1115 committed
13 14 15 16 17 18 19 20 21 22 23
const { Description } = DescriptionList;

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

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

const extra = (
  <Row>
ddcat1115's avatar
ddcat1115 committed
47
    <Col sm={24} md={12}>
48 49 50
      <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
51
    <Col sm={24} md={12}>
52 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 85
      <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"
      logo={<img alt="" src="https://gw.alipayobjects.com/zos/rmsportal/JcBAEvlHGhVvBekIJCWT.svg" />}
      action={action}
ddcat1115's avatar
ddcat1115 committed
86
      content={description}
87 88 89 90 91 92 93 94
      extraContent={extra}
      breadcrumbList={breadcrumbList}
      tabList={tabList}
      onTabChange={onTabChange}
    />
  </div>
, mountNode);
````