Browse Source

Merge branch 'master' of http://10.12.10.70:3000/zhangliang/simulation-front

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

+ 7 - 5
src/api/sceneLibrary.js

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

+ 7 - 1
src/api/workManagement.js

@@ -24,6 +24,9 @@ const selectAutomaticProjectById = basePart + '/simulationProject/selectAutomati
 const selectSubProjectInfo = basePart + '/simulationProject/selectSubProjectInfo'; // 查询自动运行子工作信息
 const selectSubProjectList = basePart + '/simulationProject/selectSubProjectList'; // 查询自动运行子工作列表
 const createAutomaticSubProject = basePart + '/simulationProject/createAutomaticSubProject'; // 手动运行自动项目
+const deleteAutomaticProjectByids = basePart + '/simulationProject/deleteAutomaticProjectByids'; // 删除自动运行主任务
+const deleteAutomaticSubProjectByIds = basePart + '/simulationProject/deleteAutomaticSubProjectByIds'; // 删除自动运行子任务
+const updateAutoProjectNowRunState = basePart + '/simulationProject/updateAutoProjectNowRunState'; // 修改自动运行子任务状态
 
 
 export default {
@@ -50,5 +53,8 @@ export default {
     selectAutomaticProjectById,
     selectSubProjectInfo,
     selectSubProjectList,
-    createAutomaticSubProject
+    createAutomaticSubProject,
+    deleteAutomaticProjectByids,
+    deleteAutomaticSubProjectByIds,
+    updateAutoProjectNowRunState
 }

+ 15 - 18
src/router/index.js

@@ -10,8 +10,7 @@ import personalInformation from "./personalInformation"
 
 Vue.use(VueRouter);
 
-const routes = [
-  {
+const routes = [{
     path: "/login",
     name: "login",
     component: () => import("../views/login.vue")
@@ -94,30 +93,28 @@ const routes = [
         children: personalInformation,
       }, 
     ]
-    .concat([{
-      path: "*",
-      name: "*",
-      component: () => import("../views/mainPage.vue")
-    }, ]),
+    // .concat([{
+    //   path: "*",
+    //   name: "*",
+    //   component: () => import("../views/mainPage.vue")
+    // }, ]),
   },
+  {
+    path: "*",
+    name: "*",
+    component: () => import("@/views/mainPage.vue")
+  }
 ];
-// {
-//   path: "/",
-//   name: "About",
-//   // route level code-splitting
-//   // this generates a separate chunk (about.[hash].js) for this route
-//   // which is lazy-loaded when the route is visited.
-//   component: () =>
-//     import( /* webpackChunkName: "about" */ "../views/About.vue"),
-// },
-
 
 const router = new VueRouter({
   mode: "history",
   base: process.env.BASE_URL,
   routes,
   scrollBehavior(to, from, savedPosition) {
-    return {x: 0, y: 0}
+    return {
+      x: 0,
+      y: 0
+    }
   }
 });
 

+ 9 - 0
src/router/sceneLibrary.js

@@ -25,6 +25,15 @@ export default [{
         },
         component: () => import("@/views/sceneLibrary/trafficAccidentSimulationScenarioList")
     },
+    {
+        path: "/generalizationScenarioList",
+        name: "generalizationScenarioList",
+        meta: {
+            tabname: "泛化场景",
+            menuKind: "sceneLibrary"
+        },
+        component: () => import("@/views/sceneLibrary/generalizationScenarioList")
+    },
     {
         path: "/scenarioTestPackageManagementList",
         name: "scenarioTestPackageManagementList",

+ 55 - 27
src/router/workManagement.js

@@ -44,31 +44,59 @@ export default [{
         },
         component: () => import("@/views/workManagement/manualRunProjectDetail")
     },
-    // {
-    //     path: "/projectInfo",
-    //     name: "projectInfo",
-    //     meta: {
-    //         tabname: "项目详情",
-    //         menuKind: "workManagement"
-    //     },
-    //     component: () => import("@/views/workManagement/projectInfo")
-    // },
-    // {
-    //     path: "/taskInfo",
-    //     name: "taskInfo",
-    //     meta: {
-    //         tabname: "任务详情",
-    //         menuKind: "workManagement"
-    //     },
-    //     component: () => import("@/views/workManagement/taskInfo")
-    // },
-    // {
-    //     path: "/evaluationReport",
-    //     name: "evaluationReport",
-    //     meta: {
-    //         tabname: "评价报告",
-    //         menuKind: "workManagement"
-    //     },
-    //     component: () => import("@/views/workManagement/evaluationReport")
-    // },
+    {
+        path: "/autoRunProjectList",
+        name: "autoRunProjectList",
+        meta: {
+            tabname: "自动运行项目列表",
+            menuKind: "workManagement"
+        },
+        component: () => import("@/views/workManagement/autoRunProjectList"),
+        children: [{
+            path: "autoRunSubProjectList",
+            name: "autoRunSubProjectList",
+            meta: {
+                tabname: "自动运行子项目列表",
+                menuKind: "workManagement"
+            },
+            component: () => import("@/views/workManagement/autoRunSubProjectList"),
+            children: [{
+                path: "projectInfo",
+                name: "projectInfo",
+                meta: {
+                    tabname: "项目详情",
+                    menuKind: "workManagement"
+                },
+                component: () => import("@/views/workManagement/projectInfo"),
+                children: [{
+                        path: "taskInfo",
+                        name: "taskInfo",
+                        meta: {
+                            tabname: "任务详情",
+                            menuKind: "workManagement"
+                        },
+                        component: () => import("@/views/workManagement/taskInfo")
+                    },
+                    {
+                        path: "evaluationReport",
+                        name: "evaluationReport",
+                        meta: {
+                            tabname: "评价报告",
+                            menuKind: "workManagement"
+                        },
+                        component: () => import("@/views/workManagement/evaluationReport")
+                    },
+                ]
+            }, ]
+        }, ]
+    },
+    {
+        path: "/autoRunProjectDetail",
+        name: "autoRunProjectDetail",
+        meta: {
+            tabname: "自动运行项目",
+            menuKind: "workManagement"
+        },
+        component: () => import("@/views/workManagement/autoRunProjectDetail")
+    },
 ]

+ 2008 - 0
src/views/sceneLibrary/components/generalizationDetail.vue

@@ -0,0 +1,2008 @@
+<template>
+    <div class="generalizationDetailPanel">
+        <el-form ref="form" :model="form" :rules="rules" label-width="225px">
+            <el-row :gutter="10">
+                <el-col :span="8" :offset="16">
+                    <div class="changeBtn">
+                        <el-button type="primary" @click="changeTemplate"
+                            >更换模板</el-button
+                        >
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="8">
+                    <el-form-item label="时间:" prop="scenarioTime">
+                        <el-time-picker
+                            v-model="form.scenarioTime"
+                            value-format="HH:mm:ss"
+                            placeholder="请选择"
+                        >
+                        </el-time-picker>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="天气:" prop="scenarioWeather">
+                        <el-select v-model="form.scenarioWeather">
+                            <el-option
+                                v-for="item in scenarioWeatherList"
+                                :label="item.caption"
+                                :value="item.code"
+                                :key="item.code"
+                            ></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="车辆模型:" prop="scenarioVehicleModel">
+                        <el-select v-model="form.scenarioVehicleModel">
+                            <el-option
+                                v-for="item in scenarioVehicleModelList"
+                                :label="item.caption"
+                                :value="item.code"
+                                :key="item.code"
+                            ></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+
+            <el-row
+                :gutter="10"
+                v-if="
+                    form.scenarioRoadType === '2' ||
+                    form.scenarioRoadType === '3'
+                "
+            >
+                <el-col :span="8">
+                    <el-form-item label="道路类型:" prop="scenarioRoadType">
+                        <el-select v-model="form.scenarioRoadType" disabled>
+                            <el-option
+                                v-for="item in scenarioRoadTypeList"
+                                :label="item.caption"
+                                :value="item.code"
+                                :key="item.code"
+                            ></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item
+                        label="车道线曲率半径:"
+                        prop="scenarioRadiusCurvatureView"
+                    >
+                        <el-select
+                            v-model="form.scenarioRadiusCurvatureView"
+                            multiple
+                        >
+                            <el-option
+                                v-for="item in scenarioRadiusCurvatureList"
+                                :label="item.caption"
+                                :value="item.code"
+                                :key="item.code"
+                            ></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="8">
+                    <!-- <div class="info">
+                        <span>场景编号:</span>
+                        <b>{{ form.sceneId }}</b>
+                    </div> -->
+                    <el-form-item label="场景编号:" prop="sceneId">
+                        <b class="infos">{{ form.sceneId }}</b>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="16">
+                    <div class="info">
+                        <span>场景简述:</span>
+                        <b>{{ form.scenarioResume }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="24">
+                    <div class="info">
+                        <span>场景描述:</span>
+                        <b>{{ form.sceneDetailedDescription }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="8" class="boxA">
+                    <el-form-item
+                        label="自车初始X坐标:"
+                        prop="egoStartX1"
+                        v-bind:class="
+                            generalizationType.egoStartX === 2 ||
+                            generalizationType.egoStartX === 4
+                                ? 'itemA'
+                                : ''
+                        "
+                    >
+                        <el-input
+                            v-if="
+                                generalizationType.egoStartX === 2 ||
+                                generalizationType.egoStartX === 4
+                            "
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{
+                                obj: form,
+                                key: 'egoStartX1',
+                            }"
+                            v-model="form.egoStartX1"
+                        >
+                        </el-input>
+
+                        <b class="infos" v-else>{{ form.egoStartX }}</b>
+                    </el-form-item>
+                    <i
+                        class="line"
+                        v-if="
+                            generalizationType.egoStartX === 2 ||
+                            generalizationType.egoStartX === 4
+                        "
+                    ></i>
+                    <el-form-item
+                        v-if="
+                            generalizationType.egoStartX === 2 ||
+                            generalizationType.egoStartX === 4
+                        "
+                        label=""
+                        prop="egoStartX2"
+                        class="itemB"
+                    >
+                        <el-input
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{
+                                obj: form,
+                                key: 'egoStartX2',
+                            }"
+                            v-model="form.egoStartX2"
+                        >
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col
+                    :span="8"
+                    v-if="
+                        generalizationType.egoStartX === 2 ||
+                        generalizationType.egoStartX === 4
+                    "
+                >
+                    <el-form-item label="间隔:" prop="egoStartX3">
+                        <el-input
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{ obj: form, key: 'egoStartX3' }"
+                            v-model="form.egoStartX3"
+                        >
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8" v-if="generalizationType.egoStartX === 4">
+                    <div class="info">
+                        <b>{{ form.egoStartXFormula }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="8" class="boxA">
+                    <el-form-item
+                        label="自车初始Y坐标:"
+                        prop="egoStartY1"
+                        v-bind:class="
+                            generalizationType.egoStartY === 2 ||
+                            generalizationType.egoStartY === 4
+                                ? 'itemA'
+                                : ''
+                        "
+                    >
+                        <el-input
+                            v-if="
+                                generalizationType.egoStartY === 2 ||
+                                generalizationType.egoStartY === 4
+                            "
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{
+                                obj: form,
+                                key: 'egoStartY1',
+                            }"
+                            v-model="form.egoStartY1"
+                        >
+                        </el-input>
+
+                        <b class="infos" v-else>{{ form.egoStartY }}</b>
+                    </el-form-item>
+                    <i
+                        class="line"
+                        v-if="
+                            generalizationType.egoStartY === 2 ||
+                            generalizationType.egoStartY === 4
+                        "
+                    ></i>
+                    <el-form-item
+                        v-if="
+                            generalizationType.egoStartY === 2 ||
+                            generalizationType.egoStartY === 4
+                        "
+                        label=""
+                        prop="egoStartY2"
+                        class="itemB"
+                    >
+                        <el-input
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{
+                                obj: form,
+                                key: 'egoStartY2',
+                            }"
+                            v-model="form.egoStartY2"
+                        >
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col
+                    :span="8"
+                    v-if="
+                        generalizationType.egoStartY === 2 ||
+                        generalizationType.egoStartY === 4
+                    "
+                >
+                    <el-form-item label="间隔:" prop="egoStartY3">
+                        <el-input
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{ obj: form, key: 'egoStartY3' }"
+                            v-model="form.egoStartY3"
+                        >
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8" v-if="generalizationType.egoStartY === 4">
+                    <div class="info">
+                        <b>{{ form.egoStartYFormula }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="8" class="boxA">
+                    <el-form-item
+                        label="自车初始速度(km/h):"
+                        prop="egoStartVelocity1"
+                        v-bind:class="
+                            generalizationType.egoStartVelocity === 2 ||
+                            generalizationType.egoStartVelocity === 4
+                                ? 'itemA'
+                                : ''
+                        "
+                    >
+                        <el-input
+                            v-if="
+                                generalizationType.egoStartVelocity === 2 ||
+                                generalizationType.egoStartVelocity === 4
+                            "
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{
+                                obj: form,
+                                key: 'egoStartVelocity1',
+                            }"
+                            v-model="form.egoStartVelocity1"
+                        >
+                        </el-input>
+
+                        <b class="infos" v-else>{{ form.egoStartVelocity }}</b>
+                    </el-form-item>
+                    <i
+                        class="line"
+                        v-if="
+                            generalizationType.egoStartVelocity === 2 ||
+                            generalizationType.egoStartVelocity === 4
+                        "
+                    ></i>
+                    <el-form-item
+                        v-if="
+                            generalizationType.egoStartVelocity === 2 ||
+                            generalizationType.egoStartVelocity === 4
+                        "
+                        label=""
+                        prop="egoStartVelocity2"
+                        class="itemB"
+                    >
+                        <el-input
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{
+                                obj: form,
+                                key: 'egoStartVelocity2',
+                            }"
+                            v-model="form.egoStartVelocity2"
+                        >
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col
+                    :span="8"
+                    v-if="
+                        generalizationType.egoStartVelocity === 2 ||
+                        generalizationType.egoStartVelocity === 4
+                    "
+                >
+                    <el-form-item label="间隔:" prop="egoStartVelocity3">
+                        <el-input
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{ obj: form, key: 'egoStartVelocity3' }"
+                            v-model="form.egoStartVelocity3"
+                        >
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col
+                    :span="8"
+                    v-if="generalizationType.egoStartVelocity === 4"
+                >
+                    <div class="info">
+                        <b>{{ form.egoStartVelocityFormula }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <el-col :span="8">
+                    <div class="info">
+                        <span>
+                            自车行驶速度状态
+                            <i
+                                class="el-icon-info cursor"
+                                title="按照时间先后顺序"
+                            ></i>
+                            :</span
+                        >
+                        <b>{{
+                            dataToView(speedStateList, form.egoVelocityStatus)
+                        }}</b>
+                    </div>
+                </el-col>
+                <el-col :span="8">
+                    <div class="info">
+                        <span>自车轨迹形态:</span>
+                        <b>{{
+                            dataToView(trajectoryList, form.egoTrajectory)
+                        }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+                <!-- <el-col :span="8">
+                    <el-form-item
+                        label="自车轨迹持续时间(s):"
+                        prop="egoDurationTime"
+                    >
+                        <el-input
+                            v-if="
+                                generalizationType.egoDurationTime === 2 ||
+                                generalizationType.egoDurationTime === 4
+                            "
+                            placeholder="请输入"
+                            maxlength="12"
+                            v-autoTrim="{ obj: form, key: 'egoDurationTime' }"
+                            v-model="form.egoDurationTime"
+                        >
+                        </el-input>
+                        <b class="infos" v-else>{{ form.egoDurationTime }}</b>
+                    </el-form-item>
+                </el-col>
+                <el-col
+                    :span="8"
+                    v-if="generalizationType.egoDurationTime === 4"
+                >
+                    <div class="info">
+                        <b>{{ form.egoDurationTimeFormula }}</b>
+                    </div>
+                </el-col> -->
+                <el-col :span="8">
+                    <div class="info">
+                        <span>自车轨迹持续时间(s):</span>
+                        <b>{{ form.egoDurationTime }}</b>
+                    </div>
+                </el-col>
+                <el-col :span="8">
+                    <div class="info">
+                        <span>自车轨迹形态分段持续时间(s):</span>
+                        <b>{{ form.egoTrajectoryTime }}</b>
+                    </div>
+                </el-col>
+            </el-row>
+
+            <el-form
+                v-for="(item, index) in form.listMb"
+                :ref="'form' + index"
+                :model="item"
+                :rules="rulesA"
+                label-width="225px"
+            >
+                <!-- <el-row :gutter="10">
+                    <el-col :span="8">
+                        <el-form-item label="目标物初始x坐标:" prop="obsStartX">
+                            <el-input
+                                v-if="
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartX === 2 ||
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartX === 4
+                                "
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartX"
+                            >
+                            </el-input>
+
+                            <b class="infos" v-else>{{ item.obsStartX }}</b>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType).obsStartX === 4
+                        "
+                    >
+                        <div class="info">
+                            <b>{{ item.obsStartXFormula }}</b>
+                        </div>
+                    </el-col>
+                    <el-col :span="8">
+                        <el-form-item label="目标物初始y坐标:" prop="obsStartY">
+                            <el-input
+                                v-if="
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartY === 2 ||
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartY === 4
+                                "
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartY"
+                            >
+                            </el-input>
+                            <b class="infos" v-else>{{ item.obsStartY }}</b>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType).obsStartY === 4
+                        "
+                    >
+                        <div class="info">
+                            <b>{{ item.obsStartYFormula }}</b>
+                        </div>
+                    </el-col>
+                </el-row> -->
+
+                <el-row :gutter="10">
+                    <el-col :span="8" class="boxA">
+                        <el-form-item
+                            label="目标物初始x坐标:"
+                            prop="obsStartX1"
+                            v-bind:class="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartX === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartX === 4
+                                    ? 'itemA'
+                                    : ''
+                            "
+                        >
+                            <el-input
+                                v-if="
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartX === 2 ||
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartX === 4
+                                "
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartX1"
+                            >
+                            </el-input>
+
+                            <b class="infos" v-else>{{ item.obsStartX }}</b>
+                        </el-form-item>
+                        <i
+                            class="line"
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartX === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartX === 4
+                            "
+                        ></i>
+                        <el-form-item
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartX === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartX === 4
+                            "
+                            label=""
+                            prop="obsStartX2"
+                            class="itemB"
+                        >
+                            <el-input
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartX2"
+                            >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType).obsStartX ===
+                                2 ||
+                            JSON.parse(item.generalizationType).obsStartX === 4
+                        "
+                    >
+                        <el-form-item label="间隔:" prop="obsStartX3">
+                            <el-input
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartX3"
+                            >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType).obsStartX === 4
+                        "
+                    >
+                        <div class="info">
+                            <b>{{ item.obsStartXFormula }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="8" class="boxA">
+                        <el-form-item
+                            label="目标物初始y坐标:"
+                            prop="obsStartY1"
+                            v-bind:class="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartY === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartY === 4
+                                    ? 'itemA'
+                                    : ''
+                            "
+                        >
+                            <el-input
+                                v-if="
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartY === 2 ||
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartY === 4
+                                "
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartY1"
+                            >
+                            </el-input>
+
+                            <b class="infos" v-else>{{ item.obsStartY }}</b>
+                        </el-form-item>
+                        <i
+                            class="line"
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartY === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartY === 4
+                            "
+                        ></i>
+                        <el-form-item
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartY === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartY === 4
+                            "
+                            label=""
+                            prop="obsStartY2"
+                            class="itemB"
+                        >
+                            <el-input
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartY2"
+                            >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType).obsStartY ===
+                                2 ||
+                            JSON.parse(item.generalizationType).obsStartY === 4
+                        "
+                    >
+                        <el-form-item label="间隔:" prop="obsStartY3">
+                            <el-input
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartY3"
+                            >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType).obsStartY === 4
+                        "
+                    >
+                        <div class="info">
+                            <b>{{ item.obsStartYFormula }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="8" class="boxA">
+                        <el-form-item
+                            label="目标物初始速度(km/h):"
+                            prop="obsStartVelocity1"
+                            v-bind:class="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartVelocity === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartVelocity === 4
+                                    ? 'itemA'
+                                    : ''
+                            "
+                        >
+                            <el-input
+                                v-if="
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartVelocity === 2 ||
+                                    JSON.parse(item.generalizationType)
+                                        .obsStartVelocity === 4
+                                "
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartVelocity1"
+                            >
+                            </el-input>
+
+                            <b class="infos" v-else>{{
+                                item.obsStartVelocity
+                            }}</b>
+                        </el-form-item>
+                        <i
+                            class="line"
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartVelocity === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartVelocity === 4
+                            "
+                        ></i>
+                        <el-form-item
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsStartVelocity === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsStartVelocity === 4
+                            "
+                            label=""
+                            prop="obsStartVelocity2"
+                            class="itemB"
+                        >
+                            <el-input
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartVelocity2"
+                            >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType)
+                                .obsStartVelocity === 2 ||
+                            JSON.parse(item.generalizationType)
+                                .obsStartVelocity === 4
+                        "
+                    >
+                        <el-form-item label="间隔:" prop="obsStartVelocity3">
+                            <el-input
+                                placeholder="请输入"
+                                maxlength="12"
+                                v-model.trim="item.obsStartVelocity3"
+                            >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType)
+                                .obsStartVelocity === 4
+                        "
+                    >
+                        <div class="info">
+                            <!-- <span>公式:</span> -->
+                            <b>{{ item.obsStartVelocityFormula }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="24">
+                        <div class="info">
+                            <span>目标物轨迹形态:</span>
+                            <b>{{
+                                dataToView(trajectoryList, item.obsTrajectory)
+                            }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="16" class="boxB">
+                        <template
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsLateralAcceleration === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsLateralAcceleration === 4
+                            "
+                        >
+                            <template
+                                v-for="(
+                                    ele, i
+                                ) in item.obsLateralAccelerationView"
+                            >
+                                <div class="info mr0" v-if="i === 0">
+                                    <span class="required"
+                                        >目标物最大横向加速度(m/s²):</span
+                                    >
+                                </div>
+                                <el-form-item
+                                    v-if="Array.isArray(ele)"
+                                    label=""
+                                    :prop="'obsLateralAcceleration' + i + '1'"
+                                    class="itemB"
+                                >
+                                    <el-input
+                                        placeholder="请输入"
+                                        maxlength="12"
+                                        v-model.trim="
+                                            item[
+                                                'obsLateralAcceleration' +
+                                                    i +
+                                                    '1'
+                                            ]
+                                        "
+                                    >
+                                    </el-input>
+                                </el-form-item>
+                                <i v-if="Array.isArray(ele)" class="line"></i>
+                                <el-form-item
+                                    v-if="Array.isArray(ele)"
+                                    label=""
+                                    :prop="'obsLateralAcceleration' + i + '2'"
+                                    class="itemB"
+                                >
+                                    <el-input
+                                        placeholder="请输入"
+                                        maxlength="12"
+                                        v-model.trim="
+                                            item[
+                                                'obsLateralAcceleration' +
+                                                    i +
+                                                    '2'
+                                            ]
+                                        "
+                                    >
+                                    </el-input>
+                                </el-form-item>
+                                <i v-if="Array.isArray(ele)" class="line"></i>
+                                <el-form-item
+                                    v-if="Array.isArray(ele)"
+                                    label=""
+                                    :prop="'obsLateralAcceleration' + i + '3'"
+                                    class="itemB"
+                                >
+                                    <el-input
+                                        placeholder="请输入"
+                                        maxlength="12"
+                                        v-model.trim="
+                                            item[
+                                                'obsLateralAcceleration' +
+                                                    i +
+                                                    '3'
+                                            ]
+                                        "
+                                    >
+                                    </el-input>
+                                </el-form-item>
+                                <div class="obsInfo" v-if="Array.isArray(ele)">
+                                    ,
+                                </div>
+                                <div v-else class="obsInfo">
+                                    {{ ele }}
+                                    <span
+                                        v-if="
+                                            i <
+                                            item.obsLateralAccelerationView
+                                                .length -
+                                                1
+                                        "
+                                        >,</span
+                                    >
+                                </div>
+                            </template>
+                        </template>
+                        <el-form-item
+                            v-else
+                            label="目标物最大横向加速度(m/s²):"
+                            prop="obsLateralAcceleration"
+                        >
+                            <b class="infos">{{
+                                item.obsLateralAcceleration
+                            }}</b>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType)
+                                .obsLateralAcceleration === 4
+                        "
+                    >
+                        <div class="info">
+                            <b>{{ item.obsLateralAccelerationFormula }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="24">
+                        <div class="info">
+                            <span
+                                >目标物行驶速度状态
+                                <i
+                                    class="el-icon-info cursor"
+                                    title="按照时间先后顺序"
+                                ></i>
+                                :</span
+                            >
+                            <b>{{
+                                dataToView(
+                                    speedStateList,
+                                    item.obsVelocityStatus
+                                )
+                            }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="16" class="boxB">
+                        <template
+                            v-if="
+                                JSON.parse(item.generalizationType)
+                                    .obsLongitudinalAcceleration === 2 ||
+                                JSON.parse(item.generalizationType)
+                                    .obsLongitudinalAcceleration === 4
+                            "
+                        >
+                            <template
+                                v-for="(
+                                    ele, i
+                                ) in item.obsLongitudinalAccelerationView"
+                            >
+                                <div class="info mr0" v-if="i === 0">
+                                    <span class="required"
+                                        >目标物最大纵向加速度(m/s²):</span
+                                    >
+                                </div>
+                                <el-form-item
+                                    v-if="Array.isArray(ele)"
+                                    label=""
+                                    :prop="
+                                        'obsLongitudinalAcceleration' + i + '1'
+                                    "
+                                    class="itemB"
+                                >
+                                    <el-input
+                                        placeholder="请输入"
+                                        maxlength="12"
+                                        v-model.trim="
+                                            item[
+                                                'obsLongitudinalAcceleration' +
+                                                    i +
+                                                    '1'
+                                            ]
+                                        "
+                                    >
+                                    </el-input>
+                                </el-form-item>
+                                <i v-if="Array.isArray(ele)" class="line"></i>
+                                <el-form-item
+                                    v-if="Array.isArray(ele)"
+                                    label=""
+                                    :prop="
+                                        'obsLongitudinalAcceleration' + i + '2'
+                                    "
+                                    class="itemB"
+                                >
+                                    <el-input
+                                        placeholder="请输入"
+                                        maxlength="12"
+                                        v-model.trim="
+                                            item[
+                                                'obsLongitudinalAcceleration' +
+                                                    i +
+                                                    '2'
+                                            ]
+                                        "
+                                    >
+                                    </el-input>
+                                </el-form-item>
+                                <i v-if="Array.isArray(ele)" class="line"></i>
+                                <el-form-item
+                                    v-if="Array.isArray(ele)"
+                                    label=""
+                                    :prop="
+                                        'obsLongitudinalAcceleration' + i + '3'
+                                    "
+                                    class="itemB"
+                                >
+                                    <el-input
+                                        placeholder="请输入"
+                                        maxlength="12"
+                                        v-model.trim="
+                                            item[
+                                                'obsLongitudinalAcceleration' +
+                                                    i +
+                                                    '3'
+                                            ]
+                                        "
+                                    >
+                                    </el-input>
+                                </el-form-item>
+                                <div class="obsInfo" v-if="Array.isArray(ele)">
+                                    ,
+                                </div>
+                                <div v-else class="obsInfo">
+                                    {{ ele }}
+                                    <span
+                                        v-if="
+                                            i <
+                                            item.obsLongitudinalAccelerationView
+                                                .length -
+                                                1
+                                        "
+                                        >,</span
+                                    >
+                                </div>
+                            </template>
+                        </template>
+                        <el-form-item
+                            v-else
+                            label="目标物最大纵向加速度(m/s²):"
+                            prop="obsLongitudinalAcceleration"
+                        >
+                            <b class="infos">{{
+                                item.obsLongitudinalAcceleration
+                            }}</b>
+                        </el-form-item>
+                    </el-col>
+                    <el-col
+                        :span="8"
+                        v-if="
+                            JSON.parse(item.generalizationType)
+                                .obsLongitudinalAcceleration === 4
+                        "
+                    >
+                        <div class="info">
+                            <b>{{ item.obsLongitudinalAccelerationFormula }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="8">
+                        <div class="info">
+                            <span>目标物轨迹持续时间(s):</span>
+                            <b>{{ item.obsDurationTime }}</b>
+                        </div>
+                    </el-col>
+                    <el-col :span="8">
+                        <div class="info">
+                            <span>目标物轨迹形态分段持续时间(s):</span>
+                            <b>{{ item.obsTrailTime }}</b>
+                        </div>
+                    </el-col>
+                    <el-col :span="8">
+                        <div class="info">
+                            <span
+                                >目标物相对自车航向角
+                                <i
+                                    class="el-icon-info cursor"
+                                    title="角度值,逆时针增加"
+                                ></i>
+                                :</span
+                            >
+                            <!-- <b>{{
+                                dataToView(
+                                    targetDirectionList,
+                                    item.obsHeadingAngleRel
+                                )
+                            }}</b> -->
+                            <b> {{ item.obsHeadingAngleRel }}</b>
+                        </div>
+                    </el-col>
+                </el-row>
+            </el-form>
+        </el-form>
+
+        <el-collapse v-model="activeNames">
+            <el-collapse-item title="说明" name="1">
+                <div class="collapseInfo">
+                    1.界面中出现的算式代表此参数需要根据其他参数泛化的结果计算所得<br />
+                    2.算式中因子对照<br />
+                    <i class="place"></i>自车初始x坐标 ep_x,自车初始y坐标
+                    ep_y<br />
+                    <i class="place"></i>自车初始速度V0(km/h)
+                    ev,自车速度分段持续时间 ev_t<br />
+                    <i class="place"></i>自车轨迹形态分段持续时间
+                    et_t,目标初始x坐标 op_x<br />
+                    <i class="place"></i>目标初始y坐标
+                    op_y,目标初始速度V1(km/h) ov<br />
+                    <i class="place"></i>目标速度分段持续时间(s)
+                    ov_t,目标轨迹形态分段持续时间(s) ot_t<br />
+                    3.目标物有关因子中括号数字代表某一个目标物:ov[0]代表第一个目标物初始速度,
+                    ov[1]代表第二个目标物的初始速度,以此类推<br />
+                    4.时间有关因子中括号代表某一段时间:自车轨迹分三段的轨迹中ev_t[0]代表自车第一段轨迹的持续时间,
+                    ev_t[1]代表第二段轨迹的持续时间,以此类推<br />
+                    5.目标物的时间因子同时出现是前面的中括号控制目标物,后一个轨迹分段<br />
+                </div>
+            </el-collapse-item>
+        </el-collapse>
+    </div>
+</template>
+
+<script>
+//import  from '';
+
+/* 
+自车3个、目标物5个标识位,x、y、初始速度,新增加速度,x、y可为负,其余为正
+是2或4就对应3个input
+两个加速度为新增,如果是基本值,直接展示,如果是array,数组元素是基本值的直接展示,是二维数组的3个input
+解释的展示
+*/
+
+// 2923ab09-f051-4226-8e61-7573c19b523d aliyun-dev
+// 这是 70环境的  Bearer dd26d02c-7284-4080-8d1d-a4d444cb5402
+
+// 校验最多1位小数的非负数
+let validateNum = (rule, value, callback) => {
+    !/^(0|[1-9][0-9]*)(\.\d{1})?$/.test(value) &&
+        callback(new Error(rule.message));
+    callback();
+};
+// 校验最多1位小数-可为负
+let validateNumA = (rule, value, callback) => {
+    !/^(-?(0|[1-9][0-9]*))(\.\d{1})?$/.test(value) &&
+        callback(new Error(rule.message));
+    callback();
+};
+// 校验最多1位小数的正数
+let isMoreThan0 = (rule, value, callback) => {
+    if (value <= 0) {
+        callback(new Error(rule.message));
+        return;
+    }
+    !/^(0|[1-9][0-9]*)(\.\d{1})?$/.test(value) &&
+        callback(new Error(rule.message));
+    callback();
+};
+
+export default {
+    name: "generalizationDetail", // 泛化信息
+    components: {},
+    data() {
+        return {
+            scenarioWeatherList: [], // 天气情况
+            scenarioVehicleModelList: [], // 车辆模型
+            speedStateList: [], // 速度形态
+            trajectoryList: [], // 轨迹形态
+            // targetDirectionList: [], // 目标方向
+            scenarioRoadTypeList: [], // 道路类型
+            scenarioRadiusCurvatureList: [], // 泛化模板车道线曲率半径
+            formula: {}, // 公式集合
+            form: {
+                scenarioTime: "", // 时间
+                scenarioWeather: "", // 天气
+                scenarioVehicleModel: "", // 车辆模型
+                id: "", // id
+                sceneId: "", // 场景编号
+                scenarioResume: "", // 场景简述
+                sceneDetailedDescription: "", // 场景描述
+                scenarioRoadType: "", // 道路类型
+                scenarioRadiusCurvature: "", // 车道线曲率半径
+                scenarioRadiusCurvatureView: [], // 车道线曲率半径-展示用
+                egoVelocityStatus: "", // 自车行驶速度状态
+                egoStartX: "", // 自车初始X坐标
+                egoStartX1: "", // 自车初始X坐标
+                egoStartX2: "", // 自车初始X坐标
+                egoStartX3: "", // 自车初始X坐标-间隔
+                egoStartY: "", // 自车初始Y坐标
+                egoStartY1: "", // 自车初始Y坐标
+                egoStartY2: "", // 自车初始Y坐标
+                egoStartY3: "", // 自车初始Y坐标-间隔
+                egoStartVelocity: "", // 自车初始速度
+                egoStartVelocity1: "", // 自车初始速度
+                egoStartVelocity2: "", // 自车初始速度
+                egoStartVelocity3: "", // 自车初始速度-间隔
+                egoTrajectory: "", // 自车轨迹形态
+                egoDurationTime: "", // 自车轨迹持续时间
+                egoTrajectoryTime: "", // 自车轨迹形态分段持续时间
+                // obsStartX: "", // 目标物初始x坐标
+                // obsStartY: "", // 目标物初始y坐标
+                // obsStartVelocity: "", // 目标物初始速度
+                // obsStartVelocity1: "", // 目标物初始速度
+                // obsStartVelocity2: "", // 目标物初始速度
+                // obsStartVelocity3: "", // 目标物初始速度
+                // obsVelocityStatus: "", // 目标物行驶速度状态
+                // obsTrajectory: "", // 目标物轨迹形态
+                // obsDurationTime: "", // 目标物轨迹持续时间
+                // obsTrailTime: "", // 目标物轨迹形态分段持续时间
+                // obsHeadingAngleRel: "", // 目标物相对自车航向角
+                // obsLateralAcceleration: "", // 目标物最大横向加速度(m/s²)
+                // obsLongitudinalAcceleration: "", // 目标物最大纵向加速度(m/s²)
+                listMb: [], // 目标物数组
+            },
+            generalizationType: {}, // 标识对象
+            rules: {
+                scenarioTime: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                scenarioWeather: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                scenarioVehicleModel: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                scenarioResume: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                sceneDetailedDescription: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                egoVelocityStatus: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                egoStartX1: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartX2: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartX3: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: isMoreThan0,
+                        message: "请输入最多带有1位小数的正数",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartY1: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartY2: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartY3: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: isMoreThan0,
+                        message: "请输入最多带有1位小数的正数",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartVelocity1: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNum,
+                        message: "请输入最多带有1位小数的非负数",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartVelocity2: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNum,
+                        message: "请输入最多带有1位小数的非负数",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoStartVelocity3: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: isMoreThan0,
+                        message: "请输入最多带有1位小数的正数",
+                        trigger: ["blur"],
+                    },
+                ],
+                egoTrajectory: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                egoTrajectoryTime: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+            },
+            rulesA: {
+                obsStartX1: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartX2: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartX3: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: isMoreThan0,
+                        message: "请输入最多带有1位小数的正数",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartY1: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartY2: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入最多带有1位小数的数字",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStart3Y: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: isMoreThan0,
+                        message: "请输入最多带有1位小数的正数",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartVelocity1: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNum,
+                        message: "请输入最多带有1位小数的非负数",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartVelocity2: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNum,
+                        message: "请输入最多带有1位小数的非负数",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsStartVelocity3: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: isMoreThan0,
+                        message: "请输入最多带有1位小数的正数",
+                        trigger: ["blur"],
+                    },
+                ],
+                obsLateralAcceleration: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                obsLongitudinalAcceleration: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                obsVelocityStatus: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                obsTrailTime: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                obsHeadingAngleRel: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+            },
+            activeNames: [""],
+        };
+    },
+
+    props: {
+        id: {
+            type: String,
+            default: "",
+        },
+        curId: {
+            type: String,
+            default: "",
+        },
+        exampleId: {
+            type: String,
+            default: "",
+        },
+        ruleName: {
+            type: String,
+            default: "",
+        },
+        rulesId: {
+            type: String,
+            default: "",
+        },
+        genUrlType: {
+            type: Number,
+            default: 1,
+        },
+    },
+
+    methods: {
+        getInfo() {
+            let url = this.$api.sceneLibrary.querySceneGeneralTemplateById;
+            let id = this.id;
+
+            if (this.genUrlType === 2) {
+                url = this.$api.sceneLibrary.queryGeneralTemplateByFh;
+                id = this.exampleId;
+            }
+
+            this.$axios({
+                method: "post",
+                url,
+                data: { id },
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    // res.info.listMb[0].obsLateralAcceleration =
+                    //     "[-1,[2,4,1],-1,[1,2,3],-1]|ovaslkdkjhlaskjdlkj";
+                    // res.info.listMb[0].generalizationType =
+                    //     '{"obsStartVelocity":2,"obsLongitudinalAcceleration":2,"obsLateralAcceleration":4}';
+                    if (this.genUrlType === 2 && res.info.isTure === "1") {
+                        this.$message.warning("该模板已变更");
+                    }
+
+                    let listMb = res.info.listMb;
+                    res.info.listMb = [];
+                    Object.assign(this.form, res.info);
+
+                    if (
+                        res.info.scenarioRoadType === "2" ||
+                        res.info.scenarioRoadType === "3"
+                    ) {
+                        // scenarioRoadTypes 2or3 时,车道线曲率半径需要展示,并全部选中
+                        let list = res.info.scenarioRadiusCurvature.split(",");
+                        list.forEach((i) => {
+                            this.scenarioRadiusCurvatureList.push({
+                                code: i,
+                                caption: i,
+                            });
+                        });
+                        this.form.scenarioRadiusCurvatureView = list;
+                        this.rules.scenarioRadiusCurvatureView = [
+                            {
+                                required: true,
+                                message: "请选择",
+                                trigger: "change",
+                            },
+                        ];
+                    }
+
+                    // 处理标识
+                    this.generalizationType = JSON.parse(
+                        res.info.generalizationType
+                    );
+
+                    this.handleGeneralizationType(
+                        this.generalizationType,
+                        this.form,
+                        res.info
+                    );
+
+                    if (listMb.length > 0) {
+                        listMb.forEach((item, i) => {
+                            let generalizationType = JSON.parse(
+                                item.generalizationType
+                            );
+
+                            this.handleGeneralizationType(
+                                generalizationType,
+                                item,
+                                item,
+                                true
+                            );
+                        });
+
+                        this.form.listMb = listMb;
+                    }
+                } else {
+                    this.$message.error(res.message || "获取模板详情失败");
+                }
+            });
+        },
+        done() {
+            let i = 0;
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    i++;
+                } else {
+                    console.log("校验");
+                }
+            });
+
+            if (this.form.listMb.length > 0) {
+                for (let index = 0; index < this.form.listMb.length; index++) {
+                    let ref = "form" + index;
+                    this.$refs[ref][0].validate((valid) => {
+                        if (valid) {
+                            i++;
+                        } else {
+                            console.log("校验" + i);
+                        }
+                    });
+                }
+            }
+
+            if (i >= 1 + this.form.listMb.length) {
+                // console.log(666);
+                let isTrue = this.checkEditKey();
+                if (!isTrue) return;
+
+                let data = {};
+                Object.keys(this.form).forEach((k) => {
+                    if (k != "listMb") {
+                        data[k] = this.form[k];
+                    }
+                });
+
+                this.generalizationTypeToData(
+                    this.generalizationType,
+                    data,
+                    this.form
+                );
+
+                data.listMb = [];
+
+                for (let index = 0; index < this.form.listMb.length; index++) {
+                    let ele = this.form.listMb[index];
+                    let obj = Object.assign({}, ele);
+                    let generalizationType = JSON.parse(ele.generalizationType);
+                    this.generalizationTypeToData(
+                        generalizationType,
+                        obj,
+                        ele,
+                        true
+                    );
+                    data.listMb[index] = obj;
+                }
+
+                let obj = {
+                    curId: this.curId,
+                    ruleName: this.ruleName,
+                    rulesId: this.rulesId,
+                };
+                this.$emit("generalizationBegin");
+
+                this.$axios({
+                    method: "post",
+                    url: this.$api.sceneLibrary.saveSceneGeneralExample,
+                    data,
+                })
+                    .then((res) => {
+                        if (res.code == 200 && res.info) {
+                            /* setTimeout(() => {
+                            // 此写法有问题 覆盖?不全部执行? 只执行最后一个
+                            // this.$emit("generalizationDone", res.info, obj);
+                        }, 20000); */
+                            this.$parent.$parent.generalizationDone(
+                                res.info,
+                                obj
+                            );
+                            this.$message.success("泛化成功");
+                        } else {
+                            this.$parent.$parent.generalizationDone(
+                                null,
+                                obj,
+                                false
+                            );
+                            this.$message.error(res.message || "泛化失败");
+                        }
+                    })
+                    .catch((error) => {
+                        this.$parent.$parent.generalizationDone(
+                            null,
+                            obj,
+                            false
+                        );
+                        this.$message.error("泛化失败");
+                    });
+            }
+        },
+        // 数据转换展示
+        dataToView(arr, val) {
+            let info = "";
+            let pre = "";
+            val.split("").forEach((ele) => {
+                let v = arr.find((i) => i.code === ele);
+                if (v) v = v.caption;
+                if (v && v != pre) {
+                    pre = v;
+                    info += v + ",";
+                }
+            });
+            if (info) {
+                info = info.slice(0, -1);
+            }
+            return info;
+        },
+
+        /**
+         * fn:处理标识
+         * arguments:标识对象,目标对象,获取属性对应的值的对象,是否已经处理过一轮(即是否处理过自车)
+         * handled(针对处理目标物时自车已处理过了,需过滤)即 自车false 目标物true
+         */
+        handleGeneralizationType(obj, target, data, handled = false) {
+            // 自车需要处理的标识字段
+            let egoArr = ["egoStartX", "egoStartY", "egoStartVelocity"];
+            let obsArr = [
+                "obsStartX",
+                "obsStartY",
+                "obsStartVelocity",
+                "obsLateralAcceleration",
+                "obsLongitudinalAcceleration",
+            ];
+
+            let rule = [
+                { required: true, message: "请输入", trigger: "blur" },
+                {
+                    validator: validateNum,
+                    message: "请输入最多带有1位小数的非负数",
+                    trigger: ["blur"],
+                },
+            ];
+
+            let rule1 = [
+                { required: true, message: "请输入", trigger: "blur" },
+                {
+                    validator: isMoreThan0,
+                    message: "请输入最多带有1位小数的正数",
+                    trigger: ["blur"],
+                },
+            ];
+
+            let handleArr = egoArr;
+            if (handled) handleArr = obsArr;
+
+            handleArr.forEach((item) => {
+                if (obj[item] === 2) {
+                    if (
+                        item === "obsLateralAcceleration" ||
+                        item === "obsLongitudinalAcceleration"
+                    ) {
+                        // [-1,[2,4,1],-1,-1]
+                        let arr = JSON.parse(data[item]);
+                        target[item + "View"] = arr;
+
+                        arr.forEach((ele, i) => {
+                            if (Array.isArray(ele)) {
+                                target[item + i + "1"] = ele[0];
+                                target[item + i + "2"] = ele[1];
+                                target[item + i + "3"] = ele[2];
+
+                                this.rulesA[item + i + "1"] = rule;
+                                this.rulesA[item + i + "2"] = rule;
+                                this.rulesA[item + i + "3"] = rule1;
+                            }
+                        });
+                    } else {
+                        // "[30,80,10]"
+                        let arr = JSON.parse(data[item]);
+                        target[item + "1"] = arr[0];
+                        target[item + "2"] = arr[1];
+                        target[item + "3"] = arr[2];
+                    }
+                } else if (obj[item] === 4) {
+                    if (
+                        item === "obsLateralAcceleration" ||
+                        item === "obsLongitudinalAcceleration"
+                    ) {
+                        let brr = data[item].split("|");
+                        let arr = JSON.parse(brr[0]);
+                        target[item + "View"] = arr;
+
+                        arr.forEach((ele, i) => {
+                            if (Array.isArray(ele)) {
+                                target[item + i + "1"] = ele[0];
+                                target[item + i + "2"] = ele[1];
+                                target[item + i + "3"] = ele[2];
+
+                                this.rulesA[item + i + "1"] = rule;
+                                this.rulesA[item + i + "2"] = rule;
+                                this.rulesA[item + i + "3"] = rule1;
+                            }
+                        });
+
+                        target[item + "Formula"] = brr[1];
+                    } else {
+                        // "[30,80,10]|0<ov[0]-ov[1]<=20"
+                        let brr = data[item].split("|");
+                        let arr = JSON.parse(brr[0]);
+
+                        target[item + "1"] = arr[0];
+                        target[item + "2"] = arr[1];
+                        target[item + "3"] = arr[2];
+
+                        // 对应公式
+                        target[item + "Formula"] = brr[1];
+                    }
+                } else {
+                    // 处理不可编辑时,form中rule的校验问题
+                    target[item + "1"] = 0;
+                    target[item + "2"] = 0;
+                    target[item + "3"] = 0;
+                }
+            });
+        },
+        // 参数同上 handleGeneralizationType
+        generalizationTypeToData(obj, target, data, handled = false) {
+            let egoArr = ["egoStartX", "egoStartY", "egoStartVelocity"];
+            let obsArr = [
+                "obsStartX",
+                "obsStartY",
+                "obsStartVelocity",
+                "obsLateralAcceleration",
+                "obsLongitudinalAcceleration",
+            ];
+
+            let handleArr = egoArr;
+            if (handled) handleArr = obsArr;
+
+            handleArr.forEach((item) => {
+                if (obj[item] === 2) {
+                    if (
+                        item === "obsLateralAcceleration" ||
+                        item === "obsLongitudinalAcceleration"
+                    ) {
+                        let oriArr = data[item + "View"];
+                        let s = "";
+                        oriArr.forEach((ele, i) => {
+                            if (Array.isArray(ele)) {
+                                s += `[${data[item + i + "1"]},${
+                                    data[item + i + "2"]
+                                },${data[item + i + "3"]}],`;
+                            } else {
+                                s += ele + ",";
+                            }
+                        });
+                        target[item] = `[${s.slice(0, -1)}]`;
+                    } else {
+                        target[item] = `[${data[item + "1"]},${
+                            data[item + "2"]
+                        },${data[item + "3"]}]`;
+                    }
+                } else if (obj[item] === 4) {
+                    if (
+                        item === "obsLateralAcceleration" ||
+                        item === "obsLongitudinalAcceleration"
+                    ) {
+                        let oriArr = data[item + "View"];
+                        let s = "";
+                        oriArr.forEach((ele, i) => {
+                            if (Array.isArray(ele)) {
+                                s += `[${data[item + i + "1"]},${
+                                    data[item + i + "2"]
+                                },${data[item + i + "3"]}],`;
+                            } else {
+                                s += ele + ",";
+                            }
+                        });
+                        target[item] = `[${s.slice(0, -1)}]|${
+                            data[item + "Formula"]
+                        }`;
+                    } else {
+                        target[item] = `[${data[item + "1"]},${
+                            data[item + "2"]
+                        },${data[item + "3"]}]|${data[item + "Formula"]}`;
+                    }
+                }
+            });
+        },
+        // 校验可编辑的字段 3个input
+        checkEditKey() {
+            let isTrue = true;
+            let egoArr = ["egoStartX", "egoStartY", "egoStartVelocity"];
+            let egoInfoArr = ["自车初始X坐标", "自车初始Y坐标", "自车初始速度"];
+            let obsArr = [
+                "obsStartX",
+                "obsStartY",
+                "obsStartVelocity",
+                "obsLateralAcceleration",
+                "obsLongitudinalAcceleration",
+            ];
+            let obsInfoArr = [
+                "目标物初始x坐标",
+                "目标物初始y坐标",
+                "目标物初始速度",
+                "目标物最大横向加速度",
+                "目标物最大纵向加速度",
+            ];
+
+            egoArr.forEach((item, index) => {
+                if (
+                    this.generalizationType[item] === 2 ||
+                    this.generalizationType[item] === 4
+                ) {
+                    let a = this.form[item + "1"];
+                    let b = this.form[item + "2"];
+                    let c = this.form[item + "3"];
+                    let result = this.checkRule(a, b, c);
+                    if (!result) {
+                        isTrue = false;
+                        let timer = setTimeout(() => {
+                            this.$message.error(
+                                `${egoInfoArr[index]}数据格式错误`
+                            );
+                            clearTimeout(timer);
+                        }, 100);
+                    }
+                }
+            });
+
+            let listMb = this.form.listMb;
+
+            obsArr.forEach((item, index) => {
+                listMb.forEach((ele, i) => {
+                    let generalizationType = JSON.parse(ele.generalizationType);
+                    if (
+                        generalizationType[item] === 2 ||
+                        generalizationType[item] === 4
+                    ) {
+                        if (
+                            item === "obsLateralAcceleration" ||
+                            item === "obsLongitudinalAcceleration"
+                        ) {
+                            let oriArr = ele[item + "View"];
+                            oriArr.forEach((el, j) => {
+                                if (Array.isArray(el)) {
+                                    let a = ele[item + j + "1"];
+                                    let b = ele[item + j + "2"];
+                                    let c = ele[item + j + "3"];
+                                    let result = this.checkRule(a, b, c);
+                                    if (!result) {
+                                        isTrue = false;
+                                        let timer = setTimeout(() => {
+                                            this.$message.error(
+                                                `第${i + 1}个${
+                                                    obsInfoArr[index]
+                                                }数据格式错误`
+                                            );
+                                            clearTimeout(timer);
+                                        }, 100);
+                                    }
+                                }
+                            });
+                        } else {
+                            let a = ele[item + "1"];
+                            let b = ele[item + "2"];
+                            let c = ele[item + "3"];
+                            let result = this.checkRule(a, b, c);
+                            if (!result) {
+                                isTrue = false;
+                                let timer = setTimeout(() => {
+                                    this.$message.error(
+                                        `${obsInfoArr[index]}数据格式错误`
+                                    );
+                                    clearTimeout(timer);
+                                }, 100);
+                            }
+                        }
+                    }
+                });
+            });
+
+            return isTrue;
+        },
+        // a,b,c, b比a大,c大于0,差除以c为整数
+        checkRule(x, y, z) {
+            let a = x * 10;
+            let b = y * 10;
+            let c = z * 10;
+            let ba = b - a;
+            if (ba <= 0 || c <= 0) return false;
+            if (ba % c != 0 || ba / c >= 20) return false;
+            return true;
+        },
+        changeTemplate() {
+            this.$emit("changeTemplate");
+        },
+    },
+
+    async mounted() {
+        await this.$dicsListsInit({
+            scenarioWeatherList: "scenarioWeather",
+            scenarioVehicleModelList: "scenarioVehicleModel",
+            scenarioRoadTypeList: "scenarioRoadType",
+            speedStateList: "speedState",
+            trajectoryList: "trajectory",
+            // targetDirectionList: "targetDirection",
+            // scenarioRadiusCurvatureList: "scenarioRadiusCurvature",
+        });
+
+        this.getInfo();
+    },
+};
+</script>
+
+<style lang='less' scoped>
+.generalizationDetailPanel {
+    padding-top: 24px;
+
+    .el-form {
+        /deep/ .el-input,
+        .el-select {
+            width: 100%;
+        }
+
+        .infos {
+            font-weight: normal;
+            word-break: break-all;
+        }
+
+        .changeBtn {
+            width: 225px;
+            margin-bottom: 22px;
+            text-align: right;
+        }
+
+        .info {
+            display: flex;
+            line-height: 32px;
+            margin: 0 12px 22px 0;
+            word-break: break-all;
+
+            span {
+                display: block;
+                width: 225px;
+                padding-right: 20px;
+                text-align: right;
+            }
+
+            b {
+                flex: 1;
+                font-weight: normal;
+            }
+        }
+
+        .mr0 {
+            margin-right: 0;
+        }
+
+        .boxA,
+        .boxB {
+            display: flex;
+            flex-wrap: wrap;
+
+            .line {
+                display: block;
+                width: 10px;
+                margin: 16px 6px 0;
+                border-top: 1px solid #606266;
+            }
+
+            /deep/ .itemA.el-form-item {
+                width: calc(50% - 12px + 112.5px);
+            }
+
+            /deep/ .itemB.el-form-item {
+                width: calc(50% - 12px - 112.5px);
+            }
+
+            .itemB {
+                /deep/ .el-form-item__content {
+                    margin-left: 0 !important;
+                }
+            }
+
+            /deep/ .el-form-item {
+                .el-form-item__content {
+                    display: flex;
+                }
+            }
+        }
+
+        .boxB {
+            /deep/ .itemB.el-form-item {
+                width: calc(15% - 18px - 36px);
+            }
+        }
+
+        .obsInfo {
+            line-height: 32px;
+            padding: 0 6px;
+            word-break: break-all;
+        }
+
+        .required {
+            &:before {
+                content: "*";
+                color: #f56c6c;
+                margin-right: 4px;
+            }
+        }
+    }
+    .collapseInfo {
+        padding-left: 18px;
+        line-height: 24px;
+
+        .place {
+            padding-left: 10px;
+        }
+    }
+}
+</style>

