diff --git a/src/components/video/player.tsx b/src/components/video/player.tsx index d76fc51..6a9d1f5 100644 --- a/src/components/video/player.tsx +++ b/src/components/video/player.tsx @@ -24,6 +24,7 @@ type Props = { onChange?: (state: State) => void; onProgress?: (current:number,duration:number) => void; muted?: boolean; + autoPlay?: boolean; } export type PlayerInstance = { play: (url: string, currentTime: number) => void; @@ -79,7 +80,7 @@ export const Player = React.forwardRef((props, ref) => { controls: props.showControls, // muted:props.muted, poster: props.poster, - autoplay: true, + autoplay: typeof(props.autoPlay) != 'undefined' ? props.autoPlay : true, licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1328581896_1/v_cube.license' } ) diff --git a/src/pages/library/components/search-form.tsx b/src/pages/library/components/search-form.tsx index 0491ff2..cd4b560 100644 --- a/src/pages/library/components/search-form.tsx +++ b/src/pages/library/components/search-form.tsx @@ -1,49 +1,59 @@ import {Button, Form, Input, Select, Space} from "antd"; import {useSetState} from "ahooks"; -import {PlayCircleOutlined} from "@ant-design/icons"; +import {PlayCircleOutlined, SearchOutlined} from "@ant-design/icons"; import {SearchListTimes} from "@/pages/news/components/news-source.ts"; +import React from "react"; +import TimeSelect from "@/components/form/time-select.tsx"; type Props = { onSearch?: (params: VideoSearchParams) => void; onBtnStartClick?: () => Promise; - loading?:boolean; + loading?: boolean; } -export default function SearchForm({onSearch, onBtnStartClick,loading}: Props) { + +export default function SearchForm({onSearch, onBtnStartClick, loading}: Props) { const [state, setState] = useSetState<{ pushing?: boolean; - }>({}) - const onFinish = (values) => { + time_flag: number; + title?: string; + }>({ + time_flag:0 + }) + + const onFinish = (params: Partial) => { onSearch?.({ - ...values, - pagination: {page: 1, limit: 10} + time_flag: params.time_flag, + title: params.title, + pagination: {page: 1, limit: 12} }) - //console.log(values) } - return (
+ const handleTimeFilter = (time_flag: number) => { + setState({time_flag}) + onFinish({ + title:state.title,time_flag + }) + } + + return (
- className={""} layout="inline" onFinish={onFinish} initialValues={{title:'',time_flag:0}}> - - - - - } + onChange={e=>setState({title: e.target.value})} + onPressEnter={()=>onFinish(state)} + onBlur={()=>onFinish(state)} + allowClear + placeholder={'请输入视频标题关键字进行信息'} + /> + +