剧本编制代码调整

This commit is contained in:
joylink_cuiweidong 2020-05-20 10:28:16 +08:00
parent 582543dd22
commit ca7e92f6a1
4 changed files with 34 additions and 4 deletions

View File

@ -257,7 +257,6 @@ export default class EAxle111 extends Group {
setStyle(styles) { setStyle(styles) {
if (this.model.shape.isSpecial) { if (this.model.shape.isSpecial) {
this.isogonInside.setStyle(styles);
this.isogonOutside.setStyle(styles); this.isogonOutside.setStyle(styles);
this.line1.setStyle(styles); this.line1.setStyle(styles);
this.line2.setStyle(styles); this.line2.setStyle(styles);

View File

@ -101,7 +101,7 @@ class Handler {
const command = this.getCommand(operation); const command = this.getCommand(operation);
if (command) { if (command) {
// 判断当前是否是剧本 添加动作指令操作 // 判断当前是否是剧本 添加动作指令操作
if (store.state.scriptRecord.isScriptCommand) { if (store.state.scriptRecord.isScriptCommand && store.state.scriptRecord.bgSet ) {
store.dispatch('scriptRecord/updateScriptCommand', {operationId:command.id, cmdType:operation.cmdType, param:command.get()}); store.dispatch('scriptRecord/updateScriptCommand', {operationId:command.id, cmdType:operation.cmdType, param:command.get()});
resolve(rtn); resolve(rtn);
} else { } else {

View File

@ -62,8 +62,7 @@ class MenuContextHandler {
const selected = this.getCurrentStateObject(); const selected = this.getCurrentStateObject();
let menu = []; let menu = [];
const control = this.getStationControl(selected); const control = this.getStationControl(selected);
if (control && (!store.state.scriptRecord.bgSet || store.state.scriptRecord.isScriptCommand)) {
if (control) {
if (this.getPrdType() != '') { if (this.getPrdType() != '') {
const type = State2SimulationMap[this.getPrdType()]; const type = State2SimulationMap[this.getPrdType()];
const status = State2ControlMap[control.controlMode]; // 判断当前模式 const status = State2ControlMap[control.controlMode]; // 判断当前模式

View File

@ -221,11 +221,21 @@ export default {
// this.commandDataNew.action.operationId = val.operationId; // this.commandDataNew.action.operationId = val.operationId;
this.commandDataNew.action.operationParamMap = val.param; this.commandDataNew.action.operationParamMap = val.param;
this.messageTips2 = ''; this.messageTips2 = '';
},
'commandDataNew.action.memberId':function(val) {
if (val) {
this.$store.dispatch('scriptRecord/updateIsScriptCommand', true);
} else {
this.$store.dispatch('scriptRecord/updateIsScriptCommand', false);
}
} }
}, },
mounted() { mounted() {
this.initData(); this.initData();
}, },
beforeDestroy() {
this.$store.dispatch('scriptRecord/updateIsScriptCommand', false);
},
methods:{ methods:{
initData() { initData() {
this.buttonName = this.$t('scriptRecord.addConversitionButton'); this.buttonName = this.$t('scriptRecord.addConversitionButton');
@ -362,10 +372,16 @@ export default {
}, },
changeMember(member) { changeMember(member) {
if (member) { if (member) {
if (this.isFirstTips) {
this.$message('请在右侧地图上选择操作');
this.isFirstTips = false;
}
this.messageTips1 = ''; this.messageTips1 = '';
this.executeCommandName = ''; this.executeCommandName = '';
this.commandDataNew.action.operationType = ''; this.commandDataNew.action.operationType = '';
this.commandDataNew.action.operationParamMap = {}; this.commandDataNew.action.operationParamMap = {};
this.$store.dispatch('scriptRecord/updateIsScriptCommand', true);
this.switchMode(member);
} }
}, },
addCommandActionNew() { addCommandActionNew() {
@ -537,6 +553,22 @@ export default {
if (!this.drawWay) { if (!this.drawWay) {
this.$refs.command.resetData(); this.$refs.command.resetData();
} }
},
switchMode(role) {
let prdType = '';
const memberInfo = this.memberList.find(member=>{
return member.id == role;
});
if (memberInfo) {
if (memberInfo.role == '行值') {
prdType = '01';
} else if (memberInfo.role == '行调') {
prdType = '02';
} else if (memberInfo.role == '司机') {
prdType = '04';
}
}
this.$store.dispatch('training/setPrdType', prdType);
} }
} }
}; };