diff --git a/src/views/trials/trials-panel/reading/reading-tracking/components/configList.vue b/src/views/trials/trials-panel/reading/reading-tracking/components/configList.vue index 933452c2..edf6b235 100644 --- a/src/views/trials/trials-panel/reading/reading-tracking/components/configList.vue +++ b/src/views/trials/trials-panel/reading/reading-tracking/components/configList.vue @@ -22,12 +22,15 @@ + :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value" + + > @@ -43,6 +46,7 @@ v-model="scope.row.CDISCCode" size="mini" :disabled="scope.row.HasChildren || scope.row.IsTableQuestion" + v-show="!scope.row.IsGroup || !scope.row.HasChildren" > @@ -91,29 +95,7 @@ export default { async submit() { this.loading = true try { - let params= { - questionList: [], - tableQuestionList: [] - } - params.questionList = this.exportInfo.QuestionList.map(i => { - return { - questionId: i.QuestionId, - tableQuestionId: i.TableQuestionId, - exportResult: i.ExportResult, - CDISCCode: i.CDISCCode - } - }) - this.exportInfo.QuestionList.forEach(i => { - let childlist = i.Children.map(k => { - return { - questionId: i.QuestionId, - tableQuestionId: k.TableQuestionId, - exportResult: k.ExportResult, - CDISCCode: k.CDISCCode - } - }) - params.tableQuestionList = params.tableQuestionList.concat(childlist) - }) + let params = this.filterQuestions(this.exportInfo.QuestionList) let res = await setTrialQuestionExportResult(params) if (res.IsSuccess) { this.$message.success(this.$t('common:message:savedSuccessfully')) @@ -124,6 +106,36 @@ export default { console.log(e) } }, + filterQuestions(arr) { + let params= { + questionList: [], + tableQuestionList: [] + } + for (let i of arr) { + if (!i.IsGroup && !i.IsTableQuestion) { + params.questionList.push({ + questionId: i.QuestionId, + tableQuestionId: i.TableQuestionId, + exportResult: i.ExportResult, + CDISCCode: i.CDISCCode + }) + } + if (i.TableQuestionId) { + params.tableQuestionList.push({ + questionId: i.QuestionId, + tableQuestionId: i.TableQuestionId, + exportResult: i.ExportResult, + CDISCCode: i.CDISCCode + }) + } + if (i.Children && i.Children.length > 0) { + const childResults = this.filterQuestions(i.Children) + params.questionList = params.questionList.concat(childResults.questionList) + params.tableQuestionList = params.tableQuestionList.concat(childResults.tableQuestionList) + } + } + return params; + }, // θŽ·ε–ηŠΆζ€ getCheckState(item, code) { return item.row.ExportResult.indexOf(code) > -1