diff --git a/src/permission.js b/src/permission.js index 3caafc04c..2b2ad0c7f 100644 --- a/src/permission.js +++ b/src/permission.js @@ -91,6 +91,7 @@ function handleRoute(to, from, next, routeInfo) { } else { // 除没有动态改变权限的需求可直接next() 删下方权限判断 if (hasPermission(store.getters.roles, to.meta.roles)) { + debugger; if (to.path === '/404' && to.redirectedFrom === '/') { next(localStore.get('trainingPlatformRoute' + store.getters.id) || '/trainingPlatform'); } else { diff --git a/src/router/index.js b/src/router/index.js index 2cce2b1da..9c1751a71 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -338,7 +338,8 @@ export const asyncRouter = [ hidden: true }, { - path: 'lesson/home/:mapId/:skinCode', + path: 'lesson/home/:mapId', + // /:skinCode component: LessonHome, hidden: true }, diff --git a/src/scripts/plugin/converter/SignalRouteOperationConverter.js b/src/scripts/plugin/converter/SignalRouteOperationConverter.js index 33e85c4e9..3baa1c8ae 100644 --- a/src/scripts/plugin/converter/SignalRouteOperationConverter.js +++ b/src/scripts/plugin/converter/SignalRouteOperationConverter.js @@ -7,95 +7,95 @@ const SignalOperation = OperationEvent.Signal; const SignalType = MapDeviceType.Signal.type; export default { - test: function (operates) { - const operateType = getOperateTypeBy('Signal', operates[0].operation); - if (operateType) { - return true; - } else { - return false; - } - }, - /** + test: function (operates) { + const operateType = getOperateTypeBy('Signal', operates[0].operation); + if (operateType) { + return true; + } else { + return false; + } + }, + /** * 验证前预处理 */ - preHandle: function (operates) { - if (operates && operates.length) { - const curOperate = operates[operates.length - 1]; - switch (operates[0].operation) { - case SignalOperation.arrangementRoute.button: { - if (curOperate.model) { - curOperate.val = curOperate.model._viewVal; - } - return curOperate; - } - case SignalOperation.cancelTrainRoute.button: { - if (curOperate.model) { - curOperate.val = curOperate.model._viewVal; - } - return curOperate; - } - case SignalOperation.reopenSignal.button: { - return curOperate; - } - case SignalOperation.humanTrainRoute.button: { - if (curOperate.model) { - curOperate.val = curOperate.model._viewVal; - } - return curOperate; - } - default: { - return curOperate; - } - } - } - }, - convert: function (operates) { - if (operates && operates.length) { - switch (operates[0].operation) { - case SignalOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates); + preHandle: function (operates) { + if (operates && operates.length) { + const curOperate = operates[operates.length - 1]; + switch (operates[0].operation) { + case SignalOperation.arrangementRoute.button: { + if (curOperate.model) { + curOperate.val = curOperate.model._viewVal; + } + return curOperate; + } + case SignalOperation.cancelTrainRoute.button: { + if (curOperate.model) { + curOperate.val = curOperate.model._viewVal; + } + return curOperate; + } + case SignalOperation.reopenSignal.button: { + return curOperate; + } + case SignalOperation.humanTrainRoute.button: { + if (curOperate.model) { + curOperate.val = curOperate.model._viewVal; + } + return curOperate; + } + default: { + return curOperate; + } + } + } + }, + convert: function (operates) { + if (operates && operates.length) { + switch (operates[0].operation) { + case SignalOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates); - case SignalOperation.stoppage.menu.operation: return handleMenuStoppage(operates); + case SignalOperation.stoppage.menu.operation: return handleMenuStoppage(operates); - case SignalOperation.arrangementRoute.button.operation: return handleButtonArrangementRoute(operates); // 排列进路按钮操作 - case SignalOperation.arrangementRoute.menu.operation: return handleMenuArrangementRoute(operates); + case SignalOperation.arrangementRoute.button.operation: return handleButtonArrangementRoute(operates); // 排列进路按钮操作 + case SignalOperation.arrangementRoute.menu.operation: return handleMenuArrangementRoute(operates); - case SignalOperation.cancelTrainRoute.button.operation: return handleButtonCancelTrainRoute(operates); // 取消进路按钮操作 - case SignalOperation.cancelTrainRoute.menu.operation: return handleMenuCancelTrainRoute(operates); + case SignalOperation.cancelTrainRoute.button.operation: return handleButtonCancelTrainRoute(operates); // 取消进路按钮操作 + case SignalOperation.cancelTrainRoute.menu.operation: return handleMenuCancelTrainRoute(operates); - case SignalOperation.reopenSignal.button.operation: return handleButtonReopenSignal(operates); // 信号重开按钮操作 - case SignalOperation.reopenSignal.menu.operation: return handleMenuReopenSignal(operates); + case SignalOperation.reopenSignal.button.operation: return handleButtonReopenSignal(operates); // 信号重开按钮操作 + case SignalOperation.reopenSignal.menu.operation: return handleMenuReopenSignal(operates); - case SignalOperation.humanTrainRoute.button.operation: return handleButtonHumanTrainRoute(operates); // 人解列车进路按钮操作 - case SignalOperation.humanTrainRoute.menu.operation: return handleMenuHumanTrainRoute(operates); + case SignalOperation.humanTrainRoute.button.operation: return handleButtonHumanTrainRoute(operates); // 人解列车进路按钮操作 + case SignalOperation.humanTrainRoute.menu.operation: return handleMenuHumanTrainRoute(operates); - case SignalOperation.lock.menu.operation: return handleMenuLock(operates); + case SignalOperation.lock.menu.operation: return handleMenuLock(operates); - case SignalOperation.unlock.menu.operation: return handleMenuUnlock(operates); + case SignalOperation.unlock.menu.operation: return handleMenuUnlock(operates); - case SignalOperation.guide.menu.operation: return handleMenuGuideRoute(operates); - case SignalOperation.guide.button.operation: return handleButtonGuideRoute(operates); // 引导进路按钮操作 + case SignalOperation.guide.menu.operation: return handleMenuGuideRoute(operates); + case SignalOperation.guide.button.operation: return handleButtonGuideRoute(operates); // 引导进路按钮操作 - case SignalOperation.signalClose.menu.operation: return handleMenuSignalClose(operates); + case SignalOperation.signalClose.menu.operation: return handleMenuSignalClose(operates); - case SignalOperation.setAutoInterlock.menu.operation: return handleMenuSetAutoInterlock(operates); - case SignalOperation.setAutoInterlock.button.operation: return handleButtonSetAutoInterlock(operates); // 设置联锁自动进路按钮 + case SignalOperation.setAutoInterlock.menu.operation: return handleMenuSetAutoInterlock(operates); + case SignalOperation.setAutoInterlock.button.operation: return handleButtonSetAutoInterlock(operates); // 设置联锁自动进路按钮 - case SignalOperation.cancelAutoInterlock.menu.operation: return handleMenuCancelAutoInterlock(operates); + case SignalOperation.cancelAutoInterlock.menu.operation: return handleMenuCancelAutoInterlock(operates); - case SignalOperation.setAutoTrigger.menu.operation: return handleMenuSetAutoTrigger(operates); + case SignalOperation.setAutoTrigger.menu.operation: return handleMenuSetAutoTrigger(operates); - case SignalOperation.cancelAutoTrigger.menu.operation: return handleMenuCancelAutoTrigger(operates); + case SignalOperation.cancelAutoTrigger.menu.operation: return handleMenuCancelAutoTrigger(operates); - case SignalOperation.humanControl.menu.operation: return handleMenuHumanControl(operates); - case SignalOperation.humanControl.button.operation: return handleButtonHumanControl(operates); // 人工控按钮操作 + case SignalOperation.humanControl.menu.operation: return handleMenuHumanControl(operates); + case SignalOperation.humanControl.button.operation: return handleButtonHumanControl(operates); // 人工控按钮操作 - case SignalOperation.atsAutoControl.menu.operation: return handleMenuAtsAutoControl(operates); - case SignalOperation.atsAutoControl.button.operation: return handleButtonAtsAutoControl(operates); // 自动控按钮操作 + case SignalOperation.atsAutoControl.menu.operation: return handleMenuAtsAutoControl(operates); + case SignalOperation.atsAutoControl.button.operation: return handleButtonAtsAutoControl(operates); // 自动控按钮操作 - case SignalOperation.detail.menu.operation: return handleMenuDetail(operates); - } - } - } + case SignalOperation.detail.menu.operation: return handleMenuDetail(operates); + } + } + } }; /** @@ -103,37 +103,37 @@ export default { * @param {*} operates */ function handleButtonArrangementRoute(operates) { - if (operates.length === 2) { - const operate = operates[1]; - if (operate.type == SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.arrangementRoute.event.query - // val: operate.model._viewVal - }; - } - return { error: true }; - } else if (operates.length >= 3) { - const operateBeg = operates[1]; // 起始信号灯 - const operateEnd = operates[operates.length - 1]; // 终端信号灯 - if (operateEnd.type == SignalType && operateEnd.code && operateEnd.tempData && operateEnd.tempData.length) { - for (let i = 0; i < operateEnd.tempData.length; i++) { - const elem = operateEnd.tempData[i]; - if (elem.startSignalCode === operateBeg.code && elem.endSignalCode == operateEnd.code) { - return { - type: operateEnd.type, - code: operateEnd.code, - over: true, - operation: SignalOperation.arrangementRoute.event.confirm - // val: elem.code - }; - } - } - } - return { error: true }; - } - return null; + if (operates.length === 2) { + const operate = operates[1]; + if (operate.type == SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.arrangementRoute.event.query + // val: operate.model._viewVal + }; + } + return { error: true }; + } else if (operates.length >= 3) { + const operateBeg = operates[1]; // 起始信号灯 + const operateEnd = operates[operates.length - 1]; // 终端信号灯 + if (operateEnd.type == SignalType && operateEnd.code && operateEnd.tempData && operateEnd.tempData.length) { + for (let i = 0; i < operateEnd.tempData.length; i++) { + const elem = operateEnd.tempData[i]; + if (elem.startSignalCode === operateBeg.code && elem.endSignalCode == operateEnd.code) { + return { + type: operateEnd.type, + code: operateEnd.code, + over: true, + operation: SignalOperation.arrangementRoute.event.confirm + // val: elem.code + }; + } + } + } + return { error: true }; + } + return null; } /** @@ -141,31 +141,31 @@ function handleButtonArrangementRoute(operates) { * @param {*} operates */ function handleMenuArrangementRoute(operates) { - if (operates.length == 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.arrangementRoute.event.query - }; - } - return { error: true }; - } else if (operates.length >= 3) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operates[0].code && (operates[operates.length - 2].val || operates[operates.length - 3].val)) { - return { - over: true, - type: operate.type, - code: operates[0].code, - operation: SignalOperation.arrangementRoute.event.confirm, - val: operates[operates.length - 2].val || operates[operates.length - 3].val - }; - } - return { error: true }; - } + if (operates.length == 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.arrangementRoute.event.query + }; + } + return { error: true }; + } else if (operates.length >= 3) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operates[0].code && (operates[operates.length - 2].val || operates[operates.length - 3].val)) { + return { + over: true, + type: operate.type, + code: operates[0].code, + operation: SignalOperation.arrangementRoute.event.confirm, + val: operates[operates.length - 2].val || operates[operates.length - 3].val + }; + } + return { error: true }; + } - return null; + return null; } /** @@ -173,19 +173,19 @@ function handleMenuArrangementRoute(operates) { * @param {*} operates */ function handleButtonCancelTrainRoute(operates) { - if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.cancelTrainRoute.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.cancelTrainRoute.event + }; + } + return { error: true }; + } + return null; } /** @@ -193,19 +193,19 @@ function handleButtonCancelTrainRoute(operates) { * @param {*} operates */ function handleButtonReopenSignal(operates) { - if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.reopenSignal.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.reopenSignal.event + }; + } + return { error: true }; + } + return null; } /** @@ -213,26 +213,25 @@ function handleButtonReopenSignal(operates) { * @param {*} operates */ function handleButtonHumanTrainRoute(operates) { - debugger; - if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - if (operate.code) { - // const counter = store.getters['map/getCounterBySingalCode'](operate.code, '02'); - // if (counter) { - // const val = localStore.get(counter.code) || ''; - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.humanTrainRoute.event - }; - // } - } - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + if (operate.code) { + // const counter = store.getters['map/getCounterBySingalCode'](operate.code, '02'); + // if (counter) { + // const val = localStore.get(counter.code) || ''; + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.humanTrainRoute.event + }; + // } + } + } + return { error: true }; + } + return null; } /** @@ -240,19 +239,19 @@ function handleButtonHumanTrainRoute(operates) { * @param {*} operates */ function handleMenuCancelStopPage(operates) { - if (operates.length >= 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.cancelStoppage.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.cancelStoppage.event + }; + } + return { error: true }; + } + return null; } /** @@ -260,19 +259,19 @@ function handleMenuCancelStopPage(operates) { * @param {*} operates */ function handleMenuStoppage(operates) { - if (operates.length >= 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.stoppage.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.stoppage.event + }; + } + return { error: true }; + } + return null; } /** @@ -280,19 +279,19 @@ function handleMenuStoppage(operates) { * @param {*} operates */ function handleMenuCancelTrainRoute(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.cancelTrainRoute.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.cancelTrainRoute.event + }; + } + return { error: true }; + } + return null; } /** @@ -300,19 +299,19 @@ function handleMenuCancelTrainRoute(operates) { * @param {*} operates */ function handleMenuReopenSignal(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.reopenSignal.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.reopenSignal.event + }; + } + return { error: true }; + } + return null; } /** @@ -320,26 +319,26 @@ function handleMenuReopenSignal(operates) { * @param {*} operates */ function handleMenuHumanTrainRoute(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - if (operate.code) { - // const counter = store.getters['map/getCounterBySingalCode'](operate.code, '02'); - // if (counter) { - // const val = localStore.get(counter.code) || ''; - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.humanTrainRoute.event - // val: val - }; - // } - } - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + if (operate.code) { + // const counter = store.getters['map/getCounterBySingalCode'](operate.code, '02'); + // if (counter) { + // const val = localStore.get(counter.code) || ''; + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.humanTrainRoute.event + // val: val + }; + // } + } + } + return { error: true }; + } + return null; } /** @@ -347,18 +346,18 @@ function handleMenuHumanTrainRoute(operates) { * @param {*} operates */ function handleMenuLock(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.lock.event - }; - } - return { error: true }; - } + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.lock.event + }; + } + return { error: true }; + } } /** @@ -366,18 +365,18 @@ function handleMenuLock(operates) { * @param {*} operates */ function handleMenuUnlock(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.unlock.event - }; - } - return { error: true }; - } + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.unlock.event + }; + } + return { error: true }; + } } /** @@ -385,28 +384,28 @@ function handleMenuUnlock(operates) { * @param {*} operates */ function handleMenuGuideRoute(operates) { - if (operates.length == 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.guide.event.query - }; - } - return { error: true }; - } else if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.guide.event.confirm - }; - } - return { error: true }; - } + if (operates.length == 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.guide.event.query + }; + } + return { error: true }; + } else if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.guide.event.confirm + }; + } + return { error: true }; + } } /** @@ -414,19 +413,19 @@ function handleMenuGuideRoute(operates) { * @param {*} operates */ function handleMenuSignalClose(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.signalClose.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.signalClose.event + }; + } + return { error: true }; + } + return null; } /** @@ -434,19 +433,19 @@ function handleMenuSignalClose(operates) { * @param {*} operates */ function handleMenuSetAutoInterlock(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.setAutoInterlock.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.setAutoInterlock.event + }; + } + return { error: true }; + } + return null; } /** @@ -454,19 +453,19 @@ function handleMenuSetAutoInterlock(operates) { * @param {*} operates */ function handleMenuCancelAutoInterlock(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.cancelAutoInterlock.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.cancelAutoInterlock.event + }; + } + return { error: true }; + } + return null; } /** @@ -474,19 +473,19 @@ function handleMenuCancelAutoInterlock(operates) { * @param {*} operates */ function handleMenuSetAutoTrigger(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.setAutoTrigger.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.setAutoTrigger.event + }; + } + return { error: true }; + } + return null; } /** @@ -494,19 +493,19 @@ function handleMenuSetAutoTrigger(operates) { * @param {*} operates */ function handleMenuCancelAutoTrigger(operates) { - if (operates.length >= 2) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.cancelAutoTrigger.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.cancelAutoTrigger.event + }; + } + return { error: true }; + } + return null; } /** @@ -514,52 +513,52 @@ function handleMenuCancelAutoTrigger(operates) { * @param {*} operates */ function handleMenuHumanControl(operates) { - if (operates.length == 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.humanControl.event.query - }; - } - return { error: true }; - } else if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - let val = null; - val = operates[operates.length - 3] && operates[operates.length - 3].val ? operates[operates.length - 3].val : val; - val = operates[operates.length - 2] && operates[operates.length - 2].val ? operates[operates.length - 2].val : val; - val = operates[operates.length - 1] && operates[operates.length - 1].val ? operates[operates.length - 1].val : val; + if (operates.length == 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.humanControl.event.query + }; + } + return { error: true }; + } else if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + let val = null; + val = operates[operates.length - 3] && operates[operates.length - 3].val ? operates[operates.length - 3].val : val; + val = operates[operates.length - 2] && operates[operates.length - 2].val ? operates[operates.length - 2].val : val; + val = operates[operates.length - 1] && operates[operates.length - 1].val ? operates[operates.length - 1].val : val; - if (operate.type === SignalType && operates[0].code && val) { - return { - over: true, - type: operate.type, - code: operates[0].code, - operation: SignalOperation.humanControl.event.confirm, - val: val - }; - } - return { error: true }; - } - return null; + if (operate.type === SignalType && operates[0].code && val) { + return { + over: true, + type: operate.type, + code: operates[0].code, + operation: SignalOperation.humanControl.event.confirm, + val: val + }; + } + return { error: true }; + } + return null; } // 人工控按钮 操作 function handleButtonHumanControl(operates) { - if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.humanControl.event.confirm - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.humanControl.event.confirm + }; + } + return { error: true }; + } + return null; } /** @@ -567,52 +566,52 @@ function handleButtonHumanControl(operates) { * @param {*} operates */ function handleMenuAtsAutoControl(operates) { - if (operates.length == 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.atsAutoControl.event.query - }; - } - return { error: true }; - } else if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - let val = null; - val = operates[operates.length - 3] && operates[operates.length - 3].val ? operates[operates.length - 3].val : val; - val = operates[operates.length - 2] && operates[operates.length - 2].val ? operates[operates.length - 2].val : val; - val = operates[operates.length - 1] && operates[operates.length - 1].val ? operates[operates.length - 1].val : val; + if (operates.length == 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.atsAutoControl.event.query + }; + } + return { error: true }; + } else if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + let val = null; + val = operates[operates.length - 3] && operates[operates.length - 3].val ? operates[operates.length - 3].val : val; + val = operates[operates.length - 2] && operates[operates.length - 2].val ? operates[operates.length - 2].val : val; + val = operates[operates.length - 1] && operates[operates.length - 1].val ? operates[operates.length - 1].val : val; - if (operate.type === SignalType && operates[0].code && val) { - return { - over: true, - type: operate.type, - code: operates[0].code, - operation: SignalOperation.atsAutoControl.event.confirm, - val: val - }; - } - return { error: true }; - } - return null; + if (operate.type === SignalType && operates[0].code && val) { + return { + over: true, + type: operate.type, + code: operates[0].code, + operation: SignalOperation.atsAutoControl.event.confirm, + val: val + }; + } + return { error: true }; + } + return null; } // 自动控 按钮操作 function handleButtonAtsAutoControl(operates) { - if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.atsAutoControl.event.confirm - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.atsAutoControl.event.confirm + }; + } + return { error: true }; + } + return null; } /** @@ -620,18 +619,18 @@ function handleButtonAtsAutoControl(operates) { * @param {*} operates */ function handleMenuDetail(operates) { - if (operates.length == 1) { - const operate = operates[0]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.detail.event.query - }; - } - return { error: true }; - } - return null; + if (operates.length == 1) { + const operate = operates[0]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.detail.event.query + }; + } + return { error: true }; + } + return null; } /** @@ -639,19 +638,19 @@ function handleMenuDetail(operates) { * @param {*} operates */ function handleButtonSetAutoInterlock(operates) { - if (operates.length >= 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: SignalOperation.setAutoInterlock.event - }; - } - return { error: true }; - } - return null; + if (operates.length >= 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: SignalOperation.setAutoInterlock.event + }; + } + return { error: true }; + } + return null; } /** @@ -659,34 +658,34 @@ function handleButtonSetAutoInterlock(operates) { * @param {*} operates */ function handleButtonGuideRoute(operates) { - if (operates.length == 2) { - const operate = operates[operates.length - 1]; - if (operate.type === SignalType && operate.code) { - return { - type: operate.type, - code: operate.code, - operation: SignalOperation.guide.event.confirm - }; - } - return { error: true }; - } else if (operates.length >= 3) { - const operateBeg = operates[1]; - const operateEnd = operates[operates.length - 1]; - if (operateEnd.type === SignalType && operateEnd.code && operateEnd.tempData && operateEnd.tempData.length) { - for (let i = 0; i < operateEnd.tempData.length; i++) { - const elem = operateEnd.tempData[i]; - if (elem.startSignalCode === operateBeg.code && elem.endSignalCode == operateEnd.code) { - return { - type: operateEnd.type, - code: operateEnd.code, - over: true, - operation: SignalOperation.guide.event.confirm - }; - } - } - } - return { error: true }; - } - return null; + if (operates.length == 2) { + const operate = operates[operates.length - 1]; + if (operate.type === SignalType && operate.code) { + return { + type: operate.type, + code: operate.code, + operation: SignalOperation.guide.event.confirm + }; + } + return { error: true }; + } else if (operates.length >= 3) { + const operateBeg = operates[1]; + const operateEnd = operates[operates.length - 1]; + if (operateEnd.type === SignalType && operateEnd.code && operateEnd.tempData && operateEnd.tempData.length) { + for (let i = 0; i < operateEnd.tempData.length; i++) { + const elem = operateEnd.tempData[i]; + if (elem.startSignalCode === operateBeg.code && elem.endSignalCode == operateEnd.code) { + return { + type: operateEnd.type, + code: operateEnd.code, + over: true, + operation: SignalOperation.guide.event.confirm + }; + } + } + } + return { error: true }; + } + return null; } diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index 6e1a4ece1..ec1d5dd15 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -95,12 +95,13 @@ export default { switch (obj.type) { case 'scriptDesign': { setSessionStorage('designType', 'scriptDesign'); - this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` }); + this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}` }); break; } case 'lessonDesign': { setSessionStorage('designType', 'lessonDesign'); - this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`, query: {cityCode: obj.cityCode} }); + // /${obj.skinCode} + this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}`, query: {cityCode: obj.cityCode} }); break; } case 'runPlanDesign': { diff --git a/src/views/jlmap3d/drive/jl3ddrive.vue b/src/views/jlmap3d/drive/jl3ddrive.vue index 0f22e8fd8..9a0d4e0db 100644 --- a/src/views/jlmap3d/drive/jl3ddrive.vue +++ b/src/views/jlmap3d/drive/jl3ddrive.vue @@ -3,14 +3,14 @@