|
@@ -1,20 +1,26 @@
|
1
|
|
-import React from 'react';
|
|
1
|
+import React, { useState } from 'react';
|
2
|
2
|
import { Row, Col } from 'react-bootstrap'
|
3
|
|
-import { Box } from '@mui/material';
|
4
|
3
|
import toast, { Toaster } from 'react-hot-toast';
|
5
|
4
|
|
6
|
|
-import ToggleButton from '@mui/material/ToggleButton';
|
7
|
|
-import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
5
|
+import {
|
|
6
|
+ ToggleButton,
|
|
7
|
+ ToggleButtonGroup,
|
|
8
|
+ Box, Paper
|
|
9
|
+} from '@mui/material';
|
8
|
10
|
|
9
|
|
-import ViewListIcon from '@mui/icons-material/ViewList';
|
10
|
|
-import ViewModuleIcon from '@mui/icons-material/ViewModule';
|
|
11
|
+import {
|
|
12
|
+ ViewList as ViewListIcon,
|
|
13
|
+ ViewModule as ViewModuleIcon,
|
|
14
|
+ RemoveRedEye as RemoveRedEyeIcon,
|
|
15
|
+ Edit as EditIcon,
|
|
16
|
+ HighlightOff as HighlightOffIcon,
|
|
17
|
+} from '@mui/icons-material';
|
11
|
18
|
|
12
|
|
-import RemoveRedEyeIcon from '@mui/icons-material/RemoveRedEye';
|
13
|
|
-import EditIcon from '@mui/icons-material/Edit';
|
14
|
|
-import HighlightOffIcon from '@mui/icons-material/HighlightOff';
|
|
19
|
+import { default as useAuth } from '../Auth/useAuth';
|
|
20
|
+import { Service } from '../Utils/HTTP';
|
15
|
21
|
|
16
|
|
-import NotFound from '../Images/not_found.png';
|
17
|
22
|
|
|
23
|
+import NotFound from '../Images/not_found.png';
|
18
|
24
|
import Express from '../Components/Modal/AgregarExpress';
|
19
|
25
|
import Manual from '../Components/Modal/AgregarManual';
|
20
|
26
|
|
|
@@ -51,6 +57,7 @@ function GridMode (props) {
|
51
|
57
|
|
52
|
58
|
return(
|
53
|
59
|
<React.Fragment>
|
|
60
|
+
|
54
|
61
|
{
|
55
|
62
|
data.length ?
|
56
|
63
|
data.slice(23).map( plaza => {
|
|
@@ -118,10 +125,25 @@ function GridMode (props) {
|
118
|
125
|
}
|
119
|
126
|
|
120
|
127
|
export function Puestos() {
|
|
128
|
+ const auth = useAuth();
|
|
129
|
+
|
|
130
|
+ useState(() => {
|
|
131
|
+ let rest = new Service("/plaza/getall")
|
|
132
|
+ let token = auth.getToken();
|
|
133
|
+
|
|
134
|
+ rest
|
|
135
|
+ .get(token)
|
|
136
|
+ .then(({data}) => {
|
|
137
|
+ console.log('data > ', data)
|
|
138
|
+ })
|
|
139
|
+ .catch((error) => {
|
|
140
|
+ console.log('error fetching data ', error );
|
|
141
|
+ })
|
|
142
|
+ },[])
|
121
|
143
|
|
122
|
144
|
const [alignment, setAlignment] = React.useState('list');
|
123
|
145
|
|
124
|
|
- const handleChange = (event, newAlignment) => setAlignment(newAlignment);
|
|
146
|
+ const handleChange = (_event, newAlignment) => setAlignment(newAlignment);
|
125
|
147
|
|
126
|
148
|
const children = [
|
127
|
149
|
<ToggleButton value="list" key="list">
|
|
@@ -149,10 +171,9 @@ export function Puestos() {
|
149
|
171
|
|
150
|
172
|
return (
|
151
|
173
|
<div className="content-section">
|
152
|
|
-
|
153
|
174
|
<div className="main">
|
154
|
|
-
|
155
|
|
- <h1>Puestos</h1>
|
|
175
|
+ <Box sx={{ width: '100%' }}>
|
|
176
|
+ <Paper sx={{ width: '100%', mb: 2, padding : 2 }}>
|
156
|
177
|
|
157
|
178
|
<Row>
|
158
|
179
|
<Col md="2" sm="2" xs="2">
|
|
@@ -194,6 +215,10 @@ export function Puestos() {
|
194
|
215
|
/>
|
195
|
216
|
</Row>
|
196
|
217
|
</div>
|
|
218
|
+
|
|
219
|
+ </Paper>
|
|
220
|
+ </Box>
|
|
221
|
+
|
197
|
222
|
</div>
|
198
|
223
|
|
199
|
224
|
<Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
|
|
@@ -202,10 +227,7 @@ export function Puestos() {
|
202
|
227
|
<Editar puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
|
203
|
228
|
<Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
|
204
|
229
|
<Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
|
205
|
|
- <Toaster
|
206
|
|
- position="bottom-right"
|
207
|
|
- reverseOrder={false}
|
208
|
|
- />
|
|
230
|
+ <Toaster position="bottom-right" reverseOrder={false} />
|
209
|
231
|
|
210
|
232
|
</div>
|
211
|
233
|
)
|