+ 297 - 0
src/views/sceneLibrary/components/generalizationList.vue

@@ -0,0 +1,297 @@
+<template>
+    <div class="generalizationListPanel">
+        <search-layout>
+            <template slot="searchItem1">
+                <span class="label">场景类型编号</span>
+                <el-input
+                    v-model="searchParams.sceneId"
+                    size="small"
+                    clearable
+                    placeholder="请输入"
+                    maxlength="60"
+                    @keyup.enter.native="doSearch"
+                >
+                </el-input>
+            </template>
+            <template slot="searchItem2">
+                <span class="label">功能模块</span>
+                <el-select v-model="searchParams.fileName" multiple>
+                    <el-option
+                        v-for="item in fileNameList"
+                        :label="item.caption"
+                        :value="item.code"
+                        :key="item.code"
+                    ></el-option>
+                </el-select>
+            </template>
+            <template slot="searchItem3">
+                <span class="label">天气</span>
+                <el-select v-model="searchParams.scenarioWeather" multiple>
+                    <el-option
+                        v-for="item in scenarioWeatherList"
+                        :label="item.caption"
+                        :value="item.code"
+                        :key="item.code"
+                    ></el-option>
+                </el-select>
+            </template>
+            <template slot="searchItem4">
+                <span class="label">时间</span>
+                <el-time-picker
+                    v-model="searchParams.scenarioTime"
+                    value-format="HH:mm:ss"
+                    placeholder="时间"
+                >
+                </el-time-picker>
+            </template>
+            <template slot="searchBtn1">
+                <el-button type="primary" @click="doSearch">查询</el-button>
+            </template>
+            <template slot="searchBtn2">
+                <el-button type="primary" @click="doReset">重置</el-button>
+            </template>
+        </search-layout>
+
+        <tableList
+            ref="table"
+            style="margin: 0"
+            :columns="columns"
+            :getDataWay="getDataWay"
+            :pagination="pagination"
+            :checkedData="checkedArr"
+            index
+            selection
+        >
+            <el-table-column
+                label="操作"
+                slot="cgInfos"
+                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>
+
+        <el-dialog
+            :title="videoDiaTitle"
+            :visible.sync="dialogVisible"
+            width="690px"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            :before-close="diaClose"
+        >
+            <div class="videoBox">
+                <video autoplay :src="videoSrc" controls></video>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import searchLayout from "@/components/grid/searchLayout";
+import tableList from "@/components/grid/TableList";
+import { mapState } from "vuex";
+
+export default {
+    name: "generalizationList", // 泛化场景
+    components: { searchLayout, tableList },
+    data() {
+        return {
+            searchParams: {
+                //搜索参数
+                sceneId: "", // 场景类型编号
+                fileName: [], // 功能模块
+                scenarioWeather: [], // 天气
+                scenarioTime: "", // 时间
+            },
+            labels: [],
+            fileNameList: [],
+            scenarioWeatherList: [],
+            props: {
+                multiple: true,
+                label: "dictName",
+                value: "dictCode",
+            },
+            columns: [
+                //表格列
+                {
+                    label: "编号",
+                    prop: "sceneId",
+                },
+                {
+                    label: "场景名称",
+                    prop: "scenarioName",
+                },
+                {
+                    label: "功能模块",
+                    prop: "fileName",
+                },
+                {
+                    label: "道路类型",
+                    prop: "scenarioRoadType",
+                },
+                {
+                    label: "时间",
+                    prop: "scenarioTime",
+                },
+                {
+                    label: "天气",
+                    prop: "scenarioWeather",
+                },
+                // {
+                //     label: "标签",
+                //     prop: "label",
+                // },
+                // {
+                //     label: "操作",
+                //     prop: "cgInfos",
+                //     template: true,
+                // },
+            ],
+            pagination: {
+                //分页使用
+                currentPage: 1,
+                pageSize: 10,
+                position: "right",
+                pageSizes: [10, 30, 50, 100, 200],
+                layout: "sizes, total, prev, pager, next, jumper",
+            },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.sceneLibrary.querySceneGeneralTemplateList,
+                param: {},
+            },
+            checkedArr: [],
+            dialogVisible: false,
+            autoplay: false,
+            videoSrc: "",
+            videoDiaTitle: "",
+        };
+    },
+
+    computed: {
+        ...mapState(["fileHost", "fileUrl"]),
+    },
+
+    methods: {
+        doSearch() {
+            this.refreshList(this.searchParams);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                sceneId: "",
+                fileName: [],
+                scenarioWeather: [],
+                scenarioTime: "",
+            };
+            this.labels = [];
+            this.doSearch();
+        },
+        viewRow(row) {
+            this.dialogVisible = true;
+            this.videoDiaTitle = row.naturalName;
+
+            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.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 = "";
+            done();
+        },
+        didUpload() {
+            this.doSearch();
+        },
+        getFileNameList() {
+            this.$axios({
+                method: "post",
+                url: this.$api.sceneLibrary.queryType,
+                data: {},
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    let arr = [];
+                    res.info.forEach((item, i) => {
+                        arr[i] = {
+                            code: item,
+                            caption: item,
+                        };
+                    });
+                    this.fileNameList = arr;
+                } else {
+                    this.$message.error(res.message || "获取功能模块列表失败");
+                }
+            });
+        },
+    },
+
+    async mounted() {
+        await this.$dicsListsInit({
+            scenarioWeatherList: "scenarioWeather",
+        });
+
+        this.getFileNameList();
+    },
+};
+</script>
+
+<style lang='less' scoped>
+@import "../common/util.less";
+.generalizationListPanel {
+    .inputBox {
+        .label {
+            min-width: 90px;
+        }
+
+        .el-input,
+        .el-select {
+            width: 230px;
+        }
+    }
+}
+</style>

