弹框关掉后再点不开以及宽度高度统一收口 (#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 { export default {
// 已绑设备 // 已绑设备
getAgentBindDevices(agentId, callback) { getAgentBindDevices(agentId, callback, failCallback) {
RequestService.sendRequest() RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}`) .url(`${getServiceUrl()}/device/bind/${agentId}`)
.method('GET') .method('GET')
@ -11,15 +11,21 @@ export default {
RequestService.clearRequestTime(); RequestService.clearRequestTime();
callback(res); callback(res);
}) })
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => { .networkFail((err) => {
console.error('获取设备列表失败:', err); console.error('获取设备列表失败:', err);
RequestService.reAjaxFun(() => { RequestService.reAjaxFun(() => {
this.getAgentBindDevices(agentId, callback); this.getAgentBindDevices(agentId, callback, failCallback);
}); });
}).send(); }).send();
}, },
// 解绑设备 // 解绑设备
unbindDevice(device_id, callback) { unbindDevice(device_id, callback, failCallback) {
RequestService.sendRequest() RequestService.sendRequest()
.url(`${getServiceUrl()}/device/unbind`) .url(`${getServiceUrl()}/device/unbind`)
.method('POST') .method('POST')
@ -28,15 +34,21 @@ export default {
RequestService.clearRequestTime(); RequestService.clearRequestTime();
callback(res); callback(res);
}) })
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => { .networkFail((err) => {
console.error('解绑设备失败:', err); console.error('解绑设备失败:', err);
RequestService.reAjaxFun(() => { RequestService.reAjaxFun(() => {
this.unbindDevice(device_id, callback); this.unbindDevice(device_id, callback, failCallback);
}); });
}).send(); }).send();
}, },
// 绑定设备 // 绑定设备
bindDevice(agentId, deviceCode, callback) { bindDevice(agentId, deviceCode, callback, failCallback) {
RequestService.sendRequest() RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}/${deviceCode}`) .url(`${getServiceUrl()}/device/bind/${agentId}/${deviceCode}`)
.method('POST') .method('POST')
@ -44,14 +56,20 @@ export default {
RequestService.clearRequestTime(); RequestService.clearRequestTime();
callback(res); callback(res);
}) })
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => { .networkFail((err) => {
console.error('绑定设备失败:', err); console.error('绑定设备失败:', err);
RequestService.reAjaxFun(() => { RequestService.reAjaxFun(() => {
this.bindDevice(agentId, deviceCode, callback); this.bindDevice(agentId, deviceCode, callback, failCallback);
}); });
}).send(); }).send();
}, },
updateDeviceInfo(id, payload, callback) { updateDeviceInfo(id, payload, callback, failCallback) {
RequestService.sendRequest() RequestService.sendRequest()
.url(`${getServiceUrl()}/device/update/${id}`) .url(`${getServiceUrl()}/device/update/${id}`)
.method('PUT') .method('PUT')
@ -60,16 +78,22 @@ export default {
RequestService.clearRequestTime() RequestService.clearRequestTime()
callback(res) callback(res)
}) })
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => { .networkFail((err) => {
console.error('更新OTA状态失败:', err) console.error('更新OTA状态失败:', err)
this.$message.error(err.msg || '更新OTA状态失败') this.$message.error(err.msg || '更新OTA状态失败')
RequestService.reAjaxFun(() => { RequestService.reAjaxFun(() => {
this.updateDeviceInfo(id, payload, callback) this.updateDeviceInfo(id, payload, callback, failCallback)
}) })
}).send() }).send()
}, },
// 手动添加设备 // 手动添加设备
manualAddDevice(params, callback) { manualAddDevice(params, callback, failCallback) {
RequestService.sendRequest() RequestService.sendRequest()
.url(`${getServiceUrl()}/device/manual-add`) .url(`${getServiceUrl()}/device/manual-add`)
.method('POST') .method('POST')
@ -78,15 +102,21 @@ export default {
RequestService.clearRequestTime(); RequestService.clearRequestTime();
callback(res); callback(res);
}) })
.fail((err) => {
RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
})
.networkFail((err) => { .networkFail((err) => {
console.error('手动添加设备失败:', err); console.error('手动添加设备失败:', err);
RequestService.reAjaxFun(() => { RequestService.reAjaxFun(() => {
this.manualAddDevice(params, callback); this.manualAddDevice(params, callback, failCallback);
}); });
}).send(); }).send();
}, },
// 获取设备状态 // 获取设备状态
getDeviceStatus(agentId, callback) { getDeviceStatus(agentId, callback, failCallback) {
RequestService.sendRequest() RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}`) .url(`${getServiceUrl()}/device/bind/${agentId}`)
.method('POST') .method('POST')
@ -95,13 +125,16 @@ export default {
RequestService.clearRequestTime(); RequestService.clearRequestTime();
callback(res); callback(res);
}) })
.fail((res) => { .fail((err) => {
callback(res); RequestService.clearRequestTime();
if (failCallback) {
failCallback(err);
}
}) })
.networkFail((err) => { .networkFail((err) => {
console.error('获取设备状态失败:', err); console.error('获取设备状态失败:', err);
RequestService.reAjaxFun(() => { RequestService.reAjaxFun(() => {
this.getDeviceStatus(agentId, callback); this.getDeviceStatus(agentId, callback, failCallback);
}); });
}).send(); }).send();
}, },

View file

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

View file

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

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

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

View file

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

View file

@ -2,7 +2,7 @@
<el-dialog <el-dialog
:title="$t('cache.dialogTitle')" :title="$t('cache.dialogTitle')"
:visible.sync="visible" :visible.sync="visible"
width="70%" width="80%"
:before-close="handleClose" :before-close="handleClose"
> >
<div v-if="isLoading" class="loading-container"> <div v-if="isLoading" class="loading-container">
@ -204,4 +204,24 @@ h3 {
margin-bottom: 10px; margin-bottom: 10px;
font-weight: 500; 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> </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

@ -1,11 +1,14 @@
<template> <template>
<el-dialog <CustomDialog
:visible.sync="dialogVisible"
width="900px"
:title="$t('contextProviderDialog.title')" :title="$t('contextProviderDialog.title')"
:close-on-click-modal="false" :visible.sync="dialogVisible"
custom-class="context-provider-dialog" width="960px"
append-to-body size="large"
class="context-provider-dialog"
:closeOnClickModal="false"
:confirmText="$t('contextProviderDialog.confirm')"
:cancelText="$t('contextProviderDialog.cancel')"
@confirm="handleConfirm"
> >
<div class="dialog-content"> <div class="dialog-content">
<el-empty v-if="localProviders.length === 0" :description="$t('contextProviderDialog.noContextApi')"> <el-empty v-if="localProviders.length === 0" :description="$t('contextProviderDialog.noContextApi')">
@ -104,17 +107,15 @@
</div> </div>
</div> </div>
</div> </div>
</CustomDialog>
<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>
</template> </template>
<script> <script>
import CustomDialog from './CustomDialog.vue';
export default { export default {
name: 'ContextProviderDialog', name: 'ContextProviderDialog',
components: { CustomDialog },
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
@ -195,17 +196,20 @@ export default {
}); });
this.$emit('confirm', result); this.$emit('confirm', result);
this.dialogVisible = false; this.$emit('update:visible', false);
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.context-provider-dialog ::v-deep .el-dialog__body {
padding: 16px 20px;
}
.dialog-content { .dialog-content {
max-height: 60vh; max-height: calc(100vh - 280px);
overflow-y: auto; overflow-y: auto;
padding: 20px 25px; padding: 0 5px;
} }
.dialog-content::-webkit-scrollbar { .dialog-content::-webkit-scrollbar {
@ -230,7 +234,7 @@ export default {
flex: 1; flex: 1;
border-radius: 12px; border-radius: 12px;
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
border-left: 4px solid #409EFF; /* 左侧强调色 */ border-left: 4px solid #409EFF;
background-color: #fff; background-color: #fff;
transition: all 0.3s ease; transition: all 0.3s ease;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
@ -261,7 +265,7 @@ export default {
text-align: right; text-align: right;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
line-height: 32px; /* 垂直居中对齐 */ line-height: 32px;
} }
.flex-1 { .flex-1 {
@ -327,3 +331,4 @@ export default {
margin-right: 8px; margin-right: 8px;
} }
</style> </style>

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"
@ -54,7 +54,7 @@ export default {
}, },
width: { width: {
type: String, type: String,
default: "600px" default: "720px"
}, },
footer: { footer: {
type: Boolean, type: Boolean,
@ -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,15 @@ 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");
if (String(this.width).includes("%")) classes.push("custom-dialog--fluid");
return classes.join(" ");
},
},
components: { components: {
CustomButton CustomButton
}, },
@ -124,110 +138,134 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-dialog { /* 大档与小档通过 .custom-dialog--large 区分 */
::v-deep .el-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);
} margin: 5vh auto !important;
display: flex;
flex-direction: column;
max-height: calc(100vh - 10vh);
}
::v-deep .el-dialog__header { ::v-deep .el-dialog__body {
padding: 16px 20px 12px; max-height: calc(100vh - 220px);
background: linear-gradient(135deg, #e2eeff, #edeafe); overflow-y: auto;
text-align: left; padding: 20px;
} }
::v-deep .el-dialog__title { /* .v-modal 样式由 global.scss 全局定义 */
font-size: 16px; ::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; 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__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> </style>

View file

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

View file

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

View file

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

View file

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

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="80%" 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

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

View file

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

View file

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

View file

@ -477,8 +477,8 @@ export default {
'device.type': 'Tipo de Dispositivo', 'device.type': 'Tipo de Dispositivo',
'device.status': 'Status do Dispositivo', 'device.status': 'Status do Dispositivo',
'device.dialogTitle': 'Adicionar Dispositivo', 'device.dialogTitle': 'Adicionar Dispositivo',
'device.verificationCode': 'Código de Verificação:', '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.verificationCodePlaceholder': 'Por favor, insira o código de verificação de 6 dígitos transmitido pelo dispositivo…',
'device.confirmButton': 'Confirmar', 'device.confirmButton': 'Confirmar',
'device.cancelButton': 'Cancelar', 'device.cancelButton': 'Cancelar',
'device.input6DigitCode': 'Por favor, insira um código de verificação de 6 dígitos', '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 // Diálogo de adicionar agente
'addAgentDialog.title': 'Adicionar Agente', 'addAgentDialog.title': 'Adicionar Agente',
'addAgentDialog.agentName': 'Nome do 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.confirm': 'Confirmar',
'addAgentDialog.cancel': 'Cancelar', 'addAgentDialog.cancel': 'Cancelar',
'addAgentDialog.nameRequired': 'Por favor, insira o nome do agente', '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.type': 'Loại thiết bị',
'device.status': 'Trạng thái thiết bị', 'device.status': 'Trạng thái thiết bị',
'device.dialogTitle': 'Thêm thiết bị', 'device.dialogTitle': 'Thêm thiết bị',
'device.verificationCode': 'Mã xác minh:', '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.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.confirmButton': 'Xác nhận',
'device.cancelButton': 'Hủy bỏ', 'device.cancelButton': 'Hủy bỏ',
'device.input6DigitCode': 'Vui lòng nhập mã xác minh 6 chữ số', 'device.input6DigitCode': 'Vui lòng nhập mã xác minh 6 chữ số',
@ -820,7 +820,7 @@ export default {
// Add agent dialog text // Add agent dialog text
'addAgentDialog.title': 'Thêm tác nhân', 'addAgentDialog.title': 'Thêm tác nhân',
'addAgentDialog.agentName': 'Tên 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.confirm': 'Xác nhận',
'addAgentDialog.cancel': 'Hủy bỏ', 'addAgentDialog.cancel': 'Hủy bỏ',
'addAgentDialog.nameRequired': 'Vui lòng nhập tên tác nhân', 'addAgentDialog.nameRequired': 'Vui lòng nhập tên tác nhân',

View file

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

View file

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

View file

@ -44,3 +44,30 @@ select:-webkit-autofill:focus {
border-radius: 3px; 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" :visible.sync="dialogVisible"
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
:footer="true" :footer="true"
:width="'1200px'" :width="'1080px'"
size="large"
@confirm="handleDialogConfirm" @confirm="handleDialogConfirm"
@cancel="dialogVisible = false" @cancel="dialogVisible = false"
> >
@ -92,7 +93,7 @@
:placeholder="$t('templateQuickConfig.agentSettings.systemPromptPlaceholder')" :placeholder="$t('templateQuickConfig.agentSettings.systemPromptPlaceholder')"
show-word-limit show-word-limit
maxlength="2000" maxlength="2000"
:rows="16" :autosize="{ minRows: 16 }"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>

View file

@ -68,7 +68,7 @@
</div> </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" /> :firmware-types="firmwareTypes" @submit="handleSubmit" @cancel="dialogVisible = false" />
<el-footer> <el-footer>
<version-footer /> <version-footer />
@ -210,6 +210,7 @@ export default {
showClose: true showClose: true
}); });
} }
this.$refs.firmwareDialog?.resetSaving();
}); });
} else { } else {
Api.ota.saveOta(form, (res) => { Api.ota.saveOta(form, (res) => {
@ -227,6 +228,7 @@ export default {
showClose: true showClose: true
}); });
} }
this.$refs.firmwareDialog?.resetSaving();
}); });
} }
}, },

View file

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