Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*
* @title 嵌套表格的模态框
* @description 嵌套表格
*
*/
import React, { Component } from 'react';
import Button from 'bee-button';
import Checkbox from 'bee-checkbox'
import Table from 'bee-table'
import multiSelect from "bee-table/build/lib/multiSelect";
import Modal from '../../src';
let MultiSelectTable = multiSelect(Table, Checkbox);
class Demo10 extends Component {
constructor(props) {
super(props);
this.state = {
showModal: false,
data: [
{ a: "杨过", b: "男", c: 30, d: '内行', key: "2", _checked: true },
{ a: "令狐冲", b: "男", c: 41, d: '大侠', key: "1", _checked: true },
{ a: "郭靖", b: "男", c: 25, d: '大侠', key: "3", _checked: true }
]
};
}
//后端回调方法,用户的sortFun和Grid的有时有冲突,所以重新定义了一个sort,传给Table
if (sortObj) {
sortObj.originSortFun = sortObj.originSortFun
? sortObj.originSortFun
: sortObj.sortFun;
sortObj.sortFun = this.sortFun;
this.sort = sortObj;
}
if (props.canSum) {
ComplexTable = sum(ComplexTable);
}
//根据条件生成Grid
ComplexTable = sort(Table, Icon);
if (props.multiSelect !== false) {
ComplexTable = multiSelect(ComplexTable, Checkbox);
}
if(props.loadLazy){
ComplexTable = bigData(ComplexTable);
}
if (props.draggable) {
ComplexTable = dragColumn(ComplexTable);
}
ComplexTable = filterColumn(ComplexTable, Popover);
this.ComplexTable = ComplexTable;
}