openxiangda 1.0.136 → 1.0.138

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.
Files changed (28) hide show
  1. package/lib/cli.js +687 -5
  2. package/lib/design-gates.js +16 -3
  3. package/openxiangda-skills/references/best-practices.md +18 -7
  4. package/openxiangda-skills/references/component-guide.md +7 -1
  5. package/openxiangda-skills/references/permission-design-patterns.md +95 -5
  6. package/openxiangda-skills/references/permissions-settings.md +165 -0
  7. package/openxiangda-skills/references/resource-manifest-cheatsheet.md +87 -0
  8. package/package.json +1 -1
  9. package/packages/sdk/dist/{ProcessPreview-Ci8_UsbN.d.mts → ProcessPreview-CZJP8n3e.d.mts} +6 -0
  10. package/packages/sdk/dist/{ProcessPreview-Ci8_UsbN.d.ts → ProcessPreview-CZJP8n3e.d.ts} +6 -0
  11. package/packages/sdk/dist/components/index.cjs +143 -16
  12. package/packages/sdk/dist/components/index.cjs.map +1 -1
  13. package/packages/sdk/dist/components/index.d.mts +8 -2
  14. package/packages/sdk/dist/components/index.d.ts +8 -2
  15. package/packages/sdk/dist/components/index.mjs +143 -16
  16. package/packages/sdk/dist/components/index.mjs.map +1 -1
  17. package/packages/sdk/dist/runtime/index.cjs +169 -25
  18. package/packages/sdk/dist/runtime/index.cjs.map +1 -1
  19. package/packages/sdk/dist/runtime/index.d.mts +1 -1
  20. package/packages/sdk/dist/runtime/index.d.ts +1 -1
  21. package/packages/sdk/dist/runtime/index.mjs +169 -25
  22. package/packages/sdk/dist/runtime/index.mjs.map +1 -1
  23. package/packages/sdk/dist/runtime/react.cjs +26 -9
  24. package/packages/sdk/dist/runtime/react.cjs.map +1 -1
  25. package/packages/sdk/dist/runtime/react.d.mts +13 -3
  26. package/packages/sdk/dist/runtime/react.d.ts +13 -3
  27. package/packages/sdk/dist/runtime/react.mjs +26 -9
  28. package/packages/sdk/dist/runtime/react.mjs.map +1 -1
