trithuc-mvc-react 3.2.8 → 3.3.0

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.
@@ -81,6 +81,7 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
81
81
  toast.success("Thay đổi trạng thái thành công !");
82
82
  }
83
83
  queryClient.invalidateQueries({ queryKey: [tableName] });
84
+ queryClient.invalidateQueries({ queryKey: [tableName, "CountAllTrangThaiXuly"] });
84
85
  },
85
86
  onError: (error) => {
86
87
  if (error.response && error.response.data) {
@@ -105,6 +106,7 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
105
106
  }
106
107
 
107
108
  queryClient.invalidateQueries({ queryKey: [tableName] });
109
+ queryClient.invalidateQueries({ queryKey: [tableName, "CountAllTrangThaiXuly"] });
108
110
  },
109
111
  onError: (error) => {
110
112
  if (error.response && error.response.data) {
@@ -157,24 +159,6 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
157
159
  }
158
160
  setOpenDialog(false); // Đóng dialog sau khi chọn
159
161
  };
160
- // const handleDelete = (id) => {
161
- // confirm({
162
- // description: "Bạn có chắc chắn muốn xóa bản ghi này không?",
163
- // title: "Xác nhận",
164
- // cancellationText: "Hủy",
165
- // confirmationText: "Xóa"
166
- // })
167
- // .then(() => {
168
- // deleteMutation.mutate({
169
- // id,
170
- // tableName
171
- // });
172
- // })
173
- // .finally(() => {
174
- // // Đảm bảo phần hủy thao tác được xử lý trong finally
175
- // toast.info("Đã hủy thao tác xóa.");
176
- // });
177
- // };
178
162
 
