绘图相关调整_(区段快捷删除调整)
This commit is contained in:
parent
c0c580ec1d
commit
7cc2b68d13
@ -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.
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
},
|
||||
|
@ -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() {
|
||||
|
@ -196,9 +196,6 @@ export default {
|
||||
watch: {
|
||||
selected(val, oldVal) {
|
||||
this.deviceSelect(val);
|
||||
},
|
||||
'$store.state.map.deleteCount': function (val) {
|
||||
this.deleteObj();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -227,9 +227,6 @@ export default {
|
||||
watch: {
|
||||
selected: function (val) {
|
||||
this.deviceSelect(val);
|
||||
},
|
||||
'$store.state.map.deleteCount': function (val) {
|
||||
this.deleteObj();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -205,9 +205,6 @@ export default {
|
||||
watch: {
|
||||
selected: function (val, oldVal) {
|
||||
this.deviceSelect(val);
|
||||
},
|
||||
'$store.state.map.deleteCount': function (val) {
|
||||
this.deleteObj();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -173,9 +173,6 @@ export default {
|
||||
watch: {
|
||||
selected: function (val, oldVal) {
|
||||
this.deviceSelect(val);
|
||||
},
|
||||
'$store.state.map.deleteCount': function (val) {
|
||||
this.deleteObj();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
Reference in New Issue
Block a user