refactor: Update dropdown functionality and styling in menu component
- Changed the upload action dropdown trigger from click to hover for improved user interaction. - Removed the popup component and integrated dropdown directly for a cleaner implementation. - Enhanced CSS styles for the dropdown menu to improve visual presentation and user experience.
This commit is contained in:
@@ -39,21 +39,19 @@
|
|||||||
{{ kb.name }}
|
{{ kb.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<t-popup overlayInnerClassName="upload-popup" class="placement top center" content="上传文档 / 在线编辑(支持拖拽上传)"
|
<t-dropdown
|
||||||
placement="top" show-arrow destroy-on-close>
|
v-if="item.path === 'knowledge-bases' && $route.name === 'knowledgeBaseDetail'"
|
||||||
<t-dropdown
|
trigger="hover"
|
||||||
v-if="item.path === 'knowledge-bases' && $route.name === 'knowledgeBaseDetail'"
|
:options="uploadActionOptions"
|
||||||
trigger="click"
|
placement="right"
|
||||||
:options="uploadActionOptions"
|
@click="handleUploadAction"
|
||||||
placement="right"
|
class="upload-action-dropdown-trigger"
|
||||||
@click="handleUploadAction"
|
>
|
||||||
>
|
<div class="upload-file-wrap" variant="outline">
|
||||||
<div class="upload-file-wrap" variant="outline">
|
<img class="upload-file-icon" :class="[item.path == currentpath ? 'active-upload' : '']"
|
||||||
<img class="upload-file-icon" :class="[item.path == currentpath ? 'active-upload' : '']"
|
:src="getImgSrc(fileAddIcon)" alt="">
|
||||||
:src="getImgSrc(fileAddIcon)" alt="">
|
</div>
|
||||||
</div>
|
</t-dropdown>
|
||||||
</t-dropdown>
|
|
||||||
</t-popup>
|
|
||||||
</div>
|
</div>
|
||||||
<div ref="submenuscrollContainer" @scroll="handleScroll" class="submenu" v-if="item.children">
|
<div ref="submenuscrollContainer" @scroll="handleScroll" class="submenu" v-if="item.children">
|
||||||
<template v-for="(group, groupIndex) in groupedSessions" :key="groupIndex">
|
<template v-for="(group, groupIndex) in groupedSessions" :key="groupIndex">
|
||||||
@@ -1099,21 +1097,46 @@ watch(() => route.params.kbId, () => {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.upload-popup {
|
// 上传操作下拉菜单样式 - 全局样式(因为 TDesign 的下拉菜单挂载到 body 上)
|
||||||
background-color: rgba(0, 0, 0, 0.9);
|
// 使用更具体的选择器来匹配上传操作下拉菜单
|
||||||
color: #FFFFFF;
|
.t-popup[data-popper-placement^="right"] {
|
||||||
border-color: rgba(0, 0, 0, 0.9) !important;
|
.t-popup__content {
|
||||||
box-shadow: none;
|
.t-dropdown__menu {
|
||||||
margin-bottom: 10px !important;
|
background: #ffffff !important;
|
||||||
|
border: 1px solid #e5e7eb !important;
|
||||||
|
border-radius: 6px !important;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
||||||
|
padding: 4px !important;
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.t-popup__arrow::before {
|
.t-dropdown__item {
|
||||||
border-color: rgba(0, 0, 0, 0.9) !important;
|
padding: 8px 12px !important;
|
||||||
background-color: rgba(0, 0, 0, 0.9) !important;
|
border-radius: 4px !important;
|
||||||
box-shadow: none !important;
|
margin: 2px 0 !important;
|
||||||
|
transition: all 0.2s ease !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
color: #333333 !important;
|
||||||
|
min-width: auto !important;
|
||||||
|
max-width: none !important;
|
||||||
|
width: auto !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f5f7fa !important;
|
||||||
|
color: #07c05f !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-dropdown__item-text {
|
||||||
|
color: inherit !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
line-height: 20px !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 退出登录确认框样式
|
// 退出登录确认框样式
|
||||||
:deep(.t-popconfirm) {
|
:deep(.t-popconfirm) {
|
||||||
.t-popconfirm__content {
|
.t-popconfirm__content {
|
||||||
|
|||||||
Reference in New Issue
Block a user