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

管理后台里的弹框按大小分成两类来收口。占整页的大弹框(历史版本、变更详情、模型修改、模型参数修正等)撑满整个浏览器高度,下面不再留白;小弹框(添加智能体、添加设备、知识库、字典、角色模板等)改成对齐屏幕正中,不再顶在屏幕上沿。修改模型那条弹框也加宽到 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,131 +137,145 @@ 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) {
border-radius: 10px; display: flex;
overflow: hidden; align-items: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); justify-content: center;
margin: 5vh auto !important; overflow: auto;
display: flex; }
flex-direction: column;
max-height: calc(100vh - 10vh);
}
::v-deep .el-dialog__wrapper { /* 内部 .el-dialog(custom-class 应用到它上面)才有 custom-dialog--large;
display: flex; 默认 .custom-dialog 也通过 customClass prop 传到内部 dialog 上时命中 */
align-items: center; ::v-deep .el-dialog.custom-dialog {
justify-content: center; border-radius: 10px;
overflow: auto; overflow: hidden;
} box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin: 5vh auto !important;
display: flex;
flex-direction: column;
max-height: calc(100vh - 10vh);
}
::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;
} }
::v-deep + .v-modal { ::v-deep + .v-modal {
background: rgba(15, 23, 42, 0.55) !important; background: rgba(15, 23, 42, 0.55) !important;
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
} }
::v-deep .el-dialog__header { ::v-deep .el-dialog__header {
padding: 16px 20px 12px; padding: 16px 20px 12px;
background: linear-gradient(135deg, #e2eeff, #edeafe); background: linear-gradient(135deg, #e2eeff, #edeafe);
text-align: left; text-align: left;
} }
::v-deep .el-dialog__title { ::v-deep .el-dialog__title {
font-size: 16px; font-size: 16px;
font-weight: 500;
color: #1a1a1a;
}
::v-deep .dialog-title {
font-size: 18px;
display: inline-flex;
align-items: center;
> span {
line-height: 18px;
font-weight: 500; font-weight: 500;
color: #1a1a1a;
} }
}
.dialog-title { ::v-deep .title-icon {
width: 24px;
height: 24px;
margin-right: 8px;
}
::v-deep .el-dialog__headerbtn {
top: 12px;
right: 16px;
width: 32px;
height: 32px;
border: none;
border-radius: 50%;
background: #fff;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
display: flex;
align-items: center;
justify-content: center;
.el-dialog__close {
font-size: 18px; font-size: 18px;
display: inline-flex; color: #666;
align-items: center; position: static;
> span { transform: none;
line-height: 18px;
font-weight: 500;
}
} }
.title-icon { &:hover {
width: 24px;
height: 24px;
margin-right: 8px;
}
::v-deep .el-dialog__headerbtn {
top: 12px;
right: 16px;
width: 32px;
height: 32px;
border: none;
border-radius: 50%;
background: #fff; background: #fff;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
display: flex;
align-items: center;
justify-content: center;
.el-dialog__close { .el-dialog__close {
font-size: 18px; color: #333;
color: #666;
position: static;
transform: none;
}
&:hover {
background: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
.el-dialog__close {
color: #333;
}
}
}
::v-deep .el-dialog__body {
padding: 20px;
}
::v-deep .el-dialog__footer {
padding: 12px 20px 16px;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
.el-button {
padding: 10px 20px;
display: flex;
align-items: center;
}
.el-button--primary {
background: linear-gradient(to right, #4a7cfd, #8154fc);
border: none;
&:hover,
&:focus {
background: linear-gradient(to right, #4a7cfd, #8154fc);
opacity: 0.85;
}
}
.confirm-inner {
display: inline-flex;
align-items: center;
}
.confirm-icon {
width: 16px;
height: 16px;
margin-right: 4px;
} }
} }
} }
::v-deep .el-dialog__body {
padding: 20px;
}
::v-deep .el-dialog__footer {
padding: 12px 20px 16px;
}
::v-deep .dialog-footer {
display: flex;
justify-content: flex-end;
.el-button {
padding: 10px 20px;
display: flex;
align-items: center;
}
.el-button--primary {
background: linear-gradient(to right, #4a7cfd, #8154fc);
border: none;
&:hover,
&:focus {
background: linear-gradient(to right, #4a7cfd, #8154fc);
opacity: 0.85;
}
}
.confirm-inner {
display: inline-flex;
align-items: center;
}
.confirm-icon {
width: 16px;
height: 16px;
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"
> >