mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
弹框宽度和高度统一收口
同一批弹框的尺寸还是各管各的:模型配置里改参数那个是跟着窗口大小按比例伸缩,历史提示词的源编辑弹框是 900 像素,参数管理里又是 720 像素,智能体变更详情那个上下还留了一大块空白。这次收到同一个共用底子上:宽度都对齐到 720 像素,弹框默认上下贴齐屏幕边、内容多时中间滚动,变更详情那个高度撑到接近屏幕顶到底。
This commit is contained in:
parent
6b625dc740
commit
499c37020c
4 changed files with 43 additions and 28 deletions
|
|
@ -2115,10 +2115,10 @@ export default {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
margin: 32px auto !important;
|
||||
margin: 5vh auto !important;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
max-height: calc(100vh - 64px);
|
||||
max-height: calc(100vh - 10vh);
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__wrapper {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
width="900px"
|
||||
<CustomDialog
|
||||
:title="$t('contextProviderDialog.title')"
|
||||
:close-on-click-modal="false"
|
||||
custom-class="context-provider-dialog"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
width="720px"
|
||||
class="context-provider-dialog"
|
||||
:closeOnClickModal="false"
|
||||
:confirmText="$t('contextProviderDialog.confirm')"
|
||||
:cancelText="$t('contextProviderDialog.cancel')"
|
||||
@confirm="handleConfirm"
|
||||
>
|
||||
<div class="dialog-content">
|
||||
<el-empty v-if="localProviders.length === 0" :description="$t('contextProviderDialog.noContextApi')">
|
||||
|
|
@ -51,7 +53,7 @@
|
|||
size="small"
|
||||
class="flex-1"
|
||||
></el-input>
|
||||
|
||||
|
||||
<div class="row-controls">
|
||||
<el-button
|
||||
type="primary"
|
||||
|
|
@ -104,17 +106,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">{{ $t('contextProviderDialog.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">{{ $t('contextProviderDialog.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</CustomDialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomDialog from './CustomDialog.vue';
|
||||
|
||||
export default {
|
||||
name: 'ContextProviderDialog',
|
||||
components: { CustomDialog },
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
|
|
@ -157,7 +157,7 @@ export default {
|
|||
headers: Object.entries(headers).map(([key, value]) => ({ key, value }))
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// 如果为空,添加一个默认块
|
||||
if (this.localProviders.length === 0) {
|
||||
this.localProviders.push({ url: '', headers: [{ key: '', value: '' }] });
|
||||
|
|
@ -193,19 +193,22 @@ export default {
|
|||
headers: headersObj
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
this.$emit('confirm', result);
|
||||
this.dialogVisible = false;
|
||||
this.$emit('update:visible', false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.context-provider-dialog ::v-deep .el-dialog__body {
|
||||
padding: 16px 20px;
|
||||
}
|
||||
.dialog-content {
|
||||
max-height: 60vh;
|
||||
max-height: calc(100vh - 280px);
|
||||
overflow-y: auto;
|
||||
padding: 20px 25px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.dialog-content::-webkit-scrollbar {
|
||||
|
|
@ -230,7 +233,7 @@ export default {
|
|||
flex: 1;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-left: 4px solid #409EFF; /* 左侧强调色 */
|
||||
border-left: 4px solid #409EFF;
|
||||
background-color: #fff;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
|
||||
|
|
@ -261,7 +264,7 @@ export default {
|
|||
text-align: right;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
line-height: 32px; /* 垂直居中对齐 */
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.flex-1 {
|
||||
|
|
@ -327,3 +330,4 @@ export default {
|
|||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -129,6 +129,22 @@ export default {
|
|||
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__wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__body {
|
||||
max-height: calc(100vh - 220px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
::v-deep + .v-modal {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<CustomDialog
|
||||
:title="$t('modelConfigDialog.editModel')"
|
||||
:visible.sync="dialogVisible"
|
||||
width="57%"
|
||||
width="720px"
|
||||
class="model-edit-dialog"
|
||||
:confirmLoading="saving"
|
||||
@confirm="handleSave"
|
||||
|
|
@ -464,11 +464,6 @@ export default {
|
|||
<style lang="scss" scoped>
|
||||
@import '@/styles/global.scss';
|
||||
|
||||
::v-deep .el-dialog__body {
|
||||
max-height: calc(100vh - 220px);
|
||||
overflow-y: auto;
|
||||
@include scrollbar-style;
|
||||
}
|
||||
.model-edit-dialog {
|
||||
.header-row {
|
||||
display: flex;
|
||||
|
|
|
|||
Loading…
Reference in a new issue