refactor: enhance ListSpaceSidebar and related components for improved UI and functionality
- Updated ListSpaceSidebar to support a pinned state and improved hover interactions, enhancing user experience. - Refactored tooltip components for better visibility and accessibility across different modes (resource, organization). - Adjusted AgentList, KnowledgeBaseList, and OrganizationList to include consistent styling and layout improvements, ensuring a cohesive design. This update improves the overall usability and visual consistency of the sidebar and related views.
This commit is contained in:
@@ -1,147 +1,153 @@
|
|||||||
<template>
|
<template>
|
||||||
<aside class="list-space-sidebar" :class="{ collapsed }">
|
<div
|
||||||
<!-- 折叠/展开按钮:浮在右侧边缘垂直居中 -->
|
class="list-space-sidebar"
|
||||||
<div class="sidebar-toggle" @click="toggleCollapse">
|
:class="{ pinned }"
|
||||||
<t-icon :name="collapsed ? 'chevron-right' : 'chevron-left'" size="14px" />
|
@mouseenter="onMouseEnter"
|
||||||
</div>
|
@mouseleave="onMouseLeave"
|
||||||
|
>
|
||||||
<!-- ========== 折叠态:44px 图标工具条 ========== -->
|
<!-- Icon strip: hidden when pinned (panel takes over) -->
|
||||||
<template v-if="collapsed">
|
<div v-show="!pinned" class="icon-strip">
|
||||||
<div class="icon-strip">
|
<template v-if="mode !== 'resource'">
|
||||||
<!-- 组织模式:全部 -->
|
<t-tooltip :content="tooltipText($t('listSpaceSidebar.all'), countAll)" placement="right" :show-arrow="false">
|
||||||
<t-tooltip v-if="mode !== 'resource'" :content="tooltipText($t('listSpaceSidebar.all'), countAll)" placement="right">
|
|
||||||
<div class="icon-item" :class="{ active: selected === 'all' }" @click="select('all')">
|
<div class="icon-item" :class="{ active: selected === 'all' }" @click="select('all')">
|
||||||
<t-icon name="layers" size="16px" />
|
<t-icon name="layers" size="16px" />
|
||||||
</div>
|
</div>
|
||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 资源模式:我的 + 共享给我 + 空间 -->
|
|
||||||
<template v-if="mode === 'resource'">
|
|
||||||
<t-tooltip :content="tooltipText($t('listSpaceSidebar.mine'), countMine)" placement="right">
|
|
||||||
<div class="icon-item" :class="{ active: selected === 'mine' }" @click="select('mine')">
|
|
||||||
<t-icon name="user" size="16px" />
|
|
||||||
</div>
|
|
||||||
</t-tooltip>
|
|
||||||
<t-tooltip v-if="countShared !== undefined && countShared > 0" :content="tooltipText($t('listSpaceSidebar.sharedToMe'), countShared)" placement="right">
|
|
||||||
<div class="icon-item" :class="{ active: selected === 'shared' }" @click="select('shared')">
|
|
||||||
<t-icon name="share" size="16px" />
|
|
||||||
</div>
|
|
||||||
</t-tooltip>
|
|
||||||
<template v-if="organizationsWithCount.length">
|
|
||||||
<div class="icon-strip-divider" />
|
|
||||||
<t-tooltip v-for="org in organizationsWithCount" :key="org.id" :content="tooltipText(org.name, getOrgCount(org.id))" placement="right">
|
|
||||||
<div class="icon-item" :class="{ active: selected === org.id }" @click="select(org.id)">
|
|
||||||
<SpaceAvatar :name="org.name" :avatar="org.avatar" size="small" />
|
|
||||||
</div>
|
|
||||||
</t-tooltip>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- 组织模式:我创建的 + 我加入的 -->
|
|
||||||
<template v-else>
|
|
||||||
<t-tooltip :content="tooltipText($t('organization.createdByMe'), countCreated)" placement="right">
|
|
||||||
<div class="icon-item" :class="{ active: selected === 'created' }" @click="select('created')">
|
|
||||||
<t-icon name="usergroup-add" size="16px" />
|
|
||||||
</div>
|
|
||||||
</t-tooltip>
|
|
||||||
<t-tooltip :content="tooltipText($t('organization.joinedByMe'), countJoined)" placement="right">
|
|
||||||
<div class="icon-item" :class="{ active: selected === 'joined' }" @click="select('joined')">
|
|
||||||
<t-icon name="usergroup" size="16px" />
|
|
||||||
</div>
|
|
||||||
</t-tooltip>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- ========== 展开态:200px 完整侧边栏 ========== -->
|
|
||||||
<template v-else>
|
|
||||||
<nav class="sidebar-nav">
|
|
||||||
<div
|
|
||||||
v-if="mode !== 'resource'"
|
|
||||||
class="sidebar-item"
|
|
||||||
:class="{ active: selected === 'all' }"
|
|
||||||
@click="select('all')"
|
|
||||||
>
|
|
||||||
<div class="item-left">
|
|
||||||
<t-icon name="layers" class="item-icon" />
|
|
||||||
<span class="item-label">{{ $t('listSpaceSidebar.all') }}</span>
|
|
||||||
</div>
|
|
||||||
<span v-if="countAll !== undefined" class="item-count">{{ countAll }}</span>
|
|
||||||
</div>
|
|
||||||
<template v-if="mode === 'resource'">
|
<template v-if="mode === 'resource'">
|
||||||
<div
|
<t-tooltip :content="tooltipText($t('listSpaceSidebar.mine'), countMine)" placement="right" :show-arrow="false">
|
||||||
class="sidebar-item"
|
<div class="icon-item" :class="{ active: selected === 'mine' }" @click="select('mine')">
|
||||||
:class="{ active: selected === 'mine' }"
|
<t-icon name="user" size="16px" />
|
||||||
@click="select('mine')"
|
|
||||||
>
|
|
||||||
<div class="item-left">
|
|
||||||
<t-icon name="user" class="item-icon" />
|
|
||||||
<span class="item-label">{{ $t('listSpaceSidebar.mine') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<span v-if="countMine !== undefined" class="item-count">{{ countMine }}</span>
|
</t-tooltip>
|
||||||
</div>
|
<t-tooltip v-if="countShared !== undefined && countShared > 0" :content="tooltipText($t('listSpaceSidebar.sharedToMe'), countShared)" placement="right" :show-arrow="false">
|
||||||
<div
|
<div class="icon-item" :class="{ active: selected === 'shared' }" @click="select('shared')">
|
||||||
v-if="countShared !== undefined && countShared > 0"
|
<t-icon name="share" size="16px" />
|
||||||
class="sidebar-item"
|
|
||||||
:class="{ active: selected === 'shared' }"
|
|
||||||
@click="select('shared')"
|
|
||||||
>
|
|
||||||
<div class="item-left">
|
|
||||||
<t-icon name="share" class="item-icon" />
|
|
||||||
<span class="item-label">{{ $t('listSpaceSidebar.sharedToMe') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<span class="item-count">{{ countShared }}</span>
|
</t-tooltip>
|
||||||
</div>
|
|
||||||
<template v-if="organizationsWithCount.length">
|
<template v-if="organizationsWithCount.length">
|
||||||
<div class="sidebar-section">
|
<div class="icon-strip-divider" />
|
||||||
<span class="section-title">{{ $t('listSpaceSidebar.spaces') }}</span>
|
<t-tooltip v-for="org in organizationsWithCount" :key="org.id" :content="tooltipText(org.name, getOrgCount(org.id))" placement="right" :show-arrow="false">
|
||||||
|
<div class="icon-item" :class="{ active: selected === org.id }" @click="select(org.id)">
|
||||||
|
<SpaceAvatar :name="org.name" :avatar="org.avatar" size="small" />
|
||||||
|
</div>
|
||||||
|
</t-tooltip>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<t-tooltip :content="tooltipText($t('organization.createdByMe'), countCreated)" placement="right" :show-arrow="false">
|
||||||
|
<div class="icon-item" :class="{ active: selected === 'created' }" @click="select('created')">
|
||||||
|
<t-icon name="usergroup-add" size="16px" />
|
||||||
</div>
|
</div>
|
||||||
|
</t-tooltip>
|
||||||
|
<t-tooltip :content="tooltipText($t('organization.joinedByMe'), countJoined)" placement="right" :show-arrow="false">
|
||||||
|
<div class="icon-item" :class="{ active: selected === 'joined' }" @click="select('joined')">
|
||||||
|
<t-icon name="usergroup" size="16px" />
|
||||||
|
</div>
|
||||||
|
</t-tooltip>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Expanded panel: floats over content on hover, or stays when pinned -->
|
||||||
|
<Transition name="sb-expand">
|
||||||
|
<aside v-if="expanded || pinned" class="expanded-panel" :class="{ pinned }">
|
||||||
|
<div class="panel-pin" @click.stop="togglePin">
|
||||||
|
<t-tooltip :content="pinned ? $t('listSpaceSidebar.unpin', 'Unpin') : $t('listSpaceSidebar.pin', 'Pin')" placement="right" :show-arrow="false">
|
||||||
|
<t-icon :name="pinned ? 'pin-filled' : 'pin'" size="14px" />
|
||||||
|
</t-tooltip>
|
||||||
|
</div>
|
||||||
|
<nav class="sidebar-nav">
|
||||||
<div
|
<div
|
||||||
v-for="org in organizationsWithCount"
|
v-if="mode !== 'resource'"
|
||||||
:key="org.id"
|
class="sidebar-item"
|
||||||
class="sidebar-item org-item"
|
:class="{ active: selected === 'all' }"
|
||||||
:class="{ active: selected === org.id }"
|
@click="select('all')"
|
||||||
@click="select(org.id)"
|
|
||||||
>
|
>
|
||||||
<div class="item-left">
|
<div class="item-left">
|
||||||
<SpaceAvatar :name="org.name" :avatar="org.avatar" size="small" class="item-avatar" />
|
<t-icon name="layers" class="item-icon" />
|
||||||
<span class="item-label" :title="org.name">{{ org.name }}</span>
|
<span class="item-label">{{ $t('listSpaceSidebar.all') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span v-if="getOrgCount(org.id) !== undefined" class="item-count">{{ getOrgCount(org.id) }}</span>
|
<span v-if="countAll !== undefined" class="item-count">{{ countAll }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
</template>
|
<template v-if="mode === 'resource'">
|
||||||
<template v-else>
|
<div
|
||||||
<div
|
class="sidebar-item"
|
||||||
class="sidebar-item"
|
:class="{ active: selected === 'mine' }"
|
||||||
:class="{ active: selected === 'created' }"
|
@click="select('mine')"
|
||||||
@click="select('created')"
|
>
|
||||||
>
|
<div class="item-left">
|
||||||
<div class="item-left">
|
<t-icon name="user" class="item-icon" />
|
||||||
<t-icon name="usergroup-add" class="item-icon" />
|
<span class="item-label">{{ $t('listSpaceSidebar.mine') }}</span>
|
||||||
<span class="item-label">{{ $t('organization.createdByMe') }}</span>
|
</div>
|
||||||
</div>
|
<span v-if="countMine !== undefined" class="item-count">{{ countMine }}</span>
|
||||||
<span v-if="countCreated !== undefined" class="item-count">{{ countCreated }}</span>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<div
|
v-if="countShared !== undefined && countShared > 0"
|
||||||
class="sidebar-item"
|
class="sidebar-item"
|
||||||
:class="{ active: selected === 'joined' }"
|
:class="{ active: selected === 'shared' }"
|
||||||
@click="select('joined')"
|
@click="select('shared')"
|
||||||
>
|
>
|
||||||
<div class="item-left">
|
<div class="item-left">
|
||||||
<t-icon name="usergroup" class="item-icon" />
|
<t-icon name="share" class="item-icon" />
|
||||||
<span class="item-label">{{ $t('organization.joinedByMe') }}</span>
|
<span class="item-label">{{ $t('listSpaceSidebar.sharedToMe') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span v-if="countJoined !== undefined" class="item-count">{{ countJoined }}</span>
|
<span class="item-count">{{ countShared }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<template v-if="organizationsWithCount.length">
|
||||||
</nav>
|
<div class="sidebar-section">
|
||||||
</template>
|
<span class="section-title">{{ $t('listSpaceSidebar.spaces') }}</span>
|
||||||
</aside>
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="org in organizationsWithCount"
|
||||||
|
:key="org.id"
|
||||||
|
class="sidebar-item org-item"
|
||||||
|
:class="{ active: selected === org.id }"
|
||||||
|
@click="select(org.id)"
|
||||||
|
>
|
||||||
|
<div class="item-left">
|
||||||
|
<SpaceAvatar :name="org.name" :avatar="org.avatar" size="small" class="item-avatar" />
|
||||||
|
<span class="item-label" :title="org.name">{{ org.name }}</span>
|
||||||
|
</div>
|
||||||
|
<span v-if="getOrgCount(org.id) !== undefined" class="item-count">{{ getOrgCount(org.id) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<div
|
||||||
|
class="sidebar-item"
|
||||||
|
:class="{ active: selected === 'created' }"
|
||||||
|
@click="select('created')"
|
||||||
|
>
|
||||||
|
<div class="item-left">
|
||||||
|
<t-icon name="usergroup-add" class="item-icon" />
|
||||||
|
<span class="item-label">{{ $t('organization.createdByMe') }}</span>
|
||||||
|
</div>
|
||||||
|
<span v-if="countCreated !== undefined" class="item-count">{{ countCreated }}</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="sidebar-item"
|
||||||
|
:class="{ active: selected === 'joined' }"
|
||||||
|
@click="select('joined')"
|
||||||
|
>
|
||||||
|
<div class="item-left">
|
||||||
|
<t-icon name="usergroup" class="item-icon" />
|
||||||
|
<span class="item-label">{{ $t('organization.joinedByMe') }}</span>
|
||||||
|
</div>
|
||||||
|
<span v-if="countJoined !== undefined" class="item-count">{{ countJoined }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
</Transition>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import { Icon as TIcon } from 'tdesign-vue-next'
|
import { Icon as TIcon } from 'tdesign-vue-next'
|
||||||
import SpaceAvatar from './SpaceAvatar.vue'
|
import SpaceAvatar from './SpaceAvatar.vue'
|
||||||
import { useOrganizationStore } from '@/stores/organization'
|
import { useOrganizationStore } from '@/stores/organization'
|
||||||
@@ -161,13 +167,37 @@ const props = withDefaults(
|
|||||||
{ mode: 'resource', collapsedKey: 'sidebar-collapsed-list', countAll: undefined, countMine: undefined, countShared: undefined, countByOrg: () => ({}), countCreated: undefined, countJoined: undefined }
|
{ mode: 'resource', collapsedKey: 'sidebar-collapsed-list', countAll: undefined, countMine: undefined, countShared: undefined, countByOrg: () => ({}), countCreated: undefined, countJoined: undefined }
|
||||||
)
|
)
|
||||||
|
|
||||||
const collapsed = ref(localStorage.getItem(props.collapsedKey) === 'true')
|
const pinStorageKey = props.collapsedKey + '-pinned'
|
||||||
|
const pinned = ref(localStorage.getItem(pinStorageKey) === 'true')
|
||||||
|
const expanded = ref(pinned.value)
|
||||||
|
let enterTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
|
let leaveTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
|
|
||||||
function toggleCollapse() {
|
function togglePin() {
|
||||||
collapsed.value = !collapsed.value
|
pinned.value = !pinned.value
|
||||||
localStorage.setItem(props.collapsedKey, String(collapsed.value))
|
localStorage.setItem(pinStorageKey, String(pinned.value))
|
||||||
|
if (pinned.value) {
|
||||||
|
expanded.value = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onMouseEnter() {
|
||||||
|
if (pinned.value) return
|
||||||
|
if (leaveTimer) { clearTimeout(leaveTimer); leaveTimer = null }
|
||||||
|
enterTimer = setTimeout(() => { expanded.value = true }, 180)
|
||||||
|
}
|
||||||
|
|
||||||
|
function onMouseLeave() {
|
||||||
|
if (pinned.value) return
|
||||||
|
if (enterTimer) { clearTimeout(enterTimer); enterTimer = null }
|
||||||
|
leaveTimer = setTimeout(() => { expanded.value = false }, 250)
|
||||||
|
}
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
if (enterTimer) clearTimeout(enterTimer)
|
||||||
|
if (leaveTimer) clearTimeout(leaveTimer)
|
||||||
|
})
|
||||||
|
|
||||||
function tooltipText(name: string, count?: number): string {
|
function tooltipText(name: string, count?: number): string {
|
||||||
return count !== undefined ? `${name} (${count})` : name
|
return count !== undefined ? `${name} (${count})` : name
|
||||||
}
|
}
|
||||||
@@ -205,63 +235,29 @@ onMounted(() => {
|
|||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.list-space-sidebar {
|
.list-space-sidebar {
|
||||||
position: relative;
|
width: 44px;
|
||||||
width: 200px;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
background: #fff;
|
position: relative;
|
||||||
padding: 24px 16px 16px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow: visible;
|
z-index: 10;
|
||||||
transition: width 0.2s ease, padding 0.2s ease;
|
transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
|
||||||
&.collapsed {
|
&.pinned {
|
||||||
width: 44px;
|
width: 208px;
|
||||||
padding: 24px 0 8px;
|
margin-right: 16px;
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 浮动折叠/展开按钮 */
|
/* ========== Icon strip (always visible, 44px) ========== */
|
||||||
.sidebar-toggle {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
right: -10px;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #fff;
|
|
||||||
border: 1px solid #e5e9f2;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 2;
|
|
||||||
color: #86909c;
|
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
.list-space-sidebar:hover & {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: #f2f4f7;
|
|
||||||
color: #1d2129;
|
|
||||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== 折叠态图标工具条 ========== */
|
|
||||||
.icon-strip {
|
.icon-strip {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 2px;
|
||||||
width: 100%;
|
width: 44px;
|
||||||
|
padding: 20px 0 8px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@@ -276,26 +272,26 @@ onMounted(() => {
|
|||||||
.icon-item {
|
.icon-item {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border-radius: 6px;
|
border-radius: 7px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #5c6470;
|
color: #6b7482;
|
||||||
transition: all 0.15s ease;
|
transition: all 0.15s ease;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #f2f4f7;
|
background: #f5f7fa;
|
||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
background: #e6f7ec;
|
background: #eef9f2;
|
||||||
color: #07c05f;
|
color: #07c05f;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #d4f4e3;
|
background: #e4f5ea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,21 +303,25 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon-strip-divider {
|
.icon-strip-divider {
|
||||||
width: 20px;
|
width: 18px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background: #e7ebf0;
|
background: #e7ebf0;
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 展开态 ========== */
|
/* ========== Expanded floating panel ========== */
|
||||||
|
.expanded-panel {
|
||||||
.sidebar-nav {
|
position: absolute;
|
||||||
display: flex;
|
top: 0;
|
||||||
flex-direction: column;
|
left: 0;
|
||||||
gap: 5px;
|
bottom: 0;
|
||||||
flex: 1;
|
width: 208px;
|
||||||
min-height: 0;
|
background: #fff;
|
||||||
|
box-shadow: 3px 0 18px rgba(0, 0, 0, 0.07), 1px 0 0 #e7ebf0;
|
||||||
|
border-radius: 0 10px 10px 0;
|
||||||
|
padding: 30px 10px 16px 10px;
|
||||||
|
z-index: 11;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
@@ -329,17 +329,83 @@ onMounted(() => {
|
|||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.pinned {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
flex: 1;
|
||||||
|
box-shadow: none;
|
||||||
|
border-right: 1px solid #eef1f5;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pin button */
|
||||||
|
.panel-pin {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #b0b7c0;
|
||||||
|
transition: all 0.15s ease;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f5f7fa;
|
||||||
|
color: #4e5662;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pinned & {
|
||||||
|
color: #07c05f;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #eef9f2;
|
||||||
|
color: #059b4c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========== Transition ========== */
|
||||||
|
.sb-expand-enter-active {
|
||||||
|
transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sb-expand-leave-active {
|
||||||
|
transition: opacity 0.15s ease, transform 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sb-expand-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-8px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sb-expand-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-6px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========== Nav items inside expanded panel ========== */
|
||||||
|
.sidebar-nav {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-item {
|
.sidebar-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 9px 12px;
|
padding: 8px 10px;
|
||||||
border-radius: 6px;
|
border-radius: 7px;
|
||||||
color: #2d3139;
|
color: #3f4652;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.15s ease;
|
||||||
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
@@ -356,7 +422,7 @@ onMounted(() => {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
color: #5c6470;
|
color: #5c6470;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
transition: color 0.2s ease;
|
transition: color 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-avatar {
|
.item-avatar {
|
||||||
@@ -369,27 +435,26 @@ onMounted(() => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
font-size: 13px;
|
||||||
font-size: 14px;
|
font-weight: 430;
|
||||||
font-weight: 450;
|
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
letter-spacing: 0.01em;
|
letter-spacing: 0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-count {
|
.item-count {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #5c6470;
|
color: #6b7482;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding: 3px 7px;
|
padding: 2px 7px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: #eef0f3;
|
background: #f4f6f8;
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #f2f4f7;
|
background: #f5f7fa;
|
||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
|
|
||||||
.item-icon {
|
.item-icon {
|
||||||
@@ -397,15 +462,14 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item-count {
|
.item-count {
|
||||||
background: #e5e9f2;
|
background: #edf1f5;
|
||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
background: #e6f7ec;
|
background: #eef9f2;
|
||||||
color: #07c05f;
|
color: #07c05f;
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
.item-icon {
|
.item-icon {
|
||||||
color: #07c05f;
|
color: #07c05f;
|
||||||
@@ -416,21 +480,21 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item-count {
|
.item-count {
|
||||||
background: #b8f0d3;
|
background: #e4f5ea;
|
||||||
color: #07c05f;
|
color: #2f9d67;
|
||||||
font-weight: 600;
|
font-weight: 520;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #d4f4e3;
|
background: #e4f5ea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section {
|
.sidebar-section {
|
||||||
padding: 10px 8px 2px;
|
padding: 10px 8px 3px;
|
||||||
margin-top: 4px;
|
margin-top: 2px;
|
||||||
border-top: 1px solid #e7ebf0;
|
border-top: 1px solid #eef1f5;
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<span class="btn-icon-wrapper">
|
<span class="btn-icon-wrapper">
|
||||||
<svg class="sparkles-icon" width="16" height="16" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg class="sparkles-icon" width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M10 3L10.8 6.2C10.9 6.7 11.3 7.1 11.8 7.2L15 8L11.8 8.8C11.3 8.9 10.9 9.3 10.8 9.8L10 13L9.2 9.8C9.1 9.3 8.7 8.9 8.2 8.8L5 8L8.2 7.2C8.7 7.1 9.1 6.7 9.2 6.2L10 3Z" fill="currentColor" stroke="currentColor" stroke-width="0.8" stroke-linecap="round" stroke-linejoin="round"/>
|
<path d="M10 3L10.8 6.2C10.9 6.7 11.3 7.1 11.8 7.2L15 8L11.8 8.8C11.3 8.9 10.9 9.3 10.8 9.8L10 13L9.2 9.8C9.1 9.3 8.7 8.9 8.2 8.8L5 8L8.2 7.2C8.7 7.1 9.1 6.7 9.2 6.2L10 3Z" fill="currentColor" stroke="currentColor" stroke-width="0.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
<path d="M15.5 4L15.8 5.2C15.85 5.45 16.05 5.65 16.3 5.7L17.5 6L16.3 6.3C16.05 6.35 15.85 6.55 15.8 6.8L15.5 8L15.2 6.8C15.15 6.55 14.95 6.35 14.7 6.3L13.5 6L14.7 5.7C14.95 5.65 15.15 5.45 15.2 5.2L15.5 4Z" fill="currentColor" stroke="currentColor" stroke-width="0.6" stroke-linecap="round" stroke-linejoin="round"/>
|
<path d="M15.5 4L15.8 5.2C15.85 5.45 16.05 5.65 16.3 5.7L17.5 6L16.3 6.3C16.05 6.35 15.85 6.55 15.8 6.8L15.5 8L15.2 6.8C15.15 6.55 14.95 6.35 14.7 6.3L13.5 6L14.7 5.7C14.95 5.65 15.15 5.45 15.2 5.2L15.5 4Z" fill="currentColor" stroke="currentColor" stroke-width="0.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
<path d="M4.5 13L4.8 14.2C4.85 14.45 5.05 14.65 5.3 14.7L6.5 15L5.3 15.3C5.05 15.35 4.85 15.55 4.8 15.8L4.5 17L4.2 15.8C4.15 15.55 3.95 15.35 3.7 15.3L2.5 15L3.7 14.7C3.95 14.65 4.15 14.45 4.2 14.2L4.5 13Z" fill="currentColor" stroke="currentColor" stroke-width="0.6" stroke-linecap="round" stroke-linejoin="round"/>
|
<path d="M4.5 13L4.8 14.2C4.85 14.45 5.05 14.65 5.3 14.7L6.5 15L5.3 15.3C5.05 15.35 4.85 15.55 4.8 15.8L4.5 17L4.2 15.8C4.15 15.55 3.95 15.35 3.7 15.3L2.5 15L3.7 14.7C3.95 14.65 4.15 14.45 4.2 14.2L4.5 13Z" fill="currentColor" stroke="currentColor" stroke-width="0.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
@@ -930,6 +930,7 @@ defineExpose({
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1088,9 +1089,20 @@ defineExpose({
|
|||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.t-button__icon) {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.t-icon),
|
:deep(.t-icon),
|
||||||
:deep(.btn-icon-wrapper) {
|
:deep(.btn-icon-wrapper) {
|
||||||
color: #07c05f;
|
color: #07c05f;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1151,6 +1151,7 @@ const handleUploadFinishedEvent = (event: Event) => {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1224,6 +1224,7 @@ onUnmounted(() => {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user