openxiangda 1.0.140 → 1.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/sdk/dist/{ProcessPreview-CZJP8n3e.d.mts → ProcessPreview-CsOTCTRT.d.mts} +1 -1
- package/packages/sdk/dist/{ProcessPreview-CZJP8n3e.d.ts → ProcessPreview-CsOTCTRT.d.ts} +1 -1
- package/packages/sdk/dist/components/index.cjs +80 -11
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.d.mts +6 -136
- package/packages/sdk/dist/components/index.d.ts +6 -136
- package/packages/sdk/dist/components/index.mjs +80 -11
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/dataManagementApi-C1OKWpP7.d.mts +141 -0
- package/packages/sdk/dist/dataManagementApi-Cd1axl3v.d.ts +141 -0
- package/packages/sdk/dist/runtime/index.cjs +82 -67
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +3 -3
- package/packages/sdk/dist/runtime/index.d.ts +3 -3
- package/packages/sdk/dist/runtime/index.mjs +82 -67
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +1 -1
- package/packages/sdk/dist/runtime/react.d.ts +1 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { F as FieldDefinition, a as FormRuntimeApi, R as RuntimeResponse, b as FormSchema } from './ProcessPreview-CsOTCTRT.mjs';
|
|
2
|
+
|
|
3
|
+
type DataManagementConfigScope = 'global' | 'personal';
|
|
4
|
+
type DataManagementDensity = 'compact' | 'middle' | 'loose';
|
|
5
|
+
type FilterLogic = 'AND' | 'OR';
|
|
6
|
+
interface DataManagementField extends FieldDefinition {
|
|
7
|
+
id: string;
|
|
8
|
+
fieldId: string;
|
|
9
|
+
componentName: string;
|
|
10
|
+
label: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
system?: boolean;
|
|
13
|
+
processOnly?: boolean;
|
|
14
|
+
displayable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface NormalizeDataManagementFieldsOptions {
|
|
17
|
+
appType?: string;
|
|
18
|
+
formUuid?: string;
|
|
19
|
+
}
|
|
20
|
+
interface DataManagementFilterRule {
|
|
21
|
+
id: string;
|
|
22
|
+
key: string;
|
|
23
|
+
operator: string;
|
|
24
|
+
value: any;
|
|
25
|
+
componentName?: string;
|
|
26
|
+
}
|
|
27
|
+
interface DataManagementFilterGroup {
|
|
28
|
+
id: string;
|
|
29
|
+
logic: FilterLogic;
|
|
30
|
+
rules: DataManagementFilterRule[];
|
|
31
|
+
conditions: DataManagementFilterGroup[];
|
|
32
|
+
}
|
|
33
|
+
interface DataManagementSort {
|
|
34
|
+
id: string;
|
|
35
|
+
isAsc: 'y' | 'n';
|
|
36
|
+
}
|
|
37
|
+
interface DataManagementConfig {
|
|
38
|
+
showFields?: string[];
|
|
39
|
+
widths?: Record<string, number>;
|
|
40
|
+
lockFieldIds?: string[];
|
|
41
|
+
sort?: DataManagementSort[];
|
|
42
|
+
filter?: {
|
|
43
|
+
searchKeyWord?: string;
|
|
44
|
+
group?: DataManagementFilterGroup;
|
|
45
|
+
};
|
|
46
|
+
density?: DataManagementDensity;
|
|
47
|
+
detailOpenMode?: 'drawer' | 'newPage';
|
|
48
|
+
pageSize?: number;
|
|
49
|
+
showForcedConfig?: boolean;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
interface DataManagementQuery {
|
|
53
|
+
appType: string;
|
|
54
|
+
formUuid: string;
|
|
55
|
+
filters?: DataManagementFilterGroup;
|
|
56
|
+
rawFilters?: string;
|
|
57
|
+
conditionType?: FilterLogic;
|
|
58
|
+
searchKeyWord?: string;
|
|
59
|
+
currentPage?: number;
|
|
60
|
+
pageSize?: number;
|
|
61
|
+
order?: DataManagementSort[];
|
|
62
|
+
instanceStatus?: string;
|
|
63
|
+
}
|
|
64
|
+
interface DataManagementListResult {
|
|
65
|
+
records: any[];
|
|
66
|
+
total: number;
|
|
67
|
+
}
|
|
68
|
+
interface DataManagementApiOptions {
|
|
69
|
+
appType: string;
|
|
70
|
+
formUuid: string;
|
|
71
|
+
menuFormUuid?: string;
|
|
72
|
+
scope?: DataManagementConfigScope;
|
|
73
|
+
}
|
|
74
|
+
type FormActionPermission = 'view' | 'create' | 'edit' | 'delete' | 'export' | 'import' | 'change_records' | 'workflow';
|
|
75
|
+
declare const extractFieldsFromComponentsTree: (componentsTree: any) => FieldDefinition[];
|
|
76
|
+
declare const getSystemFieldsForFormType: (formType?: string) => DataManagementField[];
|
|
77
|
+
declare const normalizeDataManagementFields: (payload: any, options?: NormalizeDataManagementFieldsOptions) => {
|
|
78
|
+
fields: DataManagementField[];
|
|
79
|
+
formType?: string;
|
|
80
|
+
schema?: FormSchema;
|
|
81
|
+
};
|
|
82
|
+
declare const normalizeDataManagementList: (payload: any) => DataManagementListResult;
|
|
83
|
+
declare const buildFilterPayload: (group?: DataManagementFilterGroup) => string | undefined;
|
|
84
|
+
declare const normalizeColumnConfig: (cfg: DataManagementConfig | undefined, fields: DataManagementField[]) => Required<Pick<DataManagementConfig, "showFields" | "widths" | "lockFieldIds" | "sort">> & {
|
|
85
|
+
density: DataManagementDensity;
|
|
86
|
+
detailOpenMode: "drawer" | "newPage";
|
|
87
|
+
pageSize: number;
|
|
88
|
+
};
|
|
89
|
+
declare function getDataManagementSchema(request: FormRuntimeApi['request'], params: {
|
|
90
|
+
appType: string;
|
|
91
|
+
formUuid: string;
|
|
92
|
+
}): Promise<{
|
|
93
|
+
fields: DataManagementField[];
|
|
94
|
+
formType?: string;
|
|
95
|
+
schema?: FormSchema;
|
|
96
|
+
}>;
|
|
97
|
+
declare function getDataManagementConfig(request: FormRuntimeApi['request'], options: DataManagementApiOptions): Promise<DataManagementConfig | undefined>;
|
|
98
|
+
declare function saveDataManagementConfig(request: FormRuntimeApi['request'], options: DataManagementApiOptions & {
|
|
99
|
+
config: DataManagementConfig;
|
|
100
|
+
}): Promise<any>;
|
|
101
|
+
declare function advancedSearchDataManagement(request: FormRuntimeApi['request'], query: DataManagementQuery): Promise<DataManagementListResult>;
|
|
102
|
+
declare function deleteDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
103
|
+
appType: string;
|
|
104
|
+
formUuid: string;
|
|
105
|
+
formInstanceIds: string[];
|
|
106
|
+
}): Promise<any>;
|
|
107
|
+
declare function batchApproveDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
108
|
+
appType: string;
|
|
109
|
+
formUuid: string;
|
|
110
|
+
formInstanceIds: string[];
|
|
111
|
+
action: 'approved' | 'rejected';
|
|
112
|
+
comments?: string;
|
|
113
|
+
}): Promise<any>;
|
|
114
|
+
declare function exportDataManagementRows(request: FormRuntimeApi['request'], params: DataManagementQuery & {
|
|
115
|
+
exportAll?: 'y' | 'n';
|
|
116
|
+
embedImages?: 'y' | 'n';
|
|
117
|
+
exportFields?: string[];
|
|
118
|
+
}): Promise<Blob | RuntimeResponse<any>>;
|
|
119
|
+
declare function downloadDataManagementImportTemplate(request: FormRuntimeApi['request'], params: {
|
|
120
|
+
appType: string;
|
|
121
|
+
formUuid: string;
|
|
122
|
+
}): Promise<Blob | RuntimeResponse<any>>;
|
|
123
|
+
declare function importPreviewDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
124
|
+
appType: string;
|
|
125
|
+
formUuid: string;
|
|
126
|
+
fileBase64: string;
|
|
127
|
+
}): Promise<any>;
|
|
128
|
+
declare function importDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
129
|
+
appType: string;
|
|
130
|
+
formUuid: string;
|
|
131
|
+
fileBase64: string;
|
|
132
|
+
}): Promise<any>;
|
|
133
|
+
declare function getDataManagementTransferRecords(request: FormRuntimeApi['request'], params: {
|
|
134
|
+
appType: string;
|
|
135
|
+
formUuid: string;
|
|
136
|
+
type: 'import' | 'export';
|
|
137
|
+
currentPage?: number;
|
|
138
|
+
pageSize?: number;
|
|
139
|
+
}): Promise<DataManagementListResult>;
|
|
140
|
+
|
|
141
|
+
export { type DataManagementConfigScope as D, type FormActionPermission as F, type DataManagementConfig as a, type DataManagementDensity as b, type DataManagementField as c, type DataManagementFilterGroup as d, extractFieldsFromComponentsTree as e, type DataManagementFilterRule as f, type DataManagementListResult as g, type DataManagementQuery as h, type DataManagementSort as i, advancedSearchDataManagement as j, batchApproveDataManagementRows as k, buildFilterPayload as l, deleteDataManagementRows as m, downloadDataManagementImportTemplate as n, exportDataManagementRows as o, getDataManagementConfig as p, getDataManagementSchema as q, getDataManagementTransferRecords as r, getSystemFieldsForFormType as s, importDataManagementRows as t, importPreviewDataManagementRows as u, normalizeColumnConfig as v, normalizeDataManagementFields as w, normalizeDataManagementList as x, saveDataManagementConfig as y };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { F as FieldDefinition, a as FormRuntimeApi, R as RuntimeResponse, b as FormSchema } from './ProcessPreview-CsOTCTRT.js';
|
|
2
|
+
|
|
3
|
+
type DataManagementConfigScope = 'global' | 'personal';
|
|
4
|
+
type DataManagementDensity = 'compact' | 'middle' | 'loose';
|
|
5
|
+
type FilterLogic = 'AND' | 'OR';
|
|
6
|
+
interface DataManagementField extends FieldDefinition {
|
|
7
|
+
id: string;
|
|
8
|
+
fieldId: string;
|
|
9
|
+
componentName: string;
|
|
10
|
+
label: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
system?: boolean;
|
|
13
|
+
processOnly?: boolean;
|
|
14
|
+
displayable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface NormalizeDataManagementFieldsOptions {
|
|
17
|
+
appType?: string;
|
|
18
|
+
formUuid?: string;
|
|
19
|
+
}
|
|
20
|
+
interface DataManagementFilterRule {
|
|
21
|
+
id: string;
|
|
22
|
+
key: string;
|
|
23
|
+
operator: string;
|
|
24
|
+
value: any;
|
|
25
|
+
componentName?: string;
|
|
26
|
+
}
|
|
27
|
+
interface DataManagementFilterGroup {
|
|
28
|
+
id: string;
|
|
29
|
+
logic: FilterLogic;
|
|
30
|
+
rules: DataManagementFilterRule[];
|
|
31
|
+
conditions: DataManagementFilterGroup[];
|
|
32
|
+
}
|
|
33
|
+
interface DataManagementSort {
|
|
34
|
+
id: string;
|
|
35
|
+
isAsc: 'y' | 'n';
|
|
36
|
+
}
|
|
37
|
+
interface DataManagementConfig {
|
|
38
|
+
showFields?: string[];
|
|
39
|
+
widths?: Record<string, number>;
|
|
40
|
+
lockFieldIds?: string[];
|
|
41
|
+
sort?: DataManagementSort[];
|
|
42
|
+
filter?: {
|
|
43
|
+
searchKeyWord?: string;
|
|
44
|
+
group?: DataManagementFilterGroup;
|
|
45
|
+
};
|
|
46
|
+
density?: DataManagementDensity;
|
|
47
|
+
detailOpenMode?: 'drawer' | 'newPage';
|
|
48
|
+
pageSize?: number;
|
|
49
|
+
showForcedConfig?: boolean;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
interface DataManagementQuery {
|
|
53
|
+
appType: string;
|
|
54
|
+
formUuid: string;
|
|
55
|
+
filters?: DataManagementFilterGroup;
|
|
56
|
+
rawFilters?: string;
|
|
57
|
+
conditionType?: FilterLogic;
|
|
58
|
+
searchKeyWord?: string;
|
|
59
|
+
currentPage?: number;
|
|
60
|
+
pageSize?: number;
|
|
61
|
+
order?: DataManagementSort[];
|
|
62
|
+
instanceStatus?: string;
|
|
63
|
+
}
|
|
64
|
+
interface DataManagementListResult {
|
|
65
|
+
records: any[];
|
|
66
|
+
total: number;
|
|
67
|
+
}
|
|
68
|
+
interface DataManagementApiOptions {
|
|
69
|
+
appType: string;
|
|
70
|
+
formUuid: string;
|
|
71
|
+
menuFormUuid?: string;
|
|
72
|
+
scope?: DataManagementConfigScope;
|
|
73
|
+
}
|
|
74
|
+
type FormActionPermission = 'view' | 'create' | 'edit' | 'delete' | 'export' | 'import' | 'change_records' | 'workflow';
|
|
75
|
+
declare const extractFieldsFromComponentsTree: (componentsTree: any) => FieldDefinition[];
|
|
76
|
+
declare const getSystemFieldsForFormType: (formType?: string) => DataManagementField[];
|
|
77
|
+
declare const normalizeDataManagementFields: (payload: any, options?: NormalizeDataManagementFieldsOptions) => {
|
|
78
|
+
fields: DataManagementField[];
|
|
79
|
+
formType?: string;
|
|
80
|
+
schema?: FormSchema;
|
|
81
|
+
};
|
|
82
|
+
declare const normalizeDataManagementList: (payload: any) => DataManagementListResult;
|
|
83
|
+
declare const buildFilterPayload: (group?: DataManagementFilterGroup) => string | undefined;
|
|
84
|
+
declare const normalizeColumnConfig: (cfg: DataManagementConfig | undefined, fields: DataManagementField[]) => Required<Pick<DataManagementConfig, "showFields" | "widths" | "lockFieldIds" | "sort">> & {
|
|
85
|
+
density: DataManagementDensity;
|
|
86
|
+
detailOpenMode: "drawer" | "newPage";
|
|
87
|
+
pageSize: number;
|
|
88
|
+
};
|
|
89
|
+
declare function getDataManagementSchema(request: FormRuntimeApi['request'], params: {
|
|
90
|
+
appType: string;
|
|
91
|
+
formUuid: string;
|
|
92
|
+
}): Promise<{
|
|
93
|
+
fields: DataManagementField[];
|
|
94
|
+
formType?: string;
|
|
95
|
+
schema?: FormSchema;
|
|
96
|
+
}>;
|
|
97
|
+
declare function getDataManagementConfig(request: FormRuntimeApi['request'], options: DataManagementApiOptions): Promise<DataManagementConfig | undefined>;
|
|
98
|
+
declare function saveDataManagementConfig(request: FormRuntimeApi['request'], options: DataManagementApiOptions & {
|
|
99
|
+
config: DataManagementConfig;
|
|
100
|
+
}): Promise<any>;
|
|
101
|
+
declare function advancedSearchDataManagement(request: FormRuntimeApi['request'], query: DataManagementQuery): Promise<DataManagementListResult>;
|
|
102
|
+
declare function deleteDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
103
|
+
appType: string;
|
|
104
|
+
formUuid: string;
|
|
105
|
+
formInstanceIds: string[];
|
|
106
|
+
}): Promise<any>;
|
|
107
|
+
declare function batchApproveDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
108
|
+
appType: string;
|
|
109
|
+
formUuid: string;
|
|
110
|
+
formInstanceIds: string[];
|
|
111
|
+
action: 'approved' | 'rejected';
|
|
112
|
+
comments?: string;
|
|
113
|
+
}): Promise<any>;
|
|
114
|
+
declare function exportDataManagementRows(request: FormRuntimeApi['request'], params: DataManagementQuery & {
|
|
115
|
+
exportAll?: 'y' | 'n';
|
|
116
|
+
embedImages?: 'y' | 'n';
|
|
117
|
+
exportFields?: string[];
|
|
118
|
+
}): Promise<Blob | RuntimeResponse<any>>;
|
|
119
|
+
declare function downloadDataManagementImportTemplate(request: FormRuntimeApi['request'], params: {
|
|
120
|
+
appType: string;
|
|
121
|
+
formUuid: string;
|
|
122
|
+
}): Promise<Blob | RuntimeResponse<any>>;
|
|
123
|
+
declare function importPreviewDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
124
|
+
appType: string;
|
|
125
|
+
formUuid: string;
|
|
126
|
+
fileBase64: string;
|
|
127
|
+
}): Promise<any>;
|
|
128
|
+
declare function importDataManagementRows(request: FormRuntimeApi['request'], params: {
|
|
129
|
+
appType: string;
|
|
130
|
+
formUuid: string;
|
|
131
|
+
fileBase64: string;
|
|
132
|
+
}): Promise<any>;
|
|
133
|
+
declare function getDataManagementTransferRecords(request: FormRuntimeApi['request'], params: {
|
|
134
|
+
appType: string;
|
|
135
|
+
formUuid: string;
|
|
136
|
+
type: 'import' | 'export';
|
|
137
|
+
currentPage?: number;
|
|
138
|
+
pageSize?: number;
|
|
139
|
+
}): Promise<DataManagementListResult>;
|
|
140
|
+
|
|
141
|
+
export { type DataManagementConfigScope as D, type FormActionPermission as F, type DataManagementConfig as a, type DataManagementDensity as b, type DataManagementField as c, type DataManagementFilterGroup as d, extractFieldsFromComponentsTree as e, type DataManagementFilterRule as f, type DataManagementListResult as g, type DataManagementQuery as h, type DataManagementSort as i, advancedSearchDataManagement as j, batchApproveDataManagementRows as k, buildFilterPayload as l, deleteDataManagementRows as m, downloadDataManagementImportTemplate as n, exportDataManagementRows as o, getDataManagementConfig as p, getDataManagementSchema as q, getDataManagementTransferRecords as r, getSystemFieldsForFormType as s, importDataManagementRows as t, importPreviewDataManagementRows as u, normalizeColumnConfig as v, normalizeDataManagementFields as w, normalizeDataManagementList as x, saveDataManagementConfig as y };
|
|
@@ -21494,6 +21494,60 @@ var unwrap = (response) => {
|
|
|
21494
21494
|
return response;
|
|
21495
21495
|
};
|
|
21496
21496
|
var pickData = (value) => value?.data ?? value?.result ?? value;
|
|
21497
|
+
var normalizePlatformComponentName = (componentName) => {
|
|
21498
|
+
const value = String(componentName || "").trim();
|
|
21499
|
+
return value || "TextField";
|
|
21500
|
+
};
|
|
21501
|
+
var extractSlotNodes = (value) => {
|
|
21502
|
+
if (!value) return [];
|
|
21503
|
+
if (Array.isArray(value)) {
|
|
21504
|
+
return value.flatMap((item) => extractSlotNodes(item));
|
|
21505
|
+
}
|
|
21506
|
+
if (typeof value !== "object") return [];
|
|
21507
|
+
if (value.type === "JSSlot" && value.value) {
|
|
21508
|
+
return extractSlotNodes(value.value);
|
|
21509
|
+
}
|
|
21510
|
+
if (value.componentName || Array.isArray(value.children)) {
|
|
21511
|
+
return [value];
|
|
21512
|
+
}
|
|
21513
|
+
return Object.values(value).flatMap((item) => extractSlotNodes(item));
|
|
21514
|
+
};
|
|
21515
|
+
var extractFieldsFromComponentsTree = (componentsTree) => {
|
|
21516
|
+
const roots = Array.isArray(componentsTree) ? componentsTree : [componentsTree];
|
|
21517
|
+
const fields = [];
|
|
21518
|
+
const seen = /* @__PURE__ */ new Set();
|
|
21519
|
+
const walk = (components) => {
|
|
21520
|
+
if (!Array.isArray(components)) return;
|
|
21521
|
+
components.forEach((component) => {
|
|
21522
|
+
if (!component || typeof component !== "object") return;
|
|
21523
|
+
const props = component.props || {};
|
|
21524
|
+
const fieldId = String(props.fieldId || component.fieldId || component.id || "").trim();
|
|
21525
|
+
if (props.isFormComponent === true && fieldId && !seen.has(fieldId)) {
|
|
21526
|
+
seen.add(fieldId);
|
|
21527
|
+
fields.push({
|
|
21528
|
+
...props,
|
|
21529
|
+
id: props.id || component.id || fieldId,
|
|
21530
|
+
fieldId,
|
|
21531
|
+
componentName: normalizePlatformComponentName(
|
|
21532
|
+
props.componentName || component.componentName
|
|
21533
|
+
),
|
|
21534
|
+
label: props.label || component.title || props.title || fieldId,
|
|
21535
|
+
title: props.title || component.title || props.label || fieldId,
|
|
21536
|
+
required: props.required ?? component.required
|
|
21537
|
+
});
|
|
21538
|
+
}
|
|
21539
|
+
if (component.componentName === "SubFormField") return;
|
|
21540
|
+
if (Array.isArray(component.children)) {
|
|
21541
|
+
walk(component.children);
|
|
21542
|
+
}
|
|
21543
|
+
Object.values(props).forEach((propValue) => {
|
|
21544
|
+
walk(extractSlotNodes(propValue));
|
|
21545
|
+
});
|
|
21546
|
+
});
|
|
21547
|
+
};
|
|
21548
|
+
walk(roots);
|
|
21549
|
+
return fields;
|
|
21550
|
+
};
|
|
21497
21551
|
var normalizeActionSummary = (value) => {
|
|
21498
21552
|
const raw = pickData(value) || {};
|
|
21499
21553
|
const actions = Array.from(
|
|
@@ -21522,6 +21576,11 @@ var normalizeField = (key, field, system = false) => ({
|
|
|
21522
21576
|
width: field?.width,
|
|
21523
21577
|
system
|
|
21524
21578
|
});
|
|
21579
|
+
var createDefaultLayout = (fields) => fields.map((field) => ({
|
|
21580
|
+
id: `layout_${field.fieldId}`,
|
|
21581
|
+
type: "field",
|
|
21582
|
+
fieldId: field.fieldId
|
|
21583
|
+
}));
|
|
21525
21584
|
var SYSTEM_VALUE_ALIASES = {
|
|
21526
21585
|
formInstanceId: ["formInstanceId", "formInstId", "form_instance_id", "processInstanceId"],
|
|
21527
21586
|
instanceTitle: ["instanceTitle", "instance_title", "processInstanceTitle", "title"],
|
|
@@ -21635,20 +21694,25 @@ var BASE_SYSTEM_FIELDS = [
|
|
|
21635
21694
|
)
|
|
21636
21695
|
];
|
|
21637
21696
|
var getSystemFieldsForFormType = (formType) => formType === "process" ? [...BASE_SYSTEM_FIELDS, ...PROCESS_SYSTEM_FIELDS] : BASE_SYSTEM_FIELDS;
|
|
21638
|
-
var normalizeDataManagementFields = (payload) => {
|
|
21697
|
+
var normalizeDataManagementFields = (payload, options = {}) => {
|
|
21639
21698
|
const data = pickData(payload);
|
|
21640
21699
|
const rawSchema = data?.schema || data?.formSchema || data?.publishedSchema || data;
|
|
21641
|
-
const schemaAppType = rawSchema?.formMeta?.appType || data?.appType;
|
|
21642
|
-
const schemaFormUuid = rawSchema?.formMeta?.formUuid || data?.formUuid;
|
|
21643
|
-
const schemaTitle = rawSchema?.formMeta?.title || data?.title || data?.name || data?.formName || schemaFormUuid;
|
|
21644
|
-
const formType = data?.formType || data?.schema?.formType || data?.schema?.template?.formType || rawSchema?.template?.formType || data?.type;
|
|
21645
|
-
const rawFields = data?.formFields || data?.schema?.formFields || data?.fields || data?.schema?.fields || data?.formSchema?.fields || [];
|
|
21646
|
-
const
|
|
21700
|
+
const schemaAppType = rawSchema?.formMeta?.appType || rawSchema?.appType || data?.appType || options.appType;
|
|
21701
|
+
const schemaFormUuid = rawSchema?.formMeta?.formUuid || rawSchema?.formUuid || data?.formUuid || options.formUuid;
|
|
21702
|
+
const schemaTitle = rawSchema?.formMeta?.title || rawSchema?.title || data?.title || data?.name || data?.formName || schemaFormUuid;
|
|
21703
|
+
const formType = data?.formType || data?.schema?.formType || data?.schema?.template?.formType || rawSchema?.formType || rawSchema?.template?.formType || data?.type;
|
|
21704
|
+
const rawFields = data?.formFields || data?.schema?.formFields || rawSchema?.formFields || data?.fields || data?.schema?.fields || data?.formSchema?.fields || rawSchema?.fields || [];
|
|
21705
|
+
const extractedFields = Array.isArray(rawFields) && rawFields.length === 0 && rawSchema?.componentsTree ? extractFieldsFromComponentsTree(rawSchema.componentsTree) : rawFields;
|
|
21706
|
+
const fields = (Array.isArray(extractedFields) ? extractedFields.map((field) => normalizeField(field?.fieldId || field?.id, field)) : Object.entries(extractedFields).map(([key, field]) => normalizeField(key, field))).filter((field) => field.componentName !== "PageSection");
|
|
21707
|
+
const schemaFields = Array.isArray(rawSchema?.fields) ? rawSchema.fields : fields;
|
|
21708
|
+
const hasSchemaFields = Array.isArray(rawSchema?.fields) || fields.length > 0;
|
|
21647
21709
|
return {
|
|
21648
|
-
fields
|
|
21710
|
+
fields,
|
|
21649
21711
|
formType,
|
|
21650
|
-
schema: rawSchema &&
|
|
21712
|
+
schema: rawSchema && hasSchemaFields && schemaAppType && schemaFormUuid ? {
|
|
21651
21713
|
...rawSchema,
|
|
21714
|
+
fields: schemaFields,
|
|
21715
|
+
layout: rawSchema.layout || createDefaultLayout(fields),
|
|
21652
21716
|
formMeta: {
|
|
21653
21717
|
formUuid: schemaFormUuid,
|
|
21654
21718
|
appType: schemaAppType,
|
|
@@ -21739,7 +21803,7 @@ async function getDataManagementSchema(request, params) {
|
|
|
21739
21803
|
method: "get",
|
|
21740
21804
|
params
|
|
21741
21805
|
});
|
|
21742
|
-
const result = normalizeDataManagementFields(response);
|
|
21806
|
+
const result = normalizeDataManagementFields(response, params);
|
|
21743
21807
|
if (result.schema) {
|
|
21744
21808
|
result.schema = {
|
|
21745
21809
|
...result.schema,
|
|
@@ -22823,6 +22887,7 @@ var DataManagementList = ({
|
|
|
22823
22887
|
title,
|
|
22824
22888
|
formTitle,
|
|
22825
22889
|
formType: propFormType,
|
|
22890
|
+
schema: providedSchema,
|
|
22826
22891
|
forcedConfig,
|
|
22827
22892
|
showForcedConfig = true,
|
|
22828
22893
|
detailRenderer,
|
|
@@ -23040,7 +23105,10 @@ var DataManagementList = ({
|
|
|
23040
23105
|
setTotal(0);
|
|
23041
23106
|
setSelectedRowKeys([]);
|
|
23042
23107
|
try {
|
|
23043
|
-
const schemaResult =
|
|
23108
|
+
const schemaResult = providedSchema ? normalizeDataManagementFields(
|
|
23109
|
+
{ appType, formUuid, schema: providedSchema },
|
|
23110
|
+
{ appType, formUuid }
|
|
23111
|
+
) : await getDataManagementSchema(request, { appType, formUuid });
|
|
23044
23112
|
if (!mounted) return;
|
|
23045
23113
|
const allFields = uniqueFields([
|
|
23046
23114
|
...schemaResult.fields,
|
|
@@ -23116,6 +23184,7 @@ var DataManagementList = ({
|
|
|
23116
23184
|
loadData,
|
|
23117
23185
|
menuFormUuid,
|
|
23118
23186
|
propFormType,
|
|
23187
|
+
providedSchema,
|
|
23119
23188
|
request,
|
|
23120
23189
|
title
|
|
23121
23190
|
]);
|
|
@@ -24062,61 +24131,7 @@ var DataManagementList = ({
|
|
|
24062
24131
|
};
|
|
24063
24132
|
|
|
24064
24133
|
// packages/sdk/src/runtime/host/formSchema.ts
|
|
24065
|
-
var
|
|
24066
|
-
const value = String(componentName || "").trim();
|
|
24067
|
-
return value || "TextField";
|
|
24068
|
-
};
|
|
24069
|
-
var extractSlotNodes = (value) => {
|
|
24070
|
-
if (!value) return [];
|
|
24071
|
-
if (Array.isArray(value)) {
|
|
24072
|
-
return value.flatMap((item) => extractSlotNodes(item));
|
|
24073
|
-
}
|
|
24074
|
-
if (typeof value !== "object") return [];
|
|
24075
|
-
if (value.type === "JSSlot" && value.value) {
|
|
24076
|
-
return extractSlotNodes(value.value);
|
|
24077
|
-
}
|
|
24078
|
-
if (value.componentName || Array.isArray(value.children)) {
|
|
24079
|
-
return [value];
|
|
24080
|
-
}
|
|
24081
|
-
return Object.values(value).flatMap((item) => extractSlotNodes(item));
|
|
24082
|
-
};
|
|
24083
|
-
var extractFieldsFromComponentsTree = (componentsTree) => {
|
|
24084
|
-
const roots = Array.isArray(componentsTree) ? componentsTree : [componentsTree];
|
|
24085
|
-
const fields = [];
|
|
24086
|
-
const seen = /* @__PURE__ */ new Set();
|
|
24087
|
-
const walk = (components) => {
|
|
24088
|
-
if (!Array.isArray(components)) return;
|
|
24089
|
-
components.forEach((component) => {
|
|
24090
|
-
if (!component || typeof component !== "object") return;
|
|
24091
|
-
const props = component.props || {};
|
|
24092
|
-
const fieldId = String(props.fieldId || component.fieldId || component.id || "").trim();
|
|
24093
|
-
if (props.isFormComponent === true && fieldId && !seen.has(fieldId)) {
|
|
24094
|
-
seen.add(fieldId);
|
|
24095
|
-
fields.push({
|
|
24096
|
-
...props,
|
|
24097
|
-
id: props.id || component.id || fieldId,
|
|
24098
|
-
fieldId,
|
|
24099
|
-
componentName: normalizePlatformComponentName(
|
|
24100
|
-
props.componentName || component.componentName
|
|
24101
|
-
),
|
|
24102
|
-
label: props.label || component.title || props.title || fieldId,
|
|
24103
|
-
title: props.title || component.title || props.label || fieldId,
|
|
24104
|
-
required: props.required ?? component.required
|
|
24105
|
-
});
|
|
24106
|
-
}
|
|
24107
|
-
if (component.componentName === "SubFormField") return;
|
|
24108
|
-
if (Array.isArray(component.children)) {
|
|
24109
|
-
walk(component.children);
|
|
24110
|
-
}
|
|
24111
|
-
Object.values(props).forEach((propValue) => {
|
|
24112
|
-
walk(extractSlotNodes(propValue));
|
|
24113
|
-
});
|
|
24114
|
-
});
|
|
24115
|
-
};
|
|
24116
|
-
walk(roots);
|
|
24117
|
-
return fields;
|
|
24118
|
-
};
|
|
24119
|
-
var createDefaultLayout = (fields) => fields.map((field) => ({
|
|
24134
|
+
var createDefaultLayout2 = (fields) => fields.map((field) => ({
|
|
24120
24135
|
id: `layout_${field.fieldId}`,
|
|
24121
24136
|
type: "field",
|
|
24122
24137
|
fieldId: field.fieldId
|
|
@@ -24132,7 +24147,7 @@ var normalizeRuntimeFormSchema = (payload, options) => {
|
|
|
24132
24147
|
return {
|
|
24133
24148
|
...rawSchema,
|
|
24134
24149
|
fields,
|
|
24135
|
-
layout: rawSchema.layout ||
|
|
24150
|
+
layout: rawSchema.layout || createDefaultLayout2(fields),
|
|
24136
24151
|
formMeta: {
|
|
24137
24152
|
appType: options.appType,
|
|
24138
24153
|
formUuid: options.formUuid,
|