From dc930dae126a7ef1c33f6dbd4694d1c16b29f77f Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 28 Sep 2020 21:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/drts/scene/modify.vue | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/views/drts/scene/modify.vue b/src/views/drts/scene/modify.vue index 0d5e634d0..9493a9522 100644 --- a/src/views/drts/scene/modify.vue +++ b/src/views/drts/scene/modify.vue @@ -182,22 +182,24 @@ export default { this.formModel.disposalProcesses = row.disposalProcesses; this.formModel.operationScore = row.operationScore; this.formModel.scriptId = row.scriptId; - getCompetitionPracticalSceneById(row.id).then(response=>{ - const commandEvaluationRuleVOs = {}; - response.data.commandEvaluationRuleVOs.forEach(data=>{ - commandEvaluationRuleVOs[data.actionId] = data; - }); - const stepVOs = {}; - response.data.stepVOs.forEach(data=>{ - stepVOs[data.startActionId] = data; - this.startArray.push(data.startActionId); - this.endArray.push(data.endActionId); - }); - this.commandEvaluationRuleVOs = commandEvaluationRuleVOs; - this.stepVOs = stepVOs; - }); getScriptByIdNew(row.scriptId).then(res=>{ this.actionList = res.data.actionList; + getCompetitionPracticalSceneById(row.id).then(response=>{ + const commandEvaluationRuleVOs = {}; + response.data.commandEvaluationRuleVOs.forEach(data=>{ + commandEvaluationRuleVOs[data.actionId] = data; + }); + const stepVOs = {}; + response.data.stepVOs.forEach(data=>{ + stepVOs[data.startActionId] = data; + const dataIndex = this.actionList.findIndex((value, index, arr)=>{ return value.id == data.startActionId; }); + const dataIndex1 = this.actionList.findIndex((value, index, arr)=>{ return value.id == data.endActionId; }); + this.startArray.push(dataIndex); + this.endArray.push(dataIndex1); + }); + this.commandEvaluationRuleVOs = commandEvaluationRuleVOs; + this.stepVOs = stepVOs; + }); // 加载地图数据 getPublishMapDetailById(res.data.mapId).then(resp => { this.$store.dispatch('map/setMapData', resp.data);