现地行调条件显示调整

This commit is contained in:
fan 2021-01-20 16:07:10 +08:00
parent 25b6ad4ca8
commit 70045c8f87
15 changed files with 40 additions and 82 deletions

View File

@ -1,5 +1,4 @@
import Group from 'zrender/src/container/Group';
import {isShowThePrdType} from '../../utils/handlePath';
import Polygon from 'zrender/src/graphic/shape/Polygon';
export default class Arrow extends Group {
@ -12,10 +11,8 @@ export default class Arrow extends Group {
this.model = model;
// this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
this.setShowMode();
}

View File

@ -7,7 +7,6 @@ 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 AutoTurnBack extends Group {
constructor(model, style) {
@ -19,11 +18,9 @@ export default class AutoTurnBack extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, style.AutoTurnBack.visibleConditions) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}

View File

@ -6,7 +6,6 @@ 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 {
constructor(model, style) {
@ -18,11 +17,9 @@ export default class AutomacticRoute extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, (style.AutomaticRoute || {}).displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}

View File

@ -6,7 +6,6 @@ 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 {
constructor(model, style) {
@ -18,11 +17,9 @@ export default class AxleReset extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, (style.AxleReset || {}).displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}

View File

@ -1,6 +1,5 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
import {isShowThePrdType} from '../../utils/handlePath';
import Text from 'zrender/src/graphic/Text';
export default class DirectionRod extends Group {
@ -13,11 +12,9 @@ export default class DirectionRod extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, (style.DirectionRod || {}).displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}
create() {

View File

@ -3,7 +3,6 @@
*/
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import {isShowThePrdType} from '../../utils/handlePath';
export default class FloodGate extends Group {
constructor(model, style) {
@ -16,11 +15,9 @@ export default class FloodGate extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, (style.FloodGate || {}).displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}

View File

@ -6,7 +6,6 @@ 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 {
constructor(model, style) {
@ -18,11 +17,9 @@ export default class GuideLock extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, (style.GuideLock || {}).displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}

View File

@ -1,5 +1,4 @@
import Group from 'zrender/src/container/Group';
import {isShowThePrdType} from '../../utils/handlePath';
import Polyline from 'zrender/src/graphic/shape/Polyline';
export default class Line2 extends Group {
@ -12,10 +11,8 @@ export default class Line2 extends Group {
this.model = model;
this.style = style.Line;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
this.setShowMode();
}

View File

@ -1,6 +1,5 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import {isShowThePrdType} from '../../utils/handlePath';
export default class OutFrame extends Group {
constructor(model, style) {
@ -12,10 +11,8 @@ export default class OutFrame extends Group {
this.zlevel = model.zlevel;
this.isShowShape = true;
this.z = 0;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
this.setShowMode();
}

View File

@ -1,5 +1,4 @@
import Group from 'zrender/src/container/Group';
// import {isShowThePrdType} from '../../utils/handlePath';
import ETextName from '../element/ETextName'; // 名称文字 (共有)
import BoundingRect from 'zrender/src/core/BoundingRect';

View File

@ -2,7 +2,6 @@ import Polyline from 'zrender/src/graphic/shape/Polyline';
import Group from 'zrender/src/container/Group';
import JTriangle from '../../utils/JTriangle';
import ESeparator from './ESeparator';
import {isShowThePrdType} from '../../utils/handlePath';
export default class Line2 extends Group {
constructor(model, style) {
@ -14,11 +13,9 @@ export default class Line2 extends Group {
this.model = model;
this.style = style;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.createTerminal();
this.setState(model);
}
this.setShowMode();
}

View File

@ -1,7 +1,6 @@
import Group from 'zrender/src/container/Group';
import EControl from '../element/EControl';
import EMouse from './EMouse';
import {isShowThePrdType} from '../../utils/handlePath';
import deviceType from '../../constant/deviceType';
import ELampFilament from './ELampFilament';
import EControlSwitch from './EControlSwitch';
@ -23,11 +22,9 @@ export default class SaidLamp extends Group {
this.deviceStyle = style[model._type];
if (this.deviceStyle) {
this.isShowShape = true;
if (isShowThePrdType(model.prdType, (this.deviceStyle || {}).displayCondition) || model.previewOrMapDraw) {
this.create();
this.createMouseEvent();
this.setState(model);
}
this.setShowMode();
}
}

View File

@ -12,7 +12,6 @@ import Group from 'zrender/src/container/Group';
import EHighlight from '../element/EHighlight';
import EVirtualSignal from './EVirtualSignal';
import ELowButton from './ELowButton';
import {isShowThePrdType} from '../../utils/handlePath';
import Rect from 'zrender/src/graphic/shape/Rect';
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Text from 'zrender/src/graphic/Text';
@ -735,7 +734,6 @@ class Signal extends Group {
this.recover();
/** 信号机进路按钮显示 */
if (isShowThePrdType(model.prdType, '03') && this.style.Signal.lowButton.display) {
/** 终端信号机按钮 */
if (model.isRouteActive) {
this.setLowButtonActive();
@ -743,7 +741,6 @@ class Signal extends Group {
this.setLowButtonRecover();
}
model.isRouteSignal && this.setLowButtonShow();
}
/** 设置灯的颜色 */
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭

View File

@ -36,7 +36,6 @@ import EDownDetainLamp from './functionButton/EDownDetainLamp';
import ETrainSetButton from './ETrainSetButton';
import EStationPlatform from './EStationPlatform';
import {isShowThePrdType} from '../../utils/handlePath';
import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
class StationStand extends Group {
@ -99,10 +98,8 @@ class StationStand extends Group {
'downDetainLamp':EDownDetainLamp
};
// 遍历后端返回的状态控制的绘图
if (model.previewOrMapDraw || isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow)) {
traverseStatusElements(statusElementList, model, style, this);
}
}
createMouseEvent() {
const path = window.location.href;

View File

@ -1,6 +1,5 @@
import Text from 'zrender/src/graphic/Text';
import Group from 'zrender/src/container/Group';
import {isShowThePrdType} from '../../utils/handlePath';
import BoundingRect from 'zrender/src/core/BoundingRect';
import Vue from 'vue';
@ -15,10 +14,8 @@ export default class Text2 extends Group {
this.style = style;
this.z = 6;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
this.setShowMode();
}
@ -65,6 +62,7 @@ export default class Text2 extends Group {
return;
}
const showConditions = this.model.showConditions;
console.log(showMode, showConditions);
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.text && this.text.show();
} else {