diff --git a/src/assets/img/agent/icon-history.png b/src/assets/img/agent/icon-history.png new file mode 100644 index 0000000..86f1078 Binary files /dev/null and b/src/assets/img/agent/icon-history.png differ diff --git a/src/layouts/components/siderBar/index.vue b/src/layouts/components/siderBar/index.vue index 8b130ff..3c7aea2 100644 --- a/src/layouts/components/siderBar/index.vue +++ b/src/layouts/components/siderBar/index.vue @@ -96,7 +96,7 @@ export default defineComponent({ const renderMenuList = () => { return currentMenuList.value.map((item) => { if (!item.children) { - return renderMenuItem(item, sidebarStore.menuCollapse); + return renderMenuItem(item, collapsed.value); } return ( - {renderMenuItem(item, sidebarStore.menuCollapse)} + {renderMenuItem(item, collapsed.value)} ); }); @@ -161,39 +161,39 @@ export default defineComponent({ trigger onCollapse={setCollapsed} > - + {showAiSearch.value && ( <> - {!sidebarStore.menuCollapse && ( - 开始工作 - )} + {!collapsed.value && 开始工作}
)}
-
-
{ - sidebarStore.setMenuCollapse(); - }} - > - {sidebarStore.menuCollapse ? ( - - ) : ( - - )} - {!sidebarStore.menuCollapse && 收起} -
-
+
+
{ + sidebarStore.setMenuCollapse(); + }} + > + {collapsed.value ? ( + + ) : ( + + )} + {!collapsed.value && 收起} +
+
); }, diff --git a/src/layouts/components/siderBar/style.scss b/src/layouts/components/siderBar/style.scss index b632b2b..0de0bb1 100644 --- a/src/layouts/components/siderBar/style.scss +++ b/src/layouts/components/siderBar/style.scss @@ -44,30 +44,39 @@ background-color: transparent; } } -.siderBar-wrap { - background: transparent !important; - border: none !important; - color: inherit; - .cts { - color: #211f24; - font-family: $font-family-regular; - font-size: 14px; - font-style: normal; - font-weight: 400; - line-height: 22px; - } - .menu-item { - @include menu-item; - } - .line { - opacity: 0.06; - } - .fold-btn { - &:hover { - .cts, - .icon { - color: #6d4cfe !important; +.ant-layout-sider { + .ant-layout-sider-children { + position: relative; + // padding: 16px 0; + .siderBar-wrap { + background: transparent !important; + border: none !important; + color: inherit; + .cts { + color: #211f24; + font-family: $font-family-regular; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + .menu-item { + @include menu-item; + } + .line { + opacity: 0.06; + } + + } + .fold-btn { + &:hover { + .cts, + .icon { + color: #6d4cfe !important; + } } } } } + + diff --git a/src/stores/modules/side-bar/index.ts b/src/stores/modules/side-bar/index.ts index a882f71..75dca17 100644 --- a/src/stores/modules/side-bar/index.ts +++ b/src/stores/modules/side-bar/index.ts @@ -15,6 +15,7 @@ interface sidebarState { currentMenuList: any[]; unreadInfo: number[]; menuCollapse: boolean; + hasMenuList: boolean; } let unreadInfoTimer: number | null = null; @@ -25,11 +26,12 @@ export const useSidebarStore = defineStore('sidebar', { currentMenuList: [], // 菜单信息 unreadInfo: [], // 未读消息 menuCollapse: false, // 菜单是否折叠 + hasMenuList: true, // 是否有菜单 }), getters: { showSider(): boolean { const route = router.currentRoute.value; - return !route.meta?.hideSidebar && this.currentMenuList.length > 0; + return !route.meta?.hideSidebar && this.hasMenuList; }, sidebarWidth(): number { if (!this.showSider) return 0; @@ -49,8 +51,9 @@ export const useSidebarStore = defineStore('sidebar', { clearMenuCollapse() { this.menuCollapse = false; }, - setCurrentMenuList(val: any[]) { - this.currentMenuList = val; + setCurrentMenuList(newMenuList: any[]) { + this.currentMenuList = newMenuList; + this.hasMenuList = newMenuList.length > 0; }, // navbar菜单列表由企业对应权限决定 // getUserNavbarMenuList() { diff --git a/src/views/home/style.scss b/src/views/home/style.scss index 867ae96..c4bd732 100644 --- a/src/views/home/style.scss +++ b/src/views/home/style.scss @@ -3,10 +3,12 @@ backdrop-filter: blur(20px); background: rgba(255, 255, 255, 0.9); .history-conversation-btn { - border-radius: 8px 0 0 8px; - border-top: 1px solid #eabaff; - border-bottom: 1px solid #eabaff; - border-left: 1px solid #eabaff; + background: url('@/assets/img/agent/icon-history.png') center center no-repeat; + background-size: cover; + // border-radius: 8px 0 0 8px; + // border-top: 1px solid #eabaff; + // border-bottom: 1px solid #88DDFF; + // border-left: 1px solid #AC8EFF; position: absolute; top: 50%; right: 0;