// 探查品牌位与图层功能图标是否为可重建矢量 import { readFileSync, readdirSync } from 'node:fs' import { join } from 'node:path' const raw = '.scratch/lanhu-cockpit-asset-replacement/research/raw' const files = readdirSync(raw).filter((f) => /^desktop-\d+\.json$/.test(f)).sort() const targets = ['管线图层', '监测设备', '事件定位', '应急资源', '城市生命线驾驶舱系统'] for (const file of files) { const j = JSON.parse(readFileSync(join(raw, file), 'utf8')) const ab = j.artboard const hits = [] function walk(node, path) { const p = path ? `${path}/${node.name}` : node.name const isText = node.type === 'textLayer' && node.text?.style?.content const label = isText ? String(node.text.style.content) : node.name if (targets.some((t) => label && label.includes(t))) { hits.push({ label, path: p, type: node.type, frame: `${Math.round(node.frame?.width ?? 0)}x${Math.round(node.frame?.height ?? 0)}`, paths: (node.paths || []).length, fills: (node.style?.fills || []).map((f) => f.type).join('+'), }) } for (const ch of node.layers || []) walk(ch, p) } for (const l of ab.layers || []) walk(l, '') if (hits.length) { console.log(`\n=== ${ab.name}`) for (const h of hits) console.log(` ${h.label} | ${h.type} | ${h.frame} | paths=${h.paths} | fills=${h.fills} | ${h.path}`) } }