|
@@ -0,0 +1,511 @@
|
|
|
+<!-- 画板 -->
|
|
|
+<template>
|
|
|
+ <div ref="basePlan" class="base-plan">
|
|
|
+ <canvas id="floor_plan" :width="canvasWidth" :height="canvasHeight" tabindex="0"></canvas>
|
|
|
+ <scaleBtn v-show="hasShowContro" class="sacle-btn" @sacle="changeSize"></scaleBtn>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { planScene } from "./planClass/planScene";
|
|
|
+import { FloorView } from "./planClass/FloorView";
|
|
|
+import { pubPlanerRead, equipQuery, spaceQuery } from "@/api/plan"; // 引入获取底图得接口
|
|
|
+import scaleBtn from "./scale";
|
|
|
+import { PlanParser } from "./planClass/PlanParser";
|
|
|
+import { planFactory } from "./planClass/planFactory";
|
|
|
+
|
|
|
+import { SColor, SFont, SPoint } from "@persagy-web/draw";
|
|
|
+import { SLineStyle } from "@persagy-web/graph";
|
|
|
+import { SFloorParser, getJsonz } from "@persagy-web/big";
|
|
|
+import { SImageItem, STextItem, SAnchorItem } from "@persagy-web/graph";
|
|
|
+export default {
|
|
|
+ components: { scaleBtn },
|
|
|
+ props: {
|
|
|
+ // 是否展示大小控制器
|
|
|
+ hasShowContro: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ required: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ canvasWidth: 0, // 画布的宽
|
|
|
+ canvasHeight: 0, // 画布的高
|
|
|
+ view: null, // 视图 view
|
|
|
+ scene: null, // 场景类
|
|
|
+ baseMapStyle: {
|
|
|
+ // 底图样式
|
|
|
+ default: {
|
|
|
+ strokeColor: "#F0F3F7",
|
|
|
+ fillColor: "#F0F3F7",
|
|
|
+ lineWidth: 1,
|
|
|
+ effect: {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+ equipItemMap: {}, // 图上相关的设备实例
|
|
|
+ equipItemNum: 0, // 图上相关的设备的数量
|
|
|
+ zoneIteMap: {}, // 图上相关的空间实例
|
|
|
+ zoneItemNum: 0, // 图上相关的空间实例的数量
|
|
|
+ styleMap: {}, // 样式库信息
|
|
|
+ outline: null, // 区域显示,返回有轮廓点坐标时,区域显示,否则不进行区域显示
|
|
|
+ ruleList: [], //规则列表
|
|
|
+ objExtInfo: {}, // 对象实例信息
|
|
|
+ zoneItem: [], //保存空间实例队形
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ fixWindow() {
|
|
|
+ this.view.fitSceneToView();
|
|
|
+ },
|
|
|
+ // 初始化
|
|
|
+ init() {
|
|
|
+ this.clearImg();
|
|
|
+ this.view ? (this.view.scene = this.scene) : null;
|
|
|
+ // 读取平面图数据
|
|
|
+ this.readPlanMsg();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 读取平面图数据
|
|
|
+ readPlanMsg() {
|
|
|
+ if (false) {
|
|
|
+ const obj = {
|
|
|
+ // graphId: "0314991b0cd148ba89da60eddf30efd1",
|
|
|
+ projectId: "Pj4403070003",
|
|
|
+ graphId: "994d0f65d647426f854d2a5f7f0173a4",
|
|
|
+ id: "be4c75daf4d44cb89b447eb7581614da",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ const obj = {
|
|
|
+ graphId: window._graphId,
|
|
|
+ id: window._id,
|
|
|
+ // projectId: window._projectId,
|
|
|
+ };
|
|
|
+ // 查询已发布的图
|
|
|
+ pubPlanerRead(obj).then((res) => {
|
|
|
+ // this.statDeviceIds(res);
|
|
|
+ this.getDataSuc(res);
|
|
|
+ // 获取压缩包数据并解压
|
|
|
+ if (window._floorMap) {
|
|
|
+ // TODO: 底图
|
|
|
+ this.getMapBlob();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 请求获取地图的压缩包
|
|
|
+ getMapBlob(showBaseMap) {
|
|
|
+ if (window._floorMap.includes("png") || window._floorMap.includes("jpg")) {
|
|
|
+ const url = `/image-service/common/image_get?systemId=dataPlatform&key=${window._floorMap}`;
|
|
|
+ this.getImage(url);
|
|
|
+ } else {
|
|
|
+ const url = `/image-service/common/file_get?systemId=revit&key=${window._floorMap}`;
|
|
|
+ getJsonz(url).then((data) => {
|
|
|
+ // 解析数据并放入压缩包中
|
|
|
+ this.parserData(data, showBaseMap);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取图片
|
|
|
+ getImage(url) {
|
|
|
+ const imgItem = new SImageItem(null, url);
|
|
|
+ imgItem.showType = SImageShowType.AutoFit;
|
|
|
+ imgItem.connect("imgLoadOver", this, () => {
|
|
|
+ // 画板是否可拖动;
|
|
|
+ this.scene.addItem(imgItem);
|
|
|
+ this.view.DragMove = true;
|
|
|
+ this.view.fitSceneToView();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 解析底图数据并注入 scene 类中
|
|
|
+ parserData(data, showBaseMap = true) {
|
|
|
+ const parser = new SFloorParser();
|
|
|
+ parser.parseData(data);
|
|
|
+ this.parser = parser;
|
|
|
+ parser.spaceList.forEach((t) => {
|
|
|
+ t.visible = showBaseMap;
|
|
|
+ //设置样式
|
|
|
+ Object.assign(t, this.baseMapStyle.default);
|
|
|
+ t.selectable = false;
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ parser.wallList.forEach((t) => {
|
|
|
+ t.visible = showBaseMap;
|
|
|
+ t.selectable = false;
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ parser.virtualWallList.forEach((t) => {
|
|
|
+ t.visible = showBaseMap;
|
|
|
+ t.selectable = false;
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ parser.doorList.forEach((t) => {
|
|
|
+ t.visible = showBaseMap;
|
|
|
+ t.selectable = false;
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ parser.columnList.forEach((t) => {
|
|
|
+ t.visible = showBaseMap;
|
|
|
+ t.selectable = false;
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ parser.casementList.forEach((t) => {
|
|
|
+ t.visible = showBaseMap;
|
|
|
+ t.selectable = false;
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ // 画板是否可拖动
|
|
|
+ this.view.DragMove = true;
|
|
|
+ this.view.fitSceneToView();
|
|
|
+ },
|
|
|
+ // 读图成功回调
|
|
|
+ async getDataSuc(res) {
|
|
|
+ let anchorList = []; //保存锚点对象
|
|
|
+ // 'url 新增路径'
|
|
|
+ if (res.result == "failure") return;
|
|
|
+ const parse = new PlanParser();
|
|
|
+ if (this.scene) {
|
|
|
+ // const backgroundColor = res.data.content.viewBackground ? res.data.content.viewBackground : "#1f1f27";
|
|
|
+ // this.scene.changeBackgroundColor(backgroundColor);
|
|
|
+ }
|
|
|
+ // 初始化对象实例信息
|
|
|
+ if (res.content.elements.objExtInfo?.length) {
|
|
|
+ const objExtInfo = {};
|
|
|
+ if (res.content.elements.objExtInfo?.length) {
|
|
|
+ res.content.elements.objExtInfo.forEach((item) => {
|
|
|
+ if (item?.properties?.id) objExtInfo[item.properties.id] = item;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.objExtInfo = objExtInfo;
|
|
|
+ }
|
|
|
+ // 初始化样式信息
|
|
|
+ if (res.content.style) {
|
|
|
+ // 拼接设备默认样式
|
|
|
+ this.styleMap = res.content.style;
|
|
|
+ } else {
|
|
|
+ this.styleMap = {};
|
|
|
+ }
|
|
|
+ // 加载规则,显示实例数据
|
|
|
+ if (res.content.ruleList?.length) {
|
|
|
+ // this.INITRULELIST(res.content.ruleList);
|
|
|
+ // this.ruleNum = res.content.ruleList.length;
|
|
|
+
|
|
|
+ const ruleList = res.content.ruleList;
|
|
|
+ // 同步执行规则,进行设备/设备组/空间的添加,删除
|
|
|
+ for (let index = 0; index < ruleList.length; index++) {
|
|
|
+ const rule = ruleList[index];
|
|
|
+ // 查询规则
|
|
|
+ if (rule.commond && rule.commond === "query") {
|
|
|
+ const params = { ...rule.params, buildingId: window._buildingId, floorId: window._floorId };
|
|
|
+ if (rule?.returnType === "equip") {
|
|
|
+ const res = await equipQuery(params);
|
|
|
+ if (res.result === "success") this.mergeEquipData(res.content);
|
|
|
+ } else if (rule?.returnType === "zone") {
|
|
|
+ const res = await spaceQuery(params);
|
|
|
+ if (res.result === "success") this.mergeZoneData(res.content);
|
|
|
+ } else if (rule?.returnType === "equipGroup") {
|
|
|
+ console.error("请求设备组数据");
|
|
|
+ // this.loadedRuleNum++;
|
|
|
+ // if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
|
|
|
+ }
|
|
|
+ } else if (rule.commond && rule.commond === "delete") {
|
|
|
+ // 删除规则
|
|
|
+ // console.error("删除命令!!!", rule);
|
|
|
+ // 删除设备实例
|
|
|
+ if (rule?.returnType === "equip") {
|
|
|
+ const classCode = rule?.params?.classCode;
|
|
|
+ if (classCode) {
|
|
|
+ this.removeEquipment(classCode);
|
|
|
+ }
|
|
|
+ } else if (rule?.returnType === "zone") {
|
|
|
+ // 删除空间实例
|
|
|
+ const classCode = rule?.params?.classCode;
|
|
|
+ if (classCode) {
|
|
|
+ this.removeZone(classCode);
|
|
|
+ }
|
|
|
+ } else if (rule?.returnType === "equipGroup") {
|
|
|
+ // 删除设备组
|
|
|
+ //
|
|
|
+ // this.loadedRuleNum++;
|
|
|
+ // if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ window.parse = parse;
|
|
|
+
|
|
|
+ // 图片url修改
|
|
|
+ if (res.content.elements.markers?.length) {
|
|
|
+ //
|
|
|
+ res.content.elements.markers.map((item, index, arr) => {
|
|
|
+ if (["BaseImage", "BgImage"].includes(item.properties.type)) {
|
|
|
+ if (item.style.default.url) {
|
|
|
+ arr[index].style.default.url =
|
|
|
+ window.img_baseurl + "/image-service/common/image_get?systemId=dataPlatform&key=" + arr[index].style.default.url;
|
|
|
+ } else {
|
|
|
+ // 默认图片
|
|
|
+ arr[index].style.default.url =
|
|
|
+ window.img_baseurl + "/image-service/common/image_get?systemId=dataPlatform&key=" + "1611739392546.png";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ parse.parseData(res.content.elements);
|
|
|
+ parse.markers.forEach((item) => {
|
|
|
+ // console.log(' parse.markers',item)
|
|
|
+ item && this.scene.addItem(item);
|
|
|
+ });
|
|
|
+
|
|
|
+ parse.relations.forEach((t) => {
|
|
|
+ // 设置锚点
|
|
|
+ if (t.anchor1Id) {
|
|
|
+ let startAnc = null;
|
|
|
+ anchorList.forEach((aItem) => {
|
|
|
+ if (aItem.id == t.anchor1Id) {
|
|
|
+ startAnc = aItem;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (startAnc) {
|
|
|
+ startAnc.isConnected = true;
|
|
|
+ startAnc.parent?.connect("changePos", t, t.changePos);
|
|
|
+ t.startAnchor = startAnc || null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (t.anchor12d) {
|
|
|
+ let endAnc = null;
|
|
|
+ anchorList.forEach((aItem) => {
|
|
|
+ if (aItem.id == t.anchor12d) {
|
|
|
+ endAnc = aItem;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (endAnc) {
|
|
|
+ endAnc.isConnected = true;
|
|
|
+ endAnc.parent?.connect("changePos", t, t.changePos);
|
|
|
+ t.endAnchor = endAnc || null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.scene.addItem(t);
|
|
|
+ });
|
|
|
+ // 设置画布背景色
|
|
|
+ const backgroundColor = res.content.style?.defaultMapStyle?.backgroundColor;
|
|
|
+ if (backgroundColor) {
|
|
|
+ this.scene.changeBackgroundColor(backgroundColor);
|
|
|
+ }
|
|
|
+ // 区域显示,绘制maskItem,并将maskItem适配屏幕
|
|
|
+ if (res.content.outline && res.content.style?.defaultMapStyle?.showBaseMap) {
|
|
|
+ const maskItem = new planFactory().createBaseMaskItem(res.content.outline);
|
|
|
+ maskItem.fillColor = new SColor("#ffffffff");
|
|
|
+
|
|
|
+ this.scene.addItem(maskItem);
|
|
|
+ this.view.fitItemToView([maskItem]);
|
|
|
+ } else {
|
|
|
+ this.fixWindow();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 读图成功回调
|
|
|
+ statDeviceIds(res) {
|
|
|
+ let anchorList = []; //保存锚点对象
|
|
|
+ // 'url 新增路径'
|
|
|
+ if (res.result == "failure") return;
|
|
|
+ const parse = new PlanParser();
|
|
|
+ if (res.data.content.elements.nodes && res.data.content.elements.nodes.length) {
|
|
|
+ let tempDatas = res.data.content.elements.nodes.map((obj) => {
|
|
|
+ return obj.attachObjectIds[0];
|
|
|
+ });
|
|
|
+ // console.log('tempDatas:', tempDatas)
|
|
|
+ setInterval(() => {
|
|
|
+ this.$emit("postDeviceIds", tempDatas);
|
|
|
+ }, 5000);
|
|
|
+ this.$emit("postDeviceIds", tempDatas);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 图片缩小
|
|
|
+ changeSize(isbiger) {
|
|
|
+ if (isbiger) {
|
|
|
+ this.view.scaleByPoint((this.view.scale * 1.1) / this.view.scale, this.canvasWidth / 2, this.canvasHeight / 2);
|
|
|
+ } else {
|
|
|
+ this.view.scaleByPoint((this.view.scale * 0.9) / this.view.scale, this.canvasWidth / 2, this.canvasHeight / 2);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 清空画布
|
|
|
+ clearImg() {
|
|
|
+ this.scene = new planScene();
|
|
|
+ this.scene.vueOnMouseDown = this.onMousedown;
|
|
|
+ if (this.view) {
|
|
|
+ this.view.update();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 鼠标点击事件
|
|
|
+ onMousedown(item, e) {
|
|
|
+ console.log("鼠标按下!", item, e);
|
|
|
+ this.$emit("onMousedown", item, e);
|
|
|
+ },
|
|
|
+ // 鼠标抬起事件
|
|
|
+ onMouseup(item, e) {
|
|
|
+ // console.log("鼠标抬起!", item, e);
|
|
|
+ },
|
|
|
+ // 鼠标事件移入
|
|
|
+ onMouseenter(item, e) {
|
|
|
+ // 判断是否为设备图例
|
|
|
+ item.showImgShadow = true;
|
|
|
+ console.log("鼠标移入!", item, e);
|
|
|
+ },
|
|
|
+ // 鼠标事件移出
|
|
|
+ onMouseleave(item, e) {
|
|
|
+ item.showImgShadow = false;
|
|
|
+ console.log("鼠标移出!", item, e);
|
|
|
+ },
|
|
|
+ // 解析设备数据
|
|
|
+ mergeEquipData(equipList) {
|
|
|
+ equipList.forEach((equip) => {
|
|
|
+ if (!this.equipItemMap[equip.id]) {
|
|
|
+ if (this.objExtInfo[equip.id]) {
|
|
|
+ equip = { ...this.objExtInfo[equip.id], ...equip };
|
|
|
+ }
|
|
|
+ if (!equip.pos) {
|
|
|
+ //如果未维护设备在图中的坐标
|
|
|
+ if (equip.locationJson) {
|
|
|
+ // 判断设备是否维护BIM坐标
|
|
|
+ const { x, y, z } = equip.locationJson;
|
|
|
+ equip.pos = { x, y: -y, z };
|
|
|
+ } else {
|
|
|
+ // 否则显示默认坐标位置
|
|
|
+ equip.pos = { x: 0, y: 0, z: 0 };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 添加设备对象类型
|
|
|
+ equip.properties = { type: "BaseEquipment" };
|
|
|
+ equip.style = {
|
|
|
+ default: {},
|
|
|
+ };
|
|
|
+
|
|
|
+ const equipStyle = window.__systemConf.equipStyle;
|
|
|
+ // 设备/设备类样式
|
|
|
+ let style = {};
|
|
|
+ if (this.styleMap[equip.id]) {
|
|
|
+ style = this.styleMap[equip.id];
|
|
|
+ } else if (this.styleMap[equip.classCode]) {
|
|
|
+ style = this.styleMap[equip.classCode];
|
|
|
+ } else if (equipStyle[equip.classCode]) {
|
|
|
+ style = equipStyle[equip.classCode];
|
|
|
+ } else {
|
|
|
+ style = equipStyle["defaultEquipStyle"];
|
|
|
+ }
|
|
|
+
|
|
|
+ equip.style = {
|
|
|
+ default: {
|
|
|
+ ...style,
|
|
|
+ url: window.img_baseurl + "/image-service/common/image_get?systemId=dataPlatform&key=" + style.url, //+ '1607752841478.svg'
|
|
|
+ },
|
|
|
+ };
|
|
|
+ const equipItem = new planFactory().createBaseSEquipment(equip);
|
|
|
+ equipItem.connect("onMouseDown", this, this.onMousedown);
|
|
|
+ equipItem.connect("onMouseUp", this, this.onMouseup);
|
|
|
+ equipItem.connect("onMouseLeave", this, this.onMouseleave);
|
|
|
+ equipItem.connect("onMouseEnter", this, this.onMouseenter);
|
|
|
+ this.scene.addItem(equipItem);
|
|
|
+ // 保存设备到 equipItemMap
|
|
|
+ this.equipItemMap[equip.id] = equipItem;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // this.loadedRuleNum++;
|
|
|
+ // if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
|
|
|
+ },
|
|
|
+ // 按照classCode 删除设备
|
|
|
+ removeEquipment(classCode) {
|
|
|
+ for (const key in this.equipItemMap) {
|
|
|
+ const equipItem = this.equipItemMap[key];
|
|
|
+ if (equipItem?.data?.classCode === classCode) {
|
|
|
+ // 删除equipItemMap中保存的设备实例
|
|
|
+ delete this.equipItemMap[equipItem.id];
|
|
|
+ // 删除图上的设备实例
|
|
|
+ this.scene.removeItem(equipItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 解析空间数据
|
|
|
+ mergeZoneData(zoneList) {
|
|
|
+ zoneList.forEach((zone) => {
|
|
|
+ if (!this.zoneIteMap[zone.id]) {
|
|
|
+ if (this.objExtInfo[zone.id]) {
|
|
|
+ zone = { ...this.objExtInfo[zone.id], ...zone };
|
|
|
+ }
|
|
|
+ // 添加设备对象类型
|
|
|
+ zone.properties = { type: "BaseZone" };
|
|
|
+ let style = {};
|
|
|
+ if (this.styleMap[zone.id]) {
|
|
|
+ style = this.styleMap[zone.id];
|
|
|
+ } else if (this.styleMap[zone.classCode]) {
|
|
|
+ style = this.styleMap[zone.classCode];
|
|
|
+ } else {
|
|
|
+ style = this.styleMap["defaultZoneStyle"];
|
|
|
+ }
|
|
|
+ zone.style = {
|
|
|
+ default: { ...style },
|
|
|
+ };
|
|
|
+ zone.outLine = zone.outline;
|
|
|
+ const zoneItem = new planFactory().createBaseSZone(zone);
|
|
|
+ zoneItem.connect("onMouseDown", this, this.onMousedown);
|
|
|
+ zoneItem.connect("onMouseUp", this, this.onMouseup);
|
|
|
+ zoneItem.connect("onMouseLeave", this, this.onMouseleave);
|
|
|
+ zoneItem.connect("onMouseEnter", this, this.onMouseenter);
|
|
|
+ this.scene.addItem(zoneItem);
|
|
|
+ this.zoneItem.push(zoneItem);
|
|
|
+ // 设置比例,调整文本位置
|
|
|
+ zoneItem.setScale(this.view.scale);
|
|
|
+ // 添加空间实例到 zoneIteMap
|
|
|
+ this.zoneIteMap[zone.id] = zoneItem;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // this.loadedRuleNum++;
|
|
|
+ // if (this.ruleNum === this.loadedRuleNum) this.loadMarkRelation();
|
|
|
+ },
|
|
|
+ // 按照classCode 删除空间
|
|
|
+ removeZone(classCode) {
|
|
|
+ for (const key in this.zoneIteMap) {
|
|
|
+ const zoneItem = this.zoneIteMap[key];
|
|
|
+ if (zoneItem?.data?.classCode === classCode) {
|
|
|
+ // 删除equipItemMap中保存的设备实例
|
|
|
+ delete this.zoneIteMap[zoneItem.data.id];
|
|
|
+ // 删除图上的设备实例
|
|
|
+ this.scene.removeItem(zoneItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听视图比例,调整空间中的信息点位置
|
|
|
+ "view.scale"(val) {
|
|
|
+ this.zoneItem.forEach((item) => {
|
|
|
+ item.setScale(val);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ window.vm = this;
|
|
|
+ this.clearImg();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // 获取 canvas 的宽高
|
|
|
+ this.canvasWidth = this.$refs.basePlan.offsetWidth;
|
|
|
+ this.canvasHeight = this.$refs.basePlan.offsetHeight;
|
|
|
+ // 初始化场景类
|
|
|
+ this.view = new FloorView("floor_plan");
|
|
|
+ if (this.scene) {
|
|
|
+ this.view.scene = this.scene;
|
|
|
+ }
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.base-plan {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: relative;
|
|
|
+ .sacle-btn {
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ bottom: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|