资源视频列表

This commit is contained in:
禺狨
2023-03-09 10:43:14 +08:00
parent 64b6f7a345
commit c7ade74773
11 changed files with 231 additions and 10 deletions

View File

@@ -0,0 +1,32 @@
import { useEffect, useState } from "react";
interface PropInterface {
duration: number;
}
export const DurationText = (props: PropInterface) => {
const [hour, setHour] = useState(0);
const [minute, setMinute] = useState(0);
const [second, setSecond] = useState(0);
const duration = props.duration;
useEffect(() => {
let h = Math.trunc(duration / 3600);
let m = Math.trunc((duration % 3600) / 60);
let s = Math.trunc((duration % 3600) % 60);
setHour(h);
setMinute(m);
setSecond(s);
}, []);
return (
<>
<span>
{hour === 0 ? null : hour + ":"}
{minute >= 10 ? minute : "0" + minute}:
{second >= 10 ? second : "0" + second}
</span>
</>
);
};

View File

@@ -5,4 +5,5 @@ export * from "./upload-image-button";
export * from "./tree-department";
export * from "./back-bar";
export * from "./permission-button";
export * from "./tree-category";
export * from "./tree-category";
export * from "./duration-text";

View File

@@ -103,7 +103,7 @@ export const UploadImageButton = (props: PropsInterface) => {
<Row style={{ marginBottom: 24 }}>
<Col span={24}>
<UploadImageSub
categoryIds={[]}
categoryIds={category_ids}
onUpdate={() => {
resetImageList();
}}