仿真接口调整

This commit is contained in:
fan 2020-01-17 11:31:53 +08:00
parent 69b11f98e8
commit 269cef7673
7 changed files with 50 additions and 18 deletions

View File

@ -461,6 +461,22 @@ export function getEveryDayRunPlanNew(group) {
});
}
/** 新版地图按计划行车 */
export function ranAsPlan(data, group) {
return request({
url: `/simulation/${group}/ranAsPlan`,
method: 'post',
data: data
});
}
/** 新版地图清理仿真 */
export function clearSimulation(group) {
return request({
url: `/simulation/${group}/clear`,
method: 'delete'
});
}
/** 查询进路信息*/
export function querySignalStatus(group, params) {
return request({

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
} else {

View File

@ -58,7 +58,7 @@ import AddQuest from './demon/addQuest';
import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex';
import { setGoodsTryUse } from '@/api/management/goods';
import { runDiagramQuit, getSimulationInfo } from '@/api/simulation';
import { clearSimulation, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadMapDataById } from '@/utils/loaddata';
@ -426,7 +426,7 @@ export default {
// 仿
async quit() {
await runDiagramQuit(this.group);
await clearSimulation(this.group);
await this.$store.dispatch('training/over');
},
// 仿退

View File

@ -57,7 +57,7 @@ import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex';
import { getTrainingDetail, getTrainingStepsDetail } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods';
import { runDiagramQuit, loadScript, getSimulationInfoNew } from '@/api/simulation';
import { clearSimulation, loadScript, getSimulationInfoNew } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
@ -428,7 +428,7 @@ export default {
// 仿
async quit() {
await runDiagramQuit(this.group);
await clearSimulation(this.group);
await this.$store.dispatch('training/over');
},
// 仿退

View File

@ -32,10 +32,11 @@
import SetTime from './demon/setTime';
import { Notification } from 'element-ui';
import { getGoodsTryUse } from '@/api/management/goods';
import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
import { ranAsPlan, runDiagramOver, clearSimulation, runDiagramGetTime } from '@/api/simulation';
import { PermissionType } from '@/scripts/ConstDic';
import { getCountTime } from '@/utils/index';
import { runDiagramIsStart, runDiagramQuit, quitScript } from '@/api/simulation';
import { mapGetters } from 'vuex';
// import { timeFormat } from '@/utils/date';
// import { getToken } from '@/utils/auth';
@ -81,6 +82,9 @@ export default {
};
},
computed: {
...mapGetters('map', [
'trainList'
]),
isShowQuest() {
return this.questId;
},
@ -158,7 +162,11 @@ export default {
},
start(model) {
this.isDisable = true;
runDiagramStart(model, this.group).then(res => {
const data = {
time: model.initTime,
loadNumber:this.trainList.length
};
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
});
@ -190,7 +198,7 @@ export default {
});
},
async back() {
await runDiagramQuit(this.group);
await clearSimulation(this.group);
this.$store.dispatch('training/over').then(() => {
history.go(-1);
Notification.closeAll();

View File

@ -20,7 +20,7 @@
<script>
import SetTime from './demon/setTime';
import { Notification } from 'element-ui';
import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
import { ranAsPlan, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
import { runDiagramIsStart } from '@/api/simulation';
import { timeFormat } from '@/utils/date';
import { EventBus } from '@/scripts/event-bus';
@ -76,7 +76,7 @@ export default {
methods: {
async initLoadPage() {
try {
const resp = '';//await runDiagramIsStart(this.group);
const resp = '';// await runDiagramIsStart(this.group);
if (resp && resp.data) {
this.isDisable = true;
this.$store.dispatch('training/simulationStart');
@ -98,13 +98,17 @@ export default {
},
start(model) {
this.isDisable = true;
runDiagramStart(model, this.group).then(res => {
const data = {
time: model.initTime,
loadNumber:this.trainList.length
};
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
});
}).catch(() => {
}).catch((error) => {
this.isDisable = false;
this.$messageBox('开始仿真失败请返回重试');
this.$messageBox(error.message + '' + this.$t('display.demon.startSimulationFail'));
});
},
end() {

View File

@ -20,7 +20,7 @@
<script>
import QrCode from '@/components/QrCode';
import SetTime from '@/views/display/demon/setTime';
import { runDiagramIsStart, runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
import { runDiagramIsStart, ranAsPlan, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { timeFormat } from '@/utils/date';
@ -287,13 +287,17 @@ export default {
},
start(model) {
this.isDisable = true;
runDiagramStart(model, this.group).then(res => {
const data = {
time: model.initTime,
loadNumber:this.trainList.length
};
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
});
}).catch(() => {
}).catch((error) => {
this.isDisable = false;
this.$messageBox(this.$t('error.startSimulationFailed'));
this.$messageBox(error.message + '' + this.$t('display.demon.startSimulationFail'));
});
},
end() {