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,52 +487,27 @@ export default {
}, },
setFormTableItemData(obj) { setFormTableItemData(obj) {
this.$set(this.QuestionsForm, obj.key, obj.val) this.$set(this.QuestionsForm, obj.key, obj.val)
this.classArr.map(i=>{ if (this.classArr.length > 0) {
if (i.triggerId === obj.key) { let qs = this.classArr.find(i=>i.triggerId === obj.key)
let answer = null if (!qs) return
let list = JSON.parse(i.classifyAlgorithms) let answer = null
if (i.classifyType === 0) { let list = JSON.parse(qs.classifyAlgorithms)
let o = list.find(v => { if (qs.classifyType === 0) {
return ( let o = list.find(v => {
parseFloat(obj.val) >= parseFloat(v.gt) && return (
parseFloat(obj.val) < parseFloat(v.lt) parseFloat(obj.val) >= parseFloat(v.gt) &&
) parseFloat(obj.val) < parseFloat(v.lt)
}) )
answer = o ? o.label : null })
} else if (indexedDB.classifyType === 1) { answer = o ? o.label : null
let o = list.find(v => { } else if (qs.classifyType === 1) {
return v.val.includes(obj.val) let o = list.find(v => {
}) return v.val.includes(obj.val)
answer = o ? o.label : null })
} 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) { resetTableFormItemData(obj) {
this.$set(this.QuestionsForm, obj.key, null) this.$set(this.QuestionsForm, obj.key, null)
@ -606,7 +581,7 @@ export default {
var index = this.AnswersList.findIndex(v => v.RowId === this.QuestionsForm.RowId) var index = this.AnswersList.findIndex(v => v.RowId === this.QuestionsForm.RowId)
this.AnswersList.splice(index, 1, this.QuestionsForm) 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.formItemNumberChange(this.question.Id, true)
this.addOrEdit.visible = false this.addOrEdit.visible = false
}) })
@ -728,7 +703,7 @@ export default {
if (find) { if (find) {
var num = this.logic(v) var num = this.logic(v)
if (num !== false) { 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) { if (find) {
var num = this.logic(v) var num = this.logic(v)
if (num !== false) { 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) { formNumberItemChange(v) {
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v }) this.$emit('setFormItemData', { key: v.QuestionId, val: num })
}, },
formItemChange(v, question) { formItemChange(v, question) {
if (question.Childrens.length > 0) { if (question.Childrens.length > 0) {
@ -824,10 +799,10 @@ export default {
// if (typeof val === 'boolean') { // if (typeof val === 'boolean') {
// // val = String(val) // // val = String(val)
// } // }
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs }) this.$emit('setFormItemData', { key: qs.Id, val: val })
}) })
} else { } else {
this.$emit('setFormItemData', { key: question.Id, val: v, question: question }) this.$emit('setFormItemData', { key: question.Id, val: v })
} }
}, },
resetChild(obj) { 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) }) this.fileList.push({ name: `${this.$t('trials:emailManageCfg:title:fileName')}${this.fileList.length + 1}`, url: this.$getObjectName(res.url) })
console.log('fileList', this.fileList) console.log('fileList', this.fileList)
this.urls.push(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() loading.close()
// uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => { // uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
// if (res.IsSuccess) { // if (res.IsSuccess) {
@ -916,7 +891,7 @@ export default {
this.imageUrl = '' this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1) this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === 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) 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.fileList.push({ name: param.file.name, url: this.$getObjectName(res.url) })
this.urls.push(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() loading.close()
}, },
handleBeforeUpload(file) { handleBeforeUpload(file) {
@ -330,7 +330,7 @@ export default {
this.imageUrl = '' this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1) this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === 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') { // if (typeof val === 'boolean') {
// // val = String(val) // // val = String(val)
// } // }
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs }) this.$emit('setFormItemData', { key: qs.Id, val: val })
}) })
} else { } else {
this.$emit('setFormItemData', { key: question.Id, val: v, question: question }) this.$emit('setFormItemData', { key: question.Id, val: v })
} }
}, },
limitInput(value, q) { limitInput(value, q) {
@ -515,7 +515,7 @@ export default {
console.log(res) console.log(res)
this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)}) 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.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() loading.close()
}, },
handleBeforeUpload(file) { handleBeforeUpload(file) {
@ -555,7 +555,7 @@ export default {
this.imageUrl = '' this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1) this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === 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,52 +230,28 @@ export default {
}, },
setFormItemData(obj) { setFormItemData(obj) {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val))) this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val)))
this.classArr.map(i=>{ if (this.classArr.length > 0) {
if (i.triggerId === obj.key) { let qs = this.classArr.find(i=>i.triggerId === obj.key)
let answer = null if (!qs) return
let list = JSON.parse(i.classifyAlgorithms) let answer = null
if (i.classifyType === 0) { let list = JSON.parse(qs.classifyAlgorithms)
let o = list.find(v => { if (qs.classifyType === 0) {
return ( let o = list.find(v => {
parseFloat(obj.val) >= parseFloat(v.gt) && return (
parseFloat(obj.val) < parseFloat(v.lt) parseFloat(obj.val) >= parseFloat(v.gt) &&
) parseFloat(obj.val) < parseFloat(v.lt)
}) )
answer = o ? o.label : null })
} else if (i.classifyType === 1) { answer = o ? o.label : null
let o = list.find(v => { } else if (qs.classifyType === 1) {
return v.val.includes(obj.val) let o = list.find(v => {
}) return v.val.includes(obj.val)
answer = o ? o.label.trim() : null })
} answer = o ? o.label.trim() : null
if (answer !== null) {
this.$set(this.questionForm, i.classId, answer)
}
} }
}) console.log(this.questionForm, qs.classId, answer)
// if (this.classArr.length > 0) { this.$set(this.questionForm, qs.classId, answer)
// 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)
// }
// }
} }
} }
} }

