自定义阅片更改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
642c708c74
commit
43a221de00
|
@ -432,6 +432,7 @@
|
|||
:visit-info="s"
|
||||
@resetAnnotations="resetAnnotations"
|
||||
@setReadingTaskState="setReadingTaskState"
|
||||
@viewCustomAnnotationSeries="viewCustomAnnotationSeries"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1479,6 +1480,11 @@ export default {
|
|||
// if ( this.resetAnnotation && this.isFusion ) return false
|
||||
if (!annotation) return false
|
||||
if (this.readingTaskState === 2) throw 'annotation Not allowed to operate'
|
||||
const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName)
|
||||
if (i === -1) {
|
||||
// 临时标记
|
||||
return
|
||||
}
|
||||
if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
|
||||
if (this.activeTool === 'Eraser') {
|
||||
await this.$confirm(
|
||||
|
@ -1874,8 +1880,10 @@ export default {
|
|||
const type = parseInt(value)
|
||||
// 1:默认值;2:垂直翻转;3:水平翻转;4:左转90度;5:右转90度;
|
||||
if (type === 1) {
|
||||
viewport.resetCamera()
|
||||
viewport.resetProperties()
|
||||
// viewport.resetCamera()
|
||||
// viewport.resetProperties()
|
||||
// viewport.render()
|
||||
viewport.setViewPresentation({ rotation: 0 })
|
||||
viewport.render()
|
||||
} else if (type === 2) {
|
||||
const { flipVertical } = viewport.getCamera()
|
||||
|
@ -2421,6 +2429,17 @@ export default {
|
|||
}
|
||||
return obj
|
||||
},
|
||||
viewCustomAnnotationSeries(obj) {
|
||||
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||
if (i === -1) return
|
||||
const studyList = this.visitTaskList[i].StudyList
|
||||
let series = this.getMarkedSeries(studyList, obj.annotation)
|
||||
if (series) {
|
||||
this.$refs[`${this.viewportKey}-${this.cells.length - 1}`][0].setSeriesInfo(series, true)
|
||||
this.activeViewportIndex = i
|
||||
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
||||
}
|
||||
},
|
||||
async getScreenshots(measureData, callback) {
|
||||
if (measureData) {
|
||||
await this.imageLocation(measureData)
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
type="number"
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="readingTaskState === 2"
|
||||
disabled
|
||||
style="width: 150px;"
|
||||
>
|
||||
<template v-if="question.Unit !== 0" slot="append">
|
||||
|
@ -242,7 +242,7 @@
|
|||
</el-input>
|
||||
<!-- 标记 -->
|
||||
<!-- <el-button
|
||||
v-if="readingTaskState!== 2"
|
||||
v-if="readingTaskState < 2 && !questionsMarkStatus[question.Id]"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 1, question})"
|
||||
|
@ -251,6 +251,7 @@
|
|||
</el-button> -->
|
||||
<!-- 查看 -->
|
||||
<!-- <el-button
|
||||
v-if="questionsMarkStatus[question.Id]"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 2, question})"
|
||||
|
@ -259,7 +260,7 @@
|
|||
</el-button> -->
|
||||
<!-- 更改 -->
|
||||
<!-- <el-button
|
||||
v-if="readingTaskState!== 2"
|
||||
v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 3, question})"
|
||||
|
@ -268,7 +269,7 @@
|
|||
</el-button> -->
|
||||
<!-- 移除 -->
|
||||
<!-- <el-button
|
||||
v-if="readingTaskState!== 2"
|
||||
v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 4, question})"
|
||||
|
@ -277,11 +278,14 @@
|
|||
</el-button> -->
|
||||
<!-- 保存 -->
|
||||
<!-- <el-button
|
||||
v-if="readingTaskState!== 2"
|
||||
v-if="readingTaskState < 2 && questionsMarkStatus[question.Id]"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 5, question})"
|
||||
>
|
||||
<el-tooltip v-if="questionsMarkStatus[question.Id] === 1" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</el-tooltip>
|
||||
保存
|
||||
</el-button> -->
|
||||
</div>
|
||||
|
@ -358,6 +362,7 @@
|
|||
:criterion-id="criterionId"
|
||||
:calculationList="calculationList"
|
||||
:questionMarkInfoList="questionMarkInfoList"
|
||||
:questionsMarkStatus="questionsMarkStatus"
|
||||
@formItemNumberChange="formItemNumberChange"
|
||||
@setFormItemData="setFormItemData"
|
||||
@resetFormItemData="resetFormItemData"
|
||||
|
@ -474,6 +479,12 @@ export default {
|
|||
questionMarkInfoList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
questionsMarkStatus: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
:criterion-id="criterionId"
|
||||
:calculation-list="calculationList"
|
||||
:questionMarkInfoList="questionMarkInfoList"
|
||||
:questionsMarkStatus="questionsMarkStatus"
|
||||
:is-baseline="isBaseLineTask"
|
||||
@resetFormItemData="resetFormItemData"
|
||||
@setFormItemData="setFormItemData"
|
||||
|
@ -77,7 +78,7 @@
|
|||
|
||||
<script>
|
||||
|
||||
import { getCustomTableQuestionAnswer, changeDicomReadingQuestionAnswer, submitVisitTaskQuestionsInDto, getQuestionCalculateRelation } from '@/api/trials'
|
||||
import { getCustomTableQuestionAnswer, changeDicomReadingQuestionAnswer, submitVisitTaskQuestionsInDto, getQuestionCalculateRelation, saveTaskQuestion } from '@/api/trials'
|
||||
import { setSkipReadingCache, resetReadingTask } from '@/api/reading'
|
||||
import const_ from '@/const/sign-code'
|
||||
import QuestionFormItem from './QuestionFormItem'
|
||||
|
@ -119,7 +120,9 @@ export default {
|
|||
questionMarkInfoList: [],
|
||||
operateStateEnum: null, // 1:标记;2:查看;3:更改;4:移除;5:保存
|
||||
operateQuestionId: '',
|
||||
operateRowId: ''
|
||||
operateRowId: '',
|
||||
questionsMarkStatus: {}, // 1:未保存;2:已保存
|
||||
digitPlaces: 2
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -128,6 +131,8 @@ export default {
|
|||
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
|
||||
this.isBaseLineTask = this.taskInfo.IsBaseLine
|
||||
this.criterionType = this.taskInfo.CriterionType
|
||||
const digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
this.getQuestionCalculateRelation()
|
||||
this.getQuestions()
|
||||
},
|
||||
|
@ -160,7 +165,16 @@ export default {
|
|||
}
|
||||
})
|
||||
this.questions = res.Result.SinglePage
|
||||
this.questionMarkInfoList = res.OtherInfo.QuestionMarkInfoList
|
||||
this.questionsMarkStatus = {}
|
||||
this.questionMarkInfoList = res.OtherInfo.QuestionMarkInfoList.map(i=>{
|
||||
if (i.QuestionId && i.MeasureData) {
|
||||
this.$set(this.questionsMarkStatus, i.QuestionId, 2)
|
||||
}
|
||||
if (typeof i.MeasureData === 'string' && i.MeasureData) {
|
||||
i.MeasureData = JSON.parse(i.MeasureData)
|
||||
}
|
||||
return i
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -333,55 +347,112 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
operateImageMarker(obj) {
|
||||
async operateImageMarker(obj) {
|
||||
this.operateStateEnum = obj.operateStateEnum
|
||||
this.operateQuestionId = obj.question.Id
|
||||
if (obj.operateStateEnum === 1) {
|
||||
// 添加标记
|
||||
|
||||
} else if (obj.operateStateEnum === 2) {
|
||||
// 查看标记
|
||||
this.$emit('')
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.QuestionId === obj.question.Id)
|
||||
if (i > -1) {
|
||||
let annotation = this.questionMarkInfoList[i].MeasureData
|
||||
this.$emit('viewCustomAnnotationSeries', {visitTaskId: this.visitTaskId, annotation})
|
||||
}
|
||||
|
||||
} else if (obj.operateStateEnum === 3) {
|
||||
// 更改标记
|
||||
this.$set(this.questionsMarkStatus, obj.question.Id, 1)
|
||||
} else if (obj.operateStateEnum === 4) {
|
||||
// 移除标记
|
||||
this.$set(this.questionForm, obj.question.Id, '')
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.QuestionId === obj.question.Id)
|
||||
if (i > -1) {
|
||||
this.questionMarkInfoList.splice(i, 1)
|
||||
}
|
||||
this.$set(this.questionsMarkStatus, obj.question.Id, 0)
|
||||
} else if (obj.operateStateEnum === 5) {
|
||||
// 保存标记
|
||||
this.loading = true
|
||||
try {
|
||||
let answers = []
|
||||
answers.push({ id: obj.question.Id, answer: this.questionForm[obj.question.Id] })
|
||||
let markInfo = []
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.QuestionId === this.operateQuestionId)
|
||||
if (i > -1) {
|
||||
let obj = Object.assign({}, this.questionMarkInfoList[i])
|
||||
obj.MeasureData = obj.MeasureData ? JSON.stringify(obj.MeasureData) : ''
|
||||
markInfo.push(obj)
|
||||
}
|
||||
this.operateStateEnum = obj.operateStateEnum
|
||||
this.operateQuestionId = obj.question.Id
|
||||
let params = {
|
||||
visitTaskId: this.visitTaskId,
|
||||
answers: answers,
|
||||
questionMarkInfoList: markInfo
|
||||
}
|
||||
await saveTaskQuestion(-10, params)
|
||||
|
||||
this.$set(this.questionsMarkStatus, obj.question.Id, 2)
|
||||
this.loading = false
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
bindAnnotationToQuestion(annotation) {
|
||||
console.log('bindAnnotationToQuestion', annotation)
|
||||
if (this.operateStateEnum === 1 && this.operateQuestionId) {
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.questionId === this.operateQuestionId)
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.QuestionId === this.operateQuestionId)
|
||||
if (i === -1) {
|
||||
let markInfo = {
|
||||
id: '',
|
||||
questionId: this.operateQuestionId,
|
||||
instanceId: annotation.instanceId,
|
||||
seriesId: annotation.seriesId,
|
||||
studyId: annotation.studyId,
|
||||
markTool: '',
|
||||
picturePath: '',
|
||||
numberOfFrames: '',
|
||||
measureData: annotation
|
||||
QuestionId: this.operateQuestionId,
|
||||
InstanceId: annotation.instanceId,
|
||||
SeriesId: annotation.seriesId,
|
||||
StudyId: annotation.studyId,
|
||||
MarkTool: annotation.metadata.toolName,
|
||||
PicturePath: '',
|
||||
NumberOfFrames: annotation.numberOfFrames,
|
||||
MeasureData: annotation
|
||||
}
|
||||
this.questionMarkInfoList.push(markInfo)
|
||||
} else {
|
||||
this.questionMarkInfoList[i].instanceId = annotation.instanceId
|
||||
this.questionMarkInfoList[i].seriesId = annotation.seriesId
|
||||
this.questionMarkInfoList[i].studyId = annotation.studyId
|
||||
this.questionMarkInfoList[i].markTool = ''
|
||||
this.questionMarkInfoList[i].picturePath = ''
|
||||
this.questionMarkInfoList[i].numberOfFrames = ''
|
||||
this.questionMarkInfoList[i].measureData = annotation
|
||||
this.questionMarkInfoList[i].InstanceId = annotation.instanceId
|
||||
this.questionMarkInfoList[i].SeriesId = annotation.seriesId
|
||||
this.questionMarkInfoList[i].StudyId = annotation.studyId
|
||||
this.questionMarkInfoList[i].MarkTool = annotation.metadata.toolName
|
||||
this.questionMarkInfoList[i].PicturePath = ''
|
||||
this.questionMarkInfoList[i].NumberOfFrames = annotation.numberOfFrames
|
||||
this.questionMarkInfoList[i].MeasureData = annotation
|
||||
}
|
||||
this.setAnswerToQuestion(annotation, this.operateQuestionId)
|
||||
this.$set(this.questionsMarkStatus, this.operateQuestionId, 1)
|
||||
}
|
||||
},
|
||||
updateAnnotationToQuestion(annotation) {
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.measureData && i.measureData.annotationUID === annotation.annotationUID)
|
||||
console.log('updateAnnotationToQuestion', annotation)
|
||||
let i = this.questionMarkInfoList.findIndex(i=>i.MeasureData && i.MeasureData.annotationUID === annotation.annotationUID)
|
||||
if (i === -1) return
|
||||
this.questionMarkInfoList[i].measureData = annotation
|
||||
this.setAnswerToQuestion(annotation, this.questionMarkInfoList[i].QuestionId)
|
||||
this.$set(this.questionsMarkStatus, this.questionMarkInfoList[i].QuestionId, 1)
|
||||
},
|
||||
setAnswerToQuestion(annotation, questionId) {
|
||||
if (!questionId || !annotation) return
|
||||
const referencedImageId = annotation.metadata.referencedImageId
|
||||
if (annotation.metadata.toolName === 'Length') {
|
||||
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
|
||||
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
|
||||
this.$set(this.questionForm, questionId, length)
|
||||
} else if (obj.toolName === 'Bidirectional') {
|
||||
// let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
|
||||
// length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
|
||||
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
|
||||
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
|
||||
this.$set(this.questionForm, questionId, short)
|
||||
}
|
||||
},
|
||||
async resetForm() {
|
||||
const confirm = await this.$confirm(
|
||||
|
|
Loading…
Reference in New Issue