Files
akmon/doc_zhipao/fix_display_grid.ps1
2026-01-20 08:04:15 +08:00

52 lines
2.2 KiB
PowerShell
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Fix display: grid compatibility for UTS Android
# UTS Android only supports display: flex and display: none
$files = @(
"h:\blews\akmon\pages\sport\teacher\analytics.uvue",
"h:\blews\akmon\pages\sport\teacher\records.uvue",
"h:\blews\akmon\pages\sport\teacher\project-create.uvue",
"h:\blews\akmon\pages\sport\student\record-detail.uvue",
"h:\blews\akmon\pages\eldercare\incident\report.uvue",
"h:\blews\akmon\pages\eldercare\finance\management.uvue",
"h:\blews\akmon\pages\eldercare\family\dashboard.uvue",
"h:\blews\akmon\pages\eldercare\nurse\dashboard.uvue",
"h:\blews\akmon\pages\eldercare\equipment\management.uvue",
"h:\blews\akmon\pages\eldercare\analytics\dashboard.uvue"
)
$totalFixed = 0
foreach ($file in $files) {
if (Test-Path $file) {
Write-Host "Processing: $file" -ForegroundColor Yellow
# Read file content
$content = Get-Content $file -Raw -Encoding UTF8
$originalContent = $content
# Replace display: grid with display: flex + flex-wrap
$content = $content -replace 'display:\s*grid;', 'display: flex; flex-wrap: wrap;'
$content = $content -replace 'display:\s*grid\s*;', 'display: flex; flex-wrap: wrap;'
# Count replacements
$gridMatches = [regex]::Matches($originalContent, 'display:\s*grid\s*;')
$fixedCount = $gridMatches.Count
if ($fixedCount -gt 0) {
# Write the modified content back
Set-Content $file $content -Encoding UTF8
Write-Host " ✅ Fixed $fixedCount display: grid instances" -ForegroundColor Green
$totalFixed += $fixedCount
} else {
Write-Host " No display: grid found" -ForegroundColor Gray
}
} else {
Write-Host " ❌ File not found: $file" -ForegroundColor Red
}
}
Write-Host "`n📊 Summary:" -ForegroundColor Cyan
Write-Host "Total files processed: $($files.Count)" -ForegroundColor White
Write-Host "Total display: grid instances fixed: $totalFixed" -ForegroundColor Green
Write-Host "`n✅ All display: grid properties have been converted to flex layout!" -ForegroundColor Green