+ 247 - 0
src/views/sceneLibrary/components/upload.vue

@@ -0,0 +1,247 @@
+<template>
+    <div>
+        <el-upload
+            class="upload"
+            ref="upload"
+            action=""
+            :before-upload="beforeUpload"
+            :on-change="handleChange"
+            :on-remove="handleRemove"
+            :on-preview="preview"
+            :on-success="success"
+            :on-error="error"
+            :http-request="toUpload"
+            :auto-upload="true"
+            :file-list="fileList"
+            :on-exceed="handleExceed"
+            :multiple="multiple"
+        >
+            <el-button type="primary" plain icon="el-icon-upload"
+                >上传文件</el-button
+            >
+        </el-upload>
+        <!--        <el-button @click="download">下载</el-button>-->
+    </div>
+</template>
+
+<script>
+export default {
+    name: "upload",
+    props: {
+        // 限制上传的个数
+        limit: {
+            type: Number,
+            default: 100,
+        },
+        // 一组文件传相同的值,保证其为一组
+        objectPath: {
+            type: String,
+            default: "1",
+        },
+        type: {
+            type: String,
+            default: "1",
+        },
+        // 是否需要处理大文件上传
+        needInstance: {
+            type: Boolean,
+            default: false,
+        },
+        // 上传url
+        uploadUrl: {
+            type: String,
+            default: "",
+        },
+        multiple: {
+            type: Boolean,
+            default: false,
+        },
+    },
+    data() {
+        return {
+            fileList: [],
+            attachmentList: [],
+            defaultParam: {},
+        };
+    },
+    methods: {
+        beforeUpload(file) {
+            let arr = ["xls", "xlsx"];
+            let i = file.name.lastIndexOf(".");
+
+            if (!arr.includes(file.name.slice(i + 1))) {
+                this.$message.warning("请上传以xlsx、xls为后缀名的Excel文件");
+                return false;
+            }
+        },
+        handleChange(file, fileList) {
+            this.fileList = fileList;
+        },
+        handleExceed(files, fileList) {
+            this.$message.warning(
+                `当前限制选择 ${this.limit} 个文件,本次选择了 ${
+                    files.length
+                } 个文件,共选择了 ${files.length + fileList.length} 个文件`
+            );
+        },
+        async handleRemove(file, fileList) {
+            let md5 = "";
+            if (file.raw) {
+                await this.$md5(file.raw).then((res) => {
+                    md5 = res;
+                });
+            } else {
+                md5 = file.md5;
+            }
+
+            let removeIndex = "";
+            this.attachmentList.forEach((item, index) => {
+                if (md5 === item.md5) {
+                    removeIndex = index;
+                }
+            });
+
+            // if (removeIndex < 0) {
+            //     this.$message.error("删除失败");
+            // }
+
+            this.attachmentList.splice(removeIndex, 1);
+            this.$emit("attachmentChange", this.attachmentList);
+        },
+        async toUpload(file) {
+            let _this = this;
+
+            return new Promise(async (resolve, reject) => {
+                let formData = new FormData();
+                await formData.append("name", file.file.name);
+                // await formData.append('type', _this.defaultParam.md5)
+                // console.log(this);
+
+                // await formData.append("type", this.type);
+                // await formData.append("objectPath", this.objectPath);
+                // await formData.append("md5", _this.defaultParam.md5);
+                await formData.append("file", file.file);
+
+                let axios = this.$axios;
+                // 处理大文件上传 instance已被设置不携带token
+                // if (this.needInstance) {
+                //     axios = this.$instance;
+                // }
+
+                // 上传前进行通知
+                this.$emit("willUpload");
+
+                /* let url = this.uploadUrl;
+                    let defaultParam = {};
+                    if (!url) {
+                        url = this.$api.common.uploadWj;
+                        // 获取MD5值
+                        await this.$md5(file.file).then((res) => {
+                            defaultParam = {
+                                // file: file.file,
+                                md5: res,
+                            };
+                        });
+                    } */
+
+                let url = this.$api.sceneLibrary.saveSceneGeneralTemplate;
+                let defaultParam = {};
+                // 获取MD5值
+                await this.$md5(file.file).then((res) => {
+                    defaultParam = {
+                        // file: file.file,
+                        md5: res,
+                    };
+                });
+
+                await axios({
+                    method: "post",
+                    url,
+                    data: formData,
+                    withCredentials: true,
+                    headers: {
+                        "Content-type": "multipart/form-data",
+                    },
+                })
+                    .then((res) => {
+                        if (res.code == 200) {
+                            // this.attachmentList.push({
+                            //     // attachmentName: file.file.name,
+                            //     // attachmentAddress: res.params,
+                            //     md5: defaultParam.md5 || "",
+                            //     // uid: file.file.uid,
+                            //     fileType: file.file.type,
+                            //     // fileName: res.info.fileName,
+                            //     // videoPreview: res.info.videoPreview,
+                            // });
+                            // resolve("成功");
+                            // this.$emit("attachmentChange", this.attachmentList);
+                            // 上传完成后进行通知
+                            // this.$emit("didUpload", "success");
+                            this.$refs.upload.clearFiles();
+                            this.$emit("didUpload");
+                        } else {
+                            this.$message.error(res.message || "上传失败");
+                            // this.$emit("didUpload", "fail");
+                            // reject("失败");
+                        }
+                    })
+                    // .catch((err) => {
+                    //     this.$emit("didUpload", "error");
+                    //     reject(err);
+                    // });
+            });
+        },
+        success(response, file, fileList) {
+            this.$message.success("上传成功 ");
+        },
+        error(response, file, fileList) {
+            this.$message.warning("上传失败");
+        },
+        preview(file) {
+            return false;
+            console.log(file);
+            console.log(this.attachmentList);
+            let item = this.attachmentList.find((item) =>
+                item.fileName.endsWith(file.name)
+            );
+            this.download(item.fileName, item.attachmentName);
+        },
+        download(downPath, downName) {
+            this.$axios({
+                method: "post",
+                url: this.$api.common.download,
+                responseType: "blob",
+                data: {
+                    objectName: downPath,
+                },
+            }).then((res) => {
+                const blob = new Blob([res]); //构造一个blob对象来处理数据
+                const fileName = downName;
+                //对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
+                //IE10以上支持blob但是依然不支持download
+                if ("download" in document.createElement("a")) {
+                    //支持a标签download的浏览器
+                    const link = document.createElement("a"); //创建a标签
+                    link.download = fileName; //a标签添加属性
+                    link.style.display = "none";
+                    link.href = URL.createObjectURL(blob);
+                    document.body.appendChild(link);
+                    link.click(); //执行下载
+                    URL.revokeObjectURL(link.href); //释放url
+                    document.body.removeChild(link); //释放标签
+                } else {
+                    //其他浏览器
+                    navigator.msSaveBlob(blob, fileName);
+                }
+            });
+        },
+    },
+};
+</script>
+
+<style scoped>
+.upload /deep/ .el-upload-list {
+    display: none;
+}
+</style>

