修复楼层多层切换状态同步
This commit is contained in:
@@ -126,15 +126,11 @@
|
|||||||
<text class="layer-mode-label">{{ layerModeActionLabel }}</text>
|
<text class="layer-mode-label">{{ layerModeActionLabel }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view
|
<view
|
||||||
v-if="showIndoorRightControls && showFloor"
|
v-if="showIndoorRightControls && showFloor"
|
||||||
class="floor-switcher"
|
class="floor-switcher"
|
||||||
:class="`side-${floorSide}`"
|
:class="`side-${floorSide}`"
|
||||||
:style="floorSwitcherStyle"
|
:style="floorSwitcherStyle"
|
||||||
scroll-y
|
|
||||||
:show-scrollbar="false"
|
|
||||||
:scroll-into-view="activeFloorScrollIntoView"
|
|
||||||
:scroll-with-animation="true"
|
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
v-if="showFloorHeader"
|
v-if="showFloorHeader"
|
||||||
@@ -143,15 +139,23 @@
|
|||||||
@tap.stop="handleFloorHeaderTap"
|
@tap.stop="handleFloorHeaderTap"
|
||||||
>
|
>
|
||||||
<text class="floor-header-icon">▱</text>
|
<text class="floor-header-icon">▱</text>
|
||||||
<text class="floor-header-label">楼层</text>
|
<text class="floor-header-label">{{ layerModeActionLabel }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<scroll-view
|
||||||
|
class="floor-list"
|
||||||
|
:style="floorListStyle"
|
||||||
|
scroll-y
|
||||||
|
:show-scrollbar="false"
|
||||||
|
:scroll-into-view="activeFloorScrollIntoView"
|
||||||
|
:scroll-with-animation="true"
|
||||||
|
>
|
||||||
<view
|
<view
|
||||||
v-for="floor in floorItems"
|
v-for="floor in floorItems"
|
||||||
:id="floor.scrollId"
|
:id="floor.scrollId"
|
||||||
:key="floor.id"
|
:key="floor.id"
|
||||||
class="floor-item"
|
class="floor-item"
|
||||||
:class="{
|
:class="{
|
||||||
active: activeFloorId === floor.id && layerMode !== 'multi',
|
active: activeFloorId === floor.id,
|
||||||
pending: loadingFloorId === floor.id,
|
pending: loadingFloorId === floor.id,
|
||||||
failed: failedFloorId === floor.id,
|
failed: failedFloorId === floor.id,
|
||||||
disabled: isFloorSwitchDisabled(floor.id)
|
disabled: isFloorSwitchDisabled(floor.id)
|
||||||
@@ -161,6 +165,7 @@
|
|||||||
<text class="floor-label">{{ floor.label }}</text>
|
<text class="floor-label">{{ floor.label }}</text>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view v-if="showZoomControls" class="zoom-controls" :style="zoomControlsStyle">
|
<view v-if="showZoomControls" class="zoom-controls" :style="zoomControlsStyle">
|
||||||
<view class="zoom-btn" @tap="handleZoomClick('in')">
|
<view class="zoom-btn" @tap="handleZoomClick('in')">
|
||||||
@@ -506,8 +511,13 @@ const searchFieldStyle = computed(() => ({
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
const floorSwitcherStyle = computed(() => ({
|
const floorSwitcherStyle = computed(() => ({
|
||||||
...(props.floorBottom ? { bottom: props.floorBottom } : { top: props.floorTop }),
|
...(props.floorBottom ? { bottom: props.floorBottom } : { top: props.floorTop })
|
||||||
...(props.floorMaxHeight ? { maxHeight: props.floorMaxHeight } : {})
|
}))
|
||||||
|
|
||||||
|
const floorListStyle = computed(() => ({
|
||||||
|
...(props.floorMaxHeight
|
||||||
|
? { maxHeight: props.showFloorHeader ? `calc(${props.floorMaxHeight} - 50px)` : props.floorMaxHeight }
|
||||||
|
: {})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const layerModeToggleStyle = computed(() => ({
|
const layerModeToggleStyle = computed(() => ({
|
||||||
@@ -682,7 +692,7 @@ const handleLayerModeToggle = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleFloorHeaderTap = () => {
|
const handleFloorHeaderTap = () => {
|
||||||
handleLayerModeChange('multi')
|
handleLayerModeChange(props.layerMode === 'multi' ? 'single' : 'multi')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleToolClick = (tool: string) => {
|
const handleToolClick = (tool: string) => {
|
||||||
@@ -1064,13 +1074,9 @@ defineExpose({
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
width: 46px;
|
width: 46px;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-height: calc(100vh - 260px);
|
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-y: auto;
|
overflow: hidden;
|
||||||
overscroll-behavior: contain;
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
touch-action: pan-y;
|
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
background: rgba(255, 255, 255, 0.84);
|
background: rgba(255, 255, 255, 0.84);
|
||||||
border: 1px solid #dde5df;
|
border: 1px solid #dde5df;
|
||||||
@@ -1083,6 +1089,19 @@ defineExpose({
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.floor-list {
|
||||||
|
max-height: calc(100vh - 310px);
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
touch-action: pan-y;
|
||||||
|
scrollbar-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floor-list::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.floor-switcher.side-right {
|
.floor-switcher.side-right {
|
||||||
right: 16px;
|
right: 16px;
|
||||||
}
|
}
|
||||||
@@ -1092,9 +1111,7 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
|
|
||||||
.floor-header {
|
.floor-header {
|
||||||
position: sticky;
|
position: relative;
|
||||||
top: 0;
|
|
||||||
z-index: 1;
|
|
||||||
min-height: 50px;
|
min-height: 50px;
|
||||||
padding: 7px 4px 6px;
|
padding: 7px 4px 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user