调整代码

This commit is contained in:
zyy 2020-03-18 10:20:49 +08:00
parent 12f283cbae
commit 11b2ee8130
10 changed files with 87 additions and 20 deletions

View File

@ -282,7 +282,6 @@ class Jlmap {
} else if (oDevice._type === deviceType.Section) {
this.$painter.updateShowStation(oDevice, stationCode);
this.showStationHandleSection(oDevice, stationCode);
} else if (oDevice._type === deviceType.TrainWindow) {
} else if (oDevice._type === deviceType.Psd) {
this.showStationHandlePsd(oDevice, stationCode);
} else {

View File

@ -6,6 +6,7 @@ import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
import EMouse from './EMouse';
import BoundingRect from 'zrender/src/core/BoundingRect';
import {isShowThePrdType} from '../../utils/handlePath';
export default class Automactic extends Group {
@ -105,7 +106,7 @@ export default class Automactic extends Group {
// 设置状态
setState(model) {
if (!this.isShowShape) return;
// model.show && this.handleSignal();
}
createMouseEvent() {
@ -131,7 +132,7 @@ export default class Automactic extends Group {
getShapeTipPoint() {
if (this.control) {
var distance = 2;
var rect = this.control.getBoundingRect();
var rect = this.getArcBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
@ -139,6 +140,22 @@ export default class Automactic extends Group {
}
return null;
}
getBoundingRect() { // 计算自动折返包围框
if (this.control) {
const rect = this.control.getBoundingRect().clone();
if (this.text) {
const text = this.text.getBoundingRect().clone();
rect.union(text);
return rect;
} else {
return rect;
}
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.AutoTurnBack.visibleConditions;

View File

@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import EMouse from './EMouse';
import BoundingRect from 'zrender/src/core/BoundingRect';
import {isShowThePrdType} from '../../utils/handlePath';
export default class AutomacticRoute extends Group {
@ -110,6 +111,22 @@ export default class AutomacticRoute extends Group {
}
return null;
}
getBoundingRect() { // 计算自动折返包围框
if (this.control) {
const rect = this.control.getBoundingRect().clone();
if (this.text) {
const text = this.text.getBoundingRect().clone();
rect.union(text);
return rect;
} else {
return rect;
}
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.AutomaticRoute.displayCondition;

View File

@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import EMouse from './EMouse';
import BoundingRect from 'zrender/src/core/BoundingRect';
import {isShowThePrdType} from '../../utils/handlePath';
export default class AxleReset extends Group {
@ -110,6 +111,21 @@ export default class AxleReset extends Group {
}
return null;
}
getBoundingRect() { // 计算自动折返包围框
if (this.control) {
const rect = this.control.getBoundingRect().clone();
if (this.text) {
const text = this.text.getBoundingRect().clone();
rect.union(text);
return rect;
} else {
return rect;
}
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.AxleReset.displayCondition;

View File

@ -5,6 +5,7 @@ import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import EMouse from './EMouse';
import BoundingRect from 'zrender/src/core/BoundingRect';
import {isShowThePrdType} from '../../utils/handlePath';
export default class GuideLock extends Group {
@ -110,6 +111,20 @@ export default class GuideLock extends Group {
}
return null;
}
getBoundingRect() { // 计算自动折返包围框
if (this.control) {
const rect = this.control.getBoundingRect().clone();
if (this.text) {
const text = this.text.getBoundingRect().clone();
rect.union(text);
return rect;
} else {
return rect;
}
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.GuideLock.displayCondition;

View File

@ -12,7 +12,7 @@
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>信号机</span></el-col>
<el-col :span="11" :offset="2"><span>折返</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
@ -22,10 +22,14 @@
<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 style="margin: 12px 0;">
<el-col :span="11">
<el-radio :id="upRadioId" v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" :disabled="passRadio == '2'">设置</el-radio>
</el-col>
<el-col :span="11" :offset="2">
<el-radio :id="upRadioId" v-model="passRadio" label="2" style="display: block; padding-left: 10px;" :disabled="passRadio == '1'">取消</el-radio>
</el-col>
</el-row>
<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>
@ -88,8 +92,9 @@ export default {
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
if (selected && selected._type.toUpperCase() === 'AutoTurnBack'.toUpperCase()) {
const autoReentryData = this.$store.getters['map/autoReentryData'];
this.signalName = autoReentryData[selected.cycleCode].name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;

View File

@ -88,7 +88,6 @@ export default {
initMenu() {
//
this.menu = MenuContextHandler.covert(this.menuNormal);
console.log(this.menu);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
@ -116,7 +115,7 @@ export default {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);
@ -133,7 +132,7 @@ export default {
autoTurnBackCode: this.selected.code
}
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.turnBackControl.doShow(operate, this.selected);

View File

@ -94,8 +94,8 @@ class MenuContextHandler {
if (control) {
if (this.getPrdType() != '') {
const type = State2SimulationMap[this.getPrdType()];
const status = State2ControlMap[control.controlMode]; // 判断当前模式
// const status = 'LocalStationControl';
// const status = State2ControlMap[control.controlMode]; // 判断当前模式
const status = 'LocalStationControl';
menu = [...menuList[type]];
// 特殊处理站台的右键操作( 因为小站台不允许有操作 )
if (selected._type == 'StationStand') {

View File

@ -183,7 +183,7 @@ export default {
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute';
},
isHiddenStation() {
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute' || this.editModel.type == 'AxleReset';
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset';
},
isHiddenCreateAutomaticRoute() {
@ -196,7 +196,7 @@ export default {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute';
},
isHiddenCreateStation() {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute' || this.addModel.type == 'AxleReset';
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset';
}
},
watch: {
@ -261,10 +261,9 @@ export default {
this.getAutoMaticList();
},
deviceSelect(selected) {
debugger;
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() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase()) {
if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;

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' || type == 'GuideLock') {
} else if (type == 'AutomaticRoute' || type == 'AutoTurnBack' || type == 'AxleReset' || type == 'LimitControl' || type == 'GuideLock') {
this.enabledTab = 'ControlDraft';
} else {
this.enabledTab = type;