+ 426 - 0
src/views/sceneLibrary/generalizationScenarioList.vue

@@ -0,0 +1,426 @@
+<template>
+    <div class="generalizationScenarioListPanel">
+        <search-layout :needBox="true">
+            <template slot="searchItem1">
+                <span class="label">场景类型编号</span>
+                <el-input
+                    v-model="searchParams.sceneId"
+                    size="small"
+                    clearable
+                    placeholder="请输入"
+                    maxlength="60"
+                    @keyup.enter.native="doSearch"
+                >
+                </el-input>
+            </template>
+            <template slot="searchItem2">
+                <span class="label">功能模块</span>
+                <el-select v-model="searchParams.fileName" multiple>
+                    <el-option
+                        v-for="item in fileNameList"
+                        :label="item.caption"
+                        :value="item.code"
+                        :key="item.code"
+                    ></el-option>
+                </el-select>
+            </template>
+            <template slot="searchItem3">
+                <span class="label">天气</span>
+                <el-select v-model="searchParams.scenarioWeather" multiple>
+                    <el-option
+                        v-for="item in scenarioWeatherList"
+                        :label="item.caption"
+                        :value="item.code"
+                        :key="item.code"
+                    ></el-option>
+                </el-select>
+            </template>
+            <template slot="searchItem4">
+                <span class="label">时间</span>
+                <el-time-picker
+                    v-model="searchParams.scenarioTime"
+                    value-format="HH:mm:ss"
+                    placeholder="时间"
+                >
+                </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>
+            <template slot="searchBtn2">
+                <el-button type="primary" @click="doReset">重置</el-button>
+            </template>
+        </search-layout>
+
+        <div class="btnsPanel">
+            <upload ref="upload" :limit="1" @didUpload="didUpload"></upload>
+        </div>
+
+        <tableList
+            ref="table"
+            style="margin: 0 30px"
+            :columns="columns"
+            :getDataWay="getDataWay"
+            :pagination="pagination"
+            index
+        >
+            <el-table-column
+                label="操作"
+                slot="cgInfos"
+                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>
+
+        <el-dialog
+            :title="videoDiaTitle"
+            :visible.sync="dialogVisible"
+            width="690px"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            :before-close="diaClose"
+        >
+            <div class="videoBox">
+                <video autoplay :src="videoSrc" controls></video>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<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 },
+    data() {
+        return {
+            searchParams: {
+                //搜索参数
+                sceneId: "", // 场景类型编号
+                fileName: [], // 功能模块
+                scenarioWeather: [], // 天气
+                scenarioTime: "", // 时间
+
+                // highSpeed: [], // 高速
+                // ramp: [], // 匝道
+                // tunnel: [], // 隧道
+                // cutIn: [], // 切入
+                // cutOut: [], // 切出
+                // laneChange: [], // 变道
+                // turnAround: [], // 掉头
+            },
+            labels: [],
+            fileNameList: [],
+            scenarioWeatherList: [],
+            props: {
+                multiple: true,
+                label: "dictName",
+                value: "dictCode",
+            },
+            columns: [
+                //表格列
+                {
+                    label: "编号",
+                    prop: "sceneId",
+                },
+                {
+                    label: "场景名称",
+                    prop: "scenarioName",
+                },
+                {
+                    label: "功能模块",
+                    prop: "fileName",
+                },
+                {
+                    label: "道路类型",
+                    prop: "scenarioRoadType",
+                },
+                {
+                    label: "时间",
+                    prop: "scenarioTime",
+                },
+                {
+                    label: "天气",
+                    prop: "scenarioWeather",
+                },
+                // {
+                //     label: "标签",
+                //     prop: "label",
+                // },
+                // {
+                //     label: "操作",
+                //     prop: "cgInfos",
+                //     template: true,
+                // },
+            ],
+            pagination: {
+                //分页使用
+                currentPage: 1,
+                pageSize: 10,
+                position: "right",
+                pageSizes: [10, 30, 50, 100, 200],
+                layout: "sizes, total, prev, pager, next, jumper",
+            },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.sceneLibrary.querySceneGeneralTemplateList,
+                param: {},
+            },
+            dialogVisible: false,
+            autoplay: false,
+            videoSrc: "",
+            videoDiaTitle: "",
+        };
+    },
+
+    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
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                sceneId: "",
+                fileName: [],
+                scenarioWeather: [],
+                scenarioTime: "",
+            };
+            this.labels = [];
+            this.doSearch();
+        },
+        viewRow(row) {
+            this.dialogVisible = true;
+            this.videoDiaTitle = row.naturalName;
+
+            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.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 = "";
+            done();
+        },
+        didUpload() {
+            this.doSearch();
+        },
+        getFileNameList() {
+            this.$axios({
+                method: "post",
+                url: this.$api.sceneLibrary.queryType,
+                data: {},
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    let arr = [];
+                    res.info.forEach((item, i) => {
+                        arr[i] = {
+                            code: item,
+                            caption: item,
+                        };
+                    });
+                    this.fileNameList = arr;
+                } else {
+                    this.$message.error(res.message || "获取功能模块列表失败");
+                }
+            });
+        },
+    },
+
+    async mounted() {
+        await this.$dicsListsInit({
+            scenarioWeatherList: "scenarioWeather",
+        });
+
+        this.getFileNameList();
+    },
+};
+</script>
+
+<style lang='less' scoped>
+@import "./common/util.less";
+.generalizationScenarioListPanel {
+    .inputBox {
+        .label {
+            min-width: 90px;
+        }
+    }
+
+    .btnsPanel {
+        text-align: right;
+    }
+}
+</style>

