mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 22:55:59 +00:00
refactor(任务调度): 移除任务重启功能并优化调试日志
feat(标签页): 添加缓存刷新按钮并优化标签页组件 style(布局): 注释掉过渡动画中的冗余div标签
This commit is contained in:
@@ -16,25 +16,29 @@
|
||||
/>
|
||||
<!-- 使用 rightExtra 插槽添加关闭全部按钮 -->
|
||||
<template #rightExtra>
|
||||
<!-- 修改为以 icon 显示的刷新缓存按钮 -->
|
||||
<a-button type="link" @click="refreshCache">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button type="link" @click="closeAllTabs">关闭全部</a-button>
|
||||
</template>
|
||||
</a-tabs>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ReloadOutlined } from '@ant-design/icons-vue'; // 导入刷新图标
|
||||
interface Pane {
|
||||
title: string;
|
||||
path: string;
|
||||
key: string;
|
||||
closable?: boolean;
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const panes = ref<Pane[]>([
|
||||
{
|
||||
title: '工作台',
|
||||
@@ -43,9 +47,7 @@ const panes = ref<Pane[]>([
|
||||
closable: false
|
||||
}
|
||||
]);
|
||||
|
||||
const activeKey = ref(panes.value[0].key);
|
||||
|
||||
const getRoute = () => {
|
||||
const existingPane = panes.value.some(pane => pane.key === route.path);
|
||||
if (!existingPane) {
|
||||
@@ -58,7 +60,6 @@ const getRoute = () => {
|
||||
}
|
||||
activeKey.value = route.path;
|
||||
}
|
||||
|
||||
const removePane = (targetKey: string) => {
|
||||
const paneIndex = panes.value.findIndex(pane => pane.key === targetKey);
|
||||
panes.value = panes.value.filter(pane => pane.key !== targetKey);
|
||||
@@ -95,6 +96,12 @@ const closeAllTabs = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 新增刷新缓存的方法
|
||||
const refreshCache = () => {
|
||||
// 刷新页面
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
onMounted(getRoute);
|
||||
watch(() => route.path, getRoute);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user