@@ -1,5 +1,5 @@
1
- import { d as FormEngineConfig, F as FormSchema, e as FieldBehavior, O as OptionItem, a as FormRuntimeApi, f as FormRuntimeConfig, g as FormAppearanceConfig, V as ValidationPreset, h as ValidationRule, i as FormEffect, b as FormRuntimeApiConfig, j as OptionSourceConfig, P as ProcessStatus, S as StatusMeta, T as TaskStatus, A as ApprovalPermission, k as FormDataDeleteParams, C as ChangeRecordQueryParams, l as ChangeRecordListResponse, m as FormDataQueryParams, n as FormInstanceData, I as InitiatorSelectCandidate, o as InitiatorSelectRequirement, p as ProcessBasicInfo, q as ProcessDefinition, r as ProcessTask, R as ReturnableNodeResult, s as ReturnableNode, t as ViewPermissionQueryParams, u as ViewPermissionSummary, v as ApproveParams, w as PreviewParams, x as ProcessRoute, y as ResubmitParams, z as ReturnParams, B as SaveTaskParams, D as TransferParams, W as WithdrawParams, c as FieldDefinition, E as RuntimeResponse, G as TextFieldProps, N as NumberFieldProps, H as TextAreaFieldProps, J as SelectFieldProps, M as MultiSelectFieldProps, K as RadioFieldProps, L as CheckboxFieldProps, Q as DateFieldProps, U as CascadeDateFieldProps, X as AttachmentFieldProps, Y as ImageFieldProps, Z as SubFormFieldProps, _ as UserSelectFieldProps, $ as DepartmentSelectFieldProps, a0 as CascadeSelectFieldProps, a1 as AddressFieldProps, a2 as AssociationFormFieldProps, a3 as EditorFieldProps, a4 as EditorChoiceOption, a5 as SerialNumberFieldProps, a6 as LocationFieldProps, a7 as DigitalSignatureFieldProps, a8 as JSONFieldProps, a9 as ProcessAction, aa as InitiatorSelectedApprovers, ab as ReturnPolicy, ac as ChangeRecord, ad as StandardFormPageMode, ae as LowcodePageSchema } from '../ProcessPreview-Ci8_UsbN.mjs';
2
- export { af as AddressValue, ag as ApprovalActionType, ah as ApprovalTimeline, ai as ApprovalTimelineProps, aj as AssociationFormConfig, ak as AssociationValue, al as AttachmentImageVariants, am as AttachmentItem, an as BaseFieldProps, ao as BaseLayoutNode, ap as DataFilter, aq as DataLinkageCondition, ar as DataLinkageConfig, as as DateRangeRestriction, at as DateRestrictionConfig, au as DateShortcutConfig, av as DateShortcutType, aw as DefaultValueLinkageConfig, ax as DepartmentTreeNode, ay as DigitalSignatureValue, az as EditorToolbarAction, aA as FieldLayoutNode, aB as FieldValueSyncConfig, aC as FormEffectAction, aD as FormEffectCondition, aE as FormEffectConditionOperator, aF as FormEngineMode, aG as FormLayoutNode, aH as FormSection, aI as FormSectionProps, aJ as FormSubmitBehavior, aK as FormTemplateConfig, aL as GridLayoutCell, aM as GridLayoutNode, aN as ImageCompressionConfig, aO as ImageCompressionVariantConfig, aP as ImageVariant, aQ as InitiatorSelectScope, aR as LayoutVisibleWhen, aS as LinkedFormOptionConfig, aT as LocationValue, aU as LowcodePageMeta, aV as LowcodePageNode, aW as LowcodePageNodeType, aX as OptionSourceType, aY as PeopleShortcutConfig, aZ as PeopleShortcutType, a_ as ProcessNodeType, a$ as ProcessPreview, b0 as ProcessPreviewProps, b1 as RuntimeDataQueryParams, b2 as RuntimeDataQueryResult, b3 as RuntimeRequestConfig, b4 as RuntimeUploadOptions, b5 as RuntimeUploadProvider, b6 as SectionLayoutNode, b7 as SignaturePoint, b8 as StepLayoutItem, b9 as StepsLayoutNode, ba as SubFormColumn, bb as TabLayoutItem, bc as TabsLayoutNode, bd as TextShortcutConfig, be as TextShortcutType, bf as UserDisplayFormat, bg as UserItem } from '../ProcessPreview-Ci8_UsbN.mjs';
1
+ import { d as FormEngineConfig, F as FormSchema, e as FieldBehavior, O as OptionItem, a as FormRuntimeApi, f as FormRuntimeConfig, g as FormAppearanceConfig, V as ValidationPreset, h as ValidationRule, i as FormEffect, b as FormRuntimeApiConfig, j as OptionSourceConfig, P as ProcessStatus, S as StatusMeta, T as TaskStatus, A as ApprovalPermission, k as FormDataDeleteParams, C as ChangeRecordQueryParams, l as ChangeRecordListResponse, m as FormDataQueryParams, n as FormInstanceData, I as InitiatorSelectCandidate, o as InitiatorSelectRequirement, p as ProcessBasicInfo, q as ProcessDefinition, r as ProcessTask, R as ReturnableNodeResult, s as ReturnableNode, t as ViewPermissionQueryParams, u as ViewPermissionSummary, v as ApproveParams, w as PreviewParams, x as ProcessRoute, y as ResubmitParams, z as ReturnParams, B as SaveTaskParams, D as TransferParams, W as WithdrawParams, c as FieldDefinition, E as RuntimeResponse, G as TextFieldProps, N as NumberFieldProps, H as TextAreaFieldProps, J as SelectFieldProps, M as MultiSelectFieldProps, K as RadioFieldProps, L as CheckboxFieldProps, Q as DateFieldProps, U as CascadeDateFieldProps, X as AttachmentFieldProps, Y as ImageFieldProps, Z as SubFormFieldProps, _ as UserSelectFieldProps, $ as DepartmentSelectFieldProps, a0 as CascadeSelectFieldProps, a1 as AddressFieldProps, a2 as AssociationFormFieldProps, a3 as EditorFieldProps, a4 as EditorChoiceOption, a5 as SerialNumberFieldProps, a6 as LocationFieldProps, a7 as DigitalSignatureFieldProps, a8 as JSONFieldProps, a9 as ProcessAction, aa as InitiatorSelectedApprovers, ab as ReturnPolicy, ac as ChangeRecord, ad as StandardFormPageMode, ae as LowcodePageSchema } from '../ProcessPreview-CZJP8n3e.mjs';
2
+ export { af as AddressValue, ag as ApprovalActionType, ah as ApprovalTimeline, ai as ApprovalTimelineProps, aj as AssociationFormConfig, ak as AssociationValue, al as AttachmentImageVariants, am as AttachmentItem, an as BaseFieldProps, ao as BaseLayoutNode, ap as DataFilter, aq as DataLinkageCondition, ar as DataLinkageConfig, as as DateRangeRestriction, at as DateRestrictionConfig, au as DateShortcutConfig, av as DateShortcutType, aw as DefaultValueLinkageConfig, ax as DepartmentTreeNode, ay as DigitalSignatureValue, az as EditorToolbarAction, aA as FieldLayoutNode, aB as FieldValueSyncConfig, aC as FormEffectAction, aD as FormEffectCondition, aE as FormEffectConditionOperator, aF as FormEngineMode, aG as FormLayoutNode, aH as FormSection, aI as FormSectionProps, aJ as FormSubmitBehavior, aK as FormTemplateConfig, aL as GridLayoutCell, aM as GridLayoutNode, aN as ImageCompressionConfig, aO as ImageCompressionVariantConfig, aP as ImageVariant, aQ as InitiatorSelectScope, aR as LayoutVisibleWhen, aS as LinkedFormOptionConfig, aT as LocationValue, aU as LowcodePageMeta, aV as LowcodePageNode, aW as LowcodePageNodeType, aX as OptionSourceType, aY as PeopleShortcutConfig, aZ as PeopleShortcutType, a_ as ProcessNodeType, a$ as ProcessPreview, b0 as ProcessPreviewProps, b1 as RuntimeDataQueryParams, b2 as RuntimeDataQueryResult, b3 as RuntimeRequestConfig, b4 as RuntimeUploadOptions, b5 as RuntimeUploadProvider, b6 as SectionLayoutNode, b7 as SignaturePoint, b8 as StepLayoutItem, b9 as StepsLayoutNode, ba as SubFormColumn, bb as TabLayoutItem, bc as TabsLayoutNode, bd as TextShortcutConfig, be as TextShortcutType, bf as UserDisplayFormat, bg as UserItem } from '../ProcessPreview-CZJP8n3e.mjs';
3
3
  import * as React from 'react';
