diff --git a/src/layout/components/SystemSettingDialog.vue b/src/layout/components/SystemSettingDialog.vue index 8db0c7b..2ccdf65 100644 --- a/src/layout/components/SystemSettingDialog.vue +++ b/src/layout/components/SystemSettingDialog.vue @@ -328,7 +328,6 @@ export default { ? '当前浏览器不支持目录选择(需要 Chrome/Edge 86+)' : '非安全连接(HTTP),目录选择仅支持 HTTPS 或 localhost'; this.$message({ message: `${reason},可手动输入路径`, type: 'warning', duration: 5000 }); - // 降级:弹出输入框让用户手动填写路径 await this._manualInputPath(pathKey, label); return; } @@ -344,16 +343,17 @@ export default { // 提取当前路径的盘符(如 D:),拼接选中的文件夹名填充到输入框 const drive = this._extractDrive(this.basicForm[pathKey]); this.basicForm[pathKey] = `${drive}\\...\\${dirHandle.name}`; - this.$message.success(`${label}路径已更新`); + this.$message.success(`${label}路径已授权,截图/录制将自动保存`); } catch (err) { if (err.name !== 'AbortError') { - console.error(`${label}路径修改失败`, err); - this.$message.error('修改失败'); + console.error(`${label}目录选择失败`, err); + this.$message({ message: '目录选择失败,可手动输入路径', type: 'warning', duration: 3000 }); + await this._manualInputPath(pathKey, label); } } }, - // 降级方案:用户手动输入路径(showDirectoryPicker 不可用时) + // 降级方案:用户手动输入路径(showDirectoryPicker 不可用或失败时) _manualInputPath(pathKey, label) { return new Promise((resolve) => { this.$prompt(`请输入${label}文件夹的完整路径(如 D:\\MyFolder\\HiUTalkStore)`, '手动输入路径', { diff --git a/src/views/videoCommunication/realTimeConsultation.vue b/src/views/videoCommunication/realTimeConsultation.vue index 92f5d3c..a8edcb7 100644 --- a/src/views/videoCommunication/realTimeConsultation.vue +++ b/src/views/videoCommunication/realTimeConsultation.vue @@ -905,8 +905,21 @@ export default { const fileName = `${this.meetingTitle}录制_${new Date().toLocaleString().replace(/[/:\\s]/g, '_')}.webm`; this.mediaRecorder.ondataavailable = e => e.data.size && this.recordedChunks.push(e.data); this.mediaRecorder.onstop = async () => { - const blob = new Blob(this.recordedChunks, { type: 'video/webm' }); - // 优先保存到系统设置的视讯存储路径,降级下载 + // 1. 生成录制 blob + let blob; + try { + blob = new Blob(this.recordedChunks, { type: 'video/webm' }); + if (!blob || blob.size === 0) { + this.$message.warning('录制内容为空'); + return; + } + } catch (e) { + console.error('录制文件生成失败', e); + this.$message.error('录制文件生成失败'); + return; + } + + // 2. 优先保存到系统设置的视讯存储路径,降级下载 await this._saveBlobToVideoPath(blob, fileName, '录制'); }; this.mediaRecorder.start(); @@ -1003,7 +1016,7 @@ export default { logging: false, allowTaint: false, }); - fileName = `会诊截图_${new Date().toLocaleString().replace(/[/:\\s]/g, '_')}.png`; + fileName = `${this.meetingTitle || '会诊'}截图_${new Date().toLocaleString().replace(/[/:\\s]/g, '_')}.png`; blob = await new Promise((resolve, reject) => { canvas.toBlob(b => { if (b) resolve(b); else reject(new Error('toBlob 失败')); }, 'image/png'); });