解决未标注病灶信息则不上传截图问题

uat_us
caiyiling 2024-04-24 16:25:19 +08:00
parent afd362ba72
commit 612724cbea
3 changed files with 48 additions and 65 deletions

View File

@ -606,15 +606,19 @@ export default {
}) })
FusionEvent.$on('getScreenshots', async(measuredData, callback) => { FusionEvent.$on('getScreenshots', async(measuredData, callback) => {
// var base64Str = await this.$refs['FUSION_AXIAL'].getScreenshots() // var base64Str = await this.$refs['FUSION_AXIAL'].getScreenshots()
const loading = this.$loading({ fullscreen: true }) if (!measuredData) {
await this.imageLocation(measuredData) callback()
const divForDownloadViewport = document.querySelector( } else {
'.dicom-container' const loading = this.$loading({ fullscreen: true })
) await this.imageLocation(measuredData)
var canvas = await html2canvas(divForDownloadViewport) const divForDownloadViewport = document.querySelector(
var pictureBaseStr = canvas.toDataURL('image/png', 1) '.dicom-container'
loading.close() )
callback(pictureBaseStr) var canvas = await html2canvas(divForDownloadViewport)
var pictureBaseStr = canvas.toDataURL('image/png', 1)
loading.close()
callback(pictureBaseStr)
}
}) })
FusionEvent.$on('viewHistoryScreenshot', (path) => { FusionEvent.$on('viewHistoryScreenshot', (path) => {
if (this.screenshotWindow) { if (this.screenshotWindow) {

View File

@ -398,16 +398,13 @@ export default {
var answers = [] var answers = []
var questionMarkInfoList = [] var questionMarkInfoList = []
var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType) var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType)
if (!annotationObj) { var obj = annotationObj ? Object.assign({}, annotationObj) : null
loading.close() FusionEvent.$emit('getScreenshots', { otherMeasureData: obj ? obj.OtherMeasureData : null }, async val => {
return var pictureObj = null
} var picturePath = null
var obj = Object.assign({}, annotationObj)
FusionEvent.$emit('getScreenshots', { otherMeasureData: obj.OtherMeasureData }, async val => {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
var picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
if (obj && obj.OtherMeasureData) { if (obj && obj.OtherMeasureData) {
pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
var otherMeasureData = Object.assign({}, obj.OtherMeasureData) var otherMeasureData = Object.assign({}, obj.OtherMeasureData)
for (const k in otherMeasureData.data.cachedStats) { for (const k in otherMeasureData.data.cachedStats) {
otherMeasureData.data.cachedStats[k].pointsInShape = [] otherMeasureData.data.cachedStats[k].pointsInShape = []

View File

@ -535,18 +535,28 @@ export default {
saveAnnotation(question) { saveAnnotation(question) {
this.loading = true this.loading = true
// //
var answers = []
var questionMarkInfoList = []
var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType) var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType)
if (!annotationObj) { if (!annotationObj) {
this.loading = false this.saveQuestions(question)
return } else {
var obj = Object.assign({}, annotationObj)
DicomEvent.$emit('getScreenshots', { questionId: obj.Id, visitTaskId: this.visitTaskId, lesionName: obj.OrderMarkName, markTool: obj.MarkTool, readingTaskState: this.readingTaskState, isMarked: !!obj.MeasureData }, async val => {
try {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
var picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
this.saveQuestions(question, obj, picturePath)
} catch (e) {
console.log(e)
this.loading = false
}
})
} }
var obj = Object.assign({}, annotationObj) },
DicomEvent.$emit('getScreenshots', { questionId: obj.Id, visitTaskId: this.visitTaskId, lesionName: obj.OrderMarkName, markTool: obj.MarkTool, readingTaskState: this.readingTaskState, isMarked: !!obj.MeasureData }, async val => { async saveQuestions(question, obj, picturePath) {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val) try {
var picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : '' this.loading = true
var answers = []
var questionMarkInfoList = []
if (obj && obj.MeasureData) { if (obj && obj.MeasureData) {
var annotation = Object.assign({}, obj.MeasureData) var annotation = Object.assign({}, obj.MeasureData)
obj.MeasureData = JSON.stringify(annotation) obj.MeasureData = JSON.stringify(annotation)
@ -565,44 +575,16 @@ export default {
questionMarkInfoList questionMarkInfoList
} }
const qsType = question.QuestionType === 60 ? 4 : question.QuestionType === 61 ? 5 : null const qsType = question.QuestionType === 60 ? 4 : question.QuestionType === 61 ? 5 : null
saveTaskQuestion(qsType, params).then(async res => { await saveTaskQuestion(qsType, params)
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
await this.setQuestions() await this.setQuestions()
this.loading = false this.loading = false
this.$set(question, 'SaveEnum', 0) this.$set(question, 'SaveEnum', 0)
DicomEvent.$emit('getReportInfo', true) DicomEvent.$emit('getReportInfo', true)
}).catch(() => { } catch (e) {
this.loading = false console.log(e)
}) this.loading = false
}) }
// if (this.criterionType === 2 && this.groupClassify === 3) {
// var currentSpleenStatus = this.questionForm[this.spleenStatusId]
// var currentSpleenLength = this.questionForm[this.spleenLengthId]
// currentSpleenStatus = isNaN(parseInt(currentSpleenStatus)) ? null : parseInt(currentSpleenStatus)
// var stIdx = this.measurements.findIndex(i => i.QuestionType === 60)
// var slIdx = this.measurements.findIndex(i => i.QuestionType === 60)
// if (currentSpleenLength && currentSpleenStatus === 5) {
// // '!'
// this.$alert(this.$t('trials:lugano:message:validSpleen1'), this.$t('trials:lugano:fusionDialog:warning'), {
// callback: _ => {}
// })
// } else if (currentSpleenStatus === 5 && ((stIdx > -1 && this.measurements[stIdx].MeasureData) || (slIdx > -1 && this.measurements[slIdx].MeasureData))) {
// //
// this.$alert(this.$t('trials:lugano:message:validSpleen1'), this.$t('trials:lugano:fusionDialog:warning'), {
// callback: _ => {}
// })
// } else if (((stIdx > -1 && this.measurements[stIdx].MeasureData) || (slIdx > -1 && this.measurements[slIdx].MeasureData)) && !currentSpleenLength) {
// this.$alert(this.$t('trials:lugano:message:validSpleen2'), this.$t('trials:lugano:fusionDialog:warning'), {
// callback: _ => {}
// })
// } else {
// this.saveQuestionsList()
// }
// } else {
// this.saveQuestionsList()
// }
// this.saveQuestionsList()
}, },
locateAnnotation(obj) { locateAnnotation(obj) {
const { Id } = obj const { Id } = obj