style: 💄 (settings)优化设置页面布局和样式

- 将底部按钮放入footer插槽中,保留原有的样式

#ICWDUU
This commit is contained in:
zimo493
2025-09-04 16:23:40 +08:00
parent 3208edbb18
commit 6cce9581fb

View File

@@ -107,40 +107,35 @@
</div>
<!-- 操作按钮区域 - 固定到底部 -->
<div class="action-footer">
<div class="action-divider"></div>
<div class="action-card">
<div class="action-buttons">
<el-tooltip
content="复制配置将生成当前设置的代码,覆盖 src/settings.ts 下的 defaultSettings 变量"
placement="top"
<template #footer>
<div class="action-buttons">
<el-tooltip
content="复制配置将生成当前设置的代码,覆盖 src/settings.ts 下的 defaultSettings 变量"
placement="top"
>
<el-button
type="primary"
size="default"
:icon="copyIcon"
:loading="copyLoading"
@click="handleCopySettings"
>
<el-button
type="primary"
size="default"
:icon="copyIcon"
:loading="copyLoading"
class="action-btn"
@click="handleCopySettings"
>
{{ copyLoading ? "复制中..." : t("settings.copyConfig") }}
</el-button>
</el-tooltip>
<el-tooltip content="重置将恢复所有设置为默认值" placement="top">
<el-button
type="warning"
size="default"
:icon="resetIcon"
:loading="resetLoading"
class="action-btn"
@click="handleResetSettings"
>
{{ resetLoading ? "重置中..." : t("settings.resetConfig") }}
</el-button>
</el-tooltip>
</div>
{{ copyLoading ? "复制中..." : t("settings.copyConfig") }}
</el-button>
</el-tooltip>
<el-tooltip content="重置将恢复所有设置为默认值" placement="top">
<el-button
type="warning"
size="default"
:icon="resetIcon"
:loading="resetLoading"
@click="handleResetSettings"
>
{{ resetLoading ? "重置中..." : t("settings.resetConfig") }}
</el-button>
</el-tooltip>
</div>
</div>
</template>
</el-drawer>
</template>
@@ -326,47 +321,22 @@ const handleCloseDrawer = () => {
.settings-content {
height: calc(100vh - 120px); /* 减去头部和底部按钮的高度 */
padding: 20px;
padding-bottom: 20px;
overflow-y: auto;
}
/* 底部操作区域样式 */
.action-footer {
position: absolute;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
padding: 0;
background: var(--el-bg-color);
border-top: 1px solid var(--el-border-color-light);
.action-buttons {
display: flex;
.action-divider {
display: none; /* 移除重复的分割线 */
}
& > .el-button {
flex: 1;
font-size: 14px;
border-radius: 8px;
transition: all 0.3s ease;
.action-card {
padding: 16px 20px;
margin: 0;
background: var(--el-fill-color-extra-light);
border: none;
border-radius: 0;
.action-buttons {
display: flex;
gap: 12px;
.action-btn {
flex: 1;
font-size: 14px;
border-radius: 8px;
transition: all 0.3s ease;
&:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transform: translateY(-2px);
}
}
&:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transform: translateY(-2px);
}
}
}