trithuc-mvc-react 1.5.8 → 1.5.9
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Table, TableBody, TableCell, TableContainer, TableRow, useMediaQuery, useTheme } from "@mui/material";
|
|
2
2
|
import TablePaginationCustom from "../table/TablePagination";
|
|
3
|
-
import { useMemo, useState } from "react";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
4
|
|
|
5
5
|
import { TableHead } from "./TableHead";
|
|
6
6
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
|
@@ -30,10 +30,11 @@ const DataTable = () => {
|
|
|
30
30
|
pageSize: rowsPerPage,
|
|
31
31
|
data: dataSearch
|
|
32
32
|
}),
|
|
33
|
-
keepPreviousData: true,
|
|
33
|
+
// keepPreviousData: true,
|
|
34
34
|
onSuccess: ({ PermissionModel, status }) => {
|
|
35
35
|
if (status) {
|
|
36
|
-
setPermission(PermissionModel);
|
|
36
|
+
// setPermission(PermissionModel);
|
|
37
|
+
console.log("LOAD LAI PermissionModel");
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
});
|
|
@@ -94,12 +95,18 @@ const DataTable = () => {
|
|
|
94
95
|
const { rows, total } = useMemo(() => {
|
|
95
96
|
let rows = data?.data ?? [];
|
|
96
97
|
let total = data?.total ?? 0;
|
|
98
|
+
|
|
97
99
|
return {
|
|
98
100
|
rows: rows,
|
|
99
101
|
total
|
|
100
102
|
};
|
|
101
103
|
}, [data]);
|
|
102
104
|
|
|
105
|
+
useEffect(()=>{
|
|
106
|
+
let PermissionModel = data?.PermissionModel;
|
|
107
|
+
PermissionModel&&setPermission(PermissionModel);
|
|
108
|
+
},[rows])
|
|
109
|
+
|
|
103
110
|
const handleChangePage = (event, newPage) => {
|
|
104
111
|
setPage(newPage);
|
|
105
112
|
};
|