Compare commits

..

No commits in common. "5edf2f8790df6216420872553f812208b9161173" and "c1c6f5a6c7c80d192d1483e2282cb711d753465a" have entirely different histories.

8 changed files with 108 additions and 211 deletions

View File

@ -487,11 +487,12 @@ export default {
},
setFormTableItemData(obj) {
this.$set(this.QuestionsForm, obj.key, obj.val)
this.classArr.map(i=>{
if (i.triggerId === obj.key) {
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(i.classifyAlgorithms)
if (i.classifyType === 0) {
let list = JSON.parse(qs.classifyAlgorithms)
if (qs.classifyType === 0) {
let o = list.find(v => {
return (
parseFloat(obj.val) >= parseFloat(v.gt) &&
@ -499,40 +500,14 @@ export default {
)
})
answer = o ? o.label : null
} else if (indexedDB.classifyType === 1) {
} 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, 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)
@ -606,7 +581,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, question: this.question})
this.$emit('setFormItemData', {key: this.question.Id, val: this.AnswersList})
this.formItemNumberChange(this.question.Id, true)
this.addOrEdit.visible = false
})
@ -728,7 +703,7 @@ export default {
if (find) {
var num = this.logic(v)
if (num !== false) {
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
this.$emit('setFormItemData', { key: v.QuestionId, val: num })
}
}
})
@ -741,7 +716,7 @@ export default {
if (find) {
var num = this.logic(v)
if (num !== false) {
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
this.$emit('setFormItemData', { key: v.QuestionId, val: num })
}
}
})
@ -809,7 +784,7 @@ export default {
})
},
formNumberItemChange(v) {
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
this.$emit('setFormItemData', { key: v.QuestionId, val: num })
},
formItemChange(v, question) {
if (question.Childrens.length > 0) {
@ -824,10 +799,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
this.$emit('setFormItemData', { key: qs.Id, val: val })
})
} else {
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
this.$emit('setFormItemData', { key: question.Id, val: v })
}
},
resetChild(obj) {
@ -861,7 +836,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('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
loading.close()
// uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
// if (res.IsSuccess) {
@ -916,7 +891,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('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
}
}
}

View File

@ -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('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
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('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
}
}
}

View File

@ -359,10 +359,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
this.$emit('setFormItemData', { key: qs.Id, val: val })
})
} else {
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
this.$emit('setFormItemData', { key: question.Id, val: v })
}
},
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('|') : '', question: this.question })
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
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('|') : '', question: this.question })
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
}
}
}

View File

@ -230,11 +230,12 @@ export default {
},
setFormItemData(obj) {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val)))
this.classArr.map(i=>{
if (i.triggerId === obj.key) {
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(i.classifyAlgorithms)
if (i.classifyType === 0) {
let list = JSON.parse(qs.classifyAlgorithms)
if (qs.classifyType === 0) {
let o = list.find(v => {
return (
parseFloat(obj.val) >= parseFloat(v.gt) &&
@ -242,41 +243,16 @@ export default {
)
})
answer = o ? o.label : null
} else if (i.classifyType === 1) {
} 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, 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)
// }
// }
}
}
}
</script>

View File

@ -112,8 +112,8 @@
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
:label="val"
:value="val"
/>
</template>
</el-select>
@ -130,8 +130,8 @@
<el-option
v-for="val in scope.row.TypeValue.split('|')"
:key="val"
:label="val.trim()"
:value="val.trim()"
:label="val"
:value="val"
/>
</template>
</el-select>

View File

@ -506,8 +506,7 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.QuestionsForm,
type: 'table',
question: this.question
type: 'table'
});
this.question.TableQuestions.Answers.push(this.QuestionsForm)
this.formItemNumberChange(this.question.Id, true);
@ -625,7 +624,7 @@ export default {
if (find) {
var num = this.logic(v);
if (num !== false) {
this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
this.$emit("setFormItemData", { key: v.QuestionId, val: num });
}
}
});
@ -638,7 +637,7 @@ export default {
if (find) {
var num = this.logic(v);
if (num !== false) {
this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
this.$emit("setFormItemData", { key: v.QuestionId, val: num });
}
}
});
@ -724,7 +723,7 @@ export default {
});
},
formNumberItemChange(v) {
this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
this.$emit("setFormItemData", { key: v.QuestionId, val: num });
},
formItemChange(v, question) {
if (question.Childrens.length > 0) {
@ -744,10 +743,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
this.$emit("setFormItemData", { key: qs.Id, val: val, question: qs });
this.$emit("setFormItemData", { key: qs.Id, val: val });
});
} else {
this.$emit("setFormItemData", { key: question.Id, val: v, question: question })
this.$emit("setFormItemData", { key: question.Id, val: v })
}
},
resetChild(obj) {
@ -767,11 +766,12 @@ export default {
setTblFormItemData(obj) {
console.log('setTblFormItemData', this.classArr)
this.$set(this.QuestionsForm, obj.key, obj.val)
this.classArr.map(i=>{
if (i.triggerId === obj.key) {
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(i.classifyAlgorithms)
if (i.classifyType === 0) {
let list = JSON.parse(qs.classifyAlgorithms)
if (qs.classifyType === 0) {
let o = list.find(v => {
return (
parseFloat(obj.val) >= parseFloat(v.gt) &&
@ -779,40 +779,14 @@ export default {
)
})
answer = o ? o.label : null
} else if (i.classifyType === 1) {
} 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, 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)
@ -839,7 +813,6 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.urls.length > 0 ? this.urls.join("|") : "",
question: this.question
});
loading.close();
} else {
@ -863,7 +836,6 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.urls.length > 0 ? this.urls.join("|") : "",
question: this.question
});
loading.close();
}
@ -925,7 +897,6 @@ export default {
this.$emit("setFormItemData", {
key: this.question.Id,
val: this.urls.length > 0 ? this.urls.join("|") : "",
question: this.question
});
},
},

View File

@ -328,10 +328,10 @@ export default {
// if (typeof val === 'boolean') {
// // val = String(val)
// }
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
this.$emit('setFormItemData', { key: qs.Id, val: val })
})
} else {
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
this.$emit('setFormItemData', { key: question.Id, val: v })
}
},
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('|') : '', question: this.question })
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
}
}
}

View File

@ -185,11 +185,12 @@ export default {
this.$set(this.questionForm, obj.key, arr)
} else {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val)))
this.classArr.map(i=>{
if (i.triggerId === obj.key) {
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(i.classifyAlgorithms)
if (i.classifyType === 0) {
let list = JSON.parse(qs.classifyAlgorithms)
if (qs.classifyType === 0) {
let o = list.find(v => {
return (
parseFloat(obj.val) >= parseFloat(v.gt) &&
@ -197,41 +198,15 @@ export default {
)
})
answer = o ? o.label : null
} else if (i.classifyType === 1) {
} 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, 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)
// }
// }
}
}
}
}