898e8a5ea9
- BatchDeleteActions margin-left:auto 右对齐、不再独占一行,14 页迁入各自筛选/工具行(Users/Groups/Menus/UserSecrets/QueryAsin/AsinInvalid/SkipPrice/DedupeRegistry/ProductCategory/DeviceLogs/DigitalHuman/ShopManage/ShopKeys/BrandGating);主按钮沿用全局 34px 同高,align-batch-toolbar-inline.test.ts 钉形状防回归
- 公司删除:DELETE /api/admin/companies/{id}(仅超管,名下有账号拒并带数量),只收公司行+columns 菜单树(PermissionMenuService.deleteTreeByCompany 与 copyTreeFromTemplate 对称),业务数据不级联;列表 VO 带 user_count 供前端置灰勾选/删除按钮;批量删除按用户管理同形走前端逐条循环
- CompaniesPage 加勾选列+行删除按钮(ops-cell 补 flex-wrap 过 ops-cell-must-wrap),删除后 refreshCompanyDirectory 同步 tab 条
- 测试:CompanyServiceDeleteTest 6+PermissionMenuServiceDeleteTreeTest 2+CompanyVoTest user_count 契约+CompanyControllerEndpointTest 翻转 exposesNoDeleteEndpoint→点名 DELETE 端点+CompanyReadPathMenuGateTest ensureSuperAdmin 3→4(delete 入册)+company-directory/row-buttons 补例;source-pin 基线重生成(265 文件/1859 例)
- 验证:admin-vue vue-tsc rc=0、node --test 1976 全绿、vitest mount 247 全绿;backend test-compile rc=0、Company*/PermissionMenu*/跨切守卫点名全绿(CatchSilenceRatchet 红因=另一路在飞件 JdPublishFillAiService 3 个 catch,归属京东窗不代抬)
39 lines
3.5 KiB
TypeScript
39 lines
3.5 KiB
TypeScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { readSource } from './helpers.ts'
|
|
|
|
/**
|
|
* 2026-11-23 用户口径「批量删除放上去,最大化利用空间」:BatchDeleteActions 不再独占一行,
|
|
* 由各页并入筛选/工具行(组件 margin-left:auto 右对齐)。本钉防回归——有人把它挪回
|
|
* 「LoadFailureBar 之后独占一行」的旧形状即红。
|
|
*
|
|
* 正向锚点 = 该页筛选行里紧挨着它的前一个控件;负向 = 旧形状「LoadFailureBar 后跟独立批量行」。
|
|
*/
|
|
const MOVED_PAGES: Array<{ file: string; rowMate: RegExp; note: string }> = [
|
|
{ file: 'src/pages/account/UsersPage.vue', rowMate: /@click="search">查询<\/button>[\s\S]{0,300}?<BatchDeleteActions/, note: '查询按钮右侧' },
|
|
{ file: 'src/pages/account/GroupsPage.vue', rowMate: /placeholder="输入组长用户名" \/>\s*<\/div>\s*<BatchDeleteActions/, note: '组长输入框右侧' },
|
|
{ file: 'src/pages/account/MenusPage.vue', rowMate: /value="app" \/>\s*<\/el-select>\s*<\/div>\s*<BatchDeleteActions/, note: '菜单类型下拉右侧' },
|
|
{ file: 'src/pages/account/UserSecretsPage.vue', rowMate: /<\/button>\s*<\/div>\s*<\/div>\s*<BatchDeleteActions/, note: '刷新余额那组按钮右侧' },
|
|
{ file: 'src/pages/asin/QueryAsinPage.vue', rowMate: /导出 XLSX<\/button>\s*<BatchDeleteActions/, note: '导出按钮右侧' },
|
|
{ file: 'src/pages/asin/AsinInvalidPage.vue', rowMate: /@click="apply">查询<\/button>\s*<BatchDeleteActions/, note: '查询按钮右侧' },
|
|
{ file: 'src/pages/asin/SkipPricePage.vue', rowMate: /导出 XLSX<\/button>\s*<BatchDeleteActions/, note: '导出按钮右侧' },
|
|
{ file: 'src/pages/asin/DedupeRegistryPage.vue', rowMate: /@click="apply">查询<\/button>\s*<\/div>\s*<BatchDeleteActions/, note: '查询按钮组右侧' },
|
|
{ file: 'src/pages/asin/ProductCategoryPage.vue', rowMate: /@click="openCreate\(null\)">新增类目<\/button>\s*<BatchDeleteActions/, note: '新增类目按钮右侧' },
|
|
{ file: 'src/pages/records/DeviceLogsPage.vue', rowMate: /<\/button>\s*<\/div>\s*<\/div>\s*<BatchDeleteActions/, note: '重置按钮组右侧' },
|
|
{ file: 'src/pages/records/RecordsDigitalHumanVersionPage.vue', rowMate: /@click="uploadVisible = true">上传新版本<\/button>\s*<BatchDeleteActions/, note: '上传按钮右侧' },
|
|
{ file: 'src/pages/shop/ShopManagePage.vue', rowMate: /@click="apply">查询<\/button>\s*<BatchDeleteActions/, note: '查询按钮右侧' },
|
|
{ file: 'src/pages/shop/ShopKeysPage.vue', rowMate: /@click="apply">查询<\/button>\s*<BatchDeleteActions/, note: '查询按钮右侧' },
|
|
{ file: 'src/pages/tasks/BrandGatingPanel.vue', rowMate: /@click="resetFilter">重置<\/button>\s*<BatchDeleteActions/, note: '重置按钮右侧' },
|
|
]
|
|
|
|
for (const { file, rowMate, note } of MOVED_PAGES) {
|
|
test(`align_batch_inline_${file.split('/').pop()}`, () => {
|
|
const s = readSource(file)
|
|
assert.doesNotMatch(s, /<LoadFailureBar[^>]*\/>\s*<BatchDeleteActions/, `旧形状(LoadFailureBar 后独占一行)不许回来`)
|
|
assert.match(s, rowMate, `批量删除应并入筛选/工具行(${note}),紧跟行内前一个控件`)
|
|
// 行内形状收口:组件是该行容器的最后一个孩子,紧跟该行的闭合 </div>
|
|
assert.match(s, /<BatchDeleteActions :batch="batch" \/>\s*\n\s*<\/div>/, '组件应紧跟行容器闭合,而不是自己占一行再接表格')
|
|
assert.equal((s.match(/<BatchDeleteActions/g) || []).length, 1, '每页只许一份批量删除入口')
|
|
})
|
|
}
|