mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix:优化了dropdown的弹窗
- ActionDropdown.vue:位置计算调整,优先向右展开并增加 8px 间距,减少遮挡左侧内容;下拉全局互斥仍保留。 - 账户页面:列表下拉/卡片已无“请求时间线”入口,只保留详情弹窗顶部按钮。
This commit is contained in:
@@ -116,7 +116,8 @@ const updateDropdownPosition = () => {
|
|||||||
|
|
||||||
const trigger = triggerRef.value.getBoundingClientRect()
|
const trigger = triggerRef.value.getBoundingClientRect()
|
||||||
const dropdownHeight = 200 // 预估高度
|
const dropdownHeight = 200 // 预估高度
|
||||||
const dropdownWidth = 160 // 预估宽度
|
const dropdownWidth = 180 // 预估宽度,略大以减少遮挡
|
||||||
|
const gap = 8
|
||||||
const spaceBelow = window.innerHeight - trigger.bottom
|
const spaceBelow = window.innerHeight - trigger.bottom
|
||||||
const spaceAbove = trigger.top
|
const spaceAbove = trigger.top
|
||||||
const spaceRight = window.innerWidth - trigger.right
|
const spaceRight = window.innerWidth - trigger.right
|
||||||
@@ -126,16 +127,16 @@ const updateDropdownPosition = () => {
|
|||||||
|
|
||||||
// 计算垂直位置
|
// 计算垂直位置
|
||||||
if (spaceBelow >= dropdownHeight || spaceBelow >= spaceAbove) {
|
if (spaceBelow >= dropdownHeight || spaceBelow >= spaceAbove) {
|
||||||
top = trigger.bottom + 4
|
top = trigger.bottom + gap
|
||||||
} else {
|
} else {
|
||||||
top = trigger.top - dropdownHeight - 4
|
top = trigger.top - dropdownHeight - gap
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算水平位置 - 优先显示在左侧(因为按钮在右侧固定列)
|
// 计算水平位置 - 优先向右展开,避免遮挡左侧内容
|
||||||
if (spaceLeft >= dropdownWidth) {
|
if (spaceRight >= dropdownWidth + gap) {
|
||||||
left = trigger.left - dropdownWidth + trigger.width
|
left = trigger.right + gap
|
||||||
} else if (spaceRight >= dropdownWidth) {
|
} else if (spaceLeft >= dropdownWidth + gap) {
|
||||||
left = trigger.left
|
left = trigger.left - dropdownWidth - gap + trigger.width
|
||||||
} else {
|
} else {
|
||||||
left = window.innerWidth - dropdownWidth - 10
|
left = window.innerWidth - dropdownWidth - 10
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user