新自定义dicom阅片自动计算相关
continuous-integration/drone/push Build is failing Details

main
wangxiaoshuang 2025-07-10 11:26:02 +08:00
parent 9d422d4327
commit 66bcff2405
2 changed files with 128 additions and 49 deletions

View File

@ -720,11 +720,14 @@ export default {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 5: case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
num *= parseFloat(q[o.TableQuestionId]) } else {
num *= parseFloat(q[o.TableQuestionId])
}
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
} }
@ -732,11 +735,14 @@ export default {
break; break;
case 6: case 6:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
num += parseFloat(q[o.TableQuestionId]) } else {
num += parseFloat(q[o.TableQuestionId])
}
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
} }
@ -744,11 +750,14 @@ export default {
break; break;
case 7: case 7:
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
num = parseFloat(q[o.TableQuestionId]) if (qi === 0) {
} else { num = parseFloat(q[o.TableQuestionId])
num += parseFloat(q[o.TableQuestionId]) } else {
num += parseFloat(q[o.TableQuestionId])
}
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
} }
@ -758,7 +767,10 @@ export default {
case 8: case 8:
var arr = [] var arr = []
this.questionForm[o.QuestionId].forEach(q => { 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') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
} }
@ -768,7 +780,9 @@ export default {
case 9: case 9:
var arr = [] var arr = []
this.questionForm[o.QuestionId].forEach(q => { 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') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
} }
@ -780,7 +794,9 @@ export default {
if (this.questionForm[o.TableQuestionId] === 'NE') { if (this.questionForm[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
} }
num = parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
if (!isNaN(num)) { if (!isNaN(num)) {
dataArr.push(num) dataArr.push(num)
} }
@ -791,20 +807,32 @@ export default {
} }
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 1: case 1:
num += parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 2: case 2:
num -= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 3: case 3:
num *= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 4: case 4:
if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = 0 if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) {
} else { num = 0
num /= parseFloat(this.questionForm[o.TableQuestionId]) } else {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
} }
break; break;
case 10: case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
@ -906,24 +934,42 @@ export default {
isNE = true isNE = true
} }
if (i === 0) { if (i === 0) {
num = parseFloat(this.QuestionsForm[o.TableQuestionId]); if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr = [num]; num = parseFloat(this.QuestionsForm[o.TableQuestionId]);
arr = [num];
}
} else { } else {
switch (v.CustomCalculateMark) { switch (v.CustomCalculateMark) {
case 1: case 1:
num += parseFloat(this.QuestionsForm[o.TableQuestionId]); if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num += parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break; break;
case 2: case 2:
num -= parseFloat(this.QuestionsForm[o.TableQuestionId]); if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num -= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break; break;
case 3: case 3:
num *= parseFloat(this.QuestionsForm[o.TableQuestionId]); if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num *= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break; break;
case 4: case 4:
num /= parseFloat(this.QuestionsForm[o.TableQuestionId]); if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num /= parseFloat(this.QuestionsForm[o.TableQuestionId]);
}
break; break;
case 7: case 7:
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
}
num = num =
arr.length === 0 arr.length === 0
? 0 ? 0
@ -932,11 +978,17 @@ export default {
}, 0) / arr.length; }, 0) / arr.length;
break; break;
case 8: 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); num = arr.length === 0 ? 0 : Math.max(...arr);
break; break;
case 9: 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); num = arr.length === 0 ? 0 : Math.min(...arr);
// console.log('min', this.questionForm[o.QuestionId], arr, num) // console.log('min', this.questionForm[o.QuestionId], arr, num)
break; break;

View File

@ -391,49 +391,73 @@ export default {
if (i !== 0) { if (i !== 0) {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 7: case 7:
count += parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
count += parseFloat(this.questionForm[o.TableQuestionId])
}
if (i === rules.CalculateQuestionList.length - 1) { if (i === rules.CalculateQuestionList.length - 1) {
num = count / rules.CalculateQuestionList.length num = count / rules.CalculateQuestionList.length
} }
break; break;
case 8: case 8:
maxList.push(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
maxList.push(this.questionForm[o.TableQuestionId])
}
if (i === rules.CalculateQuestionList.length - 1) { if (i === rules.CalculateQuestionList.length - 1) {
num = Math.max(...maxList) num = minList.length > 0 ? Math.max(...maxList) : 0
} }
break; break;
case 9: case 9:
minList.push(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
minList.push(this.questionForm[o.TableQuestionId])
}
if (i === rules.CalculateQuestionList.length - 1) { if (i === rules.CalculateQuestionList.length - 1) {
num = Math.min(...minList) num = minList.length > 0 ? Math.min(...minList) : 0
} }
break; break;
} }
} else { } else {
maxList.push(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
minList.push(this.questionForm[o.TableQuestionId]) maxList.push(this.questionForm[o.TableQuestionId])
count = parseFloat(this.questionForm[o.TableQuestionId]) minList.push(this.questionForm[o.TableQuestionId])
num = parseFloat(this.questionForm[o.TableQuestionId]) count = parseFloat(this.questionForm[o.TableQuestionId])
dataArr.push(num) num = parseFloat(this.questionForm[o.TableQuestionId])
dataArr.push(num)
}
} }
} else { } else {
if (i !== 0) { if (i !== 0) {
switch (rules.CustomCalculateMark) { switch (rules.CustomCalculateMark) {
case 1: case 1:
num += parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 2: case 2:
num -= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 3: case 3:
num *= parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId])
}
break; break;
case 4: case 4:
if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = 0 if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) {
} else { num = 0
num /= parseFloat(this.questionForm[o.TableQuestionId]) } else {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
} }
break; break;
case 10: case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
@ -457,7 +481,10 @@ export default {
break; break;
} }
} else { } else {
num = parseFloat(this.questionForm[o.TableQuestionId]) if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId])
}
} }
} }
}) })