bee-table7/demo/demolist/Demo0201.js

150 lines
3.5 KiB
JavaScript
Raw Normal View History

2018-12-21 09:58:52 +08:00
/**
*
2019-04-16 13:35:25 +08:00
* @title 横向滚动条
2019-04-18 10:50:38 +08:00
* @parent 滚动 Scroll View
2019-05-06 11:17:40 +08:00
* @description `scroll.x`的值代表表体内容的实际宽度默认情况下是根据各列宽度合计出来的其值超过父元素的宽度时会自动出现滚动条如设置 `scroll={{ x:1000 }}`可以手动添加横向滚动条也可以设置`scroll={{ x:"110%" }}`
2019-04-23 20:11:38 +08:00
* demo0201
2018-12-21 09:58:52 +08:00
*/
2019-03-19 11:13:10 +08:00
2019-04-16 13:35:25 +08:00
import React, { Component } from "react";
import Table from "../../src";
2019-03-20 17:44:05 +08:00
const columns = [
2019-04-16 13:35:25 +08:00
{
title: "序号",
dataIndex: "index",
key: "index",
2019-04-19 17:04:39 +08:00
width: 100,
render(text, record, index) {
return index + 1;
}
2019-04-16 13:35:25 +08:00
},
{
title: "订单编号",
dataIndex: "orderCode",
key: "orderCode",
2019-04-19 17:04:39 +08:00
width: 300,
2019-04-16 13:35:25 +08:00
},
{
title: "供应商名称",
dataIndex: "supplierName",
key: "supplierName",
width: 200
},
{
title: "类型",
dataIndex: "type_name",
key: "type_name",
width: 200
},
{
title: "采购组织",
dataIndex: "purchasing",
key: "purchasing",
width: 200
},
{
title: "采购组",
dataIndex: "purchasingGroup",
key: "purchasingGroup",
2019-04-19 17:04:39 +08:00
width: 200
2019-04-16 13:35:25 +08:00
},
{
title: "凭证日期",
dataIndex: "voucherDate",
key: "voucherDate",
2019-04-19 17:04:39 +08:00
width: 300,
2019-04-16 13:35:25 +08:00
},
{
title: "审批状态",
dataIndex: "approvalState_name",
key: "approvalState_name",
width: 200
},
{
title: "确认状态",
dataIndex: "confirmState_name",
key: "confirmState_name",
width: 200
},
{
title: "关闭状态",
dataIndex: "closeState_name",
key: "closeState_name",
2019-04-19 17:04:39 +08:00
width: 100
2019-04-16 13:35:25 +08:00
}
2018-12-21 09:58:52 +08:00
];
2019-04-19 17:04:39 +08:00
const data = [
2019-04-16 13:35:25 +08:00
{
2019-04-19 17:04:39 +08:00
orderCode:"NU0391025",
supplierName: "xx供应商",
type_name: "1",
purchasing:'组织c',
purchasingGroup:"aa",
voucherDate:"2018年03月18日",
approvalState_name:"已审批",
confirmState_name:"执行中",
closeState_name:"未关闭",
key: "1"
2019-04-16 13:35:25 +08:00
},
{
2019-04-19 17:04:39 +08:00
orderCode:"NU0391026",
supplierName: "xx供应商",
type_name: "2",
purchasing:'组织a',
purchasingGroup:"bb",
voucherDate:"2018年02月05日",
approvalState_name:"已审批",
confirmState_name:"待确认",
closeState_name:"未关闭",
key: "2"
2019-04-16 13:35:25 +08:00
},
{
2019-04-19 17:04:39 +08:00
orderCode:"NU0391027",
supplierName: "xx供应商",
type_name: "3",
purchasing:'组织b',
purchasingGroup:"aa",
voucherDate:"2018年07月01日",
approvalState_name:"已审批",
confirmState_name:"终止",
closeState_name:"已关闭",
key: "3"
2019-04-16 13:35:25 +08:00
},
{
2019-04-19 17:04:39 +08:00
orderCode:"NU0391028",
supplierName: "xx供应商",
type_name: "4",
purchasing:'组织c',
purchasingGroup:"cc",
voucherDate:"2019年03月01日",
approvalState_name:"未审批",
confirmState_name:"待确认",
closeState_name:"未关闭",
key: "4"
2019-04-16 13:35:25 +08:00
},
2019-04-19 17:04:39 +08:00
{
orderCode:"NU0391029",
supplierName: "xx供应商",
type_name: "5",
purchasing:'组织d',
purchasingGroup:"ss",
voucherDate:"2019年02月14日",
approvalState_name:"未审批",
confirmState_name:"待确认",
closeState_name:"未关闭",
key: "5"
}
2018-12-21 09:58:52 +08:00
];
2019-04-16 13:35:25 +08:00
class Demo11 extends Component {
2019-03-20 17:44:05 +08:00
render() {
2019-04-16 13:35:25 +08:00
return (
2019-05-06 11:17:40 +08:00
<Table columns={columns} data={data} scroll={{ x: "110%" }} />
2019-04-16 13:35:25 +08:00
);
2018-12-21 09:58:52 +08:00
}
}
2019-04-16 13:35:25 +08:00
export default Demo11;