This commit is contained in:
Jay
2017-03-31 18:10:37 +08:00
parent e529794956
commit 7cfdf4f2af
2 changed files with 34 additions and 13 deletions
@@ -1,11 +1,12 @@
import React from 'react';
import {} from 'semantic-ui-react';
import {Form, Input, Button} from 'semantic-ui-react';
import {getRequest} from '../../../actions';
class TimezoneForm extends React.Component {
state = {
zone: [],
zoneset: ''
zones: [],
zone: '',
loc: ''
}
componentDidMount(){
@@ -19,7 +20,7 @@ class TimezoneForm extends React.Component {
.then(json => {
if(json.status != 1) return this.props.showDialog(json.message);
this.setState({
zone: json.data.record || []
zones: json.data.record || []
})
})
}
@@ -29,15 +30,23 @@ class TimezoneForm extends React.Component {
.then(response=>response.json())
.then(json => {
if(json.status != 1) return this.props.showDialog(json.message);
let tz = (json.data.record[0].value || '').split('/');
this.setState({
zoneset: json.data.record[0].value || ''
})
zone: tz[0] || '',
loc: tz[1] || ''
});
})
}
render(){
return (
null
<Form>
<Form.Field>
<Input label="系統Timezone"
value={`${this.state.zone}${this.state.zone.length > 0 ? '/' : ''}${this.state.loc}`} />
</Form.Field>
</Form>
)
}
}