|
@@ -205,7 +205,7 @@ export class FloorScene extends SGraphyScene {
|
|
let binaryString = readerEvt.target.result;
|
|
let binaryString = readerEvt.target.result;
|
|
//解压数据
|
|
//解压数据
|
|
let base64Data = btoa(binaryString);
|
|
let base64Data = btoa(binaryString);
|
|
- let unGzipData = pako.unzip(base64Data);
|
|
|
|
|
|
+ let unGzipData = that.unzipBase64(base64Data);
|
|
that.data = unGzipData.EntityList[0].Elements;
|
|
that.data = unGzipData.EntityList[0].Elements;
|
|
resolve(unGzipData);
|
|
resolve(unGzipData);
|
|
};
|
|
};
|
|
@@ -268,7 +268,7 @@ export class FloorScene extends SGraphyScene {
|
|
* @param space 空间list
|
|
* @param space 空间list
|
|
*/
|
|
*/
|
|
addSpace(space: Space): void {
|
|
addSpace(space: Space): void {
|
|
- let item = new SpaceItem(space);
|
|
|
|
|
|
+ let item = new SpaceItem(null, space);
|
|
item.zOrder = 2;
|
|
item.zOrder = 2;
|
|
item.visible = this.isShowSpace;
|
|
item.visible = this.isShowSpace;
|
|
this.spaceList.push(item);
|
|
this.spaceList.push(item);
|
|
@@ -281,7 +281,7 @@ export class FloorScene extends SGraphyScene {
|
|
* @param column 柱子list
|
|
* @param column 柱子list
|
|
*/
|
|
*/
|
|
addColumn(column: Column): void {
|
|
addColumn(column: Column): void {
|
|
- let item = new ColumnItem(column);
|
|
|
|
|
|
+ let item = new ColumnItem(null, column);
|
|
item.visible = this.isShowColumn;
|
|
item.visible = this.isShowColumn;
|
|
this.columnList.push(item);
|
|
this.columnList.push(item);
|
|
this.addItem(item);
|
|
this.addItem(item);
|
|
@@ -293,7 +293,7 @@ export class FloorScene extends SGraphyScene {
|
|
* @param wall 墙list
|
|
* @param wall 墙list
|
|
*/
|
|
*/
|
|
addWall(wall: Wall): void {
|
|
addWall(wall: Wall): void {
|
|
- let item = new WallItem(wall);
|
|
|
|
|
|
+ let item = new WallItem(null, wall);
|
|
item.visible = this.isShowWall;
|
|
item.visible = this.isShowWall;
|
|
this.wallList.push(item);
|
|
this.wallList.push(item);
|
|
this.addItem(item);
|
|
this.addItem(item);
|
|
@@ -305,7 +305,7 @@ export class FloorScene extends SGraphyScene {
|
|
* @param virtualWall 虚拟墙list
|
|
* @param virtualWall 虚拟墙list
|
|
*/
|
|
*/
|
|
addVirtualWall(virtualWall: VirtualWall): void {
|
|
addVirtualWall(virtualWall: VirtualWall): void {
|
|
- let item = new VirtualWallItem(virtualWall);
|
|
|
|
|
|
+ let item = new VirtualWallItem(null, virtualWall);
|
|
item.visible = this.isShowVirtualWall;
|
|
item.visible = this.isShowVirtualWall;
|
|
this.virtualWallList.push(item);
|
|
this.virtualWallList.push(item);
|
|
this.addItem(item);
|
|
this.addItem(item);
|
|
@@ -317,7 +317,7 @@ export class FloorScene extends SGraphyScene {
|
|
* @param doors 门list
|
|
* @param doors 门list
|
|
*/
|
|
*/
|
|
addDoor(door: Door): void {
|
|
addDoor(door: Door): void {
|
|
- let item = new DoorItem(door);
|
|
|
|
|
|
+ let item = new DoorItem(null, door);
|
|
item.zOrder = 1;
|
|
item.zOrder = 1;
|
|
item.visible = this.isShowDoor;
|
|
item.visible = this.isShowDoor;
|
|
this.doorList.push(item);
|
|
this.doorList.push(item);
|
|
@@ -330,12 +330,13 @@ export class FloorScene extends SGraphyScene {
|
|
* @param windows 窗户list
|
|
* @param windows 窗户list
|
|
*/
|
|
*/
|
|
addCasement(casement: Casement): void {
|
|
addCasement(casement: Casement): void {
|
|
- let item = new WindowItem(casement);
|
|
|
|
|
|
+ let item = new WindowItem(null, casement);
|
|
item.zOrder = 1;
|
|
item.zOrder = 1;
|
|
item.visible = this.isShowWindow;
|
|
item.visible = this.isShowWindow;
|
|
this.casementList.push(item);
|
|
this.casementList.push(item);
|
|
this.addItem(item);
|
|
this.addItem(item);
|
|
} // Function addCasement
|
|
} // Function addCasement
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 扩大数组中相应字段一定倍数
|
|
* 扩大数组中相应字段一定倍数
|
|
*
|
|
*
|
|
@@ -361,4 +362,30 @@ export class FloorScene extends SGraphyScene {
|
|
});
|
|
});
|
|
return data;
|
|
return data;
|
|
} // Function changeMap
|
|
} // Function changeMap
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 解压文件
|
|
|
|
+ *
|
|
|
|
+ * @param b64Data base64数据
|
|
|
|
+ */
|
|
|
|
+ private unzipBase64(b64Data: any) {
|
|
|
|
+ let strData = atob(b64Data);
|
|
|
|
+ let charData = strData.split("").map(function(x) {
|
|
|
|
+ return x.charCodeAt(0);
|
|
|
|
+ });
|
|
|
|
+ let binData = new Uint8Array(charData);
|
|
|
|
+ let data = pako.inflate(binData, { to: "string" });
|
|
|
|
+ return eval("(" + data + ")");
|
|
|
|
+ } // Function unzipBase64
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 压缩文件
|
|
|
|
+ *
|
|
|
|
+ * @param str 被压缩的数据
|
|
|
|
+ */
|
|
|
|
+ private zip(str: any) {
|
|
|
|
+ //escape(str) --->压缩前编码,防止中午乱码
|
|
|
|
+ let binaryString = pako.gzip(escape(str), { to: "string" });
|
|
|
|
+ return binaryString;
|
|
|
|
+ } // Function zip
|
|
} // Class FloorScene
|
|
} // Class FloorScene
|