sy-form-components 0.2.7 → 0.2.8

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/dist/index.mjs CHANGED
@@ -8081,6 +8081,16 @@ function useApprovalActions(options) {
8081
8081
 
8082
8082
  // src/hooks/useChangeRecords.ts
8083
8083
  import { useState as useState27, useEffect as useEffect32, useCallback as useCallback14, useRef as useRef12 } from "react";
8084
+ var normalizeChangeRecordList = (value) => {
8085
+ const body = value?.data ?? value?.result ?? value ?? {};
8086
+ const records = body.records ?? body.data ?? body.list ?? body.items ?? [];
8087
+ return {
8088
+ records: Array.isArray(records) ? records : [],
8089
+ total: Number(body.total ?? body.totalCount ?? body.count ?? records.length) || 0,
8090
+ page: Number(body.page ?? body.currentPage ?? 1) || 1,
8091
+ pageSize: Number(body.pageSize ?? body.limit ?? 20) || 20
8092
+ };
8093
+ };
8084
8094
  function useChangeRecords(options) {
8085
8095
  const { formUuid, appType, formInstanceId, pageSize = 20, autoLoad = true } = options;
8086
8096
  const { api } = useFormContext();
@@ -8109,13 +8119,14 @@ function useChangeRecords(options) {
8109
8119
  pageSize
8110
8120
  });
8111
8121
  if (!mountedRef.current) return;
8122
+ const normalized = normalizeChangeRecordList(result);
8112
8123
  if (append) {
8113
- setRecords((prev) => [...prev, ...result.records]);
8124
+ setRecords((prev) => [...prev, ...normalized.records]);
8114
8125
  } else {
8115
- setRecords(result.records);
8126
+ setRecords(normalized.records);
8116
8127
  }
8117
- setTotal(result.total);
8118
- setPage(pageNum);
8128
+ setTotal(normalized.total);
8129
+ setPage(normalized.page || pageNum);
8119
8130
  } catch (error) {
8120
8131
  console.error("[useChangeRecords] Failed to load change records:", error);
8121
8132
  } finally {
@@ -8131,7 +8142,8 @@ function useChangeRecords(options) {
8131
8142
  fetchRecords(1, false);
8132
8143
  }
8133
8144
  }, [autoLoad, fetchRecords]);
