feat: v2.8 3D 预览放大模式+类型修正

- 组合页 3D 预览卡片: 放大按钮切换近全屏浮层(inset 2.5vh/2.5vw)
- 默认高度 300→380, 切换后派发 resize 让 3D 自适应
- drawing.ts 滑扇附着 reduce 种子类型修正(移除未定义 BBox 引用)
- vue-tsc 零错误, 构建通过
This commit is contained in:
HHY
2026-09-23 02:48:21 -07:00
parent 96159d4f35
commit d6e70fc571
3 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ export function inferSashGlyphs(shape: FrameShape, replayed?: Segment[][]): {
// 推拉双扇: 附着较高的区域(推拉窗滑扇在上半部, 对齐 31729 实况)
const kind = sub.type === 'DoubleSash' ? 'sliding' : 'casement'
if (kind === 'sliding') {
rb = regionBBs.reduce((p, c) => (!p || (c.y0 + c.y1) / 2 > (p.y0 + p.y1) / 2 ? c : p), null as BBox | null)
rb = regionBBs.reduce((p, c) => (!p || (c.y0 + c.y1) / 2 > (p.y0 + p.y1) / 2 ? c : p), regionBBs[0] ?? null)
}
if (rb) {
if (entries.length === 2) {
+18 -2
View File
@@ -78,7 +78,15 @@
</div>
</transition-group>
</el-card>
<el-card header="3D 预览" style="margin-top:16px">
<el-card header="3D 预览" style="margin-top:16px" :class="{ 'preview-large': previewLarge }">
<template #header>
<div class="head-row">
<span>3D 预览</span>
<el-button size="small" text type="primary" @click="togglePreviewLarge">
<el-icon><FullScreen /></el-icon>{{ previewLarge ? '还原' : '放大' }}
</el-button>
</div>
</template>
<div class="threed-box">
<WindoorThreed v-if="shapes.length" :drawing-data="combinedJson" />
<el-empty v-else description="—" :image-size="50" />
@@ -111,6 +119,12 @@ const selectedUid = ref<number | null>(null)
const saveName = ref('')
const saving = ref(false)
const equalHeight = ref(true)
const previewLarge = ref(false)
function togglePreviewLarge() {
previewLarge.value = !previewLarge.value
setTimeout(() => window.dispatchEvent(new Event('resize')), 60)
}
const canvasRef = ref()
let uidSeq = 1
const rev = ref(0)
@@ -343,7 +357,9 @@ onBeforeUnmount(() => window.removeEventListener('keydown', onKeydown))
.unit-info { flex: 1; min-width: 0; }
.unit-name { font-size: 13px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-size { font-size: 11px; color: #909399; }
.threed-box { height: 300px; }
.threed-box { height: 380px; }
.preview-large { position: fixed; inset: 2.5vh 2.5vw; z-index: 2001; margin: 0 !important; }
.preview-large .threed-box { height: calc(100% - 40px); }
.list-enter-active, .list-leave-active { transition: all .2s; }
.list-enter-from, .list-leave-to { opacity: 0; transform: translateX(12px); }
</style>