Browse Source

场景库联调

zhangliang2 3 năm trước cách đây
mục cha
commit
ec74f55691

+ 1 - 1
src/App.vue

@@ -6,7 +6,7 @@
 
 <style lang="less">
 #app {
-    min-width: 1335px;
+    min-width: 1350px;
     width: 100%;
     height: 100%;
     margin: 0;

+ 5 - 0
src/api/common.js

@@ -1,8 +1,13 @@
 const basePart = '';
 const single = '/simulation/oauth/client/sign/single';
 
+const getDictListsByTypes = '/simulation/resource/server/dict/getDictListsByTypes'; // 字典 单级下拉
+const getDictTreesByTypes = '/simulation/resource/server/dict/getDictTreesByTypes'; // 字典 多级下拉
+
 export default {
     single,
+    getDictListsByTypes,
+    getDictTreesByTypes
 }
 
 //10.15.12.74:7001/simulation/oauth/client/sign/single?code=1001&ticket=1001

+ 15 - 1
src/api/sceneLibrary.js

@@ -11,6 +11,13 @@ const deleteScoringRules = basePart + '/ScoringRules/deleteScoringRules'; // 删
 const queryStandardsRegulationsList = basePart + '/StandardsRegulations/queryStandardsRegulationsList'; // 标准法规仿真场景列表
 const download = basePart + '/StandardsRegulations/download'; // 
 
