diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue index 8a05e509..9cedaded 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue @@ -237,7 +237,7 @@ @change="(val) => { formItemNumberChange(val, question) }" @input="numberInput(question.Id)" @blur="handleBlur(questionForm[question.Id], questionForm, question.Id)" - v-model="questionForm[question.Id]" + v-model.trim="questionForm[question.Id]" :disabled="readingTaskState === 2" > @@ -250,7 +250,7 @@ v-if="question.Type === 'number' && !question.TypeValue && question.DataSource === 1" @blur="handleBlur(questionForm[question.Id], questionForm, question.Id)" :disabled="question.DataSource === 1 || readingTaskState === 2" - v-model="questionForm[question.Id]" + v-model.trim="questionForm[question.Id]" > @@ -531,8 +531,8 @@ export default { } }, handleBlur(value, a, b) { - let reg = new RegExp(/[a-zA-Z]/, 'ig') - if(!reg.test(value)) { + if (!value) return false + if(!isNaN(parseFloat(value))) { this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces)) } }, @@ -1109,8 +1109,6 @@ export default { flex-direction: row; align-items: flex-start; } - ::v-deep .el-form-item__content{ - } .el-input{ width:100%; } diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue index b6846c4c..ad28929f 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue @@ -154,7 +154,7 @@ @change="((val)=>{formItemNumberChange(val, question)})" @input="numberInput(question.Id)" @blur="handleBlur(questionForm[question.Id], questionForm, question.Id)" - v-model="questionForm[question.Id]" + v-model.trim="questionForm[question.Id]" > @@ -164,7 +164,7 @@ :disabled="question.DataSource === 1" @input="numberInput(question.Id, true )" @blur="handleCalculationBlur(calculationValue)" - v-model="calculationValue" + v-model.trim="calculationValue" > @@ -337,7 +337,6 @@ export default { this.fileList.push({ name: '', url: `${url}` }) }) } - console.log('11') } if (this.type === 'edit') return // if (this.question.Type === 'number') { @@ -350,7 +349,7 @@ export default { methods: { numberInput(id,notId = false) { if(notId ) { - // this.calculationValue = this.calculationValue.toUpperCase(); + this.calculationValue = this.calculationValue.toUpperCase(); }else { this.questionForm[id] = this.questionForm[id].toUpperCase(); } @@ -407,14 +406,17 @@ export default { } }, handleBlur(value, a, b) { - let reg = new RegExp(/[a-zA-Z]/, 'ig') - if(!reg.test(value)) { + if (!value) return false + if(!isNaN(parseFloat(value))) { this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces)) } // this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces)) }, handleCalculationBlur(v) { - this.calculationValue = parseFloat(v).toFixed(this.digitPlaces) + if (!v) return false + if(!isNaN(parseFloat(v))) { + this.calculationValue = parseFloat(v).toFixed(this.digitPlaces) + } }, limitInput(value, q) { console.log(value) diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue index 29e4f5dc..1ba3b2f6 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionsPreview.vue @@ -137,7 +137,7 @@ export default { this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType}) } if (v.Type === 'number') { - this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces)) + this.$set(this.questionForm, v.Id, isNaN(parseFloat(v.Answer)) ? v.Answer : parseFloat(v.Answer).toFixed(this.digitPlaces)) } if (v.Childrens.length > 0) { this.setChild(v.Childrens) @@ -191,7 +191,7 @@ export default { this.$set(this.questionForm, v.Id, v.TableQuestions.Answers) } if (v.Type === 'number') { - this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces)) + this.$set(this.questionForm, v.Id, isNaN(parseFloat(v.Answer)) ? v.Answer : parseFloat(v.Answer).toFixed(this.digitPlaces)) } if (v.Childrens.length > 0) { this.setChild(v.Childrens) @@ -212,7 +212,7 @@ export default { i.TableQuestions.Questions.forEach(o => { if (o.Type === 'number') { i.TableQuestions.Answers.forEach((ite, index) => { - this.$set(i.TableQuestions.Answers[index], o.Id, i.TableQuestions.Answers[index][o.Id] ? parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces) : null) + this.$set(i.TableQuestions.Answers[index], o.Id, isNaN(parseFloat(i.TableQuestions.Answers[index][o.Id])) ? i.TableQuestions.Answers[index][o.Id] : parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces)) }) } }) @@ -222,7 +222,7 @@ export default { this.classArr.push({triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType}) } if (i.Type === 'number') { - this.$set(this.questionForm, i.Id, i.Answer === '' ? '' : parseFloat(i.Answer).toFixed(this.digitPlaces)) + this.$set(this.questionForm, i.Id, isNaN(parseFloat(i.Answer)) ? i.Answer : parseFloat(i.Answer).toFixed(this.digitPlaces)) } if (i.Childrens && i.Childrens.length > 0) { this.setChild(i.Childrens) diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue index 7441a60c..6e07bd25 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue @@ -1,109 +1,66 @@