保存逻辑

main
SWX\10484 4 days ago
parent 5b82abf4a7
commit a53e50d8bd
  1. 10
      src/layout/components/SystemSettingDialog.vue
  2. 19
      src/views/videoCommunication/realTimeConsultation.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)`, '手动输入路径', {

@ -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');
});

Loading…
Cancel
Save