recist标准更改
continuous-integration/drone/push Build is passing Details

uat
caiyiling 2025-04-14 13:11:00 +08:00
parent 8e0ad5ca9d
commit ca0d406e45
2 changed files with 325 additions and 313 deletions

View File

@ -28,13 +28,13 @@
v-for="outerQs in outerQuestions" v-for="outerQs in outerQuestions"
:key="outerQs.Id" :key="outerQs.Id"
:question="outerQs" :question="outerQs"
:questionForm="outerForm" :question-form="outerForm"
:readingTaskState="readingTaskState" :reading-task-state="readingTaskState"
:visitTaskId="visitTaskId" :visit-task-id="visitTaskId"
/> />
<el-form-item v-if="readingTaskState < 2"> <el-form-item v-if="readingTaskState < 2">
<div class="outer_form-footer"> <div class="outer_form-footer">
<i class="el-icon-warning feedback-icon" @click="openFeedBackTable" :style="{color: taskInfo && taskInfo.IsExistUnprocessedFeedback ? '#ffeb3b' : '#fff'}"/> <i class="el-icon-warning feedback-icon" :style="{color: taskInfo && taskInfo.IsExistUnprocessedFeedback ? '#ffeb3b' : '#fff'}" @click="openFeedBackTable" />
<el-button size="mini" @click="saveOuterForm">{{ $t('common:button:save') }}</el-button> <el-button size="mini" @click="saveOuterForm">{{ $t('common:button:save') }}</el-button>
</div> </div>
</el-form-item> </el-form-item>
@ -45,7 +45,8 @@
<div <div
v-for="(qs,index) in tableQuestions" v-for="(qs,index) in tableQuestions"
:key="index" :key="index"
class="lesions lesions_wrapper"> class="lesions lesions_wrapper"
>
<h4 <h4
v-if="qs.Type === 'group'" v-if="qs.Type === 'group'"
style="color: #ddd;padding: 5px 0px;margin: 0;" style="color: #ddd;padding: 5px 0px;margin: 0;"
@ -58,7 +59,8 @@
v-show="!(isBaseLineTask && table.LesionType === 2)" v-show="!(isBaseLineTask && table.LesionType === 2)"
:key="table.Id" :key="table.Id"
> >
<div v-if="table.Type === 'table'" <div
v-if="table.Type === 'table'"
class="flex-row" class="flex-row"
style="margin:3px 0;" style="margin:3px 0;"
> >
@ -91,7 +93,7 @@
{{ getLesionName(table.OrderMark,answer.RowIndex) }} {{ getLesionName(table.OrderMark,answer.RowIndex) }}
<!-- 未保存 --> <!-- 未保存 -->
<el-tooltip v-if="readingTaskState<2 && parseInt(innerFormData[`${table.Id}_${answer.RowIndex}`].SaveTypeEnum) === 0" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom"> <el-tooltip v-if="readingTaskState<2 && parseInt(innerFormData[`${table.Id}_${answer.RowIndex}`].SaveTypeEnum) === 0" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
<i class="el-icon-warning" style="color:red"/> <i class="el-icon-warning" style="color:red" />
</el-tooltip> </el-tooltip>
<!-- 信息不完整 --> <!-- 信息不完整 -->
<el-tooltip v-if="readingTaskState<2 && parseInt(innerFormData[`${table.Id}_${answer.RowIndex}`].SaveTypeEnum) ===1" class="item" effect="dark" :content="$t('trials:reading:button:incompleteInfor')" placement="bottom"> <el-tooltip v-if="readingTaskState<2 && parseInt(innerFormData[`${table.Id}_${answer.RowIndex}`].SaveTypeEnum) ===1" class="item" effect="dark" :content="$t('trials:reading:button:incompleteInfor')" placement="bottom">
@ -143,13 +145,13 @@
:model="innerFormData[`${table.Id}_${answer.RowIndex}`]" :model="innerFormData[`${table.Id}_${answer.RowIndex}`]"
> >
<table-question-form-item <table-question-form-item
:tableInfo="table" :table-info="table"
:answer="answer" :answer="answer"
:questionForm="innerFormData[`${table.Id}_${answer.RowIndex}`]" :question-form="innerFormData[`${table.Id}_${answer.RowIndex}`]"
:readingTaskState="readingTaskState" :reading-task-state="readingTaskState"
:organs="organs" :organs="organs"
:isBaseLineTask="isBaseLineTask" :is-base-line-task="isBaseLineTask"
:isCurrentTask="isCurrentTask" :is-current-task="isCurrentTask"
@update="innerFormDataUpdate" @update="innerFormDataUpdate"
@close="closeInnerForm" @close="closeInnerForm"
@lesionTypeChange="lesionTypeChange" @lesionTypeChange="lesionTypeChange"
@ -229,7 +231,7 @@ export default {
} }
} }
}, },
data(){ data() {
return { return {
isBaseLineTask: false, isBaseLineTask: false,
isCurrentTask: false, isCurrentTask: false,
@ -259,7 +261,7 @@ export default {
handler(id) { handler(id) {
if (!id) return if (!id) return
this.visitTaskId = id this.visitTaskId = id
this.$nextTick(()=>{ this.$nextTick(() => {
this.activeName = '' this.activeName = ''
this.getOuterQuestions() this.getOuterQuestions()
this.getTableQuestions() this.getTableQuestions()
@ -272,22 +274,22 @@ export default {
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo')) this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.isBaseLineTask = this.taskInfo.IsBaseLine this.isBaseLineTask = this.taskInfo.IsBaseLine
this.criterionType = this.taskInfo.CriterionType this.criterionType = this.taskInfo.CriterionType
let digitPlaces = Number(localStorage.getItem('digitPlaces')) const digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.getOrganList() this.getOrganList()
}, },
methods:{ methods: {
// //
async getOrganList() { async getOrganList() {
try { try {
let params = { const params = {
visitTaskId: this.visitTaskId visitTaskId: this.visitTaskId
} }
let res = await getReadingOrganList(params) const res = await getReadingOrganList(params)
if (res.IsSuccess) { if (res.IsSuccess) {
this.organs = res.Result this.organs = res.Result
} }
} catch(e) { } catch (e) {
console.log(e) console.log(e)
} }
}, },
@ -295,17 +297,17 @@ export default {
async getOuterQuestions() { async getOuterQuestions() {
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
try { try {
let params = { const params = {
trialId: this.$route.query.trialId, trialId: this.$route.query.trialId,
visitTaskId: this.visitTaskId visitTaskId: this.visitTaskId
} }
let res = await getDicomReadingQuestionAnswer(params) const res = await getDicomReadingQuestionAnswer(params)
if (res.IsSuccess) { if (res.IsSuccess) {
this.outerQuestions = res.Result this.outerQuestions = res.Result
this.outerForm = this.getOuterFormData(this.outerQuestions) this.outerForm = this.getOuterFormData(this.outerQuestions)
} }
loading.close() loading.close()
} catch(e) { } catch (e) {
console.log(e) console.log(e)
loading.close() loading.close()
} }
@ -321,7 +323,7 @@ export default {
} }
if (item.QuestionType === 67) { if (item.QuestionType === 67) {
// //
this.imageQualityIssuesId = v.Id this.imageQualityIssuesId = item.Id
} }
if (item.Childrens?.length) { if (item.Childrens?.length) {
this.getOuterFormData(item.Childrens, formData) this.getOuterFormData(item.Childrens, formData)
@ -337,18 +339,18 @@ export default {
this.isCurrentTask = this.taskInfo.VisitTaskId === this.visitTaskId this.isCurrentTask = this.taskInfo.VisitTaskId === this.visitTaskId
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
try { try {
let params = { const params = {
trialId: this.$route.query.trialId, trialId: this.$route.query.trialId,
visitTaskId: this.visitTaskId visitTaskId: this.visitTaskId
} }
let res = await getReadingQuestionAndAnswer(params) const res = await getReadingQuestionAndAnswer(params)
if (res.IsSuccess) { if (res.IsSuccess) {
this.tableQuestions = res.Result.SinglePage this.tableQuestions = res.Result.SinglePage
res.Result.SinglePage.forEach(group=>{ res.Result.SinglePage.forEach(group => {
group.Childrens.forEach(table=>{ group.Childrens.forEach(table => {
const tableKey = table.Id const tableKey = table.Id
this.$set(this.innerFormData, tableKey, {}) this.$set(this.innerFormData, tableKey, {})
table.TableQuestions.Questions.forEach(question=>{ table.TableQuestions.Questions.forEach(question => {
if (question.Type !== 'summary') { if (question.Type !== 'summary') {
this.$set(this.innerFormData[tableKey], question.Id, null) this.$set(this.innerFormData[tableKey], question.Id, null)
} }
@ -359,18 +361,20 @@ export default {
this.$set(this.innerFormData[tableKey], 'IsLymphNodes', null) this.$set(this.innerFormData[tableKey], 'IsLymphNodes', null)
this.$set(this.innerFormData[tableKey], 'LesionState', null) this.$set(this.innerFormData[tableKey], 'LesionState', null)
this.$set(this.innerFormData[tableKey], 'LesionPart', null) this.$set(this.innerFormData[tableKey], 'LesionPart', null)
this.$set(this.innerFormData[tableKey], 'LesionOrgan', null)
this.$set(this.innerFormData[tableKey], 'LesionName', null) this.$set(this.innerFormData[tableKey], 'LesionName', null)
this.$set(this.innerFormData[tableKey], 'MeasureData', null) this.$set(this.innerFormData[tableKey], 'MeasureData', null)
this.$set(this.innerFormData[tableKey], 'TableId', tableKey) this.$set(this.innerFormData[tableKey], 'TableId', tableKey)
this.$set(this.innerFormData[tableKey], 'IsCurrentTaskAdd', 'True') this.$set(this.innerFormData[tableKey], 'IsCurrentTaskAdd', 'True')
// QuestionMark0--1--2--7--8-- // QuestionMark0--1--2--5--7--8--
let lengthId = this.getQuestionId(0, table.TableQuestions.Questions) const lengthId = this.getQuestionId(0, table.TableQuestions.Questions)
let shortId = this.getQuestionId(1, table.TableQuestions.Questions) const shortId = this.getQuestionId(1, table.TableQuestions.Questions)
let lymphNodesId = this.getQuestionId(2, table.TableQuestions.Questions) const lymphNodesId = this.getQuestionId(2, table.TableQuestions.Questions)
let stateId = this.getQuestionId(7, table.TableQuestions.Questions) const organId = this.getQuestionId(5, table.TableQuestions.Questions)
let partId = this.getQuestionId(8, table.TableQuestions.Questions) const stateId = this.getQuestionId(7, table.TableQuestions.Questions)
table.TableQuestions.Answers.forEach((answer, index)=>{ const partId = this.getQuestionId(8, table.TableQuestions.Questions)
table.TableQuestions.Answers.forEach((answer, index) => {
this.$set(this.innerFormData, `${tableKey}_${answer.RowIndex}`, {}) this.$set(this.innerFormData, `${tableKey}_${answer.RowIndex}`, {})
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'LesionName', this.getLesionName(table.OrderMark, answer.RowIndex)) this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'LesionName', this.getLesionName(table.OrderMark, answer.RowIndex))
for (const key in answer) { for (const key in answer) {
@ -380,7 +384,7 @@ export default {
} else if (key === 'LesionType' || key === lymphNodesId || key === stateId) { } else if (key === 'LesionType' || key === lymphNodesId || key === stateId) {
val = isNaN(parseInt(val)) ? null : parseInt(val) val = isNaN(parseInt(val)) ? null : parseInt(val)
} else if (key === 'IsCanEditPosition') { } else if (key === 'IsCanEditPosition') {
val = val === 'True' ? true : false val = val === 'True'
} }
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], key, val) this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], key, val)
if (key === lengthId) { if (key === lengthId) {
@ -394,6 +398,8 @@ export default {
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'SaveTypeEnum', isNaN(parseInt(val)) ? 1 : 2) this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'SaveTypeEnum', isNaN(parseInt(val)) ? 1 : 2)
} else if (key === partId) { } else if (key === partId) {
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'LesionPart', val) this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'LesionPart', val)
} else if (key === organId) {
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'LesionOrgan', val)
} }
} }
if (index === table.TableQuestions.Answers.length - 1) { if (index === table.TableQuestions.Answers.length - 1) {
@ -405,7 +411,7 @@ export default {
}) })
} }
loading.close() loading.close()
} catch(e) { } catch (e) {
console.log(e) console.log(e)
loading.close() loading.close()
} }
@ -416,7 +422,7 @@ export default {
if (!valid) return if (!valid) return
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
try { try {
let answers = [] const answers = []
let imageQuality = null let imageQuality = null
for (const k in this.outerForm) { for (const k in this.outerForm) {
answers.push({ id: k, answer: this.outerForm[k] }) answers.push({ id: k, answer: this.outerForm[k] })
@ -424,12 +430,12 @@ export default {
imageQuality = this.outerForm[k] imageQuality = this.outerForm[k]
} }
} }
let params = { const params = {
visitTaskId: this.visitTaskId, visitTaskId: this.visitTaskId,
answers: answers answers: answers
} }
let res = await saveTaskQuestion(0, params) const res = await saveTaskQuestion(0, params)
if (res.IsSuccess) { if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
if (!this.isBaseLineTask && (this.criterionType === 1 || this.criterionType === 2 || this.criterionType === 3 || this.criterionType === 17)) { if (!this.isBaseLineTask && (this.criterionType === 1 || this.criterionType === 2 || this.criterionType === 3 || this.criterionType === 17)) {
@ -445,17 +451,139 @@ export default {
} }
} }
loading.close() loading.close()
} catch(e) { } catch (e) {
console.log(e) console.log(e)
loading.close() loading.close()
} }
}, },
setAnnotation(obj) {
const annotation = Object.assign({}, obj.annotation)
if (this.activeName) {
//
const tableId = this.activeName.split('_')[0]
const rowIndex = this.activeName.split('_')[1]
const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
if (innerForm.MeasureData) {
if (this.isBaseLineTask) {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.LesionType === 0
)
if (typeof targetTable !== 'object') return
if (targetTable.MaxQuestionCount && targetTable.TableQuestions.Answers.length < targetTable.MaxQuestionCount && (obj.toolName === 'Length' || obj.toolName === 'Bidirectional')) {
this.createTTarget(annotation)
} else {
this.createNTTarget(annotation)
}
} else {
this.createNLTarget(annotation)
}
} else {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.Id === tableId
)
if (typeof targetTable !== 'object') return
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation)
if (obj.toolName === 'Length') {
const referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
} else if (obj.toolName === 'Bidirectional') {
const referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], shortId, short)
}
const stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
const state = this.innerFormData[`${tableId}_${rowIndex}`][stateId]
// 线
if (this.isBaseLineTask && !state) {
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0)
}
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', innerForm.RowId ? 1 : 0)
this.$emit('setMarkName', {
annotationUID: annotation.annotationUID,
name: this.innerFormData[`${tableId}_${rowIndex}`].LesionName
}
)
}
} else {
if (this.isBaseLineTask) {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.LesionType === 0
)
if (typeof targetTable !== 'object') return
if (targetTable.MaxQuestionCount && targetTable.TableQuestions.Answers.length < targetTable.MaxQuestionCount && (obj.toolName === 'Length' || obj.toolName === 'Bidirectional')) {
this.createTTarget(annotation)
} else {
this.createNTTarget(annotation)
}
} else {
this.createNLTarget(annotation)
}
}
},
modifyAnnotation(obj) {
const { annotation, toolName } = obj
const formData = Object.values(this.innerFormData).find(
i => i.LesionName === annotation.data.label
)
if (typeof formData !== 'object') return
const tableId = formData.TableId
const rowIndex = formData.RowIndex
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.Id === formData.TableId
)
if (typeof targetTable !== 'object') return
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation)
if (toolName === 'Length') {
const referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
} else if (toolName === 'Bidirectional') {
const referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], shortId, short)
}
const stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
const state = this.innerFormData[`${tableId}_${rowIndex}`][stateId]
// 线
if (this.isBaseLineTask && !state) {
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0)
}
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', formData.RowId ? 1 : 0)
this.activeName = `${tableId}_${rowIndex}`
},
// //
addTarget(tableInfo, annotation) { addTarget(tableInfo, annotation) {
// //
const obj = Object.values(this.innerFormData).find( const obj = Object.values(this.innerFormData).find(
obj => !obj.RowId obj => !obj.RowId
); )
if (obj !== undefined && typeof obj === 'object') { if (obj !== undefined && typeof obj === 'object') {
let msg = this.$t('trials:reading:warnning:msg5') let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', obj.LesionName) msg = msg.replace('xxx', obj.LesionName)
@ -478,10 +606,10 @@ export default {
}) })
return return
} }
let answer = Object.assign({},this.innerFormData[tableInfo.Id]) const answer = Object.assign({}, this.innerFormData[tableInfo.Id])
answer.TableId = tableInfo.Id answer.TableId = tableInfo.Id
answer.RowId = '' answer.RowId = ''
let maxIndex = this.getMaxRowIndex(tableInfo.TableQuestions.Answers) const maxIndex = this.getMaxRowIndex(tableInfo.TableQuestions.Answers)
answer.RowIndex = `${maxIndex + 1}.00` answer.RowIndex = `${maxIndex + 1}.00`
answer.IsDicomReading = true answer.IsDicomReading = true
answer.SaveTypeEnum = 0 answer.SaveTypeEnum = 0
@ -494,166 +622,41 @@ export default {
if (this.isBaseLineTask && tableInfo.LesionType === 1) { if (this.isBaseLineTask && tableInfo.LesionType === 1) {
state = 0 state = 0
} }
let stateId = this.getQuestionId(7, tableInfo.TableQuestions.Questions) const stateId = this.getQuestionId(7, tableInfo.TableQuestions.Questions)
answer[stateId] = state answer[stateId] = state
tableInfo.TableQuestions.Answers.push(answer) tableInfo.TableQuestions.Answers.push(answer)
if (typeof annotation === 'object') { if (typeof annotation === 'object') {
answer.MeasureData = annotation answer.MeasureData = annotation
if (annotation.metadata.toolName === 'Length') { if (annotation.metadata.toolName === 'Length') {
let referencedImageId = annotation.metadata.referencedImageId const referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
let lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions) const lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions)
answer.LesionLength = length answer.LesionLength = length
answer[lengthId] = length answer[lengthId] = length
} else if (annotation.metadata.toolName === 'Bidirectional') { } else if (annotation.metadata.toolName === 'Bidirectional') {
let referencedImageId = annotation.metadata.referencedImageId const referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
let lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions) const lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions)
answer.LesionLength = length answer.LesionLength = length
answer[lengthId] = length answer[lengthId] = length
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
let shortId = this.getQuestionId(1, tableInfo.TableQuestions.Questions) const shortId = this.getQuestionId(1, tableInfo.TableQuestions.Questions)
answer.LesionShort = short answer.LesionShort = short
answer[shortId] = short answer[shortId] = short
} }
this.$emit('setMarkName', { this.$emit('setMarkName', {
annotationUID: annotation.annotationUID, annotationUID: annotation.annotationUID,
name: answer.LesionName name: answer.LesionName
} }
) )
} }
this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer
this.activeName = `${tableInfo.Id}_${answer.RowIndex}` this.activeName = `${tableInfo.Id}_${answer.RowIndex}`
}, },
setAnnotation(obj) {
let annotation = Object.assign({}, obj.annotation)
if (this.activeName) {
//
let tableId = this.activeName.split('_')[0]
let rowIndex = this.activeName.split('_')[1]
let innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
if (innerForm.MeasureData) {
if (this.isBaseLineTask) {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.LesionType === 0
)
if (typeof targetTable !== 'object') return
if (targetTable.MaxQuestionCount && targetTable.TableQuestions.Answers.length < targetTable.MaxQuestionCount && (obj.toolName === 'Length' || obj.toolName === 'Bidirectional')) {
this.createTTarget(annotation)
} else {
this.createNTTarget(annotation)
}
} else {
this.createNLTarget(annotation)
}
} else {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.Id === tableId
)
if (typeof targetTable !== 'object') return
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation)
if (obj.toolName === 'Length') {
let referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
let lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
} else if (obj.toolName === 'Bidirectional') {
let referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
let lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
let shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], shortId, short)
}
let stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
let state = this.innerFormData[`${tableId}_${rowIndex}`][stateId]
// 线
if (this.isBaseLineTask && !state) {
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0)
}
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', innerForm.RowId ? 1 : 0)
this.$emit('setMarkName', {
annotationUID: annotation.annotationUID,
name: this.innerFormData[`${tableId}_${rowIndex}`].LesionName
}
)
}
} else {
if (this.isBaseLineTask) {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.LesionType === 0
)
if (typeof targetTable !== 'object') return
if (targetTable.MaxQuestionCount && targetTable.TableQuestions.Answers.length < targetTable.MaxQuestionCount && (obj.toolName === 'Length' || obj.toolName === 'Bidirectional')) {
this.createTTarget(annotation)
} else {
this.createNTTarget(annotation)
}
} else {
this.createNLTarget(annotation)
}
}
},
modifyAnnotation(obj) {
const {annotation, toolName} = obj
const formData = Object.values(this.innerFormData).find(
i => i.LesionName === annotation.data.label
)
if (typeof formData !== 'object') return
let tableId = formData.TableId
let rowIndex = formData.RowIndex
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.Id === formData.TableId
)
if (typeof targetTable !== 'object') return
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation)
if (toolName === 'Length') {
let referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
let lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
} else if (toolName === 'Bidirectional') {
let referencedImageId = annotation.metadata.referencedImageId
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
let lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionLength', length)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], lengthId, length)
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
let shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionShort', short)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], shortId, short)
}
let stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
let state = this.innerFormData[`${tableId}_${rowIndex}`][stateId]
// 线
if (this.isBaseLineTask && !state) {
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'LesionState', 0)
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], stateId, 0)
}
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'SaveTypeEnum', formData.RowId ? 1 : 0)
this.activeName = `${tableId}_${rowIndex}`
},
// //
createTTarget(annotation) { createTTarget(annotation) {
// //
@ -689,18 +692,18 @@ export default {
} }
) )
if (confirm !== 'confirm') return if (confirm !== 'confirm') return
let innerForm = this.innerFormData[`${table.Id}_${rowIndex}`] const innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
// //
let lengthId = this.getQuestionId(0, table.TableQuestions.Questions) const lengthId = this.getQuestionId(0, table.TableQuestions.Questions)
this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], lengthId, null) this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], lengthId, null)
this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'LesionLength', null) this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'LesionLength', null)
let shortId = this.getQuestionId(1, table.TableQuestions.Questions) const shortId = this.getQuestionId(1, table.TableQuestions.Questions)
this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], shortId, null) this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], shortId, null)
this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'LesionShort', null) this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'LesionShort', null)
let stateId = this.getQuestionId(7, table.TableQuestions.Questions) const stateId = this.getQuestionId(7, table.TableQuestions.Questions)
this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], stateId, null) this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], stateId, null)
this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'LesionState', null) this.$set(this.innerFormData[`${table.Id}_${rowIndex}`], 'LesionState', null)
let obj = Object.assign({}, innerForm.MeasureData) const obj = Object.assign({}, innerForm.MeasureData)
// //
this.$emit('removeAnnotation', obj) this.$emit('removeAnnotation', obj)
// //
@ -720,9 +723,9 @@ export default {
} }
) )
if (confirm !== 'confirm') return if (confirm !== 'confirm') return
let innerForm = this.innerFormData[`${table.Id}_${rowIndex}`] const innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
if (innerForm.RowId) { if (innerForm.RowId) {
let param = { const param = {
visitTaskId: this.visitTaskId, visitTaskId: this.visitTaskId,
questionId: table.Id, questionId: table.Id,
rowId: innerForm.RowId rowId: innerForm.RowId
@ -731,7 +734,7 @@ export default {
if (res.IsSuccess) { if (res.IsSuccess) {
if (innerForm.MeasureData) { if (innerForm.MeasureData) {
// //
let obj = Object.assign({}, innerForm.MeasureData) const obj = Object.assign({}, innerForm.MeasureData)
this.$emit('removeAnnotation', obj) this.$emit('removeAnnotation', obj)
} }
// //
@ -744,7 +747,7 @@ export default {
} else { } else {
if (innerForm.MeasureData) { if (innerForm.MeasureData) {
// //
let obj = Object.assign({}, innerForm.MeasureData) const obj = Object.assign({}, innerForm.MeasureData)
this.$emit('removeAnnotation', obj) this.$emit('removeAnnotation', obj)
} }
// //
@ -763,13 +766,14 @@ export default {
const valid = await this.$refs[`${table.Id}_${rowIndex}`][0].validate() const valid = await this.$refs[`${table.Id}_${rowIndex}`][0].validate()
if (!valid) return if (!valid) return
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
let innerForm = this.innerFormData[`${table.Id}_${rowIndex}`] const innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
let measureData = innerForm.MeasureData const measureData = innerForm.MeasureData
let lesionState = innerForm.LesionState const lesionState = innerForm.LesionState
let lesionLength = innerForm.LesionLength let lesionLength = innerForm.LesionLength
let lesionShort = innerForm.LesionShort let lesionShort = innerForm.LesionShort
let lymphNodes = innerForm.IsLymphNodes const lymphNodes = innerForm.IsLymphNodes
let lesionType = table.LesionType const lesionType = table.LesionType
const lesionPart = innerForm.LesionPart
if (this.isBaseLineTask) { if (this.isBaseLineTask) {
// 线 // 线
// 0 // 0
@ -873,7 +877,7 @@ export default {
loading.close() loading.close()
return return
} else if (measureData && measureData.markTool === 'ArrowAnnotate') { } else if (measureData && measureData.markTool === 'ArrowAnnotate') {
let shortId = this.getQuestionId(1, table.TableQuestions.Questions) const shortId = this.getQuestionId(1, table.TableQuestions.Questions)
this.$set(innerForm, shortId, 5) this.$set(innerForm, shortId, 5)
lesionShort = 5 lesionShort = 5
} }
@ -889,7 +893,7 @@ export default {
loading.close() loading.close()
return return
} else if (measureData && measureData.markTool === 'ArrowAnnotate') { } else if (measureData && measureData.markTool === 'ArrowAnnotate') {
let lengthId = this.getQuestionId(0, table.TableQuestions.Questions) const lengthId = this.getQuestionId(0, table.TableQuestions.Questions)
this.$set(this.questionForm, lengthId, 5) this.$set(this.questionForm, lengthId, 5)
lesionLength = 5 lesionLength = 5
} }
@ -950,7 +954,7 @@ export default {
loading.close() loading.close()
return return
} else if (measureData && measureData.markTool === 'ArrowAnnotate') { } else if (measureData && measureData.markTool === 'ArrowAnnotate') {
let lengthId = this.getQuestionId(0, table.TableQuestions.Questions) const lengthId = this.getQuestionId(0, table.TableQuestions.Questions)
this.$set(innerForm, lengthId, 0) this.$set(innerForm, lengthId, 0)
lesionLength = 0 lesionLength = 0
} }
@ -1190,17 +1194,17 @@ export default {
} }
} }
// //
let obj = Object.assign({}, measureData) const obj = Object.assign({}, measureData)
obj.visitTaskId = this.visitTaskId obj.visitTaskId = this.visitTaskId
obj.lesionName = innerForm.LesionName obj.lesionName = innerForm.LesionName
let picturePath = '' let picturePath = ''
if (measureData) { if (measureData) {
const base64Str = await this.getScreenshots(obj) const base64Str = await this.getScreenshots(obj)
let pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, base64Str) const pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, base64Str)
picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : '' picturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
} }
let answers = [] const answers = []
let reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/) const reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/)
for (const k in innerForm) { for (const k in innerForm) {
if (reg.test(k)) { if (reg.test(k)) {
if (answers.findIndex(i => i.tableQuestionId === k) === -1) { if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
@ -1208,7 +1212,7 @@ export default {
} }
} }
} }
let params = { const params = {
questionId: table.Id, questionId: table.Id,
rowId: innerForm.RowId, rowId: innerForm.RowId,
rowIndex: innerForm.RowIndex, rowIndex: innerForm.RowIndex,
@ -1227,7 +1231,6 @@ export default {
isDicomReading: innerForm.IsDicomReading isDicomReading: innerForm.IsDicomReading
} }
if (this.deleteTargetInfo && this.deleteTargetInfo.newLesionName === innerForm.LesionName) { if (this.deleteTargetInfo && this.deleteTargetInfo.newLesionName === innerForm.LesionName) {
await deleteReadingRowAnswer({ await deleteReadingRowAnswer({
visitTaskId: this.visitTaskId, visitTaskId: this.visitTaskId,
questionId: this.deleteTargetInfo.tableId, questionId: this.deleteTargetInfo.tableId,
@ -1249,8 +1252,8 @@ export default {
async uploadScreenshots(fileName, file) { async uploadScreenshots(fileName, file) {
try { try {
file = this.convertBase64ToBlob(file) file = this.convertBase64ToBlob(file)
let trialId = this.$route.query.trialId const trialId = this.$route.query.trialId
let subjectId = this.taskInfo.SubjectId const subjectId = this.taskInfo.SubjectId
const result = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${fileName}.png`, file) const result = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${fileName}.png`, file)
return { isSuccess: true, result: result } return { isSuccess: true, result: result }
} catch (e) { } catch (e) {
@ -1259,7 +1262,7 @@ export default {
} }
}, },
convertBase64ToBlob(imageEditorBase64) { convertBase64ToBlob(imageEditorBase64) {
let base64Arr = imageEditorBase64.split(',') const base64Arr = imageEditorBase64.split(',')
let imgtype = '' let imgtype = ''
let base64String = '' let base64String = ''
if (base64Arr.length > 1) { if (base64Arr.length > 1) {
@ -1269,9 +1272,9 @@ export default {
base64Arr[0].indexOf(';') base64Arr[0].indexOf(';')
) )
} }
let bytes = atob(base64String) const bytes = atob(base64String)
let bytesCode = new ArrayBuffer(bytes.length) const bytesCode = new ArrayBuffer(bytes.length)
let byteArray = new Uint8Array(bytesCode) const byteArray = new Uint8Array(bytesCode)
for (let i = 0; i < bytes.length; i++) { for (let i = 0; i < bytes.length; i++) {
byteArray[i] = bytes.charCodeAt(i) byteArray[i] = bytes.charCodeAt(i)
} }
@ -1281,15 +1284,15 @@ export default {
getScreenshots(obj) { getScreenshots(obj) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
obj.visitTaskId = this.visitTaskId obj.visitTaskId = this.visitTaskId
this.$emit('getScreenshots', obj, resolve); // resolve this.$emit('getScreenshots', obj, resolve) // resolve
}); })
}, },
// //
innerFormDataUpdate(obj) { innerFormDataUpdate(obj) {
let innerForm = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`] const innerForm = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`]
if (innerForm === undefined || typeof innerForm !== 'object') return if (innerForm === undefined || typeof innerForm !== 'object') return
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], obj.questionId, obj.val) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], obj.questionId, obj.val)
// QuestionMark0--1--2--7--8-- // QuestionMark0--1--2--5--7--8--
if (obj.questionMark === 0) { if (obj.questionMark === 0) {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionLength', obj.val) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionLength', obj.val)
} }
@ -1304,35 +1307,41 @@ export default {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionPart', obj.val) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionPart', obj.val)
} }
if (obj.updateArr) { if (obj.updateArr) {
obj.updateArr.forEach(i=>{ obj.updateArr.forEach(i => {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], i.questionId, i.val) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], i.questionId, i.val)
if (i.questionMark === 2) { if (i.questionMark === 2) {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'IsLymphNodes', i.val) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'IsLymphNodes', i.val)
} else if (i.questionMark === 5) {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionOrgan', i.val)
if (innerForm.LesionType === 2) {
this.setNewTargetState(obj.tableId, obj.rowIndex)
}
} }
}) })
} }
let rowId = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`].RowId
const rowId = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`].RowId
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'SaveTypeEnum', rowId ? 1 : 0) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'SaveTypeEnum', rowId ? 1 : 0)
}, },
handleCollapseChange(v) { handleCollapseChange(v) {
if (!v) return if (!v) return
let tableId = v.split('_')[0] const tableId = v.split('_')[0]
let rowIndex = v.split('_')[1] const rowIndex = v.split('_')[1]
let innerForm = this.innerFormData[`${tableId}_${rowIndex}`] const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
// if (!innerForm.MeasureData) return // if (!innerForm.MeasureData) return
let obj = Object.assign({visitTaskId: this.visitTaskId}, innerForm.MeasureData) const obj = Object.assign({ visitTaskId: this.visitTaskId }, innerForm.MeasureData)
obj.lesionName = innerForm.LesionName obj.lesionName = innerForm.LesionName
obj.markTool = innerForm.MarkTool ? innerForm.MarkTool : '' obj.markTool = innerForm.MarkTool ? innerForm.MarkTool : ''
obj.isMarked = innerForm.MeasureData ? true : false obj.isMarked = !!innerForm.MeasureData
if (this.visitTaskId === this.taskInfo.VisitTaskId) { if (this.visitTaskId === this.taskInfo.VisitTaskId) {
obj.isActiveTarget = true obj.isActiveTarget = true
} }
this.$emit('imageLocation', obj) this.$emit('imageLocation', obj)
}, },
collapseRightClick(e, tableId, rowIndex) { collapseRightClick(e, tableId, rowIndex) {
let innerForm = this.innerFormData[`${tableId}_${rowIndex}`] const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
if (!innerForm.MeasureData) return if (!innerForm.MeasureData) return
let obj = Object.assign({visitTaskId: this.visitTaskId}, innerForm.MeasureData) const obj = Object.assign({ visitTaskId: this.visitTaskId }, innerForm.MeasureData)
obj.lesionName = innerForm.LesionName obj.lesionName = innerForm.LesionName
this.$emit('imageLocation', obj) this.$emit('imageLocation', obj)
e.stopImmediatePropagation() e.stopImmediatePropagation()
@ -1345,7 +1354,7 @@ export default {
// //
const obj = Object.values(this.innerFormData).find( const obj = Object.values(this.innerFormData).find(
obj => !obj.RowId obj => !obj.RowId
); )
if (obj !== undefined && typeof obj === 'object') { if (obj !== undefined && typeof obj === 'object') {
let msg = this.$t('trials:reading:warnning:msg5') let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', obj.LesionName) msg = msg.replace('xxx', obj.LesionName)
@ -1367,10 +1376,9 @@ export default {
console.log(confirm) console.log(confirm)
if (confirm !== 'confirm') return if (confirm !== 'confirm') return
this.split(tableId, rowId) this.split(tableId, rowId)
} catch(e) { } catch (e) {
console.log(e) console.log(e)
} }
}, },
async split(tableId, rowId) { async split(tableId, rowId) {
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
@ -1417,19 +1425,19 @@ export default {
}, },
getMaxRowIndex(answers) { getMaxRowIndex(answers) {
if (answers.length > 0) { if (answers.length > 0) {
let arr = [] const arr = []
answers.forEach(item => { answers.forEach(item => {
var rowIndex = item.RowIndex var rowIndex = item.RowIndex
arr.push(parseInt(rowIndex)) arr.push(parseInt(rowIndex))
}) })
let max = Math.max.apply(null, arr) const max = Math.max.apply(null, arr)
return max return max
} else { } else {
return 0 return 0
} }
}, },
getQuestionId(questionMark, tableQuestions) { getQuestionId(questionMark, tableQuestions) {
let idx = tableQuestions.findIndex(i => i.QuestionMark === questionMark) const idx = tableQuestions.findIndex(i => i.QuestionMark === questionMark)
if (idx > -1) { if (idx > -1) {
return tableQuestions[idx].Id return tableQuestions[idx].Id
} else { } else {
@ -1439,8 +1447,8 @@ export default {
// //
getLesionName(orderMark, rowIndex) { getLesionName(orderMark, rowIndex) {
let lessionName = '' let lessionName = ''
let rowIndexArr = rowIndex.split('.') const rowIndexArr = rowIndex.split('.')
let x = parseInt(rowIndexArr[0]) const x = parseInt(rowIndexArr[0])
let y = parseInt(rowIndexArr[1]) let y = parseInt(rowIndexArr[1])
if (y > 0) { if (y > 0) {
y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32) y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32)
@ -1482,11 +1490,11 @@ export default {
}, },
// //
lesionTypeChange(obj) { lesionTypeChange(obj) {
let innerForm = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`] const innerForm = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`]
// //
const formData = Object.values(this.innerFormData).find( const formData = Object.values(this.innerFormData).find(
obj => !obj.RowId && obj.LesionName !== innerForm.LesionName obj => !obj.RowId && obj.LesionName !== innerForm.LesionName
); )
if (formData !== undefined && typeof formData === 'object') { if (formData !== undefined && typeof formData === 'object') {
let msg = this.$t('trials:reading:warnning:msg5') let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', formData.LesionName) msg = msg.replace('xxx', formData.LesionName)
@ -1502,7 +1510,7 @@ export default {
const targetTable = this.tableQuestions[0].Childrens.find( const targetTable = this.tableQuestions[0].Childrens.find(
child => child.LesionType === obj.newLesionType child => child.LesionType === obj.newLesionType
); )
if (typeof targetTable !== 'object') return if (typeof targetTable !== 'object') return
// //
if (!!targetTable.MaxQuestionCount && targetTable.MaxQuestionCount <= targetTable.TableQuestions.Answers.length) { if (!!targetTable.MaxQuestionCount && targetTable.MaxQuestionCount <= targetTable.TableQuestions.Answers.length) {
@ -1527,13 +1535,13 @@ export default {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionType', innerForm.LesionType) this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionType', innerForm.LesionType)
return return
} }
// //
this.removeAnswer(obj.tableId, obj.rowIndex) this.removeAnswer(obj.tableId, obj.rowIndex)
delete this.innerFormData[`${obj.tableId}_${obj.rowIndex}`] delete this.innerFormData[`${obj.tableId}_${obj.rowIndex}`]
// //
let answer = Object.assign({},this.innerFormData[targetTable.Id]) const answer = Object.assign({}, this.innerFormData[targetTable.Id])
answer.RowId = '' answer.RowId = ''
let maxIndex = this.getMaxRowIndex(targetTable.TableQuestions.Answers) const maxIndex = this.getMaxRowIndex(targetTable.TableQuestions.Answers)
answer.RowIndex = `${maxIndex + 1}.00` answer.RowIndex = `${maxIndex + 1}.00`
answer.IsDicomReading = true answer.IsDicomReading = true
answer.SaveTypeEnum = 0 answer.SaveTypeEnum = 0
@ -1551,20 +1559,19 @@ export default {
let lesionShort = null let lesionShort = null
if (innerForm.MeasureData) { if (innerForm.MeasureData) {
// //
lesionLength = innerForm.LesionLength ? innerForm.LesionLength : null lesionLength = innerForm.LesionLength ? innerForm.LesionLength : null
lesionShort = innerForm.LesionShort ? innerForm.LesionShort : null lesionShort = innerForm.LesionShort ? innerForm.LesionShort : null
this.$emit('setMarkName', { this.$emit('setMarkName', {
annotationUID: innerForm.MeasureData.annotationUID, annotationUID: innerForm.MeasureData.annotationUID,
name: answer.LesionName name: answer.LesionName
}) })
answer.MeasureData = innerForm.MeasureData answer.MeasureData = innerForm.MeasureData
} }
let lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions) const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
answer[lengthId] = lesionLength answer[lengthId] = lesionLength
let shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions) const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
answer[shortId] = lesionShort answer[shortId] = lesionShort
let stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions) const stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
answer[stateId] = state answer[stateId] = state
targetTable.TableQuestions.Answers.push(answer) targetTable.TableQuestions.Answers.push(answer)
this.innerFormData[`${targetTable.Id}_${answer.RowIndex}`] = answer this.innerFormData[`${targetTable.Id}_${answer.RowIndex}`] = answer
@ -1575,7 +1582,7 @@ export default {
} }
}, },
async closeInnerForm(obj) { async closeInnerForm(obj) {
let innerForm = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`] const innerForm = this.innerFormData[`${obj.tableId}_${obj.rowIndex}`]
if (innerForm === undefined || typeof innerForm !== 'object') return if (innerForm === undefined || typeof innerForm !== 'object') return
if (!innerForm.RowId) { if (!innerForm.RowId) {
// //
@ -1592,7 +1599,7 @@ export default {
delete this.innerFormData[`${obj.tableId}_${obj.rowIndex}`] delete this.innerFormData[`${obj.tableId}_${obj.rowIndex}`]
// //
if (innerForm.MeasureData) { if (innerForm.MeasureData) {
let obj = Object.assign({}, innerForm.MeasureData) const obj = Object.assign({}, innerForm.MeasureData)
this.$emit('removeAnnotation', obj) this.$emit('removeAnnotation', obj)
} }
// //
@ -1603,19 +1610,19 @@ export default {
} }
}, },
changeLesionState(state) { changeLesionState(state) {
Object.values(this.innerFormData).forEach(i=>{ Object.values(this.innerFormData).forEach(i => {
console.log(i) console.log(i)
}) })
}, },
removeAnswer(tableId, rowIndex) { removeAnswer(tableId, rowIndex) {
const targetTable = this.tableQuestions[0].Childrens.find( const targetTable = this.tableQuestions[0].Childrens.find(
child => child.Id === tableId child => child.Id === tableId
); )
if (targetTable?.TableQuestions?.Answers) { if (targetTable?.TableQuestions?.Answers) {
const originalAnswers = targetTable.TableQuestions.Answers; const originalAnswers = targetTable.TableQuestions.Answers
const index = originalAnswers.findIndex(item => item.RowIndex === rowIndex); const index = originalAnswers.findIndex(item => item.RowIndex === rowIndex)
if (index > -1) { if (index > -1) {
targetTable.TableQuestions.Answers.splice(index, 1); targetTable.TableQuestions.Answers.splice(index, 1)
} }
} }
}, },
@ -1625,9 +1632,9 @@ export default {
) )
if (typeof obj === 'object') { if (typeof obj === 'object') {
if (this.activeName) { if (this.activeName) {
let tableId = this.activeName.split('_')[0] const tableId = this.activeName.split('_')[0]
let rowIndex = this.activeName.split('_')[1] const rowIndex = this.activeName.split('_')[1]
let innerForm = this.innerFormData[`${tableId}_${rowIndex}`] const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
if (!innerForm.MeasureData) { if (!innerForm.MeasureData) {
return this.checkToolCanActive(toolName) return this.checkToolCanActive(toolName)
} else { } else {
@ -1638,9 +1645,9 @@ export default {
} }
} else { } else {
let msg = this.$t('trials:reading:warnning:msg5') let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', obj.LesionName) msg = msg.replace('xxx', obj.LesionName)
// `xxx` // `xxx`
return { isCanActiveTool: false, reason: msg } return { isCanActiveTool: false, reason: msg }
} }
} else { } else {
if (this.activeName) { if (this.activeName) {
@ -1659,10 +1666,10 @@ export default {
} }
}, },
checkToolCanActive(toolName) { checkToolCanActive(toolName) {
let tableId = this.activeName.split('_')[0] const tableId = this.activeName.split('_')[0]
let rowIndex = this.activeName.split('_')[1] const rowIndex = this.activeName.split('_')[1]
let innerForm = this.innerFormData[`${tableId}_${rowIndex}`] const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
let isLymphNodes = innerForm.IsLymphNodes const isLymphNodes = innerForm.IsLymphNodes
if (!innerForm.MeasureData) { if (!innerForm.MeasureData) {
if (this.isBaseLineTask) { if (this.isBaseLineTask) {
if (innerForm.LesionType === 0 && isLymphNodes === 1 && toolName !== 'Bidirectional') { if (innerForm.LesionType === 0 && isLymphNodes === 1 && toolName !== 'Bidirectional') {

View File

@ -1,14 +1,14 @@
<template> <template>
<div class="table-question-form"> <div class="table-question-form">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<h3 v-if="questionForm.LesionName" style="color: #ddd;padding: 5px 0px;margin: 0;"> <h3 v-if="qsForm.LesionName" style="color: #ddd;padding: 5px 0px;margin: 0;">
{{ questionForm.LesionName }} {{ qsForm.LesionName }}
</h3> </h3>
<!-- 关闭 --> <!-- 关闭 -->
<div> <div>
<i class="el-icon-circle-close" style="font-size: 25px;cursor: pointer;" @click="close" /> <i class="el-icon-circle-close" style="font-size: 25px;cursor: pointer;" @click="close" />
</div>
</div> </div>
</div>
<el-form-item <el-form-item
:label="$t('trials:reading:title:lesionType')" :label="$t('trials:reading:title:lesionType')"
prop="LesionType" prop="LesionType"
@ -18,7 +18,7 @@
> >
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select <el-select
v-model="questionForm.LesionType" v-model="qsForm.LesionType"
filterable filterable
:disabled="!isCurrentTask || readingTaskState>=2 || !isBaseLineTask" :disabled="!isCurrentTask || readingTaskState>=2 || !isBaseLineTask"
@change="((val)=>{lesionTypeChange(val)})" @change="((val)=>{lesionTypeChange(val)})"
@ -47,9 +47,10 @@
> >
<!-- 输入框 --> <!-- 输入框 -->
<template v-if="qs.Type==='input' || qs.Type==='number'"> <template v-if="qs.Type==='input' || qs.Type==='number'">
<el-input <el-input
v-if="qs.Type==='input' || qs.Type==='number'" v-if="qs.Type==='input' || qs.Type==='number'"
v-model="questionForm[qs.Id]" v-model="qsForm[qs.Id]"
:disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 0 || qs.QuestionMark === 1 || qs.QuestionMark === 2 || qs.QuestionMark === 5 || (qs.QuestionMark === 6 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answer.SplitOrMergeLesionName))|| (qs.QuestionMark === 8 && (isCurrentTaskAdd === 'False' || !!answer.SplitOrMergeLesionName) && lesionType !== 2) || (qs.QuestionMark === 10 && (isCurrentTaskAdd === 'False' || !!answer.SplitOrMergeLesionName))" :disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 0 || qs.QuestionMark === 1 || qs.QuestionMark === 2 || qs.QuestionMark === 5 || (qs.QuestionMark === 6 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answer.SplitOrMergeLesionName))|| (qs.QuestionMark === 8 && (isCurrentTaskAdd === 'False' || !!answer.SplitOrMergeLesionName) && lesionType !== 2) || (qs.QuestionMark === 10 && (isCurrentTaskAdd === 'False' || !!answer.SplitOrMergeLesionName))"
@change="((val)=>{formItemChange(val, qs)})" @change="((val)=>{formItemChange(val, qs)})"
> >
@ -61,7 +62,7 @@
<!-- 多行文本输入框 --> <!-- 多行文本输入框 -->
<el-input <el-input
v-if="qs.Type==='textarea'" v-if="qs.Type==='textarea'"
v-model="questionForm[qs.Id]" v-model="qsForm[qs.Id]"
type="textarea" type="textarea"
:autosize="{ minRows: 2, maxRows: 4}" :autosize="{ minRows: 2, maxRows: 4}"
:disabled="!isCurrentTask || readingTaskState>=2" :disabled="!isCurrentTask || readingTaskState>=2"
@ -70,7 +71,7 @@
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select <el-select
v-if="qs.Type==='select'" v-if="qs.Type==='select'"
v-model="questionForm[qs.Id]" v-model="qsForm[qs.Id]"
filterable filterable
:placeholder="qs.QuestionMark === 8 ? $t('common:placeholder:selectorsearch') : qs.QuestionMark === 2 ? '' : $t('common:placeholder:select')" :placeholder="qs.QuestionMark === 8 ? $t('common:placeholder:selectorsearch') : qs.QuestionMark === 2 ? '' : $t('common:placeholder:select')"
:disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 0 || qs.QuestionMark === 1 || qs.QuestionMark === 2 || qs.QuestionMark === 5 || (qs.QuestionMark === 6 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answer.SplitOrMergeLesionName))|| (qs.QuestionMark === 8 && (isCurrentTaskAdd === 'False'|| !!answer.SplitOrMergeLesionName)) || (qs.QuestionMark === 10 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answer.SplitOrMergeLesionName))" :disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 0 || qs.QuestionMark === 1 || qs.QuestionMark === 2 || qs.QuestionMark === 5 || (qs.QuestionMark === 6 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answer.SplitOrMergeLesionName))|| (qs.QuestionMark === 8 && (isCurrentTaskAdd === 'False'|| !!answer.SplitOrMergeLesionName)) || (qs.QuestionMark === 10 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answer.SplitOrMergeLesionName))"
@ -154,7 +155,7 @@
<!-- 单选 --> <!-- 单选 -->
<el-radio-group <el-radio-group
v-if="qs.Type==='radio'" v-if="qs.Type==='radio'"
v-model="questionForm[qs.id]" v-model="qsForm[qs.id]"
:disabled="!isCurrentTask || readingTaskState>=2" :disabled="!isCurrentTask || readingTaskState>=2"
> >
<el-radio <el-radio
@ -209,13 +210,22 @@ export default {
required: true required: true
} }
}, },
data() {
return {
isCurrentTaskAdd: null,
lesionType: null,
questions: [],
organList: [],
qsForm: {}
}
},
watch: { watch: {
questionForm: { questionForm: {
deep: true, deep: true,
immediate: true, immediate: true,
handler(v) { handler(v) {
if (v.MeasureData) { if (v.MeasureData) {
const {markTool} = v.MeasureData const { markTool } = v.MeasureData
if (markTool === 'Bidirectional') { if (markTool === 'Bidirectional') {
this.getOrganList(1) this.getOrganList(1)
} else if (markTool === 'Length') { } else if (markTool === 'Length') {
@ -226,6 +236,9 @@ export default {
} else { } else {
this.getOrganList() this.getOrganList()
} }
for (const key in v) {
this.$set(this.qsForm, key, v[key])
}
this.isCurrentTaskAdd = v.IsCurrentTaskAdd this.isCurrentTaskAdd = v.IsCurrentTaskAdd
} }
}, },
@ -238,45 +251,37 @@ export default {
this.questions = v.TableQuestions.Questions this.questions = v.TableQuestions.Questions
} }
} }
},
},
data(){
return{
isCurrentTaskAdd: null,
lesionType: null,
questions: [],
organList: []
} }
}, },
methods: { methods: {
lesionTypeChange(v) { lesionTypeChange(v) {
this.$emit('lesionTypeChange', {tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex, newLesionType: v}) this.$emit('lesionTypeChange', { tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex, newLesionType: v })
}, },
formItemChange(v, qs) { formItemChange(v, qs) {
let updateArr = [] const updateArr = []
if (qs.QuestionMark === 8 && qs.RelationQuestions.length > 0) { if (qs.QuestionMark === 8 && qs.RelationQuestions.length > 0) {
// //
let index = this.organList.findIndex(item => item[qs.DataTableColumn] === v) const index = this.organList.findIndex(item => item[qs.DataTableColumn] === v)
if (index > -1) { if (index > -1) {
let selected = this.organList[index] const selected = this.organList[index]
qs.RelationQuestions.map(q => { qs.RelationQuestions.map(q => {
let val = selected[q.DataTableColumn] const val = selected[q.DataTableColumn]
updateArr.push({questionId: q.Id, val: val, questionMark: q.QuestionMark}) updateArr.push({ questionId: q.Id, val: val, questionMark: q.QuestionMark })
}) })
updateArr.push({questionId: 'OrganInfoId', val: selected.OrganInfoId}) updateArr.push({ questionId: 'OrganInfoId', val: selected.OrganInfoId })
updateArr.push({questionId: 'IsCanEditPosition', val: selected.IsCanEditPosition}) updateArr.push({ questionId: 'IsCanEditPosition', val: selected.IsCanEditPosition })
} else { } else {
question.RelationQuestions.map(q => { qs.RelationQuestions.map(q => {
updateArr.push({questionId: q.Id, val: '', questionMark: q.QuestionMark}) updateArr.push({ questionId: q.Id, val: '', questionMark: q.QuestionMark })
}) })
} }
} }
this.$emit('update', {tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex, questionMark: qs.QuestionMark, questionId: qs.Id, val: v, updateArr}) this.$emit('update', { tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex, questionMark: qs.QuestionMark, questionId: qs.Id, val: v, updateArr })
}, },
getOrganList(isLymphNodes = null) { getOrganList(isLymphNodes = null) {
let idx = this.organs.findIndex(i => i.LesionType === this.questionForm.LesionType) const idx = this.organs.findIndex(i => i.LesionType === this.questionForm.LesionType)
if (idx > -1) { if (idx > -1) {
let arr = this.organs[idx].OrganList const arr = this.organs[idx].OrganList
if (!isNaN(parseInt(isLymphNodes))) { if (!isNaN(parseInt(isLymphNodes))) {
this.organList = arr.filter((item) => item.IsLymphNodes === parseInt(isLymphNodes)) this.organList = arr.filter((item) => item.IsLymphNodes === parseInt(isLymphNodes))
@ -305,7 +310,7 @@ export default {
} }
}, },
close() { close() {
this.$emit('close', {tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex}) this.$emit('close', { tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex })
} }
} }
} }