剧本接口调整(预览与 删除剧本开始执行接口)

This commit is contained in:
joylink_cuiweidong 2020-07-03 16:29:40 +08:00
parent ab94e1f981
commit 3ae8582f05
2 changed files with 16 additions and 15 deletions

View File

@ -27,6 +27,14 @@ export function setFailureModeNew(data, group) {
});
}
/** 获取仿真待触发的故障列表*/
export function getSimulationFaultRules(group) {
return request({
url: `/simulation/${group}/faultMode/faultRule`,
method: 'get'
});
}
// 创建故障规则(新版)
export function addFailureRule(data) {
return request({
@ -345,14 +353,6 @@ export function selectScriptMembers(group, data) {
});
}
/** 剧本开始执行(新版) */
export function scriptExecuteNew(group) {
return request({
url: `/api/scriptExecute/${group}`,
method: 'put'
});
}
/** 选择剧本演出成员角色 (新版地图)*/
export function selectScriptMembersNew(group, data) {
return request({

View File

@ -14,12 +14,12 @@
<el-button v-if="isDemon && !isDesignPlatform && !isScheduling && !dataError" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<el-button v-if="notScript && runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!runing && notScript && !dataError" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="mode==OperateMode.FAULT && !dataError" size="small" type="danger" @click="setFault">{{ $t('display.schema.faultSetting') }}</el-button>
<el-button v-if="mode==OperateMode.FAULT && !dataError" size="small" type="danger" @click="setFault">自动故障设置</el-button>
</el-button-group>
<el-radio-group v-if="!isScheduling && !dataError" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('display.schema.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('display.schema.faultOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">故障模式</el-radio-button>
</el-radio-group>
</div>
<fault-choose v-if="isDemon || isScript" ref="faultChoose" :group="group" :offset="offset" />
@ -39,7 +39,7 @@ import { OperateMode } from '@/scripts/ConstDic';
// import { getStationList } from '@/api/runplan';
import { getByGroupStationList } from '@/api/jmap/map';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import { getEveryDayRunPlanNew, loadScriptNew, scriptExecuteNew } from '@/api/simulation';
import { getEveryDayRunPlanNew, loadScriptNew } from '@/api/simulation';
import Vue from 'vue';
//
@ -120,6 +120,10 @@ export default {
},
isLocalStation() {
return this.$store.state.training.prdType === '01';
},
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch: {
@ -201,6 +205,7 @@ export default {
async selectQuest(row, id, mapLocation, roleName) {
try {
let res;
debugger;
if (this.isDesignPlatform) {
res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
} else {
@ -212,10 +217,6 @@ export default {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
scriptExecuteNew(this.group).then(data=>{
}).catch(error=>{
console.log(error);
});
}
this.$emit('selectQuest', row);
} catch (error) {