mirror of
https://github.com/PlayEdu/backend
synced 2025-07-20 15:19:40 +08:00
tree组件初步优化
This commit is contained in:
parent
cb568cdb9f
commit
0f5e7fd9c1
@ -120,6 +120,7 @@ export const TreeCategory = (props: PropInterface) => {
|
|||||||
selectedKeys={selectKey}
|
selectedKeys={selectKey}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
treeData={treeData}
|
treeData={treeData}
|
||||||
|
switcherIcon={<i className="iconfont icon-icon-fold c-gray" />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -94,6 +94,7 @@ export const TreeDepartment = (props: PropInterface) => {
|
|||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
treeData={treeData}
|
treeData={treeData}
|
||||||
|
switcherIcon={<i className="iconfont icon-icon-fold c-gray" />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -22,6 +22,13 @@ code {
|
|||||||
monospace;
|
monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.w-174px {
|
||||||
|
max-width: 174px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
.w-250px {
|
.w-250px {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
@ -447,7 +454,6 @@ textarea.ant-input {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-tree-switcher {
|
.ant-tree-switcher {
|
||||||
padding-left: 9px;
|
|
||||||
height: 40px !important;
|
height: 40px !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -469,7 +475,7 @@ textarea.ant-input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ant-tree-switcher {
|
.ant-tree-switcher {
|
||||||
padding-left: 4px;
|
padding-left: 6px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,3 +592,16 @@ textarea.ant-input {
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-tree-switcher_close {
|
||||||
|
.c-gray {
|
||||||
|
color: rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-tree-switcher_open {
|
||||||
|
.c-gray {
|
||||||
|
color: rgba(0, 0, 0, 0.3);
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -72,8 +72,9 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
if (!departments[departments[id][i].id]) {
|
if (!departments[departments[id][i].id]) {
|
||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
|
<>
|
||||||
|
<div className="w-174px mr-24">{departments[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<div className="w-250px mr-24">{departments[id][i].name}</div>
|
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
className="iconfont icon-icon-drag mr-16"
|
className="iconfont icon-icon-drag mr-16"
|
||||||
@ -98,6 +99,7 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
key: departments[id][i].id,
|
key: departments[id][i].id,
|
||||||
});
|
});
|
||||||
@ -105,8 +107,9 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
const new_arr: Option[] = checkArr(departments, departments[id][i].id);
|
const new_arr: Option[] = checkArr(departments, departments[id][i].id);
|
||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
|
<>
|
||||||
|
<div className="w-174px mr-24">{departments[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<div className="w-250px mr-24">{departments[id][i].name}</div>
|
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
className="iconfont icon-icon-drag mr-16"
|
className="iconfont icon-icon-drag mr-16"
|
||||||
@ -131,6 +134,7 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
key: departments[id][i].id,
|
key: departments[id][i].id,
|
||||||
children: new_arr,
|
children: new_arr,
|
||||||
@ -364,6 +368,7 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="playedu-main-body">
|
<div className="playedu-main-body">
|
||||||
|
<div style={{ width: 366 }}>
|
||||||
<Tree
|
<Tree
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
treeData={treeData}
|
treeData={treeData}
|
||||||
@ -371,7 +376,9 @@ export const DepartmentPage: React.FC = () => {
|
|||||||
blockNode
|
blockNode
|
||||||
onDragEnter={onDragEnter}
|
onDragEnter={onDragEnter}
|
||||||
onDrop={onDrop}
|
onDrop={onDrop}
|
||||||
|
switcherIcon={<i className="iconfont icon-icon-fold c-gray" />}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<DepartmentCreate
|
<DepartmentCreate
|
||||||
open={createVisible}
|
open={createVisible}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
|
@ -70,8 +70,9 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
if (!categories[categories[id][i].id]) {
|
if (!categories[categories[id][i].id]) {
|
||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
|
<>
|
||||||
|
<div className="w-174px mr-24">{categories[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<div className="w-250px mr-24">{categories[id][i].name}</div>
|
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
className="iconfont icon-icon-drag mr-16"
|
className="iconfont icon-icon-drag mr-16"
|
||||||
@ -96,6 +97,7 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
key: categories[id][i].id,
|
key: categories[id][i].id,
|
||||||
});
|
});
|
||||||
@ -103,8 +105,9 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
const new_arr: Option[] = checkArr(categories, categories[id][i].id);
|
const new_arr: Option[] = checkArr(categories, categories[id][i].id);
|
||||||
arr.push({
|
arr.push({
|
||||||
title: (
|
title: (
|
||||||
|
<>
|
||||||
|
<div className="w-174px mr-24">{categories[id][i].name}</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<div className="w-250px mr-24">{categories[id][i].name}</div>
|
|
||||||
<Tooltip placement="top" title="可拖拽排序">
|
<Tooltip placement="top" title="可拖拽排序">
|
||||||
<i
|
<i
|
||||||
className="iconfont icon-icon-drag mr-16"
|
className="iconfont icon-icon-drag mr-16"
|
||||||
@ -129,6 +132,7 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
key: categories[id][i].id,
|
key: categories[id][i].id,
|
||||||
children: new_arr,
|
children: new_arr,
|
||||||
@ -372,6 +376,7 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="playedu-main-body">
|
<div className="playedu-main-body">
|
||||||
|
<div style={{ width: 366 }}>
|
||||||
<Tree
|
<Tree
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
treeData={treeData}
|
treeData={treeData}
|
||||||
@ -379,7 +384,9 @@ export const ResourceCategoryPage: React.FC = () => {
|
|||||||
blockNode
|
blockNode
|
||||||
onDragEnter={onDragEnter}
|
onDragEnter={onDragEnter}
|
||||||
onDrop={onDrop}
|
onDrop={onDrop}
|
||||||
|
switcherIcon={<i className="iconfont icon-icon-fold c-gray" />}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<ResourceCategoryCreate
|
<ResourceCategoryCreate
|
||||||
open={createVisible}
|
open={createVisible}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user