|
@@ -30,6 +30,7 @@
|
|
|
<template v-if="showSpace">
|
|
|
<div
|
|
|
class="space-box"
|
|
|
+ :id="'space' + index"
|
|
|
v-for="(item, index) in spaceData"
|
|
|
:key="'space' + index"
|
|
|
>
|
|
@@ -298,7 +299,7 @@ export default defineComponent({
|
|
|
getDefaultLocation() {
|
|
|
let params: any = {
|
|
|
macAddress: proxyData.userInfo.mac,
|
|
|
- "spaceId":proxyData.spaceId
|
|
|
+ spaceId: proxyData.spaceId,
|
|
|
// projectId: store.state.user.projectId,
|
|
|
};
|
|
|
let paramsStr: any = setQueryConfig(params);
|
|
@@ -457,10 +458,29 @@ export default defineComponent({
|
|
|
} else {
|
|
|
proxyData.showSpace = false;
|
|
|
}
|
|
|
+ // 设置页面默认的位置
|
|
|
+ nextTick(() => {
|
|
|
+ proxyData.setPageScroolTop();
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
// 设置当前页面选中的位置
|
|
|
- setPageScroolTop() {},
|
|
|
+ setPageScroolTop() {
|
|
|
+ let idIndex: any = 0;
|
|
|
+ // debugger;
|
|
|
+ for (let i = 0; i < proxyData.spaceData.length; i++) {
|
|
|
+ if (proxyData.spaceData[i].checked) {
|
|
|
+ idIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let spaceEl: any = document.querySelector("#" + "space" + idIndex);
|
|
|
+ let spaceContetEl: any = document.querySelector(".choice-space");
|
|
|
+ let top: any = spaceEl ? spaceEl.offsetTop : 0;
|
|
|
+ if (spaceContetEl) {
|
|
|
+ spaceContetEl.scrollTop = top;
|
|
|
+ }
|
|
|
+ },
|
|
|
searchSpace() {
|
|
|
let query: any = {
|
|
|
floorId: proxyData.checkPositon.floorId,
|
|
@@ -492,6 +512,9 @@ export default defineComponent({
|
|
|
<style lang="scss" scoped>
|
|
|
@import "~@/styles/comMedia.scss";
|
|
|
.choice-space {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: scroll;
|
|
|
.search {
|
|
|
position: fixed;
|
|
|
width: 100%;
|
|
@@ -573,13 +596,15 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
.space-content {
|
|
|
- // display: flex;
|
|
|
+ display: block;
|
|
|
width: 100%;
|
|
|
+ height: 100%;
|
|
|
padding-top: $headerHeightPading;
|
|
|
padding-right: 20px;
|
|
|
padding-left: 4px;
|
|
|
padding-bottom: 70px;
|
|
|
// justify-content: space-between;
|
|
|
+ // overflow: scroll;
|
|
|
.space-box {
|
|
|
// display: i;
|
|
|
display: inline-block;
|