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/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/activityzone', label: '活动专区', icon: 'Promotion', path: '/supplier/activity', sort: 302 },
|
||||||
{ url: 'supplier/coupon', label: '优惠券', icon: 'Ticket', path: '/supplier/coupon', sort: 303 },
|
{ url: 'supplier/coupon', label: '优惠券', icon: 'Ticket', path: '/supplier/coupon', sort: 303 },
|
||||||
{ url: 'supplier/promoter', label: '推广返佣', icon: 'UserFilled', path: '/supplier/promoter', sort: 304 },
|
{ url: 'supplier/promoter', label: '推广返佣', icon: 'UserFilled', path: '/supplier/promoter', sort: 304 },
|
||||||
|
|||||||
@ -143,18 +143,37 @@ async function load() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
error.value = null
|
error.value = null
|
||||||
try {
|
try {
|
||||||
// 端点: /supplier/good/page 后端 404, 用 FALLBACK
|
// 后端 /supplier/good/page 400 (按 id 查), 真实分页端点是 /supplier/good/search (16080 条)
|
||||||
await new Promise(r => setTimeout(r, 200))
|
const data = await httpGet<{ total: number | string; list: any[] }>('/supplier/good/search', {
|
||||||
let rows = [...FALLBACK]
|
page: page.value,
|
||||||
if (filters.title) rows = rows.filter(r => r.title.toLowerCase().includes(filters.title.toLowerCase()))
|
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.enterpriseName) rows = rows.filter(r => r.enterpriseName.includes(filters.enterpriseName))
|
||||||
if (filters.checkStatus) rows = rows.filter(r => String(r.checkStatus) === filters.checkStatus)
|
if (filters.checkStatus) rows = rows.filter(r => String(r.checkStatus) === filters.checkStatus)
|
||||||
list.value = rows
|
list.value = rows
|
||||||
total.value = rows.length
|
total.value = Number(data.total) || 0
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
error.value = e?.msg || e?.message || '加载失败'
|
error.value = e?.msg || e?.message || '加载失败'
|
||||||
list.value = FALLBACK
|
list.value = []
|
||||||
total.value = FALLBACK.length
|
total.value = 0
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user