Browse Source

修改bug 图片后缀大写时处理

haojianlong 4 years ago
parent
commit
6ee27fc2f4

+ 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.toString().toLowerCase() == 'png' || temp.toString().toLowerCase() == 'jpg') {
         // 平面图创建业务空间时再改 增加图片偏移量及缩放比例
         that.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.FloorMap}`, res => {
           this.getGraphtSuc(res)

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

@@ -170,7 +170,8 @@
             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.toString().toLowerCase() == 'png' || temp.toString().toLowerCase() == 'jpg') {
                   this.initGraphy(floorMap, 3)
                 } else {
                   this.initGraphy(floorMap, 2)

+ 3 - 2
src/views/ledger/facility/batchPoint.vue

@@ -431,8 +431,9 @@ export default {
     getGraphy() {
       this.scene = new LocationPointScene();
       this.scene.selectContainer.connect('listChange', this, this.listChange)
-	  this.canvasLoading = true;
-      if (this.floorMap.split('.')[1].toString() == 'png' || this.floorMap.split('.')[1].toString() == 'jpg') {
+      this.canvasLoading = true;
+      const temp = this.floorMap.split('.')[1];
+      if (temp && temp.toString().toLowerCase() == 'png' || temp.toString().toLowerCase() == 'jpg') {
         let x = 0;
         let y = 0;
         let scale = 1;