匹配回收,bug修复
This commit is contained in:
12
frontend-vue/shop-match.html
Normal file
12
frontend-vue/shop-match.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>匹配店铺 - 数富AI</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/shop-match-main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
1582
frontend-vue/src/pages/brand/components/BrandShopMatchTab.vue
Normal file
1582
frontend-vue/src/pages/brand/components/BrandShopMatchTab.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
active: 'brand' | 'dedupe' | 'convert' | 'split' | 'delete-brand' | 'product-risk'
|
||||
active: 'brand' | 'dedupe' | 'convert' | 'split' | 'delete-brand' | 'product-risk' | 'shop-match'
|
||||
}>()
|
||||
|
||||
const active = props.active
|
||||
@@ -58,6 +58,7 @@ const navGroups = [
|
||||
items: [
|
||||
{ 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' },
|
||||
],
|
||||
},
|
||||
] as const
|
||||
|
||||
@@ -624,6 +624,7 @@ export interface ProductRiskHistoryItem {
|
||||
error?: string;
|
||||
outputFilename?: string;
|
||||
downloadUrl?: string;
|
||||
scheduledAt?: string;
|
||||
}
|
||||
|
||||
export interface ProductRiskHistoryVo {
|
||||
@@ -638,6 +639,7 @@ export interface ProductRiskTaskSummary {
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
finishedAt?: string;
|
||||
scheduledAt?: string;
|
||||
}
|
||||
|
||||
export interface ProductRiskTaskDetailVo {
|
||||
@@ -659,6 +661,16 @@ export interface ProductRiskCreateTaskVo {
|
||||
items: ProductRiskHistoryItem[];
|
||||
}
|
||||
|
||||
export type ShopMatchCandidateVo = ProductRiskCandidateVo;
|
||||
export type ShopMatchCountryPreferenceVo = ProductRiskCountryPreferenceVo;
|
||||
export type ShopMatchShopQueueItem = ProductRiskShopQueueItem;
|
||||
export type ShopMatchDashboardVo = ProductRiskDashboardVo;
|
||||
export type ShopMatchHistoryItem = ProductRiskHistoryItem;
|
||||
export type ShopMatchHistoryVo = ProductRiskHistoryVo;
|
||||
export type ShopMatchTaskDetailVo = ProductRiskTaskDetailVo;
|
||||
export type ShopMatchTaskBatchVo = ProductRiskTaskBatchVo;
|
||||
export type ShopMatchCreateTaskVo = ProductRiskCreateTaskVo;
|
||||
|
||||
export function getProductRiskDashboard() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ProductRiskDashboardVo>>(
|
||||
@@ -741,6 +753,148 @@ export function getProductRiskResultDownloadUrl(resultId: number) {
|
||||
);
|
||||
}
|
||||
|
||||
export function listShopMatchCandidates() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopMatchCandidateVo[]>>(
|
||||
`${JAVA_API_PREFIX}/shop-match/candidates`,
|
||||
{
|
||||
params: { user_id: getCurrentUserId() },
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function addShopMatchCandidate(shopName: string) {
|
||||
return unwrapJavaResponse(
|
||||
post<
|
||||
JavaApiResponse<ShopMatchCandidateVo>,
|
||||
{ user_id: number; shop_name: string }
|
||||
>(`${JAVA_API_PREFIX}/shop-match/candidates`, {
|
||||
user_id: getCurrentUserId(),
|
||||
shop_name: shopName,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteShopMatchCandidate(id: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/shop-match/candidates/${id}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopMatchCountryPreference() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopMatchCountryPreferenceVo>>(
|
||||
`${JAVA_API_PREFIX}/shop-match/country-preference`,
|
||||
{
|
||||
params: { user_id: getCurrentUserId() },
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function putShopMatchCountryPreference(countryCodes: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
put<
|
||||
JavaApiResponse<ShopMatchCountryPreferenceVo>,
|
||||
{ user_id: number; country_codes: string[] }
|
||||
>(`${JAVA_API_PREFIX}/shop-match/country-preference`, {
|
||||
user_id: getCurrentUserId(),
|
||||
country_codes: countryCodes,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function matchShopMatchShops(shopNames: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<
|
||||
JavaApiResponse<ProductRiskMatchShopsVo>,
|
||||
{ user_id: number; shop_names: string[] }
|
||||
>(`${JAVA_API_PREFIX}/shop-match/match-shops`, {
|
||||
user_id: getCurrentUserId(),
|
||||
shop_names: shopNames,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopMatchDashboard() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopMatchDashboardVo>>(
|
||||
`${JAVA_API_PREFIX}/shop-match/dashboard`,
|
||||
{
|
||||
params: { user_id: getCurrentUserId() },
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopMatchHistory() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopMatchHistoryVo>>(
|
||||
`${JAVA_API_PREFIX}/shop-match/history`,
|
||||
{
|
||||
params: { user_id: getCurrentUserId() },
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteShopMatchHistory(resultId: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/shop-match/history/${resultId}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function createShopMatchTask(
|
||||
items: ShopMatchShopQueueItem[],
|
||||
scheduleTime?: string,
|
||||
) {
|
||||
return unwrapJavaResponse(
|
||||
post<
|
||||
JavaApiResponse<ShopMatchCreateTaskVo>,
|
||||
{ user_id: number; items: ShopMatchShopQueueItem[]; schedule_time?: string }
|
||||
>(`${JAVA_API_PREFIX}/shop-match/tasks`, {
|
||||
user_id: getCurrentUserId(),
|
||||
items,
|
||||
schedule_time: scheduleTime,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteShopMatchTask(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/shop-match/tasks/${taskId}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function activateShopMatchTask(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<null>, undefined>(
|
||||
`${JAVA_API_PREFIX}/shop-match/tasks/${taskId}/activate?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
|
||||
undefined,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopMatchTasksBatch(taskIds: number[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<ShopMatchTaskBatchVo>, { taskIds: number[] }>(
|
||||
`${JAVA_API_PREFIX}/shop-match/tasks/batch`,
|
||||
{ taskIds },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopMatchResultDownloadUrl(resultId: number) {
|
||||
return getJavaDownloadUrl(`/shop-match/results/${resultId}/download`);
|
||||
}
|
||||
|
||||
export function getJavaDownloadUrl(path: string) {
|
||||
let raw =
|
||||
path.startsWith("http://") || path.startsWith("https://")
|
||||
|
||||
7
frontend-vue/src/shop-match-main.ts
Normal file
7
frontend-vue/src/shop-match-main.ts
Normal 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 BrandShopMatchTab from '@/pages/brand/components/BrandShopMatchTab.vue'
|
||||
|
||||
createApp(BrandShopMatchTab).use(ElementPlus).mount('#app')
|
||||
@@ -47,6 +47,7 @@ export default defineConfig({
|
||||
split: resolve(__dirname, 'split.html'),
|
||||
'delete-brand': resolve(__dirname, 'delete-brand.html'),
|
||||
'product-risk': resolve(__dirname, 'product-risk.html'),
|
||||
'shop-match': resolve(__dirname, 'shop-match.html'),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: 'assets/[name].js',
|
||||
|
||||
Reference in New Issue
Block a user