分类问题允许关联多个问题
parent
7360be1726
commit
fb4fc347f3
|
@ -487,27 +487,52 @@ export default {
|
||||||
},
|
},
|
||||||
setFormTableItemData(obj) {
|
setFormTableItemData(obj) {
|
||||||
this.$set(this.QuestionsForm, obj.key, obj.val)
|
this.$set(this.QuestionsForm, obj.key, obj.val)
|
||||||
if (this.classArr.length > 0) {
|
this.classArr.map(i=>{
|
||||||
let qs = this.classArr.find(i=>i.triggerId === obj.key)
|
if (i.triggerId === obj.key) {
|
||||||
if (!qs) return
|
let answer = null
|
||||||
let answer = null
|
let list = JSON.parse(i.classifyAlgorithms)
|
||||||
let list = JSON.parse(qs.classifyAlgorithms)
|
if (i.classifyType === 0) {
|
||||||
if (qs.classifyType === 0) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return (
|
||||||
return (
|
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
||||||
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
parseFloat(obj.val) < parseFloat(v.lt)
|
||||||
parseFloat(obj.val) < parseFloat(v.lt)
|
)
|
||||||
)
|
})
|
||||||
})
|
answer = o ? o.label : null
|
||||||
answer = o ? o.label : null
|
} else if (indexedDB.classifyType === 1) {
|
||||||
} else if (qs.classifyType === 1) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return v.val.includes(obj.val)
|
||||||
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)
|
||||||
|
@ -581,7 +606,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})
|
this.$emit('setFormItemData', {key: this.question.Id, val: this.AnswersList, question: this.question})
|
||||||
this.formItemNumberChange(this.question.Id, true)
|
this.formItemNumberChange(this.question.Id, true)
|
||||||
this.addOrEdit.visible = false
|
this.addOrEdit.visible = false
|
||||||
})
|
})
|
||||||
|
@ -703,7 +728,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 })
|
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -716,7 +741,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 })
|
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -784,7 +809,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
formNumberItemChange(v) {
|
formNumberItemChange(v) {
|
||||||
this.$emit('setFormItemData', { key: v.QuestionId, val: num })
|
this.$emit('setFormItemData', { key: v.QuestionId, val: num, question: v })
|
||||||
},
|
},
|
||||||
formItemChange(v, question) {
|
formItemChange(v, question) {
|
||||||
if (question.Childrens.length > 0) {
|
if (question.Childrens.length > 0) {
|
||||||
|
@ -799,10 +824,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 })
|
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$emit('setFormItemData', { key: question.Id, val: v })
|
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetChild(obj) {
|
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) })
|
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('|') : '' })
|
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
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) {
|
||||||
|
@ -891,7 +916,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('|') : '' })
|
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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('|') : '' })
|
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
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('|') : '' })
|
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 })
|
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$emit('setFormItemData', { key: question.Id, val: v })
|
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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('|') : '' })
|
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
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('|') : '' })
|
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,28 +230,52 @@ 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)))
|
||||||
if (this.classArr.length > 0) {
|
this.classArr.map(i=>{
|
||||||
let qs = this.classArr.find(i=>i.triggerId === obj.key)
|
if (i.triggerId === obj.key) {
|
||||||
if (!qs) return
|
let answer = null
|
||||||
let answer = null
|
let list = JSON.parse(i.classifyAlgorithms)
|
||||||
let list = JSON.parse(qs.classifyAlgorithms)
|
if (i.classifyType === 0) {
|
||||||
if (qs.classifyType === 0) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return (
|
||||||
return (
|
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
||||||
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
parseFloat(obj.val) < parseFloat(v.lt)
|
||||||
parseFloat(obj.val) < parseFloat(v.lt)
|
)
|
||||||
)
|
})
|
||||||
})
|
answer = o ? o.label : null
|
||||||
answer = o ? o.label : null
|
} else if (i.classifyType === 1) {
|
||||||
} else if (qs.classifyType === 1) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return v.val.includes(obj.val)
|
||||||
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)
|
})
|
||||||
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)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
:label="val.trim()"
|
||||||
:value="val"
|
:value="val.trim()"
|
||||||
/>
|
/>
|
||||||
</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"
|
:label="val.trim()"
|
||||||
:value="val"
|
:value="val.trim()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
|
@ -506,7 +506,8 @@ 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);
|
||||||
|
@ -624,7 +625,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 });
|
this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -637,7 +638,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 });
|
this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -723,7 +724,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
formNumberItemChange(v) {
|
formNumberItemChange(v) {
|
||||||
this.$emit("setFormItemData", { key: v.QuestionId, val: num });
|
this.$emit("setFormItemData", { key: v.QuestionId, val: num, question: v });
|
||||||
},
|
},
|
||||||
formItemChange(v, question) {
|
formItemChange(v, question) {
|
||||||
if (question.Childrens.length > 0) {
|
if (question.Childrens.length > 0) {
|
||||||
|
@ -743,10 +744,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 });
|
this.$emit("setFormItemData", { key: qs.Id, val: val, question: qs });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$emit("setFormItemData", { key: question.Id, val: v })
|
this.$emit("setFormItemData", { key: question.Id, val: v, question: question })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetChild(obj) {
|
resetChild(obj) {
|
||||||
|
@ -766,27 +767,52 @@ 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)
|
||||||
if (this.classArr.length > 0) {
|
this.classArr.map(i=>{
|
||||||
let qs = this.classArr.find(i=>i.triggerId === obj.key)
|
if (i.triggerId === obj.key) {
|
||||||
if (!qs) return
|
let answer = null
|
||||||
let answer = null
|
let list = JSON.parse(i.classifyAlgorithms)
|
||||||
let list = JSON.parse(qs.classifyAlgorithms)
|
if (i.classifyType === 0) {
|
||||||
if (qs.classifyType === 0) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return (
|
||||||
return (
|
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
||||||
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
parseFloat(obj.val) < parseFloat(v.lt)
|
||||||
parseFloat(obj.val) < parseFloat(v.lt)
|
)
|
||||||
)
|
})
|
||||||
})
|
answer = o ? o.label : null
|
||||||
answer = o ? o.label : null
|
} else if (i.classifyType === 1) {
|
||||||
} else if (qs.classifyType === 1) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return v.val.includes(obj.val)
|
||||||
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)
|
||||||
|
@ -813,6 +839,7 @@ 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 {
|
||||||
|
@ -836,6 +863,7 @@ 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();
|
||||||
}
|
}
|
||||||
|
@ -897,6 +925,7 @@ 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
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -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 })
|
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$emit('setFormItemData', { key: question.Id, val: v })
|
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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('|') : '' })
|
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,27 +185,52 @@ 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)))
|
||||||
if (this.classArr.length > 0) {
|
this.classArr.map(i=>{
|
||||||
let qs = this.classArr.find(i=>i.triggerId === obj.key)
|
if (i.triggerId === obj.key) {
|
||||||
if (!qs) return
|
let answer = null
|
||||||
let answer = null
|
let list = JSON.parse(i.classifyAlgorithms)
|
||||||
let list = JSON.parse(qs.classifyAlgorithms)
|
if (i.classifyType === 0) {
|
||||||
if (qs.classifyType === 0) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return (
|
||||||
return (
|
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
||||||
parseFloat(obj.val) >= parseFloat(v.gt) &&
|
parseFloat(obj.val) < parseFloat(v.lt)
|
||||||
parseFloat(obj.val) < parseFloat(v.lt)
|
)
|
||||||
)
|
})
|
||||||
})
|
answer = o ? o.label : null
|
||||||
answer = o ? o.label : null
|
} else if (i.classifyType === 1) {
|
||||||
} else if (qs.classifyType === 1) {
|
let o = list.find(v => {
|
||||||
let o = list.find(v => {
|
return v.val.includes(obj.val)
|
||||||
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)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue