大铁项目 按钮按下 弹起代码调整

This commit is contained in:
joylink_cuiweidong 2022-08-16 11:26:54 +08:00
parent a55b94e4ab
commit e3e2493b55
3 changed files with 48 additions and 7 deletions

View File

@ -155,7 +155,7 @@ export default class SignalButton extends Group {
const borderLine = this.style.SignalButton && this.style.SignalButton.borderLine ? this.style.SignalButton.borderLine : 2;
const isShowBorder = this.style.SignalButton && this.style.SignalButton.isShowBorder;
// 接车按钮 通过按钮 引导按钮
const showBorderBtn = ['PICK', 'PASS', 'GUIDE'];
const showBorderBtn = ['PICK', 'PASS', 'GUIDE', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION', 'ACCIDENT', 'RECOVERY', 'OCCLUSION', 'FLEXIBLE'];
this.leftBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
@ -326,32 +326,65 @@ export default class SignalButton extends Group {
// { value: 'ASSIST', label: '总辅助按钮' },
// { value: 'PICK_ASSIST', label: '接辅助按钮' },
// { value: 'DEPART_ASSIST', label: '发辅助按钮' },
const isShowBorder = this.style.SignalButton && this.style.SignalButton.isShowBorder;
const list = ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION', 'ACCIDENT', 'RECOVERY', 'OCCLUSION'];
if (list.includes(model.type)) {
if (this.rectButton) {
if (model.pressDown) {
this.rectButton.setStyle({ fill: '#FFFF00' });
if (isShowBorder) {
this.leftBoard && this.leftBoard.setStyle('stroke', '#A0A0A0');
this.topBoard && this.topBoard.setStyle('stroke', '#A0A0A0');
this.rightBoard && this.rightBoard.setStyle('stroke', '#FFFFFF');
this.bottomBoard && this.bottomBoard.setStyle('stroke', '#FFFFFF');
}
} else {
this.rectButton.setStyle({ fill: this.getTypeColor() });
if (isShowBorder) {
this.leftBoard && this.leftBoard.setStyle('stroke', '#FFFFFF');
this.topBoard && this.topBoard.setStyle('stroke', '#FFFFFF');
this.rightBoard && this.rightBoard.setStyle('stroke', '#A0A0A0');
this.bottomBoard && this.bottomBoard.setStyle('stroke', '#A0A0A0');
this.leftBoard && this.leftBoard.show();
this.rightBoard && this.rightBoard.show();
this.topBoard && this.topBoard.show();
this.bottomBoard && this.bottomBoard.show();
}
}
}
}
const isShowBorder = this.style.SignalButton && this.style.SignalButton.isShowBorder;
if (isShowBorder) {
if (model.type == 'FLEXIBLE') {
this.leftBoard && this.leftBoard.show();
this.rightBoard && this.rightBoard.show();
this.topBoard && this.topBoard.show();
this.bottomBoard && this.bottomBoard.show();
}
}
// 接车按钮 通过按钮 引导按钮
const showBorderBtn = ['PICK', 'PASS', 'GUIDE'];
if (isShowBorder && showBorderBtn.includes(model.type)) {
if (this.rectButton) {
if (model.hasSelected) {
this.leftBoard && this.leftBoard.hide();
this.rightBoard && this.rightBoard.hide();
this.topBoard && this.topBoard.hide();
this.bottomBoard && this.bottomBoard.hide();
if (model.hasSelected || model.pressDown) {
this.leftBoard && this.leftBoard.setStyle('stroke', '#A0A0A0');
this.topBoard && this.topBoard.setStyle('stroke', '#A0A0A0');
this.rightBoard && this.rightBoard.setStyle('stroke', '#FFFFFF');
this.bottomBoard && this.bottomBoard.setStyle('stroke', '#FFFFFF');
} else {
this.leftBoard && this.leftBoard.setStyle('stroke', '#FFFFFF');
this.topBoard && this.topBoard.setStyle('stroke', '#FFFFFF');
this.rightBoard && this.rightBoard.setStyle('stroke', '#A0A0A0');
this.bottomBoard && this.bottomBoard.setStyle('stroke', '#A0A0A0');
this.leftBoard && this.leftBoard.show();
this.rightBoard && this.rightBoard.show();
this.topBoard && this.topBoard.show();
this.bottomBoard && this.bottomBoard.show();
}
// else if (model.hasSelected && (model.type == 'PICK' || model.type == 'PASS')) {
// this.leftBoard && this.leftBoard.setStyle('stroke', '#A0A0A0');
// this.topBoard && this.topBoard.setStyle('stroke', '#A0A0A0');
// this.rightBoard && this.rightBoard.setStyle('stroke', '#FFFFFF');
// this.bottomBoard && this.bottomBoard.setStyle('stroke', '#FFFFFF');
}
}

View File

@ -93,6 +93,7 @@
</template>
<script>
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
@ -183,6 +184,9 @@ export default {
operation: OperationEvent.Command.cancel.password.operation
};
this.$emit('checkCancel');
if (this.operate.nextCmdType == CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE) {
this.$store.dispatch('training/updateMapState', [{code: this.operate.code, _type:'SignalButton', pressDown: 0}]);
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {

View File

@ -294,6 +294,9 @@ export default {
passWordCommit(data) {
let operate = {};
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 = {
over: true,
operation: data.operation,
@ -562,6 +565,7 @@ export default {
} else {
operate.nextCmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
this.$refs.password.doShow(operate, '引导信号');
this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, pressDown: 1}]);
}
},
//