优化UseTable、HiddenInfo
parent
d0c282b57d
commit
ee48eba2fc
|
|
@ -126,8 +126,8 @@ function HiddenInfo(props) {
|
||||||
column={1}
|
column={1}
|
||||||
labelStyle={{ width: 200 }}
|
labelStyle={{ width: 200 }}
|
||||||
items={[
|
items={[
|
||||||
{ label: "整改部门", children: info.hiddenUserPresetsCO.deptName },
|
{ label: "整改部门", children: info.hiddenUserPresetsCO.rectifyDeptName },
|
||||||
{ label: "整改人", children: info.hiddenUserPresetsCO.userName },
|
{ label: "整改人", children: info.hiddenUserPresetsCO.rectifyUserName },
|
||||||
...(info.rectificationType === 2
|
...(info.rectificationType === 2
|
||||||
? [
|
? [
|
||||||
{ label: "整改期限", children: dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD") },
|
{ label: "整改期限", children: dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD") },
|
||||||
|
|
@ -135,8 +135,8 @@ function HiddenInfo(props) {
|
||||||
: []),
|
: []),
|
||||||
...(info.rectificationType === 1
|
...(info.rectificationType === 1
|
||||||
? [
|
? [
|
||||||
{ label: "验收部门", children: info.hiddenUserPresetsCO.deptName },
|
{ label: "验收部门", children: info.hiddenUserPresetsCO.checkDeptName },
|
||||||
{ label: "验收人", children: info.hiddenUserPresetsCO.userName },
|
{ label: "验收人", children: info.hiddenUserPresetsCO.checkUserName },
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
]}
|
]}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||||
import { useAntdTable } from "ahooks";
|
import { useAntdTable } from "ahooks";
|
||||||
|
import useGetUrlQuery from "../useGetUrlQuery";
|
||||||
|
|
||||||
const { query } = tools.router;
|
const { query } = tools.router;
|
||||||
|
|
||||||
|
|
@ -75,9 +76,10 @@ function setQuery(searchForm, pagination) {
|
||||||
* 从 URL 中获取查询参数
|
* 从 URL 中获取查询参数
|
||||||
*/
|
*/
|
||||||
function getQuery(keysStr, valuesStr) {
|
function getQuery(keysStr, valuesStr) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
// 将键值字符串分割为数组
|
// 将键值字符串分割为数组
|
||||||
const keys = keysStr ? keysStr.split(",") : [];
|
const keys = query[keysStr] ? query[keysStr].split(",") : [];
|
||||||
const values = valuesStr ? valuesStr.split(",") : [];
|
const values = query[valuesStr] ? query[valuesStr].split(",") : [];
|
||||||
|
|
||||||
// 构建结果对象
|
// 构建结果对象
|
||||||
const resultMap = {};
|
const resultMap = {};
|
||||||
|
|
@ -119,8 +121,8 @@ function useTable(service, options) {
|
||||||
} = restOptions;
|
} = restOptions;
|
||||||
|
|
||||||
// 获取存储的查询条件
|
// 获取存储的查询条件
|
||||||
const storageQueryCriteriaSearchForm = useStorageQueryCriteria ? getQuery(query.searchFormKeys, query.searchFormValues) : {};
|
const storageQueryCriteriaSearchForm = useStorageQueryCriteria ? getQuery("searchFormKeys", "searchFormValues") : {};
|
||||||
const storageQueryCriteriaPagination = useStorageQueryCriteria && usePagination ? getQuery(query.paginationKeys, query.paginationValues) : {};
|
const storageQueryCriteriaPagination = useStorageQueryCriteria && usePagination ? getQuery("paginationKeys", "paginationValues") : {};
|
||||||
|
|
||||||
// 确定实际使用的搜索表单和分页参数
|
// 确定实际使用的搜索表单和分页参数
|
||||||
const actualSearchForm = Object.keys(storageQueryCriteriaSearchForm).length > 0 ? storageQueryCriteriaSearchForm : {};
|
const actualSearchForm = Object.keys(storageQueryCriteriaSearchForm).length > 0 ? storageQueryCriteriaSearchForm : {};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue