弹框关掉后再点不开以及宽度高度统一收口 (#3388)

* 统一管理后台弹框更舒展

把 CustomDialog 默认宽度从 600 加到 720,正文给到至少 360 的高度,
默认弹框就不再显得局促。参数编辑弹框也跟着加宽。智能体历史版
本那条列表、对比和恢复预览都给到至少 420 的最小高度,避免内容
少时框太矮看起来小气。其他像添加智能体、绑定设备这些原本就合适
的弹框没动。

* 弹框外观统一收口

原本几个弹框长得参差不齐:标题字号、按钮文案、留白高度各管各的。这次把新建智能体、新建设备、改模型、改参数这几个弹框接到同一个底座上,按钮统一成「确定」「取消」,输入框字号高度对齐,遮罩背景加了模糊,弹框太高就内部滚动,四个弹框看起来一个模子

* 修复弹框关掉后再点不开

之前几个弹框改用新底座的时候,关闭那一路少了一段转发:父页面用双向绑定来收弹框关闭的信号,子页面应该再把关闭事件抛上去告诉父页面。这一段被删了,下次再点添加按钮时父页面那边状态没复位,弹框就拉不开来。现在把这段补回去。

* 弹框宽度和高度统一收口

同一批弹框的尺寸还是各管各的:模型配置里改参数那个是跟着窗口大小按比例伸缩,历史提示词的源编辑弹框是 900 像素,参数管理里又是 720 像素,智能体变更详情那个上下还留了一大块空白。这次收到同一个共用底子上:宽度都对齐到 720 像素,弹框默认上下贴齐屏幕边、内容多时中间滚动,变更详情那个高度撑到接近屏幕顶到底。

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

管理后台里的弹框按大小分成两类来收口。占整页的大弹框(历史版本、变更详情、模型修改、模型参数修正等)撑满整个浏览器高度,下面不再留白;小弹框(添加智能体、添加设备、知识库、字典、角色模板等)改成对齐屏幕正中,不再顶在屏幕上沿。修改模型那条弹框也加宽到 960,左右留白加大到 40,跟历史版本对齐,看起来更舒展。

* 大弹框上下留白收口到十像素并按三档统一宽度

大弹框上下各留十像素让边框和圆角清晰可见。宽度按用途分三档:表单 960、含代码 1080、表格 80% 加宽度上限。供应器、上下文供应器、音色克隆都改 960;TTS 从 90% 改 80%;角色模板从 1200 改 1080;缓存查看从 70% 改 80%。新增模板的大文本框改成自适应高度。

* 弹框样式与文案收口处理

AddDeviceDialog 确认后关闭弹框;CustomDialog 去掉 :global 与紧邻选择器,合并 el-dialog__body 样式块;删除未使用的 --dialog-form/--dialog-code;AddWisdomBodyDialog 的 cancel/handleClose 委托到同一个实现;多语言文案同步去冒号与双点。

* 弹框遮罩样式移到全局作用域

scoped 块里的 ::v-deep .v-modal 打不到 body 层的遮罩,改在 global.scss 用全局选择器。

* 弹框 wrapper 居中样式移到全局作用域

scoped 块里的 ::v-deep .el-dialog__wrapper 同样打不到 element-ui 自渲染的 wrapper,跟 .v-modal 一起挪到 global.scss。

* 弹框提交状态异常收口

设备激活码错误路径不再卡 loading;Provider 与固件弹框补 loading 兜底。

* 弹框视觉异常收口

首页删除确认弹框 wrapper 居中;历史版本弹框去掉内层多余滚动条。

* 设备 API 链式返回修复

bindDevice 等方法补上 return,让 .fail() 兜底回调能正常注册到请求对象上。

* 设备 API 错误回调参数补全

device.js 六个方法加 failCallback 参数;user.js login 网络重试补 failCallback;AddDeviceDialog 改四参数签名。

* 设备状态 API 失败回调引用修复

getDeviceStatus 的 .fail() 块把函数体内 callback(res) 改成与签名一致的 if (failCallback) failCallback(err),避免业务错误时抛 ReferenceError。
This commit is contained in:
hrz 2026-10-07 08:03:25 +08:00 committed by GitHub
parent 87c6df77b0
commit 7a260ee143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 449 additions and 341 deletions

View file

@ -3,7 +3,7 @@ import RequestService from '../httpRequest';
export default {
// 已绑设备
getAgentBindDevices(agentId, callback) {
getAgentBindDevices(agentId, callback, failCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}`)
.method('GET')
@ -11,15 +11,21 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => {
console.error('获取设备列表失败:', err);
RequestService.reAjaxFun(() => {
this.getAgentBindDevices(agentId, callback);
this.getAgentBindDevices(agentId, callback, failCallback);
});
}).send();
},
// 解绑设备
unbindDevice(device_id, callback) {
unbindDevice(device_id, callback, failCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/unbind`)
.method('POST')
@ -28,15 +34,21 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => {
console.error('解绑设备失败:', err);
RequestService.reAjaxFun(() => {
this.unbindDevice(device_id, callback);
this.unbindDevice(device_id, callback, failCallback);
});
}).send();
},
// 绑定设备
bindDevice(agentId, deviceCode, callback) {
bindDevice(agentId, deviceCode, callback, failCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}/${deviceCode}`)
.method('POST')
@ -44,14 +56,20 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => {
console.error('绑定设备失败:', err);
RequestService.reAjaxFun(() => {
this.bindDevice(agentId, deviceCode, callback);
this.bindDevice(agentId, deviceCode, callback, failCallback);
});
}).send();
},
updateDeviceInfo(id, payload, callback) {
updateDeviceInfo(id, payload, callback, failCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/update/${id}`)
.method('PUT')
@ -60,16 +78,22 @@ export default {
RequestService.clearRequestTime()
callback(res)
})
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => {
console.error('更新OTA状态失败:', err)
this.$message.error(err.msg || '更新OTA状态失败')
RequestService.reAjaxFun(() => {
this.updateDeviceInfo(id, payload, callback)
this.updateDeviceInfo(id, payload, callback, failCallback)
})
}).send()
},
// 手动添加设备
manualAddDevice(params, callback) {
manualAddDevice(params, callback, failCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/manual-add`)
.method('POST')
@ -78,15 +102,21 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => {
console.error('手动添加设备失败:', err);
RequestService.reAjaxFun(() => {
this.manualAddDevice(params, callback);
this.manualAddDevice(params, callback, failCallback);
});
}).send();
},
// 获取设备状态
getDeviceStatus(agentId, callback) {
getDeviceStatus(agentId, callback, failCallback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}`)
.method('POST')
@ -95,14 +125,17 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
.fail((res) => {
callback(res);
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => {
console.error('获取设备状态失败:', err);
RequestService.reAjaxFun(() => {
this.getDeviceStatus(agentId, callback);
this.getDeviceStatus(agentId, callback, failCallback);
});
}).send();
},
}
}

View file

@ -19,7 +19,7 @@ export default {
})
.networkFail(() => {
RequestService.reAjaxFun(() => {
this.login(loginForm, callback)
this.login(loginForm, callback, failCallback)
})
}).send()
},

View file

@ -1,39 +1,37 @@
<template>
<el-dialog :visible="visible" @close="handleClose" width="24%" center>
<div
style="margin: 0 10px 10px;display: flex;align-items: center;gap: 10px;font-weight: 700;font-size: 20px;text-align: left;color: #3d4566;">
<div
style="width: 40px;height: 40px;border-radius: 50%;background: #5778ff;display: flex;align-items: center;justify-content: center;">
<img src="@/assets/home/equipment.png" alt="" style="width: 18px;height: 15px;" />
<CustomDialog
:title="$t('device.dialogTitle')"
:visible.sync="visible"
width="420px"
:confirmLoading="loading"
@confirm="confirm"
@cancel="cancel"
@close="handleClose"
:confirmText="$t('device.confirmButton')"
:cancelText="$t('device.cancelButton')"
>
<div class="add-device-body">
<div class="add-device-label">
<span class="required">*</span>
{{ $t('device.verificationCode') }}
</div>
{{ $t('device.dialogTitle') }}
<el-input
:placeholder="$t('device.verificationCodePlaceholder')"
v-model="deviceCode"
class="add-device-input"
@keyup.enter.native="confirm"
/>
</div>
<div style="height: 1px;background: #e8f0ff;" />
<div style="margin: 22px 15px;">
<div style="font-weight: 400;font-size: 14px;text-align: left;color: #3d4566;">
<div style="color: red;display: inline-block;">*</div>
<span style="font-size: 11px"> {{ $t('device.verificationCode') }}</span>
</div>
<div class="input-46" style="margin-top: 12px;">
<el-input :placeholder="$t('device.verificationCodePlaceholder')" v-model="deviceCode" @keyup.enter.native="confirm" />
</div>
</div>
<div style="display: flex;margin: 15px 15px;gap: 7px;">
<div class="dialog-btn" @click="confirm">
{{ $t('device.confirmButton') }}
</div>
<div class="dialog-btn" style="background: #e6ebff;border: 1px solid #adbdff;color: #5778ff;" @click="cancel">
{{ $t('device.cancelButton') }}
</div>
</div>
</el-dialog>
</CustomDialog>
</template>
<script>
import Api from '@/apis/api';
import CustomDialog from './CustomDialog.vue';
export default {
name: 'AddDeviceDialog',
components: { CustomDialog },
props: {
visible: { type: Boolean, required: true },
agentId: { type: String, required: true }
@ -53,7 +51,8 @@ export default {
this.loading = true;
Api.device.bindDevice(
this.agentId,
this.deviceCode, ({ data }) => {
this.deviceCode,
({ data }) => {
this.loading = false;
if (data.code === 0) {
this.$emit('refresh');
@ -68,59 +67,53 @@ export default {
showClose: true
});
}
},
(err) => {
this.loading = false;
const msg = err && err.data && err.data.msg;
this.$message.error({
message: msg || this.$t('device.bindFailed'),
showClose: true
});
}
);
},
closeDialog() {
this.$emit('update:visible', false);
this.loading = false;
this.deviceCode = '';
this.$emit('update:visible', false);
},
cancel() {
this.$emit('update:visible', false)
this.deviceCode = ""
this.closeDialog();
},
handleClose() {
this.$emit('update:visible', false);
},
this.closeDialog();
}
}
}
</script>
<style scoped>
.input-46 {
border: 1px solid #e4e6ef;
background: #f6f8fb;
border-radius: 10px;
.add-device-body {
padding: 6px 4px 4px;
}
.dialog-btn {
cursor: pointer;
flex: 1;
border-radius: 23px;
background: #5778ff;
.add-device-label {
font-size: 14px;
color: #475569;
text-align: left;
margin-bottom: 12px;
}
.add-device-label .required {
color: #f56c6c;
margin-right: 2px;
}
.add-device-input ::v-deep(.el-input__inner) {
height: 40px;
font-weight: 500;
font-size: 12px;
color: #fff;
line-height: 40px;
text-align: center;
}
::v-deep .el-dialog {
border-radius: 15px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
::v-deep .el-dialog__headerbtn {
display: none;
}
::v-deep .el-dialog__body {
padding: 4px 6px;
}
::v-deep .el-dialog__header {
padding: 10px;
border-radius: 8px;
border-color: #e2e8f0;
font-size: 14px;
}
</style>

View file

@ -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"

View file

@ -1,51 +1,53 @@
<template>
<el-dialog :visible="visible" @close="handleClose" width="25%" center @open="handleOpen">
<div
style="margin: 0 10px 10px;display: flex;align-items: center;gap: 10px;font-weight: 700;font-size: 20px;text-align: left;color: #3d4566;">
<div
style="width: 40px;height: 40px;border-radius: 50%;background: #5778ff;display: flex;align-items: center;justify-content: center;">
<img loading="lazy" src="@/assets/home/equipment.png" alt="" style="width: 18px;height: 15px;" />
<CustomDialog
:title="$t('addAgentDialog.title')"
:visible.sync="visible"
width="420px"
@confirm="confirm"
@cancel="cancel"
@close="handleClose"
:confirmText="$t('addAgentDialog.confirm')"
:cancelText="$t('addAgentDialog.cancel')"
@open="handleOpen"
>
<div class="add-agent-body">
<div class="add-agent-label">
<span class="required">*</span>
{{ $t('addAgentDialog.agentName') }}
</div>
{{ $t('addAgentDialog.title') }}
<el-input
maxLength="64"
ref="inputRef"
:placeholder="$t('addAgentDialog.placeholder')"
v-model="wisdomBodyName"
class="add-agent-input"
@keyup.enter.native="confirm"
/>
</div>
<div style="height: 1px;background: #e8f0ff;" />
<div style="margin: 22px 15px;">
<div style="font-weight: 400;text-align: left;color: #3d4566;">
<div style="color: red;display: inline-block;">*</div> {{ $t('addAgentDialog.agentName') }}:
</div>
<div class="input-46" style="margin-top: 12px;">
<el-input maxLength="64" ref="inputRef" :placeholder="$t('addAgentDialog.placeholder')" v-model="wisdomBodyName" @keyup.enter.native="confirm" />
</div>
</div>
<div style="display: flex;margin: 15px 15px;gap: 7px;">
<div class="dialog-btn" @click="confirm">
{{ $t('addAgentDialog.confirm') }}
</div>
<div class="dialog-btn" style="background: #e6ebff;border: 1px solid #adbdff;color: #5778ff;" @click="cancel">
{{ $t('addAgentDialog.cancel') }}
</div>
</div>
</el-dialog>
</CustomDialog>
</template>
<script>
import Api from '@/apis/api';
import CustomDialog from './CustomDialog.vue';
export default {
name: 'AddWisdomBodyDialog',
components: { CustomDialog },
props: {
visible: { type: Boolean, required: true }
},
data() {
return {
wisdomBodyName: "",
inputRef: null
wisdomBodyName: ""
}
},
methods: {
handleOpen() {
this.$nextTick(() => {
this.$refs.inputRef.focus();
if (this.$refs.inputRef && this.$refs.inputRef.focus) {
this.$refs.inputRef.focus();
}
});
},
confirm() {
@ -64,50 +66,37 @@ export default {
});
},
cancel() {
this.$emit('update:visible', false)
this.wisdomBodyName = ""
},
handleClose() {
this.wisdomBodyName = "";
this.$emit('update:visible', false);
},
handleClose() {
this.cancel();
}
}
}
</script>
<style scoped>
.input-46 {
border: 1px solid #e4e6ef;
background: #f6f8fb;
border-radius: 15px;
.add-agent-body {
padding: 6px 4px 4px;
}
.dialog-btn {
cursor: pointer;
flex: 1;
border-radius: 23px;
background: #5778ff;
.add-agent-label {
font-size: 14px;
color: #475569;
text-align: left;
margin-bottom: 12px;
}
.add-agent-label .required {
color: #f56c6c;
margin-right: 2px;
}
.add-agent-input ::v-deep(.el-input__inner) {
height: 40px;
font-weight: 500;
font-size: 12px;
color: #fff;
line-height: 40px;
text-align: center;
}
::v-deep .el-dialog {
border-radius: 15px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
::v-deep .el-dialog__headerbtn {
display: none;
}
::v-deep .el-dialog__body {
padding: 4px 6px;
}
::v-deep .el-dialog__header {
padding: 10px;
border-radius: 8px;
border-color: #e2e8f0;
font-size: 14px;
}
</style>

View file

@ -2115,17 +2115,18 @@ export default {
display: flex;
flex-direction: column;
overflow: hidden;
margin: 32px auto !important;
margin: 10px auto !important;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
max-height: calc(100vh - 64px);
height: calc(100vh - 20px);
max-height: calc(100vh - 20px);
}
::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 {
@ -2282,9 +2283,7 @@ export default {
}
.snapshot-table-wrapper {
max-height: 62vh;
overflow: auto;
@include scrollbar-style;
min-height: 420px;
}
.version-cell {
@ -2328,11 +2327,8 @@ export default {
}
.snapshot-diff {
min-height: 220px;
max-height: 68vh;
overflow: auto;
min-height: 420px;
padding-right: 2px;
@include scrollbar-style;
}
.restore-risk-alert {

View file

@ -2,7 +2,7 @@
<el-dialog
:title="$t('cache.dialogTitle')"
:visible.sync="visible"
width="70%"
width="80%"
:before-close="handleClose"
>
<div v-if="isLoading" class="loading-container">
@ -204,4 +204,24 @@ h3 {
margin-bottom: 10px;
font-weight: 500;
}
::v-deep .el-dialog {
margin: 10px auto !important;
height: calc(100vh - 20px);
max-height: calc(100vh - 20px);
border-radius: 10px;
display: flex;
flex-direction: column;
max-width: 1280px;
}
::v-deep .el-dialog__wrapper {
align-items: stretch;
}
::v-deep .el-dialog__body {
flex: 1;
max-height: calc(100vh - 20px - 130px);
overflow-y: auto;
}
</style>

View file

@ -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">

View file

@ -1,11 +1,14 @@
<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="960px"
size="large"
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 +54,7 @@
size="small"
class="flex-1"
></el-input>
<div class="row-controls">
<el-button
type="primary"
@ -104,17 +107,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 +158,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 +194,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 +234,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 +265,7 @@ export default {
text-align: right;
font-size: 13px;
white-space: nowrap;
line-height: 32px; /* 垂直居中对齐 */
line-height: 32px;
}
.flex-1 {
@ -327,3 +331,4 @@ export default {
margin-right: 8px;
}
</style>

View file

@ -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"
@ -54,7 +54,7 @@ export default {
},
width: {
type: String,
default: "600px"
default: "720px"
},
footer: {
type: Boolean,
@ -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,15 @@ 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");
if (String(this.width).includes("%")) classes.push("custom-dialog--fluid");
return classes.join(" ");
},
},
components: {
CustomButton
},
@ -124,110 +138,134 @@ 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);
}
/* 大档与小档通过 .custom-dialog--large 区分 */
::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__header {
padding: 16px 20px 12px;
background: linear-gradient(135deg, #e2eeff, #edeafe);
text-align: left;
}
::v-deep .el-dialog__body {
max-height: calc(100vh - 220px);
overflow-y: auto;
padding: 20px;
}
::v-deep .el-dialog__title {
font-size: 16px;
/* .v-modal 样式由 global.scss 全局定义 */
::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;
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__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;
}
}
/* 大档:上下各留 10px 让边框和圆角可见 */
::v-deep .el-dialog.custom-dialog.custom-dialog--large {
margin: 10px auto !important;
height: calc(100vh - 20px);
max-height: calc(100vh - 20px);
border-radius: 10px;
}
::v-deep .el-dialog.custom-dialog.custom-dialog--large.custom-dialog--fluid {
max-width: var(--dialog-table-max);
}
::v-deep .el-dialog.custom-dialog--large .el-dialog__body {
max-height: calc(100vh - 20px - 110px);
flex: 1;
min-height: 0;
}
</style>

View file

@ -111,6 +111,10 @@ export default {
this.saving = true
// 提交成功后将关闭对话框的逻辑交给父组件处理
this.$emit('submit', this.form)
// 兜底:父组件若未在回调内重置 saving,3 秒后强制释放加载状态
setTimeout(() => {
this.saving = false
}, 3000)
}
})
},

View file

@ -2,14 +2,14 @@
<CustomDialog
:title="$t('modelConfigDialog.editModel')"
:visible.sync="dialogVisible"
width="57%"
width="960px"
size="large"
class="model-edit-dialog"
:confirmLoading="saving"
@confirm="handleSave"
@close="handleClose"
@open="handleOpen"
>
<div class="dialog-scroll-body">
<div class="header-row">
<div class="section-title">{{ $t("modelConfigDialog.modelInfo") }}</div>
<div class="switch-group">
@ -93,7 +93,6 @@
</div>
</template>
</el-form>
</div>
</CustomDialog>
</template>
@ -466,19 +465,16 @@ export default {
<style lang="scss" scoped>
@import '@/styles/global.scss';
::v-deep .el-dialog {
margin-top: 6vh !important;
}
::v-deep .el-dialog__body {
max-height: 60vh;
overflow-y: auto;
@include scrollbar-style;
}
.model-edit-dialog {
::v-deep .el-dialog__body {
padding: 24px 40px;
}
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
}
.section-title {
@ -511,7 +507,7 @@ export default {
.section-divider {
height: 1px;
background: #e9e9e9;
margin-bottom: 16px;
margin-bottom: 18px;
}
.form-row {
@ -521,10 +517,13 @@ export default {
}
::v-deep .el-input__inner {
height: 32px;
height: 38px;
}
::v-deep .el-form-item {
margin-bottom: 10px;
margin-bottom: 14px;
}
::v-deep .el-form-item__label {
line-height: 38px;
}
}
</style>

View file

@ -2,11 +2,13 @@
<CustomDialog
:title="title"
:visible.sync="visible"
width="600px"
width="720px"
class="param-dialog-wrapper"
@confirm="submit"
@close="cancel"
:confirmLoading="saving"
:confirmText="$t('button.ok')"
:cancelText="$t('button.cancel')"
>
<div class="dialog-container">
<el-form :model="form" :rules="rules" ref="form" label-width="auto" label-position="left" class="param-form">
@ -147,6 +149,7 @@ export default {
cancel() {
this.saving = false; // 取消时重置状态
this.dialogKey = Date.now();
this.$emit('update:visible', false);
this.$emit('cancel');
},
@ -183,36 +186,19 @@ export default {
};
</script>
<style>
.custom-param-dialog {
border-radius: 16px !important;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
border: none !important;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 0 !important;
border-radius: 16px;
}
}
</style>
<style scoped lang="scss">
.param-dialog-wrapper {
.param-form {
.form-item {
margin-bottom: 20px;
margin-bottom: 28px;
:deep(.el-form-item__label) {
color: #475569;
font-weight: 500;
padding-right: 12px;
padding-right: 14px;
text-align: right;
font-size: 14px;
font-size: 15px;
letter-spacing: 0.2px;
line-height: 44px;
}
}
@ -221,7 +207,7 @@ export default {
background-color: #ffffff;
border-radius: 8px;
border: 1px solid #e2e8f0;
height: 42px;
height: 44px;
padding: 0 14px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
font-size: 14px;
@ -248,7 +234,7 @@ export default {
background-color: #ffffff;
border-radius: 8px;
border: 1px solid #e2e8f0;
height: 42px;
height: 44px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
font-size: 14px;
color: #334155;
@ -272,7 +258,7 @@ export default {
background-color: #ffffff;
border-radius: 8px;
border: 1px solid #e2e8f0;
padding: 12px 14px;
padding: 10px 14px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
font-size: 14px;
color: #334155;
@ -291,10 +277,6 @@ export default {
}
}
}
.remark-item :deep(.el-form-item__label) {
margin-top: -4px;
}
}
}
</style>

View file

@ -2,7 +2,8 @@
<CustomDialog
:title="title"
:visible.sync="visible"
width="57%"
width="960px"
size="large"
class="provider-dialog-wrapper"
@confirm="submit"
@close="handleClose"
@ -308,6 +309,11 @@ export default {
this.resetForm();
}
});
// 兜底:父组件若未在回调内清 saving,3 秒后强制释放加载状态
setTimeout(() => {
this.saving = false;
}, 3000);
}
});
},

View file

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

View file

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

View file

@ -477,8 +477,8 @@ export default {
'device.type': 'Gerätetyp',
'device.status': 'Gerätestatus',
'device.dialogTitle': 'Gerät hinzufügen',
'device.verificationCode': 'Bestätigungscode:',
'device.verificationCodePlaceholder': 'Bitte den 6-stelligen Bestätigungscode eingeben, der vom Gerät gesendet wird..',
'device.verificationCode': 'Bestätigungscode',
'device.verificationCodePlaceholder': 'Bitte den 6-stelligen Bestätigungscode eingeben, der vom Gerät gesendet wird…',
'device.confirmButton': 'Bestätigen',
'device.cancelButton': 'Abbrechen',
'device.input6DigitCode': 'Bitte 6-stelligen Bestätigungscode eingeben',
@ -820,7 +820,7 @@ export default {
// Add agent dialog text
'addAgentDialog.title': 'Agent hinzufügen',
'addAgentDialog.agentName': 'Agent-Name',
'addAgentDialog.placeholder': 'Bitte Agent-Namen eingeben..',
'addAgentDialog.placeholder': 'Bitte Agent-Namen eingeben…',
'addAgentDialog.confirm': 'Bestätigen',
'addAgentDialog.cancel': 'Abbrechen',
'addAgentDialog.nameRequired': 'Bitte Agent-Namen eingeben',

View file

@ -477,8 +477,8 @@ export default {
'device.type': 'Device Type',
'device.status': 'Device Status',
'device.dialogTitle': 'Add Device',
'device.verificationCode': 'Verification Code:',
'device.verificationCodePlaceholder': 'Please enter the 6-digit verification code broadcasted by the device..',
'device.verificationCode': 'Verification Code',
'device.verificationCodePlaceholder': 'Please enter the 6-digit verification code broadcasted by the device…',
'device.confirmButton': 'Confirm',
'device.cancelButton': 'Cancel',
'device.input6DigitCode': 'Please enter a 6-digit verification code',
@ -820,7 +820,7 @@ export default {
// Add agent dialog text
'addAgentDialog.title': 'Add Agent',
'addAgentDialog.agentName': 'Agent Name',
'addAgentDialog.placeholder': 'Please enter agent name..',
'addAgentDialog.placeholder': 'Please enter agent name…',
'addAgentDialog.confirm': 'Confirm',
'addAgentDialog.cancel': 'Cancel',
'addAgentDialog.nameRequired': 'Please enter agent name',

View file

@ -477,8 +477,8 @@ export default {
'device.type': 'Tipo de Dispositivo',
'device.status': 'Status do Dispositivo',
'device.dialogTitle': 'Adicionar Dispositivo',
'device.verificationCode': 'Código de Verificação:',
'device.verificationCodePlaceholder': 'Por favor, insira o código de verificação de 6 dígitos transmitido pelo dispositivo..',
'device.verificationCode': 'Código de Verificação',
'device.verificationCodePlaceholder': 'Por favor, insira o código de verificação de 6 dígitos transmitido pelo dispositivo…',
'device.confirmButton': 'Confirmar',
'device.cancelButton': 'Cancelar',
'device.input6DigitCode': 'Por favor, insira um código de verificação de 6 dígitos',
@ -820,7 +820,7 @@ export default {
// Diálogo de adicionar agente
'addAgentDialog.title': 'Adicionar Agente',
'addAgentDialog.agentName': 'Nome do Agente',
'addAgentDialog.placeholder': 'Por favor, insira o nome do agente..',
'addAgentDialog.placeholder': 'Por favor, insira o nome do agente…',
'addAgentDialog.confirm': 'Confirmar',
'addAgentDialog.cancel': 'Cancelar',
'addAgentDialog.nameRequired': 'Por favor, insira o nome do agente',

View file

@ -477,8 +477,8 @@ export default {
'device.type': 'Loại thiết bị',
'device.status': 'Trạng thái thiết bị',
'device.dialogTitle': 'Thêm thiết bị',
'device.verificationCode': 'Mã xác minh:',
'device.verificationCodePlaceholder': 'Vui lòng nhập mã xác minh 6 chữ số được phát từ thiết bị..',
'device.verificationCode': 'Mã xác minh',
'device.verificationCodePlaceholder': 'Vui lòng nhập mã xác minh 6 chữ số được phát từ thiết bị…',
'device.confirmButton': 'Xác nhận',
'device.cancelButton': 'Hủy bỏ',
'device.input6DigitCode': 'Vui lòng nhập mã xác minh 6 chữ số',
@ -820,7 +820,7 @@ export default {
// Add agent dialog text
'addAgentDialog.title': 'Thêm tác nhân',
'addAgentDialog.agentName': 'Tên tác nhân',
'addAgentDialog.placeholder': 'Vui lòng nhập tên tác nhân..',
'addAgentDialog.placeholder': 'Vui lòng nhập tên tác nhân…',
'addAgentDialog.confirm': 'Xác nhận',
'addAgentDialog.cancel': 'Hủy bỏ',
'addAgentDialog.nameRequired': 'Vui lòng nhập tên tác nhân',

View file

@ -477,8 +477,8 @@ export default {
'device.type': '设备类型',
'device.status': '设备状态',
'device.dialogTitle': '添加设备',
'device.verificationCode': '验证码:',
'device.verificationCodePlaceholder': '请输入设备播报的6位数验证码..',
'device.verificationCode': '验证码',
'device.verificationCodePlaceholder': '请输入设备播报的6位数验证码…',
'device.confirmButton': '确定',
'device.cancelButton': '取消',
'device.input6DigitCode': '请输入6位数字验证码',
@ -820,7 +820,7 @@ export default {
// 添加智能体对话框文本
'addAgentDialog.title': '添加智能体',
'addAgentDialog.agentName': '智能体名称',
'addAgentDialog.placeholder': '请输入智能体名称..',
'addAgentDialog.placeholder': '请输入智能体名称…',
'addAgentDialog.confirm': '确定',
'addAgentDialog.cancel': '取消',
'addAgentDialog.nameRequired': '请输入智能体名称',

View file

@ -477,8 +477,8 @@ export default {
'device.type': '設備類型',
'device.status': '設備狀態',
'device.dialogTitle': '添加設備',
'device.verificationCode': '驗證碼:',
'device.verificationCodePlaceholder': '請輸入設備播報的6位數驗證碼..',
'device.verificationCode': '驗證碼',
'device.verificationCodePlaceholder': '請輸入設備播報的6位數驗證碼…',
'device.confirmButton': '確定',
'device.cancelButton': '取消',
'device.input6DigitCode': '請輸入6位數字驗證碼',
@ -820,7 +820,7 @@ export default {
// 添加智能體對話框文本
'addAgentDialog.title': '添加智能體',
'addAgentDialog.agentName': '智能體名稱',
'addAgentDialog.placeholder': '請輸入智能體名稱..',
'addAgentDialog.placeholder': '請輸入智能體名稱…',
'addAgentDialog.confirm': '確定',
'addAgentDialog.cancel': '取消',
'addAgentDialog.nameRequired': '請輸入智能體名稱',

View file

@ -43,4 +43,31 @@ select:-webkit-autofill:focus {
background: #f0f3fe;
border-radius: 3px;
}
}
// 大弹框宽度档位(表格档使用)
:root {
--dialog-table-max: 1280px;
}
/* 全局弹框遮罩 */
.v-modal {
background: rgba(15, 23, 42, 0.55) !important;
backdrop-filter: blur(2px);
}
/* 全局弹框 wrapper 居中 */
.el-dialog__wrapper.custom-dialog {
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
/* 首页删除智能体确认弹框 wrapper 居中(非 CustomDialog,需单独命中) */
.el-dialog__wrapper.delete-agent-dialog {
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}

View file

@ -74,7 +74,8 @@
:visible.sync="dialogVisible"
:confirm-loading="confirmLoading"
:footer="true"
:width="'1200px'"
:width="'1080px'"
size="large"
@confirm="handleDialogConfirm"
@cancel="dialogVisible = false"
>
@ -92,7 +93,7 @@
:placeholder="$t('templateQuickConfig.agentSettings.systemPromptPlaceholder')"
show-word-limit
maxlength="2000"
:rows="16"
:autosize="{ minRows: 16 }"
/>
</el-form-item>
</el-form>

View file

@ -68,7 +68,7 @@
</div>
<!-- 新增/编辑固件对话框 -->
<firmware-dialog :title="dialogTitle" :visible.sync="dialogVisible" :form="firmwareForm"
<firmware-dialog ref="firmwareDialog" :title="dialogTitle" :visible.sync="dialogVisible" :form="firmwareForm"
:firmware-types="firmwareTypes" @submit="handleSubmit" @cancel="dialogVisible = false" />
<el-footer>
<version-footer />
@ -210,6 +210,7 @@ export default {
showClose: true
});
}
this.$refs.firmwareDialog?.resetSaving();
});
} else {
Api.ota.saveOta(form, (res) => {
@ -227,6 +228,7 @@ export default {
showClose: true
});
}
this.$refs.firmwareDialog?.resetSaving();
});
}
},

View file

@ -255,7 +255,6 @@ export default {
this.dialogVisible = true;
},
handleSubmit({ form, done }) {
this.loading = true;
if (form.id) {
Api.model.updateModelProvider(form, ({ data }) => {
if (data.code === 0) {
@ -264,7 +263,14 @@ export default {
message: this.$t('common.updateSuccess'),
showClose: true
});
this.dialogVisible = false;
} else {
this.$message.error({
message: data.msg || this.$t('common.updateFailure'),
showClose: true
});
}
done && done();
});
} else {
Api.model.addModelProvider(form, ({ data }) => {
@ -275,12 +281,16 @@ export default {
showClose: true
});
this.total += 1;
this.dialogVisible = false;
} else {
this.$message.error({
message: data.msg || this.$t('common.addFailure'),
showClose: true
});
}
done && done();
});
}
this.loading = false;
this.dialogVisible = false;
done && done();
},
deleteSelectedProviders() {
const selectedRows = this.providersList.filter(row => row.selected);