From c1b443b9d21fa1f68c071dd2c51fe13885c48963 Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 31 Mar 2017 15:35:39 +0800 Subject: [PATCH] update --- .../AdminPage/SystemInfo/TimezoneForm.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/components/AdminPage/SystemInfo/TimezoneForm.js diff --git a/src/components/AdminPage/SystemInfo/TimezoneForm.js b/src/components/AdminPage/SystemInfo/TimezoneForm.js new file mode 100644 index 0000000..452d27e --- /dev/null +++ b/src/components/AdminPage/SystemInfo/TimezoneForm.js @@ -0,0 +1,45 @@ +import React from 'react'; +import {} from 'semantic-ui-react'; +import {getRequest} from '../../../actions'; + +class TimezoneForm extends React.Component { + state = { + zone: [], + zoneset: '' + } + + componentDidMount(){ + this.getZones(); + this.getZoneSet(); + } + + getZones = () => { + fetch('/api/system/gettimezonelist', getRequest()) + .then(response=>response.json()) + .then(json => { + if(json.status != 1) return this.props.showDialog(json.message); + this.setState({ + zone: json.data.record || [] + }) + }) + } + + getZoneSet = () => { + fetch('/api/system/gettimezoneset', getRequest()) + .then(response=>response.json()) + .then(json => { + if(json.status != 1) return this.props.showDialog(json.message); + this.setState({ + zoneset: json.data.record[0].value || '' + }) + }) + } + + render(){ + return ( + null + ) + } +} + +export default TimezoneForm; \ No newline at end of file