自定义标准运算类型补充
parent
bc6f15388d
commit
5619412556
|
@ -67,7 +67,7 @@
|
|||
:label="`${question.QuestionName}`"
|
||||
:prop="question.Id"
|
||||
:rules="[
|
||||
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(questionForm[question.RelevanceId])))) && question.Type!=='group' && question.Type!=='summary',
|
||||
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : questionForm[question.RelevanceId].toString())))) && question.Type!=='group' && question.Type!=='summary',
|
||||
message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
|
||||
]"
|
||||
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
|
||||
|
@ -202,11 +202,23 @@
|
|||
/>
|
||||
<!-- 数值 -->
|
||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||
|
||||
<el-select
|
||||
v-if="question.Type === 'number' && question.TypeValue"
|
||||
v-model="questionForm[question.Id]"
|
||||
clearable
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val.trim()"
|
||||
:value="val.trim()"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
type="number"
|
||||
v-if="question.Type === 'number' && question.DataSource !== 1"
|
||||
@change="((val)=>{formItemNumberChange(val, question)})"
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));console.log(localStorage.getItem('digitPlaces'))"
|
||||
@input="limitInput($event, questionForm, question.Id)"
|
||||
v-model="questionForm[question.Id]"
|
||||
|
@ -241,43 +253,7 @@
|
|||
<el-button slot="default" class="el-icon-plus">
|
||||
{{this.$t('common:button:upload')}}
|
||||
</el-button>
|
||||
<!-- <div slot="file" slot-scope="{file}">-->
|
||||
<!-- <div class="el-upload-list__item-name"></div>-->
|
||||
<!--<!– <img–>-->
|
||||
<!--<!– class="el-upload-list__item-thumbnail"–>-->
|
||||
<!--<!– :src="OSSclientConfig.basePath + file.url"–>-->
|
||||
<!--<!– alt=""–>-->
|
||||
<!--<!– >–>-->
|
||||
<!-- <span class="el-upload-list__item-actions">-->
|
||||
<!-- <span-->
|
||||
<!-- class="el-upload-list__item-preview"-->
|
||||
<!-- @click="handlePictureCardPreview(file)"-->
|
||||
<!-- >-->
|
||||
<!-- <i class="el-icon-zoom-in" />-->
|
||||
<!-- </span>-->
|
||||
|
||||
<!-- <span-->
|
||||
<!-- v-if="readingTaskState < 2"-->
|
||||
<!-- class="el-upload-list__item-delete"-->
|
||||
<!-- @click="handleRemove(file)"-->
|
||||
<!-- >-->
|
||||
<!-- <i class="el-icon-delete" />-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
</el-upload>
|
||||
<!-- <el-dialog
|
||||
v-if="question.Type==='upload'"
|
||||
append-to-body
|
||||
:visible.sync="imgVisible"
|
||||
width="600px"
|
||||
>
|
||||
<el-image :src="imageUrl" width="100%">
|
||||
<div slot="placeholder" class="image-slot">
|
||||
加载中<span class="dot">...</span>
|
||||
</div>
|
||||
</el-image>
|
||||
</el-dialog> -->
|
||||
<viewer
|
||||
v-if="question.Type==='upload' && imgVisible"
|
||||
:ref="imageUrl"
|
||||
|
@ -426,7 +402,13 @@ export default {
|
|||
// if (!v[this.question.Id] || !oldv[this.question.Id]) return
|
||||
// } catch (e) {
|
||||
// }
|
||||
// this.formItemNumberChange(this.question.Id, false)
|
||||
try {
|
||||
if (!v || !v[this.question.Id] || !oldv || !oldv[this.question.Id])
|
||||
return
|
||||
} catch (e) {
|
||||
console.log(e, v)
|
||||
}
|
||||
this.formItemNumberChange(this.question.Id, false)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -521,9 +503,7 @@ export default {
|
|||
})
|
||||
answer = o ? o.label : null
|
||||
}
|
||||
if (answer !== null) {
|
||||
this.$set(this.QuestionsForm, i.classId, answer)
|
||||
}
|
||||
this.$set(this.QuestionsForm, i.classId, answer)
|
||||
}
|
||||
})
|
||||
// if (this.classArr.length > 0) {
|
||||
|
@ -554,7 +534,6 @@ export default {
|
|||
this.$set(this.QuestionsForm, obj.key, null)
|
||||
},
|
||||
handleSave() {
|
||||
console.log(this.QuestionsForm)
|
||||
this.$refs.tableQsForm.validate(valid => {
|
||||
if (!valid) return
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
|
@ -613,9 +592,7 @@ export default {
|
|||
})
|
||||
},
|
||||
save() {
|
||||
console.log(this.$refs.tableQsForm, this.QuestionsForm)
|
||||
this.$refs['tableQsForm'].validate((valid) => {
|
||||
console.log(valid)
|
||||
if (!valid) return
|
||||
if (this.addOrEdit.type === 'add') {
|
||||
this.AnswersList.push(this.QuestionsForm)
|
||||
|
@ -723,6 +700,18 @@ export default {
|
|||
}
|
||||
num = Math.min(...dataArr);
|
||||
break;
|
||||
case 13:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr, 0) ? 1 : 0;
|
||||
break;
|
||||
case 14:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) > 0 ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -733,7 +722,12 @@ export default {
|
|||
if (rules.ValueType === 2) {
|
||||
num = num * 100
|
||||
}
|
||||
return num.toFixed(digitPlaces)
|
||||
if (rules.CustomCalculateMark === 13 || rules.CustomCalculateMark === 14) {
|
||||
return num
|
||||
} else {
|
||||
return num.toFixed(digitPlaces)
|
||||
}
|
||||
|
||||
},
|
||||
formItemNumberChange(questionId, isTable) {
|
||||
if (isTable) {
|
||||
|
|
|
@ -248,9 +248,7 @@ export default {
|
|||
})
|
||||
answer = o ? o.label.trim() : null
|
||||
}
|
||||
if (answer !== null) {
|
||||
this.$set(this.questionForm, i.classId, answer)
|
||||
}
|
||||
this.$set(this.questionForm, i.classId, answer)
|
||||
}
|
||||
})
|
||||
// if (this.classArr.length > 0) {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
v-if="
|
||||
(question.ShowQuestion === 1 &&
|
||||
!!~question.ParentTriggerValueList.indexOf(
|
||||
questionForm[question.ParentId].toString()
|
||||
questionForm[question.ParentId]
|
||||
)) ||
|
||||
question.ShowQuestion === 0
|
||||
"
|
||||
|
@ -52,8 +52,8 @@
|
|||
(question.IsRequired === 1 &&
|
||||
question.RelevanceId &&
|
||||
!!~question.RelevanceValueList.indexOf(
|
||||
questionForm[question.RelevanceId].toString()
|
||||
))) &&
|
||||
isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] :
|
||||
questionForm[question.RelevanceId].toString()))) &&
|
||||
question.Type !== 'group' &&
|
||||
question.Type !== 'summary',
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
|
@ -625,6 +625,18 @@ export default {
|
|||
}
|
||||
num = Math.min(...dataArr);
|
||||
break;
|
||||
case 13:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr, 0) ? 1 : 0;
|
||||
break;
|
||||
case 14:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) > 0 ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -651,6 +663,7 @@ export default {
|
|||
var find = v.CalculateQuestionList.filter((o) => {
|
||||
return o.TableQuestionId === questionId;
|
||||
});
|
||||
|
||||
// find的自动计算值number
|
||||
if (find) {
|
||||
var num = this.logic(v);
|
||||
|
@ -782,7 +795,6 @@ export default {
|
|||
this.$emit("setFormItemData", obj);
|
||||
},
|
||||
setTblFormItemData(obj) {
|
||||
console.log('setTblFormItemData', this.classArr)
|
||||
this.$set(this.QuestionsForm, obj.key, obj.val)
|
||||
this.classArr.map(i=>{
|
||||
if (i.triggerId === obj.key) {
|
||||
|
@ -802,9 +814,7 @@ export default {
|
|||
})
|
||||
answer = o ? o.label : null
|
||||
}
|
||||
if (answer !== null) {
|
||||
this.$set(this.QuestionsForm, i.classId, answer)
|
||||
}
|
||||
this.$set(this.QuestionsForm, i.classId, answer)
|
||||
}
|
||||
})
|
||||
// if (this.classArr.length > 0) {
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
<el-select v-model="form.ParentTriggerValueList" clearable multiple>
|
||||
<el-option
|
||||
v-for="item of parentTriggerValOptions"
|
||||
:key="item.value"
|
||||
:key="`ParentTriggerValueList${item.value}`"
|
||||
:label="item.label"
|
||||
:value="item.value + ''"
|
||||
/>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<el-select v-model="form.RelevanceValueList" clearable multiple>
|
||||
<el-option
|
||||
v-for="item of reParentTriggerValOptions"
|
||||
:key="item.id"
|
||||
:key="`RelevanceValueList${item.value}`"
|
||||
:label="item.label"
|
||||
:value="item.value + ''"
|
||||
/>
|
||||
|
@ -311,7 +311,6 @@
|
|||
<!-- 是否在影像页面显示 -->
|
||||
<el-form-item
|
||||
:label="$t('trials:readingUnit:qsList:title:isShowInDicom')"
|
||||
v-if="form.ShowQuestion !== 2"
|
||||
prop="ShowQuestion"
|
||||
>
|
||||
<el-radio-group v-model="form.IsShowInDicom">
|
||||
|
@ -470,7 +469,7 @@
|
|||
<template v-if="form.TypeValue">
|
||||
<el-option
|
||||
v-for="item of form.TypeValue.split('|')"
|
||||
:key="item"
|
||||
:key="`HighlightAnswerList${item}`"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
|
@ -606,7 +605,7 @@
|
|||
<div>
|
||||
<el-radio
|
||||
v-for="item of $d.CustomCalculateMark"
|
||||
v-show="item.value <= 4 || item.value === 10 || item.value === 11 || item.value === 12"
|
||||
v-show="item.value <= 4 || item.value === 10 || item.value === 11 || item.value === 12 || item.value === 13 || item.value === 14"
|
||||
:key="`CustomCalculateMark${item.value}`"
|
||||
:label="item.value"
|
||||
>
|
||||
|
@ -1209,7 +1208,6 @@ export default {
|
|||
CustomCalculateMarkChange() {
|
||||
this.isShow = false
|
||||
if (this.form.CustomCalculateMark <= 4 || this.form.CustomCalculateMark >= 10) {
|
||||
console.log('1111')
|
||||
this.form.CalculateQuestions = [
|
||||
{
|
||||
IsTable: false,
|
||||
|
@ -1244,7 +1242,7 @@ export default {
|
|||
if (res.Result) {
|
||||
this.tableQuestions = res.Result.filter(i=>i.Type === 'basicTable')
|
||||
this.selectQuestions = res.Result.filter(i=>i.Type === 'select' || i.Type === 'radio' || i.Type === 'class')
|
||||
this.numberQuestions = res.Result.filter(i=>i.Type === 'number')
|
||||
this.numberQuestions = res.Result.filter(i=>i.Type === 'number' || (i.Type === 'class' && i.ClassifyShowType === 4))
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
|
|
|
@ -203,9 +203,7 @@ export default {
|
|||
})
|
||||
answer = o ? o.label : null
|
||||
}
|
||||
if (answer !== null) {
|
||||
this.$set(this.questionForm, i.classId, answer)
|
||||
}
|
||||
this.$set(this.questionForm, i.classId, answer)
|
||||
}
|
||||
})
|
||||
// if (this.classArr.length > 0) {
|
||||
|
|
Loading…
Reference in New Issue