Commit 997740c0 by Chaiwith Santaweesuk

update

parent 8739357d
import React, { Component } from 'react'; import React, { PureComponent } from 'react';
import { Col, Form, Button } from 'react-bootstrap'; import { Col, Form, Button } from 'react-bootstrap';
import DateRangeSeletion from './DateRangeSeletion'; import DateRangeSeletion from './DateRangeSeletion';
import moment from 'moment'; import moment from 'moment';
class GetDataSelection extends Component { class GetDataSelection extends PureComponent {
state = { state = {
device: null, device: null,
range: { range: {
...@@ -16,6 +16,7 @@ class GetDataSelection extends Component { ...@@ -16,6 +16,7 @@ class GetDataSelection extends Component {
}; };
handleClickGo = e => { handleClickGo = e => {
console.log(this.state)
this.props.onConfirm && this.props.onConfirm(this.state); this.props.onConfirm && this.props.onConfirm(this.state);
}; };
...@@ -23,10 +24,16 @@ class GetDataSelection extends Component { ...@@ -23,10 +24,16 @@ class GetDataSelection extends Component {
this.setState({ range: selectedRange }); this.setState({ range: selectedRange });
}; };
componentDidMount = () =>{
}
render() { render() {
let { allDevicesId, allDeviceInfo } = this.props; let { allDevicesId, allDeviceInfo } = this.props;
// console.log('allDevicesId', allDevicesId); if (allDevicesId) {
// console.log('allDeviceInfo', allDeviceInfo); this.setState({ device: allDevicesId[0]})
this.props.onConfirm && this.props.onConfirm(this.state);
}
return ( return (
<Col> <Col>
...@@ -37,6 +44,8 @@ class GetDataSelection extends Component { ...@@ -37,6 +44,8 @@ class GetDataSelection extends Component {
as="select" as="select"
defaultValue={this.state.device} defaultValue={this.state.device}
onChange={e => { onChange={e => {
console.log("e.target.value")
console.log(e.target.value)
this.setState({ device: e.target.value }); this.setState({ device: e.target.value });
}} }}
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment