浏览代码

pre puesto stepper

amenpunk 2 年之前
父节点
当前提交
81591d035f
共有 6 个文件被更改,包括 148 次插入135 次删除
  1. 7 1
      src/App.css
  2. 3 3
      src/Components/Puestos/ListMode.jsx
  3. 7 7
      src/Css/all.css
  4. 103 99
      src/Pages/Contras.jsx
  5. 4 4
      src/Pages/ContrasV2.jsx
  6. 24 21
      src/Pages/Puestos.jsx

+ 7 - 1
src/App.css

@@ -246,4 +246,10 @@
246 246
     place-content:center;
247 247
 }
248 248
 
249
-
249
+#pagi_bottom{
250
+    width:100%;
251
+    display:flex;
252
+    flex-direction:row;
253
+    align-items:baseline;
254
+    justify-content:space-between;
255
+}

+ 3 - 3
src/Components/Puestos/ListMode.jsx

@@ -20,7 +20,7 @@ export function ListMode(props) {
20 20
                         <tr >
21 21
                             <th className="text-center">Nombre</th>
22 22
                             <th className="text-center">Descripción</th>
23
-                            <th className="text-center">Creacion</th>
23
+                            <th className="text-center">Creación</th>
24 24
                             <th className="text-center">Acción</th>
25 25
                         </tr>
26 26
                     </thead>
@@ -32,13 +32,13 @@ export function ListMode(props) {
32 32
                                     <Zoom key={plaza.id} in={true}>
33 33
                                         <tr >
34 34
                                             <td className="text-center">{ plaza.nombrepuesto }</td>
35
-                                            <td className="text-center">{ plaza.notas }</td>
35
+                                            <td className="text-center">{plaza.notas.length > 50 ? plaza.notas.slice(0,50) + "...." : plaza.notas }</td>
36 36
                                             <td className="text-center">{ new Date( plaza.createday ).toLocaleDateString('es-GT',opciones) }</td>
37 37
                                             <TableCell
38 38
                                                 sx={{
39 39
                                                     "display":'flex',
40 40
                                                     "flexDirection":'row',
41
-                                                    "justifyContent": "space-between",
41
+                                                    "justifyContent": "space-between !important",
42 42
                                                     "flexWrap": !isMovil ? "wrap": "nowrap",
43 43
                                                 }} 
44 44
                                                 className="actions_butons_plaza"> 

+ 7 - 7
src/Css/all.css

@@ -1306,11 +1306,11 @@ button.restore_btn:hover {
1306 1306
     transition: all 0.3s;
1307 1307
 }
1308 1308
 .ver_producto {
1309
-    background: #2ec5d3;
1309
+    background: var(--second);
1310 1310
     border: 1px solid transparent;
1311 1311
     color: #fff;
1312
-    padding: 3px 7px;
1313
-    border-radius: 20px;
1312
+    padding: 4px 13px;
1313
+    border-radius: 10px;
1314 1314
     transition: all 0.3s;
1315 1315
 }
1316 1316
 .ver_producto:hover {
@@ -1323,8 +1323,8 @@ button.restore_btn:hover {
1323 1323
     background: #5893df!important;
1324 1324
     border: 1px solid transparent;
1325 1325
     color: #fff;
1326
-    padding: 3px 7px;
1327
-    border-radius: 20px;
1326
+    padding: 4px 13px;
1327
+    border-radius: 10px;
1328 1328
     transition: all 0.3s;
1329 1329
 }
1330 1330
 .editar_producto:hover {
@@ -1337,8 +1337,8 @@ button.restore_btn:hover {
1337 1337
     background: #ec5e69!important;
1338 1338
     border: 1px solid transparent;
1339 1339
     color: #fff;
1340
-    padding: 3px 7px;
1341
-    border-radius: 20px;
1340
+    padding: 4px 13px;
1341
+    border-radius: 10px;
1342 1342
     transition: all 0.3s;
1343 1343
 }
1344 1344
 .eliminar_producto:hover {

+ 103 - 99
src/Pages/Contras.jsx

@@ -1,14 +1,14 @@
1 1
 import * as React from 'react';
2 2
 
3
-import { 
3
+import {
4 4
     rows,
5 5
     action_icon,
6 6
     Comparar,
7 7
     Cuerpo,
8 8
 } from '../Components/Password/config.js';
9 9
 
10
-import { 
11
-    Table, TableBody, TableCell, TableContainer, 
10
+import {
11
+    Table, TableBody, TableCell, TableContainer,
12 12
     TableRow, TablePagination,
13 13
     Paper, Box, Switch, FormControlLabel,
14 14
     Checkbox,
@@ -36,7 +36,7 @@ export function Contras() {
36 36
 
37 37
     const SeleccionarTodos = (event) => {
38 38
         if (event.target.checked) {
39
-            const newSelecteds = rows.map( (n) => n.pass);
39
+            const newSelecteds = rows.map((n) => n.pass);
40 40
             setSelected(newSelecteds);
41 41
             return;
42 42
         }
@@ -84,110 +84,114 @@ export function Contras() {
84 84
     return (
85 85
         <div className="content-section">
86 86
             <div className="main">
87
-                <Box sx={{ width: '100%' }}>
88
-                    <Paper sx={{ width: '100%', mb: 2 }}>
89
-
90
-                        <TableOperation numSelected={selected.length} />
91
-
92
-                        <TableContainer>
93
-
94
-                            <Table
95
-                                sx={{ minWidth: 750 }}
96
-                                aria-labelledby=""
97
-                                size={dense ? 'small' : 'medium'} >
98
-
99
-                                <TableHead
100
-                                    numSelected={selected.length}
101
-                                    order={order}
102
-                                    orderBy={orderBy}
103
-                                    onSelectAllClick={SeleccionarTodos}
104
-                                    onRequestSort={CambiarTipoOrden}
105
-                                    rowCount={rows.length} />
106
-
107
-
108
-                                <TableBody>
109
-                                    {Cuerpo(rows, Comparar(order, orderBy))
110
-                                    .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
111
-                                    .map( (row, index) => {
112
-
113
-                                        const isItemSelected = isSelected(row.pass);
114
-                                        const labelId = `enhanced-table-checkbox-${index}`;
115
-
116
-                                        return (
87
+                <Paper sx={{ mb: 2, padding: 2, height: '100%', minHeight: '95vh', background: 'blue' }}>
88
+
89
+                    <Box sx={{ width: '100%' }}>
90
+                        <Paper sx={{ width: '100%', mb: 2 }}>
91
+
92
+                            <TableOperation numSelected={selected.length} />
93
+
94
+                            <TableContainer>
95
+
96
+                                <Table
97
+                                    sx={{ minWidth: 750 }}
98
+                                    aria-labelledby=""
99
+                                    size={dense ? 'small' : 'medium'} >
100
+
101
+                                    <TableHead
102
+                                        numSelected={selected.length}
103
+                                        order={order}
104
+                                        orderBy={orderBy}
105
+                                        onSelectAllClick={SeleccionarTodos}
106
+                                        onRequestSort={CambiarTipoOrden}
107
+                                        rowCount={rows.length} />
108
+
109
+
110
+                                    <TableBody>
111
+                                        {Cuerpo(rows, Comparar(order, orderBy))
112
+                                            .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
113
+                                            .map((row, index) => {
114
+
115
+                                                const isItemSelected = isSelected(row.pass);
116
+                                                const labelId = `enhanced-table-checkbox-${index}`;
117
+
118
+                                                return (
119
+                                                    <TableRow
120
+                                                        hover
121
+                                                        onClick={(event) => Seleccionar(event, row.pass)}
122
+                                                        // onClick={(event) => console.log(event)}
123
+                                                        role="checkbox"
124
+                                                        aria-checked={isItemSelected}
125
+                                                        tabIndex={-1}
126
+                                                        key={row.pass}
127
+                                                        selected={isItemSelected}
128
+                                                    >
129
+                                                        <TableCell padding="checkbox">
130
+                                                            <Checkbox
131
+                                                                color="primary"
132
+                                                                checked={isItemSelected}
133
+                                                                inputProps={{
134
+                                                                    'aria-labelledby': labelId,
135
+                                                                }}
136
+                                                            />
137
+                                                        </TableCell>
138
+                                                        <TableCell
139
+                                                            component="th"
140
+                                                            id={labelId}
141
+                                                            scope="row"
142
+                                                            padding="none"
143
+                                                        >
144
+                                                            {row.pass}
145
+                                                        </TableCell>
146
+                                                        <TableCell align="right">{row.nivel}</TableCell>
147
+                                                        <TableCell align="right">{row.puesto}</TableCell>
148
+                                                        <TableCell align="right">{row.cui}</TableCell>
149
+                                                        <TableCell align="right">{row.uso}</TableCell>
150
+                                                        <TableCell align="right">{row.picture}</TableCell>
151
+                                                        <TableCell align="right">{row.cv}</TableCell>
152
+                                                        <TableCell align="right">{row.estado}</TableCell>
153
+                                                        <TableCell align="center">
154
+                                                            <EditSharp style={action_icon} />
155
+                                                            <MailSharp style={action_icon} />
156
+                                                        </TableCell>
157
+                                                    </TableRow>
158
+                                                );
159
+                                            })}
160
+                                        {emptyRows > 0 && (
117 161
                                             <TableRow
118
-                                                hover
119
-                                                onClick={(event) => Seleccionar(event, row.pass)}
120
-                                                // onClick={(event) => console.log(event)}
121
-                                                role="checkbox"
122
-                                                aria-checked={isItemSelected}
123
-                                                tabIndex={-1}
124
-                                                key={row.pass}
125
-                                                selected={isItemSelected}
162
+                                                style={{
163
+                                                    height: (dense ? 33 : 53) * emptyRows,
164
+                                                }}
126 165
                                             >
127
-                                                <TableCell padding="checkbox">
128
-                                                    <Checkbox
129
-                                                        color="primary"
130
-                                                        checked={isItemSelected}
131
-                                                        inputProps={{
132
-                                                            'aria-labelledby': labelId,
133
-                                                        }}
134
-                                                        />
135
-                                                </TableCell>
136
-                                                <TableCell
137
-                                                    component="th"
138
-                                                    id={labelId}
139
-                                                    scope="row"
140
-                                                    padding="none"
141
-                                                >
142
-                                                    {row.pass}
143
-                                                </TableCell>
144
-                                                <TableCell align="right">{row.nivel}</TableCell>
145
-                                                <TableCell align="right">{row.puesto}</TableCell>
146
-                                                <TableCell align="right">{row.cui}</TableCell>
147
-                                                <TableCell align="right">{row.uso}</TableCell>
148
-                                                <TableCell align="right">{row.picture}</TableCell>
149
-                                                <TableCell align="right">{row.cv}</TableCell>
150
-                                                <TableCell align="right">{row.estado}</TableCell>
151
-                                                <TableCell align="center">
152
-                                                    <EditSharp style={action_icon} />
153
-                                                    <MailSharp style={action_icon}/>
154
-                                                </TableCell>
166
+                                                <TableCell colSpan={6} />
155 167
                                             </TableRow>
156
-                                        );
157
-                                    })}
158
-                                    {emptyRows > 0 && (
159
-                                        <TableRow
160
-                                            style={{
161
-                                                height: (dense ? 33 : 53) * emptyRows,
162
-                                            }}
163
-                                        >
164
-                                            <TableCell colSpan={6} />
165
-                                        </TableRow>
166
-                                    )}
167
-                                </TableBody>
168
-                            </Table>
169
-                        </TableContainer>
170
-
171
-                        <TablePagination
172
-                            rowsPerPageOptions={[5, 10, 25]}
173
-                            component="div"
174
-                            count={rows.length}
175
-                            rowsPerPage={rowsPerPage}
176
-                            page={page}
177
-                            onPageChange={handleChangePage}
178
-                            onRowsPerPageChange={handleChangeRowsPerPage}
179
-                            labelRowsPerPage={"Mostrar: "}
168
+                                        )}
169
+                                    </TableBody>
170
+                                </Table>
171
+                            </TableContainer>
172
+
173
+                            <TablePagination
174
+                                rowsPerPageOptions={[5, 10, 25]}
175
+                                component="div"
176
+                                count={rows.length}
177
+                                rowsPerPage={rowsPerPage}
178
+                                page={page}
179
+                                onPageChange={handleChangePage}
180
+                                onRowsPerPageChange={handleChangeRowsPerPage}
181
+                                labelRowsPerPage={"Mostrar: "}
180 182
                             />
181 183
 
182 184
 
183
-                    </Paper>
185
+                        </Paper>
184 186
 
185
-                    <FormControlLabel
186
-                        control={<Switch checked={dense} onChange={handleChangeDense} />}
187
-                        label="Comprimir"
187
+                        <FormControlLabel
188
+                            control={<Switch checked={dense} onChange={handleChangeDense} />}
189
+                            label="Comprimir"
188 190
                         />
189 191
 
190
-                </Box>
192
+                    </Box>
193
+
194
+                </Paper>
191 195
             </div>
192 196
         </div>
193 197
     );

+ 4 - 4
src/Pages/ContrasV2.jsx

@@ -1,8 +1,8 @@
1 1
 import * as React from 'react';
2
-import { default as CustomToolbar} from '../Components/Password/CustomToolbar';
2
+import { default as CustomToolbar } from '../Components/Password/CustomToolbar';
3 3
 
4
-import { 
5
-    Paper, Box, 
4
+import {
5
+    Paper, Box,
6 6
     // Table, TableBody, TableCell, TableContainer, TableRow, TablePagination, Switch, FormControlLabel, Checkbox,
7 7
 } from '@mui/material';
8 8
 
@@ -35,7 +35,7 @@ export function Contrasv2() {
35 35
         <div className="content-section">
36 36
             <div className="main">
37 37
                 <Box sx={{ width: '100%' }}>
38
-                    <Paper sx={{ width: '100%', mb: 2 }}>
38
+                    <Paper sx={{ mb: 2, padding: 2, height: '100%', minHeight: '95vh' }}>
39 39
                         <MUIDataTable
40 40
                             title={"Contraseñas"}
41 41
                             data={data}

+ 24 - 21
src/Pages/Puestos.jsx

@@ -1,12 +1,10 @@
1 1
 import React, { useState, useCallback} from 'react';
2 2
 import { Row, Col } from 'react-bootstrap'
3
-
4 3
 import { Toaster } from 'react-hot-toast';
5
-// import toast, { Toaster } from 'react-hot-toast';
6 4
 
7 5
 import {
8 6
     ToggleButton, ToggleButtonGroup, Box,
9
-    Paper, Pagination,
7
+    Paper, Pagination,Chip
10 8
 } from '@mui/material';
11 9
 
12 10
 import { ViewList as ViewListIcon, ViewModule as ViewModuleIcon, } from '@mui/icons-material';
@@ -115,7 +113,7 @@ export function Puestos() {
115 113
     return (
116 114
         <div className="content-section">
117 115
             <div className="main">
118
-                <Box sx={{}}>
116
+                <Box>
119 117
                     <Paper sx={{ mb: 2, padding: 2, }}>
120 118
 
121 119
                         <Row style={{ paddingBottom: 15 }}>
@@ -142,8 +140,8 @@ export function Puestos() {
142 140
                             </Col>
143 141
                         </Row>
144 142
 
145
-                        <div >
146
-                            <div  className={`main_productos ${alignment === 'grid' ? 'activar_vista' : 'desactivar_vista'}`} id="grid_view">
143
+                        <div>
144
+                            <div className={`main_productos ${alignment === 'grid' ? 'activar_vista' : 'desactivar_vista'}`} id="grid_view">
147 145
                                 <Row>
148 146
                                     <GridMode
149 147
                                         toggle={toggle}
@@ -164,20 +162,25 @@ export function Puestos() {
164 162
                                 </Row>
165 163
                             </div>
166 164
 
167
-                            <Pagination
168
-                                sx={{
169
-                                    "& ul": {
170
-                                        paddingTop: "20px",
171
-                                        justifyContent: "center"
172
-                                    }
173
-                                }}
174
-                                siblingCount={2}
175
-                                boundaryCount={2}
176
-                                shape='rounded'
177
-                                count={total_items}
178
-                                page={page}
179
-                                onChange={changePage}
180
-                            />
165
+                            <div id="pagi_bottom">
166
+                                <Pagination
167
+                                    sx={{
168
+                                        "& ul": {
169
+                                            paddingTop: "20px",
170
+                                            justifyContent: "center"
171
+                                        }
172
+                                    }}
173
+                                    siblingCount={2}
174
+                                    boundaryCount={2}
175
+                                    shape='rounded'
176
+                                    count={total_items}
177
+                                    page={page}
178
+                                    onChange={changePage}
179
+                                    />
180
+
181
+                                <Chip label={"Total: "+ ( result? result.data.length : 0 ) } />
182
+                            </div>
183
+
181 184
                         </div>
182 185
                     </Paper>
183 186
                 </Box>
@@ -190,7 +193,7 @@ export function Puestos() {
190 193
             <Editar  puesto={puesto} visible={edit} toggle={toggle} />
191 194
             <Eliminar visible={del} onClose={() => setDelete(false)} />
192 195
 
193
-            <Toaster position="bottom-right" reverseOrder={false} />
196
+            <Toaster position="bottom-right" />
194 197
 
195 198
         </div>
196 199
     )