线上课编辑优化

This commit is contained in:
禺狨
2023-03-17 16:50:06 +08:00
parent 34246017da
commit 6eb8cb5c60
10 changed files with 808 additions and 16 deletions

View File

@@ -9,9 +9,11 @@ interface Option {
}
interface PropInterface {
type: string;
text: string;
categoryCount: any;
resourceTotal: number;
onUpdate: (keys: any, title: any) => void;
}
@@ -25,15 +27,20 @@ export const TreeCategory = (props: PropInterface) => {
const categories = res.data.categories;
if (JSON.stringify(categories) !== "{}") {
const new_arr: Option[] = checkArr(categories, 0);
new_arr.unshift({
key: 0,
title: (
<div className="d-flex">
<span className="tree-num">({props.categoryCount[0] || 0})</span>
</div>
),
});
if (props.type === "no-cate") {
new_arr.unshift({
key: 0,
title: (
<div className="d-flex">
<span className="tree-num">
({props.categoryCount[0] || 0})
</span>
</div>
),
});
}
setTreeData(new_arr);
}
});

View File

@@ -98,6 +98,7 @@ export const UploadImageButton = (props: PropsInterface) => {
<Row gutter={16}>
<Col span={4}>
<TreeCategory
type="no-cate"
resourceTotal={0}
categoryCount={{}}
text={"图片"}

View File

@@ -149,6 +149,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
<Row style={{ width: 752, minHeight: 520 }}>
<Col span={7}>
<TreeCategory
type="no-cate"
resourceTotal={pureTotal}
categoryCount={{ categoryCount }}
text={props.label}