Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
9d0b565142
@ -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({
|
||||
|
@ -105,5 +105,8 @@ export default {
|
||||
checkTheValidityFirst: 'Please check the validity first!',
|
||||
permissionAtLeast:'At least one of the number of permissions is more than 0',
|
||||
permissionTimeError:'End time must be more than start time',
|
||||
getRealDeviceFailed: 'Failed to get real device failed'
|
||||
getRealDeviceFailed: 'Failed to get real device failed',
|
||||
mapDataError: 'Map data error',
|
||||
runningChartDataError: 'Running chart data error',
|
||||
runningChartIsNotLoaded: 'Running chart is not loaded'
|
||||
};
|
||||
|
@ -105,5 +105,8 @@ export default {
|
||||
checkTheValidityFirst: '请先进行有效性检查!',
|
||||
permissionAtLeast:'至少有一种权限的数量大于0',
|
||||
permissionTimeError:'结束时间必须大于开始时间',
|
||||
getRealDeviceFailed: '获取真实设备失败!'
|
||||
getRealDeviceFailed: '获取真实设备失败!',
|
||||
mapDataError: '地图数据错误',
|
||||
runningChartDataError: '运行图数据错误',
|
||||
runningChartIsNotLoaded: '运行图未加载'
|
||||
};
|
||||
|
@ -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 {
|
||||
|
@ -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');
|
||||
},
|
||||
// 仿真错误时,被动退出时调用
|
||||
|
@ -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');
|
||||
},
|
||||
// 仿真错误时,被动退出时调用
|
||||
|
@ -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,13 +162,23 @@ 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(error => {
|
||||
this.isDisable = false;
|
||||
this.$messageBox(error.message + ',' + this.$t('display.demon.startSimulationFail'));
|
||||
if (error.code == '5001') {
|
||||
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5002') {
|
||||
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5003') {
|
||||
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
|
||||
}
|
||||
});
|
||||
},
|
||||
end() {
|
||||
@ -190,7 +204,7 @@ export default {
|
||||
});
|
||||
},
|
||||
async back() {
|
||||
await runDiagramQuit(this.group);
|
||||
await clearSimulation(this.group);
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
|
@ -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,23 @@ 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('开始仿真失败,请返回重试');
|
||||
if (error.code == '5001') {
|
||||
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5002') {
|
||||
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5003') {
|
||||
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
|
||||
}
|
||||
});
|
||||
},
|
||||
end() {
|
||||
|
@ -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,23 @@ 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'));
|
||||
if (error.code == '5001') {
|
||||
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5002') {
|
||||
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5003') {
|
||||
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
|
||||
}
|
||||
});
|
||||
},
|
||||
end() {
|
||||
|
Loading…
Reference in New Issue
Block a user