webio-node/src/components/AdminPage/Wristband/Location/index.js

50 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-04-06 09:31:36 +00:00
import React from 'react';
import {Container, Segment, Button} from 'semantic-ui-react';
import {getRequest} from '../../../../actions';
const stateDefault = ()=>({
list: [],
modal: {
open: false,
type: 0,
data: {}
}
})
class Location extends React.Component {
state = {
...stateDefault()
}
componentDidMount() {
this.getList();
}
getList = () => {
let {showDialog, toggleLoading} = this.props;
toggleLoading(1);
fetch('/api/wristband/getlocationlist', getRequest())
.then(response=>response.json())
.then(json => {
toggleLoading(0);
if(json.status != 1) return showDialog(json.message);
this.setState({
list: json.data.record || []
})
})
}
render() {
return (
<Container fluid>
<Segment className="clearfix">
<Button floated="right" basic color="green" style={{marginBottom: '15px'}} content="新增" icon="plus" />
</Segment>
</Container>
)
}
}
export default Location;