trithuc-mvc-react 3.3.4 → 3.3.6

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.
@@ -127,6 +127,7 @@ const DataTable = ({ multipleActions = [], page, setPage = () => {}, disableEdit
127
127
  }
128
128
  setSelectedItems([]);
129
129
  queryClient.invalidateQueries({ queryKey: [tableName] });
130
+ queryClient.invalidateQueries({ queryKey: [tableName, "CountAllTrangThaiXuly"] });
130
131
  },
131
132
  onError: (error) => {
132
133
  if (error.response && error.response.data) {
@@ -80,6 +80,7 @@ const DataTableSM = ({ multipleActions = [], page, setPage = () => {}, disableEd
80
80
  toast.success("Thay đổi trạng thái thành công !");
81
81
  }
82
82
  queryClient.invalidateQueries({ queryKey: [tableName] });
83
+ queryClient.invalidateQueries({ queryKey: [tableName, "CountAllTrangThaiXuly"] });
83
84
  },
84
85
  onError: (error) => {
85
86
  if (error.response && error.response.data && error.response.data.errors) {
@@ -108,6 +109,7 @@ const DataTableSM = ({ multipleActions = [], page, setPage = () => {}, disableEd
108
109
  }
109
110
 
110
111
  queryClient.invalidateQueries({ queryKey: [tableName] });
112
+ queryClient.invalidateQueries({ queryKey: [tableName, "CountAllTrangThaiXuly"] });
111
113
  },
112
114
  onError: (error) => {
113
115
  if (error.response && error.response.data && error.response.data.errors) {
@@ -132,6 +134,7 @@ const DataTableSM = ({ multipleActions = [], page, setPage = () => {}, disableEd
132
134
  }
133
135
  setSelectedItems([]);
134
136
  queryClient.invalidateQueries({ queryKey: [tableName] });
137
+ queryClient.invalidateQueries({ queryKey: [tableName, "CountAllTrangThaiXuly"] });
135
138
  },
136
139
  onError: (error) => {
137
140
  if (error.response && error.response.data && error.response.data.errors) {
@@ -27,7 +27,7 @@ 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: "100px", textTransform: "none" }}
30
+ sx={{ ml: 0.5, mr: 0.5, minWidth: isSmallScreen ? "73px" : "100px", textTransform: "none" }}
31
31
  >
32
32
  <Typography
33
33
  noWrap
@@ -53,7 +53,7 @@ const ExportExcelButton = ({ tableName, data, size = "small" }) => {
53
53
  onClick={() => {
54
54
  handleExportExcel(tableName, data);
55
55
  }}
56
- sx={{ ml: 0.5, mr: 0.5, minWidth: "100px", textTransform: "none" }}
56
+ sx={{ ml: 0.5, mr: 0.5, minWidth: isSmallScreen ? "73px" : "100px", textTransform: "none" }}
57
57
  >
58
58
  <Typography
59
59
  noWrap
@@ -130,7 +130,7 @@ export const TableRowRenderSM = ({
130
130
  {tableActionsOnTable.map(
131
131
  ({ title, size, onClick, element, visible = true }, idx) =>
132
132
  (typeof visible === "function" ? visible(row) : visible) && (
133
- <Grid size={4}>
133
+ <Grid key={row.Id} size={4}>
134
134
  <Button
135
135
  fullWidth
136
136
  key={idx}
@@ -419,7 +419,7 @@ function DataManagement({
419
419
  sx={{
420
420
  ml: 0.5,
421
421
  mr: 0.5,
422
- minWidth: "130px",
422
+ minWidth: isSmallScreen ? "100px" : "130px",
423
423
  textTransform: "none" // ✅ Không viết hoa tự động
424
424
  }}
425
425
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "3.3.4",
3
+ "version": "3.3.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/utils/storage.js CHANGED
@@ -42,42 +42,82 @@ export const decryptData = (ciphertext) => {
42
42
 
43
43
  export const storeUserData = (data) => {
44
44
  if (!data) return;
45
-
46
45
  // Mã hóa và lưu token
47
46
  const encryptedToken = encryptData(data.Token);
48
47
  localStorage.setItem("token", encryptedToken);
49
-
50
48
  // Tạo object user từ dữ liệu response
51
49
  const userObj = {
50
+ Avatar: data?.Avatar,
51
+ GroupID: data?.GroupID,
52
+ Name: data?.Name,
53
+ PhoneNumber: data?.PhoneNumber,
54
+ PhongBan: data?.PhongBan,
55
+ TenPhongBan: data?.TenPhongBan,
56
+ CoQuanHanhChinh: data?.CoQuanHanhChinh,
57
+ TenCoQuanHanhChinh: data?.TenCoQuanHanhChinh,
58
+ PhanLoaiNguoiDung: data?.PhanLoaiNguoiDung,
59
+ ChucVu: data?.ChucVu,
60
+ TenChucVu: data?.TenChucVu,
61
+ DonViHanhChinh: data?.DonViHanhChinh,
62
+ TenDonViHanhChinh: data?.TenDonViHanhChinh,
63
+ Tinh: data?.Tinh,
64
+ TenTinh: data?.TenTinh,
65
+ Huyen: data?.Huyen,
66
+ TenHuyen: data?.TenHuyen,
67
+ PhuongXa: data?.PhuongXa,
68
+ TenPhuongXa: data?.TenPhuongXa,
69
+ isModule: data?.isModule,
52
70
  userName: data?.UserName,
53
- email: data?.Email,
71
+ UserName: data?.UserName,
72
+ UserId: data?.UserId,
54
73
  FullName: data?.FullName,
55
- Avatar: data?.Avatar,
74
+ email: data?.Email,
75
+ Email: data?.Email,
56
76
  Navigate: data?.Navigate,
57
- PhoneNumber: data?.PhoneNumber
77
+ FirstLogin: data?.FirstLogin,
78
+ ThoiGianMatKhauHopLe: data?.ThoiGianMatKhauHopLe
58
79
  };
59
-
60
80
  // Mã hóa và lưu user object vào localStorage
61
81
  const encryptedUserObj = encryptData(userObj);
62
82
  localStorage.setItem("user", encryptedUserObj);
63
83
  };
64
84
  export const storeSubUserData = (data) => {
65
85
  if (!data) return;
66
-
67
86
  // Mã hóa và lưu token
68
87
  const encryptedToken = encryptData(data.Token);
69
88
  localStorage.setItem("token", encryptedToken);
70
-
71
89
  // Tạo object user từ dữ liệu response
72
90
  const userObj = {
91
+ Avatar: data?.Avatar,
92
+ GroupID: data?.GroupID,
93
+ Name: data?.Name,
94
+ PhoneNumber: data?.PhoneNumber,
95
+ PhongBan: data?.PhongBan,
96
+ TenPhongBan: data?.TenPhongBan,
97
+ CoQuanHanhChinh: data?.CoQuanHanhChinh,
98
+ TenCoQuanHanhChinh: data?.TenCoQuanHanhChinh,
99
+ PhanLoaiNguoiDung: data?.PhanLoaiNguoiDung,
100
+ ChucVu: data?.ChucVu,
101
+ TenChucVu: data?.TenChucVu,
102
+ DonViHanhChinh: data?.DonViHanhChinh,
103
+ TenDonViHanhChinh: data?.TenDonViHanhChinh,
104
+ Tinh: data?.Tinh,
105
+ TenTinh: data?.TenTinh,
106
+ Huyen: data?.Huyen,
107
+ TenHuyen: data?.TenHuyen,
108
+ PhuongXa: data?.PhuongXa,
109
+ TenPhuongXa: data?.TenPhuongXa,
110
+ isModule: data?.isModule,
73
111
  userName: data?.UserName,
74
- email: data?.Email,
112
+ UserName: data?.UserName,
113
+ UserId: data?.UserId,
75
114
  FullName: data?.FullName,
76
- Avatar: data?.Avatar,
115
+ email: data?.Email,
116
+ Email: data?.Email,
77
117
  Navigate: data?.Navigate,
78
- PhoneNumber: data?.PhoneNumber
118
+ FirstLogin: data?.FirstLogin,
119
+ ThoiGianMatKhauHopLe: data?.ThoiGianMatKhauHopLe
79
120
  };
80
-
81
121
  // Mã hóa và lưu user object vào localStorage
82
122
  const encryptedUserObj = encryptData(userObj);
83
123
  localStorage.setItem("subUser", encryptedUserObj);