绘图相关调整_(区段快捷删除调整)

This commit is contained in:
fan 2019-12-06 14:36:18 +08:00
parent c0c580ec1d
commit 7cc2b68d13
7 changed files with 17 additions and 24 deletions

View File

@ -14,20 +14,23 @@ export function getUID(type, list) {
} else {
name = Math.floor((Math.random() * 100000) + 1);
}
const code = [(type || ''), name].join('');
let count = 0;
for (let index = 0; index < list.length; index++) {
count++;
if (list[index].code == code) {
this.getUID(type, list);
return;
function checkUid() {
let count = 0;
for (let index = 0; index < list.length; index++) {
count++;
if (list[index].code == [(type || ''), name].join('')) {
name++;
return checkUid();
}
}
return count == list.length;
}
if (count == list.length) {
return code;
if (checkUid()) {
return [(type || ''), name].join('');
}
// } else {
// return [(type || ''), Math.floor((Math.random() * 100000) + 1)].join('');
// }
// use Math.random to make id as unique as possible.
}

View File

@ -254,6 +254,11 @@ export default {
return this.mapInfo && this.mapInfo.id;
}
},
watch: {
'$store.state.map.deleteCount': function (val) {
this.$refs[this.enabledTab].deleteObj();
}
},
mounted() {
this.initPage();
},

View File

@ -603,9 +603,6 @@ 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,9 +196,6 @@ export default {
watch: {
selected(val, oldVal) {
this.deviceSelect(val);
},
'$store.state.map.deleteCount': function (val) {
this.deleteObj();
}
},
mounted() {

View File

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

View File

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

View File

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