Compare commits

...

2 Commits

Author SHA1 Message Date
wangxiaoshuang 728f3238ca 防止内存泄漏
continuous-integration/drone/push Build is passing Details
2026-04-29 17:35:25 +08:00
wangxiaoshuang e245057bb2 切换视口快速提交监测 2026-04-29 17:34:12 +08:00
2 changed files with 39 additions and 6 deletions

View File

@ -1011,7 +1011,9 @@ export default {
if (isSaved) {
let confirm = await this.$confirm(this.$t("trials:reading:Segmentations:confirm:changeScreenSave"))
if (!confirm) reslove(true)
this.$refs.Segmentations.saveSegmentGroup(null, true, () => {
this.loading = true
this.loadingText = this.$t("segment:loadingText:saveSegmentation")
this.$refs.Segmentations.checkSaveLoading(() => {
reslove(true)
})
} else {

View File

@ -127,7 +127,7 @@
</el-switch>
<span style="margin-left: 5px;">{{
$t('trials:reading:Segmentations:title:InactiveSegmentationsShow')
}}</span>
}}</span>
</div>
</div>
<template v-if="segmentList.length > 0">
@ -163,7 +163,7 @@
<i class="el-icon-warning-outline" style="color:red;margin-right: 5px;"
:title="$t('trials:reading:Segmentations:tip:segmentationIsNotSave')"
v-if="!curSegmentGroup.isSaved"></i>
<el-button type="success" size="small" :disabled="saveLoading && isMPR"
<el-button type="success" size="small" :disabled="saveLoading || isMPR"
@click="saveSegmentGroup([curSegmentGroup])">
{{ $t("trials:reading:Segmentations:button:save") }}
</el-button>
@ -253,7 +253,7 @@
</el-collapse-item>
</el-collapse>
<div class="saveBtnBox" v-if="readingTaskState < 2 && segmentList && segmentList.length > 1">
<el-button type="success" size="small" :disabled="saveLoading && isMPR" @click="saveSegmentGroup()">
<el-button type="success" size="small" :disabled="saveLoading || isMPR" @click="saveSegmentGroup()">
{{ $t("trials:reading:Segmentations:button:saveAll") }}
</el-button>
</div>
@ -402,7 +402,8 @@ export default {
isloaded: false,
popoverId: null,
saveLoading: false,
popoverVisible: false
popoverVisible: false,
timer: null
}
},
mounted() {
@ -424,6 +425,10 @@ export default {
this.popoverId = null
this.segmentIndex = null
this.segmentationId = null
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
this.getSegmentationList()
})
DicomEvent.$on('isloaded', (data) => {
@ -1466,9 +1471,30 @@ export default {
console.log(err)
}
},
checkSaveLoading(callback) {
if (!this.saveLoading) {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
this.saveSegmentGroup(null, true, callback)
} else {
this.timer = setInterval(() => {
if (!this.saveLoading) {
console.log(this.saveLoading, 'timer')
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
this.saveSegmentGroup(null, true, callback)
}
}, 100)
}
},
//
async saveSegmentGroup(list = null, saveSegment = true, callback) {
try {
console.log('saveSegmentGroup')
let segmentList = list ? list : this.segmentList
if (segmentList.length <= 0) return false
this.$emit("setToolsPassive")
@ -1942,7 +1968,12 @@ export default {
return rgbToHex(rgb.r, rgb.g, rgb.b);
}
},
destroyed() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
}
}
</script>
<style lang="scss" scoped>