实训校验暂提
This commit is contained in:
parent
1443d7d2fa
commit
92a3e85f93
@ -301,9 +301,6 @@ export default {
|
|||||||
passWordCommit(data) {
|
passWordCommit(data) {
|
||||||
let operate = {};
|
let operate = {};
|
||||||
if (data.nextCmdType) {
|
if (data.nextCmdType) {
|
||||||
if (data.nextCmdType == CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE) {
|
|
||||||
this.$store.dispatch('training/updateMapState', [{code: data.code, _type:'SignalButton', pressDown: 0}]);
|
|
||||||
}
|
|
||||||
operate = {
|
operate = {
|
||||||
over: true,
|
over: true,
|
||||||
operation: data.operateNext,
|
operation: data.operateNext,
|
||||||
@ -312,37 +309,63 @@ export default {
|
|||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
param: data.param
|
param: data.param
|
||||||
};
|
};
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then( result => {
|
||||||
|
if (result.valid) {
|
||||||
|
if (data.nextCmdType == CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE) {
|
||||||
|
this.$store.dispatch('training/updateMapState', [{code: data.code, _type:'SignalButton', pressDown: 0}]);
|
||||||
|
}
|
||||||
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.params }).then(resp => {
|
||||||
|
if (operate.operationPre === this.Switch.guideLock.leftButton.operation || operate.operation === this.Switch.guideLock.leftButton.operation) {
|
||||||
|
this.guideLockLeftFlag = !this.guideLockLeftFlag;
|
||||||
|
} else if (operate.operationPre === this.Switch.guideLock.rightButton.operation || operate.operation === this.Switch.guideLock.rightButton.operation) {
|
||||||
|
this.guideLockRightFlag = !this.guideLockRightFlag;
|
||||||
|
}
|
||||||
|
this.clearOperate();
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
this.clearOperate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
operate = {
|
operate = {
|
||||||
operationPre: data.operation,
|
operationPre: data.operation,
|
||||||
operation: data.operateNext,
|
operation: data.operateNext,
|
||||||
userOperationType: 'leftClick'
|
userOperationType: 'leftClick'
|
||||||
};
|
};
|
||||||
}
|
this.$store.dispatch('trainingNew/next', operate).then( result => {
|
||||||
this.trainingOperation(operate);
|
|
||||||
},
|
|
||||||
// 执行操作
|
|
||||||
trainingOperation(operate) {
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
||||||
if (valid) {
|
|
||||||
/* 引导总锁输入面后 处理按钮选中状态 */
|
|
||||||
if (operate.operationPre === this.Switch.guideLock.leftButton.operation || operate.operation === this.Switch.guideLock.leftButton.operation) {
|
|
||||||
this.guideLockLeftFlag = !this.guideLockLeftFlag;
|
|
||||||
} else if (operate.operationPre === this.Switch.guideLock.rightButton.operation || operate.operation === this.Switch.guideLock.rightButton.operation) {
|
|
||||||
this.guideLockRightFlag = !this.guideLockRightFlag;
|
|
||||||
}
|
|
||||||
if (operate.operationPre == this.Station.powerUnLock.button.operation) {
|
if (operate.operationPre == this.Station.powerUnLock.button.operation) {
|
||||||
this.clearOperate();
|
this.clearOperate();
|
||||||
}
|
}
|
||||||
// debugger;
|
|
||||||
// this.$store.dispatch('menuOperation/setButtonOperation', operate.operation); // 按钮菜单是否被按下
|
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
}
|
});
|
||||||
}).catch((error) => {
|
}
|
||||||
console.error(error);
|
// this.trainingOperation(operate);
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
// 执行操作
|
||||||
|
// trainingOperation(operate) {
|
||||||
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
// if (valid) {
|
||||||
|
// /* 引导总锁输入面后 处理按钮选中状态 */
|
||||||
|
// if (operate.operationPre === this.Switch.guideLock.leftButton.operation || operate.operation === this.Switch.guideLock.leftButton.operation) {
|
||||||
|
// this.guideLockLeftFlag = !this.guideLockLeftFlag;
|
||||||
|
// } else if (operate.operationPre === this.Switch.guideLock.rightButton.operation || operate.operation === this.Switch.guideLock.rightButton.operation) {
|
||||||
|
// this.guideLockRightFlag = !this.guideLockRightFlag;
|
||||||
|
// }
|
||||||
|
// if (operate.operationPre == this.Station.powerUnLock.button.operation) {
|
||||||
|
// this.clearOperate();
|
||||||
|
// }
|
||||||
|
// // debugger;
|
||||||
|
// // this.$store.dispatch('menuOperation/setButtonOperation', operate.operation); // 按钮菜单是否被按下
|
||||||
|
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
// }
|
||||||
|
// }).catch((error) => {
|
||||||
|
// console.error(error);
|
||||||
|
// this.$refs.noticeInfo.doShow();
|
||||||
|
// });
|
||||||
|
// },
|
||||||
updateButtonShow(val, old) {
|
updateButtonShow(val, old) {
|
||||||
if (old) {
|
if (old) {
|
||||||
// 恢复旧按钮显示
|
// 恢复旧按钮显示
|
||||||
@ -406,8 +429,8 @@ export default {
|
|||||||
code: model.code,
|
code: model.code,
|
||||||
userOperationType: 'leftClick'
|
userOperationType: 'leftClick'
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
const {switchSection, code, shuntingTypeList} = model;
|
const {switchSection, code, shuntingTypeList} = model;
|
||||||
this.$refs.defectiveShunting.doShow({switchSection, code, shuntingTypeList});
|
this.$refs.defectiveShunting.doShow({switchSection, code, shuntingTypeList});
|
||||||
}
|
}
|
||||||
@ -420,8 +443,8 @@ export default {
|
|||||||
operation: this.Station.stationMasterLock.leftButton.operation,
|
operation: this.Station.stationMasterLock.leftButton.operation,
|
||||||
userOperationType: 'leftClick'
|
userOperationType: 'leftClick'
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
// 引导总锁弹出 调用取消引导总锁指令
|
// 引导总锁弹出 调用取消引导总锁指令
|
||||||
operate.nextCmdType = this.sGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
|
operate.nextCmdType = this.sGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
|
||||||
operate.param = {throat: 'S', stationCode: this.$store.state.map.showCentralizedStationCode};
|
operate.param = {throat: 'S', stationCode: this.$store.state.map.showCentralizedStationCode};
|
||||||
@ -437,8 +460,8 @@ export default {
|
|||||||
operation: this.Station.stationMasterLock.rightButton.operation,
|
operation: this.Station.stationMasterLock.rightButton.operation,
|
||||||
userOperationType: 'leftClick'
|
userOperationType: 'leftClick'
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
// 引导总锁弹出 调用取消引导总锁指令
|
// 引导总锁弹出 调用取消引导总锁指令
|
||||||
operate.nextCmdType = this.xGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
|
operate.nextCmdType = this.xGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
|
||||||
operate.param = {throat: 'X', stationCode: this.$store.state.map.showCentralizedStationCode};
|
operate.param = {throat: 'X', stationCode: this.$store.state.map.showCentralizedStationCode};
|
||||||
@ -450,58 +473,78 @@ export default {
|
|||||||
},
|
},
|
||||||
buttonDown(operation, commandTypeList) {
|
buttonDown(operation, commandTypeList) {
|
||||||
this.clearOperate();
|
this.clearOperate();
|
||||||
if (operation != this.Command.cancel.clearMbm.operation) {
|
const operate = {
|
||||||
const operate = {
|
start: true,
|
||||||
operation: operation,
|
operation: operation,
|
||||||
userOperationType: 'leftClick'
|
userOperationType: 'leftClick'
|
||||||
};
|
};
|
||||||
// 以下 会弹出密码框 (总人解,区故解) 铅封按钮
|
// 以下 会弹出密码框 (总人解,区故解) 铅封按钮
|
||||||
const operationList = [this.Signal.humanTrainRoute.button.operation,
|
const operationList = [this.Signal.humanTrainRoute.button.operation,
|
||||||
this.Section.fault.button.operation,
|
this.Section.fault.button.operation,
|
||||||
this.Section.defectiveShunting.button.operation,
|
this.Section.defectiveShunting.button.operation,
|
||||||
this.Station.powerUnLock.button.operation,
|
this.Station.powerUnLock.button.operation,
|
||||||
this.Signal.signalTurnOff.menuButton.operation];
|
this.Signal.signalTurnOff.menuButton.operation];
|
||||||
const operationMap = {
|
const operationMap = {
|
||||||
[this.Signal.humanTrainRoute.button.operation]:'总人解',
|
[this.Signal.humanTrainRoute.button.operation]:'总人解',
|
||||||
[this.Section.fault.button.operation]:'区故解',
|
[this.Section.fault.button.operation]:'区故解',
|
||||||
[this.Section.defectiveShunting.button.operation]:'分路不良',
|
[this.Section.defectiveShunting.button.operation]:'分路不良',
|
||||||
[this.Signal.signalTurnOff.menuButton.operation]:'灭灯',
|
[this.Signal.signalTurnOff.menuButton.operation]:'灭灯',
|
||||||
[this.Station.powerUnLock.button.operation]:'上电解锁'
|
[this.Station.powerUnLock.button.operation]:'上电解锁'
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (operation === this.Command.cancel.clearMbm.operation) {
|
||||||
this.operation = operation;
|
this.commandTypeList = [];
|
||||||
this.commandTypeList = commandTypeList;
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', operation); // 按钮菜单是否被按下
|
this.guideLockRightFlag = false;
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.guideLockLeftFlag = false;
|
||||||
// 判断是否需要 弹窗密码框
|
}
|
||||||
if (operationList.includes(operation)) {
|
});
|
||||||
operate['operateNext'] = this.Command.close.password.operation;
|
// this.commandTypeList = [];
|
||||||
if (operation == this.Station.powerUnLock.button.operation) {
|
// this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
operate.nextCmdType = CMD.Station.CMD_STATION_POWER_ON_UNLOCK;
|
// this.guideLockRightFlag = false;
|
||||||
operate.param = {stationCode: this.$store.state.map.showCentralizedStationCode};
|
// this.guideLockLeftFlag = false;
|
||||||
}
|
|
||||||
this.$refs.password.doShow(operate, operationMap[operation]);
|
// if (operation != this.Command.cancel.clearMbm.operation) {
|
||||||
}
|
// const operate = {
|
||||||
this.timeNode = this.$store.state.socket.simulationTimeSync;
|
// operation: operation,
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
// userOperationType: 'leftClick'
|
||||||
}
|
// };
|
||||||
});
|
|
||||||
} else {
|
// this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
// 清除按钮
|
// if (result.valid) {
|
||||||
const operate = {
|
// this.operation = operation;
|
||||||
start: true,
|
// this.commandTypeList = commandTypeList;
|
||||||
userOperationType: 'leftClick',
|
// this.$store.dispatch('menuOperation/setButtonOperation', operation); // 按钮菜单是否被按下
|
||||||
operation: operation
|
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
};
|
// // 判断是否需要 弹窗密码框
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
// if (operationList.includes(operation)) {
|
||||||
if (valid) {
|
// operate['operateNext'] = this.Command.close.password.operation;
|
||||||
this.commandTypeList = [];
|
// if (operation == this.Station.powerUnLock.button.operation) {
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
// operate.nextCmdType = CMD.Station.CMD_STATION_POWER_ON_UNLOCK;
|
||||||
this.guideLockRightFlag = false;
|
// operate.param = {stationCode: this.$store.state.map.showCentralizedStationCode};
|
||||||
}
|
// }
|
||||||
});
|
// this.$refs.password.doShow(operate, operationMap[operation]);
|
||||||
}
|
// }
|
||||||
|
// this.timeNode = this.$store.state.socket.simulationTimeSync;
|
||||||
|
// this.$store.dispatch('training/emitTipFresh');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// // 清除按钮
|
||||||
|
// const operate = {
|
||||||
|
// start: true,
|
||||||
|
// userOperationType: 'leftClick',
|
||||||
|
// operation: operation
|
||||||
|
// };
|
||||||
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
// if (valid) {
|
||||||
|
// this.commandTypeList = [];
|
||||||
|
// this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
|
// this.guideLockRightFlag = false;
|
||||||
|
// this.guideLockLeftFlag = false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
// 解析进路数据
|
// 解析进路数据
|
||||||
handleRouteDataMap() {
|
handleRouteDataMap() {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<center><b>建</b><b>立</b></center>
|
<center><b>建</b><b>立</b></center>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button :id="MixinCommand.totalCancel.button.domId" class="button_box" @click="buttonDown(MixinCommand.totalCancel.button.operation, ['Signal','SignalButton'])">
|
<button :id="MixinCommand.totalCancel.button.domId" class="button_box" @click="buttonDown(MixinCommand.totalCancel.button.operation, [])">
|
||||||
<span :style="{color: operation === MixinCommand.totalCancel.button.operation ? '#ccc': 'black'}">
|
<span :style="{color: operation === MixinCommand.totalCancel.button.operation ? '#ccc': 'black'}">
|
||||||
<center><b>总</b></center>
|
<center><b>总</b></center>
|
||||||
<center><b>取</b><b>消</b></center>
|
<center><b>取</b><b>消</b></center>
|
||||||
@ -341,13 +341,24 @@ export default {
|
|||||||
},
|
},
|
||||||
// 执行操作
|
// 执行操作
|
||||||
trainingOperation(operate) {
|
trainingOperation(operate) {
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
// if (valid) {
|
||||||
|
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
// }
|
||||||
|
// }).catch((error) => {
|
||||||
|
// console.error(error);
|
||||||
|
// this.$refs.noticeInfo.doShow();
|
||||||
|
// });
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
|
if (result.valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.params }).then(resp => {
|
||||||
|
console.log(resp);
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
|
||||||
console.error(error);
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateButtonShow(val, old) {
|
updateButtonShow(val, old) {
|
||||||
@ -376,12 +387,11 @@ export default {
|
|||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
operation: this.Switch.guideLock.leftButton.operation
|
operation: this.Switch.guideLock.leftButton.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
// 引导总锁弹出 调用取消引导总锁指令
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
|
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
|
||||||
operate.param = {right: false};
|
operate.param = {right: false};
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
||||||
operate['operateNext'] = this.Command.close.password.operation;
|
operate['operateNext'] = this.Command.close.password.operation;
|
||||||
this.$refs.password.doShow(operate);
|
this.$refs.password.doShow(operate);
|
||||||
}
|
}
|
||||||
@ -393,12 +403,11 @@ export default {
|
|||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
operation: this.Switch.guideLock.rightButton.operation
|
operation: this.Switch.guideLock.rightButton.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
// 引导总锁弹出 调用取消引导总锁指令
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
|
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
|
||||||
operate.param = {right: true};
|
operate.param = {right: true};
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
||||||
operate['operateNext'] = this.Command.close.password.operation;
|
operate['operateNext'] = this.Command.close.password.operation;
|
||||||
this.$refs.password.doShow(operate);
|
this.$refs.password.doShow(operate);
|
||||||
}
|
}
|
||||||
@ -407,47 +416,71 @@ export default {
|
|||||||
buttonDown(operation, commandTypeList) {
|
buttonDown(operation, commandTypeList) {
|
||||||
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
||||||
if (!station || station.controlMode === 'Interlock') { return; }
|
if (!station || station.controlMode === 'Interlock') { return; }
|
||||||
this.clearOperate();
|
const operate = {
|
||||||
if (operation != this.Command.cancel.clearMbm.operation) {
|
start: operation != this.Command.cancel.clearMbm.operation,
|
||||||
const operate = {
|
userOperationType: 'leftClick',
|
||||||
userOperationType: 'leftClick',
|
operation: operation
|
||||||
operation: operation
|
};
|
||||||
};
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
// 以下 会弹出密码框 (总人解,区故解) 铅封按钮 684
|
if (result.valid) {
|
||||||
const operationList = [
|
this.$store.dispatch('menuOperation/setButtonOperation', operation === this.Command.cancel.clearMbm.operation ? null : operation);
|
||||||
this.Signal.humanTrainRoute.button.operation,
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.Section.fault.button.operation,
|
this.operation = operation;
|
||||||
this.Signal.guide.button.operation
|
this.commandTypeList = commandTypeList;
|
||||||
];
|
const operationList = [
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.Signal.humanTrainRoute.button.operation,
|
||||||
if (valid) {
|
this.Section.fault.button.operation,
|
||||||
this.operation = operation;
|
this.Signal.guide.button.operation
|
||||||
this.commandTypeList = commandTypeList;
|
];
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', operation); // 按钮菜单是否被按下
|
if (operationList.includes(operation)) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
operate['operateNext'] = this.Command.close.password.operation;
|
||||||
// 判断是否需要 弹窗密码框
|
this.$refs.password.doShow(operate);
|
||||||
if (operationList.includes(operation)) {
|
|
||||||
operate['operateNext'] = this.Command.close.password.operation;
|
|
||||||
this.$refs.password.doShow(operate);
|
|
||||||
}
|
|
||||||
this.timeNode = this.$store.state.socket.simulationTimeSync;
|
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
|
||||||
}
|
}
|
||||||
});
|
this.timeNode = this.$store.state.socket.simulationTimeSync;
|
||||||
} else {
|
// this.$store.dispatch('training/emitTipFresh');
|
||||||
// 清除按钮
|
}
|
||||||
const operate = {
|
});
|
||||||
start: true,
|
// this.clearOperate();
|
||||||
userOperationType: 'leftClick',
|
// if (operation != this.Command.cancel.clearMbm.operation) {
|
||||||
operation: operation
|
// const operate = {
|
||||||
};
|
// userOperationType: 'leftClick',
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
// operation: operation
|
||||||
if (valid) {
|
// };
|
||||||
this.commandTypeList = [];
|
// // 以下 会弹出密码框 (总人解,区故解) 铅封按钮 684
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
// const operationList = [
|
||||||
}
|
// this.Signal.humanTrainRoute.button.operation,
|
||||||
});
|
// this.Section.fault.button.operation,
|
||||||
}
|
// this.Signal.guide.button.operation
|
||||||
|
// ];
|
||||||
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
// if (valid) {
|
||||||
|
// this.operation = operation;
|
||||||
|
// this.commandTypeList = commandTypeList;
|
||||||
|
// this.$store.dispatch('menuOperation/setButtonOperation', operation); // 按钮菜单是否被按下
|
||||||
|
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
|
// // 判断是否需要 弹窗密码框
|
||||||
|
// if (operationList.includes(operation)) {
|
||||||
|
// operate['operateNext'] = this.Command.close.password.operation;
|
||||||
|
// this.$refs.password.doShow(operate);
|
||||||
|
// }
|
||||||
|
// this.timeNode = this.$store.state.socket.simulationTimeSync;
|
||||||
|
// this.$store.dispatch('training/emitTipFresh');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// // 清除按钮
|
||||||
|
// const operate = {
|
||||||
|
// start: true,
|
||||||
|
// userOperationType: 'leftClick',
|
||||||
|
// operation: operation
|
||||||
|
// };
|
||||||
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
|
// if (valid) {
|
||||||
|
// this.commandTypeList = [];
|
||||||
|
// this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
// 解析进路数据
|
// 解析进路数据
|
||||||
handleRouteDataMap() {
|
handleRouteDataMap() {
|
||||||
@ -473,83 +506,76 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 信号重开
|
// 信号重开
|
||||||
handelReopenSignal(device) {
|
handleReopenSignal(device) {
|
||||||
const operate = {
|
const operate = {
|
||||||
operation: this.Signal.reopenSignal.button.operation,
|
operation: this.Signal.reopenSignal.button.operation,
|
||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
code: device.code,
|
code: device.code,
|
||||||
param: { signalCode: device.code }
|
param: { signalCode: device.code }
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {
|
this.$store.dispatch('trainingNew/next', operate);
|
||||||
}).catch(() => this.$refs.noticeInfo.doShow() );
|
// const result = this.$store.dispatch('trainingNew/next', operate);
|
||||||
|
// this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {
|
||||||
|
// }).catch(() => this.$refs.noticeInfo.doShow() );
|
||||||
},
|
},
|
||||||
// 排列进路
|
// 排列进路
|
||||||
arrangementRouteOperation(deviceList) {
|
arrangementRouteOperation(deviceList) {
|
||||||
const operate = { userOperationType: 'leftClick', operation: this.Signal.arrangementRoute.button.operation };
|
const operate = { userOperationType: 'leftClick', operation: this.Signal.arrangementRoute.button.operation };
|
||||||
if (!this.routeDataMap) { this.handleRouteDataMap(); }
|
if (!this.routeDataMap) { this.handleRouteDataMap(); }
|
||||||
if (!this.checkHaveRoute(deviceList)) { // 无效的进路按钮选择 清除deviceList
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
// this.$message.error('无效的进路按钮');
|
if (result.valid) {
|
||||||
this.clearOperate();
|
if (!this.checkHaveRoute(deviceList)) { // 无效的进路按钮选择 清除deviceList
|
||||||
return;
|
// this.$message.error('无效的进路按钮');
|
||||||
}
|
this.clearOperate();
|
||||||
this.deviceTimeNode = this.$store.state.socket.simulationTimeSync;
|
return;
|
||||||
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].signalCode || deviceList[0].code);// deviceList[0] 为 SignalButton || Signal
|
}
|
||||||
if (deviceList.length === 1 && !signal.routeLock) { // 排列进路 处理始端信号机状态
|
this.deviceTimeNode = this.$store.state.socket.simulationTimeSync;
|
||||||
operate.code = deviceList[0].code;
|
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].signalCode || deviceList[0].code);// deviceList[0] 为 SignalButton || Signal
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
if (deviceList.length === 1 && !signal.routeLock) {
|
||||||
if (valid) {
|
operate.code = deviceList[0].code;
|
||||||
// 仅信号按钮调车信号机有状态
|
|
||||||
if (deviceList[0]._type === 'SignalButton' || (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING')) {
|
if (deviceList[0]._type === 'SignalButton' || (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING')) {
|
||||||
this.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: deviceList[0]._type, hasSelected: 1}]);
|
this.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: deviceList[0]._type, hasSelected: 1}]);
|
||||||
}
|
}
|
||||||
}
|
} else if (deviceList.length > 1) {
|
||||||
}).catch(() => {
|
let key = '';
|
||||||
this.$refs.noticeInfo.doShow();
|
deviceList.forEach((item, index) => {
|
||||||
});
|
key = key + (index ? '-' : '') + item.code;
|
||||||
} else if (deviceList.length > 1) {
|
|
||||||
let key = '';
|
|
||||||
deviceList.forEach((item, index) => {
|
|
||||||
key = key + (index ? '-' : '') + item.code;
|
|
||||||
});
|
|
||||||
const route = this.routeDataMap[key];
|
|
||||||
if (route) {
|
|
||||||
operate.code = deviceList[deviceList.length - 1].code;
|
|
||||||
operate.param = {routeCode: route.code};
|
|
||||||
this.route = route;
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
this.deviceTimeNode = 0;
|
|
||||||
this.$store.dispatch('training/updateMapState',
|
|
||||||
[{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0}, {code: this.deviceList[1].code, _type: this.deviceList[1]._type, hasSelected: 1}]);
|
|
||||||
}).catch(() => {
|
|
||||||
this.deviceTimeNode = 0;
|
|
||||||
this.clearOperate();
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
});
|
|
||||||
} else if (this.menuSignal) {
|
|
||||||
key = '';
|
|
||||||
deviceList.forEach((item, index) => {
|
|
||||||
key = key + (index ? '-' : '') + (index ? item.code : this.menuSignal.code);
|
|
||||||
});
|
|
||||||
const route = this.routeDataMap[key];
|
|
||||||
if (route) {
|
|
||||||
operate.code = deviceList[deviceList.length - 1].code;
|
|
||||||
operate.param = {routeCode: route.code};
|
|
||||||
this.route = route;
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
this.deviceTimeNode = 0;
|
|
||||||
this.$store.dispatch('training/updateMapState',
|
|
||||||
[{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0}, {code: this.deviceList[1].code, _type: this.deviceList[1]._type, hasSelected: 1}]);
|
|
||||||
}).catch(() => {
|
|
||||||
this.deviceTimeNode = 0;
|
|
||||||
this.clearOperate();
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
});
|
});
|
||||||
|
const route = this.routeDataMap[key];
|
||||||
|
if (route) {
|
||||||
|
operate.code = deviceList[deviceList.length - 1].code;
|
||||||
|
operate.param = { routeCode: route.code };
|
||||||
|
this.route = route;
|
||||||
|
this.deviceTimeNode = 0;
|
||||||
|
const stateData = [
|
||||||
|
{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0},
|
||||||
|
{code: this.deviceList[1].code, _type: this.deviceList[1]._type, hasSelected: 1}
|
||||||
|
];
|
||||||
|
this.$store.dispatch('training/updateMapState', stateData);
|
||||||
|
} else if (this.menuSignal) {
|
||||||
|
key = '';
|
||||||
|
deviceList.forEach((item, index) => {
|
||||||
|
key = key + (index ? '-' : '') + (index ? item.code : this.menuSignal.code);
|
||||||
|
});
|
||||||
|
const route = this.routeDataMap[key];
|
||||||
|
if (route) {
|
||||||
|
operate.code = deviceList[deviceList.length - 1].code;
|
||||||
|
operate.param = {routeCode: route.code};
|
||||||
|
this.route = route;
|
||||||
|
this.deviceTimeNode = 0;
|
||||||
|
const stateData = [
|
||||||
|
{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0},
|
||||||
|
{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 1}
|
||||||
|
];
|
||||||
|
this.$store.dispatch('training/updateMapState', stateData);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
},
|
},
|
||||||
// 总取消
|
// 总取消
|
||||||
handelTotalCancel(model) {
|
handleTotalCancel(model) {
|
||||||
const operate = {
|
const operate = {
|
||||||
code: model.code,
|
code: model.code,
|
||||||
operation: this.$store.state.menuOperation.buttonOperation,
|
operation: this.$store.state.menuOperation.buttonOperation,
|
||||||
@ -558,10 +584,11 @@ export default {
|
|||||||
signalCode: model._type === 'Signal' ? model.code : model.signalCode
|
signalCode: model._type === 'Signal' ? model.code : model.signalCode
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
this.$store.dispatch('trainingNew/next', operate);
|
||||||
}).catch(() => {
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||||
this.$refs.noticeInfo.doShow();
|
// }).catch(() => {
|
||||||
});
|
// this.$refs.noticeInfo.doShow();
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
// 引导信号
|
// 引导信号
|
||||||
handleGuideSignal(model) {
|
handleGuideSignal(model) {
|
||||||
@ -571,11 +598,16 @@ export default {
|
|||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
param: {signalCode: model.signalCode}
|
param: {signalCode: model.signalCode}
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, hasSelected: 1}]);
|
if (result.valid) {
|
||||||
}).catch(() => {
|
this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, hasSelected: 1}]);
|
||||||
this.$refs.noticeInfo.doShow();
|
}
|
||||||
});
|
});
|
||||||
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||||
|
// this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, hasSelected: 1}]);
|
||||||
|
// }).catch(() => {
|
||||||
|
// this.$refs.noticeInfo.doShow();
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
// 人解进路
|
// 人解进路
|
||||||
handleTotalHumanSolution(model) {
|
handleTotalHumanSolution(model) {
|
||||||
@ -586,30 +618,32 @@ export default {
|
|||||||
val: model.code,
|
val: model.code,
|
||||||
param: { signalCode: model.code }
|
param: { signalCode: model.code }
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
this.$store.dispatch('trainingNew/next', operate);
|
||||||
}).catch(() => {
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||||
this.$refs.noticeInfo.doShow();
|
// }).catch(() => {
|
||||||
});
|
// this.$refs.noticeInfo.doShow();
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
handelSwitchOperate(model) {
|
handleSwitchOperate(model) {
|
||||||
const operate = {
|
const operate = {
|
||||||
code: model.code,
|
code: model.code,
|
||||||
operation: this.$store.state.menuOperation.buttonOperation,
|
operation: this.$store.state.menuOperation.buttonOperation,
|
||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
param: { switchCode: model.code}
|
param: { switchCode: model.code}
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
this.$store.dispatch('trainingNew/next', operate);
|
||||||
}).catch(() => {
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||||
this.$refs.noticeInfo.doShow();
|
// }).catch(() => {
|
||||||
});
|
// this.$refs.noticeInfo.doShow();
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
// 发送指令
|
// 发送指令
|
||||||
sendCommand(operate) {
|
// sendCommand(operate) {
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
|
// this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
|
||||||
console.error(error);
|
// console.error(error);
|
||||||
this.$refs.noticeInfo.doShow();
|
// this.$refs.noticeInfo.doShow();
|
||||||
}).finally(() =>{ this.clearOperate(); });
|
// }).finally(() =>{ this.clearOperate(); });
|
||||||
},
|
// },
|
||||||
// 校验是否有列车(接车)按钮
|
// 校验是否有列车(接车)按钮
|
||||||
checkHasTrainButton(model) {
|
checkHasTrainButton(model) {
|
||||||
if (model.signalButtonList && model.signalButtonList.length > 0) {
|
if (model.signalButtonList && model.signalButtonList.length > 0) {
|
||||||
@ -623,7 +657,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handelSignalBlockOrUnblock(model) {
|
handleSignalBlockOrUnblock(model) {
|
||||||
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
|
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
|
||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
@ -649,7 +683,17 @@ export default {
|
|||||||
operate.param = {signalCode: model.signalCode};
|
operate.param = {signalCode: model.signalCode};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sendCommand(operate);
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
|
if (result.valid) {
|
||||||
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.params }).then(resp => {
|
||||||
|
this.clearOperate();
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
this.clearOperate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleGuideLock(model) {
|
handleGuideLock(model) {
|
||||||
const operate = {
|
const operate = {
|
||||||
@ -658,13 +702,14 @@ export default {
|
|||||||
userOperationType: 'leftClick',
|
userOperationType: 'leftClick',
|
||||||
param: {signalCode: model.signalCode}
|
param: {signalCode: model.signalCode}
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
||||||
}).catch((e) => {
|
// }).catch((e) => {
|
||||||
this.$refs.noticeInfo.doShow();
|
// this.$refs.noticeInfo.doShow();
|
||||||
this.clearOperate();
|
// this.clearOperate();
|
||||||
});
|
// });
|
||||||
|
this.$store.dispatch('trainingNew/next', operate);
|
||||||
},
|
},
|
||||||
handelFaultSection(model) {
|
handleFaultSection(model) {
|
||||||
if (model._type === 'Section') {
|
if (model._type === 'Section') {
|
||||||
const operate = {
|
const operate = {
|
||||||
over: true,
|
over: true,
|
||||||
@ -673,7 +718,17 @@ export default {
|
|||||||
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
|
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
|
||||||
param: {sectionCode: model.code}
|
param: {sectionCode: model.code}
|
||||||
};
|
};
|
||||||
this.sendCommand(operate);
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
|
if (result.valid) {
|
||||||
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.params }).then(resp => {
|
||||||
|
this.clearOperate();
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
this.clearOperate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// CHANGE_DIRECTION
|
// CHANGE_DIRECTION
|
||||||
@ -691,17 +746,17 @@ export default {
|
|||||||
// debugger;
|
// debugger;
|
||||||
if (buttonOperation && this.commandTypeList.includes(model._type)) {
|
if (buttonOperation && this.commandTypeList.includes(model._type)) {
|
||||||
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
|
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
|
||||||
this.handelTotalCancel(model);
|
this.handleTotalCancel(model);
|
||||||
} else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) {
|
} else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) {
|
||||||
this.handleTotalHumanSolution(model);
|
this.handleTotalHumanSolution(model);
|
||||||
} else if (this.switchOperation.includes(buttonOperation)) {
|
} else if (this.switchOperation.includes(buttonOperation)) {
|
||||||
this.handelSwitchOperate(model);
|
this.handleSwitchOperate(model);
|
||||||
} else if (buttonOperation === this.Signal.lock.button.operation || buttonOperation === this.Signal.unlock.button.operation) {
|
} else if (buttonOperation === this.Signal.lock.button.operation || buttonOperation === this.Signal.unlock.button.operation) {
|
||||||
this.handelSignalBlockOrUnblock(model);
|
this.handleSignalBlockOrUnblock(model);
|
||||||
} else if (buttonOperation === this.Section.fault.button.operation) {
|
} else if (buttonOperation === this.Section.fault.button.operation) {
|
||||||
this.handelFaultSection(model);
|
this.handleFaultSection(model);
|
||||||
} else if (buttonOperation === this.Signal.reopenSignal.button.operation) {
|
} else if (buttonOperation === this.Signal.reopenSignal.button.operation) {
|
||||||
this.handelReopenSignal(model);
|
this.handleReopenSignal(model);
|
||||||
} else if (buttonOperation === this.Signal.arrangementRoute.button.operation) {
|
} else if (buttonOperation === this.Signal.arrangementRoute.button.operation) {
|
||||||
this.deviceList.push(model);
|
this.deviceList.push(model);
|
||||||
this.arrangementRouteOperation(this.deviceList);
|
this.arrangementRouteOperation(this.deviceList);
|
||||||
@ -763,12 +818,16 @@ export default {
|
|||||||
},
|
},
|
||||||
routeCommit(trainCode, duration) {
|
routeCommit(trainCode, duration) {
|
||||||
const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.CTC.CTC_SET_ROUTE, param:{ tripNumber: trainCode || '', duration: duration >= 0 ? duration : null, force: false }};
|
const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.CTC.CTC_SET_ROUTE, param:{ tripNumber: trainCode || '', duration: duration >= 0 ? duration : null, force: false }};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
this.clearOperate();
|
if (result.valid) {
|
||||||
}).catch((e) => {
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.params }).then(resp => {
|
||||||
console.log(e, 'error');
|
this.clearOperate();
|
||||||
this.$refs.noticeInfo.doShow();
|
}).catch(e => {
|
||||||
this.clearOperate();
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
this.clearOperate();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
commandOrders() {
|
commandOrders() {
|
||||||
@ -780,44 +839,40 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.routeCommit();
|
this.routeCommit();
|
||||||
}
|
}
|
||||||
} else if (this.operation === OperationEvent.MixinCommand.totalCancel.button.operation) {
|
} else {
|
||||||
const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE};
|
const operate = {};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
if (this.operation === OperationEvent.MixinCommand.totalCancel.button.operation) {
|
||||||
this.clearOperate();
|
operate.userOperationType = 'leftClick';
|
||||||
}).catch((e) => {
|
operate.over = true;
|
||||||
this.$refs.noticeInfo.doShow();
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE;
|
||||||
this.clearOperate();
|
} else if (this.operation === OperationEvent.Signal.reopenSignal.button.operation) {
|
||||||
|
operate.userOperationType = 'leftClick';
|
||||||
|
operate.over = true;
|
||||||
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
|
||||||
|
} else if (this.operation === OperationEvent.Signal.guide.button.operation) {
|
||||||
|
operate.userOperationType = 'leftClick';
|
||||||
|
operate.over = true;
|
||||||
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
|
||||||
|
} else if (this.operation === OperationEvent.Signal.humanTrainRoute.button.operation) {
|
||||||
|
operate.userOperationType = 'leftClick';
|
||||||
|
operate.over = true;
|
||||||
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
|
||||||
|
} else if (this.switchOperation.includes(this.operation)) {
|
||||||
|
operate.userOperationType = 'leftClick';
|
||||||
|
operate.over = true;
|
||||||
|
operate.cmdType = this.cmdType;
|
||||||
|
}
|
||||||
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
|
if (result.valid) {
|
||||||
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.param }).then(resp => {
|
||||||
|
this.clearOperate();
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
this.clearOperate();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.button.operation) {
|
|
||||||
const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL};
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
this.clearOperate();
|
|
||||||
}).catch(() => {
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
this.clearOperate();
|
|
||||||
});
|
|
||||||
} else if (this.operation === OperationEvent.Signal.guide.button.operation) {
|
|
||||||
const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE};
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: this.selected._type, hasSelected: 0}]);
|
|
||||||
this.clearOperate();
|
|
||||||
}).catch(() => {
|
|
||||||
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: this.selected._type, hasSelected: 0}]);
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
this.clearOperate();
|
|
||||||
});
|
|
||||||
} else if (this.operation === OperationEvent.Signal.humanTrainRoute.button.operation) {
|
|
||||||
const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE};
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
}).catch((e) => {
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
}).finally(() => { this.clearOperate(); });
|
|
||||||
} else if (this.switchOperation.includes(this.operation)) {
|
|
||||||
const operate = {userOperationType: 'leftClick', over:true, cmdType: this.cmdType};
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
}).catch(() => {
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
}).finally(() => { this.clearOperate(); });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
commandClear() {
|
commandClear() {
|
||||||
@ -905,17 +960,16 @@ export default {
|
|||||||
param: noPasswordModelTypeMap[model.type].param,
|
param: noPasswordModelTypeMap[model.type].param,
|
||||||
cmdType : noPasswordModelTypeMap[model.type].nextCmdType
|
cmdType : noPasswordModelTypeMap[model.type].nextCmdType
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
this.clearOperate();
|
this.$store.dispatch('trainingNew/execute', { cmdType: result.cmdType, wholeParam: result.params }).then(resp => {
|
||||||
} else {
|
this.clearOperate();
|
||||||
this.$refs.noticeInfo.doShow();
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
this.$refs.noticeInfo.doShow();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
|
||||||
console.error(error);
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const operate = {
|
const operate = {
|
||||||
operation: modelTypeMap[model.type].operation,
|
operation: modelTypeMap[model.type].operation,
|
||||||
@ -923,34 +977,14 @@ export default {
|
|||||||
code: model.code,
|
code: model.code,
|
||||||
param: modelTypeMap[model.type].param
|
param: modelTypeMap[model.type].param
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('trainingNew/next', operate).then(result => {
|
||||||
if (valid) {
|
if (result.valid) {
|
||||||
operate.nextCmdType = modelTypeMap[model.type].nextCmdType;
|
operate.nextCmdType = modelTypeMap[model.type].nextCmdType;
|
||||||
operate['operateNext'] = this.Command.close.password.operation;
|
operate['operateNext'] = this.Command.close.password.operation;
|
||||||
this.$refs.password.doShow(operate);
|
this.$refs.password.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
|
||||||
console.error(error);
|
|
||||||
this.$refs.noticeInfo.doShow();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// const operate = {
|
|
||||||
// over: true,
|
|
||||||
// code: model.code,
|
|
||||||
// operation: this.CTCCommand.assistPressDownTurnDirection.menu.operation,
|
|
||||||
// cmdType: CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION,
|
|
||||||
// param: {
|
|
||||||
// labelEnum:model.labelEnum,
|
|
||||||
// stationCode:model.stationCode
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
|
|
||||||
// // this.clearOperate();
|
|
||||||
// }).catch((error) => {
|
|
||||||
// // this.clearOperate();
|
|
||||||
// console.error(error);
|
|
||||||
// this.$refs.noticeInfo.doShow();
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -36,39 +36,15 @@ class Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handle(operation) {
|
handle(operation) {
|
||||||
// return new Promise((resolve, reject) => {
|
|
||||||
// this.storeOperation(operation);
|
|
||||||
// const rtn = { valid: false, response: null };
|
|
||||||
// rtn.valid = ValidateHandler.validate(this.getTrainingMode(), operation);
|
|
||||||
// if (!rtn.valid ) {
|
|
||||||
// this.pop();
|
|
||||||
// reject();
|
|
||||||
// } else {
|
|
||||||
// if (operation.cancel === true) {
|
|
||||||
// this.clear();
|
|
||||||
// } else {
|
|
||||||
// if (operation.cmdType.value) {
|
|
||||||
// rtn.cmdType = operation.cmdType.value;
|
|
||||||
// rtn.params = this.getWholeParam();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// resolve(rtn);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
this.storeOperation(operation);
|
this.storeOperation(operation);
|
||||||
const result = { valid: false };
|
let valid = false;
|
||||||
result.valid = ValidateHandler.validate(this.getTrainingMode(), operation);
|
valid = ValidateHandler.validate(this.getTrainingMode(), operation);
|
||||||
if (!result.valid) {
|
if (!valid) {
|
||||||
this.pop();
|
this.pop();
|
||||||
} else {
|
} else if (operation.cancel === true) {
|
||||||
if (operation.cancel === true) {
|
this.clear();
|
||||||
this.clear();
|
|
||||||
} else if (operation.cmdType.value) {
|
|
||||||
result.cmdType = operation.cmdType.value;
|
|
||||||
result.params = this.getWholeParam();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return valid;
|
||||||
}
|
}
|
||||||
execute(cmdType, wholeParam) {
|
execute(cmdType, wholeParam) {
|
||||||
const group = router.currentRoute.query.group;
|
const group = router.currentRoute.query.group;
|
||||||
@ -78,7 +54,6 @@ class Handler {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +150,7 @@ const training = {
|
|||||||
store.dispatch('training/setOperate', operate);
|
store.dispatch('training/setOperate', operate);
|
||||||
if (state.trainingDetail && !state.trainingSwitch) {
|
if (state.trainingDetail && !state.trainingSwitch) {
|
||||||
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() === 'en' ? 'Please click start, start training!' : '请点击开始,开始实训!', color: 'red' });
|
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() === 'en' ? 'Please click start, start training!' : '请点击开始,开始实训!', color: 'red' });
|
||||||
|
return {valid: false};
|
||||||
} else {
|
} else {
|
||||||
const result = NewHandler.handle(operate);
|
const result = NewHandler.handle(operate);
|
||||||
if (state.trainingSwitch && state.trainingDetail.type === 'SINGLE' && (state.teachMode === ScriptMode.TEACH || state.teachMode === ScriptMode.PRACTICE)) {
|
if (state.trainingSwitch && state.trainingDetail.type === 'SINGLE' && (state.teachMode === ScriptMode.TEACH || state.teachMode === ScriptMode.PRACTICE)) {
|
||||||
@ -160,6 +161,15 @@ const training = {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
execute: ({ commit, state }, { cmdType, wholeParam }) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
NewHandler.execute(cmdType, wholeParam).then(resp => {
|
||||||
|
resolve(resp);
|
||||||
|
}).catch(e=> {
|
||||||
|
reject(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -57,7 +57,6 @@ export default {
|
|||||||
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
|
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
|
||||||
if (this.mapData && this.mapData.pictureList) {
|
if (this.mapData && this.mapData.pictureList) {
|
||||||
const picture = this.mapData.pictureList.find(picture => picture.type === 'dispatchWork');
|
const picture = this.mapData.pictureList.find(picture => picture.type === 'dispatchWork');
|
||||||
console.log(picture, this.mapData.pictureList, '-----------');
|
|
||||||
if (picture) {
|
if (picture) {
|
||||||
this.handlerPictureShow(picture);
|
this.handlerPictureShow(picture);
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,7 +76,11 @@ export default {
|
|||||||
// this.$jlmap.updateShowMode(list, '02');
|
// this.$jlmap.updateShowMode(list, '02');
|
||||||
// }
|
// }
|
||||||
if (this.mapData && this.mapData.pictureList) {
|
if (this.mapData && this.mapData.pictureList) {
|
||||||
const type = this.datie ? 'chainStation' : 'localWork';
|
let type = this.datie ? 'chainStation' : 'localWork';
|
||||||
|
const station = this.mapDevice[this.roleDeviceCode];
|
||||||
|
if (station && station.depot) {
|
||||||
|
type = 'chainStation';
|
||||||
|
}
|
||||||
const picture = this.mapData.pictureList.find(picture => picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
|
const picture = this.mapData.pictureList.find(picture => picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
|
||||||
if (picture) {
|
if (picture) {
|
||||||
this.handlerPictureShow(picture);
|
this.handlerPictureShow(picture);
|
||||||
|
@ -1,393 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div v-loading="loading" class="view-control-content">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
||||||
<el-card shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
|
|
||||||
<div slot="header">
|
|
||||||
<span>请选择行调显示设备</span>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div class="content-box-list" style="margin-top: 10px;">
|
|
||||||
<div class="title-box">设备列表</div>
|
|
||||||
<div class="list-box" style="height:400px;overflow:auto">
|
|
||||||
<div v-for="nor in addModel.elementList" :key="nor.code" class="list-content">
|
|
||||||
<div class="name">{{ getDeviceName(nor) }}</div>
|
|
||||||
<div class="close" @click="delList(nor, addModel.elementList)"><i class="el-icon-close" /></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div class="content-box-list" style="margin-top: 10px">
|
|
||||||
<div style="height: 30px;line-height: 30px;margin-bottom: 10px;">
|
|
||||||
<span class="title-box">修正设备列表</span>
|
|
||||||
<el-button icon="el-icon-plus" size="mini" style="float:right;" circle @click="addAmendPoints" />
|
|
||||||
</div>
|
|
||||||
<template v-for="(elem, i) in amendPointsList">
|
|
||||||
<el-card :key="i" class="box-card">
|
|
||||||
<el-row>
|
|
||||||
<el-button icon="el-icon-minus" size="mini" style="float:right;" circle @click="delAmendPoints(i)" />
|
|
||||||
</el-row>
|
|
||||||
<el-row style="height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>修正设备:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-select v-model="elem.code" filterable size="mini" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in [...sectionList, ...signalList, ...trainWindowList]"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name?item.name:'' + '(' + item.code + ')'"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button :type="hoverIndex === i?'danger':'primary'" size="mini" @click="hoverClick(i)">激活</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'points')" style="margin-top: 10px;">
|
|
||||||
<el-col :span="5" style="height: 28px;line-height: 28px">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<template v-for="(point, j) in elem.points">
|
|
||||||
<div :key="j">
|
|
||||||
<el-input-number v-model="point.x" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="point.y" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<el-button icon="el-icon-plus" size="mini" circle @click="addPoint(j, elem.points)" />
|
|
||||||
<el-button icon="el-icon-minus" size="mini" circle :disabled="elem.points.length < 3" @click="delPoint(j, elem.points)" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'position')" style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="elem.position.x" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="elem.position.y" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'rotate')" style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>旋转角度:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="elem.rotate" style="width: 100px" size="mini" :min="-360" :max="360" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'reversal')" style="margin-top: 10px;height: 28px;line-height: 28px;">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>车头翻转:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-checkbox v-model="elem.reversal" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<div style="display: table; margin-left: 120px; margin-top: 12px; margin-bottom: 20px;">
|
|
||||||
<el-button type="primary" size="small" :loading="dataLoading" @click="generateData">自动生成</el-button>
|
|
||||||
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
|
|
||||||
<el-button type="primary" size="small" :loading="dataLoading" @click="clear">清除</el-button>
|
|
||||||
<el-button type="primary" size="small" @click="back">返回</el-button>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { saveMap } from '@/api/jmap/mapdraft';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
selected: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
otherData: [],
|
|
||||||
addModel: {
|
|
||||||
type: 'CENTER',
|
|
||||||
elementList: []
|
|
||||||
},
|
|
||||||
amendPointsList: [],
|
|
||||||
loading: false,
|
|
||||||
dataLoading:false,
|
|
||||||
hoverIndex: -1
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'sectionList',
|
|
||||||
'stationList',
|
|
||||||
'signalList',
|
|
||||||
'switchList',
|
|
||||||
'stationStandList',
|
|
||||||
'automaticRouteButtonList',
|
|
||||||
'axleCounterResetButtonList',
|
|
||||||
'cycleButtonList',
|
|
||||||
'directionRodList',
|
|
||||||
'indicatorLightList',
|
|
||||||
'lineList',
|
|
||||||
'outerFrameList',
|
|
||||||
'psdList',
|
|
||||||
'responderList',
|
|
||||||
'tbStrategyList',
|
|
||||||
'tempSpeedLimitList',
|
|
||||||
'textList',
|
|
||||||
'totalGuideLockButtonVOList',
|
|
||||||
'seclectDeviceList',
|
|
||||||
'trainWindowList',
|
|
||||||
'signalButtonList'
|
|
||||||
])
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
selected: function (val, oldVal) {
|
|
||||||
this.deviceSelect(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initData() {
|
|
||||||
(this.$store.state.map.map.displayList || []).forEach(item => {
|
|
||||||
if (item.type === 'CENTER') {
|
|
||||||
this.addModel = item;
|
|
||||||
this.amendPointsList = this.addModel.amendPointsList ? this.addModel.amendPointsList : [];
|
|
||||||
} else {
|
|
||||||
this.otherData.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deviceSelect(selected) {
|
|
||||||
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
|
|
||||||
this.seclectDeviceList.forEach(item => {
|
|
||||||
if (this.addModel.elementList.indexOf(item.code) < 0) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (selected && this.hoverIndex > -1 && (['Section'.toUpperCase(), 'Signal'.toUpperCase(), 'TrainWindow'.toUpperCase()].includes(selected._type.toUpperCase()))) {
|
|
||||||
this.amendPointsList[this.hoverIndex].code = selected.code;
|
|
||||||
} else if (selected) {
|
|
||||||
if (this.addModel.elementList.indexOf(selected.code) < 0) {
|
|
||||||
this.addModel.elementList.push(selected.code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
hoverClick(index) {
|
|
||||||
this.hoverIndex = this.hoverIndex === index ? -1 : index;
|
|
||||||
},
|
|
||||||
checkDeviceType(data, prop) {
|
|
||||||
if (data.code) {
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](data.code);
|
|
||||||
if (device._type === 'Section' && prop === 'points') {
|
|
||||||
return true;
|
|
||||||
} else if (device._type === 'Signal' && (prop === 'position' || prop === 'rotate')) {
|
|
||||||
return true;
|
|
||||||
} else if (device._type === 'TrainWindow' && (prop === 'position' || prop === 'reversal')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
getDeviceName(code) {
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
|
||||||
return device.name || device.code;
|
|
||||||
},
|
|
||||||
// 删除当前选中
|
|
||||||
delList(model, list) {
|
|
||||||
list.forEach((nor, index) => {
|
|
||||||
if (nor == model) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.seclectDeviceList.forEach((item, index) => {
|
|
||||||
if (item.code == model) {
|
|
||||||
this.seclectDeviceList.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
this.addModel = {
|
|
||||||
type: 'CENTER',
|
|
||||||
elementList: []
|
|
||||||
};
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.otherData],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
this.dataLoading = true;
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.$message.success('保存行调配置成功');
|
|
||||||
this.dataLoading = false;
|
|
||||||
}).catch(() => {
|
|
||||||
this.dataLoading = false;
|
|
||||||
this.$messageBox('保存行调配置失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
addAmendPoints() {
|
|
||||||
this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }], position: {x: 0, y: 0}, rotate:0, reversal: false });
|
|
||||||
},
|
|
||||||
delAmendPoints(index) {
|
|
||||||
this.hoverIndex = -1;
|
|
||||||
this.amendPointsList.splice(index, 1);
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
if (this.amendPointsList.find(elem => !elem.code)) {
|
|
||||||
this.$messageBox('修正设备未选择!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
this.addModel.amendPointsList = this.amendPointsList;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.otherData, this.addModel],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
this.dataLoading = true;
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.$message.success('保存行调配置成功');
|
|
||||||
this.dataLoading = false;
|
|
||||||
}).catch(() => {
|
|
||||||
this.dataLoading = false;
|
|
||||||
this.$messageBox('保存行调配置失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
back() {
|
|
||||||
this.$emit('goDraw');
|
|
||||||
},
|
|
||||||
generateData() {
|
|
||||||
this.loading = true;
|
|
||||||
this.addModel = {
|
|
||||||
type: 'CENTER',
|
|
||||||
elementList: []
|
|
||||||
};
|
|
||||||
const stationCodes = [];
|
|
||||||
this.stationList.forEach(item => {
|
|
||||||
if (item.depot) {
|
|
||||||
stationCodes.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
|
|
||||||
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
|
|
||||||
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList, ...this.signalButtonList].forEach(item => {
|
|
||||||
if (!stationCodes.includes(item.stationCode)) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
[...this.directionRodList].forEach(item => {
|
|
||||||
if (!stationCodes.includes(item.deviceStationCode)) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.stationList.forEach(item => {
|
|
||||||
if (!stationCodes.includes(item.code)) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.psdList.forEach(item => {
|
|
||||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
|
||||||
if (!stationCodes.includes(stand.stationCode)) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.otherData, this.addModel],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$message.success('保存行调配置成功');
|
|
||||||
}).catch(() => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$messageBox('保存行调配置失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
addPoint(index, points) {
|
|
||||||
points.splice(index, 0, {x:0, y:0});
|
|
||||||
},
|
|
||||||
delPoint(index, points) {
|
|
||||||
points.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
.title-box{
|
|
||||||
padding-left: 10px;
|
|
||||||
border-left: 4px solid red;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.box-card {
|
|
||||||
width: 100%;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
.coordinate {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
text-align: right;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
line-height: 28px;
|
|
||||||
width: 120px;
|
|
||||||
font-weight: bold;
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
margin-right: 7px;
|
|
||||||
}
|
|
||||||
.listWidth{
|
|
||||||
display: table;
|
|
||||||
float: left;
|
|
||||||
margin-right: 20px;
|
|
||||||
&:last-child{
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.list-box{
|
|
||||||
overflow: hidden;
|
|
||||||
.list-content{
|
|
||||||
float: left;
|
|
||||||
background: #e2e2e2;
|
|
||||||
margin: 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover{
|
|
||||||
background: #ccc;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
float: left;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
.close{
|
|
||||||
float: left;
|
|
||||||
width: 23px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,479 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div v-loading="loading" class="view-control-content">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
||||||
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
|
||||||
<el-table-column label="车站">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<template v-for="stationCode in scope.row.stationCodeList">
|
|
||||||
<span :key="stationCode" style="margin-left: 10px">{{ getDeviceName(stationCode) }}</span>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="100px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" size="small" @click.native.prevent="editModel(tableData, scope.$index)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button type="text" size="small" @click.native.prevent="deleteModel(tableData, scope.$index)">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-card shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span style="font-size: 12px;">{{ cardTitle }}</span>
|
|
||||||
<el-button style="float: right; padding: 3px 3px" type="text" @click="clear">清空</el-button>
|
|
||||||
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
|
|
||||||
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
|
|
||||||
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
|
|
||||||
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div>
|
|
||||||
<span>车站:</span>
|
|
||||||
<el-select v-model="addModel.stationCodeList" size="mini" style="width: 300px;" multiple placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in stationList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="content-box-list" style="margin-top: 10px;">
|
|
||||||
<div class="title-box">设备列表</div>
|
|
||||||
<div class="list-box" style="height:400px;overflow:auto">
|
|
||||||
<div v-for="nor in addModel.elementList" :key="nor.code" class="list-content">
|
|
||||||
<div class="name">{{ getDeviceName(nor) }}</div>
|
|
||||||
<div class="close" @click="delList(nor, addModel.elementList)"><i class="el-icon-close" /></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div class="content-box-list" style="margin-top: 10px">
|
|
||||||
<div style="height: 30px;line-height: 30px;margin-bottom: 10px;">
|
|
||||||
<span class="title-box">修正设备列表</span>
|
|
||||||
<el-button icon="el-icon-plus" size="mini" style="float:right;" circle @click="addAmendPoints" />
|
|
||||||
</div>
|
|
||||||
<template v-for="(elem, i) in amendPointsList">
|
|
||||||
<el-card :key="i" class="box-card">
|
|
||||||
<el-row>
|
|
||||||
<el-button icon="el-icon-minus" size="mini" style="float:right;" circle @click="delAmendPoints(i)" />
|
|
||||||
</el-row>
|
|
||||||
<el-row style="height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>修正设备:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-select v-model="elem.code" filterable size="mini" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in [...sectionList, ...signalList, ...trainWindowList]"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name?item.name:'' + '(' + item.code + ')'"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button :type="hoverIndex === i?'danger':'primary'" size="mini" @click="hoverClick(i)">激活</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'points')" style="margin-top: 10px;">
|
|
||||||
<el-col :span="5" style="height: 28px;line-height: 28px">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<template v-for="(point, j) in elem.points">
|
|
||||||
<div :key="j">
|
|
||||||
<el-input-number v-model="point.x" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="point.y" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<el-button icon="el-icon-plus" size="mini" circle @click="addPoint(j, elem.points)" />
|
|
||||||
<el-button icon="el-icon-minus" size="mini" circle :disabled="elem.points.length < 3" @click="delPoint(j, elem.points)" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'position')" style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="elem.position.x" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="elem.position.y" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'rotate')" style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>旋转角度:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="elem.rotate" style="width: 100px" size="mini" :min="-360" :max="360" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'reversal')" style="margin-top: 10px;height: 28px;line-height: 28px;">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>车头翻转:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-checkbox v-model="elem.reversal" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div class="content-box-list" style="margin-top: 10px">
|
|
||||||
<div style="height: 30px;line-height: 30px;margin-bottom: 10px;">
|
|
||||||
<span class="title-box">偏移缩放</span>
|
|
||||||
<el-button size="mini" style="float:right;" @click="generateOffsetScale">定位</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-row style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="addModel.offsetX" style="width: 120px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="addModel.offsetY" style="width: 120px" size="mini" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>缩放:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="addModel.scaleRate" style="width: 100px" size="mini" :min="-360" :max="360" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<div style="display: table; margin-left: 150px; margin-top: 12px; margin-bottom: 20px;">
|
|
||||||
<el-button type="primary" size="small" @click="generateData">生成</el-button>
|
|
||||||
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
|
|
||||||
<el-button type="primary" size="small" @click="back">返回</el-button>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { saveMap } from '@/api/jmap/mapdraft';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
selected: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableData: [],
|
|
||||||
otherData: [],
|
|
||||||
addModel: {
|
|
||||||
type: 'LOCAL',
|
|
||||||
stationCodeList: [],
|
|
||||||
elementList: [],
|
|
||||||
offsetX: 0,
|
|
||||||
offsetY: 0,
|
|
||||||
scaleRate: 1
|
|
||||||
},
|
|
||||||
amendPointsList: [],
|
|
||||||
list: [],
|
|
||||||
field: '',
|
|
||||||
cardMode: 'generate',
|
|
||||||
index: '',
|
|
||||||
isPreview: true,
|
|
||||||
loading: false,
|
|
||||||
dataLoading:false,
|
|
||||||
depotStationList: [],
|
|
||||||
hoverIndex: -1
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'sectionList',
|
|
||||||
'stationList',
|
|
||||||
'signalList',
|
|
||||||
'switchList',
|
|
||||||
'stationStandList',
|
|
||||||
'automaticRouteButtonList',
|
|
||||||
'axleCounterResetButtonList',
|
|
||||||
'cycleButtonList',
|
|
||||||
'directionRodList',
|
|
||||||
'indicatorLightList',
|
|
||||||
'lineList',
|
|
||||||
'outerFrameList',
|
|
||||||
'psdList',
|
|
||||||
'responderList',
|
|
||||||
'tbStrategyList',
|
|
||||||
'tempSpeedLimitList',
|
|
||||||
'textList',
|
|
||||||
'totalGuideLockButtonVOList',
|
|
||||||
'seclectDeviceList',
|
|
||||||
'trainWindowList',
|
|
||||||
'signalButtonList'
|
|
||||||
]),
|
|
||||||
cardTitle() {
|
|
||||||
if (this.cardMode === 'generate') {
|
|
||||||
return '生成数据';
|
|
||||||
} else if (this.cardMode === 'edit') {
|
|
||||||
return '编辑数据';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
selected: function (val, oldVal) {
|
|
||||||
this.deviceSelect(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initData() {
|
|
||||||
this.depotStationList = this.stationList.filter(elem => elem.depot);
|
|
||||||
(this.$store.state.map.map.displayList || []).forEach( item => {
|
|
||||||
if (item.type === 'DEPOT_IL') {
|
|
||||||
this.tableData.push(item);
|
|
||||||
} else {
|
|
||||||
this.otherData.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
generateOffsetScale() {
|
|
||||||
this.addModel.offsetX = this.$store.state.map.dataZoom.offsetX || 0;
|
|
||||||
this.addModel.offsetY = this.$store.state.map.dataZoom.offsetY || 0;
|
|
||||||
this.addModel.scaleRate = this.$store.state.map.dataZoom.scaleRate || 1;
|
|
||||||
},
|
|
||||||
deviceSelect(selected) {
|
|
||||||
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
|
|
||||||
this.seclectDeviceList.forEach(item => {
|
|
||||||
if (this.addModel.elementList.indexOf(item.code) < 0) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (selected && this.hoverIndex > -1 && (['Section'.toUpperCase(), 'Signal'.toUpperCase(), 'TrainWindow'.toUpperCase()].includes(selected._type.toUpperCase()))) {
|
|
||||||
this.amendPointsList[this.hoverIndex].code = selected.code;
|
|
||||||
} else if (selected) {
|
|
||||||
if (this.addModel.elementList.indexOf(selected.code) < 0) {
|
|
||||||
this.addModel.elementList.push(selected.code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getDeviceName(code) {
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
|
||||||
return device.name || device.code;
|
|
||||||
},
|
|
||||||
hoverClick(index) {
|
|
||||||
this.hoverIndex = this.hoverIndex === index ? -1 : index;
|
|
||||||
},
|
|
||||||
checkDeviceType(data, prop) {
|
|
||||||
if (data.code) {
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](data.code);
|
|
||||||
if (device._type === 'Section' && prop === 'points') {
|
|
||||||
return true;
|
|
||||||
} else if (device._type === 'Signal' && (prop === 'position' || prop === 'rotate')) {
|
|
||||||
return true;
|
|
||||||
} else if (device._type === 'TrainWindow' && (prop === 'position' || prop === 'reversal')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
deleteModel(list, index) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
this.list.pop();
|
|
||||||
this.clearData();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
editModel(list, index) {
|
|
||||||
this.addModel = list[index];
|
|
||||||
this.amendPointsList = this.addModel.amendPointsList ? this.addModel.amendPointsList : [];
|
|
||||||
this.index = index;
|
|
||||||
this.cardMode = 'edit';
|
|
||||||
},
|
|
||||||
cancelOverlab() {
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
this.clear();
|
|
||||||
},
|
|
||||||
updateOverlab() {
|
|
||||||
if (this.index || this.index == 0) {
|
|
||||||
if (!this.addModel.stationCodeList.length) {
|
|
||||||
this.$messageBox('请选择车站!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.amendPointsList.find(elem => !elem.code)) {
|
|
||||||
this.$messageBox('修正设备未选择!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.addModel.amendPointsList = [...this.amendPointsList];
|
|
||||||
this.amendPointsList = [];
|
|
||||||
this.tableData.splice(this.index, 1, this.addModel);
|
|
||||||
this.clearData();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 删除当前选中
|
|
||||||
delList(model, list) {
|
|
||||||
list.forEach((nor, index) => {
|
|
||||||
if (nor == model) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.seclectDeviceList.forEach((item, index) => {
|
|
||||||
if (item.code == model) {
|
|
||||||
this.seclectDeviceList.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.tableData, ...this.otherData],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
this.dataLoading = true;
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.$message.success('保存车辆段配置成功');
|
|
||||||
this.dataLoading = false;
|
|
||||||
this.cancelOverlab();
|
|
||||||
}).catch(() => {
|
|
||||||
this.dataLoading = false;
|
|
||||||
this.$messageBox('保存车辆段配置失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
back() {
|
|
||||||
this.$emit('goDraw');
|
|
||||||
},
|
|
||||||
generateOverlab() { // 生成
|
|
||||||
if (!this.addModel.stationCodeList.length) {
|
|
||||||
this.$messageBox('请选择车站!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.amendPointsList.find(elem => !elem.code)) {
|
|
||||||
this.$messageBox('修正区段未选择!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.addModel.amendPointsList = [...this.amendPointsList];
|
|
||||||
this.amendPointsList = [];
|
|
||||||
this.hoverIndex = -1;
|
|
||||||
this.tableData.push(this.addModel);
|
|
||||||
this.clearData();
|
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [], offsetX: 0, offsetY: 0, scaleRate: 1 };
|
|
||||||
this.amendPointsList = [];
|
|
||||||
},
|
|
||||||
clearData() {
|
|
||||||
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [], offsetX: 0, offsetY: 0, scaleRate: 1 };
|
|
||||||
this.amendPointsList = [];
|
|
||||||
this.index = '';
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
addAmendPoints() {
|
|
||||||
this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }], position: {x: 0, y: 0}, rotate:0, reversal: false });
|
|
||||||
},
|
|
||||||
delAmendPoints(index) {
|
|
||||||
this.hoverIndex = -1;
|
|
||||||
this.amendPointsList.splice(index, 1);
|
|
||||||
},
|
|
||||||
addPoint(index, points) {
|
|
||||||
points.splice(index, 0, {x:0, y:0});
|
|
||||||
},
|
|
||||||
delPoint(index, points) {
|
|
||||||
points.splice(index, 1);
|
|
||||||
},
|
|
||||||
generateData() {
|
|
||||||
this.loading = true;
|
|
||||||
this.tableData = [];
|
|
||||||
this.stationList.forEach(item => {
|
|
||||||
if (item.depot) {
|
|
||||||
this.tableData.push({type: 'DEPOT_IL', stationCodeList: [item.code], elementList: [item.code], offsetX: 0, offsetY: 0, scaleRate: 1 });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
|
|
||||||
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
|
|
||||||
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList, ...this.signalButtonList].forEach(item => {
|
|
||||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(item.stationCode));
|
|
||||||
target && target.elementList.push(item.code);
|
|
||||||
});
|
|
||||||
[...this.directionRodList].forEach(item => {
|
|
||||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(item.deviceStationCode));
|
|
||||||
target && target.elementList.push(item.code);
|
|
||||||
});
|
|
||||||
this.psdList.forEach(item => {
|
|
||||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
|
||||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(stand.stationCode));
|
|
||||||
target && target.elementList.push(item.code);
|
|
||||||
});
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.tableData, ...this.otherData],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$message.success('保存车辆段配置成功');
|
|
||||||
this.cancelOverlab();
|
|
||||||
}).catch(() => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$messageBox('保存车辆段配置失败');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
.title-box{
|
|
||||||
padding-left: 10px;
|
|
||||||
border-left: 4px solid red;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.box-card {
|
|
||||||
width: 100%;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
.list-box{
|
|
||||||
overflow: hidden;
|
|
||||||
.list-content{
|
|
||||||
float: left;
|
|
||||||
background: #e2e2e2;
|
|
||||||
margin: 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover{
|
|
||||||
background: #ccc;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
float: left;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
.close{
|
|
||||||
float: left;
|
|
||||||
width: 23px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,518 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div v-loading="loading" class="view-control-content">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
||||||
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
|
||||||
<el-table-column label="车站">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<template v-for="stationCode in scope.row.stationCodeList">
|
|
||||||
<span :key="stationCode" style="margin-left: 10px">{{ getDeviceName(stationCode) }}</span>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="100px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" size="small" @click.native.prevent="editModel(tableData, scope.$index)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button type="text" size="small" @click.native.prevent="deleteModel(tableData, scope.$index)">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-card shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span style="font-size: 12px;">{{ cardTitle }}</span>
|
|
||||||
<el-button style="float: right; padding: 3px 3px" type="text" @click="clear">清空</el-button>
|
|
||||||
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
|
|
||||||
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
|
|
||||||
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
|
|
||||||
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div>
|
|
||||||
<span>车站:</span>
|
|
||||||
<el-select v-model="addModel.stationCodeList" size="mini" style="width: 300px;" multiple placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in stationList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div style="margin-top:10px">
|
|
||||||
<span>可切换显示的车站:</span>
|
|
||||||
<el-select v-model="addModel.switchStationCodeList" size="mini" style="width:200px;" multiple placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in stationList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="content-box-list" style="margin-top: 10px;">
|
|
||||||
<div class="title-box">设备列表</div>
|
|
||||||
<div class="list-box" style="height:400px;overflow:auto">
|
|
||||||
<div v-for="nor in addModel.elementList" :key="nor.code" class="list-content">
|
|
||||||
<div class="name">{{ getDeviceName(nor) }}</div>
|
|
||||||
<div class="close" @click="delList(nor, addModel.elementList)"><i class="el-icon-close" /></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="padding: 10px;font-size: 14px;">
|
|
||||||
<div class="content-box-list" style="margin-top: 10px">
|
|
||||||
<div style="height: 30px;line-height: 30px;margin-bottom: 10px;">
|
|
||||||
<span class="title-box">修正设备列表</span>
|
|
||||||
<el-button icon="el-icon-plus" size="mini" style="float:right;" circle @click="addAmendPoints" />
|
|
||||||
</div>
|
|
||||||
<template v-for="(elem, i) in amendPointsList">
|
|
||||||
<el-card :key="i" class="box-card">
|
|
||||||
<el-row>
|
|
||||||
<el-button icon="el-icon-minus" size="mini" style="float:right;" circle @click="delAmendPoints(i)" />
|
|
||||||
</el-row>
|
|
||||||
<el-row style="height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>修正设备:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-select v-model="elem.code" filterable size="mini" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in [...sectionList, ...signalList, ...trainWindowList]"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name?item.name:'' + '(' + item.code + ')'"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button :type="hoverIndex === i?'danger':'primary'" size="mini" @click="hoverClick(i)">激活</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'points')" style="margin-top: 10px;">
|
|
||||||
<el-col :span="5" style="height: 28px;line-height: 28px;">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<template v-for="(point, j) in elem.points">
|
|
||||||
<div :key="j">
|
|
||||||
<el-input-number v-model="point.x" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="point.y" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<el-button icon="el-icon-plus" size="mini" circle @click="addPoint(j, elem.points)" />
|
|
||||||
<el-button icon="el-icon-minus" size="mini" circle :disabled="elem.points.length < 3" @click="delPoint(j, elem.points)" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'position')" style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>坐标点:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="elem.position.x" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
<span style="line-height: 28px;">, </span>
|
|
||||||
<el-input-number v-model="elem.position.y" style="width: 100px" size="mini" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'rotate')" style="margin-top: 10px;height: 28px;line-height: 28px">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>旋转角度:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-input-number v-model="elem.rotate" style="width: 100px" size="mini" :min="-360" :max="360" controls-position="right" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="checkDeviceType(elem, 'reversal')" style="margin-top: 10px;height: 28px;line-height: 28px;">
|
|
||||||
<el-col :span="5">
|
|
||||||
<span>车头翻转:</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="19">
|
|
||||||
<el-checkbox v-model="elem.reversal" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
|
|
||||||
<el-button type="primary" size="small" @click="generateData">按集中站生成</el-button>
|
|
||||||
<el-button type="primary" size="small" @click="generateAllData">全显生成</el-button>
|
|
||||||
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
|
|
||||||
<el-button type="primary" size="small" @click="back">返回</el-button>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { saveMap } from '@/api/jmap/mapdraft';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
selected: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableData: [],
|
|
||||||
otherData: [],
|
|
||||||
addModel: {
|
|
||||||
type: 'LOCAL',
|
|
||||||
stationCodeList: [],
|
|
||||||
switchStationCodeList:[],
|
|
||||||
elementList: []
|
|
||||||
},
|
|
||||||
amendPointsList: [],
|
|
||||||
list: [],
|
|
||||||
field: '',
|
|
||||||
cardMode: 'generate',
|
|
||||||
index: '',
|
|
||||||
isPreview: true,
|
|
||||||
loading: false,
|
|
||||||
dataLoading:false,
|
|
||||||
hoverIndex: -1
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'sectionList',
|
|
||||||
'stationList',
|
|
||||||
'signalList',
|
|
||||||
'switchList',
|
|
||||||
'stationStandList',
|
|
||||||
'automaticRouteButtonList',
|
|
||||||
'axleCounterResetButtonList',
|
|
||||||
'cycleButtonList',
|
|
||||||
'directionRodList',
|
|
||||||
'indicatorLightList',
|
|
||||||
'lineList',
|
|
||||||
'outerFrameList',
|
|
||||||
'psdList',
|
|
||||||
'responderList',
|
|
||||||
'tbStrategyList',
|
|
||||||
'tempSpeedLimitList',
|
|
||||||
'textList',
|
|
||||||
'totalGuideLockButtonVOList',
|
|
||||||
'seclectDeviceList',
|
|
||||||
'trainWindowList',
|
|
||||||
'signalButtonList'
|
|
||||||
]),
|
|
||||||
cardTitle() {
|
|
||||||
if (this.cardMode === 'generate') {
|
|
||||||
return '生成数据';
|
|
||||||
} else if (this.cardMode === 'edit') {
|
|
||||||
return '编辑数据';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
selected: function (val, oldVal) {
|
|
||||||
this.deviceSelect(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// deviceSelect(selected) {
|
|
||||||
// this.$refs.form && this.$refs.form.resetFields();
|
|
||||||
// this.$refs.make && this.$refs.make.resetFields();
|
|
||||||
// if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectSection'.toUpperCase()) {
|
|
||||||
// if (selected.type === '01' || selected.type === '02' || selected.type === '03') {
|
|
||||||
// this.addModel.sectionCode = selected.code;
|
|
||||||
// this.field = '';
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
initData() {
|
|
||||||
(this.$store.state.map.map.displayList || []).forEach( item => {
|
|
||||||
if (item.type === 'LOCAL') {
|
|
||||||
this.tableData.push(item);
|
|
||||||
} else {
|
|
||||||
this.otherData.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deviceSelect(selected) {
|
|
||||||
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
|
|
||||||
this.seclectDeviceList.forEach(item => {
|
|
||||||
if (this.addModel.elementList.indexOf(item.code) < 0) {
|
|
||||||
this.addModel.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (selected && this.hoverIndex > -1 && (['Section'.toUpperCase(), 'Signal'.toUpperCase(), 'TrainWindow'.toUpperCase()].includes(selected._type.toUpperCase()))) {
|
|
||||||
this.amendPointsList[this.hoverIndex].code = selected.code;
|
|
||||||
} else if (selected) {
|
|
||||||
if (this.addModel.elementList.indexOf(selected.code) < 0) {
|
|
||||||
this.addModel.elementList.push(selected.code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
hoverClick(index) {
|
|
||||||
this.hoverIndex = this.hoverIndex === index ? -1 : index;
|
|
||||||
},
|
|
||||||
getDeviceName(code) {
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
|
||||||
return device.name || device.code;
|
|
||||||
},
|
|
||||||
checkDeviceType(data, prop) {
|
|
||||||
if (data.code) {
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](data.code);
|
|
||||||
if (device._type === 'Section' && prop === 'points') {
|
|
||||||
return true;
|
|
||||||
} else if (device._type === 'Signal' && (prop === 'position' || prop === 'rotate')) {
|
|
||||||
return true;
|
|
||||||
} else if (device._type === 'TrainWindow' && (prop === 'position' || prop === 'reversal')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
deleteModel(list, index) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
this.list.pop();
|
|
||||||
this.clearData();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
editModel(list, index) {
|
|
||||||
this.addModel = list[index];
|
|
||||||
this.amendPointsList = this.addModel.amendPointsList ? this.addModel.amendPointsList : [];
|
|
||||||
this.index = index;
|
|
||||||
this.cardMode = 'edit';
|
|
||||||
},
|
|
||||||
cancelOverlab() {
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
this.clear();
|
|
||||||
},
|
|
||||||
updateOverlab() {
|
|
||||||
if (this.index || this.index == 0) {
|
|
||||||
if (!this.addModel.stationCodeList.length) {
|
|
||||||
this.$messageBox('请选择车站!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.addModel.switchStationCodeList.length) {
|
|
||||||
this.$messageBox('请选择可切换显示的车站!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.amendPointsList.find(elem => !elem.code)) {
|
|
||||||
this.$messageBox('修正设备未选择!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.addModel.amendPointsList = [...this.amendPointsList];
|
|
||||||
this.amendPointsList = [];
|
|
||||||
this.tableData.splice(this.index, 1, this.addModel);
|
|
||||||
this.clearData();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 删除当前选中
|
|
||||||
delList(model, list) {
|
|
||||||
list.forEach((nor, index) => {
|
|
||||||
if (nor == model) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.seclectDeviceList.forEach((item, index) => {
|
|
||||||
if (item.code == model) {
|
|
||||||
this.seclectDeviceList.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.tableData, ...this.otherData],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
this.dataLoading = true;
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.$message.success('保存现地配置成功');
|
|
||||||
this.dataLoading = false;
|
|
||||||
this.cancelOverlab();
|
|
||||||
}).catch(() => {
|
|
||||||
this.dataLoading = false;
|
|
||||||
this.$messageBox('保存现地配置失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
back() {
|
|
||||||
this.$emit('goDraw');
|
|
||||||
},
|
|
||||||
generateOverlab() { // 生成
|
|
||||||
if (!this.addModel.stationCodeList.length) {
|
|
||||||
this.$messageBox('请选择车站!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.addModel.switchStationCodeList.length) {
|
|
||||||
this.$messageBox('请选择可切换显示的车站!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.amendPointsList.find(elem => !elem.code)) {
|
|
||||||
this.$messageBox('修正区段未选择!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.addModel.amendPointsList = [...this.amendPointsList];
|
|
||||||
this.amendPointsList = [];
|
|
||||||
this.hoverIndex = -1;
|
|
||||||
this.tableData.push(this.addModel);
|
|
||||||
this.clearData();
|
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
|
||||||
this.amendPointsList = [];
|
|
||||||
},
|
|
||||||
clearData() {
|
|
||||||
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
|
||||||
this.amendPointsList = [];
|
|
||||||
this.index = '';
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
generateAllData() {
|
|
||||||
this.loading = true;
|
|
||||||
this.tableData = [];
|
|
||||||
const tempData = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
|
|
||||||
const stationCodeList = [];
|
|
||||||
this.stationList.forEach(item => {
|
|
||||||
if (!item.depot) {
|
|
||||||
tempData.stationCodeList.push(item.code);
|
|
||||||
tempData.switchStationCodeList.push(item.code);
|
|
||||||
tempData.elementList.push(item.code);
|
|
||||||
} else { stationCodeList.push(item.code); }
|
|
||||||
});
|
|
||||||
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
|
|
||||||
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
|
|
||||||
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList, ...this.signalButtonList].forEach(item => {
|
|
||||||
if (!stationCodeList.includes(item.stationCode)) {
|
|
||||||
tempData.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
[...this.directionRodList].forEach(item => {
|
|
||||||
if (!stationCodeList.includes(item.deviceStationCode)) {
|
|
||||||
tempData.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.psdList.forEach(item => {
|
|
||||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
|
||||||
if (!stationCodeList.includes(stand.stationCode)) {
|
|
||||||
tempData.elementList.push(item.code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.tableData.push(tempData);
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.tableData, ...this.otherData],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$message.success('保存现地配置成功');
|
|
||||||
this.cancelOverlab();
|
|
||||||
}).catch(() => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$messageBox('保存现地配置失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
addAmendPoints() {
|
|
||||||
this.amendPointsList.push({ code: '', points: [{ x: 0, y: 0 }, { x:0, y:0 }], position: {x: 0, y: 0}, rotate:0, reversal: false });
|
|
||||||
},
|
|
||||||
delAmendPoints(index) {
|
|
||||||
this.hoverIndex = -1;
|
|
||||||
this.amendPointsList.splice(index, 1);
|
|
||||||
},
|
|
||||||
addPoint(index, points) {
|
|
||||||
points.splice(index, 0, {x:0, y:0});
|
|
||||||
},
|
|
||||||
delPoint(index, points) {
|
|
||||||
points.splice(index, 1);
|
|
||||||
},
|
|
||||||
generateData() {
|
|
||||||
this.loading = true;
|
|
||||||
this.tableData = [];
|
|
||||||
// switchStationCodeList:[...item.switchStationCodeList, item.code]
|
|
||||||
this.stationList.forEach(item => {
|
|
||||||
if (item.centralized) {
|
|
||||||
this.tableData.push({type: 'LOCAL', stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
|
|
||||||
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
|
|
||||||
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList, ...this.signalButtonList].forEach(item => {
|
|
||||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(item.stationCode));
|
|
||||||
target && target.elementList.push(item.code);
|
|
||||||
});
|
|
||||||
[...this.directionRodList].forEach(item => {
|
|
||||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(item.deviceStationCode));
|
|
||||||
target && target.elementList.push(item.code);
|
|
||||||
});
|
|
||||||
this.psdList.forEach(item => {
|
|
||||||
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
|
|
||||||
const target = this.tableData.find(elem => elem.stationCodeList.includes(stand.stationCode));
|
|
||||||
target && target.elementList.push(item.code);
|
|
||||||
});
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
displayList: [...this.tableData, ...this.otherData],
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$message.success('保存现地配置成功');
|
|
||||||
this.cancelOverlab();
|
|
||||||
}).catch(() => {
|
|
||||||
this.loading = false;
|
|
||||||
this.$messageBox('保存现地配置失败');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
.title-box{
|
|
||||||
padding-left: 10px;
|
|
||||||
border-left: 4px solid red;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.box-card {
|
|
||||||
width: 100%;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
.list-box{
|
|
||||||
overflow: hidden;
|
|
||||||
.list-content{
|
|
||||||
float: left;
|
|
||||||
background: #e2e2e2;
|
|
||||||
margin: 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover{
|
|
||||||
background: #ccc;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
float: left;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
.close{
|
|
||||||
float: left;
|
|
||||||
width: 23px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,308 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="view-control-content">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
||||||
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
|
||||||
<el-table-column label="区段名称">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.name }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="换行位置">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span style="margin-left: 10px">{{ scope.row.position }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" size="small" @click.native.prevent="editModel(tableData, scope.$index)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button type="text" size="small" @click.native.prevent="deleteModel(tableData, scope.$index)">
|
|
||||||
移出
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span style="font-size: 12px;">{{ cardTitle }}</span>
|
|
||||||
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
|
|
||||||
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
|
|
||||||
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
|
|
||||||
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-form ref="hostileForm" :model="addModel" label-width="135px" size="mini" style="margin-top: 15px">
|
|
||||||
<el-form-item label="区段:" prop="sectionCode">
|
|
||||||
<el-select v-model="addModel.sectionCode" clearable :filterable="true">
|
|
||||||
<el-option
|
|
||||||
v-for="item in sectionList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name + ' (' + item.code+ ')'"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button
|
|
||||||
:type=" field === 'selectSection' ? 'danger' : 'primary'"
|
|
||||||
@click="hover('selectSection')"
|
|
||||||
>{{ $t('map.activate') }}</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<el-form ref="form" :model="formData" :rules="rules" label-width="140px" size="mini">
|
|
||||||
<el-form-item label="宽度:" prop="width">
|
|
||||||
<el-input-number v-model="formData.width" style="width: 150px;" :min="1" />
|
|
||||||
<span style="color: #ababab;">屏</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="高度:" prop="height">
|
|
||||||
<el-input-number v-model="formData.height" style="width: 150px;" :min="1" />
|
|
||||||
<span style="color: #ababab;">屏</span>
|
|
||||||
</el-form-item>
|
|
||||||
<template v-for="(item, i) in list">
|
|
||||||
<el-form-item :key="i" :label="'第'+ (i + 1) +'行偏移值:'" prop="offsetTop">
|
|
||||||
<el-input-number v-model="list[i]['offsetTop']" style="width: 150px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
</el-form>
|
|
||||||
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
|
|
||||||
<el-button type="primary" @click="save">保存</el-button>
|
|
||||||
<el-button v-if="isPreview" type="primary" @click="preview">预览</el-button>
|
|
||||||
<el-button v-if="!isPreview" type="primary" @click="recover">重置</el-button>
|
|
||||||
<el-button type="primary" @click="back">返回</el-button>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { saveMap } from '@/api/jmap/mapdraft';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
selected: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableData: [],
|
|
||||||
addModel: {
|
|
||||||
sectionCode: '',
|
|
||||||
offsetTop: 0
|
|
||||||
},
|
|
||||||
formData: {
|
|
||||||
width: 2,
|
|
||||||
height: 2,
|
|
||||||
offsetTop: 0
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
width: [
|
|
||||||
{ required: true, message: '请输入宽度', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
height: [
|
|
||||||
{ required: true, message: '请输入高度', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
list: [],
|
|
||||||
field: '',
|
|
||||||
cardMode: 'generate',
|
|
||||||
index: '',
|
|
||||||
isPreview: true
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'sectionList',
|
|
||||||
'bigScreenConfig'
|
|
||||||
]),
|
|
||||||
cardTitle() {
|
|
||||||
if (this.cardMode === 'generate') {
|
|
||||||
return '生成数据';
|
|
||||||
} else if (this.cardMode === 'edit') {
|
|
||||||
return '编辑数据';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
selected: function (val, oldVal) {
|
|
||||||
this.deviceSelect(val);
|
|
||||||
}
|
|
||||||
// bigScreenConfig: function(data) {
|
|
||||||
// if (data) {
|
|
||||||
// this.handleList(data);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.bigScreenConfig) {
|
|
||||||
this.handleList(this.bigScreenConfig);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
deviceSelect(selected) {
|
|
||||||
this.$refs.form && this.$refs.form.resetFields();
|
|
||||||
this.$refs.make && this.$refs.make.resetFields();
|
|
||||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectSection'.toUpperCase()) {
|
|
||||||
if (selected.type === '01' || selected.type === '02' || selected.type === '03') {
|
|
||||||
this.addModel.sectionCode = selected.code;
|
|
||||||
this.field = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleList(data) {
|
|
||||||
this.tableData = [];
|
|
||||||
if (data.bigScreenSplitConfig) {
|
|
||||||
data.bigScreenSplitConfig.forEach(item => {
|
|
||||||
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
|
||||||
if (section) {
|
|
||||||
const param = {
|
|
||||||
position: String(section.points[section.points.length - 1].x),
|
|
||||||
name: `${section.name}(${section.code})`,
|
|
||||||
offsetTop: 0,
|
|
||||||
sectionCode: section.code
|
|
||||||
};
|
|
||||||
this.tableData.push(param);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.tableData.sort((a, b) => Number(a.position) - Number(b.position)); // 数组排序
|
|
||||||
this.formData = {
|
|
||||||
width: data.width,
|
|
||||||
height: data.height
|
|
||||||
};
|
|
||||||
data.offsetList.length = data.bigScreenSplitConfig.length + 1;
|
|
||||||
}
|
|
||||||
if (data.offsetList && data.offsetList.length) {
|
|
||||||
this.list = [];
|
|
||||||
data.offsetList.forEach(item => {
|
|
||||||
const param = {offsetTop: item};
|
|
||||||
this.list.push(param);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.list = this.tableData.concat({offsetTop: 0});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
hover(field) {
|
|
||||||
this.field = field == this.field ? '' : field;
|
|
||||||
},
|
|
||||||
deleteModel(list, index) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
this.list.pop();
|
|
||||||
this.clear();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
editModel(list, index) {
|
|
||||||
this.addModel.sectionCode = list[index].sectionCode;
|
|
||||||
this.index = index;
|
|
||||||
this.cardMode = 'edit';
|
|
||||||
},
|
|
||||||
cancelOverlab() {
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
this.clear();
|
|
||||||
},
|
|
||||||
updateOverlab() {
|
|
||||||
if (this.index || this.index == 0) {
|
|
||||||
if (!this.addModel.sectionCode) {
|
|
||||||
this.$messageBox('请选择区段!');
|
|
||||||
} else {
|
|
||||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
|
||||||
const param = {
|
|
||||||
position: String(section.points[section.points.length - 1].x),
|
|
||||||
offsetTop: 0,
|
|
||||||
name: `${section.name}(${section.code})`,
|
|
||||||
sectionCode: section.code
|
|
||||||
};
|
|
||||||
this.tableData.splice(this.index, 1, param);
|
|
||||||
}
|
|
||||||
this.clear();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
if (this.tableData.length) {
|
|
||||||
const map = this.$store.state.map.map;
|
|
||||||
const param = {
|
|
||||||
bigScreenConfig: {
|
|
||||||
bigScreenSplitConfig: this.tableData,
|
|
||||||
width: this.formData.width,
|
|
||||||
height: this.formData.height,
|
|
||||||
offsetList: this.list.map(ele => ele.offsetTop)
|
|
||||||
},
|
|
||||||
mapId: this.$route.params.mapId
|
|
||||||
};
|
|
||||||
saveMap(Object.assign(map, param)).then(response => {
|
|
||||||
this.$message.success('保存大屏分割位置成功');
|
|
||||||
}).catch(() => {
|
|
||||||
this.$messageBox('保存大屏分割位置失败');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
preview() { // 预览
|
|
||||||
if (this.tableData.length) {
|
|
||||||
this.isPreview = false;
|
|
||||||
this.$jlmap && this.$jlmap.off('zoom');
|
|
||||||
const size = {
|
|
||||||
width: this.$jlmap.$zr.getWidth() * this.formData.width,
|
|
||||||
height: this.$jlmap.$zr.getHeight() * this.formData.height,
|
|
||||||
list: this.tableData.map(ele => ele.position),
|
|
||||||
offsetList: this.list.map(ele => ele.offsetTop)
|
|
||||||
};
|
|
||||||
this.$jlmap && this.$jlmap.setUpdateScreen(size);
|
|
||||||
} else {
|
|
||||||
this.$messageBox('请输入换行位置信息');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
recover() { // 恢复缩放比
|
|
||||||
this.isPreview = true;
|
|
||||||
this.$jlmap && this.$jlmap.on('zoom');
|
|
||||||
const param = {
|
|
||||||
scaleRate: this.$store.state.map.dataZoom.scaleRate,
|
|
||||||
offsetX: this.$store.state.map.dataZoom.offsetX,
|
|
||||||
offsetY: this.$store.state.map.dataZoom.offsetY
|
|
||||||
};
|
|
||||||
this.$jlmap && this.$jlmap.setRecover(param);
|
|
||||||
},
|
|
||||||
back() {
|
|
||||||
this.$emit('goDraw');
|
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
this.$refs.hostileForm.resetFields();
|
|
||||||
this.addModel.sectionCode = '';
|
|
||||||
this.index = '';
|
|
||||||
this.field = '';
|
|
||||||
},
|
|
||||||
generateOverlab() { // 生成
|
|
||||||
if (!this.addModel.sectionCode) {
|
|
||||||
this.$messageBox('请选择区段!');
|
|
||||||
} else {
|
|
||||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
|
||||||
const position = section.points[section.points.length - 1].x;
|
|
||||||
this.tableData.push({
|
|
||||||
position: String(position),
|
|
||||||
offsetTop: 0,
|
|
||||||
name: `${section.name}(${section.code})`,
|
|
||||||
sectionCode: section.code
|
|
||||||
});
|
|
||||||
this.tableData.sort((a, b) => Number(a.position) - Number(b.position)); // 数组排序
|
|
||||||
|
|
||||||
this.list = this.list.concat({offsetTop: 0});
|
|
||||||
this.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -13,10 +13,6 @@
|
|||||||
<el-dropdown class="operate-button" trigger="click">
|
<el-dropdown class="operate-button" trigger="click">
|
||||||
<span class="el-dropdown-link">配置</span>
|
<span class="el-dropdown-link">配置</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item><div @click="showCenterConfig">行调配置</div></el-dropdown-item>
|
|
||||||
<el-dropdown-item><div @click="showLocalConfig">现地配置</div></el-dropdown-item>
|
|
||||||
<el-dropdown-item><div @click="showScreenConfig">大屏配置</div></el-dropdown-item>
|
|
||||||
<el-dropdown-item><div @click="showDepotConfig">车辆段配置</div></el-dropdown-item>
|
|
||||||
<el-dropdown-item><div @click="setMapFunctionConfig">地图配置</div></el-dropdown-item>
|
<el-dropdown-item><div @click="setMapFunctionConfig">地图配置</div></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@ -30,7 +26,7 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<el-button v-if="isSave" type="text" style="padding: 3px 0" :disabled="$attrs.mapSaveing" @click="saveMapEvent">{{ $t('map.save') }}</el-button>
|
<el-button v-if="isSave" type="text" style="padding: 3px 0" :disabled="$attrs.mapSaveing" @click="saveMapEvent">{{ $t('map.save') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-tabs v-show="configShow === 'none'" v-model="enabledTab" class="mapEdit" type="card">
|
<el-tabs v-model="enabledTab" class="mapEdit" type="card">
|
||||||
<el-tab-pane v-for="(each,index) in tabList" :key="index" :label="each.label" class="tab_pane_box" :name="each.name" :lazy="lazy">
|
<el-tab-pane v-for="(each,index) in tabList" :key="index" :label="each.label" class="tab_pane_box" :name="each.name" :lazy="lazy">
|
||||||
<component
|
<component
|
||||||
:is="each.menus"
|
:is="each.menus"
|
||||||
@ -42,10 +38,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<local-config v-if="configShow === 'local'" ref="localConfig" :selected="selected" @goDraw="goDraw" />
|
|
||||||
<split-screen v-else-if="configShow === 'screen'" ref="splitScreen" :selected="selected" @goDraw="goDraw" />
|
|
||||||
<center-config v-else-if="configShow === 'center'" ref="centerConfig" :selected="selected" @goDraw="goDraw" />
|
|
||||||
<depot-config v-else-if="configShow === 'depot'" ref="depotConfig" :selected="selected" @goDraw="goDraw" />
|
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
@ -73,13 +65,9 @@ import ResponderDraft from './responder/index';
|
|||||||
import ControlLamp from './controlLamp';
|
import ControlLamp from './controlLamp';
|
||||||
import SplitStation from './splitStation';
|
import SplitStation from './splitStation';
|
||||||
import Arrow from './arrow';
|
import Arrow from './arrow';
|
||||||
import SplitScreen from './displayConfig/splitScreen';
|
|
||||||
import FloodGate from './floodGate';
|
import FloodGate from './floodGate';
|
||||||
import DirectionRod from './directionRod';
|
import DirectionRod from './directionRod';
|
||||||
import SignalButton from './signalButton';
|
import SignalButton from './signalButton';
|
||||||
import LocalConfig from './displayConfig/localConfig';
|
|
||||||
import CenterConfig from './displayConfig/centerConfig';
|
|
||||||
import DepotConfig from './displayConfig/depotConfig';
|
|
||||||
import SimulationMember from './simulationMember/index';
|
import SimulationMember from './simulationMember/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -107,13 +95,9 @@ export default {
|
|||||||
ControlLamp,
|
ControlLamp,
|
||||||
SplitStation,
|
SplitStation,
|
||||||
Arrow,
|
Arrow,
|
||||||
SplitScreen,
|
|
||||||
FloodGate,
|
FloodGate,
|
||||||
DirectionRod,
|
DirectionRod,
|
||||||
SignalButton,
|
SignalButton,
|
||||||
LocalConfig,
|
|
||||||
CenterConfig,
|
|
||||||
DepotConfig,
|
|
||||||
SimulationMember
|
SimulationMember
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -160,8 +144,7 @@ export default {
|
|||||||
{label: '仿真成员', name: 'SimulationMember', menus: SimulationMember}
|
{label: '仿真成员', name: 'SimulationMember', menus: SimulationMember}
|
||||||
],
|
],
|
||||||
selectDevice:'',
|
selectDevice:'',
|
||||||
enabledTab: 'Section',
|
enabledTab: 'Section'
|
||||||
configShow: 'none'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -192,21 +175,6 @@ export default {
|
|||||||
dataRelation() {
|
dataRelation() {
|
||||||
this.$emit('selectView', 'path');
|
this.$emit('selectView', 'path');
|
||||||
},
|
},
|
||||||
showCenterConfig() {
|
|
||||||
this.configShow = 'center';
|
|
||||||
},
|
|
||||||
showLocalConfig() {
|
|
||||||
this.configShow = 'local';
|
|
||||||
},
|
|
||||||
showScreenConfig() {
|
|
||||||
this.configShow = 'screen';
|
|
||||||
},
|
|
||||||
showDepotConfig() {
|
|
||||||
this.configShow = 'depot';
|
|
||||||
},
|
|
||||||
goDraw() {
|
|
||||||
this.configShow = 'none';
|
|
||||||
},
|
|
||||||
showMap() {
|
showMap() {
|
||||||
this.$emit('showMap');
|
this.$emit('showMap');
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user