+const querySceneAccidentList = basePart + '/SceneAccident/querySceneAccidentList'; // 交通事故仿真场景列表
+
+const querySceneNaturalList = basePart + '/SceneNatural/querySceneNaturalList'; // 自然驾驶场景列表
+
+const queryScenePackageList = basePart + '/ScenePackage/queryScenePackageList'; // 场景测试包管理列表
+const queryScenePackageSublistList = basePart + '/ScenePackage/queryScenePackageSublistList'; // 场景数据包列表
+
 export default {
     // queryScenePackageSublistList,
     queryScoringRulesList,
@@ -20,7 +27,14 @@ export default {
     deleteScoringRules,
 
     queryStandardsRegulationsList,
-    download
+    download,
+
+    querySceneAccidentList,
+
+    querySceneNaturalList,
+
+    queryScenePackageList,
+    queryScenePackageSublistList
 }
 
 

+ 9 - 0
src/api/workManagement.js

@@ -0,0 +1,9 @@
+const basePart = '/simulation/resource/server';
+
+const addOrUpdateProject = basePart + '/simulationProject/addOrUpdateProject'; // 创建手动运行项目
+
+
+export default {
+    addOrUpdateProject
+}
+

+ 1 - 13
src/axios/filter.js

@@ -40,7 +40,7 @@ Vue.use(VueAxios, axios);
 axios.defaults.baseURL = ''; //项目的的基础url
 axios.defaults.headers.common['Authorization'] = ""; //请求token信息配置
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; //请求type设置
-axios.defaults.timeout = 10000; //在超时前,所有请求都会等待10秒
+axios.defaults.timeout = 15000; //在超时前,所有请求都会等待10秒
 axios.defaults.withCredentials = true;
 
 // 添加请求拦截器
@@ -72,18 +72,6 @@ axios.interceptors.response.use(function (response) {
     return response;
 }, function (error) {
     tryHideFullScreenLoading();
-    // 对响应错误处理
-    // if (error.response && error.response.status == 401) {
-    //     //去登陆 执行login
-    //     localStorage.removeItem('Authorization');
-    //     window.location.reload();
-    // }
-    /*if (error.response && error.response.status == 500) {
-        ElementUI.MessageBox({
-            title: '提示',
-            message: '服务器未启动或正在重启,请稍后再试!'
-        });
-    }*/
     console.log('网络异常');
     ElementUI.Message.error("网络异常");
     return Promise.reject(error);

+ 106 - 0
src/lib/util.js

@@ -0,0 +1,106 @@
+import Vue from "vue";
+
+// 缓存
+const DicsCatch = {};
+// 单级下拉字典项
+Vue.prototype.$dicsListsInit = function (selectList) {
+
+    return new Promise((resolve, reject) => {
+        let noSelectList = {};
+        for (let selectNames in selectList) {
+            let dicsName = selectList[selectNames];
+            if (!!DicsCatch[dicsName]) {
+                this[selectNames] = DicsCatch[dicsName]
+            } else {
+                noSelectList[selectNames] = dicsName
+            }
+        }
+
+        if (Object.values(noSelectList).length <= 0) {
+            resolve()
+        } else {
+            this.$axios({
+                method: "post",
+                url: this.$api.common.getDictListsByTypes,
+                data: {
+                    dictTypes: Object.values(noSelectList).join(",")
+                }
+            }).then(res => {
+                if (res.code != 200) {
+                    this.$message.error(res.message || "字典获取失败");
+                    reject();
+                    return false;
+                }
+                let result = res.info;
+                for (let selectNames in noSelectList) {
+                    let dicsName = noSelectList[selectNames];
+                    for (let i = 0; i < result[dicsName].length; i++) {
+                        this[selectNames].push({
+                            name: result[dicsName][i].dictName,
+                            code: result[dicsName][i].dictCode,
+                        });
+                    }
+                    DicsCatch[dicsName] = this[selectNames]
+                }
+                resolve();
+            }).catch(error => {
+                this.$message.error("网络异常");
+                reject(error);
+            });
+        }
+    });
+}
+
+
+
+// 缓存
+const DicsTreeCatch = {};
+// 单级下拉字典项
+Vue.prototype.$dicsTreesInit = function (selectList) {
+
+    return new Promise((resolve, reject) => {
+        let noSelectList = {};
+        for (let selectNames in selectList) {
+            let dicsName = selectList[selectNames];
+            if (!!DicsTreeCatch[dicsName]) {
+                this[selectNames] = DicsTreeCatch[dicsName]
+            } else {
+                noSelectList[selectNames] = dicsName
+            }
+        }
+
+        if (Object.values(noSelectList).length <= 0) {
+            resolve()
+        } else {
+            this.$axios({
+                method: "post",
+                url: this.$api.common.getDictTreesByTypes,
+                data: {
+                    dictTypes: Object.values(noSelectList).join(",")
+                }
+            }).then(res => {
+                if (res.code != 200) {
+                    this.$message.error(res.message || "字典获取失败");
+                    reject();
+                    return false;
+                }
+                let result = res.info;
+                for (let selectNames in noSelectList) {
+                    let dicsName = noSelectList[selectNames];
+                    // for (let i = 0; i < result[dicsName].length; i++) {
+                    //     this[selectNames].push({
+                    //         name: result[dicsName][i].dictName,
+                    //         code: result[dicsName][i].dictCode,
+                    //     });
+                    // }
+                    this[selectNames] = result[dicsName]
+                    DicsTreeCatch[dicsName] = this[selectNames]
+                }
+                resolve();
+            }).catch(error => {
+                this.$message.error("网络异常");
+                reject(error);
+            });
+        }
+    });
+}

+ 1 - 0
src/main.js

@@ -13,6 +13,7 @@ import "./axios/filter"
 
 import '@/api/index.js'
 import '@/lib/autoTrim'
+import '@/lib/util.js'
 
 Vue.config.productionTip = false;
 

+ 2 - 1
src/views/page/pageMenu.vue

@@ -159,8 +159,9 @@ export default {
     created() {
         localStorage.setItem(
             "Authorization",
-            "Bearer 34d4020a-b746-4cc7-8cde-b3a8c3efbc11"
+            "Bearer 52de2c22-c2f9-4307-b49d-5b5593792352"
         );
+        document.cookie = 'Authorization=Bearer 52de2c22-c2f9-4307-b49d-5b5593792352'
         // console.log(this.$route);
         /* let { code, ticket } = this.$route.query;
         if (code && ticket) {

+ 30 - 32
src/views/sceneLibrary/gradingRule.vue

@@ -93,7 +93,8 @@ export default {
         save(isAdd) {
             this.$refs.form.validate((valid) => {
                 if (valid) {
-                    if (isAdd || !this.$route.query.formData) { // 另存为或新增页面
+                    if (isAdd || !this.$route.query.formData) {
+                        // 另存为或新增页面
                         this.form.rulesId = "";
                         this.form.share = "0";
                     }
@@ -104,47 +105,44 @@ export default {
                         data: {
                             ...this.form,
                         },
-                    })
-                        .then((res) => {
-                            if (res.code == 200) {
-                                this.$message.success("保存成功");
-                                this.cancel();
-                            } else {
-                                this.$message.error(res.message || "保存失败");
-                            }
-                        })
-                        // .catch((error) => {
-                        //     this.$message.error(error || "保存失败!");
-                        // });
+                    }).then((res) => {
+                        if (res.code == 200) {
+                            this.$message.success("保存成功");
+                            this.cancel();
+                        } else {
+                            this.$message.error(res.message || "保存失败");
+                        }
+                    });
+                    // .catch((error) => {
+                    //     this.$message.error(error || "保存失败!");
+                    // });
                 }
             });
         },
-        cancel(){
+        cancel() {
             this.$router.replace({ path: "/gradingRulesList" });
-        }
+        },
     },
 
     mounted() {
-        let rulesId = "";
         if (this.$route.query.formData) {
+            let rulesId = "";
             this.form.rulesId = rulesId = this.$route.query.formData.rulesId;
-            this.form.share = this.$route.query.formData.share;
-        }
-        this.share = this.form.share;
+            this.form.share = this.share = this.$route.query.formData.share;
 
-        if (rulesId) {
-            this.$axios({
-                method: "post",
-                url: this.$api.sceneLibrary.queryScoringRules,
-                data: {
-                    rulesId,
-                },
-            }).then((res) => {
-                console.log(res);
-                if (res.code == 200 && res.info) {
-                    this.form = res.info;
-                }
-            });
+            if (rulesId) {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.queryScoringRules,
+                    data: {
+                        rulesId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200 && res.info) {
+                        this.form = res.info;
+                    }
+                });
+            }
         }
     },
 };

+ 10 - 10
src/views/sceneLibrary/gradingRulesList.vue

@@ -134,7 +134,7 @@ export default {
                 ruleName: "", //规则名称
                 ruleDescription: "", //规则描述
                 yearMin: "", // 开始时间
-                yearMax: "", // 结束时间
+                yearMax: "" // 结束时间
             },
             searchDate: "", // 创建时间
             columns: [
@@ -160,7 +160,7 @@ export default {
                     label: "操作",
                     prop: "cgInfos",
                     template: true,
-                },
+                }
             ],
             pagination: {
                 //分页使用
@@ -168,7 +168,7 @@ export default {
                 pageSize: 10,
                 position: "right",
                 pageSizes: [10, 30, 50, 100, 200],
-                layout: "sizes, total, prev, pager, next, jumper",
+                layout: "sizes, total, prev, pager, next, jumper"
             },
             getDataWay: {
                 //加载表格数据
@@ -179,9 +179,9 @@ export default {
                 param: {
                     packageId: "11111111",
                     share: "1",
-                },
+                }
             },
-            dialogVisible: false,
+            dialogVisible: false
         };
     },
     methods: {
@@ -200,7 +200,7 @@ export default {
                 ruleDescription: this.searchParams.ruleDescription,
                 yearMin: this.searchParams.yearMin,
                 yearMax: this.searchParams.yearMax,
-                share: this.activeName === "1" ? "1" : "0",
+                share: this.activeName === "1" ? "1" : "0"
             };
             this.refreshList(pageMap);
         },
@@ -216,7 +216,7 @@ export default {
                 ruleName: "",
                 ruleDescription: "",
                 yearMin: "",
-                yearMax: "",
+                yearMax: ""
             };
             this.searchDate = "";
             this.doSearch();
@@ -289,10 +289,10 @@ export default {
                     },
                 },
             });
-        },
-    },
+        }
+    }
 
-    mounted() {},
+    // mounted() {}
 };
 </script>
 

+ 82 - 36
src/views/sceneLibrary/naturalDrivingScenarioList.vue

@@ -36,7 +36,7 @@
             </template>
             <template slot="searchItem4">
                 <span class="label">自车行为</span>
-                <el-select v-model="searchParams.status">
+                <el-select v-model="searchParams.selfBehavior">
                     <el-option
                         v-for="item in list"
                         :label="item.caption"
@@ -58,30 +58,40 @@
             </template>
             <template slot="searchItem6">
                 <span class="label">自然环境</span>
-                <el-select v-model="searchParams.status">
-                    <el-option
-                        v-for="item in list"
-                        :label="item.caption"
-                        :value="item.code"
-                        :key="item.code"
-                    ></el-option>
-                </el-select>
+                <el-cascader
+                    v-model="searchParams.naturalEnvironment"
+                    :options="naturalEnvironmentList"
+                    :props="props"
+                    clearable=""
+                ></el-cascader>
             </template>
             <template slot="searchItem7">
                 <el-checkbox-group v-model="searchParams.c">
-                    <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="labelC">晴天</el-checkbox-button>
-                    <el-checkbox-button :label="6" :key="6" class="labelD">直道</el-checkbox-button>
+                    <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="labelC"
+                        >晴天</el-checkbox-button
+                    >
+                    <el-checkbox-button :label="6" :key="6" class="labelD"
+                        >直道</el-checkbox-button
+                    >
                 </el-checkbox-group>
             </template>
             <template slot="searchBtn1">
-                <el-button type="primary">查询</el-button>
+                <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
             <template slot="searchBtn2">
-                <el-button type="primary">重置</el-button>
+                <el-button type="primary" @click="doReset">重置</el-button>
             </template>
         </search-layout>
 
@@ -113,6 +123,7 @@
                     <i
                         @click="viewRow(scope.row)"
                         class="el-icon-view elIcon cursor"
+                        title="查看"
                     >
                     </i>
                 </template>
@@ -143,30 +154,36 @@ export default {
             searchParams: {
                 //搜索参数
                 id: "", //ID
-                clientOrgName: "", //车辆名称
+                naturalEnvironment: "", //车辆名称
                 clientOrgName1: "", //配置名称
                 clientOrgName2: "", //配置描述
                 status: "",
-                c:[],
+                c: [],
             },
             list: [],
+            naturalEnvironmentList: [],
+            props: {
+                multiple: true,
+                label: "dictName",
+                value: "dictCode",
+            },
             columns: [
                 //表格列
                 {
                     label: "场景名称",
-                    prop: "aid1",
+                    prop: "naturalName",
                 },
                 {
                     label: "天气",
-                    prop: "ktName",
+                    prop: "weather",
                 },
                 {
                     label: "自车行为",
-                    prop: "jbSource",
+                    prop: "selfBehavior",
                 },
                 {
                     label: "目标行为",
-                    prop: "jbSource",
+                    prop: "targetBehavior",
                 },
                 {
                     label: "标签",
@@ -189,33 +206,62 @@ export default {
             },
             getDataWay: {
                 //加载表格数据
-                dataType: "data",
+                dataType: "url",
                 type: "post",
-                firstRequest: false,
-                data: [
-                    {
-                        id: 1,
-                        ktName: "kjdhfkjsdhfkjsjhdfksdjhfkhwoieyrhfisdhfksjhdf",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 2 },
-                    { id: 6 },
-                ],
+                // firstRequest: false,
+                data: this.$api.sceneLibrary.querySceneNaturalList,
                 param: {},
             },
             dialogVisible: false,
         };
     },
     methods: {
+        doSearch() {
+            this.refreshList(this.searchParams);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                naturalEnvironment: "",
+                regulationType: [],
+                standardType: "",
+            };
+            this.doSearch();
+        },
         viewRow(row) {
             this.dialogVisible = true;
         },
     },
 
-    // mounted: {},
+    // mounted() {
+    /* this.$axios({
+            method: "post",
+            url: this.$api.common.getDictTreesByTypes,
+            data: {
+                dictTypes: "naturalEnvironment",
+            },
+        }).then((res) => {
+            if (res.code == 200) {
+                console.log(res);
+            } else {
+                this.$message.error(res.message || "保存失败");
+            }
+        }); */
+    // },
+
+    async mounted() {
+        await this.$dicsTreesInit({
+            naturalEnvironmentList: "naturalEnvironment",
+        });
+    },
 };
 </script>
 
 <style lang='less' scoped>
-@import './common/util.less';
+@import "./common/util.less";
 </style>

+ 142 - 151
src/views/sceneLibrary/scenarioTestPackageManagementList.vue

@@ -4,7 +4,7 @@
             <template slot="searchItem1">
                 <span class="label">指标ID</span>
                 <el-input
-                    v-model="searchParams.id"
+                    v-model="searchParams.packageId"
                     size="small"
                     clearable
                     placeholder="请输入"
@@ -14,7 +14,7 @@
             <template slot="searchItem2">
                 <span class="label">指标名称</span>
                 <el-input
-                    v-model="searchParams.clientOrgName"
+                    v-model="searchParams.packageName"
                     size="small"
                     clearable
                     placeholder="请输入"
@@ -24,43 +24,41 @@
             <template slot="searchItem3">
                 <span class="label">创建时间</span>
                 <el-date-picker
-                    v-model="searchParams.clientOrgName1"
-                    type="date"
-                    placeholder="选择日期"
+                    v-model="searchDate"
+                    type="daterange"
+                    format="yyyy-MM-dd"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
                 >
                 </el-date-picker>
             </template>
 
             <template slot="searchBtn1">
-                <el-button type="primary">查询</el-button>
+                <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
             <template slot="searchBtn2">
-                <el-button type="primary">重置</el-button>
+                <el-button type="primary" @click="doReset">重置</el-button>
             </template>
         </search-layout>
 
         <div class="tabsBox">
-            <toolbarTab
-                :isConnect="true"
-                position="top"
-                :subPageActiveName="subPageActiveName"
-                :toolbarItem="pageBtnList"
-                @toolbarClick="pageControl"
-                class="toolbarTab"
-            >
-            </toolbarTab>
+            <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
+                <el-tab-pane label="公有" name="1"></el-tab-pane>
+                <el-tab-pane label="私有" name="2"></el-tab-pane>
+            </el-tabs>
             <el-button
+                class="addBtn"
                 icon="el-icon-circle-plus-outline"
                 @click="addConfig"
                 type="primary"
-                plain
-                :disabled="activitedPageNum === 1"
+                :disabled="activeName === '1'"
                 >新增</el-button
             >
         </div>
 
         <tableList
-            v-if="activitedPageNum === 1"
             ref="table"
             style="margin: 0 30px"
             :columns="columns"
@@ -71,39 +69,25 @@
             <el-table-column label="操作" slot="cgInfos" align="center">
                 <template v-slot="scope">
                     <i
-                        @click="addMarkDia(scope.row)"
+                        v-if="activeName === '2'"
+                        @click="shareRow(scope.row)"
+                        class="el-icon-share elIcon"
+                        title="分享"
+                    ></i>
+                    <i
+                        @click="editRow(scope.row)"
                         class="el-icon-edit-outline elIcon"
+                        title="编辑"
+                    ></i>
+                    <i
+                        v-if="activeName === '2'"
+                        @click="delRow(scope.row)"
+                        class="el-icon-delete elIcon"
+                        title="删除"
                     ></i>
                 </template>
             </el-table-column>
         </tableList>
-        <div v-else>
-            <tableList
-                ref="tableA"
-                style="margin: 0 30px"
-                :columns="columnsA"
-                :getDataWay="getDataWayA"
-                :pagination="paginationA"
-                index
-            >
-                <el-table-column label="操作" slot="cgInfos" align="center">
-                    <template v-slot="scope">
-                        <i
-                            @click="addMarkDia(scope.row)"
-                            class="el-icon-share elIcon"
-                        ></i>
-                        <i
-                            @click="addMarkDia(scope.row)"
-                            class="el-icon-edit-outline elIcon"
-                        ></i>
-                        <i
-                            @click="addMarkDia(scope.row)"
-                            class="el-icon-delete elIcon"
-                        ></i>
-                    </template>
-                </el-table-column>
-            </tableList>
-        </div>
     </div>
 </template>
 
@@ -119,65 +103,21 @@ export default {
         return {
             searchParams: {
                 //搜索参数
-                id: "", //ID
-                clientOrgName: "", //车辆名称
-                clientOrgName1: "", //配置名称
-                clientOrgName2: "", //配置描述
+                packageId: "", //指标ID
+                packageName: "", //指标名称
+                yearMin: "", // 开始时间
+                yearMax: "", // 结束时间
             },
-            activitedPageNum: 1,
-            subPageActiveName: 1,
-            pageBtnList: [
-                {
-                    type: "primary",
-                    title: "公有",
-                    key: "all",
-                    fromId: 1,
-                    method: "showAll",
-                    plain: true,
-                    disabled: false,
-                },
-                {
-                    type: "primary",
-                    title: "私有",
-                    key: "notRead",
-                    fromId: 2,
-                    method: "showNotRead",
-                    plain: true,
-                    disabled: false,
-                },
-            ],
+            searchDate: "", // 创建时间
+            activeName: "1",
             columns: [
                 {
                     label: "指标ID",
-                    prop: "id",
-                },
-                {
-                    label: "指标名称",
-                    prop: "ktName",
-                },
-                {
-                    label: "场景数量",
-                    prop: "jbSource",
-                },
-                {
-                    label: "创建时间",
-                    prop: "startDateStr",
-                    width: 120,
-                },
-                {
-                    label: "操作",
-                    prop: "cgInfos",
-                    template: true,
-                },
-            ],
-            columnsA: [
-                {
-                    label: "指标ID",
-                    prop: "id",
+                    prop: "packageId",
                 },
                 {
                     label: "指标名称",
-                    prop: "ktName",
+                    prop: "packageName",
                 },
                 {
                     label: "场景数量",
@@ -202,68 +142,116 @@ export default {
                 pageSizes: [10, 30, 50, 100, 200],
                 layout: "sizes, total, prev, pager, next, jumper",
             },
-            paginationA: {
-                //分页使用
-                currentPage: 1,
-                pageSize: 10,
-                position: "right",
-                pageSizes: [10, 30, 50, 100, 200],
-                layout: "sizes, total, prev, pager, next, jumper",
-            },
             getDataWay: {
                 //加载表格数据
-                dataType: "data",
-                type: "post",
-                firstRequest: false,
-                data: [
-                    {
-                        id: 1,
-                        ktName: "kjdhfkjsdhfkjsjhdfksdjhfkhwoieyrhfisdhfksjhdf",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 2 },
-                    { id: 3 },
-                    { id: 4 },
-                    { id: 5 },
-                    { id: 6 },
-                ],
-                param: {},
-            },
-            getDataWayA: {
-                //加载表格数据
-                dataType: "data",
+                dataType: "url",
                 type: "post",
-                firstRequest: false,
-                data: [
-                    {
-                        id: 6,
-                        ktName: "沃尔沃二",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 66 },
-                    {
-                        id: 666,
-                        tName: "沃尔沃二",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 6666 },
-                    { id: 51 },
-                    { id: 6 },
-                ],
-                param: {},
+                // firstRequest: false,
+                data: this.$api.sceneLibrary.queryScenePackageList,
+                param: {
+                    share: "1"
+                },
             },
         };
     },
     methods: {
+        doSearch() {
+            if (this.searchDate) {
+                this.searchParams.yearMin = `${this.searchDate[0]} 00:00:00`;
+                this.searchParams.yearMax = `${this.searchDate[1]} 23:59:59`;
+            } else {
+                this.searchParams.yearMin = "";
+                this.searchParams.yearMax = "";
+            }
+
+            let pageMap = {
+                packageId: this.searchParams.packageId,
+                packageName: this.searchParams.packageName,
+                yearMin: this.searchParams.yearMin,
+                yearMax: this.searchParams.yearMax,
+                share: this.activeName === "1" ? "1" : "0",
+            };
+            this.refreshList(pageMap);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                packageId: "",
+                packageName: "",
+                yearMin: "",
+                yearMax: "",
+            };
+            this.searchDate = "";
+            this.doSearch();
+        },
         pageControl(data) {
-            this.activitedPageNum = data.fromId;
+            this.activeName = data.name;
+            this.doSearch();
         },
         addConfig() {
             this.$router.push({ path: "/scenePacketList" });
         },
-        addMarkDia() {},
+        shareRow(row) {
+            this.$confirm("确认是否分享?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then((e) => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.fxScoringRules,
+                    data: {
+                        rulesId: row.rulesId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("分享成功");
+                    } else {
+                        this.$message.error(res.message || "分享失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        delRow(row) {
+            this.$confirm("确认是否删除?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then((e) => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.deleteScoringRules,
+                    data: {
+                        rulesId: row.rulesId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: "/scenePacketList",
+                query: {
+                    formData: {
+                        packageId: row.packageId
+                    }
+                }
+            });
+        }
     },
-    created() {},
+    // created() {},
 };
 </script>
 
@@ -274,12 +262,15 @@ export default {
 
     .el-button {
         position: absolute;
+        bottom: 18px;
         right: 40px;
-        top: 45px;
     }
 }
 
-.toolbarTab {
-    margin: 45px 40px 15px;
+.el-range-editor.el-input__inner {
+    padding: 0 10px;
+}
+/deep/ .el-date-editor .el-range-separator {
+    width: 6%;
 }
 </style>

+ 68 - 23
src/views/sceneLibrary/scenePacketList.vue

@@ -11,24 +11,30 @@
             :columns="columns"
             :getDataWay="getDataWay"
             :pagination="pagination"
+            row-key="sublistId"
+            :tree-props="{ children: 'list', hasChildren: 'hasChildren' }"
         >
             <el-table-column label="操作" slot="cgInfos" align="center">
                 <template v-slot="scope">
                     <i
                         @click="addIndicators(scope.row)"
                         class="el-icon-plus elIcon"
+                        title="添加"
                     ></i>
                     <i
-                        @click="addIndicators(scope.row)"
+                        @click="editRow(scope.row)"
                         class="el-icon-edit-outline elIcon"
+                        title="编辑"
                     ></i>
                     <i
-                        @click="addMarkDia(scope.row)"
+                        @click="delRow(scope.row)"
                         class="el-icon-delete elIcon"
+                        title="删除"
                     ></i>
                     <i
                         @click="addScenario(scope.row)"
                         class="el-icon-document-add elIcon"
+                        title="添加场景"
                     ></i>
                 </template>
             </el-table-column>
@@ -457,23 +463,23 @@ export default {
                 },
                 {
                     label: "指标名称",
-                    prop: "id",
+                    prop: "sublistName",
                 },
                 {
                     label: "权重",
-                    prop: "ktName",
+                    prop: "weight",
                 },
                 {
                     label: "场景数量",
-                    prop: "jbSource",
+                    prop: "sceneNum",
                 },
                 {
                     label: "规则名称",
-                    prop: "startDateStr",
+                    prop: "ruleName",
                 },
                 {
                     label: "备注",
-                    prop: "startDateStr",
+                    prop: "remarks",
                 },
             ],
             pagination: {
@@ -487,21 +493,10 @@ export default {
             getDataWay: {
                 //加载表格数据
                 dataType: "data",
-                type: "post",
-                firstRequest: false,
-                data: [
-                    {
-                        id: 1,
-                        ktName: "kjdhfkjsdhfkjsjhdfksdjhfkhwoieyrhfisdhfksjhdf",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                    },
-                    { id: 2 },
-                    { id: 3 },
-                    { id: 4 },
-                    { id: 5 },
-                    { id: 6 },
-                ],
-                param: {},
+                // type: "post",
+                // firstRequest: false,
+                data: [],
+                // param: {},
             },
             diaTitle: "",
             indicatorsVisible: false, // 编辑指标
@@ -746,6 +741,38 @@ export default {
         viewTree() {
             this.$router.push({ path: "/templateView" });
         },
+        delRow(row) {
+            this.$confirm("确认是否删除?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then((e) => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.deleteScoringRules,
+                    data: {
+                        rulesId: row.rulesId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: "/scenePacketList",
+                query: {
+                    formData: {
+                        packageId: row.packageId,
+                    },
+                },
+            });
+        },
         addIndicators(row) {
             this.diaTitle = "添加指标";
             this.indicatorsVisible = true;
@@ -768,7 +795,25 @@ export default {
         },
     },
 
-    // mounted() {},
+    mounted() {
+        if (this.$route.query.formData) {
+            let packageId = this.$route.query.formData.packageId;
+
+            if (packageId) {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.queryScenePackageSublistList,
+                    data: {
+                        packageId,
+                    },
+                }).then((res) => {
+                    if (res.code == 200 && res.info) {
+                        this.getDataWay.data = res.info.list;
+                    }
+                });
+            }
+        }
+    },
 };
 </script>
 

+ 65 - 16
src/views/sceneLibrary/standardRegulationSimulationScenarioList.vue

@@ -16,8 +16,8 @@
                 <span class="label">法规类型</span>
                 <el-select v-model="searchParams.regulationType" multiple>
                     <el-option
-                        v-for="item in list"
-                        :label="item.caption"
+                        v-for="item in regulationTypeList"
+                        :label="item.name"
                         :value="item.code"
                         :key="item.code"
                     ></el-option>
@@ -57,10 +57,10 @@
                 </el-checkbox-group>
             </template>
             <template slot="searchBtn1">
-                <el-button type="primary">查询</el-button>
+                <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
             <template slot="searchBtn2">
-                <el-button type="primary">重置</el-button>
+                <el-button type="primary" @click="doReset">重置</el-button>
             </template>
         </search-layout>
 
@@ -92,6 +92,7 @@
                     <i
                         @click="viewRow(scope.row)"
                         class="el-icon-view elIcon cursor"
+                        title="查看"
                     >
                     </i>
                 </template>
@@ -105,7 +106,9 @@
             :close-on-click-modal="false"
             :close-on-press-escape="false"
         >
-            <div>123</div>
+            <div class="videoBox">
+                <video :autoplay="autoplay" :src="videoSrc"></video>
+            </div>
         </el-dialog>
     </div>
 </template>
@@ -115,7 +118,7 @@ import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
 
 function isObject(obj) {
-  return Object.prototype.toString.call(obj) === '[object Object]'
+    return Object.prototype.toString.call(obj) === "[object Object]";
 }
 
 function getUrlParams(url, param, fileName) {
@@ -161,11 +164,11 @@ export default {
             searchParams: {
                 //搜索参数
                 sceneName: "", //场景名称
-                regulationType: "", //法规类型
+                regulationType: [], //法规类型
                 standardType: "", //标准类型
-                c:"" // 标签
+                c: "", // 标签
             },
-            list: [],
+            regulationTypeList: [],
             columns: [
                 //表格列
                 {
@@ -190,7 +193,7 @@ export default {
                     prop: "cgInfos",
                     template: true,
                     // videoAddress
-                }
+                },
             ],
             pagination: {
                 //分页使用
@@ -209,27 +212,73 @@ export default {
                 param: {},
             },
             dialogVisible: false,
+            autoplay: false,
+            videoSrc: ""
         };
     },
     methods: {
+        doSearch() {
+            this.refreshList(this.searchParams);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                sceneName: "",
+                regulationType: [],
+                standardType: ""
+            };
+            this.doSearch();
+        },
         viewRow(row) {
             // this.dialogVisible = true;
 
-            window.open(
+            /* this.$axios({
+                method: "post",
+                url: '/simulation/resource/common/minio/download',
+                data: {
+                    objectName: "simulation.mp4"
+                },
+            }).then((res) => {
+                console.log(res);
+            }); */
+
+            /* window.open(
                 getUrlParams(
                     this.$api.sceneLibrary.download,
-                    {objectName:row.videoAddress },
-                    row.videoAddress
+                    // {objectName:row.videoAddress },
+                    { objectName: "simulation.mp4" },
+                    // row.videoAddress
+                    "simulation.mp4"
                 ),
-                "_target"
-            );
+                "_self"
+            ); */
+            this.dialogVisible = true;
+            this.videoSrc = row.videoPreview;
+            this.autoplay = true;
         },
     },
 
-    // mounted: {},
+    async mounted() {
+        await this.$dicsListsInit({
+            regulationTypeList: 'regulationType',
+        });
+    },
 };
 </script>
 
 <style lang='less' scoped>
 @import "./common/util.less";
+.videoBox {
+    width: 100%;
+    padding: 30 60px;
+
+    video {
+        width: 100%;
+    }
+}
 </style>

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

@@ -4,18 +4,19 @@
             <template slot="searchItem1">
                 <span class="label">场景名称</span>
                 <el-input
-                    v-model="searchParams.id"
+                    v-model="searchParams.sceneName"
                     size="small"
                     clearable
                     placeholder="请输入"
+                    maxlength="60"
                 >
                 </el-input>
             </template>
             <template slot="searchItem2">
                 <span class="label">自车驾驶行为</span>
-                <el-select v-model="searchParams.status" multiple>
+                <el-select v-model="searchParams.selfDriving" multiple>
                     <el-option
-                        v-for="item in list"
+                        v-for="item in selfDrivingList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -24,9 +25,9 @@
             </template>
             <template slot="searchItem3">
                 <span class="label">目标驾驶行为</span>
-                <el-select v-model="searchParams.status" multiple>
+                <el-select v-model="searchParams.targetDriving" multiple>
                     <el-option
-                        v-for="item in list"
+                        v-for="item in targetDrivingList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -35,9 +36,9 @@
             </template>
             <template slot="searchItem4">
                 <span class="label">自车反应行为</span>
-                <el-select v-model="searchParams.status" multiple>
+                <el-select v-model="searchParams.selfReaction" multiple>
                     <el-option
-                        v-for="item in list"
+                        v-for="item in selfReactionList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -46,9 +47,9 @@
             </template>
             <template slot="searchItem5">
                 <span class="label">冲突行为</span>
-                <el-select v-model="searchParams.status" multiple>
+                <el-select v-model="searchParams.conflictBehavior" multiple>
                     <el-option
-                        v-for="item in list"
+                        v-for="item in conflictBehaviorList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -57,9 +58,9 @@
             </template>
             <template slot="searchItem6">
                 <span class="label">冲突类型</span>
-                <el-select v-model="searchParams.status" multiple>
+                <el-select v-model="searchParams.conflictType" multiple>
                     <el-option
-                        v-for="item in list"
+                        v-for="item in conflictTypeList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -88,25 +89,11 @@
                     >
                 </el-checkbox-group>
             </template>
-            <!-- <template slot="searchItem7">
-                <div class="radioBox">
-                    <span class="label">是否存在盲区</span>
-                    <el-radio v-model="searchParams.x" label="1">是</el-radio>
-                    <el-radio v-model="searchParams.x" label="2">否</el-radio>
-                </div>
-            </template>
-            <template slot="searchItem8">
-                <div class="radioBox">
-                    <span class="label">是否发生碰撞</span>
-                    <el-radio v-model="searchParams.x" label="1">是</el-radio>
-                    <el-radio v-model="searchParams.x" label="2">否</el-radio>
-                </div>
-            </template> -->
             <template slot="searchBtn1">
-                <el-button type="primary">查询</el-button>
+                <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
             <template slot="searchBtn2">
-                <el-button type="primary">重置</el-button>
+                <el-button type="primary" @click="doReset">重置</el-button>
             </template>
         </search-layout>
 
@@ -116,7 +103,6 @@
             :columns="columns"
             :getDataWay="getDataWay"
             :pagination="pagination"
-            index
         >
             <el-table-column label="标签" slot="asd" align="center">
                 <template>
@@ -138,6 +124,7 @@
                     <i
                         @click="viewRow(scope.row)"
                         class="el-icon-view elIcon cursor"
+                        title="查看"
                     >
                     </i>
                 </template>
@@ -167,40 +154,48 @@ export default {
         return {
             searchParams: {
                 //搜索参数
-                id: "", //ID
-                clientOrgName: "", //车辆名称
-                clientOrgName1: "", //配置名称
-                clientOrgName2: "", //配置描述
-                status: "",
-                x: "1",
-                c: [],
+                sceneName: "", //场景名称
+                selfDriving: [], //自车驾驶行为
+                targetDriving: [], //目标驾驶行为
+                selfReaction: [], //自车反应行为
+                conflictBehavior: [], //冲突行为
+                conflictType: [] ,//冲突类型
+                c:""
             },
-            list: [],
+            selfDrivingList: [],
+            targetDrivingList: [],
+            selfReactionList: [],
+            conflictBehaviorList: [],
+            conflictTypeList: [],
             columns: [
                 //表格列
+                {
+                    label: "编号",
+                    prop: "accidentId",
+                },
                 {
                     label: "场景名称",
-                    prop: "id",
+                    prop: "sceneName",
                 },
                 {
                     label: "自车驾驶行为",
-                    prop: "aid1",
+                    prop: "selfDriving",
                 },
                 {
                     label: "目标驾驶行为",
-                    prop: "ktName",
+                    prop: "targetDriving",
                 },
                 {
                     label: "自车反应行为",
-                    prop: "jbSource",
+                    prop: "selfReaction",
                 },
                 {
                     label: "冲突行为",
-                    prop: "jbSource",
+                    prop: "conflictBehavior",
                 },
                 {
                     label: "冲突类型",
-                    prop: "jbSource",
+                    prop: "conflictType",
                 },
                 {
                     label: "标签",
@@ -226,19 +221,47 @@ export default {
                 dataType: "url",
                 type: "post",
                 // firstRequest: false,
-                data: this.$api.sceneLibrary.queryStandardsRegulationsList,
+                data: this.$api.sceneLibrary.querySceneAccidentList,
                 param: {},
             },
             dialogVisible: false,
         };
     },
     methods: {
+        doSearch() {
+            this.refreshList(this.searchParams);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                sceneName: "",
+                selfDriving: [],
+                targetDriving: [],
+                selfReaction: [],
+                conflictBehavior: [],
+                conflictType: []
+            };
+            this.doSearch();
+        },
         viewRow(row) {
             this.dialogVisible = true;
         },
     },
 
-    // mounted: {},
+    async mounted() {
+        await this.$dicsListsInit({
+            selfDrivingList: "selfDriving",
+            targetDrivingList: "targetDriving",
+            selfReactionList: "selfReaction",
+            conflictBehaviorList: "conflictBehavior",
+            conflictTypeList: "conflictType"
+        });
+    },
 };
 </script>
 

+ 13 - 4
vue.config.js

@@ -76,16 +76,25 @@ module.exports = {
         open: true, //配置自动启动浏览器
         hot: true,
         proxy: { // 配置跨域处理 可以设置多个
-            '/simulation': {
+            '/simulation/resource/common': {
                 // target: 'http://10.10.83.145:6888/user-center',
                 // target: 'http://10.15.12.70/simulation',
                 // target: 'http://10.15.12.70:7001', // 登录
+                // target: 'http://10.15.12.73:7003',  // 王志强
+                target: 'http://10.15.12.74:8001',
+                changeOrigin: true,
+                secure: false, // 如果是https接口,需要配置这个参数
+                pathRewrite: {
+                    '^/simulation/resource/common': '/simulation/resource/common'
+                }
+            },
+            '/simulation/resource/server': {
                 target: 'http://10.15.12.73:7003',  // 王志强
                 changeOrigin: true,
                 secure: false, // 如果是https接口,需要配置这个参数
-                // pathRewrite: {
-                //     '^/simulation': '/simulation'
-                // }
+                pathRewrite: {
+                    '^/simulation/resource/server': '/simulation/resource/server'
+                }
             },
         }
     },