添加表格日期操作
This commit is contained in:
parent
269e6f19de
commit
a79ebbd41c
|
@ -10,6 +10,9 @@
|
||||||
@import "../node_modules/bee-checkbox/src/Checkbox.scss";
|
@import "../node_modules/bee-checkbox/src/Checkbox.scss";
|
||||||
@import "../node_modules/bee-select/src/Select.scss";
|
@import "../node_modules/bee-select/src/Select.scss";
|
||||||
|
|
||||||
|
//引入日期控件样式文件
|
||||||
|
@import "../node_modules/bee-datepicker/src/datepicker.scss";
|
||||||
|
|
||||||
.editable-cell {
|
.editable-cell {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,15 @@ import Select from 'bee-select';
|
||||||
import Popconfirm from "bee-popconfirm";
|
import Popconfirm from "bee-popconfirm";
|
||||||
import InputRender from "../../src/render/InputRender.js";
|
import InputRender from "../../src/render/InputRender.js";
|
||||||
|
|
||||||
|
//日期控件引入
|
||||||
|
import DatePicker from 'bee-datepicker';
|
||||||
|
import zhCN from 'rc-calendar/lib/locale/zh_CN';
|
||||||
|
import enUS from 'rc-calendar/lib/locale/en_US';
|
||||||
|
|
||||||
|
const format = 'YYYY-MM-DD';
|
||||||
|
|
||||||
|
const dateInputPlaceholder = '选择日期';
|
||||||
|
|
||||||
class Demo15 extends React.Component {
|
class Demo15 extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -94,6 +103,23 @@ class Demo15 extends React.Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '日期', dataIndex: 'datepicker', key: 'datepicker', width: 200,
|
||||||
|
render:()=>{
|
||||||
|
return(
|
||||||
|
<DatePicker
|
||||||
|
format={format}
|
||||||
|
|
||||||
|
onSelect={this.onSelect}
|
||||||
|
|
||||||
|
onChange={this.onChange}
|
||||||
|
|
||||||
|
locale={zhCN}
|
||||||
|
|
||||||
|
placeholder = {dateInputPlaceholder}>
|
||||||
|
</DatePicker>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
dataIndex: "operation",
|
dataIndex: "operation",
|
||||||
|
@ -157,6 +183,15 @@ class Demo15 extends React.Component {
|
||||||
</Animate>
|
</Animate>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onSelect = (d) =>{
|
||||||
|
console.log(d)
|
||||||
|
};
|
||||||
|
|
||||||
|
onChange = (d) => {
|
||||||
|
console.log(d)
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { dataSource } = this.state;
|
const { dataSource } = this.state;
|
||||||
const columns = this.columns;
|
const columns = this.columns;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue