Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 4847 | Rev 4890 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 4847 Rev 4881
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
const CompanySizesView = ({ urlsVar }) => {
4
const CompanySizesView = ({ urlsVar }) => {
5
 
5
 
-
 
6
    const { linkTable, linkAdd, linkEdit, linkDelete } = urlsVar
-
 
7
    const [companyData, setCompanyData] = useState();
-
 
8
    const [search, setSearch] = useState('');
-
 
9
    const [dataLength, setDataLength] = useState(10);
Línea 6... Línea 10...
6
    const { linkTable, linkAdd, linkEdit, linkDelete } = urlsVar
10
    const [page, setPage] = useState(1);
-
 
11
    const lengthValues = ["10", "25", "50", "100"]
-
 
12
 
-
 
13
    const getData = () => {
-
 
14
        axios.get(
-
 
15
            linkTable,
7
    const [companyData, setCompanyData] = useState();
16
            {
-
 
17
                params: {
-
 
18
                    page: page,
-
 
19
                    length: dataLength,
8
 
20
                    search: search,
9
    const getData = () => {
21
                }
10
        axios.get(linkTable, { params: { length: 3 } })
22
            })
Línea 11... Línea 23...
11
            .then(({ data }) => {
23
            .then(({ data }) => {
Línea 18... Línea 30...
18
            .catch((err) => console.log(err))
30
            .catch((err) => console.log(err))
19
    }
31
    }
Línea 20... Línea 32...
20
 
32
 
21
    useEffect(() => {
33
    useEffect(() => {
22
        getData()
34
        getData()
23
        console.log(urlsVar)
35
        console.log(companyData)
Línea 24... Línea 36...
24
    }, []);
36
    }, [search, dataLength, page]);
-
 
37
 
-
 
38
    return (
-
 
39
        <section className="content">
-
 
40
            <section className="content-header">
-
 
41
                <div className="container-fluid">
-
 
42
                    <div className="row mb-2">
-
 
43
                        <div className="col-sm-12">
-
 
44
                            <h1>Tamaños de empresa</h1>
-
 
45
                        </div>
-
 
46
                    </div>
-
 
47
                </div>
-
 
48
            </section>
-
 
49
            <section className="content">
-
 
50
                <div className="container-fluid">
-
 
51
                    <div className="row">
-
 
52
                        <div className="col-12">
-
 
53
                            <div className="card">
-
 
54
                                <div className="card-body">
-
 
55
                                    <div id="gridTable_wrapper" className="dataTables_wrapper dt-bootstrap4 no-footer">
-
 
56
                                        <div className="row">
-
 
57
                                            <div className="col-sm-12 col-md-6">
-
 
58
                                                <div className="dataTables_length" id="gridTable_length">
-
 
59
                                                    <label>
-
 
60
                                                        Mostrar
-
 
61
                                                        <select
-
 
62
                                                            className="custom-select custom-select-sm form-control form-control-sm"
-
 
63
                                                            onChange={(e) => setDataLength(e.target.value)}
-
 
64
                                                        >
-
 
65
                                                            {
-
 
66
                                                                lengthValues.map((value, index) => (
-
 
67
                                                                    <option key={index} value={value}>{value}</option>
-
 
68
                                                                ))
-
 
69
                                                            }
-
 
70
                                                        </select>
-
 
71
                                                        registros
-
 
72
                                                    </label>
-
 
73
                                                </div>
-
 
74
                                            </div>
-
 
75
                                            <div className="col-sm-12 col-md-6">
-
 
76
                                                <div id="gridTable_filter" className="dataTables_filter">
-
 
77
                                                    <label>
-
 
78
                                                        Buscar
-
 
79
                                                        <input
-
 
80
                                                            type="search"
-
 
81
                                                            className="form-control form-control-sm" placeholder=""
-
 
82
                                                            onChange={(e) => setSearch(e.target.value)}
-
 
83
                                                        />
-
 
84
                                                    </label>
-
 
85
                                                </div>
-
 
86
                                            </div>
-
 
87
                                        </div>
-
 
88
                                    </div>
25
 
89
                                </div>
-
 
90
                            </div>
-
 
91
                        </div>
-
 
92
                    </div>
-
 
93
                </div>
26
    return (
94
            </section>
27
        <div>CompanySizes</div>
95
        </section>
Línea 28... Línea 96...
28
    )
96
    )
29
}
97
}