yanjinhui
10 天以前 c5de0d98241f8c8349fa38851b77efcfc61e4d26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<script setup lang="ts">
import { ContentWrap } from '@/components/ContentWrap'
import { useTagsView } from '@/hooks/web/useTagsView'
import { useRouter } from 'vue-router'
 
const { push } = useRouter()
 
const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage, setTitle } =
  useTagsView()
 
const closeAllTabs = () => {
  closeAll(() => {
    push('/dashboard/analysis')
  })
}
 
const closeLeftTabs = () => {
  closeLeft()
}
 
const closeRightTabs = () => {
  closeRight()
}
 
const closeOtherTabs = () => {
  closeOther()
}
 
const refresh = () => {
  refreshPage()
}
 
const closeCurrentTab = () => {
  closeCurrent(undefined, () => {
    push('/dashboard/analysis')
  })
}
 
const setTabTitle = () => {
  setTitle(new Date().getTime().toString())
}
 
const setAnalysisTitle = () => {
  setTitle(`分析页-${new Date().getTime().toString()}`, '/dashboard/analysis')
}
</script>
 
<template>
  <ContentWrap title="useTagsView">
    <BaseButton type="primary" @click="closeAllTabs"> 关闭所有标签页 </BaseButton>
    <BaseButton type="primary" @click="closeLeftTabs"> 关闭左侧标签页 </BaseButton>
    <BaseButton type="primary" @click="closeRightTabs"> 关闭右侧标签页 </BaseButton>
    <BaseButton type="primary" @click="closeOtherTabs"> 关闭其他标签页 </BaseButton>
    <BaseButton type="primary" @click="closeCurrentTab"> 关闭当前标签页 </BaseButton>
    <BaseButton type="primary" @click="refresh"> 刷新当前标签页 </BaseButton>
    <BaseButton type="primary" @click="setTabTitle"> 修改当前标题 </BaseButton>
    <BaseButton type="primary" @click="setAnalysisTitle"> 修改分析页标题 </BaseButton>
  </ContentWrap>
</template>