From ff4dd3afbf5c0c7a439c71b0c494b81e0f2c70d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=87=AF=E9=BE=99?= <502431556@qq.com> Date: Fri, 21 Jan 2022 16:17:40 +0800 Subject: [PATCH] feat(Layout): Add cutMenu layout --- src/App.vue | 2 +- src/components/Logo/src/Logo.vue | 43 ++-- src/components/Menu/src/Menu.vue | 116 +++++++--- src/components/Setting/src/Setting.vue | 61 +++-- .../src/components/InterfaceDisplay.vue | 25 +-- .../src/components/LayoutRadioPicker.vue | 70 +++++- src/components/TabMenu/index.ts | 3 + src/components/TabMenu/src/TabMenu.vue | 211 ++++++++++++++++++ src/components/TabMenu/src/helper.ts | 52 +++++ src/components/TagsView/src/TagsView.vue | 20 +- src/config/app.ts | 12 +- src/layout/Layout.vue | 10 +- src/layout/components/ToolHeader.vue | 17 +- src/layout/components/useRenderLayout.tsx | 114 +++++++++- src/locales/en.ts | 3 +- src/locales/zh-CN.ts | 3 +- src/store/modules/app.ts | 12 +- src/store/modules/permission.ts | 10 +- src/styles/common.less | 8 + src/styles/index.less | 2 +- src/styles/var.css | 14 +- src/utils/tree.ts | 2 +- windi.config.ts | 72 +++--- 23 files changed, 711 insertions(+), 171 deletions(-) create mode 100644 src/components/TabMenu/index.ts create mode 100644 src/components/TabMenu/src/TabMenu.vue create mode 100644 src/components/TabMenu/src/helper.ts diff --git a/src/App.vue b/src/App.vue index 0cf6419..48b69c4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,7 +34,7 @@ initDark() html, body { - padding: 0; + padding: 0 !important; margin: 0; overflow: hidden; .size; diff --git a/src/components/Logo/src/Logo.vue b/src/components/Logo/src/Logo.vue index a3d7795..aa8febd 100644 --- a/src/components/Logo/src/Logo.vue +++ b/src/components/Logo/src/Logo.vue @@ -6,7 +6,7 @@ const appStore = useAppStore() const show = ref(true) -const title = computed(() => appStore.getLogoTitle) +const title = computed(() => appStore.getTitle) const layout = computed(() => appStore.getLayout) @@ -19,15 +19,30 @@ onMounted(() => { watch( () => collapse.value, (collapse: boolean) => { - if (layout.value !== 'classic') { + if (unref(layout) === 'topLeft' || unref(layout) === 'cutMenu') { + show.value = true + return + } + if (!collapse) { + setTimeout(() => { + show.value = !collapse + }, 400) + } else { + show.value = !collapse + } + } +) + +watch( + () => layout.value, + (layout) => { + if (layout === 'top' || layout === 'cutMenu') { show.value = true } else { - if (!collapse) { - setTimeout(() => { - show.value = !collapse - }, 400) + if (unref(collapse)) { + show.value = false } else { - show.value = !collapse + show.value = true } } } @@ -55,7 +70,8 @@ watch( 'ml-10px text-16px font-700', { 'text-[var(--logo-title-text-color)]': layout === 'classic', - 'text-[var(--top-header-text-color)]': layout === 'topLeft' + 'text-[var(--top-header-text-color)]': + layout === 'topLeft' || layout === 'top' || layout === 'cutMenu' } ]" > @@ -66,15 +82,4 @@ watch( diff --git a/src/components/Menu/src/Menu.vue b/src/components/Menu/src/Menu.vue index 9fae3c2..e278327 100644 --- a/src/components/Menu/src/Menu.vue +++ b/src/components/Menu/src/Menu.vue @@ -1,5 +1,5 @@