feat(distribution): 优化货架批量操作、结算大事务、大盘与前台多端解析缓存及货架分页
This commit is contained in:
@@ -610,15 +610,50 @@ export async function updateAccountMarkup(id: number, shelfRatioDelta: number):
|
||||
return extract(resp)
|
||||
}
|
||||
|
||||
export async function batchUpdateAccountMarkup(siteID: number, listingIDs: number[], shelfRatioDelta: number): Promise<void> {
|
||||
await api.post(`/admin/distribution/accounts/batch-markup`, {
|
||||
listing_ids: listingIDs,
|
||||
shelf_ratio_delta: shelfRatioDelta,
|
||||
}, {
|
||||
export interface BatchUpdateAccountMarkupItem {
|
||||
id?: number
|
||||
listing_id?: number
|
||||
shelf_ratio_delta: number
|
||||
}
|
||||
|
||||
export interface BatchUpdateAccountMarkupRequest {
|
||||
listing_ids?: number[]
|
||||
display_ids?: number[]
|
||||
shelf_ratio_delta?: number
|
||||
items?: BatchUpdateAccountMarkupItem[]
|
||||
}
|
||||
|
||||
export async function batchUpdateAccountMarkup(
|
||||
siteID: number,
|
||||
reqOrListingIDs: BatchUpdateAccountMarkupRequest | number[],
|
||||
shelfRatioDelta?: number,
|
||||
): Promise<void> {
|
||||
const payload: BatchUpdateAccountMarkupRequest = Array.isArray(reqOrListingIDs)
|
||||
? { listing_ids: reqOrListingIDs, shelf_ratio_delta: shelfRatioDelta ?? 0 }
|
||||
: reqOrListingIDs
|
||||
|
||||
await api.post(`/admin/distribution/accounts/batch-markup`, payload, {
|
||||
params: { site_id: siteID },
|
||||
})
|
||||
}
|
||||
|
||||
export async function batchUpdateAccountDisplay(
|
||||
siteID: number,
|
||||
displayIDs: number[],
|
||||
targetStatus: 'enabled' | 'disabled',
|
||||
): Promise<void> {
|
||||
await api.post(
|
||||
`/admin/distribution/accounts/batch-display`,
|
||||
{
|
||||
display_ids: displayIDs,
|
||||
target_status: targetStatus,
|
||||
},
|
||||
{
|
||||
params: { site_id: siteID },
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export interface DistributionAnalytics {
|
||||
today_received_count: number
|
||||
total_received_count: number
|
||||
|
||||
Reference in New Issue
Block a user