zhangliang2 3 rokov pred
rodič
commit
61348c0f72

+ 2 - 2
.env

@@ -1,7 +1,7 @@
 # 用于标记打包的环境
 NODE_ENV = production
 
-# 使用 process.env.VUE_APP_GET_HOST
+# 使用 process.env.VUE_APP_IS_DEV
 
 # 域名
-VUE_APP_GET_HOST = ''
+VUE_APP_IS_DEV = 'false'

+ 2 - 2
.env.dev

@@ -1,7 +1,7 @@
 # 用于标记打包的环境
 NODE_ENV = DEV
 
-# 使用 process.env.VUE_APP_GET_HOST
+# 使用 process.env.VUE_APP_IS_DEV
 
 # 域名
-VUE_APP_GET_HOST = 'http://10.15.12.72:8001'
+VUE_APP_IS_DEV = 'true'

+ 6 - 0
src/api/sceneLibrary.js

@@ -9,12 +9,15 @@ const deleteScoringRules = basePart + '/ScoringRules/deleteScoringRules'; // 删
 
 const queryStandardsRegulationsList = basePart + '/StandardsRegulations/queryStandardsRegulationsList'; // 标准法规仿真场景列表
 const saveStandardsRegulations = basePart + '/StandardsRegulations/saveStandardsRegulations'; // 新增标准法规仿场景
+const deleteStandardsRegulations = basePart + '/StandardsRegulations/deleteStandardsRegulations'; // 删除标准法规仿场景
 
 const querySceneAccidentList = basePart + '/SceneAccident/querySceneAccidentList'; // 交通事故仿真场景列表
 const saveSceneAccident = basePart + '/SceneAccident/saveSceneAccident'; // 新增交通事故仿真场景
+const deleteSceneAccident = basePart + '/SceneAccident/deleteSceneAccident'; // 删除交通事故仿真场景
 
 const querySceneNaturalList = basePart + '/SceneNatural/querySceneNaturalList'; // 自然驾驶场景列表
 const saveSceneNatural = basePart + '/SceneNatural/saveSceneNatural'; // 新增自然驾驶场景
+const deleteSceneNatural = basePart + '/SceneNatural/deleteSceneNatural'; // 删除自然驾驶场景
 
 const queryScenePackageList = basePart + '/ScenePackage/queryScenePackageList'; // 场景测试包管理列表
 const instShareList = basePart + '/ScenePackage/instShareList'; // 分享场景测试包
