diff --git a/src/views/dictionary/template/components/CriterionQuestionForm.vue b/src/views/dictionary/template/components/CriterionQuestionForm.vue
index 1497357c..d59218b5 100644
--- a/src/views/dictionary/template/components/CriterionQuestionForm.vue
+++ b/src/views/dictionary/template/components/CriterionQuestionForm.vue
@@ -642,8 +642,8 @@
prop="ClassifyQuestionId"
>
-
+
-
+
{ formItemChange(val, question) }"
/>
{ formItemChange(val, question) }"
/>
{
- formItemChange(val, question);
- }
- "
+ @change="(val) => { formItemChange(val, question) }"
>
@@ -144,11 +142,7 @@
{
- formItemChange(val, question);
- }
- "
+ @change="(val) => { formItemChange(val, question) }"
>
- {{ val }}
+ {{ val.trim() }}
@@ -173,6 +167,7 @@
{ formItemChange(val, question) }"
>
- {{ val }}
+ {{ val.trim() }}
@@ -203,10 +198,23 @@
/>
+
+
+ {{ item.trim() }}
+
+
{formItemChange(val, question)})"
+ @change="(val) => { formItemNumberChange(val, question) }"
>
{
- formItemNumberChange(val, question);
- }
- "
+ @change="(val) => { formItemNumberChange(val, question) }"
/>
{
- if (this.question.Type === "class") {
- let o = this.ClassifyAlgorithmsList.find((v) => {
- return (
- this.questionForm[this.question.ClassifyQuestionId] >= v.gt &&
- this.questionForm[this.question.ClassifyQuestionId] < v.lt
- );
- });
- if (this.questionForm[this.question.ClassifyQuestionId]) {
- this.questionForm[this.question.Id] = o ? o.label : null;
- } else {
- this.questionForm[this.question.Id] = null;
- }
- }
- }, 300);
+ // setInterval(() => {
+ // if (this.question.Type === "class") {
+ // let o = this.ClassifyAlgorithmsList.find((v) => {
+ // return (
+ // this.questionForm[this.question.ClassifyQuestionId] >= v.gt &&
+ // this.questionForm[this.question.ClassifyQuestionId] < v.lt
+ // );
+ // });
+ // if (this.questionForm[this.question.ClassifyQuestionId]) {
+ // this.questionForm[this.question.Id] = o ? o.label : null;
+ // } else {
+ // this.questionForm[this.question.Id] = null;
+ // }
+ // }
+ // }, 300);
if (this.question.Type === "upload") {
if (this.questionForm[this.question.Id]) {
this.urls = this.questionForm[this.question.Id].split("|");
@@ -475,19 +480,19 @@ export default {
});
}
}
- if (this.question.Type === "table") {
- // this.getQuestionCalculateRelation()
- if (this.questionForm[this.question.Id]) {
- this.QuestionsForm = {};
- this.question.TableQuestions.Questions.forEach((v) => {
- if (v.Type === "number") {
- this.$set(this.QuestionsForm, v.Id, 0);
- } else {
- this.$set(this.QuestionsForm, v.Id, "");
- }
- });
- }
- }
+ // if (this.question.Type === "table") {
+ // // this.getQuestionCalculateRelation()
+ // if (this.questionForm[this.question.Id]) {
+ // this.QuestionsForm = {};
+ // this.question.TableQuestions.Questions.forEach((v) => {
+ // if (v.Type === "number") {
+ // this.$set(this.QuestionsForm, v.Id, 0);
+ // } else {
+ // this.$set(this.QuestionsForm, v.Id, "");
+ // }
+ // });
+ // }
+ // }
},
methods: {
getQuestionCalculateRelation() {
@@ -499,11 +504,13 @@ export default {
});
},
save() {
- this.AnswersList.push(this.QuestionsForm);
+ // this.AnswersList.push(this.QuestionsForm);
this.$emit("setFormItemData", {
key: this.question.Id,
- val: this.AnswersList,
+ val: this.QuestionsForm,
+ type: 'table'
});
+ this.question.TableQuestions.Answers.push(this.QuestionsForm)
this.formItemNumberChange(this.question.Id, true);
this.addOrEdit.visible = false;
},
@@ -689,11 +696,17 @@ export default {
});
},
openAddTableCol(row) {
-
+ this.QuestionsForm = {}
+ this.classArr = []
this.addOrEdit.title =
row.QuestionName + this.$t("trials:readingUnit:qsList:title:tableQs"); // '表格问题'
this.QuestionsList = row.TableQuestions.Questions;
- this.AnswersList = row.TableQuestions.Answers;
+ row.TableQuestions.Questions.map(v=>{
+ if (v.Type === 'class') {
+ this.classArr.push({triggerId: v.ClassifyTableQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
+ }
+ })
+ // this.AnswersList = row.TableQuestions.Answers;
row.TableQuestions.Questions.map(i=>{
this.$set(this.QuestionsForm, i.Id, null)
})
@@ -734,6 +747,8 @@ export default {
// }
this.$emit("setFormItemData", { key: qs.Id, val: val });
});
+ } else {
+ this.$emit("setFormItemData", { key: question.Id, val: v })
}
},
resetChild(obj) {
@@ -751,7 +766,29 @@ export default {
this.$emit("setFormItemData", obj);
},
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.$set(this.QuestionsForm, qs.classId, answer)
+ }
},
resetTblFormItemData(obj) {
this.$set(this.QuestionsForm, obj.key, null)
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 bd172ee6..d152565c 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
@@ -103,10 +103,23 @@
/>
+
+
+ {{ item.trim() }}
+
+
{
- if (this.question.Type === "class") {
- if (this.questionForm[this.question.ClassifyTableQuestionId]) {
- let o = this.ClassifyAlgorithmsList.find((v) => {
- return (
- this.questionForm[this.question.ClassifyTableQuestionId] >= v.gt &&
- this.questionForm[this.question.ClassifyTableQuestionId] < v.lt
- );
- });
- this.$emit('setFormItemData', { key: this.question.Id, val: o ? o.label : null })
- } else {
- this.$emit('setFormItemData', { key: this.question.Id, val: null })
- }
- }
- }, 300);
+
if (this.question.Type === 'upload') {
if (this.questionForm[this.question.Id]) {
this.urls = this.questionForm[this.question.Id].split('|')
@@ -302,9 +300,6 @@ export default {
this.getOrganInfoList()
}
},
- beforeDestroy() {
- clearInterval(this.timer)
- },
methods: {
save() {
},
@@ -326,9 +321,6 @@ export default {
})
},
formItemChange(v, question) {
- if (question.Childrens.length > 0) {
- this.resetChild(question.Childrens)
- }
if (question.TableQuestionType === 1 && question.RelationQuestions.length > 0) {
var index = this.organList.findIndex(item => item[question.DataTableColumn] === v)
if (index < 0) return
@@ -340,6 +332,8 @@ export default {
// }
this.$emit('setFormItemData', { key: qs.Id, val: val })
})
+ } else {
+ this.$emit('setFormItemData', { key: question.Id, val: v })
}
},
formItemNumberChange(v, question) {
@@ -359,21 +353,8 @@ export default {
setFormItemData(obj) {
this.$emit('setFormItemData', obj)
},
- async uploadScreenshot(param) {
- if (!this.visitTaskId) return
- const loading = this.$loading({
- target: document.querySelector('.ecrf-wrapper'),
- fullscreen: false,
- lock: true,
- text: 'Loading',
- spinner: 'el-icon-loading'
- })
- var file = await this.fileToBlob(param.file)
- 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('|') : '' })
- loading.close()
+ uploadScreenshot(param) {
+
},
handleBeforeUpload(file) {
// 检测文件类型是否符合要求
diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue
index d5646930..042833b3 100644
--- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue
+++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionsForm.vue
@@ -405,7 +405,7 @@
:label="$t('trials:qcCfg:table:typeValue')"
prop="TypeValue"
:rules="[
- {required: form.Type !== 'number', trigger: ['blur', 'change']},
+ {required: form.Type !== 'number', trigger: ['blur', 'change'], message: this.$t('common:ruleMessage:specify')},
{validator: validateTypeVal, trigger: ['blur', 'change']},
{max: 200, message: `${this.$t('common:ruleMessage:maxLength')} 200`}]"
>
@@ -663,8 +663,12 @@
>
-
+
@@ -677,13 +681,13 @@
>
-
+
+ v-for="item of !scope.row.QuestionId ? [] : tableQuestions.find(v => v.Id === scope.row.QuestionId).TableQuestions"
+ :key="item.Id" :label="item.QuestionName" :value="item.Id"/>
@@ -762,8 +766,29 @@
+
+
+
+ {{ item.label }}
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+