|
@@ -3,22 +3,22 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
import { debounce } from "lodash";
|
|
|
import { DageTableActions } from "@dage/pc-components";
|
|
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
|
|
-import { LEVEL_TYPE } from "./constants";
|
|
|
+import { CATEGORY_TYPE } from "./constants";
|
|
|
import { collectionApi } from "@/api";
|
|
|
|
|
|
-const ALL_LEVEL_TYPE = [
|
|
|
+const ALL_CATEGORY_TYPE = [
|
|
|
{
|
|
|
label: "全部",
|
|
|
value: "",
|
|
|
},
|
|
|
- ...LEVEL_TYPE,
|
|
|
+ ...CATEGORY_TYPE,
|
|
|
];
|
|
|
|
|
|
const DEFAULT_PARAMS = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
|
searchKey: "",
|
|
|
- dictLevel: ALL_LEVEL_TYPE[0].value,
|
|
|
+ dictType: ALL_CATEGORY_TYPE[0].value,
|
|
|
};
|
|
|
|
|
|
export default function CollectionPage() {
|
|
@@ -30,7 +30,7 @@ export default function CollectionPage() {
|
|
|
const [params, setParams] = useState({
|
|
|
...DEFAULT_PARAMS,
|
|
|
searchKey: searchParams.get("searchKey") || "",
|
|
|
- dictLevel: searchParams.get("dictLevel") || ALL_LEVEL_TYPE[0].value,
|
|
|
+ dictType: searchParams.get("dictType") || ALL_CATEGORY_TYPE[0].value,
|
|
|
});
|
|
|
const [total, setTotal] = useState(0);
|
|
|
|
|
@@ -110,9 +110,9 @@ export default function CollectionPage() {
|
|
|
useEffect(() => {
|
|
|
setSearchParams({
|
|
|
searchKey: params.searchKey,
|
|
|
- dictLevel: params.dictLevel,
|
|
|
+ dictType: params.dictType,
|
|
|
});
|
|
|
- }, [params.searchKey, params.dictLevel, setSearchParams]);
|
|
|
+ }, [params.searchKey, params.dictType, setSearchParams]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
getList();
|
|
@@ -151,8 +151,8 @@ export default function CollectionPage() {
|
|
|
<Form.Item label="搜索项" name="searchKey">
|
|
|
<Input placeholder="请输入" maxLength={10} showCount allowClear />
|
|
|
</Form.Item>
|
|
|
- <Form.Item label="级别" name="dictLevel">
|
|
|
- <Select style={{ width: 220 }} options={ALL_LEVEL_TYPE} />
|
|
|
+ <Form.Item label="类别" name="dictType">
|
|
|
+ <Select style={{ width: 220 }} options={ALL_CATEGORY_TYPE} />
|
|
|
</Form.Item>
|
|
|
<Form.Item>
|
|
|
<Button type="primary" onClick={() => navigate("/collection/create")}>
|