提交任务更新

This commit is contained in:
2026-04-13 20:07:00 +08:00
parent eb04caccf1
commit 951a353881
26 changed files with 2782 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -47,6 +47,7 @@ type ActiveNavKey =
| 'delete-brand'
| 'product-risk'
| 'shop-match'
| 'pricing'
type NavItem = {
key: string
@@ -78,7 +79,7 @@ const navGroups: ReadonlyArray<{ label: string; items: ReadonlyArray<NavItem> }>
{ key: 'delete-brand', label: '删除ASIN', href: '/new_web_source/delete-brand.html' },
{ key: 'product-risk', label: '商品风险解决', href: '/new_web_source/product-risk.html' },
{ key: 'shop-match', label: '定时匹配', href: '/new_web_source/shop-match.html' },
{ key: 'pricing', label: '跟价' },
{ key: 'pricing', label: '跟价', href: '/new_web_source/price-track.html' },
{ key: 'patrol-delete', label: '巡店删除' },
{ key: 'withdraw', label: '取款' },
{ key: 'shop-status', label: '店铺状态查询' },

View File

@@ -0,0 +1,7 @@
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/styles/main.css'
import BrandPriceTrackTab from '@/pages/brand/components/BrandPriceTrackTab.vue'
createApp(BrandPriceTrackTab).use(ElementPlus).mount('#app')

View File

@@ -916,6 +916,181 @@ export function getShopMatchResultDownloadUrl(resultId: number) {
return getJavaDownloadUrl(`/shop-match/results/${resultId}/download`);
}
// ========== 跟价 ==========
export interface PriceTrackCandidateVo {
id: number;
shopName: string;
}
export interface PriceTrackShopQueueItem {
shopName?: string;
shopId?: number | string | null;
matched?: boolean;
matchStatus?: string;
matchMessage?: string;
platform?: string;
companyName?: string;
}
export interface PriceTrackMatchShopsVo {
items: PriceTrackShopQueueItem[];
}
export interface PriceTrackCountryPreferenceVo {
userId: number;
countryCodes: string[];
}
export interface PriceTrackDashboardVo {
candidateCount: number;
processedTaskCount: number;
successTaskCount: number;
failedTaskCount: number;
}
export interface PriceTrackHistoryItem {
resultId?: number;
taskId?: number;
shopName?: string;
shopId?: number | string | null;
platform?: string;
companyName?: string;
matched?: boolean;
matchStatus?: string;
matchMessage?: string;
taskStatus?: string;
outputFilename?: string;
downloadUrl?: string;
error?: string;
success?: boolean;
}
export interface PriceTrackHistoryVo {
items: PriceTrackHistoryItem[];
}
export interface PriceTrackCreateTaskVo {
taskId: number;
items: PriceTrackShopQueueItem[];
}
export function listPriceTrackCandidates() {
return unwrapJavaResponse(
get<JavaApiResponse<PriceTrackCandidateVo[]>>(
`${JAVA_API_PREFIX}/price-track/candidates?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export function addPriceTrackCandidate(shopName: string) {
return unwrapJavaResponse(
post<JavaApiResponse<PriceTrackCandidateVo>, { user_id: number; shopName: string }>(
`${JAVA_API_PREFIX}/price-track/candidates`,
{ user_id: getCurrentUserId(), shopName },
),
);
}
export function deletePriceTrackCandidate(id: number) {
return unwrapJavaResponse(
del<JavaApiResponse<null>>(
`${JAVA_API_PREFIX}/price-track/candidates/${id}?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export function getPriceTrackCountryPreference() {
return unwrapJavaResponse(
get<JavaApiResponse<PriceTrackCountryPreferenceVo>>(
`${JAVA_API_PREFIX}/price-track/country-preference?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export function putPriceTrackCountryPreference(countryCodes: string[]) {
return unwrapJavaResponse(
put<JavaApiResponse<PriceTrackCountryPreferenceVo>, { user_id: number; countryCodes: string[] }>(
`${JAVA_API_PREFIX}/price-track/country-preference`,
{ user_id: getCurrentUserId(), countryCodes },
),
);
}
export function matchPriceTrackShops(shopNames: string[]) {
return unwrapJavaResponse(
post<JavaApiResponse<PriceTrackMatchShopsVo>, { user_id: number; shopNames: string[] }>(
`${JAVA_API_PREFIX}/price-track/match-shops`,
{ user_id: getCurrentUserId(), shopNames },
),
);
}
export function getPriceTrackDashboard() {
return unwrapJavaResponse(
get<JavaApiResponse<PriceTrackDashboardVo>>(
`${JAVA_API_PREFIX}/price-track/dashboard?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export function getPriceTrackHistory() {
return unwrapJavaResponse(
get<JavaApiResponse<PriceTrackHistoryVo>>(
`${JAVA_API_PREFIX}/price-track/history?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export function deletePriceTrackHistory(resultId: number) {
return unwrapJavaResponse(
del<JavaApiResponse<null>>(
`${JAVA_API_PREFIX}/price-track/history/${resultId}?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export interface PriceTrackCreateTaskRequest {
userId: number;
statusMode: boolean;
asinMode: boolean;
items: PriceTrackShopQueueItem[];
asinFiles: string[];
countryCodes: string[];
minPrice?: number;
maxPrice?: number;
priceDiffPercent?: number;
}
export function createPriceTrackTask(request: PriceTrackCreateTaskRequest) {
return unwrapJavaResponse(
post<JavaApiResponse<PriceTrackCreateTaskVo>, PriceTrackCreateTaskRequest>(
`${JAVA_API_PREFIX}/price-track/tasks`,
{ ...request, user_id: getCurrentUserId() },
),
);
}
export function deletePriceTrackTask(taskId: number) {
return unwrapJavaResponse(
del<JavaApiResponse<null>>(
`${JAVA_API_PREFIX}/price-track/tasks/${taskId}?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
),
);
}
export function getPriceTrackResultDownloadUrl(resultId: number) {
return getJavaDownloadUrl(`/price-track/results/${resultId}/download`);
}
export function deletePendingPriceTrackShopResult(shopName: string) {
return unwrapJavaResponse(
del<JavaApiResponse<null>>(
`${JAVA_API_PREFIX}/price-track/pending-shop-result?user_id=${encodeURIComponent(String(getCurrentUserId()))}&shop_name=${encodeURIComponent(shopName)}`,
),
);
}
export function getJavaDownloadUrl(path: string) {
let raw =
path.startsWith("http://") || path.startsWith("https://")