|
@@ -1,6 +1,7 @@
|
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
-import { Row, Col, Button, Table } from 'react-bootstrap'
|
|
|
|
|
|
|
+import { Row, Col } from 'react-bootstrap'
|
|
|
import { Box } from '@mui/material';
|
|
import { Box } from '@mui/material';
|
|
|
|
|
+import toast, { Toaster } from 'react-hot-toast';
|
|
|
|
|
|
|
|
import ToggleButton from '@mui/material/ToggleButton';
|
|
import ToggleButton from '@mui/material/ToggleButton';
|
|
|
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
@@ -21,7 +22,8 @@ import Editar from '../Components/Modal/EditPlaza';
|
|
|
import Eliminar from '../Components/Modal/EliminarPlaza';
|
|
import Eliminar from '../Components/Modal/EliminarPlaza';
|
|
|
import Mostrar from '../Components/Modal/MostrarPlaza';
|
|
import Mostrar from '../Components/Modal/MostrarPlaza';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { ListMode } from '../Components/Puestos/ListMode'
|
|
|
|
|
+
|
|
|
let data = [{
|
|
let data = [{
|
|
|
nombre : 'The standard Lorem Ipsum passage, used since the 1500s',
|
|
nombre : 'The standard Lorem Ipsum passage, used since the 1500s',
|
|
|
description : '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."',
|
|
description : '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."',
|
|
@@ -35,83 +37,14 @@ function* idMaker() {
|
|
|
yield index++;
|
|
yield index++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const Success = () => toast.success('Plaza Agregada!!')
|
|
|
|
|
+
|
|
|
var ID = idMaker();
|
|
var ID = idMaker();
|
|
|
|
|
|
|
|
for ( var _ of new Array(46) ){
|
|
for ( var _ of new Array(46) ){
|
|
|
data.push({ ...data[0], id : ID.next().value, d : _ })
|
|
data.push({ ...data[0], id : ID.next().value, d : _ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function ListMode(props) {
|
|
|
|
|
-
|
|
|
|
|
- let { setEdit, setDelete, setShow, setPuesto } = props;
|
|
|
|
|
-
|
|
|
|
|
- return(
|
|
|
|
|
- <Col md="12">
|
|
|
|
|
- <div className="body-table">
|
|
|
|
|
- <Table responsive borderless id="tablaproductos">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr >
|
|
|
|
|
- <th className="text-center">Nombre de la plaza</th>
|
|
|
|
|
- <th className="text-center">Descripción</th>
|
|
|
|
|
- <th className="text-center">Salario</th>
|
|
|
|
|
- <th className="text-center">Acciones</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- data.length ?
|
|
|
|
|
- data.slice( 0,23 ).map( (plaza, i) => {
|
|
|
|
|
- return (
|
|
|
|
|
- <tr key={plaza.id}>
|
|
|
|
|
- <td className="text-center">{ plaza.id + " - " + plaza.nombre }</td>
|
|
|
|
|
- <td className="text-center">{ plaza.description }</td>
|
|
|
|
|
- <td className="text-center">{ plaza.salario }</td>
|
|
|
|
|
- <td className="actions_butons_plaza">
|
|
|
|
|
- <Button
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setPuesto(plaza)
|
|
|
|
|
- setShow(true)
|
|
|
|
|
- }}
|
|
|
|
|
- className="ver_producto">Ver
|
|
|
|
|
- </Button>
|
|
|
|
|
-
|
|
|
|
|
- <Button
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setPuesto(plaza)
|
|
|
|
|
- setEdit(true)
|
|
|
|
|
- }}
|
|
|
|
|
- className="editar_producto">Editar
|
|
|
|
|
- </Button>
|
|
|
|
|
- <Button
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setPuesto(plaza)
|
|
|
|
|
- setDelete(true)
|
|
|
|
|
- }}
|
|
|
|
|
- className="eliminar_producto">Eliminar
|
|
|
|
|
- </Button>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- )
|
|
|
|
|
- }) : undefined
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- </tbody>
|
|
|
|
|
- <tfoot>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th>Nombre de la plaza</th>
|
|
|
|
|
- <th>Descripción</th>
|
|
|
|
|
- <th>Salario</th>
|
|
|
|
|
- <th>Acciones</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </tfoot>
|
|
|
|
|
- </Table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- )
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
function GridMode (props) {
|
|
function GridMode (props) {
|
|
|
|
|
|
|
|
let { setEdit, setDelete, setShow, setPuesto } = props;
|
|
let { setEdit, setDelete, setShow, setPuesto } = props;
|
|
@@ -253,6 +186,7 @@ export function Puestos() {
|
|
|
<div className={`main_list_products ${alignment === 'list' ? 'activar_vista' : 'desactivar_vista'}`} id="list_view_products">
|
|
<div className={`main_list_products ${alignment === 'list' ? 'activar_vista' : 'desactivar_vista'}`} id="list_view_products">
|
|
|
<Row>
|
|
<Row>
|
|
|
<ListMode
|
|
<ListMode
|
|
|
|
|
+ data={data}
|
|
|
setPuesto={setPuesto}
|
|
setPuesto={setPuesto}
|
|
|
setEdit={setEdit}
|
|
setEdit={setEdit}
|
|
|
setDelete={setDelete}
|
|
setDelete={setDelete}
|
|
@@ -262,12 +196,16 @@ export function Puestos() {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <Express setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
|
|
|
|
|
- <Manual setManual={setManual} visible={manual} onClose={() => setManual(false) } />
|
|
|
|
|
|
|
+ <Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
|
|
|
|
|
+ <Manual success={Success} setManual={setManual} visible={manual} onClose={() => setManual(false) } />
|
|
|
|
|
|
|
|
<Editar puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
|
|
<Editar puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
|
|
|
<Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
|
|
<Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
|
|
|
<Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
|
|
<Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
|
|
|
|
|
+ <Toaster
|
|
|
|
|
+ position="bottom-right"
|
|
|
|
|
+ reverseOrder={false}
|
|
|
|
|
+ />
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|