@@ -84,14 +86,14 @@
@contextmenu.prevent.native="collapseRightClick($event, table.Id, answer.RowIndex)"
>
-
{{ getLesionName(table.OrderMark,answer.RowIndex) }}
-
+
@@ -143,13 +145,13 @@
:model="innerFormData[`${table.Id}_${answer.RowIndex}`]"
>
{
+ this.$nextTick(() => {
this.activeName = ''
this.getOuterQuestions()
this.getTableQuestions()
@@ -272,22 +274,22 @@ export default {
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
this.isBaseLineTask = this.taskInfo.IsBaseLine
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.getOrganList()
},
- methods:{
+ methods: {
// 获取器官信息
async getOrganList() {
try {
- let params = {
+ const params = {
visitTaskId: this.visitTaskId
}
- let res = await getReadingOrganList(params)
+ const res = await getReadingOrganList(params)
if (res.IsSuccess) {
this.organs = res.Result
}
- } catch(e) {
+ } catch (e) {
console.log(e)
}
},
@@ -295,17 +297,17 @@ export default {
async getOuterQuestions() {
const loading = this.$loading({ fullscreen: true })
try {
- let params = {
+ const params = {
trialId: this.$route.query.trialId,
visitTaskId: this.visitTaskId
}
- let res = await getDicomReadingQuestionAnswer(params)
+ const res = await getDicomReadingQuestionAnswer(params)
if (res.IsSuccess) {
this.outerQuestions = res.Result
this.outerForm = this.getOuterFormData(this.outerQuestions)
}
loading.close()
- } catch(e) {
+ } catch (e) {
console.log(e)
loading.close()
}
@@ -321,7 +323,7 @@ export default {
}
if (item.QuestionType === 67) {
// 影像质量问题
- this.imageQualityIssuesId = v.Id
+ this.imageQualityIssuesId = item.Id
}
if (item.Childrens?.length) {
this.getOuterFormData(item.Childrens, formData)
@@ -337,18 +339,18 @@ export default {
this.isCurrentTask = this.taskInfo.VisitTaskId === this.visitTaskId
const loading = this.$loading({ fullscreen: true })
try {
- let params = {
+ const params = {
trialId: this.$route.query.trialId,
visitTaskId: this.visitTaskId
}
- let res = await getReadingQuestionAndAnswer(params)
+ const res = await getReadingQuestionAndAnswer(params)
if (res.IsSuccess) {
this.tableQuestions = res.Result.SinglePage
- res.Result.SinglePage.forEach(group=>{
- group.Childrens.forEach(table=>{
+ res.Result.SinglePage.forEach(group => {
+ group.Childrens.forEach(table => {
const tableKey = table.Id
this.$set(this.innerFormData, tableKey, {})
- table.TableQuestions.Questions.forEach(question=>{
+ table.TableQuestions.Questions.forEach(question => {
if (question.Type !== 'summary') {
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], 'LesionState', 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], 'MeasureData', null)
this.$set(this.innerFormData[tableKey], 'TableId', tableKey)
this.$set(this.innerFormData[tableKey], 'IsCurrentTaskAdd', 'True')
-
- // QuestionMark:0--长径;1--短径;2--是否淋巴结;7--状态;8--所在部位;
- let lengthId = this.getQuestionId(0, table.TableQuestions.Questions)
- let shortId = this.getQuestionId(1, table.TableQuestions.Questions)
- let lymphNodesId = this.getQuestionId(2, table.TableQuestions.Questions)
- let stateId = this.getQuestionId(7, table.TableQuestions.Questions)
- let partId = this.getQuestionId(8, table.TableQuestions.Questions)
- table.TableQuestions.Answers.forEach((answer, index)=>{
+
+ // QuestionMark:0--长径;1--短径;2--是否淋巴结;5--所在器官;7--状态;8--所在部位;
+ const lengthId = this.getQuestionId(0, table.TableQuestions.Questions)
+ const shortId = this.getQuestionId(1, table.TableQuestions.Questions)
+ const lymphNodesId = this.getQuestionId(2, table.TableQuestions.Questions)
+ const organId = this.getQuestionId(5, table.TableQuestions.Questions)
+ const stateId = this.getQuestionId(7, table.TableQuestions.Questions)
+ 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}`], 'LesionName', this.getLesionName(table.OrderMark, answer.RowIndex))
for (const key in answer) {
@@ -380,7 +384,7 @@ export default {
} else if (key === 'LesionType' || key === lymphNodesId || key === stateId) {
val = isNaN(parseInt(val)) ? null : parseInt(val)
} else if (key === 'IsCanEditPosition') {
- val = val === 'True' ? true : false
+ val = val === 'True'
}
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], key, val)
if (key === lengthId) {
@@ -394,6 +398,8 @@ export default {
this.$set(this.innerFormData[`${tableKey}_${answer.RowIndex}`], 'SaveTypeEnum', isNaN(parseInt(val)) ? 1 : 2)
} else if (key === partId) {
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) {
@@ -405,7 +411,7 @@ export default {
})
}
loading.close()
- } catch(e) {
+ } catch (e) {
console.log(e)
loading.close()
}
@@ -416,7 +422,7 @@ export default {
if (!valid) return
const loading = this.$loading({ fullscreen: true })
try {
- let answers = []
+ const answers = []
let imageQuality = null
for (const k in this.outerForm) {
answers.push({ id: k, answer: this.outerForm[k] })
@@ -424,12 +430,12 @@ export default {
imageQuality = this.outerForm[k]
}
}
- let params = {
+ const params = {
visitTaskId: this.visitTaskId,
answers: answers
}
- let res = await saveTaskQuestion(0, params)
+ const res = await saveTaskQuestion(0, params)
if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully'))
if (!this.isBaseLineTask && (this.criterionType === 1 || this.criterionType === 2 || this.criterionType === 3 || this.criterionType === 17)) {
@@ -445,17 +451,139 @@ export default {
}
}
loading.close()
- } catch(e) {
+ } catch (e) {
console.log(e)
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) {
// 判断是否存在未保存的病灶,否则不允许添加
const obj = Object.values(this.innerFormData).find(
obj => !obj.RowId
- );
+ )
if (obj !== undefined && typeof obj === 'object') {
let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', obj.LesionName)
@@ -478,10 +606,10 @@ export default {
})
return
}
- let answer = Object.assign({},this.innerFormData[tableInfo.Id])
+ const answer = Object.assign({}, this.innerFormData[tableInfo.Id])
answer.TableId = tableInfo.Id
answer.RowId = ''
- let maxIndex = this.getMaxRowIndex(tableInfo.TableQuestions.Answers)
+ const maxIndex = this.getMaxRowIndex(tableInfo.TableQuestions.Answers)
answer.RowIndex = `${maxIndex + 1}.00`
answer.IsDicomReading = true
answer.SaveTypeEnum = 0
@@ -494,166 +622,41 @@ export default {
if (this.isBaseLineTask && tableInfo.LesionType === 1) {
state = 0
}
- let stateId = this.getQuestionId(7, tableInfo.TableQuestions.Questions)
+ const stateId = this.getQuestionId(7, tableInfo.TableQuestions.Questions)
answer[stateId] = state
tableInfo.TableQuestions.Answers.push(answer)
if (typeof annotation === 'object') {
answer.MeasureData = annotation
if (annotation.metadata.toolName === 'Length') {
- let referencedImageId = annotation.metadata.referencedImageId
+ const 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, tableInfo.TableQuestions.Questions)
+ const lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions)
answer.LesionLength = length
answer[lengthId] = length
} else if (annotation.metadata.toolName === 'Bidirectional') {
- let referencedImageId = annotation.metadata.referencedImageId
+ const 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, tableInfo.TableQuestions.Questions)
+ const lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions)
answer.LesionLength = length
answer[lengthId] = length
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
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[shortId] = short
}
this.$emit('setMarkName', {
- annotationUID: annotation.annotationUID,
- name: answer.LesionName
- }
+ annotationUID: annotation.annotationUID,
+ name: answer.LesionName
+ }
)
}
this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer
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) {
// 靶病灶
@@ -689,18 +692,18 @@ export default {
}
)
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}`], '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}`], '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}`], 'LesionState', null)
- let obj = Object.assign({}, innerForm.MeasureData)
+ const obj = Object.assign({}, innerForm.MeasureData)
// 移除标注信息
this.$emit('removeAnnotation', obj)
// 重置标注信息
@@ -720,9 +723,9 @@ export default {
}
)
if (confirm !== 'confirm') return
- let innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
+ const innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
if (innerForm.RowId) {
- let param = {
+ const param = {
visitTaskId: this.visitTaskId,
questionId: table.Id,
rowId: innerForm.RowId
@@ -731,7 +734,7 @@ export default {
if (res.IsSuccess) {
if (innerForm.MeasureData) {
// 移除标注信息
- let obj = Object.assign({}, innerForm.MeasureData)
+ const obj = Object.assign({}, innerForm.MeasureData)
this.$emit('removeAnnotation', obj)
}
// 刷新表格问题
@@ -744,7 +747,7 @@ export default {
} else {
if (innerForm.MeasureData) {
// 移除标注信息
- let obj = Object.assign({}, innerForm.MeasureData)
+ const obj = Object.assign({}, innerForm.MeasureData)
this.$emit('removeAnnotation', obj)
}
// 移除病灶
@@ -763,13 +766,14 @@ export default {
const valid = await this.$refs[`${table.Id}_${rowIndex}`][0].validate()
if (!valid) return
const loading = this.$loading({ fullscreen: true })
- let innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
- let measureData = innerForm.MeasureData
- let lesionState = innerForm.LesionState
+ const innerForm = this.innerFormData[`${table.Id}_${rowIndex}`]
+ const measureData = innerForm.MeasureData
+ const lesionState = innerForm.LesionState
let lesionLength = innerForm.LesionLength
let lesionShort = innerForm.LesionShort
- let lymphNodes = innerForm.IsLymphNodes
- let lesionType = table.LesionType
+ const lymphNodes = innerForm.IsLymphNodes
+ const lesionType = table.LesionType
+ const lesionPart = innerForm.LesionPart
if (this.isBaseLineTask) {
// 基线
// 靶病灶且状态为存在(0)
@@ -873,7 +877,7 @@ export default {
loading.close()
return
} 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)
lesionShort = 5
}
@@ -889,7 +893,7 @@ export default {
loading.close()
return
} 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)
lesionLength = 5
}
@@ -950,7 +954,7 @@ export default {
loading.close()
return
} 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)
lesionLength = 0
}
@@ -1190,17 +1194,17 @@ export default {
}
}
// 获取截图
- let obj = Object.assign({}, measureData)
+ const obj = Object.assign({}, measureData)
obj.visitTaskId = this.visitTaskId
obj.lesionName = innerForm.LesionName
let picturePath = ''
if (measureData) {
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) : ''
}
- let 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 answers = []
+ 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) {
if (reg.test(k)) {
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
@@ -1208,7 +1212,7 @@ export default {
}
}
}
- let params = {
+ const params = {
questionId: table.Id,
rowId: innerForm.RowId,
rowIndex: innerForm.RowIndex,
@@ -1227,7 +1231,6 @@ export default {
isDicomReading: innerForm.IsDicomReading
}
if (this.deleteTargetInfo && this.deleteTargetInfo.newLesionName === innerForm.LesionName) {
-
await deleteReadingRowAnswer({
visitTaskId: this.visitTaskId,
questionId: this.deleteTargetInfo.tableId,
@@ -1249,8 +1252,8 @@ export default {
async uploadScreenshots(fileName, file) {
try {
file = this.convertBase64ToBlob(file)
- let trialId = this.$route.query.trialId
- let subjectId = this.taskInfo.SubjectId
+ const trialId = this.$route.query.trialId
+ const subjectId = this.taskInfo.SubjectId
const result = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${fileName}.png`, file)
return { isSuccess: true, result: result }
} catch (e) {
@@ -1259,7 +1262,7 @@ export default {
}
},
convertBase64ToBlob(imageEditorBase64) {
- let base64Arr = imageEditorBase64.split(',')
+ const base64Arr = imageEditorBase64.split(',')
let imgtype = ''
let base64String = ''
if (base64Arr.length > 1) {
@@ -1269,9 +1272,9 @@ export default {
base64Arr[0].indexOf(';')
)
}
- let bytes = atob(base64String)
- let bytesCode = new ArrayBuffer(bytes.length)
- let byteArray = new Uint8Array(bytesCode)
+ const bytes = atob(base64String)
+ const bytesCode = new ArrayBuffer(bytes.length)
+ const byteArray = new Uint8Array(bytesCode)
for (let i = 0; i < bytes.length; i++) {
byteArray[i] = bytes.charCodeAt(i)
}
@@ -1281,22 +1284,22 @@ export default {
getScreenshots(obj) {
return new Promise((resolve, reject) => {
obj.visitTaskId = this.visitTaskId
- this.$emit('getScreenshots', obj, resolve); // 将resolve传递给父组件
- });
+ this.$emit('getScreenshots', obj, resolve) // 将resolve传递给父组件
+ })
},
// 更新表格问题表单信息
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
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], obj.questionId, obj.val)
- // QuestionMark:0--长径;1--短径;2--是否淋巴结;7--状态;8--所在部位;
+ // QuestionMark:0--长径;1--短径;2--是否淋巴结;5--所在器官;7--状态;8--所在部位;
if (obj.questionMark === 0) {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionLength', obj.val)
}
if (obj.questionMark === 1) {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionShort', obj.val)
}
-
+
if (obj.questionMark === 7) {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionState', obj.val)
}
@@ -1304,35 +1307,41 @@ export default {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionPart', obj.val)
}
if (obj.updateArr) {
- obj.updateArr.forEach(i=>{
+ obj.updateArr.forEach(i => {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], i.questionId, i.val)
if (i.questionMark === 2) {
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)
},
handleCollapseChange(v) {
if (!v) return
- let tableId = v.split('_')[0]
- let rowIndex = v.split('_')[1]
- let innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
+ const tableId = v.split('_')[0]
+ const rowIndex = v.split('_')[1]
+ const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
// 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.markTool = innerForm.MarkTool ? innerForm.MarkTool : ''
- obj.isMarked = innerForm.MeasureData ? true : false
+ obj.isMarked = !!innerForm.MeasureData
if (this.visitTaskId === this.taskInfo.VisitTaskId) {
obj.isActiveTarget = true
}
this.$emit('imageLocation', obj)
},
collapseRightClick(e, tableId, rowIndex) {
- let innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
+ const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
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
this.$emit('imageLocation', obj)
e.stopImmediatePropagation()
@@ -1345,7 +1354,7 @@ export default {
// 判断是否有病灶未保存
const obj = Object.values(this.innerFormData).find(
obj => !obj.RowId
- );
+ )
if (obj !== undefined && typeof obj === 'object') {
let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', obj.LesionName)
@@ -1367,10 +1376,9 @@ export default {
console.log(confirm)
if (confirm !== 'confirm') return
this.split(tableId, rowId)
- } catch(e) {
+ } catch (e) {
console.log(e)
}
-
},
async split(tableId, rowId) {
const loading = this.$loading({ fullscreen: true })
@@ -1417,19 +1425,19 @@ export default {
},
getMaxRowIndex(answers) {
if (answers.length > 0) {
- let arr = []
+ const arr = []
answers.forEach(item => {
var rowIndex = item.RowIndex
arr.push(parseInt(rowIndex))
})
- let max = Math.max.apply(null, arr)
+ const max = Math.max.apply(null, arr)
return max
} else {
return 0
}
},
getQuestionId(questionMark, tableQuestions) {
- let idx = tableQuestions.findIndex(i => i.QuestionMark === questionMark)
+ const idx = tableQuestions.findIndex(i => i.QuestionMark === questionMark)
if (idx > -1) {
return tableQuestions[idx].Id
} else {
@@ -1439,8 +1447,8 @@ export default {
// 获取病灶名称
getLesionName(orderMark, rowIndex) {
let lessionName = ''
- let rowIndexArr = rowIndex.split('.')
- let x = parseInt(rowIndexArr[0])
+ const rowIndexArr = rowIndex.split('.')
+ const x = parseInt(rowIndexArr[0])
let y = parseInt(rowIndexArr[1])
if (y > 0) {
y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32)
@@ -1482,11 +1490,11 @@ export default {
},
// 病灶类型切换
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(
obj => !obj.RowId && obj.LesionName !== innerForm.LesionName
- );
+ )
if (formData !== undefined && typeof formData === 'object') {
let msg = this.$t('trials:reading:warnning:msg5')
msg = msg.replace('xxx', formData.LesionName)
@@ -1499,10 +1507,10 @@ export default {
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'LesionType', innerForm.LesionType)
return
}
-
+
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.LesionType === obj.newLesionType
- );
+ )
if (typeof targetTable !== 'object') return
// 判断当前病灶类型下的病灶个数是否超过最大行数,否则不允许添加
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)
return
}
- //移除当前病灶
+ // 移除当前病灶
this.removeAnswer(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 = ''
- let maxIndex = this.getMaxRowIndex(targetTable.TableQuestions.Answers)
+ const maxIndex = this.getMaxRowIndex(targetTable.TableQuestions.Answers)
answer.RowIndex = `${maxIndex + 1}.00`
answer.IsDicomReading = true
answer.SaveTypeEnum = 0
@@ -1551,31 +1559,30 @@ export default {
let lesionShort = null
if (innerForm.MeasureData) {
// 有标记时保留标记(标记需要修改标注名称)、短径、长径的值
- lesionLength = innerForm.LesionLength ? innerForm.LesionLength : null
- lesionShort = innerForm.LesionShort ? innerForm.LesionShort : null
+ lesionLength = innerForm.LesionLength ? innerForm.LesionLength : null
+ lesionShort = innerForm.LesionShort ? innerForm.LesionShort : null
this.$emit('setMarkName', {
- annotationUID: innerForm.MeasureData.annotationUID,
+ annotationUID: innerForm.MeasureData.annotationUID,
name: answer.LesionName
})
answer.MeasureData = innerForm.MeasureData
-
}
- let lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
+ const lengthId = this.getQuestionId(0, targetTable.TableQuestions.Questions)
answer[lengthId] = lesionLength
- let shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
+ const shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
answer[shortId] = lesionShort
- let stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
+ const stateId = this.getQuestionId(7, targetTable.TableQuestions.Questions)
answer[stateId] = state
targetTable.TableQuestions.Answers.push(answer)
this.innerFormData[`${targetTable.Id}_${answer.RowIndex}`] = answer
this.activeName = `${targetTable.Id}_${answer.RowIndex}`
-
+
if (innerForm.RowId) {
this.deleteTargetInfo = { rowId: innerForm.RowId, tableId: obj.tableId, newLesionName: answer.LesionName }
}
},
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.RowId) {
// 当前病灶为新建病灶,未保存。如果关闭窗口,将会删除病灶信息,是否继续?
@@ -1592,7 +1599,7 @@ export default {
delete this.innerFormData[`${obj.tableId}_${obj.rowIndex}`]
// 移除标注信息
if (innerForm.MeasureData) {
- let obj = Object.assign({}, innerForm.MeasureData)
+ const obj = Object.assign({}, innerForm.MeasureData)
this.$emit('removeAnnotation', obj)
}
// 关闭窗口
@@ -1603,19 +1610,19 @@ export default {
}
},
changeLesionState(state) {
- Object.values(this.innerFormData).forEach(i=>{
+ Object.values(this.innerFormData).forEach(i => {
console.log(i)
})
},
removeAnswer(tableId, rowIndex) {
const targetTable = this.tableQuestions[0].Childrens.find(
child => child.Id === tableId
- );
+ )
if (targetTable?.TableQuestions?.Answers) {
- const originalAnswers = targetTable.TableQuestions.Answers;
- const index = originalAnswers.findIndex(item => item.RowIndex === rowIndex);
+ const originalAnswers = targetTable.TableQuestions.Answers
+ const index = originalAnswers.findIndex(item => item.RowIndex === rowIndex)
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 (this.activeName) {
- let tableId = this.activeName.split('_')[0]
- let rowIndex = this.activeName.split('_')[1]
- let innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
+ const tableId = this.activeName.split('_')[0]
+ const rowIndex = this.activeName.split('_')[1]
+ const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
if (!innerForm.MeasureData) {
return this.checkToolCanActive(toolName)
} else {
@@ -1638,9 +1645,9 @@ export default {
}
} else {
let msg = this.$t('trials:reading:warnning:msg5')
- msg = msg.replace('xxx', obj.LesionName)
- // `病灶xxx信息未保存,不允许继续添加!`
- return { isCanActiveTool: false, reason: msg }
+ msg = msg.replace('xxx', obj.LesionName)
+ // `病灶xxx信息未保存,不允许继续添加!`
+ return { isCanActiveTool: false, reason: msg }
}
} else {
if (this.activeName) {
@@ -1659,10 +1666,10 @@ export default {
}
},
checkToolCanActive(toolName) {
- let tableId = this.activeName.split('_')[0]
- let rowIndex = this.activeName.split('_')[1]
- let innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
- let isLymphNodes = innerForm.IsLymphNodes
+ const tableId = this.activeName.split('_')[0]
+ const rowIndex = this.activeName.split('_')[1]
+ const innerForm = this.innerFormData[`${tableId}_${rowIndex}`]
+ const isLymphNodes = innerForm.IsLymphNodes
if (!innerForm.MeasureData) {
if (this.isBaseLineTask) {
if (innerForm.LesionType === 0 && isLymphNodes === 1 && toolName !== 'Bidirectional') {
@@ -1855,4 +1862,4 @@ export default {
}
}
-
\ No newline at end of file
+
diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/TableQuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/TableQuestionFormItem.vue
index 500d994c..fbb49226 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/TableQuestionFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/Recist/TableQuestionFormItem.vue
@@ -1,14 +1,14 @@