Pārlūkot izejas kodu

fix:场景测试包基准库表格数据回显修复

linchengzhe 1 gadu atpakaļ
vecāks
revīzija
7631cfe6f1

+ 1 - 0
src/views/sceneLibrary/benchmarkScenarioList.vue

@@ -640,6 +640,7 @@ export default {
       this.$store.commit("getSceneId",row.sceneId);
       this.$router.push({
         path: '/sceneEvaluation',
+        query:{id:row.sceneId}
       })
     },
   },

+ 6 - 8
src/views/sceneLibrary/components/realSceneList.vue

@@ -1441,7 +1441,6 @@ export default {
     },
 
     doSearchD() {
-      console.log('zzz')
       const specialParams = [
         'mainBehavior',
         'otherBehavior',
@@ -1454,7 +1453,6 @@ export default {
       ]
       this.searchParamsD.share = this.activeNameD === '1' ? '1' : '0'
       const obj = JSON.parse(JSON.stringify(this.searchParamsD))
-      console.log('obj',this.searchParamsD)
       Object.keys(obj).forEach((item) => {
         if (specialParams.includes(item)) {
           if (!obj[item][0][1]) {
@@ -1504,7 +1502,7 @@ export default {
     loadedCallBackD() {
       this.checkedArrD = []
       this.$refs.tableD.tableData.forEach((i) => {
-        if (this.checkedIdsD.includes(i.regulationsId)) {
+        if (this.checkedIdsD.includes(i.sceneId)) {
           this.$refs.tableD.$refs.ListTable.toggleRowSelection(i, true)
           this.checkedArrD.push(i)
         }
@@ -1513,9 +1511,9 @@ export default {
 
     selectedCallBackD(row, type) {
       if (type === 1) {
-        this.checkedIdsD.push(row.regulationsId)
+        this.checkedIdsD.push(row.sceneId)
       } else {
-        let index = this.checkedIdsD.indexOf(row.regulationsId)
+        let index = this.checkedIdsD.indexOf(row.sceneId)
         if (index > -1) {
           this.checkedIdsD.splice(index, 1)
         }
@@ -1525,13 +1523,13 @@ export default {
     selectedAllCallBackD(selection, type) {
       if (type === 1) {
         selection.forEach((i) => {
-          if (!this.checkedIdsD.includes(i.regulationsId)) {
-            this.checkedIdsD.push(i.regulationsId)
+          if (!this.checkedIdsD.includes(i.sceneId)) {
+            this.checkedIdsD.push(i.sceneId)
           }
         })
       } else {
         this.$refs.tableD.tableData.forEach((i) => {
-          let index = this.checkedIdsD.indexOf(i.regulationsId)
+          let index = this.checkedIdsD.indexOf(i.sceneId)
           if (index > -1) {
             this.checkedIdsD.splice(index, 1)
           }

+ 1 - 0
src/views/sceneLibrary/naturalDrivingScenarioList.vue

@@ -504,6 +504,7 @@ export default {
       this.$store.commit('getSceneId', row.naturalId)
       this.$router.push({
         path: '/sceneEvaluation',
+        query:{id:row.naturalId}
       })
     },
     viewRow(row) {

+ 12 - 3
src/views/sceneLibrary/sceneEvaluation.vue

@@ -116,7 +116,9 @@ export default {
         type: 'post',
         data: this.$api.sceneLibrary.queryComplexityDetail,
         param: {
-          sceneId: this.$store.state.sceneId,
+          // sceneId: this.$store.state.sceneId,
+          sceneId: '',
+
         },
       },
       getDataWay2: {
@@ -125,7 +127,9 @@ export default {
         type: 'post',
         data: this.$api.sceneLibrary.queryRiskDetail,
         param: {
-          sceneId: this.$store.state.sceneId,
+          // sceneId: this.$store.state.sceneId,
+          sceneId: '',
+
         },
       },
       pagination1: {
@@ -193,6 +197,11 @@ export default {
       this.currentPage = val
     },
   },
-  mounted() {},
+  mounted() {
+    if(this.$route.query.id){
+      this.getDataWay1.param.sceneId = this.$route.query.id
+      this.getDataWay2.param.sceneId = this.$route.query.id
+    }
+  },
 }
 </script>

+ 14 - 1
src/views/sceneLibrary/scenePacketList.vue

@@ -406,6 +406,7 @@ export default {
                         ruleNameArrayS: [],
                         sceneGeneralizationIds: null,
                         sceneNaturalIds: "",
+                        sceneReferenceLibIds:null,
                         sceneNum: 0,
                         sceneStatueIds: null,
                         sceneTrafficIds: null,
@@ -476,6 +477,7 @@ export default {
             checkedIdsA: [], // 交通事故列表已选
             checkedIdsB: [], // 自然驾驶列表已选
             checkedIdsC: [], // 标准法规列表已选
+            checkedIdsD: [], // 基准化场景列表已选
             isRoot: false, // 是否是根节点
             templateViewVisible: false, // 模板预览dialog
             treeData: [],
@@ -648,6 +650,7 @@ export default {
                             ruleNameArrayS: [],
                             sceneGeneralizationIds: null,
                             sceneNaturalIds: "",
+                            sceneReferenceLibIds:null,
                             sceneNum: 0,
                             sceneStatueIds: null,
                             sceneTrafficIds: null,
@@ -673,7 +676,6 @@ export default {
                         this.nodeList
                     );
 
-                    // console.log(this.getDataWay.data);
 
                     this.checkWeightValidate();
 
@@ -708,6 +710,8 @@ export default {
                             this.$refs.realScene.doResetA();
                             this.$refs.realScene.doResetB();
                             this.$refs.realScene.doResetC();
+                            this.$refs.realScene.doResetD();
+
 
                             // 把选中数据对应的ids组分别传入tabs中,用于后续操作数据进行存储
                             if (this.curNode.sceneTrafficIds) {
@@ -722,6 +726,9 @@ export default {
                                 this.$refs.realScene.checkedIdsC =
                                     this.curNode.sceneStatueIds.split(",");
                             }
+                            if(this.curNode.sceneReferenceLibIds){
+                                this.$refs.realScene.checkedIdsD = this.curNode.sceneReferenceLibIds.split(",")
+                            }
                         });
                     } else {
                         // 泛化场景
@@ -756,6 +763,8 @@ export default {
             this.checkedIdsA = this.$refs.realScene.checkedIdsA;
             this.checkedIdsB = this.$refs.realScene.checkedIdsB;
             this.checkedIdsC = this.$refs.realScene.checkedIdsC;
+            this.checkedIdsD = this.$refs.realScene.checkedIdsD;
+
 
             this.curNode.packageAndRules = this.formA.rulesId;
             this.curNode.ruleName = this.formA.ruleName;
@@ -764,6 +773,7 @@ export default {
             this.curNode.sceneNum =
                 this.checkedIdsA.length +
                 this.checkedIdsB.length +
+                this.checkedIdsD.length +
                 this.checkedIdsC.length;
 
             // 选择场景总数为0 则去掉对应的规则名称和id
@@ -781,6 +791,8 @@ export default {
             this.curNode.sceneTrafficIds = this.checkedIdsA.join(",");
             this.curNode.sceneNaturalIds = this.checkedIdsB.join(",");
             this.curNode.sceneStatueIds = this.checkedIdsC.join(",");
+            this.curNode.sceneReferenceLibIds = this.checkedIdsD.join(",");
+
 
             // 清空泛化场景的数据
             this.curNode.exampleId = "";
@@ -903,6 +915,7 @@ export default {
                 node.sceneTrafficIds = "";
                 node.sceneNaturalIds = "";
                 node.sceneStatueIds = "";
+                node.sceneReferenceLibIds = "";
 
                 this.sceneNumUpdate(node);
             }

+ 1 - 0
src/views/sceneLibrary/standardRegulationSimulationScenarioList.vue

@@ -365,6 +365,7 @@ export default {
       this.$store.commit('getSceneId', row.regulationsId)
       this.$router.push({
         path: '/sceneEvaluation',
+        query:{id:row.regulationsId}
       })
     },
     viewRow(row) {

+ 1 - 0
src/views/sceneLibrary/trafficAccidentSimulationScenarioList.vue

@@ -401,6 +401,7 @@ export default {
       this.$store.commit('getSceneId', row.accidentId)
       this.$router.push({
         path: '/sceneEvaluation',
+        query:{id:row.accidentId}
       })
     },
     doReset() {