8134
- const hasMore = records.length < total;
8145
+ const safeRecords = Array.isArray(records) ? records : [];
8146
+ const hasMore = safeRecords.length < total;
8135
8147
  const loadMore = useCallback14(async () => {
8136
8148
  if (!hasMore || loading) return;
8137
8149
  await fetchRecords(page + 1, true);
@@ -8143,7 +8155,7 @@ function useChangeRecords(options) {
8143
8155
  await fetchRecords(1, false);
8144
8156
  }, [fetchRecords]);
8145
8157
  return {
8146
- records,
8158
+ records: safeRecords,
8147
8159
  loading,
8148
8160
  total,
8149
8161
  page,
@@ -8922,7 +8934,7 @@ var ApprovalTimeline = ({
8922
8934
 
8923
8935
  // src/modules/ApprovalActionBar.tsx
8924
8936
  import { useMemo as useMemo16, useState as useState32 } from "react";
8925
- import { Form, Input as Input10, Modal as Modal6, Select as Select5 } from "antd";
8937
+ import { Form, Input as Input10, Modal as Modal5, Select as Select5 } from "antd";
8926
8938
  import {
8927
8939
  CheckOutlined,
8928
8940
  CloseOutlined,
@@ -8933,8 +8945,23 @@ import {
8933
8945
 
8934
8946
  // src/modules/StickyActionBar.tsx
8935
8947
  import { useEffect as useEffect35, useMemo as useMemo15, useState as useState31 } from "react";
8936
- import { Button as Button10, Dropdown, Modal as Modal5 } from "antd";
8948
+ import { Button as Button10, Dropdown } from "antd";
8937
8949
  import { MoreOutlined } from "@ant-design/icons";
8950
+
8951
+ // src/utils/confirmAction.ts
8952
+ var confirmAction = (title, content) => {
8953
+ const message2 = [title, content].filter(Boolean).join("\n") || "\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F";
8954
+ if (typeof window === "undefined" || typeof window.confirm !== "function") {
8955
+ return true;
8956
+ }
8957
+ try {
8958
+ return window.confirm(message2);
8959
+ } catch {
8960
+ return true;
8961
+ }
8962
+ };
8963
+
8964
+ // src/modules/StickyActionBar.tsx
8938
8965
  import { Fragment as Fragment2, jsx as jsx81, jsxs as jsxs33 } from "react/jsx-runtime";
8939
8966
  var getActionPriority = (action) => {
8940
8967
  const maybePriority = action.priority;
@@ -8949,8 +8976,8 @@ var StickyActionBar = ({
8949
8976
  className = "",
8950
8977
  maxMobileButtons = 2,
8951
8978
  layoutMode = "default",
8952
- inDrawer = false,
8953
- maxWidth = 1120
8979
+ maxWidth = 1120,
8980
+ position = "sticky"
8954
8981
  }) => {
8955
8982
  const [isMobile, setIsMobile] = useState31(false);
8956
8983
  useEffect35(() => {
@@ -8969,6 +8996,14 @@ var StickyActionBar = ({
8969
8996
  const moreMobile = visibleActions.slice(maxMobileButtons);
8970
8997
  const leftActions = visibleActions.filter((action) => getPlacement(action) === "left");
8971
8998
  const rightActions = visibleActions.filter((action) => getPlacement(action) !== "left");
8999
+ const positionClass = position === "fixed" ? "fixed bottom-0 left-0 right-0" : position === "inline" ? "relative" : "sticky bottom-0";
9000
+ const runAction = (action) => {
9001
+ if (action.confirm) {
9002
+ const confirmed = confirmAction(action.confirm.title, action.confirm.content);
9003
+ if (!confirmed) return;
9004
+ }
9005
+ action.onClick();
9006
+ };
8972
9007
  const renderButton = (action, mobile = false) => /* @__PURE__ */ jsx81(
8973
9008
  Button10,
8974
9009
  {
@@ -8977,19 +9012,7 @@ var StickyActionBar = ({
8977
9012
  loading: action.loading,
8978
9013
  disabled: action.disabled,
8979
9014
  icon: action.icon,
8980
- onClick: () => {
8981
- if (action.confirm) {
8982
- Modal5.confirm({
8983
- title: action.confirm.title,
8984
- content: action.confirm.content,
8985
- okText: action.confirm.okText || "\u786E\u8BA4",
8986
- cancelText: action.confirm.cancelText || "\u53D6\u6D88",
8987
- onOk: action.onClick
8988
- });
8989
- return;
8990
- }
8991
- action.onClick();
8992
- },
9015
+ onClick: () => runAction(action),
8993
9016
  className: `${mobile ? "min-w-0 flex-1" : "min-w-[88px]"} rounded-md`,
8994
9017
  children: action.label
8995
9018
  },
@@ -8998,7 +9021,7 @@ var StickyActionBar = ({
8998
9021
  return /* @__PURE__ */ jsx81(
8999
9022
  "div",
9000
9023
  {
9001
- className: `fixed bottom-0 left-0 right-0 z-50 border-t border-ant-border-secondary bg-ant-bg-container/95 px-4 py-3 shadow-[0_-8px_24px_rgba(15,23,42,0.06)] backdrop-blur supports-[padding:max(0px)]:pb-[max(0.75rem,env(safe-area-inset-bottom))] ${inDrawer ? "absolute" : ""} ${className}`,
9024
+ className: `${positionClass} z-20 border-t border-ant-border-secondary bg-ant-bg-container/95 px-4 py-3 shadow-[0_-8px_24px_rgba(15,23,42,0.06)] backdrop-blur supports-[padding:max(0px)]:pb-[max(0.75rem,env(safe-area-inset-bottom))] ${className}`,
9002
9025
  children: /* @__PURE__ */ jsx81(
9003
9026
  "div",
9004
9027
  {
@@ -9018,19 +9041,7 @@ var StickyActionBar = ({
9018
9041
  danger: action.type === "danger",
9019
9042
  disabled: action.disabled,
9020
9043
  icon: action.icon,
9021
- onClick: () => {
9022
- if (action.confirm) {
9023
- Modal5.confirm({
9024
- title: action.confirm.title,
9025
- content: action.confirm.content,
9026
- okText: action.confirm.okText || "\u786E\u8BA4",
9027
- cancelText: action.confirm.cancelText || "\u53D6\u6D88",
9028
- onOk: action.onClick
9029
- });
9030
- return;
9031
- }
9032
- action.onClick();
9033
- }
9044
+ onClick: () => runAction(action)
9034
9045
  }))
9035
9046
  },
9036
9047
  children: /* @__PURE__ */ jsx81(Button10, { icon: /* @__PURE__ */ jsx81(MoreOutlined, {}), className: "rounded-md", children: "\u66F4\u591A" })
@@ -9195,8 +9206,9 @@ var ApprovalActionBar = ({
9195
9206
  }
9196
9207
  ),
9197
9208
  /* @__PURE__ */ jsx82(
9198
- Modal6,
9209
+ Modal5,
9199
9210
  {
9211
+ getContainer: false,
9200
9212
  title: getModalTitle(modalAction),
9201
9213
  open: modalAction !== null,
9202
9214
  okText: "\u786E\u8BA4",
@@ -9232,6 +9244,7 @@ var ApprovalActionBar = ({
9232
9244
  Select5,
9233
9245
  {
9234
9246
  placeholder: "\u8BF7\u9009\u62E9\u9000\u56DE\u8282\u70B9",
9247
+ getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
9235
9248
  options: returnableNodes.map((node) => ({
9236
9249
  value: node.nodeId || node.id || "",
9237
9250
  label: renderReturnNodeLabel ? renderReturnNodeLabel(node) : node.nodeName || node.name || node.nodeId || node.id
@@ -9258,7 +9271,7 @@ var ApprovalActionBar = ({
9258
9271
 
9259
9272
  // src/modules/ApprovalActions.tsx
9260
9273
  import { useMemo as useMemo17, useState as useState33 } from "react";
9261
- import { Button as Button11, Dropdown as Dropdown2, Form as Form2, Input as Input11, Modal as Modal7 } from "antd";
9274
+ import { Button as Button11, Dropdown as Dropdown2, Form as Form2, Input as Input11, Modal as Modal6 } from "antd";
9262
9275
  import { MoreOutlined as MoreOutlined2 } from "@ant-design/icons";
9263
9276
  import { Fragment as Fragment4, jsx as jsx83, jsxs as jsxs35 } from "react/jsx-runtime";
9264
9277
  var priority = {
@@ -9368,6 +9381,7 @@ var ApprovalActions = ({
9368
9381
  Dropdown2,
9369
9382
  {
9370
9383
  trigger: ["click"],
9384
+ getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
9371
9385
  menu: {
9372
9386
  items: moreButtons.map((action) => ({
9373
9387
  key: action.action,
@@ -9383,8 +9397,9 @@ var ApprovalActions = ({
9383
9397
  }
9384
9398
  ),
9385
9399
  /* @__PURE__ */ jsx83(
9386
- Modal7,
9400
+ Modal6,
9387
9401
  {
9402
+ getContainer: false,
9388
9403
  title,
9389
9404
  open: modalAction !== null,
9390
9405
  okText: "\u786E\u8BA4",
@@ -9418,7 +9433,7 @@ var ApprovalActions = ({
9418
9433
 
9419
9434
  // src/modules/FormActionBar.tsx
9420
9435
  import { useState as useState34 } from "react";
9421
- import { Button as Button12, Modal as Modal8 } from "antd";
9436
+ import { Button as Button12 } from "antd";
9422
9437
  import { Fragment as Fragment5, jsx as jsx84, jsxs as jsxs36 } from "react/jsx-runtime";
9423
9438
  var FormActionBar = ({
9424
9439
  actions,
@@ -9436,15 +9451,9 @@ var FormActionBar = ({
9436
9451
  });
9437
9452
  const handleClick = async (action) => {
9438
9453
  if (action.confirm) {
9439
- Modal8.confirm({
9440
- title: action.confirm.title,
9441
- content: action.confirm.content,
9442
- okText: "\u786E\u8BA4",
9443
- cancelText: "\u53D6\u6D88",
9444
- onOk: async () => {
9445
- await executeAction(action);
9446
- }
9447
- });
9454
+ const confirmed = confirmAction(action.confirm.title, action.confirm.content);
9455
+ if (!confirmed) return;
9456
+ await executeAction(action);
9448
9457
  } else {
9449
9458
  await executeAction(action);
9450
9459
  }
@@ -9526,11 +9535,11 @@ var RuntimePageShell = ({
9526
9535
  }
9527
9536
  return children;
9528
9537
  };
9529
- return /* @__PURE__ */ jsxs37("div", { className: `sy-runtime-page min-h-screen bg-ant-bg-layout text-ant-text ${className}`, children: [
9538
+ return /* @__PURE__ */ jsxs37("div", { className: `sy-runtime-page min-h-full bg-ant-bg-layout text-ant-text ${className}`, children: [
9530
9539
  /* @__PURE__ */ jsx85(
9531
9540
  "div",
9532
9541
  {
9533
- className: `sy-runtime-page__content mx-auto w-full px-4 py-6 pb-24 md:px-6 ${inDrawer ? "py-4 md:px-4" : ""} ${contentClassName}`,
9542
+ className: `sy-runtime-page__content mx-auto w-full px-4 py-6 pb-8 md:px-6 ${inDrawer ? "py-4 md:px-4" : ""} ${contentClassName}`,
9534
9543
  style: { maxWidth: maxWidthStyle },
9535
9544
  children: renderState()
9536
9545
  }
@@ -9663,7 +9672,7 @@ var DraftManager = ({
9663
9672
  };
9664
9673
 
9665
9674
  // src/modules/ProcessPreview.tsx
9666
- import { Modal as Modal9, Skeleton as Skeleton2, Button as Button14 } from "antd";
9675
+ import { Modal as Modal7, Skeleton as Skeleton2, Button as Button14 } from "antd";
9667
9676
  import { CheckCircleOutlined, UserOutlined as UserOutlined3 } from "@ant-design/icons";
9668
9677
  import { jsx as jsx88, jsxs as jsxs40 } from "react/jsx-runtime";
9669
9678
  var ProcessPreview = ({
@@ -9673,9 +9682,11 @@ var ProcessPreview = ({
9673
9682
  routes,
9674
9683
  loading = false
9675
9684
  }) => {
9685
+ const routeList = Array.isArray(routes) ? routes : [];
9676
9686
  return /* @__PURE__ */ jsx88(
9677
- Modal9,
9687
+ Modal7,
9678
9688
  {
9689
+ getContainer: false,
9679
9690
  title: "\u6D41\u7A0B\u9884\u89C8",
9680
9691
  open,
9681
9692
  onCancel: onClose,
@@ -9684,8 +9695,8 @@ var ProcessPreview = ({
9684
9695
  /* @__PURE__ */ jsx88(Button14, { onClick: onClose, children: "\u53D6\u6D88" }),
9685
9696
  /* @__PURE__ */ jsx88(Button14, { type: "primary", onClick: onConfirm, loading, children: "\u786E\u8BA4\u63D0\u4EA4" })
9686
9697
  ] }),
9687
- children: loading && routes.length === 0 ? /* @__PURE__ */ jsx88(Skeleton2, { active: true, paragraph: { rows: 4 } }) : routes.length === 0 ? /* @__PURE__ */ jsx88("p", { className: "text-sm text-gray-400 text-center py-8", children: "\u6682\u65E0\u6D41\u7A0B\u8282\u70B9" }) : /* @__PURE__ */ jsx88("div", { className: "py-2", children: routes.map((route, index) => {
9688
- const isLast = index === routes.length - 1;
9698
+ children: loading && routeList.length === 0 ? /* @__PURE__ */ jsx88(Skeleton2, { active: true, paragraph: { rows: 4 } }) : routeList.length === 0 ? /* @__PURE__ */ jsx88("p", { className: "text-sm text-gray-400 text-center py-8", children: "\u6682\u65E0\u6D41\u7A0B\u8282\u70B9" }) : /* @__PURE__ */ jsx88("div", { className: "py-2", children: routeList.map((route, index) => {
9699
+ const isLast = index === routeList.length - 1;
9689
9700
  return /* @__PURE__ */ jsxs40("div", { className: "flex gap-3", children: [
9690
9701
  /* @__PURE__ */ jsxs40("div", { className: "flex flex-col items-center", children: [
9691
9702
  /* @__PURE__ */ jsx88("div", { className: "w-6 h-6 rounded-full bg-blue-50 border-2 border-blue-400 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx88(CheckCircleOutlined, { className: "text-blue-500 text-xs" }) }),
@@ -9716,11 +9727,12 @@ import { useCallback as useCallback17, useEffect as useEffect36, useMemo as useM
9716
9727
  import {
9717
9728
  Button as Button15,
9718
9729
  Checkbox as Checkbox5,
9730
+ ConfigProvider,
9719
9731
  Drawer as Drawer2,
9720
9732
  Dropdown as Dropdown3,
9721
9733
  Empty as Empty5,
9722
9734
  Input as Input12,
9723
- Modal as Modal10,
9735
+ Modal as Modal8,
9724
9736
  Segmented,
9725
9737
  Select as Select6,
9726
9738
  Space as Space9,
@@ -9993,6 +10005,7 @@ var DataManagementList = ({
9993
10005
  requestOverride,
9994
10006
  rowActions = []
9995
10007
  }) => {
10008
+ const rootRef = useRef14(null);
9996
10009
  const api = useMemo18(() => {
9997
10010
  if (typeof requestOverride === "function") {
9998
10011
  return createFormRuntimeApi({ request: requestOverride });
@@ -10039,6 +10052,13 @@ var DataManagementList = ({
10039
10052
  const [submitOpen, setSubmitOpen] = useState35(false);
10040
10053
  const fetchStateRef = useRef14({});
10041
10054
  const request = api.request;
10055
+ const getPopupContainer = useCallback17(
10056
+ (triggerNode) => triggerNode?.parentElement || rootRef.current || document.body,
10057
+ []
10058
+ );
10059
+ const confirmDanger = useCallback17((title2, content, onOk) => {
10060
+ if (confirmAction(title2, content)) onOk();
10061
+ }, []);
10042
10062
  const visibleFields = useMemo18(
10043
10063
  () => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
10044
10064
  [fields, showFields]
@@ -10319,6 +10339,7 @@ var DataManagementList = ({
10319
10339
  Dropdown3,
10320
10340
  {
10321
10341
  trigger: ["click"],
10342
+ getPopupContainer,
10322
10343
  menu: {
10323
10344
  items: [
10324
10345
  ...rowActions.map((action) => ({
@@ -10339,11 +10360,11 @@ var DataManagementList = ({
10339
10360
  label: "\u5220\u9664",
10340
10361
  danger: true,
10341
10362
  icon: /* @__PURE__ */ jsx89(DeleteOutlined, {}),
10342
- onClick: () => Modal10.confirm({
10343
- title: "\u786E\u8BA4\u5220\u9664",
10344
- content: "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
10345
- onOk: () => handleDelete([String(getRecordId(record))])
10346
- })
10363
+ onClick: () => confirmDanger(
10364
+ "\u786E\u8BA4\u5220\u9664",
10365
+ "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
10366
+ () => handleDelete([String(getRecordId(record))])
10367
+ )
10347
10368
  }
10348
10369
  ] : []
10349
10370
  ]
@@ -10354,7 +10375,17 @@ var DataManagementList = ({
10354
10375
  ] })
10355
10376
  }
10356
10377
  ];
10357
- }, [handleDelete, handleDetail, lockFieldIds, readonly, rowActions, visibleFields, widths]);
10378
+ }, [
10379
+ confirmDanger,
10380
+ getPopupContainer,
10381
+ handleDelete,
10382
+ handleDetail,
10383
+ lockFieldIds,
10384
+ readonly,
10385
+ rowActions,
10386
+ visibleFields,
10387
+ widths
10388
+ ]);
10358
10389
  const tableSize = density === "compact" ? "small" : density === "loose" ? "large" : "middle";
10359
10390
  const importPreviewColumns = useMemo18(() => {
10360
10391
  const keys = Array.from(
@@ -10372,7 +10403,7 @@ var DataManagementList = ({
10372
10403
  };
10373
10404
  });
10374
10405
  }, [fields, importPreview]);
10375
- return /* @__PURE__ */ jsxs41("div", { className: `${fullHeight ? "h-full min-h-screen" : ""} bg-ant-bg-layout`, children: [
10406
+ return /* @__PURE__ */ jsx89(ConfigProvider, { getPopupContainer, children: /* @__PURE__ */ jsxs41("div", { ref: rootRef, className: `${fullHeight ? "h-full min-h-full" : ""} bg-ant-bg-layout`, children: [
10376
10407
  /* @__PURE__ */ jsxs41("div", { className: "mx-auto flex h-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
10377
10408
  /* @__PURE__ */ jsxs41("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
10378
10409
  /* @__PURE__ */ jsxs41("div", { children: [
@@ -10398,7 +10429,9 @@ var DataManagementList = ({
10398
10429
  onSearch: (value) => {
10399
10430
  const nextSearchKeyWord = String(value || "");
10400
10431
  setSearchKeyWord(nextSearchKeyWord);
10401
- persistConfig({ filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup } });
10432
+ persistConfig({
10433
+ filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup }
10434
+ });
10402
10435
  loadData({
10403
10436
  current: 1,
10404
10437
  pageSize,
@@ -10413,6 +10446,7 @@ var DataManagementList = ({
10413
10446
  /* @__PURE__ */ jsx89(
10414
10447
  Dropdown3,
10415
10448
  {
10449
+ getPopupContainer,
10416
10450
  menu: {
10417
10451
  items: [
10418
10452
  {
@@ -10447,6 +10481,7 @@ var DataManagementList = ({
10447
10481
  !readonly && /* @__PURE__ */ jsx89(
10448
10482
  Dropdown3,
10449
10483
  {
10484
+ getPopupContainer,
10450
10485
  menu: {
10451
10486
  items: [
10452
10487
  { key: "import", label: "\u5BFC\u5165\u6570\u636E", onClick: () => setImportOpen(true) },
@@ -10463,73 +10498,74 @@ var DataManagementList = ({
10463
10498
  /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(ReloadOutlined3, {}), onClick: () => loadData({ current, pageSize }) })
10464
10499
  ] })
10465
10500
  ] }),
10466
- /* @__PURE__ */ jsxs41("div", { className: "relative flex-1 overflow-hidden rounded-lg border border-ant-border-secondary bg-ant-bg-container", children: [
10467
- /* @__PURE__ */ jsx89(
10468
- Table3,
10469
- {
10470
- rowKey: (record) => String(getRecordId(record)),
10471
- loading: loading || schemaLoading,
10472
- columns,
10473
- dataSource,
10474
- size: tableSize,
10475
- scroll: {
10476
- x: Math.max(900, visibleFields.length * 160),
10477
- y: fullHeight ? "calc(100vh - 260px)" : void 0
10478
- },
10479
- rowSelection: {
10480
- selectedRowKeys,
10481
- onChange: setSelectedRowKeys
10482
- },
10483
- pagination: {
10484
- current,
10485
- pageSize,
10486
- total,
10487
- showSizeChanger: true,
10488
- showTotal: (count) => `\u5171 ${count} \u6761`
10489
- },
10490
- onChange: (pagination, _filters, sorter) => {
10491
- const sorters = Array.isArray(sorter) ? sorter : [sorter];
10492
- const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
10493
- id: String(item.field),
10494
- isAsc: item.order === "ascend" ? "y" : "n"
10495
- }));
10496
- setSort(nextSort);
10497
- persistConfig({ sort: nextSort });
10498
- loadData({
10499
- current: pagination.current || 1,
10500
- pageSize: pagination.pageSize || pageSize,
10501
- sort: nextSort
10502
- });
10503
- }
10504
- }
10505
- ),
10506
- selectedRowKeys.length > 0 && /* @__PURE__ */ jsxs41("div", { className: "absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-3 rounded-lg border border-ant-border-secondary bg-ant-bg-elevated px-4 py-3 shadow-lg", children: [
10507
- /* @__PURE__ */ jsxs41("span", { className: "text-sm text-ant-color-text-secondary", children: [
10508
- "\u5DF2\u9009 ",
10509
- selectedRowKeys.length,
10510
- " \u6761"
10511
- ] }),
10501
+ selectedRowKeys.length > 0 && /* @__PURE__ */ jsxs41("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-ant-border-secondary bg-ant-bg-container px-4 py-3 shadow-sm", children: [
10502
+ /* @__PURE__ */ jsxs41("span", { className: "text-sm text-ant-color-text-secondary", children: [
10503
+ "\u5DF2\u9009 ",
10504
+ selectedRowKeys.length,
10505
+ " \u6761"
10506
+ ] }),
10507
+ /* @__PURE__ */ jsxs41(Space9, { wrap: true, children: [
10512
10508
  !readonly && /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(SwapOutlined2, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
10513
10509
  !readonly && /* @__PURE__ */ jsx89(
10514
10510
  Button15,
10515
10511
  {
10516
10512
  danger: true,
10517
10513
  icon: /* @__PURE__ */ jsx89(DeleteOutlined, {}),
10518
- onClick: () => Modal10.confirm({
10519
- title: "\u786E\u8BA4\u6279\u91CF\u5220\u9664",
10520
- content: `\u5C06\u5220\u9664 ${selectedRowKeys.length} \u6761\u6570\u636E\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F`,
10521
- onOk: () => handleDelete(selectedRowKeys.map(String))
10522
- }),
10514
+ onClick: () => confirmDanger(
10515
+ "\u786E\u8BA4\u6279\u91CF\u5220\u9664",
10516
+ `\u5C06\u5220\u9664 ${selectedRowKeys.length} \u6761\u6570\u636E\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F`,
10517
+ () => handleDelete(selectedRowKeys.map(String))
10518
+ ),
10523
10519
  children: "\u6279\u91CF\u5220\u9664"
10524
10520
  }
10525
10521
  ),
10526
10522
  /* @__PURE__ */ jsx89(Button15, { type: "link", onClick: () => setSelectedRowKeys([]), children: "\u53D6\u6D88\u9009\u62E9" })
10527
10523
  ] })
10528
- ] })
10524
+ ] }),
10525
+ /* @__PURE__ */ jsx89("div", { className: "relative flex-1 overflow-hidden rounded-lg border border-ant-border-secondary bg-ant-bg-container", children: /* @__PURE__ */ jsx89(
10526
+ Table3,
10527
+ {
10528
+ rowKey: (record) => String(getRecordId(record)),
10529
+ loading: loading || schemaLoading,
10530
+ columns,
10531
+ dataSource,
10532
+ size: tableSize,
10533
+ scroll: {
10534
+ x: Math.max(900, visibleFields.length * 160),
10535
+ y: fullHeight ? selectedRowKeys.length > 0 ? "calc(100vh - 320px)" : "calc(100vh - 260px)" : void 0
10536
+ },
10537
+ rowSelection: {
10538
+ selectedRowKeys,
10539
+ onChange: setSelectedRowKeys
10540
+ },
10541
+ pagination: {
10542
+ current,
10543
+ pageSize,
10544
+ total,
10545
+ showSizeChanger: true,
10546
+ showTotal: (count) => `\u5171 ${count} \u6761`
10547
+ },
10548
+ onChange: (pagination, _filters, sorter) => {
10549
+ const sorters = Array.isArray(sorter) ? sorter : [sorter];
10550
+ const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
10551
+ id: String(item.field),
10552
+ isAsc: item.order === "ascend" ? "y" : "n"
10553
+ }));
10554
+ setSort(nextSort);
10555
+ persistConfig({ sort: nextSort });
10556
+ loadData({
10557
+ current: pagination.current || 1,
10558
+ pageSize: pagination.pageSize || pageSize,
10559
+ sort: nextSort
10560
+ });
10561
+ }
10562
+ }
10563
+ ) })
10529
10564
  ] }),
10530
10565
  /* @__PURE__ */ jsx89(
10531
- Modal10,
10566
+ Modal8,
10532
10567
  {
10568
+ getContainer: false,
10533
10569
  title: "\u9AD8\u7EA7\u7B5B\u9009",
10534
10570
  open: filterOpen,
10535
10571
  width: 760,
@@ -10544,8 +10580,9 @@ var DataManagementList = ({
10544
10580
  }
10545
10581
  ),
10546
10582
  /* @__PURE__ */ jsx89(
10547
- Modal10,
10583
+ Modal8,
10548
10584
  {
10585
+ getContainer: false,
10549
10586
  title: "\u5217\u8BBE\u7F6E",
10550
10587
  open: columnOpen,
10551
10588
  width: 720,
@@ -10629,8 +10666,9 @@ var DataManagementList = ({
10629
10666
  }
10630
10667
  ),
10631
10668
  /* @__PURE__ */ jsx89(
10632
- Modal10,
10669
+ Modal8,
10633
10670
  {
10671
+ getContainer: false,
10634
10672
  title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
10635
10673
  open: exportOpen,
10636
10674
  onCancel: () => setExportOpen(false),
@@ -10659,8 +10697,9 @@ var DataManagementList = ({
10659
10697
  }
10660
10698
  ),
10661
10699
  /* @__PURE__ */ jsx89(
10662
- Modal10,
10700
+ Modal8,
10663
10701
  {
10702
+ getContainer: false,
10664
10703
  title: "\u6279\u91CF\u5BA1\u6279",
10665
10704
  open: batchApprovalOpen,
10666
10705
  onCancel: () => setBatchApprovalOpen(false),
@@ -10700,8 +10739,9 @@ var DataManagementList = ({
10700
10739
  }
10701
10740
  ),
10702
10741
  /* @__PURE__ */ jsxs41(
10703
- Modal10,
10742
+ Modal8,
10704
10743
  {
10744
+ getContainer: false,
10705
10745
  title: "\u5BFC\u5165\u6570\u636E",
10706
10746
  open: importOpen,
10707
10747
  width: 720,
@@ -10743,6 +10783,7 @@ var DataManagementList = ({
10743
10783
  /* @__PURE__ */ jsxs41(
10744
10784
  Drawer2,
10745
10785
  {
10786
+ getContainer: false,
10746
10787
  title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
10747
10788
  open: recordsOpen,
10748
10789
  width: 720,
@@ -10774,6 +10815,7 @@ var DataManagementList = ({
10774
10815
  /* @__PURE__ */ jsx89(
10775
10816
  Drawer2,
10776
10817
  {
10818
+ getContainer: false,
10777
10819
  title: "\u8BE6\u60C5",
10778
10820
  open: detailOpen,
10779
10821
  width: 720,
@@ -10789,6 +10831,7 @@ var DataManagementList = ({
10789
10831
  /* @__PURE__ */ jsx89(
10790
10832
  Drawer2,
10791
10833
  {
10834
+ getContainer: false,
10792
10835
  title: "\u65B0\u589E\u6570\u636E",
10793
10836
  open: submitOpen,
10794
10837
  width: 720,
@@ -10803,7 +10846,7 @@ var DataManagementList = ({
10803
10846
  }) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
10804
10847
  }
10805
10848
  )
10806
- ] });
10849
+ ] }) });
10807
10850
  };
10808
10851
 
10809
10852
  // src/templates/FormSubmitTemplate.tsx
@@ -10965,7 +11008,7 @@ var InnerFormContent = ({
10965
11008
  data: formData,
10966
11009
  submissionDepartmentId: departmentId
10967
11010
  });
10968
- setPreviewRoutes(routes);
11011
+ setPreviewRoutes(Array.isArray(routes) ? routes : []);
10969
11012
  } catch (error) {
10970
11013
  console.error("[FormSubmitTemplate] Preview failed:", error);
10971
11014
  setPreviewRoutes([]);
@@ -11055,17 +11098,18 @@ var InnerFormContent = ({
11055
11098
  }
11056
11099
  )
11057
11100
  ] }) : null;
11058
- const actionsNode = !submitted ? /* @__PURE__ */ jsx90(StickyActionBar, { actions, inDrawer }) : null;
11059
- return /* @__PURE__ */ jsxs42(RuntimePageShell, { actions: actionsNode, inDrawer, children: [
11101
+ const actionsNode = !submitted ? /* @__PURE__ */ jsx90(
11102
+ StickyActionBar,
11103
+ {
11104
+ actions,
11105
+ inDrawer,
11106
+ position: "inline",
11107
+ className: "mt-6 -mx-5 -mb-5 rounded-b-lg md:-mx-6 md:-mb-6"
11108
+ }
11109
+ ) : null;
11110
+ return /* @__PURE__ */ jsxs42(RuntimePageShell, { inDrawer, children: [
11060
11111
  /* @__PURE__ */ jsxs42("div", { className: "space-y-6", children: [
11061
- header || /* @__PURE__ */ jsx90(
11062
- SummaryPanel,
11063
- {
11064
- title: schema.formMeta.title,
11065
- eyebrow: formType === "process" ? "\u6D41\u7A0B\u53D1\u8D77" : "\u6570\u636E\u63D0\u4EA4",
11066
- status: formType === "process" ? { label: "\u5F85\u63D0\u4EA4", tone: "brand" } : void 0
11067
- }
11068
- ),
11112
+ header,
11069
11113
  enableDraft && hasDraft && !submitted && /* @__PURE__ */ jsx90("div", { children: /* @__PURE__ */ jsx90(
11070
11114
  DraftManager,
11071
11115
  {
@@ -11079,7 +11123,8 @@ var InnerFormContent = ({
11079
11123
  departmentSelector,
11080
11124
  beforeForm,
11081
11125
  renderForm ? renderForm({ schema, config }) : /* @__PURE__ */ jsx90(FormRenderer, { columns: 2 }),
11082
- afterForm
11126
+ afterForm,
11127
+ actionsNode
11083
11128
  ] }) : successInfo && /* @__PURE__ */ jsx90(
11084
11129
  SubmitSuccessCard,
11085
11130
  {