|
|
|
@ -1,17 +1,40 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, unref } from "vue";
|
|
|
|
|
import { Logo } from "./components/Logo";
|
|
|
|
|
import { MainView } from "./components/Main";
|
|
|
|
|
import { AsideMenu } from "./components/Menu";
|
|
|
|
|
import { PageHeader } from "./components/Header";
|
|
|
|
|
import { useProjectSetting } from "@/hooks/setting/useProjectSetting";
|
|
|
|
|
import { computed, onBeforeMount, unref } from 'vue'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
import { Logo } from './components/Logo'
|
|
|
|
|
import { MainView } from './components/Main'
|
|
|
|
|
import { AsideMenu } from './components/Menu'
|
|
|
|
|
import { PageHeader } from './components/Header'
|
|
|
|
|
import { useProjectSetting } from '@/hooks/setting/useProjectSetting'
|
|
|
|
|
import { storage } from '@/utils/Storage'
|
|
|
|
|
|
|
|
|
|
const { menuSetting } = useProjectSetting();
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
onBeforeMount(() => {
|
|
|
|
|
/**
|
|
|
|
|
* 如果刷新则去掉筛选条件
|
|
|
|
|
* 1. 如果当前页面路由与上一个页面路由相同时则为刷新
|
|
|
|
|
* 2. 防止一直刷新 另外一个判断条件为当前当前路由query不为{}
|
|
|
|
|
* 3. 当前页面下执行当前页面的搜索 1条件一定成立
|
|
|
|
|
*
|
|
|
|
|
* 4. 搜索点击->存storage->跳转页面->onMounted
|
|
|
|
|
* ->如果storage为true则不replace 并将storage置false
|
|
|
|
|
*/
|
|
|
|
|
if (
|
|
|
|
|
history.state.back == route.path
|
|
|
|
|
&& JSON.stringify(route.query).trim() != '{}'
|
|
|
|
|
&& storage.get('isSearch')
|
|
|
|
|
) {
|
|
|
|
|
storage.set('isSearch', false)
|
|
|
|
|
router.replace(route.path)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const { menuSetting } = useProjectSetting()
|
|
|
|
|
|
|
|
|
|
const leftMenuWidth = computed(() => {
|
|
|
|
|
const { minMenuWidth } = unref(menuSetting);
|
|
|
|
|
return minMenuWidth;
|
|
|
|
|
});
|
|
|
|
|
const { minMenuWidth } = unref(menuSetting)
|
|
|
|
|
return minMenuWidth
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|