纵隔血池、肝脏血池、脾尖、脾底标记保存优化

uat_us
caiyiling 2024-03-22 13:26:04 +08:00
parent a51d613633
commit 994598c216
18 changed files with 563 additions and 277 deletions

View File

@ -1127,8 +1127,8 @@ export default {
// resolve() // resolve()
// }) // })
cornerstone.loadAndCacheImage(this.stack.imageIds[this.stack.currentImageIdIndex]) cornerstone.loadAndCacheImage(this.stack.imageIds[this.stack.currentImageIdIndex])
.then(image => { .then(async image => {
scope.onFirstImageLoaded(image) await scope.onFirstImageLoaded(image)
resolve() resolve()
}) })
.catch((error) => { .catch((error) => {
@ -1141,84 +1141,86 @@ export default {
}, },
onFirstImageLoaded(image) { onFirstImageLoaded(image) {
console.log('onFirstImageLoaded') console.log('onFirstImageLoaded')
return new Promise(async resolve => {
const element = this.$refs.canvas
var viewport = cornerstone.getDefaultViewportForImage(this.canvas, image)
cornerstone.displayImage(this.canvas, image, viewport)
const element = this.$refs.canvas if (!this.toolState.initialized) {
var viewport = cornerstone.getDefaultViewportForImage(this.canvas, image) this.toolState.initialized = true
cornerstone.displayImage(this.canvas, image, viewport) const toolButtons = document.querySelectorAll('[data-tool]')
if (!this.toolState.initialized) { // const scope = this
this.toolState.initialized = true Array.from(toolButtons).forEach((toolBtn) => {
const toolButtons = document.querySelectorAll('[data-tool]')
// const scope = this
Array.from(toolButtons).forEach((toolBtn) => {
// Add the tool // Add the tool
const toolName = toolBtn.getAttribute('data-tool') const toolName = toolBtn.getAttribute('data-tool')
const apiTool = cornerstoneTools[`${toolName}Tool`] const apiTool = cornerstoneTools[`${toolName}Tool`]
if (apiTool) { if (apiTool) {
const toolAlreadyAddedToElement = cornerstoneTools.getToolForElement(element, apiTool) const toolAlreadyAddedToElement = cornerstoneTools.getToolForElement(element, apiTool)
if (!toolAlreadyAddedToElement) { if (!toolAlreadyAddedToElement) {
if (toolName === 'Length') { if (toolName === 'Length') {
cornerstoneTools.addToolForElement(element, LengthTool, { configuration: { handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true, digits: this.digitPlaces, drawHandles: true }}) cornerstoneTools.addToolForElement(element, LengthTool, { configuration: { handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true, digits: this.digitPlaces, drawHandles: true }})
} else if (toolName === 'Bidirectional') { } else if (toolName === 'Bidirectional') {
// cornerstoneTools.addToolForElement(element, BidirectionalTool, { digits: this.digitPlaces }) // cornerstoneTools.addToolForElement(element, BidirectionalTool, { digits: this.digitPlaces })
// , handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true // , handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true
cornerstoneTools.addToolForElement(element, BidirectionalTool, { configuration: { digits: this.digitPlaces, hideHandlesIfMoving: true }}) cornerstoneTools.addToolForElement(element, BidirectionalTool, { configuration: { digits: this.digitPlaces, hideHandlesIfMoving: true }})
} else if (toolName === 'ArrowAnnotate') { } else if (toolName === 'ArrowAnnotate') {
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }}) cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }})
} else if (toolName === 'RectangleRoi') { } else if (toolName === 'RectangleRoi') {
cornerstoneTools.addToolForElement(element, RectangleRoiTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }}) cornerstoneTools.addToolForElement(element, RectangleRoiTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }})
} else { } else {
cornerstoneTools.addToolForElement(element, apiTool) cornerstoneTools.addToolForElement(element, apiTool)
}
} }
} }
})
if (!cornerstoneTools.getToolForElement(element, cornerstoneTools.WwwcRegionTool)) {
cornerstoneTools.addToolForElement(element, cornerstoneTools.WwwcRegionTool)
} }
}) if (!cornerstoneTools.getToolForElement(element, cornerstoneTools.StackScrollMouseWheelTool)) {
if (!cornerstoneTools.getToolForElement(element, cornerstoneTools.WwwcRegionTool)) { cornerstoneTools.addToolForElement(element, cornerstoneTools.StackScrollMouseWheelTool)
cornerstoneTools.addToolForElement(element, cornerstoneTools.WwwcRegionTool) }
} cornerstoneTools.setToolActiveForElement(element, 'StackScrollMouseWheel', {})
if (!cornerstoneTools.getToolForElement(element, cornerstoneTools.StackScrollMouseWheelTool)) {
cornerstoneTools.addToolForElement(element, cornerstoneTools.StackScrollMouseWheelTool)
}
cornerstoneTools.setToolActiveForElement(element, 'StackScrollMouseWheel', {})
if (!cornerstoneTools.getToolForElement(element, ScaleOverlayTool)) { if (!cornerstoneTools.getToolForElement(element, ScaleOverlayTool)) {
cornerstoneTools.addToolForElement(element, ScaleOverlayTool) cornerstoneTools.addToolForElement(element, ScaleOverlayTool)
} }
cornerstoneTools.setToolActiveForElement(element, 'ScaleOverlay', {}) cornerstoneTools.setToolActiveForElement(element, 'ScaleOverlay', {})
cornerstoneTools.setToolActiveForElement(this.canvas, 'Zoom', { cornerstoneTools.setToolActiveForElement(this.canvas, 'Zoom', {
mouseButtonMask: 2 mouseButtonMask: 2
}) })
cornerstoneTools.setToolActiveForElement(this.canvas, 'Pan', { cornerstoneTools.setToolActiveForElement(this.canvas, 'Pan', {
mouseButtonMask: 4 mouseButtonMask: 4
}) })
// if (!cornerstoneTools.getToolForElement(element, OrientationMarkersTool)) { // if (!cornerstoneTools.getToolForElement(element, OrientationMarkersTool)) {
// cornerstoneTools.addToolForElement(element, OrientationMarkersTool) // cornerstoneTools.addToolForElement(element, OrientationMarkersTool)
// } // }
// cornerstoneTools.setToolActiveForElement(element, 'OrientationMarkers', { }) // cornerstoneTools.setToolActiveForElement(element, 'OrientationMarkers', { })
} }
// cornerstoneTools.addStackStateManager(this.canvas, ['stack', 'stackPrefetch', 'playClip']) // cornerstoneTools.addStackStateManager(this.canvas, ['stack', 'stackPrefetch', 'playClip'])
cornerstoneTools.addStackStateManager(this.canvas, ['stack', 'playClip']) cornerstoneTools.addStackStateManager(this.canvas, ['stack', 'playClip'])
cornerstoneTools.addToolState(this.canvas, 'stack', this.stack) cornerstoneTools.addToolState(this.canvas, 'stack', this.stack)
// cornerstoneTools.stackPrefetch.enable(this.canvas) // cornerstoneTools.stackPrefetch.enable(this.canvas)
cornerstone.updateImage(element, true) cornerstone.updateImage(element, true)
this.stack.firstImageLoading = false this.stack.firstImageLoading = false
this.toolState.dicomInfoVisible = true this.toolState.dicomInfoVisible = true
var instanceId = image.imageId.split('/')[image.imageId.split('/').length - 1] var instanceId = image.imageId.split('/')[image.imageId.split('/').length - 1]
var frame = null var frame = null
if (instanceId.includes('?frame=')) { if (instanceId.includes('?frame=')) {
frame = instanceId.split('?frame=')[1] frame = instanceId.split('?frame=')[1]
instanceId = instanceId.split('?frame=')[0] instanceId = instanceId.split('?frame=')[0]
} }
this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0 this.stack.frame = !isNaN(parseInt(frame)) ? parseInt(frame) : 0
instanceId = instanceId.split('.')[0] instanceId = instanceId.split('.')[0]
this.stack.instanceId = instanceId this.stack.instanceId = instanceId
this.height = (this.stack.currentImageIdIndex) * 100 / (this.stack.imageIds.length - 1) this.height = (this.stack.currentImageIdIndex) * 100 / (this.stack.imageIds.length - 1)
this.resetWwwc() this.resetWwwc()
resolve()
})
}, },
onNewImage(e) { onNewImage(e) {
console.log('cornerstonenewimage') console.log('cornerstonenewimage')

View File

@ -828,7 +828,7 @@ export default {
activeSeries: { activeSeries: {
immediate: true, immediate: true,
handler(v) { handler(v) {
if (v) { if (v && v.isCurrentTask && this.studyList.length === 0) {
this.activeTaskInfo.taskName = v.taskBlindName this.activeTaskInfo.taskName = v.taskBlindName
this.activeTaskInfo.visitTaskId = v.visitTaskId this.activeTaskInfo.visitTaskId = v.visitTaskId
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === v.visitTaskId) const i = this.visitTaskList.findIndex(i => i.VisitTaskId === v.visitTaskId)
@ -838,8 +838,6 @@ export default {
studyList = studyList.filter(i => !i.IsCriticalSequence && i.Modalities.indexOf('CT') !== -1 && i.Modalities.indexOf('PT') !== -1) studyList = studyList.filter(i => !i.IsCriticalSequence && i.Modalities.indexOf('CT') !== -1 && i.Modalities.indexOf('PT') !== -1)
if (studyList.length === 0) return if (studyList.length === 0) return
this.studyList = studyList this.studyList = studyList
} else {
this.studyList = []
} }
} }
} }
@ -887,24 +885,48 @@ export default {
} }
console.log('getMeasureData') console.log('getMeasureData')
}) })
DicomEvent.$on('getScreenshots', async(callback) => { DicomEvent.$on('getScreenshots', async(measuredData, callback) => {
if (this.currentDicomCanvasIndex > -1) { if (this.currentDicomCanvasIndex > -1) {
// var base64Str = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].getScreenshots() if (!measuredData) return
const divForDownloadViewport = document.querySelector( await this.imageLocation(measuredData)
`div[data-canvas-uid="dicomCanvas${this.currentDicomCanvasIndex}"]` setTimeout(async() => {
) // var base64Str = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].getScreenshots()
var canvas = await html2canvas(divForDownloadViewport) const divForDownloadViewport = document.querySelector(
var base64Str = canvas.toDataURL('image/png', 1) `div[data-canvas-uid="dicomCanvas${this.currentDicomCanvasIndex}"]`
callback(base64Str) )
var canvas = await html2canvas(divForDownloadViewport)
var base64Str = canvas.toDataURL('image/png', 1)
console.log('getScreenshots')
callback(base64Str)
}, 50)
} }
console.log('getScreenshots')
}) })
DicomEvent.$on('imageLocation', measuredData => { DicomEvent.$on('imageLocation', async(measuredData) => {
if (!measuredData) return return new Promise(async resolve => {
this.imageLocation(measuredData) if (!measuredData) return
await this.imageLocation(measuredData)
console.log('imageLocation') console.log('imageLocation')
resolve()
})
}) })
// DicomEvent.$on('imageLocation', async(measuredData, callback) => {
// if (measuredData) {
// await this.imageLocation(measuredData)
// }
// console.log('imageLocation')
// this.$nextTick(() => {
// if (callback) {
// callback()
// }
// })
// })
// DicomEvent.$on('imageLocation', measuredData => {
// if (!measuredData) return
// this.imageLocation(measuredData)
// console.log('imageLocation')
// })
DicomEvent.$on('setReadingState', readingTaskState => { DicomEvent.$on('setReadingState', readingTaskState => {
this.canvasObj[this.currentDicomCanvasIndex].readingTaskState = readingTaskState this.canvasObj[this.currentDicomCanvasIndex].readingTaskState = readingTaskState
if (this.activeTool) { if (this.activeTool) {
@ -934,6 +956,11 @@ export default {
if (!this.petctWindow) return if (!this.petctWindow) return
this.petctWindow.postMessage({ type: 'setReadingState', data: data }, window.location) this.petctWindow.postMessage({ type: 'setReadingState', data: data }, window.location)
}) })
DicomEvent.$on('reload', () => {
if (this.petctWindow) {
this.petctWindow.close()
}
})
}, },
beforeDestroy() { beforeDestroy() {
DicomEvent.$off('updateImage') DicomEvent.$off('updateImage')
@ -945,6 +972,7 @@ export default {
DicomEvent.$off('setMeasuredToolsPassive') DicomEvent.$off('setMeasuredToolsPassive')
DicomEvent.$off('readingPageUpdate') DicomEvent.$off('readingPageUpdate')
DicomEvent.$off('setReadingState') DicomEvent.$off('setReadingState')
DicomEvent.$off('reload')
if (this.petctWindow) { if (this.petctWindow) {
this.petctWindow.close() this.petctWindow.close()
} }
@ -1302,108 +1330,117 @@ export default {
// 访 // 访
// //
async imageLocation(obj) { imageLocation(obj) {
var loading = null return new Promise(async resolve => {
var loadImagePromises = [] var loading = null
var isScrollSync = this.isScrollSync var loadImagePromises = []
if (this.isScrollSync) { var isScrollSync = this.isScrollSync
if (this.isScrollSync) {
// //
this.isScrollSync = false this.isScrollSync = false
} }
var activeCanvasTaskId = obj.visitTaskId var activeCanvasTaskId = obj.visitTaskId
var index = this.visitTaskList.findIndex(i => i.VisitTaskId === activeCanvasTaskId) var index = this.visitTaskList.findIndex(i => i.VisitTaskId === activeCanvasTaskId)
if (index === -1) return if (index === -1) {
resolve()
return
}
var firstAddSeries = null var firstAddSeries = null
var currentAddSeries = null var currentAddSeries = null
if (this.isReadingTaskViewInOrder) { if (this.isReadingTaskViewInOrder) {
// //
// 访 // 访
var firstAddVisitTaskId = null var firstAddVisitTaskId = null
var idx = this.visitTaskList[index].MeasureData.findIndex(item => { var idx = this.visitTaskList[index].MeasureData.findIndex(item => {
return item.OrderMarkName === obj.lesionName return item.OrderMarkName === obj.lesionName
}) })
if (idx > -1) { if (idx > -1) {
firstAddVisitTaskId = this.visitTaskList[index].MeasureData[idx].FristAddTaskId firstAddVisitTaskId = this.visitTaskList[index].MeasureData[idx].FristAddTaskId
}
if (firstAddVisitTaskId) {
var taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === firstAddVisitTaskId)
if (taskIdx > -1 && !this.visitTaskList[taskIdx].IsInit) {
loading = this.$loading({ fullscreen: true })
if (!this.visitTaskList[taskIdx].measureDataInit) {
await store.dispatch('reading/getMeasuredData', this.visitTaskList[taskIdx].VisitTaskId)
}
if (!this.visitTaskList[taskIdx].studyListInit) {
await store.dispatch('reading/getStudyInfo', { trialId: this.trialId, subjectVisitId: this.visitTaskList[taskIdx].VisitId, visitTaskId: this.visitTaskList[taskIdx].VisitTaskId, taskBlindName: this.visitTaskList[taskIdx].TaskBlindName })
}
if (!this.visitTaskList[taskIdx].readingQuestionsInit) {
await store.dispatch('reading/getReadingQuestionAndAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[taskIdx].VisitTaskId })
}
if (!this.visitTaskList[taskIdx].questionsInit) {
await store.dispatch('reading/getDicomReadingQuestionAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[taskIdx].VisitTaskId })
}
await store.dispatch('reading/setStatus', { visitTaskId: this.visitTaskList[taskIdx].VisitTaskId })
} }
if (this.CriterionType === 3 && obj.lesionType === 7 && obj.fromMark) { if (firstAddVisitTaskId) {
const measureDataInfo = Object.assign({}, obj) var taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === firstAddVisitTaskId)
measureDataInfo.lesionName = obj.fromMark if (taskIdx > -1 && !this.visitTaskList[taskIdx].IsInit) {
firstAddSeries = this.getSeriesInfoByMark(firstAddVisitTaskId, measureDataInfo) loading = this.$loading({ fullscreen: true })
} else { if (!this.visitTaskList[taskIdx].measureDataInit) {
firstAddSeries = this.getSeriesInfoByMark(firstAddVisitTaskId, obj) await store.dispatch('reading/getMeasuredData', this.visitTaskList[taskIdx].VisitTaskId)
} }
} if (!this.visitTaskList[taskIdx].studyListInit) {
// 访 await store.dispatch('reading/getStudyInfo', { trialId: this.trialId, subjectVisitId: this.visitTaskList[taskIdx].VisitId, visitTaskId: this.visitTaskList[taskIdx].VisitTaskId, taskBlindName: this.visitTaskList[taskIdx].TaskBlindName })
currentAddSeries = this.getSeriesInfoByMark(activeCanvasTaskId, obj) }
if (!firstAddSeries && currentAddSeries) { if (!this.visitTaskList[taskIdx].readingQuestionsInit) {
// await store.dispatch('reading/getReadingQuestionAndAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[taskIdx].VisitTaskId })
firstAddSeries = currentAddSeries }
} else if (!firstAddSeries && !currentAddSeries) { if (!this.visitTaskList[taskIdx].questionsInit) {
// await store.dispatch('reading/getDicomReadingQuestionAnswer', { trialId: this.trialId, visitTaskId: this.visitTaskList[taskIdx].VisitTaskId })
loading && loading.close() }
this.isScrollSync = isScrollSync
this.setToolToTarget(obj)
return
} else if (firstAddSeries && !currentAddSeries) {
// 访
currentAddSeries = this.getLinkedSeries(firstAddSeries, activeCanvasTaskId)
await store.dispatch('reading/setStatus', { visitTaskId: this.visitTaskList[taskIdx].VisitTaskId })
}
if (this.CriterionType === 3 && obj.lesionType === 7 && obj.fromMark) {
const measureDataInfo = Object.assign({}, obj)
measureDataInfo.lesionName = obj.fromMark
firstAddSeries = this.getSeriesInfoByMark(firstAddVisitTaskId, measureDataInfo)
} else {
firstAddSeries = this.getSeriesInfoByMark(firstAddVisitTaskId, obj)
}
}
// 访
currentAddSeries = this.getSeriesInfoByMark(activeCanvasTaskId, obj)
if (!firstAddSeries && currentAddSeries) {
//
firstAddSeries = currentAddSeries
} else if (!firstAddSeries && !currentAddSeries) {
//
loading && loading.close()
this.isScrollSync = isScrollSync
this.setToolToTarget(obj)
resolve()
return
} else if (firstAddSeries && !currentAddSeries) {
// 访
currentAddSeries = this.getLinkedSeries(firstAddSeries, activeCanvasTaskId)
if (!currentAddSeries) {
//
currentAddSeries = this.$refs[`dicomCanvas${this.maxCanvas - 1}`][0].series
}
}
} else {
//
currentAddSeries = this.getSeriesInfoByMark(activeCanvasTaskId, obj)
if (!currentAddSeries) { if (!currentAddSeries) {
// //
currentAddSeries = this.$refs[`dicomCanvas${this.maxCanvas - 1}`][0].series currentAddSeries = this.$refs[`dicomCanvas${this.maxCanvas - 1}`][0].series
} }
firstAddSeries = currentAddSeries
} }
} else {
//
currentAddSeries = this.getSeriesInfoByMark(activeCanvasTaskId, obj)
if (!currentAddSeries) {
//
currentAddSeries = this.$refs[`dicomCanvas${this.maxCanvas - 1}`][0].series
}
firstAddSeries = currentAddSeries
}
for (let i = 0; i < this.maxCanvas; i++) { for (let i = 0; i < this.maxCanvas; i++) {
if (i === this.maxCanvas - 1) { if (i === this.maxCanvas - 1) {
loadImagePromises.push(this.$refs[`dicomCanvas${i}`][0].loadImageStack(currentAddSeries)) loadImagePromises.push(this.$refs[`dicomCanvas${i}`][0].loadImageStack(currentAddSeries))
this.currentDicomCanvasIndex = i this.currentDicomCanvasIndex = i
this.activeSeries = currentAddSeries this.activeSeries = currentAddSeries
store.dispatch('reading/setActiveSeries', currentAddSeries) store.dispatch('reading/setActiveSeries', currentAddSeries)
} else { } else {
loadImagePromises.push(this.$refs[`dicomCanvas${i}`][0].loadImageStack(firstAddSeries)) loadImagePromises.push(this.$refs[`dicomCanvas${i}`][0].loadImageStack(firstAddSeries))
}
} }
} Promise.all(loadImagePromises)
Promise.all(loadImagePromises) .then(() => {
.then(() => { this.isScrollSync = isScrollSync
this.isScrollSync = isScrollSync this.setToolToTarget(obj)
this.setToolToTarget(obj) resolve()
}) }).catch(() => {
if (loading) { resolve()
loading.close() })
} if (loading) {
loading.close()
}
})
}, },
setToolToTarget(obj) { setToolToTarget(obj) {
if (obj.readingTaskState < 2 && obj.markTool && !obj.isMarked) { if (obj.readingTaskState < 2 && obj.markTool && !obj.isMarked) {

View File

@ -75,7 +75,10 @@ export default {
translateX: 0, translateX: 0,
pageSize: 0, // pageSize: 0, //
previewImages: [], previewImages: [],
imgSize: { width: '120px', height: '120px' } imgSize: { width: '120px', height: '120px' },
lesionId: '',
visitTaskId: '',
questionType: null
} }
}, },
computed: { computed: {
@ -112,7 +115,10 @@ export default {
store.dispatch('user/setToken', this.$route.query.TokenKey) store.dispatch('user/setToken', this.$route.query.TokenKey)
changeURLStatic('TokenKey', '') changeURLStatic('TokenKey', '')
} }
this.lesionId = this.$route.query.rowId this.lesionId = this.$route.query.rowId ? this.$route.query.rowId : ''
this.visitTaskId = this.$route.query.visitTaskId ? this.$route.query.visitTaskId : ''
var questionType = this.$route.query.questionType
this.questionType = questionType ? Number(questionType) : null
this.initPage() this.initPage()
}, },
methods: { methods: {
@ -128,7 +134,7 @@ export default {
getScreenshot() { getScreenshot() {
return new Promise(resolve => { return new Promise(resolve => {
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
getPreviousOtherPicturePath({ rowId: this.lesionId }).then(res => { getPreviousOtherPicturePath({ rowId: this.lesionId, visitTaskId: this.visitTaskId, questionType: this.questionType }).then(res => {
this.previewImages = res.Result this.previewImages = res.Result
if (this.previewImages.length === 0) { if (this.previewImages.length === 0) {
this.$alert(this.$t('trials:lugano:message:noScreenshot'), this.$t('trials:lugano:message:warnTip'), { this.$alert(this.$t('trials:lugano:message:noScreenshot'), this.$t('trials:lugano:message:warnTip'), {

View File

@ -483,6 +483,7 @@ export default {
{ label: this.$t('trials:reading:button:rotateTurnRight'), val: 5 }// 90 { label: this.$t('trials:reading:button:rotateTurnRight'), val: 5 }// 90
], ],
isCurrentTask: false, isCurrentTask: false,
isBaseLineTask: false,
ctSeries: {}, ctSeries: {},
petSeries: {}, petSeries: {},
renderingEngineId: renderingEngineId, renderingEngineId: renderingEngineId,
@ -562,6 +563,7 @@ export default {
this.subjectCode = this.$route.query.subjectCode this.subjectCode = this.$route.query.subjectCode
this.taskBlindName = this.$route.query.taskBlindName this.taskBlindName = this.$route.query.taskBlindName
this.isCurrentTask = this.$route.query.isCurrentTask === 'true' this.isCurrentTask = this.$route.query.isCurrentTask === 'true'
this.isBaseLineTask = this.$route.query.isCurrentTask === 'true'
this.customWwc = { visible: false, title: this.$t('trials:reading:dagTitle:wwwcCustom') } this.customWwc = { visible: false, title: this.$t('trials:reading:dagTitle:wwwcCustom') }
const digitPlaces = parseInt(this.$route.query.digitPlaces) const digitPlaces = parseInt(this.$route.query.digitPlaces)
this.digitPlaces = digitPlaces === -1 ? 2 : digitPlaces this.digitPlaces = digitPlaces === -1 ? 2 : digitPlaces
@ -606,9 +608,10 @@ export default {
console.log('imageLocation') console.log('imageLocation')
this.imageLocation(obj) this.imageLocation(obj)
}) })
FusionEvent.$on('getScreenshots', async(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 }) const loading = this.$loading({ fullscreen: true })
await this.imageLocation(measuredData)
const divForDownloadViewport = document.querySelector( const divForDownloadViewport = document.querySelector(
'.dicom-container' '.dicom-container'
) )
@ -712,8 +715,9 @@ export default {
const debouncedCallback = this.debounce((e) => { const debouncedCallback = this.debounce((e) => {
const { annotation } = e.detail const { annotation } = e.detail
const { remark } = annotation.data const { remark } = annotation.data
if (this.initAnnotations.length > 0 && this.initAnnotations[0].orderMark === remark && !this.initAnnotations[0].isInit) { var idx = this.initAnnotations.findIndex(i => i.orderMark === remark)
this.initAnnotations[0].isInit = true if (this.initAnnotations.length > 0 && idx > -1 && this.initAnnotations[idx].orderMark === remark && !this.initAnnotations[idx].isInit) {
this.initAnnotations[idx].isInit = true
} else { } else {
this.onAnnotationModified(e) this.onAnnotationModified(e)
} }
@ -1972,28 +1976,33 @@ export default {
}) })
}, },
imageLocation(obj) { imageLocation(obj) {
this.setToolToTarget(obj) return new Promise(resolve => {
if (!obj.otherMeasureData) return console.log('imageLocation')
this.isLocate = true this.setToolToTarget(obj)
const { metadata } = obj.otherMeasureData if (!obj.otherMeasureData) {
var imageArr = metadata.referencedImageId.split('/') resolve()
var instanceId = imageArr[imageArr.length - 1] return
var viewportId = null }
// var seriesId = data.seriesId this.isLocate = true
// var instanceId = data.instanceId const { metadata } = obj.otherMeasureData
var index = -1 var imageArr = metadata.referencedImageId.split('/')
index = this.petSeries.instanceList.findIndex(i => i === instanceId) var instanceId = imageArr[imageArr.length - 1]
if (index > -1) { var viewportId = null
viewportId = 'PT_AXIAL' // var seriesId = data.seriesId
this.$refs[viewportId].scroll(index) // var instanceId = data.instanceId
return var index = -1
} index = this.petSeries.instanceList.findIndex(i => i === instanceId)
index = this.ctSeries.instanceList.findIndex(i => i === instanceId) if (index > -1) {
if (index > -1) { viewportId = 'PT_AXIAL'
viewportId = 'CT_AXIAL' this.$refs[viewportId].scroll(index)
this.$refs[viewportId].scroll(index) }
return index = this.ctSeries.instanceList.findIndex(i => i === instanceId)
} if (index > -1) {
viewportId = 'CT_AXIAL'
this.$refs[viewportId].scroll(index)
}
resolve()
})
}, },
setToolToTarget(obj) { setToolToTarget(obj) {
var toolGroupIds = [ctToolGroupId, ptToolGroupId, fusionToolGroupId] var toolGroupIds = [ctToolGroupId, ptToolGroupId, fusionToolGroupId]

View File

@ -35,16 +35,24 @@
<!-- 测量 --> <!-- 测量 -->
<el-button v-if="(!questionForm[question.Id] && ((question.QuestionType === 51 && liverIsInsideVolume) || (question.QuestionType === 52 && lungIsInsideVolume)) && readingTaskState!== 2)" size="mini" type="text" @click="addAnnotation(question)">{{ $t('trials:lugano:button:addAnnotation') }}</el-button> <el-button v-if="(!questionForm[question.Id] && ((question.QuestionType === 51 && liverIsInsideVolume) || (question.QuestionType === 52 && lungIsInsideVolume)) && readingTaskState!== 2)" size="mini" type="text" @click="addAnnotation(question)">{{ $t('trials:lugano:button:addAnnotation') }}</el-button>
<!-- 清除标记 --> <!-- 清除标记 -->
<el-button v-if="(questionForm[question.Id] || (question.QuestionType === 51 && !liverIsInsideVolume) || (question.QuestionType === 52 && !lungIsInsideVolume)) && readingTaskState!== 2" size="mini" type="text" style="padding: 7px 5px;" @click="removeAnnotation(question)">{{ $t('trials:lugano:button:clearAnnotation') }}</el-button> <el-button v-if="(questionForm[question.Id] || (question.QuestionType === 51 && !liverIsInsideVolume) || (question.QuestionType === 52 && !lungIsInsideVolume)) && readingTaskState!== 2" size="mini" type="text" style="padding: 7px 5px;margin-left:5px;" @click="removeAnnotation(question)">{{ $t('trials:lugano:button:clearAnnotation') }}</el-button>
<!-- 定位 --> <!-- 定位 -->
<el-button <el-button
v-if="(questionForm[question.Id] || (question.QuestionType === 51 && !liverIsInsideVolume) || (question.QuestionType === 52 && !lungIsInsideVolume))" v-if="(questionForm[question.Id] || (question.QuestionType === 51 && !liverIsInsideVolume) || (question.QuestionType === 52 && !lungIsInsideVolume))"
size="mini" size="mini"
type="text" type="text"
style="padding: '7px 5px'" style="padding: '7px 5px';margin-left:-5px;"
:style="{marginLeft: readingTaskState!== 2?'-5px':'5px'}"
@click="locateAnnotation(question)" @click="locateAnnotation(question)"
>{{ $t('trials:lugano:button:locateAnnotation') }}</el-button> >{{ $t('trials:lugano:button:locateAnnotation') }}</el-button>
<!-- 保存 -->
<el-button v-if="questionForm[question.Id] && readingTaskState!== 2 && question.SaveEnum === 1" size="mini" type="text" style="padding: '7px 5px';margin-left:-5px;" @click="saveAnnotation(question)">
<!-- 未保存 -->
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
<i class="el-icon-warning" style="color:red" />
</el-tooltip>
{{ $t('common:button:save') }}
</el-button>
<el-button v-if="!question.IsBaseLineTask" size="mini" type="text" style="padding: '7px 5px';margin-left:-5px;" @click="viewAnnotations(question)">{{ $t('trials:lugano:button:suvscreenshot') }}</el-button>
</div> </div>
</template> </template>
<template v-else-if="question.QuestionType === 53"> <template v-else-if="question.QuestionType === 53">
@ -339,11 +347,16 @@ export default {
FusionEvent.$emit('removeAnnotation', question) FusionEvent.$emit('removeAnnotation', question)
}) })
.catch(() => {}) .catch(() => {})
}, },
locateAnnotation(question) { locateAnnotation(question) {
FusionEvent.$emit('locateAnnotation', question) FusionEvent.$emit('locateAnnotation', question)
}, },
saveAnnotation(question) {
FusionEvent.$emit('saveAnnotation', question)
},
viewAnnotations(question) {
FusionEvent.$emit('viewAnnotations', question)
},
async uploadScreenshot(param) { async uploadScreenshot(param) {
if (!this.visitTaskId) return if (!this.visitTaskId) return
const loading = this.$loading({ const loading = this.$loading({

View File

@ -33,9 +33,11 @@
<script> <script>
import { saveImageQuality, getDicomReadingQuestionAnswer, getReadingCalculationData } from '@/api/trials' import { saveImageQuality, getDicomReadingQuestionAnswer, getReadingCalculationData } from '@/api/trials'
import { getToken } from '@/utils/auth'
import QuestionItem from './QuestionItem' import QuestionItem from './QuestionItem'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import FusionEvent from './FusionEvent' import FusionEvent from './FusionEvent'
export default { export default {
name: 'ECRF', name: 'ECRF',
components: { components: {
@ -103,6 +105,7 @@ export default {
this.resetSuvQuestions() this.resetSuvQuestions()
}) })
FusionEvent.$on('addAnnotation', obj => { FusionEvent.$on('addAnnotation', obj => {
this.$set(obj, 'SaveEnum', 0)
this.addAnnotation(obj) this.addAnnotation(obj)
}) })
FusionEvent.$on('removeAnnotation', obj => { FusionEvent.$on('removeAnnotation', obj => {
@ -111,6 +114,13 @@ export default {
FusionEvent.$on('locateAnnotation', obj => { FusionEvent.$on('locateAnnotation', obj => {
this.locateAnnotation(obj) this.locateAnnotation(obj)
}) })
FusionEvent.$on('saveAnnotation', obj => {
this.saveAnnotation(obj)
})
FusionEvent.$on('viewAnnotations', obj => {
console.log('viewAnnotations')
this.viewAnnotations(obj)
})
}, },
beforeDestroy() { beforeDestroy() {
FusionEvent.$off('refreshQuestions') FusionEvent.$off('refreshQuestions')
@ -193,10 +203,12 @@ export default {
if (i.QuestionType === 51) { if (i.QuestionType === 51) {
// SUVmax(51); // SUVmax(51);
this.liverSuvmaxId = i.Id this.liverSuvmaxId = i.Id
this.$set(i, 'SaveEnum', 0)
} }
if (i.QuestionType === 52) { if (i.QuestionType === 52) {
// SUVmax(52); // SUVmax(52);
this.lungSuvmaxId = i.Id this.lungSuvmaxId = i.Id
this.$set(i, 'SaveEnum', 0)
} }
if (i.QuestionType === 53) { if (i.QuestionType === 53) {
// SUVmax; // SUVmax;
@ -223,18 +235,7 @@ export default {
handleSave() { handleSave() {
this.$refs['questions'].validate((valid) => { this.$refs['questions'].validate((valid) => {
if (!valid) return if (!valid) return
if (!this.lungIsInsideVolume || !this.liverIsInsideVolume) {
//
this.$alert(this.$t('trials:reading:lugano:warnning:outsideVolume'), this.$t('trials:lugano:fusionDialog:warning'), {
callback: action => {
this.$message({
type: 'info',
message: `action: ${action}`
})
}
})
return
}
// SUVmax // SUVmax
const liverSUVmax = !isNaN(parseFloat(this.questionForm[this.liverSuvmaxId])) ? parseFloat(this.questionForm[this.liverSuvmaxId]) : 0 const liverSUVmax = !isNaN(parseFloat(this.questionForm[this.liverSuvmaxId])) ? parseFloat(this.questionForm[this.liverSuvmaxId]) : 0
// SUVmax // SUVmax
@ -268,22 +269,22 @@ export default {
for (const k in this.questionForm) { for (const k in this.questionForm) {
answers.push({ id: k, answer: this.questionForm[k] }) answers.push({ id: k, answer: this.questionForm[k] })
} }
var questionMarkInfoList = [] // var questionMarkInfoList = []
this.measurements.forEach(item => { // this.measurements.forEach(item => {
var i = Object.assign({}, item) // var i = Object.assign({}, item)
if (i.OtherMeasureData) { // if (i.OtherMeasureData) {
for (const k in i.OtherMeasureData.data.cachedStats) { // for (const k in i.OtherMeasureData.data.cachedStats) {
i.OtherMeasureData.data.cachedStats[k].pointsInShape = [] // i.OtherMeasureData.data.cachedStats[k].pointsInShape = []
} // }
i.OtherMeasureData = JSON.stringify(i.OtherMeasureData) // i.OtherMeasureData = JSON.stringify(i.OtherMeasureData)
} // }
questionMarkInfoList.push(i) // questionMarkInfoList.push(i)
}) // })
var params = { var params = {
visitTaskId: this.visitTaskId, visitTaskId: this.visitTaskId,
answers: answers, answers: answers
questionMarkInfoList // questionMarkInfoList
} }
saveImageQuality(params).then(async res => { saveImageQuality(params).then(async res => {
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
@ -336,6 +337,70 @@ export default {
FusionEvent.$emit('imageLocation', { otherMeasureData: otherMeasureData }) FusionEvent.$emit('imageLocation', { otherMeasureData: otherMeasureData })
}, },
saveAnnotation(question) {
if (!this.lungIsInsideVolume || !this.liverIsInsideVolume) {
//
this.$alert(this.$t('trials:reading:lugano:warnning:outsideVolume'), this.$t('trials:lugano:fusionDialog:warning'), {
callback: action => {
this.$message({
type: 'info',
message: `action: ${action}`
})
}
})
return
}
const loading = this.$loading({ fullscreen: true })
//
var answers = []
var questionMarkInfoList = []
var annotationObj = this.measurements.find(i => i.QuestionType === question.QuestionType)
if (!annotationObj) {
loading.close()
return
}
FusionEvent.$emit('getScreenshots', { otherMeasureData: annotationObj.OtherMeasureData }, async val => {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
var picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
if (annotationObj && annotationObj.OtherMeasureData) {
var otherMeasureData = Object.assign({}, annotationObj.OtherMeasureData)
for (const k in otherMeasureData.data.cachedStats) {
otherMeasureData.data.cachedStats[k].pointsInShape = []
}
annotationObj.OtherMeasureData = JSON.stringify(otherMeasureData)
annotationObj.OtherPicturePath = picturePath
questionMarkInfoList.push(annotationObj)
}
for (const k in this.questionForm) {
if (k === question.Id) {
answers.push({ id: k, answer: this.questionForm[k] })
break
}
}
var params = {
visitTaskId: this.visitTaskId,
answers,
questionMarkInfoList
}
saveImageQuality(params).then(async res => {
this.$message.success(this.$t('common:message:savedSuccessfully'))
loading.close()
this.$set(question, 'SaveEnum', 0)
window.opener.postMessage({ type: 'petctLesionUpdate' }, window.location)
}).catch(() => {
loading.close()
})
})
},
viewAnnotations(question) {
var token = getToken()
var subjectCode = this.$route.query.subjectCode
var path = `/historyScreenshot?&subjectCode=${subjectCode}&visitTaskId=${this.visitTaskId}&questionType=${question.QuestionType}&TokenKey=${token}`
const routeData = this.$router.resolve({ path })
window.open(routeData.href, '_blank')
},
setMeasuredData(measurement) { setMeasuredData(measurement) {
if (measurement.data.isHandleOutsideImage) { if (measurement.data.isHandleOutsideImage) {
this.setOutsideMeasuredData(measurement) this.setOutsideMeasuredData(measurement)
@ -374,6 +439,19 @@ export default {
} }
FusionEvent.$emit('addOrUpdateAnnotations', { data }) FusionEvent.$emit('addOrUpdateAnnotations', { data })
this.questionFormChangeState = true this.questionFormChangeState = true
this.setQuestionStatus(this.questions, this.measurements[idx].QuestionType)
}
},
setQuestionStatus(obj, questionType) {
console.log(obj, questionType)
for (let i = 0; i < obj.length; i++) {
if (obj[i].QuestionType === questionType) {
this.$set(obj[i], 'SaveEnum', 1)
break
}
if (obj[i].Childrens && obj[i].Childrens.length > 0) {
this.setQuestionStatus(obj[i].Childrens, questionType)
}
} }
}, },
setOutsideMeasuredData(measurement) { setOutsideMeasuredData(measurement) {
@ -415,6 +493,7 @@ export default {
} }
FusionEvent.$emit('addOrUpdateAnnotations', { data }) FusionEvent.$emit('addOrUpdateAnnotations', { data })
this.questionFormChangeState = true this.questionFormChangeState = true
this.setQuestionStatus(this.questions, this.measurements[idx].QuestionType)
}, },
clearMeasuredData(remark) { clearMeasuredData(remark) {
var idx = this.measurements.findIndex(i => i.OrderMarkName === remark) var idx = this.measurements.findIndex(i => i.OrderMarkName === remark)
@ -538,6 +617,45 @@ export default {
this.setSuvChild(i.Childrens) this.setSuvChild(i.Childrens)
} }
}) })
},
async uploadScreenshots(fileName, file) {
try {
file = this.convertBase64ToBlob(file)
var trialId = this.$route.query.trialId
var subjectId = this.$route.query.trialId
const result = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${fileName}.png`, file)
return { isSuccess: true, result: result }
} catch (e) {
console.log(e)
return { isSuccess: false, result: e }
}
},
convertBase64ToBlob(imageEditorBase64) {
var base64Arr = imageEditorBase64.split(',')
var imgtype = ''
var base64String = ''
if (base64Arr.length > 1) {
// base64
base64String = base64Arr[1]
imgtype = base64Arr[0].substring(
base64Arr[0].indexOf(':') + 1,
base64Arr[0].indexOf(';')
)
}
// base64
var bytes = atob(base64String)
// var bytes = base64;
var bytesCode = new ArrayBuffer(bytes.length)
//
var byteArray = new Uint8Array(bytesCode)
// base64ascii
for (var i = 0; i < bytes.length; i++) {
byteArray[i] = bytes.charCodeAt(i)
}
// Blob
return new Blob([bytesCode], { type: imgtype })
} }
} }
} }

View File

@ -794,7 +794,7 @@ export default {
otherMeasureData.data.cachedStats[k].pointsInShape = [] otherMeasureData.data.cachedStats[k].pointsInShape = []
} }
} }
FusionEvent.$emit('getScreenshots', async val => { FusionEvent.$emit('getScreenshots', { otherMeasureData: this.questionForm.OtherMeasureData }, async val => {
// 0线 // 0线
// 10mm2线 // 10mm2线
// 15mm2线 // 15mm2线

View File

@ -205,11 +205,17 @@ export default {
document.addEventListener('mouseup', () => { document.addEventListener('mouseup', () => {
this.sliderMouseup() this.sliderMouseup()
}) })
// document.addEventListener('mousewheel', (e) => {
// this.mousewheel(e)
// })
}, },
destroyed() { destroyed() {
}, },
methods: { methods: {
// mousewheel(e){
// console.log(e)
// },
handleVolumeNewImage(e) { handleVolumeNewImage(e) {
const { imageIndex } = e.detail const { imageIndex } = e.detail
this.seriesInfo.imageIdIndex = imageIndex this.seriesInfo.imageIdIndex = imageIndex
@ -297,6 +303,7 @@ export default {
var zoom = viewport.getZoom() var zoom = viewport.getZoom()
if (!zoom) return if (!zoom) return
this.imageInfo.zoom = zoom.toFixed(4) this.imageInfo.zoom = zoom.toFixed(4)
// console.log(e)
}, },
handleVOIModified(e) { handleVOIModified(e) {
renderingEngine = getRenderingEngine(this.renderingEngineId) renderingEngine = getRenderingEngine(this.renderingEngineId)

View File

@ -519,7 +519,7 @@ export default {
item.Answer = this.questionForm[item.Id] item.Answer = this.questionForm[item.Id]
arr.push(item) arr.push(item)
}) })
var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionType: this.lesionType } var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }
DicomEvent.$emit('imageLocation', obj) DicomEvent.$emit('imageLocation', obj)
var type = null var type = null
@ -1957,7 +1957,7 @@ export default {
} }
} }
DicomEvent.$emit('getScreenshots', async val => { DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }, async val => {
// 0线 // 0线
// 10mm2线 // 10mm2线
// 15mm2线 // 15mm2线

View File

@ -640,7 +640,7 @@ export default {
item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : '' item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : ''
arr.push(item) arr.push(item)
}) })
var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionType: this.lesionType } var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }
DicomEvent.$emit('imageLocation', obj) DicomEvent.$emit('imageLocation', obj)
var type = null var type = null
if (this.questionForm.RowId) { if (this.questionForm.RowId) {
@ -1653,8 +1653,13 @@ export default {
} }
} }
} }
// DicomEvent.$emit('imageLocation', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionName, lesionType: this.lesionType }, () => {
// console.log(11111)
DicomEvent.$emit('getScreenshots', async val => { // })
// await DicomEvent.$emit('imageLocation', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionName, lesionType: this.lesionType })
// console.log(5555)
DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }, async val => {
// 0线 // 0线
// 10mm2线 // 10mm2线
// 15mm2线 // 15mm2线

View File

@ -690,7 +690,7 @@ export default {
} }
} }
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
DicomEvent.$emit('getScreenshots', async val => { DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }, async val => {
var picturePath = '' var picturePath = ''
if (val && measureData) { if (val && measureData) {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val) var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)

View File

@ -15,6 +15,7 @@
</div> </div>
<template v-else-if="((question.QuestionType === 56 || question.QuestionType === 57) && question.IsBaseLineTask)" /> <template v-else-if="((question.QuestionType === 56 || question.QuestionType === 57) && question.IsBaseLineTask)" />
<template v-else> <template v-else>
<el-form-item <el-form-item
v-if="(question.ShowQuestion===1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion===0 " v-if="(question.ShowQuestion===1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion===0 "
:label="`${question.QuestionName}`" :label="`${question.QuestionName}`"
@ -26,7 +27,8 @@
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']" :class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
> >
<template v-if="question.QuestionType === 60 || question.QuestionType === 61"> <template v-if="question.QuestionType === 60 || question.QuestionType === 61">
<div style="display: flex;flex-direction: row;justify-content: flex-start;"> <div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;">
<el-input <el-input
v-if="question.Type==='calculation'" v-if="question.Type==='calculation'"
v-model="questionForm[question.Id]" v-model="questionForm[question.Id]"
@ -42,7 +44,15 @@
<!-- 清除标记 --> <!-- 清除标记 -->
<el-button v-if="questionForm[question.Id]&& readingTaskState!== 2" size="mini" type="text" @click="removeAnnotation(question)">{{ $t('trials:lugano:button:clearAnnotation') }}</el-button> <el-button v-if="questionForm[question.Id]&& readingTaskState!== 2" size="mini" type="text" @click="removeAnnotation(question)">{{ $t('trials:lugano:button:clearAnnotation') }}</el-button>
<!-- 定位 --> <!-- 定位 -->
<el-button v-if="questionForm[question.Id]" size="mini" type="text" style="margin-left: -5px;" @click="locateAnnotation(question)">{{ $t('trials:lugano:button:locateAnnotation') }}</el-button> <el-button v-if="questionForm[question.Id]" size="mini" type="text" @click="locateAnnotation(question)">{{ $t('trials:lugano:button:locateAnnotation') }}</el-button>
<!-- 保存 -->
<el-button v-if="questionForm[question.Id] && readingTaskState!== 2 && question.SaveEnum === 1" size="mini" type="text" @click="saveAnnotation(question)">
<!-- 未保存 -->
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
<i class="el-icon-warning" style="color:red" />
</el-tooltip>
{{ $t('common:button:save') }}
</el-button>
</div> </div>
</template> </template>
@ -361,6 +371,9 @@ export default {
addAnnotation(question) { addAnnotation(question) {
DicomEvent.$emit('addAnnotation', question) DicomEvent.$emit('addAnnotation', question)
}, },
saveAnnotation(question) {
DicomEvent.$emit('saveAnnotation', question)
},
removeAnnotation(question) { removeAnnotation(question) {
DicomEvent.$emit('locateAnnotation', question) DicomEvent.$emit('locateAnnotation', question)
// //

View File

@ -113,24 +113,31 @@ export default {
DicomEvent.$on('setReadingState', readingTaskState => { DicomEvent.$on('setReadingState', readingTaskState => {
this.readingTaskState = readingTaskState this.readingTaskState = readingTaskState
}) })
DicomEvent.$on('handleSaveQuestions', readingTaskState => { if (this.groupClassify === 3) {
this.handleSave() DicomEvent.$on('addAnnotation', obj => {
}) this.$set(obj, 'SaveEnum', 1)
DicomEvent.$on('addAnnotation', obj => { this.addAnnotation(obj)
this.addAnnotation(obj) })
}) DicomEvent.$on('removeAnnotation', obj => {
DicomEvent.$on('removeAnnotation', obj => { this.removeAnnotation(obj)
this.removeAnnotation(obj) })
}) DicomEvent.$on('saveAnnotation', obj => {
DicomEvent.$on('locateAnnotation', obj => { this.saveAnnotation(obj)
this.locateAnnotation(obj) })
})
DicomEvent.$on('locateAnnotation', obj => {
this.locateAnnotation(obj)
})
}
}, },
beforeDestroy() { beforeDestroy() {
DicomEvent.$off('setReadingState') DicomEvent.$off('setReadingState')
DicomEvent.$off('addAnnotation') if (this.groupClassify === 3) {
DicomEvent.$off('removeAnnotation') DicomEvent.$off('addAnnotation')
DicomEvent.$off('locateAnnotation') DicomEvent.$off('removeAnnotation')
DicomEvent.$off('saveAnnotation')
DicomEvent.$off('locateAnnotation')
}
}, },
methods: { methods: {
async getQuestions(visitTaskId) { async getQuestions(visitTaskId) {
@ -227,10 +234,12 @@ export default {
if (i.QuestionType === 60) { if (i.QuestionType === 60) {
// //
this.spleenTopId = i.Id this.spleenTopId = i.Id
this.$set(i, 'SaveEnum', 0)
} }
if (i.QuestionType === 61) { if (i.QuestionType === 61) {
// //
this.spleenBottomId = i.Id this.spleenBottomId = i.Id
this.$set(i, 'SaveEnum', 0)
} }
} }
if (i.Childrens && i.Childrens.length > 0) { if (i.Childrens && i.Childrens.length > 0) {
@ -276,10 +285,6 @@ export default {
this.loading = true this.loading = true
var answers = [] var answers = []
var imageQuality = null var imageQuality = null
if (this.groupClassify === 3) {
await this.uploadScreenshot()
}
for (const k in this.questionForm) { for (const k in this.questionForm) {
answers.push({ id: k, answer: this.questionForm[k] }) answers.push({ id: k, answer: this.questionForm[k] })
if (k === this.imageQualityId) { if (k === this.imageQualityId) {
@ -291,17 +296,17 @@ export default {
answers: answers answers: answers
} }
if (this.groupClassify === 3) { // if (this.groupClassify === 3) {
var questionMarkInfoList = [] // var questionMarkInfoList = []
this.measurements.forEach(item => { // this.measurements.forEach(item => {
var i = Object.assign({}, item) // var i = Object.assign({}, item)
if (i.MeasureData) { // if (i.MeasureData) {
i.MeasureData = JSON.stringify(i.MeasureData) // i.MeasureData = JSON.stringify(i.MeasureData)
} // }
questionMarkInfoList.push(i) // questionMarkInfoList.push(i)
}) // })
params.questionMarkInfoList = questionMarkInfoList // params.questionMarkInfoList = questionMarkInfoList
} // }
saveImageQuality(params).then(async res => { saveImageQuality(params).then(async res => {
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
@ -359,16 +364,6 @@ export default {
return { isSuccess: false, result: e } return { isSuccess: false, result: e }
} }
}, },
//
async uploadScreenshot() {
for (let i = 0; i < this.measurements.length; i++) {
if (this.measurements[i].pictureBaseStr) {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, this.measurements[i].pictureBaseStr)
this.measurements[i].PicturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
this.measurements[i].pictureBaseStr = ''
}
}
},
async uploadScreenshots(fileName, file) { async uploadScreenshots(fileName, file) {
try { try {
file = this.convertBase64ToBlob(file) file = this.convertBase64ToBlob(file)
@ -436,6 +431,73 @@ export default {
this.setSpleenCommentDisplay() this.setSpleenCommentDisplay()
this.formChanged = true this.formChanged = true
}, },
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
}
DicomEvent.$emit('getScreenshots', { questionId: annotationObj.Id, visitTaskId: this.visitTaskId, lesionName: annotationObj.OrderMarkName, markTool: annotationObj.MarkTool, readingTaskState: this.readingTaskState, isMarked: !!annotationObj.MeasureData }, async val => {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
var picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
if (annotationObj && annotationObj.MeasureData) {
annotationObj.MeasureData = JSON.stringify(annotationObj.MeasureData)
annotationObj.PicturePath = picturePath
questionMarkInfoList.push(annotationObj)
}
for (const k in this.questionForm) {
if (k === question.Id) {
answers.push({ id: k, answer: this.questionForm[k] })
break
}
}
var params = {
visitTaskId: this.visitTaskId,
answers,
questionMarkInfoList
}
saveImageQuality(params).then(async res => {
this.$message.success(this.$t('common:message:savedSuccessfully'))
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()
},
locateAnnotation(obj) { locateAnnotation(obj) {
const { Id } = obj const { Id } = obj
var idx = this.measurements.findIndex(i => i.QuestionId === Id) var idx = this.measurements.findIndex(i => i.QuestionId === Id)
@ -504,6 +566,19 @@ export default {
DicomEvent.$emit('questionFormChange', true) DicomEvent.$emit('questionFormChange', true)
} }
this.formChanged = true this.formChanged = true
this.setQuestionStatus(this.questions, this.measurements[idx].QuestionType)
},
setQuestionStatus(obj, questionType) {
console.log(obj, questionType)
for (let i = 0; i < obj.length; i++) {
if (obj[i].QuestionType === questionType) {
this.$set(obj[i], 'SaveEnum', 1)
break
}
if (obj[i].Childrens && obj[i].Childrens.length > 0) {
this.setQuestionStatus(obj[i].Childrens, questionType)
}
}
}, },
getSpleenL() { getSpleenL() {
var length = null var length = null

View File

@ -496,7 +496,7 @@ export default {
item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : '' item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : ''
arr.push(item) arr.push(item)
}) })
var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionType: this.lesionType } var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }
DicomEvent.$emit('imageLocation', obj) DicomEvent.$emit('imageLocation', obj)
var type = null var type = null
if (this.questionForm.RowId) { if (this.questionForm.RowId) {
@ -1319,7 +1319,7 @@ export default {
} }
} }
DicomEvent.$emit('getScreenshots', async val => { DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }, async val => {
// 0线 // 0线
// 10mm2线 // 10mm2线
// 15mm2线 // 15mm2线

View File

@ -454,7 +454,7 @@ export default {
item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : '' item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : ''
arr.push(item) arr.push(item)
}) })
var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionType: this.lesionType } var obj = { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }
DicomEvent.$emit('imageLocation', obj) DicomEvent.$emit('imageLocation', obj)
var type = null var type = null
if (this.questionForm.RowId) { if (this.questionForm.RowId) {
@ -970,7 +970,7 @@ export default {
} }
} }
DicomEvent.$emit('getScreenshots', async val => { DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType }, async val => {
var picturePath = '' var picturePath = ''
if (val && measureData) { if (val && measureData) {
var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val) var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)

View File

@ -690,6 +690,7 @@ export default {
await store.dispatch('reading/setCurrentReadingTaskState', 2) await store.dispatch('reading/setCurrentReadingTaskState', 2)
var isAutoTask = await this.getAutoTaskVal() var isAutoTask = await this.getAutoTaskVal()
if (isAutoTask) { if (isAutoTask) {
DicomEvent.$emit('reload')
// DicomEvent.$emit('getNextTask') // DicomEvent.$emit('getNextTask')
window.location.reload() window.location.reload()
} else { } else {

View File

@ -78,7 +78,7 @@
</p> </p>
<div class="flex-div"> <div class="flex-div">
<div v-if="measureData.findIndex(v=>v.SeriesId === series.seriesId && v.MeasureData) > -1"> <div v-if="measureData && measureData.findIndex(v=>v.SeriesId === series.seriesId && v.MeasureData) > -1">
<!-- 有标注 --> <!-- 有标注 -->
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:marked')" placement="right"> <el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:marked')" placement="right">
<i class="el-icon-star-on" style="font-size: 16px;color: #ff5722;" /> <i class="el-icon-star-on" style="font-size: 16px;color: #ff5722;" />
@ -718,7 +718,7 @@ export default {
// requestPoolManager.startTaskTimer() // requestPoolManager.startTaskTimer()
this.imageList.map(image => { this.imageList.map(image => {
requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => { requestPoolManager.loadAndCacheImagePlus(image.imageId, image.seriesId, image.priority).then(res => {
if(res){ if (res) {
this.imageLoaded(image, res.data.string('x0020000e')) this.imageLoaded(image, res.data.string('x0020000e'))
} }
}) })

View File

@ -78,7 +78,7 @@
</p> </p>
<div class="flex-div"> <div class="flex-div">
<div v-if="measureData.findIndex(v=>v.SeriesId === series.seriesId && v.MeasureData) > -1"> <div v-if="measureData && measureData.findIndex(v=>v.SeriesId === series.seriesId && v.MeasureData) > -1">
<!-- 有标注 --> <!-- 有标注 -->
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:marked')" placement="right"> <el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:marked')" placement="right">
<i class="el-icon-star-on" style="font-size: 16px;color: #ff5722;" /> <i class="el-icon-star-on" style="font-size: 16px;color: #ff5722;" />