feat(web): 前端 SPA 化 + 工具页任务面板统一与历史批量删除
- SPA 化:22 个 MPA html 入口与 *-main.ts 合并为 index.html + vue-router(URL 无 .html 后缀), 页面跳转全部 router-link,/new_web_source/xxx.html 旧路径归一为 /xxx - 任务面板统一:共享 TaskCenterPanel/TaskItemCard/TaskStatCards/HistoryTaskLayer, 16 个工具页右侧统一为统计卡 + 当前任务 + 历史任务弹层(任务ID/开始/结束/状态必展示) - 历史记录支持单条删除 + 批量勾选删除(确认框/全选/失败提示) - Java 7 模块(dedupe/convert/split/productrisk/shopmatch/pricetrack/deletebrand) history 接口补齐任务时间字段(VO+Service,复用 biz_file_task 列) - 图片工作台/API 层(brand/permission/user)既有未提交改动一并提交
This commit is contained in:
@@ -30,6 +30,8 @@ export interface BrandTaskItem {
|
||||
desc?: string
|
||||
file_paths?: string[]
|
||||
created_at?: string
|
||||
/** 最后更新(终态时即完成时间,作为结束时间兜底) */
|
||||
updated_at?: string
|
||||
progress_total?: number
|
||||
progress_current?: number
|
||||
error_message?: string
|
||||
|
||||
@@ -12,6 +12,16 @@ export interface ConvertResultItem {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
downloadUrl?: string;
|
||||
/** 所属任务ID(biz_file_task.id) */
|
||||
taskId?: number;
|
||||
/** 任务状态:PENDING / RUNNING / SUCCESS / FAILED */
|
||||
taskStatus?: string;
|
||||
/** 任务创建时间 */
|
||||
createdAt?: string;
|
||||
/** 任务开始时间 */
|
||||
startedAt?: string;
|
||||
/** 任务结束时间(未结束为空) */
|
||||
finishedAt?: string;
|
||||
}
|
||||
|
||||
export interface ConvertRunVo {
|
||||
|
||||
@@ -12,6 +12,16 @@ export interface DedupeResultItem {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
downloadUrl?: string;
|
||||
/** 所属任务ID(biz_file_task.id) */
|
||||
taskId?: number;
|
||||
/** 任务状态:PENDING / RUNNING / SUCCESS / FAILED */
|
||||
taskStatus?: string;
|
||||
/** 任务创建时间 */
|
||||
createdAt?: string;
|
||||
/** 任务开始时间 */
|
||||
startedAt?: string;
|
||||
/** 任务结束时间(未结束为空) */
|
||||
finishedAt?: string;
|
||||
}
|
||||
|
||||
export interface DedupeRunVo {
|
||||
|
||||
@@ -54,7 +54,8 @@ function normalizeColumnKeys(items: PermissionMenuItem[] | undefined) {
|
||||
return Array.from(keys)
|
||||
}
|
||||
|
||||
export async function getCurrentUserAppColumnKeys() {
|
||||
/** 拉取当前用户 app 列权限(菜单项 + 本地缓存写入);权限接口失败时抛出 */
|
||||
async function fetchAppColumnPermissions() {
|
||||
const uid = getCurrentUserId()
|
||||
const cacheKey = getAppPermissionCacheKey(uid)
|
||||
|
||||
@@ -81,5 +82,15 @@ export async function getCurrentUserAppColumnKeys() {
|
||||
window.localStorage.setItem(cacheKey, JSON.stringify(items))
|
||||
} catch (_error) {}
|
||||
|
||||
return normalizeColumnKeys(items)
|
||||
return items
|
||||
}
|
||||
|
||||
/** 归一化后的列权限键(菜单入口/卡片显隐用,见 AmazonConsolePage 等) */
|
||||
export async function getCurrentUserAppColumnKeys() {
|
||||
return normalizeColumnKeys(await fetchAppColumnPermissions())
|
||||
}
|
||||
|
||||
/** 原始权限菜单项(页面需要自行计算权限状态时用,见 DesktopHomePage) */
|
||||
export async function getCurrentUserAppColumnRaw() {
|
||||
return fetchAppColumnPermissions()
|
||||
}
|
||||
|
||||
@@ -20,6 +20,16 @@ export interface SplitResultItem {
|
||||
downloadUrl?: string;
|
||||
entryCount?: number;
|
||||
entries?: SplitArchiveEntry[];
|
||||
/** 所属任务ID(biz_file_task.id) */
|
||||
taskId?: number;
|
||||
/** 任务状态:PENDING / RUNNING / SUCCESS / FAILED */
|
||||
taskStatus?: string;
|
||||
/** 任务创建时间 */
|
||||
createdAt?: string;
|
||||
/** 任务开始时间 */
|
||||
startedAt?: string;
|
||||
/** 任务结束时间(未结束为空) */
|
||||
finishedAt?: string;
|
||||
}
|
||||
|
||||
export interface SplitRunVo {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { post } from './http.ts'
|
||||
|
||||
export function getCurrentUserId() {
|
||||
const raw =
|
||||
typeof window === "undefined"
|
||||
@@ -9,3 +11,32 @@ export function getCurrentUserId() {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/** 桌面端登录接口响应 data 段 */
|
||||
export interface LoginData {
|
||||
token?: string
|
||||
userId?: number | string
|
||||
username?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
success: boolean
|
||||
message?: string
|
||||
msg?: string
|
||||
data?: LoginData
|
||||
}
|
||||
|
||||
/**
|
||||
* 桌面端登录(原页面裸 window.fetch('/newApi/login') 收敛到 shared 层:
|
||||
* 页面不得直连 /newApi,见 shared-api-allowlist 测试约定)
|
||||
*/
|
||||
export function loginWithDevice(account: string, password: string, deviceId: string) {
|
||||
return post<LoginResponse>(
|
||||
'/newApi/login',
|
||||
{ username: account, password, deviceId },
|
||||
{
|
||||
headers: { 'X-Device-Id': deviceId, 'X-Requested-With': 'XMLHttpRequest' },
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user