mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
管理后台弹框按大小分类统一外观
管理后台里的弹框按大小分成两类来收口。占整页的大弹框(历史版本、变更详情、模型修改、模型参数修正等)撑满整个浏览器高度,下面不再留白;小弹框(添加智能体、添加设备、知识库、字典、角色模板等)改成对齐屏幕正中,不再顶在屏幕上沿。修改模型那条弹框也加宽到 960,左右留白加大到 40,跟历史版本对齐,看起来更舒展。
This commit is contained in:
parent
499c37020c
commit
bddd5e8b74
11 changed files with 177 additions and 119 deletions
|
|
@ -2,7 +2,8 @@
|
|||
<CustomDialog
|
||||
:visible.sync="dialogVisible"
|
||||
:title="$t('modelConfigDialog.addModel')"
|
||||
width="57%"
|
||||
width="960px"
|
||||
size="large"
|
||||
class="add-model-dialog"
|
||||
:confirmLoading="saving"
|
||||
@close="handleClose"
|
||||
|
|
|
|||
|
|
@ -2115,17 +2115,18 @@ export default {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
margin: 5vh auto !important;
|
||||
border-radius: 10px;
|
||||
margin: 0 auto !important;
|
||||
border-radius: 0;
|
||||
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 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
overflow: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__header {
|
||||
|
|
|
|||
|
|
@ -204,4 +204,23 @@ h3 {
|
|||
margin-bottom: 10px;
|
||||
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>
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
:title="$t('chatHistory.with') + agentName + $t('chatHistory.dialogTitle')"
|
||||
:visible.sync="dialogVisible"
|
||||
width="80%"
|
||||
size="large"
|
||||
:footer="false"
|
||||
:close-on-click-modal="false"
|
||||
custom-class="chat-history-dialog">
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
:title="$t('contextProviderDialog.title')"
|
||||
:visible.sync="dialogVisible"
|
||||
width="720px"
|
||||
size="large"
|
||||
class="context-provider-dialog"
|
||||
:closeOnClickModal="false"
|
||||
:confirmText="$t('contextProviderDialog.confirm')"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
:close-on-press-escape="closeOnPressEscape"
|
||||
:show-close="showClose"
|
||||
:destroy-on-close="destroyOnClose"
|
||||
:custom-class="customClass"
|
||||
:custom-class="dialogCustomClass"
|
||||
class="custom-dialog"
|
||||
@close="handleClose"
|
||||
@open="handleOpen"
|
||||
|
|
@ -80,6 +80,11 @@ export default {
|
|||
type: String,
|
||||
default: ""
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: "small",
|
||||
validator: (val) => ["small", "large"].includes(val),
|
||||
},
|
||||
cancelText: {
|
||||
type: String,
|
||||
default: "取消"
|
||||
|
|
@ -94,6 +99,14 @@ export default {
|
|||
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: {
|
||||
CustomButton
|
||||
},
|
||||
|
|
@ -124,131 +137,145 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.custom-dialog {
|
||||
::v-deep .el-dialog {
|
||||
border-radius: 10px;
|
||||
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);
|
||||
}
|
||||
/* wrapper 上带 custom-dialog class(来自 :class prop),用 :global() 命中它本身 */
|
||||
:global(.el-dialog__wrapper.custom-dialog) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__wrapper {
|
||||
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;
|
||||
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 {
|
||||
max-height: calc(100vh - 220px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
max-height: calc(100vh - 220px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
::v-deep + .v-modal {
|
||||
background: rgba(15, 23, 42, 0.55) !important;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
::v-deep + .v-modal {
|
||||
background: rgba(15, 23, 42, 0.55) !important;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__header {
|
||||
padding: 16px 20px 12px;
|
||||
background: linear-gradient(135deg, #e2eeff, #edeafe);
|
||||
text-align: left;
|
||||
}
|
||||
::v-deep .el-dialog__header {
|
||||
padding: 16px 20px 12px;
|
||||
background: linear-gradient(135deg, #e2eeff, #edeafe);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__title {
|
||||
font-size: 16px;
|
||||
::v-deep .el-dialog__title {
|
||||
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;
|
||||
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;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
> span {
|
||||
line-height: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
color: #666;
|
||||
position: static;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.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%;
|
||||
&:hover {
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
|
||||
|
||||
.el-dialog__close {
|
||||
font-size: 18px;
|
||||
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;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::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>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
<CustomDialog
|
||||
:title="$t('modelConfigDialog.editModel')"
|
||||
:visible.sync="dialogVisible"
|
||||
width="720px"
|
||||
width="960px"
|
||||
size="large"
|
||||
class="model-edit-dialog"
|
||||
:confirmLoading="saving"
|
||||
@confirm="handleSave"
|
||||
|
|
@ -465,6 +466,10 @@ export default {
|
|||
@import '@/styles/global.scss';
|
||||
|
||||
.model-edit-dialog {
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 24px 40px;
|
||||
}
|
||||
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
:title="title"
|
||||
:visible.sync="visible"
|
||||
width="57%"
|
||||
size="large"
|
||||
class="provider-dialog-wrapper"
|
||||
@confirm="submit"
|
||||
@close="handleClose"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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="handleClose">
|
||||
<div class="scroll-wrapper">
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
:title="$t('voiceClone.dialogTitle')"
|
||||
:visible.sync="innerVisible"
|
||||
width="900px"
|
||||
size="large"
|
||||
:footer="false"
|
||||
@close="handleDialogClose"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
:confirm-loading="confirmLoading"
|
||||
:footer="true"
|
||||
:width="'1200px'"
|
||||
size="large"
|
||||
@confirm="handleDialogConfirm"
|
||||
@cancel="dialogVisible = false"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in a new issue