tree组件初步优化

This commit is contained in:
禺狨 2023-03-21 14:38:50 +08:00
parent 0f5e7fd9c1
commit 092cf2f69e
3 changed files with 7 additions and 20 deletions

View File

@ -30,12 +30,7 @@ export const TreeCategory = (props: PropInterface) => {
if (props.type === "no-cate") { if (props.type === "no-cate") {
new_arr.unshift({ new_arr.unshift({
key: 0, key: 0,
title: ( title: "未分类",
<>
<span></span>
<span className="tree-num">{props.categoryCount[0] || 0}</span>
</>
),
}); });
} }
@ -51,9 +46,6 @@ export const TreeCategory = (props: PropInterface) => {
let name = ( let name = (
<> <>
<span className="tree-title-elli">{categories[id][i].name}</span> <span className="tree-title-elli">{categories[id][i].name}</span>
<span className="tree-num">
{props.categoryCount[categories[id][i].id] || 0}
</span>
</> </>
); );
arr.push({ arr.push({
@ -64,9 +56,6 @@ export const TreeCategory = (props: PropInterface) => {
let name = ( let name = (
<> <>
<span className="tree-title-elli">{categories[id][i].name}</span> <span className="tree-title-elli">{categories[id][i].name}</span>
<span className="tree-num">
{props.categoryCount[categories[id][i].id] || 0}
</span>
</> </>
); );
const new_arr: Option[] = checkArr(categories, categories[id][i].id); const new_arr: Option[] = checkArr(categories, categories[id][i].id);
@ -112,7 +101,6 @@ export const TreeCategory = (props: PropInterface) => {
> >
<div className="j-b-flex"> <div className="j-b-flex">
<span>{props.text}</span> <span>{props.text}</span>
<span className="tree-num-total">{props.resourceTotal}</span>
</div> </div>
</div> </div>
<Tree <Tree

View File

@ -116,13 +116,12 @@ export const UploadImageButton = (props: PropsInterface) => {
></UploadImageSub> ></UploadImageSub>
</Col> </Col>
</Row> </Row>
<div className="image-list-box">
{imageList.length === 0 && ( {imageList.length === 0 && (
<Col span={24}> <Col span={24}>
<Empty description="暂无图片" /> <Empty description="暂无图片" />
</Col> </Col>
)} )}
<div className="image-list-box">
{imageList.map((item) => ( {imageList.map((item) => (
<div <div
key={item.id} key={item.id}

View File

@ -519,7 +519,7 @@ textarea.ant-input {
} }
.tree-title-elli { .tree-title-elli {
max-width: 100px; width: 100%;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;