fix(admin-vue 查询ASIN): 列表筛选/分页参数对齐后端 snake_case,导出 XLSX 带上当前筛选

- query-asin-filter: toQueryAsinQuery 输出 page_size/group_id/shop_name(35bed42b 后端已改显式 snake,
  camel 参数被静默忽略导致分组/店铺名筛选无作用、pageSize 固定回落 15)
- 新增 query-asin-export: 按当前筛选构建导出 URL,页面「导出 XLSX」不再恒为全量
- query-asin-import-api: 导入兜底分组 groupId→group_id(后端 importExcel 已改名,此前同样被丢弃)
- query-asin-delete-import-api: 保持 groupId 并加注释(后端仍隐式 camel,统一需两端同步部署)
- task-71 测试断言更新为 snake 契约(含 camel 不下发反断言)+ 新增导出 URL 用例

已上线 admin-vue-20260910-145200,线上 chunk 验证含 snake 参数;task-71 10/10 通过,vue-tsc 通过
This commit is contained in:
2026-09-10 14:53:57 +08:00
parent b9768aac5e
commit 5af4e1c23e
6 changed files with 66 additions and 20 deletions
@@ -8,12 +8,13 @@ import {
export const QUERY_ASIN_IMPORT_ENDPOINT = '/api/admin/query-asins/import'
/** 启动导入添加;groupId 为 Excel 未提供分组时的兜底,可选(>=1 才下发)。 */
/** 启动导入添加;groupId 为 Excel 未提供分组时的兜底,可选(>=1 才下发)。
* 参数名必须用 group_idJava importExcel @RequestParam(name="group_id"),发 groupId 会被丢弃致兜底分组失效。 */
export async function startQueryAsinImport(file: File, groupId?: number): Promise<string> {
const form = new FormData()
form.append('file', file, file.name)
if (typeof groupId === 'number' && Number.isFinite(groupId) && groupId >= 1) {
form.append('groupId', String(Math.floor(groupId)))
form.append('group_id', String(Math.floor(groupId)))
}
const { data } = await http.post<unknown>(QUERY_ASIN_IMPORT_ENDPOINT, form)
return parseQueryAsinImportStart(data)