调整自动折返 type 类型 增加自动折返菜单流程

This commit is contained in:
zyy 2020-03-18 09:10:57 +08:00
parent 2fb74f520d
commit 0ceb0c2c65
21 changed files with 400 additions and 45 deletions

View File

@ -216,7 +216,7 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.MapCycleButtonVO] = {
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '03',
text: {

View File

@ -292,7 +292,7 @@ class SkinCode extends defaultStyle {
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.MapCycleButtonVO] = {
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '03',
text: {

View File

@ -465,7 +465,7 @@ class SkinCode extends defaultStyle {
controlColor: '#b5b3b3' // 控制灯颜色 (灰色)
}
};
this[deviceType.MapCycleButtonVO] = {
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '03',
text: {

View File

@ -275,7 +275,7 @@ class SkinCode extends defaultStyle {
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.MapCycleButtonVO] = {
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '03',
text: {

View File

@ -290,7 +290,7 @@ class SkinCode extends defaultStyle {
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.MapCycleButtonVO] = {
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '03',
text: {

View File

@ -210,7 +210,7 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.MapCycleButtonVO] = {
this[deviceType.AutoTurnBack] = {
// 是否显示
visibleConditions: '01',
text: {

View File

@ -117,8 +117,8 @@ deviceRender[deviceType.CheckBox] = {
};
/** Automactic渲染配置 自动折返*/
deviceRender[deviceType.MapCycleButtonVO] = {
_type: deviceType.MapCycleButtonVO,
deviceRender[deviceType.AutoTurnBack] = {
_type: deviceType.AutoTurnBack,
zlevel: 1
};

View File

@ -10,7 +10,7 @@ const deviceType = {
StationStand: 'StationStand',
Esp: 'Esp',
Psd: 'Psd',
MapCycleButtonVO: 'MapCycleButtonVO',
AutoTurnBack: 'AutoTurnBack',
OutFrame: 'OutFrame',
AxleReset: 'AxleReset',
GuideLock: 'GuideLock',

View File

@ -114,7 +114,7 @@ class Status {
handleLimitControl(device) {
this.statusObj = { };
}
handleMapCycleButtonVO(device) {
handleAutoTurnBack(device) {
this.statusObj = { };
}
handleAutomaticRoute(device) {

View File

@ -18,7 +18,7 @@ export default class Automactic extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.MapCycleButtonVO.visibleConditions) || model.previewOrMapDraw) {
if (isShowThePrdType(model.prdType, style.AutoTurnBack.visibleConditions) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
@ -37,11 +37,11 @@ export default class Automactic extends Group {
shape: {
cx: model.position.x,
cy: model.position.y,
r: this.style.MapCycleButtonVO.lamp.radiusR
r: this.style.AutoTurnBack.lamp.radiusR
},
style: {
lineWidth: 0,
fill: this.style.MapCycleButtonVO.lamp.controlColor
fill: this.style.AutoTurnBack.lamp.controlColor
}
});
@ -52,9 +52,9 @@ export default class Automactic extends Group {
position: [0, 0],
style: {
x: model.position.x,
y: model.position.y + this.style.MapCycleButtonVO.lamp.radiusR + this.style.MapCycleButtonVO.text.distance,
fontWeight: this.style.MapCycleButtonVO.text.fontWeight,
fontSize: this.style.MapCycleButtonVO.text.fontSize,
y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance,
fontWeight: this.style.AutoTurnBack.text.fontWeight,
fontSize: this.style.AutoTurnBack.text.fontSize,
fontFamily: this.style.fontFamily,
text: model.name,
textFill: '#fff',
@ -71,9 +71,9 @@ export default class Automactic extends Group {
position: [0, 0],
style: {
x: model.position.x,
y: model.position.y + this.style.MapCycleButtonVO.lamp.radiusR + this.style.MapCycleButtonVO.subtitleText.distance,
fontWeight: this.style.MapCycleButtonVO.subtitleText.fontWeight,
fontSize: this.style.MapCycleButtonVO.subtitleText.fontSize,
y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance,
fontWeight: this.style.AutoTurnBack.subtitleText.fontWeight,
fontSize: this.style.AutoTurnBack.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
text: model.subtitleName,
textFill: '#fff',
@ -84,7 +84,7 @@ export default class Automactic extends Group {
this.add(this.subtitleText);
}
if (this.style.MapCycleButtonVO.lamp.borderShow) {
if (this.style.AutoTurnBack.lamp.borderShow) {
const arcRect = this.getArcBoundingRect();
this.arcBorder = new Rect({
zlevel: this.zlevel,
@ -92,9 +92,9 @@ export default class Automactic extends Group {
silent: true,
shape: arcRect,
style: {
lineDash: this.style.MapCycleButtonVO.lamp.lineDash,
stroke: this.style.MapCycleButtonVO.lamp.stroke,
fill: this.style.MapCycleButtonVO.lamp.fill
lineDash: this.style.AutoTurnBack.lamp.lineDash,
stroke: this.style.AutoTurnBack.lamp.stroke,
fill: this.style.AutoTurnBack.lamp.fill
}
});
this.add(this.arcBorder);
@ -141,7 +141,7 @@ export default class Automactic extends Group {
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.MapCycleButtonVO.visibleConditions;
const showConditions = this.style.AutoTurnBack.visibleConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.show();
} else {

View File

@ -17,7 +17,7 @@ import Line from './Line/index.js';
import Text2 from './Text/index.js';
import AxleReset from './AxleReset/index';
import GuideLock from './GuideLock/index';
import MapCycleButtonVO from './Automactic/index.js';
import AutoTurnBack from './Automactic/index.js';
import OutFrame from './OutFrame/index.js';
import CheckBox from './checkBox/checkBox.js';
import AutomaticRoute from './AutomacticRoute/index.js';
@ -40,7 +40,7 @@ mapShape[deviceType.TrainWindow] = TrainWindow;
mapShape[deviceType.Train] = Train;
mapShape[deviceType.Line] = Line;
mapShape[deviceType.Text] = Text2;
mapShape[deviceType.MapCycleButtonVO] = MapCycleButtonVO;
mapShape[deviceType.AutoTurnBack] = AutoTurnBack;
mapShape[deviceType.OutFrame] = OutFrame;
mapShape[deviceType.AxleReset] = AxleReset;
mapShape[deviceType.GuideLock] = GuideLock;

View File

@ -356,7 +356,7 @@ export default {
} else if (model._type === 'StationStand' && subType === 'CancelStopJumpLamp') {
operate.cmdType = CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP;
operate.param = {standCode: model.code, trainGroupNumber: ''};
} else if (model._type === 'MapCycleButtonVO' ) {
} else if (model._type === 'AutoTurnBack' ) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK;
operate.param = {cycleCode: model.cycleCode};
} else if (model._type === 'AutomaticRoute') {
@ -383,7 +383,7 @@ export default {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE;
operate.param = {signalCode: model.code};
}
} else if (model._type === 'MapCycleButtonVO') {
} else if (model._type === 'AutoTurnBack') {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK;
operate.param = {cycleCode: model.cycleCode, cancelRoute: false};
} else if (model._type === 'AutomaticRoute') {

View File

@ -23,8 +23,8 @@
</el-col>
</el-row>
<div v-if="passModel" style="margin: 12px 0;">
<el-radio :id="upRadioId" v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" @change="changeRadio" :disabled="passRadio == '2'">设置自动通过</el-radio>
<el-radio :id="upRadioId" v-model="passRadio" label="2" style="display: block; padding-left: 10px;" @change="changeRadio" :disabled="passRadio == '1'">取消自动通过</el-radio>
<el-radio :id="upRadioId" v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" :disabled="passRadio == '2'" @change="changeRadio">设置自动通过</el-radio>
<el-radio :id="upRadioId" v-model="passRadio" label="2" style="display: block; padding-left: 10px;" :disabled="passRadio == '1'" @change="changeRadio">取消自动通过</el-radio>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">

View File

@ -0,0 +1,174 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm signal-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div style="margin: 12px 0;">
<el-radio :id="upRadioId" v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" :disabled="passRadio == '2'">设置</el-radio>
<el-radio :id="upRadioId" v-model="passRadio" label="2" style="display: block; padding-left: 10px;" :disabled="passRadio == '1'">取消</el-radio>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RouteControl',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
operation: null,
stationName: '',
signalName: '',
passRadio: '1'
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '自动折返';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.operation = operate.operation;
if (this.operation == OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation) {
this.passRadio = '1';
} else if (this.operation == OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation) {
this.passRadio = '2';
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.mouseCancelState(this.selected);
},
commit() {
if (this.operation == OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation) {
this.singalPassModel(); //
} else if (this.operation == OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation) {
this.singalCancelPassModel(); //
}
},
//
singalPassModel() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
};
this.sendCommand(operate);
},
//
singalCancelPassModel() {
const operate = {
over: true,
operation: this.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
};
this.sendCommand(operate);
},
sendCommand(operate) {
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate, error.message);
});
},
//
cancel() {
const operate = {
operation: OperationEvent.Command.close.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>

View File

@ -4,6 +4,7 @@
<template v-show="isShowAll">
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
<!-- <menu-button ref="menuButton" /> -->
<menu-auto-trun-route ref="menuAutoTrunRoute" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-station-control ref="menuStationControl" :selected="selected" />>
<menu-switch ref="menuSwitch" :selected="selected" />
@ -24,6 +25,7 @@ import { mapGetters } from 'vuex';
import MenuCancel from './menuCancel';
import MenuSignal from './menuSignal';
// import MenuButton from './menuButton';
import MenuAutoTrunRoute from './menuAutoTrunRoute';
import MenuStationStand from './menuStationStand';
import MenuStationControl from './menuStationControl';
import MenuSwitch from './menuSwitch';
@ -41,6 +43,7 @@ export default {
components: {
MenuBar,
// MenuButton,
MenuAutoTrunRoute,
MenuCancel,
MenuSignal,
MenuSwitch,

View File

@ -0,0 +1,145 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<turn-back-control ref="turnBackControl" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import TurnBackControl from './dialog/turnBackControl';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
export default {
name: 'MenuLimit',
components: {
PopMenu,
TurnBackControl
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [],
menuNormal: {
Local: [
{
label: '设置自动折返',
handler: this.handlerTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
},
{
label: '取消自动折返',
handler: this.cancelTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
}
],
Center: [
{
label: '设置自动折返',
handler: this.handlerTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
},
{
label: '取消自动折返',
handler: this.cancelTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
}
]
}
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.AutoTurnBack) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
console.log(this.menu);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
handlerTurnBack() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation,
param: {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
}
});
},
//
cancelTurnBack() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation,
param: {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
}
});
}
}
};
</script>

View File

@ -116,7 +116,7 @@ export function parser(data, skinCode, showConfig) {
}, this);
zrUtil.each(data.cycleButtonList || [], elem => { // 自动折返列表
mapDevice[elem.code] = createDevice(deviceType.MapCycleButtonVO, elem, propConvert, showConfig);
mapDevice[elem.code] = createDevice(deviceType.AutoTurnBack, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.axleCounterResetButtonList || [], elem => { // 计轴复位列表
@ -225,7 +225,7 @@ export function updateMapData(state, model) {
case deviceType.Text: updateForList(model, state, 'textList'); break;
case deviceType.Psd: updateForList(model, state, 'psdList'); break;
case deviceType.Esp: updateForList(model, state, 'espList'); break;
case deviceType.MapCycleButtonVO: updateForList(model, state, 'cycleButtonList'); break;
case deviceType.AutoTurnBack: updateForList(model, state, 'cycleButtonList'); break;
case deviceType.AxleReset: updateForList(model, state, 'axleCounterResetButtonList'); break;
case deviceType.GuideLock: updateForList(model, state, 'totalGuideLockButtonVOList'); break;
case deviceType.OutFrame: updateForList(model, state, 'outerFrameList'); break;

View File

@ -104,6 +104,7 @@ export const DeviceMenu = {
Station: '08',
TrainWindow: '09',
LimitControl: '10',
AutoTurnBack: '11',
Map: '100',
PrdCategory: '101',

View File

@ -1922,6 +1922,30 @@ export const OperationEvent = {
}
},
// 设置/取消自动折返
AutoTurnBack: {
SetAutoTurnBackButton: {
menu: {
operation: '900',
domId: '_Tips-Turn-Back-Menu'
},
confirm: {
operation: '9001',
domId: '_Tips-Turn-Back-confirm-Menu'
}
},
CancelAutoTurnBackButton: {
menu: {
operation: '900',
domId: '_Tips-Turn-Back-Menu'
},
confirm: {
operation: '9001',
domId: '_Tips-Turn-Back-confirm-Menu'
}
}
},
// 混合指令
MixinCommand: {
/** 控制模式操作 */

View File

@ -55,7 +55,7 @@ export default {
activeName: 'first',
autoList: [],
typeList: [
{ name: '自动折返', value: 'MapCycleButtonVO' },
{ name: '自动折返', value: 'AutoTurnBack' },
{ name: '计轴复位', value: 'AxleReset' },
{ name: '自动进路', value: 'AutomaticRoute' },
{ name: '引导总锁', value: 'GuideLock' },
@ -131,8 +131,8 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.ChangeStation },
{ prop:'cycleCode', label: '自动折返进路code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.ChangeStation },
{ prop:'automaticRouteCode', label: '自动进路code:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.ChangeEditStation },
{ prop:'cycleCode', label: '自动折返进路code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.ChangeEditStation },
{ prop:'stationCode', label: '所属集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
]
}
@ -177,30 +177,31 @@ export default {
return this.editModel.type == 'AutomaticRoute';
},
isHiddenMapCycleButtonVO() {
return this.editModel.type == 'MapCycleButtonVO';
return this.editModel.type == 'AutoTurnBack';
},
isDisabledStation() {
return this.editModel.type == 'MapCycleButtonVO' || this.editModel.type == 'AutomaticRoute';
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute';
},
isHiddenStation() {
return this.editModel.type == 'MapCycleButtonVO' || this.editModel.type == 'AutomaticRoute' || this.editModel.type == 'AxleReset';
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute' || this.editModel.type == 'AxleReset';
},
isHiddenCreateAutomaticRoute() {
return this.addModel.type == 'AutomaticRoute';
},
isHiddenCreateMapCycleButtonVO() {
return this.addModel.type == 'MapCycleButtonVO';
return this.addModel.type == 'AutoTurnBack';
},
isDisabledCreateStation() {
return this.addModel.type == 'MapCycleButtonVO' || this.addModel.type == 'AutomaticRoute';
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute';
},
isHiddenCreateStation() {
return this.addModel.type == 'MapCycleButtonVO' || this.addModel.type == 'AutomaticRoute' || this.addModel.type == 'AxleReset';
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute' || this.addModel.type == 'AxleReset';
}
},
watch: {
selected(val, oldVal) {
this.handleTypes(val._type);
this.deviceSelect(val);
}
},
@ -219,7 +220,7 @@ export default {
},
handleTypes(type) {
switch (type) {
case 'MapCycleButtonVO':
case 'AutoTurnBack':
this.selectLists = this.cycleButtonList;
this.getAutoTurnBackList();
break;
@ -245,6 +246,13 @@ export default {
}
});
},
ChangeEditStation(code) { //
this.autoList.forEach(elem => {
if (elem.code == code) {
this.editModel.stationCode = elem.stationCode;
}
});
},
deviceChange(code) {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
@ -255,7 +263,7 @@ export default {
deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'MapCycleButtonVO'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase()) {
if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;
@ -322,7 +330,7 @@ export default {
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() === 'MapCycleButtonVO'.toUpperCase() || selected._type.toUpperCase() === 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase()) {
if (selected && selected._type.toUpperCase() === 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() === 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() === 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase()) {
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),

View File

@ -301,7 +301,7 @@ export default {
this.enabledTab = 'Esp';
} else if (this.feild) {
this.enabledTab = 'Section';
} else if (type == 'AutomaticRoute' || type == 'MapCycleButtonVO' || type == 'AxleReset' || type == 'LimitControl') {
} else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl') {
this.enabledTab = 'ControlDraft';
} else {
this.enabledTab = type;