Bläddra i källkod

fix:遗留问题修改

linchengzhe 1 år sedan
förälder
incheckning
36b3883548

+ 1 - 1
src/api/sceneLibrary.js

@@ -8,7 +8,7 @@ const saveScoringRules = basePart + '/ScoringRules/saveScoringRules'; // 保存
 const fxScoringRules = basePart + '/ScoringRules/fxScoringRules'; // 分享评分规则
 const deleteScoringRules = basePart + '/ScoringRules/deleteScoringRules'; // 删除评分规则
 const queryCsbById = basePart + '/ScoringRules/queryCsbById'; // 查询该规则是否有关联任务
-const queryScoringRulesInfo = basePart +'/ScoringRules/saveSceneEvaluationRule';  // 场景评价编辑
+const queryScoringRulesInfo = basePart +'/ScoringRules/saveSceneEvaluationRuleByPath';  // 场景评价编辑
 const getScriptListByType = basePart +'/ScoringRules/queryEvaluationScript'; // 脚本列表 【复杂度,危险度等】
 
 const deleteSceneEvaluationRule = basePart +'/ScoringRules/deleteSceneEvaluationRule'; // 删除场景评价规则

+ 6 - 0
src/router/index.js

@@ -1,5 +1,6 @@
 import Vue from "vue";
 import VueRouter from "vue-router";
+import store from '../store'
 
 import modelLibrary from "./modelLibrary"; // 模型库
 import algorithmsLibrary from "./algorithmsLibrary"; // 算法库
@@ -137,4 +138,9 @@ const router = new VueRouter({
   }
 });
 
+router.beforeEach((to, from, next) => {
+  store.commit('setSceneLock', from.path === '/sceneEvaluation' ? true : false)
+  next()
+})
+
 export default router;

+ 19 - 13
src/store/index.js

