|
@@ -81,7 +81,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { SFengParser } from '@saga-web/feng-map'
|
|
|
+import { SFengParser, ProjectRf } from '@saga-web/feng-map'
|
|
|
import { SFloorParser, ItemOrder, ItemColor, SPolygonItem } from '@saga-web/big'
|
|
|
import { FloorView } from '@/lib/FloorView'
|
|
|
import { FloorScene } from '@/lib/FloorScene'
|
|
@@ -128,7 +128,8 @@ export default {
|
|
|
pointData: []
|
|
|
},
|
|
|
activeItem: null,
|
|
|
- showBtnWell: false
|
|
|
+ showBtnWell: false,
|
|
|
+ count: 0, // 顶楼为多张图时计数器
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -281,14 +282,40 @@ export default {
|
|
|
if (floor == 'g80') {
|
|
|
// 屋顶
|
|
|
if (window.fengmapData.frImg) {
|
|
|
- let imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`)
|
|
|
- imgItem.showType = SImageShowType.AutoFit
|
|
|
- imgItem.connect('imgLoadOver', this, () => {
|
|
|
- this.readGraph()
|
|
|
- })
|
|
|
- this.scene.addItem(imgItem)
|
|
|
- this.view.scene = this.scene
|
|
|
+ const pj = this.urlMsg.fmapID.split('_')[0]
|
|
|
+ // 单张图片
|
|
|
+ if (!ProjectRf[pj]) {
|
|
|
+ let imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`)
|
|
|
+ imgItem.showType = SImageShowType.AutoFit
|
|
|
+ imgItem.connect('imgLoadOver', this, () => {
|
|
|
+ this.readGraph()
|
|
|
+ })
|
|
|
+ this.scene.addItem(imgItem)
|
|
|
+ this.view.scene = this.scene
|
|
|
// this.view.fitSceneToView()
|
|
|
+ } else {
|
|
|
+ // 多张图
|
|
|
+ try {
|
|
|
+ // 初始化0
|
|
|
+ this.count = 0;
|
|
|
+ ProjectRf[pj].forEach(t => {
|
|
|
+ const item = new SImageItem(
|
|
|
+ null,
|
|
|
+ `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${t.name}`
|
|
|
+ );
|
|
|
+ item.width = t.width
|
|
|
+ item.height = t.width
|
|
|
+ item.moveTo(t.x, t.y)
|
|
|
+ item.connect("imgLoadOver", this, () => {
|
|
|
+ this.countRf(ProjectRf[pj].length);
|
|
|
+ });
|
|
|
+ this.scene.addItem(item);
|
|
|
+ })
|
|
|
+ this.view.scene = this.scene;
|
|
|
+ } catch(e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
// 屋顶图不为图片
|
|
|
this.readBaseMap(floor);
|
|
@@ -445,6 +472,15 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ // 顶楼为多张图时计数器
|
|
|
+ countRf(len) {
|
|
|
+ this.count++
|
|
|
+ if (len == this.count) {
|
|
|
+ this.readGraph();
|
|
|
+ } else {
|
|
|
+ console.log('所有图片未加载完成');
|
|
|
+ }
|
|
|
+ },
|
|
|
clearGraphy() {
|
|
|
if (this.view) {
|
|
|
this.view.scene = null
|