feat(admin): 为支持单删的管理列表补齐批量删除

This commit is contained in:
2026-11-20 12:08:28 +08:00
parent 132c19d51f
commit 51c41b238a
43 changed files with 2806 additions and 1948 deletions
+6 -2
View File
@@ -15,8 +15,12 @@ const INDEX_CANDIDATES = ['/index.ts', '/index.tsx', '/index.vue', '/index.js']
* (内容逐字节等价,主树 LF 3565 B / 新检出 CRLF 3629 B)在干净检出树上会多红一条与本任务无关的用例。
* 归一之后判据只取决于内容,不取决于在哪台机器、哪个 worktree 里跑。
*/
export function readSource(rel: string): string {
return readFileSync(join(ROOT, rel), 'utf8').replace(/\r\n/g, '\n')
export function readSource(rel: string, includeVueStyles = false): string {
const source = readFileSync(join(ROOT, rel), 'utf8').replace(/\r\n/g, '\n')
if (!includeVueStyles) return source
const styles = [...source.matchAll(/<style\b[^>]*\bsrc="(\.\/[^"\n]+\.css)"[^>]*>/g)]
.map(([, path]) => readSource(join(dirname(rel), path)))
return [source, ...styles].join('\n')
}
/** 统计非重叠子串出现次数(幂等、只读)。 */