修改代码

This commit is contained in:
ival 2019-11-18 14:44:01 +08:00
parent f2dd239467
commit 50e9a242e7
37 changed files with 2972 additions and 3132 deletions

View File

@ -2,74 +2,74 @@ import request from '@/utils/request';
/** 根据皮肤获取地图版本信息*/
export function getPublishMapVersion(skinCode) {
return request({
url: `/api/map/skin/${skinCode}/version`,
method: 'get'
});
return request({
url: `/api/map/skin/${skinCode}/version`,
method: 'get'
});
}
/** 根据皮肤获取发布地图详细内容*/
export function getPublishMapDetail(skinCode) {
const datad = request({
url: `/api/map/skin/${skinCode}/details`,
method: 'get'
});
return datad.then();
const datad = request({
url: `/api/map/skin/${skinCode}/details`,
method: 'get'
});
return datad.then();
}
/** 根据地图id获取地图信息*/
export function getPublishMapInfo(mapId) {
return request({
url: `/api/map/${mapId}`,
method: 'get'
});
return request({
url: `/api/map/${mapId}`,
method: 'get'
});
}
/** 获取草稿地图详细内容*/
export function getMapDetail(id) {
return request({
url: `/api/mapBuild/${id}/mapDataDetail`,
method: 'get'
});
return request({
url: `/api/mapBuild/${id}/mapDataDetail`,
method: 'get'
});
}
/** 创建地图3d数据*/
export function set3dMapData(data) {
return request({
url: `/api/mapBuild/3dMapData`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/3dMapData`,
method: 'post',
data: data
});
}
/** 通过地图id获取地图3d数据*/
export function get3dMapData(mapId) {
return request({
url: `/api/mapBuild/3dMapData/${mapId}`,
method: 'get'
});
return request({
url: `/api/mapBuild/3dMapData/${mapId}`,
method: 'get'
});
}
/** 更新地图3d数据*/
export function update3dMapData(data) {
return request({
url: `/api/mapBuild/3dMapData/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/mapBuild/3dMapData/${data.id}`,
method: 'put',
data: data
});
}
/** 获取模型资源列表*/
export function loadmap3dModel() {
return request({
url: `/api/map3dModel/all`,
method: 'get'
});
return request({
url: `/api/map3dModel/all`,
method: 'get'
});
}
export function getPublish3dMapDetail(skinCode) {
const datad = request({
url: `/api/map/${skinCode}/3dMapData`,
method: 'get'
});
return datad.then();
const datad = request({
url: `/api/map/${skinCode}/3dMapData`,
method: 'get'
});
return datad.then();
}

View File

@ -2,272 +2,272 @@ import request from '@/utils/request';
/** 获取地图树形类表*/
export function getMapTree() {
return request({
url: '/api/mapBuild/tree',
method: 'get'
});
return request({
url: '/api/mapBuild/tree',
method: 'get'
});
}
/** 草稿地图列表*/
export function listMap() {
return request({
url: '/api/mapBuild/list',
method: 'get'
});
return request({
url: '/api/mapBuild/list',
method: 'get'
});
}
/** 获取草稿地图详细内容*/
export function getMapDetail(id) {
return request({
url: `/api/mapBuild/${id}/mapDataDetail`,
method: 'get'
});
return request({
url: `/api/mapBuild/${id}/mapDataDetail`,
method: 'get'
});
}
/** 新建草稿地图*/
export function newMap(data) {
return request({
url: '/api/mapBuild/create',
method: 'post',
data: data
});
return request({
url: '/api/mapBuild/create',
method: 'post',
data: data
});
}
/** 更新草稿地图*/
export function updateMap(data) {
return request({
url: `/api/mapBuild/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/mapBuild/${data.id}`,
method: 'put',
data: data
});
}
/** 删除草稿地图*/
export function deleteMap(data) {
return request({
url: `/api/mapBuild/delete/${data}`,
method: 'delete'
});
return request({
url: `/api/mapBuild/delete/${data}`,
method: 'delete'
});
}
/** 保存草稿地图*/
export function saveMap(data) {
return request({
url: `/api/mapBuild/${data.mapId}/saveElements`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/${data.mapId}/saveElements`,
method: 'post',
data: data
});
}
/** 草稿地图另存为*/
export function saveAsMap(data) {
return request({
url: `/api/mapBuild/${data.id}/saveAs`,
method: 'post',
data: {
name: data.name
}
});
return request({
url: `/api/mapBuild/${data.id}/saveAs`,
method: 'post',
data: {
name: data.name
}
});
}
/** 使用发布地图新建草稿地图*/
export function newUsePublishMap(data) {
return request({
url: '/api/mapBuild/createFrom',
method: 'post',
data: data
});
return request({
url: '/api/mapBuild/createFrom',
method: 'post',
data: data
});
}
/** 发布地图*/
export function publishMap(data) {
return request({
url: `/api/mapBuild/${data.id}/publish`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/${data.id}/publish`,
method: 'post',
data: data
});
}
/** 草稿地图数据导入*/
export function postBuildMapImport(data) {
return request({
url: `/api/mapBuild/import`,
method: 'post',
data: data,
time: 60000
});
return request({
url: `/api/mapBuild/import`,
method: 'post',
data: data,
time: 60000
});
}
/** 查询进路列表*/
export function listRouteRoute(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/route`,
method: 'get',
params: params
});
return request({
url: `/api/mapBuild/${mapId}/route`,
method: 'get',
params: params
});
}
/** 查询进路地图列表*/
export function listRouteMapRoute(mapId) {
return request({
url: `/api/mapBuild/${mapId}/route/all`,
method: 'get'
});
return request({
url: `/api/mapBuild/${mapId}/route/all`,
method: 'get'
});
}
/** 查询进路明细*/
export function queryRouteRouteDetail(data) {
return request({
url: `/api/mapBuild/route/${data.id}`,
method: 'get'
});
return request({
url: `/api/mapBuild/route/${data.id}`,
method: 'get'
});
}
/** 创建进路*/
export function createRouteRoute(data) {
return request({
url: `/api/mapBuild/route`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/route`,
method: 'post',
data: data
});
}
/** 删除进路*/
export function deleteRouteRoute(id) {
return request({
url: `/api/mapBuild/route/${id}`,
method: 'delete'
});
return request({
url: `/api/mapBuild/route/${id}`,
method: 'delete'
});
}
/** 更新进路*/
export function updateRouteRoute(data) {
return request({
url: `/api/mapBuild/route/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/mapBuild/route/${data.id}`,
method: 'put',
data: data
});
}
/** 创建联动道岔*/
export function createLinkageSwitch(data) {
return request({
url: `/api/mapBuild/switchCoupled`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/switchCoupled`,
method: 'post',
data: data
});
}
/** 删除联动道岔*/
export function deleteLinkageSwitch(coupleId) {
return request({
url: `/api/mapBuild/switchCoupled/${coupleId}`,
method: 'delete'
});
return request({
url: `/api/mapBuild/switchCoupled/${coupleId}`,
method: 'delete'
});
}
/** get联动道岔列表*/
export function listLinkageSwitch(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/switchCoupled`,
method: 'get',
params: params
});
return request({
url: `/api/mapBuild/${mapId}/switchCoupled`,
method: 'get',
params: params
});
}
/** 草稿地图数据校验*/
export function verifyMap(id) {
return request({
url: `/api/mapBuild/${id}/checkData`,
method: 'get'
});
return request({
url: `/api/mapBuild/${id}/checkData`,
method: 'get'
});
}
/** 分页查询交路数据*/
export function listRouting(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/routing`,
method: 'get',
params: params
});
return request({
url: `/api/mapBuild/${mapId}/routing`,
method: 'get',
params: params
});
}
/** 创建交路*/
export function addRouting(data) {
return request({
url: `/api/mapBuild/routing`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/routing`,
method: 'post',
data: data
});
}
/** 删除交路*/
export function deleteRouting(routingId) {
return request({
url: `/api/mapBuild/routing/${routingId}`,
method: 'delete'
});
return request({
url: `/api/mapBuild/routing/${routingId}`,
method: 'delete'
});
}
/** 获取交路详情*/
export function getRouting(routingId) {
return request({
url: `/api/mapBuild/routing/${routingId}`,
method: 'get'
});
return request({
url: `/api/mapBuild/routing/${routingId}`,
method: 'get'
});
}
/** 更新交路*/
export function updateRouting(data) {
return request({
url: `/api/mapBuild/routing/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/mapBuild/routing/${data.id}`,
method: 'put',
data: data
});
}
// 创建自动信号
export function postAutoSignal(data) {
return request({
url: `/api/mapBuild/autoSignal`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/autoSignal`,
method: 'post',
data: data
});
}
// 删除自动信号
export function delAutoSignal(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'delete'
});
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'delete'
});
}
// 删除自动信号
export function getAutoSignalList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/autoSignal`,
method: 'get',
params
});
return request({
url: `/api/mapBuild/${mapId}/autoSignal`,
method: 'get',
params
});
}
// 获取自动信号
export function getAutoSignalDetail(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'get'
});
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'get'
});
}
// 更新自动信号
export function putAutoSignal(data) {
return request({
url: `/api/mapBuild/autoSignal/${data.autoSignalId}`,
method: 'put',
data: data
});
return request({
url: `/api/mapBuild/autoSignal/${data.autoSignalId}`,
method: 'put',
data: data
});
}
export function getListByCityCode(cityCode) {
return request({
url: `/api/mapBuild/${cityCode}/list`,
method: 'get'
});
return request({
url: `/api/mapBuild/${cityCode}/list`,
method: 'get'
});
}

View File

@ -2,43 +2,43 @@ import request from '@/utils/request';
/** 获取路径单元列表*/
export function getRouteUnitList(id, data) {
return request({
url: `/api/mapBuild/${id}/routeUnit`,
method: 'get',
params: data
});
return request({
url: `/api/mapBuild/${id}/routeUnit`,
method: 'get',
params: data
});
}
/** 创建路径单元*/
export function addRouteUnit(data) {
return request({
url: `/api/mapBuild/routeUnit`,
method: 'post',
data: data
});
return request({
url: `/api/mapBuild/routeUnit`,
method: 'post',
data: data
});
}
/** 删除路径单元*/
export function delRouteUnit(id) {
return request({
url: `/api/mapBuild/routeUnit/${id}`,
method: 'DELETE'
});
return request({
url: `/api/mapBuild/routeUnit/${id}`,
method: 'DELETE'
});
}
/** 获取路径单元*/
export function getRouteUnit(id) {
return request({
url: `/api/mapBuild/routeUnit/${id}`,
method: 'get'
});
return request({
url: `/api/mapBuild/routeUnit/${id}`,
method: 'get'
});
}
/** 更新路径单元*/
export function setRouteUnit(data) {
return request({
url: `/api/mapBuild/routeUnit/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/mapBuild/routeUnit/${data.id}`,
method: 'put',
data: data
});
}

View File

@ -1,49 +1,49 @@
import request from '@/utils/request';
export function list(dicId, params) {
return request({
url: `/api/dictionary/${dicId}/detail/list`,
method: 'get',
params: params
});
return request({
url: `/api/dictionary/${dicId}/detail/list`,
method: 'get',
params: params
});
}
export function checkDicDetailCodeExist(dicId, code) {
return request({
url: `/api/dictionary/${dicId}/detail/checkExistByCode`,
method: 'get',
params: {
code: code
}
});
return request({
url: `/api/dictionary/${dicId}/detail/checkExistByCode`,
method: 'get',
params: {
code: code
}
});
}
export function getData(dicId, id) {
return request({
url: `/api/dictionary/${dicId}/detail/${id}`,
method: 'get'
});
return request({
url: `/api/dictionary/${dicId}/detail/${id}`,
method: 'get'
});
}
export function create(dicId, data) {
return request({
url: `/api/dictionary/${dicId}/detail/create`,
method: 'post',
data: data
});
return request({
url: `/api/dictionary/${dicId}/detail/create`,
method: 'post',
data: data
});
}
export function del(dicId, id) {
return request({
url: `/api/dictionary/${dicId}/detail/delete/${id}`,
method: 'delete'
});
return request({
url: `/api/dictionary/${dicId}/detail/delete/${id}`,
method: 'delete'
});
}
export function update(dicId, data) {
return request({
url: `/api/dictionary/${dicId}/detail/update/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/dictionary/${dicId}/detail/update/${data.id}`,
method: 'put',
data: data
});
}

View File

@ -2,127 +2,127 @@ import request from '@/utils/request';
/** 获取商品信息 */
export function getCommodityDetailByParams(data) {
return request({
url: `/api/goods/detail`,
method: 'get',
params: data
});
return request({
url: `/api/goods/detail`,
method: 'get',
params: data
});
}
/**
* 获取商品明细列表
*/
export function getCommodityList(params) {
return request({
url: '/api/goods',
method: 'get',
params: params
});
return request({
url: '/api/goods',
method: 'get',
params: params
});
}
/**
* 保存商品明细列表
*/
export function saveCommodityList(params) {
return request({
url: '/api/goods',
method: 'post',
data: params
});
return request({
url: '/api/goods',
method: 'post',
data: params
});
}
/**
* 删除商品明细
*/
export function delCommodity(id) {
return request({
url: `/api/goods/${id}`,
method: 'delete'
});
return request({
url: `/api/goods/${id}`,
method: 'delete'
});
}
/**
* 获取商品地图产品课程列表
*/
export function getMapLesson() {
return request({
url: `/api/goods/tree`,
method: 'get'
});
return request({
url: `/api/goods/tree`,
method: 'get'
});
}
/**
* 获取商品地图产品课程列表
*/
export function getCommodityDetailById(id) {
return request({
url: `/api/goods/${id}`,
method: 'get'
});
return request({
url: `/api/goods/${id}`,
method: 'get'
});
}
/**
* 获取商品地图产品课程列表
*/
export function updataCommodityList(data) {
return request({
url: `/api/goods/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/goods/${data.id}`,
method: 'put',
data: data
});
}
/**
* 设置失效或有效切换
*/
export function setCommodityStatus(id) {
return request({
url: `/api/goods/${id}/status`,
method: 'put'
});
return request({
url: `/api/goods/${id}/status`,
method: 'put'
});
}
/** 获取试用时长*/
export function getGoodsTryUse(data) {
return request({
url: `/api/goods/tryUse`,
method: 'get',
params: data
});
return request({
url: `/api/goods/tryUse`,
method: 'get',
params: data
});
}
/** 设置试用时长*/
export function setGoodsTryUse(data) {
return request({
url: `/api/goods/${data.goodsId}/tryUse`,
method: 'put',
data: {
time: data.time
}
});
return request({
url: `/api/goods/${data.goodsId}/tryUse`,
method: 'put',
data: {
time: data.time
}
});
}
/** 获取商品列表*/
export function getGoodsList() {
return request({
url: `/api/goods/list`,
method: 'get'
});
return request({
url: `/api/goods/list`,
method: 'get'
});
}
// 通过权限判断有无商品
export function getPermissionGoods(id) {
return request({
url: `/api/goods/list/permissionIds?permissionIds=${id}`,
method: 'get'
});
return request({
url: `/api/goods/list/permissionIds?permissionIds=${id}`,
method: 'get'
});
}
// 创建商品
export function postsPermissionGoods(data) {
return request({
url: `/api/goods`,
method: 'post',
data: data
});
return request({
url: `/api/goods`,
method: 'post',
data: data
});
}

View File

@ -2,17 +2,17 @@ import request from '@/utils/request';
/** 获取组织/企业数据*/
export function getOrganizationList() {
return request({
url: '/api/organization',
method: 'get'
});
return request({
url: '/api/organization',
method: 'get'
});
}
/** 添加组织/企业*/
export function addOrganization(data) {
return request({
url: '/api/organization',
method: 'post',
data: data
});
return request({
url: '/api/organization',
method: 'post',
data: data
});
}

View File

@ -2,34 +2,34 @@ import request from '@/utils/request';
/** 创建实训生成任务*/
export function addAutoGenerateTask(data) {
return request({
url: `/api/task`,
method: 'post',
data: data
});
return request({
url: `/api/task`,
method: 'post',
data: data
});
}
/** get任务列表*/
export function getTaskList(param) {
return request({
url: '/api/task',
method: 'get',
params: param
});
return request({
url: '/api/task',
method: 'get',
params: param
});
}
/** 开始任务*/
export function postTask(data) {
return request({
url: `/api/task/${data.id}/execute`,
method: 'post'
});
return request({
url: `/api/task/${data.id}/execute`,
method: 'post'
});
}
/** 开始任务*/
export function postTaskCancel(id) {
return request({
url: `/api/task/${id}/cancel`,
method: 'post'
});
return request({
url: `/api/task/${id}/cancel`,
method: 'post'
});
}

View File

@ -2,75 +2,75 @@ import request from '@/utils/request';
/** 获取用户试题列表*/
export function generateExamList(examId) {
return request({
url: `/api/userExam/${examId}/generate`,
method: 'get'
});
return request({
url: `/api/userExam/${examId}/generate`,
method: 'get'
});
}
/** 刷新考题列表*/
export function refreshExamList(userExamId) {
return request({
url: `/api/userExam/${userExamId}`,
method: 'get'
});
return request({
url: `/api/userExam/${userExamId}`,
method: 'get'
});
}
/** 提交一个考题*/
export function finishOneExamQuestion(data) {
return request({
url: '/api/userExam/finish',
method: 'put',
data: data
});
return request({
url: '/api/userExam/finish',
method: 'put',
data: data
});
}
/** 考试完成提交*/
export function submitExam(examId) {
return request({
url: `/api/userExam/${examId}/submit`,
method: 'put'
});
return request({
url: `/api/userExam/${examId}/submit`,
method: 'put'
});
}
/** 获取用户考试列表*/
export function getPublishExam(data) {
return request({
url: `/api/userExam/list`,
method: 'get',
params: data
});
return request({
url: `/api/userExam/list`,
method: 'get',
params: data
});
}
/** 删除用户考试*/
export function delPublishExam(id) {
return request({
url: `/api/userExam/${id}`,
method: 'delete'
});
return request({
url: `/api/userExam/${id}`,
method: 'delete'
});
}
/** 删除用户实训*/
export function delTrainingList() {
return request({
url: `/api/userExam/list`,
method: 'delet'
});
return request({
url: `/api/userExam/list`,
method: 'delet'
});
}
/** 设置试卷失效 */
export function setExamGive(id) {
return request({
url: `/api/userExam/${id}/abandon`,
method: 'put'
});
return request({
url: `/api/userExam/${id}/abandon`,
method: 'put'
});
}
export function updateExam(data) {
return request({
url: `/api/userExam/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/userExam/${data.id}`,
method: 'put',
data: data
});
}

View File

@ -3,65 +3,65 @@ import request from '@/utils/request';
/** 分页查询仿真记录*/
export function getSimulationRelpayList(params) {
return request({
url: `/api/simulationRecord`,
method: 'get',
params: params
});
return request({
url: `/api/simulationRecord`,
method: 'get',
params: params
});
}
// 删除回放
export function delSimulationRecord(replayId) {
return request({
url: `/api/simulationRecord/${replayId}`,
method: 'delete'
});
return request({
url: `/api/simulationRecord/${replayId}`,
method: 'delete'
});
}
/** 回放*/
export function simulationRelpay(replayId) {
return request({
url: `/api/simulationRecord/${replayId}/playBack`,
method: 'get'
});
return request({
url: `/api/simulationRecord/${replayId}/playBack`,
method: 'get'
});
}
// 结束回放
export function putsSimulationRecord(replayId) {
return request({
url: `/api/simulationRecord/${replayId}/over`,
method: 'put'
});
return request({
url: `/api/simulationRecord/${replayId}/over`,
method: 'put'
});
}
// 暂停回放
export function putsSimulationRecordPause(replayId) {
return request({
url: `/api/simulationRecord/${replayId}/pause`,
method: 'put'
});
return request({
url: `/api/simulationRecord/${replayId}/pause`,
method: 'put'
});
}
// 播放回放
export function putsSimulationRecordPlay(replayId) {
return request({
url: `/api/simulationRecord/${replayId}/play`,
method: 'put'
});
return request({
url: `/api/simulationRecord/${replayId}/play`,
method: 'put'
});
}
// 设置速度回放
export function putsSimulationRecordPlaySpeed(replayId, speed) {
return request({
url: `/api/simulationRecord/${replayId}/playSpeed?playSpeed=${speed}`,
method: 'put'
});
return request({
url: `/api/simulationRecord/${replayId}/playSpeed?playSpeed=${speed}`,
method: 'put'
});
}
// 播放
export function putsSimulationRecordplayTime(replayId, offsetSeconds) {
return request({
url: `/api/simulationRecord/${replayId}/playTime?offsetSeconds=${offsetSeconds}`,
method: 'put'
});
return request({
url: `/api/simulationRecord/${replayId}/playTime?offsetSeconds=${offsetSeconds}`,
method: 'put'
});
}

View File

@ -2,88 +2,88 @@ import request from '@/utils/request';
// 课程列表
export function getLessonList(code) {
return request({
url: '/api/stats/lesson/list',
method: 'get',
params: {
wmCode: code
}
});
return request({
url: '/api/stats/lesson/list',
method: 'get',
params: {
wmCode: code
}
});
}
// 课程内实训数据统计
export function getLessonTimeChart(data) {
return request({
url: `/api/stats/lesson/${data.id}/stats`,
method: 'get',
params: {
wmCode: data.code
}
});
return request({
url: `/api/stats/lesson/${data.id}/stats`,
method: 'get',
params: {
wmCode: data.code
}
});
}
// 查询参与考试的课程列表
export function getExamTree(code) {
return request({
url: '/api/stats/exam/lessonList',
method: 'get',
params: {
wmCode: code
}
});
return request({
url: '/api/stats/exam/lessonList',
method: 'get',
params: {
wmCode: code
}
});
}
// 查询参与考试的试题列表
export function getstatsExamList(data) {
return request({
url: `/api/stats/exam/${data.lessonId}/list`,
method: 'get',
params: {
wmCode: data.code
}
});
return request({
url: `/api/stats/exam/${data.lessonId}/list`,
method: 'get',
params: {
wmCode: data.code
}
});
}
// 个人考试数据统计
export function getExamChart(data) {
return request({
url: `/api/stats/exam/${data.examId}/stats`,
method: 'get',
params: {
wmCode: data.code
}
});
return request({
url: `/api/stats/exam/${data.examId}/stats`,
method: 'get',
params: {
wmCode: data.code
}
});
}
// 个人关注地图数据统计列表
export function getRelevanceMapList(code) {
return request({
url: `/api/user/subscribe`,
method: 'get',
params: {
wmCode: code
}
});
return request({
url: `/api/user/subscribe`,
method: 'get',
params: {
wmCode: code
}
});
}
// 仿真地图下产品列表
export function getSimulationPrdList(mapId, code) {
return request({
url: `/api/stats/simulation/${mapId}/prdList`,
method: 'get',
params: {
wmCode: code
}
});
return request({
url: `/api/stats/simulation/${mapId}/prdList`,
method: 'get',
params: {
wmCode: code
}
});
}
// 个人仿真数据统计
export function getSimulationTimeChart(data) {
return request({
url: `/api/stats/simulation/${data.mapId}/stats`,
method: 'get',
params: {
wmCode: data.code
}
});
return request({
url: `/api/stats/simulation/${data.mapId}/stats`,
method: 'get',
params: {
wmCode: data.code
}
});
}

View File

@ -1,9 +1,9 @@
import request from '@/utils/request';
export function getList(params) {
return request({
url: '/table/list',
method: 'get',
params
});
return request({
url: '/table/list',
method: 'get',
params
});
}

View File

@ -352,7 +352,7 @@ export function Jl3dDriving(updatemmi, sound) {
trainlisttest.list[code].speeds = data.body[i].speed;
trainlisttest.list[code].speeds = 0;
// trainlisttest.list[code].startmark = 1;
}else {
} else {
trainlisttest.list[code].speeds = data.body[i].speed;
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed * 10 / 36 / 24 / trainlisttest.list[code].len);
}
@ -491,7 +491,7 @@ export function Jl3dDriving(updatemmi, sound) {
// console.log(trainlisttest.list[code].nextcurve.points);
// console.log("=========================");
}else {
} else {
let nextcode;
if (data.body[i].directionType == '02') {
if (rails.linkrail[data.body[i].linkCode].lineleft) {

View File

@ -6,439 +6,439 @@ import router from '@/router';
// 定于仿真socket接口
export function Jlmap3dSubscribe(worker) {
const scope = this;
this.map = null;
const webworker = worker;
var trainlisttest = null;
var sectionlist = null;
var signallist = null;
var stationstandlist = null;
var sectionlist = null;
var materials = null;
var actions = null;
var scenes = null;
var code = null;
this.teststomp = new StompClient();
this.topic = displayTopic;
const header = { group: router.currentRoute.query.group, 'X-Token': getToken() };
this.updatamap = function (mapdata, materiallist, nowaction, scene) {
// console.log(mapdata);
scope.map = mapdata;
trainlisttest = this.map.trainlisttest;
sectionlist = this.map.sectionlist;
signallist = this.map.signallist;
stationstandlist = this.map.stationstandlist;
sectionlist = this.map.sectionlist;
materials = materiallist;
scenes = scene;
actions = nowaction;
};
this.socketon = function (topic) {
try {
// console.log("teststomp");
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function (topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
// 对象化数据
const data = JSON.parse(Response.body);
// 遍历后台数据
// 判断消息类型
// if(data.type == "Simulation_TrainPosition"){
//
//
// }
if (data.type == 'Simulation_DeviceStatus') {
if (data.body.length < 200) {
for (let i = data.body.length - 1; i >= 0; i--) {
if (data.body[i]._type == 'Train') {
// console.log(data.body[i]);
// 遍历列车对象组
// console.log(data.body[i]);
if (trainlisttest) {
code = data.body[i].code;
// 剔除不显示的车
// 找到对应列车
if (trainlisttest.list[code]) {
// 车门开关验证
// if(data.body[i].directionType == "02"){
if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') {
// console.log("close");
trainlisttest.list[code].doorStatus = '01';
for (let an = actions[code].top.length - 1; an >= 0; an--) {
actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1;
actions[code].top[an].play();
}
} else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') {
// console.log("open");
trainlisttest.list[code].doorStatus = '02';
for (let an = actions[code].top.length - 1; an >= 0; an--) {
actions[code].top[an].reset();
actions[code].top[an].time = 0;
actions[code].top[an].timeScale = 1;
actions[code].top[an].play();
}
}
// }else{
// if(trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == "01"){
// //console.log("close");
// trainlisttest.list[code].doorStatus = "01";
// for(let an=actions[code].down.length-1;an>=0;an--){
// actions[code].down[an].reset();
// actions[code].down[an].time = actions[code].top[an]._clip.duration;
// actions[code].down[an].timeScale = -1;
// actions[code].down[an].play();
// }
// }else if(trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == "02"){
// //console.log("open");
// trainlisttest.list[code].doorStatus = "02";
// for(let an=actions[code].down.length-1;an>=0;an--){
// actions[code].down[an].reset();
// actions[code].down[an].time = 0;
// actions[code].down[an].timeScale = 1;
// actions[code].down[an].play();
// }
// }
// }
// 遍历获取所在轨道
if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) {
trainlisttest.group.add(trainlisttest.list[code]);
if (sectionlist.sections.datalist[data.body[i].sectionCode].code) {
trainlisttest.list[code].position.y = 0;
trainlisttest.list[code].progress = 0;
trainlisttest.list[code].oldoffset = data.body[i].sectionOffsetPercent;
trainlisttest.list[code].dispose = false;
if (data.body[i].directionType == '02') {
trainlisttest.list[code].status = '02';
trainlisttest.list[code].rotation.y = 0;
} else if (data.body[i].directionType == '03') {
trainlisttest.list[code].status = '03';
trainlisttest.list[code].rotation.y = Math.PI;
}
}
} else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) {
trainlisttest.group.remove(trainlisttest.list[code]);
trainlisttest.list[code].progress = null;
trainlisttest.list[code].dispose = true;
} else if (trainlisttest.list[code].dispose == data.body[i].dispose && data.body[i].dispose == false) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].code) {
if (trainlisttest.list[code].nowcode != data.body[i].sectionCode || trainlisttest.list[code].nextcode != data.body[i].nextSectionCode) {
trainlisttest.list[code].nowcode = data.body[i].sectionCode;
trainlisttest.list[code].nextcode = data.body[i].nextSectionCode;
const vexlist = [];
const endrotation = null;
if (data.body[i].directionType == '02') { // 向右
if (trainlisttest.list[code].status != data.body[i].directionType) {
console.log(trainlisttest.list[code].position);
console.log(trainlisttest.list[code].children[5].matrixWorld);
trainlisttest.list[code].position.x = trainlisttest.list[code].children[5].matrixWorld.elements[12];
trainlisttest.list[code].children[0].position.z = trainlisttest.list[code].children[0].matrixWorld.elements[14];
trainlisttest.list[code].children[1].position.z = trainlisttest.list[code].children[1].matrixWorld.elements[14];
trainlisttest.list[code].children[2].position.z = trainlisttest.list[code].children[2].matrixWorld.elements[14];
trainlisttest.list[code].children[3].position.z = trainlisttest.list[code].children[3].matrixWorld.elements[14];
trainlisttest.list[code].children[4].position.z = trainlisttest.list[code].children[4].matrixWorld.elements[14];
trainlisttest.list[code].children[5].position.z = trainlisttest.list[code].children[5].matrixWorld.elements[14];
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x > sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x > trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
} else {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x > trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
} else {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x > sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
} else {
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
trainlisttest.list[code].status = '02';
trainlisttest.list[code].rotation.y = 0;
} else if (data.body[i].directionType == '03') { // 向左
if (trainlisttest.list[code].status != data.body[i].directionType) {
trainlisttest.list[code].position.x = trainlisttest.list[code].children[5].matrixWorld.elements[12];
trainlisttest.list[code].children[0].position.z = trainlisttest.list[code].children[0].matrixWorld.elements[14];
trainlisttest.list[code].children[1].position.z = trainlisttest.list[code].children[1].matrixWorld.elements[14];
trainlisttest.list[code].children[2].position.z = trainlisttest.list[code].children[2].matrixWorld.elements[14];
trainlisttest.list[code].children[3].position.z = trainlisttest.list[code].children[3].matrixWorld.elements[14];
trainlisttest.list[code].children[4].position.z = trainlisttest.list[code].children[4].matrixWorld.elements[14];
trainlisttest.list[code].children[5].position.z = trainlisttest.list[code].children[5].matrixWorld.elements[14];
//
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x < sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x < trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
} else {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x < trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
} else {
//
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x < sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
} else {
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
trainlisttest.list[code].status = '03';
trainlisttest.list[code].rotation.y = Math.PI;
}
trainlisttest.list[code].curve = new THREE.CatmullRomCurve3(vexlist);
// console.log(trainlisttest.list[code].curve.points);
// console.log(data.body[i].speed)
// console.log(sectionlist.sections.datalist[data.body[i].sectionCode].distance);
trainlisttest.list[code].speeds = data.body[i].speed * 10 / 36 / 11 / sectionlist.sections.datalist[data.body[i].sectionCode].distance;
trainlisttest.list[code].progress = 0;
}
// console.log("speed");
// console.log(data.body[i].speed);
// console.log(trainlisttest.list[code].speed);
if (data.body[i].speed != trainlisttest.list[code].speed) {
trainlisttest.list[code].speed = data.body[i].speed;
trainlisttest.list[code].speeds = data.body[i].speed * 10 / 36 / 11 / sectionlist.sections.datalist[data.body[i].sectionCode].distance;
// if(trainlisttest.list[code].speeds > 0.1){
// console.log(data.body[i]);
// console.log(data.body[i].speed)
// console.log(sectionlist.sections.datalist[data.body[i].sectionCode].distance);
// console.log(trainlisttest.list[code].speeds);
// }
}
}
}
}
}
}
// 0xFFFFFF
// 0xCD0000 红
// 0xEEEE00 黄
// 0x32CD32 绿
if (data.body[i]._type == 'Signal') {
if (signallist) {
code = data.body[i].code;
if (data.body[i].lightType == '01') {
if (signallist.list[code].mesh.code) {
signallist.list[code].mesh.status = data.body[i].status;
// 55
// 33
// 77
// 关闭
if (data.body[i].status == '01') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[0];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
// 开放
if (data.body[i].status == '02') {
if (data.body[i].switchLocateType == '01') {
signallist.list[code].mesh.children[0].material.map = materials[2];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
if (data.body[i].switchLocateType == '02') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[1];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
}
// 引导
if (data.body[i].status == '03') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[0];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[1];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
// 封锁
if (data.body[i].status == '04') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
// 故障
if (data.body[i].status == '05') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
}
} else if (data.body[i].lightType == '01') {
if (signallist.list[code].mesh.code) {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
}
}
}
if (data.body[i]._type == 'StationStand') {
if (actions) {
code = data.body[i].code;
if (data.body[i].screenDoorOpenStatus == '02' && actions[code].status == '01') {
actions[code].status = '00';
}
if (data.body[i].screenDoorOpenStatus == '02' && actions[code].status == '00') {
actions[code].status = '02';
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.body[i].screenDoorOpenStatus == '01' && actions[code].status == '02') {
actions[code].status = '00';
}
if (data.body[i].screenDoorOpenStatus == '01' && actions[code].status == '00') {
actions[code].status = '01';
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
}
}
}
if (data.body[i]._type == 'Switch') {
if (sectionlist) {
code = data.body[i].code;
for (let j = sectionlist.switchs.modellist.length - 1; j >= 0; j--) {
if (sectionlist.switchs.modellist[j].code == code) {
if (sectionlist.switchs.modellist[j].locateType != data.body[i].locateType) {
if (data.body[i].locateType == '02') {
sectionlist.switchs.modellist[j].locateType = data.body[i].locateType;
actions[sectionlist.switchs.modellist[j].code].reset();
actions[sectionlist.switchs.modellist[j].code].time = 0;
actions[sectionlist.switchs.modellist[j].code].timeScale = 1;
actions[sectionlist.switchs.modellist[j].code].play();
} else if (data.body[i].locateType == '01') {
sectionlist.switchs.modellist[j].locateType = data.body[i].locateType;
actions[sectionlist.switchs.modellist[j].code].reset();
actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration;
actions[sectionlist.switchs.modellist[j].code].timeScale = -1;
actions[sectionlist.switchs.modellist[j].code].play();
}
}
// console.log(sectionlist.group[j].name);
j = 0;
}
}
}
}
}
} else if (data.body.length > 200) {
}
}
}
const scope = this;
this.map = null;
const webworker = worker;
var trainlisttest = null;
var sectionlist = null;
var signallist = null;
var stationstandlist = null;
var sectionlist = null;
var materials = null;
var actions = null;
var scenes = null;
var code = null;
this.teststomp = new StompClient();
this.topic = displayTopic;
const header = { group: router.currentRoute.query.group, 'X-Token': getToken() };
this.updatamap = function (mapdata, materiallist, nowaction, scene) {
// console.log(mapdata);
scope.map = mapdata;
trainlisttest = this.map.trainlisttest;
sectionlist = this.map.sectionlist;
signallist = this.map.signallist;
stationstandlist = this.map.stationstandlist;
sectionlist = this.map.sectionlist;
materials = materiallist;
scenes = scene;
actions = nowaction;
};
this.socketon = function (topic) {
try {
// console.log("teststomp");
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function (topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
// 对象化数据
const data = JSON.parse(Response.body);
// 遍历后台数据
// 判断消息类型
// if(data.type == "Simulation_TrainPosition"){
//
//
// }
if (data.type == 'Simulation_DeviceStatus') {
if (data.body.length < 200) {
for (let i = data.body.length - 1; i >= 0; i--) {
if (data.body[i]._type == 'Train') {
// console.log(data.body[i]);
// 遍历列车对象组
// console.log(data.body[i]);
if (trainlisttest) {
code = data.body[i].code;
// 剔除不显示的车
// 找到对应列车
if (trainlisttest.list[code]) {
// 车门开关验证
// if(data.body[i].directionType == "02"){
if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') {
// console.log("close");
trainlisttest.list[code].doorStatus = '01';
for (let an = actions[code].top.length - 1; an >= 0; an--) {
actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1;
actions[code].top[an].play();
}
} else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') {
// console.log("open");
trainlisttest.list[code].doorStatus = '02';
for (let an = actions[code].top.length - 1; an >= 0; an--) {
actions[code].top[an].reset();
actions[code].top[an].time = 0;
actions[code].top[an].timeScale = 1;
actions[code].top[an].play();
}
}
// }else{
// if(trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == "01"){
// //console.log("close");
// trainlisttest.list[code].doorStatus = "01";
// for(let an=actions[code].down.length-1;an>=0;an--){
// actions[code].down[an].reset();
// actions[code].down[an].time = actions[code].top[an]._clip.duration;
// actions[code].down[an].timeScale = -1;
// actions[code].down[an].play();
// }
// }else if(trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == "02"){
// //console.log("open");
// trainlisttest.list[code].doorStatus = "02";
// for(let an=actions[code].down.length-1;an>=0;an--){
// actions[code].down[an].reset();
// actions[code].down[an].time = 0;
// actions[code].down[an].timeScale = 1;
// actions[code].down[an].play();
// }
// }
// }
// 遍历获取所在轨道
if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) {
trainlisttest.group.add(trainlisttest.list[code]);
if (sectionlist.sections.datalist[data.body[i].sectionCode].code) {
trainlisttest.list[code].position.y = 0;
trainlisttest.list[code].progress = 0;
trainlisttest.list[code].oldoffset = data.body[i].sectionOffsetPercent;
trainlisttest.list[code].dispose = false;
if (data.body[i].directionType == '02') {
trainlisttest.list[code].status = '02';
trainlisttest.list[code].rotation.y = 0;
} else if (data.body[i].directionType == '03') {
trainlisttest.list[code].status = '03';
trainlisttest.list[code].rotation.y = Math.PI;
}
}
} else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) {
trainlisttest.group.remove(trainlisttest.list[code]);
trainlisttest.list[code].progress = null;
trainlisttest.list[code].dispose = true;
} else if (trainlisttest.list[code].dispose == data.body[i].dispose && data.body[i].dispose == false) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].code) {
if (trainlisttest.list[code].nowcode != data.body[i].sectionCode || trainlisttest.list[code].nextcode != data.body[i].nextSectionCode) {
trainlisttest.list[code].nowcode = data.body[i].sectionCode;
trainlisttest.list[code].nextcode = data.body[i].nextSectionCode;
const vexlist = [];
const endrotation = null;
if (data.body[i].directionType == '02') { // 向右
if (trainlisttest.list[code].status != data.body[i].directionType) {
console.log(trainlisttest.list[code].position);
console.log(trainlisttest.list[code].children[5].matrixWorld);
trainlisttest.list[code].position.x = trainlisttest.list[code].children[5].matrixWorld.elements[12];
trainlisttest.list[code].children[0].position.z = trainlisttest.list[code].children[0].matrixWorld.elements[14];
trainlisttest.list[code].children[1].position.z = trainlisttest.list[code].children[1].matrixWorld.elements[14];
trainlisttest.list[code].children[2].position.z = trainlisttest.list[code].children[2].matrixWorld.elements[14];
trainlisttest.list[code].children[3].position.z = trainlisttest.list[code].children[3].matrixWorld.elements[14];
trainlisttest.list[code].children[4].position.z = trainlisttest.list[code].children[4].matrixWorld.elements[14];
trainlisttest.list[code].children[5].position.z = trainlisttest.list[code].children[5].matrixWorld.elements[14];
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x > sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x > trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
} else {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x > trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
} else {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x > sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
} else {
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
trainlisttest.list[code].status = '02';
trainlisttest.list[code].rotation.y = 0;
} else if (data.body[i].directionType == '03') { // 向左
if (trainlisttest.list[code].status != data.body[i].directionType) {
trainlisttest.list[code].position.x = trainlisttest.list[code].children[5].matrixWorld.elements[12];
trainlisttest.list[code].children[0].position.z = trainlisttest.list[code].children[0].matrixWorld.elements[14];
trainlisttest.list[code].children[1].position.z = trainlisttest.list[code].children[1].matrixWorld.elements[14];
trainlisttest.list[code].children[2].position.z = trainlisttest.list[code].children[2].matrixWorld.elements[14];
trainlisttest.list[code].children[3].position.z = trainlisttest.list[code].children[3].matrixWorld.elements[14];
trainlisttest.list[code].children[4].position.z = trainlisttest.list[code].children[4].matrixWorld.elements[14];
trainlisttest.list[code].children[5].position.z = trainlisttest.list[code].children[5].matrixWorld.elements[14];
//
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x < sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x < trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
} else {
vexlist.push(new THREE.Vector3(trainlisttest.list[code].position.x, 0, trainlisttest.list[code].children[0].matrixWorld.elements[14]));
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[m].x < trainlisttest.list[code].position.x) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
} else {
//
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x < sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
for (let m = sectionlist.sections.datalist[data.body[i].sectionCode].rail.length - 1; m >= 0; m--) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
} else {
for (let m = 0; m < sectionlist.sections.datalist[data.body[i].sectionCode].rail.length; m++) {
vexlist.push(sectionlist.sections.datalist[data.body[i].sectionCode].rail[m]);
}
}
}
trainlisttest.list[code].status = '03';
trainlisttest.list[code].rotation.y = Math.PI;
}
trainlisttest.list[code].curve = new THREE.CatmullRomCurve3(vexlist);
// console.log(trainlisttest.list[code].curve.points);
// console.log(data.body[i].speed)
// console.log(sectionlist.sections.datalist[data.body[i].sectionCode].distance);
trainlisttest.list[code].speeds = data.body[i].speed * 10 / 36 / 11 / sectionlist.sections.datalist[data.body[i].sectionCode].distance;
trainlisttest.list[code].progress = 0;
}
// console.log("speed");
// console.log(data.body[i].speed);
// console.log(trainlisttest.list[code].speed);
if (data.body[i].speed != trainlisttest.list[code].speed) {
trainlisttest.list[code].speed = data.body[i].speed;
trainlisttest.list[code].speeds = data.body[i].speed * 10 / 36 / 11 / sectionlist.sections.datalist[data.body[i].sectionCode].distance;
// if(trainlisttest.list[code].speeds > 0.1){
// console.log(data.body[i]);
// console.log(data.body[i].speed)
// console.log(sectionlist.sections.datalist[data.body[i].sectionCode].distance);
// console.log(trainlisttest.list[code].speeds);
// }
}
}
}
}
}
}
// 0xFFFFFF
// 0xCD0000 红
// 0xEEEE00 黄
// 0x32CD32 绿
if (data.body[i]._type == 'Signal') {
if (signallist) {
code = data.body[i].code;
if (data.body[i].lightType == '01') {
if (signallist.list[code].mesh.code) {
signallist.list[code].mesh.status = data.body[i].status;
// 55
// 33
// 77
// 关闭
if (data.body[i].status == '01') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[0];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
// 开放
if (data.body[i].status == '02') {
if (data.body[i].switchLocateType == '01') {
signallist.list[code].mesh.children[0].material.map = materials[2];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
if (data.body[i].switchLocateType == '02') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[1];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
}
// 引导
if (data.body[i].status == '03') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[0];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[1];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
// 封锁
if (data.body[i].status == '04') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
// 故障
if (data.body[i].status == '05') {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
}
} else if (data.body[i].lightType == '01') {
if (signallist.list[code].mesh.code) {
signallist.list[code].mesh.children[0].material.map = materials[3];
signallist.list[code].mesh.children[0].material.map.needsUpdate = true;
signallist.list[code].mesh.children[1].material.map = materials[3];
signallist.list[code].mesh.children[1].material.map.needsUpdate = true;
signallist.list[code].mesh.children[2].material.map = materials[3];
signallist.list[code].mesh.children[2].material.map.needsUpdate = true;
}
}
}
}
if (data.body[i]._type == 'StationStand') {
if (actions) {
code = data.body[i].code;
if (data.body[i].screenDoorOpenStatus == '02' && actions[code].status == '01') {
actions[code].status = '00';
}
if (data.body[i].screenDoorOpenStatus == '02' && actions[code].status == '00') {
actions[code].status = '02';
actions[code].action.reset();
actions[code].action.time = 0;
actions[code].action.timeScale = 1;
actions[code].action.play();
}
if (data.body[i].screenDoorOpenStatus == '01' && actions[code].status == '02') {
actions[code].status = '00';
}
if (data.body[i].screenDoorOpenStatus == '01' && actions[code].status == '00') {
actions[code].status = '01';
actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1;
actions[code].action.play();
}
}
}
if (data.body[i]._type == 'Switch') {
if (sectionlist) {
code = data.body[i].code;
for (let j = sectionlist.switchs.modellist.length - 1; j >= 0; j--) {
if (sectionlist.switchs.modellist[j].code == code) {
if (sectionlist.switchs.modellist[j].locateType != data.body[i].locateType) {
if (data.body[i].locateType == '02') {
sectionlist.switchs.modellist[j].locateType = data.body[i].locateType;
actions[sectionlist.switchs.modellist[j].code].reset();
actions[sectionlist.switchs.modellist[j].code].time = 0;
actions[sectionlist.switchs.modellist[j].code].timeScale = 1;
actions[sectionlist.switchs.modellist[j].code].play();
} else if (data.body[i].locateType == '01') {
sectionlist.switchs.modellist[j].locateType = data.body[i].locateType;
actions[sectionlist.switchs.modellist[j].code].reset();
actions[sectionlist.switchs.modellist[j].code].time = actions[sectionlist.switchs.modellist[j].code]._clip.duration;
actions[sectionlist.switchs.modellist[j].code].timeScale = -1;
actions[sectionlist.switchs.modellist[j].code].play();
}
}
// console.log(sectionlist.group[j].name);
j = 0;
}
}
}
}
}
} else if (data.body.length > 200) {
}
}
}
}

View File

@ -13,138 +13,138 @@ import { runDiagramQuit } from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = true;
this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
//
// this.menuNormal.push(node);
// }
// });
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = true;
this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
//
// this.menuNormal.push(node);
// }
// });
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
};
</script>

View File

@ -242,126 +242,126 @@
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import OperateHandler from '@/scripts/plugin/OperateHandler';
export default {
name: 'MapButtonMenu',
data() {
return {
point: {
x: -1000,
y: -1000
},
operation: '0',
buttonName: '',
buttonDownColor: '#A8A8A8',
buttonUpColor: '#DCDCDC',
width: 58,
tempData: null,
offset: {}
};
},
computed: {
Switch() {
return OperationEvent.Switch;
},
Section() {
return OperationEvent.Section;
},
Signal() {
return OperationEvent.Signal;
},
isShowBtn() {
return this.$store.state.training.prdType == '01';
}
},
watch: {
'$store.state.config.canvasOffsetCount': function (val) {
this.resetPosition();
},
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
}
},
mounted() {
this.resetPosition();
},
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},
updateButtonShow(val, old) {
if (old) {
//
const domId = getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
const domId = getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
buttonDown(operation) {
const operate = {
type: 'mbm',
operation: operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/emitTipFresh');
}
});
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
const model = this.$store.state.menuOperation.selected;
if (model) {
const deviceType = MapDeviceType[model._type];
const operate = {
send: true,
model: model,
code: model.code,
type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
};
name: 'MapButtonMenu',
data() {
return {
point: {
x: -1000,
y: -1000
},
operation: '0',
buttonName: '',
buttonDownColor: '#A8A8A8',
buttonUpColor: '#DCDCDC',
width: 58,
tempData: null,
offset: {}
};
},
computed: {
Switch() {
return OperationEvent.Switch;
},
Section() {
return OperationEvent.Section;
},
Signal() {
return OperationEvent.Signal;
},
isShowBtn() {
return this.$store.state.training.prdType == '01';
}
},
watch: {
'$store.state.config.canvasOffsetCount': function (val) {
this.resetPosition();
},
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
}
},
mounted() {
this.resetPosition();
},
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},
updateButtonShow(val, old) {
if (old) {
//
const domId = getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
const domId = getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
buttonDown(operation) {
const operate = {
type: 'mbm',
operation: operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/emitTipFresh');
}
});
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
const model = this.$store.state.menuOperation.selected;
if (model) {
const deviceType = MapDeviceType[model._type];
const operate = {
send: true,
model: model,
code: model.code,
type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
};
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
}
}
});
} else {
OperateHandler.cleanOperates();
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}
}
}
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
}
}
});
} else {
OperateHandler.cleanOperates();
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -13,137 +13,137 @@ import { runDiagramQuit } from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = true;
this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
//
// this.menuNormal.push(node);
// }
// });
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = true;
this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
//
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
//
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
//
// this.menuNormal.push(node);
// }
// });
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
};
</script>

View File

@ -109,7 +109,7 @@
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import OperateHandler from '@/scripts/plugin/OperateHandler';
import { deepAssign } from '@/utils/index';
import PasswordBox from './dialog/childDialog/passwordInputBox.vue';

View File

@ -13,92 +13,92 @@ import { runDiagramQuit } from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
};
</script>

View File

@ -13,138 +13,138 @@ import { runDiagramQuit } from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuNormal: [],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
isScreen() { //
return this.$route.params.mode === 'dp' ||
this.$store.state.training.roles == 'BigScreen';
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
// this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
// this.menu[0].disabled = (this.menu[0] && val) ? true : true;
// this.menu[1].disabled = !((this.menu[1] && val));
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
// this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
// this.menuNormal.push(node);
// }
// });
// this.menuNormal.push(node);
// }
// });
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
async back() {
await runDiagramQuit(this.group);
EventBus.$emit('trainingSubscribeStop');
history.go(-1);
exitFullscreen();
}
}
};
</script>

View File

@ -86,7 +86,7 @@ import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import OperateHandler from '@/scripts/plugin/OperateHandler';
export default {
name: 'TrainControl',

View File

@ -5,23 +5,23 @@ const CancelLimitOperation = OperationEvent.LimitControl;
const CancelLimitType = MapDeviceType.LimitControl.type;
export default {
test: function (operates) {
const operateType = getOperateTypeBy('LimitControl', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case CancelLimitOperation.CancelAllLimit.menu.operation: return handleMenuCancelAllLimit(operates);
test: function (operates) {
const operateType = getOperateTypeBy('LimitControl', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case CancelLimitOperation.CancelAllLimit.menu.operation: return handleMenuCancelAllLimit(operates);
}
}
}
}
}
}
};
/**
@ -29,17 +29,17 @@ export default {
* @param {*} operates
*/
function handleMenuCancelAllLimit(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === CancelLimitType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: CancelLimitOperation.CancelAllLimit.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === CancelLimitType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: CancelLimitOperation.CancelAllLimit.event
};
}
return { error: true };
}
return null;
}

View File

@ -7,121 +7,121 @@ const MixinCommandOperation = OperationEvent.MixinCommand;
const StationControlOperation = OperationEvent.StationControl;
export default {
test: function (operates) {
const operateType = getOperateTypeBy('MixinCommand', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
switch (operates[0].operation) {
case MixinCommandOperation.remoteControl.mbar.operation: return handleMenuRemoteControl(operates);
case MixinCommandOperation.block.button.operation: return handleBlockButton(operates);
case MixinCommandOperation.unblock.button.operation: return handleUnblockButton(operates);
test: function (operates) {
const operateType = getOperateTypeBy('MixinCommand', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
switch (operates[0].operation) {
case MixinCommandOperation.remoteControl.mbar.operation: return handleMenuRemoteControl(operates);
case MixinCommandOperation.block.button.operation: return handleBlockButton(operates);
case MixinCommandOperation.unblock.button.operation: return handleUnblockButton(operates);
// case MixinCommandOperation.remoteControl.mbar.operation: return handleMenuRemoteControl(operates);
// case MixinCommandOperation.remoteControl.mbar.operation: return handleMenuRemoteControl(operates);
}
}
}
}
}
}
};
/**
* 控制模式操作
*/
function handleMenuRemoteControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (checkOperationIsCurrentOperate(operate.operation, StationControlOperation.requestStationControl)) {
return handleMenuRequestCentralControl(operates);
} else if (checkOperationIsCurrentOperate(operate.operation, StationControlOperation.requestCentralControl)) {
return handleMenuRequestStationControl(operates);
} else if (checkOperationIsCurrentOperate(operate.operation, StationControlOperation.emergencyStationControl)) {
return handleMenuEmergencyStationControl(operates);
}
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (checkOperationIsCurrentOperate(operate.operation, StationControlOperation.requestStationControl)) {
return handleMenuRequestCentralControl(operates);
} else if (checkOperationIsCurrentOperate(operate.operation, StationControlOperation.requestCentralControl)) {
return handleMenuRequestStationControl(operates);
} else if (checkOperationIsCurrentOperate(operate.operation, StationControlOperation.emergencyStationControl)) {
return handleMenuEmergencyStationControl(operates);
}
return { error: true };
}
return null;
return { error: true };
}
return null;
}
// 封锁操作
function handleBlockButton(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type == MapDeviceType.Signal.type) { // 信号机 封锁
return handleButtonLock(operate);
} else if (operate.type == MapDeviceType.Switch.type) { // 道岔封锁
return handleButtonBlock(operate);
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type == MapDeviceType.Signal.type) { // 信号机 封锁
return handleButtonLock(operate);
} else if (operate.type == MapDeviceType.Switch.type) { // 道岔封锁
return handleButtonBlock(operate);
}
return { error: true };
}
return null;
}
// 信号封锁 按钮操作
function handleButtonLock(operate) {
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Signal.lock.event
};
}
return { error: true };
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Signal.lock.event
};
}
return { error: true };
}
// 信号机解封 按钮操作
function handleButtonUnlock(operate) {
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Signal.unlock.event
};
}
return { error: true };
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Signal.unlock.event
};
}
return { error: true };
}
// 道岔封锁 按钮操作
function handleButtonBlock(operate) {
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Switch.block.event
};
}
return { error: true };
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Switch.block.event
};
}
return { error: true };
}
// 道岔解封 按钮操作
function handleButtonUnblock(operate) {
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Switch.unblock.event
};
}
return { error: true };
if (operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: OperationEvent.Switch.unblock.event
};
}
return { error: true };
}
// 解封操作
function handleUnblockButton(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type == MapDeviceType.Signal.type) { // 信号机 解封
return handleButtonUnlock(operate);
} else if (operate.type == MapDeviceType.Switch.type) { // 道岔封锁
return handleButtonUnblock(operate);
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type == MapDeviceType.Signal.type) { // 信号机 解封
return handleButtonUnlock(operate);
} else if (operate.type == MapDeviceType.Switch.type) { // 道岔封锁
return handleButtonUnblock(operate);
}
return { error: true };
}
return null;
}

View File

@ -7,52 +7,52 @@ const SectionOperation = OperationEvent.Section;
const SectionType = MapDeviceType.Section.type;
export default {
test: function (operates) {
const operateType = getOperateTypeBy('Section', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case SectionOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
test: function (operates) {
const operateType = getOperateTypeBy('Section', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case SectionOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case SectionOperation.stoppage.menu.operation: return handleMenuFailure(operates);
case SectionOperation.stoppage.menu.operation: return handleMenuFailure(operates);
case SectionOperation.alxeFailure.menu.operation: return handleMenuAlxeFailure(operates);
case SectionOperation.alxeFailure.menu.operation: return handleMenuAlxeFailure(operates);
case SectionOperation.fault.menu.operation: return handleMenuFault(operates);
case SectionOperation.fault.button.operation: return handleButtonFault(operates);
case SectionOperation.fault.menu.operation: return handleMenuFault(operates);
case SectionOperation.fault.button.operation: return handleButtonFault(operates);
case SectionOperation.lock.menu.operation: return handleMenuLock(operates);
case SectionOperation.lock.menu.operation: return handleMenuLock(operates);
case SectionOperation.unlock.menu.operation: return handleMenuUnlock(operates);
case SectionOperation.unlock.menu.operation: return handleMenuUnlock(operates);
case SectionOperation.split.menu.operation: return handleMenuSplit(operates);
case SectionOperation.split.menu.operation: return handleMenuSplit(operates);
case SectionOperation.active.menu.operation: return handleMenuActive(operates);
case SectionOperation.active.menu.operation: return handleMenuActive(operates);
case SectionOperation.setSpeed.menu.operation: return handleMenuSetSpeed(operates);
case SectionOperation.setSpeed.menu.operation: return handleMenuSetSpeed(operates);
case SectionOperation.cancelSpeed.menu.operation: return handleMenuCancelSpeed(operates);
case SectionOperation.cancelSpeed.menu.operation: return handleMenuCancelSpeed(operates);
case SectionOperation.axlePreReset.menu.operation: return handleMenuAxlePreReset(operates);
case SectionOperation.axlePreReset.button.operation: return handleButtonAxlePreReset(operates);
case SectionOperation.axlePreReset.menu.operation: return handleMenuAxlePreReset(operates);
case SectionOperation.axlePreReset.button.operation: return handleButtonAxlePreReset(operates);
case SectionOperation.detail.menu.operation: return handleMenuDetail(operates);
case SectionOperation.detail.menu.operation: return handleMenuDetail(operates);
case SectionOperation.newtrain.menu.operation: return handleMenuNewTrain(operates);
case SectionOperation.newtrain.menu.operation: return handleMenuNewTrain(operates);
case SectionOperation.alxeEffective.menu.operation: return handleMenuAlxeEffective(operates);
case SectionOperation.alxeEffective.menu.operation: return handleMenuAlxeEffective(operates);
case SectionOperation.setLimitSpeed.menu.operation: return handleMenuSetLimitSpeed(operates);
}
}
}
case SectionOperation.setLimitSpeed.menu.operation: return handleMenuSetLimitSpeed(operates);
}
}
}
};
/**
@ -60,19 +60,19 @@ export default {
* @param {*} operates
*/
function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -80,19 +80,19 @@ function handleMenuCancelStopPage(operates) {
* @param {*} operates
*/
function handleMenuFailure(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.stoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.stoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -100,19 +100,19 @@ function handleMenuFailure(operates) {
* @param {*} operates
*/
function handleMenuAlxeFailure(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.alxeFailure.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.alxeFailure.event
};
}
return { error: true };
}
return null;
}
/**
@ -120,28 +120,28 @@ function handleMenuAlxeFailure(operates) {
* @param {*} operates
*/
function handleMenuFault(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
if (operate.code) {
let val = '';
const counter = store.getters['map/getCounterBySectionCode'](operate.code, '01');
if (counter) {
val = localStore.get(counter.code);
}
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
if (operate.code) {
let val = '';
const counter = store.getters['map/getCounterBySectionCode'](operate.code, '01');
if (counter) {
val = localStore.get(counter.code);
}
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.fault.event,
val: val
};
}
}
return { error: true };
}
return null;
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.fault.event,
val: val
};
}
}
return { error: true };
}
return null;
}
/**
@ -149,20 +149,20 @@ function handleMenuFault(operates) {
* @param {*} operates
*/
function handleMenuLock(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.lock.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.lock.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -170,20 +170,20 @@ function handleMenuLock(operates) {
* @param {*} operates
*/
function handleMenuUnlock(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.unlock.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.unlock.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -191,20 +191,20 @@ function handleMenuUnlock(operates) {
* @param {*} operates
*/
function handleMenuSplit(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.split.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.split.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -212,20 +212,20 @@ function handleMenuSplit(operates) {
* @param {*} operates
*/
function handleMenuActive(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.active.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.active.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -234,20 +234,20 @@ function handleMenuActive(operates) {
*/
function handleMenuSetSpeed(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.setSpeed.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.setSpeed.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -256,30 +256,30 @@ function handleMenuSetSpeed(operates) {
*/
function handleMenuCancelSpeed(operates) {
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: SectionOperation.cancelSpeed.event.query
};
}
return { error: true };
} else if (operates.length >= 3) {
const operate = operates[operates.length - 1];
if (operate.type === SectionType && operates[0].code) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: SectionOperation.cancelSpeed.event.confirm
};
}
return { error: true };
}
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: SectionOperation.cancelSpeed.event.query
};
}
return { error: true };
} else if (operates.length >= 3) {
const operate = operates[operates.length - 1];
if (operate.type === SectionType && operates[0].code) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: SectionOperation.cancelSpeed.event.confirm
};
}
return { error: true };
}
return null;
return null;
}
/**
@ -288,20 +288,20 @@ function handleMenuCancelSpeed(operates) {
*/
function handleMenuAxlePreReset(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.axlePreReset.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.axlePreReset.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -310,20 +310,20 @@ function handleMenuAxlePreReset(operates) {
*/
function handleMenuDetail(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.detail.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.detail.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -331,20 +331,20 @@ function handleMenuDetail(operates) {
* @param {*} operates
*/
function handleMenuNewTrain(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.newtrain.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.newtrain.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -352,20 +352,20 @@ function handleMenuNewTrain(operates) {
* @param {*} operates
*/
function handleMenuAlxeEffective(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.alxeEffective.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.alxeEffective.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -373,27 +373,27 @@ function handleMenuAlxeEffective(operates) {
* @param {*} operates
*/
function handleMenuSetLimitSpeed(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.setLimitSpeed.event,
val: operates[operates.length - 1].val
};
} else if (operate.type === MapDeviceType.Switch.type && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.setLimitSpeed.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.setLimitSpeed.event,
val: operates[operates.length - 1].val
};
} else if (operate.type === MapDeviceType.Switch.type && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.setLimitSpeed.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
}
/**
@ -401,19 +401,19 @@ function handleMenuSetLimitSpeed(operates) {
* @param {*} operates
*/
function handleButtonFault(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
// over: true,
operation: SectionOperation.fault.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
// over: true,
operation: SectionOperation.fault.event
};
}
return { error: true };
}
return null;
}
/**
@ -421,17 +421,17 @@ function handleButtonFault(operates) {
* @param {*} operates
*/
function handleButtonAxlePreReset(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.axlePreReset.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SectionType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SectionOperation.axlePreReset.event
};
}
return { error: true };
}
return null;
}

View File

@ -5,38 +5,38 @@ const StationControlOperation = OperationEvent.StationControl;
const StationControlType = MapDeviceType.StationControl.type;
export default {
test: function (operates) {
const operateType = getOperateTypeBy('StationControl', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case StationControlOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
test: function (operates) {
const operateType = getOperateTypeBy('StationControl', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case StationControlOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case StationControlOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case StationControlOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case StationControlOperation.emergencyStationControl.menu.operation: return handleMenuEmergencyStationControl(operates);
case StationControlOperation.emergencyStationControl.menu.operation: return handleMenuEmergencyStationControl(operates);
case StationControlOperation.requestStationControl.menu.operation: return handleMenuRequestStationControl(operates);
case StationControlOperation.requestStationControl.mbar.operation: return handleBarRequestStationControl(operates);
case StationControlOperation.requestStationControl.menu.operation: return handleMenuRequestStationControl(operates);
case StationControlOperation.requestStationControl.mbar.operation: return handleBarRequestStationControl(operates);
case StationControlOperation.forcedStationControl.menu.operation: return handleMenuForcedStationControl(operates);
case StationControlOperation.forcedStationControl.passwordConfirm.operation: return handleBarForcedStationControl(operates);
case StationControlOperation.forcedStationControl.mbar.operation: return handleBarForcedStationControl(operates);
case StationControlOperation.forcedStationControl.menu.operation: return handleMenuForcedStationControl(operates);
case StationControlOperation.forcedStationControl.passwordConfirm.operation: return handleBarForcedStationControl(operates);
case StationControlOperation.forcedStationControl.mbar.operation: return handleBarForcedStationControl(operates);
case StationControlOperation.requestCentralControl.menu.operation: return handleMenuRequestCentralControl(operates);
case StationControlOperation.requestCentralControl.mbar.operation: return handleBarRequestCentralControl(operates);
case StationControlOperation.requestCentralControl.menu.operation: return handleMenuRequestCentralControl(operates);
case StationControlOperation.requestCentralControl.mbar.operation: return handleBarRequestCentralControl(operates);
case StationControlOperation.controlResponse.menu.operation: return handleMenuControlResponse(operates);
}
}
}
case StationControlOperation.controlResponse.menu.operation: return handleMenuControlResponse(operates);
}
}
}
};
/**
@ -44,19 +44,19 @@ export default {
* @param {*} operates
*/
export function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === StationControlType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationControlOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === StationControlType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationControlOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -64,19 +64,19 @@ export function handleMenuCancelStopPage(operates) {
* @param {*} operates
*/
export function handleMenuStoppage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === StationControlType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationControlOperation.stoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === StationControlType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationControlOperation.stoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -84,20 +84,20 @@ export function handleMenuStoppage(operates) {
* @param {*} operates
*/
export function handleMenuEmergencyStationControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.emergencyStationControl.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.emergencyStationControl.event
};
}
return { error: true };
}
return null;
}
/**
@ -105,20 +105,20 @@ export function handleMenuEmergencyStationControl(operates) {
* @param {*} operates
*/
export function handleMenuRequestStationControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.requestStationControl.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.requestStationControl.event
};
}
return { error: true };
}
return null;
}
/**
@ -126,20 +126,20 @@ export function handleMenuRequestStationControl(operates) {
* @param {*} operates
*/
export function handleMenuForcedStationControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.forcedStationControl.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.forcedStationControl.event
};
}
return { error: true };
}
return null;
}
/**
@ -147,20 +147,20 @@ export function handleMenuForcedStationControl(operates) {
* @param {*} operates
*/
export function handleMenuRequestCentralControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.requestCentralControl.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: StationControlOperation.requestCentralControl.event
};
}
return { error: true };
}
return null;
}
/**
@ -168,35 +168,35 @@ export function handleMenuRequestCentralControl(operates) {
* @param {*} operates
*/
export function handleMenuControlResponse(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
let operation = '';
if (operate.operation == StationControlOperation.controlResponse.agree.operation) {
if (operate.prdType == '01') {
operation = StationControlOperation.controlResponse.event.stationAgree;
} else {
operation = StationControlOperation.controlResponse.event.centralAgree;
}
} else {
if (operate.prdType == '01') {
operation = StationControlOperation.controlResponse.event.stationRefuse;
} else {
operation = StationControlOperation.controlResponse.event.centralRefuse;
}
}
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
let operation = '';
if (operate.operation == StationControlOperation.controlResponse.agree.operation) {
if (operate.prdType == '01') {
operation = StationControlOperation.controlResponse.event.stationAgree;
} else {
operation = StationControlOperation.controlResponse.event.centralAgree;
}
} else {
if (operate.prdType == '01') {
operation = StationControlOperation.controlResponse.event.stationRefuse;
} else {
operation = StationControlOperation.controlResponse.event.centralRefuse;
}
}
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: operation
};
}
return { error: true };
}
return null;
return {
type: operate.type,
val: operate.val,
code: operate.code,
over: true,
operation: operation
};
}
return { error: true };
}
return null;
}
/**
@ -204,18 +204,18 @@ export function handleMenuControlResponse(operates) {
* @param {*} operates
*/
export function handleBarRequestStationControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
operation: StationControlOperation.requestStationControl.event,
code: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
operation: StationControlOperation.requestStationControl.event,
code: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -223,18 +223,18 @@ export function handleBarRequestStationControl(operates) {
* @param {*} operates
*/
export function handleBarForcedStationControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
code: operate.val,
operation: StationControlOperation.forcedStationControl.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
code: operate.val,
operation: StationControlOperation.forcedStationControl.event
};
}
return { error: true };
}
return null;
}
/**
@ -242,16 +242,16 @@ export function handleBarForcedStationControl(operates) {
* @param {*} operates
*/
export function handleBarRequestCentralControl(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
code: operate.val,
operation: StationControlOperation.requestCentralControl.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationControlType && operate.val) {
return {
type: operate.type,
code: operate.val,
operation: StationControlOperation.requestCentralControl.event
};
}
return { error: true };
}
return null;
}

View File

@ -6,7 +6,7 @@ const StationType = MapDeviceType.Station.type;
export default {
test: function (operates) {
let operateType = getOperateTypeBy('Station', operates[0].operation);
const operateType = getOperateTypeBy('Station', operates[0].operation);
if (operateType) {
return true;
} else {
@ -15,23 +15,23 @@ export default {
},
convert: function (operates) {
if (operates && operates.length) {
let operation = operates[0].operation;
const operation = operates[0].operation;
switch (operation) {
case StationOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case StationOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case StationOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case StationOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case StationOperation.setAutoTrigger.menu.operation: return handleMenuSetAutoTrigger(operates);
case StationOperation.setAutoTrigger.menu.operation: return handleMenuSetAutoTrigger(operates);
case StationOperation.cancelAutoTrigger.menu.operation: return handleMenuCancelAutoTrigger(operates);
case StationOperation.cancelAutoTrigger.menu.operation: return handleMenuCancelAutoTrigger(operates);
case StationOperation.powerUnLock.menu.operation: return handleMenuPowerUnLock(operates);
case StationOperation.powerUnLock.menu.operation: return handleMenuPowerUnLock(operates);
case StationOperation.execKeyOperationTest.menu.operation: return handleMenuExecKeyOperationTest(operates);
case StationOperation.execKeyOperationTest.menu.operation: return handleMenuExecKeyOperationTest(operates);
case StationOperation.humanControlALL.menu.operation: return handleMenuHumanControlAll(operates);
case StationOperation.humanControlALL.menu.operation: return handleMenuHumanControlAll(operates);
case StationOperation.atsAutoControlALL.menu.operation: return handleMenuAtsAutoControlAll(operates);
case StationOperation.atsAutoControlALL.menu.operation: return handleMenuAtsAutoControlAll(operates);
}
}
}
@ -43,13 +43,13 @@ export default {
*/
function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationOperation.cancelStoppage.event,
operation: StationOperation.cancelStoppage.event
};
}
return { error: true };
@ -57,14 +57,13 @@ function handleMenuCancelStopPage(operates) {
return null;
}
/**
* 处理右键菜单 设置故障 操作
* @param {*} operates
*/
function handleMenuStoppage(operates) {
if (operates.length >= 1) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
@ -84,7 +83,7 @@ function handleMenuStoppage(operates) {
*/
function handleMenuSetAutoTrigger(operates) {
if (operates.length >= 1) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
@ -104,7 +103,7 @@ function handleMenuSetAutoTrigger(operates) {
*/
function handleMenuCancelAutoTrigger(operates) {
if (operates.length >= 1) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
@ -124,7 +123,7 @@ function handleMenuCancelAutoTrigger(operates) {
*/
function handleMenuPowerUnLock(operates) {
if (operates.length >= 2) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
@ -144,7 +143,7 @@ function handleMenuPowerUnLock(operates) {
*/
function handleMenuExecKeyOperationTest(operates) {
if (operates.length >= 2) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
@ -158,14 +157,13 @@ function handleMenuExecKeyOperationTest(operates) {
return null;
}
/**
* 处理右键菜单 所有进路自排关 操作
* @param {*} operates
*/
function handleMenuHumanControlAll(operates) {
if (operates.length >= 1) {
let operate = operates[0];
const operate = operates[0];
if (operate.type === StationType && operate.code) {
return {
type: operate.type,
@ -185,7 +183,7 @@ function handleMenuHumanControlAll(operates) {
*/
function handleMenuAtsAutoControlAll(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
const operate = operates[operates.length - 1];
if (operate.type === StationType && operates[0].code) {
return {
type: operate.type,

View File

@ -5,54 +5,54 @@ const StationStandOperation = OperationEvent.StationStand;
const StationStandType = MapDeviceType.StationStand.type;
export default {
test: function (operates) {
let operateType = getOperateTypeBy('StationStand', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
let operation = operates[0].operation;
switch (operation) {
case StationStandOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
test: function (operates) {
const operateType = getOperateTypeBy('StationStand', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case StationStandOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case StationStandOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case StationStandOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case StationStandOperation.earlyDeparture.menu.operation: return handleMenuEarlyDeparture(operates);
case StationStandOperation.earlyDeparture.menu.operation: return handleMenuEarlyDeparture(operates);
case StationStandOperation.setJumpStop.menu.operation: return handleMenuSetJumpStop(operates);
case StationStandOperation.setJumpStop.menu.operation: return handleMenuSetJumpStop(operates);
case StationStandOperation.cancelJumpStop.menu.operation: return handleMenuCancelJumpStop(operates);
case StationStandOperation.cancelJumpStop.menu.operation: return handleMenuCancelJumpStop(operates);
case StationStandOperation.setDetainTrain.menu.operation: return handleMenuSetDetainTrain(operates);
case StationStandOperation.setDetainTrain.menu.operation: return handleMenuSetDetainTrain(operates);
case StationStandOperation.cancelDetainTrain.menu.operation: return handleMenuCancelDetainTrain(operates);
case StationStandOperation.cancelDetainTrain.menu.operation: return handleMenuCancelDetainTrain(operates);
case StationStandOperation.cancelDetainTrainForce.menu.operation: return handleMenuCancelDetainTrainForce(operates);
case StationStandOperation.cancelDetainTrainForce.menu.operation: return handleMenuCancelDetainTrainForce(operates);
case StationStandOperation.detail.menu.operation: return handleMenuDetail(operates);
case StationStandOperation.detail.menu.operation: return handleMenuDetail(operates);
case StationStandOperation.cancelDetainTrainAll.menu.operation: return handleMenuCancelDetainTrainAll(operates);
case StationStandOperation.cancelDetainTrainAll.menu.operation: return handleMenuCancelDetainTrainAll(operates);
case StationStandOperation.setStopTime.menu.operation: return handleMenuSetStopTime(operates);
case StationStandOperation.setStopTime.menu.operation: return handleMenuSetStopTime(operates);
case StationStandOperation.setRunLevel.menu.operation: return handleMenuSetRunLevel(operates);
case StationStandOperation.setRunLevel.menu.operation: return handleMenuSetRunLevel(operates);
case StationStandOperation.setBackStrategy.menu.operation: return handleMenuSetBackStrategy(operates);
case StationStandOperation.setBackStrategy.menu.operation: return handleMenuSetBackStrategy(operates);
case StationStandOperation.setDetainTrainAll.mbar.operation: return handleMbarSetDetainTrainAll(operates);
case StationStandOperation.setDetainTrainAll.mbar.operation: return handleMbarSetDetainTrainAll(operates);
case StationStandOperation.cancelDetainTrainAll.mbar.operation: return handleMbarCancelDetainTrainAll(operates);
case StationStandOperation.cancelDetainTrainAll.mbar.operation: return handleMbarCancelDetainTrainAll(operates);
case StationStandOperation.cancelUpDetainTrainAll.mbar.operation: return handleMbarCancelUpDetainTrainAll(operates);
case StationStandOperation.cancelUpDetainTrainAll.mbar.operation: return handleMbarCancelUpDetainTrainAll(operates);
case StationStandOperation.cancelDownDetainTrainAll.mbar.operation: return handleMbarCancelDownDetainTrainAll(operates);
}
}
}
case StationStandOperation.cancelDownDetainTrainAll.mbar.operation: return handleMbarCancelDownDetainTrainAll(operates);
}
}
}
};
/**
@ -60,19 +60,19 @@ export default {
* @param {*} operates
*/
function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
let operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationStandOperation.cancelStoppage.event,
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationStandOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -80,19 +80,19 @@ function handleMenuCancelStopPage(operates) {
* @param {*} operates
*/
function handleMenuStoppage(operates) {
if (operates.length >= 1) {
let operate = operates[0];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationStandOperation.stoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: StationStandOperation.stoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -100,20 +100,20 @@ function handleMenuStoppage(operates) {
* @param {*} operates
*/
function handleMenuEarlyDeparture(operates) {
if (operates.length > 0) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.earlyDeparture.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.earlyDeparture.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -121,20 +121,20 @@ function handleMenuEarlyDeparture(operates) {
* @param {*} operates
*/
function handleMenuSetJumpStop(operates) {
if (operates.length > 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.setJumpStop.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length > 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.setJumpStop.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -142,41 +142,40 @@ function handleMenuSetJumpStop(operates) {
* @param {*} operates
*/
function handleMenuCancelJumpStop(operates) {
if (operates.length > 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.cancelJumpStop.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length > 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.cancelJumpStop.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 设置扣车 操作
* @param {*} operates
*/
function handleMenuSetDetainTrain(operates) {
if (operates.length > 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.setDetainTrain.event
};
}
return { error: true };
}
return null;
if (operates.length > 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.setDetainTrain.event
};
}
return { error: true };
}
return null;
}
/**
@ -184,21 +183,21 @@ function handleMenuSetDetainTrain(operates) {
* @param {*} operates
*/
function handleMenuCancelDetainTrain(operates) {
if (operates.length > 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
// operation: operate.operation,
operation: StationStandOperation.cancelDetainTrain.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length > 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
// operation: operate.operation,
operation: StationStandOperation.cancelDetainTrain.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -206,19 +205,19 @@ function handleMenuCancelDetainTrain(operates) {
* @param {*} operates
*/
function handleMenuCancelDetainTrainForce(operates) {
if (operates.length > 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.cancelDetainTrainForce.event
};
}
return { error: true };
}
return null;
if (operates.length > 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.cancelDetainTrainForce.event
};
}
return { error: true };
}
return null;
}
/**
@ -226,19 +225,19 @@ function handleMenuCancelDetainTrainForce(operates) {
* @param {*} operates
*/
function handleMenuDetail(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.detail.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.detail.event
};
}
return { error: true };
}
return null;
}
/**
@ -246,20 +245,20 @@ function handleMenuDetail(operates) {
* @param {*} operates
*/
function handleMenuCancelDetainTrainAll(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.cancelDetainTrainAll.event,
val: operate.val,
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: StationStandOperation.cancelDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -267,31 +266,31 @@ function handleMenuCancelDetainTrainAll(operates) {
* @param {*} operates
*/
function handleMenuSetStopTime(operates) {
if (operates.length == 1) {
let operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: StationStandOperation.setStopTime.event.query,
};
}
return { error: true };
} else if (operates.length >= 2) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType && operate.val) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: StationStandOperation.setStopTime.event.confirm,
val: operate.val
};
}
return { error: true };
}
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: StationStandOperation.setStopTime.event.query
};
}
return { error: true };
} else if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType && operate.val) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: StationStandOperation.setStopTime.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
return null;
}
/**
@ -299,30 +298,30 @@ function handleMenuSetStopTime(operates) {
* @param {*} operates
*/
function handleMenuSetRunLevel(operates) {
if (operates.length == 1) {
let operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: StationStandOperation.setRunLevel.event.query,
};
}
return { error: true };
} else if (operates.length >= 2) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType && operate.val) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: StationStandOperation.setRunLevel.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: StationStandOperation.setRunLevel.event.query
};
}
return { error: true };
} else if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType && operate.val) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: StationStandOperation.setRunLevel.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -330,51 +329,50 @@ function handleMenuSetRunLevel(operates) {
* @param {*} operates
*/
function handleMenuSetBackStrategy(operates) {
if (operates.length == 1) {
let operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: StationStandOperation.setBackStrategy.event.query,
};
}
return { error: true };
} else if (operates.length >= 2) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType && operate.val) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: StationStandOperation.setBackStrategy.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === StationStandType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: StationStandOperation.setBackStrategy.event.query
};
}
return { error: true };
} else if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType && operate.val) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: StationStandOperation.setBackStrategy.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理菜单栏 设置全线扣车 操作
* @param {*} operates
*/
function handleMbarSetDetainTrainAll(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.setDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.setDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -382,19 +380,19 @@ function handleMbarSetDetainTrainAll(operates) {
* @param {*} operates
*/
function handleMbarCancelDetainTrainAll(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.cancelDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.cancelDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -402,19 +400,19 @@ function handleMbarCancelDetainTrainAll(operates) {
* @param {*} operates
*/
function handleMbarCancelUpDetainTrainAll(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.cancelUpDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.cancelUpDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -422,17 +420,17 @@ function handleMbarCancelUpDetainTrainAll(operates) {
* @param {*} operates
*/
function handleMbarCancelDownDetainTrainAll(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.cancelDownDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === StationStandType) {
return {
type: operate.type,
code: operate.val,
operation: StationStandOperation.cancelDownDetainTrainAll.event,
val: operate.val
};
}
return { error: true };
}
return null;
}

View File

@ -5,58 +5,58 @@ const SwitchOperation = OperationEvent.Switch;
const SwitchType = MapDeviceType.Switch.type;
export default {
test: function (operates) {
const operateType = getOperateTypeBy('Switch', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case SwitchOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
test: function (operates) {
const operateType = getOperateTypeBy('Switch', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case SwitchOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case SwitchOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case SwitchOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case SwitchOperation.locate.button.operation: return handleButtonLocate(operates);
case SwitchOperation.locate.menu.operation: return handleMenuLocate(operates);
case SwitchOperation.locate.button.operation: return handleButtonLocate(operates);
case SwitchOperation.locate.menu.operation: return handleMenuLocate(operates);
case SwitchOperation.reverse.button.operation: return handleButtonReverse(operates);
case SwitchOperation.reverse.menu.operation: return handleMenuReverse(operates);
case SwitchOperation.reverse.button.operation: return handleButtonReverse(operates);
case SwitchOperation.reverse.menu.operation: return handleMenuReverse(operates);
case SwitchOperation.lock.button.operation: return handleButtonLock(operates);
case SwitchOperation.lock.menu.operation: return handleMenuLock(operates);
case SwitchOperation.lock.button.operation: return handleButtonLock(operates);
case SwitchOperation.lock.menu.operation: return handleMenuLock(operates);
case SwitchOperation.unlock.button.operation: return handleButtonUnlock(operates);
case SwitchOperation.unlock.menu.operation: return handleMenuUnlock(operates);
case SwitchOperation.unlock.button.operation: return handleButtonUnlock(operates);
case SwitchOperation.unlock.menu.operation: return handleMenuUnlock(operates);
case SwitchOperation.block.menu.operation: return handleMenuBlock(operates);
case SwitchOperation.block.menu.operation: return handleMenuBlock(operates);
case SwitchOperation.unblock.menu.operation: return handleMenuUnblock(operates);
case SwitchOperation.unblock.menu.operation: return handleMenuUnblock(operates);
case SwitchOperation.turnout.menu.operation: return handleMenuTurnout(operates);
case SwitchOperation.turnout.menu.operation: return handleMenuTurnout(operates);
case SwitchOperation.turnoutForce.menu.operation: return handleMenuTurnoutForce(operates);
case SwitchOperation.turnoutForce.menu.operation: return handleMenuTurnoutForce(operates);
case SwitchOperation.fault.menu.operation: return handleMenuFault(operates);
case SwitchOperation.fault.menu.operation: return handleMenuFault(operates);
case SwitchOperation.axlePreReset.menu.operation: return handleMenuAxlePreReset(operates);
case SwitchOperation.axlePreReset.menu.operation: return handleMenuAxlePreReset(operates);
case SwitchOperation.split.menu.operation: return handleMenuSplit(operates);
case SwitchOperation.split.menu.operation: return handleMenuSplit(operates);
case SwitchOperation.active.menu.operation: return handleMenuActive(operates);
case SwitchOperation.active.menu.operation: return handleMenuActive(operates);
case SwitchOperation.setSpeed.menu.operation: return handleMenuSetSpeed(operates);
case SwitchOperation.setSpeed.menu.operation: return handleMenuSetSpeed(operates);
case SwitchOperation.cancelSpeed.menu.operation: return handleMenuCancelSpeed(operates);
case SwitchOperation.cancelSpeed.menu.operation: return handleMenuCancelSpeed(operates);
case SwitchOperation.alxeEffective.menu.operation: return handleMenuAlxeEffective(operates);
}
}
}
case SwitchOperation.alxeEffective.menu.operation: return handleMenuAlxeEffective(operates);
}
}
}
};
/**
@ -64,19 +64,19 @@ export default {
* @param {*} operates
*/
function handleButtonLocate(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.locate.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.locate.event
};
}
return { error: true };
}
return null;
}
/**
@ -84,19 +84,19 @@ function handleButtonLocate(operates) {
* @param {*} operates
*/
function handleButtonReverse(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.reverse.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.reverse.event
};
}
return { error: true };
}
return null;
}
/**
@ -104,19 +104,19 @@ function handleButtonReverse(operates) {
* @param {*} operates
*/
function handleButtonLock(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.lock.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.lock.event
};
}
return { error: true };
}
return null;
}
/**
@ -124,19 +124,19 @@ function handleButtonLock(operates) {
* @param {*} operates
*/
function handleButtonUnlock(operates) {
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.unlock.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.unlock.event
};
}
return { error: true };
}
return null;
}
/**
@ -144,19 +144,19 @@ function handleButtonUnlock(operates) {
* @param {*} operates
*/
function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -164,19 +164,19 @@ function handleMenuCancelStopPage(operates) {
* @param {*} operates
*/
function handleMenuStoppage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.stoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.stoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -184,19 +184,19 @@ function handleMenuStoppage(operates) {
* @param {*} operates
*/
function handleMenuLocate(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.locate.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.locate.event
};
}
return { error: true };
}
return null;
}
/**
@ -204,19 +204,19 @@ function handleMenuLocate(operates) {
* @param {*} operates
*/
function handleMenuReverse(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.reverse.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.reverse.event
};
}
return { error: true };
}
return null;
}
/**
@ -224,19 +224,19 @@ function handleMenuReverse(operates) {
* @param {*} operates
*/
function handleMenuLock(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.lock.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.lock.event
};
}
return { error: true };
}
return null;
}
/**
@ -244,19 +244,19 @@ function handleMenuLock(operates) {
* @param {*} operates
*/
function handleMenuUnlock(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.unlock.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.unlock.event
};
}
return { error: true };
}
return null;
}
/**
@ -264,19 +264,19 @@ function handleMenuUnlock(operates) {
* @param {*} operates
*/
function handleMenuBlock(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.block.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.block.event
};
}
return { error: true };
}
return null;
}
/**
@ -284,19 +284,19 @@ function handleMenuBlock(operates) {
* @param {*} operates
*/
function handleMenuUnblock(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.unblock.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.unblock.event
};
}
return { error: true };
}
return null;
}
/**
@ -304,19 +304,19 @@ function handleMenuUnblock(operates) {
* @param {*} operates
*/
function handleMenuFault(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.fault.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.fault.event
};
}
return { error: true };
}
return null;
}
/**
@ -324,19 +324,19 @@ function handleMenuFault(operates) {
* @param {*} operates
*/
function handleMenuTurnout(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.turnout.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.turnout.event
};
}
return { error: true };
}
return null;
}
/**
@ -344,19 +344,19 @@ function handleMenuTurnout(operates) {
* @param {*} operates
*/
function handleMenuTurnoutForce(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.turnoutForce.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.turnoutForce.event
};
}
return { error: true };
}
return null;
}
/**
@ -364,19 +364,19 @@ function handleMenuTurnoutForce(operates) {
* @param {*} operates
*/
function handleMenuAxlePreReset(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.axlePreReset.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.axlePreReset.event
};
}
return { error: true };
}
return null;
}
/**
@ -384,19 +384,19 @@ function handleMenuAxlePreReset(operates) {
* @param {*} operates
*/
function handleMenuSplit(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.split.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.split.event
};
}
return { error: true };
}
return null;
}
/**
@ -404,19 +404,19 @@ function handleMenuSplit(operates) {
* @param {*} operates
*/
function handleMenuActive(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.active.event
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.active.event
};
}
return { error: true };
}
return null;
}
/**
@ -424,20 +424,20 @@ function handleMenuActive(operates) {
* @param {*} operates
*/
function handleMenuSetSpeed(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.setSpeed.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.setSpeed.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}
/**
@ -445,29 +445,29 @@ function handleMenuSetSpeed(operates) {
* @param {*} operates
*/
function handleMenuCancelSpeed(operates) {
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: SwitchOperation.cancelSpeed.event.query
};
}
return { error: true };
} else if (operates.length >= 3) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operates[0].code) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: SwitchOperation.cancelSpeed.event.confirm
};
}
return { error: true };
}
return null;
if (operates.length == 1) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
operation: SwitchOperation.cancelSpeed.event.query
};
}
return { error: true };
} else if (operates.length >= 3) {
const operate = operates[operates.length - 1];
if (operate.type === SwitchType && operates[0].code) {
return {
over: true,
type: operate.type,
code: operates[0].code,
operation: SwitchOperation.cancelSpeed.event.confirm
};
}
return { error: true };
}
return null;
}
/**
@ -475,18 +475,18 @@ function handleMenuCancelSpeed(operates) {
* @param {*} operates
*/
function handleMenuAlxeEffective(operates) {
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.alxeEffective.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
if (operates.length >= 2) {
const operate = operates[0];
if (operate.type === SwitchType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: SwitchOperation.alxeEffective.event,
val: operates[operates.length - 1].val
};
}
return { error: true };
}
return null;
}

View File

@ -5,47 +5,47 @@ const TrainOperation = OperationEvent.Train;
const TrainType = MapDeviceType.Train.type;
export default {
test: function (operates) {
const operateType = getOperateTypeBy('Train', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case TrainOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
test: function (operates) {
const operateType = getOperateTypeBy('Train', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case TrainOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case TrainOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case TrainOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case TrainOperation.addTrainId.menu.operation: return handleMenuAddTrainId(operates);
case TrainOperation.addTrainId.menu.operation: return handleMenuAddTrainId(operates);
case TrainOperation.editTrainId.menu.operation: return handleMenuEditTrainId(operates);
case TrainOperation.editTrainId.menu.operation: return handleMenuEditTrainId(operates);
case TrainOperation.delTrainId.menu.operation: return handleMenuDelTrainId(operates);
case TrainOperation.delTrainId.menu.operation: return handleMenuDelTrainId(operates);
case TrainOperation.moveTrainId.menu.operation: return handleMenuMoveTrainId(operates);
case TrainOperation.moveTrainId.menu.operation: return handleMenuMoveTrainId(operates);
case TrainOperation.switchTrainId.menu.operation: return handleMenuSwitchTrainId(operates);
case TrainOperation.switchTrainId.menu.operation: return handleMenuSwitchTrainId(operates);
case TrainOperation.editTrainNo.menu.operation: return handleMenuEditTrainNo(operates);
case TrainOperation.editTrainNo.menu.operation: return handleMenuEditTrainNo(operates);
case TrainOperation.limitSpeed.menu.operation: return handleMenuLimitSpeed(operates);
case TrainOperation.limitSpeed.menu.operation: return handleMenuLimitSpeed(operates);
case TrainOperation.setPlanTrainId.menu.operation: return handleMenuSetPlanTrainId(operates);
case TrainOperation.setPlanTrainId.menu.operation: return handleMenuSetPlanTrainId(operates);
case TrainOperation.addPlanTrainId.menu.operation: return handleMenuAddPlanTrainId(operates);
case TrainOperation.addPlanTrainId.menu.operation: return handleMenuAddPlanTrainId(operates);
case TrainOperation.moveEventlyTrainId.menu.operation: return handleMenuMoveEventlyTrainId(operates);
case TrainOperation.moveEventlyTrainId.menu.operation: return handleMenuMoveEventlyTrainId(operates);
case TrainOperation.deletePlanTrainId.menu.operation: return handleMenuDeletePlanTrainId(operates);
case TrainOperation.deletePlanTrainId.menu.operation: return handleMenuDeletePlanTrainId(operates);
}
}
}
}
}
}
};
/**
@ -53,19 +53,19 @@ export default {
* @param {*} operates
*/
function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -73,19 +73,19 @@ function handleMenuCancelStopPage(operates) {
* @param {*} operates
*/
function handleMenuStoppage(operates) {
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.stoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.stoppage.event
};
}
return { error: true };
}
return null;
}
/**
@ -93,20 +93,20 @@ function handleMenuStoppage(operates) {
* @param {*} operates
*/
function handleMenuAddTrainId(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.addTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.addTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -114,31 +114,31 @@ function handleMenuAddTrainId(operates) {
* @param {*} operates
*/
function handleMenuEditTrainId(operates) {
if (operates.length == 2) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
operation: TrainOperation.editTrainId.event.query,
val: operate.val
};
}
return { error: true };
} else if (operates.length > 2) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.editTrainId.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length == 2) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
operation: TrainOperation.editTrainId.event.query,
val: operate.val
};
}
return { error: true };
} else if (operates.length > 2) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.editTrainId.event.confirm,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -146,20 +146,20 @@ function handleMenuEditTrainId(operates) {
* @param {*} operates
*/
function handleMenuDelTrainId(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.delTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.delTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -167,20 +167,20 @@ function handleMenuDelTrainId(operates) {
* @param {*} operates
*/
function handleMenuMoveTrainId(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.moveTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.moveTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -188,20 +188,20 @@ function handleMenuMoveTrainId(operates) {
* @param {*} operates
*/
function handleMenuSwitchTrainId(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.switchTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.switchTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -209,20 +209,20 @@ function handleMenuSwitchTrainId(operates) {
* @param {*} operates
*/
function handleMenuEditTrainNo(operates) {
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operate[0].code,
over: true,
operation: TrainOperation.editTrainNo.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operate[0].code,
over: true,
operation: TrainOperation.editTrainNo.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -231,19 +231,19 @@ function handleMenuEditTrainNo(operates) {
*/
function handleMenuLimitSpeed(operates) {
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.limitSpeed.event
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.limitSpeed.event
};
}
return { error: true };
}
return null;
}
/**
@ -252,64 +252,64 @@ function handleMenuLimitSpeed(operates) {
*/
function handleMenuSetPlanTrainId(operates) {
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.setPlanTrainId.event
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.setPlanTrainId.event
};
}
return { error: true };
}
return null;
}
function handleMenuAddPlanTrainId(operates) {
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.addPlanTrainId.event
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.addPlanTrainId.event
};
}
return { error: true };
}
return null;
}
function handleMenuMoveEventlyTrainId(operates) {
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.moveEventlyTrainId.event
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.moveEventlyTrainId.event
};
}
return { error: true };
}
return null;
}
function handleMenuDeletePlanTrainId(operates) {
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.deletePlanTrainId.event
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.deletePlanTrainId.event
};
}
return { error: true };
}
return null;
}

View File

@ -9,32 +9,32 @@ import CancelLimitOperationConverter from './CancelLimitOperationConverter';
import MixinOperationConverter from './MixinOperationConverter';
export function getConverter(operates) {
if (SwitchOperationConverter.test(operates)) {
return SwitchOperationConverter;
if (SwitchOperationConverter.test(operates)) {
return SwitchOperationConverter;
} else if (SignalOperationConverter.test(operates)) {
return SignalOperationConverter;
} else if (SignalOperationConverter.test(operates)) {
return SignalOperationConverter;
} else if (StationControlOperationConverter.test(operates)) {
return StationControlOperationConverter;
} else if (StationControlOperationConverter.test(operates)) {
return StationControlOperationConverter;
} else if (StationOperationConverter.test(operates)) {
return StationOperationConverter;
} else if (StationOperationConverter.test(operates)) {
return StationOperationConverter;
} else if (SectionOperationConverter.test(operates)) {
return SectionOperationConverter;
} else if (SectionOperationConverter.test(operates)) {
return SectionOperationConverter;
} else if (StationStandOperationConverter.test(operates)) {
return StationStandOperationConverter;
} else if (StationStandOperationConverter.test(operates)) {
return StationStandOperationConverter;
} else if (TrainOperationConverter.test(operates)) {
return TrainOperationConverter;
} else if (TrainOperationConverter.test(operates)) {
return TrainOperationConverter;
} else if (CancelLimitOperationConverter.test(operates)) {
return CancelLimitOperationConverter;
} else if (CancelLimitOperationConverter.test(operates)) {
return CancelLimitOperationConverter;
} else if (MixinOperationConverter.test(operates)) {
return MixinOperationConverter;
} else if (MixinOperationConverter.test(operates)) {
return MixinOperationConverter;
}
}
}

View File

@ -1,9 +1,9 @@
import store from '@/store';
import router from '@/router';
import OperateHandler from '@/scripts/plugin/OperateHandler';
import { sendCommand } from '@/api/jmap/training';
import { OperationEvent } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { getConverter } from '@/scripts/plugin/converter/manager';
import { getConverter } from '@/scripts/plugin/Converter/manager';
var OperateConverter = function () { };
OperateConverter.prototype = {

View File

@ -1,147 +0,0 @@
import store from '@/store';
import router from '@/router';
import OperateConverter from '@/scripts/plugin/operateConvert2Command';
import { TrainingMode } from '@/scripts/ConstDic';
import { getConverter } from '@/scripts/plugin/converter/manager';
import { sendTrainingNextStep } from '@/api/jmap/training';
import { Message } from 'element-ui';
import LangStorage from '@/utils/lang';
var OperateHandler = function () {
};
OperateHandler.prototype = {
/** 操作组 */
operates: [],
backStep: function(num) {
this.operates = this.operates.slice(0, num);
},
/** 清空操作组 */
cleanOperates: function () {
this.operates.splice(0, this.operates.length);
},
/**
* 判断操作步骤是否正确
*/
judge: function (operate) {
let valid = false;
const steps = this.getSteps();
const order = this.getOrder();
if (order >= steps) {
return valid;
}
// debugger;
const standard = steps[order];
if (operate && standard && operate.code == standard.code && operate.type == standard.type &&
operate.operation == standard.operation &&
operate.val == standard.val) {
valid = true;
}
return valid;
},
/**
* 根据模式验证操作步骤
*/
validate: function (operate) {
// 按钮操作之后,第二步错误操作菜单的情况,需要直接返回
if ((this.operates.length && operate.start === true) && (this.operates[0].type === 'mbm')) {
return false;
}
// 如果是正常的第一步操作需要清空operates数组
if (operate.type === 'mbm' || operate.type === 'bar' || operate.start === true) {
this.cleanOperates();
}
this.operates.push(operate);
// 预处理
const converter = getConverter(this.operates);
if (converter && converter.preHandle instanceof Function) {
operate = converter.preHandle(this.operates);
}
let valid = true;
const mode = this.getTrainingMode();
if (TrainingMode.EDIT === mode) {
// 编辑制作模式
if (this.getOperateBreakStatus()) {
valid = false;
const tip = LangStorage.getLang() == 'en' ? 'Please enter a hint and click next' : '请输入提示并点击下一步';
Message.error(tip);
this.operates.pop();
return valid;
}
if (this.getTrainingStart()) {
store.dispatch('training/setTempStep', operate);
}
} else if (TrainingMode.TEACH === mode || TrainingMode.PRACTICE === mode) {
// 教学模式/练习模式
if (this.getTrainingStart()) {
valid = this.judge(operate);
} else {
this.cleanOperates();
valid = false;
}
}
// 发送每一步的步骤数据;
const basicInfo = store.getters['training/basicInfo'];
if (basicInfo.id && valid) {
const group = router.currentRoute.query.group;
sendTrainingNextStep({ trainingId: basicInfo.id, operate: operate }, group);
}
if (!valid) {
// 如果操作校验不正确,回退
this.operates.pop();
} else {
if (operate.cancel === true) {
this.cleanOperates();
}
}
return valid;
},
handle: function (operate) {
return new Promise((resolve, reject) => {
const rtn = { valid: false, response: null };
const valid = this.validate(operate);
rtn.valid = valid;
if (valid) {
// 改变状态开始请求
OperateConverter.convertAndSend(operate).then(response => {
rtn.response = response;
resolve(rtn);
}).catch(error => {
reject(error);
});
} else {
resolve(rtn);
}
});
},
getTrainingMode: function () {
return store.state.training.mode;
},
getSteps: function () {
return store.state.training.steps;
},
getOrder: function () {
return store.state.training.order;
},
getTrainingStart: function () {
return store.state.training.started;
},
getOperateBreakStatus: function () {
return store.state.menuOperation.break;
}
};
export default new OperateHandler();

View File

@ -1,6 +1,6 @@
import Vue from 'vue';
import { TrainingMode } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import OperateHandler from '@/scripts/plugin/OperateHandler';
import deviceType from '../../jmap/constant/deviceType';
import LangStorage from '@/utils/lang';
// const lang = LangStorage.getLang();

View File

@ -3,11 +3,11 @@ 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.41:9000'; // 杜闪
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -13,11 +13,7 @@ export function creatSubscribe(topic, header) {
Vue.prototype.$stomp = new StompClient();
}
Vue.prototype.$stomp.subscribe(
[displayTopic].includes(topic) ? `${topic}/${header.group}` : topic,
callback,
header
);
Vue.prototype.$stomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}

View File

@ -34,7 +34,6 @@ import { PermissionType } from '@/scripts/ConstDic';
import { getCountTime } from '@/utils/index';
import { runDiagramIsStart, quitScript } from '@/api/simulation';
import { timeFormat } from '@/utils/date';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'MenuDemon',
@ -186,8 +185,6 @@ export default {
},
back() {
this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
history.go(-1);
Notification.closeAll();
});

View File

@ -178,7 +178,6 @@ export default {
back() {
this.$emit('quit');
Notification.closeAll();
// exitFullscreen();
if (this.$route.params.mode == 'record') {
/** 如果是演示返回时,需要重新创建仿真*/

View File

@ -22,12 +22,10 @@ export default {
stomp: null,
currentMap: null,
mode: '',
isDesignPlatform: false
isDesignPlatform: false,
group: ''
};
},
computed: {
group() { return this.$route.query.group; }
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) {
this.subscribe();
@ -56,6 +54,7 @@ export default {
mounted() {
window.onbeforeunload = this.clearSubscribe;
this.mode = this.$route.params.mode || '';
this.group = this.$route.query.group || '';
this.currentMap = this.$refs.mapCommon;
this.$nextTick(() => {
setTimeout(() => {
@ -105,12 +104,12 @@ export default {
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(displayTopic, header);
creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(displayTopic);
clearSubscribe(`${displayTopic}\/${this.group}`);
},
sendDeviceChangeEvent(data, header) {
//