diff --git a/src/compenents/tree-department/index.tsx b/src/compenents/tree-department/index.tsx index 3da48c5..238c996 100644 --- a/src/compenents/tree-department/index.tsx +++ b/src/compenents/tree-department/index.tsx @@ -87,13 +87,17 @@ export const TreeDepartment = (props: PropInterface) => { for (let i = 0; i < departments[id].length; i++) { if (!departments[departments[id][i].id]) { arr.push({ - title: departments[id][i].name, + title: ( + {departments[id][i].name} + ), key: departments[id][i].id, }); } else { - const new_arr: Option[] = checkArr(departments, departments[id][i].id); + const new_arr: any[] = checkArr(departments, departments[id][i].id); arr.push({ - title: departments[id][i].name, + title: ( + {departments[id][i].name} + ), key: departments[id][i].id, children: new_arr, }); @@ -105,9 +109,11 @@ export const TreeDepartment = (props: PropInterface) => { const getNewTitle = (title: any, id: number, counts: any) => { if (counts) { let value = counts[id] || 0; - return title + "(" + value + ")"; + return ( + {title + "(" + value + ")"} + ); } else { - return title; + return {title}; } }; diff --git a/src/index.less b/src/index.less index 0bcee1a..532d11b 100644 --- a/src/index.less +++ b/src/index.less @@ -457,6 +457,7 @@ textarea.ant-input { margin-bottom: 8px !important; display: flex; align-items: center !important; + &.ant-tree-treenode-selected { background-color: #fff2f0 !important; border-radius: 6px !important; @@ -559,9 +560,11 @@ textarea.ant-input { .tree-title-elli { width: 100%; + display: -webkit-box; overflow: hidden; - white-space: nowrap; text-overflow: ellipsis; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; } .ant-tabs { diff --git a/src/pages/department/index.tsx b/src/pages/department/index.tsx index 3c885e5..f81f17b 100644 --- a/src/pages/department/index.tsx +++ b/src/pages/department/index.tsx @@ -68,7 +68,7 @@ const DepartmentPage = () => { arr.push({ title: ( <> -