+ 230 - 33
src/views/sceneLibrary/scenePacketList.vue

@@ -195,6 +195,62 @@
             </span>
         </el-dialog>
 
+        <el-dialog
+            v-if="generalizationVisible"
+            :visible.sync="generalizationVisible"
+            title="泛化场景"
+            width="90%"
+            class="generalizationDia"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            :before-close="generalizationCancel"
+        >
+            <el-steps :active="stepActive" align-center>
+                <el-step title="第一步" description="选择场景模板"></el-step>
+                <el-step title="第二步" description="场景泛化"></el-step>
+            </el-steps>
+            <div>
+                <generalization-list
+                    v-if="stepActive === 1"
+                    ref="generalizationList"
+                ></generalization-list>
+                <generalization-detail
+                    v-if="stepActive === 2"
+                    ref="generalizationDetail"
+                    :id="generalizationId"
+                    :curId="curNode.id"
+                    :exampleId="curNode.exampleId"
+                    :ruleName="formA.ruleName"
+                    :rulesId="formA.rulesId"
+                    :genUrlType="genUrlType"
+                    @generalizationBegin="generalizationBegin"
+                    @generalizationDone="generalizationDone"
+                    @changeTemplate="changeTemplate"
+                ></generalization-detail>
+            </div>
+            <span slot="footer">
+                <!-- <el-button
+                    v-if="stepActive === 2"
+                    type="primary"
+                    @click="generalizationPrev"
+                    >上一步</el-button
+                > -->
+                <el-button
+                    v-if="stepActive === 1"
+                    type="primary"
+                    @click="generalizationNext"
+                    >下一步</el-button
+                >
+                <el-button
+                    v-if="stepActive === 2"
+                    type="primary"
+                    @click="generalizationConfirm"
+                    >完成</el-button
+                >
+                <el-button @click="generalizationCancel">取 消</el-button>
+            </span>
+        </el-dialog>
+
         <el-dialog
             title="模板预览"
             :visible.sync="templateViewVisible"
@@ -223,6 +279,8 @@ import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
 import toolbarTab from "@/components/toolbar/toolbarTab";
 import realSceneList from "./components/realSceneList";
+import generalizationList from "./components/generalizationList";
+import generalizationDetail from "./components/generalizationDetail";
 // import viewTree from "./components/elTree";
 import templateView from "./components/templateView";
 
@@ -233,6 +291,8 @@ export default {
         tableList,
         toolbarTab,
         realSceneList,
+        generalizationList,
+        generalizationDetail,
         // viewTree,
         templateView,
     },
@@ -334,9 +394,9 @@ export default {
             },
             idIndex: 1, // 用做新增加点id自加,因为id为空会报错
             nameDiaTitle: "", // 编辑该级节点信息的dialog的title
-            indicatorsVisible: false, // 编辑指标
-            scenarioVisible: false, // 选择场景
-            scenarioListsVisible: false, // 真实场景列表
+            indicatorsVisible: false, // 编辑指标dialog
+            scenarioVisible: false, // 选择场景dialog
+            scenarioListsVisible: false, // 真实场景列表dialog
             form: {
                 sublistName: "",
                 weight: "",
@@ -375,7 +435,10 @@ export default {
                     { required: true, message: "请选择", trigger: "change" },
                 ],
             },
-            sceneTypeList: [{ caption: "真实场景", code: "1" }],
+            sceneTypeList: [
+                { caption: "真实场景", code: "1" },
+                { caption: "泛化场景", code: "2" },
+            ],
             nodeList: [], // 把当前所有节点遍历到一个扁平数组
             curNode: {}, // 当前操作的节点
             editType: "", // 点操作编辑的类型 新增or编辑
@@ -383,9 +446,13 @@ export default {
             checkedIdsB: [], // 自然驾驶列表已选
             checkedIdsC: [], // 标准法规列表已选
             isRoot: false, // 是否是根节点
-            templateViewVisible: false,
+            templateViewVisible: false, // 模板预览dialog
             treeData: [],
             weightErrIds: [], // 存储weightErr为false的节点id的数组
+            generalizationVisible: false, // 泛化dialog
+            stepActive: 1, // 泛化步骤
+            generalizationId: "", // 泛化详情id
+            genUrlType: 1, // 1为从列表跳入的模板信息,2为泛化后的详情
         };
     },
 
@@ -440,6 +507,19 @@ export default {
                 );
                 this.curNode.children.splice(index, 1);
 
+                let node = null;
+                if (this.curNode.children && this.curNode.children.length > 0) {
+                    node = this.curNode.children[0];
+                } else {
+                    node = this.curNode;
+                }
+
+                if (node.parentId != "0") {
+                    this.sceneNumUpdate(node);
+                } else {
+                    this.curNode.sceneNum = 0;
+                }
+
                 this.checkWeightValidate();
             });
         },
