chore: 移除项目内无用代码(28 文件)
- 清理任务面板/SPA 化改造遗留的未使用变量与函数(模板管理配套 6 函数、 payloadForDisplay/showTip/hasRunning/schedulePoll/removeMatchedRowLocally 等 30+ 处) - 清理未使用 import(getBrandTemplateXlsxUrl/uploadTempFileToJava/getProductRiskTasksBatch 等) - useTaskProgressLoop 改为仅类型导入;progress/task-request 缓存未用参数精简 - DeleteBrandRunService 删除永不执行的 taskItems 死分支 - 全量 vue-tsc(含 --noUnusedLocals/--noUnusedParameters)0 错误;648 测试全过
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { get, post, put, del, type JavaApiResponse, unwrapJavaResponse } from '../../http.ts'
|
||||
import { buildJavaUrl, JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { getCurrentUserId } from '../../user.ts'
|
||||
import { getTaskProgressCacheTtlMs, getTaskProgressTimeoutMs } from '../../../task-progress-config.ts'
|
||||
import { createTaskProgressRequestCache } from '../../../task-progress-request-cache.ts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, post, put, type JavaApiResponse, unwrapJavaResponse } from '../../http.ts'
|
||||
import { buildJavaUrl, JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { getCurrentUserId } from '../../user.ts'
|
||||
|
||||
export interface ImageVideoDouyinCopyVo {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, post, put, del, type JavaApiResponse, unwrapJavaResponse } from '../../http.ts'
|
||||
import { buildJavaUrl, JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { getCurrentUserId } from '../../user.ts'
|
||||
import { getJavaDownloadUrl } from '../../download-url.ts'
|
||||
import { getTaskProgressCacheTtlMs, getTaskProgressTimeoutMs } from '../../../task-progress-config.ts'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, post, put, del, type JavaApiResponse, unwrapJavaResponse } from '../../http.ts'
|
||||
import { buildJavaUrl, JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { getCurrentUserId } from '../../user.ts'
|
||||
import { getJavaDownloadUrl } from '../../download-url.ts'
|
||||
import { getTaskProgressCacheTtlMs, getTaskProgressTimeoutMs } from '../../../task-progress-config.ts'
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { get, post, put, del, type JavaApiResponse, unwrapJavaResponse } from '../../http.ts'
|
||||
import { buildJavaUrl, JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { getCurrentUserId } from '../../user.ts'
|
||||
import { getJavaDownloadUrl } from '../../download-url.ts'
|
||||
import { getTaskProgressCacheTtlMs, getTaskProgressTimeoutMs } from '../../../task-progress-config.ts'
|
||||
import { createTaskProgressRequestCache } from '../../../task-progress-request-cache.ts'
|
||||
import { API_ENDPOINTS } from '../../endpoints.ts'
|
||||
import type { QueryAsinCountryAsins } from './query-asin.ts'
|
||||
|
||||
/** 商品风险处理:备选店铺与匹配相关数据结构。 */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, post, del, type JavaApiResponse, unwrapJavaResponse } from '../../http.ts'
|
||||
import { buildJavaUrl, JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { JAVA_API_PREFIX } from '../../url.ts'
|
||||
import { getCurrentUserId } from '../../user.ts'
|
||||
import { getJavaDownloadUrl } from '../../download-url.ts'
|
||||
import { getTaskProgressCacheTtlMs, getTaskProgressTimeoutMs } from '../../../task-progress-config.ts'
|
||||
|
||||
@@ -6,18 +6,9 @@ import {
|
||||
getTaskForegroundRefreshDelayMs,
|
||||
} from '../task-progress-config.ts'
|
||||
import { createCategorizedTimers } from '../utils/categorized-timers.ts'
|
||||
import {
|
||||
createTaskPollingBaseline,
|
||||
type TaskPollingBaseline,
|
||||
} from '../task-polling-baseline.ts'
|
||||
import {
|
||||
createProgressResponseCache,
|
||||
type ProgressResponseCache,
|
||||
} from '../progress-response-cache.ts'
|
||||
import {
|
||||
createTaskPollingCoordinator,
|
||||
type TaskPollingCoordinator,
|
||||
} from '../task-polling-coordinator.ts'
|
||||
import { createTaskPollingBaseline, type TaskPollingBaseline } from '../task-polling-baseline.ts'
|
||||
import type { ProgressResponseCache } from '../progress-response-cache.ts'
|
||||
import type { TaskPollingCoordinator } from '../task-polling-coordinator.ts'
|
||||
|
||||
/**
|
||||
* 通用任务进度轮询组合式函数。
|
||||
@@ -86,7 +77,7 @@ export interface TaskProgressLoopOptions<TDetail> {
|
||||
coordinator?: TaskPollingCoordinator
|
||||
}
|
||||
|
||||
export interface TaskProgressLoopHandle<TDetail> {
|
||||
export interface TaskProgressLoopHandle {
|
||||
taskIds: Ref<number[]>
|
||||
taskStatuses: Ref<Record<number, string>>
|
||||
inFlight: Ref<boolean>
|
||||
@@ -135,7 +126,7 @@ function writeIdsToStorage(key: string | undefined, ids: number[]) {
|
||||
|
||||
export function useTaskProgressLoop<TDetail>(
|
||||
options: TaskProgressLoopOptions<TDetail>,
|
||||
): TaskProgressLoopHandle<TDetail> {
|
||||
): TaskProgressLoopHandle {
|
||||
const timers = createCategorizedTimers(`task-progress-loop:${options.scope}`)
|
||||
const isTerminal = options.isTerminal ?? DEFAULT_TERMINAL
|
||||
const intervalMs = options.getIntervalMs ?? getTaskPollIntervalMs
|
||||
|
||||
@@ -12,7 +12,3 @@ export function resolvePageHref(rawHref?: string): string {
|
||||
return rawHref.replace(/^\/new_web_source\/(.+)\.html$/, '/$1')
|
||||
}
|
||||
|
||||
/** 兼容旧引用:SPA 下生产/开发路径一致,恒为 false(页面不再按路径区分桌面/Web) */
|
||||
export function isDesktopClientPage(): boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export function createProgressResponseCache<V>(options: ProgressResponseCacheOpt
|
||||
return removed
|
||||
}
|
||||
|
||||
function evictIfNeeded(at: number) {
|
||||
function evictIfNeeded(_at: number) {
|
||||
while (map.size > maxEntries) {
|
||||
const oldest = map.keys().next().value as number | undefined
|
||||
if (oldest == null) break
|
||||
|
||||
@@ -48,7 +48,6 @@ export interface TaskProgressRequestCache<T> {
|
||||
|
||||
export function createTaskProgressRequestCache<T>(options: TaskProgressRequestCacheOptions) {
|
||||
const ttl = options.ttlMs
|
||||
const ttlValue = typeof ttl === 'number' ? ttl : 0
|
||||
if (typeof ttl === 'number') {
|
||||
if (!(ttl > 0)) {
|
||||
throw new Error('ttlMs 必须为正数: ' + ttl)
|
||||
|
||||
Reference in New Issue
Block a user