影像工具下载图像功能优化

uat_us
caiyiling 2024-03-27 16:45:09 +08:00
parent c745756c8c
commit 4fabe3fa14
3 changed files with 21 additions and 6 deletions

View File

@ -1866,8 +1866,23 @@ export default {
this.$refs['measurementList'].modifyMeasuredData(data) this.$refs['measurementList'].modifyMeasuredData(data)
this.activeTool = '' this.activeTool = ''
}, },
saveImage() { async saveImage() {
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage() // this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()
// canvasCanvas
const divForDownloadViewport = document.querySelector(
`div[data-canvas-uid="dicomCanvas${this.currentDicomCanvasIndex}"]`
)
var canvas = await html2canvas(divForDownloadViewport)
let oImg = new Image()
oImg = canvas.toDataURL('image/png', 1)//
var oA = document.createElement('a')
var subjectCode = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].subjectCode
var taskBlindName = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].stack.taskBlindName
oA.download = `${subjectCode}_${taskBlindName}`// ''
oA.href = oImg
document.body.appendChild(oA)
oA.click()
oA.remove() //
}, },
// / // /
setDicomCanvasWwwc(v) { setDicomCanvasWwwc(v) {

View File

@ -527,7 +527,7 @@ export default {
initAnnotations: [], initAnnotations: [],
activeCanvasWW: null, activeCanvasWW: null,
activeCanvasWC: null, activeCanvasWC: null,
fusion: { visible: false }, // fusion: { visible: false } //
// initFirstAnnotation:false // initFirstAnnotation:false
} }
}, },