Просмотр исходного кода

update SearchCriteria save

CR013B1
Alex Cheung 2 месяцев назад
Родитель
Сommit
664d9d49a7
2 измененных файлов: 15 добавлений и 2 удалений
  1. +11
    -0
      src/auth/utils.js
  2. +4
    -2
      src/components/FiDataGrid.js

+ 11
- 0
src/auth/utils.js Просмотреть файл

@@ -144,4 +144,15 @@ export const getSearchCriteria = (path) =>{
return ""
}
}
}

export const checkSearchCriteriaPath = (path) =>{
if(!path.startsWith("/application")
|| path === "/application/search"){
if(!path.startsWith("/user/")){
if(!path.startsWith("/publicNotice/")){
return true
}
}
}
}

+ 4
- 2
src/components/FiDataGrid.js Просмотреть файл

@@ -6,7 +6,7 @@ import {
import * as HttpUtils from "utils/HttpUtils";
import { FormattedMessage, useIntl } from "react-intl";
import { TablePagination, Typography } from '@mui/material';
import { getSearchCriteria } from "auth/utils";
import { getSearchCriteria, checkSearchCriteriaPath } from "auth/utils";

// ==============================|| EVENT TABLE ||============================== //

@@ -147,7 +147,9 @@ export function FiDataGrid({ rows, columns, sx, autoHeight,
if (_doLoad.params == null) _doLoad.params = {};
_doLoad.params.start = page * pageSize;
_doLoad.params.limit = pageSize;
localStorage.setItem('searchCriteria', JSON.stringify({path:window.location.pathname,data:_doLoad.params}))
if(checkSearchCriteriaPath(window.location.pathname)){
localStorage.setItem('searchCriteria', JSON.stringify({path:window.location.pathname,data:_doLoad.params}))
}
HttpUtils.get({
url: _doLoad.url,


Загрузка…
Отмена
Сохранить