@@ -33,39 +33,45 @@ export default new Vuex.Store({
     scenePacketDistributionDetailTabName: "", // 场景包分配详情
     editAccountTabName: "", // 编辑账户详情
     vehicleModelDetailTabName: "", // 车辆设置详情
-    evaluationInfo:{}, // 场景评价编辑信息
-    sceneId:"", // 场景id
+    evaluationInfo: {}, // 场景评价编辑信息
+    sceneId: "", // 场景id
+    sceneCurPage: 1,// 分页
+    sceneLock:false, // 分页记忆锁
   },
   mutations: {
-    getUserId(state, data) {
+    getUserId (state, data) {
       state.id = data
     },
-    getUsername(state, data) {
+    getUsername (state, data) {
       state.username = data
     },
-    getRoleCode(state, data) {
+    getRoleCode (state, data) {
       state.roleCode = data
     },
-    getUseType(state, data) {
+    getUseType (state, data) {
       state.useType = data
     },
-    getProjectInfoTabname(state, data) {
+    getProjectInfoTabname (state, data) {
       state.projectInfoTabname = data
     },
-    getTaskInfoTabname(state, data) {
+    getTaskInfoTabname (state, data) {
       state.taskInfoTabname = data
     },
-    getTabname(state, name, data) {
-      console.log('zzz',name,data)
+    getTabname (state, name, data) {
       state[name] = data
     },
-    getEvaluationInfo(state,data){
+    getEvaluationInfo (state, data) {
       state.evaluationInfo = data
     },
-    getSceneId(state,data){
+    getSceneId (state, data) {
       state.sceneId = data
+    },
+    getSceneCurPage(state, data){
+      state.sceneCurPage = data
+    },
+    setSceneLock(state,data){
+      state.sceneLock = data
     }
-    
   },
   actions: {},
   modules: {},

+ 1 - 0
src/views/multimodeSimulation/simulationEdit.vue

@@ -368,6 +368,7 @@ export default {
         name: 'multimodeSimulationEdit',
         query: {
           sceneId: id,
+          projectId:this.projectId
         },
       })
     },

+ 9 - 2
src/views/sceneLibrary/benchmarkScenarioList.vue

@@ -463,7 +463,7 @@ export default {
         {
           label: '场景名称',
           prop: 'sceneName',
-          fixed: 'left',
+          // fixed: 'left',
         },
         {
           label: '主车动作',
@@ -484,14 +484,17 @@ export default {
         {
           label: '道路几何-平面',
           prop: 'roadGeometryPlane',
+          width:'200'
         },
         {
           label: '道路几何-纵断面',
           prop: 'roadGeometryVertical',
+          width:'150'
         },
         {
           label: '支持智驾功能',
           prop: 'autoDriveFunction',
+          width:'150'
         },
         {
           label: '运行区域',
@@ -636,7 +639,7 @@ export default {
     },
     viewRow(row) {
       this.dialogVisible = true
-      this.videoSrc = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
+      this.videoSrc = row.videoPreview || ''
     },
     // 编辑
     editHandle(e) {
@@ -646,6 +649,7 @@ export default {
     // 跳转场景评价
     jumpScene(row) {
       this.$store.commit("getSceneId",row.sceneId);
+      this.$store.commit("getSceneCurPage",this.pagination.currentPage);
       this.$router.push({
         path: '/sceneEvaluation',
         query:{id:row.sceneId}
@@ -672,6 +676,9 @@ export default {
   },
 
   async mounted() {
+    if(this.$store.state.sceneLock){
+      this.pagination.currentPage = this.$store.state.sceneCurPage
+    }
     this.searchInit()
   },
 }

+ 27 - 21
src/views/sceneLibrary/gradingRuleDetail.vue

@@ -45,7 +45,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item
+      <!-- <el-form-item
         v-if="isScore && form.rulesId"
         label="脚本名称:"
         prop="scriptName"
@@ -57,11 +57,11 @@
           v-model="form.scriptName"
         >
         </el-input>
-      </el-form-item>
+      </el-form-item> -->
 
       <!-- 文件上传 -->
-      <el-form-item label="文件上传" v-if="isScore">
-        <el-upload
+      <el-form-item label="脚本上传地址" v-if="isScore">
+        <!-- <el-upload
           :multiple="false"
           action=""
           class="upload-demo"
@@ -71,7 +71,13 @@
           :on-remove="fileRemove"
         >
           <el-button size="small" type="primary">点击上传</el-button>
-        </el-upload>
+        </el-upload> -->
+        <el-input
+          style="width: 400px"
+          placeholder="请填写脚本地址"
+          v-model="form.localPath"
+        >
+        </el-input>
       </el-form-item>
 
       <div class="btns">
@@ -99,7 +105,6 @@
 <script>
 import editor from './components/editor'
 import { ruleTypeOpts } from './common'
-import { del } from 'vue'
 
 export default {
   name: 'gradingRuleDetail', // 评分规则
@@ -115,7 +120,8 @@ export default {
         ruleDescription: '',
         ruleDetails: '',
         ruleType: '',
-        scriptName: '',
+        // scriptName: '',
+        localPath:'',
       },
       ruleTypeDisabled: false,
       fileList: [], // 文件上传列表
@@ -203,23 +209,23 @@ export default {
     },
     saveFn() {
       if (this.isScore) {
-        let formData = new FormData()
-        let source = { ...this.form }
-        source['ruleId'] = source.rulesId
-        delete source.rulesId
-        const json = JSON.stringify({
-          ...source,
-          uploadNewFile: this.scriptUpdate,
-        })
-        const blob = new Blob([json], {
-          type: 'application/json',
-        })
-        formData.append('content', blob)
-        this.scriptUpdate && formData.append('file', this.fileList[0])
+        // let formData = new FormData()
+        // let source = { ...this.form }
+        // source['ruleId'] = source.rulesId
+        // delete source.rulesId
+        // const json = JSON.stringify({
+        //   ...source,
+        //   uploadNewFile: this.scriptUpdate,
+        // })
+        // const blob = new Blob([json], {
+        //   type: 'application/json',
+        // })
+        // formData.append('content', blob)
+        // this.scriptUpdate && formData.append('file', this.fileList[0])
         this.$axios({
           method: 'post',
           url: this.$api.sceneLibrary.queryScoringRulesInfo,
-          data: formData,
+          data: {...this.form,scriptUpdate:true},
           withCredentials: true,
           headers: {
             'Content-type': 'multipart/form-data',

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

@@ -501,6 +501,7 @@ export default {
       }
     },
     jumpScene(row) {
+      this.$store.commit("getSceneCurPage",this.pagination.currentPage);
       this.$store.commit('getSceneId', row.naturalId)
       this.$router.push({
         path: '/sceneEvaluation',
@@ -565,6 +566,9 @@ export default {
   },
 
   async mounted() {
+    if(this.$store.state.sceneLock){
+      this.pagination.currentPage = this.$store.state.sceneCurPage
+    }
     await this.$dicsTreesInit({
       roadList: 'road',
       infrastructureList: 'infrastructure',

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

@@ -362,6 +362,7 @@ export default {
       }
     },
     jumpScene(row) {
+      this.$store.commit("getSceneCurPage",this.pagination.currentPage);
       this.$store.commit('getSceneId', row.regulationsId)
       this.$router.push({
         path: '/sceneEvaluation',
@@ -426,6 +427,9 @@ export default {
   },
 
   async mounted() {
+    if(this.$store.state.sceneLock){
+      this.pagination.currentPage = this.$store.state.sceneCurPage
+    }
     await this.$dicsListsInit({
       regulationTypeList: 'regulationType',
     })

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

@@ -398,6 +398,7 @@ export default {
         : this.$refs['table'].loadData()
     },
     jumpScene(row) {
+      this.$store.commit("getSceneCurPage",this.pagination.currentPage);
       this.$store.commit('getSceneId', row.accidentId)
       this.$router.push({
         path: '/sceneEvaluation',
@@ -527,6 +528,9 @@ export default {
   },
 
   async mounted() {
+    if(this.$store.state.sceneLock){
+      this.pagination.currentPage = this.$store.state.sceneCurPage
+    }
     await this.$dicsListsInit({
       selfDrivingList: 'selfDriving',
       targetDrivingList: 'targetDriving',

+ 10 - 1
src/views/workManagement/multimodeSimulationEdit.vue

@@ -39,6 +39,7 @@
 				isDisabled: false,
 				mapList: [],
 				sceneId: "",
+				projectId:"", // 项目id
 				dialog: {
 					dialogParam: {},
 					dialogOpen: false
@@ -54,6 +55,7 @@
 		},
 		beforeMount() {
 			this.sceneId = this.$route.query.sceneId;
+			this.projectId = this.$route.query.projectId
 			// if(!this.sceneId){
 			// 	this.sceneId = "b1e8fb96cf8a41d9a0364d29a9289628";
 			// }
@@ -179,7 +181,14 @@
 			},
 			back() {
 
-				this.$router.go(-1);
+				// this.$router.go(-1);
+				this.$router.push({
+					path:'/simulationEdit',
+					query:{
+						mode:'edit',
+						id:this.projectId
+					}
+				})
 			}
 		}
 	};