feat(appearance-patent): 外观专利数据库筛选面精简为 分组/国家/同步起止(2026-11-11 客户拍板「筛选条件和获取店铺一样」「按账号对应的主管吧 不需要店铺」)——任务号/ASIN 输入框下架,分组(主管=组长)提到国家前对齐获取店铺页字段顺序;主管维度沿用今晨已上线的分组整集下推(选组长=按「组长本人+名下子账户」过滤,卡片显示所属主管);后端 §3.2 参数契约与前端过滤模块逐字对撞护栏原样保留(UI 不再暴露 task_id/asin),company-tab watch 清栏 token 不动(wiring 护栏照旧);挂载测试四用例适配新筛选面(11/11 绿)
This commit is contained in:
@@ -2,11 +2,14 @@
|
|||||||
import { formatDateTime, orderedPair } from '@/utils/datetime'
|
import { formatDateTime, orderedPair } from '@/utils/datetime'
|
||||||
/** 外观专利无侵权数据 · 只读分页列表(v1.3)。展示形式 2026-11-11 客户改版:参照「店铺数据记录」页
|
/** 外观专利无侵权数据 · 只读分页列表(v1.3)。展示形式 2026-11-11 客户改版:参照「店铺数据记录」页
|
||||||
* (ShopDataTasksPage)——form-box 筛选条件 + panel-box 工具条[导出] + 卡片宫格(4/3/2/1 响应式)
|
* (ShopDataTasksPage)——form-box 筛选条件 + panel-box 工具条[导出] + 卡片宫格(4/3/2/1 响应式)
|
||||||
* + OldPagination 服务端分页,推翻 2026-11-10「参照去重库页自绘 table」的旧拍板;取数/过滤面/
|
* + OldPagination 服务端分页,推翻 2026-11-10「参照去重库页自绘 table」的旧拍板。
|
||||||
* 导出/公司 tab 契约一字未动(company-tab-wiring 与 date-filter 护栏照旧)。数据由出表成功点
|
* 筛选面同日二次精简(客户「筛选条件只要…和获取店铺一样」「按账号对应的主管吧 不需要店铺」):
|
||||||
|
* 只留 分组(下拉,主管=组长,选中按「组长本人+名下子账户」整集 SQL 下推过滤)/国家/同步起止
|
||||||
|
* 时间,字段顺序对齐获取店铺页(分组→国家→时间);任务号/ASIN 输入框下架——后端 §3.2 参数契约
|
||||||
|
* (task_id/asin)与前端过滤模块逐字对撞护栏原样保留,只是 UI 不再暴露。数据由出表成功点
|
||||||
* 自动同步(后端 SyncService),本页零写操作:无编辑/导入;单条明细没有可下载文件,下载/导出
|
* 自动同步(后端 SyncService),本页零写操作:无编辑/导入;单条明细没有可下载文件,下载/导出
|
||||||
* 统一走既有 /export 全量出 xlsx(带当前过滤面 + 公司 tab,含所属主管列)。分组下拉(主管=组长)
|
* 统一走既有 /export 全量出 xlsx(带当前过滤面 + 公司 tab,含所属主管列)。分组下拉选项与去重页
|
||||||
* 选项与去重页共用 GET /shop-manages/groups,选中后以 group_id 走同一过滤面(列表与导出同源)。 */
|
* 共用 GET /shop-manages/groups,选中后以 group_id 走同一过滤面(列表与导出同源)。 */
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||||
import {
|
import {
|
||||||
exportAppearancePatentCleanList,
|
exportAppearancePatentCleanList,
|
||||||
@@ -165,12 +168,11 @@ onMounted(() => {
|
|||||||
<h4 class="clean-filter-title">筛选条件</h4>
|
<h4 class="clean-filter-title">筛选条件</h4>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group" style="min-width: 150px">
|
<div class="form-group" style="min-width: 150px">
|
||||||
<label>任务号</label>
|
<label>分组</label>
|
||||||
<input v-model="filter.taskId" type="text" placeholder="输入任务号" @keyup.enter="apply" />
|
<select v-model="filter.groupId">
|
||||||
</div>
|
<option value="">全部分组</option>
|
||||||
<div class="form-group" style="min-width: 150px">
|
<option v-for="group in groupOptions" :key="group.id" :value="String(group.id)">{{ group.name }}</option>
|
||||||
<label>ASIN</label>
|
</select>
|
||||||
<input v-model="filter.asin" type="text" placeholder="输入 ASIN" @keyup.enter="apply" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" style="min-width: 130px">
|
<div class="form-group" style="min-width: 130px">
|
||||||
<label>国家</label>
|
<label>国家</label>
|
||||||
@@ -179,13 +181,6 @@ onMounted(() => {
|
|||||||
<option v-for="code in ASIN_COUNTRY_CODES" :key="code" :value="code">{{ asinCountryLabel(code) }}</option>
|
<option v-for="code in ASIN_COUNTRY_CODES" :key="code" :value="code">{{ asinCountryLabel(code) }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" style="min-width: 130px">
|
|
||||||
<label>分组</label>
|
|
||||||
<select v-model="filter.groupId">
|
|
||||||
<option value="">全部分组</option>
|
|
||||||
<option v-for="group in groupOptions" :key="group.id" :value="String(group.id)">{{ group.name }}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-group" style="min-width: 150px">
|
<div class="form-group" style="min-width: 150px">
|
||||||
<label>同步开始日期</label>
|
<label>同步开始日期</label>
|
||||||
<input v-model="filter.startDate" type="date" :max="filter.endDate" @change="clampDatePair" />
|
<input v-model="filter.startDate" type="date" :max="filter.endDate" @change="clampDatePair" />
|
||||||
|
|||||||
@@ -4,9 +4,11 @@
|
|||||||
* 展示形式(2026-11-11 客户改版,推翻 2026-11-10「参照去重库页自绘 table、不做卡片宫格」的
|
* 展示形式(2026-11-11 客户改版,推翻 2026-11-10「参照去重库页自绘 table、不做卡片宫格」的
|
||||||
* 旧拍板):参照「店铺数据记录」页(ShopDataTasksPage)——form-box 筛选条件 + panel-box
|
* 旧拍板):参照「店铺数据记录」页(ShopDataTasksPage)——form-box 筛选条件 + panel-box
|
||||||
* 工具条[导出] + 卡片宫格(每卡一条明细:ASIN/任务号/结论徽章/所属主管/国家/品牌/SKU/价格/
|
* 工具条[导出] + 卡片宫格(每卡一条明细:ASIN/任务号/结论徽章/所属主管/国家/品牌/SKU/价格/
|
||||||
* 标题/同步时间)+ `OldPagination.vue` 服务端分页。取数/过滤面/导出/公司 tab 契约不变:
|
* 标题/同步时间)+ `OldPagination.vue` 服务端分页。筛选面同日二次精简(客户「按账号对应的
|
||||||
* `companyScoped: true` 公司 Tab;任务号/ASIN/国家/分组/起止时间筛选;`page`/`page_size`
|
* 主管吧 不需要店铺」):分组(=主管)/国家/起止时间三样,任务号/ASIN 输入框下架(后端
|
||||||
* snake 参数,响应 `{items, total, page, pageSize}`。默认仅 super_admin 可见(菜单不预授权,
|
* §3.2 参数契约与过滤模块逐字对撞护栏保留,UI 不再暴露)。取数/导出/公司 tab 契约不变:
|
||||||
|
* `companyScoped: true` 公司 Tab;`page`/`page_size` snake 参数,响应
|
||||||
|
* `{items, total, page, pageSize}`。默认仅 super_admin 可见(菜单不预授权,
|
||||||
* 判据在后端 AdminAppearancePatentCleanItemsControllerTest 的菜单迁移支,这里只管前端接线)。
|
* 判据在后端 AdminAppearancePatentCleanItemsControllerTest 的菜单迁移支,这里只管前端接线)。
|
||||||
*
|
*
|
||||||
* 跑法:`npx vitest run tests/mount/appearance-patent-clean-page.test.ts`
|
* 跑法:`npx vitest run tests/mount/appearance-patent-clean-page.test.ts`
|
||||||
@@ -151,8 +153,6 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const wrapper = await mountWith({ items: [row(1)], total: 1, page: 1, pageSize: 10 })
|
const wrapper = await mountWith({ items: [row(1)], total: 1, page: 1, pageSize: 10 })
|
||||||
const textInputs = wrapper.findAll('input[type="text"]')
|
|
||||||
await textInputs[0].setValue('33179')
|
|
||||||
const exportBtn = wrapper.findAll('button').find((b) => b.text() === '导出')
|
const exportBtn = wrapper.findAll('button').find((b) => b.text() === '导出')
|
||||||
expect(exportBtn).toBeTruthy()
|
expect(exportBtn).toBeTruthy()
|
||||||
await exportBtn!.trigger('click')
|
await exportBtn!.trigger('click')
|
||||||
@@ -162,7 +162,7 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
expect(cleanApi.exportAppearancePatentCleanList).toHaveBeenCalledTimes(1)
|
expect(cleanApi.exportAppearancePatentCleanList).toHaveBeenCalledTimes(1)
|
||||||
const call = cleanApi.exportAppearancePatentCleanList.mock.calls[0][0]
|
const call = cleanApi.exportAppearancePatentCleanList.mock.calls[0][0]
|
||||||
expect(call).toMatchObject({
|
expect(call).toMatchObject({
|
||||||
taskId: '33179',
|
taskId: '',
|
||||||
asin: '',
|
asin: '',
|
||||||
country: '',
|
country: '',
|
||||||
groupId: '',
|
groupId: '',
|
||||||
@@ -209,13 +209,17 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
expect(last.page).toBe(1, '改每页条数后回第一页')
|
expect(last.page).toBe(1, '改每页条数后回第一页')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('任务号/ASIN/国家/起止时间筛选生效', async () => {
|
it('分组/国家/起止时间筛选生效(任务号/ASIN 输入框已下架,2026-11-11 客户拍板)', async () => {
|
||||||
|
cleanApi.fetchDedupeTotalGroups.mockResolvedValue([{ id: 7, name: '甲组', leaderUserId: 9 }])
|
||||||
const wrapper = await mountWith({ items: [], total: 0, page: 1, pageSize: 10 })
|
const wrapper = await mountWith({ items: [], total: 0, page: 1, pageSize: 10 })
|
||||||
|
|
||||||
const textInputs = wrapper.findAll('input[type="text"]')
|
// 筛选面只剩分组/国家/时间,页面上不再有任务号/ASIN 文本框(OldPagination 跳页框除外)
|
||||||
await textInputs[0].setValue('33179')
|
const filterTextInputs = wrapper.findAll('.form-row input[type="text"]')
|
||||||
await textInputs[1].setValue('B0AB8CDEF1')
|
expect(filterTextInputs).toHaveLength(0)
|
||||||
await wrapper.find('select').setValue('DE')
|
|
||||||
|
const selects = wrapper.findAll('select')
|
||||||
|
await selects[0].setValue('7') // 分组(主管=组长)排在国家前,对齐获取店铺页字段顺序
|
||||||
|
await selects[1].setValue('DE')
|
||||||
const dateInputs = wrapper.findAll('input[type="date"]')
|
const dateInputs = wrapper.findAll('input[type="date"]')
|
||||||
await dateInputs[0].setValue('2026-11-01')
|
await dateInputs[0].setValue('2026-11-01')
|
||||||
await dateInputs[1].setValue('2026-11-09')
|
await dateInputs[1].setValue('2026-11-09')
|
||||||
@@ -224,10 +228,10 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
|
|
||||||
const last = cleanApi.fetchAppearancePatentCleanList.mock.calls.at(-1)![0]
|
const last = cleanApi.fetchAppearancePatentCleanList.mock.calls.at(-1)![0]
|
||||||
expect(last).toMatchObject({
|
expect(last).toMatchObject({
|
||||||
taskId: '33179',
|
taskId: '',
|
||||||
asin: 'B0AB8CDEF1',
|
asin: '',
|
||||||
country: 'DE',
|
country: 'DE',
|
||||||
groupId: '',
|
groupId: '7',
|
||||||
startDate: '2026-11-01',
|
startDate: '2026-11-01',
|
||||||
endDate: '2026-11-09',
|
endDate: '2026-11-09',
|
||||||
page: 1,
|
page: 1,
|
||||||
@@ -244,7 +248,7 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
// 选项取数走的是公司隔离的同一分组集(GET /shop-manages/groups 的适配层)
|
// 选项取数走的是公司隔离的同一分组集(GET /shop-manages/groups 的适配层)
|
||||||
expect(cleanApi.fetchDedupeTotalGroups).toHaveBeenCalledWith(1)
|
expect(cleanApi.fetchDedupeTotalGroups).toHaveBeenCalledWith(1)
|
||||||
|
|
||||||
const groupSelect = wrapper.findAll('select')[1]
|
const groupSelect = wrapper.findAll('select')[0]
|
||||||
const optionTexts = groupSelect.findAll('option').map((o) => o.text())
|
const optionTexts = groupSelect.findAll('option').map((o) => o.text())
|
||||||
expect(optionTexts).toContain('全部分组')
|
expect(optionTexts).toContain('全部分组')
|
||||||
expect(optionTexts).toContain('甲组')
|
expect(optionTexts).toContain('甲组')
|
||||||
@@ -275,10 +279,8 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
it('切公司 Tab 重取并清掉上一家的筛选(company-tab-wiring 同口径)', async () => {
|
it('切公司 Tab 重取并清掉上一家的筛选(company-tab-wiring 同口径)', async () => {
|
||||||
cleanApi.fetchDedupeTotalGroups.mockResolvedValue([{ id: 7, name: '甲组', leaderUserId: 9 }])
|
cleanApi.fetchDedupeTotalGroups.mockResolvedValue([{ id: 7, name: '甲组', leaderUserId: 9 }])
|
||||||
const wrapper = await mountWith({ items: [row(1)], total: 1, page: 1, pageSize: 10 })
|
const wrapper = await mountWith({ items: [row(1)], total: 1, page: 1, pageSize: 10 })
|
||||||
const textInputs = wrapper.findAll('input[type="text"]')
|
|
||||||
await textInputs[0].setValue('33179')
|
|
||||||
// 选上上一家公司的分组:切走后必须连同 groupId 一起清(分组的成员集是公司隔离的)
|
// 选上上一家公司的分组:切走后必须连同 groupId 一起清(分组的成员集是公司隔离的)
|
||||||
const groupSelect = wrapper.findAll('select')[1]
|
const groupSelect = wrapper.findAll('select')[0]
|
||||||
await groupSelect.setValue('7')
|
await groupSelect.setValue('7')
|
||||||
const callsAfterMount = cleanApi.fetchAppearancePatentCleanList.mock.calls.length
|
const callsAfterMount = cleanApi.fetchAppearancePatentCleanList.mock.calls.length
|
||||||
|
|
||||||
@@ -289,8 +291,8 @@ describe('AC-5 外观专利无侵权数据页(卡片宫格,2026-11-11 改版
|
|||||||
expect(cleanApi.fetchAppearancePatentCleanList.mock.calls.length).toBeGreaterThan(callsAfterMount)
|
expect(cleanApi.fetchAppearancePatentCleanList.mock.calls.length).toBeGreaterThan(callsAfterMount)
|
||||||
const last = cleanApi.fetchAppearancePatentCleanList.mock.calls.at(-1)![0]
|
const last = cleanApi.fetchAppearancePatentCleanList.mock.calls.at(-1)![0]
|
||||||
expect(last.companyId).toBe(2)
|
expect(last.companyId).toBe(2)
|
||||||
expect(last.taskId).toBe('', '切公司必须清掉上一家填的任务号')
|
|
||||||
expect(last.groupId).toBe('', '切公司必须清掉上一家选的分组')
|
expect(last.groupId).toBe('', '切公司必须清掉上一家选的分组')
|
||||||
|
expect(last.taskId).toBe('', 'watch token 仍整把清栏(taskId/asin 字段留在契约里,UI 不再暴露)')
|
||||||
expect(last.page).toBe(1)
|
expect(last.page).toBe(1)
|
||||||
// 分组选项按新公司重取(选项集公司隔离)
|
// 分组选项按新公司重取(选项集公司隔离)
|
||||||
expect(cleanApi.fetchDedupeTotalGroups).toHaveBeenLastCalledWith(2)
|
expect(cleanApi.fetchDedupeTotalGroups).toHaveBeenLastCalledWith(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user