线上课列表渲染优化

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

@@ -11,8 +11,6 @@ interface Option {
interface PropInterface {
type: string;
text: string;
categoryCount: any;
resourceTotal: number;
onUpdate: (keys: any, title: any) => void;
}
@@ -37,7 +35,7 @@ export const TreeCategory = (props: PropInterface) => {
setTreeData(new_arr);
}
});
}, [props.categoryCount]);
}, []);
const checkArr = (categories: any[], id: number) => {
const arr = [];

View File

@@ -99,8 +99,6 @@ export const UploadImageButton = (props: PropsInterface) => {
<Col span={7}>
<TreeCategory
type="no-cate"
resourceTotal={0}
categoryCount={{}}
text={"图片"}
onUpdate={(keys: any) => setCategoryIds(keys)}
/>

View File

@@ -32,8 +32,6 @@ export const UploadVideoSub = (props: PropsInterface) => {
const [page, setPage] = useState(1);
const [size, setSize] = useState(10);
const [total, setTotal] = useState(0);
const [pureTotal, setPureTotal] = useState(0);
const [categoryCount, setCategoryCount] = useState<any>({});
const [plainOptions, setPlainOptions] = useState<any>([]);
const [checkedList, setCheckedList] = useState<CheckboxValueType[]>([]);
@@ -48,8 +46,6 @@ export const UploadVideoSub = (props: PropsInterface) => {
.then((res: any) => {
setTotal(res.data.result.total);
setVideoExtra(res.data.videos_extra);
setCategoryCount(res.data.category_count);
setPureTotal(res.data.pure_total);
setVideoList(res.data.result.data);
let data = res.data.result.data;
const arr = [];
@@ -150,8 +146,6 @@ export const UploadVideoSub = (props: PropsInterface) => {
<Col span={7}>
<TreeCategory
type="no-cate"
resourceTotal={pureTotal}
categoryCount={{ categoryCount }}
text={props.label}
onUpdate={(keys: any) => setCategoryIds(keys)}
/>