|
@@ -1,10 +1,6 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div
|
|
|
- class="space-main"
|
|
|
- v-if="mapData && mapData.spaceList && mapData.spaceList.length"
|
|
|
- id="spaceMain"
|
|
|
- >
|
|
|
+ <div id="map" style="width: 100%; height: 100%">
|
|
|
+ <div class="space-main" id="spaceMain">
|
|
|
<div
|
|
|
class="space-box"
|
|
|
v-for="(area, index) in mapData.spaceList"
|
|
@@ -22,8 +18,6 @@
|
|
|
:class="[
|
|
|
area.canClick ? '' : 'click-disable',
|
|
|
selectArea.id === area.id ? 'select' : '',
|
|
|
- spaceInfo.spaceId === area.spaceId &&
|
|
|
- spaceInfo.isPermanent &&
|
|
|
isSetSpace
|
|
|
? 'use-select'
|
|
|
: '',
|
|
@@ -174,7 +168,7 @@ export default defineComponent({
|
|
|
},
|
|
|
floorId: {
|
|
|
type: String,
|
|
|
- default: () => ""
|
|
|
+ default: () => "",
|
|
|
},
|
|
|
},
|
|
|
components: {
|
|
@@ -233,8 +227,10 @@ export default defineComponent({
|
|
|
let matrix_box: any = document.querySelector("#spaceMain");
|
|
|
// 记住使用的缩放值
|
|
|
proxyData.displacement.scale = 1;
|
|
|
- matrix_box.style.left = 0 + "px";
|
|
|
- matrix_box.style.top = 0 + "px";
|
|
|
+ if (matrix_box) {
|
|
|
+ matrix_box.style.left = 0 + "px";
|
|
|
+ matrix_box.style.top = 0 + "px";
|
|
|
+ }
|
|
|
},
|
|
|
swipe(el: any, options: any) {
|
|
|
//设置开关,监听move事件
|
|
@@ -500,7 +496,7 @@ export default defineComponent({
|
|
|
*/
|
|
|
checkSpace(area: any) {
|
|
|
proxyData.isSetSearchSpace = false;
|
|
|
- if (area.canClick) {
|
|
|
+ if (area && area.canClick) {
|
|
|
proxyData.setSelectSpacePosition(area);
|
|
|
if (proxyData.isSetSpace) {
|
|
|
// 记录当前选中的id
|
|
@@ -594,7 +590,8 @@ export default defineComponent({
|
|
|
// item.canClick = !item.canClick
|
|
|
proxyData.setSpaceIcon(item);
|
|
|
}
|
|
|
-
|
|
|
+ console.log(" proxyData.mapData proxyData.mapData");
|
|
|
+ console.log(proxyData.mapData);
|
|
|
// 备份数据
|
|
|
proxyData.copyMapDaata = JSON.parse(JSON.stringify(data));
|
|
|
}
|
|
@@ -986,12 +983,13 @@ export default defineComponent({
|
|
|
getMapInfo(flag: boolean = true, searchItem: any = null) {
|
|
|
let params: any = {
|
|
|
projectId: props.projectId,
|
|
|
- floorId:props.floorId
|
|
|
+ floorId: props.floorId,
|
|
|
// floorId: proxyData.floorItem.id,
|
|
|
};
|
|
|
getMapInfo(params)
|
|
|
.then((res) => {
|
|
|
let resData: any = res;
|
|
|
+ debugger;
|
|
|
if (resData.result === "success") {
|
|
|
proxyData.mapData = resData?.data ?? null;
|
|
|
// 切换数据的时候清楚默认样式
|
|
@@ -1018,6 +1016,7 @@ export default defineComponent({
|
|
|
if (!proxyData.isSetSpace) {
|
|
|
proxyData.checkSpace(proxyData.selectArea);
|
|
|
}
|
|
|
+ proxyData.selectArea = proxyData.mapData.spaceList[0];
|
|
|
// 设置当前空间的位置
|
|
|
proxyData.setSelectSpacePosition(proxyData.selectArea);
|
|
|
}
|