From 629973babe51df32a3433c4082faa06792bc0b9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com>
Date: Tue, 21 Mar 2023 12:12:36 +0800
Subject: [PATCH] =?UTF-8?q?tree=E7=BB=84=E4=BB=B6=E5=88=9D=E6=AD=A5?=
=?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/compenents/tree-category/index.tsx | 32 ++++++++++-----------
src/index.less | 39 +++++++++++++++++---------
2 files changed, 41 insertions(+), 30 deletions(-)
diff --git a/src/compenents/tree-category/index.tsx b/src/compenents/tree-category/index.tsx
index d912b37..a4bb1a3 100644
--- a/src/compenents/tree-category/index.tsx
+++ b/src/compenents/tree-category/index.tsx
@@ -31,12 +31,10 @@ export const TreeCategory = (props: PropInterface) => {
new_arr.unshift({
key: 0,
title: (
-
- 未分类
-
- ({props.categoryCount[0] || 0})
-
-
+ <>
+ 未分类
+ {props.categoryCount[0] || 0}
+ >
),
});
}
@@ -51,12 +49,12 @@ export const TreeCategory = (props: PropInterface) => {
for (let i = 0; i < categories[id].length; i++) {
if (!categories[categories[id][i].id]) {
let name = (
-
- {categories[id][i].name}
+ <>
+ {categories[id][i].name}
- ({props.categoryCount[categories[id][i].id] || 0})
+ {props.categoryCount[categories[id][i].id] || 0}
-
+ >
);
arr.push({
title: name,
@@ -64,12 +62,12 @@ export const TreeCategory = (props: PropInterface) => {
});
} else {
let name = (
-
- {categories[id][i].name}
+ <>
+ {categories[id][i].name}
- ({props.categoryCount[categories[id][i].id] || 0})
+ {props.categoryCount[categories[id][i].id] || 0}
-
+ >
);
const new_arr: Option[] = checkArr(categories, categories[id][i].id);
arr.push({
@@ -112,8 +110,10 @@ export const TreeCategory = (props: PropInterface) => {
onSelect([], "");
}}
>
- 全部{props.text}
- ({props.resourceTotal})
+
+ 全部{props.text}
+ {props.resourceTotal}
+
.ant-btn-default:hover {
color: #ff4d4f !important;
@@ -504,7 +498,24 @@ textarea.ant-input {
}
.tree-num {
+ width: auto;
+ display: block;
color: rgba(0, 0, 0, 0.45);
+ margin-right: 4px;
+}
+
+.tree-num-total {
+ width: auto;
+ display: block;
+ color: rgba(0, 0, 0, 0.45);
+ margin-right: 8px;
+}
+
+.tree-title-elli {
+ max-width:100px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
}
.ant-tabs {