导表配置更改

uat_us
caiyiling 2025-01-22 09:48:28 +08:00
parent f1c72c66e8
commit 6e66dd8bbe
1 changed files with 36 additions and 24 deletions

View File

@ -22,12 +22,15 @@
<el-table-column <el-table-column
v-for="item in exportInfo.DicList" v-for="item in exportInfo.DicList"
:key="item.Code" :key="item.Code"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"> :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
>
<template v-slot="scope"> <template v-slot="scope">
<el-checkbox <el-checkbox
@change="() => changeState(scope, item.Code)" @change="() => changeState(scope, item.Code)"
:checked="getCheckState(scope, item.Code)" :checked="getCheckState(scope, item.Code)"
:disabled="getDisabledState(scope.row, item)" :disabled="getDisabledState(scope.row, item)"
v-show="!scope.row.IsGroup || !scope.row.HasChildren"
> >
</el-checkbox> </el-checkbox>
</template> </template>
@ -43,6 +46,7 @@
v-model="scope.row.CDISCCode" v-model="scope.row.CDISCCode"
size="mini" size="mini"
:disabled="scope.row.HasChildren || scope.row.IsTableQuestion" :disabled="scope.row.HasChildren || scope.row.IsTableQuestion"
v-show="!scope.row.IsGroup || !scope.row.HasChildren"
> >
</el-input> </el-input>
</template> </template>
@ -91,29 +95,7 @@ export default {
async submit() { async submit() {
this.loading = true this.loading = true
try { try {
let params= { let params = this.filterQuestions(this.exportInfo.QuestionList)
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 res = await setTrialQuestionExportResult(params) let res = await setTrialQuestionExportResult(params)
if (res.IsSuccess) { if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(this.$t('common:message:savedSuccessfully'))
@ -124,6 +106,36 @@ export default {
console.log(e) 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) { getCheckState(item, code) {
return item.row.ExportResult.indexOf(code) > -1 return item.row.ExportResult.indexOf(code) > -1