Files
crawler-plugin/admin-frontend-vue/src/components/BatchDeleteActions.vue
T
huangzd1997 898e8a5ea9 feat(admin): 批量删除并入筛选行省一整行+公司管理加删除/批量删除(2026-11-23 用户口径)
- 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,归属京东窗不代抬)
2026-11-23 01:41:37 +08:00

53 lines
2.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
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.
<script setup lang="ts">
defineProps<{
batch: {
verb: string
count: number
disabled: boolean
progress: string
result: { failures: ReadonlyArray<{ id: number | string; label: string; reason: string }> } | null
submit: () => Promise<void>
clearSelection: () => void
}
}>()
</script>
<template>
<div class="batch-delete-actions">
<button class="btn btn-danger batch-delete-button" type="button" :disabled="batch.disabled || !batch.count" @click="batch.submit">
{{ batch.progress ? `正在${batch.verb} ${batch.progress}` : `批量${batch.verb}(${batch.count})` }}
</button>
<button v-if="batch.count" class="btn btn-sm batch-clear-button" type="button" :disabled="batch.disabled" @click="batch.clearSelection">清除勾选</button>
<details v-if="batch.result?.failures.length" class="batch-delete-failures">
<summary>查看失败原因({{ batch.result.failures.length }} 条)</summary>
<ul>
<li v-for="failure in batch.result.failures" :key="failure.id">{{ failure.label }}:{{ failure.reason }}</li>
</ul>
</details>
</div>
</template>
<style scoped>
/* 2026-11-23 用户口径「批量删除放上去,最大化利用空间」:不再独占一行,由各页放进筛选/工具行,
margin-left:auto 在 flex 行内右对齐(落点=查询按钮右侧留白)。 */
.batch-delete-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.batch-delete-actions button {
min-height: 34px;
padding: 5px 12px;
border: 1px solid var(--admin-border);
border-radius: 9px;
background: #fff;
color: var(--admin-text);
font: inherit;
cursor: pointer;
}
/* 主按钮沿用 34px:全局 main.css 已把 panel 内 .btn(查询)压到 34px,同高才不会一高一矮。 */
.batch-delete-actions .batch-delete-button { color: #fff; background: #b35f6a; border-color: #b35f6a; }
.batch-delete-button:hover:not(:disabled) { background: #a34f5b; }
.batch-clear-button:hover:not(:disabled) { background: #edf5fb; }
.batch-delete-actions button:focus-visible { outline: 2px solid var(--admin-primary); outline-offset: 2px; }
.batch-delete-actions button:disabled { cursor: not-allowed; opacity: 0.55; }
.batch-delete-failures { max-width: 520px; color: #9f3845; overflow-wrap: anywhere; }
.batch-delete-failures ul { max-height: 180px; overflow: auto; margin: 4px 0; padding-left: 20px; }
</style>