update
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user