ソースを参照

手动运行项目优化

zhangliang2 3 年 前
コミット
4a49386bc1

+ 117 - 25
src/views/workManagement/evaluationReport.vue

@@ -194,15 +194,21 @@ export default {
 
     methods: {
         arraySpanMethod({ row, column, rowIndex, columnIndex }) {
-            if (columnIndex === 0 || columnIndex === this.columnsB.length - 1) {
+            if (columnIndex === 0) {
                 if (this.subIndexArr[0].includes(rowIndex)) {
-                    return [this.sublistNameObj[0][row.sublistName1], 1];
+                    return [
+                        this.sublistNameObj[0][row.sublistName1 + rowIndex],
+                        1,
+                    ];
                 } else {
                     return [0, 0];
                 }
             } else if (columnIndex === 1) {
                 if (this.subIndexArr[1].includes(rowIndex)) {
-                    return [this.sublistNameObj[1][row.sublistName2], 1];
+                    return [
+                        this.sublistNameObj[1][row.sublistName2 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName2) {
                         return [0, 0];
@@ -212,7 +218,10 @@ export default {
                 }
             } else if (columnIndex === 2) {
                 if (this.subIndexArr[2].includes(rowIndex)) {
-                    return [this.sublistNameObj[2][row.sublistName3], 1];
+                    return [
+                        this.sublistNameObj[2][row.sublistName3 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName3) {
                         return [0, 0];
@@ -222,7 +231,10 @@ export default {
                 }
             } else if (columnIndex === 3) {
                 if (this.subIndexArr[3].includes(rowIndex)) {
-                    return [this.sublistNameObj[3][row.sublistName4], 1];
+                    return [
+                        this.sublistNameObj[3][row.sublistName4 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName4) {
                         return [0, 0];
@@ -232,7 +244,10 @@ export default {
                 }
             } else if (columnIndex === 4) {
                 if (this.subIndexArr[4].includes(rowIndex)) {
-                    return [this.sublistNameObj[4][row.sublistName5], 1];
+                    return [
+                        this.sublistNameObj[4][row.sublistName5 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName5) {
                         return [0, 0];
@@ -242,7 +257,10 @@ export default {
                 }
             } else if (columnIndex === 5) {
                 if (this.subIndexArr[5].includes(rowIndex)) {
-                    return [this.sublistNameObj[5][row.sublistName6], 1];
+                    return [
+                        this.sublistNameObj[5][row.sublistName6 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName6) {
                         return [0, 0];
@@ -250,18 +268,37 @@ export default {
                         return [1, 1];
                     }
                 }
+            } else if (columnIndex === this.columnsB.length - 1) {
+                if (this.subIndexArr[6].includes(rowIndex)) {
+                    return [
+                        this.sublistNameObj[6][row.firstScore + "a" + rowIndex],
+                        1,
+                    ];
+                } else {
+                    if (row.firstScore) {
+                        return [0, 0];
+                    } else {
+                        return [1, 1];
+                    }
+                }
             }
         },
         arraySpanMethodA({ row, column, rowIndex, columnIndex }) {
             if (columnIndex === 0) {
                 if (this.subIndexArrA[0].includes(rowIndex)) {
-                    return [this.sublistNameObjA[0][row.sublistName1], 1];
+                    return [
+                        this.sublistNameObjA[0][row.sublistName1 + rowIndex],
+                        1,
+                    ];
                 } else {
                     return [0, 0];
                 }
             } else if (columnIndex === 1) {
                 if (this.subIndexArrA[1].includes(rowIndex)) {
-                    return [this.sublistNameObjA[1][row.sublistName2], 1];
+                    return [
+                        this.sublistNameObjA[1][row.sublistName2 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName2) {
                         return [0, 0];
@@ -271,7 +308,10 @@ export default {
                 }
             } else if (columnIndex === 2) {
                 if (this.subIndexArrA[2].includes(rowIndex)) {
-                    return [this.sublistNameObjA[2][row.sublistName3], 1];
+                    return [
+                        this.sublistNameObjA[2][row.sublistName3 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName3) {
                         return [0, 0];
@@ -281,7 +321,10 @@ export default {
                 }
             } else if (columnIndex === 3) {
                 if (this.subIndexArrA[3].includes(rowIndex)) {
-                    return [this.sublistNameObjA[3][row.sublistName4], 1];
+                    return [
+                        this.sublistNameObjA[3][row.sublistName4 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName4) {
                         return [0, 0];
@@ -291,7 +334,10 @@ export default {
                 }
             } else if (columnIndex === 4) {
                 if (this.subIndexArrA[4].includes(rowIndex)) {
-                    return [this.sublistNameObjA[4][row.sublistName5], 1];
+                    return [
+                        this.sublistNameObjA[4][row.sublistName5 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName5) {
                         return [0, 0];
@@ -301,7 +347,10 @@ export default {
                 }
             } else if (columnIndex === 5) {
                 if (this.subIndexArrA[5].includes(rowIndex)) {
-                    return [this.sublistNameObjA[5][row.sublistName6], 1];
+                    return [
+                        this.sublistNameObjA[5][row.sublistName6 + rowIndex],
+                        1,
+                    ];
                 } else {
                     if (row.sublistName6) {
                         return [0, 0];
@@ -326,6 +375,7 @@ export default {
             let lastRowSublistName4 = "";
             let lastRowSublistName5 = "";
             let lastRowSublistName6 = "";
+            let lastRowSublistName7 = "";
 
             let sublistNameObj1 = {};
             let sublistNameObj2 = {};
@@ -333,6 +383,7 @@ export default {
             let sublistNameObj4 = {};
             let sublistNameObj5 = {};
             let sublistNameObj6 = {};
+            let sublistNameObj7 = {};
 
             let subIndexArr1 = [];
             let subIndexArr2 = [];
@@ -340,71 +391,110 @@ export default {
             let subIndexArr4 = [];
             let subIndexArr5 = [];
             let subIndexArr6 = [];
+            let subIndexArr7 = [];
+
+            let lastI1 = 0;
+            let lastI2 = 0;
+            let lastI3 = 0;
+            let lastI4 = 0;
+            let lastI5 = 0;
+            let lastI6 = 0;
+            let lastI7 = 0;
 
             arr.forEach((item, i) => {
                 let sublistName1 = item.sublistName1;
                 if (sublistName1 === lastRowSublistName1) {
-                    sublistNameObj1[sublistName1]++;
+                    sublistNameObj1[sublistName1 + lastI1]++;
                 } else {
                     lastRowSublistName1 = sublistName1;
                     subIndexArr1.push(i);
-                    sublistNameObj1[sublistName1] = 1;
+                    lastI1 = i;
+                    sublistNameObj1[sublistName1 + lastI1] = 1;
                 }
 
                 if (item.sublistName2) {
                     // 一级后的指标名称可能不存在
                     let sublistName2 = item.sublistName2;
                     if (sublistName2 === lastRowSublistName2) {
-                        sublistNameObj2[sublistName2]++;
+                        sublistNameObj2[sublistName2 + lastI2]++;
                     } else {
                         lastRowSublistName2 = sublistName2;
                         subIndexArr2.push(i);
-                        sublistNameObj2[sublistName2] = 1;
+                        lastI2 = i;
+                        sublistNameObj2[sublistName2 + lastI2] = 1;
                     }
+                } else {
+                    lastRowSublistName2 = "";
                 }
 
                 if (item.sublistName3) {
                     let sublistName3 = item.sublistName3;
                     if (sublistName3 === lastRowSublistName3) {
-                        sublistNameObj3[sublistName3]++;
+                        sublistNameObj3[sublistName3 + lastI3]++;
                     } else {
                         lastRowSublistName3 = sublistName3;
                         subIndexArr3.push(i);
-                        sublistNameObj3[sublistName3] = 1;
+                        lastI3 = i;
+                        sublistNameObj3[sublistName3 + lastI3] = 1;
                     }
+                } else {
+                    lastRowSublistName3 = "";
                 }
 
                 if (item.sublistName4) {
                     let sublistName4 = item.sublistName4;
                     if (sublistName4 === lastRowSublistName4) {
-                        sublistNameObj4[sublistName4]++;
+                        sublistNameObj4[sublistName4 + lastI4]++;
                     } else {
                         lastRowSublistName4 = sublistName4;
                         subIndexArr4.push(i);
-                        sublistNameObj4[sublistName4] = 1;
+                        lastI4 = i;
+                        sublistNameObj4[sublistName4 + lastI4] = 1;
                     }
+                } else {
+                    lastRowSublistName4 = "";
                 }
 
                 if (item.sublistName5) {
                     let sublistName5 = item.sublistName5;
                     if (sublistName5 === lastRowSublistName5) {
-                        sublistNameObj5[sublistName5]++;
+                        sublistNameObj5[sublistName5 + lastI5]++;
                     } else {
                         lastRowSublistName5 = sublistName5;
                         subIndexArr5.push(i);
-                        sublistNameObj5[sublistName5] = 1;
+                        lastI5 = i;
+                        sublistNameObj5[sublistName5 + lastI5] = 1;
                     }
+                } else {
+                    lastRowSublistName5 = "";
                 }
 
                 if (item.sublistName6) {
                     let sublistName6 = item.sublistName6;
                     if (sublistName6 === lastRowSublistName6) {
-                        sublistNameObj6[sublistName6]++;
+                        sublistNameObj6[sublistName6 + lastI6]++;
                     } else {
                         lastRowSublistName6 = sublistName6;
                         subIndexArr6.push(i);
-                        sublistNameObj6[sublistName6] = 1;
+                        lastI6 = i;
+                        sublistNameObj6[sublistName6 + lastI6] = 1;
                     }
+                } else {
+                    lastRowSublistName6 = "";
+                }
+
+                if (item.firstScore) {
+                    let firstScore = item.firstScore;
+                    if (firstScore === lastRowSublistName7) {
+                        sublistNameObj7[firstScore + "a" + lastI7]++;
+                    } else {
+                        lastRowSublistName7 = firstScore;
+                        subIndexArr7.push(i);
+                        lastI7 = i;
+                        sublistNameObj7[firstScore + "a" + lastI7] = 1;
+                    }
+                } else {
+                    lastRowSublistName7 = "";
                 }
             });
 
@@ -427,6 +517,8 @@ export default {
             ];
 
             if (type === 1) {
+                arr1.push(subIndexArr7);
+                arr2.push(sublistNameObj7);
                 this.subIndexArr = arr1;
                 this.sublistNameObj = arr2;
             } else if (type === 2) {

+ 2 - 2
src/views/workManagement/manualRunProjectDetail.vue

@@ -81,7 +81,7 @@
                     <el-input
                         :disabled="runDisabled"
                         placeholder="请输入"
-                        maxlength="100"
+                        maxlength="10"
                         v-autoTrim="{ obj: form, key: 'parallelism' }"
                         v-model="form.parallelism"
                     >
@@ -90,7 +90,7 @@
                 <el-form-item label="最大仿真时间:" prop="maxSimulationTime">
                     <el-input
                         placeholder="请输入"
-                        maxlength="100"
+                        maxlength="10"
                         v-autoTrim="{ obj: form, key: 'maxSimulationTime' }"
                         v-model="form.maxSimulationTime"
                     >