UNPKG

ac-grids

Version:
154 lines (149 loc) 3.12 kB
/** * @title 基础示例 * @description 全选、分页、过滤功能、交换 * */ import React, { Component } from "react"; import AcGrids from '../../src' const column = [ { title: "订单编号", dataIndex: "orderCode", key: "orderCode", width: 150, }, { title: "金额", dataIndex: "money", key: "money", width: 160, textAlign:'right' }, { title: "类型", dataIndex: "type_name", key: "type_name", width: 100 }, { title: "采购组织", dataIndex: "purchasing", key: "purchasing", width: 150 }, { title: "采购组", dataIndex: "purchasingGroup", key: "purchasingGroup", width: 300 }, { title: "凭证日期", dataIndex: "voucherDate", key: "voucherDate", width: 150 }, { title: "审批状态", dataIndex: "approvalState_name", key: "approvalState_name", width: 150 }, { title: "确认状态", dataIndex: "confirmState_name", key: "confirmState_name", width: 500 }, { title: "关闭状态", dataIndex: "closeState_name", key: "closeState_name", width: 150 } ]; const dataList = [ { orderCode: "2343", supplierName: "xxx", type_name: "123", purchasing: "内行", purchasingGroup: "323", voucherDate: "kkkk", approvalState_name: "vvvv", confirmState_name: "aaaa", closeState_name: "vnnnnn", money:'1232.56', d: "操作", key: "1" }, { _checked: true, orderCode: "222", supplierName: "22xxx", type_name: "1223", purchasing: "内行2", purchasingGroup: "3223", voucherDate: "222kk", approvalState_name: "22vvvv", confirmState_name: "2aaaa", closeState_name: "2vnnnnn", money:'2341232.56', d: "2操作", key: "2" }, { orderCode: "222", supplierName: "22xxx", _disabled: true, type_name: "1223", purchasing: "内行2", purchasingGroup: "3223", voucherDate: "222kk", approvalState_name: "22vvvv", confirmState_name: "2aaaa", closeState_name: "2vnnnnn", money:'122368732.56', d: "3操作", key: "3" }, { orderCode: "222", supplierName: "22xxx", type_name: "1223", purchasing: "内行2", purchasingGroup: "3223", voucherDate: "222kk", approvalState_name: "22vvvv", confirmState_name: "2aaaa", closeState_name: "2vnnnnn", money:'18765232.56', d: "4操作", key: "4" } ]; class Demo1 extends Component { constructor(props) { super(props); } render() { let paginationObj = { maxButtons:999, items:15,//一页显示多少条 activePage:2, onSelect:(value)=>{console.log('切换到第几页:'+value)}, onDataNumSelect:(value)=>{console.log("每页多少条:"+value)},//改变页码回调 } return ( <AcGrids columns={column} data={dataList} getSelectedDataFunc={this.getSelectedDataFunc} paginationObj={paginationObj} multiSelect={false} ref='grid' /> ); } } export default Demo1;