@@ -475,11 +555,17 @@ export default {
         addScenario(row) {
             this.curNode = row;
 
+            if (row.sceneGeneralizationIds) {
+                this.formA.sceneType = "2";
+            } else {
+                this.formA.sceneType = "1";
+            }
+
             if (row.packageAndRules) {
                 this.formA.rulesId = row.packageAndRules;
-                this.formA.ruleName = this.ruleList.find(
-                    (i) => i.rulesId === row.packageAndRules
-                ).ruleName;
+                this.formA.ruleName =
+                    this.ruleList.find((i) => i.rulesId === row.packageAndRules)
+                        .ruleName || "";
             }
 
             this.scenarioVisible = true;
@@ -538,6 +624,8 @@ export default {
                         this.nodeList
                     );
 
+                    // console.log(this.getDataWay.data);
+
                     this.checkWeightValidate();
 
                     this.indicatorsCancel();
@@ -559,30 +647,47 @@ export default {
             this.$refs.formA.validate((valid) => {
                 if (valid) {
                     this.scenarioVisible = false;
-                    this.scenarioListsVisible = true;
 
-                    // 切换到第一个tab页并清空所有tab页中查询条件
-                    this.$nextTick(() => {
-                        this.$refs.realScene.activeName = "1";
+                    // 真实场景
+                    if (this.formA.sceneType === "1") {
+                        this.scenarioListsVisible = true;
 
-                        this.$refs.realScene.doResetA();
-                        this.$refs.realScene.doResetB();
-                        this.$refs.realScene.doResetC();
+                        // 切换到第一个tab页并清空所有tab页中查询条件
+                        this.$nextTick(() => {
+                            this.$refs.realScene.activeName = "1";
 
-                        // 把选中数据对应的ids组分别传入tabs中,用于后续操作数据进行存储
-                        if (this.curNode.sceneTrafficIds) {
-                            this.$refs.realScene.checkedIdsA =
-                                this.curNode.sceneTrafficIds.split(",");
-                        }
-                        if (this.curNode.sceneNaturalIds) {
-                            this.$refs.realScene.checkedIdsB =
-                                this.curNode.sceneNaturalIds.split(",");
-                        }
-                        if (this.curNode.sceneStatueIds) {
-                            this.$refs.realScene.checkedIdsC =
-                                this.curNode.sceneStatueIds.split(",");
+                            this.$refs.realScene.doResetA();
+                            this.$refs.realScene.doResetB();
+                            this.$refs.realScene.doResetC();
+
+                            // 把选中数据对应的ids组分别传入tabs中,用于后续操作数据进行存储
+                            if (this.curNode.sceneTrafficIds) {
+                                this.$refs.realScene.checkedIdsA =
+                                    this.curNode.sceneTrafficIds.split(",");
+                            }
+                            if (this.curNode.sceneNaturalIds) {
+                                this.$refs.realScene.checkedIdsB =
+                                    this.curNode.sceneNaturalIds.split(",");
+                            }
+                            if (this.curNode.sceneStatueIds) {
+                                this.$refs.realScene.checkedIdsC =
+                                    this.curNode.sceneStatueIds.split(",");
+                            }
+                        });
+                    } else {
+                        // 泛化场景
+                        if (this.curNode.exampleId) {
+                            // 进详情
+                            this.genUrlType = 2;
+                            this.stepActive = 2;
+                        } else {
+                            // 进列表
+                            this.genUrlType = 1;
+                            this.stepActive = 1;
                         }
-                    });
+
+                        this.generalizationVisible = true;
+                    }
                 }
             });
         },
@@ -624,13 +729,16 @@ export default {
             this.curNode.sceneNaturalIds = this.checkedIdsB.join(",");
             this.curNode.sceneStatueIds = this.checkedIdsC.join(",");
 
+            // 清空泛化场景的数据
+            this.curNode.exampleId = "";
+            this.curNode.sceneGeneralizationIds = "";
+            this.curNode.templateId = "";
+
             this.nodeList = [];
             // 遍历当前树 拿到所有节点的平行展开数组
             this.deepFirstSearch(this.getDataWay.data[0], this.nodeList);
 
-            if (this.curNode.parentId != "0") {
-                this.sceneNumUpdate(this.curNode);
-            }
+            this.sceneNumUpdate(this.curNode);
 
             this.scenarioListsCancel();
         },
@@ -657,6 +765,84 @@ export default {
 
             this.scenarioListsVisible = false;
         },
+        // 泛化-上一步
+        generalizationPrev() {
+            this.stepActive = 1;
+        },
+        // 泛化-下一步
+        generalizationNext() {
+            let arr = [];
+            if (
+                this.$refs.generalizationList &&
+                this.$refs.generalizationList.checkedArr
+            ) {
+                arr = this.$refs.generalizationList.checkedArr;
+            } else {
+                return;
+            }
+
+            if (arr.length === 0) {
+                this.$message.warning("请先选择一条数据");
+                return;
+            } else if (arr.length > 1) {
+                this.$message.warning("只能选择一条数据");
+                return;
+            }
+
+            this.generalizationId = arr[0].id;
+            this.genUrlType = 1;
+            this.stepActive = 2;
+        },
+        // 泛化-完成按钮
+        generalizationConfirm() {
+            this.$refs.generalizationDetail.done();
+        },
+        // 泛化-取消
+        generalizationCancel() {
+            this.generalizationVisible = false;
+        },
+        // 开始泛化
+        generalizationBegin() {
+            this.generalizationCancel();
+            this.curNode.sceneNum = "泛化中";
+        },
+        // 泛化完成回调
+        generalizationDone(info, obj, isSuccess = true) {
+            this.nodeList = [];
+            // 遍历当前树 拿到所有节点的平行展开数组
+            this.deepFirstSearch(this.getDataWay.data[0], this.nodeList);
+
+            let node = this.nodeList.find((i) => i.id === obj.curId);
+            if (node) {
+                if (isSuccess) {
+                    node.exampleId = info.exampleId;
+                    node.sceneGeneralizationIds = info.sceneGeneralizationIds;
+                    node.sceneNum = info.sceneNum;
+                    node.id = info.sublistId;
+                    node.templateId = info.templateId;
+
+                    node.packageAndRules = obj.rulesId;
+                    node.ruleName = obj.ruleName;
+                } else {
+                    // 若泛化失败则清空对应字段
+                    node.exampleId = "";
+                    node.sceneGeneralizationIds = "";
+                    node.sceneNum = 0;
+                    node.templateId = "";
+                }
+
+                // 清空真实场景的数据
+                node.sceneTrafficIds = "";
+                node.sceneNaturalIds = "";
+                node.sceneStatueIds = "";
+
+                this.sceneNumUpdate(node);
+            }
+        },
+        // 更换模板
+        changeTemplate() {
+            this.stepActive = 1;
+        },
         // 校验权重
         checkWeightValidate() {
             this.allRowWeightErrFalse(this.getDataWay.data[0]);
@@ -727,6 +913,16 @@ export default {
 
             for (let index = 0; index < this.nodeList.length; index++) {
                 const element = this.nodeList[index];
+                if (element.sceneNum === "泛化中") {
+                    this.$message.error("存在泛化中场景,请稍后进行保存");
+                    return;
+                }
+
+                if (element.sceneNum == 0) {
+                    this.$message.error("场景数量不能为0");
+                    return;
+                }
+
                 if (element.children && element.children.length > 0) {
                     let total = 0;
                     let arr = [];
@@ -794,7 +990,7 @@ export default {
             let node = this.nodeList.find((i) => i.id === curNode.parentId);
             let sceneNum = 0;
             node.children.forEach((i) => {
-                sceneNum += i.sceneNum;
+                i.sceneNum != "泛化中" ? (sceneNum += i.sceneNum) : null;
             });
 
             node.sceneNum = sceneNum;
@@ -851,7 +1047,8 @@ export default {
         color: @gray;
     }
 
-    .scenarioListsDia {
+    .scenarioListsDia,
+    .generalizationDia {
         /deep/ .el-dialog__body {
             padding: 20px 60px;
         }

+ 514 - 0
src/views/workManagement/autoRunProjectDetail.vue

@@ -0,0 +1,514 @@
+<template>
+    <div>
+        <el-form
+            ref="form"
+            :model="form"
+            :rules="rules"
+            label-width="120px"
+            class="flexBox"
+        >
+            <div class="formItemBox">
+                <el-form-item label="项目名称:" prop="projectName">
+                    <el-input
+                        placeholder="请输入"
+                        maxlength="30"
+                        v-autoTrim="{ obj: form, key: 'projectName' }"
+                        v-model="form.projectName"
+                    >
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="项目描述:" prop="projectDescribe">
+                    <el-input
+                        type="textarea"
+                        :autosize="{ minRows: 4, maxRows: 4 }"
+                        placeholder="请输入"
+                        maxlength="300"
+                        v-autoTrim="{ obj: form, key: 'projectDescribe' }"
+                        v-model="form.projectDescribe"
+                    >
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="算法来源:" prop="algorithmType">
+                    <el-radio
+                        v-model="form.algorithmType"
+                        label="1"
+                        @change="typeChange"
+                        >私有导入</el-radio
+                    >
+                    <el-radio
+                        v-model="form.algorithmType"
+                        label="3"
+                        @change="typeChange"
+                        >算法平台</el-radio
+                    >
+                </el-form-item>
+                <el-form-item label="选择算法:" prop="algorithm">
+                    <el-select v-model="form.algorithm">
+                        <el-option
+                            v-for="item in algorithmList"
+                            :label="item.name"
+                            :value="item.id"
+                            :key="item.id"
+                            :title="item.description"
+                        ></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="选择车辆:" prop="vehicle">
+                    <el-select
+                        v-model="form.vehicle"
+                        @change="vehicleSelChange"
+                    >
+                        <el-option
+                            v-for="item in vehicleList"
+                            :label="item.name"
+                            :value="item.id"
+                            :key="item.id"
+                            :title="item.description"
+                        ></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="选择场景:" prop="scene">
+                    <el-select v-model="form.scene" @change="sceneSelChange">
+                        <el-option
+                            v-for="item in sceneList"
+                            :label="item.name"
+                            :value="item.id"
+                            :key="item.id"
+                        ></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="并行度:" prop="parallelism">
+                    <el-input
+                        :disabled="runDisabled"
+                        placeholder="请输入"
+                        maxlength="10"
+                        v-autoTrim="{ obj: form, key: 'parallelism' }"
+                        v-model="form.parallelism"
+                    >
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="最大仿真时间:" prop="maxSimulationTime">
+                    <el-input
+                        placeholder="请输入"
+                        maxlength="10"
+                        v-autoTrim="{ obj: form, key: 'maxSimulationTime' }"
+                        v-model="form.maxSimulationTime"
+                    >
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="运行周期:" prop="operationCycle">
+                    <el-input
+                        placeholder="请输入"
+                        maxlength="60"
+                        v-autoTrim="{ obj: form, key: 'operationCycle' }"
+                        v-model="form.operationCycle"
+                    >
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="是否选择GPU:" prop="isChoiceGpu">
+                    <el-radio v-model="form.isChoiceGpu" label="0">是</el-radio>
+                    <el-radio v-model="form.isChoiceGpu" label="1">否</el-radio>
+                </el-form-item>
+            </div>
+
+            <div class="tipBox">
+                <div class="tip tipA">
+                    <!-- (传感器1:根据车辆自动带出;传感器2:根据车辆自动带出) -->
+                    <span
+                        v-for="item in sensors"
+                        :key="item"
+                        v-bind:class="{
+                            iconA: item === 'camera',
+                            iconB: item === 'ogt',
+                            iconC: item === 'lidar',
+                            iconE: item === 'gps',
+                        }"
+                    ></span>
+                </div>
+                <div class="tip">(场景数量:{{ sceneCount }})</div>
+                <!-- <div class="tip flexBox">
+                    <div>(下次运行时间:XX时XX分XX秒)</div>
+                    <div class="tipBtnBox">
+                        <el-button type="primary">规则查看</el-button>
+                    </div>
+                </div> -->
+                <div class="tip">(最多可用资源:{{ maxCount }})</div>
+                <div class="tip">(最小是5,最大是60)</div>
+            </div>
+        </el-form>
+
+        <div class="ruleTip">
+            <el-collapse v-model="activeNames">
+                <el-collapse-item title="运行周期规则查看" name="1">
+                    <div class="collapseInfo">
+                        运行周期规则查看
+                    </div>
+                </el-collapse-item>
+            </el-collapse>
+        </div>
+
+        <div class="btns">
+            <el-button type="primary" @click="save(false)">保存</el-button>
+            <el-button
+                type="primary"
+                @click="save(true)"
+                v-if="this.$route.query.id"
+                >另存为</el-button
+            >
+            <el-button
+                type="primary"
+                @click="save(false, true)"
+                :disabled="runDisabled"
+                >提交</el-button
+            >
+            <el-button type="primary" plain @click="cancel">取消</el-button>
+        </div>
+    </div>
+</template>
+
+<script>
+//import  from '';
+let maxCount = 0; // 用于校验
+let validateNum = (rule, value, callback) => {
+    !/^(\d+)$/.test(value) && callback(new Error(rule.message));
+    if (value <= 0 || value > maxCount) callback(new Error(rule.message));
+    callback();
+};
+let validateNumA = (rule, value, callback) => {
+    !/^(\d+)$/.test(value) && callback(new Error(rule.message));
+    if (value < 5 || value > 60) callback(new Error(rule.message));
+    callback();
+};
+let validateNumB = (rule, value, callback) => {
+    !/^(\d+)$/.test(value) && callback(new Error(rule.message));
+    if (value <= 0) callback(new Error(rule.message));
+    callback();
+};
+
+export default {
+    name: "autoRunProjectDetail", // 自动运行项目详情
+    components: {},
+    data() {
+        return {
+            form: {
+                id: "",
+                projectName: "", // 项目名称
+                projectDescribe: "", // 项目描述
+                algorithmType: "1", // 算法来源
+                algorithm: "", // 选择算法
+                vehicle: "", // 选择车辆
+                scene: "", // 选择场景
+                parallelism: "", // 并行度
+                maxSimulationTime: "", // 最大仿真时间
+                isChoiceGpu: "0", // 是否选择GPU
+                nowRunState: "10", // 运行状态
+                operationCycle: "", // 运行周期
+            },
+            algorithmList: [], // 算法对应列表
+            vehicleList: [], // 车辆对应列表
+            sceneList: [], // 场景对应列表
+            maxCount: 0, // 最多可用资源
+            sceneCount: 0, // 场景数量
+            rules: {
+                projectName: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                projectDescribe: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                algorithmType: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                algorithm: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                vehicle: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                scene: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                parallelism: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                maxSimulationTime: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入不小于5且不大于60的正整数",
+                        trigger: ["blur"],
+                    },
+                ],
+                isChoiceGpu: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                operationCycle: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+            },
+            sensors: [], // 选中车辆后对应的传感器数组
+            activeNames: [""],
+            runDisabled: false, // 若最多可用资源为0,则不可点击"提交"
+        };
+    },
+
+    computed: {},
+
+    methods: {
+        async getLists(dropDownType = "") {
+            await this.$axios({
+                method: "post",
+                url: this.$api.workManagement.selectDropDownByType,
+                data: {
+                    dropDownType,
+                    algorithmType: this.form.algorithmType,
+                },
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    res.info.forEach((item) => {
+                        if (item.type === "1") {
+                            this.algorithmList = item.dropDownList;
+                        } else if (item.type === "2") {
+                            this.vehicleList = item.dropDownList;
+                        } else if (item.type === "3") {
+                            this.sceneList = item.dropDownList;
+                        }
+                        // 空表示第一次进,有值表示在切换算法来源,需要清空选择算法的值
+                        if (dropDownType) {
+                            this.form.algorithm = "";
+                            this.$nextTick(() => {
+                                this.$refs.form.clearValidate("algorithm");
+                            });
+                        }
+                    });
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
+        typeChange() {
+            this.getLists("1");
+        },
+        async getMaxSimulationTime() {
+            await this.$axios({
+                method: "post",
+                url: this.$api.workManagement.selectMaxParallelism,
+                data: {},
+            }).then((res) => {
+                // res.info = 10;
+                if (res.code == 200 && res.info && res.info != 0) {
+                    this.maxCount = maxCount = res.info;
+                    if (res.info == -1) {
+                        this.rules.parallelism.push({
+                            validator: validateNumB,
+                            message: "请输入正整数",
+                            trigger: ["blur"],
+                        });
+                    } else {
+                        this.rules.parallelism.push({
+                            validator: validateNum,
+                            message: "请输入不大于最多可用资源的正整数",
+                            trigger: ["blur"],
+                        });
+                    }
+                } else if (res.code == 200 && res.info == 0) {
+                    this.maxCount = maxCount = 0;
+                    this.runDisabled = true;
+                    this.form.parallelism = 0;
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
+        sceneSelChange(item) {
+            this.sceneCount = this.sceneList.find(
+                (i) => i.id === item
+            ).sceneNum;
+        },
+        vehicleSelChange(item) {
+            let sensor = this.vehicleList.find((i) => i.id === item).sensor;
+
+            if (!sensor) {
+                this.sensors = [];
+            } else {
+                this.sensors = sensor.split(",");
+            }
+        },
+        save(isAdd = false, needChange = false) {
+            // isAdd是否强制新增,needChange是否需要改变状态
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    if (isAdd) {
+                        // 另存为
+                        this.form.id = "";
+                    }
+
+                    this.form.nowRunState = "10";
+
+                    this.$axios({
+                        method: "post",
+                        url: this.$api.workManagement
+                            .addOrUpdateAutomaticProject,
+                        data: {
+                            ...this.form,
+                        },
+                    }).then((res) => {
+                        if (res.code == 200) {
+                            this.$message.success("保存成功");
+                            if (needChange) {
+                                this.form.id = res.info;
+                                this.stateChange();
+                            } else {
+                                this.cancel();
+                            }
+                        } else {
+                            this.$message.error(res.message || "保存失败");
+                        }
+                    });
+                }
+            });
+        },
+        cancel() {
+            this.$router.replace({ path: "/autoRunProjectList" });
+        },
+        stateChange() {
+            this.$axios({
+                method: "post",
+                url: this.$api.workManagement.updateAutomaticRunState,
+                data: {
+                    id: this.form.id,
+                    automaticRunState: "0",
+                },
+            }).then((res) => {
+                if (res.code == 200) {
+                    this.$message.success("提交成功");
+                    this.cancel();
+                } else {
+                    this.$message.error(res.message || "提交失败");
+                }
+            });
+        },
+    },
+
+    mounted() {
+        if (this.$route.query.id) {
+            let id = "";
+            this.form.id = id = this.$route.query.id;
+
+            if (id) {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.selectAutomaticProjectById,
+                    data: {
+                        id,
+                    },
+                }).then(async (res) => {
+                    if (res.code == 200 && res.info) {
+                        this.form = res.info;
+                        await this.getLists();
+                        await this.getMaxSimulationTime();
+                        this.vehicleSelChange(res.info.vehicle);
+                        this.sceneSelChange(res.info.scene);
+                    } else {
+                        this.$message.error(res.message || "获取信息失败");
+                    }
+                });
+            }
+        } else {
+            this.getLists();
+            this.getMaxSimulationTime();
+        }
+    },
+};
+</script>
+
+<style lang='less' scoped>
+.el-form {
+    width: 60%;
+    min-width: 900px;
+    padding-top: 60px;
+    margin: 0 auto;
+
+    .formItemBox {
+        flex: 1;
+
+        /deep/ .el-input,
+        .el-select {
+            width: 100%;
+        }
+    }
+
+    .el-textarea {
+        height: 96px;
+    }
+
+    .tipBox {
+        min-width: 270px;
+        margin-left: 20px;
+
+        .tip {
+            margin-bottom: 22px;
+            line-height: 32px;
+        }
+
+        .tipA {
+            height: 32px;
+            // 按54往上加
+            margin-top: 280px;
+
+            .iconA {
+                background: url("../../assets/common/image/sensor/001.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+            .iconB {
+                background: url("../../assets/common/image/sensor/002.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+            .iconC {
+                background: url("../../assets/common/image/sensor/003.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+            .iconD {
+                background: url("../../assets/common/image/sensor/004.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+            .iconE {
+                background: url("../../assets/common/image/sensor/005.png")
+                    center no-repeat;
+                background-size: contain;
+            }
+
+            span {
+                display: inline-block;
+                width: 18px;
+                height: 18px;
+                margin-top: 7px;
+                margin-right: 6px;
+            }
+        }
+
+        .tipB {
+            padding-top: 54px;
+        }
+
+        .tipBtnBox {
+            margin-left: 20px;
+        }
+    }
+}
+
+.ruleTip {
+    width: 60%;
+    min-width: 900px;
+    margin: 0 auto;
+}
+
+.btns {
+    padding-top: 30px;
+    text-align: center;
+}
+</style>

+ 391 - 0
src/views/workManagement/autoRunProjectList.vue

@@ -0,0 +1,391 @@
+<template>
+    <div>
+        <div v-if="!$route.path.includes('autoRunSubProjectList')">
+            <search-layout :needBox="true">
+                <template slot="searchItem1">
+                    <span class="label">项目ID</span>
+                    <el-input
+                        v-model="searchParams.projectId"
+                        size="small"
+                        clearable
+                        placeholder="请输入"
+                        maxlength="60"
+                        @keyup.enter.native="doSearch"
+                    >
+                    </el-input>
+                </template>
+                <template slot="searchItem2">
+                    <span class="label">项目名称</span>
+                    <el-input
+                        v-model="searchParams.projectName"
+                        size="small"
+                        clearable
+                        placeholder="请输入"
+                        maxlength="60"
+                        @keyup.enter.native="doSearch"
+                    >
+                    </el-input>
+                </template>
+                <template slot="searchItem3">
+                    <span class="label">创建时间</span>
+                    <el-date-picker
+                        v-model="createDate"
+                        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" @click="doSearch">查询</el-button>
+                </template>
+                <template slot="searchBtn2">
+                    <el-button type="primary" @click="doReset">重置</el-button>
+                </template>
+            </search-layout>
+
+            <div class="btnsPanel">
+                <el-button
+                    type="primary"
+                    plain
+                    icon="el-icon-delete"
+                    @click="delRows"
+                    >批量删除</el-button
+                >
+                <el-button
+                    type="primary"
+                    icon="el-icon-circle-plus-outline"
+                    @click="addOne"
+                    >创建</el-button
+                >
+            </div>
+
+            <tableList
+                ref="table"
+                style="margin: 0 30px"
+                :columns="columns"
+                :getDataWay="getDataWay"
+                :pagination="pagination"
+                :checkedData="checkedArr"
+                selection
+                index
+            >
+                <el-table-column
+                    label="停/启用"
+                    slot="automaticRunState"
+                    align="center"
+                >
+                    <template v-slot="scope">
+                        <el-switch
+                            v-model="scope.row.automaticRunState"
+                            active-value="0"
+                            inactive-value="1"
+                            active-color="#3397FF"
+                            inactive-color="#ff4949"
+                            @change="
+                                ($event) => {
+                                    switchVisible($event, scope.row);
+                                }
+                            "
+                        ></el-switch>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" slot="cgInfos" align="center">
+                    <template v-slot="scope">
+                        <i
+                            @click="runRow(scope.row.id, scope.row.parallelism)"
+                            class="el-icon-video-play elIcon"
+                            title="运行"
+                        ></i>
+                        <i
+                            @click="editRow(scope.row)"
+                            class="el-icon-edit-outline elIcon"
+                            title="编辑"
+                        ></i>
+                        <i
+                            @click="viewRow(scope.row.id)"
+                            class="el-icon-view elIcon"
+                            title="查看"
+                        ></i>
+                        <i
+                            v-if="scope.row.automaticRunState === '1'"
+                            @click="delRow(scope.row.id)"
+                            class="el-icon-delete elIcon"
+                            title="删除"
+                        ></i>
+                        <!-- 停用的时候显示删除 automaticRunState 0是启用 1是停用 -->
+                    </template>
+                </el-table-column>
+            </tableList>
+        </div>
+        <router-view v-else></router-view>
+    </div>
+</template>
+
+<script>
+import searchLayout from "@/components/grid/searchLayout";
+import tableList from "@/components/grid/TableList";
+
+export default {
+    name: "autoRunProjectList", // 自动运行项目列表
+    components: { searchLayout, tableList },
+    data() {
+        return {
+            searchParams: {
+                //搜索参数
+                projectId: "", //项目ID
+                projectName: "", //项目名称
+                createStartDate: "", //创建时间起
+                createEndDate: "", //创建时间止
+            },
+            createDate: "",
+            columns: [
+                {
+                    label: "项目ID",
+                    prop: "projectId",
+                },
+                {
+                    label: "项目名称",
+                    prop: "projectName",
+                },
+                {
+                    label: "创建时间",
+                    prop: "createTimeFmt",
+                },
+                {
+                    label: "算法名称",
+                    prop: "algorithm",
+                },
+                {
+                    label: "自动运行次数",
+                    prop: "automaticRunTimes",
+                },
+                {
+                    label: "最近运行时间",
+                    prop: "lastRunTimeFmt",
+                },
+                {
+                    label: "停/启用",
+                    prop: "automaticRunState",
+                    template: true,
+                },
+                {
+                    label: "操作",
+                    prop: "cgInfos",
+                    template: true,
+                },
+            ],
+            pagination: {
+                //分页使用
+                currentPage: 1,
+                pageSize: 10,
+                position: "right",
+                pageSizes: [10, 30, 50, 100, 200],
+                layout: "sizes, total, prev, pager, next, jumper",
+            },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.workManagement.selectAutomaticProject,
+                param: {},
+            },
+            checkedArr: [],
+            curRow: {}, // 当前row
+        };
+    },
+    methods: {
+        doSearch() {
+            if (this.createDate) {
+                this.searchParams.createStartDate = `${this.createDate[0]}`;
+                this.searchParams.createEndDate = `${this.createDate[1]}`;
+            } else {
+                this.searchParams.createStartDate = "";
+                this.searchParams.createEndDate = "";
+            }
+
+            let pageMap = {
+                projectId: this.searchParams.projectId,
+                projectName: this.searchParams.projectName,
+                createStartDate: this.searchParams.createStartDate,
+                createEndDate: this.searchParams.createEndDate,
+            };
+            this.refreshList(pageMap);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                projectId: "",
+                projectName: "",
+                createStartDate: "",
+                createEndDate: "",
+            };
+            this.createDate = "";
+            this.doSearch();
+        },
+        addOne() {
+            this.$router.push({ path: "/autoRunProjectDetail" });
+        },
+        switchVisible(value, row) {
+            // 停用
+            if (value === "1") {
+                row.automaticRunState = "0";
+                this.$confirm("确认该项目停用自动运行?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                }).then(() => {
+                    this.$axios({
+                        method: "POST",
+                        url: this.$api.workManagement.updateAutomaticRunState,
+                        data: {
+                            id: row.id,
+                            automaticRunState: "1",
+                        },
+                    }).then((res) => {
+                        if (res.code == 200) {
+                            row.automaticRunState = "1";
+                            this.$message.success("停用成功");
+                        } else {
+                            this.$message.error(res.message || "停用失败");
+                        }
+                    });
+                });
+            } else {
+                // 启用
+                row.automaticRunState = "1";
+                this.$confirm("确认该项目启用自动运行?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                }).then(() => {
+                    this.$axios({
+                        method: "POST",
+                        url: this.$api.workManagement.updateAutomaticRunState,
+                        data: {
+                            id: row.id,
+                            automaticRunState: "0",
+                        },
+                    }).then((res) => {
+                        if (res.code == 200) {
+                            row.automaticRunState = "0";
+                            this.$message.success("启用成功");
+                        } else {
+                            this.$message.error(res.message || "启用失败");
+                        }
+                    });
+                });
+            }
+        },
+        editRow(row) {
+            this.$router.push({
+                path: "/autoRunProjectDetail",
+                query: {
+                    id: row.id,
+                },
+            });
+        },
+        runRow(id, parallelism) {
+            this.$confirm("确认是否运行?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                if (parallelism == "0") {
+                    this.$message.error("并行度为0,不能运行");
+                    return;
+                }
+
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.createAutomaticSubProject,
+                    data: { id },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("运行成功");
+                    } else {
+                        this.$message.error(res.message || "运行失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        delRow(ids) {
+            this.$confirm("确认是否删除?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.deleteAutomaticProjectByids,
+                    data: {
+                        ids,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        delRows() {
+            let checkedArr = this.checkedArr;
+            if (checkedArr.length <= 0) {
+                this.$message.info("请先选择数据");
+                return;
+            }
+
+            let arr = [];
+
+            for (let index = 0; index < checkedArr.length; index++) {
+                const row = checkedArr[index];
+                if (row.automaticRunState != "1") {
+                    this.$message.error("存在未停用数据,请重新选择");
+                    return;
+                }
+                arr.push(row.id);
+            }
+
+            this.delRow(arr.join(","));
+        },
+
+        viewRow(id) {
+            this.$router.push({
+                path: "/autoRunProjectList/autoRunSubProjectList",
+                query: { id },
+            });
+        },
+    },
+
+    mounted() {},
+};
+</script>
+
+<style lang='less' scoped>
+.btnsPanel {
+    margin: 45px 40px 15px;
+    text-align: right;
+}
+
+.checkboxPanel {
+    text-align: center;
+
+    .labelA {
+        margin-right: 60px;
+    }
+}
+</style>

+ 390 - 0
src/views/workManagement/autoRunSubProjectList.vue

@@ -0,0 +1,390 @@
+<template>
+    <div>
+        <div v-if="!$route.path.includes('projectInfo')">
+            <div class="box">
+                <div class="info">
+                    <span>项目名称:</span>
+                    <b>{{ info.projectName }}</b>
+                </div>
+                <div class="info">
+                    <span>项目描述:</span>
+                    <b>{{ info.projectDescribe }}</b>
+                </div>
+                <div class="info">
+                    <span>算法名称:</span>
+                    <b>{{ info.algorithmName }}</b>
+                </div>
+                <div class="info">
+                    <span>车辆:</span>
+                    <b>{{ info.vehicle }}</b>
+                </div>
+                <div class="info">
+                    <span>场景:</span>
+                    <b>{{ info.sceneName }}</b>
+                </div>
+                <div class="info">
+                    <span>最大仿真时间:</span>
+                    <b>{{ info.maxSimulationTime }}</b>
+                </div>
+                <div class="info">
+                    <span>运行周期:</span>
+                    <b>{{ info.operationCycle }}</b>
+                </div>
+                <div class="info">
+                    <span>并行度:</span>
+                    <b>{{ info.parallelism }}</b>
+                </div>
+                <div class="info">
+                    <span>是否选择GPU:</span>
+                    <b>{{ info.isChoiceGpu }}</b>
+                </div>
+            </div>
+
+            <tableList
+                ref="table"
+                style="margin: 0 30px"
+                :columns="columns"
+                :getDataWay="getDataWay"
+                :pagination="pagination"
+                index
+            >
+                <el-table-column label="操作" slot="cgInfos" align="center">
+                    <template v-slot="scope">
+                        <i
+                            @click="viewRow(scope.row.id)"
+                            class="el-icon-view elIcon"
+                            title="查看"
+                        ></i>
+                        <i
+                            v-if="scope.row.nowRunState === '30'"
+                            @click="downRow(scope.row)"
+                            class="el-icon-download elIcon"
+                            title="下载"
+                        ></i>
+                        <i
+                            v-if="scope.row.nowRunState != '20'"
+                            @click="delRow(scope.row.id)"
+                            class="el-icon-delete elIcon"
+                            title="删除"
+                        ></i>
+                        <i
+                            v-if="scope.row.nowRunState === '20'"
+                            @click="stopRow(scope.row.id)"
+                            class="el-icon-video-pause elIcon"
+                            title="中止"
+                        ></i>
+                        <!-- 下载只有执行完成才可展示 nowRunState 30展示  -->
+                        <!-- 只要nowRunState不是20 即执行中的时候都可以删除 -->
+                        <!-- 只有执行中可中止 即等于20的时候 -->
+                    </template>
+                </el-table-column>
+            </tableList>
+
+            <el-dialog
+                title="下载"
+                :visible.sync="dialogVisible"
+                width="690px"
+                :close-on-click-modal="false"
+                :close-on-press-escape="false"
+                :before-close="cancelDown"
+            >
+                <div class="checkboxPanel">
+                    <el-checkbox-group v-model="downType">
+                        <el-checkbox
+                            label="工作报告"
+                            class="labelA"
+                            :disabled="downDisabled"
+                        ></el-checkbox>
+                        <el-checkbox label="任务文件包"></el-checkbox>
+                    </el-checkbox-group>
+                </div>
+                <span slot="footer">
+                    <el-button type="primary" @click="confirmDown"
+                        >确 定</el-button
+                    >
+                    <el-button @click="cancelDown">取 消</el-button>
+                </span>
+            </el-dialog>
+        </div>
+        <router-view v-else></router-view>
+    </div>
+</template>
+
+<script>
+import tableList from "@/components/grid/TableList";
+
+export default {
+    name: "autoRunSubProjectList", // 自动运行子项目列表
+    components: { tableList },
+    data() {
+        return {
+            id: "",
+            columns: [
+                {
+                    label: "项目ID",
+                    prop: "projectId",
+                },
+                {
+                    label: "项目名称",
+                    prop: "projectName",
+                },
+                {
+                    label: "开始时间",
+                    prop: "createTimeFmt",
+                },
+                {
+                    label: "结束时间",
+                    prop: "finishTimeFmt",
+                },
+                {
+                    label: "进度",
+                    prop: "nowRunStateDict",
+                },
+                {
+                    label: "评测等级",
+                    prop: "evaluationLevelDict",
+                },
+                {
+                    label: "操作",
+                    prop: "cgInfos",
+                    template: true,
+                },
+            ],
+            pagination: {
+                //分页使用
+                currentPage: 1,
+                pageSize: 10,
+                position: "right",
+                pageSizes: [10, 30, 50, 100, 200],
+                layout: "sizes, total, prev, pager, next, jumper",
+            },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.workManagement.selectSubProjectList,
+                param: {
+                    parentId: this.$route.query.id,
+                },
+            },
+            downType: [],
+            dialogVisible: false,
+            curRow: {}, // 当前row
+            downDisabled: false, // 用于判断是否可下载工作报告
+            info: {},
+        };
+    },
+    methods: {
+        doSearch() {
+            this.refreshList();
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        editRow(row) {
+            this.$router.push({
+                path: "/autoRunProjectDetail",
+                query: {
+                    id: row.id,
+                },
+            });
+        },
+        runRow(id) {
+            this.$confirm("确认是否运行?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.updateProjectNowRunState,
+                    data: {
+                        id,
+                        nowRunState: "20",
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("运行成功");
+                    } else {
+                        this.$message.error(res.message || "运行失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        delRow(ids) {
+            this.$confirm("确认是否删除?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.deleteAutomaticSubProjectByIds,
+                    data: {
+                        ids,
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("删除成功");
+                    } else {
+                        this.$message.error(res.message || "删除失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        stopRow(id) {
+            this.$confirm("确认是否中止?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.updateAutoProjectNowRunState,
+                    data: {
+                        id,
+                        nowRunState: "40",
+                    },
+                }).then((res) => {
+                    if (res.code == 200) {
+                        this.$message.success("中止成功");
+                    } else {
+                        this.$message.error(res.message || "中止失败");
+                    }
+                    this.doSearch();
+                });
+            });
+        },
+        viewRow(id) {
+            this.$router.push({
+                path: "/autoRunProjectList/autoRunSubProjectList/projectInfo",
+                query: { id, projectType: "2" },
+            });
+        },
+        downRow(row) {
+            this.curRow = row;
+            this.downDisabled = row.nowRunState === "30" ? false : true;
+            this.dialogVisible = true;
+        },
+        confirmDown() {
+            let url = "";
+            let fileName = this.curRow.projectName;
+
+            if (this.downType.length === 0) {
+                this.$message.info("请先选择下载类型");
+                return;
+            } else if (this.downType.length === 1) {
+                if (this.downType[0] === "工作报告") {
+                    url = this.$api.workManagement.exportProjectReportById;
+                    fileName += ".pdf";
+                } else {
+                    url = this.$api.workManagement.exportProjectTaskFileById;
+                    fileName += ".zip";
+                }
+            } else {
+                url =
+                    this.$api.workManagement.exportProjectReportAndTaskFileById;
+                fileName += ".zip";
+            }
+
+            let id = this.curRow.id;
+            this.curRow = {};
+
+            this.$axios({
+                method: "post",
+                url,
+                responseType: "blob",
+                data: {
+                    id,
+                    projectType: "2",
+                },
+            }).then((res) => {
+                let blob = new Blob([res]);
+                if ("download" in document.createElement("a")) {
+                    // 非IE下载
+                    let emlink = document.createElement("a");
+                    emlink.download = fileName;
+                    emlink.style.display = "none";
+                    emlink.href = URL.createObjectURL(blob);
+                    document.body.appendChild(emlink);
+                    emlink.click();
+                    URL.revokeObjectURL(emlink.href);
+                    document.body.removeChild(emlink);
+                } else {
+                    // IE下载
+                    navigator.msSaveBlob(blob, fileName);
+                }
+            });
+
+            this.downType = [];
+            this.dialogVisible = false;
+        },
+        cancelDown() {
+            this.downType = [];
+            this.dialogVisible = false;
+        },
+    },
+
+    mounted() {
+        if (this.$route.query.id) {
+            this.id = this.$route.query.id;
+
+            if (this.id) {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.selectSubProjectInfo,
+                    data: {
+                        id: this.id,
+                    },
+                }).then((res) => {
+                    if (res.code == 200 && res.info) {
+                        this.info = res.info;
+                    } else {
+                        this.$message.error(res.message || "获取信息失败");
+                    }
+                });
+            }
+        }
+    },
+};
+</script>
+
+<style lang='less' scoped>
+.box {
+    display: flex;
+    flex-wrap: wrap;
+    padding: 20px 40px;
+
+    .info {
+        display: flex;
+        width: 345px;
+        margin: 0 12px 22px 0;
+        word-break: break-all;
+
+        span {
+            display: block;
+            width: 105px;
+            color: @gray;
+        }
+
+        b {
+            flex: 1;
+            font-weight: normal;
+        }
+    }
+}
+
+.checkboxPanel {
+    text-align: center;
+
+    .labelA {
+        margin-right: 60px;
+    }
+}
+</style>

+ 3 - 0
src/views/workManagement/evaluationReport.vue

@@ -81,6 +81,7 @@ export default {
     data() {
         return {
             id: "",
+            projectType: "",
             columns: [
                 {
                     label: "测试项目",
@@ -498,6 +499,7 @@ export default {
     mounted() {
         if (this.$route.query.id) {
             this.id = this.$route.query.id;
+            this.projectType = this.$route.query.projectType || "1";
 
             if (this.id) {
                 this.$axios({
@@ -505,6 +507,7 @@ export default {
                     url: this.$api.workManagement.selectProjectReportById,
                     data: {
                         id: this.id,
+                        projectType: this.projectType,
                     },
                 }).then((res) => {
                     if (res.code == 200 && res.info) {

+ 3 - 2
src/views/workManagement/manualRunProjectList.vue

@@ -346,7 +346,7 @@ export default {
                     this.$message.error("并行度为0,不能运行");
                     return;
                 }
-                
+
                 this.$axios({
                     method: "post",
                     url: this.$api.workManagement.updateProjectNowRunState,
@@ -433,7 +433,7 @@ export default {
         viewRow(id) {
             this.$router.push({
                 path: "/manualRunProjectList/projectInfo",
-                query: { id },
+                query: { id, projectType: "1" },
             });
         },
         downRow(row) {
@@ -471,6 +471,7 @@ export default {
                 responseType: "blob",
                 data: {
                     id,
+                    projectType: "1",
                 },
             }).then((res) => {
                 let blob = new Blob([res]);

+ 40 - 37
src/views/workManagement/projectInfo.vue

@@ -58,7 +58,7 @@
                 </div>
             </div>
 
-            <div class="panel">
+            <div class="scorePanel panel">
                 <div class="titlePanel">
                     <div class="titlePanelBor">测评得分</div>
                 </div>
@@ -230,6 +230,7 @@ export default {
     data() {
         return {
             id: "",
+            projectType: "", // 1手动 2自动
             info: {},
             columns: [
                 {
@@ -304,6 +305,7 @@ export default {
                 data: this.$api.workManagement.selectProjectTaskList,
                 param: {
                     id: this.$route.query.id,
+                    projectType: this.$route.query.projectType,
                 },
             },
             getDataWayA: {
@@ -345,6 +347,7 @@ export default {
                 query: {
                     taskId: row.id,
                     id: row.pid,
+                    projectType: this.projectType,
                 },
             });
         },
@@ -352,7 +355,7 @@ export default {
             if (this.info.nowRunState === "30") {
                 this.$router.push({
                     path: "/manualRunProjectList/projectInfo/evaluationReport",
-                    query: { id: this.id },
+                    query: { id: this.id, projectType: this.projectType },
                 });
             }
         },
@@ -362,7 +365,7 @@ export default {
                 method: "post",
                 url: this.$api.workManagement.exportProjectReportById,
                 responseType: "blob",
-                data: { id: this.id },
+                data: { id: this.id, projectType: this.projectType },
             }).then((res) => {
                 let blob = new Blob([res]);
                 let fileName = "测试报告.pdf";
@@ -403,43 +406,39 @@ export default {
         // console.log(this.$route);
         if (this.$route.query.id) {
             this.id = this.$route.query.id;
+            this.projectType = this.$route.query.projectType || "1";
 
-            if (this.id) {
-                this.$axios({
-                    method: "post",
-                    url: this.$api.workManagement.selectProjectDetailsById,
-                    data: {
-                        id: this.id,
-                    },
-                }).then((res) => {
-                    if (res.code == 200 && res.info) {
-                        this.info = res.info;
-                        this.configList.camera =
-                            res.info.sensorCameraList || [];
-                        this.configList.ogt = res.info.sensorOgtList || [];
-                        this.configList.lidar = res.info.sensorLidarList || [];
-                        this.configList.gps = res.info.sensorGpsList || [];
-
-                        this.modelImgSrc = this.getImgUrl(
-                            res.info.vehicleTopView
-                        );
-
-                        if (this.info.nowRunState === "30") {
-                            this.downImgSrc = require("@/assets/common/image/others/hasDoc.png");
-                        } else {
-                            this.downImgSrc = require("@/assets/common/image/others/noDoc.png");
-                        }
-
-                        this.stateList = res.info.stateList || [];
-                        this.resultList = res.info.resultScoreList || [];
-                        // this.resultList = res.info.resultList || [];
-
-                        this.getDataWayA.data = res.info.algorithmScoreList;
+            this.$axios({
+                method: "post",
+                url: this.$api.workManagement.selectProjectDetailsById,
+                data: {
+                    id: this.id,
+                    projectType: this.projectType,
+                },
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    this.info = res.info;
+                    this.configList.camera = res.info.sensorCameraList || [];
+                    this.configList.ogt = res.info.sensorOgtList || [];
+                    this.configList.lidar = res.info.sensorLidarList || [];
+                    this.configList.gps = res.info.sensorGpsList || [];
+
+                    this.modelImgSrc = this.getImgUrl(res.info.vehicleTopView);
+
+                    if (this.info.nowRunState === "30") {
+                        this.downImgSrc = require("@/assets/common/image/others/hasDoc.png");
                     } else {
-                        this.$message.error(res.message || "获取信息失败");
+                        this.downImgSrc = require("@/assets/common/image/others/noDoc.png");
                     }
-                });
-            }
+
+                    this.stateList = res.info.stateList || [];
+                    this.resultList = res.info.resultScoreList || [];
+
+                    this.getDataWayA.data = res.info.algorithmScoreList;
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
         }
     },
 };
@@ -493,6 +492,10 @@ export default {
         }
     }
 
+    .scorePanel {
+        margin-bottom: 25px;
+    }
+
     .topPanel {
         .box {
             flex: 1;

+ 2 - 1
src/views/workManagement/taskInfo.vue

@@ -226,7 +226,6 @@ export default {
     components: { tableList, lineChartTaskInfo },
     data() {
         return {
-            // id: "",
             info: {},
             columns: [
                 {
@@ -324,6 +323,7 @@ export default {
     mounted() {
         let taskId = this.$route.query.taskId;
         let id = this.$route.query.id;
+        let projectType = this.$route.query.projectType || "1";
 
         if (taskId && id) {
             let id = this.$route.query.id;
@@ -334,6 +334,7 @@ export default {
                 data: {
                     id,
                     taskId,
+                    projectType,
                 },
             }).then((res) => {
                 if (res.code == 200 && res.info) {

+ 6 - 4
vue.config.js

@@ -89,11 +89,12 @@ module.exports = {
                 // target: 'http://10.12.10.70/simulation',
                 // target: 'http://10.12.10.70:7001', // 登录
                 // target: 'http://10.12.10.73:7003',  // 王志强
-                // target: 'http://10.12.10.70', // windowstest
+                target: 'http://10.12.10.70', // windowstest
                 // target: 'http://10.12.10.87:8001',  // 赵艳
                 // target: 'http://10.12.10.72:8001',  // 王晓峰
                 // target: 'http://192.168.30.75',  // gq
-                target: 'http://47.94.105.148',  // aliyun
+                // target: 'http://47.94.105.148',  // aliyun
+                // target: 'http://47.93.217.159',  // aliyun-dev
                 // target: 'http://10.12.10.74:8001',
                 changeOrigin: true,
                 secure: false, // 如果是https接口,需要配置这个参数
@@ -106,9 +107,10 @@ module.exports = {
                 // target: 'http://10.12.10.88:7003', // 王耀栋
                 // target: 'http://10.12.10.72:7003',  // 王晓峰
                 // target: 'http://10.12.10.87:7003',  // 赵艳
-                // target: 'http://10.12.10.70',  // windowstest
+                target: 'http://10.12.10.70',  // windowstest
                 // target: 'http://192.168.30.75',  // gq
-                target: 'http://47.94.105.148',  // aliyun
+                // target: 'http://47.94.105.148',  // aliyun
+                // target: 'http://47.93.217.159',  // aliyun-dev
                 // target: 'http://10.12.10.74:7003', // 孟令鑫
                 changeOrigin: true,
                 secure: false, // 如果是https接口,需要配置这个参数