fix: v2.6 组合画布选中根因修复+右键菜单+3D 三场景
- 选中失效根因: Vue3 布尔 prop 缺省转换(editable 缺省→false)
withDefaults 默认 true 修复, 左键选中/右键选中/菜单动作全链路打通
- 右键菜单: 右键单元弹操作菜单(顺/逆旋转/镜像/底边对齐/删除)
动作 emit('ctx') 由父组件统一执行, document 级委托
- 3D 三场景: 室内(窗后墙+木地板)/室外(外墙+草地)/影棚(网格)
场景联动背景色, 真实浏览器截图验证三场景渲染
- 菜单动作行为级验证: 旋转后 1600x1800 宽高互换✓ 删除清空✓
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// 对比 canvas 与 ctx-menu 的 Vue 监听器挂载: node scripts/vei2.mjs <token>
|
||||
import puppeteer from 'puppeteer-core'
|
||||
const EDGE = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
|
||||
const token = process.argv[2]
|
||||
const browser = await puppeteer.launch({
|
||||
executablePath: EDGE,
|
||||
headless: 'new',
|
||||
args: ['--window-size=1440,900', '--enable-unsafe-swiftshader', '--use-gl=angle', '--use-angle=swiftshader'],
|
||||
defaultViewport: { width: 1440, height: 900 },
|
||||
})
|
||||
const page = await browser.newPage()
|
||||
await page.goto(`http://localhost:8000/combine?token=${encodeURIComponent(token)}`, { waitUntil: 'networkidle2' })
|
||||
await page.waitForSelector('.lib-item')
|
||||
await page.click('.lib-item')
|
||||
await new Promise(r => setTimeout(r, 500))
|
||||
const box = await (await page.$('.canvas-box')).boundingBox()
|
||||
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2, { button: 'right' })
|
||||
await new Promise(r => setTimeout(r, 300))
|
||||
const res = await page.evaluate(() => {
|
||||
const cv = document.querySelector('.canvas-box canvas')
|
||||
const item = document.querySelector('.ctx-item')
|
||||
const menu = document.querySelector('.ctx-menu')
|
||||
const out = {
|
||||
canvasVei: cv && cv._vei ? Object.keys(cv._vei) : null,
|
||||
menuExists: !!menu,
|
||||
menuParentChain: [],
|
||||
itemTag: item ? item.tagName : null,
|
||||
}
|
||||
let e = item
|
||||
while (e && e.tagName !== 'BODY') {
|
||||
out.menuParentChain.push(e.tagName + (e.id ? '#' + e.id : '') + (e.className ? '.' + String(e.className).split(' ')[0] : ''))
|
||||
e = e.parentElement
|
||||
}
|
||||
return out
|
||||
})
|
||||
console.log(JSON.stringify(res, null, 1))
|
||||
await new Promise(r => setTimeout(r, 300))
|
||||
await browser.close()
|
||||
Reference in New Issue
Block a user