浏览代码

自动运行完成

zhangliang2 3 年之前
父节点
当前提交
82b2754fd6

+ 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
 }

+ 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")
+    },
 ]

+ 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) {

+ 4 - 4
vue.config.js

@@ -89,11 +89,11 @@ 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://10.12.10.74:8001',
                 changeOrigin: true,
                 secure: false, // 如果是https接口,需要配置这个参数
@@ -103,12 +103,12 @@ module.exports = {
             },
             '/simulation/resource/server': {
                 // target: 'http://10.12.10.73:7003', // 王志强
-                // target: 'http://10.12.10.88:7003', // 王耀栋
+                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://192.168.30.75',  // gq
-                target: 'http://47.94.105.148',  // aliyun
+                // target: 'http://47.94.105.148',  // aliyun
                 // target: 'http://10.12.10.74:7003', // 孟令鑫
                 changeOrigin: true,
                 secure: false, // 如果是https接口,需要配置这个参数