From 80139644411a9a7d3ee20b2db49af2f4009f331b Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Wed, 8 Nov 2023 16:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8D=E7=A7=B0=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upload-courseware-sub/index.tsx | 38 +++++++++++++++++-- src/compenents/upload-video-sub/index.tsx | 38 +++++++++++++++++-- 2 files changed, 68 insertions(+), 8 deletions(-) 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 && (