|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, onBeforeMount, unref } from 'vue'
|
|
|
|
|
import { computed, onBeforeMount, onMounted, unref } from 'vue'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
import { Logo } from './components/Logo'
|
|
|
|
|
import { MainView } from './components/Main'
|
|
|
|
@ -10,7 +10,7 @@ import { storage } from '@/utils/Storage'
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
onBeforeMount(() => {
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
/**
|
|
|
|
|
* 如果刷新则去掉筛选条件
|
|
|
|
|
* 1. 如果当前页面路由与上一个页面路由相同时则为刷新
|
|
|
|
@ -20,14 +20,13 @@ onBeforeMount(() => {
|
|
|
|
|
* 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)
|
|
|
|
|
if (storage.get('isSearch')) {
|
|
|
|
|
storage.remove('isSearch')
|
|
|
|
|
router.replace(route.path)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (history.state.back == route.path && JSON.stringify(route.query).trim() != '{}')
|
|
|
|
|
router.replace(route.path)
|
|
|
|
|
})
|
|
|
|
|
const { menuSetting } = useProjectSetting()
|
|
|
|
|
|
|
|
|
|