Browse Source

图类型判断

haojianlong 4 years ago
parent
commit
321e7f9d68

+ 2 - 1
src/components/business_space/newGraphy/graphy.vue

@@ -362,7 +362,8 @@
       that.clearGraphy()
       that.scene = new DivideFloorScene();
       that.canvasLoading = true;
-      if (this.FloorMap.split('.')[1].toString() == 'png' || this.FloorMap.split('.')[1].toString() == 'jpg') {
+      const temp = this.FloorMap.split('.')[1];
+      if (temp && (temp.toLowerCase() == 'png' || temp.toLowerCase() == 'jpg')) {
         that.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.FloorMap}`, res => {
           this.getGraphtSuc(res)
         })

+ 2 - 2
src/components/ledger/lib/bimDialog.vue

@@ -152,11 +152,11 @@ export default {
     },
     //获取楼层数据
     getFloorData() {
-      console.log(this.floorData)
       if (this.floorData && this.floorData.StructureInfo && this.floorData.StructureInfo.FloorMap) {
         this.isdata = true
         let floorMap = this.floorData.StructureInfo.FloorMap
-        if (floorMap.split('.')[1].toString() == 'png' || floorMap.split('.')[1].toString() == 'jpg') {
+        const temp = floorMap.split('.')[1];
+        if (temp && (temp.toLowerCase() == 'png' || temp.toLowerCase() == 'jpg')) {
           this.initGraphy(floorMap, 3)
         } else {
           this.initGraphy(floorMap, 2)