zhangliang2 преди 3 години
родител
ревизия
d1e993f348

+ 2 - 0
src/api/index.js

@@ -2,10 +2,12 @@ import Vue from "vue";
 
 import common from './common.js'
 import sceneLibrary from './sceneLibrary.js'
+import workManagement from './workManagement.js'
 
 const api = {
     common,
     sceneLibrary,
+    workManagement
 }
 
 export default api;

+ 15 - 3
src/api/workManagement.js

@@ -1,9 +1,21 @@
 const basePart = '/simulation/resource/server';
 
-const addOrUpdateProject = basePart + '/simulationProject/addOrUpdateProject'; // 创建手动运行项目
+const addOrUpdateProject = basePart + '/simulationProject/addOrUpdateProject'; // 创建或保存手动运行项目详情
+const selectProjectById = basePart + '/simulationProject/selectProjectById'; // 查询手动运行项目详情
+const selectDropDownByType = basePart + '/simulationProject/selectDropDownByType'; // 手动运行项目详情中的下拉列表
+const selectMaxParallelism = basePart + '/simulationProject/selectMaxParallelism'; // 手动运行项目详情中获取人员可用并行数
+const updateProjectNowRunState = basePart + '/simulationProject/updateProjectNowRunState'; // 手动运行项目详情中修改工作运行状态
 
+const selectProject = basePart + '/simulationProject/selectProject'; // 手动运行项目列表
+const deleteProjectByids = basePart + '/simulationProject/deleteProjectByids'; // 删除手动运行项目
 
 export default {
-    addOrUpdateProject
-}
+    addOrUpdateProject,
+    selectProjectById,
+    selectDropDownByType,
+    selectMaxParallelism,
+    updateProjectNowRunState,
 
+    selectProject,
+    deleteProjectByids
+}

+ 44 - 30
src/assets/common/css/theme.less

@@ -362,39 +362,41 @@
     border-radius: 3px;
 }
 
