mirror of
https://github.com/PlayEdu/backend
synced 2025-12-30 05:03:34 +08:00
数据结构添加interface
This commit is contained in:
@@ -9,11 +9,9 @@ import {
|
||||
Select,
|
||||
Button,
|
||||
} from "antd";
|
||||
import type { MenuProps } from "antd";
|
||||
import { resource } from "../../../api";
|
||||
// import styles from "./index.module.less";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { DownOutlined, ExclamationCircleFilled } from "@ant-design/icons";
|
||||
import { ExclamationCircleFilled } from "@ant-design/icons";
|
||||
import type { ColumnsType } from "antd/es/table";
|
||||
import { dateFormat } from "../../../utils/index";
|
||||
import { TreeCategory, UploadCoursewareButton } from "../../../compenents";
|
||||
@@ -22,34 +20,45 @@ import { CoursewareUpdateDialog } from "./compenents/update-dialog";
|
||||
const { confirm } = Modal;
|
||||
|
||||
interface DataType {
|
||||
admin_id: number;
|
||||
created_at: string;
|
||||
disk: string;
|
||||
extension: string;
|
||||
file_id: string;
|
||||
id: React.Key;
|
||||
name: string;
|
||||
created_at: string;
|
||||
parent_id: number;
|
||||
path: string;
|
||||
size: number;
|
||||
type: string;
|
||||
number: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
type AdminUsersModel = {
|
||||
[key: number]: string;
|
||||
};
|
||||
|
||||
const ResourceCoursewarePage = () => {
|
||||
const result = new URLSearchParams(useLocation().search);
|
||||
const [list, setList] = useState<any>([]);
|
||||
const [adminUsers, setAdminUsers] = useState<any>({});
|
||||
const [existingTypes, setExistingTypes] = useState<any>([]);
|
||||
const [list, setList] = useState<DataType[]>([]);
|
||||
const [adminUsers, setAdminUsers] = useState<AdminUsersModel>({});
|
||||
const [existingTypes, setExistingTypes] = useState<string[]>([]);
|
||||
const [refresh, setRefresh] = useState(false);
|
||||
const [page, setPage] = useState(1);
|
||||
const [size, setSize] = useState(10);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [category_ids, setCategoryIds] = useState<any>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [category_ids, setCategoryIds] = useState<number[]>([]);
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
|
||||
const [type, setType] = useState("WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP");
|
||||
const [title, setTitle] = useState<string>("");
|
||||
const [multiConfig, setMultiConfig] = useState<boolean>(false);
|
||||
const [title, setTitle] = useState("");
|
||||
const [multiConfig, setMultiConfig] = useState(false);
|
||||
const [selLabel, setLabel] = useState<string>(
|
||||
result.get("label") ? String(result.get("label")) : "全部课件"
|
||||
);
|
||||
const [cateId, setCateId] = useState(Number(result.get("cid")));
|
||||
const [updateId, setUpdateId] = useState(0);
|
||||
const [updateVisible, setUpdateVisible] = useState<boolean>(false);
|
||||
const [updateVisible, setUpdateVisible] = useState(false);
|
||||
const types = [
|
||||
{ label: "全部", value: "WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP" },
|
||||
{ label: "WORD", value: "WORD" },
|
||||
|
||||
Reference in New Issue
Block a user