管理后台弹框按大小分类统一外观

管理后台里的弹框按大小分成两类来收口。占整页的大弹框(历史版本、变更详情、模型修改、模型参数修正等)撑满整个浏览器高度,下面不再留白;小弹框(添加智能体、添加设备、知识库、字典、角色模板等)改成对齐屏幕正中,不再顶在屏幕上沿。修改模型那条弹框也加宽到 960,左右留白加大到 40,跟历史版本对齐,看起来更舒展。
This commit is contained in:
hrz 2026-10-06 17:59:27 +08:00
parent 499c37020c
commit bddd5e8b74
11 changed files with 177 additions and 119 deletions

View file

@ -2,7 +2,8 @@
<CustomDialog <CustomDialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:title="$t('modelConfigDialog.addModel')" :title="$t('modelConfigDialog.addModel')"
width="57%" width="960px"
size="large"
class="add-model-dialog" class="add-model-dialog"
:confirmLoading="saving" :confirmLoading="saving"
@close="handleClose" @close="handleClose"

View file

@ -2115,17 +2115,18 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
margin: 5vh auto !important; margin: 0 auto !important;
border-radius: 10px; border-radius: 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
max-height: calc(100vh - 10vh); height: 100vh;
max-height: 100vh;
} }
::v-deep .el-dialog__wrapper { ::v-deep .el-dialog__wrapper {
display: flex; display: flex;
align-items: center; align-items: stretch;
justify-content: center; justify-content: center;
overflow: auto; overflow: hidden;
} }
::v-deep .el-dialog__header { ::v-deep .el-dialog__header {

View file

@ -204,4 +204,23 @@ h3 {
margin-bottom: 10px; margin-bottom: 10px;
font-weight: 500; font-weight: 500;
} }
::v-deep .el-dialog {
margin: 0 auto !important;
height: 100vh;
max-height: 100vh;
border-radius: 0;
display: flex;
flex-direction: column;
}
::v-deep .el-dialog__wrapper {
align-items: stretch;
}
::v-deep .el-dialog__body {
flex: 1;
max-height: calc(100vh - 130px);
overflow-y: auto;
}
</style> </style>

View file

@ -3,6 +3,7 @@
:title="$t('chatHistory.with') + agentName + $t('chatHistory.dialogTitle')" :title="$t('chatHistory.with') + agentName + $t('chatHistory.dialogTitle')"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="80%" width="80%"
size="large"
:footer="false" :footer="false"
:close-on-click-modal="false" :close-on-click-modal="false"
custom-class="chat-history-dialog"> custom-class="chat-history-dialog">

View file

@ -3,6 +3,7 @@
:title="$t('contextProviderDialog.title')" :title="$t('contextProviderDialog.title')"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="720px" width="720px"
size="large"
class="context-provider-dialog" class="context-provider-dialog"
:closeOnClickModal="false" :closeOnClickModal="false"
:confirmText="$t('contextProviderDialog.confirm')" :confirmText="$t('contextProviderDialog.confirm')"

View file

@ -7,7 +7,7 @@
:close-on-press-escape="closeOnPressEscape" :close-on-press-escape="closeOnPressEscape"
:show-close="showClose" :show-close="showClose"
:destroy-on-close="destroyOnClose" :destroy-on-close="destroyOnClose"
:custom-class="customClass" :custom-class="dialogCustomClass"
class="custom-dialog" class="custom-dialog"
@close="handleClose" @close="handleClose"
@open="handleOpen" @open="handleOpen"
@ -80,6 +80,11 @@ export default {
type: String, type: String,
default: "" default: ""
}, },
size: {
type: String,
default: "small",
validator: (val) => ["small", "large"].includes(val),
},
cancelText: { cancelText: {
type: String, type: String,
default: "取消" default: "取消"
@ -94,6 +99,14 @@ export default {
dialogVisible: this.visible dialogVisible: this.visible
}; };
}, },
computed: {
dialogCustomClass() {
const classes = ["custom-dialog"];
if (this.customClass) classes.push(this.customClass);
if (this.size === "large") classes.push("custom-dialog--large");
return classes.join(" ");
},
},
components: { components: {
CustomButton CustomButton
}, },
@ -124,8 +137,17 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-dialog { /* wrapper 上带 custom-dialog class(来自 :class prop),用 :global() 命中它本身 */
::v-deep .el-dialog { :global(.el-dialog__wrapper.custom-dialog) {
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
/* 内部 .el-dialog(custom-class 应用到它上面)才有 custom-dialog--large;
默认 .custom-dialog 也通过 customClass prop 传到内部 dialog 上时命中 */
::v-deep .el-dialog.custom-dialog {
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
@ -135,13 +157,6 @@ export default {
max-height: calc(100vh - 10vh); max-height: calc(100vh - 10vh);
} }
::v-deep .el-dialog__wrapper {
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
max-height: calc(100vh - 220px); max-height: calc(100vh - 220px);
overflow-y: auto; overflow-y: auto;
@ -164,7 +179,7 @@ export default {
color: #1a1a1a; color: #1a1a1a;
} }
.dialog-title { ::v-deep .dialog-title {
font-size: 18px; font-size: 18px;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@ -174,7 +189,7 @@ export default {
} }
} }
.title-icon { ::v-deep .title-icon {
width: 24px; width: 24px;
height: 24px; height: 24px;
margin-right: 8px; margin-right: 8px;
@ -218,7 +233,7 @@ export default {
padding: 12px 20px 16px; padding: 12px 20px 16px;
} }
.dialog-footer { ::v-deep .dialog-footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
@ -250,5 +265,17 @@ export default {
margin-right: 4px; margin-right: 4px;
} }
} }
/* size="large":dialog 撑满整个浏览器高度 */
::v-deep .el-dialog.custom-dialog.custom-dialog--large {
margin: 0 auto !important;
height: 100vh;
max-height: 100vh;
border-radius: 0;
}
::v-deep .el-dialog.custom-dialog--large .el-dialog__body {
max-height: calc(100vh - 120px);
flex: 1;
} }
</style> </style>

