rt-sim-training-client/src/api/simulation.js

508 lines
13 KiB
JavaScript

import request from '@/utils/request';
/** 设置自动故障(新版)*/
export function setFailureModeNew(data, group) {
return request({
url: `/simulation/${group}/faultMode`,
method: 'post',
data: data
});
}
/** 取消自动故障 */
export function cancelFailureModeNew(id, group) {
return request({
url: `/simulation/${group}/faultMode/${id}`,
method: 'put'
});
}
/** 查询已设置所有的自动触发故障*/
export function getSimulationFaultRules(group) {
return request({
url: `/simulation/${group}/faultMode/faultRule`,
method: 'get'
});
}
/** 根据id删除故障规则 */
export function deleteFailureRule(id) {
return request({
url: `/api/v1/faultRule/${id}`,
method: 'delete'
});
}
/** 实训系统(新版地图) */
export function trainingNotifyNew({ trainingId }) {
return request({
url: `/simulation/training/${trainingId}`,
method: 'get'
});
}
/** 考试系统(新版地图)*/
export function examNotifyNew({ examId }) {
return request({
url: `/simulation/exam/${examId}`,
method: 'get'
});
}
/** 获取用户实训列表*/
export function getSimulationList(data) {
return request({
url: `/api/stats/simulation`,
method: 'get',
params: data
});
}
/** 添加用户仿真数据*/
export function postSimulationStats(data) {
return request({
url: `/api/stats/simulation`,
method: 'post',
data: data
});
}
/** 更新用户仿真数据*/
export function putSimulationStats(data) {
return request({
url: `/api/stats/${data.id}`,
method: 'put',
data: data
});
}
/** 删除用户仿真数据*/
export function deleteSimulationStats(statsId) {
return request({
url: `/api/stats/${statsId}`,
method: 'delete'
});
}
/** 录制脚本仿真(新版)*/
export function scriptRecordNotifyNew(scriptId) {
return request({
url: `/api/scriptSimulation/${scriptId}/scriptWrite`,
method: 'get'
});
}
/** 保存剧本背景(新版)*/
export function saveScriptScenesNew(group) {
return request({
url: `/api/scriptSimulation/${group}/saveScenes`,
method: 'put'
});
}
/** 剧本预览再次加载剧本*/
export function scriptRePreview(group) {
return request({
url: `/api/scriptSimulation/${group}/rePreview`,
method: 'put'
});
}
/** 保存录制任务数据(新版)*/
export function saveScriptDataNew(group) {
return request({
url: `/api/scriptSimulation/${group}/saveData`,
method: 'put'
});
}
/** 更新任务地图定位信息(新版)*/
export function updateMapLocationNew(group, data) {
return request({
url: `/api/scriptSimulation/${group}/mapLocation`,
method: 'put',
data
});
}
/** 清除仿真剧本数据(新版)*/
export function dumpScriptDataNew(group) {
return request({
url: `/api/scriptSimulation/${group}/reset`,
method: 'PUT'
});
}
/** 修改剧本动作(新版) */
export function modifyScriptActionNew(group, data) {
return request({
url: `/api/scriptSimulation/${group}/action/update`,
method: 'put',
data
});
}
/** 开始替换 */
export function startReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/start`,
method: 'put'
});
}
/** 确认替换 */
export function confirmReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/confirm`,
method: 'put'
});
}
/** 放弃替换 */
export function cancelReplaceBg(group) {
return request({
url: `/api/scriptSimulation/${group}/replace/cancel`,
method: 'put'
});
}
// /** 分页查询存在的仿真 */
// export function getExistingSimulation(params) {
// return request({
// url: `/manage/simulation/exists`,
// method: 'get',
// params
// });
// }
//
// /** 删除存在的仿真 */
// export function deleteExistingSimulation(group) {
// return request({
// url: `/manage/simulation/${group}`,
// method: 'delete'
// });
// }
/** 获取任务录制的所有动作(新版)*/
export function getScriptAllAction(group) {
return request({
url: `/api/scriptSimulation/${group}/allAction`,
method: 'get'
});
}
/** 加载剧本(新版) */
export function loadScriptNew(scriptId, memberId, group) {
return request({
url: `/simulation/${group}/script/${scriptId}?memberId=${memberId}`,
method: 'PUT'
});
}
/** 退出剧本(新版)*/
export function quitScriptNew(group) {
return request({
url: `/simulation/${group}/exitScript`,
method: 'put'
});
}
/** 暂停仿真 */
export function simulationPause(group) {
return request({
url: `/simulation/${group}/pause`,
method: 'PUT'
});
}
/** 恢复仿真运行并执行刚编辑的剧本动作(新版) */
export function executeScriptNew(group) {
return request({
url: `/simulation/${group}/resume`,
method: 'PUT'
});
}
/** 处理ibp盘事件 */
export function handlerIbpEvent(group, button, stationCode, buttonCode) {
return request({
url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}&buttonCode=${buttonCode}`,
method: 'put'
});
}
/** 处理ibp盘事件(按下) */
export function handleIbpPress(group, stationCode, buttonCode) {
return request({
url: `/simulation/${group}/ibp/press/${stationCode}/${buttonCode}`,
method: 'put'
});
}
/** 处理ibp盘事件(松开) */
export function handleIbpRelease(group, stationCode, buttonCode) {
return request({
url: `/simulation/${group}/ibp/release/${stationCode}/${buttonCode}`,
method: 'put'
});
}
/** 预览脚本仿真(新版)*/
export function scriptDraftRecordNotifyNew(scriptId) {
return request({
url: `/api/scriptSimulation/${scriptId}/preview`,
method: 'get'
});
}
/** 新版地图创建仿真 */
export function createSimulationNew(params) {
return request({
url: `/simulation`,
method: 'get',
params
});
}
/** 新版地图根据仿真group获取仿真基础信息 */
export function getSimulationInfoNew(group) {
return request({
url: `/simulation/${group}`,
method: 'get'
});
}
/** 新版地图根据仿真group获取仿真地图数据 */
export function getNewMapDataByGroup(group) {
return request({
url: `/simulation/${group}/mapData`,
method: 'get'
});
}
/** 新版地图根据group获取仿真运行图 */
export function getEveryDayRunPlanNew(group) {
return request({
url: `/simulation/${group}/runPlan`,
method: 'get'
});
}
/** 新版地图按计划行车 */
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 getTripNumberList(group) {
return request({
url: `/simulation/${group}/tripNumbers`,
method: 'get'
});
}
/** 根据车次号获取服务号 */
export function getServiceNumbersByTripNum(group, tripNumber) {
return request({
url: `/simulation/${group}/serviceNumber`,
method: 'get',
params: {
tripNumber: tripNumber
}
});
}
/** 根据计划时间获取此时间点可加载的最大列车数量 */
export function getLoadTrainNumber(params, group) {
return request({
url: `/simulation/${group}/loadTrainNumber`,
method: 'get',
params
});
}
/** 推出按计划行车 */
export function exitRunPlan (group) {
return request({
url: `/simulation/${group}/planOver`,
method: 'post'
});
}
/** 加载指定运行计划 */
export function simulationLoadRunPlan(group, templateId) {
return request({
url: `/simulation/${group}/load/runPlan/${templateId}`,
method: 'put'
});
}
/** 根据车次号获取列车信息 */
export function getTrainDetailBytripNumber(group, params) {
return request({
url: `/simulation/${group}/planTripInfo`,
method: 'get',
params: params
});
}
/** 根据车次号和表号获取列车信息 */
export function getTrainDetailByStNumber(group, params) {
return request({
url: `/simulation/${group}/planTripInfoBySt`,
method: 'get',
params: params
});
}
/** 获取新版综合仿真仿真成员列表 */
export function getSimulationMemberList(group) {
return request({
url: `/simulation/${group}/members`,
method: 'get'
});
}
/** 获取仿真用户信息 */
export function getSimulationUserInfo(group) {
return request({
url: `/simulation/${group}/simulationUser`,
method: 'get'
});
}
// 获取所有仿真用户
export function getAllSimulationUser(group) {
return request({
url: `/simulation/${group}/simulationUsers`,
method: 'get'
});
}
// 获取仿真全部真实设备
export function getAllSimulationList(group) {
return request({
url: `/api/simulation/${group}/realDevice/list`,
method: 'get'
});
}
// 连接仿真设备和真实设备
export function postSimulationConnectById(group, id, sdCode) {
return request({
url: `/api/simulation/${group}/realDevice/${id}/connect/${sdCode}`,
method: 'post'
});
}
// 断开仿真设备和真实设备的连接
export function putSimulationDisconnectById(group, id) {
return request({
url: `/api/simulation/${group}/realDevice/${id}/disconnect`,
method: 'put'
});
}
// 获取IBP盘初始状态
export function getIbpInitialState (group, stationCode) {
return request({
url: `/simulation/${group}/${stationCode}/ibp/status`,
method: 'get'
});
}
// 获取报警列表
export function getAlarmList(group, params) {
return request({
url: `/simulation/${group}/alarm`,
method: 'get',
params:params
});
}
// 报警确认
export function confirmAlarm(group, data) {
return request({
url: `/simulation/${group}/alarm/confirm`,
method: 'put',
data
});
}
// 获取客流数据基础信息
export function getPassengerFlowData(mapId) {
return request({
url: `/map/${mapId}/passengerFlowData`,
method: 'get'
});
}
// 仿真客流数据切换
export function changePassengerFlowData(group, passengerFlowId) {
return request({
url: `/simulation/${group}/passengerFlow/${passengerFlowId}`,
method: 'put'
});
}
// 哈尔滨线路(仿真行调工作站 获取 日志信息)
export function getLogList(group, params) {
return request({
url: `/simulation/${group}/log`,
method: 'get',
params:params
});
}
/* 宁波三排列进路到 获取路径列表 */
export function getPathListByStandCodeOrSignalCode( group, params ) {
return request({
url: `/simulation/${group}/querySectionPaths`,
method: 'get',
params
});
}
/** 查询未该列车以建立的进路 */
export function getRouteListForTrain( group, groupNumber ) {
return request({
url: `/simulation/${group}/queryEstablishedRoutes/${groupNumber}`,
method: 'get'
});
}
/** 根据group查询目的码 */
export function getSimulationDestinationList(group) {
return request({
url: `/simulation/${group}/destinationCode/list`,
method: 'get'
});
}
/** 获取PSL盘状态 */
export function getPslStatus(group, standCode) {
return request({
url: `/simulation/${group}/${standCode}/psl/status`,
method: 'get'
});
}
/** 按下PSL盘按钮
* @param {String} button
* YXJZ-允许/禁止;
* HSJC-互锁解除;
* KM-开门;
* GM-关门;
* SD-试灯;
*/
export function pressPslButton(group, standCode, button) {
return request({
url: `/simulation/${group}/${standCode}/psl/${button}`,
method: 'put'
});
}
/** 查询运行线或者列车经过的站台 */
export function getStandListByRunLineOrTrainCode(group, params) {
return request({
url: `simulation/${group}/queryStands/trainOrDestination`,
method: 'get',
params
});
}
/** 上饶列车控制 */
export function srTrainControl(group, params) {
return request({
url: `/api/sr/${group}/control`,
method: 'put',
params
});
}