From fd4f54ed562854e2fa6483df8c761c0c34c871ea Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Mon, 1 Sep 2025 11:22:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?style:=20border=E9=A2=9C=E8=89=B2=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/img/agent/icon-history.png | Bin 0 -> 2043 bytes src/views/home/style.scss | 10 ++++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 src/assets/img/agent/icon-history.png diff --git a/src/assets/img/agent/icon-history.png b/src/assets/img/agent/icon-history.png new file mode 100644 index 0000000000000000000000000000000000000000..86f107852129ecb76afaa4b31ce24ea80d0e844c GIT binary patch literal 2043 zcmV;fC;1jfd0wB8Ao$)29dojhe3yg^- zx&c%qiiSobQC{YHp6AYU=cP04%-laN?C+PfbKmC9?Z4-o=RB{InSeVR<>LMOb}Gy4 zgzvV>(w2RD(O(zCdEYkQeq=oA`&S>*c`e7gY+|mthzB3oS^q;;{4-YSyOq}e;px~8 z42sgXzs(;r^nE?o*5`YlBO5qB;@;CRv7kZ7ITzA5&-pVf_G(xTx#2K<2hWXq-*yi; zOrzfS*@(|Aw>h`dGue=P3|=>ppuc=puKGL9C0DL*Qkdo;Dc4NI`G9nAQ<95Mtxu7yNbBU>k-C`orb&RBpDOuGn+1 z5|cQ&Gg}1pw5V0I?P`jddl7RY^1%Z$ZQJmdC}!bq{@C+~ISGA&{T%wp?NWZ|em1B&48ZEy5QO;K})4H}R?>@*GsF@vjiX#6l%RmrtWcpgDPPb*xiIw=R#U5~zBLK~OQd z;qp?dv?-^QR}o#Fq+Ul|Q^Msn6e+O>4V3a?5L66ZAY$sOCuNd`f{`Oya{A@9^o?MK z<}mtB3~7@X1QpZGLveix#85G~yqLW1LdH@hC_`~{5JSZjwRPh2 z5(<`S(^8~`1PP%U>KKZVY9J34!*E71btz8_)j$jt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FRogaLLaeL3ly>{x};}{0aRy<8OYoQ`At`bSSVSn}D)ATITm5usu z^z8SI#4fjfW_ay8KjL}&?vstUe#n2n%tYPs>n^UhtE~7#FZ&%&SctV{f4tp^|I1{) Ze*vv6G*38~MxX!y002ovPDHLkV1mL+$; Date: Mon, 1 Sep 2025 14:07:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?perf:=20sidebar=E7=BB=93=E6=9E=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/components/siderBar/index.vue | 46 +++++++++--------- src/layouts/components/siderBar/style.scss | 55 +++++++++++++--------- src/stores/modules/side-bar/index.ts | 9 ++-- 3 files changed, 61 insertions(+), 49 deletions(-) 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() {