视频列表增加名称搜索

This commit is contained in:
unknown 2023-11-13 14:20:49 +08:00
parent e12c13e5cd
commit d9850260e9
2 changed files with 43 additions and 15 deletions

View File

@ -59,7 +59,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
{
title: "课时标题",
dataIndex: "title",
render: (title: string) => (
<>
<span>{title}</span>
@ -68,7 +67,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
},
{
title: "总时长",
width: 120,
dataIndex: "duration",
render: (duration: number) => (
<>
@ -78,7 +76,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
},
{
title: "已学习时长",
width: 120,
dataIndex: "finished_duration",
render: (_, record: any) => (
<>
@ -96,7 +93,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
},
{
title: "是否学完",
width: 100,
dataIndex: "is_finished",
render: (_, record: any) => (
<>
@ -112,7 +108,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
},
{
title: "开始时间",
width: 150,
dataIndex: "created_at",
render: (_, record: any) => (
<>
@ -126,7 +121,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
},
{
title: "学完时间",
width: 150,
dataIndex: "finished_at",
render: (_, record: any) => (
<>
@ -142,7 +136,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
title: "操作",
key: "action",
fixed: "right",
width: 70,
render: (_, record: any) => (
<>
{records && records[record.id] ? (
@ -222,7 +215,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
maskClosable={false}
footer={null}
>
<div className="w-100 d-flex mt-24">
<div className="mt-24">
<PerButton
type="primary"
text="重置学习记录"
@ -235,10 +228,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
disabled={null}
/>
</div>
<div
className="w-100 d-flex mt-24"
style={{ maxHeight: 800, overflowY: "auto" }}
>
<div className="mt-24" style={{ maxHeight: 800, overflowY: "auto" }}>
<Table
columns={column}
dataSource={list}

View File

@ -1,5 +1,14 @@
import { useEffect, useState } from "react";
import { Modal, Table, message, Space, Dropdown, Button } from "antd";
import {
Modal,
Table,
message,
Space,
Dropdown,
Typography,
Input,
Button,
} from "antd";
import type { MenuProps } from "antd";
import { resource } from "../../../api";
import { useLocation } from "react-router-dom";
@ -63,6 +72,7 @@ const ResourceVideosPage = () => {
const [multiConfig, setMultiConfig] = useState(false);
const [updateId, setUpdateId] = useState(0);
const [playUrl, setPlayUrl] = useState("");
const [title, setTitle] = useState("");
useEffect(() => {
setCateId(Number(result.get("cid")));
@ -231,7 +241,7 @@ const ResourceVideosPage = () => {
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);
setVideoList(res.data.result.data);
@ -250,6 +260,7 @@ const ResourceVideosPage = () => {
setSize(10);
setVideoList([]);
setSelectedRowKeys([]);
setTitle("");
setRefresh(!refresh);
};
@ -328,7 +339,34 @@ const ResourceVideosPage = () => {
</Button>
</div>
<div className="d-flex"></div>
<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>
<div className="float-left">
{multiConfig ? (