From 62a92ea7c9eafc39fbfeb5b86c7e6e4330636b30 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Thu, 10 Jul 2025 11:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=A1=E7=AE=97=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/main.js | 2 +- .../customize/CustomizeQuestionFormItem.vue | 133 +++- .../CustomizeQuestionTableFormItem.vue | 513 +++++++-------- .../dicoms/customize/CustomizeReportPage.vue | 483 +++++++------- .../components/customize/QuestionList.vue | 2 + .../components/customize/ReportPage.vue | 446 +++++++------ .../visit-review/components/EcrfList.vue | 6 +- .../visit-review/components/ReportPage.vue | 486 +++++++++------ .../components/QuestionFormItem.vue | 589 ++++++++---------- .../components/QuestionTableFormItem.vue | 3 +- .../reading-unit/components/TableQsForm.vue | 2 +- 12 files changed, 1415 insertions(+), 1251 deletions(-) diff --git a/.gitignore b/.gitignore index dc6dabc4..5d2aa688 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ tests/**/coverage/ *.sln .eslintignore /.eslintignore +*.svn diff --git a/src/main.js b/src/main.js index e6b3e54b..38c6c9aa 100644 --- a/src/main.js +++ b/src/main.js @@ -469,7 +469,7 @@ async function VueInit() { var my_password = zzSessionStorage.getItem('my_password') let my_userid = zzSessionStorage.getItem('userId') let my_EMail = zzSessionStorage.getItem('my_EMail') || '' - if (md5(_vm.unlock.my_password) === my_password && (my_username === _vm.unlock.my_username || my_EMail.toUpperCase() === vm.unlock.my_username.toUpperCase())) { + if (md5(_vm.unlock.my_password) === my_password && (my_username === _vm.unlock.my_username || my_EMail.toUpperCase() === _vm.unlock.my_username.toUpperCase())) { resetReadingRestTime().then(() => { }) const closeLock = (_vm) => { 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 9cedaded..cf6b2244 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue @@ -36,7 +36,7 @@ {{scope.row[item.Id] === '' ? '' : scope.row[item.Id] ? scope.row[item.Id].split('|').length : ''}} - {{scope.row[item.Id] ? parseFloat(scope.row[item.Id]).toFixed(digitPlaces) : null}} + {{!isNaN(parseFloat(scope.row[item.Id])) ? parseFloat(scope.row[item.Id]).toFixed(digitPlaces) : scope.row[item.Id]}} {{scope.row[item.Id]}} @@ -446,6 +446,7 @@ 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 @@ -455,7 +456,6 @@ export default { if (this.question.Type === 'class') { this.$emit("setFormItemData", { key: this.question.Id, val: v[this.question.Id], question: v }) } - this.formItemNumberChange(this.question.Id, false) } }, readingTaskState: { @@ -539,6 +539,7 @@ export default { deleteTableCol(row, index) { this.$confirm(this.$t('trials:uploadNonDicoms:message:msg1')).then(() => { const loading = this.$loading({ fullscreen: true }) + let RowId = this.questionForm[row.Id][index].RowId var param = { visitTaskId: this.visitTaskId, questionId: row.Id, @@ -549,6 +550,11 @@ export default { if (res.IsSuccess) { this.$message.success(this.$t('common:message:deletedSuccessfully')) DicomEvent.$emit('reGetQuestionAnswer') + this.AnswersList = row.TableQuestions.Answers + var index = this.AnswersList.findIndex(v => v.RowId === RowId) + this.AnswersList.splice(index, 1) + this.$emit('setFormItemData', {key: this.question.Id, val: this.AnswersList, question: this.question}) + this.formItemNumberChange(this.question.Id, true) } loading.close() }).catch(() => { @@ -681,39 +687,58 @@ export default { }) }, logic(rules, num = 0) { + let isNE = false try { if (rules.CalculateQuestionList.length === 0) { return false } let dataArr = [] rules.CalculateQuestionList.forEach((o, i) => { + if (this.questionForm[o.TableQuestionId] === 'NE') { + isNE = true + } if (i === 0) { if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) { switch (rules.CustomCalculateMark) { case 5: this.questionForm[o.QuestionId].forEach((q, qi) => { - if (qi === 0) { - num = parseFloat(q[o.TableQuestionId]) - } else { - num *= parseFloat(q[o.TableQuestionId]) + if (!isNaN(parseFloat(q[o.TableQuestionId]))) { + if (qi === 0) { + num = parseFloat(q[o.TableQuestionId]) + } else { + num *= parseFloat(q[o.TableQuestionId]) + } + } + if (q[o.TableQuestionId] === 'NE') { + isNE = true } }) break; case 6: this.questionForm[o.QuestionId].forEach((q, qi) => { - if (qi === 0) { - num = parseFloat(q[o.TableQuestionId]) - } else { - num += parseFloat(q[o.TableQuestionId]) + if (!isNaN(parseFloat(q[o.TableQuestionId]))) { + if (qi === 0) { + num = parseFloat(q[o.TableQuestionId]) + } else { + num += parseFloat(q[o.TableQuestionId]) + } + } + if (q[o.TableQuestionId] === 'NE') { + isNE = true } }) break; case 7: this.questionForm[o.QuestionId].forEach((q, qi) => { - if (qi === 0) { - num = parseFloat(q[o.TableQuestionId]) - } else { - num += parseFloat(q[o.TableQuestionId]) + if (!isNaN(parseFloat(q[o.TableQuestionId]))) { + if (qi === 0) { + num = parseFloat(q[o.TableQuestionId]) + } else { + num += parseFloat(q[o.TableQuestionId]) + } + } + if (q[o.TableQuestionId] === 'NE') { + isNE = true } }) num = this.questionForm[o.QuestionId].length === 0 ? 0 : num / this.questionForm[o.QuestionId].length @@ -721,20 +746,32 @@ export default { case 8: var arr = [] this.questionForm[o.QuestionId].forEach(q => { - arr.push(q[o.TableQuestionId]) + if (!isNaN(parseFloat(q[o.TableQuestionId]))) { + arr.push(q[o.TableQuestionId]) + } + if (q[o.TableQuestionId] === 'NE') { + isNE = true + } }) num = arr.length === 0 ? 0 : Math.max(...arr) break; case 9: var arr = [] this.questionForm[o.QuestionId].forEach(q => { - arr.push(q[o.TableQuestionId]) + if (!isNaN(parseFloat(q[o.TableQuestionId]))) { + arr.push(q[o.TableQuestionId]) + } + if (q[o.TableQuestionId] === 'NE') { + isNE = true + } }) num = arr.length === 0 ? 0 : Math.min(...arr) break; } } else { - num = parseFloat(this.questionForm[o.TableQuestionId]) + if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + num = parseFloat(this.questionForm[o.TableQuestionId]) + } if (!isNaN(num)) { dataArr.push(num) } @@ -742,19 +779,27 @@ export default { } else { switch (rules.CustomCalculateMark) { case 1: - num += parseFloat(this.questionForm[o.TableQuestionId]) + if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + num += parseFloat(this.questionForm[o.TableQuestionId]) + } break; case 2: - num -= parseFloat(this.questionForm[o.TableQuestionId]) + if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + num -= parseFloat(this.questionForm[o.TableQuestionId]) + } break; case 3: - num *= parseFloat(this.questionForm[o.TableQuestionId]) + if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + num *= parseFloat(this.questionForm[o.TableQuestionId]) + } break; case 4: - if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) { - num = 0 - } else { - num /= parseFloat(this.questionForm[o.TableQuestionId]) + if (isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { + if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) { + num = 0 + } else { + num /= parseFloat(this.questionForm[o.TableQuestionId]) + } } break; case 10: @@ -795,6 +840,9 @@ export default { } catch (e) { console.log(e) } + if (isNE) { + return 'NE' + } if (rules.ValueType === 2) { num = num * 100 } @@ -875,26 +923,40 @@ export default { var CalculateQuestions = JSON.parse(v.CalculateQuestions); var num, arr = []; + let isNE = false CalculateQuestions.forEach((o, i) => { + if (this.QuestionsForm[o.TableQuestionId] === 'NE') { + isNE = true + } if (i === 0) { num = parseFloat(this.QuestionsForm[o.TableQuestionId]); arr = [num]; } else { switch (v.CustomCalculateMark) { case 1: - num += parseFloat(this.QuestionsForm[o.TableQuestionId]); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + num += parseFloat(this.QuestionsForm[o.TableQuestionId]); + } break; case 2: - num -= parseFloat(this.QuestionsForm[o.TableQuestionId]); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + num -= parseFloat(this.QuestionsForm[o.TableQuestionId]); + } break; case 3: - num *= parseFloat(this.QuestionsForm[o.TableQuestionId]); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + num *= parseFloat(this.QuestionsForm[o.TableQuestionId]); + } break; case 4: - num /= parseFloat(this.QuestionsForm[o.TableQuestionId]); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + num /= parseFloat(this.QuestionsForm[o.TableQuestionId]); + } break; case 7: - arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); + } num = arr.length === 0 ? 0 @@ -903,17 +965,26 @@ export default { }, 0) / arr.length; break; case 8: - arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); + } num = arr.length === 0 ? 0 : Math.max(...arr); break; case 9: - arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); + if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { + arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); + } num = arr.length === 0 ? 0 : Math.min(...arr); // console.log('min', this.questionForm[o.QuestionId], arr, num) break; } } }); + if (isNE) { + num = 'NE' + } else { + num = num.toFixed(this.digitPlaces) + } this.$set(this.QuestionsForm, v.Id, num.toString()); } }); 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 2cfe9365..55a71425 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue @@ -1,239 +1,140 @@