View file

@ -2,7 +2,8 @@
<CustomDialog <CustomDialog
:title="$t('modelConfigDialog.editModel')" :title="$t('modelConfigDialog.editModel')"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="720px" width="960px"
size="large"
class="model-edit-dialog" class="model-edit-dialog"
:confirmLoading="saving" :confirmLoading="saving"
@confirm="handleSave" @confirm="handleSave"
@ -465,6 +466,10 @@ export default {
@import '@/styles/global.scss'; @import '@/styles/global.scss';
.model-edit-dialog { .model-edit-dialog {
::v-deep .el-dialog__body {
padding: 24px 40px;
}
.header-row { .header-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View file

@ -3,6 +3,7 @@
:title="title" :title="title"
:visible.sync="visible" :visible.sync="visible"
width="57%" width="57%"
size="large"
class="provider-dialog-wrapper" class="provider-dialog-wrapper"
@confirm="submit" @confirm="submit"
@close="handleClose" @close="handleClose"

View file

@ -1,5 +1,5 @@
<template> <template>
<CustomDialog :visible.sync="localVisible" :title="$t('modelConfig.voiceManagement')" width="90%" <CustomDialog :visible.sync="localVisible" :title="$t('modelConfig.voiceManagement')" width="90%" size="large"
:close-on-click-modal="true" :destroy-on-close="false" :footer="false" :append-to-body="true" :close-on-click-modal="true" :destroy-on-close="false" :footer="false" :append-to-body="true"
@close="handleClose"> @close="handleClose">
<div class="scroll-wrapper"> <div class="scroll-wrapper">

View file

@ -3,6 +3,7 @@
:title="$t('voiceClone.dialogTitle')" :title="$t('voiceClone.dialogTitle')"
:visible.sync="innerVisible" :visible.sync="innerVisible"
width="900px" width="900px"
size="large"
:footer="false" :footer="false"
@close="handleDialogClose" @close="handleDialogClose"
> >

View file

@ -75,6 +75,7 @@
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
:footer="true" :footer="true"
:width="'1200px'" :width="'1200px'"
size="large"
@confirm="handleDialogConfirm" @confirm="handleDialogConfirm"
@cancel="dialogVisible = false" @cancel="dialogVisible = false"
> >