From 9c156ec1e65c4c476242ff3a4a23eafd46074962 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Fri, 25 Oct 2024 10:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9Edicom=E9=98=85=E7=89=87=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reading/none-dicoms/components/ECRF.vue | 40 ++++++++++++++++- .../none-dicoms/components/FormItem.vue | 44 ++++++++++++++----- .../components/QuestionsPreview.vue | 4 +- 3 files changed, 72 insertions(+), 16 deletions(-) diff --git a/src/views/trials/trials-panel/reading/none-dicoms/components/ECRF.vue b/src/views/trials/trials-panel/reading/none-dicoms/components/ECRF.vue index 71ff3fda..da348130 100644 --- a/src/views/trials/trials-panel/reading/none-dicoms/components/ECRF.vue +++ b/src/views/trials/trials-panel/reading/none-dicoms/components/ECRF.vue @@ -157,7 +157,8 @@ export default { currentUser: zzSessionStorage.getItem('userName'), readingTaskState: 0, activeName: 0, - formType: null + formType: null, + classArr: [] } }, mounted() { @@ -185,6 +186,9 @@ export default { if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary') { this.$set(this.questionForm, v.Id, v.Answer ? v.Answer : null) } + if (v.Type === 'class') { + this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType}) + } if (v.Childrens.length > 0) { this.setChild(v.Childrens) } @@ -198,6 +202,9 @@ export default { if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary') { this.$set(this.questionForm, v.Id, v.Answer ? v.Answer : null) } + if (v.Type === 'class') { + this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType}) + } if (v.Childrens.length > 0) { this.setChild(v.Childrens) } @@ -205,16 +212,21 @@ export default { this.publicQuestions = res.Result.PublicPage } } else { + console.log(1111) res.Result.SinglePage.map((v) => { if (v.Type === 'group' && v.Childrens.length === 0) return if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary') { this.$set(this.questionForm, v.Id, v.Answer ? v.Answer : null) } + if (v.Type === 'class') { + this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType}) + } if (v.Childrens.length > 0) { this.setChild(v.Childrens) } }) this.questions = res.Result.SinglePage + console.log(this.questions) } this.isRender = true } @@ -228,6 +240,9 @@ export default { if (i.Type !== 'group' && i.Type !== 'summary' && i.Id) { this.$set(this.questionForm, i.Id, i.Answer ? i.Answer : null) } + if (i.Type === 'class') { + this.classArr.push({triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType}) + } if (i.Childrens && i.Childrens.length > 0) { this.setChild(i.Childrens) } @@ -341,7 +356,28 @@ export default { this.questionForm[v] = null }, setFormItemData(obj) { - this.questionForm[obj.key] = obj.val + this.$set(this.questionForm, obj.key, obj.val) + if (this.classArr.length > 0) { + let qs = this.classArr.find(i=>i.triggerId === obj.key) + if (!qs) return + let answer = null + let list = JSON.parse(qs.classifyAlgorithms) + if (qs.classifyType === 0) { + let o = list.find(v => { + return ( + parseFloat(obj.val) >= parseFloat(v.gt) && + parseFloat(obj.val) < parseFloat(v.lt) + ) + }) + answer = o ? o.label : null + } else if (qs.classifyType === 1) { + let o = list.find(v => { + return v.val.includes(obj.val) + }) + answer = o ? o.label : null + } + this.$set(this.questionForm, qs.classId, answer) + } } } } diff --git a/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue b/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue index f22de0ef..ecff6edf 100644 --- a/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue +++ b/src/views/trials/trials-panel/reading/none-dicoms/components/FormItem.vue @@ -19,7 +19,7 @@ :prop="question.Id" :rules="[ { required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type!=='group' && question.Type!=='summary', - message: '请注明', trigger: ['blur', 'change']}, + message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']}, ]" :class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']" > @@ -72,9 +72,9 @@ @@ -97,10 +97,10 @@ @@ -112,10 +112,10 @@ > - {{ val }} + {{ val.trim() }} @@ -124,7 +124,7 @@ - + + + + + {{ item.trim() }} + + 0) { this.resetChild(question.Childrens) + } else { + this.$emit('setFormItemData', { key: question.Id, val: v}) } }, resetChild(obj) { diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsPreview.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsPreview.vue index 105165b3..0fb8fa6e 100644 --- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsPreview.vue +++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsPreview.vue @@ -123,8 +123,8 @@ export default { this.$set(this.questionForm, v.Id, v.Answer) } if (v.Type === 'table') { - this.$set(this.questionForm, v.Id, []) - } + this.$set(this.questionForm, v.Id, []) + } if (v.Type === 'class') { this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType}) }