Tang 3 лет назад
Родитель
Сommit
05717d6580

+ 5 - 0
src/views/resource/bankManagement/testPaperManagement/addPaper/topicAddPaper/index.vue

@@ -1206,12 +1206,16 @@ export default {
 
       if (this.tableData.length) {
         let maxIndex = 0;
+        let childrenIndex = 0;
         this.tableData.forEach((item) => {
           if (item.sort > maxIndex) {
             maxIndex = item.sort;
+            childrenIndex = item.index
           }
         });
         this.activeLists.forEach((item, index) => {
+          childrenIndex++
+          item.index = childrenIndex
           item.sort = maxIndex + index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;
@@ -1219,6 +1223,7 @@ export default {
         });
       } else {
         this.activeLists.forEach((item, index) => {
+          item.index = 0
           item.sort = index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;

+ 5 - 0
src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/index.vue

@@ -1252,12 +1252,16 @@ export default {
 
       if (this.tableData.length) {
         let maxIndex = 0;
+        let childrenIndex = 0;
         this.tableData.forEach((item) => {
           if (item.sort > maxIndex) {
             maxIndex = item.sort;
+            childrenIndex = item.index
           }
         });
         this.activeLists.forEach((item, index) => {
+          childrenIndex++
+          item.index = childrenIndex
           item.sort = maxIndex + index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;
@@ -1266,6 +1270,7 @@ export default {
         });
       } else {
         this.activeLists.forEach((item, index) => {
+          item.index = 0
           item.sort = index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;