50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
|
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;
|