影像工具下载图像功能优化
parent
c745756c8c
commit
4fabe3fa14
|
@ -1866,8 +1866,23 @@ export default {
|
|||
this.$refs['measurementList'].modifyMeasuredData(data)
|
||||
this.activeTool = ''
|
||||
},
|
||||
saveImage() {
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()
|
||||
async saveImage() {
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()
|
||||
// canvas为转换后的Canvas对象
|
||||
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) {
|
||||
|
|
|
@ -527,7 +527,7 @@ export default {
|
|||
initAnnotations: [],
|
||||
activeCanvasWW: null,
|
||||
activeCanvasWC: null,
|
||||
fusion: { visible: false }, // 历史记录融合调窗
|
||||
fusion: { visible: false } // 历史记录融合调窗
|
||||
// initFirstAnnotation:false
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue