trithuc-mvc-react 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,6 +18,7 @@ import { usePermission } from "../../hooks";
|
|
|
18
18
|
DataManagement.propTypes = {
|
|
19
19
|
columns: PropTypes.array,
|
|
20
20
|
title: PropTypes.string,
|
|
21
|
+
titleButtons: PropTypes.array,
|
|
21
22
|
tableName: PropTypes.string,
|
|
22
23
|
selectedField: PropTypes.string,
|
|
23
24
|
filters: PropTypes.arrayOf(
|
|
@@ -52,6 +53,7 @@ const getDefaultValues = (filters = []) => {
|
|
|
52
53
|
function DataManagement({
|
|
53
54
|
columns = [],
|
|
54
55
|
title,
|
|
56
|
+
titleButtons = [],
|
|
55
57
|
tableName,
|
|
56
58
|
selectedField = "Id",
|
|
57
59
|
filters: tableFilters = [],
|
|
@@ -110,6 +112,7 @@ function DataManagement({
|
|
|
110
112
|
return {
|
|
111
113
|
tableName,
|
|
112
114
|
selectedField,
|
|
115
|
+
titleButtons,
|
|
113
116
|
columns,
|
|
114
117
|
selectedEditItem,
|
|
115
118
|
setSelectedEditItem,
|
|
@@ -130,6 +133,7 @@ function DataManagement({
|
|
|
130
133
|
}, [
|
|
131
134
|
tableName,
|
|
132
135
|
selectedField,
|
|
136
|
+
titleButtons,
|
|
133
137
|
columns,
|
|
134
138
|
selectedEditItem,
|
|
135
139
|
dataSearch,
|
|
@@ -170,6 +174,12 @@ function DataManagement({
|
|
|
170
174
|
</IconButton>
|
|
171
175
|
</Tooltip>
|
|
172
176
|
|
|
177
|
+
{titleButtons?.map((button, index) => (
|
|
178
|
+
<div key={index}>
|
|
179
|
+
{button}
|
|
180
|
+
{/* Các phần tử khác có thể được thêm ở đây nếu cần */}
|
|
181
|
+
</div>
|
|
182
|
+
))}
|
|
173
183
|
<ExportExcelButton tableName={tableName} data={dataSearch} size={elementSize} />
|
|
174
184
|
{canCreate && !disableAdd && (
|
|
175
185
|
<Button
|
|
@@ -199,6 +209,7 @@ function DataManagement({
|
|
|
199
209
|
</Card>
|
|
200
210
|
</FormProvider>
|
|
201
211
|
|
|
212
|
+
{/* nôi dung form */}
|
|
202
213
|
{disableEditor || (
|
|
203
214
|
<EditorDialog
|
|
204
215
|
open={openEditorDialog}
|
|
@@ -207,6 +218,7 @@ function DataManagement({
|
|
|
207
218
|
fields={editorFields}
|
|
208
219
|
/>
|
|
209
220
|
)}
|
|
221
|
+
{/* nôi dung view */}
|
|
210
222
|
<ViewDetailDialog open={openViewDialog} onClose={() => setOpenViewDialog(false)} fields={editorFields} />
|
|
211
223
|
</DataTableContext.Provider>
|
|
212
224
|
</>
|