调整回车内容不修改

This commit is contained in:
zyy 2020-03-31 14:41:17 +08:00
parent 1ad7265f58
commit 1873898adc
6 changed files with 17 additions and 19 deletions

View File

@ -19,11 +19,11 @@ class KeyboardController extends Eventful {
opts = opts || {}; opts = opts || {};
this._keyOnDownUp = opts.keyOnDownUp || true; this._keyOnDownUp = opts.keyOnDownUp || true;
window.addEventListener('keydown', keydownHandle, false); window.addEventListener('keyup', keydownHandle, false);
}; };
this.disable = function () { this.disable = function () {
window.removeEventListener('keydown', keydownHandle, false); window.removeEventListener('keyup', keydownHandle, false);
}; };
this.dispose = function() { this.dispose = function() {

View File

@ -148,7 +148,7 @@ export function deepAssign(obj, item) {
const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象 const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象
for (const keys in item) { for (const keys in item) {
if (item.hasOwnProperty(keys) && keys != 'instance') { // instance 对面不拷贝 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] = item[keys].constructor === Array ? [] : {};
target[keys] = deepClone(item[keys]); target[keys] = deepClone(item[keys]);
} else { } else {

View File

@ -17,7 +17,7 @@
<div style="display: inline-block"> <div style="display: inline-block">
<span class="title" style="">鼠标偏移:</span> <span class="title" style="">鼠标偏移:</span>
<el-form-item label="x" label-width="12px"> <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>
<el-form-item label="y" label-width="12px"> <el-form-item label="y" label-width="12px">
<el-input v-model="offset.y" :disabled="true" style="width: 95px" /> <el-input v-model="offset.y" :disabled="true" style="width: 95px" />
@ -276,7 +276,9 @@ export default {
break; break;
case 'Delete': this.$store.dispatch('map/setDeleteCount'); case 'Delete': this.$store.dispatch('map/setDeleteCount');
break; break;
case 'Update': this.$store.dispatch('map/setUpdateCount'); case 'Update':
this.$refs.offsetX.focus();
this.$store.dispatch('map/setUpdateCount');
break; break;
} }
}, },

View File

@ -179,7 +179,7 @@ export default {
} }
}, },
clickEvent(em) { clickEvent(em) {
var device = this.getDeviceByEm(em); const device = this.getDeviceByEm(em);
this.deviceHighLight(this.oldDevice, false); this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(device, true); this.deviceHighLight(device, true);
this.oldDevice = device; this.oldDevice = device;

View File

@ -95,7 +95,7 @@
</template> </template>
<template v-if="checkFieldType(item, 'number')"> <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"> <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"> <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" /> <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> </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" /> <el-input-number v-model="formModel[item.prop]" :min="item.min" :max="item.max" :label="item.label" :disabled="item.disabled" style="width: 140px" />
</template> </template>
<span style="padding-left: 1px;">{{ item.placeholder }}</span> <span style="padding-left: 1px;">{{ item.placeholder }}</span>
</div> </template>
<div v-else> <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" /> <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> <span style="padding-left: 1px;">{{ item.placeholder }}</span>
</div> </template>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="checkFieldType(item, 'color')"> <template v-if="checkFieldType(item, 'color')">

View File

@ -196,7 +196,7 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList }, { 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: '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: '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 }, { 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; this.regionList = this.$ConstSelect.RegionTypeList;
}, },
methods: { 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) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
@ -483,8 +477,10 @@ export default {
} }
let models = []; let models = [];
const model = deepAssign(this.editModel, {_type: 'Section'}); // model const model = deepAssign(this.editModel, {_type: 'Section'}); // model
model.leftStopPointOffset = Number(model.leftStopPointOffset); if (model.lengthFact > 5 && (model.transferTrack || model.reentryTrack || model.standTrack)) {
model.rightStopPointOffset = Number(model.rightStopPointOffset); model.leftStopPointOffset = 5;
model.rightStopPointOffset = model.lengthFact - 5;
}
const changeSectionList = this.handleOtherSectionChange(model); const changeSectionList = this.handleOtherSectionChange(model);
models = [model, ...changeSectionList]; models = [model, ...changeSectionList];