Browse Source

场景库管理优化

zhangliang2 2 years ago
parent
commit
004c8c6554

+ 2 - 0
src/api/sceneLibrary.js

@@ -28,6 +28,7 @@ const saveScenePackage = basePart + '/ScenePackage/saveScenePackage'; // 场景
 const queryCsb = basePart + '/ScoringRules/queryCsb'; // 测试包添加评分规则下拉
 
 const querySceneGeneralTemplateList = basePart + '/SceneGeneralTemplate/querySceneGeneralTemplateList'; // 泛化列表
+const deleteSceneGeneralTemplateById = basePart + '/SceneGeneralTemplate/deleteSceneGeneralTemplateById'; // 删除泛化场景
 const queryType = basePart + '/SceneGeneralTemplate/queryType'; // 功能模块查询
 const querySceneGeneralTemplateById = basePart + '/SceneGeneralTemplate/querySceneGeneralTemplateById'; // 选中模板展示详情
 const saveSceneGeneralTemplate = basePart + '/SceneGeneralTemplate/saveSceneGeneralTemplate'; // 新增泛化场景
@@ -65,6 +66,7 @@ export default {
     queryCsb,
 
     querySceneGeneralTemplateList,
+    deleteSceneGeneralTemplateById,
     queryType,
     querySceneGeneralTemplateById,
     saveSceneGeneralTemplate,

+ 1 - 32
src/views/sceneLibrary/generalizationScenarioList.vue

@@ -105,14 +105,6 @@
                 align="center"
                 width="180"
             >
-                <!-- <template v-slot="scope">
-                    <i
-                        @click="viewRow(scope.row)"
-                        class="el-icon-view elIcon cursor"
-                        title="查看"
-                    >
-                    </i>
-                </template> -->
             </el-table-column>
         </tableList>
 
@@ -134,12 +126,11 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-import upload from "./components/upload";
 import { mapState } from "vuex";
 
 export default {
     name: "generalizationScenarioList", // 泛化场景
-    components: { searchLayout, tableList, upload },
+    components: { searchLayout, tableList },
     data() {
         return {
             searchParams: {
@@ -358,28 +349,6 @@ export default {
             this.videoSrc = `${url}?objectName=${row.videoAddress}&access_token=${token}`;
             this.autoplay = true;
         },
-        delRow(row) {
-            this.$confirm("确认是否删除?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-            }).then(() => {
-                this.$axios({
-                    method: "post",
-                    url: this.$api.sceneLibrary.deleteSceneNatural,
-                    data: {
-                        naturalId: row.naturalId,
-                    },
-                }).then((res) => {
-                    if (res.code == 200) {
-                        this.$message.success("删除成功");
-                    } else {
-                        this.$message.error(res.message || "删除失败");
-                    }
-                    this.doSearch();
-                });
-            });
-        },
         diaClose(done) {
             this.autoplay = false;
             this.videoSrc = "";

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

@@ -116,24 +116,6 @@
             </template>
         </search-layout>
 
-        <!-- <div class="btnsPanel">
-            <el-button
-                type="primary"
-                plain
-                icon="el-icon-upload"
-                @click="openFileDia"
-                >上传文件</el-button
-            >
-        </div> -->
-
-        <!-- <file-dialog
-            ref="fileDialog"
-            type="1"
-            :objectPath="objectPath"
-            :api="$api.sceneLibrary.saveSceneNatural"
-            @fileClose="fileClose"
-        ></file-dialog> -->
-
         <tableList
             ref="table"
             style="margin: 30px"
@@ -155,12 +137,6 @@
                         title="查看"
                     >
                     </i>
-                    <!-- <i
-                        @click="delRow(scope.row)"
-                        class="el-icon-delete elIcon"
-                        title="删除"
-                    >
-                    </i> -->
                 </template>
             </el-table-column>
         </tableList>
@@ -183,12 +159,11 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-import fileDialog from "./components/fileDialog";
 import { mapState } from "vuex";
 
 export default {
     name: "naturalDrivingScenarioList", // 自然驾驶场景
-    components: { searchLayout, tableList, fileDialog },
+    components: { searchLayout, tableList },
     data() {
         return {
             searchParams: {

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

@@ -65,24 +65,6 @@
             </template>
         </search-layout>
 
-        <!-- <div class="btnsPanel">
-            <el-button
-                type="primary"
-                plain
-                icon="el-icon-upload"
-                @click="openFileDia"
-                >上传文件</el-button
-            >
-        </div> -->
-
-        <!-- <file-dialog
-            ref="fileDialog"
-            type="2"
-            :objectPath="objectPath"
-            :api="$api.sceneLibrary.saveStandardsRegulations"
-            @fileClose="fileClose"
-        ></file-dialog> -->
-
         <tableList
             ref="table"
             style="margin: 30px"
@@ -104,12 +86,6 @@
                         title="查看"
                     >
                     </i>
-                    <!-- <i
-                        @click="delRow(scope.row)"
-                        class="el-icon-delete elIcon"
-                        title="删除"
-                    >
-                    </i> -->
                 </template>
             </el-table-column>
         </tableList>
@@ -132,12 +108,11 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-import fileDialog from "./components/fileDialog";
 import { mapState } from "vuex";
 
 export default {
     name: "standardRegulationSimulationScenarioList", // 标准法规仿真场景
-    components: { searchLayout, tableList, fileDialog },
+    components: { searchLayout, tableList },
     data() {
         return {
             searchParams: {

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

@@ -123,24 +123,6 @@
             </template>
         </search-layout>
 
-        <!-- <div class="btnsPanel">
-            <el-button
-                type="primary"
-                plain
-                icon="el-icon-upload"
-                @click="openFileDia"
-                >上传文件</el-button
-            >
-        </div> -->
-
-        <!-- <file-dialog
-            ref="fileDialog"
-            type="3"
-            :objectPath="objectPath"
-            :api="$api.sceneLibrary.saveSceneAccident"
-            @fileClose="fileClose"
-        ></file-dialog> -->
-
         <tableList
             ref="table"
             style="margin: 30px"
@@ -162,12 +144,6 @@
                         title="查看"
                     >
                     </i>
-                    <!-- <i
-                        @click="delRow(scope.row)"
-                        class="el-icon-delete elIcon"
-                        title="删除"
-                    >
-                    </i> -->
                 </template>
             </el-table-column>
         </tableList>
@@ -190,12 +166,11 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-import fileDialog from "./components/fileDialog";
 import { mapState } from "vuex";
 
 export default {
     name: "trafficAccidentSimulationScenarioList", // 交通事故仿真场景
-    components: { searchLayout, tableList, fileDialog },
+    components: { searchLayout, tableList },
     data() {
         return {
             searchParams: {

+ 22 - 155
src/views/systemManagement/sceneLibraryManagement/generalizationScene.vue

@@ -54,31 +54,6 @@
                 >
                 </el-time-picker>
             </template>
-            <!-- <template slot="searchItem27">
-                <el-checkbox-group v-model="labels">
-                    <el-checkbox-button label="1" :key="1" class="labelA"
-                        >高速</el-checkbox-button
-                    >
-                    <el-checkbox-button label="2" :key="2" class="labelB"
-                        >切入</el-checkbox-button
-                    >
-                    <el-checkbox-button label="3" :key="3" class="labelC"
-                        >切出</el-checkbox-button
-                    >
-                    <el-checkbox-button label="4" :key="4" class="labelD"
-                        >变道</el-checkbox-button
-                    >
-                    <el-checkbox-button label="5" :key="5" class="labelA"
-                        >匝道</el-checkbox-button
-                    >
-                    <el-checkbox-button label="6" :key="6" class="labelB"
-                        >隧道</el-checkbox-button
-                    >
-                    <el-checkbox-button label="7" :key="7" class="labelC"
-                        >掉头</el-checkbox-button
-                    >
-                </el-checkbox-group>
-            </template> -->
             <template slot="searchBtn1">
                 <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
@@ -87,10 +62,6 @@
             </template>
         </search-layout>
 
-        <!-- <div class="btnsPanel">
-            <upload ref="upload" :limit="1" @didUpload="didUpload"></upload>
-        </div> -->
-
         <tableList
             ref="table"
             style="margin: 30px"
@@ -105,14 +76,14 @@
                 align="center"
                 width="180"
             >
-                <!-- <template v-slot="scope">
+                <template v-slot="scope">
                     <i
-                        @click="viewRow(scope.row)"
-                        class="el-icon-view elIcon cursor"
-                        title="查看"
+                        @click="delRow(scope.row)"
+                        class="el-icon-delete elIcon"
+                        title="删除"
                     >
                     </i>
-                </template> -->
+                </template>
             </el-table-column>
         </tableList>
 
@@ -134,7 +105,6 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-// import upload from "./components/upload";
 import { mapState } from "vuex";
 
 export default {
@@ -148,18 +118,10 @@ export default {
                 fileName: [], // 功能模块
                 scenarioWeather: [], // 天气
                 scenarioTime: "", // 时间
-
-                // highSpeed: [], // 高速
-                // ramp: [], // 匝道
-                // tunnel: [], // 隧道
-                // cutIn: [], // 切入
-                // cutOut: [], // 切出
-                // laneChange: [], // 变道
-                // turnAround: [], // 掉头
             },
             labels: [],
             fileNameList: [],
-            scenarioWeatherList: [],
+            // scenarioWeatherList: [],
             props: {
                 multiple: true,
                 label: "dictName",
@@ -191,15 +153,11 @@ export default {
                     label: "天气",
                     prop: "scenarioWeather",
                 },
-                // {
-                //     label: "标签",
-                //     prop: "label",
-                // },
-                // {
-                //     label: "操作",
-                //     prop: "cgInfos",
-                //     template: true,
-                // },
+                {
+                    label: "操作",
+                    prop: "cgInfos",
+                    template: true,
+                },
             ],
             pagination: {
                 //分页使用
@@ -224,107 +182,19 @@ export default {
         };
     },
 
+    props: {
+        scenarioWeatherList: {
+            type: Array,
+            default: [],
+        },
+    },
+
     computed: {
         ...mapState(["fileHost", "fileUrl"]),
     },
 
     methods: {
         doSearch() {
-            /* this.searchParams.highSpeed = this.labels.includes("1")
-                ? [["roadType", "高速"]]
-                : [];
-            this.searchParams.cutIn = this.labels.includes("2")
-                ? [
-                      [
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "机动车从左侧切入成功",
-                      ],
-                      [
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "机动车从右侧切入成功",
-                      ],
-                  ]
-                : [];
-            this.searchParams.cutOut = this.labels.includes("3")
-                ? [
-                      [
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "机动车向左侧切出成功",
-                      ],
-                      [
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "targetBehavior",
-                          "机动车向右侧切出成功",
-                      ],
-                  ]
-                : [];
-            this.searchParams.laneChange = this.labels.includes("4")
-                ? [
-                      [
-                          "selfBehavior",
-                          "selfBehavior",
-                          "selfBehavior",
-                          "向左变道成功",
-                      ],
-                      [
-                          "selfBehavior",
-                          "selfBehavior",
-                          "selfBehavior",
-                          "向右变道成功",
-                      ],
-                      [
-                          "selfBehavior",
-                          "selfBehavior",
-                          "selfBehavior",
-                          "向左连续变道",
-                      ],
-                      [
-                          "selfBehavior",
-                          "selfBehavior",
-                          "selfBehavior",
-                          "向右连续变道",
-                      ],
-                      [
-                          "selfBehavior",
-                          "selfBehavior",
-                          "selfBehavior",
-                          "向左变道超车",
-                      ],
-                      [
-                          "selfBehavior",
-                          "selfBehavior",
-                          "selfBehavior",
-                          "向右变道超车",
-                      ],
-                  ]
-                : [];
-            this.searchParams.ramp = this.labels.includes("5")
-                ? [["ramp", "是"]]
-                : [];
-            this.searchParams.tunnel = this.labels.includes("6")
-                ? [["tunnel", "是"]]
-                : [];
-            this.searchParams.turnAround = this.labels.includes("7")
-                ? [
-                      ["selfBehavior", "直路掉头"],
-                      ["selfBehavior", "selfBehavior", "路口掉头"],
-                  ]
-                : []; */
             this.refreshList(this.searchParams);
         },
         //刷新table
@@ -366,9 +236,10 @@ export default {
             }).then(() => {
                 this.$axios({
                     method: "post",
-                    url: this.$api.sceneLibrary.deleteSceneNatural,
+                    url: this.$api.sceneLibrary.deleteSceneGeneralTemplateById,
                     data: {
-                        naturalId: row.naturalId,
+                        id: row.id,
+                        sceneId: row.sceneId,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -410,11 +281,7 @@ export default {
         },
     },
 
-    async mounted() {
-        await this.$dicsListsInit({
-            scenarioWeatherList: "scenarioWeather",
-        });
-
+    mounted() {
         this.getFileNameList();
     },
 };

+ 39 - 19
src/views/systemManagement/sceneLibraryManagement/naturalDrivingScene.vue

@@ -211,13 +211,13 @@ export default {
             },
             labels: [],
             list: [],
-            roadList: [],
-            infrastructureList: [],
-            trafficConditionList: [],
-            selfBehaviorList: [],
-            targetBehaviorList: [],
-            naturalEnvironmentList: [],
-            temporaryOperationList: [],
+            // roadList: [],
+            // infrastructureList: [],
+            // trafficConditionList: [],
+            // selfBehaviorList: [],
+            // targetBehaviorList: [],
+            // naturalEnvironmentList: [],
+            // temporaryOperationList: [],
             props: {
                 multiple: true,
                 label: "dictName",
@@ -275,6 +275,37 @@ export default {
         };
     },
 
+    props: {
+        roadList: {
+            type: Array,
+            default: [],
+        },
+        infrastructureList: {
+            type: Array,
+            default: [],
+        },
+        trafficConditionList: {
+            type: Array,
+            default: [],
+        },
+        selfBehaviorList: {
+            type: Array,
+            default: [],
+        },
+        targetBehaviorList: {
+            type: Array,
+            default: [],
+        },
+        naturalEnvironmentList: {
+            type: Array,
+            default: [],
+        },
+        temporaryOperationList: {
+            type: Array,
+            default: [],
+        },
+    },
+
     computed: {
         ...mapState(["fileHost", "fileUrl"]),
     },
@@ -431,6 +462,7 @@ export default {
                     url: this.$api.sceneLibrary.deleteSceneNatural,
                     data: {
                         naturalId: row.naturalId,
+                        naturalName: row.naturalName,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -456,18 +488,6 @@ export default {
             this.doSearch();
         },
     },
-
-    async mounted() {
-        await this.$dicsTreesInit({
-            roadList: "road",
-            infrastructureList: "infrastructure",
-            trafficConditionList: "trafficCondition",
-            selfBehaviorList: "selfBehavior",
-            targetBehaviorList: "targetBehavior",
-            naturalEnvironmentList: "naturalEnvironment",
-            temporaryOperationList: "temporaryOperation",
-        });
-    },
 };
 </script>
 

+ 59 - 3
src/views/systemManagement/sceneLibraryManagement/sceneLibraryManagement.vue

@@ -9,14 +9,34 @@
             @toolbarClick="toolsControl"
         >
         </toolbarTab>
-        <traffic-accident-simulation-scene v-show="subPageActiveName === 1">
+        <traffic-accident-simulation-scene
+            v-show="subPageActiveName === 1"
+            :selfDrivingList="selfDrivingList"
+            :targetDrivingList="targetDrivingList"
+            :selfReactionList="selfReactionList"
+            :conflictBehaviorList="conflictBehaviorList"
+            :conflictTypeList="conflictTypeList"
+        >
         </traffic-accident-simulation-scene>
-        <natural-driving-scene v-show="subPageActiveName === 2">
+        <natural-driving-scene
+            v-show="subPageActiveName === 2"
+            :roadList="roadList"
+            :infrastructureList="infrastructureList"
+            :trafficConditionList="trafficConditionList"
+            :selfBehaviorList="selfBehaviorList"
+            :targetBehaviorList="targetBehaviorList"
+            :naturalEnvironmentList="naturalEnvironmentList"
+            :temporaryOperationList="temporaryOperationList"
+        >
         </natural-driving-scene>
-        <standard-regulation-simulation-scene v-show="subPageActiveName === 3">
+        <standard-regulation-simulation-scene
+            v-show="subPageActiveName === 3"
+            :regulationTypeList="regulationTypeList"
+        >
         </standard-regulation-simulation-scene>
         <generalization-scene
             v-show="subPageActiveName === 4"
+            :scenarioWeatherList="scenarioWeatherList"
         ></generalization-scene>
     </div>
 </template>
@@ -40,6 +60,21 @@ export default {
     data() {
         return {
             subPageActiveName: 1,
+            selfDrivingList: [],
+            targetDrivingList: [],
+            selfReactionList: [],
+            conflictBehaviorList: [],
+            conflictTypeList: [],
+            roadList: [],
+            infrastructureList: [],
+            trafficConditionList: [],
+            selfBehaviorList: [],
+            targetBehaviorList: [],
+            naturalEnvironmentList: [],
+            temporaryOperationList: [],
+            regulationTypeList: [],
+            fileNameList: [],
+            scenarioWeatherList: [],
         };
     },
     computed: {
@@ -85,6 +120,27 @@ export default {
             this.subPageActiveName = item.fromId;
         },
     },
+    async mounted() {
+        await this.$dicsListsInit({
+            selfDrivingList: "selfDriving",
+            targetDrivingList: "targetDriving",
+            selfReactionList: "selfReaction",
+            conflictBehaviorList: "conflictBehavior",
+            conflictTypeList: "conflictType",
+            regulationTypeList: "regulationType",
+            scenarioWeatherList: "scenarioWeather",
+        });
+
+        await this.$dicsTreesInit({
+            roadList: "road",
+            infrastructureList: "infrastructure",
+            trafficConditionList: "trafficCondition",
+            selfBehaviorList: "selfBehavior",
+            targetBehaviorList: "targetBehavior",
+            naturalEnvironmentList: "naturalEnvironment",
+            temporaryOperationList: "temporaryOperation",
+        });
+    },
 };
 </script>
 

+ 9 - 26
src/views/systemManagement/sceneLibraryManagement/standardRegulationSimulationScene.vue

@@ -65,24 +65,6 @@
             </template>
         </search-layout>
 
-        <!-- <div class="btnsPanel">
-            <el-button
-                type="primary"
-                plain
-                icon="el-icon-upload"
-                @click="openFileDia"
-                >上传文件</el-button
-            >
-        </div> -->
-
-        <!-- <file-dialog
-            ref="fileDialog"
-            type="2"
-            :objectPath="objectPath"
-            :api="$api.sceneLibrary.saveStandardsRegulations"
-            @fileClose="fileClose"
-        ></file-dialog> -->
-
         <tableList
             ref="table"
             style="margin: 30px"
@@ -132,7 +114,6 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-// import fileDialog from "./components/fileDialog";
 import { mapState } from "vuex";
 
 export default {
@@ -148,7 +129,7 @@ export default {
                 label: [],
             },
             labels: [], // 标签
-            regulationTypeList: [],
+            // regulationTypeList: [],
             columns: [
                 //表格列
                 {
@@ -198,6 +179,13 @@ export default {
         };
     },
 
+    props: {
+        regulationTypeList: {
+            type: Array,
+            default: [],
+        },
+    },
+
     computed: {
         ...mapState(["fileHost", "fileUrl"]),
     },
@@ -249,6 +237,7 @@ export default {
                     url: this.$api.sceneLibrary.deleteStandardsRegulations,
                     data: {
                         regulationsId: row.regulationsId,
+                        sceneName: row.sceneName,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -274,12 +263,6 @@ export default {
             this.doSearch();
         },
     },
-
-    async mounted() {
-        await this.$dicsListsInit({
-            regulationTypeList: "regulationType",
-        });
-    },
 };
 </script>
 

+ 29 - 34
src/views/systemManagement/sceneLibraryManagement/trafficAccidentSimulationScene.vue

@@ -123,24 +123,6 @@
             </template>
         </search-layout>
 
-        <!-- <div class="btnsPanel">
-            <el-button
-                type="primary"
-                plain
-                icon="el-icon-upload"
-                @click="openFileDia"
-                >上传文件</el-button
-            >
-        </div> -->
-
-        <!-- <file-dialog
-            ref="fileDialog"
-            type="3"
-            :objectPath="objectPath"
-            :api="$api.sceneLibrary.saveSceneAccident"
-            @fileClose="fileClose"
-        ></file-dialog> -->
-
         <tableList
             ref="table"
             style="margin: 30px"
@@ -190,7 +172,6 @@
 <script>
 import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
-// import fileDialog from "./components/fileDialog";
 import { mapState } from "vuex";
 
 export default {
@@ -212,11 +193,11 @@ export default {
                 carConflict: "", // 机动车-机动车冲突
             },
             labels: [],
-            selfDrivingList: [],
-            targetDrivingList: [],
-            selfReactionList: [],
-            conflictBehaviorList: [],
-            conflictTypeList: [],
+            // selfDrivingList: [],
+            // targetDrivingList: [],
+            // selfReactionList: [],
+            // conflictBehaviorList: [],
+            // conflictTypeList: [],
             columns: [
                 //表格列
                 {
@@ -277,6 +258,29 @@ export default {
         };
     },
 
+    props: {
+        selfDrivingList: {
+            type: Array,
+            default: [],
+        },
+        targetDrivingList: {
+            type: Array,
+            default: [],
+        },
+        selfReactionList: {
+            type: Array,
+            default: [],
+        },
+        conflictBehaviorList: {
+            type: Array,
+            default: [],
+        },
+        conflictTypeList: {
+            type: Array,
+            default: [],
+        },
+    },
+
     computed: {
         ...mapState(["fileHost", "fileUrl"]),
     },
@@ -347,6 +351,7 @@ export default {
                     url: this.$api.sceneLibrary.deleteSceneAccident,
                     data: {
                         accidentId: row.accidentId,
+                        sceneName: row.sceneName,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -372,16 +377,6 @@ export default {
             this.doSearch();
         },
     },
-
-    async mounted() {
-        await this.$dicsListsInit({
-            selfDrivingList: "selfDriving",
-            targetDrivingList: "targetDriving",
-            selfReactionList: "selfReaction",
-            conflictBehaviorList: "conflictBehavior",
-            conflictTypeList: "conflictType",
-        });
-    },
 };
 </script>