sunyize 2 rokov pred
rodič
commit
0ec24be6a0

+ 10 - 18
src/views/networkAccess/registration.vue

@@ -1069,6 +1069,7 @@ export default {
         "queryByCardNo": "/businessReminderCard/queryByCardNo",
         "getCompany": "/sysCompany/list",
         "queryByCardNoOne": "/businessReminderCard/queryByCardNoOne",
+        "ping": "/businessReminderCard/checkNetwork",
       },
 
       labelCol: {span: 2},
@@ -1412,7 +1413,6 @@ export default {
     this.initTest();
     this.getSysCompany();
     //DOM初始化完成进行地图初始化
-    this.initMap();
     this.getSysDictItems()
     this.queryById();
 
@@ -1421,23 +1421,15 @@ export default {
 
   methods: {
     initTest(){
-      if (window.navigator.onLine) {
-        this.showMap=true;
-        console.log('网络正常!');
-      } else {
-        console.log('网络中断!');
-      }
-      // var url ="https://restapi.amap.com/v3/place/text?platform=JS&s=rsv3&logversion=2.0&key=8e513e3c374bdb2dd0095cd337b02ee6&sdkversion=2.0.5.16&appname=http%253A%252F%252Flocalhost%253A3000%252FnetworkAccess%252Fregistration&csid=4E2FC734-B760-4BDC-8A28-EE4089511EBA&jscode=f762c44f71422cd56f90acc2a8e75144&page=1&offset=10&language=zh_cn&s=rsv3&children=&type_=KEYWORD&antiCrab=true&keywords=%E5%8C%97%E4%BA%AC&callback=jsonp_948335_1698657067342";
-      // getAction(url).then((res)=>{
-      //   if (window.navigator.onLine) {
-      //     console.log('网络正常!');
-      //   } else {
-      //     console.log('网络中断!');
-      //   }
-      // }).catch(e => {
-      //   alert()
-      //   console.log(e);
-      // })
+      getAction(this.url.ping).then((res)=> {
+        if (res.success) {
+          this.showMap=true;
+          this.initMap();
+        } else {
+          this.showMap=false;
+          //alert('网络中断!');
+        }
+      });
     },
     validateItemValue(rule, value, callback){
       let param = {

+ 9 - 18
src/views/networkAccess/registrationSelect.vue

@@ -1444,7 +1444,6 @@ export default {
     this.initTest();
     this.getSysCompany();
     //DOM初始化完成进行地图初始化
-    this.initMap();
     this.getSysDictItems()
     this.queryById();
 
@@ -1453,23 +1452,15 @@ export default {
 
   methods: {
     initTest(){
-      if (window.navigator.onLine) {
-        this.showMap=true;
-        console.log('网络正常!');
-      } else {
-        console.log('网络中断!');
-      }
-      // var url ="https://restapi.amap.com/v3/place/text?platform=JS&s=rsv3&logversion=2.0&key=8e513e3c374bdb2dd0095cd337b02ee6&sdkversion=2.0.5.16&appname=http%253A%252F%252Flocalhost%253A3000%252FnetworkAccess%252Fregistration&csid=4E2FC734-B760-4BDC-8A28-EE4089511EBA&jscode=f762c44f71422cd56f90acc2a8e75144&page=1&offset=10&language=zh_cn&s=rsv3&children=&type_=KEYWORD&antiCrab=true&keywords=%E5%8C%97%E4%BA%AC&callback=jsonp_948335_1698657067342";
-      // getAction(url).then((res)=>{
-      //   if (window.navigator.onLine) {
-      //     console.log('网络正常!');
-      //   } else {
-      //     console.log('网络中断!');
-      //   }
-      // }).catch(e => {
-      //   alert()
-      //   console.log(e);
-      // })
+      getAction(this.url.ping).then((res)=> {
+        if (res.success) {
+          this.showMap=true;
+          this.initMap();
+        } else {
+          this.showMap=false;
+          //alert('网络中断!');
+        }
+      });
     },
 // 添加按钮
     add(){

+ 9 - 18
src/views/networkAccess/registrationUpdate.vue

@@ -1444,7 +1444,6 @@ export default {
     this.initTest();
     this.getSysCompany();
     //DOM初始化完成进行地图初始化
-    this.initMap();
     this.getSysDictItems()
     this.queryById();
 
@@ -1453,23 +1452,15 @@ export default {
 
   methods: {
     initTest(){
-      if (window.navigator.onLine) {
-        this.showMap=true;
-        console.log('网络正常!');
-      } else {
-        console.log('网络中断!');
-      }
-      // var url ="https://restapi.amap.com/v3/place/text?platform=JS&s=rsv3&logversion=2.0&key=8e513e3c374bdb2dd0095cd337b02ee6&sdkversion=2.0.5.16&appname=http%253A%252F%252Flocalhost%253A3000%252FnetworkAccess%252Fregistration&csid=4E2FC734-B760-4BDC-8A28-EE4089511EBA&jscode=f762c44f71422cd56f90acc2a8e75144&page=1&offset=10&language=zh_cn&s=rsv3&children=&type_=KEYWORD&antiCrab=true&keywords=%E5%8C%97%E4%BA%AC&callback=jsonp_948335_1698657067342";
-      // getAction(url).then((res)=>{
-      //   if (window.navigator.onLine) {
-      //     console.log('网络正常!');
-      //   } else {
-      //     console.log('网络中断!');
-      //   }
-      // }).catch(e => {
-      //   alert()
-      //   console.log(e);
-      // })
+      getAction(this.url.ping).then((res)=> {
+        if (res.success) {
+          this.showMap=true;
+          this.initMap();
+        } else {
+          this.showMap=false;
+          //alert('网络中断!');
+        }
+      });
     },
     // 添加按钮
     add(){