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
|
@@ -252,10 +252,13 @@ interface RuntimeRequestConfig {
|
|
|
252
252
|
headers?: Record<string, string>;
|
|
253
253
|
responseType?: 'json' | 'blob';
|
|
254
254
|
}
|
|
255
|
+
type RuntimeUploadProvider = 'platform' | 'oss' | 'builtin-oss';
|
|
255
256
|
interface RuntimeUploadOptions {
|
|
256
|
-
uploadProvider?:
|
|
257
|
+
uploadProvider?: RuntimeUploadProvider;
|
|
258
|
+
storageScope?: 'app' | 'platform';
|
|
257
259
|
storageCode?: string;
|
|
258
260
|
appType?: string;
|
|
261
|
+
uploadPurpose?: 'attachment' | 'image';
|
|
259
262
|
imageCompression?: ImageCompressionConfig;
|
|
260
263
|
}
|
|
261
264
|
interface FormRuntimeApi {
|
|
@@ -297,6 +300,7 @@ interface FormEngineConfig {
|
|
|
297
300
|
mode: FormEngineMode;
|
|
298
301
|
formUuid: string;
|
|
299
302
|
appType: string;
|
|
303
|
+
defaultUploadProvider?: RuntimeUploadProvider;
|
|
300
304
|
formInstanceId?: string;
|
|
301
305
|
submitBehavior?: FormSubmitBehavior;
|
|
302
306
|
permissions?: {
|
|
@@ -592,6 +596,8 @@ interface AttachmentItem {
|
|
|
592
596
|
uid?: string;
|
|
593
597
|
status?: 'uploading' | 'done' | 'error';
|
|
594
598
|
provider?: 'platform' | 'oss';
|
|
599
|
+
uploadProvider?: RuntimeUploadProvider;
|
|
600
|
+
storageScope?: 'app' | 'platform';
|
|
595
601
|
storageCode?: string;
|
|
596
602
|
appType?: string;
|
|
597
603
|
objectName?: string;
|
|
@@ -642,8 +648,8 @@ interface AttachmentFieldProps extends BaseFieldProps {
|
|
|
642
648
|
maxSize?: number;
|
|
643
649
|
uploadAction?: string;
|
|
644
650
|
bucketName?: string;
|
|
645
|
-
/**
|
|
646
|
-
uploadProvider?:
|
|
651
|
+
/** 自定义上传提供方;oss 需配置 storageCode,builtin-oss 使用平台内置 OSS。 */
|
|
652
|
+
uploadProvider?: RuntimeUploadProvider;
|
|
647
653
|
/** src/resources/storage/<code>.json 中声明的存储 code。 */
|
|
648
654
|
storageCode?: string;
|
|
649
655
|
multiple?: boolean;
|
|
@@ -664,8 +670,8 @@ interface ImageFieldProps extends BaseFieldProps {
|
|
|
664
670
|
accept?: string;
|
|
665
671
|
uploadAction?: string;
|
|
666
672
|
bucketName?: string;
|
|
667
|
-
/**
|
|
668
|
-
uploadProvider?:
|
|
673
|
+
/** 自定义上传提供方;oss 需配置 storageCode,builtin-oss 使用平台内置 OSS。 */
|
|
674
|
+
uploadProvider?: RuntimeUploadProvider;
|
|
669
675
|
/** src/resources/storage/<code>.json 中声明的存储 code。 */
|
|
670
676
|
storageCode?: string;
|
|
671
677
|
multiple?: boolean;
|
|
@@ -1156,4 +1162,4 @@ interface ProcessPreviewProps {
|
|
|
1156
1162
|
}
|
|
1157
1163
|
declare const ProcessPreview: React__default.FC<ProcessPreviewProps>;
|
|
1158
1164
|
|
|
1159
|
-
export { type FormRuntimeApiConfig as $, type AddressFieldProps as A, type BaseFieldProps as B, type CascadeDateFieldProps as C, type DataFilter as D, type DepartmentSelectFieldProps as E, type DepartmentTreeNode as F, type DigitalSignatureFieldProps as G, type DigitalSignatureValue as H, type EditorChoiceOption as I, type EditorFieldProps as J, type EditorToolbarAction as K, type FieldBehavior as L, type FieldDefinition as M, type FieldLayoutNode as N, type FieldValueSyncConfig as O, type FormAppearanceConfig as P, type FormDataDeleteParams as Q, type FormDataQueryParams as R, type FormEffect as S, type FormEffectAction as T, type FormEffectCondition as U, type FormEffectConditionOperator as V, type FormEngineConfig as W, type FormEngineMode as X, type FormInstanceData as Y, type FormLayoutNode as Z, type FormRuntimeApi as _, type AddressValue as a, type
|
|
1165
|
+
export { type FormRuntimeApiConfig as $, type AddressFieldProps as A, type BaseFieldProps as B, type CascadeDateFieldProps as C, type DataFilter as D, type DepartmentSelectFieldProps as E, type DepartmentTreeNode as F, type DigitalSignatureFieldProps as G, type DigitalSignatureValue as H, type EditorChoiceOption as I, type EditorFieldProps as J, type EditorToolbarAction as K, type FieldBehavior as L, type FieldDefinition as M, type FieldLayoutNode as N, type FieldValueSyncConfig as O, type FormAppearanceConfig as P, type FormDataDeleteParams as Q, type FormDataQueryParams as R, type FormEffect as S, type FormEffectAction as T, type FormEffectCondition as U, type FormEffectConditionOperator as V, type FormEngineConfig as W, type FormEngineMode as X, type FormInstanceData as Y, type FormLayoutNode as Z, type FormRuntimeApi as _, type AddressValue as a, type SubFormColumn as a$, type FormRuntimeConfig as a0, type FormSchema as a1, FormSection as a2, type FormSectionProps as a3, type FormSubmitBehavior as a4, type FormTemplateConfig as a5, type GridLayoutCell as a6, type GridLayoutNode as a7, type ImageCompressionConfig as a8, type ImageCompressionVariantConfig as a9, type ProcessNodeType as aA, ProcessPreview as aB, type ProcessPreviewProps as aC, type ProcessRoute as aD, type ProcessStatus as aE, type ProcessTask as aF, type RadioFieldProps as aG, type ResubmitParams as aH, type ReturnParams as aI, type ReturnPolicy as aJ, type ReturnableNode as aK, type ReturnableNodeResult as aL, type RuntimeDataQueryParams as aM, type RuntimeDataQueryResult as aN, type RuntimeRequestConfig as aO, type RuntimeResponse as aP, type RuntimeUploadOptions as aQ, type RuntimeUploadProvider as aR, type SaveTaskParams as aS, type SectionLayoutNode as aT, type SelectFieldProps as aU, type SerialNumberFieldProps as aV, type SignaturePoint as aW, type StandardFormPageMode as aX, type StatusMeta as aY, type StepLayoutItem as aZ, type StepsLayoutNode as a_, type ImageFieldProps as aa, type ImageVariant as ab, type InitiatorSelectCandidate as ac, type InitiatorSelectRequirement as ad, type InitiatorSelectScope as ae, type InitiatorSelectedApprovers as af, type JSONFieldProps as ag, type LayoutVisibleWhen as ah, type LinkedFormOptionConfig as ai, type LocationFieldProps as aj, type LocationValue as ak, type LowcodePageMeta as al, type LowcodePageNode as am, type LowcodePageNodeType as an, type LowcodePageSchema as ao, type MultiSelectFieldProps as ap, type NumberFieldProps as aq, type OptionItem as ar, type OptionSourceConfig as as, type OptionSourceType as at, type PeopleShortcutConfig as au, type PeopleShortcutType as av, type PreviewParams as aw, type ProcessAction as ax, type ProcessBasicInfo as ay, type ProcessDefinition as az, type ApprovalActionType as b, type SubFormFieldProps as b0, type TabLayoutItem as b1, type TabsLayoutNode as b2, type TaskStatus as b3, type TextAreaFieldProps as b4, type TextFieldProps as b5, type TextShortcutConfig as b6, type TextShortcutType as b7, type TransferParams as b8, type UserDisplayFormat as b9, type UserItem as ba, type UserSelectFieldProps as bb, type ValidationPreset as bc, type ValidationRule as bd, type ViewPermissionQueryParams as be, type ViewPermissionSummary as bf, type WithdrawParams as bg, type ApprovalPermission as c, ApprovalTimeline as d, type ApprovalTimelineProps as e, type ApproveParams as f, type AssociationFormConfig as g, type AssociationFormFieldProps as h, type AssociationValue as i, type AttachmentFieldProps as j, type AttachmentImageVariants as k, type AttachmentItem as l, type BaseLayoutNode as m, type CascadeSelectFieldProps as n, type ChangeRecord as o, type ChangeRecordListResponse as p, type ChangeRecordQueryParams as q, type CheckboxFieldProps as r, type DataLinkageCondition as s, type DataLinkageConfig as t, type DateFieldProps as u, type DateRangeRestriction as v, type DateRestrictionConfig as w, type DateShortcutConfig as x, type DateShortcutType as y, type DefaultValueLinkageConfig as z };
|
|
@@ -3345,19 +3345,29 @@ function AttachmentFieldPC({
|
|
|
3345
3345
|
);
|
|
3346
3346
|
const valueRef = import_react21.default.useRef(value);
|
|
3347
3347
|
const disabled = behavior === "DISABLED";
|
|
3348
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
3349
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
3348
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
3349
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
3350
|
+
uploadProvider: "builtin-oss",
|
|
3351
|
+
storageScope: "platform",
|
|
3352
|
+
appType: config.appType,
|
|
3353
|
+
uploadPurpose: "attachment",
|
|
3354
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3355
|
+
} : fieldUploadProvider === "oss" ? {
|
|
3350
3356
|
uploadProvider: "oss",
|
|
3351
3357
|
storageCode,
|
|
3352
3358
|
appType: config.appType,
|
|
3353
3359
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3354
3360
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
3355
|
-
const getItemUploadOptions = (item) => item.
|
|
3361
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
3362
|
+
uploadProvider: "builtin-oss",
|
|
3363
|
+
storageScope: "platform",
|
|
3364
|
+
appType: item.appType || config.appType
|
|
3365
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
3356
3366
|
uploadProvider: "oss",
|
|
3357
3367
|
storageCode: item.storageCode || storageCode,
|
|
3358
3368
|
appType: item.appType || config.appType
|
|
3359
3369
|
} : void 0;
|
|
3360
|
-
const isDirectStorageItem3 = (item) => item.provider === "oss" || Boolean(item.storageCode);
|
|
3370
|
+
const isDirectStorageItem3 = (item) => item.provider === "oss" || item.uploadProvider === "builtin-oss" || Boolean(item.storageCode);
|
|
3361
3371
|
import_react21.default.useEffect(() => {
|
|
3362
3372
|
valueRef.current = value;
|
|
3363
3373
|
}, [value]);
|
|
@@ -3702,19 +3712,29 @@ function AttachmentFieldMobile({
|
|
|
3702
3712
|
const valueRef = import_react22.default.useRef(value);
|
|
3703
3713
|
const inputRef = import_react22.default.useRef(null);
|
|
3704
3714
|
const disabled = behavior === "DISABLED";
|
|
3705
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
3706
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
3715
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
3716
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
3717
|
+
uploadProvider: "builtin-oss",
|
|
3718
|
+
storageScope: "platform",
|
|
3719
|
+
appType: config.appType,
|
|
3720
|
+
uploadPurpose: "attachment",
|
|
3721
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3722
|
+
} : fieldUploadProvider === "oss" ? {
|
|
3707
3723
|
uploadProvider: "oss",
|
|
3708
3724
|
storageCode,
|
|
3709
3725
|
appType: config.appType,
|
|
3710
3726
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
3711
3727
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
3712
|
-
const getItemUploadOptions = (item) => item.
|
|
3728
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
3729
|
+
uploadProvider: "builtin-oss",
|
|
3730
|
+
storageScope: "platform",
|
|
3731
|
+
appType: item.appType || config.appType
|
|
3732
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
3713
3733
|
uploadProvider: "oss",
|
|
3714
3734
|
storageCode: item.storageCode || storageCode,
|
|
3715
3735
|
appType: item.appType || config.appType
|
|
3716
3736
|
} : void 0;
|
|
3717
|
-
const isDirectStorageItem3 = (item) => item.provider === "oss" || Boolean(item.storageCode);
|
|
3737
|
+
const isDirectStorageItem3 = (item) => item.provider === "oss" || item.uploadProvider === "builtin-oss" || Boolean(item.storageCode);
|
|
3718
3738
|
import_react22.default.useEffect(() => {
|
|
3719
3739
|
valueRef.current = value;
|
|
3720
3740
|
}, [value]);
|
|
@@ -4194,19 +4214,31 @@ function ImageFieldPC({
|
|
|
4194
4214
|
);
|
|
4195
4215
|
const valueRef = import_react24.default.useRef(value);
|
|
4196
4216
|
const disabled = behavior === "DISABLED";
|
|
4197
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
4198
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
4217
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
4218
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
4219
|
+
uploadProvider: "builtin-oss",
|
|
4220
|
+
storageScope: "platform",
|
|
4221
|
+
appType: config.appType,
|
|
4222
|
+
uploadPurpose: "image",
|
|
4223
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4224
|
+
} : fieldUploadProvider === "oss" ? {
|
|
4199
4225
|
uploadProvider: "oss",
|
|
4200
4226
|
storageCode,
|
|
4201
4227
|
appType: config.appType,
|
|
4202
4228
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4203
4229
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
4204
|
-
const getItemUploadOptions = (item) => item.
|
|
4230
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
4231
|
+
uploadProvider: "builtin-oss",
|
|
4232
|
+
storageScope: "platform",
|
|
4233
|
+
appType: item.appType || config.appType
|
|
4234
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
4205
4235
|
uploadProvider: "oss",
|
|
4206
4236
|
storageCode: item.storageCode || storageCode,
|
|
4207
4237
|
appType: item.appType || config.appType
|
|
4208
4238
|
} : void 0;
|
|
4209
|
-
const isDirectStorageItem3 = (item) => Boolean(
|
|
4239
|
+
const isDirectStorageItem3 = (item) => Boolean(
|
|
4240
|
+
item && (item.provider === "oss" || item.uploadProvider === "builtin-oss" || item.storageCode)
|
|
4241
|
+
);
|
|
4210
4242
|
import_react24.default.useEffect(() => {
|
|
4211
4243
|
valueRef.current = value;
|
|
4212
4244
|
}, [value]);
|
|
@@ -4555,19 +4587,29 @@ function ImageFieldMobile({
|
|
|
4555
4587
|
const valueRef = import_react25.default.useRef(value);
|
|
4556
4588
|
const inputRef = import_react25.default.useRef(null);
|
|
4557
4589
|
const disabled = behavior === "DISABLED";
|
|
4558
|
-
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : "platform");
|
|
4559
|
-
const fieldUploadOptions = fieldUploadProvider === "oss" ? {
|
|
4590
|
+
const fieldUploadProvider = uploadProvider || (storageCode ? "oss" : config.defaultUploadProvider || "platform");
|
|
4591
|
+
const fieldUploadOptions = fieldUploadProvider === "builtin-oss" ? {
|
|
4592
|
+
uploadProvider: "builtin-oss",
|
|
4593
|
+
storageScope: "platform",
|
|
4594
|
+
appType: config.appType,
|
|
4595
|
+
uploadPurpose: "image",
|
|
4596
|
+
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4597
|
+
} : fieldUploadProvider === "oss" ? {
|
|
4560
4598
|
uploadProvider: "oss",
|
|
4561
4599
|
storageCode,
|
|
4562
4600
|
appType: config.appType,
|
|
4563
4601
|
...imageCompression && imageCompression.enabled !== false ? { imageCompression } : {}
|
|
4564
4602
|
} : imageCompression && imageCompression.enabled !== false ? { imageCompression } : void 0;
|
|
4565
|
-
const getItemUploadOptions = (item) => item.
|
|
4603
|
+
const getItemUploadOptions = (item) => item.storageScope === "platform" || item.uploadProvider === "builtin-oss" ? {
|
|
4604
|
+
uploadProvider: "builtin-oss",
|
|
4605
|
+
storageScope: "platform",
|
|
4606
|
+
appType: item.appType || config.appType
|
|
4607
|
+
} : item.provider === "oss" || item.storageCode ? {
|
|
4566
4608
|
uploadProvider: "oss",
|
|
4567
4609
|
storageCode: item.storageCode || storageCode,
|
|
4568
4610
|
appType: item.appType || config.appType
|
|
4569
4611
|
} : void 0;
|
|
4570
|
-
const isDirectStorageItem3 = (item) => item.provider === "oss" || Boolean(item.storageCode);
|
|
4612
|
+
const isDirectStorageItem3 = (item) => item.provider === "oss" || item.uploadProvider === "builtin-oss" || Boolean(item.storageCode);
|
|
4571
4613
|
import_react25.default.useEffect(() => {
|
|
4572
4614
|
valueRef.current = value;
|
|
4573
4615
|
}, [value]);
|
|
@@ -9992,6 +10034,8 @@ var normalizeUploadData = (data, file, bucketName, baseUrl = "") => {
|
|
|
9992
10034
|
thumbUrl: normalizeRuntimeFileUrl(baseUrl, item?.thumbUrl) || variants?.thumb?.url,
|
|
9993
10035
|
visibility: item?.visibility,
|
|
9994
10036
|
provider: item?.provider,
|
|
10037
|
+
uploadProvider: item?.uploadProvider,
|
|
10038
|
+
storageScope: item?.storageScope,
|
|
9995
10039
|
storageCode: item?.storageCode,
|
|
9996
10040
|
appType: item?.appType,
|
|
9997
10041
|
status: "done",
|
|
@@ -10083,6 +10127,8 @@ var uploadWithSignedUrl = (file, uploadInfo, bucketName, onProgress) => new Prom
|
|
|
10083
10127
|
{
|
|
10084
10128
|
...uploadInfo,
|
|
10085
10129
|
provider: uploadInfo.provider || "oss",
|
|
10130
|
+
uploadProvider: uploadInfo.uploadProvider,
|
|
10131
|
+
storageScope: uploadInfo.storageScope,
|
|
10086
10132
|
storageCode: uploadInfo.storageCode
|
|
10087
10133
|
},
|
|
10088
10134
|
file,
|
|
@@ -10113,6 +10159,23 @@ async function uploadOssFile(request, file, bucketName, onProgress, options) {
|
|
|
10113
10159
|
});
|
|
10114
10160
|
return uploadWithSignedUrl(file, response.data || response.result, bucketName, onProgress);
|
|
10115
10161
|
}
|
|
10162
|
+
async function uploadBuiltinOssFile(request, file, bucketName, onProgress, options) {
|
|
10163
|
+
if (!options.appType) throw new Error("\u5E73\u53F0\u5185\u7F6E OSS \u4E0A\u4F20\u7F3A\u5C11 appType");
|
|
10164
|
+
const response = await request({
|
|
10165
|
+
url: `/openxiangda-api/v1/apps/${encodeURIComponent(
|
|
10166
|
+
options.appType
|
|
10167
|
+
)}/storage/builtin/uploads/initiate`,
|
|
10168
|
+
method: "post",
|
|
10169
|
+
data: {
|
|
10170
|
+
fileName: file.name,
|
|
10171
|
+
fileSize: file.size,
|
|
10172
|
+
contentType: file.type || void 0,
|
|
10173
|
+
bucketName,
|
|
10174
|
+
purpose: options.uploadPurpose
|
|
10175
|
+
}
|
|
10176
|
+
});
|
|
10177
|
+
return uploadWithSignedUrl(file, response.data || response.result, bucketName, onProgress);
|
|
10178
|
+
}
|
|
10116
10179
|
async function uploadChunkedFile(request, file, bucketName, baseUrl, onProgress, options = {}) {
|
|
10117
10180
|
const initiate = await request({
|
|
10118
10181
|
url: "/file/multipart/initiate",
|
|
@@ -10183,6 +10246,9 @@ var createSegmentProgress = (onProgress, start, end) => (percent) => {
|
|
|
10183
10246
|
var getAttachmentUrl = (item) => item.publicUrl || item.previewUrl || item.downloadUrl || item.url || "";
|
|
10184
10247
|
async function uploadSingleRuntimeFile(request, baseUrl, file, bucketName, onProgress, options) {
|
|
10185
10248
|
const singleOptions = stripImageCompressionOptions(options);
|
|
10249
|
+
if (singleOptions.uploadProvider === "builtin-oss") {
|
|
10250
|
+
return uploadBuiltinOssFile(request, file, bucketName, onProgress, singleOptions);
|
|
10251
|
+
}
|
|
10186
10252
|
if (singleOptions.uploadProvider === "oss" || singleOptions.storageCode) {
|
|
10187
10253
|
return uploadOssFile(request, file, bucketName, onProgress, singleOptions);
|
|
10188
10254
|
}
|
|
@@ -10269,6 +10335,17 @@ function createFormRuntimeApi(config) {
|
|
|
10269
10335
|
});
|
|
10270
10336
|
},
|
|
10271
10337
|
deleteFile: async (objectName, bucketName = "files", options = {}) => {
|
|
10338
|
+
if (options.uploadProvider === "builtin-oss" || options.storageScope === "platform") {
|
|
10339
|
+
if (!options.appType) throw new Error("\u5E73\u53F0\u5185\u7F6E OSS \u5220\u9664\u7F3A\u5C11 appType");
|
|
10340
|
+
await request({
|
|
10341
|
+
url: `/openxiangda-api/v1/apps/${encodeURIComponent(
|
|
10342
|
+
options.appType
|
|
10343
|
+
)}/storage/builtin/objects/delete`,
|
|
10344
|
+
method: "post",
|
|
10345
|
+
data: { bucketName, objectName }
|
|
10346
|
+
});
|
|
10347
|
+
return { success: true };
|
|
10348
|
+
}
|
|
10272
10349
|
if (options.uploadProvider === "oss" || options.storageCode) {
|
|
10273
10350
|
if (!options.appType) throw new Error("OSS \u5220\u9664\u7F3A\u5C11 appType");
|
|
10274
10351
|
if (!options.storageCode) throw new Error("OSS \u5220\u9664\u7F3A\u5C11 storageCode");
|
|
@@ -17203,6 +17280,7 @@ var StandardFormPage = ({
|
|
|
17203
17280
|
formUuid,
|
|
17204
17281
|
appType,
|
|
17205
17282
|
formInstanceId,
|
|
17283
|
+
defaultUploadProvider,
|
|
17206
17284
|
submitBehavior,
|
|
17207
17285
|
onSubmit,
|
|
17208
17286
|
onSubmitSuccess,
|
|
@@ -17274,6 +17352,7 @@ var StandardFormPage = ({
|
|
|
17274
17352
|
formUuid: resolvedFormUuid,
|
|
17275
17353
|
appType: resolvedAppType,
|
|
17276
17354
|
formInstanceId,
|
|
17355
|
+
defaultUploadProvider,
|
|
17277
17356
|
submitBehavior,
|
|
17278
17357
|
permissions,
|
|
17279
17358
|
api
|