自动分类问题补充及预览更改
parent
f1f27f405b
commit
9f9a799832
|
@ -642,8 +642,8 @@
|
||||||
prop="ClassifyQuestionId"
|
prop="ClassifyQuestionId"
|
||||||
>
|
>
|
||||||
<el-select v-model="form.ClassifyQuestionId" clearable>
|
<el-select v-model="form.ClassifyQuestionId" clearable>
|
||||||
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
|
<el-option v-for="item of Questions" :key="item.Id" :label="item.QuestionName"
|
||||||
:value="item.QuestionId"/>
|
:value="item.Id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|
|
@ -457,8 +457,8 @@
|
||||||
prop="ClassifyTableQuestionId"
|
prop="ClassifyTableQuestionId"
|
||||||
>
|
>
|
||||||
<el-select v-model="form.ClassifyTableQuestionId" clearable>
|
<el-select v-model="form.ClassifyTableQuestionId" clearable>
|
||||||
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
|
<el-option v-for="item of Questions" :key="item.Id" :label="item.QuestionName"
|
||||||
:value="item.QuestionId"/>
|
:value="item.Id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
v-if="question.Type === 'input'"
|
v-if="question.Type === 'input'"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
:disabled="question.TableQuestionType === 2"
|
:disabled="question.TableQuestionType === 2"
|
||||||
|
@change="(val) => { formItemChange(val, question) }"
|
||||||
/>
|
/>
|
||||||
<!-- 多行文本输入框 -->
|
<!-- 多行文本输入框 -->
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -80,6 +81,7 @@
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||||
|
@change="(val) => { formItemChange(val, question) }"
|
||||||
/>
|
/>
|
||||||
<!-- 下拉框 -->
|
<!-- 下拉框 -->
|
||||||
<el-select
|
<el-select
|
||||||
|
@ -91,11 +93,7 @@
|
||||||
question.QuestionGenre === 2) &&
|
question.QuestionGenre === 2) &&
|
||||||
!!question.DictionaryCode
|
!!question.DictionaryCode
|
||||||
"
|
"
|
||||||
@change="
|
@change="(val) => { formItemChange(val, question) }"
|
||||||
(val) => {
|
|
||||||
formItemChange(val, question);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<template v-if="question.TableQuestionType === 1">
|
<template v-if="question.TableQuestionType === 1">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -135,8 +133,8 @@
|
||||||
<el-option
|
<el-option
|
||||||
v-for="val in question.TypeValue.split('|')"
|
v-for="val in question.TypeValue.split('|')"
|
||||||
:key="val"
|
:key="val"
|
||||||
:label="val"
|
:label="val.trim()"
|
||||||
:value="val"
|
:value="val.trim()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -144,11 +142,7 @@
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-if="question.Type === 'radio'"
|
v-if="question.Type === 'radio'"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
@change="
|
@change="(val) => { formItemChange(val, question) }"
|
||||||
(val) => {
|
|
||||||
formItemChange(val, question);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<template v-if="question.DictionaryCode">
|
<template v-if="question.DictionaryCode">
|
||||||
<el-radio
|
<el-radio
|
||||||
|
@ -162,10 +156,10 @@
|
||||||
<template v-if="question.TypeValue">
|
<template v-if="question.TypeValue">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="val in question.TypeValue.split('|')"
|
v-for="val in question.TypeValue.split('|')"
|
||||||
:key="val"
|
:key="val.trim()"
|
||||||
:label="val"
|
:label="val.trim()"
|
||||||
>
|
>
|
||||||
{{ val }}
|
{{ val.trim() }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
@ -173,6 +167,7 @@
|
||||||
<el-checkbox-group
|
<el-checkbox-group
|
||||||
v-if="question.Type === 'checkbox'"
|
v-if="question.Type === 'checkbox'"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
|
@change="(val) => { formItemChange(val, question) }"
|
||||||
>
|
>
|
||||||
<template v-if="question.DictionaryCode">
|
<template v-if="question.DictionaryCode">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
|
@ -186,10 +181,10 @@
|
||||||
<template v-if="question.TypeValue">
|
<template v-if="question.TypeValue">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="val in question.TypeValue.split('|')"
|
v-for="val in question.TypeValue.split('|')"
|
||||||
:key="val"
|
:key="val.trim()"
|
||||||
:label="val"
|
:label="val.trim()"
|
||||||
>
|
>
|
||||||
{{ val }}
|
{{ val.trim() }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
|
@ -203,10 +198,23 @@
|
||||||
/>
|
/>
|
||||||
<!-- 自动分类 -->
|
<!-- 自动分类 -->
|
||||||
<el-input
|
<el-input
|
||||||
v-if="question.Type === 'class'"
|
v-if="question.Type === 'class' && !question.TypeValue"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
|
<el-radio-group
|
||||||
|
v-if="question.Type === 'class' && question.TypeValue"
|
||||||
|
v-model="questionForm[question.Id]"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<el-radio
|
||||||
|
v-for="item of question.TypeValue.split('|')"
|
||||||
|
:key="item.trim()"
|
||||||
|
:label="item.trim()"
|
||||||
|
>
|
||||||
|
{{ item.trim() }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
<!-- 自增 -->
|
<!-- 自增 -->
|
||||||
<el-input
|
<el-input
|
||||||
v-if="question.Type === 'increment'"
|
v-if="question.Type === 'increment'"
|
||||||
|
@ -219,24 +227,20 @@
|
||||||
v-if="question.Type === 'number' && question.TypeValue"
|
v-if="question.Type === 'number' && question.TypeValue"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
clearable
|
clearable
|
||||||
@change="((val)=>{formItemChange(val, question)})"
|
@change="(val) => { formItemNumberChange(val, question) }"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="val in question.TypeValue.split('|')"
|
v-for="val in question.TypeValue.split('|')"
|
||||||
:key="val"
|
:key="val"
|
||||||
:label="val"
|
:label="val.trim()"
|
||||||
:value="val"
|
:value="val.trim()"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
v-else-if="question.Type === 'number' && question.DataSource !== 1"
|
v-else-if="question.Type === 'number' && question.DataSource !== 1"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
type="number"
|
type="number"
|
||||||
@change="
|
@change="(val) => { formItemNumberChange(val, question) }"
|
||||||
(val) => {
|
|
||||||
formItemNumberChange(val, question);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
<el-input
|
<el-input
|
||||||
v-else-if="question.Type === 'number' && question.DataSource === 1"
|
v-else-if="question.Type === 'number' && question.DataSource === 1"
|
||||||
|
@ -428,6 +432,7 @@ export default {
|
||||||
QuestionsForm: {},
|
QuestionsForm: {},
|
||||||
AnswersList: [],
|
AnswersList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
classArr: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -451,21 +456,21 @@ export default {
|
||||||
this.question.ClassifyAlgorithms
|
this.question.ClassifyAlgorithms
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
setInterval(() => {
|
// setInterval(() => {
|
||||||
if (this.question.Type === "class") {
|
// if (this.question.Type === "class") {
|
||||||
let o = this.ClassifyAlgorithmsList.find((v) => {
|
// let o = this.ClassifyAlgorithmsList.find((v) => {
|
||||||
return (
|
// return (
|
||||||
this.questionForm[this.question.ClassifyQuestionId] >= v.gt &&
|
// this.questionForm[this.question.ClassifyQuestionId] >= v.gt &&
|
||||||
this.questionForm[this.question.ClassifyQuestionId] < v.lt
|
// this.questionForm[this.question.ClassifyQuestionId] < v.lt
|
||||||
);
|
// );
|
||||||
});
|
// });
|
||||||
if (this.questionForm[this.question.ClassifyQuestionId]) {
|
// if (this.questionForm[this.question.ClassifyQuestionId]) {
|
||||||
this.questionForm[this.question.Id] = o ? o.label : null;
|
// this.questionForm[this.question.Id] = o ? o.label : null;
|
||||||
} else {
|
// } else {
|
||||||
this.questionForm[this.question.Id] = null;
|
// this.questionForm[this.question.Id] = null;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}, 300);
|
// }, 300);
|
||||||
if (this.question.Type === "upload") {
|
if (this.question.Type === "upload") {
|
||||||
if (this.questionForm[this.question.Id]) {
|
if (this.questionForm[this.question.Id]) {
|
||||||
this.urls = this.questionForm[this.question.Id].split("|");
|
this.urls = this.questionForm[this.question.Id].split("|");
|
||||||
|
@ -475,19 +480,19 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.question.Type === "table") {
|
// if (this.question.Type === "table") {
|
||||||
// this.getQuestionCalculateRelation()
|
// // this.getQuestionCalculateRelation()
|
||||||
if (this.questionForm[this.question.Id]) {
|
// if (this.questionForm[this.question.Id]) {
|
||||||
this.QuestionsForm = {};
|
// this.QuestionsForm = {};
|
||||||
this.question.TableQuestions.Questions.forEach((v) => {
|
// this.question.TableQuestions.Questions.forEach((v) => {
|
||||||
if (v.Type === "number") {
|
// if (v.Type === "number") {
|
||||||
this.$set(this.QuestionsForm, v.Id, 0);
|
// this.$set(this.QuestionsForm, v.Id, 0);
|
||||||
} else {
|
// } else {
|
||||||
this.$set(this.QuestionsForm, v.Id, "");
|
// this.$set(this.QuestionsForm, v.Id, "");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getQuestionCalculateRelation() {
|
getQuestionCalculateRelation() {
|
||||||
|
@ -499,11 +504,13 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
this.AnswersList.push(this.QuestionsForm);
|
// this.AnswersList.push(this.QuestionsForm);
|
||||||
this.$emit("setFormItemData", {
|
this.$emit("setFormItemData", {
|
||||||
key: this.question.Id,
|
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.formItemNumberChange(this.question.Id, true);
|
||||||
this.addOrEdit.visible = false;
|
this.addOrEdit.visible = false;
|
||||||
},
|
},
|
||||||
|
@ -689,11 +696,17 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openAddTableCol(row) {
|
openAddTableCol(row) {
|
||||||
|
this.QuestionsForm = {}
|
||||||
|
this.classArr = []
|
||||||
this.addOrEdit.title =
|
this.addOrEdit.title =
|
||||||
row.QuestionName + this.$t("trials:readingUnit:qsList:title:tableQs"); // '表格问题'
|
row.QuestionName + this.$t("trials:readingUnit:qsList:title:tableQs"); // '表格问题'
|
||||||
this.QuestionsList = row.TableQuestions.Questions;
|
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=>{
|
row.TableQuestions.Questions.map(i=>{
|
||||||
this.$set(this.QuestionsForm, i.Id, null)
|
this.$set(this.QuestionsForm, i.Id, null)
|
||||||
})
|
})
|
||||||
|
@ -734,6 +747,8 @@ export default {
|
||||||
// }
|
// }
|
||||||
this.$emit("setFormItemData", { key: qs.Id, val: val });
|
this.$emit("setFormItemData", { key: qs.Id, val: val });
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.$emit("setFormItemData", { key: question.Id, val: v })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetChild(obj) {
|
resetChild(obj) {
|
||||||
|
@ -751,7 +766,29 @@ export default {
|
||||||
this.$emit("setFormItemData", obj);
|
this.$emit("setFormItemData", obj);
|
||||||
},
|
},
|
||||||
setTblFormItemData(obj) {
|
setTblFormItemData(obj) {
|
||||||
|
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) {
|
||||||
|
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) {
|
resetTblFormItemData(obj) {
|
||||||
this.$set(this.QuestionsForm, obj.key, null)
|
this.$set(this.QuestionsForm, obj.key, null)
|
||||||
|
|
|
@ -103,10 +103,23 @@
|
||||||
/>
|
/>
|
||||||
<!-- 自动计算 -->
|
<!-- 自动计算 -->
|
||||||
<el-input
|
<el-input
|
||||||
v-if="question.Type==='class'"
|
v-if="question.Type === 'class' && !question.TypeValue"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
|
<el-radio-group
|
||||||
|
v-if="question.Type === 'class' && question.TypeValue"
|
||||||
|
v-model="questionForm[question.Id]"
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
<el-radio
|
||||||
|
v-for="item of question.TypeValue.split('|')"
|
||||||
|
:key="item.trim()"
|
||||||
|
:label="item.trim()"
|
||||||
|
>
|
||||||
|
{{ item.trim() }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
<!-- 自增 -->
|
<!-- 自增 -->
|
||||||
<el-input
|
<el-input
|
||||||
v-if="question.Type==='increment'"
|
v-if="question.Type==='increment'"
|
||||||
|
@ -240,8 +253,7 @@ export default {
|
||||||
urls: [],
|
urls: [],
|
||||||
organList: [],
|
organList: [],
|
||||||
QuestionsList: [],
|
QuestionsList: [],
|
||||||
QuestionsForm: {},
|
QuestionsForm: {}
|
||||||
timer: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -269,21 +281,7 @@ export default {
|
||||||
this.question.ClassifyAlgorithms
|
this.question.ClassifyAlgorithms
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.timer = setInterval(() => {
|
|
||||||
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.question.Type === 'upload') {
|
||||||
if (this.questionForm[this.question.Id]) {
|
if (this.questionForm[this.question.Id]) {
|
||||||
this.urls = this.questionForm[this.question.Id].split('|')
|
this.urls = this.questionForm[this.question.Id].split('|')
|
||||||
|
@ -302,9 +300,6 @@ export default {
|
||||||
this.getOrganInfoList()
|
this.getOrganInfoList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
|
||||||
clearInterval(this.timer)
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
save() {
|
save() {
|
||||||
},
|
},
|
||||||
|
@ -326,9 +321,6 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
formItemChange(v, question) {
|
formItemChange(v, question) {
|
||||||
if (question.Childrens.length > 0) {
|
|
||||||
this.resetChild(question.Childrens)
|
|
||||||
}
|
|
||||||
if (question.TableQuestionType === 1 && question.RelationQuestions.length > 0) {
|
if (question.TableQuestionType === 1 && question.RelationQuestions.length > 0) {
|
||||||
var index = this.organList.findIndex(item => item[question.DataTableColumn] === v)
|
var index = this.organList.findIndex(item => item[question.DataTableColumn] === v)
|
||||||
if (index < 0) return
|
if (index < 0) return
|
||||||
|
@ -340,6 +332,8 @@ export default {
|
||||||
// }
|
// }
|
||||||
this.$emit('setFormItemData', { key: qs.Id, val: val })
|
this.$emit('setFormItemData', { key: qs.Id, val: val })
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.$emit('setFormItemData', { key: question.Id, val: v })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formItemNumberChange(v, question) {
|
formItemNumberChange(v, question) {
|
||||||
|
@ -359,21 +353,8 @@ export default {
|
||||||
setFormItemData(obj) {
|
setFormItemData(obj) {
|
||||||
this.$emit('setFormItemData', obj)
|
this.$emit('setFormItemData', obj)
|
||||||
},
|
},
|
||||||
async uploadScreenshot(param) {
|
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()
|
|
||||||
},
|
},
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
// 检测文件类型是否符合要求
|
// 检测文件类型是否符合要求
|
||||||
|
|
|
@ -405,7 +405,7 @@
|
||||||
:label="$t('trials:qcCfg:table:typeValue')"
|
:label="$t('trials:qcCfg:table:typeValue')"
|
||||||
prop="TypeValue"
|
prop="TypeValue"
|
||||||
:rules="[
|
: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']},
|
{validator: validateTypeVal, trigger: ['blur', 'change']},
|
||||||
{max: 200, message: `${this.$t('common:ruleMessage:maxLength')} 200`}]"
|
{max: 200, message: `${this.$t('common:ruleMessage:maxLength')} 200`}]"
|
||||||
>
|
>
|
||||||
|
@ -663,8 +663,12 @@
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.QuestionId" clearable :disabled="!scope.row.IsTable">
|
<el-select v-model="scope.row.QuestionId" clearable :disabled="!scope.row.IsTable">
|
||||||
<el-option v-for="item of tableQuestions" :key="item.QuestionId" :label="item.QuestionName"
|
<el-option
|
||||||
:value="item.QuestionId"/>
|
v-for="item of tableQuestions"
|
||||||
|
:key="item.Id"
|
||||||
|
:label="item.QuestionName"
|
||||||
|
:value="item.Id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -677,13 +681,13 @@
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-if="!scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable>
|
<el-select v-if="!scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable>
|
||||||
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
|
<el-option v-for="item of numberQuestions" :key="item.Id" :label="item.QuestionName"
|
||||||
:value="item.QuestionId"/>
|
:value="item.Id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-if="scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable>
|
<el-select v-if="scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item of !scope.row.QuestionId ? [] : tableQuestions.find(v => v.QuestionId === scope.row.QuestionId).TableQuestions"
|
v-for="item of !scope.row.QuestionId ? [] : tableQuestions.find(v => v.Id === scope.row.QuestionId).TableQuestions"
|
||||||
:key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId"/>
|
:key="item.Id" :label="item.QuestionName" :value="item.Id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -762,8 +766,29 @@
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 分类 -->
|
<!-- 分类 -->
|
||||||
|
<el-form-item
|
||||||
|
v-if="form.Type === 'class'"
|
||||||
|
:label="$t('trials:readingUnit:qsList:title:ClassifyType')"
|
||||||
|
prop="ClassifyType"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-radio-group
|
||||||
|
v-model="form.ClassifyType"
|
||||||
|
@change="classifyTypeChange"
|
||||||
|
>
|
||||||
|
<el-radio
|
||||||
|
v-for="item of $d.ClassifyType"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.value"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="form.Type === 'class'"
|
v-if="form.Type === 'class' && form.ClassifyType === 0"
|
||||||
:label="$t('trials:readingUnit:label:ClassifyQuestion')"
|
:label="$t('trials:readingUnit:label:ClassifyQuestion')"
|
||||||
prop="ClassifyQuestionId"
|
prop="ClassifyQuestionId"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
@ -771,12 +796,29 @@
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<el-select v-model="form.ClassifyQuestionId" clearable>
|
<el-select v-model="form.ClassifyQuestionId" clearable>
|
||||||
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
|
<el-option v-for="item in numberQuestions" :key="item.Id" :label="item.QuestionName"
|
||||||
:value="item.QuestionId"/>
|
:value="item.Id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="form.Type === 'class'"
|
v-if="form.Type === 'class' && form.ClassifyType === 1"
|
||||||
|
:label="$t('trials:readingUnit:label:ClassifyQuestion')"
|
||||||
|
prop="ClassifyQuestionId"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-select v-model="form.ClassifyQuestionId" clearable @change="classifyQuestionChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in selectQuestions"
|
||||||
|
:key="item.Id"
|
||||||
|
:label="item.QuestionName"
|
||||||
|
:value="item.Id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="form.Type === 'class' && form.ClassifyType === 0"
|
||||||
:label="$t('trials:readingUnit:label:ClassifyAlgorithms')"
|
:label="$t('trials:readingUnit:label:ClassifyAlgorithms')"
|
||||||
prop="ClassifyAlgorithms"
|
prop="ClassifyAlgorithms"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
@ -823,6 +865,51 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="form.Type === 'class' && form.ClassifyType === 1"
|
||||||
|
:label="$t('trials:readingUnit:label:ClassifyAlgorithms')"
|
||||||
|
prop="ClassifyAlgorithms"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-table
|
||||||
|
ref="CalculateTable"
|
||||||
|
:data="ClassifyAlgorithmsList"
|
||||||
|
style="margin: 10px;width: calc(100% - 20px)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<!-- 运算类型 -->
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('trials:readingUnit:label:label')"
|
||||||
|
show-overflow-tooltip
|
||||||
|
min-width="70"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.label }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- 选项 -->
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('trials:readingUnit:label:options')"
|
||||||
|
show-overflow-tooltip
|
||||||
|
min-width="128"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-select v-model="scope.row.val" multiple>
|
||||||
|
<el-option
|
||||||
|
v-for="item in classifyQuestionOptions"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||||||
|
@ -904,7 +991,7 @@ export default {
|
||||||
ParentTriggerValueList: [],
|
ParentTriggerValueList: [],
|
||||||
ShowOrder: 0,
|
ShowOrder: 0,
|
||||||
ShowQuestion: 0,
|
ShowQuestion: 0,
|
||||||
IsRequired: 2,
|
IsRequired: 0,
|
||||||
IsJudgeQuestion: false,
|
IsJudgeQuestion: false,
|
||||||
GroupName: '',
|
GroupName: '',
|
||||||
GroupEnName: '',
|
GroupEnName: '',
|
||||||
|
@ -937,7 +1024,8 @@ export default {
|
||||||
LimitShow: 0,
|
LimitShow: 0,
|
||||||
HighlightAnswerList: [],
|
HighlightAnswerList: [],
|
||||||
ExportIdentification: 0,
|
ExportIdentification: 0,
|
||||||
ExportResult: []
|
ExportResult: [],
|
||||||
|
ClassifyType: null,
|
||||||
// IsEnable: true
|
// IsEnable: true
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
@ -977,10 +1065,14 @@ export default {
|
||||||
groupOptions: [],
|
groupOptions: [],
|
||||||
isParentExistGroup: false,
|
isParentExistGroup: false,
|
||||||
lesionTypes: [],
|
lesionTypes: [],
|
||||||
Questions: [],
|
|
||||||
tableQuestions: [],
|
tableQuestions: [],
|
||||||
isShow: true,
|
isShow: true,
|
||||||
validateTypeVal:null
|
validateTypeVal:null,
|
||||||
|
numberQuestions: [],
|
||||||
|
classQuestions: [],
|
||||||
|
selectQuestions: [],
|
||||||
|
classifyQuestionOptions: [],
|
||||||
|
selectedClassifyOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -990,14 +1082,14 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.validateTypeVal = (rule, value, callback) => {
|
this.validateTypeVal = (rule, value, callback) => {
|
||||||
if (value === '') {
|
if (value === '' && this.form.Type !== 'number') {
|
||||||
callback(new Error(this.$t('common:ruleMessage:specify')))
|
callback(new Error(this.$t('common:ruleMessage:specify')))
|
||||||
} else {
|
} else {
|
||||||
var arr = value.split('|')
|
var arr = value.split('|')
|
||||||
if (new Set(arr).size !== arr.length) {
|
if (new Set(arr).size !== arr.length) {
|
||||||
// '选项不允许存在相同值'
|
// '选项不允许存在相同值'
|
||||||
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg0')))
|
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg0')))
|
||||||
} else if (this.form.Type === 'number' && arr.findIndex(i=>isNaN(parseFloat(i)) && i!== 'NE') > -1) {
|
} else if (value && this.form.Type === 'number' && arr.findIndex(i=>isNaN(parseFloat(i)) && i!== 'NE') > -1) {
|
||||||
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg5')))
|
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg5')))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
|
@ -1006,22 +1098,48 @@ export default {
|
||||||
}
|
}
|
||||||
this.initForm()
|
this.initForm()
|
||||||
this.getBasicConfigSelect()
|
this.getBasicConfigSelect()
|
||||||
this.getCalculateQuestions('number')
|
this.getCalculateQuestions(['number', 'select', 'radio', 'basicTable'])
|
||||||
this.getCalculateQuestions('table')
|
// this.getTableQuestions()
|
||||||
|
// this.getCalculateQuestions('number')
|
||||||
|
// this.getCalculateQuestions('table')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
classifyTypeChange(v) {
|
||||||
|
this.form.ClassifyQuestionId = ''
|
||||||
|
if (this.ClassifyAlgorithmsList.length === 0 && this.form.TypeValue) {
|
||||||
|
let list = this.form.TypeValue.split('|')
|
||||||
|
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
||||||
|
return this.form.ClassifyType === 0 ? {
|
||||||
|
label: res.trim(),
|
||||||
|
lt: 0,
|
||||||
|
gt: 0
|
||||||
|
} : {
|
||||||
|
label: res.trim(),
|
||||||
|
val: []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
typeValueChange(v) {
|
typeValueChange(v) {
|
||||||
this.form.DefaultValue = null
|
this.form.DefaultValue = null
|
||||||
var list = v.split('|')
|
var list = v.split('|')
|
||||||
this.form.ClassifyAlgorithms = null
|
this.form.ClassifyAlgorithms = null
|
||||||
var arr = Object.assign([], this.ClassifyAlgorithmsList)
|
if (this.form.ClassifyType === 0) {
|
||||||
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
||||||
return {
|
return {
|
||||||
label: res,
|
label: res.trim(),
|
||||||
lt: arr[i] ? arr[i].lt : 0,
|
lt: 0,
|
||||||
gt: arr[i] ? arr[i].gt : 0
|
gt: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else if (this.form.ClassifyType === 1) {
|
||||||
|
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
||||||
|
return {
|
||||||
|
label: res.trim(),
|
||||||
|
val: []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getBasicConfigSelect() {
|
getBasicConfigSelect() {
|
||||||
// getBasicConfigSelect('Reading_eCRF_Criterion').then(res => {
|
// getBasicConfigSelect('Reading_eCRF_Criterion').then(res => {
|
||||||
|
@ -1072,18 +1190,54 @@ export default {
|
||||||
this.isShow = true
|
this.isShow = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCalculateQuestions(type) {
|
async getCalculateQuestions(types) {
|
||||||
getCalculateQuestions({
|
try {
|
||||||
TrialCriterionId: this.trialCriterionId,
|
let params = {
|
||||||
type: type
|
trialCriterionId: this.trialCriterionId,
|
||||||
}).then(res => {
|
typeList: types
|
||||||
if (type === 'table') {
|
|
||||||
this.tableQuestions = res.Result
|
|
||||||
} else {
|
|
||||||
this.Questions = res.Result
|
|
||||||
}
|
}
|
||||||
})
|
let res = await getCalculateQuestions(params)
|
||||||
|
if (res.Result) {
|
||||||
|
this.tableQuestions = res.Result.filter(i=>i.Type === 'basicTable')
|
||||||
|
this.selectQuestions = res.Result.filter(i=>i.Type === 'select' || i.Type === 'radio')
|
||||||
|
this.numberQuestions = res.Result.filter(i=>i.Type === 'number')
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
async getTableQuestions() {
|
||||||
|
try {
|
||||||
|
let params = {
|
||||||
|
trialCriterionId: this.trialCriterionId,
|
||||||
|
type: 'basicTable'
|
||||||
|
}
|
||||||
|
let res = await getCalculateQuestions(params)
|
||||||
|
if (res.Result) {
|
||||||
|
this.tableQuestions = res.Result
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
classifyQuestionChange (v){
|
||||||
|
let obj = this.selectQuestions.find(i=>i.Id === v)
|
||||||
|
let arr = obj && obj.TypeValue ? obj.TypeValue.split('|') : []
|
||||||
|
arr = arr.length > 0 ? arr.map(i=>i.trim()) : []
|
||||||
|
this.classifyQuestionOptions = arr
|
||||||
|
},
|
||||||
|
// getCalculateQuestions(type) {
|
||||||
|
// getCalculateQuestions({
|
||||||
|
// TrialCriterionId: this.trialCriterionId,
|
||||||
|
// type: type
|
||||||
|
// }).then(res => {
|
||||||
|
// if (type === 'table') {
|
||||||
|
// this.tableQuestions = res.Result
|
||||||
|
// } else {
|
||||||
|
// this.Questions = res.Result
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// },
|
||||||
async initForm() {
|
async initForm() {
|
||||||
// this.Questions = await getCalculateQuestions({
|
// this.Questions = await getCalculateQuestions({
|
||||||
// QuestionId: this.trialCriterionId,
|
// QuestionId: this.trialCriterionId,
|
||||||
|
@ -1112,6 +1266,9 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.form.ClassifyQuestionId) {
|
||||||
|
this.classifyQuestionChange(this.form.ClassifyQuestionId)
|
||||||
|
}
|
||||||
if (this.form.ParentId !== '' && this.form.ParentId !== null && this.form.GroupName !== '') {
|
if (this.form.ParentId !== '' && this.form.ParentId !== null && this.form.GroupName !== '') {
|
||||||
this.isParentExistGroup = true
|
this.isParentExistGroup = true
|
||||||
}
|
}
|
||||||
|
@ -1344,6 +1501,7 @@ export default {
|
||||||
form.HighlightAnswerList = []
|
form.HighlightAnswerList = []
|
||||||
form.ExportIdentification = 0
|
form.ExportIdentification = 0
|
||||||
form.ExportResult = []
|
form.ExportResult = []
|
||||||
|
form.ClassifyType = null
|
||||||
},
|
},
|
||||||
getLesionType() {
|
getLesionType() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { getTrialReadingQuestion, getCustomQuestionPreview, getCustomTableQuestionPreview, getQuestionCalculateRelation } from '@/api/trials'
|
import { getTrialReadingQuestion, getCustomQuestionPreview, getCustomTableQuestionPreview, getQuestionCalculateRelation} from '@/api/trials'
|
||||||
import QuestionFormItem from './QuestionFormItem'
|
import QuestionFormItem from './QuestionFormItem'
|
||||||
export default {
|
export default {
|
||||||
name: 'QuestionsPreview',
|
name: 'QuestionsPreview',
|
||||||
|
@ -57,7 +57,8 @@ export default {
|
||||||
isRender: false,
|
isRender: false,
|
||||||
readingTaskState: 0,
|
readingTaskState: 0,
|
||||||
activeName: 0,
|
activeName: 0,
|
||||||
CalculationList: []
|
CalculationList: [],
|
||||||
|
classArr: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -104,8 +105,8 @@ export default {
|
||||||
if (res.OtherInfo.FormType === 2) {
|
if (res.OtherInfo.FormType === 2) {
|
||||||
if (res.Result.MultiPage.length > 0) {
|
if (res.Result.MultiPage.length > 0) {
|
||||||
res.Result.MultiPage.map((v) => {
|
res.Result.MultiPage.map((v) => {
|
||||||
if (v.Type === 'group' && v.Childrens.length === 0 && i.Type !== 'table') return
|
// if (v.Type === 'group' && v.Childrens.length === 0 && i.Type !== 'table' && i.Type !== 'basicTable') return
|
||||||
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Type !== 'table') {
|
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Type !== 'table' && i.Type !== 'basicTable') {
|
||||||
this.$set(this.questionForm, v.Id, v.Answer)
|
this.$set(this.questionForm, v.Id, v.Answer)
|
||||||
}
|
}
|
||||||
if (v.Childrens.length > 0) {
|
if (v.Childrens.length > 0) {
|
||||||
|
@ -117,10 +118,16 @@ export default {
|
||||||
}
|
}
|
||||||
if (res.Result.PublicPage.length > 0) {
|
if (res.Result.PublicPage.length > 0) {
|
||||||
res.Result.PublicPage.map((v) => {
|
res.Result.PublicPage.map((v) => {
|
||||||
if (v.Type === 'group' && v.Childrens.length === 0 && i.Type !== 'table') return
|
// if (v.Type === 'group' && v.Childrens.length === 0 && i.Type !== 'table') return
|
||||||
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Type !== 'table') {
|
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Type !== 'table' && i.Type !== 'basicTable') {
|
||||||
this.$set(this.questionForm, v.Id, v.Answer)
|
this.$set(this.questionForm, v.Id, v.Answer)
|
||||||
}
|
}
|
||||||
|
if (v.Type === 'table') {
|
||||||
|
this.$set(this.questionForm, v.Id, [])
|
||||||
|
}
|
||||||
|
if (v.Type === 'class') {
|
||||||
|
this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
|
||||||
|
}
|
||||||
if (v.Childrens.length > 0) {
|
if (v.Childrens.length > 0) {
|
||||||
this.setChild(v.Childrens)
|
this.setChild(v.Childrens)
|
||||||
}
|
}
|
||||||
|
@ -129,15 +136,15 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res.Result.SinglePage.map((v) => {
|
res.Result.SinglePage.map((v) => {
|
||||||
if (v.Type === 'group' && v.Childrens.length === 0 && i.Type !== 'table') return
|
// if (v.Type === 'group' && v.Childrens.length === 0 && i.Type !== 'table') return
|
||||||
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Type !== 'table' && i.Type !== 'number') {
|
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Type !== 'table' && i.Type !== 'basicTable') {
|
||||||
this.$set(this.questionForm, v.Id, v.Answer)
|
this.$set(this.questionForm, v.Id, v.Answer)
|
||||||
}
|
}
|
||||||
if (i.Type === 'table') {
|
if (v.Type === 'table') {
|
||||||
this.$set(this.questionForm, v.Id, [])
|
this.$set(this.questionForm, v.Id, [])
|
||||||
}
|
}
|
||||||
if (i.Type === 'number') {
|
if (v.Type === 'class') {
|
||||||
this.$set(this.questionForm, v.Id, v.Answer)
|
this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
|
||||||
}
|
}
|
||||||
if (v.Childrens.length > 0) {
|
if (v.Childrens.length > 0) {
|
||||||
this.setChild(v.Childrens)
|
this.setChild(v.Childrens)
|
||||||
|
@ -151,14 +158,17 @@ export default {
|
||||||
},
|
},
|
||||||
setChild(obj) {
|
setChild(obj) {
|
||||||
obj.forEach(i => {
|
obj.forEach(i => {
|
||||||
if (i.Type !== 'group' && i.Type !== 'summary' && i.Id && i.Type !== 'table') {
|
if (i.Type !== 'group' && i.Type !== 'summary' && i.Id && i.Type !== 'table' && i.Type !== 'basicTable') {
|
||||||
this.$set(this.questionForm, i.Id, i.Answer)
|
this.$set(this.questionForm, i.Id, i.Answer)
|
||||||
}
|
}
|
||||||
if (i.Type === 'table') {
|
if (i.Type === 'table') {
|
||||||
this.$set(this.questionForm, i.Id, [])
|
this.$set(this.questionForm, i.Id, [])
|
||||||
}
|
}
|
||||||
if (i.Type === 'number') {
|
// if (i.Type === 'number') {
|
||||||
this.$set(this.questionForm, i.Id, i.Answer)
|
// this.$set(this.questionForm, i.Id, i.Answer)
|
||||||
|
// }
|
||||||
|
if (i.Type === 'class') {
|
||||||
|
this.classArr.push({triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType})
|
||||||
}
|
}
|
||||||
if (i.Childrens && i.Childrens.length > 0) {
|
if (i.Childrens && i.Childrens.length > 0) {
|
||||||
this.setChild(i.Childrens)
|
this.setChild(i.Childrens)
|
||||||
|
@ -169,7 +179,34 @@ export default {
|
||||||
this.questionForm[v] = ''
|
this.questionForm[v] = ''
|
||||||
},
|
},
|
||||||
setFormItemData(obj) {
|
setFormItemData(obj) {
|
||||||
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val)))
|
if (obj.type && obj.type === 'table') {
|
||||||
|
let arr = this.questionForm[obj.key] || []
|
||||||
|
arr.push(JSON.parse(JSON.stringify(obj.val)))
|
||||||
|
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.$set(this.questionForm, qs.classId, answer)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,7 +394,7 @@
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.TableQuestionId" clearable>
|
<el-select v-model="scope.row.TableQuestionId" clearable>
|
||||||
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId" />
|
<el-option v-for="item of numberQuestions" :key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -606,8 +606,29 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 分类 -->
|
<!-- 分类 -->
|
||||||
|
<el-form-item
|
||||||
|
v-if="form.Type === 'class'"
|
||||||
|
:label="$t('trials:readingUnit:qsList:title:ClassifyType')"
|
||||||
|
prop="ClassifyType"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-radio-group
|
||||||
|
v-model="form.ClassifyType"
|
||||||
|
@change="classifyTypeChange"
|
||||||
|
>
|
||||||
|
<el-radio
|
||||||
|
v-for="item of $d.ClassifyType"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.value"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="form.Type === 'class'"
|
v-if="form.Type === 'class' && form.ClassifyType === 0"
|
||||||
:label="$t('trials:readingUnit:label:ClassifyQuestion')"
|
:label="$t('trials:readingUnit:label:ClassifyQuestion')"
|
||||||
prop="ClassifyTableQuestionId"
|
prop="ClassifyTableQuestionId"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
@ -615,12 +636,29 @@
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<el-select v-model="form.ClassifyTableQuestionId" clearable>
|
<el-select v-model="form.ClassifyTableQuestionId" clearable>
|
||||||
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
|
<el-option v-for="item of numberQuestions" :key="item.QuestionId" :label="item.QuestionName"
|
||||||
:value="item.QuestionId"/>
|
:value="item.QuestionId"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="form.Type === 'class'"
|
v-if="form.Type === 'class' && form.ClassifyType === 1"
|
||||||
|
:label="$t('trials:readingUnit:label:ClassifyQuestion')"
|
||||||
|
prop="ClassifyTableQuestionId"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<el-select v-model="form.ClassifyTableQuestionId" clearable @change="classifyTableQuestionChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in selectQuestions"
|
||||||
|
:key="item.QuestionId"
|
||||||
|
:label="item.QuestionName"
|
||||||
|
:value="item.QuestionId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="form.Type === 'class' && form.ClassifyType === 0"
|
||||||
:label="$t('trials:readingUnit:label:ClassifyAlgorithms')"
|
:label="$t('trials:readingUnit:label:ClassifyAlgorithms')"
|
||||||
prop="ClassifyAlgorithms"
|
prop="ClassifyAlgorithms"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
@ -667,6 +705,51 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="form.Type === 'class' && form.ClassifyType === 1"
|
||||||
|
:label="$t('trials:readingUnit:label:ClassifyAlgorithms')"
|
||||||
|
prop="ClassifyAlgorithms"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-table
|
||||||
|
ref="CalculateTable"
|
||||||
|
:data="ClassifyAlgorithmsList"
|
||||||
|
style="margin: 10px;width: calc(100% - 20px)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<!-- 运算类型 -->
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('trials:readingUnit:label:label')"
|
||||||
|
show-overflow-tooltip
|
||||||
|
min-width="70"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.label }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- 选项 -->
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('trials:readingUnit:label:options')"
|
||||||
|
show-overflow-tooltip
|
||||||
|
min-width="128"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-select v-model="scope.row.val" multiple>
|
||||||
|
<el-option
|
||||||
|
v-for="item in classifyQuestionOptions"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -764,7 +847,8 @@ export default {
|
||||||
ClassifyAlgorithms: null,
|
ClassifyAlgorithms: null,
|
||||||
ExportIdentification: 0,
|
ExportIdentification: 0,
|
||||||
ExportResult: [],
|
ExportResult: [],
|
||||||
ImageCount: 0
|
ImageCount: 0,
|
||||||
|
ClassifyType: null
|
||||||
// IsEnable: true
|
// IsEnable: true
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
@ -803,11 +887,15 @@ export default {
|
||||||
tblOptions: [],
|
tblOptions: [],
|
||||||
colOptions: [],
|
colOptions: [],
|
||||||
dicList: [],
|
dicList: [],
|
||||||
Questions: [],
|
|
||||||
tableQuestions: [],
|
tableQuestions: [],
|
||||||
LimitEdit: 0,
|
LimitEdit: 0,
|
||||||
highlightAnswers: [],
|
highlightAnswers: [],
|
||||||
validateTypeVal: null
|
validateTypeVal: null,
|
||||||
|
numberQuestions: [],
|
||||||
|
classQuestions: [],
|
||||||
|
selectQuestions: [],
|
||||||
|
classifyQuestionOptions: [],
|
||||||
|
selectedClassifyOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -833,14 +921,14 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.validateTypeVal = (rule, value, callback) => {
|
this.validateTypeVal = (rule, value, callback) => {
|
||||||
if (value === '') {
|
if (value === '' && this.form.Type !== 'number') {
|
||||||
callback(new Error(this.$t('common:ruleMessage:specify')))
|
callback(new Error(this.$t('common:ruleMessage:specify')))
|
||||||
} else {
|
} else {
|
||||||
var arr = value.split('|')
|
var arr = value.split('|')
|
||||||
if (new Set(arr).size !== arr.length) {
|
if (new Set(arr).size !== arr.length) {
|
||||||
// '选项不允许存在相同值'
|
// '选项不允许存在相同值'
|
||||||
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg0')))
|
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg0')))
|
||||||
} else if (this.form.Type === 'number' && arr.findIndex(i=>isNaN(parseFloat(i)) && i!== 'NE') > -1) {
|
} else if (value && this.form.Type === 'number' && arr.findIndex(i=>isNaN(parseFloat(i)) && i!== 'NE') > -1) {
|
||||||
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg5')))
|
callback(new Error(this.$t('trials:readingUnit:qsList:message:msg5')))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
|
@ -848,10 +936,43 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.initForm()
|
this.initForm()
|
||||||
this.getCalculateTableQuestions('number')
|
this.getCalculateTableQuestions(['number', 'select', 'radio', 'basicTable'])
|
||||||
this.getCalculateTableQuestions('table')
|
// this.getCalculateTableQuestions('number')
|
||||||
|
// this.getCalculateTableQuestions('table')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getCalculateTableQuestions(types) {
|
||||||
|
try {
|
||||||
|
let params = {
|
||||||
|
QuestionId: this.readingQuestionId,
|
||||||
|
typeList: types
|
||||||
|
}
|
||||||
|
let res = await getCalculateTableQuestions(params)
|
||||||
|
if (res.Result) {
|
||||||
|
this.tableQuestions = res.Result.filter(i=>i.Type === 'basicTable')
|
||||||
|
this.selectQuestions = res.Result.filter(i=>i.Type === 'select' || i.Type === 'radio')
|
||||||
|
this.numberQuestions = res.Result.filter(i=>i.Type === 'number')
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
classifyTypeChange(v) {
|
||||||
|
this.form.ClassifyTableQuestionId = ''
|
||||||
|
if (this.ClassifyAlgorithmsList.length === 0 && this.form.TypeValue) {
|
||||||
|
let list = this.form.TypeValue.split('|')
|
||||||
|
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
||||||
|
return this.form.ClassifyType === 0 ? {
|
||||||
|
label: res.trim(),
|
||||||
|
lt: 0,
|
||||||
|
gt: 0
|
||||||
|
} : {
|
||||||
|
label: res.trim(),
|
||||||
|
val: []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
deleteCustomCalculateMark(index) {
|
deleteCustomCalculateMark(index) {
|
||||||
this.form.CalculateQuestions.splice(index, 1)
|
this.form.CalculateQuestions.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
@ -866,14 +987,22 @@ export default {
|
||||||
this.form.DefaultValue = null
|
this.form.DefaultValue = null
|
||||||
var list = v.split('|')
|
var list = v.split('|')
|
||||||
this.form.ClassifyAlgorithms = null
|
this.form.ClassifyAlgorithms = null
|
||||||
var arr = Object.assign([], this.ClassifyAlgorithmsList)
|
if (this.form.ClassifyType === 0) {
|
||||||
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
||||||
return {
|
return {
|
||||||
label: res,
|
label: res.trim(),
|
||||||
lt: arr[i] ? arr[i].lt : 0,
|
lt: 0,
|
||||||
gt: arr[i] ? arr[i].gt : 0
|
gt: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else if (this.form.ClassifyType === 1) {
|
||||||
|
this.ClassifyAlgorithmsList = list.map((res, i) => {
|
||||||
|
return {
|
||||||
|
label: res.trim(),
|
||||||
|
val: []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
CustomCalculateMarkChange() {
|
CustomCalculateMarkChange() {
|
||||||
if (this.form.CustomCalculateMark <= 4) {
|
if (this.form.CustomCalculateMark <= 4) {
|
||||||
|
@ -898,17 +1027,23 @@ export default {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCalculateTableQuestions(type) {
|
// getCalculateTableQuestions(types) {
|
||||||
getCalculateTableQuestions({
|
// getCalculateTableQuestions({
|
||||||
QuestionId: this.readingQuestionId,
|
// QuestionId: this.readingQuestionId,
|
||||||
type: type
|
// typeList: types
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if (type === 'table') {
|
// if (type === 'table') {
|
||||||
this.tableQuestions = res.Result
|
// this.tableQuestions = res.Result
|
||||||
} else {
|
// } else {
|
||||||
this.Questions = res.Result
|
// this.Questions = res.Result
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
// },
|
||||||
|
classifyTableQuestionChange (v){
|
||||||
|
let obj = this.selectQuestions.find(i=>i.QuestionId === v)
|
||||||
|
let arr = obj && obj.TypeValue ? obj.TypeValue.split('|') : []
|
||||||
|
arr = arr.length > 0 ? arr.map(i=>i.trim()) : []
|
||||||
|
this.classifyQuestionOptions = arr
|
||||||
},
|
},
|
||||||
async initForm() {
|
async initForm() {
|
||||||
await this.getParentQuestions()
|
await this.getParentQuestions()
|
||||||
|
@ -960,6 +1095,9 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.form.ClassifyTableQuestionId) {
|
||||||
|
this.classifyQuestionChange(this.form.ClassifyTableQuestionId)
|
||||||
|
}
|
||||||
if (!this.data.ShowOrder) {
|
if (!this.data.ShowOrder) {
|
||||||
if (this.list.length > 0) {
|
if (this.list.length > 0) {
|
||||||
var ShowOrderList = this.list.map(v => v.ShowOrder)
|
var ShowOrderList = this.list.map(v => v.ShowOrder)
|
||||||
|
@ -1120,6 +1258,7 @@ export default {
|
||||||
form.ExportIdentification = 0
|
form.ExportIdentification = 0
|
||||||
form.ExportResult = []
|
form.ExportResult = []
|
||||||
form.ImageCount = 0
|
form.ImageCount = 0
|
||||||
|
form.ClassifyType = null
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
|
Loading…
Reference in New Issue