fix: v2.2 前端完整性治理(vue-tsc 全量清零)

- 组合画布 3D 扇面板解构键名错误(rect/s→rect/sash)——3D 混乱根因之一
- WindoorCanvas isDoor 标注 cx 作用域泄漏修复
- WindoorThreed rebuild 函数定义补全(墙体开关可用)
- 量尺页 openCreate 补定义(点击不再报错)
- 状态筛选 ref 类型纳入空串语义(4 页面)
- CombineCanvas 孤儿 @drop 移除+容器 dragover.prevent(拖放入库修复)
- AIRenderCanvas style 属性名保留处理+表单联合类型
- 零散隐式 any 参数补类型
- 新增 check-frontend.cjs: 未定义引用扫描+API 路径一致性比对
- 全量回归: 18 GET+4 POST+7 SPA 全部通过
This commit is contained in:
HHY
2026-09-21 04:27:16 -07:00
parent 5eb93f043e
commit cf8c0c65ce
15 changed files with 247 additions and 19 deletions
+20 -4
View File
@@ -34,7 +34,7 @@
<!-- 开合控制 -->
<div class="ctrl" v-if="hasOpenable">
<span>开合</span>
<el-slider v-model="openPct" style="width: 150px" :min="0" :max="100" :format-tooltip="v => v + '%'" />
<el-slider v-model="openPct" style="width: 150px" :min="0" :max="100" :format-tooltip="(v: number) => v + '%'" />
<el-checkbox v-model="autoPlay" size="small">自动演示</el-checkbox>
<el-button size="small" text @click="openPct = openPct > 0 ? 0 : 100">{{ openPct > 0 ? '全关' : '全开' }}</el-button>
</div>
@@ -110,6 +110,12 @@ function overlapArea(a: BBox, b: BBox): number {
return w > 0 && h > 0 ? w * h : 0
}
/** 型材面宽(世界单位) */
function fwOf(shape: any, S: number): number {
const ew = shape.fm?.ew ?? [60, 60, 60, 60]
return Math.max(0.018, (ew.reduce((a: number, b: number) => a + b, 0) / ew.length) * S)
}
/** 型材截面: 多腔体 + 玻璃槽(比例依据真实 DXF 截面学习: 深度46-90/面宽65-130/腔体3-6/壁厚≈深度1/30) */
function barX(parent: THREE.Group, mat: THREE.Material, len: number, fw: number,
depth: number, cx: number, cy: number, cz: number, chambers = 2) {
@@ -166,6 +172,16 @@ function applyView() {
orbit.phi = p.phi
}
/** 重建场景(墙体开关等触发) */
function rebuild() {
try {
if (props.drawingData) build(parseDrawing(props.drawingData))
} catch (e) {
console.error('[WindoorThreed] rebuild 失败:', e)
info.value = '解析失败: ' + (e as Error).message
}
}
function build(drawing: DrawingData) {
dispose()
scene = new THREE.Scene()
@@ -227,7 +243,7 @@ function build(drawing: DrawingData) {
transparent: true, opacity: 0.4, roughness: 0.06, metalness: 0.1, side: THREE.DoubleSide,
})
: glassMat
const fw = Math.max(0.018, fwOf(shape))
const fw = Math.max(0.018, fwOf(shape, S))
const regionBBs: BBox[] = regions.map(r => bboxOf(regionPoints(r)))
const used = new Set<number>()
@@ -261,7 +277,7 @@ function build(drawing: DrawingData) {
})
// 扇面板(可开合)
panels.forEach(({ rect, s }, k) => {
panels.forEach(({ rect, sash: s }, k) => {
const w = (rect.x1 - rect.x0) * S, h = (rect.y1 - rect.y0) * S
const cxr = ((rect.x0 + rect.x1) / 2 - cx) * S
const cyr = ((rect.y0 + rect.y1) / 2 - cy) * S
@@ -314,7 +330,7 @@ function build(drawing: DrawingData) {
const hh = gh * S / 2 + 0.05 // 窗洞半高
const side = 0.55 // 上下墙高度/左右墙宽度
const wt = DEPTH * 3
const wallBoxes: [number, number, number, number, number][] = [
const wallBoxes: number[][] = [
[-hw - side, hh, side * 2 + hw * 2, side], // 上
[-hw - side, -hh - side, side * 2 + hw * 2, side], // 下
[-hw - side, -hh, side, hh * 2], // 左