View File

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

View File

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

View File

@ -328,10 +328,10 @@ export default {
// if (typeof val === 'boolean') { // if (typeof val === 'boolean') {
// // val = String(val) // // val = String(val)
// } // }
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs }) this.$emit('setFormItemData', { key: qs.Id, val: val })
}) })
} else { } else {
this.$emit('setFormItemData', { key: question.Id, val: v, question: question }) this.$emit('setFormItemData', { key: question.Id, val: v })
} }
}, },
formItemNumberChange(v, question) { formItemNumberChange(v, question) {
@ -383,7 +383,7 @@ export default {
this.imageUrl = '' this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1) this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === 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,52 +185,27 @@ export default {
this.$set(this.questionForm, obj.key, arr) this.$set(this.questionForm, obj.key, arr)
} else { } else {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val))) this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val)))
this.classArr.map(i=>{ if (this.classArr.length > 0) {
if (i.triggerId === obj.key) { let qs = this.classArr.find(i=>i.triggerId === obj.key)
let answer = null if (!qs) return
let list = JSON.parse(i.classifyAlgorithms) let answer = null
if (i.classifyType === 0) { let list = JSON.parse(qs.classifyAlgorithms)
let o = list.find(v => { if (qs.classifyType === 0) {
return ( let o = list.find(v => {
parseFloat(obj.val) >= parseFloat(v.gt) && return (
parseFloat(obj.val) < parseFloat(v.lt) parseFloat(obj.val) >= parseFloat(v.gt) &&
) parseFloat(obj.val) < parseFloat(v.lt)
}) )
answer = o ? o.label : null })
} else if (i.classifyType === 1) { answer = o ? o.label : null
let o = list.find(v => { } else if (qs.classifyType === 1) {
return v.val.includes(obj.val) let o = list.find(v => {
}) return v.val.includes(obj.val)
answer = o ? o.label : null })
} 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)
// }
// }
} }
} }
} }