mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 05:39:38 +08:00
线上课编辑优化
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -98,6 +98,7 @@ export const UploadImageButton = (props: PropsInterface) => {
|
||||
<Row gutter={16}>
|
||||
<Col span={4}>
|
||||
<TreeCategory
|
||||
type="no-cate"
|
||||
resourceTotal={0}
|
||||
categoryCount={{}}
|
||||
text={"图片"}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user