diff --git a/src/compenents/tree-category/index.tsx b/src/compenents/tree-category/index.tsx index 7c93467..48f4a40 100644 --- a/src/compenents/tree-category/index.tsx +++ b/src/compenents/tree-category/index.tsx @@ -1,4 +1,4 @@ -import { Button, Input, message, Tree } from "antd"; +import { Tree } from "antd"; import { useState, useEffect } from "react"; import { resourceCategory } from "../../api/index"; @@ -11,6 +11,7 @@ interface Option { interface PropInterface { text: string; categoryCount: any; + resourceTotal: number; onUpdate: (keys: any, title: any) => void; } @@ -96,9 +97,7 @@ export const TreeCategory = (props: PropInterface) => { }} > 全部{props.text} - {JSON.stringify(props.categoryCount) !== "{}" && ( - ({props.categoryCount["0"]}) - )} + ({props.resourceTotal}) { setCategoryIds(keys)} diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index 751c92a..ee57b50 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -43,7 +43,11 @@ export const CoursePage = () => { const [dep_ids, setDepIds] = useState([]); const [selLabel, setLabel] = useState("全部课程"); const [categoryCount, setCategoryCount] = useState({}); +<<<<<<< HEAD const [tabKey, setTabKey] = useState(1); +======= + const [pureTotal, setPureTotal] = useState(0); +>>>>>>> fc90ddf2cc1481f6aa7fb80b7d2746f7bbc94fcd const items: TabsProps["items"] = [ { @@ -52,6 +56,7 @@ export const CoursePage = () => { children: (
{ @@ -178,6 +183,7 @@ export const CoursePage = () => { setTotal(res.data.total); setList(res.data.data); setCategoryCount(res.data.category_count); + setPureTotal(res.data.pure_total); setLoading(false); }) .catch((err: any) => { diff --git a/src/pages/resource/images/index.tsx b/src/pages/resource/images/index.tsx index 90dbbc1..47b5668 100644 --- a/src/pages/resource/images/index.tsx +++ b/src/pages/resource/images/index.tsx @@ -44,6 +44,7 @@ export const ResourceImagesPage = () => { const [selLabel, setLabel] = useState("全部图片"); const [loading, setLoading] = useState(false); const [categoryCount, setCategoryCount] = useState({}); + const [pureTotal, setPureTotal] = useState(0); // 删除图片 const removeResource = () => { @@ -89,6 +90,7 @@ export const ResourceImagesPage = () => { setVisibleArr(arr); setHoverArr(arr); setCategoryCount(res.data.category_count); + setPureTotal(res.data.pure_total); setLoading(false); }) .catch((err: any) => { @@ -154,6 +156,7 @@ export const ResourceImagesPage = () => { { setCategoryIds(keys); if (typeof title == "string") { diff --git a/src/pages/resource/videos/index.tsx b/src/pages/resource/videos/index.tsx index a2667c1..3e52496 100644 --- a/src/pages/resource/videos/index.tsx +++ b/src/pages/resource/videos/index.tsx @@ -30,6 +30,7 @@ export const ResourceVideosPage = () => { const [category_ids, setCategoryIds] = useState([]); const [selLabel, setLabel] = useState("全部视频"); const [categoryCount, setCategoryCount] = useState({}); + const [pureTotal, setPureTotal] = useState(0); const columns: ColumnsType = [ // { @@ -129,6 +130,7 @@ export const ResourceVideosPage = () => { 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) => { @@ -167,6 +169,7 @@ export const ResourceVideosPage = () => {
{