站台屏蔽门调整

This commit is contained in:
fan 2019-12-13 13:10:11 +08:00
parent 2f639cce5e
commit 083e70dc02
2 changed files with 46 additions and 61 deletions

View File

@ -17,21 +17,6 @@
<div style="height: calc(100% - 46px);"> <div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini"> <el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
<el-form-item label="关联站台轨:" prop="standTrackCode">
<el-select v-model="addModel.standTrackCode" filterable>
<el-option
v-for="item in PhysicalSectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'sectionSelectCode' ? 'danger' : 'primary'"
size="small"
@click="hover('sectionSelectCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="关联站台:" prop="standCode"> <el-form-item label="关联站台:" prop="standCode">
<el-select v-model="addModel.standCode" filterable> <el-select v-model="addModel.standCode" filterable>
<el-option <el-option
@ -97,18 +82,15 @@ export default {
code: '', code: '',
name: '', name: '',
standCode: '', // code standCode: '', // code
standTrackCode: '', //
width: 60, width: 60,
height: 3, height: 3,
position: { x: 0, y: 0 }, position: { x: 0, y: 0 }
doorLocationType: '01' //
}, },
field: '', field: '',
addModel: { addModel: {
standCode: '', standCode: '',
width: 60, width: 60,
height: 3, height: 3,
standTrackCode: '',
doorLocationType: '01' // doorLocationType: '01' //
} }
}; };
@ -136,8 +118,6 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }, ] },
{ prop: 'doorLocationType', label: '显示方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList },
{ prop: 'standTrackCode', label: '关联区段:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList },
{ prop: 'width', label: '屏蔽门宽度', type: 'number', min: 0, max: 2000, placeholder: 'px' }, { prop: 'width', label: '屏蔽门宽度', type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: '屏蔽门高度', type: 'number', min: 0, max: 2000, placeholder: 'px' } { prop: 'height', label: '屏蔽门高度', type: 'number', min: 0, max: 2000, placeholder: 'px' }
] ]
@ -162,9 +142,6 @@ export default {
standCode: [ standCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' } { required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
], ],
standTrackCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
],
'position.x': [ 'position.x': [
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'change' } { required: true, message: this.$t('rules.trainPositionX'), trigger: 'change' }
], ],
@ -185,9 +162,6 @@ export default {
standCode: [ standCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' } { required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
], ],
standTrackCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
],
doorLocationType: [ doorLocationType: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' } { required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
] ]
@ -236,12 +210,6 @@ export default {
this.field = ''; this.field = '';
this.$emit('standStationCode', ''); this.$emit('standStationCode', '');
} }
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectCode'.toUpperCase()) {
this.addModel.standTrackCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('standStationCode', '');
}
}, },
create() { create() {
this.$refs.make.validate((valid) => { this.$refs.make.validate((valid) => {
@ -253,8 +221,7 @@ export default {
name: `Psd${this.psdList.length + 1}`, name: `Psd${this.psdList.length + 1}`,
width: this.addModel.width, width: this.addModel.width,
height: this.addModel.height, height: this.addModel.height,
standCode: this.addModel.standCode, // code standCode: this.addModel.standCode // code
standTrackCode: this.addModel.standTrackCode //
}; };
this.stationStandList.forEach(elem => { this.stationStandList.forEach(elem => {
if (elem.code === this.addModel.standCode) { if (elem.code === this.addModel.standCode) {

View File

@ -17,23 +17,6 @@
<div style="height: calc(100% - 46px);"> <div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<config-list ref="make" :form="addForm" :form-model="addModel" :rules="createRules" /> <config-list ref="make" :form="addForm" :form-model="addModel" :rules="createRules" />
<!-- <el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
<el-form-item :label="$t('map.stationstandName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable @change="changeStation">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'standSelectStationCode' ? 'danger' : 'primary'"
size="small"
@click="hover('standSelectStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
</el-form> -->
</el-scrollbar> </el-scrollbar>
</div> </div>
<div class="button_box"> <div class="button_box">
@ -73,6 +56,14 @@ export default {
{ code: '01', name: '朝下' }, { code: '01', name: '朝下' },
{ code: '02', name: '朝上' } { code: '02', name: '朝上' }
*/ */
isRightList: [
{ code: true, name: '右向'},
{ code: false, name: '左向'}
],
isSmallStandList: [
{ code: false, name: '否'},
{ code: true, name: '是'}
],
editModel: { editModel: {
code: '', code: '',
name: '', name: '',
@ -83,7 +74,10 @@ export default {
height: 0, height: 0,
stationCode: '', // stationCode: '', //
position: { x: 0, y: 0 }, position: { x: 0, y: 0 },
visible: true // visible: true, //
isRight: null,
standTrackCode: '',
isSmallStand: false
// direction: '' // // direction: '' //
}, },
field: '', field: '',
@ -97,7 +91,9 @@ export default {
standTrackCode: '', // standTrackCode: '', //
standTrackUpCode: '', // standTrackUpCode: '', //
standTrackDownCode: '', // standTrackDownCode: '', //
stationstandDirection: '02' // stationstandDirection: '02', //
isRight: null,
isSmallStand: false
} }
}; };
}, },
@ -127,7 +123,10 @@ export default {
] }, ] },
{ prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' }, { prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' }, { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' } { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
{ prop: 'isRight', label: '行驶方向', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'isSmallStand', label: '小型站台', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isSmallStandList }
] ]
}, },
map: { map: {
@ -163,6 +162,15 @@ export default {
], ],
'position.y': [ 'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'change' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'change' }
],
standTrackCode: [
{ required: true, message: '请选择关联站台轨', trigger: 'change' }
],
isRight: [
{ required: true, message: '请选择行驶方向', trigger: 'change'}
],
isSmallStand: [
{ required: true, message: '请选择是否为小型站台', trigger: 'change'}
] ]
}; };
// //
@ -183,7 +191,10 @@ export default {
{ prop: 'stationCode', label: this.$t('map.stationstandName'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'standSelectStationCode', buttonShowType: this.isButtonType }, { prop: 'stationCode', label: this.$t('map.stationstandName'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'standSelectStationCode', buttonShowType: this.isButtonType },
{ prop: 'pointY', label: 'Y 坐标:', type: 'number' }, { prop: 'pointY', label: 'Y 坐标:', type: 'number' },
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' }, { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' } { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
{ prop: 'isRight', label: '行驶方向', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'isSmallStand', label: '小型站台', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isSmallStandList }
] ]
}, },
door: { door: {
@ -193,7 +204,6 @@ export default {
{value: '01', label: '单侧屏蔽门' }, {value: '01', label: '单侧屏蔽门' },
{value: '02', label: '双侧屏蔽门' } {value: '02', label: '双侧屏蔽门' }
] }, ] },
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
{ prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList, isHidden: !this.doorTypeOne }, { prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList, isHidden: !this.doorTypeOne },
{ prop: 'standTrackUpCode', label: '上行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectUpCode', buttonShowType: this.isButtonTypeU, isHidden: !this.doorTypeTwo }, { prop: 'standTrackUpCode', label: '上行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectUpCode', buttonShowType: this.isButtonTypeU, isHidden: !this.doorTypeTwo },
{ prop: 'standTrackDownCode', label: '下行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectDownCode', buttonShowType: this.isButtonTypeD, isHidden: !this.doorTypeTwo } { prop: 'standTrackDownCode', label: '下行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectDownCode', buttonShowType: this.isButtonTypeD, isHidden: !this.doorTypeTwo }
@ -224,6 +234,12 @@ export default {
], ],
standTrackDownCode: [ standTrackDownCode: [
{ required: true, message: '请选择站台轨', trigger: 'change' } { required: true, message: '请选择站台轨', trigger: 'change' }
],
isRight: [
{ required: true, message: '请选择行驶方向', trigger: 'change'}
],
isSmallStand: [
{ required: true, message: '请选择是否为小型站台', trigger: 'change'}
] ]
}; };
}, },
@ -335,7 +351,10 @@ export default {
position: { position: {
x: 0, x: 0,
y: this.addModel.pointY y: this.addModel.pointY
} },
standTrackCode: this.addModel.standTrackCode,
isRight: this.addModel.isRight,
isSmallStand: this.addModel.isSmallStand
}; };
this.stationList.forEach(elem => { this.stationList.forEach(elem => {
if (elem.code == this.addModel.stationCode) { if (elem.code == this.addModel.stationCode) {
@ -344,7 +363,7 @@ export default {
} }
}); });
models.push(model); models.push(model);
if (this.addModel.doorType == '01') { if (this.addModel.doorType == '01' && !this.addModel.isSmallStand) {
const uid = getUID('Psd', this.psdList); const uid = getUID('Psd', this.psdList);
const param = { const param = {
_type: 'Psd', _type: 'Psd',
@ -353,7 +372,6 @@ export default {
width: this.addModel.width, width: this.addModel.width,
height: 3, height: 3,
standCode: Standuid, // code standCode: Standuid, // code
standTrackCode: this.addModel.standTrackCode, //
position: { position: {
x: models[0].position.x, x: models[0].position.x,
y: this.addModel.pointY - (this.addModel.height / 2) - space y: this.addModel.pointY - (this.addModel.height / 2) - space
@ -363,7 +381,7 @@ export default {
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space; param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
} }
models.push(param); models.push(param);
} else if (this.addModel.doorType == '02') { } else if (this.addModel.doorType == '02' && !this.addModel.isSmallStand) {
const arr = []; const arr = [];
for (let index = 0; index < 2; index++) { for (let index = 0; index < 2; index++) {
const uid = getUID('Psd', [...this.psdList, ...arr]); const uid = getUID('Psd', [...this.psdList, ...arr]);