feat: 优化 GiForm(同步 GiDemo 更新)

This commit is contained in:
2025-02-27 22:44:04 +08:00
parent 15ae164eef
commit 47769f9ad8
32 changed files with 589 additions and 586 deletions

View File

@@ -0,0 +1,31 @@
<template>
<icon-refresh class="reload-icon" :class="{ 'reload-icon--spin': loading }" :size="18" @click="reload" />
</template>
<script lang="ts" setup>
import { useTabsStore } from '@/stores'
const tabsStore = useTabsStore()
const loading = ref(false)
// 重载页面
const reload = () => {
if (loading.value) return
loading.value = true
tabsStore.reloadPage()
setTimeout(() => {
loading.value = false
}, 600)
}
</script>
<style lang="scss" scoped>
.reload-icon {
cursor: pointer;
&--spin {
animation-name: arco-loading-circle;
animation-duration: 0.6s;
}
}
</style>

View File

@@ -51,17 +51,12 @@
</template>
<template #default>关闭其他</template>
</a-doption>
<a-doption @click="tabsStore.closeAll">
<template #icon>
<icon-minus />
</template>
<template #default>关闭全部</template>
</a-doption>
</template>
</a-dropdown>
</template>
</a-tab-pane>
<template #extra>
<ReloadIcon></ReloadIcon>
<a-dropdown trigger="hover">
<a-button type="text">
<template #icon>
@@ -69,12 +64,6 @@
</template>
</a-button>
<template #content>
<a-doption @click="reload">
<template #icon>
<icon-refresh class="reload-icon" :class="{ 'reload-icon--spin': loading }" />
</template>
<template #default>重新加载</template>
</a-doption>
<a-doption @click="tabsStore.closeCurrent(route.path)">
<template #icon>
<icon-close />
@@ -114,6 +103,7 @@
<script setup lang="ts">
import type { RouteLocationNormalized } from 'vue-router'
import ReloadIcon from './ReloadIcon.vue'
import { useAppStore, useTabsStore } from '@/stores'
defineOptions({ name: 'Tabs' })