refactor(parsePqdif): 重构PQDIF解析页面为ProTable管理界面
- 将原有网格布局替换为ProTable组件进行数据管理 - 新增PQDIF路径表单对话框用于创建和编辑记录 - 实现PQDIF记录的增删改查功能 - 添加批量删除和JSON导出功能 - 集成文件上传和解析流程 - 更新API接口支持路径管理和解析结果存储 - 移除旧的请求面板、摘要面板和结果面板组件 - 调整MMS映射组件中的XML生成事件处理逻辑
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
import http from '@/api'
|
||||
import type { ParsePqdif } from './interface'
|
||||
|
||||
const PQDIF_PATH_BASE_URL = '/api/parse-pqdif/pqdif-paths'
|
||||
|
||||
const buildPqdifPathFormData = (request: ParsePqdif.PqdifPathSaveParams, pqdifFile?: File | null) => {
|
||||
const formData = new FormData()
|
||||
|
||||
if (pqdifFile) {
|
||||
formData.append('pqdifFile', pqdifFile)
|
||||
}
|
||||
|
||||
// 关键业务节点:记录上传接口固定读取 request 这个 JSON part,字段名不能调整。
|
||||
formData.append('request', new Blob([JSON.stringify(request)], { type: 'application/json' }))
|
||||
|
||||
return formData
|
||||
}
|
||||
|
||||
export const parsePqdifApi = (pqdifFile: File) => {
|
||||
const formData = new FormData()
|
||||
|
||||
@@ -11,3 +26,47 @@ export const parsePqdifApi = (pqdifFile: File) => {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
export const listPqdifPathsApi = (params: ParsePqdif.PqdifPathListParams = {}) => {
|
||||
const request = { ...params }
|
||||
delete request.pageNum
|
||||
delete request.pageSize
|
||||
|
||||
return http.post<ParsePqdif.PqdifPathRecord[]>(`${PQDIF_PATH_BASE_URL}/list`, request)
|
||||
}
|
||||
|
||||
export const addPqdifPathApi = (params: ParsePqdif.PqdifPathSaveParams, pqdifFile?: File | null) => {
|
||||
if (pqdifFile) {
|
||||
return http.post<boolean>(`${PQDIF_PATH_BASE_URL}/add`, buildPqdifPathFormData(params, pqdifFile), {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
return http.post<boolean>(`${PQDIF_PATH_BASE_URL}/add`, params)
|
||||
}
|
||||
|
||||
export const updatePqdifPathApi = (params: ParsePqdif.PqdifPathSaveParams, pqdifFile?: File | null) => {
|
||||
if (pqdifFile) {
|
||||
return http.post<boolean>(`${PQDIF_PATH_BASE_URL}/update`, buildPqdifPathFormData(params, pqdifFile), {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
return http.post<boolean>(`${PQDIF_PATH_BASE_URL}/update`, params)
|
||||
}
|
||||
|
||||
export const deletePqdifPathsApi = (ids: string[]) => {
|
||||
return http.post<boolean>(`${PQDIF_PATH_BASE_URL}/delete`, ids)
|
||||
}
|
||||
|
||||
export const getPqdifParseMsgApi = (id: string) => {
|
||||
return http.post<ParsePqdif.PqdifParseMsg>(`${PQDIF_PATH_BASE_URL}/${id}/parse-msg`)
|
||||
}
|
||||
|
||||
export const getPqdifParseDetailApi = (id: string) => {
|
||||
return http.post<ParsePqdif.PqdifParseDetail>(`${PQDIF_PATH_BASE_URL}/${id}/parse-detail`)
|
||||
}
|
||||
|
||||
export const savePqdifParseResultApi = (id: string, params: ParsePqdif.SaveParseResultParams) => {
|
||||
return http.post<boolean>(`${PQDIF_PATH_BASE_URL}/${id}/parse-result`, params)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export namespace ParsePqdif {
|
||||
export type ParseStatus = 'SUCCESS' | 'FAILED' | (string & {})
|
||||
export type SeriesDataStatus = 'DATA_SUCCESS' | 'DATA_FAILED' | (string & {})
|
||||
export type ParseResultValue = 0 | 1
|
||||
|
||||
export interface RecordItem {
|
||||
recordIndex?: number
|
||||
@@ -53,4 +54,48 @@ export namespace ParsePqdif {
|
||||
records?: RecordItem[]
|
||||
observations?: ObservationItem[]
|
||||
}
|
||||
|
||||
export interface PqdifPathListParams {
|
||||
keyword?: string
|
||||
result?: ParseResultValue | ''
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface PqdifPathRecord {
|
||||
id?: string
|
||||
name?: string
|
||||
filePath?: string
|
||||
recordCount?: number
|
||||
observationCount?: number
|
||||
sampleValueCount?: number
|
||||
state?: number
|
||||
result?: ParseResultValue
|
||||
msg?: Record<string, unknown> | null
|
||||
createBy?: string
|
||||
createTime?: string
|
||||
updateBy?: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
export interface PqdifPathSaveParams {
|
||||
id?: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface PqdifParseDetail {
|
||||
id?: string
|
||||
name?: string
|
||||
filePath?: string
|
||||
}
|
||||
|
||||
export type PqdifParseMsg = Record<string, unknown> | null
|
||||
|
||||
export interface SaveParseResultParams {
|
||||
recordCount?: number
|
||||
observationCount?: number
|
||||
sampleValueCount?: number
|
||||
result: ParseResultValue
|
||||
msg?: Record<string, unknown> | null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user