| | |
| | | import { request, type ApiResponse } from './request' |
| | | import { formatBusinessTime } from '@/utils/businessTime' |
| | | |
| | | export type RevisionDataType = 'REALTIME' | 'STEP' | 'CYCLE' |
| | | export type RevisionDataType = 'REALTIME' | 'STEP' | 'CYCLE' | 'ALL' |
| | | export type RevisionOperationType = 'EDIT' | 'IMPORT' | 'DELETE' |
| | | |
| | | export const revisionDataTypeLabels: Record<RevisionDataType, string> = { REALTIME: '实时', STEP: '工步', CYCLE: '循环' } |
| | | export const revisionDataTypeLabels: Record<RevisionDataType, string> = { REALTIME: '实时', STEP: '工步', CYCLE: '循环', ALL: '三 Sheet' } |
| | | export const revisionOperationLabels: Record<RevisionOperationType, string> = { EDIT: '编辑', IMPORT: '导入', DELETE: '删除' } |
| | | export function formatRevisionTime(value: string | null | undefined) { return value ? new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'medium' }).format(new Date(value)) : '-' } |
| | | export const formatRevisionTime = formatBusinessTime |
| | | export function formatRevisionScope(value: string) { return value.replace(/^按格(?=修改)/, '') } |
| | | |
| | | export interface DataRevisionAction { |
| | | actionId: number |
| | |
| | | dataType: RevisionDataType |
| | | operationType: RevisionOperationType |
| | | scopeSummary: string |
| | | identitySummary: string |
| | | affectedRecordCount?: number |
| | | identitySummary: string | null |
| | | changesSummary: string | null |
| | | reason: string |
| | | operatorId: number | null |
| | | operatorName: string |
| | | createdAtUtc: string |
| | | createdAtUtc: number |
| | | } |
| | | |
| | | interface RevisionListResponse extends ApiResponse { total: number; rows: DataRevisionAction[] } |