admin_new P0+P1 全批次合并 (84 commits) #2
@ -74,7 +74,7 @@ export const MENU_LABELS: MenuLabel[] = [
|
||||
|
||||
// ===== 供应商模块 =====
|
||||
{ url: 'supplier/good', label: '实物商品', icon: 'Box', path: '/supplier/good', sort: 300 },
|
||||
{ url: 'supplier/servicegood', label: '服务商品(→实物商品)', icon: 'Box', path: '/supplier/good', sort: 301 },
|
||||
{ url: 'supplier/servicegood', label: '服务商品', icon: 'Box', path: '/supplier/good', sort: 301 },
|
||||
{ url: 'supplier/activityzone', label: '活动专区', icon: 'Promotion', path: '/supplier/activity', sort: 302 },
|
||||
{ url: 'supplier/coupon', label: '优惠券', icon: 'Ticket', path: '/supplier/coupon', sort: 303 },
|
||||
{ url: 'supplier/promoter', label: '推广返佣', icon: 'UserFilled', path: '/supplier/promoter', sort: 304 },
|
||||
|
||||
@ -143,18 +143,37 @@ async function load() {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
try {
|
||||
// 端点: /supplier/good/page 后端 404, 用 FALLBACK
|
||||
await new Promise(r => setTimeout(r, 200))
|
||||
let rows = [...FALLBACK]
|
||||
if (filters.title) rows = rows.filter(r => r.title.toLowerCase().includes(filters.title.toLowerCase()))
|
||||
// 后端 /supplier/good/page 400 (按 id 查), 真实分页端点是 /supplier/good/search (16080 条)
|
||||
const data = await httpGet<{ total: number | string; list: any[] }>('/supplier/good/search', {
|
||||
page: page.value,
|
||||
limit: limit.value,
|
||||
...(filters.title ? { title: filters.title } : {})
|
||||
})
|
||||
let rows = (data.list || []).map((it: any) => ({
|
||||
id: String(it.id),
|
||||
supplierGoodId: 'G' + String(it.id),
|
||||
icon: it.icon || null,
|
||||
title: it.title || '--',
|
||||
enterpriseName: '--', // search 端点不返, 留占位
|
||||
firstCategoryName: it.firstCategoryName || '',
|
||||
secondCategoryName: it.secondCategoryName || '',
|
||||
thirdCategoryName: it.thirdCategoryName || '',
|
||||
brandName: it.brandName || '--',
|
||||
unitName: '--', // search 端点不返
|
||||
onShelf: it.onShelf ?? 1,
|
||||
checkOpinion: '',
|
||||
checkStatus: 2, // search 不返, 默认已通过
|
||||
createDate: '',
|
||||
raw: it
|
||||
}))
|
||||
if (filters.enterpriseName) rows = rows.filter(r => r.enterpriseName.includes(filters.enterpriseName))
|
||||
if (filters.checkStatus) rows = rows.filter(r => String(r.checkStatus) === filters.checkStatus)
|
||||
list.value = rows
|
||||
total.value = rows.length
|
||||
total.value = Number(data.total) || 0
|
||||
} catch (e: any) {
|
||||
error.value = e?.msg || e?.message || '加载失败'
|
||||
list.value = FALLBACK
|
||||
total.value = FALLBACK.length
|
||||
list.value = []
|
||||
total.value = 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user