-.el-tabs {
-    width: 285px;
-    margin: 45px 40px 15px;
-    color: @themeColor;
-
-    .el-tabs__content {
-        display: none;
-    }
+.myTabsBox {
+    .el-tabs {
+        width: 285px;
+        margin: 45px 40px 15px;
+        color: @themeColor;
 
-    .el-tabs__nav-scroll {
-        padding-left: 25px;
-        position: relative;
-
-        &:before {
-            content: "";
-            display: block;
-            position: absolute;
-            left: 0;
-            bottom: 0;
-            width: 25px;
-            height: 1px;
-            border-bottom: 1px solid @themeColor;
+        .el-tabs__content {
+            display: none;
         }
 
-        &:after {
-            content: "";
-            display: block;
-            position: absolute;
-            right: 0;
-            bottom: 0;
-            width: 60px;
-            height: 1px;
-            border-bottom: 1px solid @themeColor;
+        .el-tabs__nav-scroll {
+            padding-left: 25px;
+            position: relative;
+
+            &:before {
+                content: "";
+                display: block;
+                position: absolute;
+                left: 0;
+                bottom: 0;
+                width: 25px;
+                height: 1px;
+                border-bottom: 1px solid @themeColor;
+            }
+
+            &:after {
+                content: "";
+                display: block;
+                position: absolute;
+                right: 0;
+                bottom: 0;
+                width: 60px;
+                height: 1px;
+                border-bottom: 1px solid @themeColor;
+            }
         }
     }
 }
@@ -415,6 +417,18 @@
     }
 }
 
+.el-textarea {
+    height: 96px;
+}
+
+.el-range-editor.el-input__inner {
+    padding: 0 10px;
+}
+
+.el-date-editor .el-range-separator {
+    width: 6%;
+}
+
 
 
 

BIN
src/assets/common/image/sensor/._02.png


BIN
src/assets/common/image/sensor/._04.png


BIN
src/assets/common/image/sensor/._05.png


BIN
src/assets/common/image/sensor/01.png


BIN
src/assets/common/image/sensor/02.png


BIN
src/assets/common/image/sensor/03.png


BIN
src/assets/common/image/sensor/04.png


BIN
src/assets/common/image/sensor/05.png


+ 1 - 1
src/lib/util.js

@@ -36,7 +36,7 @@ Vue.prototype.$dicsListsInit = function (selectList) {
                     let dicsName = noSelectList[selectNames];
                     for (let i = 0; i < result[dicsName].length; i++) {
                         this[selectNames].push({
-                            name: result[dicsName][i].dictName,
+                            caption: result[dicsName][i].dictName,
                             code: result[dicsName][i].dictCode,
                         });
                     }

+ 29 - 43
src/views/mainPage.vue

@@ -1,17 +1,13 @@
 <template>
     <div class="mainPagePanel">
-        <div>
-            <toolbarTab
-                :isConnect="true"
-                position="top"
-                :subPageActiveName="subPageActiveName"
-                :toolbarItem="pageBtnList"
-                @toolbarClick="pageControl"
-            >
-            </toolbarTab>
+        <div class="tabsBox myTabsBox">
+            <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
+                <el-tab-pane label="系统监控" name="1"></el-tab-pane>
+                <el-tab-pane label="系统概览" name="2"></el-tab-pane>
+            </el-tabs>
         </div>
 
-        <div v-if="activitedPageNum === 1" class="tabBox">
+        <div v-if="activeName === '1'" class="tabBox">
             <div class="boxContent">
                 <div class="titlePanel">
                     <div class="titlePanelBor">硬件监控</div>
@@ -98,7 +94,7 @@
             </div>
         </div>
 
-        <div v-if="activitedPageNum === 2" class="tabBox">
+        <div v-if="activeName === '2'" class="tabBox">
             <div class="boxContent">
                 <div class="titlePanel">
                     <div class="titlePanelBor">数据橄榄</div>
@@ -135,7 +131,6 @@
                 <div>
                     <el-tabs
                         v-model="activitedPageNumA"
-                        type="card"
                         @tab-click="pageControlA"
                     >
                         <el-tab-pane label="运行项目" name="1">
@@ -197,30 +192,9 @@ export default {
     },
     data() {
         return {
-            activitedPageNum: 1,
-            subPageActiveName: 1,
+            activeName: "1",
             activitedPageNumA: "1",
             subPageActiveNameA: 1,
-            pageBtnList: [
-                {
-                    type: "primary",
-                    title: "系统监控",
-                    key: "all",
-                    fromId: 1,
-                    method: "showAll",
-                    plain: true,
-                    disabled: false,
-                },
-                {
-                    type: "primary",
-                    title: "系统概览",
-                    key: "notRead",
-                    fromId: 2,
-                    method: "showNotRead",
-                    plain: true,
-                    disabled: false,
-                },
-            ],
             pageBtnListA: [
                 {
                     type: "primary",
@@ -383,7 +357,7 @@ export default {
 
     methods: {
         pageControl(data) {
-            this.activitedPageNum = data.fromId;
+            this.activeName = data.name;
         },
         pageControlA(data) {
             this.activitedPageNumA = data.name;
@@ -406,6 +380,19 @@ export default {
         padding: 30px;
     }
 
+    .myTabsBox {
+        /deep/ .el-tabs {
+            width: auto;
+            margin: 0;
+
+            .el-tabs__nav-scroll {
+                &:after {
+                    width: 100%;
+                }
+            }
+        }
+    }
+
     .boxContent {
         padding-bottom: 40px;
 
@@ -531,15 +518,14 @@ export default {
             > div {
                 flex: 1;
                 width: 30%;
-
             }
-                .title {
-                    padding-top: 24px;
-                    padding-bottom: 24px;
-                    text-align: center;
-                    font-size: 18px;
-                    font-weight: bold;
-                }
+            .title {
+                padding-top: 24px;
+                padding-bottom: 24px;
+                text-align: center;
+                font-size: 18px;
+                font-weight: bold;
+            }
 
             .shadowBoxB {
                 margin: 0 50px;

+ 2 - 0
src/views/sceneLibrary/gradingRule.vue

@@ -140,6 +140,8 @@ export default {
                 }).then((res) => {
                     if (res.code == 200 && res.info) {
                         this.form = res.info;
+                    } else {
+                        this.$message.error(res.message || "获取信息失败");
                     }
                 });
             }

+ 15 - 22
src/views/sceneLibrary/gradingRulesList.vue

@@ -55,7 +55,7 @@
             </template>
         </search-layout>
 
-        <div class="tabsBox">
+        <div class="tabsBox myTabsBox">
             <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
                 <el-tab-pane label="公有" name="1"></el-tab-pane>
                 <el-tab-pane label="私有" name="2"></el-tab-pane>
@@ -63,7 +63,7 @@
             <el-button
                 class="addBtn"
                 icon="el-icon-circle-plus-outline"
-                @click="addConfig"
+                @click="addOne"
                 type="primary"
                 :disabled="activeName === '1'"
                 >新增</el-button
@@ -134,7 +134,7 @@ export default {
                 ruleName: "", //规则名称
                 ruleDescription: "", //规则描述
                 yearMin: "", // 开始时间
-                yearMax: "" // 结束时间
+                yearMax: "", // 结束时间
             },
             searchDate: "", // 创建时间
             columns: [
@@ -160,7 +160,7 @@ export default {
                     label: "操作",
                     prop: "cgInfos",
                     template: true,
-                }
+                },
             ],
             pagination: {
                 //分页使用
@@ -168,7 +168,7 @@ export default {
                 pageSize: 10,
                 position: "right",
                 pageSizes: [10, 30, 50, 100, 200],
-                layout: "sizes, total, prev, pager, next, jumper"
+                layout: "sizes, total, prev, pager, next, jumper",
             },
             getDataWay: {
                 //加载表格数据
@@ -179,9 +179,9 @@ export default {
                 param: {
                     packageId: "11111111",
                     share: "1",
-                }
+                },
             },
-            dialogVisible: false
+            dialogVisible: false,
         };
     },
     methods: {
@@ -200,7 +200,7 @@ export default {
                 ruleDescription: this.searchParams.ruleDescription,
                 yearMin: this.searchParams.yearMin,
                 yearMax: this.searchParams.yearMax,
-                share: this.activeName === "1" ? "1" : "0"
+                share: this.activeName === "1" ? "1" : "0",
             };
             this.refreshList(pageMap);
         },
@@ -216,7 +216,7 @@ export default {
                 ruleName: "",
                 ruleDescription: "",
                 yearMin: "",
-                yearMax: ""
+                yearMax: "",
             };
             this.searchDate = "";
             this.doSearch();
@@ -228,7 +228,7 @@ export default {
             this.activeName = data.name;
             this.doSearch();
         },
-        addConfig() {
+        addOne() {
             this.$router.push({ path: "/gradingRule" });
         },
         shareRow(row) {
@@ -241,7 +241,7 @@ export default {
                     method: "post",
                     url: this.$api.sceneLibrary.fxScoringRules,
                     data: {
-                        rulesId: row.rulesId
+                        rulesId: row.rulesId,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -258,12 +258,12 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
                 type: "warning",
-            }).then((e) => {
+            }).then(() => {
                 this.$axios({
                     method: "post",
                     url: this.$api.sceneLibrary.deleteScoringRules,
                     data: {
-                        rulesId: row.rulesId
+                        rulesId: row.rulesId,
                     },
                 }).then((res) => {
                     if (res.code == 200) {
@@ -289,8 +289,8 @@ export default {
                     },
                 },
             });
-        }
-    }
+        },
+    },
 
     // mounted() {}
 };
@@ -307,11 +307,4 @@ export default {
         right: 40px;
     }
 }
-
-.el-range-editor.el-input__inner {
-    padding: 0 10px;
-}
-/deep/ .el-date-editor .el-range-separator {
-    width: 6%;
-}
 </style>

+ 2 - 2
src/views/sceneLibrary/naturalDrivingScenarioList.vue

@@ -154,7 +154,7 @@ export default {
             searchParams: {
                 //搜索参数
                 id: "", //ID
-                naturalEnvironment: "", //车辆名称
+                naturalEnvironment: [], //车辆名称
                 clientOrgName1: "", //配置名称
                 clientOrgName2: "", //配置描述
                 status: "",
@@ -227,7 +227,7 @@ export default {
         },
         doReset() {
             this.searchParams = {
-                naturalEnvironment: "",
+                naturalEnvironment: [],
                 regulationType: [],
                 standardType: "",
             };

+ 5 - 12
src/views/sceneLibrary/scenarioTestPackageManagementList.vue

@@ -43,7 +43,7 @@
             </template>
         </search-layout>
 
-        <div class="tabsBox">
+        <div class="tabsBox myTabsBox">
             <el-tabs v-model="activeName" type="card" @tab-click="pageControl">
                 <el-tab-pane label="公有" name="1"></el-tab-pane>
                 <el-tab-pane label="私有" name="2"></el-tab-pane>
@@ -149,7 +149,7 @@ export default {
                 // firstRequest: false,
                 data: this.$api.sceneLibrary.queryScenePackageList,
                 param: {
-                    share: "1"
+                    share: "1",
                 },
             },
         };
@@ -246,10 +246,10 @@ export default {
                 query: {
                     formData: {
                         packageId: row.packageId
-                    }
-                }
+                    },
+                },
             });
-        }
+        },
     },
     // created() {},
 };
@@ -266,11 +266,4 @@ export default {
         right: 40px;
     }
 }
-
-.el-range-editor.el-input__inner {
-    padding: 0 10px;
-}
-/deep/ .el-date-editor .el-range-separator {
-    width: 6%;
-}
 </style>

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

@@ -17,7 +17,7 @@
                 <el-select v-model="searchParams.regulationType" multiple>
                     <el-option
                         v-for="item in regulationTypeList"
-                        :label="item.name"
+                        :label="item.caption"
                         :value="item.code"
                         :key="item.code"
                     ></el-option>

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

@@ -103,6 +103,7 @@
             :columns="columns"
             :getDataWay="getDataWay"
             :pagination="pagination"
+            index
         >
             <el-table-column label="标签" slot="asd" align="center">
                 <template>
@@ -169,10 +170,6 @@ export default {
             conflictTypeList: [],
             columns: [
                 //表格列
-                {
-                    label: "编号",
-                    prop: "accidentId",
-                },
                 {
                     label: "场景名称",
                     prop: "sceneName",

+ 242 - 53
src/views/workManagement/manualRunProjectDetail.vue

@@ -8,75 +8,77 @@
             class="flexBox"
         >
             <div class="formItemBox">
-                <el-form-item label="项目名称:" prop="name">
+                <el-form-item label="项目名称:" prop="projectName">
                     <el-input
                         placeholder="请输入"
                         maxlength="30"
-                        v-autoTrim="{ obj: form, key: 'name' }"
-                        v-model="form.name"
+                        v-autoTrim="{ obj: form, key: 'projectName' }"
+                        v-model="form.projectName"
                     >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="项目描述:" prop="des">
+                <el-form-item label="项目描述:" prop="projectDescribe">
                     <el-input
+                        type="textarea"
+                        :autosize="{ minRows: 4, maxRows: 4 }"
                         placeholder="请输入"
-                        maxlength="100"
-                        v-autoTrim="{ obj: form, key: 'name' }"
-                        v-model="form.name"
+                        maxlength="300"
+                        v-autoTrim="{ obj: form, key: 'projectDescribe' }"
+                        v-model="form.projectDescribe"
                     >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="选择算法:" prop="x">
-                    <el-select v-model="form.des">
+                <el-form-item label="选择算法:" prop="algorithm">
+                    <el-select v-model="form.algorithm">
                         <el-option
-                            v-for="item in list"
-                            :label="item.caption"
-                            :value="item.code"
-                            :key="item.code"
+                            v-for="item in algorithmList"
+                            :label="item.name"
+                            :value="item.id"
+                            :key="item.id"
                         ></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="选择车辆:" prop="x">
-                    <el-select v-model="form.des">
+                <el-form-item label="选择车辆:" prop="vehicle">
+                    <el-select v-model="form.vehicle">
                         <el-option
-                            v-for="item in list"
-                            :label="item.caption"
-                            :value="item.code"
-                            :key="item.code"
+                            v-for="item in vehicleList"
+                            :label="item.name"
+                            :value="item.id"
+                            :key="item.id"
                         ></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="选择场景:" prop="x">
-                    <el-select v-model="form.des">
+                <el-form-item label="选择场景:" prop="scene">
+                    <el-select v-model="form.scene" @change="sceneSelChange">
                         <el-option
-                            v-for="item in list"
-                            :label="item.caption"
-                            :value="item.code"
-                            :key="item.code"
+                            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="x">
+                <el-form-item label="并行度:" prop="parallelism">
                     <el-input
                         placeholder="请输入"
                         maxlength="100"
-                        v-autoTrim="{ obj: form, key: 'x' }"
-                        v-model="form.x"
+                        v-autoTrim="{ obj: form, key: 'parallelism' }"
+                        v-model="form.parallelism"
                     >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="并行度:" prop="x">
+                <el-form-item label="最大仿真时间:" prop="maxSimulationTime">
                     <el-input
                         placeholder="请输入"
                         maxlength="100"
-                        v-autoTrim="{ obj: form, key: 'x' }"
-                        v-model="form.x"
+                        v-autoTrim="{ obj: form, key: 'maxSimulationTime' }"
+                        v-model="form.maxSimulationTime"
                     >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="是否选择GPU:" prop="type">
-                    <el-radio v-model="form.type" label="1">是</el-radio>
-                    <el-radio v-model="form.type" label="2">否</el-radio>
+                <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>
 
@@ -84,52 +86,235 @@
                 <div class="tip tipA">
                     (传感器1:根据车辆自动带出;传感器2:根据车辆自动带出)
                 </div>
-                <div class="tip">(场景数量:300)</div>
-                <div class="tip flexBox">
+                <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">(最多可用资源XXXX)</div>
+                </div> -->
+                <div class="tip">(最多可用资源{{ maxCount }})</div>
+                <div class="tip">(最小是5,最大是60)</div>
             </div>
         </el-form>
         <div class="btns">
-            <el-button type="primary">保存</el-button>
-            <el-button type="primary">提交</el-button>
-            <el-button type="primary">取消</el-button>
+            <el-button type="primary" @click="save()">保存</el-button>
+            <el-button
+                type="primary"
+                @click="save(true)"
+                v-if="this.$route.query.formData"
+                >另存为</el-button
+            >
+            <el-button type="primary" @click="save(false, true)"
+                >提交</el-button
+            >
+            <el-button type="primary" plain @click="cancel">取消</el-button>
         </div>
     </div>
 </template>
 
 <script>
 //import  from '';
-
+let maxCount = 0; // 用于校验
 export default {
     name: "manualRunProjectDetail", // 手动运行项目详情
     components: {},
     data() {
+        let validateNum = (rule, value, callback) => {
+            !/^(\d+)$/.test(value) && callback(new Error(rule.message));
+            if (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();
+        };
+
         return {
             form: {
-                name: "",
-                des: "",
-                x: "",
-                type: "1",
+                id: "",
+                projectName: "", // 项目名称
+                projectDescribe: "", // 项目描述
+                algorithm: "", // 选择算法
+                vehicle: "", // 选择车辆
+                scene: "", // 选择场景
+                parallelism: "", // 并行度
+                maxSimulationTime: "", // 最大仿真时间
+                isChoiceGpu: "0", // 是否选择GPU
+                nowRunState: "10", // 运行状态
             },
+            algorithmList: [],
+            vehicleList: [],
+            sceneList: [],
+            maxCount: 0, // 最多可用资源
+            sceneCount: 0, // 场景数量
             rules: {
-                name: [{ required: true, message: "请输入", trigger: "blur" }],
-                des: [{ required: true, message: "请输入", trigger: "blur" }],
-                // x: [{ required: true, message: "请输入", trigger: "blur" }],
+                projectName: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                projectDescribe: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                ],
+                algorithm: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                vehicle: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                scene: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
+                parallelism: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNum,
+                        message: "请输入不大于最多可用资源的正整数",
+                        trigger: ["blur"],
+                    },
+                ],
+                maxSimulationTime: [
+                    { required: true, message: "请输入", trigger: "blur" },
+                    {
+                        validator: validateNumA,
+                        message: "请输入不小于5且不大于60的正整数",
+                        trigger: ["blur"],
+                    },
+                ],
+                isChoiceGpu: [
+                    { required: true, message: "请选择", trigger: "change" },
+                ],
             },
-            list: [],
         };
     },
 
     computed: {},
 
-    methods: {},
+    methods: {
+        getLists() {
+            this.$axios({
+                method: "post",
+                url: this.$api.workManagement.selectDropDownByType,
+                data: {
+                    dropDownType: "",
+                },
+            }).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;
+                        }
+                    });
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
+        getMaxSimulationTime() {
+            this.$axios({
+                method: "post",
+                url: this.$api.workManagement.selectMaxParallelism,
+                data: {},
+            }).then((res) => {
+                if (res.code == 200 && res.info) {
+                    this.maxCount = maxCount = res.info;
+                } else if (res.code == 200 && res.info == 0) {
+                    this.maxCount = maxCount = 0;
+                } else {
+                    this.$message.error(res.message || "获取信息失败");
+                }
+            });
+        },
+        sceneSelChange(item) {
+            this.sceneCount = this.sceneList.find(
+                (i) => i.id === item
+            ).sceneNum;
+        },
+        save(isAdd = false, needChange = false) {
+            // isAdd是否强制新增,needChange是否需要改变状态
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    if (isAdd) {
+                        // 另存为
+                        this.form.id = "";
+                    }
 
-    // mounted() {},
+                    this.form.nowRunState = "10";
+
+                    this.$axios({
+                        method: "post",
+                        url: this.$api.workManagement.addOrUpdateProject,
+                        data: {
+                            ...this.form,
+                        },
+                    }).then((res) => {
+                        if (res.code == 200) {
+                            this.$message.success("保存成功");
+                            if (needChange) {
+                                this.stateChange();
+                            } else {
+                                this.cancel();
+                            }
+                        } else {
+                            this.$message.error(res.message || "保存失败");
+                        }
+                    });
+                }
+            });
+        },
+        cancel() {
+            this.$router.replace({ path: "/manualRunProjectList" });
+        },
+        stateChange() {
+            this.$axios({
+                method: "post",
+                url: this.$api.workManagement.updateProjectNowRunState,
+                data: {
+                    id: this.form.id,
+                    nowRunState: "20",
+                },
+            }).then((res) => {
+                if (res.code == 200) {
+                    this.$message.success("提交成功");
+                    this.cancel();
+                } else {
+                    this.$message.error(res.message || "提交失败");
+                }
+            });
+        },
+    },
+
+    mounted() {
+        /* this.getLists();
+        this.getMaxSimulationTime(); */
+
+        if (this.$route.query.formData) {
+            let id = "";
+            this.form.id = id = this.$route.query.formData.id;
+
+            if (id) {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.selectProjectById,
+                    data: {
+                        id,
+                    },
+                }).then((res) => {
+                    if (res.code == 200 && res.info) {
+                        this.form = res.info;
+                        this.getLists();
+                        this.getMaxSimulationTime();
+                    } else {
+                        this.$message.error(res.message || "获取信息失败");
+                    }
+                });
+            }
+        }
+    },
 };
 </script>
 
