diff --git a/src/components/Dicom/DicomCanvas.vue b/src/components/Dicom/DicomCanvas.vue index cc921b9b..acda0e50 100644 --- a/src/components/Dicom/DicomCanvas.vue +++ b/src/components/Dicom/DicomCanvas.vue @@ -950,15 +950,11 @@ export default { }, removeNote_RectangleRoi() { const toolState = cornerstoneTools.getToolState(this.canvas, 'Note_RectangleRoi'); - if (toolState && toolState.data.length > 0) { - toolState.data.forEach(item => { - // 例如:删除列表中最后一个矩形 - const dataToRemove = item - // 调用 removeToolState 删除指定的数据对象 - cornerstoneTools.removeToolState(this.canvas, 'Note_RectangleRoi', dataToRemove); + let arr = toolState.data.map(item => item) + arr.forEach(item => { + cornerstoneTools.removeToolState(this.canvas, 'Note_RectangleRoi', item); }) - // 刷新视图 cornerstone.updateImage(this.canvas); } }, diff --git a/src/components/Dicom/DicomViewer.vue b/src/components/Dicom/DicomViewer.vue index 13ff5374..1f46c05b 100644 --- a/src/components/Dicom/DicomViewer.vue +++ b/src/components/Dicom/DicomViewer.vue @@ -510,7 +510,7 @@ export default { }, methods: { - comparison(f) { + setToolsPassive() { const elements = document.querySelectorAll('.dicom-item') const scope = this Array.from(elements).forEach((element, index) => { @@ -519,6 +519,9 @@ export default { } }) scope.activeTool = null + }, + comparison(f) { + this.setToolsPassive() if (f) { this.$refs[`dicomCanvas0`].getNote_RectangleRoi().then(obj => { let { image } = obj @@ -570,6 +573,7 @@ export default { }, recovery(isAll = false) { if (this.isComparison) return false + this.setToolsPassive() this.$refs[`dicomCanvas0`].getNote_RectangleRoi().then(async obj => { let { image } = obj let instanceInfo = this.series.instanceInfoList.find(item => { @@ -616,6 +620,7 @@ export default { }, anonymousImage(isAll = false) { if (this.isComparison) return false + this.setToolsPassive() this.$refs[`dicomCanvas0`].getNote_RectangleRoi().then(async obj => { let { toolInfo, image } = obj if (!toolInfo || toolInfo.data.length <= 0) return this.$confirm(this.$t("DicomViewer:anonymous:notMark"))