移除外观专利转 Linux 后台后的废弃代码
- Java:删除无调用方的 parsed-payload/queue-payload/parsed-groups 三个 HTTP 端点、service 的 parsedPayload/parsedGroupPage 方法与 AppearancePatentParsedGroupPageDto;service.queuePayload 保留(内部认领 SPI 仍在用) - 前端:删除 getAppearancePatentParsedPayload/getAppearancePatentQueuePayload/activateAppearancePatentTask 封装与 endpoints 条目、ParsedPayloadDto 类型,以及外观专利页永远为空的 queuePayloadText 模板/声明/清零/样式
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
<div>任务 ID:{{ visibleTaskSummary.taskId }}</div>
|
||||
<div>总行数:{{ visibleTaskSummary.totalRows }},有效:{{ visibleTaskSummary.acceptedRows }},分组:{{ visibleTaskSummary.groupCount || 0 }},过滤:{{ visibleTaskSummary.droppedRows }}</div>
|
||||
</div>
|
||||
<pre v-if="queuePayloadText" class="queue-payload">{{ queuePayloadText }}</pre>
|
||||
<ModuleTemplateDownload module-code="appearance-patent" filename="外观专利检测 文档格式.xlsx" />
|
||||
</aside>
|
||||
|
||||
@@ -122,7 +121,6 @@ const queuedTaskSummary = ref<TaskSummary | null>(null)
|
||||
const aiPrompt = ref('')
|
||||
const parsing = ref(false)
|
||||
const pushing = ref(false)
|
||||
const queuePayloadText = ref('')
|
||||
const pollingTaskIds = ref<number[]>([])
|
||||
const pendingFileTaskIds = ref<number[]>([])
|
||||
const pollTimer = ref<number | null>(null)
|
||||
@@ -306,14 +304,12 @@ async function selectFiles() {
|
||||
selectedFileNames.value = files.map((f) => f.relativePath || f.originalFilename || f.fileKey)
|
||||
parseResult.value = null
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
} catch (error) {
|
||||
// 上传失败时清空选择,避免残留上一批文件让用户误以为新文件已就绪
|
||||
uploadedFiles.value = []
|
||||
selectedFileNames.value = []
|
||||
parseResult.value = null
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
ElMessage.error(error instanceof Error ? error.message : '文件上传失败')
|
||||
}
|
||||
}
|
||||
@@ -338,7 +334,6 @@ async function selectFolder() {
|
||||
selectedFileNames.value = result.items.map((item) => item.relativePath || item.absolutePath)
|
||||
parseResult.value = null
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
ElMessage.success(`已选择文件夹内 ${result.items.length} 个 Excel 文件`)
|
||||
} catch (error) {
|
||||
uploadedFiles.value = []
|
||||
@@ -397,19 +392,16 @@ async function parseFiles() {
|
||||
if (!(await passGuard(guard))) {
|
||||
parseResult.value = null
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
return
|
||||
}
|
||||
if (await abortOnCollapsedGroups(res)) {
|
||||
parseResult.value = null
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
ElMessage.info('已取消,修正 id 列后重新解析')
|
||||
return
|
||||
}
|
||||
parseResult.value = res
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
ElMessage.success(`解析完成,共 ${res.groupCount || 0} 组 / ${res.acceptedRows} 条`)
|
||||
} catch (e) {
|
||||
ElMessage.error(e instanceof Error ? e.message : '解析失败')
|
||||
@@ -443,7 +435,6 @@ async function pushToPythonQueue() {
|
||||
|
||||
function clearParsedTask() {
|
||||
parseResult.value = null
|
||||
queuePayloadText.value = ''
|
||||
}
|
||||
|
||||
function addPollingTask(taskId: number) {
|
||||
@@ -941,8 +932,7 @@ async function batchDeleteHistory(views: TaskItemView[]) {
|
||||
.prompt-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 180px; padding: 10px 12px; border: 1px solid #333; border-radius: 8px; background: #222b3d; color: #c8d2e2; font-size: 12px; line-height: 1.6; outline: none; }
|
||||
.secret-input { width: 100%; box-sizing: border-box; height: 38px; padding: 0 12px; border: 1px solid #333; border-radius: 8px; background: #222b3d; color: #c8d2e2; font-size: 12px; outline: none; }
|
||||
.prompt-input:focus, .secret-input:focus { border-color: #3498db; }
|
||||
.parse-card, .queue-payload { margin-top: 14px; padding: 12px; border: 1px solid #2e3a52; border-radius: 8px; background: #222b3d; color: #a0acbe; font-size: 12px; }
|
||||
.queue-payload { max-height: 220px; overflow: auto; color: #8fd3ff; white-space: pre-wrap; }
|
||||
.parse-card { margin-top: 14px; padding: 12px; border: 1px solid #2e3a52; border-radius: 8px; background: #222b3d; color: #a0acbe; font-size: 12px; }
|
||||
.result-table { --el-table-bg-color: #242424; --el-table-tr-bg-color: #242424; --el-table-header-bg-color: #2e3a52; --el-table-text-color: #c8d2e2; --el-table-border-color: #333; }
|
||||
.result-hint { margin-top: 6px; color: #e0b96d; }
|
||||
.download { padding: 6px 10px; color: #c8d2e2; background: rgba(52, 152, 219, .18); }
|
||||
|
||||
@@ -190,14 +190,11 @@ export const API_ENDPOINTS = {
|
||||
},
|
||||
appearancePatent: {
|
||||
parse: '/api/appearance-patent/parse',
|
||||
parsedPayload: '/api/appearance-patent/tasks/{taskId}/parsed-payload',
|
||||
queuePayload: '/api/appearance-patent/tasks/{taskId}/queue-payload',
|
||||
dashboard: '/api/appearance-patent/dashboard',
|
||||
history: '/api/appearance-patent/history',
|
||||
historyDelete: '/api/appearance-patent/history/{resultId}',
|
||||
progressBatch: '/api/appearance-patent/tasks/progress/batch',
|
||||
progressLight: '/api/appearance-patent/tasks/progress/light',
|
||||
taskActivate: '/api/appearance-patent/tasks/{taskId}/activate',
|
||||
taskDelete: '/api/appearance-patent/tasks/{taskId}',
|
||||
resultDownload: '/api/appearance-patent/results/{resultId}/download',
|
||||
},
|
||||
|
||||
@@ -46,16 +46,6 @@ export interface AppearancePatentParseVo {
|
||||
groups?: AppearancePatentParsedGroup[];
|
||||
}
|
||||
|
||||
export interface AppearancePatentParsedPayloadDto {
|
||||
aiPrompt?: string;
|
||||
apiKey?: string;
|
||||
sourceFiles?: UploadedFileRef[];
|
||||
headers?: string[];
|
||||
items?: AppearancePatentParsedRow[];
|
||||
groups?: AppearancePatentParsedGroup[];
|
||||
allItems?: AppearancePatentParsedRow[];
|
||||
}
|
||||
|
||||
export interface AppearancePatentDashboardVo {
|
||||
pendingTaskCount: number;
|
||||
processedTaskCount: number;
|
||||
@@ -190,24 +180,6 @@ export function parseAppearancePatent(files: UploadedFileRef[], aiPrompt: string
|
||||
);
|
||||
}
|
||||
|
||||
export function getAppearancePatentParsedPayload(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<AppearancePatentParsedPayloadDto>>(
|
||||
buildJavaUrl(API_ENDPOINTS.appearancePatent.parsedPayload.replace('{taskId}', String(taskId))),
|
||||
{ params: { user_id: getCurrentUserId() } },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getAppearancePatentQueuePayload(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<AppearancePatentParsedPayloadDto>>(
|
||||
buildJavaUrl(API_ENDPOINTS.appearancePatent.queuePayload.replace('{taskId}', String(taskId))),
|
||||
{ params: { user_id: getCurrentUserId() } },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getAppearancePatentDashboard() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<AppearancePatentDashboardVo>>(
|
||||
@@ -237,15 +209,6 @@ export function getAppearancePatentTaskProgressBatch(
|
||||
);
|
||||
}
|
||||
|
||||
export function activateAppearancePatentTask(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<null>, undefined>(
|
||||
`${JAVA_API_PREFIX}/appearance-patent/tasks/${taskId}/activate?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
|
||||
undefined,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteAppearancePatentTask(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/appearance-patent/tasks/${taskId}`, {
|
||||
|
||||
Reference in New Issue
Block a user