fix(系统设置): 仓库设置页顶部固定、设置项独立滚动、底部新增固定保存条
配置项很长而保存按钮只在顶端,配置完要滚回顶部才能保存,体验差。改为: - 顶部标题与操作固定,中间设置项区独立滚动(overflow-y:auto + overscroll-behavior:contain) - 底部新增固定操作条(刷新 / 保存,与顶部按钮等效,带说明文案) - 补全页面 flex 高度链路(flex:1 + height:100% + min-height:0),使长表单只在设置项区域滚动
This commit is contained in:
parent
4b6def1d89
commit
19e55726d9
@ -8,6 +8,7 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="warehouse-settings-form" v-loading="pageLoading">
|
<div class="warehouse-settings-form" v-loading="pageLoading">
|
||||||
|
<!-- 顶部固定区:标题 + 操作(不随表单滚动) -->
|
||||||
<div class="settings-header">
|
<div class="settings-header">
|
||||||
<div class="header-text">
|
<div class="header-text">
|
||||||
<span class="title">仓库设置</span>
|
<span class="title">仓库设置</span>
|
||||||
@ -19,16 +20,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-alert
|
<!-- 中间滚动区:配置项很长时只有这里滚动 -->
|
||||||
v-if="loadError"
|
|
||||||
type="error"
|
|
||||||
:closable="false"
|
|
||||||
show-icon
|
|
||||||
class="mb-16"
|
|
||||||
:title="loadError"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="settings-body">
|
<div class="settings-body">
|
||||||
|
<el-alert
|
||||||
|
v-if="loadError"
|
||||||
|
type="error"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
class="mb-16"
|
||||||
|
:title="loadError"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-form label-width="200px" label-position="right" class="settings-form">
|
<el-form label-width="200px" label-position="right" class="settings-form">
|
||||||
<template v-if="displayFields.length">
|
<template v-if="displayFields.length">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -239,6 +241,15 @@
|
|||||||
<el-empty v-else description="暂无可编辑字段,请检查接口返回" />
|
<el-empty v-else description="暂无可编辑字段,请检查接口返回" />
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 底部固定操作条:滚到底部即可直接保存,不必再回到顶部 -->
|
||||||
|
<div class="settings-footer">
|
||||||
|
<span class="footer-hint">配置项较多时,可随时用这里的按钮保存(与顶部「保存」等效)</span>
|
||||||
|
<div class="header-actions">
|
||||||
|
<el-button :loading="pageLoading" @click="loadAll">刷新</el-button>
|
||||||
|
<el-button type="primary" :loading="saving" @click="handleSave">保存</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -696,8 +707,13 @@ loadAll()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
/* 页面整体:顶部固定 header + 中间独立滚动 + 底部固定操作条(长表单不必回到顶部才能保存) */
|
||||||
.warehouse-settings-form {
|
.warehouse-settings-form {
|
||||||
padding: 12px 16px 24px;
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
@ -708,7 +724,28 @@ loadAll()
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-bottom: 12px;
|
flex-shrink: 0;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-bottom: 1px solid #e8eef7;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 底部固定操作条:与顶部按钮等效,到达页面底部即可保存 */
|
||||||
|
.settings-footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 10px 16px;
|
||||||
|
border-top: 1px solid #e8eef7;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-hint {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-text {
|
.header-text {
|
||||||
@ -737,9 +774,13 @@ loadAll()
|
|||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 中间滚动区:只让表单项滚动,滚动条不外溢到底部操作条 */
|
||||||
.settings-body {
|
.settings-body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-form {
|
.settings-form {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user