| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // 票 15 实施(四):模式钮激活渐变、品牌标题渐变、状态点等遗留字面量 → 设计稿色板内值
- // 全部取自全稿色板(#01abea/#009de9/#0094d0/#33b3ed/#00b8ff/#b9e8ff/#c7f5ff/#27d17a/#c1d5ff)。
- import { readFileSync, writeFileSync } from 'node:fs'
- const edits = [
- // 一级模式按钮:active 渐变(旧 #2a8fd0/#1467a8/#0b4b83 → 设计蓝族)
- ['src/modules/cockpit/CockpitShell.vue', [
- ['linear-gradient(180deg, #2a8fd0 0%, #1467a8 55%, #0b4b83 100%)',
- 'linear-gradient(180deg, #01abea 0%, #009de9 55%, #0094d0 100%)'],
- ['rgba(34, 108, 168, 0.7)', 'rgba(1, 171, 234, 0.7)'],
- ['background: #cdf3ff;\n box-shadow: 0 0 10px #7fe0ff, 0 0 20px #4fd8ff;',
- 'background: #b9e8ff;\n box-shadow: 0 0 10px #00b8ff, 0 0 20px #01abea;'],
- // 品牌标题渐变(设计 title 渐变 #ffffff→#c7f5ff,尾停取色板 #33b3ed)
- ['linear-gradient(180deg, #ffffff 8%, #bfeaff 52%, #4fb6e8 100%)',
- 'linear-gradient(180deg, #ffffff 8%, #c7f5ff 52%, #33b3ed 100%)'],
- // 状态点 ok 绿(→ --lv4 同族)
- ['#35d6a4', '#27d17a'],
- ]],
- // 事件卡/工单时间线:语义底上的可读浅色文字(家族色相随语义色微调)
- ['src/modules/cockpit/components/EventDetailCard.vue', [['#8fe9c4', '#b8f2d4'], ['#ffb3bb', '#ffc2c9']]],
- ['src/modules/cockpit/components/WorkOrderTimeline.vue', [['#ffd9de', '#ffc2c9']]],
- ['src/modules/cockpit/services/mapService.js', [['#ffb3bb', '#ffc2c9']]],
- ]
- let total = 0
- for (const [file, pairs] of edits) {
- const src = readFileSync(file, 'utf8')
- let out = src
- let count = 0
- for (const [from, to] of pairs) {
- if (!out.includes(from)) {
- console.log(`MISS ${file}: ${from.slice(0, 60)}`)
- continue
- }
- out = out.split(from).join(to)
- count += 1
- }
- if (count) {
- writeFileSync(file, out)
- total += count
- console.log(`${file}: ${count}`)
- }
- }
- console.log(`\n合计 ${total} 处`)
|