|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="sw-menu">
|
|
|
- <a-menu style="flex:1" v-model:selectedKeys="current" mode="inline" :open-keys="openKeys" @openChange="onOpenChange" active-text-color="#000" @click="itemClick">
|
|
|
+ <a-menu style="flex:1" v-model:selectedKeys="current" mode="inline" active-text-color="#000" @click="itemClick">
|
|
|
<template v-for="item in mods" :key="item.systemmoduleid">
|
|
|
<a-sub-menu v-if="item.apps.length > 1" :key="item.systemmoduleid" @click="modClick(item)">
|
|
|
<template #title>
|
|
|
@@ -33,27 +33,13 @@ import { useAuthStore } from '@/stores/modules/auth'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { useRouter } from "vue-router"
|
|
|
import less from 'less'
|
|
|
-import { CalendarOutlined,PieChartOutlined} from '@ant-design/icons-vue'
|
|
|
+import { CalendarOutlined} from '@ant-design/icons-vue'
|
|
|
import {ConfigProvider, Modal } from 'ant-design-vue';
|
|
|
const router = useRouter()
|
|
|
const store = useAuthStore()
|
|
|
-let { mods,actMod,system } = storeToRefs(store)
|
|
|
-
|
|
|
-let rootSubmenuKeys = ref([])
|
|
|
-let openKeys = ref([])
|
|
|
-let selectedKeys = ref([])
|
|
|
+let { mods,actMod } = storeToRefs(store)
|
|
|
|
|
|
const current = ref([])
|
|
|
-
|
|
|
-const onOpenChange = openKey => {
|
|
|
- const latestOpenKey = openKey.find(key => openKeys.value.indexOf(key) === -1);
|
|
|
- if (rootSubmenuKeys.value.indexOf(latestOpenKey) === -1) {
|
|
|
- openKeys.value = openKey;
|
|
|
- } else {
|
|
|
- openKeys.value = latestOpenKey ? [latestOpenKey] : [];
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
const itemClick = (item, key, keyPath)=>{
|
|
|
current.value = item.keyPath
|
|
|
}
|
|
|
@@ -61,10 +47,7 @@ const modClick = (item)=>{
|
|
|
actMod.value = item
|
|
|
}
|
|
|
const routeChange = (app)=>{
|
|
|
- // store.appData(app)
|
|
|
- console.log(app)
|
|
|
- router.push({path:app.path})
|
|
|
- console.log(app.path);
|
|
|
+ router.replace({path:app.path,meta:{keepAlive:false}})
|
|
|
}
|
|
|
const colorState = ref({})
|
|
|
const setTheme = (themeName)=> {
|
|
|
@@ -76,11 +59,11 @@ const setTheme = (themeName)=> {
|
|
|
successColor: '#4aa0d5',
|
|
|
infoColor: '#d8e9f0',
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ConfigProvider.config({
|
|
|
theme: colorState.value
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
} else if (themeName === 'normal') {
|
|
|
colorState.value = {
|
|
|
primaryColor: '#14317D',
|
|
|
@@ -112,22 +95,13 @@ const setTheme = (themeName)=> {
|
|
|
theme: colorState.value
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-let getKeys = () => {
|
|
|
- system.value.forEach(sys => {
|
|
|
- sys.modules.forEach(mod => {
|
|
|
- rootSubmenuKeys.value.push(mod.systemmoduleid)
|
|
|
- })
|
|
|
- })
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
onBeforeMount(()=>{
|
|
|
setTheme('normal')
|
|
|
- getKeys()
|
|
|
+
|
|
|
})
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
|
|
|
-</style>
|
|
|
+</style>
|