添加测试信息
This commit is contained in:
@@ -1,10 +1,122 @@
|
||||
/* 树容器 */
|
||||
.bim-tree {
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden; /* 内部滚动 */
|
||||
font-size: 14px;
|
||||
color: var(--bim-ui_text_primary, #333);
|
||||
user-select: none; /* 防止双击选中文字 */
|
||||
position: relative; /* 为下拉框定位 */
|
||||
}
|
||||
|
||||
/* 搜索区域 */
|
||||
.bim-tree-search {
|
||||
padding: 8px;
|
||||
/* border-bottom: 1px solid var(--bim-ui_border_color, #d9d9d9); */
|
||||
/* 背景透明,使用父布局背景 */
|
||||
background-color: transparent;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bim-tree-search-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bim-tree-search-icon {
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--bim-ui_text_secondary, #999);
|
||||
pointer-events: none; /* 让点击穿透到 input */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bim-tree-search-icon svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bim-tree-search-input {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
/* 左侧留出图标位置: 8px left + 16px icon + 4px gap = 28px */
|
||||
padding: 4px 8px 4px 30px;
|
||||
border: 1px solid var(--bim-ui_border_color, #d9d9d9);
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
font-size: 13px;
|
||||
color: inherit;
|
||||
/* 输入框背景半透明或白色,看设计,通常输入框本身还是需要背景的,否则文字看不清 */
|
||||
background-color: var(--bim-ui_bg_color, #fff);
|
||||
transition: all 0.2s;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.bim-tree-search-input:focus {
|
||||
border-color: var(--bim-primary_color, #1890ff);
|
||||
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
||||
}
|
||||
|
||||
/* 搜索结果下拉框 */
|
||||
.bim-tree-search-results {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
background-color: var(--bim-ui_bg_color, #fff);
|
||||
border: 1px solid var(--bim-ui_border_color, #eee);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
border-radius: 4px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
z-index: 10;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bim-tree-search-results.is-visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.bim-tree-search-item {
|
||||
padding: 8px 12px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.03);
|
||||
}
|
||||
|
||||
.bim-tree-search-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.bim-tree-search-item:hover {
|
||||
background-color: var(--bim-ui_bg_hover, #f5f5f5);
|
||||
}
|
||||
|
||||
.bim-tree-search-item-title {
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.bim-tree-search-item-path {
|
||||
font-size: 12px;
|
||||
color: var(--bim-ui_text_secondary, #999);
|
||||
margin-top: 2px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 树内容区域 */
|
||||
.bim-tree-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
/* 节点行容器 */
|
||||
@@ -146,16 +258,66 @@
|
||||
.bim-tree-title {
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
/* 移除省略号样式,许文本撑开 */
|
||||
/* overflow: hidden; */
|
||||
/* text-overflow: ellipsis; */
|
||||
}
|
||||
|
||||
/* 子节点容器 */
|
||||
.bim-tree-children {
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
overflow: visible; /* 允许子节点撑开宽度 */
|
||||
}
|
||||
|
||||
.bim-tree-children.is-visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 选中高亮状态 */
|
||||
.bim-tree-node-content.is-selected {
|
||||
background-color: var(--bim-ui_bg_selected, rgba(24, 144, 255, 0.2));
|
||||
color: var(--bim-primary_color, #1890ff);
|
||||
}
|
||||
|
||||
/* 节点操作栏 */
|
||||
.bim-tree-node-actions {
|
||||
display: none; /* 默认隐藏 */
|
||||
align-items: center;
|
||||
margin-left: 8px; /* 与文字的间距 */
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bim-tree-node-content.is-selected .bim-tree-node-actions {
|
||||
display: flex; /* 选中时显示 */
|
||||
}
|
||||
|
||||
/* 树内容区域 */
|
||||
.bim-tree-content {
|
||||
flex: 1;
|
||||
overflow: auto; /* 支持横向和纵向滚动 */
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
/* 节点行容器 */
|
||||
.bim-tree-node {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: fit-content; /* 关键:让节点容器跟随内容宽度 */
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
/* 节点内容行 (Flex 布局) */
|
||||
.bim-tree-node-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 32px; /* 标准行高 */
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
border-radius: 4px;
|
||||
padding-right: 8px;
|
||||
|
||||
/* 关键:允许宽度根据内容撑开,且至少占满容器 */
|
||||
width: fit-content;
|
||||
min-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user