解决未标注病灶信息则不上传截图问题
parent
afd362ba72
commit
612724cbea
|
@ -606,15 +606,19 @@ export default {
|
|||
})
|
||||
FusionEvent.$on('getScreenshots', async(measuredData, callback) => {
|
||||
// var base64Str = await this.$refs['FUSION_AXIAL'].getScreenshots()
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
await this.imageLocation(measuredData)
|
||||
const divForDownloadViewport = document.querySelector(
|
||||
'.dicom-container'
|
||||
)
|
||||
var canvas = await html2canvas(divForDownloadViewport)
|
||||
var pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
loading.close()
|
||||
callback(pictureBaseStr)
|
||||
if (!measuredData) {
|
||||
callback()
|
||||
} else {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
await this.imageLocation(measuredData)
|
||||
const divForDownloadViewport = document.querySelector(
|
||||
'.dicom-container'
|
||||
)
|
||||
var canvas = await html2canvas(divForDownloadViewport)
|
||||
var pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
loading.close()
|
||||
callback(pictureBaseStr)
|
||||
}
|
||||
})
|
||||
FusionEvent.$on('viewHistoryScreenshot', (path) => {
|
||||
if (this.screenshotWindow) {
|
||||
|
|
|
@ -398,16 +398,13 @@ export default {
|
|||
var answers = []
|
||||
var questionMarkInfoList = []
|
||||
var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType)
|
||||
if (!annotationObj) {
|
||||
loading.close()
|
||||
return
|
||||
}
|
||||
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) : ''
|
||||
|
||||
var obj = annotationObj ? Object.assign({}, annotationObj) : null
|
||||
FusionEvent.$emit('getScreenshots', { otherMeasureData: obj ? obj.OtherMeasureData : null }, async val => {
|
||||
var pictureObj = null
|
||||
var picturePath = null
|
||||
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)
|
||||
for (const k in otherMeasureData.data.cachedStats) {
|
||||
otherMeasureData.data.cachedStats[k].pointsInShape = []
|
||||
|
|
|
@ -535,18 +535,28 @@ export default {
|
|||
saveAnnotation(question) {
|
||||
this.loading = true
|
||||
// 获取截图
|
||||
var answers = []
|
||||
var questionMarkInfoList = []
|
||||
var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType)
|
||||
if (!annotationObj) {
|
||||
this.loading = false
|
||||
return
|
||||
this.saveQuestions(question)
|
||||
} 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 => {
|
||||
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
|
||||
var picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
|
||||
|
||||
},
|
||||
async saveQuestions(question, obj, picturePath) {
|
||||
try {
|
||||
this.loading = true
|
||||
var answers = []
|
||||
var questionMarkInfoList = []
|
||||
if (obj && obj.MeasureData) {
|
||||
var annotation = Object.assign({}, obj.MeasureData)
|
||||
obj.MeasureData = JSON.stringify(annotation)
|
||||
|
@ -565,44 +575,16 @@ export default {
|
|||
questionMarkInfoList
|
||||
}
|
||||
const qsType = question.QuestionType === 60 ? 4 : question.QuestionType === 61 ? 5 : null
|
||||
saveTaskQuestion(qsType, params).then(async res => {
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
await this.setQuestions()
|
||||
this.loading = false
|
||||
this.$set(question, 'SaveEnum', 0)
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
}).catch(() => {
|
||||
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()
|
||||
await saveTaskQuestion(qsType, params)
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
await this.setQuestions()
|
||||
this.loading = false
|
||||
this.$set(question, 'SaveEnum', 0)
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
locateAnnotation(obj) {
|
||||
const { Id } = obj
|
||||
|
|
Loading…
Reference in New Issue