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 DateRangeSeletion from './DateRangeSeletion';
import moment from 'moment';
class GetDataSelection extends Component {
class GetDataSelection extends PureComponent {
state = {
device: null,
range: {
......@@ -16,6 +16,7 @@ class GetDataSelection extends Component {
};
handleClickGo = e => {
console.log(this.state)
this.props.onConfirm && this.props.onConfirm(this.state);
};
......@@ -23,10 +24,16 @@ class GetDataSelection extends Component {
this.setState({ range: selectedRange });
};
componentDidMount = () =>{
}
render() {
let { allDevicesId, allDeviceInfo } = this.props;
// console.log('allDevicesId', allDevicesId);
// console.log('allDeviceInfo', allDeviceInfo);
if (allDevicesId) {
this.setState({ device: allDevicesId[0]})
this.props.onConfirm && this.props.onConfirm(this.state);
}
return (
<Col>
......@@ -37,6 +44,8 @@ class GetDataSelection extends Component {
as="select"
defaultValue={this.state.device}
onChange={e => {
console.log("e.target.value")
console.log(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