feat: Optimize dropdown positioning and UI components for knowledge base management

- Enhanced dropdown positioning logic to dynamically adjust based on available space, ensuring better visibility and usability.
- Improved UI styles for dropdown menus and action items, including consistent padding, margins, and hover effects.
- Updated localization strings for better clarity in knowledge base actions and menu items.
- Refactored related components to streamline the user experience when interacting with knowledge base features.
This commit is contained in:
wizardchen
2025-11-20 13:37:21 +08:00
parent 3b1a859374
commit aabc9faf74
6 changed files with 713 additions and 370 deletions
+329 -236
View File
@@ -191,30 +191,108 @@ const updateModelDropdownPosition = () => {
const anchor = modelButtonRef.value;
if (!anchor) {
modelDropdownStyle.value = {
position: 'fixed',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
};
return;
}
// 获取按钮相对于视口的位置
const rect = anchor.getBoundingClientRect();
console.log('[Model Dropdown] Button rect:', {
top: rect.top,
bottom: rect.bottom,
left: rect.left,
right: rect.right,
width: rect.width,
height: rect.height
});
const dropdownWidth = 280;
const offsetY = 8;
let top = rect.bottom + offsetY;
let left = rect.left;
if (left + dropdownWidth > window.innerWidth) {
left = window.innerWidth - dropdownWidth - 12;
const vw = window.innerWidth;
const vh = window.innerHeight;
// 左对齐到触发元素的左边缘
// 使用 Math.floor 而不是 Math.round,避免像素对齐问题
let left = Math.floor(rect.left);
// 边界处理:不超出视口左右(留 16px margin)
const minLeft = 16;
const maxLeft = Math.max(16, vw - dropdownWidth - 16);
left = Math.max(minLeft, Math.min(maxLeft, left));
// 垂直定位:紧贴按钮,使用合理的高度避免空白
const preferredDropdownHeight = 280; // 优选高度(紧凑且够用)
const maxDropdownHeight = 360; // 最大高度
const minDropdownHeight = 200; // 最小高度
const topMargin = 20; // 顶部留白
const spaceBelow = vh - rect.bottom; // 下方剩余空间
const spaceAbove = rect.top; // 上方剩余空间
console.log('[Model Dropdown] Space check:', {
spaceBelow,
spaceAbove,
windowHeight: vh
});
let actualHeight: number;
let shouldOpenBelow: boolean;
// 优先考虑下方空间
if (spaceBelow >= minDropdownHeight + offsetY) {
// 下方有足够空间,向下弹出
actualHeight = Math.min(preferredDropdownHeight, spaceBelow - offsetY - 16);
shouldOpenBelow = true;
console.log('[Model Dropdown] Position: below button', { actualHeight });
} else {
// 向上弹出,优先使用 preferredHeight,必要时才扩展到 maxHeight
const availableHeight = spaceAbove - offsetY - topMargin;
if (availableHeight >= preferredDropdownHeight) {
// 有足够空间显示优选高度
actualHeight = preferredDropdownHeight;
} else {
// 空间不够,使用可用空间(但不小于最小高度)
actualHeight = Math.max(minDropdownHeight, availableHeight);
}
shouldOpenBelow = false;
console.log('[Model Dropdown] Position: above button', { actualHeight });
}
const dropdownHeight = 360;
if (top + dropdownHeight > window.innerHeight) {
top = rect.top - dropdownHeight - offsetY;
if (top < 10) top = 10;
// 根据弹出方向使用不同的定位方式
if (shouldOpenBelow) {
// 向下弹出:使用 top 定位,左对齐
const top = Math.floor(rect.bottom + offsetY);
console.log('[Model Dropdown] Opening below, top:', top);
modelDropdownStyle.value = {
position: 'fixed !important',
width: `${dropdownWidth}px`,
left: `${left}px`,
top: `${top}px`,
maxHeight: `${actualHeight}px`,
transform: 'none !important',
margin: '0 !important',
padding: '0 !important'
};
} else {
// 向上弹出:使用 bottom 定位,左对齐
const bottom = vh - rect.top + offsetY;
console.log('[Model Dropdown] Opening above, bottom:', bottom);
modelDropdownStyle.value = {
position: 'fixed !important',
width: `${dropdownWidth}px`,
left: `${left}px`,
bottom: `${bottom}px`,
maxHeight: `${actualHeight}px`,
transform: 'none !important',
margin: '0 !important',
padding: '0 !important'
};
}
modelDropdownStyle.value = {
top: `${Math.round(top)}px`,
left: `${Math.round(left)}px`,
width: `${dropdownWidth}px`,
};
console.log('[Model Dropdown] Applied style:', modelDropdownStyle.value);
};
const toggleModelSelector = () => {
@@ -224,8 +302,15 @@ const toggleModelSelector = () => {
if (!availableModels.value.length) {
loadChatModels();
}
// 多次更新位置确保准确
nextTick(() => {
updateModelDropdownPosition();
requestAnimationFrame(() => {
updateModelDropdownPosition();
setTimeout(() => {
updateModelDropdownPosition();
}, 50);
});
});
}
};
@@ -239,6 +324,10 @@ const closeAgentModeSelector = () => {
showAgentModeSelector.value = false;
};
// 窗口事件处理器
let resizeHandler: (() => void) | null = null;
let scrollHandler: (() => void) | null = null;
onMounted(() => {
loadKnowledgeBases();
loadWebSearchConfig();
@@ -254,20 +343,38 @@ onMounted(() => {
// 监听点击外部关闭下拉菜单
document.addEventListener('click', closeAgentModeSelector);
document.addEventListener('click', closeModelSelector);
// 监听窗口大小变化,重新计算位置
window.addEventListener('resize', () => {
// 监听窗口大小变化和滚动,重新计算位置
resizeHandler = () => {
if (showModelSelector.value) {
updateModelDropdownPosition();
}
if (showAgentModeSelector.value) {
updateAgentModeDropdownPosition();
}
});
};
scrollHandler = () => {
if (showModelSelector.value) {
updateModelDropdownPosition();
}
if (showAgentModeSelector.value) {
updateAgentModeDropdownPosition();
}
};
window.addEventListener('resize', resizeHandler, { passive: true });
window.addEventListener('scroll', scrollHandler, { passive: true, capture: true });
});
onUnmounted(() => {
document.removeEventListener('click', closeAgentModeSelector);
document.removeEventListener('click', closeModelSelector);
if (resizeHandler) {
window.removeEventListener('resize', resizeHandler);
}
if (scrollHandler) {
window.removeEventListener('scroll', scrollHandler, { capture: true });
}
});
// 监听路由变化
@@ -307,8 +414,6 @@ const createSession = (val: string) => {
clearvalue();
}
// 计算模型下拉菜单位置
// 计算 Agent 模式下拉菜单位置
const updateAgentModeDropdownPosition = () => {
const anchor = agentModeButtonRef.value;
@@ -325,32 +430,71 @@ const updateAgentModeDropdownPosition = () => {
const rect = anchor.getBoundingClientRect();
const dropdownWidth = 200;
const offsetY = 8;
const vw = window.innerWidth;
const vh = window.innerHeight;
// 计算位置:默认在按钮下方
let top = rect.bottom + offsetY;
let left = rect.left;
// 水平位置:左对齐
let left = Math.floor(rect.left);
const minLeft = 16;
const maxLeft = Math.max(16, vw - dropdownWidth - 16);
left = Math.max(minLeft, Math.min(maxLeft, left));
// 检查右侧边界
if (left + dropdownWidth > window.innerWidth) {
left = window.innerWidth - dropdownWidth - 10;
}
// 垂直位置:紧贴按钮,使用合理的高度避免空白
const preferredDropdownHeight = 140; // Agent 模式选择器内容较少,用更小的优选高度
const maxDropdownHeight = 150;
const minDropdownHeight = 100;
const topMargin = 20;
const spaceBelow = vh - rect.bottom;
const spaceAbove = rect.top;
// 检查下方空间
const dropdownMaxHeight = 150;
if (top + dropdownMaxHeight > window.innerHeight) {
// 如果下方空间不足,显示在按钮上方
top = rect.top - dropdownMaxHeight - offsetY;
if (top < 10) {
top = 10;
console.log('[Agent Dropdown] Space check:', {
spaceBelow,
spaceAbove,
windowHeight: vh
});
let actualHeight: number;
// 优先考虑下方空间
if (spaceBelow >= minDropdownHeight + offsetY) {
// 下方有足够空间,向下弹出
actualHeight = Math.min(preferredDropdownHeight, spaceBelow - offsetY - 16);
const top = Math.floor(rect.bottom + offsetY);
agentModeDropdownStyle.value = {
position: 'fixed !important',
width: `${dropdownWidth}px`,
left: `${left}px`,
top: `${top}px`,
maxHeight: `${actualHeight}px`,
transform: 'none !important',
margin: '0 !important',
padding: '0 !important',
};
console.log('[Agent Dropdown] Position: below button', { actualHeight });
} else {
// 向上弹出,使用 bottom 定位确保紧贴按钮
const availableHeight = spaceAbove - offsetY - topMargin;
if (availableHeight >= preferredDropdownHeight) {
actualHeight = preferredDropdownHeight;
} else {
actualHeight = Math.max(minDropdownHeight, availableHeight);
}
const bottom = vh - rect.top + offsetY;
agentModeDropdownStyle.value = {
position: 'fixed !important',
width: `${dropdownWidth}px`,
left: `${left}px`,
bottom: `${bottom}px`, // 使用 bottom 定位,确保紧贴按钮
maxHeight: `${actualHeight}px`,
transform: 'none !important',
margin: '0 !important',
padding: '0 !important',
};
console.log('[Agent Dropdown] Position: above button', { actualHeight, bottom });
}
agentModeDropdownStyle.value = {
position: 'fixed',
top: `${Math.round(top)}px`,
left: `${Math.round(left)}px`,
width: `${dropdownWidth}px`
};
};
const toggleAgentModeSelector = () => {
@@ -362,8 +506,15 @@ const toggleAgentModeSelector = () => {
showAgentModeSelector.value = !showAgentModeSelector.value;
if (showAgentModeSelector.value) {
// 多次更新位置确保准确
nextTick(() => {
updateAgentModeDropdownPosition();
requestAnimationFrame(() => {
updateAgentModeDropdownPosition();
setTimeout(() => {
updateAgentModeDropdownPosition();
}, 50);
});
});
}
}
@@ -880,17 +1031,12 @@ const getImgSrc = (url: string) => {
border-radius: 6px;
background: #f5f5f5;
cursor: pointer;
transition: all 0.2s ease;
transition: background 0.12s;
user-select: none;
flex-shrink: 0;
&:hover {
background: #e6e6e6;
transform: scale(1.02);
}
&:active {
transform: scale(0.98);
}
&.disabled {
@@ -899,7 +1045,6 @@ const getImgSrc = (url: string) => {
&:hover {
background: #f5f5f5;
transform: none;
}
}
}
@@ -910,17 +1055,17 @@ const getImgSrc = (url: string) => {
min-width: auto;
font-weight: 500;
border: 1.5px solid transparent;
transition: all 0.2s ease;
transition: background 0.12s, border-color 0.12s;
position: relative;
&.active,
&.agent-active {
background: linear-gradient(135deg, rgba(7, 192, 95, 0.15) 0%, rgba(7, 192, 95, 0.1) 100%);
border-color: rgba(7, 192, 95, 0.4);
box-shadow: 0 2px 6px rgba(7, 192, 95, 0.12);
background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
border-color: rgba(16, 185, 129, 0.4);
box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12);
.agent-mode-text {
color: #07C05F;
color: #10b981;
font-weight: 600;
}
@@ -929,14 +1074,12 @@ const getImgSrc = (url: string) => {
}
.dropdown-arrow {
color: #07C05F;
color: #10b981;
}
&:hover {
background: linear-gradient(135deg, rgba(7, 192, 95, 0.2) 0%, rgba(7, 192, 95, 0.15) 100%);
border-color: rgba(7, 192, 95, 0.6);
box-shadow: 0 3px 10px rgba(7, 192, 95, 0.2);
transform: translateY(-1px);
background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
border-color: rgba(16, 185, 129, 0.6);
}
}
@@ -955,7 +1098,6 @@ const getImgSrc = (url: string) => {
&:hover {
background: rgba(255, 255, 255, 1);
border-color: #b0b0b0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
}
}
@@ -977,7 +1119,6 @@ const getImgSrc = (url: string) => {
.control-icon {
width: 18px;
height: 18px;
transition: all 0.2s ease;
}
.kb-btn {
@@ -986,11 +1127,11 @@ const getImgSrc = (url: string) => {
min-width: auto;
&.active {
background: rgba(7, 192, 95, 0.1);
color: #07C05F;
background: rgba(16, 185, 129, 0.1);
color: #10b981;
&:hover {
background: rgba(7, 192, 95, 0.15);
background: rgba(16, 185, 129, 0.15);
}
}
}
@@ -1003,7 +1144,7 @@ const getImgSrc = (url: string) => {
}
.kb-btn.active .kb-btn-text {
color: #07C05F;
color: #10b981;
}
.websearch-btn {
@@ -1016,14 +1157,14 @@ const getImgSrc = (url: string) => {
justify-content: center;
&.active {
background: rgba(7, 192, 95, 0.1);
background: rgba(16, 185, 129, 0.1);
.websearch-icon {
color: #07C05F;
color: #10b981;
}
&:hover {
background: rgba(7, 192, 95, 0.15);
background: rgba(16, 185, 129, 0.15);
}
}
@@ -1064,14 +1205,13 @@ const getImgSrc = (url: string) => {
.websearch-icon {
width: 18px;
height: 18px;
transition: all 0.2s ease;
}
.dropdown-arrow {
transition: transform 0.2s ease;
width: 10px;
height: 10px;
margin-left: 2px;
transition: transform 0.12s;
&.rotate {
transform: rotate(180deg);
@@ -1096,16 +1236,16 @@ const getImgSrc = (url: string) => {
align-items: center;
gap: 4px;
padding: 4px 8px;
background: rgba(7, 192, 95, 0.1);
border: 1px solid rgba(7, 192, 95, 0.3);
background: rgba(16, 185, 129, 0.1);
border: 1px solid rgba(16, 185, 129, 0.3);
border-radius: 4px;
font-size: 12px;
color: #07C05F;
color: #10b981;
white-space: nowrap;
transition: all 0.15s ease;
transition: background 0.12s;
&:hover {
background: rgba(7, 192, 95, 0.15);
background: rgba(16, 185, 129, 0.15);
}
}
@@ -1147,27 +1287,21 @@ const getImgSrc = (url: string) => {
width: 28px;
height: 28px;
padding: 0;
background: rgba(7, 192, 95, 0.08);
color: #07C05F;
border: 1.5px solid rgba(7, 192, 95, 0.2);
background: rgba(16, 185, 129, 0.08);
color: #10b981;
border: 1.5px solid rgba(16, 185, 129, 0.2);
position: relative;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
display: flex;
align-items: center;
justify-content: center;
animation: stopBtnPulse 2s ease-in-out infinite;
&:hover {
background: rgba(7, 192, 95, 0.12);
border-color: #07C05F;
transform: scale(1.05);
box-shadow: 0 2px 4px rgba(7, 192, 95, 0.2);
animation: none;
background: rgba(16, 185, 129, 0.12);
border-color: #10b981;
}
&:active {
transform: scale(0.95);
background: rgba(7, 192, 95, 0.15);
background: rgba(16, 185, 129, 0.15);
}
svg {
@@ -1178,60 +1312,9 @@ const getImgSrc = (url: string) => {
content: '';
width: 12px;
height: 12px;
background: #07C05F;
background: #10b981;
border-radius: 50%;
display: block;
animation: stopDotPulse 2s ease-in-out infinite;
}
&:hover::before {
animation: none;
}
&::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
border-radius: 50%;
border: 2px solid #07C05F;
animation: stopRipple 2s ease-out infinite;
}
&:hover::after {
animation: none;
opacity: 0;
}
}
@keyframes stopBtnPulse {
0%, 100% {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
50% {
box-shadow: 0 2px 4px rgba(7, 192, 95, 0.1);
}
}
@keyframes stopDotPulse {
0%, 100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(0.92);
opacity: 0.9;
}
}
@keyframes stopRipple {
0% {
transform: scale(0.9);
opacity: 0.4;
}
100% {
transform: scale(2);
opacity: 0;
}
}
@@ -1239,11 +1322,10 @@ const getImgSrc = (url: string) => {
width: 28px;
height: 28px;
padding: 0;
background-color: #07C05F;
background-color: #10b981;
&:hover:not(.disabled) {
background-color: #00a651;
transform: scale(1.05);
background-color: #059669;
}
&.disabled {
@@ -1260,7 +1342,7 @@ const getImgSrc = (url: string) => {
.model-display {
display: flex;
align-items: center;
margin-left: 0;
margin-left: auto; /* 推到最右边,但仍在 control-left 内 */
flex-shrink: 0;
}
@@ -1272,16 +1354,15 @@ const getImgSrc = (url: string) => {
min-width: 100px;
height: 22px;
border-radius: 6px;
border: 1px solid rgba(7, 192, 95, 0.3);
background: rgba(7, 192, 95, 0.1);
box-shadow: none;
transition: background 0.2s ease, border-color 0.2s ease;
border: 1px solid rgba(16, 185, 129, 0.3);
background: rgba(16, 185, 129, 0.1);
transition: background 0.12s, border-color 0.12s;
cursor: pointer;
}
.model-selector-trigger:hover {
background: rgba(7, 192, 95, 0.15);
border-color: rgba(7, 192, 95, 0.45);
background: rgba(16, 185, 129, 0.15);
border-color: rgba(16, 185, 129, 0.45);
}
.model-selector-trigger.disabled {
@@ -1290,8 +1371,8 @@ const getImgSrc = (url: string) => {
}
.model-selector-trigger.disabled:hover {
background: rgba(7, 192, 95, 0.1);
border-color: rgba(7, 192, 95, 0.3);
background: rgba(16, 185, 129, 0.1);
border-color: rgba(16, 185, 129, 0.3);
}
.model-selector-name {
@@ -1310,13 +1391,12 @@ const getImgSrc = (url: string) => {
height: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 5px solid #07C05F;
border-top: 5px solid #10b981;
margin-left: 4px;
transition: transform 0.2s ease;
}
.model-selector-trigger.disabled::after {
border-top-color: rgba(7, 192, 95, 0.4);
border-top-color: rgba(16, 185, 129, 0.4);
}
.model-selector-overlay {
@@ -1324,91 +1404,103 @@ const getImgSrc = (url: string) => {
inset: 0;
z-index: 9998;
background: transparent;
touch-action: none;
}
.model-selector-dropdown {
position: fixed;
position: fixed !important;
z-index: 9999;
background: #fff;
border-radius: 12px;
box-shadow: 0 25px 45px rgba(15, 23, 42, 0.15);
border: 1px solid #e2e8f0;
border-radius: 10px;
box-shadow: 0 6px 28px rgba(15, 23, 42, 0.08);
border: 1px solid #e7e9eb;
overflow: hidden;
max-height: 360px;
display: flex;
flex-direction: column;
margin: 0 !important;
padding: 0 !important;
transform: none !important;
}
.model-selector-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid #f1f5f9;
background: #f8fafc;
font-size: 13px;
padding: 8px 10px;
border-bottom: 1px solid #f2f4f5;
background: #fafcfc;
font-size: 12px;
font-weight: 600;
color: #0f172a;
color: #222;
}
.model-selector-content {
max-height: 300px;
flex: 1;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
padding: 6px 8px;
}
.model-selector-add {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 12px;
border-radius: 999px;
border: 1px solid rgba(7, 192, 95, 0.4);
background: rgba(7, 192, 95, 0.08);
color: #057647;
font-size: 12px;
font-weight: 600;
padding: 3px 8px;
border-radius: 6px;
border: 1px solid #e1e5e6;
background: #fff;
color: #52575a;
font-size: 11px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease;
transition: all 0.12s;
}
.model-selector-add .add-icon {
font-size: 14px;
font-size: 12px;
line-height: 1;
}
.model-selector-add:hover {
background: rgba(7, 192, 95, 0.18);
border-color: rgba(7, 192, 95, 0.6);
border-color: #10b981;
color: #10b981;
background: #f0fdf6;
}
.model-option {
padding: 12px 16px;
padding: 6px 8px;
cursor: pointer;
transition: background 0.2s;
border-bottom: 1px solid #f1f5f9;
transition: background 0.12s;
border-radius: 6px;
margin-bottom: 4px;
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
&:hover {
background: #f5f5f5;
background: #f6f8f7;
}
&.selected {
background: rgba(7, 192, 95, 0.08);
background: #eefdf5;
.model-option-name {
color: #07C05F;
color: #10b981;
font-weight: 600;
}
}
&.empty {
color: #999;
color: #9aa0a6;
cursor: default;
text-align: center;
padding: 20px 8px;
&:hover {
background: white;
background: transparent;
}
}
}
@@ -1416,86 +1508,88 @@ const getImgSrc = (url: string) => {
.model-option-main {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 4px;
gap: 6px;
margin-bottom: 1px;
}
.model-option-name {
font-size: 14px;
color: #333;
font-size: 12px;
color: #222;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.4;
}
.model-option-desc {
font-size: 12px;
color: #999;
font-size: 11px;
color: #8b9196;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 1px;
}
.model-badge-remote,
.model-badge-local {
display: inline-block;
padding: 2px 6px;
font-size: 11px;
padding: 1px 5px;
font-size: 10px;
border-radius: 3px;
font-weight: 500;
flex-shrink: 0;
}
.model-badge-remote {
background: rgba(7, 192, 95, 0.1);
color: #07C05F;
background: rgba(16, 185, 129, 0.1);
color: #10b981;
}
.model-badge-local {
background: rgba(82, 196, 26, 0.1);
color: #52c41a;
background: rgba(139, 145, 150, 0.1);
color: #52575a;
}
/* Agent 模式选择下拉菜单 */
.agent-mode-selector-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
inset: 0;
z-index: 9998;
background: transparent;
touch-action: none;
}
.agent-mode-selector-dropdown {
position: fixed !important;
z-index: 9999;
background: white;
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(7, 192, 95, 0.08);
border: 1px solid #e5e7eb;
background: #fff;
border-radius: 10px;
box-shadow: 0 6px 28px rgba(15, 23, 42, 0.08);
border: 1px solid #e7e9eb;
overflow: hidden;
padding: 4px;
padding: 6px 8px;
min-width: 200px;
display: flex;
flex-direction: column;
margin: 0 !important;
padding: 0 !important;
transform: none !important;
}
.agent-mode-option {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 14px;
padding: 8px 10px;
cursor: pointer;
transition: all 0.2s ease;
transition: background 0.12s;
border-radius: 6px;
position: relative;
margin: 2px 0;
margin: 4px 6px;
&:hover:not(.disabled) {
background: rgba(7, 192, 95, 0.1);
transform: translateX(2px);
}
&:active:not(.disabled) {
transform: translateX(1px);
background: #f6f8f7;
}
&.disabled {
@@ -1504,16 +1598,14 @@ const getImgSrc = (url: string) => {
&:hover {
background: transparent;
transform: none;
}
}
// 选中状态的选项有更明显的背景
&.selected {
background: rgba(7, 192, 95, 0.06);
background: #eefdf5;
.agent-mode-option-name {
color: #07C05F;
color: #10b981;
font-weight: 700;
}
}
@@ -1522,62 +1614,63 @@ const getImgSrc = (url: string) => {
.agent-mode-option-main {
display: flex;
flex-direction: column;
gap: 2px;
gap: 1px;
flex: 1;
min-width: 0;
}
.agent-mode-option-name {
font-size: 14px;
font-size: 12px;
font-weight: 600;
color: #333;
color: #222;
line-height: 1.4;
transition: color 0.2s ease;
transition: color 0.12s;
}
.agent-mode-option-desc {
font-size: 12px;
color: #999;
font-size: 11px;
color: #8b9196;
line-height: 1.3;
}
.check-icon {
width: 16px;
height: 16px;
color: #07C05F;
width: 14px;
height: 14px;
color: #10b981;
flex-shrink: 0;
margin-left: 8px;
margin-left: 6px;
}
.agent-mode-warning {
display: flex;
align-items: center;
margin-left: 8px;
margin-left: 6px;
.warning-icon {
color: #ff9800;
font-size: 16px;
font-size: 14px;
}
}
.agent-mode-footer {
padding: 8px 12px;
border-top: 1px solid #f0f0f0;
margin-top: 4px;
padding: 6px 10px;
border-top: 1px solid #f2f4f5;
margin-top: 2px;
background: #fafcfc;
}
.agent-mode-link {
color: #07C05F;
color: #10b981;
text-decoration: none;
font-size: 12px;
font-size: 11px;
font-weight: 500;
display: inline-flex;
align-items: center;
gap: 4px;
transition: all 0.2s ease;
gap: 3px;
transition: all 0.12s;
&:hover {
color: #00a651;
color: #059669;
text-decoration: underline;
}
}
+120 -80
View File
@@ -164,15 +164,18 @@ const updateDropdownPosition = () => {
// fallback 函数
const applyFallback = () => {
const vw = window.innerWidth
const topFallback = Math.max(80, window.innerHeight / 2 - 160)
const vw = window.innerWidth;
const topFallback = Math.max(80, window.innerHeight / 2 - 160);
dropdownStyle.value = {
position: 'fixed',
width: `${dropdownWidth}px`,
left: `${Math.round((vw - dropdownWidth) / 2)}px`,
top: `${Math.round(topFallback)}px`
}
}
top: `${Math.round(topFallback)}px`,
transform: 'none',
margin: '0',
padding: '0',
};
};
if (!anchor) {
applyFallback()
@@ -183,8 +186,15 @@ const updateDropdownPosition = () => {
let rect: DOMRect | null = null
try {
if (typeof anchor.getBoundingClientRect === 'function') {
// 强制重新计算布局,确保获取最新位置
rect = anchor.getBoundingClientRect()
console.log('[KB Selector] Button rect:', {
top: rect.top,
bottom: rect.bottom,
left: rect.left,
right: rect.right,
width: rect.width,
height: rect.height
})
} else if (anchor.width !== undefined && anchor.left !== undefined) {
// 已经是 DOMRect
rect = anchor as DOMRect
@@ -210,45 +220,72 @@ const updateDropdownPosition = () => {
const maxLeft = Math.max(16, vw - dropdownWidth - 16)
left = Math.max(minLeft, Math.min(maxLeft, left))
// 垂直定位:智能判断向上还是向下
const dropdownHeight = 360 // 弹窗高度估算
// 垂直定位:紧贴按钮,使用合理的高度避免空白
const preferredDropdownHeight = 280 // 优选高度(紧凑且够用)
const maxDropdownHeight = 360 // 最大高度
const minDropdownHeight = 200 // 最小高度
const topMargin = 20 // 顶部留白
const spaceBelow = vh - rect.bottom // 下方剩余空间
const spaceAbove = rect.top // 上方剩余空间
let top: number
console.log('[KB Selector] Space check:', {
spaceBelow,
spaceAbove,
windowHeight: vh
})
// 判断应该向上还是向下弹出
if (spaceBelow >= dropdownHeight + offsetY + 16) {
// 下方空间充足,向下弹出
top = Math.floor(rect.bottom + offsetY)
} else if (spaceAbove >= dropdownHeight + offsetY + 16) {
// 下方不够但上方充足,向上弹出
top = Math.floor(rect.top - dropdownHeight - offsetY)
let actualHeight: number
let shouldOpenBelow: boolean
// 优先考虑下方空间
if (spaceBelow >= minDropdownHeight + offsetY) {
// 下方有足够空间,向下弹出
actualHeight = Math.min(preferredDropdownHeight, spaceBelow - offsetY - 16)
shouldOpenBelow = true
console.log('[KB Selector] Position: below button', { actualHeight })
} else {
// 上下都不够,选择空间较大的一侧
if (spaceAbove > spaceBelow) {
// 上方空间更大,贴着顶部
top = Math.max(16, Math.floor(rect.top - dropdownHeight - offsetY))
// 向上弹出,优先使用 preferredHeight,必要时才扩展到 maxHeight
const availableHeight = spaceAbove - offsetY - topMargin
if (availableHeight >= preferredDropdownHeight) {
// 有足够空间显示优选高度
actualHeight = preferredDropdownHeight
} else {
// 下方空间更大,贴着底部或按钮下方
top = Math.floor(rect.bottom + offsetY)
// 确保不超出视口底部
if (top + dropdownHeight > vh - 16) {
top = Math.max(16, Math.floor(vh - dropdownHeight - 16))
}
// 空间不够,使用可用空间(但不小于最小高度)
actualHeight = Math.max(minDropdownHeight, availableHeight)
}
shouldOpenBelow = false
console.log('[KB Selector] Position: above button', { actualHeight })
}
// 使用 fixed 定位,确保没有 transform 或其他样式影响
dropdownStyle.value = {
position: 'fixed',
width: `${dropdownWidth}px`,
left: `${left}px`,
top: `${top}px`,
maxHeight: `${Math.min(dropdownHeight, vh - 32)}px`, // 添加最大高度限制
transform: 'none', // 确保没有 transform 影响定位
margin: '0', // 确保没有 margin 影响定位
padding: '0' // 确保没有 padding 影响定位
// 根据弹出方向使用不同的定位方式
if (shouldOpenBelow) {
// 向下弹出:使用 top 定位
const top = Math.floor(rect.bottom + offsetY)
console.log('[KB Selector] Opening below, top:', top)
dropdownStyle.value = {
position: 'fixed',
width: `${dropdownWidth}px`,
left: `${left}px`,
top: `${top}px`,
maxHeight: `${actualHeight}px`,
transform: 'none',
margin: '0',
padding: '0'
}
} else {
// 向上弹出:使用 bottom 定位
const bottom = vh - rect.top + offsetY
console.log('[KB Selector] Opening above, bottom:', bottom)
dropdownStyle.value = {
position: 'fixed',
width: `${dropdownWidth}px`,
left: `${left}px`,
bottom: `${bottom}px`,
maxHeight: `${actualHeight}px`,
transform: 'none',
margin: '0',
padding: '0'
}
}
}
@@ -259,42 +296,40 @@ let scrollHandler: (() => void) | null = null
// 当 visible 变化时处理
watch(() => props.visible, async (v) => {
if (v) {
await loadKnowledgeBases()
// 等 DOM 渲染完再计算位置,防止 rect 读取到不准值
await nextTick()
// 延迟一帧再计算位置,确保所有样式都已应用
await loadKnowledgeBases();
// 等 DOM 渲染完再计算位置
await nextTick();
// 多次更新位置确保准确
requestAnimationFrame(() => {
updateDropdownPosition()
// 再次确保位置正确(应对动画或其他延迟渲染)
updateDropdownPosition();
requestAnimationFrame(() => {
updateDropdownPosition()
// 最后一次确保位置正确
updateDropdownPosition();
setTimeout(() => {
updateDropdownPosition()
}, 100)
})
})
updateDropdownPosition();
}, 50);
});
});
// 确保 focus
nextTick(() => searchInput.value?.focus())
nextTick(() => searchInput.value?.focus());
// 监听 resize/scroll 做微调(使用 passive 提高性能)
resizeHandler = () => updateDropdownPosition()
scrollHandler = () => updateDropdownPosition()
window.addEventListener('resize', resizeHandler, { passive: true })
window.addEventListener('scroll', scrollHandler, { passive: true, capture: true })
resizeHandler = () => updateDropdownPosition();
scrollHandler = () => updateDropdownPosition();
window.addEventListener('resize', resizeHandler, { passive: true });
window.addEventListener('scroll', scrollHandler, { passive: true, capture: true });
} else {
searchQuery.value = ''
highlightedIndex.value = 0
searchQuery.value = '';
highlightedIndex.value = 0;
// 清理事件监听器
if (resizeHandler) {
window.removeEventListener('resize', resizeHandler)
resizeHandler = null
window.removeEventListener('resize', resizeHandler);
resizeHandler = null;
}
if (scrollHandler) {
window.removeEventListener('scroll', scrollHandler, { capture: true })
scrollHandler = null
window.removeEventListener('scroll', scrollHandler, { capture: true });
scrollHandler = null;
}
}
})
});
</script>
<style scoped lang="less">
@@ -334,15 +369,15 @@ watch(() => props.visible, async (v) => {
/* 宽度由 JS 控制(dropdownWidth),这里只做内部样式 */
.kb-search {
padding: 10px 12px;
padding: 8px 10px;
border-bottom: 1px solid #f1f3f4;
}
.kb-search-input {
width: 100%;
padding: 8px 12px;
font-size: 13px;
padding: 6px 10px;
font-size: 12px;
border: 1px solid #eef1f2;
border-radius: 8px;
border-radius: 6px;
background: #fbfdfc;
outline: none;
transition: border 0.12s;
@@ -357,7 +392,7 @@ watch(() => props.visible, async (v) => {
min-height: 0; /* 允许 flex 子元素缩小 */
max-height: 260px;
overflow-y: auto;
padding: 8px;
padding: 6px 8px;
/* 确保滚动限制在此容器内 */
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
@@ -366,11 +401,11 @@ watch(() => props.visible, async (v) => {
.kb-item {
display: flex;
align-items: center;
padding: 8px;
border-radius: 8px;
padding: 6px 8px;
border-radius: 6px;
cursor: pointer;
transition: background 0.12s;
margin-bottom: 6px;
margin-bottom: 4px;
}
.kb-item:last-child { margin-bottom: 0; }
@@ -382,42 +417,47 @@ watch(() => props.visible, async (v) => {
.kb-item-left {
display: flex;
align-items: center;
gap: 10px;
gap: 8px;
width: 100%;
}
.checkbox {
width: 18px; height: 18px;
border-radius: 4px;
width: 16px; height: 16px;
border-radius: 3px;
border: 1.5px solid #d7dadd;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.checkbox.checked {
background: #10b981;
border-color: #10b981;
}
.checkbox.checked svg {
width: 10px;
height: 10px;
}
.kb-name-wrap { display:flex; flex-direction: column; min-width: 0; }
.kb-name { font-size: 13px; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-docs { font-size: 11px; color: #8b9196; margin-top: 2px; }
.kb-name { font-size: 12px; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.kb-docs { font-size: 11px; color: #8b9196; margin-top: 1px; }
.kb-empty { padding: 28px 8px; text-align: center; color: #9aa0a6; font-size: 13px; }
.kb-empty { padding: 20px 8px; text-align: center; color: #9aa0a6; font-size: 12px; }
.kb-actions {
display: flex;
gap: 10px;
padding: 10px;
gap: 8px;
padding: 8px 10px;
border-top: 1px solid #f2f4f5;
background: #fafcfc;
}
.kb-btn {
flex: 1;
padding: 8px 10px;
border-radius: 8px;
padding: 6px 10px;
border-radius: 6px;
border: 1px solid #e1e5e6;
background: #fff;
font-size: 13px;
font-size: 12px;
color: #52575a;
cursor: pointer;
transition: all 0.12s;
+107 -47
View File
@@ -11,47 +11,57 @@
<div class="kb-action-menu">
<template v-if="showCreateKbAction">
<div class="menu_item kb-action-item" @click.stop="handleCreateKnowledgeBase">
<div class="menu_item-box">
<div class="menu_icon">
<t-icon name="add" />
</div>
<span class="menu_title">{{ t('knowledgeList.create') }}</span>
<div class="kb-action-icon-wrapper">
<svg class="kb-action-icon" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M9 3.75V14.25M3.75 9H14.25" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="kb-action-content">
<span class="kb-action-title">{{ t('knowledgeList.create') }}</span>
</div>
</div>
</template>
<template v-else-if="showDocActions">
<div class="menu_item kb-action-item" @click.stop="handleDocUploadClick">
<div class="menu_item-box">
<div class="menu_icon">
<t-icon name="upload" />
</div>
<span class="menu_title">{{ t('upload.uploadDocument') }}</span>
<div class="kb-action-icon-wrapper">
<svg class="kb-action-icon" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M15.75 11.25V14.25C15.75 14.6478 15.592 15.0294 15.3107 15.3107C15.0294 15.592 14.6478 15.75 14.25 15.75H3.75C3.35218 15.75 2.97064 15.592 2.68934 15.3107C2.40804 15.0294 2.25 14.6478 2.25 14.25V11.25M12.75 6L9 2.25M9 2.25L5.25 6M9 2.25V11.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="kb-action-content">
<span class="kb-action-title">{{ t('upload.uploadDocument') }}</span>
</div>
</div>
<div class="menu_item kb-action-item" @click.stop="handleDocManualCreate">
<div class="menu_item-box">
<div class="menu_icon">
<t-icon name="edit-1" />
</div>
<span class="menu_title">{{ t('upload.onlineEdit') }}</span>
<div class="kb-action-icon-wrapper">
<svg class="kb-action-icon" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M8.25 2.25H3.75C3.35218 2.25 2.97064 2.40804 2.68934 2.68934C2.40804 2.97064 2.25 3.35218 2.25 3.75V14.25C2.25 14.6478 2.40804 15.0294 2.68934 15.3107C2.97064 15.592 3.35218 15.75 3.75 15.75H14.25C14.6478 15.75 15.0294 15.592 15.3107 15.3107C15.592 15.0294 15.75 14.6478 15.75 14.25V9.75M13.875 3.375L5.625 11.625L5.25 12.75L6.375 12.375L14.625 4.125C14.7745 3.97554 14.8571 3.77516 14.8571 3.5625C14.8571 3.34984 14.7745 3.14946 14.625 3L15 2.625L14.625 3C14.4755 2.85054 14.2752 2.76786 14.0625 2.76786C13.8498 2.76786 13.6495 2.85054 13.5 3L13.875 3.375Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="kb-action-content">
<span class="kb-action-title">{{ t('upload.onlineEdit') }}</span>
</div>
</div>
</template>
<template v-else-if="showFaqActions">
<div class="menu_item kb-action-item" @click.stop="handleFaqCreateFromMenu">
<div class="menu_item-box">
<div class="menu_icon">
<t-icon name="add" />
</div>
<span class="menu_title">{{ t('knowledgeEditor.faq.editorCreate') }}</span>
<div class="kb-action-icon-wrapper">
<svg class="kb-action-icon" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M9 3.75V14.25M3.75 9H14.25" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="kb-action-content">
<span class="kb-action-title">{{ t('knowledgeEditor.faq.editorCreate') }}</span>
</div>
</div>
<div class="menu_item kb-action-item" @click.stop="handleFaqImportFromMenu">
<div class="menu_item-box">
<div class="menu_icon">
<t-icon name="import" />
</div>
<span class="menu_title">{{ t('knowledgeEditor.faqImport.importButton') }}</span>
<div class="kb-action-icon-wrapper">
<svg class="kb-action-icon" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M15.75 11.25V14.25C15.75 14.6478 15.592 15.0294 15.3107 15.3107C15.0294 15.592 14.6478 15.75 14.25 15.75H3.75C3.35218 15.75 2.97064 15.592 2.68934 15.3107C2.40804 15.0294 2.25 14.6478 2.25 14.25V11.25M5.25 7.5L9 11.25M9 11.25L12.75 7.5M9 11.25V2.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="kb-action-content">
<span class="kb-action-title">{{ t('knowledgeEditor.faqImport.importButton') }}</span>
</div>
</div>
</template>
@@ -709,48 +719,98 @@ const handleCreateKnowledgeBase = () => {
}
.kb-action-wrapper {
border: 1px dashed #e5e7eb;
border-radius: 8px;
padding: 12px 8px;
border: 1px solid #e7e9eb;
border-radius: 10px;
padding: 10px;
margin-bottom: 12px;
background: #fcfefe;
background: #fafcfc;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.kb-action-label {
font-size: 12px;
color: #98a2b3;
margin-bottom: 6px;
padding: 0 8px;
font-size: 11px;
font-weight: 600;
color: #8b9196;
margin-bottom: 8px;
padding: 0 6px;
text-transform: uppercase;
letter-spacing: 0.3px;
}
.kb-action-menu {
display: flex;
flex-direction: column;
gap: 6px;
gap: 4px;
}
.kb-action-item {
background: #f7f8fa;
background: #fff;
border-radius: 6px;
border: 1px solid transparent;
border: 1px solid #eef1f2;
transition: all 0.12s ease;
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
cursor: pointer;
.menu_icon {
color: #07c05f;
&:hover {
background: #f0fdf6;
border-color: #10b981;
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
:deep(.t-icon) {
font-size: 16px;
.kb-action-icon {
color: #059669;
transform: scale(1.05);
}
.kb-action-title {
color: #10b981;
}
}
.menu_title {
font-size: 13px;
color: #1d2129;
&:active {
transform: translateY(0);
box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
}
}
&:hover {
background: #ecfdf5;
border-color: #07c05f;
}
.kb-action-icon-wrapper {
width: 32px;
height: 32px;
border-radius: 6px;
background: #f0fdf6;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: all 0.12s ease;
}
.kb-action-icon {
color: #10b981;
transition: all 0.12s ease;
}
.kb-action-item:hover .kb-action-icon-wrapper {
background: #d1fae5;
}
.kb-action-content {
flex: 1;
min-width: 0;
}
.kb-action-title {
font-size: 13px;
font-weight: 500;
color: #0f172a;
transition: color 0.12s ease;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.menu_box {
+78 -3
View File
@@ -1057,6 +1057,63 @@ async function createNewSession(value: string): Promise<void> {
min-width: 120px;
}
}
/* 面包屑下拉菜单优化 */
.t-popup__content {
.t-dropdown__menu {
background: #ffffff;
border: 1px solid #e7e9eb;
border-radius: 10px;
box-shadow: 0 6px 28px rgba(15, 23, 42, 0.08);
padding: 6px;
min-width: 200px;
max-width: 240px;
}
.t-dropdown__item {
padding: 8px 12px;
border-radius: 6px;
margin: 2px 0;
transition: all 0.12s ease;
font-size: 13px;
color: #0f172a;
cursor: pointer;
min-width: auto !important;
max-width: 100% !important;
display: flex !important;
align-items: center;
width: 100%;
&:hover {
background: #f6f8f7;
color: #10b981;
}
.t-dropdown__item-icon {
flex-shrink: 0;
margin-right: 8px;
color: inherit;
display: flex;
align-items: center;
.t-icon {
font-size: 16px;
}
}
.t-dropdown__item-text {
color: inherit !important;
font-size: 13px !important;
line-height: 1.5 !important;
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
flex: 1;
min-width: 0;
display: block;
}
}
}
</style>
<style scoped lang="less">
.knowledge-layout {
@@ -1475,23 +1532,41 @@ async function createNewSession(value: string): Promise<void> {
.breadcrumb-link {
border: none;
background: transparent;
padding: 0;
padding: 4px 8px;
margin: -4px -8px;
font: inherit;
color: #4e5969;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
transition: color 0.2s ease;
border-radius: 6px;
transition: all 0.12s ease;
&:hover:not(:disabled) {
color: #07c05f;
color: #10b981;
background: #f6f8f7;
}
&:disabled {
cursor: not-allowed;
color: #c9ced6;
}
&.dropdown {
padding-right: 6px;
:deep(.t-icon) {
font-size: 14px;
transition: transform 0.12s ease;
}
&:hover:not(:disabled) {
:deep(.t-icon) {
transform: translateY(1px);
}
}
}
}
.breadcrumb-separator {
@@ -72,7 +72,7 @@
<!-- 卡片底部 -->
<div class="card-bottom">
<div class="type-badge" :class="{ 'document': (kb.type || 'document') === 'document', 'faq': kb.type === 'faq' }">
<t-icon :name="kb.type === 'faq' ? 'chat-bubble-help' : 'file'" size="14px" />
<t-icon :name="kb.type === 'faq' ? 'chat-bubble-help' : 'folder'" size="14px" />
<span>{{ kb.type === 'faq' ? $t('knowledgeEditor.basic.typeFAQ') : $t('knowledgeEditor.basic.typeDocument') }}</span>
</div>
<span class="card-time">{{ kb.updated_at }}</span>
@@ -2283,6 +2283,63 @@ watch(() => entries.value.map(e => ({
min-width: 120px;
}
}
/* 面包屑下拉菜单优化 */
.t-popup__content {
.t-dropdown__menu {
background: #ffffff;
border: 1px solid #e7e9eb;
border-radius: 10px;
box-shadow: 0 6px 28px rgba(15, 23, 42, 0.08);
padding: 6px;
min-width: 150px;
max-width: 200px;
}
.t-dropdown__item {
padding: 8px 12px;
border-radius: 6px;
margin: 2px 0;
transition: all 0.12s ease;
font-size: 13px;
color: #0f172a;
cursor: pointer;
min-width: auto !important;
max-width: 100% !important;
display: flex !important;
align-items: center;
width: 100%;
&:hover {
background: #f6f8f7;
color: #10b981;
}
.t-dropdown__item-icon {
flex-shrink: 0;
margin-right: 8px;
color: inherit;
display: flex;
align-items: center;
.t-icon {
font-size: 16px;
}
}
.t-dropdown__item-text {
color: inherit !important;
font-size: 13px !important;
line-height: 1.5 !important;
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
flex: 1;
min-width: 0;
display: block;
}
}
}
</style>
<style scoped lang="less">
.faq-manager {
@@ -2713,23 +2770,41 @@ watch(() => entries.value.map(e => ({
.breadcrumb-link {
border: none;
background: transparent;
padding: 0;
padding: 4px 8px;
margin: -4px -8px;
font: inherit;
color: #4e5969;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
transition: color 0.2s ease;
border-radius: 6px;
transition: all 0.12s ease;
&:hover:not(:disabled) {
color: #07c05f;
color: #10b981;
background: #f6f8f7;
}
&:disabled {
cursor: not-allowed;
color: #c9ced6;
}
&.dropdown {
padding-right: 6px;
:deep(.t-icon) {
font-size: 14px;
transition: transform 0.12s ease;
}
&:hover:not(:disabled) {
:deep(.t-icon) {
transform: translateY(1px);
}
}
}
}
.breadcrumb-separator {