mirror of
https://github.com/PlayEdu/backend
synced 2025-06-08 04:44:05 +08:00
tree组件overflow
This commit is contained in:
parent
dfcd1fbaec
commit
0b83fb69ff
@ -87,13 +87,17 @@ export const TreeDepartment = (props: PropInterface) => {
|
|||||||
for (let i = 0; i < departments[id].length; i++) {
|
for (let i = 0; i < departments[id].length; i++) {
|
||||||
if (!departments[departments[id][i].id]) {
|
if (!departments[departments[id][i].id]) {
|
||||||
arr.push({
|
arr.push({
|
||||||
title: departments[id][i].name,
|
title: (
|
||||||
|
<span className="tree-title-elli">{departments[id][i].name}</span>
|
||||||
|
),
|
||||||
key: departments[id][i].id,
|
key: departments[id][i].id,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const new_arr: Option[] = checkArr(departments, departments[id][i].id);
|
const new_arr: any[] = checkArr(departments, departments[id][i].id);
|
||||||
arr.push({
|
arr.push({
|
||||||
title: departments[id][i].name,
|
title: (
|
||||||
|
<span className="tree-title-elli">{departments[id][i].name}</span>
|
||||||
|
),
|
||||||
key: departments[id][i].id,
|
key: departments[id][i].id,
|
||||||
children: new_arr,
|
children: new_arr,
|
||||||
});
|
});
|
||||||
@ -105,9 +109,11 @@ export const TreeDepartment = (props: PropInterface) => {
|
|||||||
const getNewTitle = (title: any, id: number, counts: any) => {
|
const getNewTitle = (title: any, id: number, counts: any) => {
|
||||||
if (counts) {
|
if (counts) {
|
||||||
let value = counts[id] || 0;
|
let value = counts[id] || 0;
|
||||||
return title + "(" + value + ")";
|
return (
|
||||||
|
<span className="tree-title-elli">{title + "(" + value + ")"}</span>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return title;
|
return <span className="tree-title-elli">{title}</span>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -457,6 +457,7 @@ textarea.ant-input {
|
|||||||
margin-bottom: 8px !important;
|
margin-bottom: 8px !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center !important;
|
align-items: center !important;
|
||||||
|
|
||||||
&.ant-tree-treenode-selected {
|
&.ant-tree-treenode-selected {
|
||||||
background-color: #fff2f0 !important;
|
background-color: #fff2f0 !important;
|
||||||
border-radius: 6px !important;
|
border-radius: 6px !important;
|
||||||
@ -559,9 +560,11 @@ textarea.ant-input {
|
|||||||
|
|
||||||
.tree-title-elli {
|
.tree-title-elli {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
display: -webkit-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs {
|
.ant-tabs {
|
||||||
|
@ -68,7 +68,7 @@ const DepartmentPage = () => {
|
|||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
<>
|
<>
|
||||||
<div className="w-174px mr-24">{departments[id][i].name}</div>
|
<div className="tree-title-elli">{departments[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
@ -103,7 +103,7 @@ const DepartmentPage = () => {
|
|||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
<>
|
<>
|
||||||
<div className="w-174px mr-24">{departments[id][i].name}</div>
|
<div className="tree-title-elli">{departments[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
|
@ -66,7 +66,7 @@ const ResourceCategoryPage = () => {
|
|||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
<>
|
<>
|
||||||
<div className="w-174px mr-24">{categories[id][i].name}</div>
|
<div className="tree-title-elli">{categories[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
@ -101,7 +101,7 @@ const ResourceCategoryPage = () => {
|
|||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
<>
|
<>
|
||||||
<div className="w-174px mr-24">{categories[id][i].name}</div>
|
<div className="tree-title-elli">{categories[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
|
Loading…
x
Reference in New Issue
Block a user