2024-09-14 02:46:44 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="header-container">
|
|
|
|
|
<div class="header-content">
|
2025-06-30 22:29:23 +08:00
|
|
|
<div class="header-actions" v-if="$slots.left">
|
|
|
|
|
<slot name="left"></slot>
|
|
|
|
|
</div>
|
2024-09-14 02:46:44 +08:00
|
|
|
<div class="header-title">
|
2025-07-23 03:52:22 +08:00
|
|
|
<div class="header-title-block">
|
|
|
|
|
<h1>{{ title }}</h1>
|
|
|
|
|
<slot name="behind-title"></slot>
|
|
|
|
|
</div>
|
2024-09-14 02:46:44 +08:00
|
|
|
<slot name="description">
|
|
|
|
|
<p v-if="description">{{ description }}</p>
|
|
|
|
|
</slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="header-actions" v-if="$slots.actions">
|
2025-05-26 20:39:31 +08:00
|
|
|
<loading-outlined v-if="loading" />
|
2024-09-14 02:46:44 +08:00
|
|
|
<slot name="actions"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-01-15 06:01:34 +08:00
|
|
|
import { LoadingOutlined } from '@ant-design/icons-vue'
|
2024-09-14 02:46:44 +08:00
|
|
|
const props = defineProps({
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
description: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: ''
|
2025-05-26 20:39:31 +08:00
|
|
|
},
|
|
|
|
|
loading: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false
|
2024-09-14 02:46:44 +08:00
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
})
|
2024-09-14 02:46:44 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
.header-container {
|
2025-07-23 03:52:22 +08:00
|
|
|
background-color: var(--bg-sider);
|
2024-09-14 02:46:44 +08:00
|
|
|
backdrop-filter: blur(10px);
|
2025-07-23 03:52:22 +08:00
|
|
|
padding: 10px 24px;
|
2025-11-23 01:39:44 +08:00
|
|
|
border-bottom: 1px solid var(--gray-150);
|
2024-09-14 02:46:44 +08:00
|
|
|
position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header-content {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
2025-06-30 22:29:23 +08:00
|
|
|
gap: 10px;
|
2024-09-14 02:46:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header-title {
|
2025-06-30 22:29:23 +08:00
|
|
|
flex: 1;
|
|
|
|
|
width: 100%;
|
2024-09-14 02:46:44 +08:00
|
|
|
font-size: 14px;
|
2026-03-02 02:48:30 +08:00
|
|
|
color: var(--gray-900);
|
2024-09-14 02:46:44 +08:00
|
|
|
|
2025-07-23 03:52:22 +08:00
|
|
|
.header-title-block {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: baseline;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-14 02:46:44 +08:00
|
|
|
h1 {
|
|
|
|
|
margin: 0;
|
2025-07-27 02:56:50 +08:00
|
|
|
font-size: 18px;
|
2024-09-14 02:46:44 +08:00
|
|
|
font-weight: 500;
|
2025-11-23 01:39:44 +08:00
|
|
|
color: var(--gray-2000);
|
2024-09-14 02:46:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p {
|
2026-03-02 02:48:30 +08:00
|
|
|
margin: 4px 0 0;
|
2024-09-14 02:46:44 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|