style(business): 统一优化多个业务弹窗为接近全屏高度

- /business/waybill-manage 新增/编辑弹窗添加 dialogCustomClass 控制高度样式,覆盖默认 max-height 限制
- /business/contract-manage 弹窗同样加 dialogCustomClass,scoped 样式解开 Avue 弹窗默认 body 高度限制并实现底部操作栏粘性
- element-ui.scss 新增对应页 dialog 样式,确保弹窗上下留白20px,内容区高度自动适应,底部操作栏始终可见
- 复用 business-crud-page 组件中传入 option 的 dialogCustomClass 实现页面隔离样式,不影响其他业务
This commit is contained in:
2026-08-14 16:01:12 +08:00
parent b3510cf233
commit 285a281439
6 changed files with 117 additions and 4 deletions
+1
View File
@@ -622,3 +622,4 @@ option.dialogWidth = 1480;
option.dialogTop = '4vh';
option.dialogCloseBtn = true;
option.menuWidth = 320;
option.dialogCustomClass = 'contract-manage-dialog';
+1
View File
@@ -323,6 +323,7 @@ export const config = {
};
export const option = {
dialogCustomClass: 'waybill-manage-dialog',
...createCrudOption(
withSearchPlaceholders([
{
+65
View File
@@ -521,6 +521,71 @@
background: #fff;
}
// 运单管理新增/编辑弹窗:参照 vehicle/customer-archive,弹窗体接近全屏(上下各留 20px 边距);
// 同时覆盖 Avue 库内置 .avue-dialog 的 max-height: calc(100% - 200px) 上限,
// 并解开 .avue-crud__dialog .el-dialog__body 的 max-height: calc(100vh - 200px) 限制;
// 底部操作栏(avue 内置 footer,渲染在 body 内部)sticky 贴底始终可见
// (额外用 margin-top: 0 !important 抵消全局 .avue-crud__dialog .avue-dialog__footer 的 -30px 上移)
.waybill-manage-dialog.el-dialog {
margin-top: 20px !important;
margin-bottom: 20px !important;
height: calc(100vh - 40px);
max-height: calc(100vh - 40px) !important;
display: flex;
flex-direction: column;
}
.waybill-manage-dialog .el-dialog__header {
flex: none;
}
.waybill-manage-dialog .el-dialog__body {
flex: 1 1 auto;
min-height: 0;
max-height: none !important;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.waybill-manage-dialog .avue-dialog__footer {
position: sticky;
bottom: 0;
flex: none;
margin-top: 0 !important;
background: #fff;
}
// 合同管理新增/编辑弹窗(business-crud-page 封装 → avue-crud,弹窗带 avue-crud__dialog class
// 复刻 waybill-manage 方案:接近全屏、压过库内置 .avue-dialog 的 calc(100% - 200px)
// 并解开 body 的 200px 上限、抵消全局 footer 的 -30px 上移
.contract-manage-dialog.el-dialog {
margin-top: 20px !important;
margin-bottom: 20px !important;
height: calc(100vh - 40px);
max-height: calc(100vh - 40px) !important;
display: flex;
flex-direction: column;
}
.contract-manage-dialog .el-dialog__header {
flex: none;
}
.contract-manage-dialog .el-dialog__body {
flex: 1 1 auto;
min-height: 0;
max-height: none !important;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.contract-manage-dialog .avue-dialog__footer {
position: sticky;
bottom: 0;
flex: none;
margin-top: 0 !important;
background: #fff;
}
// 统一表格线条颜色
.el-table {
--el-table-border-color: #eff1f7;
+30 -4
View File
@@ -764,7 +764,7 @@
@drop="handleRouteDrop(index)"
>
<el-icon class="loading-manage-dialog__route-handle"><Rank /></el-icon>
<span class="loading-manage-dialog__route-type">{{ routeTypeText(index) }}</span>
<span :class="['loading-manage-dialog__route-type', `loading-manage-dialog__route-type--${routeTypeClass(index)}`]">{{ routeTypeText(index) }}</span>
<span class="loading-manage-dialog__route-address">{{ node.address }}</span>
<span class="loading-manage-dialog__route-tags">
<el-tag v-for="tag in node.tags" :key="tag" size="small">{{ tag }}</el-tag>
@@ -933,7 +933,7 @@
<el-table-column label="到货地" min-width="310"><template #default="{ row }"><div class="loading-route-change-dialog__original">原:{{ row.originalArrivalAddress || '-' }}</div><el-input v-model="row.arrivalAddress" placeholder="请选择或输入地址" @input="updateRouteChangeNodes"><template #suffix><el-icon class="loading-route-change-dialog__location" @click="openCommonAddressDialog(row, 'arrival')"><Location /></el-icon></template></el-input></template></el-table-column>
</el-table>
</section-card>
<section-card title="路线编辑"><template #extra><span class="loading-route-change-dialog__hint">拖拽调整顺序</span></template><div v-if="routeChangeNodes.length" class="loading-route-change-dialog__route-list"><div v-for="(node, index) in routeChangeNodes" :key="node.key || index" class="loading-route-change-dialog__route-item" draggable="true" @dragstart="handleRouteChangeDragStart(index)" @dragover.prevent @drop="handleRouteChangeDrop(index)"><span class="loading-route-change-dialog__route-type">{{ routeChangeTypeText(index) }}</span><span>{{ node.address }}</span><span class="loading-route-change-dialog__tags"><el-tag v-for="tag in node.tags || []" :key="tag" size="small">{{ tag }}</el-tag></span><el-icon><Rank /></el-icon></div></div><el-empty v-else description="暂无路线" :image-size="60" /></section-card>
<section-card title="路线编辑"><template #extra><span class="loading-route-change-dialog__hint">拖拽调整顺序</span></template><div v-if="routeChangeNodes.length" class="loading-route-change-dialog__route-list"><div v-for="(node, index) in routeChangeNodes" :key="node.key || index" class="loading-route-change-dialog__route-item" draggable="true" @dragstart="handleRouteChangeDragStart(index)" @dragover.prevent @drop="handleRouteChangeDrop(index)"><span :class="['loading-route-change-dialog__route-type', `loading-route-change-dialog__route-type--${routeChangeTypeClass(index)}`]">{{ routeChangeTypeText(index) }}</span><span>{{ node.address }}</span><span class="loading-route-change-dialog__tags"><el-tag v-for="tag in node.tags || []" :key="tag" size="small">{{ tag }}</el-tag></span><el-icon><Rank /></el-icon></div></div><el-empty v-else description="暂无路线" :image-size="60" /></section-card>
<el-form label-width="auto"><el-form-item label="变更备注"><el-input v-model="routeChangeRemark" type="textarea" :rows="1" maxlength="200" show-word-limit placeholder="请输入" /></el-form-item></el-form>
</el-tab-pane>
<el-tab-pane label="变更记录" name="records"><el-table :data="routeChangeRecords" border><el-table-column prop="changeTime" label="变更时间" min-width="170"/><el-table-column prop="changeUser" label="变更人" min-width="120"/><el-table-column prop="content" label="变更内容" min-width="360"><template #default="{ row }"><div class="loading-route-change-dialog__record-content">{{ row.content || '-' }}</div></template></el-table-column><el-table-column prop="remark" label="备注" min-width="200" show-overflow-tooltip/></el-table><el-empty v-if="!routeChangeRecords.length" description="暂无变更记录" :image-size="60"/></el-tab-pane>
@@ -1612,6 +1612,11 @@ export default {
if (index === this.routeChangeNodes.length - 1) return '终';
return '经';
},
routeChangeTypeClass(index) {
if (index === 0) return 'start';
if (index === this.routeChangeNodes.length - 1) return 'end';
return 'middle';
},
handleRouteChangeDragStart(index) {
this.routeChangeDragIndex = index;
},
@@ -1843,6 +1848,11 @@ export default {
if (index === this.routeNodes.length - 1) return '终';
return '经';
},
routeTypeClass(index) {
if (index === 0) return 'start';
if (index === this.routeNodes.length - 1) return 'end';
return 'middle';
},
handleRouteDragStart(index) {
this.routeDragIndex = index;
},
@@ -2373,7 +2383,10 @@ export default {
text-align: center;
border-radius: 50%;
color: #fff;
background: #409eff;
&--start { background: #409eff; }
&--middle { background: #e6a23c; }
&--end { background: #67c23a; }
}
.loading-manage-dialog__route-address {
@@ -2458,7 +2471,20 @@ export default {
.loading-detail__process-actions .el-select { width: 180px; }
.loading-detail__map { width: 100%; min-height: 260px; border: 1px solid #eff1f7; }
}
.loading-route-change-dialog { .loading-route-change-dialog__original { color: #a8abb2; line-height: 20px; margin-bottom: 4px; }.loading-route-change-dialog__location { cursor: pointer; color: #909399; }.loading-route-change-dialog__hint { color: #909399; }.loading-route-change-dialog__route-list { display: flex; flex-direction: column; gap: 8px; }.loading-route-change-dialog__route-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; padding: 10px 12px; background: #f5f6f7; cursor: move; }.loading-route-change-dialog__route-type { width: 30px; height: 30px; border-radius: 50%; background: #dcdfe6; text-align: center; line-height: 30px; }.loading-route-change-dialog__tags { display: flex; gap: 4px; }.loading-route-change-dialog__record-content { white-space: normal; overflow-wrap: anywhere; line-height: 22px; } }
.loading-route-change-dialog {
.loading-route-change-dialog__original { color: #a8abb2; line-height: 20px; margin-bottom: 4px; }
.loading-route-change-dialog__location { cursor: pointer; color: #909399; }
.loading-route-change-dialog__hint { color: #909399; }
.loading-route-change-dialog__route-list { display: flex; flex-direction: column; gap: 8px; }
.loading-route-change-dialog__route-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; padding: 10px 12px; background: #f5f6f7; cursor: move; }
.loading-route-change-dialog__route-type { width: 30px; height: 30px; border-radius: 50%; text-align: center; line-height: 30px; color: #fff;
&--start { background: #409eff; }
&--middle { background: #e6a23c; }
&--end { background: #67c23a; }
}
.loading-route-change-dialog__tags { display: flex; gap: 4px; }
.loading-route-change-dialog__record-content { white-space: normal; overflow-wrap: anywhere; line-height: 22px; }
}
.loading-common-address-dialog__toolbar { display: flex; gap: 8px; margin-bottom: 12px; }.loading-common-address-dialog__toolbar .el-input { flex: 1; }
@media (max-width: 900px) {
.loading-manage-dialog__grid {