浏览代码

table mok style fix

amenpunk 2 年之前
父节点
当前提交
958ba7983d
共有 5 个文件被更改,包括 65 次插入72 次删除
  1. 5 1
      src/App.css
  2. 54 23
      src/Components/Home/Candidato.jsx
  3. 3 34
      src/Components/Home/Candidatos.js
  4. 1 0
      src/Css/all.css
  5. 2 14
      src/Pages/Home.jsx

+ 5 - 1
src/App.css

@@ -388,7 +388,11 @@
388 388
 .table_list_test_user{
389 389
   border :none !important;
390 390
 }
391
-
391
+.pwd_user_name{
392
+  border-bottom:none!important;
393
+  border-right :1px solid #f1f1f1 !important;
394
+  /* background:red; */
395
+}
392 396
 .home_letter{
393 397
   font-family: 'gudea' !important;
394 398
   color: #878787 !important;

+ 54 - 23
src/Components/Home/Candidato.jsx

@@ -3,8 +3,16 @@ import {
3 3
   Skeleton, Box, IconButton, TableCell, TableContainer,
4 4
   Table, TableRow, Paper, TableBody
5 5
 } from '@mui/material';
6
+
7
+import { Col, Row } from 'react-bootstrap'
8
+
6 9
 import React from 'react'
7
-import CheckBoxIcon from '@mui/icons-material/CheckBox';
10
+
11
+import {
12
+  CheckBox as CheckBoxIcon,
13
+  FmdBad as FmdBadIcon,
14
+  NewReleases as NewReleasesIcon
15
+} from '@mui/icons-material'
8 16
 
9 17
 
10 18
 const big_as = 70
@@ -27,15 +35,25 @@ function Asignaciones(props) {
27 35
 function TableUser(props) {
28 36
   let { user } = props;
29 37
   let { asignaciones, candi } = user
30
-  // console.log(asignaciones)
38
+
39
+  if (asignaciones.lenght <= 0) {
40
+    return <h1>Sin datos</h1>
41
+  }
42
+
31 43
   return (
32
-    <TableRow style={{}}>
33
-      <TableCell className="table_list_test_user home_letter">{candi.nombre + " " + candi.apellidos}</TableCell>
44
+    <TableRow >
45
+      <TableCell
46
+        style={{ borderRight: '1px solid #f1f1f1 !important' }}
47
+        className="home_letter pwd_user_name ">
48
+        {candi.nombre + " " + candi.apellidos}
49
+      </TableCell>
34 50
       <TableCell className="table_list_test_user home_letter">
35 51
         <table>
36 52
           <tbody >
37 53
             {
38
-              asignaciones.map(a => <Asignaciones key={a.id} asign={a} />)
54
+              asignaciones?.length > 0 ?
55
+                asignaciones.map(a => <Asignaciones key={a.id} asign={a} />)
56
+                : <SinAsignaciones />
39 57
             }
40 58
           </tbody>
41 59
         </table>
@@ -44,39 +62,52 @@ function TableUser(props) {
44 62
   )
45 63
 }
46 64
 
65
+function SinAsignaciones() {
66
+  return (
67
+    <tr style={{ padding: 5 }}>
68
+      <center className="home_letter">
69
+        <i> El candidato aun no cuenta con asignaciones... </i>
70
+        <FmdBadIcon style={{ color: 'var(--main)' }} />
71
+      </center>
72
+    </tr>
73
+  )
74
+}
75
+
47 76
 export function Candidato(props) {
48
-  // console.log("USER: ", props.user)
49 77
   let { password, candidatos } = props.user
50 78
 
51 79
   return (
52 80
     <div className="data_candidato">
53
-      <div className="row">
54
-        <div style={{padding:15, borderRight: '1px solid #f1f1f1' }} className="col-3" >
81
+      <Row>
82
+        <Col md="3" sm="12" style={{ padding: 10, borderRight: '1px solid #f1f1f1' }}>
55 83
           <p><b>{password?.toUpperCase()}</b></p>
56
-        </div>
57
-        <div className="col-9">
58
-
84
+        </Col>
85
+        <Col md="9">
59 86
           <TableContainer style={{ boxShadow: "none" }} component={Paper}>
60 87
             <Table size="small" aria-label="a dense table">
61
-              {/*
62
-              <TableHead>
63
-                <TableRow>
64
-                  <TableCell className="tg-0lax">Nombre</TableCell>
65
-                  <TableCell className="tg-0lax">Asignaciones</TableCell>
66
-                </TableRow>
67
-              </TableHead>
68
-                  */}
69 88
               <TableBody>
70 89
                 {
71
-                  candidatos.map(u => <TableUser key={u.candi.id} user={u} />)
90
+                  candidatos.length > 0 ?
91
+                    candidatos.map(u => <TableUser key={u.candi.id} user={u} />)
92
+                    : <SinAsignRealizadas />
93
+
72 94
                 }
73 95
               </TableBody>
74 96
             </Table>
75
-
76 97
           </TableContainer>
98
+        </Col>
99
+      </Row>
100
+    </div>
101
+  )
102
+}
77 103
 
78
-        </div>
79
-      </div>
104
+function SinAsignRealizadas() {
105
+  return (
106
+    <div style={{ padding: 5 }}>
107
+      <center className="home_letter">
108
+        <i> No se ha relizado ninguna asignacion... </i>
109
+        <NewReleasesIcon style={{ color: '#e8eb34' }} />
110
+      </center>
80 111
     </div>
81 112
   )
82 113
 }

+ 3 - 34
src/Components/Home/Candidatos.js

@@ -6,7 +6,7 @@ import { Candidato, Preview } from './Candidato'
6 6
 
7 7
 function Divide(arregloOriginal) {
8 8
 
9
-  const LONGITUD_PEDAZOS = 4;
9
+  const LONGITUD_PEDAZOS = 7;
10 10
   let arregloDeArreglos = [];
11 11
   for (let i = 0; i < arregloOriginal.length; i += LONGITUD_PEDAZOS) {
12 12
     let pedazo = arregloOriginal.slice(i, i + LONGITUD_PEDAZOS);
@@ -40,46 +40,15 @@ export default function Candidatos(props) {
40 40
 
41 41
     let list = passwords.map(pwd => {
42 42
       let { candidatospwds } = pwd
43
-      // console.log(candidatospwds)
44
-      // let candi_info = candidatospwds.map( ({candi}) => candi?.nombre +" "+ candi?.apellidos   )
45 43
       return {
46 44
         password: fromBase64(pwd.pwd),
47 45
         candidatos: candidatospwds
48 46
       }
49 47
     })
50 48
 
51
-    /*
52
-    let list = [{
53
-      password: 'tester',
54
-      puesto: "Piloto Repartidor",
55
-      DPI: 0,
56
-      // aplicacion : "27/12/2018 12:02 PM",
57
-      aplicacion: new Date().toUTCString(),
58
-      pendientes: "No"
59
-    }]
60
-
61
-    let a = 1;
62
-    for (let _ of new Array(USER_LENGTH)) {
63
-      if (_) break
64
-
65
-      let temp = {
66
-        ...list[0],
67
-        DPI: a * 1000,
68
-        password: Math.random().toString(36).slice(5),
69
-        aplicacion: new Date(10, 12, a).toUTCString(),
70
-      }
71
-
72
-      a = a + 1;
73
-      list.push(temp)
74
-    }
75
-
76
-*/
77
-
78 49
     let divided = Divide(list);
79
-
80 50
     setUser(divided)
81 51
 
82
-
83 52
   }, [passwords])
84 53
 
85 54
   return (
@@ -100,12 +69,12 @@ export default function Candidatos(props) {
100 69
         </div>
101 70
         {
102 71
           users.length
103
-            ? users[page - 1].map((user,i) => (<Candidato key={i} user={user} />))
72
+            ? users[page - 1].map((user, i) => (<Candidato key={i} user={user} />))
104 73
             : <Preview style={{ paddingTop: 10 }} lenght={10} />
105 74
         }
106 75
         <Row style={{ padding: 5 }}>
107 76
           <Col>
108
-            <Stack style={{ display: 'flex', flexDirection: 'row', alignItems: 'baseline' }} spacing={2}>
77
+            <Stack style={{ display: 'flex', flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-evenly' }} spacing={2}>
109 78
               <Typography style={{ paddingTop: 15, paddingRight: 10 }}>Página: {page}</Typography>
110 79
               <Pagination
111 80
                 siblingCount={1}

+ 1 - 0
src/Css/all.css

@@ -1807,6 +1807,7 @@ li.cabecera_li {
1807 1807
     color: #25344f;
1808 1808
 }
1809 1809
 .data_candidato {
1810
+  padding:2px;
1810 1811
   border-bottom: 1px solid #f1f1f1;
1811 1812
 }
1812 1813
 .data_candidato a:hover {

+ 2 - 14
src/Pages/Home.jsx

@@ -1,5 +1,4 @@
1 1
 import React from 'react'
2
-
3 2
 import { Col, Row } from 'react-bootstrap'
4 3
 import { PersonOutline, VerifiedUser, ListAlt } from '@mui/icons-material/'
5 4
 import Actividades from '../Components/Home/Actividades'
@@ -12,7 +11,7 @@ import { useQuery } from 'react-query';
12 11
 export function Home() {
13 12
 
14 13
   const auth = useSelector((state) => state.token)
15
-  const profile = useSelector((state) => state.user.profile)
14
+  // const profile = useSelector((state) => state.user.profile)
16 15
 
17 16
   const getAllPwd = async () => {
18 17
     let rest = new Service('/contrasenia/getallbyidUsr');
@@ -20,24 +19,13 @@ export function Home() {
20 19
   }
21 20
 
22 21
   const { data, status } = useQuery('homepwd', getAllPwd);
23
-
24 22
   let is_loading = status === "loading";
25
-  console.log({is_loading, data})
26
-
27
-  //TODO:
28
-  //utilizar el servicio 
29
-  //http://psicoadmin.ditca.org:8081/plaza/getthis/212
30
-  //para renderizar informacion de cada pwd en la home
23
+  console.log({is_loading})
31 24
 
32 25
   return (
33 26
     <section >
34 27
       <div className="content-section">
35 28
         <div className="main">
36
-
37
-          <div id="start_title">
38
-            <h1>Bienvenido de nuevo {profile.nombre}</h1>
39
-          </div>
40
-
41 29
           <div className="panel_options">
42 30
             <Row>
43 31
               <Col md="4">