diff --git a/src/compenents/upload-courseware-sub/index.tsx b/src/compenents/upload-courseware-sub/index.tsx index 9866ca2..c2f95e6 100644 --- a/src/compenents/upload-courseware-sub/index.tsx +++ b/src/compenents/upload-courseware-sub/index.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { Row, Col, Empty, Table, Spin } from "antd"; +import { Row, Col, Empty, Table, Spin, Typography, Input, Button } from "antd"; import type { ColumnsType } from "antd/es/table"; import { resource } from "../../api"; import styles from "./index.module.less"; @@ -47,6 +47,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => { const [size, setSize] = useState(10); const [total, setTotal] = useState(0); const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [title, setTitle] = useState(""); // 加载列表 useEffect(() => { @@ -70,7 +71,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => { size, "", "", - "", + title, "WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP", categoryIds ) @@ -92,6 +93,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => { const resetVideoList = () => { setPage(1); setVideoList([]); + setTitle(""); setRefresh(!refresh); }; @@ -178,14 +180,42 @@ export const UploadCoursewareSub = (props: PropsInterface) => { - +
{ resetVideoList(); }} > - +
+
+ 名称: + { + setTitle(e.target.value); + }} + allowClear + style={{ width: 160 }} + placeholder="请输入名称关键字" + /> +
+
+ + +
+
+
{init && (
diff --git a/src/compenents/upload-video-sub/index.tsx b/src/compenents/upload-video-sub/index.tsx index 3e8857f..99823fa 100644 --- a/src/compenents/upload-video-sub/index.tsx +++ b/src/compenents/upload-video-sub/index.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { Row, Col, Empty, Table, Spin } from "antd"; +import { Row, Col, Empty, Table, Spin, Typography, Input, Button } from "antd"; import type { ColumnsType } from "antd/es/table"; import { resource } from "../../api"; import styles from "./index.module.less"; @@ -48,6 +48,7 @@ export const UploadVideoSub = (props: PropsInterface) => { const [size, setSize] = useState(10); const [total, setTotal] = useState(0); const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [title, setTitle] = useState(""); // 加载列表 useEffect(() => { @@ -66,7 +67,7 @@ export const UploadVideoSub = (props: PropsInterface) => { setLoading(true); let categoryIds = category_ids.join(","); resource - .resourceList(page, size, "", "", "", "VIDEO", categoryIds) + .resourceList(page, size, "", "", title, "VIDEO", categoryIds) .then((res: any) => { setTotal(res.data.result.total); setVideoExtra(res.data.videos_extra); @@ -85,6 +86,7 @@ export const UploadVideoSub = (props: PropsInterface) => { const resetVideoList = () => { setPage(1); setVideoList([]); + setTitle(""); setRefresh(!refresh); }; @@ -170,14 +172,42 @@ export const UploadVideoSub = (props: PropsInterface) => { - +
{ resetVideoList(); }} > - +
+
+ 名称: + { + setTitle(e.target.value); + }} + allowClear + style={{ width: 160 }} + placeholder="请输入名称关键字" + /> +
+
+ + +
+
+
{init && (