Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-23 11:39:42 +08:00
commit b74337f2f0
1 changed files with 23 additions and 56 deletions

View File

@ -52,7 +52,7 @@
<div class="add-icon" style="margin: 0 5px;">
<i class="el-icon-upload2" />
</div>
<div class="add-icon" @click.prevent="handleAdd(item)">
<div class="add-icon" @click.prevent="handleAddOrEdit('add',item)">
<i class="el-icon-plus" />
</div>
</div>
@ -63,7 +63,6 @@
:ref="item.Id"
:data="item.TableQuestions.Answers"
max-height="600"
style="width:100%;"
>
<!-- <el-table-column :label="$t('CustomizeQuestionFormItem:label:OrderMark')" width="60px" show-overflow-tooltip>
<template slot-scope="scope">
@ -72,7 +71,7 @@
</el-table-column> -->
<el-table-column
type="index"
width="50"
width="40px"
/>
<el-table-column
v-for="q of item.TableQuestions.Questions"
@ -80,6 +79,7 @@
:prop="q.Id"
:label="q.QuestionName"
show-overflow-tooltip
:render-header="renderHeader"
/>
<el-table-column
v-if="readingTaskState < 2"
@ -88,10 +88,10 @@
fixed="right"
>
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleEdit('edit',item, scope.$index)">
<el-button type="text" size="mini" @click="handleAddOrEdit('edit',item, scope.$index)">
{{ $t('common:button:edit') }}
</el-button>
<el-button v-if="scope.row.IsCurrentTaskAdd === 'True'" type="text" size="mini" @click="handleDelete(question, scope.$index)">
<el-button v-if="scope.row.IsCurrentTaskAdd === 'True'" type="text" size="mini" @click="handleDelete(item, scope.$index)">
{{ $t('common:button:delete') }}
</el-button>
</template>
@ -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;
}
}
}
</style>