import request from '@/utils/request'; /** 获取故障规则列表*/ export function getFailureGenerateRules(params) { return request({ url: `/api/simulation/failureGenerateRules`, method: 'get', params: params }); } /** 设置自动故障*/ export function setFailureMode(data, group) { return request({ url: `/api/simulation/${group}/failureMode`, method: 'post', data: data }); } /** * 仿真系统按计划行车 */ export function runDiagramStart(params, group) { return request({ url: `/api/simulation/${group}/start`, method: 'put', params: params }); } /** * 仿真系统结束计划行车 */ export function runDiagramOver(group) { return request({ url: `/api/simulation/${group}/over`, method: 'put' }); } /** * 退出仿真系统 */ export function runDiagramQuit(group) { return request({ url: `/api/simulation/${group}/quit`, method: 'put' }); } /** 获取仿真系统时间*/ export function runDiagramGetTime(group) { return request({ url: `/api/simulation/${group}/systemTime`, method: 'get' }); } // 查看是否开始按计划行车 export function runDiagramIsStart(group) { return request({ url: `/api/simulation/${group}/isRunPlanStart`, method: 'get' }); } /** * 仿真系统CBTC * @param {*} mapId */ export function simulationNotify({ mapId, code }) { return request({ url: `/api/simulation/${mapId}/${code}`, method: 'get' }); } /** * 大屏系统CBTC * @param {*} mapId */ export function bitScreenNotify({ mapId }) { return request({ url: `/api/simulation/bigScreen/${mapId}`, method: 'get' }); } /** * 实训系统CBTC * @param {*} data */ export function trainingNotify({ trainingId }) { return request({ url: `/api/simulation/training/${trainingId}`, method: 'get' }); } /** * 考试系统CBTC * @param {*} data */ export function examNotify({ examId }) { return request({ url: `/api/simulation/exam/${examId}`, method: 'get' }); } /** 获取用户实训列表*/ export function getSimulationList(data) { return request({ url: `/api/simulation/stats`, method: 'get', params: data }); } /** 添加用户仿真数据*/ export function postSimulationStats(data) { return request({ url: `/api/simulation/stats`, method: 'post', data: data }); } /** 更新用户仿真数据*/ export function putSimulationStats(data) { return request({ url: `/api/simulation/${data.id}/stats`, method: 'put', data: data }); } /** 删除用户仿真数据*/ export function deleteSimulationStats(statsId) { return request({ url: `/api/simulation/${statsId}`, method: 'delete' }); } /** 获取用户鼠标左键选中的设备信息*/ export function letfMouseSelectDevice(deviceCode, group) { return request({ url: `/api/simulation/${group}/device/${deviceCode}`, method: 'get' }); } /** 获取每日运行图*/ export function getEveryDayRunPlanData(group) { return request({ url: `/api/simulation/${group}/runPlan`, method: 'get' }); } /** 生成手机同步仿真二维码*/ // export function getSimulationQrCodeUrl(group) { // return request({ // url: `/api/simulation/${group}/qrCode`, // method: 'post' // }); // } /** 录制脚本仿真*/ export function scriptRecordNotify(questId) { return request({ url: `/api/simulation/questRecord/${questId}`, method: 'get' }); } /** 保存剧本背景*/ export function saveScriptScenes(group) { return request({ url: `/api/simulation/${group}/questRecord/scenes`, method: 'post' }); } /** 保存录制任务数据*/ export function saveScriptData(group) { return request({ url: `/api/simulation/${group}/questRecord`, method: 'post' }); } /** 清除仿真剧本数据*/ export function dumpScriptData(scriptId) { return request({ url: `/api/simulation/${scriptId}/clearScriptRecord`, method: 'post' }); } /** 查询录制剧本步骤*/ export function queryScriptStep(group) { return request({ url: `/api/simulation/${group}/scriptRecordStage`, method: 'get' }); } /** 获取指定时间里可加载列车的个数*/ export function getDesignatedTimeTrainNum(params, group) { return request({ url: `/api/simulation/${group}/plan/trainNum`, method: 'get', params }); } /** 根据成员角色查询设备列表*/ export function getDevicesByRole(group, params) { return request({ url: `/api/simulation/${group}/role/devices`, method: 'get', params }); } /** 获取任务录制的成员角色列表 */ export function getMembersByGroup(group) { return request({ url: `/api/simulation/${group}/questRecord/members`, method: 'get' }); } /** 添加任务角色成员 */ export function postQuestMember(group, data) { return request({ url: `/api/simulation/${group}/questRecord/member`, method: 'post', data }); } /** 删除任务角色成员 */ export function deleteQuestMember(group, memberId) { return request({ url: `/api/simulation/${group}/questRecord/member/${memberId}`, method: 'delete' }); } // /** 添加/修改任务角色行为 */ export function postMemberBehavior(group, memberId, data) { return request({ url: `/api/simulation/${group}/questRecord/${memberId}/behavior`, method: 'post', data }); } /** 删除任务角色行为 */ export function deleteMemberBehavior(group, memberId, behaviorId) { return request({ url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`, method: 'delete' }); } /** 删除任务角色行为动作 */ export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) { return request({ url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`, method: 'delete' }); } /** 添加/修改任务角色行为动作 */ export function postMemberBehaviorAction(group, memberId, behaviorId, data) { return request({ url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`, method: 'post', data }); } /** 添加/修改任务目标条件*/ export function postTargetConditionAction(group, data) { return request({ url: `/api/simulation/${group}/questRecord/targetCondition`, method: 'post', data }); } /** 删除任务目标条件*/ export function deleteTargetConditionAction(group, tcId) { return request({ url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`, method: 'delete' }); } /** 分页查询存在的仿真 */ export function getExistingSimulation(params) { return request({ url: `/api/simulation/manage/page`, method: 'get', params }); } /** 删除存在的仿真 */ export function deleteExistingSimulation(group) { return request({ url: `/api/simulation/manage/${group}`, method: 'delete' }); } /** 根据设备类型获取设备列表 */ export function getDeviceCodeByDeviceType(group, params) { return request({ url: `/api/simulation/${group}/deviceType/devices`, method: 'get', params }); } /** 根据设备类型获取设备条件列表 */ export function getDeviceCoditionByDeviceType(params) { return request({ url: `/api/simulation/deviceType/conditions`, method: 'get', params }); } /** 获取任务录制的数据*/ export function getQuestRecord(group) { return request({ url: `/api/simulation/${group}/questRecord`, method: 'get' }); } /** 加载任务*/ export function loadQuest(questId, memberId, group) { return request({ url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`, method: 'post' }); } /** 退出任务*/ export function quitQuest(group) { return request({ url: `/api/simulation/${group}/quest`, method: 'put' }); } /** 根据group获取仿真对象*/ export function getSimulationInfo(group) { return request({ url: `/api/simulation/${group}`, method: 'get' }); } /** 获取可用的设备指令*/ export function getAvailableDeviceCommand() { return request({ url: `/api/simulation/deviceCommand/available`, method: 'get' }); } /** 保存/修改任务剧本*/ export function saveTaskScript(group, data) { return request({ url: `/api/simulation/${group}/questRecord/script`, method: 'post', data }); }