竞赛系统 场景加载 已经开始演出接口代码调整

This commit is contained in:
joylink_cuiweidong 2020-10-09 14:37:59 +08:00
parent c701ca11b2
commit 68921f80ff
3 changed files with 25 additions and 8 deletions

View File

@ -318,3 +318,19 @@ export function updateCompetitionPracticalStep(data) {
data
});
}
/** 加载场景 */
export function loadCompetitionPracticalScene(group, id) {
return request({
url: `/api/v1/competitionPractical/load/${group}/${id}`,
method: 'PUT'
});
}
/** 场景开始演出 */
export function competitionPracticalSceneStart(group, memberId, mode) {
return request({
url: `/api/v1/competitionPractical/start/${group}?memberId=${memberId}&mode=${mode}`,
method: 'PUT'
});
}

View File

@ -98,7 +98,7 @@ import SelectRole from '@/views/newMap/displayNew/scriptDisplay/component/select
import { setGoodsTryUse } from '@/api/management/goods';
// import {loadScriptNewMode } from '@/api/simulation';
import {endScriptTraining } from '@/api/script';
import {loadDraftScriptNewMode } from '@/api/designPlatform';
import {competitionPracticalSceneStart} from '@/api/competition';
import { launchFullscreen } from '@/utils/screen';
import { createSimulationNew } from '@/api/simulation';
import Vue from 'vue';
@ -506,7 +506,7 @@ export default {
},
runScriptMode(memberId) {
// this.$store.dispatch('scriptRecord/updateBgSet', true);
loadDraftScriptNewMode(memberId, this.group, this.scriptMode)
competitionPracticalSceneStart(this.group, memberId, this.scriptMode)
.then(res=>{
this.isScriptRun = true;
if (this.mapLocation) {

View File

@ -31,7 +31,8 @@
</template>
<script>
import { ScriptMode } from '@/scripts/ConstDic';
import {getScriptByIdNew, loadScript } from '@/api/script';
import {getDraftScriptByGroupNew } from '@/api/script';
import {loadCompetitionPracticalScene} from '@/api/competition';
import { EventBus } from '@/scripts/event-bus';
export default {
@ -73,7 +74,7 @@ export default {
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
this.mainSceneData = [
{type: '车辆故障', scene: '列车救援'},
{type: '信号系统故障', scene: '道岔故障', id: '9'},
{type: '信号系统故障', scene: '道岔故障', id: '10'},
{type: '信号系统故障', scene: '区域控制器故障'},
{type: '信号系统故障', scene: '联锁故障'},
{type: '供电系统故障', scene: '接触轨(网)断电'},
@ -93,10 +94,10 @@ export default {
},
async handleLoad(row) {
this.row = row;
const res = await getScriptByIdNew(row.id);
if (res.code == 200) {
const response = await loadScript(this.$route.query.group, row.id);
const response = await loadCompetitionPracticalScene(this.$route.query.group, row.id);
if (response.code == 200) {
const res = await getDraftScriptByGroupNew(this.$route.query.group);
if (res.code == 200) {
const playerList = [];
EventBus.$emit('clearRunSeries');
if (res.data.memberList && res.data.memberList.length > 0) {