绘图相关调整_(添加快捷删除)

This commit is contained in:
fan 2019-12-05 18:53:06 +08:00
parent b88693c772
commit 75f400a1c7
8 changed files with 27 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class KeyboardController extends Eventful {
this._keyboards = [
{ key: 'Control', keyCode: 17, active: false },
{ key: 'Shift', keyCode: 16, active: false },
{ key: 'Alt', keyCode: 18, active: false }
{ key: 'Alt', keyCode: 18, active: false },
];
}
@ -47,7 +47,6 @@ class KeyboardController extends Eventful {
var index = this._keyboards.findIndex(
elem=> { return elem.keyCode == e.keyCode; }
);
if (index >= 0) {
this._keyboards[index].active = true;
} else {

View File

@ -250,7 +250,8 @@ const map = {
mapIdList: {}, // 地图数据列表(以id为标识)
mapViewLoadedCount: 0, // 地图视图加载完成标识
mapDataLoadedCount: 0, // 地图数据加载完成标识
trainDetails: null // 地图'列车详情'显示
trainDetails: null, // 地图'列车详情'显示
deleteCount: 0 // 绘图快捷删除标识
},
getters: {
@ -577,6 +578,9 @@ const map = {
state.map[type].push(item);
}
});
},
setDeleteCount: (state) => {
state.deleteCount++;
}
},
@ -685,6 +689,10 @@ const map = {
updateMapStandData: ({ commit }, { models, type }) => {
commit('updateMapStandData', { models, type });
},
setDeleteCount: ({ commit }) => {
commit('setDeleteCount');
}
}

View File

@ -222,6 +222,8 @@ export default {
break;
case 'Control_Y': this.$store.dispatch('map/setRecover');
break;
case 'DELETE': this.$store.dispatch('map/setDeleteCount');
break;
}
},
//

View File

@ -634,6 +634,9 @@ export default {
watch: {
'$store.state.menuOperation.mapDrawSelectCount': function(val) {
this.deviceSelect(this.selected);
},
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
mounted() {

View File

@ -196,6 +196,9 @@ export default {
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
},
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
mounted() {

View File

@ -210,6 +210,9 @@ export default {
watch: {
selected: function (val) {
this.deviceSelect(val);
},
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
methods: {

View File

@ -205,6 +205,9 @@ export default {
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
mounted() {

View File

@ -180,6 +180,9 @@ export default {
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
methods: {