From fb4fc347f379cc73121fafca087da0f866a787f6 Mon Sep 17 00:00:00 2001
From: caiyiling <1321909229@qq.com>
Date: Tue, 29 Oct 2024 09:40:40 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=97=AE=E9=A2=98=E5=85=81?=
=?UTF-8?q?=E8=AE=B8=E5=85=B3=E8=81=94=E5=A4=9A=E4=B8=AA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../customize/CustomizeQuestionFormItem.vue | 81 ++++++++++++-------
.../customize/CustomizeQuestionItem.vue | 4 +-
.../CustomizeQuestionTableFormItem.vue | 8 +-
.../customize/CustomizeQuestionsPreview.vue | 66 ++++++++++-----
.../dicoms/customize/CustomizeReportPage.vue | 8 +-
.../components/QuestionFormItem.vue | 81 +++++++++++++------
.../components/QuestionTableFormItem.vue | 6 +-
.../components/QuestionsPreview.vue | 65 ++++++++++-----
8 files changed, 211 insertions(+), 108 deletions(-)
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue
index 1098e334..96f3eba6 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue
@@ -487,27 +487,52 @@ export default {
},
setFormTableItemData(obj) {
this.$set(this.QuestionsForm, 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.classArr.map(i=>{
+ if (i.triggerId === obj.key) {
+ let answer = null
+ let list = JSON.parse(i.classifyAlgorithms)
+ if (i.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 (indexedDB.classifyType === 1) {
+ let o = list.find(v => {
+ return v.val.includes(obj.val)
+ })
+ answer = o ? o.label : null
+ }
+ if (answer !== null) {
+ this.$set(this.QuestionsForm, i.classId, answer)
+ }
}
- this.$set(this.QuestionsForm, qs.classId, answer)
- }
+ })
+ // 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
+ // }
+ // if (answer !== null) {
+ // this.$set(this.QuestionsForm, qs.classId, answer)
+ // }
+ // }
},
resetTableFormItemData(obj) {
this.$set(this.QuestionsForm, obj.key, null)
@@ -581,7 +606,7 @@ export default {
var index = this.AnswersList.findIndex(v => v.RowId === this.QuestionsForm.RowId)
this.AnswersList.splice(index, 1, this.QuestionsForm)
}
- this.$emit('setFormItemData', {key: this.question.Id, val: this.AnswersList})
+ this.$emit('setFormItemData', {key: this.question.Id, val: this.AnswersList, question: this.question})
this.formItemNumberChange(this.question.Id, true)
this.addOrEdit.visible = false
})
@@ -703,7 +728,7 @@ export default {
if (find) {
var num = this.logic(v)
if (num !== false) {
- this.$emit('setFormItemData', { key: v.QuestionId, val: num })
+ this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
}
}
})
@@ -716,7 +741,7 @@ export default {
if (find) {
var num = this.logic(v)
if (num !== false) {
- this.$emit('setFormItemData', { key: v.QuestionId, val: num })
+ this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
}
}
})
@@ -784,7 +809,7 @@ export default {
})
},
formNumberItemChange(v) {
- this.$emit('setFormItemData', { key: v.QuestionId, val: num })
+ this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
},
formItemChange(v, question) {
if (question.Childrens.length > 0) {
@@ -799,10 +824,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
- this.$emit('setFormItemData', { key: qs.Id, val: val })
+ this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
})
} else {
- this.$emit('setFormItemData', { key: question.Id, val: v })
+ this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
}
},
resetChild(obj) {
@@ -836,7 +861,7 @@ export default {
this.fileList.push({ name: `${this.$t('trials:emailManageCfg:title:fileName')}${this.fileList.length + 1}`, url: this.$getObjectName(res.url) })
console.log('fileList', this.fileList)
this.urls.push(this.$getObjectName(res.url))
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
loading.close()
// uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
// if (res.IsSuccess) {
@@ -891,7 +916,7 @@ export default {
this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
}
}
}
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue
index ec700485..9ea4abed 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionItem.vue
@@ -290,7 +290,7 @@ export default {
const res = await this.OSSclient.put(`/${this.trialId}/ReadAttachment/${this.subjectId}/${this.visitTaskId}/${param.file.name}`, file)
this.fileList.push({ name: param.file.name, url: this.$getObjectName(res.url) })
this.urls.push(this.$getObjectName(res.url))
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
loading.close()
},
handleBeforeUpload(file) {
@@ -330,7 +330,7 @@ export default {
this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
}
}
}
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue
index eaf60213..ce710159 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue
@@ -359,10 +359,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
- this.$emit('setFormItemData', { key: qs.Id, val: val })
+ this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
})
} else {
- this.$emit('setFormItemData', { key: question.Id, val: v })
+ this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
}
},
limitInput(value, q) {
@@ -515,7 +515,7 @@ export default {
console.log(res)
this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)})
this.urls.push(this.$getObjectName(res.url))
- this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
loading.close()
},
handleBeforeUpload(file) {
@@ -555,7 +555,7 @@ export default {
this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
- this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
}
}
}
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue
index 42c232b0..ceabb5a1 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue
@@ -230,28 +230,52 @@ export default {
},
setFormItemData(obj) {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(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.trim() : null
+ this.classArr.map(i=>{
+ if (i.triggerId === obj.key) {
+ let answer = null
+ let list = JSON.parse(i.classifyAlgorithms)
+ if (i.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 (i.classifyType === 1) {
+ let o = list.find(v => {
+ return v.val.includes(obj.val)
+ })
+ answer = o ? o.label.trim() : null
+ }
+ if (answer !== null) {
+ this.$set(this.questionForm, i.classId, answer)
+ }
}
- console.log(this.questionForm, qs.classId, answer)
- this.$set(this.questionForm, qs.classId, answer)
- }
+ })
+ // 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.trim() : null
+ // }
+ // if (answer !== null) {
+ // this.$set(this.questionForm, qs.classId, answer)
+ // }
+ // }
}
}
}
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPage.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPage.vue
index 49fa39f1..3f320e29 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPage.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPage.vue
@@ -112,8 +112,8 @@
@@ -130,8 +130,8 @@
diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue
index d6317b22..cbfec4e5 100644
--- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue
+++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue
@@ -506,7 +506,8 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.QuestionsForm,
- type: 'table'
+ type: 'table',
+ question: this.question
});
this.question.TableQuestions.Answers.push(this.QuestionsForm)
this.formItemNumberChange(this.question.Id, true);
@@ -624,7 +625,7 @@ export default {
if (find) {
var num = this.logic(v);
if (num !== false) {
- this.$emit("setFormItemData", { key: v.QuestionId, val: num });
+ this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
}
}
});
@@ -637,7 +638,7 @@ export default {
if (find) {
var num = this.logic(v);
if (num !== false) {
- this.$emit("setFormItemData", { key: v.QuestionId, val: num });
+ this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
}
}
});
@@ -723,7 +724,7 @@ export default {
});
},
formNumberItemChange(v) {
- this.$emit("setFormItemData", { key: v.QuestionId, val: num });
+ this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
},
formItemChange(v, question) {
if (question.Childrens.length > 0) {
@@ -743,10 +744,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
- this.$emit("setFormItemData", { key: qs.Id, val: val });
+ this.$emit("setFormItemData", { key: qs.Id, val: val, question: qs });
});
} else {
- this.$emit("setFormItemData", { key: question.Id, val: v })
+ this.$emit("setFormItemData", { key: question.Id, val: v, question: question })
}
},
resetChild(obj) {
@@ -766,27 +767,52 @@ export default {
setTblFormItemData(obj) {
console.log('setTblFormItemData', this.classArr)
this.$set(this.QuestionsForm, 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.classArr.map(i=>{
+ if (i.triggerId === obj.key) {
+ let answer = null
+ let list = JSON.parse(i.classifyAlgorithms)
+ if (i.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 (i.classifyType === 1) {
+ let o = list.find(v => {
+ return v.val.includes(obj.val)
+ })
+ answer = o ? o.label : null
+ }
+ if (answer !== null) {
+ this.$set(this.QuestionsForm, i.classId, answer)
+ }
}
- this.$set(this.QuestionsForm, qs.classId, answer)
- }
+ })
+ // 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
+ // }
+ // if (answer !== null) {
+ // this.$set(this.QuestionsForm, qs.classId, answer)
+ // }
+ // }
},
resetTblFormItemData(obj) {
this.$set(this.QuestionsForm, obj.key, null)
@@ -813,6 +839,7 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.urls.length > 0 ? this.urls.join("|") : "",
+ question: this.question
});
loading.close();
} else {
@@ -836,6 +863,7 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.urls.length > 0 ? this.urls.join("|") : "",
+ question: this.question
});
loading.close();
}
@@ -897,6 +925,7 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.urls.length > 0 ? this.urls.join("|") : "",
+ question: this.question
});
},
},
diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue
index e4a64585..40602247 100644
--- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue
+++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionTableFormItem.vue
@@ -328,10 +328,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
- this.$emit('setFormItemData', { key: qs.Id, val: val })
+ this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
})
} else {
- this.$emit('setFormItemData', { key: question.Id, val: v })
+ this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
}
},
formItemNumberChange(v, question) {
@@ -383,7 +383,7 @@ export default {
this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
- this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
+ this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
}
}
}
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 0fb8fa6e..55835bcb 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
@@ -185,27 +185,52 @@ export default {
this.$set(this.questionForm, obj.key, arr)
} else {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(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.classArr.map(i=>{
+ if (i.triggerId === obj.key) {
+ let answer = null
+ let list = JSON.parse(i.classifyAlgorithms)
+ if (i.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 (i.classifyType === 1) {
+ let o = list.find(v => {
+ return v.val.includes(obj.val)
+ })
+ answer = o ? o.label : null
+ }
+ if (answer !== null) {
+ this.$set(this.questionForm, i.classId, answer)
+ }
}
- this.$set(this.questionForm, qs.classId, answer)
- }
+ })
+ // 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
+ // }
+ // if (answer !== null) {
+ // this.$set(this.questionForm, qs.classId, answer)
+ // }
+ // }
}
}
}