Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sdmu-gaoqi authored Jan 19, 2024
2 parents e867ad7 + 0f6ae63 commit 1b09307
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions src/components/layout/layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
collapsedWidth="40"
>
<!-- 菜单栏区域 -->
<a-menu mode="inline" :style="{ height: '100%', borderRight: 0 }">
<a-menu
mode="inline"
:style="{ height: '100%', borderRight: 0 }"
@click="handleClickMenu"
:selectedKeys="[tab]"
>
<template v-for="item in currentMenus" :key="item.key">
<a-sub-menu v-if="item.children && item.children?.length > 0">
<template #title>
Expand All @@ -63,6 +68,7 @@
</a-sub-menu>
<a-menu-item
v-else-if="!item.children || item.children?.length === 0"
:key="item.key"
>
<img
:src="item.icon"
Expand Down Expand Up @@ -99,15 +105,20 @@
</template>
<script lang="ts" setup>
import { useStore } from '@/store/store'
import { computed } from 'vue'
import { RouterView } from 'vue-router'
import { computed, ref } from 'vue'
import { RouterView, useRoute, useRouter } from 'vue-router'
import { Avatar } from 'ant-design-vue'
import { systemLogout } from '@/utils'
import { useI18n } from 'vue-i18n'
import { langMap } from '@/constant'
import { changeLang } from '@/utils/lang'
const store = useStore()
const { locale } = useI18n()
const router = useRouter()
const routeData = useRoute()
const path = routeData.path
const tab = ref(path)
const appList = computed(() => {
return store.state.common.apps?.map((item) => ({
Expand All @@ -124,6 +135,11 @@ const currentMenus = computed(() => {
return filterMenus
})
const handleClickMenu = ({ key }: { key: string }) => {
tab.value = key
router.push(key)
}
const handleChangeApp = (key: string) => {
store.dispatch('common/changeApp', { data: key })
}
Expand Down
2 changes: 1 addition & 1 deletion src/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const apps: { name: string; key: string }[] = [
export const menu: WAMenu = [
{
title: '工作台',
key: 'workbench',
key: '/workbench',
icon: Workbench,
type: 'group'
},
Expand Down

0 comments on commit 1b09307

Please sign in to comment.