@@ -158,7 +343,11 @@ export default {
         }
 
         .tipA {
-            margin-top: 162px;
+            margin-top: 226px;
+        }
+
+        .tipB {
+            padding-top: 54px;
         }
 
         .tipBtnBox {

+ 166 - 47
src/views/workManagement/manualRunProjectList.vue

@@ -4,7 +4,7 @@
             <template slot="searchItem1">
                 <span class="label">项目ID</span>
                 <el-input
-                    v-model="searchParams.id"
+                    v-model="searchParams.projectId"
                     size="small"
                     clearable
                     placeholder="请输入"
@@ -15,7 +15,7 @@
             <template slot="searchItem2">
                 <span class="label">项目名称</span>
                 <el-input
-                    v-model="searchParams.clientOrgName"
+                    v-model="searchParams.projectName"
                     size="small"
                     clearable
                     placeholder="请输入"
@@ -25,9 +25,9 @@
             </template>
             <template slot="searchItem3">
                 <span class="label">进度</span>
-                <el-select v-model="searchParams.status">
+                <el-select v-model="searchParams.nowRunState">
                     <el-option
-                        v-for="item in list"
+                        v-for="item in nowRunStateList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -35,10 +35,10 @@
                 </el-select>
             </template>
             <template slot="searchItem4">
-                <span class="label">评等级</span>
-                <el-select v-model="searchParams.status">
+                <span class="label">评等级</span>
+                <el-select v-model="searchParams.evaluationLevel">
                     <el-option
-                        v-for="item in list"
+                        v-for="item in evaluationLevelList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
@@ -48,32 +48,44 @@
             <template slot="searchItem5">
                 <span class="label">创建时间</span>
                 <el-date-picker
-                    v-model="searchParams.clientOrgName1"
-                    type="date"
-                    placeholder="选择日期"
+                    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="searchItem6">
                 <span class="label">完成时间</span>
                 <el-date-picker
-                    v-model="searchParams.clientOrgName1"
-                    type="date"
-                    placeholder="选择日期"
+                    v-model="finishDate"
+                    type="daterange"
+                    format="yyyy-MM-dd"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
                 >
                 </el-date-picker>
             </template>
 
             <template slot="searchBtn1">
-                <el-button type="primary">查询</el-button>
+                <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
             <template slot="searchBtn2">
-                <el-button type="primary">重置</el-button>
+                <el-button type="primary" @click="doReset">重置</el-button>
             </template>
         </search-layout>
 
         <div class="btnsPanel">
-            <el-button type="primary" plain icon="el-icon-delete"
+            <el-button
+                type="primary"
+                plain
+                icon="el-icon-delete"
+                @click="delRows"
                 >批量删除</el-button
             >
             <el-button
@@ -90,6 +102,7 @@
             :columns="columns"
             :getDataWay="getDataWay"
             :pagination="pagination"
+            :checkedData="checkedArr"
             selection
             index
         >
@@ -111,7 +124,8 @@
                         title="停用"
                     ></i>
                     <i
-                        @click="addMarkDia(scope.row)"
+                        v-if="scope.row.nowRunState === '10'"
+                        @click="delRow(scope.row.id)"
                         class="el-icon-delete elIcon"
                         title="删除"
                     ></i>
@@ -126,7 +140,8 @@
                         title="运行"
                     ></i>
                     <i
-                        @click="addMarkDia(scope.row)"
+                        v-if="scope.row.nowRunState === '10'"
+                        @click="editRow(scope.row)"
                         class="el-icon-edit-outline elIcon"
                         title="编辑"
                     ></i>
@@ -167,42 +182,49 @@ import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
 
 export default {
-    name: "manualRunProjectList", // 手动运行项目
+    name: "manualRunProjectList", // 手动运行项目列表
     components: { searchLayout, tableList },
     data() {
         return {
             searchParams: {
                 //搜索参数
-                id: "", //ID
-                clientOrgName: "", //车辆名称
-                clientOrgName1: "", //配置名称
-                clientOrgName2: "", //配置描述
+                projectId: "", //项目ID
+                projectName: "", //项目名称
+                nowRunState: "", //进度
+                evaluationLevel: "", //测评等级
+                createStartDate: "", //创建时间起
+                createEndDate: "", //创建时间止
+                finishDateStart: "", //完成时间起
+                finishDateEnd: "", //完成时间止
             },
-            list: [],
+            nowRunStateList: [],
+            evaluationLevelList: [],
+            createDate: "",
+            finishDate: "",
             columns: [
                 {
                     label: "项目ID",
-                    prop: "id",
+                    prop: "projectId",
                 },
                 {
                     label: "项目名称",
-                    prop: "ktName",
+                    prop: "projectName",
                 },
                 {
                     label: "算法名称",
-                    prop: "jbSource",
+                    prop: "algorithm",
                 },
                 {
                     label: "创建时间",
-                    prop: "jbSource",
+                    prop: "createTimeFmt",
                 },
                 {
                     label: "进度",
-                    prop: "startDateStr",
+                    prop: "nowRunStateDict",
                 },
                 {
-                    label: "评等级",
-                    prop: "jbSource",
+                    label: "评等级",
+                    prop: "evaluationLevelDict",
                 },
                 // {
                 //     label: "停/启用",
@@ -225,32 +247,124 @@ export default {
             },
             getDataWay: {
                 //加载表格数据
-                dataType: "data",
+                dataType: "url",
                 type: "post",
-                firstRequest: false,
-                data: [
-                    {
-                        id: 1,
-                        ktName: "kjdhfkjsdhfkjsjhdfksdjhfkhwoieyrhfisdhfksjhdf",
-                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
-                        asd: true,
-                    },
-                    { id: 2, asd: true },
-                    { id: 3, asd: true },
-                    { id: 4, asd: true },
-                    { id: 5, asd: true },
-                    { id: 6, asd: true },
-                ],
+                // firstRequest: false,
+                data: this.$api.workManagement.selectProject,
                 param: {},
             },
+            checkedArr: [],
             downType: [],
             dialogVisible: false,
         };
     },
     methods: {
+        doSearch() {
+            if (this.createDate) {
+                this.searchParams.createStartDate = `${this.createDate[0]}`;
+                this.searchParams.createEndDate = `${this.createDate[1]}`;
+            } else {
+                this.searchParams.createStartDate = "";
+                this.searchParams.createEndDate = "";
+            }
+
+            if (this.finishDate) {
+                this.searchParams.finishDateStart = `${this.finishDate[0]}`;
+                this.searchParams.finishDateEnd = `${this.finishDate[1]}`;
+            } else {
+                this.searchParams.finishDateStart = "";
+                this.searchParams.finishDateEnd = "";
+            }
+
+            let pageMap = {
+                projectId: this.searchParams.projectId,
+                projectName: this.searchParams.projectName,
+                nowRunState: this.searchParams.nowRunState,
+                evaluationLevel: this.searchParams.evaluationLevel,
+                createStartDate: this.searchParams.createStartDate,
+                createEndDate: this.searchParams.createEndDate,
+                finishDateStart: this.searchParams.finishDateStart,
+                finishDateEnd: this.searchParams.finishDateEnd,
+            };
+            this.refreshList(pageMap);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                projectId: "",
+                projectName: "",
+                nowRunState: "",
+                evaluationLevel: "",
+                createStartDate: "",
+                createEndDate: "",
+                finishDateStart: "",
+                finishDateEnd: "",
+            };
+            this.createDate = "";
+            this.finishDate = "";
+            this.doSearch();
+        },
         addOne() {
             this.$router.push({ path: "/manualRunProjectDetail" });
         },
+        editRow(row) {
+            this.$router.push({
+                path: "/manualRunProjectDetail",
+                query: {
+                    formData: {
+                        id: row.id,
+                    },
+                },
+            });
+        },
+        delRow(ids) {
+            this.$confirm("确认是否删除?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$axios({
+                    method: "post",
+                    url: this.$api.workManagement.deleteProjectByids,
+                    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.nowRunState != "10") {
+                    this.$message.error("存在已执行数据,请重新选择");
+                    return;
+                }
+                arr.push(row.id);
+            }
+
+            this.delRow(arr.join(","));
+        },
+
         viewRow() {
             this.$router.push({ path: "/projectInfo" });
         },
@@ -260,7 +374,12 @@ export default {
         },
     },
 
-    // mounted() {},
+    async mounted() {
+        await this.$dicsListsInit({
+            nowRunStateList: "projectRunState",
+            evaluationLevelList: "evaluationLevel",
+        });
+    },
 };
 </script>
 

+ 2 - 1
vue.config.js

@@ -89,7 +89,8 @@ module.exports = {
                 }
             },
             '/simulation/resource/server': {
-                target: 'http://10.15.12.73:7003',  // 王志强
+                // target: 'http://10.15.12.73:7003',  // 王志强
+                target: 'http://10.15.12.88:7003',  // 王耀栋
                 changeOrigin: true,
                 secure: false, // 如果是https接口,需要配置这个参数
                 pathRewrite: {