|
|
|
|
@ -816,6 +816,7 @@ export default { |
|
|
|
|
equipments: [], |
|
|
|
|
positions: [], |
|
|
|
|
experts: [], |
|
|
|
|
negative: 1, // 默认阴性(1=阴性,0=阳性) |
|
|
|
|
}, |
|
|
|
|
// 原始表单数据副本,用于检测是否有修改 |
|
|
|
|
originalForm: null, |
|
|
|
|
@ -906,8 +907,10 @@ export default { |
|
|
|
|
// ==================== IndexedDB 目录句柄读取(与 SystemSettingDialog 共享 HiUTalkStoreDB) ==================== |
|
|
|
|
_openIDB() { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
const req = indexedDB.open('HiUTalkStoreDB', 1); |
|
|
|
|
req.onupgradeneeded = () => { req.result.createObjectStore('handles'); }; |
|
|
|
|
const req = indexedDB.open("HiUTalkStoreDB", 1); |
|
|
|
|
req.onupgradeneeded = () => { |
|
|
|
|
req.result.createObjectStore("handles"); |
|
|
|
|
}; |
|
|
|
|
req.onsuccess = () => resolve(req.result); |
|
|
|
|
req.onerror = () => reject(req.error); |
|
|
|
|
}); |
|
|
|
|
@ -915,31 +918,48 @@ export default { |
|
|
|
|
async _getStoredDirHandle(key) { |
|
|
|
|
const db = await this._openIDB(); |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
const tx = db.transaction('handles', 'readonly'); |
|
|
|
|
const req = tx.objectStore('handles').get(key); |
|
|
|
|
req.onsuccess = () => { db.close(); resolve(req.result); }; |
|
|
|
|
req.onerror = () => { db.close(); reject(req.error); }; |
|
|
|
|
const tx = db.transaction("handles", "readonly"); |
|
|
|
|
const req = tx.objectStore("handles").get(key); |
|
|
|
|
req.onsuccess = () => { |
|
|
|
|
db.close(); |
|
|
|
|
resolve(req.result); |
|
|
|
|
}; |
|
|
|
|
req.onerror = () => { |
|
|
|
|
db.close(); |
|
|
|
|
reject(req.error); |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 图片操作:优先使用系统设置中的 videoPath 目录选择文件 |
|
|
|
|
async handleOpenFile() { |
|
|
|
|
// 尝试使用系统设置中配置的 videoPath 目录打开文件选择器 |
|
|
|
|
try { |
|
|
|
|
const dirHandle = await this._getStoredDirHandle('screenshot_dir'); |
|
|
|
|
const dirHandle = await this._getStoredDirHandle("screenshot_dir"); |
|
|
|
|
if (dirHandle && window.showOpenFilePicker) { |
|
|
|
|
// 检查目录权限 |
|
|
|
|
let perm = await dirHandle.queryPermission({ mode: 'read' }); |
|
|
|
|
if (perm !== 'granted') { |
|
|
|
|
perm = await dirHandle.requestPermission({ mode: 'read' }); |
|
|
|
|
let perm = await dirHandle.queryPermission({ mode: "read" }); |
|
|
|
|
if (perm !== "granted") { |
|
|
|
|
perm = await dirHandle.requestPermission({ mode: "read" }); |
|
|
|
|
} |
|
|
|
|
if (perm === 'granted') { |
|
|
|
|
if (perm === "granted") { |
|
|
|
|
const fileHandles = await window.showOpenFilePicker({ |
|
|
|
|
startIn: dirHandle, |
|
|
|
|
multiple: true, |
|
|
|
|
types: [{ |
|
|
|
|
description: 'Images', |
|
|
|
|
accept: { 'image/*': ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.webp'] }, |
|
|
|
|
}], |
|
|
|
|
types: [ |
|
|
|
|
{ |
|
|
|
|
description: "Images", |
|
|
|
|
accept: { |
|
|
|
|
"image/*": [ |
|
|
|
|
".png", |
|
|
|
|
".jpg", |
|
|
|
|
".jpeg", |
|
|
|
|
".gif", |
|
|
|
|
".bmp", |
|
|
|
|
".webp", |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
// 逐个上传选中的文件 |
|
|
|
|
for (const fileHandle of fileHandles) { |
|
|
|
|
@ -950,8 +970,11 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
if (e.name === 'AbortError') return; // 用户取消选择 |
|
|
|
|
console.warn('基于系统设置目录的文件选择器不可用,降级使用默认文件选择:', e); |
|
|
|
|
if (e.name === "AbortError") return; // 用户取消选择 |
|
|
|
|
console.warn( |
|
|
|
|
"基于系统设置目录的文件选择器不可用,降级使用默认文件选择:", |
|
|
|
|
e |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
// 降级:使用原始的文件 input 方式 |
|
|
|
|
this.$refs.fileInput.click(); |
|
|
|
|
@ -1104,6 +1127,7 @@ export default { |
|
|
|
|
if (this.form.reviewer_id === 0) { |
|
|
|
|
this.form.reviewer_id = ""; |
|
|
|
|
} |
|
|
|
|
this.form.negative = this.form.negative === 0 ? 0 : 1; |
|
|
|
|
// 保存原始数据副本,用于检测是否有修改 |
|
|
|
|
this.originalForm = JSON.parse(JSON.stringify(this.form)); |
|
|
|
|
this.getReviewers(); |
|
|
|
|
@ -1144,7 +1168,7 @@ export default { |
|
|
|
|
patient_type: form.patient_type || 0, |
|
|
|
|
request_doctor: form.request_doctor || "", |
|
|
|
|
reviewer_id: form.reviewer_id || 0, |
|
|
|
|
negative: form.negative ? 0 : 1, |
|
|
|
|
negative: form.negative === 0 ? 0 : 1, |
|
|
|
|
position_text: form.position_text || "", |
|
|
|
|
text_comment: form.text_comment || "", |
|
|
|
|
text_conclusion: form.text_conclusion || "", |
|
|
|
|
@ -1316,7 +1340,11 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 部位模板-新增/编辑 |
|
|
|
|
openTemplateDialog(form) { |
|
|
|
|
this.newTemplateForm = { ...form, tpl_id: form.id || "",part_id:form.part_id || "" }; |
|
|
|
|
this.newTemplateForm = { |
|
|
|
|
...form, |
|
|
|
|
tpl_id: form.id || "", |
|
|
|
|
part_id: form.part_id || "", |
|
|
|
|
}; |
|
|
|
|
this.templateDialogOpen = true; |
|
|
|
|
this.loadTemplateTree(); |
|
|
|
|
}, |
|
|
|
|
|