|
|
@@ -1,20 +1,26 @@
|
|
|
-import React from 'react';
|
|
|
+import React, { useState } from 'react';
|
|
|
import { Row, Col } from 'react-bootstrap'
|
|
|
-import { Box } from '@mui/material';
|
|
|
import toast, { Toaster } from 'react-hot-toast';
|
|
|
|
|
|
-import ToggleButton from '@mui/material/ToggleButton';
|
|
|
-import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
|
+import {
|
|
|
+ ToggleButton,
|
|
|
+ ToggleButtonGroup,
|
|
|
+ Box, Paper
|
|
|
+} from '@mui/material';
|
|
|
|
|
|
-import ViewListIcon from '@mui/icons-material/ViewList';
|
|
|
-import ViewModuleIcon from '@mui/icons-material/ViewModule';
|
|
|
+import {
|
|
|
+ ViewList as ViewListIcon,
|
|
|
+ ViewModule as ViewModuleIcon,
|
|
|
+ RemoveRedEye as RemoveRedEyeIcon,
|
|
|
+ Edit as EditIcon,
|
|
|
+ HighlightOff as HighlightOffIcon,
|
|
|
+} from '@mui/icons-material';
|
|
|
|
|
|
-import RemoveRedEyeIcon from '@mui/icons-material/RemoveRedEye';
|
|
|
-import EditIcon from '@mui/icons-material/Edit';
|
|
|
-import HighlightOffIcon from '@mui/icons-material/HighlightOff';
|
|
|
+import { default as useAuth } from '../Auth/useAuth';
|
|
|
+import { Service } from '../Utils/HTTP';
|
|
|
|
|
|
-import NotFound from '../Images/not_found.png';
|
|
|
|
|
|
+import NotFound from '../Images/not_found.png';
|
|
|
import Express from '../Components/Modal/AgregarExpress';
|
|
|
import Manual from '../Components/Modal/AgregarManual';
|
|
|
|
|
|
@@ -51,6 +57,7 @@ function GridMode (props) {
|
|
|
|
|
|
return(
|
|
|
<React.Fragment>
|
|
|
+
|
|
|
{
|
|
|
data.length ?
|
|
|
data.slice(23).map( plaza => {
|
|
|
@@ -118,10 +125,25 @@ function GridMode (props) {
|
|
|
}
|
|
|
|
|
|
export function Puestos() {
|
|
|
+ const auth = useAuth();
|
|
|
+
|
|
|
+ useState(() => {
|
|
|
+ let rest = new Service("/plaza/getall")
|
|
|
+ let token = auth.getToken();
|
|
|
+
|
|
|
+ rest
|
|
|
+ .get(token)
|
|
|
+ .then(({data}) => {
|
|
|
+ console.log('data > ', data)
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log('error fetching data ', error );
|
|
|
+ })
|
|
|
+ },[])
|
|
|
|
|
|
const [alignment, setAlignment] = React.useState('list');
|
|
|
|
|
|
- const handleChange = (event, newAlignment) => setAlignment(newAlignment);
|
|
|
+ const handleChange = (_event, newAlignment) => setAlignment(newAlignment);
|
|
|
|
|
|
const children = [
|
|
|
<ToggleButton value="list" key="list">
|
|
|
@@ -149,10 +171,9 @@ export function Puestos() {
|
|
|
|
|
|
return (
|
|
|
<div className="content-section">
|
|
|
-
|
|
|
<div className="main">
|
|
|
-
|
|
|
- <h1>Puestos</h1>
|
|
|
+ <Box sx={{ width: '100%' }}>
|
|
|
+ <Paper sx={{ width: '100%', mb: 2, padding : 2 }}>
|
|
|
|
|
|
<Row>
|
|
|
<Col md="2" sm="2" xs="2">
|
|
|
@@ -194,6 +215,10 @@ export function Puestos() {
|
|
|
/>
|
|
|
</Row>
|
|
|
</div>
|
|
|
+
|
|
|
+ </Paper>
|
|
|
+ </Box>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
|
|
|
@@ -202,10 +227,7 @@ export function Puestos() {
|
|
|
<Editar puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
|
|
|
<Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
|
|
|
<Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
|
|
|
- <Toaster
|
|
|
- position="bottom-right"
|
|
|
- reverseOrder={false}
|
|
|
- />
|
|
|
+ <Toaster position="bottom-right" reverseOrder={false} />
|
|
|
|
|
|
</div>
|
|
|
)
|