mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 07:09:27 +08:00
分类组件显示当前列表对应分类数量
This commit is contained in:
@@ -44,6 +44,7 @@ export const CoursePage = () => {
|
||||
const [title, setTitle] = useState<string>("");
|
||||
const [dep_ids, setDepIds] = useState<any>([]);
|
||||
const [selLabel, setLabel] = useState<string>("全部视频");
|
||||
const [categoryCount, setCategoryCount] = useState<any>({});
|
||||
|
||||
const items: TabsProps["items"] = [
|
||||
{
|
||||
@@ -53,9 +54,14 @@ export const CoursePage = () => {
|
||||
<div className="float-left">
|
||||
<TreeCategory
|
||||
text={"课程"}
|
||||
categoryCount={categoryCount}
|
||||
onUpdate={(keys: any, title: any) => {
|
||||
setCategoryIds(keys);
|
||||
setLabel(title);
|
||||
if (typeof title == "string") {
|
||||
setLabel(title);
|
||||
} else {
|
||||
setLabel(title.props.children[0]);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -172,6 +178,7 @@ export const CoursePage = () => {
|
||||
.then((res: any) => {
|
||||
setTotal(res.data.total);
|
||||
setList(res.data.data);
|
||||
setCategoryCount(res.data.category_count);
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
|
||||
@@ -43,6 +43,7 @@ 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 removeResource = () => {
|
||||
@@ -87,6 +88,7 @@ export const ResourceImagesPage = () => {
|
||||
}
|
||||
setVisibleArr(arr);
|
||||
setHoverArr(arr);
|
||||
setCategoryCount(res.data.category_count);
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
@@ -151,14 +153,19 @@ export const ResourceImagesPage = () => {
|
||||
<div className="left-box">
|
||||
<TreeCategory
|
||||
text={"图片"}
|
||||
categoryCount={categoryCount}
|
||||
onUpdate={(keys: any, title: any) => {
|
||||
setCategoryIds(keys);
|
||||
setLabel(title);
|
||||
if (typeof title == "string") {
|
||||
setLabel(title);
|
||||
} else {
|
||||
setLabel(title.props.children[0]);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="right-box">
|
||||
<div className="playedu-main-title float-left mb-24">
|
||||
<div className="d-flex playedu-main-title float-left mb-24">
|
||||
图片 / {selLabel}
|
||||
</div>
|
||||
<Row gutter={16} style={{ marginBottom: 24 }}>
|
||||
|
||||
@@ -29,6 +29,7 @@ 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 columns: ColumnsType<DataType> = [
|
||||
// {
|
||||
@@ -127,6 +128,7 @@ export const ResourceVideosPage = () => {
|
||||
setVideoList(res.data.result.data);
|
||||
setVideoExtra(res.data.videos_extra);
|
||||
setAdminUsers(res.data.admin_users);
|
||||
setCategoryCount(res.data.category_count);
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
@@ -166,14 +168,19 @@ export const ResourceVideosPage = () => {
|
||||
<div className="left-box">
|
||||
<TreeCategory
|
||||
text={"视频"}
|
||||
categoryCount={categoryCount}
|
||||
onUpdate={(keys: any, title: any) => {
|
||||
setCategoryIds(keys);
|
||||
setLabel(title);
|
||||
if (typeof title == "string") {
|
||||
setLabel(title);
|
||||
} else {
|
||||
setLabel(title.props.children[0]);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="right-box">
|
||||
<div className="playedu-main-title float-left mb-24">
|
||||
<div className="d-flex playedu-main-title float-left mb-24">
|
||||
视频 / {selLabel}
|
||||
</div>
|
||||
<div className="float-left mb-24">
|
||||
|
||||
Reference in New Issue
Block a user