diff --git a/src/jmapNew/keyboardController.js b/src/jmapNew/keyboardController.js
index 9cfd0abc9..c8e74c12d 100644
--- a/src/jmapNew/keyboardController.js
+++ b/src/jmapNew/keyboardController.js
@@ -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() {
diff --git a/src/utils/index.js b/src/utils/index.js
index 902d58b5f..8b3204716 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -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 {
diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue
index cc0872745..b91244271 100644
--- a/src/views/newMap/jlmapNew/index.vue
+++ b/src/views/newMap/jlmapNew/index.vue
@@ -17,7 +17,7 @@
鼠标偏移:
-
+
@@ -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;
}
},
diff --git a/src/views/newMap/newMapdraft/index.vue b/src/views/newMap/newMapdraft/index.vue
index 356481103..84e3e920f 100644
--- a/src/views/newMap/newMapdraft/index.vue
+++ b/src/views/newMap/newMapdraft/index.vue
@@ -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;
diff --git a/src/views/newMap/newMapdraft/mapoperate/config/list.vue b/src/views/newMap/newMapdraft/mapoperate/config/list.vue
index 5030cea55..a188b4f1f 100644
--- a/src/views/newMap/newMapdraft/mapoperate/config/list.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/config/list.vue
@@ -95,7 +95,7 @@
-
+
@@ -103,11 +103,11 @@
{{ item.placeholder }}
-
-
+
+
{{ item.placeholder }}
-
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue
index fe3159cc5..c95dfc275 100644
--- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue
@@ -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];