4
4
  import React__default from 'react';
5
5
 
@@ -277,6 +277,7 @@ interface DataManagementApiOptions {
277
277
  menuFormUuid?: string;
278
278
  scope?: DataManagementConfigScope;
279
279
  }
280
+ type FormActionPermission = 'view' | 'create' | 'edit' | 'delete' | 'export' | 'import' | 'change_records' | 'workflow';
280
281
  declare const getSystemFieldsForFormType: (formType?: string) => DataManagementField[];
281
282
  declare const normalizeDataManagementFields: (payload: any) => {
282
283
  fields: DataManagementField[];
@@ -885,8 +886,11 @@ interface DataManagementRowAction {
885
886
  key: string;
886
887
  label: string;
887
888
  danger?: boolean;
889
+ requiredAction?: FormActionPermission;
888
890
  onClick: (record: any) => void;
889
891
  }
892
+ type DataManagementPermissionMode = 'auto' | 'manual' | 'off';
893
+ type DataManagementActionOverrides = Partial<Record<FormActionPermission, boolean>>;
890
894
  interface DataManagementListProps {
891
895
  appType: string;
892
896
  formUuid: string;
@@ -907,6 +911,8 @@ interface DataManagementListProps {
907
911
  allowSchemaFallback?: boolean;
908
912
  rowActions?: DataManagementRowAction[];
909
913
  maxVisibleRowActions?: number;
914
+ permissionMode?: DataManagementPermissionMode;
915
+ actionOverrides?: DataManagementActionOverrides;
910
916
  }
911
917
  declare const DataManagementList: React__default.FC<DataManagementListProps>;
912
918
 
@@ -1,5 +1,5 @@
1
- import { d as FormEngineConfig, F as FormSchema, e as FieldBehavior, O as OptionItem, a as FormRuntimeApi, f as FormRuntimeConfig, g as FormAppearanceConfig, V as ValidationPreset, h as ValidationRule, i as FormEffect, b as FormRuntimeApiConfig, j as OptionSourceConfig, P as ProcessStatus, S as StatusMeta, T as TaskStatus, A as ApprovalPermission, k as FormDataDeleteParams, C as ChangeRecordQueryParams, l as ChangeRecordListResponse, m as FormDataQueryParams, n as FormInstanceData, I as InitiatorSelectCandidate, o as InitiatorSelectRequirement, p as ProcessBasicInfo, q as ProcessDefinition, r as ProcessTask, R as ReturnableNodeResult, s as ReturnableNode, t as ViewPermissionQueryParams, u as ViewPermissionSummary, v as ApproveParams, w as PreviewParams, x as ProcessRoute, y as ResubmitParams, z as ReturnParams, B as SaveTaskParams, D as TransferParams, W as WithdrawParams, c as FieldDefinition, E as RuntimeResponse, G as TextFieldProps, N as NumberFieldProps, H as TextAreaFieldProps, J as SelectFieldProps, M as MultiSelectFieldProps, K as RadioFieldProps, L as CheckboxFieldProps, Q as DateFieldProps, U as CascadeDateFieldProps, X as AttachmentFieldProps, Y as ImageFieldProps, Z as SubFormFieldProps, _ as UserSelectFieldProps, $ as DepartmentSelectFieldProps, a0 as CascadeSelectFieldProps, a1 as AddressFieldProps, a2 as AssociationFormFieldProps, a3 as EditorFieldProps, a4 as EditorChoiceOption, a5 as SerialNumberFieldProps, a6 as LocationFieldProps, a7 as DigitalSignatureFieldProps, a8 as JSONFieldProps, a9 as ProcessAction, aa as InitiatorSelectedApprovers, ab as ReturnPolicy, ac as ChangeRecord, ad as StandardFormPageMode, ae as LowcodePageSchema } from '../ProcessPreview-Ci8_UsbN.js';
2
- export { af as AddressValue, ag as ApprovalActionType, ah as ApprovalTimeline, ai as ApprovalTimelineProps, aj as AssociationFormConfig, ak as AssociationValue, al as AttachmentImageVariants, am as AttachmentItem, an as BaseFieldProps, ao as BaseLayoutNode, ap as DataFilter, aq as DataLinkageCondition, ar as DataLinkageConfig, as as DateRangeRestriction, at as DateRestrictionConfig, au as DateShortcutConfig, av as DateShortcutType, aw as DefaultValueLinkageConfig, ax as DepartmentTreeNode, ay as DigitalSignatureValue, az as EditorToolbarAction, aA as FieldLayoutNode, aB as FieldValueSyncConfig, aC as FormEffectAction, aD as FormEffectCondition, aE as FormEffectConditionOperator, aF as FormEngineMode, aG as FormLayoutNode, aH as FormSection, aI as FormSectionProps, aJ as FormSubmitBehavior, aK as FormTemplateConfig, aL as GridLayoutCell, aM as GridLayoutNode, aN as ImageCompressionConfig, aO as ImageCompressionVariantConfig, aP as ImageVariant, aQ as InitiatorSelectScope, aR as LayoutVisibleWhen, aS as LinkedFormOptionConfig, aT as LocationValue, aU as LowcodePageMeta, aV as LowcodePageNode, aW as LowcodePageNodeType, aX as OptionSourceType, aY as PeopleShortcutConfig, aZ as PeopleShortcutType, a_ as ProcessNodeType, a$ as ProcessPreview, b0 as ProcessPreviewProps, b1 as RuntimeDataQueryParams, b2 as RuntimeDataQueryResult, b3 as RuntimeRequestConfig, b4 as RuntimeUploadOptions, b5 as RuntimeUploadProvider, b6 as SectionLayoutNode, b7 as SignaturePoint, b8 as StepLayoutItem, b9 as StepsLayoutNode, ba as SubFormColumn, bb as TabLayoutItem, bc as TabsLayoutNode, bd as TextShortcutConfig, be as TextShortcutType, bf as UserDisplayFormat, bg as UserItem } from '../ProcessPreview-Ci8_UsbN.js';
1
+ import { d as FormEngineConfig, F as FormSchema, e as FieldBehavior, O as OptionItem, a as FormRuntimeApi, f as FormRuntimeConfig, g as FormAppearanceConfig, V as ValidationPreset, h as ValidationRule, i as FormEffect, b as FormRuntimeApiConfig, j as OptionSourceConfig, P as ProcessStatus, S as StatusMeta, T as TaskStatus, A as ApprovalPermission, k as FormDataDeleteParams, C as ChangeRecordQueryParams, l as ChangeRecordListResponse, m as FormDataQueryParams, n as FormInstanceData, I as InitiatorSelectCandidate, o as InitiatorSelectRequirement, p as ProcessBasicInfo, q as ProcessDefinition, r as ProcessTask, R as ReturnableNodeResult, s as ReturnableNode, t as ViewPermissionQueryParams, u as ViewPermissionSummary, v as ApproveParams, w as PreviewParams, x as ProcessRoute, y as ResubmitParams, z as ReturnParams, B as SaveTaskParams, D as TransferParams, W as WithdrawParams, c as FieldDefinition, E as RuntimeResponse, G as TextFieldProps, N as NumberFieldProps, H as TextAreaFieldProps, J as SelectFieldProps, M as MultiSelectFieldProps, K as RadioFieldProps, L as CheckboxFieldProps, Q as DateFieldProps, U as CascadeDateFieldProps, X as AttachmentFieldProps, Y as ImageFieldProps, Z as SubFormFieldProps, _ as UserSelectFieldProps, $ as DepartmentSelectFieldProps, a0 as CascadeSelectFieldProps, a1 as AddressFieldProps, a2 as AssociationFormFieldProps, a3 as EditorFieldProps, a4 as EditorChoiceOption, a5 as SerialNumberFieldProps, a6 as LocationFieldProps, a7 as DigitalSignatureFieldProps, a8 as JSONFieldProps, a9 as ProcessAction, aa as InitiatorSelectedApprovers, ab as ReturnPolicy, ac as ChangeRecord, ad as StandardFormPageMode, ae as LowcodePageSchema } from '../ProcessPreview-CZJP8n3e.js';
2
+ export { af as AddressValue, ag as ApprovalActionType, ah as ApprovalTimeline, ai as ApprovalTimelineProps, aj as AssociationFormConfig, ak as AssociationValue, al as AttachmentImageVariants, am as AttachmentItem, an as BaseFieldProps, ao as BaseLayoutNode, ap as DataFilter, aq as DataLinkageCondition, ar as DataLinkageConfig, as as DateRangeRestriction, at as DateRestrictionConfig, au as DateShortcutConfig, av as DateShortcutType, aw as DefaultValueLinkageConfig, ax as DepartmentTreeNode, ay as DigitalSignatureValue, az as EditorToolbarAction, aA as FieldLayoutNode, aB as FieldValueSyncConfig, aC as FormEffectAction, aD as FormEffectCondition, aE as FormEffectConditionOperator, aF as FormEngineMode, aG as FormLayoutNode, aH as FormSection, aI as FormSectionProps, aJ as FormSubmitBehavior, aK as FormTemplateConfig, aL as GridLayoutCell, aM as GridLayoutNode, aN as ImageCompressionConfig, aO as ImageCompressionVariantConfig, aP as ImageVariant, aQ as InitiatorSelectScope, aR as LayoutVisibleWhen, aS as LinkedFormOptionConfig, aT as LocationValue, aU as LowcodePageMeta, aV as LowcodePageNode, aW as LowcodePageNodeType, aX as OptionSourceType, aY as PeopleShortcutConfig, aZ as PeopleShortcutType, a_ as ProcessNodeType, a$ as ProcessPreview, b0 as ProcessPreviewProps, b1 as RuntimeDataQueryParams, b2 as RuntimeDataQueryResult, b3 as RuntimeRequestConfig, b4 as RuntimeUploadOptions, b5 as RuntimeUploadProvider, b6 as SectionLayoutNode, b7 as SignaturePoint, b8 as StepLayoutItem, b9 as StepsLayoutNode, ba as SubFormColumn, bb as TabLayoutItem, bc as TabsLayoutNode, bd as TextShortcutConfig, be as TextShortcutType, bf as UserDisplayFormat, bg as UserItem } from '../ProcessPreview-CZJP8n3e.js';
3
3
  import * as React from 'react';
4
4
  import React__default from 'react';
5
5
 
@@ -277,6 +277,7 @@ interface DataManagementApiOptions {
277
277
  menuFormUuid?: string;
278
278
  scope?: DataManagementConfigScope;
279
279
  }
280
+ type FormActionPermission = 'view' | 'create' | 'edit' | 'delete' | 'export' | 'import' | 'change_records' | 'workflow';
280
281
  declare const getSystemFieldsForFormType: (formType?: string) => DataManagementField[];
281
282
  declare const normalizeDataManagementFields: (payload: any) => {
282
283
  fields: DataManagementField[];
@@ -885,8 +886,11 @@ interface DataManagementRowAction {
885
886
  key: string;
886
887
  label: string;
887
888
  danger?: boolean;
889
+ requiredAction?: FormActionPermission;
888
890
  onClick: (record: any) => void;
889
891
  }
892
+ type DataManagementPermissionMode = 'auto' | 'manual' | 'off';
893
+ type DataManagementActionOverrides = Partial<Record<FormActionPermission, boolean>>;
890
894
  interface DataManagementListProps {
891
895
  appType: string;
892
896
  formUuid: string;
@@ -907,6 +911,8 @@ interface DataManagementListProps {
907
911
  allowSchemaFallback?: boolean;
908
912
  rowActions?: DataManagementRowAction[];
909
913
  maxVisibleRowActions?: number;
914
+ permissionMode?: DataManagementPermissionMode;
915
+ actionOverrides?: DataManagementActionOverrides;
910
916
  }
911
917
  declare const DataManagementList: React__default.FC<DataManagementListProps>;
912
918
 
@@ -12305,6 +12305,16 @@ async function getViewPermission(request, params) {
12305
12305
  }
12306
12306
 
12307
12307
  // packages/sdk/src/components/core/dataManagementApi.ts
12308
+ var FORM_ACTION_PERMISSIONS = [
12309
+ "view",
12310
+ "create",
12311
+ "edit",
12312
+ "delete",
12313
+ "export",
12314
+ "import",
12315
+ "change_records",
12316
+ "workflow"
12317
+ ];
12308
12318
  var unwrap = (response) => {
12309
12319
  if (response instanceof Blob) return response;
12310
12320
  if (response?.data?.result !== void 0) return response.data.result;
@@ -12313,6 +12323,24 @@ var unwrap = (response) => {
12313
12323
  return response;
12314
12324
  };
12315
12325
  var pickData = (value) => value?.data ?? value?.result ?? value;
12326
+ var normalizeActionSummary = (value) => {
12327
+ const raw = pickData(value) || {};
12328
+ const actions = Array.from(
12329
+ /* @__PURE__ */ new Set([...raw.actions || [], ...raw.operations || []])
12330
+ ).filter(
12331
+ (action) => FORM_ACTION_PERMISSIONS.includes(action)
12332
+ );
12333
+ const can = FORM_ACTION_PERMISSIONS.reduce((result, action) => {
12334
+ result[action] = Boolean(raw.can?.[action] ?? actions.includes(action));
12335
+ return result;
12336
+ }, {});
12337
+ return {
12338
+ ...raw,
12339
+ actions,
12340
+ operations: actions,
12341
+ can
12342
+ };
12343
+ };
12316
12344
  var normalizeComponentName = (field) => field?.componentName || field?.component_name || field?.component_type || field?.componentType || field?.type || "TextField";
12317
12345
  var normalizeField = (key, field, system = false) => ({
12318
12346
  ...field,
@@ -12564,6 +12592,14 @@ async function getDataManagementConfig(request, options) {
12564
12592
  });
12565
12593
  return unwrap(response);
12566
12594
  }
12595
+ async function getDataManagementActionSummary(request, params) {
12596
+ const response = await request({
12597
+ url: "/permission/form-group/view-permissions",
12598
+ method: "get",
12599
+ params
12600
+ });
12601
+ return normalizeActionSummary(response);
12602
+ }
12567
12603
  async function saveDataManagementConfig(request, options) {
12568
12604
  const targetFormUuid = options.menuFormUuid || options.formUuid;
12569
12605
  const personal = options.scope === "personal";
@@ -18437,7 +18473,9 @@ var DataManagementList = ({
18437
18473
  requestOverride,
18438
18474
  allowSchemaFallback = false,
18439
18475
  rowActions = [],
18440
- maxVisibleRowActions
18476
+ maxVisibleRowActions,
18477
+ permissionMode = "auto",
18478
+ actionOverrides
18441
18479
  }) => {
18442
18480
  const rootRef = useRef20(null);
18443
18481
  const api = useMemo32(() => {
@@ -18488,6 +18526,9 @@ var DataManagementList = ({
18488
18526
  const [activeRecord, setActiveRecord] = useState41(null);
18489
18527
  const [detailOpen, setDetailOpen] = useState41(false);
18490
18528
  const [submitOpen, setSubmitOpen] = useState41(false);
18529
+ const [actionSummary, setActionSummary] = useState41(null);
18530
+ const [permissionLoading, setPermissionLoading] = useState41(permissionMode === "auto");
18531
+ const [permissionError, setPermissionError] = useState41(null);
18491
18532
  const fetchStateRef = useRef20({});
18492
18533
  const isProcessForm = isProcessFormType(formType);
18493
18534
  const request = api.request;
@@ -18503,6 +18544,67 @@ var DataManagementList = ({
18503
18544
  const confirmDanger = useCallback24((title2, content, onOk) => {
18504
18545
  if (confirmAction(title2, content)) onOk();
18505
18546
  }, []);
18547
+ useEffect43(() => {
18548
+ let mounted = true;
18549
+ if (permissionMode !== "auto") {
18550
+ setActionSummary(null);
18551
+ setPermissionLoading(false);
18552
+ setPermissionError(null);
18553
+ return () => {
18554
+ mounted = false;
18555
+ };
18556
+ }
18557
+ if (!appType || !formUuid) return void 0;
18558
+ setPermissionLoading(true);
18559
+ setPermissionError(null);
18560
+ getDataManagementActionSummary(request, { appType, formUuid }).then((summary) => {
18561
+ if (!mounted) return;
18562
+ setActionSummary(summary);
18563
+ }).catch((error) => {
18564
+ if (!mounted) return;
18565
+ setActionSummary(null);
18566
+ setPermissionError(error instanceof Error ? error : new Error(String(error)));
18567
+ }).finally(() => {
18568
+ if (mounted) setPermissionLoading(false);
18569
+ });
18570
+ return () => {
18571
+ mounted = false;
18572
+ };
18573
+ }, [appType, formUuid, permissionMode, request]);
18574
+ const baseActionCan = useMemo32(() => {
18575
+ if (permissionMode === "auto") {
18576
+ return FORM_ACTION_PERMISSIONS.reduce((result, action) => {
18577
+ result[action] = Boolean(actionSummary?.can?.[action]);
18578
+ return result;
18579
+ }, {});
18580
+ }
18581
+ return FORM_ACTION_PERMISSIONS.reduce((result, action) => {
18582
+ result[action] = true;
18583
+ return result;
18584
+ }, {});
18585
+ }, [actionSummary?.can, permissionMode]);
18586
+ const canAction = useCallback24(
18587
+ (action) => {
18588
+ if (permissionLoading && permissionMode === "auto") return false;
18589
+ if (permissionError && permissionMode === "auto") return action === "view";
18590
+ let allowed = permissionMode === "off" ? true : Boolean(baseActionCan[action]);
18591
+ if (permissionMode === "auto") {
18592
+ allowed = allowed && actionOverrides?.[action] !== false;
18593
+ } else if (actionOverrides?.[action] === false) {
18594
+ allowed = false;
18595
+ }
18596
+ if (readonly && ["create", "edit", "delete", "import"].includes(action)) {
18597
+ return false;
18598
+ }
18599
+ return allowed;
18600
+ },
18601
+ [actionOverrides, baseActionCan, permissionError, permissionLoading, permissionMode, readonly]
18602
+ );
18603
+ const canCreate = canAction("create");
18604
+ const canDelete = canAction("delete");
18605
+ const canExport = canAction("export");
18606
+ const canImport = canAction("import");
18607
+ const canWorkflow = canAction("workflow");
18506
18608
  const visibleFields = useMemo32(
18507
18609
  () => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
18508
18610
  [fields, showFields]
@@ -18746,11 +18848,15 @@ var DataManagementList = ({
18746
18848
  const handleDelete = useCallback24(
18747
18849
  async (ids) => {
18748
18850
  if (ids.length === 0) return;
18851
+ if (!canDelete) {
18852
+ message5.error("\u65E0\u6743\u9650\u5220\u9664\u6570\u636E");
18853
+ return;
18854
+ }
18749
18855
  await deleteDataManagementRows(request, { appType, formUuid, formInstanceIds: ids });
18750
18856
  setSelectedRowKeys([]);
18751
18857
  await loadData({ current, pageSize });
18752
18858
  },
18753
- [appType, current, formUuid, loadData, pageSize, request]
18859
+ [appType, canDelete, current, formUuid, loadData, pageSize, request]
18754
18860
  );
18755
18861
  const getSelectedRecordIds = useCallback24(
18756
18862
  () => selectedRowKeys.map((key) => {
@@ -18790,6 +18896,10 @@ var DataManagementList = ({
18790
18896
  }
18791
18897
  };
18792
18898
  const handleExport = async (scope) => {
18899
+ if (!canExport) {
18900
+ message5.error("\u65E0\u6743\u9650\u5BFC\u51FA\u6570\u636E");
18901
+ return;
18902
+ }
18793
18903
  const selectedIds = scope === "selected" ? getSelectedRecordIds() : [];
18794
18904
  if (scope === "selected" && selectedIds.length === 0) {
18795
18905
  message5.warning("\u8BF7\u5148\u9009\u62E9\u8981\u5BFC\u51FA\u7684\u8BB0\u5F55");
@@ -18828,6 +18938,10 @@ var DataManagementList = ({
18828
18938
  }
18829
18939
  };
18830
18940
  const handleDownloadTemplate = async () => {
18941
+ if (!canImport) {
18942
+ message5.error("\u65E0\u6743\u9650\u5BFC\u5165\u6570\u636E");
18943
+ return;
18944
+ }
18831
18945
  setTemplateDownloading(true);
18832
18946
  try {
18833
18947
  const response = await downloadDataManagementImportTemplate(request, { appType, formUuid });
@@ -18841,6 +18955,8 @@ var DataManagementList = ({
18841
18955
  }
18842
18956
  };
18843
18957
  const loadTransferRecords = async (type) => {
18958
+ if (type === "import" && !canImport) return;
18959
+ if (type === "export" && !canExport) return;
18844
18960
  setRecordTab(type);
18845
18961
  setRecordsOpen(true);
18846
18962
  const result = await getDataManagementTransferRecords(request, {
@@ -18853,6 +18969,10 @@ var DataManagementList = ({
18853
18969
  setTransferRecords(result.records);
18854
18970
  };
18855
18971
  const handleImportPreview = async (file) => {
18972
+ if (!canImport) {
18973
+ message5.error("\u65E0\u6743\u9650\u5BFC\u5165\u6570\u636E");
18974
+ return Upload3.LIST_IGNORE;
18975
+ }
18856
18976
  const base64 = await fileToBase64(file);
18857
18977
  setImportBase64(base64);
18858
18978
  const result = await importPreviewDataManagementRows(request, {
@@ -18866,6 +18986,10 @@ var DataManagementList = ({
18866
18986
  };
18867
18987
  const handleImportConfirm = async () => {
18868
18988
  if (!importBase64) return;
18989
+ if (!canImport) {
18990
+ message5.error("\u65E0\u6743\u9650\u5BFC\u5165\u6570\u636E");
18991
+ return;
18992
+ }
18869
18993
  await importDataManagementRows(request, { appType, formUuid, fileBase64: importBase64 });
18870
18994
  message5.success("\u5BFC\u5165\u4EFB\u52A1\u5DF2\u521B\u5EFA");
18871
18995
  setImportOpen(false);
@@ -18874,7 +18998,7 @@ var DataManagementList = ({
18874
18998
  await loadData({ current: 1, pageSize });
18875
18999
  };
18876
19000
  const visibleRowActionLimit = normalizeMaxVisibleRowActions(maxVisibleRowActions);
18877
- const rowActionCount = 1 + rowActions.length + (readonly ? 0 : 1) + (isProcessForm ? 1 : 0);
19001
+ const rowActionCount = 1 + rowActions.filter((action) => !action.requiredAction || canAction(action.requiredAction)).length + (canDelete ? 1 : 0) + (isProcessForm && canWorkflow ? 1 : 0);
18878
19002
  const actionColumnWidth = Math.max(
18879
19003
  ACTION_COLUMN_MIN_WIDTH,
18880
19004
  Math.min(rowActionCount, visibleRowActionLimit) * ACTION_BUTTON_ESTIMATED_WIDTH + (rowActionCount > visibleRowActionLimit ? ACTION_MORE_BUTTON_WIDTH : 0) + ACTION_COLUMN_HORIZONTAL_PADDING
@@ -18914,13 +19038,13 @@ var DataManagementList = ({
18914
19038
  label: "\u8BE6\u60C5",
18915
19039
  onClick: () => handleDetail(record)
18916
19040
  },
18917
- ...rowActions.map((action) => ({
19041
+ ...rowActions.filter((action) => !action.requiredAction || canAction(action.requiredAction)).map((action) => ({
18918
19042
  key: action.key,
18919
19043
  label: action.label,
18920
19044
  danger: action.danger,
18921
19045
  onClick: () => action.onClick(record)
18922
19046
  })),
18923
- ...!readonly ? [
19047
+ ...canDelete ? [
18924
19048
  {
18925
19049
  key: "delete",
18926
19050
  label: "\u5220\u9664",
@@ -18933,7 +19057,7 @@ var DataManagementList = ({
18933
19057
  )
18934
19058
  }
18935
19059
  ] : [],
18936
- ...isProcessForm ? [
19060
+ ...isProcessForm && canWorkflow ? [
18937
19061
  {
18938
19062
  key: "workflow",
18939
19063
  label: "\u6D41\u7A0B\u65E5\u5FD7",
@@ -18994,7 +19118,9 @@ var DataManagementList = ({
18994
19118
  handleDetail,
18995
19119
  isProcessForm,
18996
19120
  lockFieldIds,
18997
- readonly,
19121
+ canAction,
19122
+ canDelete,
19123
+ canWorkflow,
18998
19124
  rowActions,
18999
19125
  updateColumnWidth,
19000
19126
  visibleRowActionLimit,
@@ -19034,7 +19160,7 @@ var DataManagementList = ({
19034
19160
  /* @__PURE__ */ jsxs55("div", { className: "mx-auto flex min-h-0 w-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
19035
19161
  title && /* @__PURE__ */ jsx101("div", { className: "mb-4", children: /* @__PURE__ */ jsx101("h2", { className: "m-0 text-xl font-semibold text-ant-color-text", children: title }) }),
19036
19162
  /* @__PURE__ */ jsx101("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center", children: /* @__PURE__ */ jsxs55(Space9, { wrap: true, children: [
19037
- !readonly && (submitRenderer || runtimeFormSchema) && /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(PlusOutlined2, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
19163
+ canCreate && (submitRenderer || runtimeFormSchema) && /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(PlusOutlined2, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
19038
19164
  /* @__PURE__ */ jsx101(
19039
19165
  Input14.Search,
19040
19166
  {
@@ -19060,7 +19186,7 @@ var DataManagementList = ({
19060
19186
  ),
19061
19187
  /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(FilterOutlined, {}), onClick: () => setFilterOpen(true), children: "\u7B5B\u9009" }),
19062
19188
  /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(SettingOutlined, {}), onClick: () => setColumnOpen(true), children: "\u5217\u8BBE\u7F6E" }),
19063
- /* @__PURE__ */ jsx101(
19189
+ canExport && /* @__PURE__ */ jsx101(
19064
19190
  Dropdown3,
19065
19191
  {
19066
19192
  getPopupContainer,
@@ -19085,7 +19211,7 @@ var DataManagementList = ({
19085
19211
  children: /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(DownloadOutlined2, {}), children: "\u5BFC\u51FA" })
19086
19212
  }
19087
19213
  ),
19088
- !readonly && /* @__PURE__ */ jsx101(
19214
+ canImport && /* @__PURE__ */ jsx101(
19089
19215
  Dropdown3,
19090
19216
  {
19091
19217
  getPopupContainer,
@@ -19111,7 +19237,7 @@ var DataManagementList = ({
19111
19237
  " \u6761"
19112
19238
  ] }),
19113
19239
  /* @__PURE__ */ jsxs55(Space9, { wrap: true, children: [
19114
- /* @__PURE__ */ jsx101(
19240
+ canExport && /* @__PURE__ */ jsx101(
19115
19241
  Button17,
19116
19242
  {
19117
19243
  icon: /* @__PURE__ */ jsx101(DownloadOutlined2, {}),
@@ -19123,8 +19249,8 @@ var DataManagementList = ({
19123
19249
  children: "\u5BFC\u51FA\u9009\u4E2D"
19124
19250
  }
19125
19251
  ),
19126
- !readonly && isProcessForm && /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(SwapOutlined2, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
19127
- !readonly && /* @__PURE__ */ jsx101(
19252
+ isProcessForm && canWorkflow && /* @__PURE__ */ jsx101(Button17, { icon: /* @__PURE__ */ jsx101(SwapOutlined2, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
19253
+ canDelete && /* @__PURE__ */ jsx101(
19128
19254
  Button17,
19129
19255
  {
19130
19256
  danger: true,
@@ -19429,7 +19555,7 @@ var DataManagementList = ({
19429
19555
  width: 720,
19430
19556
  onCancel: () => setImportOpen(false),
19431
19557
  onOk: handleImportConfirm,
19432
- okButtonProps: { disabled: !importBase64 },
19558
+ okButtonProps: { disabled: !importBase64 || !canImport },
19433
19559
  okText: "\u786E\u8BA4\u5BFC\u5165",
19434
19560
  children: [
19435
19561
  /* @__PURE__ */ jsxs55("div", { className: "mb-3 flex flex-col gap-3 rounded-lg border border-ant-border-secondary bg-ant-bg-container px-4 py-3 md:flex-row md:items-center md:justify-between", children: [
@@ -19442,6 +19568,7 @@ var DataManagementList = ({
19442
19568
  {
19443
19569
  icon: /* @__PURE__ */ jsx101(DownloadOutlined2, {}),
19444
19570
  loading: templateDownloading,
19571
+ disabled: !canImport,
19445
19572
  onClick: handleDownloadTemplate,
19446
19573
  children: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F"
19447
19574
  }
@@ -19492,8 +19619,8 @@ var DataManagementList = ({
19492
19619
  {
19493
19620
  value: recordTab,
19494
19621
  options: [
19495
- { label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
19496
- { label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
19622
+ ...canImport ? [{ label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" }] : [],
19623
+ ...canExport ? [{ label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }] : []
19497
19624
  ],
19498
19625
  onChange: (value) => loadTransferRecords(value)
19499
19626
  }