diff --git a/src/compenents/left-menu/index.tsx b/src/compenents/left-menu/index.tsx index 89d4ba5..4bd2973 100644 --- a/src/compenents/left-menu/index.tsx +++ b/src/compenents/left-menu/index.tsx @@ -61,8 +61,8 @@ const items = [ , [ getItem("管理人员", "/system/administrator", null, null, null), - getItem("系统配置", "/system/index", null, null, null), getItem("角色配置", "/system/adminroles", null, null, null), + getItem("系统配置", "/system/index", null, null, null), ], null ), diff --git a/src/compenents/tree-category/index.tsx b/src/compenents/tree-category/index.tsx index a79b9cc..fdc9209 100644 --- a/src/compenents/tree-category/index.tsx +++ b/src/compenents/tree-category/index.tsx @@ -10,7 +10,7 @@ interface Option { interface PropInterface { text: string; - onUpdate: (keys: any) => void; + onUpdate: (keys: any, title: any) => void; } export const TreeCategory = (props: PropInterface) => { @@ -59,7 +59,11 @@ export const TreeCategory = (props: PropInterface) => { }; const onSelect = (selectedKeys: any, info: any) => { - props.onUpdate(selectedKeys); + let label = "全部" + props.text; + if (info) { + label = info.node.title; + } + props.onUpdate(selectedKeys, label); setSelectKey(selectedKeys); }; @@ -75,7 +79,7 @@ export const TreeCategory = (props: PropInterface) => { > 全部{props.text} - + ); }; diff --git a/src/compenents/tree-department/index.tsx b/src/compenents/tree-department/index.tsx index 4bd1e45..66600bd 100644 --- a/src/compenents/tree-department/index.tsx +++ b/src/compenents/tree-department/index.tsx @@ -10,7 +10,7 @@ interface Option { interface PropInterface { text: string; - onUpdate: (keys: any) => void; + onUpdate: (keys: any, title: any) => void; } export const TreeDepartment = (props: PropInterface) => { @@ -60,7 +60,11 @@ export const TreeDepartment = (props: PropInterface) => { }; const onSelect = (selectedKeys: any, info: any) => { - props.onUpdate(selectedKeys); + let label = "全部" + props.text; + if (info) { + label = info.node.title; + } + props.onUpdate(selectedKeys, label); setSelectKey(selectedKeys); }; diff --git a/src/pages/resource/images/index.tsx b/src/pages/resource/images/index.tsx index 205d28f..1fa5db3 100644 --- a/src/pages/resource/images/index.tsx +++ b/src/pages/resource/images/index.tsx @@ -40,6 +40,7 @@ export const ResourceImagesPage = () => { const [selectKey, setSelectKey] = useState([]); const [visibleArr, setVisibleArr] = useState([]); const [hoverArr, setHoverArr] = useState([]); + const [selLabel, setLabel] = useState("全部图片"); // 删除图片 const removeResource = () => { @@ -142,12 +143,15 @@ export const ResourceImagesPage = () => {
setCategoryIds(keys)} + onUpdate={(keys: any, title: any) => { + setCategoryIds(keys); + setLabel(title); + }} />
- 图片 / 全部图片 + 图片 / {selLabel}
@@ -164,18 +168,22 @@ export const ResourceImagesPage = () => { 取消选择 )} - - removeResource()} - /> + {imageList.length !== 0 && ( + <> + + removeResource()} + /> + + )}
diff --git a/src/pages/resource/videos/index.tsx b/src/pages/resource/videos/index.tsx index 8ef3de5..9eabaca 100644 --- a/src/pages/resource/videos/index.tsx +++ b/src/pages/resource/videos/index.tsx @@ -28,6 +28,7 @@ export const ResourceVideosPage = () => { const [total, setTotal] = useState(0); const [loading, setLoading] = useState(true); const [category_ids, setCategoryIds] = useState([]); + const [selLabel, setLabel] = useState("全部视频"); const columns: ColumnsType = [ // { @@ -165,12 +166,15 @@ export const ResourceVideosPage = () => {
setCategoryIds(keys)} + onUpdate={(keys: any, title: any) => { + setCategoryIds(keys); + setLabel(title); + }} />
- 视频 / 后端课程 + 视频 / {selLabel}