Quellcode durchsuchen

graph:fix:万达ios问题修改

haojianlong vor 4 Jahren
Ursprung
Commit
f781178e86

+ 2 - 2
saga-web-big/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/big",
-    "version": "1.0.119",
+    "version": "1.0.120",
     "description": "上格云建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -42,6 +42,6 @@
         "typescript": "^3.9.7"
     },
     "dependencies": {
-        "@saga-web/graph": "2.1.133"
+        "@saga-web/graph": "2.1.136"
     }
 }

+ 2 - 2
saga-web-fengmap/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/feng-map",
-    "version": "1.0.51",
+    "version": "1.0.52",
     "description": "上格云Web平面图。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -33,7 +33,7 @@
         "typescript": "^3.9.7"
     },
     "dependencies": {
-        "@saga-web/big": "1.0.119",
+        "@saga-web/big": "1.0.120",
         "axios": "^0.18.0"
     }
 }

+ 1 - 1
saga-web-graph/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/graph",
-    "version": "2.1.134",
+    "version": "2.1.136",
     "description": "上格云二维图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

+ 26 - 7
saga-web-graph/src/items/SImageItem.ts

@@ -75,24 +75,43 @@ export class SImageItem extends SObjectItem {
         this._url = v;
         this.img = new Image();
         this.img.onload = (e): void => {
-            // @ts-ignore
-            const imgSrc = e.path[0].src;
-            if (this.isUrlIdentical(imgSrc)) {
+            const isiOS = !!navigator.userAgent.match(
+                /\(i[^;]+;( U;)? CPU.+Mac OS X/
+            ); //ios终端
+            if (isiOS) {
                 this.isLoadOver = true;
                 this.computeImgSize();
                 this.$emit("imgLoadOver");
                 this.update();
+            } else {
+                // @ts-ignore
+                const imgSrc = e.path[0].src;
+                if (this.isUrlIdentical(imgSrc)) {
+                    this.isLoadOver = true;
+                    this.computeImgSize();
+                    this.$emit("imgLoadOver");
+                    this.update();
+                }
             }
         };
         this.img.onerror = (e): void => {
-            // @ts-ignore
-            const imgSrc = e.path[0].src;
-            if (this.isUrlIdentical(imgSrc)) {
+            const isiOS = !!navigator.userAgent.match(
+                /\(i[^;]+;( U;)? CPU.+Mac OS X/
+            ); //ios终端
+            if (isiOS) {
                 this.isLoadOver = false;
                 this.$emit("imgLoadOver");
                 this.update();
-                console.log("加载图片错误!", e);
+            } else {
+                // @ts-ignore
+                const imgSrc = e.path[0].src;
+                if (this.isUrlIdentical(imgSrc)) {
+                    this.isLoadOver = false;
+                    this.$emit("imgLoadOver");
+                    this.update();
+                }
             }
+            console.log("加载图片错误!", e);
         };
         this.img.src = v;
     }