Merge pull request !17 from 白书科技/fix/1108
This commit is contained in:
白书科技 2023-11-13 03:57:27 +00:00 committed by Gitee
commit d6a0d2bfec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 68 additions and 8 deletions

View File

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; 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 type { ColumnsType } from "antd/es/table";
import { resource } from "../../api"; import { resource } from "../../api";
import styles from "./index.module.less"; import styles from "./index.module.less";
@ -47,6 +47,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
const [size, setSize] = useState(10); const [size, setSize] = useState(10);
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]); const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
const [title, setTitle] = useState("");
// 加载列表 // 加载列表
useEffect(() => { useEffect(() => {
@ -70,7 +71,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
size, size,
"", "",
"", "",
"", title,
"WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP", "WORD,EXCEL,PPT,PDF,TXT,RAR,ZIP",
categoryIds categoryIds
) )
@ -92,6 +93,7 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
const resetVideoList = () => { const resetVideoList = () => {
setPage(1); setPage(1);
setVideoList([]); setVideoList([]);
setTitle("");
setRefresh(!refresh); setRefresh(!refresh);
}; };
@ -178,14 +180,42 @@ export const UploadCoursewareSub = (props: PropsInterface) => {
</Col> </Col>
<Col span={17}> <Col span={17}>
<Row style={{ marginBottom: 24, paddingLeft: 10 }}> <Row style={{ marginBottom: 24, paddingLeft: 10 }}>
<Col span={24}> <div className="float-left j-b-flex">
<UploadCoursewareButton <UploadCoursewareButton
categoryIds={category_ids} categoryIds={category_ids}
onUpdate={() => { onUpdate={() => {
resetVideoList(); resetVideoList();
}} }}
></UploadCoursewareButton> ></UploadCoursewareButton>
</Col> <div className="d-flex">
<div className="d-flex mr-24">
<Typography.Text></Typography.Text>
<Input
value={title}
onChange={(e) => {
setTitle(e.target.value);
}}
allowClear
style={{ width: 160 }}
placeholder="请输入名称关键字"
/>
</div>
<div className="d-flex">
<Button className="mr-16" onClick={resetVideoList}>
</Button>
<Button
type="primary"
onClick={() => {
setPage(1);
setRefresh(!refresh);
}}
>
</Button>
</div>
</div>
</div>
</Row> </Row>
{init && ( {init && (
<div className="float-left text-center mt-30"> <div className="float-left text-center mt-30">

View File

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; 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 type { ColumnsType } from "antd/es/table";
import { resource } from "../../api"; import { resource } from "../../api";
import styles from "./index.module.less"; import styles from "./index.module.less";
@ -48,6 +48,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
const [size, setSize] = useState(10); const [size, setSize] = useState(10);
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]); const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
const [title, setTitle] = useState("");
// 加载列表 // 加载列表
useEffect(() => { useEffect(() => {
@ -66,7 +67,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
setLoading(true); setLoading(true);
let categoryIds = category_ids.join(","); let categoryIds = category_ids.join(",");
resource resource
.resourceList(page, size, "", "", "", "VIDEO", categoryIds) .resourceList(page, size, "", "", title, "VIDEO", categoryIds)
.then((res: any) => { .then((res: any) => {
setTotal(res.data.result.total); setTotal(res.data.result.total);
setVideoExtra(res.data.videos_extra); setVideoExtra(res.data.videos_extra);
@ -85,6 +86,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
const resetVideoList = () => { const resetVideoList = () => {
setPage(1); setPage(1);
setVideoList([]); setVideoList([]);
setTitle("");
setRefresh(!refresh); setRefresh(!refresh);
}; };
@ -170,14 +172,42 @@ export const UploadVideoSub = (props: PropsInterface) => {
</Col> </Col>
<Col span={17}> <Col span={17}>
<Row style={{ marginBottom: 24, paddingLeft: 10 }}> <Row style={{ marginBottom: 24, paddingLeft: 10 }}>
<Col span={24}> <div className="float-left j-b-flex">
<UploadVideoButton <UploadVideoButton
categoryIds={category_ids} categoryIds={category_ids}
onUpdate={() => { onUpdate={() => {
resetVideoList(); resetVideoList();
}} }}
></UploadVideoButton> ></UploadVideoButton>
</Col> <div className="d-flex">
<div className="d-flex mr-24">
<Typography.Text></Typography.Text>
<Input
value={title}
onChange={(e) => {
setTitle(e.target.value);
}}
allowClear
style={{ width: 160 }}
placeholder="请输入名称关键字"
/>
</div>
<div className="d-flex">
<Button className="mr-16" onClick={resetVideoList}>
</Button>
<Button
type="primary"
onClick={() => {
setPage(1);
setRefresh(!refresh);
}}
>
</Button>
</div>
</div>
</div>
</Row> </Row>
{init && ( {init && (
<div className="float-left text-center mt-30"> <div className="float-left text-center mt-30">