64 lines
1.8 KiB
PowerShell
64 lines
1.8 KiB
PowerShell
# Admin Pages Refactoring Helper Script
|
|
# 用于快速识别需要修改的文件模式
|
|
|
|
$adminPath = "d:\骅锋\mall\pages\mall\admin"
|
|
|
|
# 获取所有 .uvue 文件
|
|
$files = Get-ChildItem -Path $adminPath -Recurse -Filter "*.uvue" | Select-Object FullName, Name
|
|
|
|
# 统计不同的文件类型/模式
|
|
$patterns = @{}
|
|
|
|
foreach ($file in $files) {
|
|
$content = Get-Content $file.FullName -Raw
|
|
|
|
# 检测模式
|
|
if ($content -match '\.Page\s*\{') {
|
|
$patterns["PascalCase_Classes"] += 1
|
|
}
|
|
if ($content -match '#ffffff') {
|
|
$patterns["Hardcoded_Colors"] += 1
|
|
}
|
|
if ($content -match 'background:\s*#') {
|
|
$patterns["Hardcoded_BG"] += 1
|
|
}
|
|
if ($content -match 'lang="scss"') {
|
|
$patterns["Has_SCSS_Lang"] += 1
|
|
}
|
|
if ($content -match 'color:\s*#999') {
|
|
$patterns["Gray_Color"] += 1
|
|
}
|
|
}
|
|
|
|
Write-Host "Pattern Analysis Results:"
|
|
$patterns | ForEach-Object {
|
|
Write-Host "$($_.Name): $($_.Value)"
|
|
}
|
|
|
|
# 分组输出需要修改的文件
|
|
Write-Host "`nFiles by Category:`n"
|
|
|
|
# P0 Priority (已完成)
|
|
$p0Files = @(
|
|
"user-management.uvue",
|
|
"product-management.uvue",
|
|
"order-management.uvue",
|
|
"system-settings.uvue",
|
|
"marketing-management.uvue"
|
|
)
|
|
|
|
# P1 Priority (maintain 文件夹)
|
|
Write-Host "P1 Files (maintain/):"
|
|
Get-ChildItem -Path "$adminPath\maintain" -Recurse -Filter "*.uvue" |
|
|
Where-Object { $_.Name -ne "system-info.uvue" } |
|
|
ForEach-Object { Write-Host " - $($_.FullName -replace [regex]::Escape($adminPath), '')" }
|
|
|
|
# 其他需要修改的文件
|
|
Write-Host "`nOther files (P2+):"
|
|
Get-ChildItem -Path $adminPath -Recurse -Filter "*.uvue" |
|
|
Where-Object {
|
|
$_.FullName -notmatch "maintain" -and
|
|
$p0Files -notcontains $_.Name
|
|
} |
|
|
ForEach-Object { Write-Host " - $($_.FullName -replace [regex]::Escape($adminPath), '')" }
|