style(componentTest): 优化组件测试页面布局结构

master
钟良源 2 months ago
parent b71d4034cf
commit e253ea592d

@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Input, Tree } from '@arco-design/web-react'; import { Input, Tree } from '@arco-design/web-react';
import { IconSearch } from '@arco-design/web-react/icon'; import { IconSearch } from '@arco-design/web-react/icon';
import { getTreeComponents } from '@/api/componentTestCase'; import { getTreeComponents } from '@/api/componentTestCase';
import styles from './style/sideBar.module.less';
const TreeNode = Tree.Node; const TreeNode = Tree.Node;
@ -129,15 +130,14 @@ const SideBar = ({ onNodeSelect, getCount }) => {
}, []); }, []);
return ( return (
<> <div className={styles['sidebar-container']}>
<Input <Input
prefix={<IconSearch />} prefix={<IconSearch />}
placeholder={'搜索'} placeholder={'搜索'}
style={{ width: '90%' }}
value={searchValue} value={searchValue}
onChange={handleSearchChange} onChange={handleSearchChange}
/> />
<div className={styles['tree-wrapper']}>
<Tree <Tree
onSelect={handleTreeSelect} onSelect={handleTreeSelect}
onExpand={(keys) => { onExpand={(keys) => {
@ -147,8 +147,8 @@ const SideBar = ({ onNodeSelect, getCount }) => {
treeData={treeData} treeData={treeData}
> >
</Tree> </Tree>
</div>
</> </div>
); );
}; };

@ -1,7 +1,10 @@
.component-test { .component-test {
height: 98%; height: 98%;
background-color: #ffffff; background-color: #ffffff;
padding: 17px 19px 0 24px; padding: 17px 19px 17px 24px;
display: flex;
flex-direction: column;
box-sizing: border-box;
.header { .header {
display: flex; display: flex;
@ -9,17 +12,46 @@
padding-bottom: 15px; padding-bottom: 15px;
border-bottom: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;
margin-bottom: 25px; margin-bottom: 25px;
flex-shrink: 0;
} }
.content { .content {
display: flex; display: flex;
flex: 1;
overflow: hidden;
min-height: 0;
.left { .left {
width: 20%; width: 20%;
height: 100%;
display: flex;
flex-direction: column;
padding-right: 16px;
padding-bottom: 10px;
border-right: 1px solid #ebebeb;
box-sizing: border-box;
min-height: 0;
:global {
.arco-input-wrapper {
flex-shrink: 0;
margin-bottom: 12px;
}
.arco-tree {
flex: 1;
overflow-y: auto;
min-height: 0;
}
}
} }
.right { .right {
width: 80%; width: 80%;
height: 100%;
overflow-y: auto;
padding-left: 16px;
box-sizing: border-box;
} }
} }
} }

@ -0,0 +1,12 @@
.sidebar-container {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
.tree-wrapper {
flex: 1;
overflow-y: auto;
margin-top: 12px;
}
}
Loading…
Cancel
Save