同步数据时只刷新病灶列表部分信息

uat_us
caiyiling 2024-04-08 14:50:47 +08:00
parent c8e7645fa5
commit 55085438aa
3 changed files with 31 additions and 24 deletions

View File

@ -161,7 +161,7 @@
<div class="text">{{ $t('trials:reading:button:reset') }}</div> <div class="text">{{ $t('trials:reading:button:reset') }}</div>
</div> </div>
</el-tooltip> </el-tooltip>
<el-tooltip v-if="!isBaseLineTask" class="item" effect="dark" :content="$t('trials:lugano:button:record')" placement="bottom" > <el-tooltip v-if="!isBaseLineTask" class="item" effect="dark" :content="$t('trials:lugano:button:record')" placement="bottom">
<div class="tool-wrapper"> <div class="tool-wrapper">
<div <div
class="icon" class="icon"
@ -2136,7 +2136,7 @@ export default {
async receiveMsg(event) { async receiveMsg(event) {
if (event.data.type === 'readingPageUpdate') { if (event.data.type === 'readingPageUpdate') {
// this.$refs['questions'].initList() // this.$refs['questions'].initList()
this.$refs['tableQuestions'].initList() this.$refs['tableQuestions'].initList(true)
this.isLocate = true this.isLocate = true
// await this.getAnnotations() // await this.getAnnotations()
this.viewportRender() this.viewportRender()

View File

@ -287,7 +287,7 @@ export default {
}, },
methods: { methods: {
async initForm() { async initForm(isRerender = false) {
const loading = this.$loading({ fullscreen: true }) const loading = this.$loading({ fullscreen: true })
this.questions.forEach(item => { this.questions.forEach(item => {
if (item.QuestionClassify === 0) { if (item.QuestionClassify === 0) {
@ -301,23 +301,28 @@ export default {
if (this.isBaseLineTask && item.QuestionMark === 7 && this.lesionType === 1) { if (this.isBaseLineTask && item.QuestionMark === 7 && this.lesionType === 1) {
val = 0 val = 0
} }
if (!isRerender || (isRerender && item.QuestionMark !== 20)) {
this.$set(this.questionForm, item.Id, val) this.$set(this.questionForm, item.Id, val)
} }
}
}) })
this.$set(this.questionForm, 'MeasureData', this.answers.MeasureData ? JSON.parse(this.answers.MeasureData) : '') this.$set(this.questionForm, 'MeasureData', this.answers.MeasureData ? JSON.parse(this.answers.MeasureData) : '')
if (!isRerender) {
this.$set(this.questionForm, 'OtherMeasureData', this.answers.OtherMeasureData ? JSON.parse(this.answers.OtherMeasureData) : '') this.$set(this.questionForm, 'OtherMeasureData', this.answers.OtherMeasureData ? JSON.parse(this.answers.OtherMeasureData) : '')
}
this.$set(this.questionForm, 'RowIndex', this.answers.RowIndex ? this.answers.RowIndex : '') this.$set(this.questionForm, 'RowIndex', this.answers.RowIndex ? this.answers.RowIndex : '')
this.$set(this.questionForm, 'RowId', this.answers.RowId ? this.answers.RowId : '') this.$set(this.questionForm, 'RowId', this.answers.RowId ? this.answers.RowId : '')
this.$set(this.questionForm, 'OrganInfoId', this.answers.OrganInfoId ? this.answers.OrganInfoId : '') this.$set(this.questionForm, 'OrganInfoId', this.answers.OrganInfoId ? this.answers.OrganInfoId : '')
// saveTypeEnum 01访/2 // saveTypeEnum 01访/2
var lesionState = this.getQuestionVal(7) var lesionState = this.getQuestionVal(7)
if (!isRerender) {
if (this.questionForm.RowId) { if (this.questionForm.RowId) {
this.$set(this.questionForm, 'saveTypeEnum', isNaN(parseInt(lesionState)) ? 1 : 2) this.$set(this.questionForm, 'saveTypeEnum', isNaN(parseInt(lesionState)) ? 1 : 2)
} else { } else {
this.$set(this.questionForm, 'saveTypeEnum', 0) this.$set(this.questionForm, 'saveTypeEnum', 0)
} }
}
this.$set(this.questionForm, 'IsCanEditPosition', this.answers.IsCanEditPosition === 'True') this.$set(this.questionForm, 'IsCanEditPosition', this.answers.IsCanEditPosition === 'True')
this.$set(this.questionForm, 'IsDicomReading', this.answers.IsDicomReading !== 'False') this.$set(this.questionForm, 'IsDicomReading', this.answers.IsDicomReading !== 'False')
@ -359,13 +364,13 @@ export default {
if (this.answers.IsFristAdd === 'True' && this.answers.SplitOrMergeType === '0' && isNaN(parseInt(this.getQuestionVal(7)))) { if (this.answers.IsFristAdd === 'True' && this.answers.SplitOrMergeType === '0' && isNaN(parseInt(this.getQuestionVal(7)))) {
const stateId = this.getQuestionId(7) const stateId = this.getQuestionId(7)
this.$set(this.questionForm, stateId, 0) this.$set(this.questionForm, stateId, 0)
}
var isLymphLesion = this.getQuestionVal(2) var isLymphLesion = this.getQuestionVal(2)
isLymphLesion = !isNaN(parseInt(isLymphLesion)) ? parseInt(isLymphLesion) : null isLymphLesion = !isNaN(parseInt(isLymphLesion)) ? parseInt(isLymphLesion) : null
const lesionPart = this.getQuestionVal(8) const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6) const lesionOrgan = this.getQuestionVal(6)
const suvMax = this.getQuestionVal(20) const suvMax = this.getQuestionVal(20)
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, suvMax, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, suvMax, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
}
this.isRender = true this.isRender = true
loading.close() loading.close()
}, },

View File

@ -170,7 +170,7 @@ export default {
beforeDestroy() { beforeDestroy() {
}, },
methods: { methods: {
initList() { initList(isRerender = false) {
this.loading = true this.loading = true
this.activeName = '' this.activeName = ''
this.activeItem.activeRowIndex = null this.activeItem.activeRowIndex = null
@ -180,13 +180,13 @@ export default {
visitTaskId: this.visitTaskId visitTaskId: this.visitTaskId
} }
getReadingQuestionAndAnswer(params).then(res => { getReadingQuestionAndAnswer(params).then(res => {
this.questions = this.getQuestions(res.Result.SinglePage) this.questions = this.getQuestions(res.Result.SinglePage, isRerender)
this.getTableQuestions() this.getTableQuestions()
this.$nextTick(() => { this.$nextTick(() => {
this.tableQuestions.forEach(item => { this.tableQuestions.forEach(item => {
item.TableQuestions.Answers.forEach(i => { item.TableQuestions.Answers.forEach(i => {
var refName = `${item.Id}_${i.RowIndex}` var refName = `${item.Id}_${i.RowIndex}`
this.$refs[refName] && this.$refs[refName][0].initForm() this.$refs[refName] && this.$refs[refName][0].initForm(isRerender)
}) })
}) })
}) })
@ -217,7 +217,7 @@ export default {
} }
}, },
getQuestions(questions) { getQuestions(questions, isRerender) {
questions.forEach(item => { questions.forEach(item => {
if (item.Type === 'table' && item.TableQuestions && item.TableQuestions.Answers.length > 0) { if (item.Type === 'table' && item.TableQuestions && item.TableQuestions.Answers.length > 0) {
item.TableQuestions.Answers.forEach(answerObj => { item.TableQuestions.Answers.forEach(answerObj => {
@ -230,11 +230,13 @@ export default {
var lesionState = this.getQuestionAnswer(item.TableQuestions.Questions, 7, answerObj) var lesionState = this.getQuestionAnswer(item.TableQuestions.Questions, 7, answerObj)
lesionState = !isNaN(parseInt(lesionState)) ? parseInt(lesionState) : '' lesionState = !isNaN(parseInt(lesionState)) ? parseInt(lesionState) : ''
this.$set(answerObj, 'lesionState', lesionState) this.$set(answerObj, 'lesionState', lesionState)
if (!isRerender) {
if (answerObj.RowId) { if (answerObj.RowId) {
this.$set(answerObj, 'saveTypeEnum', 2) this.$set(answerObj, 'saveTypeEnum', 2)
} else { } else {
this.$set(answerObj, 'saveTypeEnum', 0) this.$set(answerObj, 'saveTypeEnum', 0)
} }
}
}) })
} }
if (item.Childrens.length > 0) { if (item.Childrens.length > 0) {