export type FillFieldType = 'checkbox' | 'date' | 'multiline' | 'select' | 'text';
|
export type FillFieldValue = boolean | string;
|
export type DateControlFormat = string;
|
|
export interface FillFieldData {
|
checkboxGroupCode?: string;
|
checkboxGroupMaxSelected?: null | number;
|
checkboxGroupMinSelected?: number;
|
formulaMessage?: string;
|
formulaStatus?: 'ERROR' | 'MISSING_INPUT' | 'SUCCESS';
|
readOnly?: boolean;
|
required?: boolean;
|
type: FillFieldType;
|
value: FillFieldValue | null;
|
valueSource?: string;
|
}
|
|
export interface FillDataResponse {
|
fields: Record<string, FillFieldData>;
|
pendingSourceSync?: SourceSynchronized;
|
repeatGroups: RepeatGroup[];
|
stepStructure?: StepFillStructure;
|
}
|
|
export interface FillStep {
|
id: string;
|
name: string;
|
order: number;
|
}
|
|
export type StepProgressStatus = 'complete' | 'in-progress' | 'problem';
|
|
export const STEP_PROGRESS_LABELS: Record<StepProgressStatus, string> = {
|
complete: '已完整',
|
'in-progress': '填写中',
|
problem: '有问题',
|
};
|
|
export interface StepProgress {
|
missingCount: number;
|
problemCount: number;
|
status: StepProgressStatus;
|
step: FillStep;
|
}
|
|
export interface StepFillStructure {
|
configuration: {
|
singleStep: boolean;
|
steps: FillStep[];
|
};
|
controlSteps: Record<string, string>;
|
repeatGroupSteps: Record<string, string>;
|
}
|
|
export interface SelectOption {
|
display: string;
|
value: string;
|
}
|
|
export interface DocumentField {
|
alias: string;
|
currentValue: FillFieldValue;
|
dateFormat?: DateControlFormat;
|
internalId: string;
|
options: SelectOption[];
|
tag: string;
|
type: FillFieldType;
|
}
|
|
export interface FieldChange {
|
tag: string;
|
type: FillFieldType;
|
value: FillFieldValue;
|
}
|
|
export interface FieldApplyResult {
|
error?: string;
|
ok: boolean;
|
tag: string;
|
}
|
|
export interface SourceSyncDifference {
|
bindingId: string;
|
canClear?: boolean;
|
changed: boolean;
|
currentValue?: null | string;
|
dataType: string;
|
fieldCode: string;
|
fieldName: string;
|
previousValue?: null | string;
|
previousFetchedTime?: null | string;
|
sourceFetchedAt?: null | string;
|
sourceFieldVersionId?: null | string;
|
sourceProperty?: null | string;
|
sourcePropertyRevision?: null | number;
|
sourceOutcome?: null | string;
|
sourceRecordId?: null | string;
|
sourceRevisionId?: null | string;
|
sourceType: 'CROSS_TEMPLATE' | 'LIMS_TASK';
|
sourceValueId?: null | string;
|
}
|
|
export interface SourceSyncPreview {
|
changedCount: number;
|
differences: SourceSyncDifference[];
|
previewToken: string;
|
recordId: string;
|
recordVersion: number;
|
revisionId: string;
|
}
|
|
export interface SourceSyncCommand {
|
clearReasons?: Record<string, string>;
|
expectedRecordVersion: number;
|
operationCode: string;
|
previewToken: string;
|
}
|
|
export interface SourceSynchronized {
|
changedCount: number;
|
changedFieldCodes: string[];
|
differences: SourceSyncDifference[];
|
operationCode: string;
|
recalculatedCount: number;
|
recordId: string;
|
recordVersion: number;
|
revisionId: string;
|
}
|
|
export interface RepeatRow {
|
deleteOperationCode?: string | null;
|
deleteReason?: string | null;
|
groupCode: string;
|
rowId: string;
|
rowOrder: number;
|
status: 'ACTIVE' | 'DELETE_PREPARED' | 'PREPARED';
|
}
|
|
export interface RepeatGroup {
|
activeRowCount: number;
|
checkboxGroups?: Record<string, string>;
|
groupCode: string;
|
maxRows: number;
|
minRows: number;
|
rows: RepeatRow[];
|
}
|
|
export interface RepeatAppendForm {
|
groupCode: string;
|
operationCode: string;
|
}
|
|
export interface RepeatDeleteForm {
|
groupCode: string;
|
operationCode: string;
|
reason: string;
|
rowId: string;
|
}
|
|
export type RepeatRestoreForm = Omit<RepeatDeleteForm, 'reason'>;
|
|
export interface RepeatCloneSpec {
|
beforeRowId?: string;
|
groupCode: string;
|
rowId: string;
|
}
|