diff --git a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue index 5df546d0..9a4b9097 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/IVUS/QuestionList.vue @@ -52,7 +52,7 @@
-
+
@@ -63,7 +63,6 @@ :ref="item.Id" :data="item.TableQuestions.Answers" max-height="600" - style="width:100%;" > @@ -241,21 +241,13 @@ export default { return { height: window.innerHeight - 140, questions: [], - activeName: '', - activeItem: { - activeRowIndex: null, - activeCollapseId: null - }, visitTaskId: '', isCurrentTask: false, loading: false, - unSaveTargets: [], - temporaryLesions: [], readingTaskState: 2, isBaseLineTask: false, taskBlindName: '', tableQuestions: [], - isFirstRender: false, CriterionType: null, subjectCode: '', questionForm: {}, @@ -325,9 +317,6 @@ export default { this.readingTaskState = this.visitTaskList[i].ReadingTaskState this.isBaseLineTask = this.visitTaskList[i].IsBaseLineTask this.isCurrentTask = this.visitTaskList[i].IsCurrentTask - this.activeName = '' - this.activeItem.activeRowIndex = null - this.activeItem.activeCollapseId = null if (!this.visitTaskList[i].IsInit) { var loading = this.$loading({ fullscreen: true }) var triald = this.trialId = this.$router.currentRoute.query.trialId @@ -442,37 +431,6 @@ export default { isCanActiveTool(toolName) { return { isCanActiveTool: true, reason: '' } }, - - async handleAdd(qs) { - if (!!qs.MaxQuestionCount && qs.MaxQuestionCount <= qs.TableQuestions.Answers.length) { - let msg = this.$t('trials:reading:warnning:msg14') - // msg = msg.replace('xxx', qs.QuestionName) - msg = msg.replace('xxx', qs.MaxQuestionCount) - this.$confirm(msg, { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - } else { - // saveTypeEnum: 0 - var obj = { saveTypeEnum: 0 } - // var questions = qs.TableQuestions.Questions.find(item => item.QuestionMark === 3) - // if (questions) { - // console.log(questions) - // var maxIndex = this.getMaxRowIndex(qs.TableQuestions.Answers) - // obj.RowIndex = `${maxIndex + 1}.00` - // obj[questions.Id] = `${qs.OrderMark}${String(maxIndex + 1).padStart(2, '0')}` - // } - var maxIndex = this.getMaxRowIndex(qs.TableQuestions.Answers) - obj.RowIndex = `${maxIndex + 1}.00` - obj.IsDicomReading = true - await store.dispatch('reading/addReadingQuestionAndAnswer', { lesionType: qs.LesionType, visitTaskId: this.visitTaskId, lesionObj: obj }) - - this.activeItem.activeRowIndex = String(obj.RowIndex) - this.activeItem.activeCollapseId = qs.Id - this.activeName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}` - } - }, getMaxRowIndex(answerList) { if (answerList.length > 0) { var arr = [] @@ -568,10 +526,6 @@ export default { const res = await resetReadingTask({ visitTaskId: this.visitTaskId }) this.loading = false if (res.IsSuccess) { - // 刷新标注、表单、报告页信息 - this.activeName = '' - this.activeItem.activeRowIndex = null - this.activeItem.activeCollapseId = null await this.getReadingQuestionAndAnswer(this.visitTaskId) const triald = this.$router.currentRoute.query.trialId await store.dispatch('reading/refreshDicomReadingQuestionAnswer', { trialId: triald, visitTaskId: this.visitTaskId }) @@ -612,13 +566,18 @@ export default { } } }, - handleEdit(type, row, index) { + handleAddOrEdit(type, row, index) { this.addOrEdit.title = row.QuestionName this.qsList = row.TableQuestions.Questions this.qsForm = {} this.qsForm.questionId = row.Id this.qsForm.rowId = type === 'add' ? null : row.TableQuestions.Answers && row.TableQuestions.Answers[index] ? row.TableQuestions.Answers[index].RowId : null - this.qsForm.rowIndex = type === 'add' ? null : row.TableQuestions.Answers && row.TableQuestions.Answers[index] ? row.TableQuestions.Answers[index].RowIndex : null + if (type === 'add') { + var maxIndex = this.getMaxRowIndex(row.TableQuestions.Answers) + this.qsForm.rowIndex = `${maxIndex + 1}.00` + } else { + this.qsForm.rowIndex = row.TableQuestions.Answers && row.TableQuestions.Answers[index] ? row.TableQuestions.Answers[index].RowIndex : null + } row.TableQuestions.Questions.map(i => { if (i.QuestionMark === 1001) { this.eemId = i.Id @@ -681,7 +640,7 @@ export default { } ) if (confirm !== 'confirm') return - if (this.questionForm.RowId) { + if (row.TableQuestions.Answers[index].RowId) { var param = { visitTaskId: this.visitTaskId, questionId: row.Id, @@ -689,6 +648,7 @@ export default { } const res = await deleteReadingRowAnswer(param) if (res.IsSuccess) { + await this.getReadingQuestionAndAnswer(this.visitTaskId) DicomEvent.$emit('getReportInfo', true) // '删除成功!' this.$message.success(this.$t('common:message:deletedSuccessfully')) @@ -699,6 +659,14 @@ export default { loading.close() console.log(e) } + }, + renderHeader(h, { column, $index }) { + const span = document.createElement('span') + span.innerText = column.label + document.body.appendChild(span) + column.minWidth = span.getBoundingClientRect().width + 15 + document.body.removeChild(span) + return h('span', column.label) } } } @@ -829,7 +797,7 @@ export default { height: 100% !important; } /deep/ .el-table .cell { - line-height: 15px; + line-height: 14px; } /deep/ .el-table__cell { padding: 5px 0; @@ -841,7 +809,6 @@ export default { /deep/.el-table__fixed-body-wrapper tr:hover > td { background-color: #000 !important; } - } }