feat:修改
This commit is contained in:
@@ -5,10 +5,14 @@
|
||||
<span class="navbar-title">{{ title }}</span>
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
<el-button link icon="Refresh" class="nav-btn" @click="handleRefresh" title="刷新数据">
|
||||
<span>{{ refreshing ? '刷新中...' : '' }}</span>
|
||||
</el-button>
|
||||
<el-button link :icon="isFullscreen ? 'FullScreenExit' : 'FullScreen'" class="nav-btn" @click="handleToggleFullscreen" :title="isFullscreen ? '退出全屏' : '全屏'"></el-button>
|
||||
<button class="action-btn refresh-btn" @click="handleRefresh" title="刷新数据">
|
||||
<span class="btn-icon">🔄</span>
|
||||
<span class="btn-text">刷新</span>
|
||||
</button>
|
||||
<button class="action-btn fullscreen-btn" @click="handleToggleFullscreen" :title="isFullscreen ? '退出全屏' : '全屏'">
|
||||
<span class="btn-icon">{{ isFullscreen ? '⛶' : '⛶' }}</span>
|
||||
<span class="btn-text">{{ isFullscreen ? '退出' : '全屏' }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
</template>
|
||||
@@ -22,18 +26,13 @@ const store = useStore()
|
||||
|
||||
const title = computed(() => store.state.settings.title)
|
||||
const isFullscreen = ref(false)
|
||||
const refreshing = ref(false)
|
||||
|
||||
const toggleSideBar = () => {
|
||||
store.dispatch('app/toggleSideBar')
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
refreshing.value = true
|
||||
window.dispatchEvent(new CustomEvent('refresh-data'))
|
||||
setTimeout(() => {
|
||||
refreshing.value = false
|
||||
}, 1500)
|
||||
}
|
||||
|
||||
const handleToggleFullscreen = () => {
|
||||
@@ -55,45 +54,103 @@ onUnmounted(() => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
height: 50px;
|
||||
background: linear-gradient(90deg, rgba(0, 168, 204, 0.9) 0%, rgba(0, 212, 255, 0.8) 50%, rgba(0, 168, 204, 0.9) 100%);
|
||||
height: 60px;
|
||||
background: linear-gradient(90deg, rgba(0, 168, 204, 0.95) 0%, rgba(0, 212, 255, 0.9) 50%, rgba(0, 168, 204, 0.95) 100%);
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
padding: 0 24px;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid rgba(0, 212, 255, 0.3);
|
||||
border-bottom: 2px solid rgba(0, 212, 255, 0.4);
|
||||
box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
|
||||
}
|
||||
|
||||
.navbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.navbar-title {
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #0a1428;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.navbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
.action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 20px;
|
||||
border: 2px solid rgba(10, 20, 40, 0.4);
|
||||
border-radius: 8px;
|
||||
background: rgba(10, 20, 40, 0.15);
|
||||
color: #0a1428;
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 20, 40, 0.2);
|
||||
background: rgba(10, 20, 40, 0.3);
|
||||
border-color: rgba(10, 20, 40, 0.6);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
.btn-icon {
|
||||
font-size: 20px;
|
||||
animation: spin 2s linear infinite;
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
&:hover .btn-icon {
|
||||
animation-play-state: running;
|
||||
}
|
||||
}
|
||||
|
||||
.fullscreen-btn {
|
||||
.btn-icon {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 212, 255, 0.3);
|
||||
box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user