Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15294 Rev 15295
Línea 54... Línea 54...
54
			})))
54
			})))
55
	}
55
	}
Línea 56... Línea 56...
56
 
56
 
Línea -... Línea 57...
-
 
57
	const setData = (data) => setItems(data)
-
 
58
 
-
 
59
	const renderChild = () => {
-
 
60
		items.map((item, index) =>
-
 
61
			<tr key={index}>
-
 
62
				<td>{item.name}</td>
-
 
63
				<td>{item.job_description}</td>
-
 
64
				<td>
-
 
65
					{item.status === 'a'
-
 
66
						? 'Activo'
-
 
67
						: 'Inactivo'
-
 
68
					}
-
 
69
				</td>
-
 
70
				<td className='d-flex' style={{ gap: '10px' }}>
-
 
71
					{permisions.allowEdit &&
-
 
72
						<i
-
 
73
							className='fa fa-pencil'
-
 
74
							onClick={() => {
-
 
75
								setActionLink(item.actions.link_edit)
-
 
76
								setAction('edit')
-
 
77
							}}
-
 
78
							style={{ cursor: 'pointer' }} />
-
 
79
					}
-
 
80
					{permisions.allowDelete &&
-
 
81
						<i
-
 
82
							className='fa fa-trash'
-
 
83
							onClick={() => {
-
 
84
								setShowDeleteModal(true)
-
 
85
								setDeleteLink(item.actions.link_delete)
-
 
86
							}}
-
 
87
							style={{ cursor: 'pointer' }} />
-
 
88
					}
-
 
89
				</td>
-
 
90
			</tr>
-
 
91
		)
57
	const setData = (data) => setItems(data)
92
	}
58
 
93
 
59
	useEffect(() => {
94
	useEffect(() => {
60
		getData({
95
		getData({
61
			url: table_link,
96
			url: table_link,
Línea 133... Línea 168...
133
										<Table
168
										<Table
134
											data={items}
169
											data={items}
135
											headers={headers}
170
											headers={headers}
136
											setData={setData}
171
											setData={setData}
137
										>
172
										>
138
											{[...items].map((item, index) =>
-
 
139
												<tr key={index}>
173
											{renderChild}
140
													<td>{item.name}</td>
-
 
141
													<td>{item.job_description}</td>
-
 
142
													<td>
-
 
143
														{item.status === 'a'
-
 
144
															? 'Activo'
-
 
145
															: 'Inactivo'
-
 
146
														}
-
 
147
													</td>
-
 
148
													<td className='d-flex' style={{ gap: '10px' }}>
-
 
149
														{permisions.allowEdit &&
-
 
150
															<i
-
 
151
																className='fa fa-pencil'
-
 
152
																onClick={() => {
-
 
153
																	setActionLink(item.actions.link_edit)
-
 
154
																	setAction('edit')
-
 
155
																}}
-
 
156
																style={{ cursor: 'pointer' }} />
-
 
157
														}
-
 
158
														{permisions.allowDelete &&
-
 
159
															<i
-
 
160
																className='fa fa-trash'
-
 
161
																onClick={() => {
-
 
162
																	setShowDeleteModal(true)
-
 
163
																	setDeleteLink(item.actions.link_delete)
-
 
164
																}}
-
 
165
																style={{ cursor: 'pointer' }} />
-
 
166
														}
-
 
167
													</td>
-
 
168
												</tr>
-
 
169
											)}
-
 
170
										</Table>
174
										</Table>
171
									</div>
175
									</div>
172
									<div className='row justify-content-between align-items-center'>
176
									<div className='row justify-content-between align-items-center'>
173
										<p className='mb-0'>
177
										<p className='mb-0'>
174
											{`Mostrando registros del ${startItem} al ${lastItem} de un total de ${total} registros`}
178
											{`Mostrando registros del ${startItem} al ${lastItem} de un total de ${total} registros`}