西安二号线 绘图 站台添加模式筛选标识

This commit is contained in:
joylink_cuiweidong 2020-04-24 18:23:17 +08:00
parent a190aedb62
commit 7d5605d170
5 changed files with 82 additions and 3 deletions

View File

@ -253,6 +253,10 @@ class SkinCode extends defaultStyle {
defaultColor:'#808080', // 西安二号线特殊样式(默认颜色) defaultColor:'#808080', // 西安二号线特殊样式(默认颜色)
special:true // 西安二号线特殊样式 special:true // 西安二号线特殊样式
}, },
patternFilter:{ // 模式筛选标识
defaultColor:'#808080', // 默认颜色,
offset:{x:25, y:15} // 相对于站台边缘的偏移
},
reentry: {}, // 站台折返策略 reentry: {}, // 站台折返策略
detainCar: { // 扣车 detainCar: { // 扣车
position: -1, // 扣车标识在站台上显示方向 position: -1, // 扣车标识在站台上显示方向

View File

@ -0,0 +1,57 @@
import Group from 'zrender/src/container/Group';
import Polygon from 'zrender/src/graphic/shape/Polygon';
class EPatternFilter extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
const style = this.model.style;
const startX = (model.width / 2 + style.StationStand.patternFilter.offset.x);
const startY = model.y + (model.height / 2 + style.StationStand.patternFilter.offset.y) * model.direction + (1 + model.direction) / 2 * 14;
this.patternFilter1 = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points:[
[model.x - startX, startY],
[model.x - startX, startY - 14],
[model.x - startX - 14, startY - 14],
[model.x - startX - 14 - 10 * 0.866, startY - 7],
[model.x - startX - 14, startY]
]
},
style: {
fill: style.StationStand.patternFilter.defaultColor
}
});
this.patternFilter2 = new Polygon({
zlevel: model.zlevel,
z: model.z,
shape: {
points:[
[model.x + startX, startY],
[model.x + startX, startY - 14],
[model.x + startX + 14, startY - 14],
[model.x + startX + 14 + 10 * 0.866, startY - 7],
[model.x + startX + 14, startY]
]
},
style: {
fill: style.StationStand.patternFilter.defaultColor
}
});
this.add(this.patternFilter1);
this.add(this.patternFilter2);
}
setColor(color) {
this.patternFilter1.setStyle('fill', color);
}
}
export default EPatternFilter;

View File

@ -13,6 +13,7 @@ import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart'; import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl'; import EControl from '../element/EControl';
import EDetainCircle from './EDetainCircle'; import EDetainCircle from './EDetainCircle';
import EPatternFilter from './EPatternFilter';
import {isShowThePrdType} from '../../utils/handlePath'; import {isShowThePrdType} from '../../utils/handlePath';
class StationStand extends Group { class StationStand extends Group {
@ -60,6 +61,22 @@ class StationStand extends Group {
}); });
this.add(this.safeStand); this.add(this.safeStand);
// 模式筛选标识(西安二号线特殊的情况)
if (style.StationStand.patternFilter) {
const direction = model.right ? 1 : -1;
this.patternFilter = new EPatternFilter({
zlevel: this.zlevel,
z: this.z + 1,
style: style,
x: model.position.x,
y: model.position.y,
width: model.width,
height:model.height,
direction:direction
});
this.add(this.patternFilter);
}
/** 站台紧急关闭*/ /** 站台紧急关闭*/
const emergentOffset = model.inside ? style.StationStand.standEmergent.insideOffset : style.StationStand.standEmergent.outsideOffset; const emergentOffset = model.inside ? style.StationStand.standEmergent.insideOffset : style.StationStand.standEmergent.outsideOffset;
const emergentH = model.right ? 1 : -1; const emergentH = model.right ? 1 : -1;

View File

@ -64,7 +64,8 @@ export default {
row: null, row: null,
operation: '', operation: '',
stationLists: [], stationLists: [],
disabledAll: false disabledAll: false,
checked2: false
}; };
}, },
computed: { computed: {

View File

@ -24,10 +24,10 @@
</el-row> </el-row>
<el-row style="margin: 12px 0;"> <el-row style="margin: 12px 0;">
<el-col :span="11"> <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-radio v-model="passRadio" label="1" style="display: block; padding-left: 10px; margin-bottom: 10px;" :disabled="passRadio == '2'">设置</el-radio>
</el-col> </el-col>
<el-col :span="11" :offset="2"> <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-radio v-model="passRadio" label="2" style="display: block; padding-left: 10px;" :disabled="passRadio == '1'">取消</el-radio>
</el-col> </el-col>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">