179
163
  const handleChangeStatus = (Id) => {
180
164
  changeStatusMutation.mutate({
@@ -268,23 +252,6 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
268
252
  }
269
253
  setOpenDeleteMultipleDialog(false); // Đóng Dialog sau khi chọn
270
254
  };
271
- // const handleDeleteMultiple = () => {
272
- // confirm({
273
- // description: `Bạn có chắc chắn muốn xóa ${selectedItems?.length} bản ghi này không?`,
274
- // title: "Xác nhận",
275
- // cancellationText: "Hủy",
276
- // confirmationText: "Đồng ý"
277
- // })
278
- // .then(() => {
279
- // deleteMultipleMutation.mutate({
280
- // tableName,
281
- // ids: selectedItems
282
- // });
283
- // })
284
- // .catch(() => {
285
- // toast.info("Đã hủy thao tác xóa.");
286
- // });
287
- // };
288
255
  const theme = useTheme();
289
256
  const downXL = useMediaQuery(theme.breakpoints.down("xl"));
290
257
 
@@ -1,6 +1,6 @@
1
1
  import { URL_APPLICATION, URL_APPLICATION_API } from "@/constants";
2
2
  import { Download } from "@mui/icons-material";
3
- import { Button, IconButton, Tooltip, useMediaQuery, useTheme } from "@mui/material";
3
+ import { Button, IconButton, Tooltip, Typography, useMediaQuery, useTheme } from "@mui/material";
4
4
  import { toast } from "react-toastify";
5
5
  import { exportExcel } from "../../api";
6
6
 
@@ -27,9 +27,19 @@ const ExportExcelButton = ({ tableName, data, size = "small" }) => {
27
27
  onClick={() => {
28
28
  handleExportExcel(tableName, data);
29
29
  }}
30
- sx={{ ml: 0.5, mr: 0.5, minWidth: "73px" }}
30
+ sx={{ ml: 0.5, mr: 0.5, minWidth: "73px", textTransform: "none" }}
31
31
  >
32
- Excel
32
+ <Typography
33
+ noWrap
34
+ sx={{
35
+ width: "100%",
36
+ fontSize: "clamp(0.75rem, 1.5vw, 1rem)",
37
+ textAlign: "center",
38
+ textTransform: "none" // ✅ Đảm bảo chữ gốc giữ nguyên
39
+ }}
40
+ >
41
+ Excel
42
+ </Typography>
33
43
  </Button>
34
44
  ) : (
35
45
  <Button
@@ -39,9 +49,19 @@ const ExportExcelButton = ({ tableName, data, size = "small" }) => {
39
49
  onClick={() => {
40
50
  handleExportExcel(tableName, data);
41
51
  }}
42
- sx={{ ml: 0.5, mr: 0.5, minWidth: "73px" }}
52
+ sx={{ ml: 0.5, mr: 0.5, minWidth: "73px", textTransform: "none" }}
43
53
  >
44
- Excel
54
+ <Typography
55
+ noWrap
56
+ sx={{
57
+ width: "100%",
58
+ fontSize: "clamp(0.75rem, 1.5vw, 1rem)",
59
+ textAlign: "center",
60
+ textTransform: "none" // ✅ Đảm bảo chữ gốc giữ nguyên
61
+ }}
62
+ >
63
+ Excel
64
+ </Typography>
45
65
  </Button>
46
66
  );
47
67
  };
@@ -152,7 +152,7 @@ export const FilterGod = ({ tableName, filters, filterButtons, elementSize = "sm
152
152
  );
153
153
 
154
154
  return (
155
- <Grid container key={field.toString()} size={{ ...size }}>
155
+ <Grid sx={{ mb: "5px" }} container key={field.toString()} size={{ ...size }}>
156
156
  <Grid size={{ xs: 12, md: 6 }}>{renderDatePicker(field[0], label1, field[1], "max")}</Grid>
157
157
  <Grid size={{ xs: 12, md: 6 }}>{renderDatePicker(field[1], label2, field[0], "min")}</Grid>
158
158
  </Grid>
@@ -161,7 +161,7 @@ export const FilterGod = ({ tableName, filters, filterButtons, elementSize = "sm
161
161
 
162
162
  if (rest.type === "slider-range") {
163
163
  return (
164
- <Grid key={field.toString()} size={{ ...size }}>
164
+ <Grid sx={{ mb: "5px" }} key={field.toString()} size={{ ...size }}>
165
165
  <Slider
166
166
  onChange={(e, value) => {
167
167
  setDataSearch({
@@ -182,7 +182,7 @@ export const FilterGod = ({ tableName, filters, filterButtons, elementSize = "sm
182
182
  );
183
183
  }
184
184
  return (
185
- <Grid key={field.toString()} size={{ ...size }}>
185
+ <Grid sx={{ mb: "5px" }} key={field.toString()} size={{ ...size }}>
186
186
  <FilterElement name={field.toString()} label={label} placeholder={placeHolder} {...rest} setPage={setPage} />
187
187
  </Grid>
188
188
  );
@@ -108,7 +108,7 @@ function DataManagement({
108
108
  }
109
109
  },
110
110
  defaultRowsPerPage = 5,
111
- titleAddButton = "Thêm",
111
+ titleAddButton = "Thêm mới",
112
112
  thongKe,
113
113
  bieuDo,
114
114
  disableHead = false
@@ -413,10 +413,21 @@ function DataManagement({
413
413
  sx={{
414
414
  ml: 0.5,
415
415
  mr: 0.5,
416
- minWidth: "73px"
416
+ minWidth: "73px",
417
+ textTransform: "none" // ✅ Không viết hoa tự động
417
418
  }}
418
419
  >
419
- {titleAddButton}
420
+ <Typography
421
+ noWrap
422
+ sx={{
423
+ width: "100%",
424
+ fontSize: "clamp(0.75rem, 1.5vw, 1rem)",
425
+ textAlign: "center",
426
+ textTransform: "none" // ✅ Đảm bảo chữ gốc giữ nguyên
427
+ }}
428
+ >
429
+ {titleAddButton}
430
+ </Typography>
420
431
  </Button>
421
432
  )}
422
433
  </Box>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "3.2.8",
3
+ "version": "3.3.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"