#!/usr/bin/env node /** * D19: family-dashboard.vue 家庭情绪看板清理 (debt 66) * script 五维色板/canvas/吉凶色板全收编 BrandColors;template 内联色绑定 data * style #FFF5F7 收编局部变量 */ const fs = require('fs'); const F = 'pages/mind-detail/family-dashboard.vue'; let src = fs.readFileSync(F, 'utf8'); let replaced = 0; function repl(from, to) { const cnt = src.split(from).length - 1; if (cnt === 0) { console.warn('NOT FOUND:', from.slice(0, 90)); return; } src = src.split(from).join(to); replaced += cnt; } // ---- 1. template 内联色 ---- repl(":style=\"{ backgroundColor: '#FFA500' }\"", ":style=\"{ backgroundColor: dataIconColor }\""); // ---- 2. import + data ---- if (!src.includes('utils/brand-colors.js')) { const head = src.match(/