Преглед на файлове

新增兵力列表、想定作战单元添加功能

xyh преди 1 година
родител
ревизия
ed9bc47cad
променени са 1 файла, в които са добавени 28 реда и са изтрити 0 реда
  1. 28 0
      src/views/situation/index.vue

+ 28 - 0
src/views/situation/index.vue

@@ -250,6 +250,16 @@ export default {
           return
         }
       }
+      if(parseFloat(this.redForm.lat)>180||parseFloat(this.redForm.lat)<-180)
+      {
+        this.$message("请输入正确范围的经度")
+        return
+      }
+      if(parseFloat(this.redForm.lon)>90||parseFloat(this.redForm.lon)<-90)
+      {
+        this.$message("请输入正确范围的纬度")
+        return
+      }
       this.redList.push({
         order: this.redList.length+1,
         name: this.redForm.name,
@@ -323,6 +333,16 @@ export default {
           return
         }
       }
+      if(parseFloat(this.blueForm.lat)>180||parseFloat(this.blueForm.lat)<-180)
+      {
+        this.$message("请输入正确范围的经度")
+        return
+      }
+      if(parseFloat(this.blueForm.lon)>90||parseFloat(this.blueForm.lon)<-90)
+      {
+        this.$message("请输入正确范围的纬度")
+        return
+      }
       this.blueList.push({
         order: this.blueList.length+1,
         name: this.blueForm.name,
@@ -347,6 +367,10 @@ export default {
 
     },
     addRed(){
+      if(!this.save){
+        this.$message("请先导入想定文件!")
+        return
+      }
       this.redForm = {
           name: '',
           method: '',
@@ -357,6 +381,10 @@ export default {
         this.redVisible = true
     },
     addBlue(){
+      if(!this.save){
+        this.$message("请先导入想定文件!")
+        return
+      }
       this.blueForm = {
           name: '',
           lat: '',