@@ -35,12 +38,15 @@ export default {
 
     queryStandardsRegulationsList,
     saveStandardsRegulations,
+    deleteStandardsRegulations,
 
     querySceneAccidentList,
     saveSceneAccident,
+    deleteSceneAccident,
 
     querySceneNaturalList,
     saveSceneNatural,
+    deleteSceneNatural,
 
     queryScenePackageList,
     instShareList,

+ 14 - 2
src/components/echarts/lineChart1.vue

@@ -1,5 +1,9 @@
 <template>
-    <div class="linechart" :id="id" style="width: 100%; height: 100%"></div>
+    <div
+        class="linechart"
+        :id="id"
+        style="width: calc(100vw - 270px); height: calc(80vh - 260px)"
+    ></div>
 </template>
 
 <script>
@@ -57,7 +61,15 @@ export default {
 
         let option = {
             xAxis: {
-                data: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
+                data: [
+                    "星期一",
+                    "星期二",
+                    "星期三",
+                    "星期四",
+                    "星期五",
+                    "星期六",
+                    "星期日",
+                ],
             },
             yAxis: {},
             series: [

+ 16 - 4
src/components/echarts/lineChart2.vue

@@ -1,5 +1,9 @@
 <template>
-    <div class="linechart" :id="id" style="width: calc(100vw - 270px); height: calc(45vh);"></div>
+    <div
+        class="linechart"
+        :id="id"
+        style="width: calc(100vw - 240px); height: calc(48vh - 165px)"
+    ></div>
 </template>
 
 <script>
@@ -57,9 +61,17 @@ export default {
 
         let option = {
             xAxis: {
-                type: 'category',
+                type: "category",
                 boundaryGap: false,
-                data: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
+                data: [
+                    "星期一",
+                    "星期二",
+                    "星期三",
+                    "星期四",
+                    "星期五",
+                    "星期六",
+                    "星期日",
+                ],
             },
             yAxis: {},
             series: [
@@ -74,7 +86,7 @@ export default {
                     },
                     areaStyle: {
                         color: "rgba(51,151,255,0.2)",
-                    }
+                    },
                 },
             ],
         };

+ 16 - 4
src/components/echarts/lineChart3.vue

@@ -1,5 +1,9 @@
 <template>
-   <div class="linechart" :id="id" style="width: calc(100vw - 270px); height: calc(45vh);"></div>
+    <div
+        class="linechart"
+        :id="id"
+        style="width: calc(100vw - 240px); height: calc(48vh - 165px)"
+    ></div>
 </template>
 
 <script>
@@ -57,9 +61,17 @@ export default {
 
         let option = {
             xAxis: {
-                type: 'category',
+                type: "category",
                 boundaryGap: false,
-                data: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
+                data: [
+                    "星期一",
+                    "星期二",
+                    "星期三",
+                    "星期四",
+                    "星期五",
+                    "星期六",
+                    "星期日",
+                ],
             },
             yAxis: {},
             series: [
@@ -74,7 +86,7 @@ export default {
                     },
                     areaStyle: {
                         color: "rgba(51,151,255,0.2)",
-                    }
+                    },
                 },
             ],
         };

+ 1 - 3
src/components/echarts/pieChart.vue

@@ -140,9 +140,7 @@ export default {
                 //图例
                 orient: "vertical", //图例的布局,竖直    horizontal为水平
                 x: "right", //图例显示在右边
-                data: [
-                    "图例一", "图例二", "图例三", "图例四"
-                ],
+                data: ["图例一", "图例二", "图例三", "图例四"],
                 textStyle: {
                     //图例文字的样式
                     color: "#333", //文字颜色

+ 6 - 4
src/components/echarts/pieChart1.vue

@@ -1,5 +1,9 @@
 <template>
-    <div class="linechart" :id="id" style="width: calc(33vw - 180px); height: calc(24vh);"></div>
+    <div
+        class="linechart"
+        :id="id"
+        style="width: calc(33vw - 180px); height: calc(42vh - 165px)"
+    ></div>
 </template>
 
 <script>
@@ -140,9 +144,7 @@ export default {
                 //图例
                 orient: "vertical", //图例的布局,竖直    horizontal为水平
                 x: "right", //图例显示在右边
-                data: [
-                    "图例一", "图例二", "图例三", "图例四"
-                ],
+                data: ["图例一", "图例二", "图例三", "图例四"],
                 textStyle: {
                     //图例文字的样式
                     color: "#333", //文字颜色

+ 2 - 0
src/store/index.js

@@ -7,6 +7,8 @@ export default new Vuex.Store({
   state: {
     // configTitleList: ['摄像头', '完美传感器', '激光雷达', '毫米波雷达', 'GPS'],
     configTitleList: ['摄像头', '完美传感器', '激光雷达', 'GPS'],
+    fileHost: 'http://10.15.12.70:8001', // 开发环境需要连开发服务器地址,上线后会用相对地址拼接fileUrl
+    fileUrl: '/simulation/resource/common/minio/preview',
   },
   mutations: {},
   actions: {},

+ 65 - 44
src/views/mainPage.vue

@@ -78,7 +78,7 @@
                 </div>
             </div>
 
-            <div class="boxContent">
+            <div class="boxContent padTop20">
                 <div class="titlePanel">
                     <div class="titlePanelBor">服务器监控</div>
                 </div>
@@ -95,11 +95,11 @@
         </div>
 
         <div v-show="activeName === '2'" class="tabBox">
-            <div class="boxContent">
+            <div class="boxContent padBot10">
                 <div class="titlePanel">
                     <div class="titlePanelBor">数据概览</div>
                 </div>
-                <ul class="listPanel listPanelB listPanelC">
+                <ul class="listPanel listPanelB">
                     <li class="shadowBox">
                         <b>场景数量</b>
                         <i>678</i>
@@ -148,7 +148,7 @@
                 </div>
             </div>
 
-            <div class="boxContent">
+            <div class="boxContent boxContentB">
                 <div class="titlePanel">
                     <div class="titlePanelBor">状态统计</div>
                 </div>
@@ -404,10 +404,10 @@ export default {
 
 <style lang='less' scoped>
 .mainPagePanel {
-    padding: 20px;
+    padding: 20px 20px 20px 0;
 
     .tabBox {
-        padding: 30px;
+        padding: 10px 30px 0;
     }
 
     .myTabsBox {
@@ -424,25 +424,24 @@ export default {
     }
 
     .boxContent {
-        padding-bottom: 40px;
+        padding-bottom: 20px;
 
         .titlePanel {
-            padding-bottom: 20px;
+            padding-bottom: 10px;
         }
 
         .listPanel {
             display: flex;
-            flex-wrap: wrap;
+            flex-wrap: nowrap;
             color: @themeColor;
 
             li {
-                width: 300px;
+                flex: 1;
                 display: flex;
-                height: 120px;
-                padding: 24px;
-                margin-right: 54px;
-                margin-bottom: 20px;
-                justify-content: space-between;
+                height: 10vh;
+                padding: 10px 1%;
+                margin-right: 3%;
+                justify-content: space-around;
                 align-items: center;
 
                 span,
@@ -454,11 +453,26 @@ export default {
                 }
 
                 b {
-                    font-size: 18px;
+                    font-size: 90%;
                 }
 
                 i {
-                    font-size: 36px;
+                    font-size: 150%;
+                }
+
+                &:last-child {
+                    margin-right: 0;
+                }
+            }
+
+            .colorA,
+            .colorB,
+            .colorC,
+            .colorD,
+            .colorE {
+                span {
+                    width: 15%;
+                    height: 45%;
                 }
             }
 
@@ -466,8 +480,8 @@ export default {
                 color: @themeColor;
 
                 span {
-                    width: 36px;
-                    height: 38px;
+                    // width: 36px;
+                    // height: 38px;
                     background: url("../assets/common/image/index/hw1.png")
                         center center no-repeat;
                     background-size: contain;
@@ -477,8 +491,6 @@ export default {
                 color: #8479ff;
 
                 span {
-                    width: 36px;
-                    height: 38px;
                     background: url("../assets/common/image/index/hw2.png")
                         center center no-repeat;
                     background-size: contain;
@@ -488,8 +500,6 @@ export default {
                 color: #ffc935;
 
                 span {
-                    width: 36px;
-                    height: 38px;
                     background: url("../assets/common/image/index/hw3.png")
                         center center no-repeat;
                     background-size: contain;
@@ -499,8 +509,6 @@ export default {
                 color: #bf5bff;
 
                 span {
-                    width: 36px;
-                    height: 38px;
                     background: url("../assets/common/image/index/hw4.png")
                         center center no-repeat;
                     background-size: contain;
@@ -510,8 +518,6 @@ export default {
                 color: #ff6161;
 
                 span {
-                    width: 36px;
-                    height: 38px;
                     background: url("../assets/common/image/index/hw5.png")
                         center center no-repeat;
                     background-size: contain;
@@ -521,24 +527,14 @@ export default {
 
         .listPanelB {
             li {
-                display: block;
+                display: flex;
+                flex-direction: column;
 
                 i,
                 b {
                     display: block;
-                    line-height: 1;
                     text-align: center;
                 }
-
-                b {
-                    padding-bottom: 15px;
-                }
-            }
-        }
-
-        .listPanelC {
-            li {
-                width: 260px;
             }
         }
 
@@ -551,29 +547,42 @@ export default {
             }
 
             .title {
-                padding-top: 24px;
-                padding-bottom: 24px;
+                padding: 10px 0;
                 text-align: center;
-                font-size: 18px;
+                font-size: 16px;
+                line-height: 1;
                 font-weight: bold;
             }
 
             .shadowBoxB {
                 margin: 0 50px;
             }
+
+            .shadowBox {
+                padding: 0;
+            }
         }
     }
 
+    .padTop20 {
+        padding-top: 20px;
+    }
+
+    .padBot10 {
+        padding-bottom: 10px;
+    }
+
     /deep/ .el-tabs__item.is-active {
         color: @themeColor;
     }
 
     .chartABox {
-        height: calc(45vh);
+        height: calc(80vh - 260px);
     }
 
     .chartBBox {
-        height: calc(45vh);
+        height: calc(48vh - 165px);
+        overflow: hidden;
     }
 
     .chartABox.shadowBox,
@@ -581,6 +590,18 @@ export default {
         padding: 0;
     }
 
+    .boxContentB {
+        padding-bottom: 0;
+    }
+
+    .pieBox {
+        height: calc(42vh - 165px);
+
+        .shadowBox {
+            padding: 0;
+        }
+    }
+
     .tabsA /deep/ .el-tabs__nav-wrap::after {
         background-color: @themeColor;
     }

+ 31 - 13
src/views/page/pageMenu.vue

@@ -34,7 +34,7 @@
                 </li>
                 <li
                     @click="menuFoldHandle(1)"
-                    v-bind:class="{ isOpened: opened === 'systemManagement' }"
+                    v-bind:class="{ isOpened: opened === 'workManagement' }"
                 >
                     <b class="my-icon-menuD"></b>
                 </li>
@@ -54,6 +54,7 @@
 
             <div class="menuList" v-show="!menuFold">
                 <el-menu
+                    ref="menu"
                     default-active="mainPage"
                     class="el-menu-vertical-demo"
                     background-color="#3397FF"
@@ -62,11 +63,11 @@
                     @select="menuSel"
                 >
                     <!-- active-text-color="#ffffff" -->
-                    <el-menu-item index="mainPage" class="indexMenu">
+                    <el-menu-item :index="menus[0]" class="indexMenu">
                         <i class="my-icon-home"></i>
                         <span>首页</span>
                     </el-menu-item>
-                    <el-submenu index="modelLibrary">
+                    <el-submenu :index="menus[1]">
                         <template slot="title">
                             <i class="my-icon-menuA"></i>
                             <span>模型库</span>
@@ -81,7 +82,7 @@
                             >车辆配置</el-menu-item
                         >
                     </el-submenu>
-                    <el-submenu index="algorithmsLibrary">
+                    <el-submenu :index="menus[2]">
                         <template slot="title">
                             <i class="my-icon-menuB"></i>
                             <span>算法库</span>
@@ -90,7 +91,7 @@
                             >算法库列表</el-menu-item
                         >
                     </el-submenu>
-                    <el-submenu index="sceneLibrary">
+                    <el-submenu :index="menus[3]">
                         <template slot="title">
                             <i class="my-icon-menuC"></i>
                             <span>场景库</span>
@@ -113,7 +114,7 @@
                             >评分规则</el-menu-item
                         >
                     </el-submenu>
-                    <el-submenu index="workManagement">
+                    <el-submenu :index="menus[4]">
                         <template slot="title">
                             <i class="my-icon-menuD"></i>
                             <span>工作管理</span>
@@ -151,6 +152,13 @@ export default {
             menuFold: false, // menu是否折叠
             opened: false,
             imgSrc: require("@/assets/common/image/photoF.png"),
+            menus: [
+                "mainPage",
+                "modelLibrary",
+                "algorithmsLibrary",
+                "sceneLibrary",
+                "workManagement",
+            ],
         };
     },
     methods: {
@@ -163,18 +171,28 @@ export default {
             this.$emit("menuFold", this.menuFold);
         },
         menuSel(index, indexPath) {
-            console.log(index, indexPath);
+            // console.log(index, indexPath);
             this.opened = indexPath[0];
+
+            // 如果是首页 手动关闭其他菜单
+            if (index === this.menus[0]) {
+                this.menus.forEach((i) => {
+                    this.$refs.menu.close(i);
+                });
+            }
         },
     },
     created() {
-        localStorage.setItem(
-            "Authorization",
-            "Bearer 9882c634-9af6-4647-89dc-8ad53c04a56b"
-        );
+        // localStorage.setItem(
+        //     "Authorization",
+        //     "Bearer 9882c634-9af6-4647-89dc-8ad53c04a56b"
+        // );
+
+
+
         // document.cookie = 'Authorization=Bearer 52de2c22-c2f9-4307-b49d-5b5593792352'
         // console.log(this.$route);
-        /* let { code, ticket } = this.$route.query;
+        let { code, ticket } = this.$route.query;
         if (code && ticket) {
             this.$axios({
                 method: "post",
@@ -192,7 +210,7 @@ export default {
             });
         } else {
             console.log(66);
-        } */
+        }
     },
 };
 </script>

+ 21 - 24
src/views/sceneLibrary/naturalDrivingScenarioList.vue

@@ -183,6 +183,7 @@
 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", // 自然驾驶场景
@@ -263,9 +264,16 @@ export default {
             videoSrc: "",
             objectPath: "",
             videoDiaTitle: "",
-            abc: "http://10.15.12.72:8001/simulation/resource/common/minio/preview?objectName=自然驾驶场景/20220314/0.2378730429515783/simulation.mp4&access_token=9882c634-9af6-4647-89dc-8ad53c04a56b",
+            //abc: "http://10.15.12.72:8001/simulation/resource/common/minio/preview?objectName=
+            // 自然驾驶场景/20220314/0.2378730429515783/simulation.mp4&access_token
+            // =9882c634-9af6-4647-89dc-8ad53c04a56b",
         };
     },
+
+    computed: {
+        ...mapState(["fileHost", "fileUrl"]),
+    },
+
     methods: {
         doSearch() {
             this.refreshList(this.searchParams);
@@ -290,28 +298,19 @@ export default {
             this.doSearch();
         },
         viewRow(row) {
-            console.log(123);
             this.dialogVisible = true;
             this.videoDiaTitle = row.naturalName;
-            // this.videoSrc =
-            //     "http://10.15.12.72:8001/simulation/resource/common/minio/preview?objectName=" +
-            //     row.videoAddress+"&access_token=9882c634-9af6-4647-89dc-8ad53c04a56b";
-            this.videoSrc = this.abc;
-            this.autoplay = true;
 
-            // this.$axios({
-            //     method: "post",
-            //     url: this.$api.common.download,
-            //     data: {
-            //         objectName: row.videoAddress,
-            //     },
-            // }).then((res) => {
-            //     if (res.code == 200 && res.info) {
-            //         this.form = res.info;
-            //     } else {
-            //         this.$message.error(res.message || "获取信息失败");
-            //     }
-            // });
+            let url = "";
+            if (process.env.VUE_APP_IS_DEV == "true") {
+                url = this.fileHost + this.fileUrl;
+            } else {
+                url = this.fileUrl;
+            }
+
+            let token = localStorage.getItem("Authorization").split(" ")[1];
+            this.videoSrc += `${url}?objectName=${row.videoAddress}&access_token=${token}`;
+            this.autoplay = true;
         },
         delRow(row) {
             this.$confirm("确认是否删除?", "提示", {
@@ -321,9 +320,9 @@ export default {
             }).then(() => {
                 this.$axios({
                     method: "post",
-                    url: this.$api.sceneLibrary.deleteScoringRules,
+                    url: this.$api.sceneLibrary.deleteSceneNatural,
                     data: {
-                        rulesId: row.rulesId,
+                        naturalId: row.naturalId,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -351,8 +350,6 @@ export default {
     },
 
     async mounted() {
-        console.log(process.env.VUE_APP_GET_HOST);
-        console.log(process.env);
         await this.$dicsTreesInit({
             roadList: "road",
             infrastructureList: "infrastructure",

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

@@ -49,6 +49,14 @@
                     <span>{{ scope.row.sublistName }}</span>
                 </template>
             </el-table-column>
+            <el-table-column label="权重" slot="weight" align="center">
+                <template v-slot="scope">
+                    <span v-if="scope.row.weightErr" style="color: red">{{
+                        scope.row.weight
+                    }}</span>
+                    <span v-else>{{ scope.row.weight }}</span>
+                </template>
+            </el-table-column>
         </tableList>
 
         <div class="btns">
@@ -96,6 +104,7 @@
                         maxlength="6"
                         v-autoTrim="{ obj: form, key: 'weight' }"
                         v-model="form.weight"
+                        :disabled="editType === 'edit' && isRoot"
                     >
                     </el-input>
                 </el-form-item>
@@ -223,6 +232,7 @@ export default {
                 {
                     label: "权重",
                     prop: "weight",
+                    template: true,
                 },
                 {
                     label: "场景数量",
@@ -257,7 +267,7 @@ export default {
                         sceneStatueIds: null,
                         sceneTrafficIds: null,
                         seq: 0,
-                        sublistName: "根节点",
+                        sublistName: "一级指标",
                         weight: 100,
                     },
                 ],
@@ -306,6 +316,7 @@ export default {
             checkedIdsA: [], // 交通事故列表已选
             checkedIdsB: [], // 自然驾驶列表已选
             checkedIdsC: [], // 标准法规列表已选
+            isRoot: false, // 是否是根节点
         };
     },
 
@@ -341,6 +352,13 @@ export default {
             this.nameDiaTitle = "编辑指标";
             this.editType = "edit";
             this.indicatorsVisible = true;
+
+            if (row.parentId === "0") {
+                this.isRoot = true;
+            } else {
+                this.isRoot = false;
+            }
+
             this.form.sublistName = row.sublistName;
             this.form.weight = row.weight;
             this.form.remarks = row.remarks;
@@ -351,6 +369,7 @@ export default {
         addIndicators(row) {
             this.nameDiaTitle = "添加指标";
             this.editType = "add";
+            
             this.indicatorsVisible = true;
 
             this.curNode = row;
@@ -403,6 +422,8 @@ export default {
                         }
                         this.curNode.children.push(node);
                     }
+console.log(this.getDataWay.data[0]);
+                    this.checkWeightValidate();
 
                     this.indicatorsCancel();
                 }
@@ -473,6 +494,15 @@ export default {
                 this.checkedIdsB.length +
                 this.checkedIdsC.length;
 
+            // 选择场景总数为0 则去掉对应的规则名称和id
+            if (this.curNode.sceneNum === 0) {
+                this.curNode.packageAndRules = "";
+                this.curNode.ruleName = "";
+            } else {
+                this.curNode.packageAndRules = this.formA.rulesId;
+                this.curNode.ruleName = this.formA.ruleName;
+            }
+
             // 选中数据分别传入对应的ids组
             this.curNode.sceneTrafficIds = this.checkedIdsA.join(",");
             this.curNode.sceneNaturalIds = this.checkedIdsB.join(",");
@@ -508,6 +538,32 @@ export default {
 
             this.scenarioListsVisible = false;
         },
+        // 校验权重
+        checkWeightValidate() {
+            this.allRowWeightErrFalse(this.getDataWay.data[0]);
+
+            let ids = [];
+
+            for (let index = 0; index < this.nodeList.length; index++) {
+                const element = this.nodeList[index];
+                if (element.children && element.children.length > 0) {
+                    let total = 0;
+                    let arr = [];
+                    element.children.forEach((item) => {
+                        console.log(this.nodeList);
+                        total += +this.nodeList.find((i) => i.id === item.id)
+                            .weight;
+                        arr.push(item.id);
+                    });
+                    if (total != 100) {
+                        ids.push(...arr);
+                    }
+                }
+            }
+            this.rowWeightErrTrue(this.getDataWay.data[0], ids);
+            console.log(6);
+            console.log(this.getDataWay.data[0]);
+        },
         // 深度优先遍历
         /* deepFirstSearch(node, nodeList) {
             if (node) {
@@ -537,6 +593,30 @@ export default {
             }
             return nodeList;
         },
+        // 使全部节点 weightErr 为 false
+        allRowWeightErrFalse(node) {
+            if (node) {
+                node.weightErr = false;
+                var children = node.children;
+                if (children) {
+                    for (var i = 0; i < children.length; i++)
+                        this.allRowWeightErrFalse(children[i]);
+                }
+            }
+        },
+        // 使部分节点 weightErr 为 true
+        rowWeightErrTrue(node, arr) {
+            if (node) {
+                if (arr.includes(node.id)) {
+                    node.weightErr = true;
+                }
+                var children = node.children;
+                if (children) {
+                    for (var i = 0; i < children.length; i++)
+                        this.rowWeightErrTrue(children[i], arr);
+                }
+            }
+        },
         save(isAdd) {
             this.nodeList = [];
             this.deepFirstSearch(this.getDataWay.data[0], this.nodeList);

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

@@ -113,6 +113,12 @@
                         title="查看"
                     >
                     </i>
+                    <i
+                        @click="delRow(scope.row)"
+                        class="el-icon-delete elIcon"
+                        title="删除"
+                    >
+                    </i>
                 </template>
             </el-table-column>
         </tableList>
@@ -136,6 +142,7 @@
 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", // 标准法规仿真场景
@@ -199,6 +206,11 @@ export default {
             videoDiaTitle: "",
         };
     },
+
+    computed: {
+        ...mapState(["fileHost", "fileUrl"]),
+    },
+
     methods: {
         doSearch() {
             this.refreshList(this.searchParams);
@@ -220,9 +232,40 @@ export default {
         viewRow(row) {
             this.dialogVisible = true;
             this.videoDiaTitle = row.sceneName;
-            this.videoSrc = row.videoPreview;
+
+            let url = "";
+            if (process.env.VUE_APP_IS_DEV == "true") {
+                url = this.fileHost + this.fileUrl;
+            } else {
+                url = this.fileUrl;
+            }
+
+            let token = localStorage.getItem("Authorization").split(" ")[1];
+            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.deleteStandardsRegulations,
+                    data: {
+                        regulationsId: row.regulationsId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
         diaClose(done) {
             this.autoplay = false;
             this.videoSrc = "";

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

@@ -146,6 +146,12 @@
                         title="查看"
                     >
                     </i>
+                    <i
+                        @click="delRow(scope.row)"
+                        class="el-icon-delete elIcon"
+                        title="删除"
+                    >
+                    </i>
                 </template>
             </el-table-column>
         </tableList>
@@ -169,6 +175,7 @@
 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", // 交通事故仿真场景
@@ -250,6 +257,11 @@ export default {
             videoDiaTitle: "",
         };
     },
+
+    computed: {
+        ...mapState(["fileHost", "fileUrl"]),
+    },
+
     methods: {
         doSearch() {
             this.refreshList(this.searchParams);
@@ -274,9 +286,40 @@ export default {
         viewRow(row) {
             this.dialogVisible = true;
             this.videoDiaTitle = row.sceneName;
-            this.videoSrc = row.videoPreview;
+
+            let url = "";
+            if (process.env.VUE_APP_IS_DEV == "true") {
+                url = this.fileHost + this.fileUrl;
+            } else {
+                url = this.fileUrl;
+            }
+
+            let token = localStorage.getItem("Authorization").split(" ")[1];
+            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.deleteSceneAccident,
+                    data: {
+                        accidentId: row.accidentId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
         diaClose(done) {
             this.autoplay = false;
             this.videoSrc = "";