线上课列表渲染优化

This commit is contained in:
禺狨
2023-03-21 18:32:28 +08:00
parent 7d665085a8
commit f824396b05
6 changed files with 45 additions and 39 deletions

View File

@@ -43,8 +43,6 @@ export const ResourceImagesPage = () => {
const [hoverArr, setHoverArr] = useState<any>([]);
const [selLabel, setLabel] = useState<string>("全部图片");
const [loading, setLoading] = useState<boolean>(false);
const [categoryCount, setCategoryCount] = useState<any>({});
const [pureTotal, setPureTotal] = useState(0);
// 删除图片
const removeResource = () => {
@@ -89,8 +87,6 @@ export const ResourceImagesPage = () => {
}
setVisibleArr(arr);
setHoverArr(arr);
setCategoryCount(res.data.category_count);
setPureTotal(res.data.pure_total);
setLoading(false);
})
.catch((err: any) => {
@@ -156,8 +152,6 @@ export const ResourceImagesPage = () => {
<TreeCategory
type="no-cate"
text={"图片"}
categoryCount={categoryCount}
resourceTotal={pureTotal}
onUpdate={(keys: any, title: any) => {
setCategoryIds(keys);
if (typeof title == "string") {

View File

@@ -29,8 +29,6 @@ export const ResourceVideosPage = () => {
const [loading, setLoading] = useState<boolean>(true);
const [category_ids, setCategoryIds] = useState<any>([]);
const [selLabel, setLabel] = useState<string>("全部视频");
const [categoryCount, setCategoryCount] = useState<any>({});
const [pureTotal, setPureTotal] = useState(0);
const columns: ColumnsType<DataType> = [
// {
@@ -129,8 +127,6 @@ export const ResourceVideosPage = () => {
setVideoList(res.data.result.data);
setVideoExtra(res.data.videos_extra);
setAdminUsers(res.data.admin_users);
setCategoryCount(res.data.category_count);
setPureTotal(res.data.pure_total);
setLoading(false);
})
.catch((err: any) => {
@@ -170,9 +166,7 @@ export const ResourceVideosPage = () => {
<div className="left-box">
<TreeCategory
type="no-cate"
resourceTotal={pureTotal}
text={"视频"}
categoryCount={categoryCount}
onUpdate={(keys: any, title: any) => {
setCategoryIds(keys);
if (typeof title == "string") {