Browse Source

地图无效字符bug修复

刘浩男 1 year ago
parent
commit
cb5c86767c
1 changed files with 10 additions and 6 deletions
  1. 10 6
      data-ui/src/views/data/common/ISuperMap.vue

+ 10 - 6
data-ui/src/views/data/common/ISuperMap.vue

@@ -78,12 +78,16 @@
       },
       init(sign, form,NB,type) {
         const regex = /^\d+(\.\d+)?$/;
-        if (!regex.test(form.longitude)&& !regex.test(form.latitude)){
-           this.$message.warning('无效字符');
-           this.visible = false;
-           this.$parent.ISuperMapvisible = false;
-           this.$parent.form.latitude = null;
-           this.$parent.form.longitude = null;
+        if (this.$parent.form.latitude == null||this.$parent.form.longitude == null) {
+
+        }else{
+          if (!regex.test(form.longitude) && !regex.test(form.latitude)) {
+            this.$message.warning('无效字符');
+            this.visible = false;
+            this.$parent.ISuperMapvisible = false;
+            this.$parent.form.latitude = null;
+            this.$parent.form.longitude = null;
+          }
         }
         if(NB=='NB'){
           getConfigKey('supermapKey').then(response => {