Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
b22374db9e
|
@ -916,10 +916,10 @@ export default {
|
|||
toolGroup.addTool(ArrowAnnotateTool.toolName, {
|
||||
arrowHeadStyle: 'standard',
|
||||
changeTextCallback: async(data, eventData, doneChangingTextCallback) => {
|
||||
return doneChangingTextCallback('')
|
||||
return doneChangingTextCallback(data.label)
|
||||
},
|
||||
getTextCallback: async(doneChangingTextCallback) => {
|
||||
return doneChangingTextCallback('')
|
||||
return doneChangingTextCallback('_')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -1044,10 +1044,10 @@ export default {
|
|||
}
|
||||
}
|
||||
})
|
||||
const arr = cornerstoneTools.annotation.state.getAllAnnotations()
|
||||
console.log(arr)
|
||||
|
||||
},
|
||||
addAnnotationListeners() {
|
||||
console.log(toolsEvents)
|
||||
const debouncedCallback = this.debounce((evt) => {
|
||||
this.annotationModifiedListener(evt)
|
||||
}, 100)
|
||||
|
@ -1065,10 +1065,21 @@ export default {
|
|||
toolsEvents.ANNOTATION_REMOVED,
|
||||
this.annotationRemovedListener
|
||||
)
|
||||
eventTarget.addEventListener(
|
||||
toolsEvents.ANNOTATION_ADDED,
|
||||
this.annotationAddedListener
|
||||
)
|
||||
// eventTarget.addEventListener(
|
||||
// toolsEvents.ANNOTATION_ADDED,
|
||||
// this.annotationAddedListener
|
||||
// )
|
||||
// eventTarget.addEventListener(
|
||||
// toolsEvents.TOOL_MODE_CHANGED,
|
||||
// this.toolModeChanged
|
||||
// )
|
||||
|
||||
},
|
||||
toolModeChanged(e) {
|
||||
console.log(e)
|
||||
const arr = cornerstoneTools.annotation.state.getAllAnnotations()
|
||||
// if (arr)
|
||||
console.log(arr)
|
||||
},
|
||||
annotationAddedListener(e) {
|
||||
console.log('annotationAddedListener', e)
|
||||
|
@ -1167,7 +1178,12 @@ export default {
|
|||
const annotations = cornerstoneTools.annotation.state.getAllAnnotations()
|
||||
const idx = annotations.findIndex(i => i.annotationUID === obj.annotationUID)
|
||||
if (idx === -1) return
|
||||
if (annotations[idx].metadata.toolName === 'ArrowAnnotate') {
|
||||
annotations[idx].data.text = obj.name
|
||||
} else {
|
||||
annotations[idx].data.label = obj.name
|
||||
}
|
||||
|
||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||
const viewportId = `viewport-${this.activeViewportIndex}`
|
||||
const viewport = renderingEngine.getViewport(viewportId)
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
v-for="outerQs in outerQuestions"
|
||||
:key="outerQs.Id"
|
||||
:question="outerQs"
|
||||
:questionForm="outerForm"
|
||||
:readingTaskState="readingTaskState"
|
||||
:visitTaskId="visitTaskId"
|
||||
:question-form="outerForm"
|
||||
:reading-task-state="readingTaskState"
|
||||
:visit-task-id="visitTaskId"
|
||||
/>
|
||||
<el-form-item v-if="readingTaskState < 2">
|
||||
<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>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
@ -45,7 +45,8 @@
|
|||
<div
|
||||
v-for="(qs,index) in tableQuestions"
|
||||
:key="index"
|
||||
class="lesions lesions_wrapper">
|
||||
class="lesions lesions_wrapper"
|
||||
>
|
||||
<h4
|
||||
v-if="qs.Type === 'group'"
|
||||
style="color: #ddd;padding: 5px 0px;margin: 0;"
|
||||
|
@ -58,7 +59,8 @@
|
|||
v-show="!(isBaseLineTask && table.LesionType === 2)"
|
||||
:key="table.Id"
|
||||
>
|
||||
<div v-if="table.Type === 'table'"
|
||||
<div
|
||||
v-if="table.Type === 'table'"
|
||||
class="flex-row"
|
||||
style="margin:3px 0;"
|
||||
>
|
||||
|
@ -91,7 +93,7 @@
|
|||
{{ 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">
|
||||
<i class="el-icon-warning" style="color:red"/>
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</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">
|
||||
|
@ -143,13 +145,13 @@
|
|||
:model="innerFormData[`${table.Id}_${answer.RowIndex}`]"
|
||||
>
|
||||
<table-question-form-item
|
||||
:tableInfo="table"
|
||||
:table-info="table"
|
||||
:answer="answer"
|
||||
:questionForm="innerFormData[`${table.Id}_${answer.RowIndex}`]"
|
||||
:readingTaskState="readingTaskState"
|
||||
:question-form="innerFormData[`${table.Id}_${answer.RowIndex}`]"
|
||||
:reading-task-state="readingTaskState"
|
||||
:organs="organs"
|
||||
:isBaseLineTask="isBaseLineTask"
|
||||
:isCurrentTask="isCurrentTask"
|
||||
:is-base-line-task="isBaseLineTask"
|
||||
:is-current-task="isCurrentTask"
|
||||
@update="innerFormDataUpdate"
|
||||
@close="closeInnerForm"
|
||||
@lesionTypeChange="lesionTypeChange"
|
||||
|
@ -229,7 +231,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
data(){
|
||||
data() {
|
||||
return {
|
||||
isBaseLineTask: false,
|
||||
isCurrentTask: false,
|
||||
|
@ -259,7 +261,7 @@ export default {
|
|||
handler(id) {
|
||||
if (!id) return
|
||||
this.visitTaskId = id
|
||||
this.$nextTick(()=>{
|
||||
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,98 +451,18 @@ export default {
|
|||
}
|
||||
}
|
||||
loading.close()
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
},
|
||||
// 新增病灶
|
||||
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)
|
||||
|
||||
this.$confirm(msg, {
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
callback: action => {}
|
||||
})
|
||||
return
|
||||
}
|
||||
// 判断当前病灶类型下的病灶个数是否超过最大行数,否则不允许添加
|
||||
if (!!tableInfo.MaxQuestionCount && tableInfo.MaxQuestionCount <= tableInfo.TableQuestions.Answers.length) {
|
||||
let msg = this.$t('trials:reading:warnning:msg14')
|
||||
msg = msg.replace('xxx', tableInfo.MaxQuestionCount)
|
||||
this.$confirm(msg, {
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
callback: action => {}
|
||||
})
|
||||
return
|
||||
}
|
||||
let answer = Object.assign({},this.innerFormData[tableInfo.Id])
|
||||
answer.TableId = tableInfo.Id
|
||||
answer.RowId = ''
|
||||
let maxIndex = this.getMaxRowIndex(tableInfo.TableQuestions.Answers)
|
||||
answer.RowIndex = `${maxIndex + 1}.00`
|
||||
answer.IsDicomReading = true
|
||||
answer.SaveTypeEnum = 0
|
||||
answer.LesionType = tableInfo.LesionType
|
||||
answer.LesionName = this.getLesionName(tableInfo.OrderMark, answer.RowIndex)
|
||||
let state = null
|
||||
if (this.isBaseLineTask && tableInfo.LesionType === 0) {
|
||||
state = 0
|
||||
}
|
||||
if (this.isBaseLineTask && tableInfo.LesionType === 1) {
|
||||
state = 0
|
||||
}
|
||||
let 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
|
||||
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
|
||||
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
|
||||
let lengthId = this.getQuestionId(0, tableInfo.TableQuestions.Questions)
|
||||
answer.LesionLength = length
|
||||
answer[lengthId] = length
|
||||
} else if (annotation.metadata.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, 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)
|
||||
answer.LesionShort = short
|
||||
answer[shortId] = short
|
||||
}
|
||||
this.$emit('setMarkName', {
|
||||
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)
|
||||
const 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}`]
|
||||
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(
|
||||
|
@ -558,28 +484,28 @@ export default {
|
|||
if (typeof targetTable !== 'object') return
|
||||
this.$set(this.innerFormData[`${tableId}_${rowIndex}`], 'MeasureData', annotation)
|
||||
if (obj.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, targetTable.TableQuestions.Questions)
|
||||
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') {
|
||||
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, targetTable.TableQuestions.Questions)
|
||||
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
|
||||
let shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
|
||||
const 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]
|
||||
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)
|
||||
|
@ -607,44 +533,43 @@ export default {
|
|||
this.createNLTarget(annotation)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
modifyAnnotation(obj) {
|
||||
const {annotation, toolName} = 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 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') {
|
||||
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, targetTable.TableQuestions.Questions)
|
||||
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') {
|
||||
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, targetTable.TableQuestions.Questions)
|
||||
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
|
||||
let shortId = this.getQuestionId(1, targetTable.TableQuestions.Questions)
|
||||
const 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]
|
||||
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)
|
||||
|
@ -652,7 +577,85 @@ export default {
|
|||
}
|
||||
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)
|
||||
|
||||
this.$confirm(msg, {
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
callback: action => {}
|
||||
})
|
||||
return
|
||||
}
|
||||
// 判断当前病灶类型下的病灶个数是否超过最大行数,否则不允许添加
|
||||
if (!!tableInfo.MaxQuestionCount && tableInfo.MaxQuestionCount <= tableInfo.TableQuestions.Answers.length) {
|
||||
let msg = this.$t('trials:reading:warnning:msg14')
|
||||
msg = msg.replace('xxx', tableInfo.MaxQuestionCount)
|
||||
this.$confirm(msg, {
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
callback: action => {}
|
||||
})
|
||||
return
|
||||
}
|
||||
const answer = Object.assign({}, this.innerFormData[tableInfo.Id])
|
||||
answer.TableId = tableInfo.Id
|
||||
answer.RowId = ''
|
||||
const maxIndex = this.getMaxRowIndex(tableInfo.TableQuestions.Answers)
|
||||
answer.RowIndex = `${maxIndex + 1}.00`
|
||||
answer.IsDicomReading = true
|
||||
answer.SaveTypeEnum = 0
|
||||
answer.LesionType = tableInfo.LesionType
|
||||
answer.LesionName = this.getLesionName(tableInfo.OrderMark, answer.RowIndex)
|
||||
let state = null
|
||||
if (this.isBaseLineTask && tableInfo.LesionType === 0) {
|
||||
state = 0
|
||||
}
|
||||
if (this.isBaseLineTask && tableInfo.LesionType === 1) {
|
||||
state = 0
|
||||
}
|
||||
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') {
|
||||
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, tableInfo.TableQuestions.Questions)
|
||||
answer.LesionLength = length
|
||||
answer[lengthId] = length
|
||||
} else if (annotation.metadata.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, 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
|
||||
const shortId = this.getQuestionId(1, tableInfo.TableQuestions.Questions)
|
||||
answer.LesionShort = short
|
||||
answer[shortId] = short
|
||||
}
|
||||
this.$emit('setMarkName', {
|
||||
annotationUID: annotation.annotationUID,
|
||||
name: answer.LesionName
|
||||
}
|
||||
)
|
||||
}
|
||||
this.innerFormData[`${tableInfo.Id}_${answer.RowIndex}`] = answer
|
||||
this.activeName = `${tableInfo.Id}_${answer.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,15 +1284,15 @@ 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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -1502,7 +1510,7 @@ export default {
|
|||
|
||||
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
|
||||
|
@ -1558,13 +1566,12 @@ export default {
|
|||
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
|
||||
|
@ -1575,7 +1582,7 @@ export default {
|
|||
}
|
||||
},
|
||||
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 {
|
||||
|
@ -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') {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div class="table-question-form">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<h3 v-if="questionForm.LesionName" style="color: #ddd;padding: 5px 0px;margin: 0;">
|
||||
{{ questionForm.LesionName }}
|
||||
<h3 v-if="qsForm.LesionName" style="color: #ddd;padding: 5px 0px;margin: 0;">
|
||||
{{ qsForm.LesionName }}
|
||||
</h3>
|
||||
<!-- 关闭 -->
|
||||
<div>
|
||||
|
@ -18,7 +18,7 @@
|
|||
>
|
||||
<!-- 下拉框 -->
|
||||
<el-select
|
||||
v-model="questionForm.LesionType"
|
||||
v-model="qsForm.LesionType"
|
||||
filterable
|
||||
:disabled="!isCurrentTask || readingTaskState>=2 || !isBaseLineTask"
|
||||
@change="((val)=>{lesionTypeChange(val)})"
|
||||
|
@ -47,9 +47,10 @@
|
|||
>
|
||||
<!-- 输入框 -->
|
||||
<template v-if="qs.Type==='input' || qs.Type==='number'">
|
||||
|
||||
<el-input
|
||||
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))"
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
>
|
||||
|
@ -61,7 +62,7 @@
|
|||
<!-- 多行文本输入框 -->
|
||||
<el-input
|
||||
v-if="qs.Type==='textarea'"
|
||||
v-model="questionForm[qs.Id]"
|
||||
v-model="qsForm[qs.Id]"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:disabled="!isCurrentTask || readingTaskState>=2"
|
||||
|
@ -70,7 +71,7 @@
|
|||
<!-- 下拉框 -->
|
||||
<el-select
|
||||
v-if="qs.Type==='select'"
|
||||
v-model="questionForm[qs.Id]"
|
||||
v-model="qsForm[qs.Id]"
|
||||
filterable
|
||||
: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))"
|
||||
|
@ -154,7 +155,7 @@
|
|||
<!-- 单选 -->
|
||||
<el-radio-group
|
||||
v-if="qs.Type==='radio'"
|
||||
v-model="questionForm[qs.id]"
|
||||
v-model="qsForm[qs.id]"
|
||||
:disabled="!isCurrentTask || readingTaskState>=2"
|
||||
>
|
||||
<el-radio
|
||||
|
@ -209,13 +210,22 @@ export default {
|
|||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isCurrentTaskAdd: null,
|
||||
lesionType: null,
|
||||
questions: [],
|
||||
organList: [],
|
||||
qsForm: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
questionForm: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(v) {
|
||||
if (v.MeasureData) {
|
||||
const {markTool} = v.MeasureData
|
||||
const { markTool } = v.MeasureData
|
||||
if (markTool === 'Bidirectional') {
|
||||
this.getOrganList(1)
|
||||
} else if (markTool === 'Length') {
|
||||
|
@ -226,6 +236,9 @@ export default {
|
|||
} else {
|
||||
this.getOrganList()
|
||||
}
|
||||
for (const key in v) {
|
||||
this.$set(this.qsForm, key, v[key])
|
||||
}
|
||||
this.isCurrentTaskAdd = v.IsCurrentTaskAdd
|
||||
}
|
||||
},
|
||||
|
@ -238,45 +251,37 @@ export default {
|
|||
this.questions = v.TableQuestions.Questions
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
isCurrentTaskAdd: null,
|
||||
lesionType: null,
|
||||
questions: [],
|
||||
organList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
let updateArr = []
|
||||
const updateArr = []
|
||||
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) {
|
||||
let selected = this.organList[index]
|
||||
const selected = this.organList[index]
|
||||
qs.RelationQuestions.map(q => {
|
||||
let val = selected[q.DataTableColumn]
|
||||
updateArr.push({questionId: q.Id, val: val, questionMark: q.QuestionMark})
|
||||
const val = selected[q.DataTableColumn]
|
||||
updateArr.push({ questionId: q.Id, val: val, questionMark: q.QuestionMark })
|
||||
})
|
||||
updateArr.push({questionId: 'OrganInfoId', val: selected.OrganInfoId})
|
||||
updateArr.push({questionId: 'IsCanEditPosition', val: selected.IsCanEditPosition})
|
||||
updateArr.push({ questionId: 'OrganInfoId', val: selected.OrganInfoId })
|
||||
updateArr.push({ questionId: 'IsCanEditPosition', val: selected.IsCanEditPosition })
|
||||
} else {
|
||||
question.RelationQuestions.map(q => {
|
||||
updateArr.push({questionId: q.Id, val: '', questionMark: q.QuestionMark})
|
||||
qs.RelationQuestions.map(q => {
|
||||
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) {
|
||||
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) {
|
||||
let arr = this.organs[idx].OrganList
|
||||
const arr = this.organs[idx].OrganList
|
||||
|
||||
if (!isNaN(parseInt(isLymphNodes))) {
|
||||
this.organList = arr.filter((item) => item.IsLymphNodes === parseInt(isLymphNodes))
|
||||
|
@ -305,7 +310,7 @@ export default {
|
|||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit('close', {tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex})
|
||||
this.$emit('close', { tableId: this.tableInfo.Id, rowIndex: this.answer.RowIndex })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -362,7 +362,7 @@ export default {
|
|||
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], 'IntrahepaticLesion', null)
|
||||
this.$set(this.innerFormData[tableKey], 'IntrahepaticLesion', 0)
|
||||
this.$set(this.innerFormData[tableKey], 'LesionName', null)
|
||||
this.$set(this.innerFormData[tableKey], 'MeasureData', null)
|
||||
this.$set(this.innerFormData[tableKey], 'TableId', tableKey)
|
||||
|
@ -376,6 +376,7 @@ export default {
|
|||
const stateId = this.getQuestionId(7, table.TableQuestions.Questions)
|
||||
const partId = this.getQuestionId(8, table.TableQuestions.Questions)
|
||||
const intrahepaticLesionId = this.getQuestionId(21, table.TableQuestions.Questions)
|
||||
this.$set(this.innerFormData[tableKey], intrahepaticLesionId, 0)
|
||||
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))
|
||||
|
@ -1342,6 +1343,15 @@ export default {
|
|||
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 (i.val !== '肝脏' && i.val !== 'Liver') {
|
||||
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], 'IntrahepaticLesion', 0)
|
||||
const targetTable = this.tableQuestions[0].Childrens.find(
|
||||
child => child.Id === obj.tableId
|
||||
)
|
||||
if (typeof targetTable !== 'object') return
|
||||
const intrahepaticLesionId = this.getQuestionId(21, targetTable.TableQuestions.Questions)
|
||||
this.$set(this.innerFormData[`${obj.tableId}_${obj.rowIndex}`], intrahepaticLesionId, 0)
|
||||
}
|
||||
if (innerForm.LesionType === 2) {
|
||||
this.setNewTargetState(obj.tableId, obj.rowIndex)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
:key="qs.Id"
|
||||
:label="`${qs.QuestionName}`"
|
||||
:prop="qs.Id"
|
||||
:title="(qs.QuestionMark === 0 && (questionForm.LesionOrgan === '肝脏' || questionForm.LesionOrgan === 'Liver') && (lesionType === 0 || lesionType === 1) && questionForm.IntrahepaticLesion) ? $t('trials:mRecist:warnning:msg1') : ''"
|
||||
:title="(qs.QuestionMark === 0 && (questionForm.LesionOrgan === '肝脏' || questionForm.LesionOrgan === 'Liver') && (lesionType === 0 || lesionType === 1 || lesionType === 2) && questionForm.IntrahepaticLesion) ? $t('trials:mRecist:warnning:msg1') : ''"
|
||||
:rules="[
|
||||
{ required: (qs.IsRequired === 0 || (qs.IsRequired ===1 && qs.RelevanceId && (questionForm[qs.RelevanceId] === qs.RelevanceValue)) || (qs.QuestionMark === 6 && questionForm.IsCanEditPosition === true) || (questionForm.IsCanEditPosition && qs.QuestionMark === 10) || (qs.QuestionMark === 21 && (questionForm.LesionOrgan === '肝脏' || questionForm.LesionOrgan === 'Liver') && (lesionType === 0 || lesionType === 1 || lesionType === 2)) || (qs.QuestionMark === 0 && (questionForm.LesionOrgan === '肝脏' || questionForm.LesionOrgan === 'Liver') && (lesionType === 0 || lesionType === 1 || lesionType === 2))) && qs.Type!=='group' && qs.Type!=='summary',
|
||||
message:['radio', 'select', 'checkbox'].includes(qs.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur','change']},
|
||||
|
@ -77,7 +77,7 @@
|
|||
v-model="qsForm[qs.Id]"
|
||||
filterable
|
||||
: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)) || (qs.QuestionMark === 21 && (isCurrentTaskAdd === 'False'|| !!answer.SplitOrMergeLesionName)) || (questionForm.LesionOrgan && questionForm.LesionOrgan !== '肝脏' && questionForm.LesionOrgan !== 'Liver' && qs.QuestionMark === 21)"
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
>
|
||||
<template v-if="qs.QuestionMark === 8" #prefix>
|
||||
|
|
Loading…
Reference in New Issue