|
@@ -1,46 +1,50 @@
|
|
|
<template>
|
|
|
<div id="baseEditer">
|
|
|
- <a-button type="primary" @click="init" style="position:absolute"> Primary </a-button>
|
|
|
+ <a-button type="primary" @click="init" style="position:absolute">Primary</a-button>
|
|
|
<div id="fengMap"></div>
|
|
|
-
|
|
|
<div class="canvas-container" ref="graphy">
|
|
|
<canvas id="canvas" :width="canvasWidth" :height="canvasHeight"></canvas>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { SFengParser } from "@saga-web/feng-map"
|
|
|
-import { SFloorParser } from "@saga-web/big"
|
|
|
-import { SGraphyView, SGraphyScene } from '@saga-web/graphy/lib';
|
|
|
+import { SFengParser } from "@saga-web/feng-map";
|
|
|
+import { SFloorParser } from "@saga-web/big";
|
|
|
+import { SGraphyView, SGraphyScene } from "@saga-web/graphy/lib";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
appName: "万达可视化系统",
|
|
|
key: "23f30a832a862c58637a4aadbf50a566",
|
|
|
mapServerURL: "/wanda",
|
|
|
- fmapID: '1001724_29',
|
|
|
+ fmapID: "1001724_29",
|
|
|
fmap: null,
|
|
|
- canvasWidth: 800,
|
|
|
+ canvasWidth: 700,
|
|
|
canvasHeight: 800,
|
|
|
fParser: null
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.canvasWidth = this.$refs.graphy.offsetWidth;
|
|
|
- console.log(this.$refs.graphy.offsetWidth)
|
|
|
+ console.log(this.$refs.graphy.offsetWidth);
|
|
|
this.canvasHeight = this.$refs.graphy.offsetHeight;
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- this.clearGraphy()
|
|
|
- this.scene = new SGraphyScene()
|
|
|
- this.fmap = new SFengParser('fengMap', this.mapServerURL, this.key, this.appName, null)
|
|
|
+ this.clearGraphy();
|
|
|
+ this.scene = new SGraphyScene();
|
|
|
+ this.fmap = new SFengParser(
|
|
|
+ "fengMap",
|
|
|
+ this.mapServerURL,
|
|
|
+ this.key,
|
|
|
+ this.appName,
|
|
|
+ null
|
|
|
+ );
|
|
|
console.log(this.fmap);
|
|
|
- this.fmap.parseData('1001724_29', 1, res => {
|
|
|
- console.log(res)
|
|
|
+ this.fmap.parseData("1001724_29", 1, res => {
|
|
|
+ console.log(res);
|
|
|
this.fParser = new SFloorParser(null);
|
|
|
- console.log(this.fParser)
|
|
|
+ console.log(this.fParser);
|
|
|
this.fParser.parseData(res);
|
|
|
this.fParser.spaceList.forEach(t => this.scene.addItem(t));
|
|
|
this.fParser.wallList.forEach(t => this.scene.addItem(t));
|
|
@@ -50,7 +54,7 @@ export default {
|
|
|
this.fParser.casementList.forEach(t => this.scene.addItem(t));
|
|
|
this.view.scene = this.scene;
|
|
|
this.view.fitSceneToView();
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
clearGraphy() {
|
|
|
if (this.view) {
|
|
@@ -59,15 +63,16 @@ export default {
|
|
|
}
|
|
|
this.view = new SGraphyView("canvas");
|
|
|
},
|
|
|
- changeFloor() { }
|
|
|
+ changeFloor() {}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
#baseEditer {
|
|
|
background: #ccc;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ // position: relative;
|
|
|
#fengMap {
|
|
|
position: absolute;
|
|
|
width: 100px;
|