站台站台轨位置校验&站台属性是否显示不生效修改&站台中站台轨属性不可修改&tab页懒加载导致的数据未展示问题调整

This commit is contained in:
fan 2020-05-08 18:52:46 +08:00
parent 5eeac156db
commit 84e212c48b
27 changed files with 147 additions and 118 deletions

View File

@ -615,7 +615,7 @@ class StationStand extends Group {
}
}
setShowStation(stationCode) {
if (!stationCode || this.model.deviceStationCode === stationCode) {
if ((!stationCode || this.model.deviceStationCode === stationCode) && this.model.visible) {
this.eachChild(item => {
item.show();
});

View File

@ -362,6 +362,26 @@ export default {
}
return flag;
},
verifyStationPosition(map) {
let flag = true;
const tipInfoList = [];
map.stationStandList.forEach(stationStand => {
const section = this.$store.getters['map/getDeviceByCode'](stationStand.standTrackCode);
const list = [];
section.points.forEach(point => {
list.push(point.x);
});
if (stationStand.position.x > Math.max(...list) || stationStand.position.x < Math.min(...list)) {
flag = false;
tipInfoList.push('站台' + stationStand.name + '(' + stationStand.code + ')' + '位置偏移出关联站台轨,请检查关联站台轨是否正确!');
}
});
if (!flag) {
this.$messageBox(this.$t('tip.dataValidationFailed'));
this.tableToExcel(tipInfoList);
}
return flag;
},
verifySignalPosition(map) {
let flag = true;
const tipInfoList = [];
@ -463,7 +483,7 @@ export default {
if (this.$refs.jlmapVisual) {
const map = this.$store.state.map.map;
if (map && this.$route.params.mapId) {
if (this.verifySectionRelation(map) && this.verifySignalPosition(map) && this.verifyInterlockDevice(map)) {
if (this.verifySectionRelation(map) && this.verifySignalPosition(map) && this.verifyInterlockDevice(map) && this.verifyStationPosition(map)) {
verifyMap(this.$route.params.mapId).then(res => {
if (res.data.length) {
this.tableToExcel(res.data);

View File

@ -200,14 +200,14 @@ export default {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset';
}
},
watch: {
selected(val, oldVal) {
if (val && val._type) {
this.handleTypes(val._type);
this.deviceSelect(val);
}
}
},
// watch: {
// selected(val, oldVal) {
// if (val && val._type) {
// this.handleTypes(val._type);
// this.deviceSelect(val);
// }
// }
// },
mounted() {
},
methods: {
@ -220,8 +220,8 @@ export default {
}
},
typeChange(type) { //
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.automaticRouteCode = '';
this.addModel.cycleCode = '';
this.addModel.concentrateStationList = '';
@ -271,8 +271,9 @@ export default {
this.getAutoMaticList();
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
this.handleTypes(selected._type);
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
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);
@ -350,7 +351,7 @@ export default {
type: 'warning'
}).then(() => {
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -172,9 +172,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
},
@ -184,8 +184,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Resource'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -140,9 +140,9 @@ export default {
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
}
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: {
deviceChange(code) {
@ -150,8 +150,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.createForm.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.createForm && this.$refs.createForm.resetFields();
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -79,9 +79,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
},

View File

@ -247,9 +247,9 @@ export default {
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
},
// selected(val, oldVal) {
// this.deviceSelect(val);
// },
indicatorLightList(val) {
this.handleIndicatorLightList(val);
},
@ -263,8 +263,8 @@ export default {
},
methods: {
typeChange(type) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.type = type;
this.editModel.type = type;
},
@ -414,8 +414,8 @@ export default {
this.addModel.switchCode = selected.code;
}
} else if (selected && this.controlLampTypeList.includes(selected._type)) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;
@ -533,7 +533,7 @@ export default {
type: 'warning'
}).then(() => {
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -168,9 +168,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
},
@ -179,8 +179,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -150,9 +150,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
},
@ -162,8 +162,8 @@ export default {
},
deviceSelect(selected) {
this.$nextTick(() => {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -115,9 +115,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// },
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
@ -135,7 +135,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Esp'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -197,7 +197,7 @@ export default {
}).then(() => {
this.$store.dispatch('map/delMapStandData', {models: [selected], type: 'espList'});
this.deviceSelect();
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -61,7 +61,7 @@
</el-tab-pane>
<el-tab-pane :label="$t('map.psd')" class="tab_pane_box" name="Psd" :lazy="lazy">
<psd-draft
ref="PsdDraft"
ref="Psd"
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"
@ -70,7 +70,7 @@
</el-tab-pane>
<el-tab-pane :label="$t('map.platformEmergencyStop')" class="tab_pane_box" name="Esp" :lazy="lazy">
<esp-draft
ref="EspDraft"
ref="Esp"
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"
@ -282,6 +282,14 @@ export default {
},
'$store.state.map.updateCount': function (val) {
this.$refs[this.enabledTab].edit();
},
selected(val, oldVal) {
if (this.selected) {
console.log(this.$refs[this.enabledTab], this.enabledTab);
this.$nextTick(() => {
this.$refs[this.enabledTab].deviceSelect(val);
});
}
}
},
mounted() {

View File

@ -157,9 +157,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
},
@ -169,8 +169,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -198,9 +198,9 @@ export default {
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
}
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
this.$Dictionary.lineType().then(list => {
@ -213,8 +213,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -201,9 +201,9 @@ export default {
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
}
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
this.$Dictionary.lineType().then(list => {
@ -216,8 +216,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -200,9 +200,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// },
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
@ -223,7 +223,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -279,7 +279,7 @@ export default {
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -192,7 +192,7 @@ export default {
models.push(model);
});
this.$emit('updateMapModel', models, 'five');
this.$refs.formModel.resetFields(); //
this.$refs.formModel && this.$refs.formModel.resetFields(); //
}
});
},
@ -252,7 +252,7 @@ export default {
}
}
this.$emit('updateMapModel', models, 'five');
this.$refs.roadModel.resetFields(); //
this.$refs.roadModel && this.$refs.roadModel.resetFields(); //
});
},
setBelongStation() {

View File

@ -391,9 +391,9 @@ export default {
}
},
watch: {
'$store.state.menuOperation.mapDrawSelectCount': function(val) {
this.deviceSelect(this.selected);
},
// '$store.state.menuOperation.mapDrawSelectCount': function(val) {
// this.deviceSelect(this.selected);
// },
activeName(val) {
if (val === 'four') {
this.$nextTick(() => {
@ -670,7 +670,7 @@ export default {
}
},
clear() {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
// 沿
this.editModel.logicSectionCodeList = [];
this.editModel.rightSectionCode = '';

View File

@ -293,9 +293,9 @@ export default {
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
}
// selected(val, oldVal) {
// this.deviceSelect(val);
// }
},
mounted() {
this.SignalLeftOrRightList = this.$ConstSelect.SignalLeftOrRightList;
@ -323,7 +323,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() != 'selectSingalCode'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.rotate = selected.rotate || 0; //
@ -371,7 +371,7 @@ export default {
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -134,14 +134,14 @@ export default {
}
},
watch: {
selected(val) {
this.deviceSelect(val);
}
// selected(val) {
// this.deviceSelect(val);
// }
},
methods: {
deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type === 'SplitStation') {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -190,7 +190,7 @@ export default {
type: 'warning'
}).then(() => {
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -282,9 +282,9 @@ export default {
}
},
watch: {
selected: function (val) {
this.deviceSelect(val);
}
// selected: function (val) {
// this.deviceSelect(val);
// }
},
methods: {
deviceChange(code) {
@ -294,7 +294,7 @@ export default {
deviceSelect(selected) {
// this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.runPlanName = selected.runPlanName || '';

View File

@ -168,7 +168,7 @@ export default {
{ 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: '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: 'editSectionSelectCode', buttonShowType: this.isButtonTypeES },
{ prop: 'standTrackCode', label: '站台轨:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, disabled: true},
{ prop: 'right', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList },
{ prop: 'defaultReentryStrategy', label: '默认折返策略:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.reentryStrategyList },
{ prop: 'small', label: '是否小型站台:', type: 'checkbox', disabled: true },
@ -367,7 +367,7 @@ export default {
},
deviceSelect(selected) {
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -513,7 +513,7 @@ export default {
});
_that.$emit('updateMapModel', models);
_that.deviceSelect();
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -48,9 +48,9 @@ export default {
])
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: {
filterSections(query, item) {

View File

@ -129,7 +129,7 @@ export default {
this.setModel(this.$store.getters['map/getDeviceByCode'](code));
},
setModel(data) {
this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.editModel = deepAssign(this.editModel, data);
},
//

View File

@ -182,9 +182,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: {
deviceChange(code) {
@ -192,8 +192,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -79,9 +79,9 @@ export default {
])
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
},
// selected(val, oldVal) {
// this.deviceSelect(val);
// },
$route() {
// this.activeName = 'first';
}

View File

@ -188,9 +188,9 @@ export default {
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
// selected: function (val, oldVal) {
// this.deviceSelect(val);
// }
},
methods: {
filterSections(query, item) {
@ -204,7 +204,7 @@ export default {
this.field = field == this.field ? '' : field;
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.form && this.$refs.form.resetFields();
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);

View File

@ -162,9 +162,9 @@ export default {
}
},
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
},
// selected(val, oldVal) {
// this.deviceSelect(val);
// },
stationList() {
this.getConcertrateStation();
}
@ -182,8 +182,8 @@ export default {
this.getConcertrateStation();
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);