openxiangda 1.0.127 → 1.0.129
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/README.md +1 -1
- package/lib/cli.js +376 -34
- package/package.json +1 -1
- package/packages/sdk/dist/{ProcessPreview-Kexdosgu.d.mts → ProcessPreview-B2-umzSY.d.mts} +12 -6
- package/packages/sdk/dist/{ProcessPreview-Kexdosgu.d.ts → ProcessPreview-B2-umzSY.d.ts} +12 -6
- package/packages/sdk/dist/components/index.cjs +95 -16
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.d.mts +4 -3
- package/packages/sdk/dist/components/index.d.ts +4 -3
- package/packages/sdk/dist/components/index.mjs +95 -16
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +131 -16
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +2 -2
- package/packages/sdk/dist/runtime/index.d.ts +2 -2
- package/packages/sdk/dist/runtime/index.mjs +131 -16
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +34 -0
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +63 -2
- package/packages/sdk/dist/runtime/react.d.ts +63 -2
- package/packages/sdk/dist/runtime/react.mjs +34 -0
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/templates/openxiangda-react-spa/src/app/navigation.ts +8 -1
- package/templates/openxiangda-react-spa/src/app/router.tsx +6 -0
- package/templates/openxiangda-react-spa/src/pages/admin/LoginLogPage.tsx +425 -0
- package/templates/openxiangda-react-spa/src/resources/menus/menus.json +9 -0
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/app-admin.json +3 -3
- package/templates/openxiangda-react-spa/src/resources/roles/roles.json +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as FormEngineConfig, a1 as FormSchema, L as FieldBehavior, ar as OptionItem, _ as FormRuntimeApi, a0 as FormRuntimeConfig, P as FormAppearanceConfig,
|
|
2
|
-
export { a as AddressValue, b as ApprovalActionType, d as ApprovalTimeline, e as ApprovalTimelineProps, g as AssociationFormConfig, i as AssociationValue, k as AttachmentImageVariants, l as AttachmentItem, B as BaseFieldProps, m as BaseLayoutNode, D as DataFilter, s as DataLinkageCondition, t as DataLinkageConfig, v as DateRangeRestriction, w as DateRestrictionConfig, x as DateShortcutConfig, y as DateShortcutType, z as DefaultValueLinkageConfig, F as DepartmentTreeNode, H as DigitalSignatureValue, K as EditorToolbarAction, N as FieldLayoutNode, O as FieldValueSyncConfig, T as FormEffectAction, U as FormEffectCondition, V as FormEffectConditionOperator, X as FormEngineMode, Z as FormLayoutNode, a2 as FormSection, a3 as FormSectionProps, a4 as FormSubmitBehavior, a5 as FormTemplateConfig, a6 as GridLayoutCell, a7 as GridLayoutNode, a8 as ImageCompressionConfig, a9 as ImageCompressionVariantConfig, ab as ImageVariant, ae as InitiatorSelectScope, ah as LayoutVisibleWhen, ai as LinkedFormOptionConfig, ak as LocationValue, al as LowcodePageMeta, am as LowcodePageNode, an as LowcodePageNodeType, at as OptionSourceType, au as PeopleShortcutConfig, av as PeopleShortcutType, aA as ProcessNodeType, aB as ProcessPreview, aC as ProcessPreviewProps, aM as RuntimeDataQueryParams, aN as RuntimeDataQueryResult, aO as RuntimeRequestConfig, aQ as RuntimeUploadOptions,
|
|
1
|
+
import { W as FormEngineConfig, a1 as FormSchema, L as FieldBehavior, ar as OptionItem, _ as FormRuntimeApi, a0 as FormRuntimeConfig, P as FormAppearanceConfig, bc as ValidationPreset, bd as ValidationRule, S as FormEffect, $ as FormRuntimeApiConfig, as as OptionSourceConfig, aE as ProcessStatus, aY as StatusMeta, b3 as TaskStatus, c as ApprovalPermission, Q as FormDataDeleteParams, q as ChangeRecordQueryParams, p as ChangeRecordListResponse, R as FormDataQueryParams, Y as FormInstanceData, ac as InitiatorSelectCandidate, ad as InitiatorSelectRequirement, ay as ProcessBasicInfo, az as ProcessDefinition, aF as ProcessTask, aL as ReturnableNodeResult, aK as ReturnableNode, be as ViewPermissionQueryParams, bf as ViewPermissionSummary, f as ApproveParams, aw as PreviewParams, aD as ProcessRoute, aH as ResubmitParams, aI as ReturnParams, aS as SaveTaskParams, b8 as TransferParams, bg as WithdrawParams, M as FieldDefinition, aP as RuntimeResponse, b5 as TextFieldProps, aq as NumberFieldProps, b4 as TextAreaFieldProps, aU as SelectFieldProps, ap as MultiSelectFieldProps, aG as RadioFieldProps, r as CheckboxFieldProps, u as DateFieldProps, C as CascadeDateFieldProps, j as AttachmentFieldProps, aa as ImageFieldProps, b0 as SubFormFieldProps, bb as UserSelectFieldProps, E as DepartmentSelectFieldProps, n as CascadeSelectFieldProps, A as AddressFieldProps, h as AssociationFormFieldProps, J as EditorFieldProps, I as EditorChoiceOption, aV as SerialNumberFieldProps, aj as LocationFieldProps, G as DigitalSignatureFieldProps, ag as JSONFieldProps, ax as ProcessAction, af as InitiatorSelectedApprovers, aJ as ReturnPolicy, o as ChangeRecord, aX as StandardFormPageMode, ao as LowcodePageSchema } from '../ProcessPreview-B2-umzSY.mjs';
|
|
2
|
+
export { a as AddressValue, b as ApprovalActionType, d as ApprovalTimeline, e as ApprovalTimelineProps, g as AssociationFormConfig, i as AssociationValue, k as AttachmentImageVariants, l as AttachmentItem, B as BaseFieldProps, m as BaseLayoutNode, D as DataFilter, s as DataLinkageCondition, t as DataLinkageConfig, v as DateRangeRestriction, w as DateRestrictionConfig, x as DateShortcutConfig, y as DateShortcutType, z as DefaultValueLinkageConfig, F as DepartmentTreeNode, H as DigitalSignatureValue, K as EditorToolbarAction, N as FieldLayoutNode, O as FieldValueSyncConfig, T as FormEffectAction, U as FormEffectCondition, V as FormEffectConditionOperator, X as FormEngineMode, Z as FormLayoutNode, a2 as FormSection, a3 as FormSectionProps, a4 as FormSubmitBehavior, a5 as FormTemplateConfig, a6 as GridLayoutCell, a7 as GridLayoutNode, a8 as ImageCompressionConfig, a9 as ImageCompressionVariantConfig, ab as ImageVariant, ae as InitiatorSelectScope, ah as LayoutVisibleWhen, ai as LinkedFormOptionConfig, ak as LocationValue, al as LowcodePageMeta, am as LowcodePageNode, an as LowcodePageNodeType, at as OptionSourceType, au as PeopleShortcutConfig, av as PeopleShortcutType, aA as ProcessNodeType, aB as ProcessPreview, aC as ProcessPreviewProps, aM as RuntimeDataQueryParams, aN as RuntimeDataQueryResult, aO as RuntimeRequestConfig, aQ as RuntimeUploadOptions, aR as RuntimeUploadProvider, aT as SectionLayoutNode, aW as SignaturePoint, aZ as StepLayoutItem, a_ as StepsLayoutNode, a$ as SubFormColumn, b1 as TabLayoutItem, b2 as TabsLayoutNode, b6 as TextShortcutConfig, b7 as TextShortcutType, b9 as UserDisplayFormat, ba as UserItem } from '../ProcessPreview-B2-umzSY.mjs';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -15,7 +15,7 @@ interface FormContextValue {
|
|
|
15
15
|
dynamicOptions: Record<string, OptionItem[]>;
|
|
16
16
|
api: FormRuntimeApi;
|
|
17
17
|
runtime: FormRuntimeConfig;
|
|
18
|
-
config: Pick<FormEngineConfig, 'mode' | 'formUuid' | 'appType' | 'formInstanceId' | 'submit'>;
|
|
18
|
+
config: Pick<FormEngineConfig, 'mode' | 'formUuid' | 'appType' | 'formInstanceId' | 'submit' | 'defaultUploadProvider'>;
|
|
19
19
|
setFieldValue: (fieldId: string, value: any) => void;
|
|
20
20
|
getFieldValue: (fieldId: string) => any;
|
|
21
21
|
getFormData: () => Record<string, any>;
|
|
@@ -998,6 +998,7 @@ interface StandardFormPageProps {
|
|
|
998
998
|
formUuid?: string;
|
|
999
999
|
appType?: string;
|
|
1000
1000
|
formInstanceId?: string;
|
|
1001
|
+
defaultUploadProvider?: FormEngineConfig['defaultUploadProvider'];
|
|
1001
1002
|
submitBehavior?: FormEngineConfig['submitBehavior'];
|
|
1002
1003
|
onSubmit?: (values: Record<string, any>) => Promise<any>;
|
|
1003
1004
|
onSubmitSuccess?: (formInstId: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as FormEngineConfig, a1 as FormSchema, L as FieldBehavior, ar as OptionItem, _ as FormRuntimeApi, a0 as FormRuntimeConfig, P as FormAppearanceConfig,
|
|
2
|
-
export { a as AddressValue, b as ApprovalActionType, d as ApprovalTimeline, e as ApprovalTimelineProps, g as AssociationFormConfig, i as AssociationValue, k as AttachmentImageVariants, l as AttachmentItem, B as BaseFieldProps, m as BaseLayoutNode, D as DataFilter, s as DataLinkageCondition, t as DataLinkageConfig, v as DateRangeRestriction, w as DateRestrictionConfig, x as DateShortcutConfig, y as DateShortcutType, z as DefaultValueLinkageConfig, F as DepartmentTreeNode, H as DigitalSignatureValue, K as EditorToolbarAction, N as FieldLayoutNode, O as FieldValueSyncConfig, T as FormEffectAction, U as FormEffectCondition, V as FormEffectConditionOperator, X as FormEngineMode, Z as FormLayoutNode, a2 as FormSection, a3 as FormSectionProps, a4 as FormSubmitBehavior, a5 as FormTemplateConfig, a6 as GridLayoutCell, a7 as GridLayoutNode, a8 as ImageCompressionConfig, a9 as ImageCompressionVariantConfig, ab as ImageVariant, ae as InitiatorSelectScope, ah as LayoutVisibleWhen, ai as LinkedFormOptionConfig, ak as LocationValue, al as LowcodePageMeta, am as LowcodePageNode, an as LowcodePageNodeType, at as OptionSourceType, au as PeopleShortcutConfig, av as PeopleShortcutType, aA as ProcessNodeType, aB as ProcessPreview, aC as ProcessPreviewProps, aM as RuntimeDataQueryParams, aN as RuntimeDataQueryResult, aO as RuntimeRequestConfig, aQ as RuntimeUploadOptions,
|
|
1
|
+
import { W as FormEngineConfig, a1 as FormSchema, L as FieldBehavior, ar as OptionItem, _ as FormRuntimeApi, a0 as FormRuntimeConfig, P as FormAppearanceConfig, bc as ValidationPreset, bd as ValidationRule, S as FormEffect, $ as FormRuntimeApiConfig, as as OptionSourceConfig, aE as ProcessStatus, aY as StatusMeta, b3 as TaskStatus, c as ApprovalPermission, Q as FormDataDeleteParams, q as ChangeRecordQueryParams, p as ChangeRecordListResponse, R as FormDataQueryParams, Y as FormInstanceData, ac as InitiatorSelectCandidate, ad as InitiatorSelectRequirement, ay as ProcessBasicInfo, az as ProcessDefinition, aF as ProcessTask, aL as ReturnableNodeResult, aK as ReturnableNode, be as ViewPermissionQueryParams, bf as ViewPermissionSummary, f as ApproveParams, aw as PreviewParams, aD as ProcessRoute, aH as ResubmitParams, aI as ReturnParams, aS as SaveTaskParams, b8 as TransferParams, bg as WithdrawParams, M as FieldDefinition, aP as RuntimeResponse, b5 as TextFieldProps, aq as NumberFieldProps, b4 as TextAreaFieldProps, aU as SelectFieldProps, ap as MultiSelectFieldProps, aG as RadioFieldProps, r as CheckboxFieldProps, u as DateFieldProps, C as CascadeDateFieldProps, j as AttachmentFieldProps, aa as ImageFieldProps, b0 as SubFormFieldProps, bb as UserSelectFieldProps, E as DepartmentSelectFieldProps, n as CascadeSelectFieldProps, A as AddressFieldProps, h as AssociationFormFieldProps, J as EditorFieldProps, I as EditorChoiceOption, aV as SerialNumberFieldProps, aj as LocationFieldProps, G as DigitalSignatureFieldProps, ag as JSONFieldProps, ax as ProcessAction, af as InitiatorSelectedApprovers, aJ as ReturnPolicy, o as ChangeRecord, aX as StandardFormPageMode, ao as LowcodePageSchema } from '../ProcessPreview-B2-umzSY.js';
|
|
2
|
+
export { a as AddressValue, b as ApprovalActionType, d as ApprovalTimeline, e as ApprovalTimelineProps, g as AssociationFormConfig, i as AssociationValue, k as AttachmentImageVariants, l as AttachmentItem, B as BaseFieldProps, m as BaseLayoutNode, D as DataFilter, s as DataLinkageCondition, t as DataLinkageConfig, v as DateRangeRestriction, w as DateRestrictionConfig, x as DateShortcutConfig, y as DateShortcutType, z as DefaultValueLinkageConfig, F as DepartmentTreeNode, H as DigitalSignatureValue, K as EditorToolbarAction, N as FieldLayoutNode, O as FieldValueSyncConfig, T as FormEffectAction, U as FormEffectCondition, V as FormEffectConditionOperator, X as FormEngineMode, Z as FormLayoutNode, a2 as FormSection, a3 as FormSectionProps, a4 as FormSubmitBehavior, a5 as FormTemplateConfig, a6 as GridLayoutCell, a7 as GridLayoutNode, a8 as ImageCompressionConfig, a9 as ImageCompressionVariantConfig, ab as ImageVariant, ae as InitiatorSelectScope, ah as LayoutVisibleWhen, ai as LinkedFormOptionConfig, ak as LocationValue, al as LowcodePageMeta, am as LowcodePageNode, an as LowcodePageNodeType, at as OptionSourceType, au as PeopleShortcutConfig, av as PeopleShortcutType, aA as ProcessNodeType, aB as ProcessPreview, aC as ProcessPreviewProps, aM as RuntimeDataQueryParams, aN as RuntimeDataQueryResult, aO as RuntimeRequestConfig, aQ as RuntimeUploadOptions, aR as RuntimeUploadProvider, aT as SectionLayoutNode, aW as SignaturePoint, aZ as StepLayoutItem, a_ as StepsLayoutNode, a$ as SubFormColumn, b1 as TabLayoutItem, b2 as TabsLayoutNode, b6 as TextShortcutConfig, b7 as TextShortcutType, b9 as UserDisplayFormat, ba as UserItem } from '../ProcessPreview-B2-umzSY.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -15,7 +15,7 @@ interface FormContextValue {
|
|
|
15
15
|
dynamicOptions: Record<string, OptionItem[]>;
|
|
16
16
|
api: FormRuntimeApi;
|
|
17
17
|
runtime: FormRuntimeConfig;
|
|
18
|
-
config: Pick<FormEngineConfig, 'mode' | 'formUuid' | 'appType' | 'formInstanceId' | 'submit'>;
|
|
18
|
+
config: Pick<FormEngineConfig, 'mode' | 'formUuid' | 'appType' | 'formInstanceId' | 'submit' | 'defaultUploadProvider'>;
|
|
19
19
|
setFieldValue: (fieldId: string, value: any) => void;
|
|
20
20
|
getFieldValue: (fieldId: string) => any;
|
|
21
21
|
getFormData: () => Record<string, any>;
|
|
@@ -998,6 +998,7 @@ interface StandardFormPageProps {
|
|
|
998
998
|
formUuid?: string;
|
|
999
999
|
appType?: string;
|
|
1000
1000
|
formInstanceId?: string;
|
|
1001
|
+
defaultUploadProvider?: FormEngineConfig['defaultUploadProvider'];
|
|
1001
1002
|
submitBehavior?: FormEngineConfig['submitBehavior'];
|
|
1002
1003
|
onSubmit?: (values: Record<string, any>) => Promise<any>;
|
|
1003
1004
|
onSubmitSuccess?: (formInstId: string) => void;
|
|
@@ -3200,19 +3200,29 @@ function AttachmentFieldPC({
|
|
|
3200
3200
|
);
|
|
3201
3201
|
const valueRef = React18.useRef(value);
|
|
3202
3202
|
const disabled = behavior === "DISABLED";
|
|
3203
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
3204
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
3203
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
3204
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
3205
|
+
uploadProvider: "builtin-oss",
|
|
3206
|
+
storageScope: "platform",
|
|
3207
|
+
appType: config.appType,
|
|
3208
|
+
uploadPurpose: "attachment",
|
|
3209
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3210
|
+
} : fieldUploadProvider === "oss" ? {
|
|
3205
3211
|
uploadProvider: "oss",
|
|
3206
3212
|
storageCode,
|
|
3207
3213
|
appType: config.appType,
|
|
3208
3214
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3209
3215
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
3210
|
-
const getItemUploadOptions = (item) => item.
|
|
3216
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
3217
|
+
uploadProvider: "builtin-oss",
|
|
3218
|
+
storageScope: "platform",
|
|
3219
|
+
appType: item.appType || config.appType
|
|
3220
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
3211
3221
|
uploadProvider: "oss",
|
|
3212
3222
|
storageCode: item.storageCode || storageCode,
|
|
3213
3223
|
appType: item.appType || config.appType
|
|
3214
3224
|
} : void 0;
|
|
3215
|
-
const isDirectStorageItem3 = (item) => item.provider === "oss" || Boolean(item.storageCode);
|
|
3225
|
+
const isDirectStorageItem3 = (item) => item.provider === "oss" || item.uploadProvider === "builtin-oss" || Boolean(item.storageCode);
|
|
3216
3226
|
React18.useEffect(() => {
|
|
3217
3227
|
valueRef.current = value;
|
|
3218
3228
|
}, [value]);
|
|
@@ -3557,19 +3567,29 @@ function AttachmentFieldMobile({
|
|
|
3557
3567
|
const valueRef = React19.useRef(value);
|
|
3558
3568
|
const inputRef = React19.useRef(null);
|
|
3559
3569
|
const disabled = behavior === "DISABLED";
|
|
3560
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
3561
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
3570
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
3571
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
3572
|
+
uploadProvider: "builtin-oss",
|
|
3573
|
+
storageScope: "platform",
|
|
3574
|
+
appType: config.appType,
|
|
3575
|
+
uploadPurpose: "attachment",
|
|
3576
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3577
|
+
} : fieldUploadProvider === "oss" ? {
|
|
3562
3578
|
uploadProvider: "oss",
|
|
3563
3579
|
storageCode,
|
|
3564
3580
|
appType: config.appType,
|
|
3565
3581
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3566
3582
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
3567
|
-
const getItemUploadOptions = (item) => item.
|
|
3583
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
3584
|
+
uploadProvider: "builtin-oss",
|
|
3585
|
+
storageScope: "platform",
|
|
3586
|
+
appType: item.appType || config.appType
|
|
3587
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
3568
3588
|
uploadProvider: "oss",
|
|
3569
3589
|
storageCode: item.storageCode || storageCode,
|
|
3570
3590
|
appType: item.appType || config.appType
|
|
3571
3591
|
} : void 0;
|
|
3572
|
-
const isDirectStorageItem3 = (item) => item.provider === "oss" || Boolean(item.storageCode);
|
|
3592
|
+
const isDirectStorageItem3 = (item) => item.provider === "oss" || item.uploadProvider === "builtin-oss" || Boolean(item.storageCode);
|
|
3573
3593
|
React19.useEffect(() => {
|
|
3574
3594
|
valueRef.current = value;
|
|
3575
3595
|
}, [value]);
|
|
@@ -4049,19 +4069,31 @@ function ImageFieldPC({
|
|
|
4049
4069
|
);
|
|
4050
4070
|
const valueRef = React21.useRef(value);
|
|
4051
4071
|
const disabled = behavior === "DISABLED";
|
|
4052
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
4053
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
4072
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
4073
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
4074
|
+
uploadProvider: "builtin-oss",
|
|
4075
|
+
storageScope: "platform",
|
|
4076
|
+
appType: config.appType,
|
|
4077
|
+
uploadPurpose: "image",
|
|
4078
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4079
|
+
} : fieldUploadProvider === "oss" ? {
|
|
4054
4080
|
uploadProvider: "oss",
|
|
4055
4081
|
storageCode,
|
|
4056
4082
|
appType: config.appType,
|
|
4057
4083
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4058
4084
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
4059
|
-
const getItemUploadOptions = (item) => item.
|
|
4085
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
4086
|
+
uploadProvider: "builtin-oss",
|
|
4087
|
+
storageScope: "platform",
|
|
4088
|
+
appType: item.appType || config.appType
|
|
4089
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
4060
4090
|
uploadProvider: "oss",
|
|
4061
4091
|
storageCode: item.storageCode || storageCode,
|
|
4062
4092
|
appType: item.appType || config.appType
|
|
4063
4093
|
} : void 0;
|
|
4064
|
-
const isDirectStorageItem3 = (item) => Boolean(
|
|
4094
|
+
const isDirectStorageItem3 = (item) => Boolean(
|
|
4095
|
+
item && (item.provider === "oss" || item.uploadProvider === "builtin-oss" || item.storageCode)
|
|
4096
|
+
);
|
|
4065
4097
|
React21.useEffect(() => {
|
|
4066
4098
|
valueRef.current = value;
|
|
4067
4099
|
}, [value]);
|
|
@@ -4410,19 +4442,29 @@ function ImageFieldMobile({
|
|
|
4410
4442
|
const valueRef = React22.useRef(value);
|
|
4411
4443
|
const inputRef = React22.useRef(null);
|
|
4412
4444
|
const disabled = behavior === "DISABLED";
|
|
4413
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
4414
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
4445
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
4446
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
4447
|
+
uploadProvider: "builtin-oss",
|
|
4448
|
+
storageScope: "platform",
|
|
4449
|
+
appType: config.appType,
|
|
4450
|
+
uploadPurpose: "image",
|
|
4451
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4452
|
+
} : fieldUploadProvider === "oss" ? {
|
|
4415
4453
|
uploadProvider: "oss",
|
|
4416
4454
|
storageCode,
|
|
4417
4455
|
appType: config.appType,
|
|
4418
4456
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4419
4457
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
4420
|
-
const getItemUploadOptions = (item) => item.
|
|
4458
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
4459
|
+
uploadProvider: "builtin-oss",
|
|
4460
|
+
storageScope: "platform",
|
|
4461
|
+
appType: item.appType || config.appType
|
|
4462
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
4421
4463
|
uploadProvider: "oss",
|
|
4422
4464
|
storageCode: item.storageCode || storageCode,
|
|
4423
4465
|
appType: item.appType || config.appType
|
|
4424
4466
|
} : void 0;
|
|
4425
|
-
const isDirectStorageItem3 = (item) => item.provider === "oss" || Boolean(item.storageCode);
|
|
4467
|
+
const isDirectStorageItem3 = (item) => item.provider === "oss" || item.uploadProvider === "builtin-oss" || Boolean(item.storageCode);
|
|
4426
4468
|
React22.useEffect(() => {
|
|
4427
4469
|
valueRef.current = value;
|
|
4428
4470
|
}, [value]);
|
|
@@ -9878,6 +9920,8 @@ var normalizeUploadData = (data, file, bucketName, baseUrl = "") => {
|
|
|
9878
9920
|
thumbUrl: normalizeRuntimeFileUrl(baseUrl, item?.thumbUrl) || variants?.thumb?.url,
|
|
9879
9921
|
visibility: item?.visibility,
|
|
9880
9922
|
provider: item?.provider,
|
|
9923
|
+
uploadProvider: item?.uploadProvider,
|
|
9924
|
+
storageScope: item?.storageScope,
|
|
9881
9925
|
storageCode: item?.storageCode,
|
|
9882
9926
|
appType: item?.appType,
|
|
9883
9927
|
status: "done",
|
|
@@ -9969,6 +10013,8 @@ var uploadWithSignedUrl = (file, uploadInfo, bucketName, onProgress) => new Prom
|
|
|
9969
10013
|
{
|
|
9970
10014
|
...uploadInfo,
|
|
9971
10015
|
provider: uploadInfo.provider || "oss",
|
|
10016
|
+
uploadProvider: uploadInfo.uploadProvider,
|
|
10017
|
+
storageScope: uploadInfo.storageScope,
|
|
9972
10018
|
storageCode: uploadInfo.storageCode
|
|
9973
10019
|
},
|
|
9974
10020
|
file,
|
|
@@ -9999,6 +10045,23 @@ async function uploadOssFile(request, file, bucketName, onProgress, options) {
|
|
|
9999
10045
|
});
|
|
10000
10046
|
return uploadWithSignedUrl(file, response.data || response.result, bucketName, onProgress);
|
|
10001
10047
|
}
|
|
10048
|
+
async function uploadBuiltinOssFile(request, file, bucketName, onProgress, options) {
|
|
10049
|
+
if (!options.appType) throw new Error("\u5E73\u53F0\u5185\u7F6E OSS \u4E0A\u4F20\u7F3A\u5C11 appType");
|
|
10050
|
+
const response = await request({
|
|
10051
|
+
url: `/openxiangda-api/v1/apps/${encodeURIComponent(
|
|
10052
|
+
options.appType
|
|
10053
|
+
)}/storage/builtin/uploads/initiate`,
|
|
10054
|
+
method: "post",
|
|
10055
|
+
data: {
|
|
10056
|
+
fileName: file.name,
|
|
10057
|
+
fileSize: file.size,
|
|
10058
|
+
contentType: file.type || void 0,
|
|
10059
|
+
bucketName,
|
|
10060
|
+
purpose: options.uploadPurpose
|
|
10061
|
+
}
|
|
10062
|
+
});
|
|
10063
|
+
return uploadWithSignedUrl(file, response.data || response.result, bucketName, onProgress);
|
|
10064
|
+
}
|
|
10002
10065
|
async function uploadChunkedFile(request, file, bucketName, baseUrl, onProgress, options = {}) {
|
|
10003
10066
|
const initiate = await request({
|
|
10004
10067
|
url: "/file/multipart/initiate",
|
|
@@ -10069,6 +10132,9 @@ var createSegmentProgress = (onProgress, start, end) => (percent) => {
|
|
|
10069
10132
|
var getAttachmentUrl = (item) => item.publicUrl || item.previewUrl || item.downloadUrl || item.url || "";
|
|
10070
10133
|
async function uploadSingleRuntimeFile(request, baseUrl, file, bucketName, onProgress, options) {
|
|
10071
10134
|
const singleOptions = stripImageCompressionOptions(options);
|
|
10135
|
+
if (singleOptions.uploadProvider === "builtin-oss") {
|
|
10136
|
+
return uploadBuiltinOssFile(request, file, bucketName, onProgress, singleOptions);
|
|
10137
|
+
}
|
|
10072
10138
|
if (singleOptions.uploadProvider === "oss" || singleOptions.storageCode) {
|
|
10073
10139
|
return uploadOssFile(request, file, bucketName, onProgress, singleOptions);
|
|
10074
10140
|
}
|
|
@@ -10155,6 +10221,17 @@ function createFormRuntimeApi(config) {
|
|
|
10155
10221
|
});
|
|
10156
10222
|
},
|
|
10157
10223
|
deleteFile: async (objectName, bucketName = "files", options = {}) => {
|
|
10224
|
+
if (options.uploadProvider === "builtin-oss" || options.storageScope === "platform") {
|
|
10225
|
+
if (!options.appType) throw new Error("\u5E73\u53F0\u5185\u7F6E OSS \u5220\u9664\u7F3A\u5C11 appType");
|
|
10226
|
+
await request({
|
|
10227
|
+
url: `/openxiangda-api/v1/apps/${encodeURIComponent(
|
|
10228
|
+
options.appType
|
|
10229
|
+
)}/storage/builtin/objects/delete`,
|
|
10230
|
+
method: "post",
|
|
10231
|
+
data: { bucketName, objectName }
|
|
10232
|
+
});
|
|
10233
|
+
return { success: true };
|
|
10234
|
+
}
|
|
10158
10235
|
if (options.uploadProvider === "oss" || options.storageCode) {
|
|
10159
10236
|
if (!options.appType) throw new Error("OSS \u5220\u9664\u7F3A\u5C11 appType");
|
|
10160
10237
|
if (!options.storageCode) throw new Error("OSS \u5220\u9664\u7F3A\u5C11 storageCode");
|
|
@@ -17153,6 +17230,7 @@ var StandardFormPage = ({
|
|
|
17153
17230
|
formUuid,
|
|
17154
17231
|
appType,
|
|
17155
17232
|
formInstanceId,
|
|
17233
|
+
defaultUploadProvider,
|
|
17156
17234
|
submitBehavior,
|
|
17157
17235
|
onSubmit,
|
|
17158
17236
|
onSubmitSuccess,
|
|
@@ -17224,6 +17302,7 @@ var StandardFormPage = ({
|
|
|
17224
17302
|
formUuid: resolvedFormUuid,
|
|
17225
17303
|
appType: resolvedAppType,
|
|
17226
17304
|
formInstanceId,
|
|
17305
|
+
defaultUploadProvider,
|
|
17227
17306
|
submitBehavior,
|
|
17228
17307
|
permissions,
|
|
17229
17308
|
api
|