|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-container class="hc-layout-box">
|
|
|
+ <el-container class="hc-layout-box" :class="[!isNullES(isLayout) && isLayout === 'no' ? 'is-no-layout' : '']">
|
|
|
<div v-if="appTheme === 'dark'" class="hc-app-bg-box">
|
|
|
<img :src="appViewBg" alt="">
|
|
|
</div>
|
|
@@ -53,7 +53,7 @@
|
|
|
<script setup>
|
|
|
import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import { initButtons } from '~sto/app'
|
|
|
import HcSocket from '~src/plugins/HcSocket'
|
|
|
import { getObjValue, isNullES } from 'js-fast-way'
|
|
@@ -61,6 +61,7 @@ import website from '~src/config'
|
|
|
|
|
|
//初始组合式
|
|
|
const router = useRouter()
|
|
|
+const useRoutes = useRoute()
|
|
|
const store = useAppStore()
|
|
|
|
|
|
const reloadRouter = ref(true)
|
|
@@ -78,23 +79,31 @@ import MenuBar from '~src/layout/modules/MenuBar.vue'
|
|
|
import appViewBg from '~src/assets/view/bg.png'
|
|
|
|
|
|
// logo
|
|
|
-const appLogoIcon = ref(store.getLogoIcon)
|
|
|
const appLogoName = ref(store.getLogoName)
|
|
|
const appTheme = ref(store.getTheme)
|
|
|
|
|
|
//菜单数据
|
|
|
const menuBarKey = ref('')
|
|
|
const menuBarData = ref([])
|
|
|
+const isLayout = ref('')
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
+ const layout = useRoutes?.query?.layout, layout2 = store.isLayout
|
|
|
+ isLayout.value = layout ?? layout2
|
|
|
initButtons()
|
|
|
})
|
|
|
|
|
|
-//监听
|
|
|
+//监听layout
|
|
|
watch(() => [
|
|
|
- store.getTheme,
|
|
|
-], ([theme]) => {
|
|
|
+ useRoutes?.query?.layout,
|
|
|
+ store.isLayout,
|
|
|
+], ([layout, layout2]) => {
|
|
|
+ isLayout.value = layout ?? layout2
|
|
|
+}, { deep: true })
|
|
|
+
|
|
|
+//监听
|
|
|
+watch(() => store.getTheme, (theme) => {
|
|
|
appTheme.value = theme
|
|
|
})
|
|
|
|