站台方向属性调整

This commit is contained in:
fan 2019-12-13 17:51:00 +08:00
parent 852ac4e601
commit 62300d327f

View File

@ -57,8 +57,8 @@ export default {
{ code: '02', name: '朝上' } { code: '02', name: '朝上' }
*/ */
isRightList: [ isRightList: [
{ code: true, name: '右向'}, { code: 'right', name: '向右'},
{ code: false, name: '左向'} { code: 'left', name: '向左'}
], ],
editModel: { editModel: {
code: '', code: '',
@ -71,7 +71,7 @@ export default {
stationCode: '', // stationCode: '', //
position: { x: 0, y: 0 }, position: { x: 0, y: 0 },
visible: true, // visible: true, //
isRight: true, isRight: 1,
standTrackCode: '', standTrackCode: '',
small: false small: false
// direction: '' // // direction: '' //
@ -87,7 +87,7 @@ export default {
standTrackUpCode: '', // standTrackUpCode: '', //
standTrackDownCode: '', // standTrackDownCode: '', //
stationstandDirection: '02', // stationstandDirection: '02', //
isRight: true, isRight: 1,
small: false small: false
} }
}; };
@ -273,6 +273,7 @@ export default {
this.$refs.dataform.resetFields(); this.$refs.dataform.resetFields();
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
this.editModel.isRight = selected.isRight ? 'right' : 'left';
} }
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'standSelectStationCode'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'standSelectStationCode'.toUpperCase()) {
this.addModel.stationCode = selected.code; this.addModel.stationCode = selected.code;
@ -310,7 +311,7 @@ export default {
y: this.addModel.pointY y: this.addModel.pointY
}, },
standTrackCode: this.addModel.standTrackCode, standTrackCode: this.addModel.standTrackCode,
isRight: this.addModel.isRight, isRight: this.addModel.isRight === 'right',
small: this.addModel.small small: this.addModel.small
}; };
this.stationList.forEach(elem => { this.stationList.forEach(elem => {
@ -339,7 +340,6 @@ export default {
} }
models.push(param); models.push(param);
} }
console.log(models, '===========');
this.$emit('updateMapModel', models); this.$emit('updateMapModel', models);
} }
}); });
@ -348,7 +348,9 @@ export default {
edit() { edit() {
this.$refs.dataform.validate((valid) => { this.$refs.dataform.validate((valid) => {
if (valid) { if (valid) {
this.editModel.isRight = this.addModel.isRight === 'right';
const data = Object.assign({_type: 'StationStand'}, this.editModel); const data = Object.assign({_type: 'StationStand'}, this.editModel);
console.log(data);
this.$emit('updateMapModel', data); this.$emit('updateMapModel', data);
} }
}); });