调整回车内容不修改
This commit is contained in:
parent
1ad7265f58
commit
1873898adc
@ -19,11 +19,11 @@ class KeyboardController extends Eventful {
|
||||
opts = opts || {};
|
||||
this._keyOnDownUp = opts.keyOnDownUp || true;
|
||||
|
||||
window.addEventListener('keydown', keydownHandle, false);
|
||||
window.addEventListener('keyup', keydownHandle, false);
|
||||
};
|
||||
|
||||
this.disable = function () {
|
||||
window.removeEventListener('keydown', keydownHandle, false);
|
||||
window.removeEventListener('keyup', keydownHandle, false);
|
||||
};
|
||||
|
||||
this.dispose = function() {
|
||||
|
@ -148,7 +148,7 @@ export function deepAssign(obj, item) {
|
||||
const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象
|
||||
for (const keys in item) {
|
||||
if (item.hasOwnProperty(keys) && keys != 'instance') { // instance 对面不拷贝
|
||||
if (item[keys] && typeof item[keys] === 'object') { // 如果值是对象,就递归一下
|
||||
if (typeof item[keys] === 'object') { // 如果值是对象,就递归一下
|
||||
target[keys] = item[keys].constructor === Array ? [] : {};
|
||||
target[keys] = deepClone(item[keys]);
|
||||
} else {
|
||||
|
@ -17,7 +17,7 @@
|
||||
<div style="display: inline-block">
|
||||
<span class="title" style="">鼠标偏移:</span>
|
||||
<el-form-item label="x" label-width="12px">
|
||||
<el-input v-model="offset.x" :disabled="true" style="width: 95px" />
|
||||
<el-input ref="offsetX" v-model="offset.x" :disabled="true" style="width: 95px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="y" label-width="12px">
|
||||
<el-input v-model="offset.y" :disabled="true" style="width: 95px" />
|
||||
@ -276,7 +276,9 @@ export default {
|
||||
break;
|
||||
case 'Delete': this.$store.dispatch('map/setDeleteCount');
|
||||
break;
|
||||
case 'Update': this.$store.dispatch('map/setUpdateCount');
|
||||
case 'Update':
|
||||
this.$refs.offsetX.focus();
|
||||
this.$store.dispatch('map/setUpdateCount');
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -179,7 +179,7 @@ export default {
|
||||
}
|
||||
},
|
||||
clickEvent(em) {
|
||||
var device = this.getDeviceByEm(em);
|
||||
const device = this.getDeviceByEm(em);
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(device, true);
|
||||
this.oldDevice = device;
|
||||
|
@ -95,7 +95,7 @@
|
||||
</template>
|
||||
<template v-if="checkFieldType(item, 'number')">
|
||||
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
|
||||
<div v-if="!item.firstLevel">
|
||||
<template v-if="!item.firstLevel">
|
||||
<template v-if="item.change">
|
||||
<el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" @change="item.deviceChange" />
|
||||
</template>
|
||||
@ -103,11 +103,11 @@
|
||||
<el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" />
|
||||
</template>
|
||||
<span style="padding-left: 1px;">{{ item.placeholder }}</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-input-number v-model="formModel[item.firstLevel][item.secondLevel]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" />
|
||||
<span style="padding-left: 1px;">{{ item.placeholder }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-if="checkFieldType(item, 'color')">
|
||||
|
@ -196,7 +196,7 @@ export default {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList },
|
||||
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter'), change: true, deviceChange: this.lengthFactChange },
|
||||
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter') },
|
||||
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, disabled: true, isHidden: !this.isStopPointOffset },
|
||||
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, disabled: true, isHidden: !this.isStopPointOffset },
|
||||
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
|
||||
@ -385,12 +385,6 @@ export default {
|
||||
this.regionList = this.$ConstSelect.RegionTypeList;
|
||||
},
|
||||
methods: {
|
||||
lengthFactChange() {
|
||||
if (this.editModel.lengthFact > 5 && (this.editModel.transferTrack || this.editModel.reentryTrack || this.editModel.standTrack)) {
|
||||
this.editModel.leftStopPointOffset = 5;
|
||||
this.editModel.rightStopPointOffset = this.editModel.lengthFact - 5;
|
||||
}
|
||||
},
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
@ -483,8 +477,10 @@ export default {
|
||||
}
|
||||
let models = [];
|
||||
const model = deepAssign(this.editModel, {_type: 'Section'}); // 修改元素model
|
||||
model.leftStopPointOffset = Number(model.leftStopPointOffset);
|
||||
model.rightStopPointOffset = Number(model.rightStopPointOffset);
|
||||
if (model.lengthFact > 5 && (model.transferTrack || model.reentryTrack || model.standTrack)) {
|
||||
model.leftStopPointOffset = 5;
|
||||
model.rightStopPointOffset = model.lengthFact - 5;
|
||||
}
|
||||
const changeSectionList = this.handleOtherSectionChange(model);
|
||||
models = [model, ...changeSectionList];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user