refactor(steady-checksquare): 更新稳态校验功能的数据结构和接口规范
- 移除 lineId 字段,统一使用 lineIds 数组字段 - 更新创建任务请求体构建逻辑,不再包含 lineId 属性 - 修改任务详情和检测项明细的接口契约验证 - 更新稳态校验 API 文档说明,移除对 lineId 的支持 - 重构稳态校验表单项验证规则 - 移除磁盘监控作业详情抽屉组件 - 移除磁盘监控作业表格组件 - 更新路由配置以支持新的系统监控路径 - 添加测试报告相关字典代码常量 - 更新 ICD 路径表单和结果面板功能
This commit is contained in:
48
frontend/src/api/aireport/clientUnit/index.ts
Normal file
48
frontend/src/api/aireport/clientUnit/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import http from '@/api'
|
||||
import type { ClientUnit } from './interface'
|
||||
|
||||
const buildClientUnitImportFormData = (file: File) => {
|
||||
const formData = new FormData()
|
||||
|
||||
formData.append('file', file)
|
||||
|
||||
return formData
|
||||
}
|
||||
|
||||
export const listClientUnitsApi = (params: ClientUnit.ClientUnitListParams) => {
|
||||
return http.post('/clientUnit/list', params)
|
||||
}
|
||||
|
||||
export const createClientUnitApi = (params: ClientUnit.ClientUnitSaveRequest) => {
|
||||
return http.post<boolean>('/clientUnit/add', params)
|
||||
}
|
||||
|
||||
export const updateClientUnitApi = (params: ClientUnit.ClientUnitSaveRequest) => {
|
||||
return http.post<boolean>('/clientUnit/update', params)
|
||||
}
|
||||
|
||||
export const getClientUnitDetailApi = (id: string) => {
|
||||
return http.get<ClientUnit.ClientUnitRecord>('/clientUnit/getById', { id })
|
||||
}
|
||||
|
||||
export const deleteClientUnitsApi = (ids: string[]) => {
|
||||
return http.post<boolean>('/clientUnit/delete', ids)
|
||||
}
|
||||
|
||||
export const exportClientUnitsApi = (params: ClientUnit.ClientUnitListParams) => {
|
||||
return http.post('/clientUnit/export', params, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
export const downloadClientUnitImportTemplateApi = () => {
|
||||
return http.get('/clientUnit/importTemplate', undefined, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
export const importClientUnitsApi = (file: File) => {
|
||||
return http.post<ClientUnit.ClientUnitImportResult>(
|
||||
'/clientUnit/import',
|
||||
buildClientUnitImportFormData(file),
|
||||
{
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
)
|
||||
}
|
||||
36
frontend/src/api/aireport/clientUnit/interface/index.ts
Normal file
36
frontend/src/api/aireport/clientUnit/interface/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export namespace ClientUnit {
|
||||
export interface ClientUnitRecord {
|
||||
id?: string
|
||||
name?: string | null
|
||||
contactName?: string | null
|
||||
phonenumber?: string | null
|
||||
address?: string | null
|
||||
createBy?: string | null
|
||||
createTime?: string | null
|
||||
updateBy?: string | null
|
||||
updateTime?: string | null
|
||||
}
|
||||
|
||||
export interface ClientUnitListParams {
|
||||
name?: string
|
||||
searchBeginTime?: string
|
||||
searchEndTime?: string
|
||||
timeRange?: string[]
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface ClientUnitSaveRequest {
|
||||
id?: string
|
||||
name: string
|
||||
contactName?: string | null
|
||||
phonenumber?: string | null
|
||||
address?: string | null
|
||||
}
|
||||
|
||||
export interface ClientUnitImportResult {
|
||||
successCount?: number
|
||||
failCount?: number
|
||||
failReasons?: string[]
|
||||
}
|
||||
}
|
||||
16
frontend/src/api/aireport/reportApproval/index.ts
Normal file
16
frontend/src/api/aireport/reportApproval/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import http from '@/api'
|
||||
import type { ReportApproval } from './interface'
|
||||
|
||||
const REPORT_APPROVAL_BASE_URL = '/api/report-approval'
|
||||
|
||||
export const listPendingReportApprovalsApi = (params: ReportApproval.PendingListParams) =>
|
||||
http.get(`${REPORT_APPROVAL_BASE_URL}/pending-page`, params)
|
||||
|
||||
export const passReportApprovalApi = (params: ReportApproval.ApprovalActionRequest) =>
|
||||
http.post<boolean>(`${REPORT_APPROVAL_BASE_URL}/pass`, params)
|
||||
|
||||
export const rejectReportApprovalApi = (params: ReportApproval.ApprovalActionRequest) =>
|
||||
http.post<boolean>(`${REPORT_APPROVAL_BASE_URL}/reject`, params)
|
||||
|
||||
export const listReportApprovalLogsApi = (params: ReportApproval.LogListParams) =>
|
||||
http.get(`${REPORT_APPROVAL_BASE_URL}/log-page`, params)
|
||||
46
frontend/src/api/aireport/reportApproval/interface/index.ts
Normal file
46
frontend/src/api/aireport/reportApproval/interface/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
export namespace ReportApproval {
|
||||
export type ReportType = 'REPORT_MODEL' | 'TEST_REPORT' | (string & {})
|
||||
export type ReportState = '01' | '02' | '03' | '04' | '05' | (string & {})
|
||||
export type ApprovalResult = '03' | '04' | (string & {})
|
||||
|
||||
export interface PendingRecord {
|
||||
reportType?: ReportType
|
||||
reportId?: string
|
||||
reportName?: string | null
|
||||
state?: ReportState
|
||||
submitterId?: string | null
|
||||
submitterName?: string | null
|
||||
submitTime?: string | null
|
||||
}
|
||||
|
||||
export interface PendingListParams {
|
||||
current?: number
|
||||
size?: number
|
||||
reportType?: ReportType | ''
|
||||
}
|
||||
|
||||
export interface ApprovalActionRequest {
|
||||
reportType: ReportType
|
||||
reportId: string
|
||||
approvalReason: string
|
||||
}
|
||||
|
||||
export interface LogRecord {
|
||||
id?: string
|
||||
reportType?: ReportType
|
||||
reportId?: string
|
||||
reportName?: string | null
|
||||
approvalResult?: ApprovalResult
|
||||
approvalReason?: string | null
|
||||
beforeState?: ReportState
|
||||
afterState?: ReportState
|
||||
approverName?: string | null
|
||||
approvalTime?: string | null
|
||||
}
|
||||
|
||||
export interface LogListParams {
|
||||
current?: number
|
||||
size?: number
|
||||
reportType?: ReportType | ''
|
||||
}
|
||||
}
|
||||
49
frontend/src/api/aireport/reportModel/index.ts
Normal file
49
frontend/src/api/aireport/reportModel/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import http from '@/api'
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import type { ReportModel } from './interface'
|
||||
|
||||
const REPORT_MODEL_BASE_URL = '/api/report-model'
|
||||
|
||||
const buildReportModelFormData = (request: ReportModel.ReportModelSaveRequest, templateFile?: File | null) => {
|
||||
const formData = new FormData()
|
||||
|
||||
// 关键业务节点:后端按 @RequestPart("request") 读取 JSON 分段,字段名不能改成普通表单字段。
|
||||
formData.append('request', new Blob([JSON.stringify(request)], { type: 'application/json' }))
|
||||
|
||||
if (templateFile) {
|
||||
formData.append('templateFile', templateFile)
|
||||
}
|
||||
|
||||
return formData
|
||||
}
|
||||
|
||||
export const listReportModelsApi = (params: ReportModel.ReportModelListParams) => {
|
||||
return http.post('/api/report-model/list', params)
|
||||
}
|
||||
|
||||
export const getReportModelDetailApi = (id: string) => {
|
||||
return http.get<ReportModel.ReportModelRecord>(`${REPORT_MODEL_BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
export const createReportModelApi = (request: ReportModel.ReportModelSaveRequest, templateFile: File) => {
|
||||
return http.post<boolean>(`${REPORT_MODEL_BASE_URL}/add`, buildReportModelFormData(request, templateFile), {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
export const updateReportModelApi = (request: ReportModel.ReportModelSaveRequest, templateFile?: File | null) => {
|
||||
return http.post<boolean>(`${REPORT_MODEL_BASE_URL}/update`, buildReportModelFormData(request, templateFile), {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteReportModelsApi = (ids: string[]) => {
|
||||
return http.post<boolean>(`${REPORT_MODEL_BASE_URL}/delete`, ids)
|
||||
}
|
||||
|
||||
export const downloadReportModelApi = (id: string): Promise<AxiosResponse<Blob>> =>
|
||||
http.get(`${REPORT_MODEL_BASE_URL}/${id}/download`, undefined, { responseType: 'blob' }) as unknown as Promise<AxiosResponse<Blob>>
|
||||
|
||||
export const submitReportModelAuditApi = (params: ReportModel.ReportModelAuditRequest) => {
|
||||
return http.post<boolean>(`${REPORT_MODEL_BASE_URL}/submit-audit`, params)
|
||||
}
|
||||
43
frontend/src/api/aireport/reportModel/interface/index.ts
Normal file
43
frontend/src/api/aireport/reportModel/interface/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export namespace ReportModel {
|
||||
export type ReportModelState = '01' | '02' | '03' | '04' | (string & {})
|
||||
|
||||
export interface ReportModelRecord {
|
||||
id?: string
|
||||
name?: string
|
||||
state?: ReportModelState
|
||||
checkId?: string | null
|
||||
checkerName?: string | null
|
||||
checkTime?: string | null
|
||||
checkResult?: string | null
|
||||
path?: string | null
|
||||
fileName?: string | null
|
||||
file_name?: string | null
|
||||
status?: number
|
||||
createBy?: string | null
|
||||
createTime?: string | null
|
||||
updateBy?: string | null
|
||||
editorName?: string | null
|
||||
updateTime?: string | null
|
||||
}
|
||||
|
||||
export interface ReportModelListParams {
|
||||
name?: string
|
||||
state?: ReportModelState | ''
|
||||
searchBeginTime?: string
|
||||
searchEndTime?: string
|
||||
timeRange?: string[]
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface ReportModelSaveRequest {
|
||||
id?: string
|
||||
name: string
|
||||
fileName?: string
|
||||
}
|
||||
|
||||
export interface ReportModelAuditRequest {
|
||||
id: string
|
||||
checkResult?: string
|
||||
}
|
||||
}
|
||||
77
frontend/src/api/aireport/testDevice/index.ts
Normal file
77
frontend/src/api/aireport/testDevice/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import http from '@/api'
|
||||
import type { TestDevice } from './interface'
|
||||
|
||||
const TEST_DEVICE_BASE_URL = '/api/test-device'
|
||||
|
||||
const buildTestDeviceFormData = (request: TestDevice.TestDeviceSaveRequest, reportFile?: File | null) => {
|
||||
const formData = new FormData()
|
||||
|
||||
// 关键业务节点:检测设备新增/编辑接口按 request JSON 分段读取业务字段,报告文件单独传 reportFile。
|
||||
formData.append('request', new Blob([JSON.stringify(request)], { type: 'application/json' }))
|
||||
|
||||
if (reportFile) {
|
||||
formData.append('reportFile', reportFile)
|
||||
}
|
||||
|
||||
return formData
|
||||
}
|
||||
|
||||
const buildTestDeviceImportFormData = (file: File, reportZip: File) => {
|
||||
const formData = new FormData()
|
||||
|
||||
formData.append('file', file)
|
||||
formData.append('reportZip', reportZip)
|
||||
|
||||
return formData
|
||||
}
|
||||
|
||||
export const listTestDevicesApi = (params: TestDevice.TestDeviceListParams) => {
|
||||
return http.post(`${TEST_DEVICE_BASE_URL}/list`, params)
|
||||
}
|
||||
|
||||
export const createTestDeviceApi = (request: TestDevice.TestDeviceSaveRequest, reportFile: File) => {
|
||||
return http.post<boolean>(`${TEST_DEVICE_BASE_URL}/add`, buildTestDeviceFormData(request, reportFile), {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
export const updateTestDeviceApi = (request: TestDevice.TestDeviceSaveRequest, reportFile?: File | null) => {
|
||||
return http.post<boolean>(`${TEST_DEVICE_BASE_URL}/update`, buildTestDeviceFormData(request, reportFile), {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteTestDevicesApi = (ids: string[]) => {
|
||||
return http.post<boolean>(`${TEST_DEVICE_BASE_URL}/delete`, ids)
|
||||
}
|
||||
|
||||
export const getTestDeviceDetailApi = (id: string) => {
|
||||
return http.get<TestDevice.TestDeviceRecord>(`${TEST_DEVICE_BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
export const downloadTestDeviceImportTemplateApi = () => {
|
||||
return http.get(`${TEST_DEVICE_BASE_URL}/template`, undefined, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
export const importTestDevicesApi = (file: File, reportZip: File) => {
|
||||
return http.post<TestDevice.TestDeviceImportResult>(
|
||||
`${TEST_DEVICE_BASE_URL}/import`,
|
||||
buildTestDeviceImportFormData(file, reportZip),
|
||||
{
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export const exportTestDevicesApi = (params: TestDevice.TestDeviceListParams) => {
|
||||
return http.get(`${TEST_DEVICE_BASE_URL}/export`, params, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
export const previewTestDeviceReportApi = (id: string) => {
|
||||
// 关键业务节点:test-device 当前仅提供 /{id}/report,预览与下载统一复用同一报告流,避免前端误调不存在的 preview 接口。
|
||||
return http.get(`${TEST_DEVICE_BASE_URL}/${id}/report`, undefined, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
export const downloadTestDeviceReportApi = (id: string) => {
|
||||
return http.get(`${TEST_DEVICE_BASE_URL}/${id}/report`, undefined, { responseType: 'blob' })
|
||||
}
|
||||
45
frontend/src/api/aireport/testDevice/interface/index.ts
Normal file
45
frontend/src/api/aireport/testDevice/interface/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export namespace TestDevice {
|
||||
export type TestDeviceState = '01' | '02' | (string & {})
|
||||
|
||||
export interface TestDeviceRecord {
|
||||
id?: string
|
||||
type?: string | null
|
||||
typeName?: string | null
|
||||
no?: string | null
|
||||
validityPeriod?: string | null
|
||||
validityReport?: string | null
|
||||
validityReportName?: string | null
|
||||
validityReportUrl?: string | null
|
||||
state?: TestDeviceState
|
||||
status?: number
|
||||
createBy?: string | null
|
||||
createByName?: string | null
|
||||
createTime?: string | null
|
||||
updateBy?: string | null
|
||||
updateByName?: string | null
|
||||
updateTime?: string | null
|
||||
}
|
||||
|
||||
export interface TestDeviceListParams {
|
||||
keyword?: string
|
||||
searchBeginTime?: string
|
||||
searchEndTime?: string
|
||||
timeRange?: string[]
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface TestDeviceSaveRequest {
|
||||
id?: string
|
||||
type: string
|
||||
no: string
|
||||
validityPeriod: string
|
||||
state?: TestDeviceState
|
||||
}
|
||||
|
||||
export interface TestDeviceImportResult {
|
||||
successCount?: number
|
||||
failCount?: number
|
||||
failReasons?: string[]
|
||||
}
|
||||
}
|
||||
32
frontend/src/api/aireport/testReport/index.ts
Normal file
32
frontend/src/api/aireport/testReport/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import http from '@/api'
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import type { ReportTask } from './interface'
|
||||
|
||||
const REPORT_TASK_BASE_URL = '/api/test-report'
|
||||
|
||||
export const listReportTasksApi = (params: ReportTask.ReportTaskListParams) => {
|
||||
return http.post(`${REPORT_TASK_BASE_URL}/list`, params)
|
||||
}
|
||||
|
||||
export const createReportTaskApi = (params: ReportTask.ReportTaskSaveRequest) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_BASE_URL}/add`, params)
|
||||
}
|
||||
|
||||
export const updateReportTaskApi = (params: ReportTask.ReportTaskSaveRequest) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_BASE_URL}/update`, params)
|
||||
}
|
||||
|
||||
export const deleteReportTasksApi = (ids: string[]) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_BASE_URL}/delete`, ids)
|
||||
}
|
||||
|
||||
export const getReportTaskDetailApi = (id: string) => {
|
||||
return http.get<ReportTask.ReportTaskRecord>(`${REPORT_TASK_BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
export const exportReportTasksApi = (params: ReportTask.ReportTaskListParams): Promise<AxiosResponse<Blob>> =>
|
||||
http.get(`${REPORT_TASK_BASE_URL}/export`, params, { responseType: 'blob' }) as unknown as Promise<AxiosResponse<Blob>>
|
||||
|
||||
export const submitReportTaskAuditApi = (params: ReportTask.ReportTaskAuditRequest) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_BASE_URL}/submit-audit`, params)
|
||||
}
|
||||
52
frontend/src/api/aireport/testReport/interface/index.ts
Normal file
52
frontend/src/api/aireport/testReport/interface/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
export namespace ReportTask {
|
||||
export interface ReportTaskRecord {
|
||||
id?: string
|
||||
no?: string | null
|
||||
clientUnitId?: string | null
|
||||
clientUnitName?: string | null
|
||||
reportModelId?: string | null
|
||||
reportModelName?: string | null
|
||||
createUnit?: string | null
|
||||
contractNumber?: string | null
|
||||
standard?: string[] | string | null
|
||||
data?: string | null
|
||||
phonenumber?: string | null
|
||||
checkId?: string | null
|
||||
checkerName?: string | null
|
||||
checkTime?: string | null
|
||||
checkResult?: string | null
|
||||
status?: number
|
||||
createBy?: string | null
|
||||
createByName?: string | null
|
||||
createTime?: string | null
|
||||
updateBy?: string | null
|
||||
updateByName?: string | null
|
||||
updateTime?: string | null
|
||||
}
|
||||
|
||||
export interface ReportTaskListParams {
|
||||
keyword?: string
|
||||
searchBeginTime?: string
|
||||
searchEndTime?: string
|
||||
timeRange?: string[]
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface ReportTaskSaveRequest {
|
||||
id?: string
|
||||
no: string
|
||||
clientUnitId: string
|
||||
reportModelId: string
|
||||
createUnit: string
|
||||
contractNumber: string
|
||||
standard: string[]
|
||||
data: string
|
||||
phonenumber?: string
|
||||
}
|
||||
|
||||
export interface ReportTaskAuditRequest {
|
||||
id: string
|
||||
checkResult?: string
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user