sy-form-components 0.2.7 → 0.2.9

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.js CHANGED
@@ -6893,6 +6893,38 @@ var normalizeField = (key, field, system = false) => ({
6893
6893
  width: field?.width,
6894
6894
  system
6895
6895
  });
6896
+ var SYSTEM_VALUE_ALIASES = {
6897
+ formInstanceId: ["formInstanceId", "formInstId", "form_instance_id", "processInstanceId"],
6898
+ instanceTitle: ["instanceTitle", "instance_title", "processInstanceTitle", "title"],
6899
+ createdBy: ["createdBy", "created_by", "originator"],
6900
+ createdByName: ["createdByName", "created_by_name", "originatorName", "creatorName"],
6901
+ createdByDepartmentId: ["createdByDepartmentId", "created_by_department_id", "originatorCorp"],
6902
+ createdByDepartmentName: [
6903
+ "createdByDepartmentName",
6904
+ "created_by_department_name",
6905
+ "originatorDepartmentName",
6906
+ "originatorCorpName"
6907
+ ],
6908
+ createdAt: ["createdAt", "created_at", "createTime", "gmtCreate"],
6909
+ updatedAt: ["updatedAt", "updated_at", "modifiedTime", "modifyTime", "gmtModified"]
6910
+ };
6911
+ var pickAliasValue = (record, aliases) => {
6912
+ for (const alias of aliases) {
6913
+ const value = record?.[alias];
6914
+ if (value !== void 0 && value !== null && value !== "") return value;
6915
+ }
6916
+ return void 0;
6917
+ };
6918
+ var normalizeDataManagementRecord = (record) => {
6919
+ if (!record || typeof record !== "object" || Array.isArray(record)) return record;
6920
+ const normalized = { ...record };
6921
+ Object.entries(SYSTEM_VALUE_ALIASES).forEach(([targetKey, aliases]) => {
6922
+ if (normalized[targetKey] !== void 0 && normalized[targetKey] !== null) return;
6923
+ const aliasValue = pickAliasValue(record, aliases);
6924
+ if (aliasValue !== void 0) normalized[targetKey] = aliasValue;
6925
+ });
6926
+ return normalized;
6927
+ };
6896
6928
  var PROCESS_INSTANCE_STATUS_OPTIONS = [
6897
6929
  { label: "\u5F85\u5904\u7406", value: "pending" },
6898
6930
  { label: "\u5BA1\u6279\u4E2D", value: "running" },
@@ -6947,15 +6979,29 @@ var PROCESS_SYSTEM_FIELDS = [
6947
6979
  )
6948
6980
  ];
6949
6981
  var BASE_SYSTEM_FIELDS = [
6950
- normalizeField("createTime", { label: "\u521B\u5EFA\u65F6\u95F4", componentName: "DateField", width: 170 }, true),
6951
6982
  normalizeField(
6952
- "modifiedTime",
6953
- { label: "\u66F4\u65B0\u65F6\u95F4", componentName: "DateField", width: 170 },
6983
+ "instanceTitle",
6984
+ { label: "\u5B9E\u4F8B\u6807\u9898", componentName: "TextField", width: 220, displayable: true },
6954
6985
  true
6955
6986
  ),
6956
6987
  normalizeField(
6957
- "originatorName",
6958
- { label: "\u521B\u5EFA\u4EBA", componentName: "TextField", width: 130 },
6988
+ "createdByName",
6989
+ { label: "\u521B\u5EFA\u4EBA", componentName: "TextField", width: 130, displayable: true },
6990
+ true
6991
+ ),
6992
+ normalizeField(
6993
+ "createdByDepartmentName",
6994
+ { label: "\u521B\u5EFA\u4EBA\u90E8\u95E8", componentName: "TextField", width: 150, displayable: true },
6995
+ true
6996
+ ),
6997
+ normalizeField(
6998
+ "createdAt",
6999
+ { label: "\u521B\u5EFA\u65F6\u95F4", componentName: "DateField", width: 170, displayable: true },
7000
+ true
7001
+ ),
7002
+ normalizeField(
7003
+ "updatedAt",
7004
+ { label: "\u66F4\u65B0\u65F6\u95F4", componentName: "DateField", width: 170, displayable: true },
6959
7005
  true
6960
7006
  )
6961
7007
  ];
@@ -6976,7 +7022,7 @@ var normalizeDataManagementList = (payload) => {
6976
7022
  const records = body?.data || body?.records || body?.list || body?.items || [];
6977
7023
  const total = body?.totalCount ?? body?.total ?? body?.count ?? records.length;
6978
7024
  return {
6979
- records: Array.isArray(records) ? records : [],
7025
+ records: Array.isArray(records) ? records.map(normalizeDataManagementRecord) : [],
6980
7026
  total: Number(total) || 0
6981
7027
  };
6982
7028
  };
@@ -6996,7 +7042,9 @@ var buildFilterPayload = (group) => {
6996
7042
  var normalizeColumnConfig = (cfg, fields) => {
6997
7043
  const allowed = new Set(fields.map((field) => field.fieldId));
6998
7044
  const configured = Array.isArray(cfg?.showFields) ? cfg.showFields.filter((fieldId) => allowed.has(fieldId)) : [];
6999
- const defaultShow = fields.filter((field) => !field.system || field.displayable).slice(0, 8).map((field) => field.fieldId);
7045
+ const defaultBusinessFields = fields.filter((field) => !field.system).slice(0, 8).map((field) => field.fieldId);
7046
+ const defaultSystemFields = fields.filter((field) => field.system && field.displayable).map((field) => field.fieldId);
7047
+ const defaultShow = [...defaultBusinessFields, ...defaultSystemFields];
7000
7048
  return {
7001
7049
  showFields: configured.length > 0 ? configured : defaultShow,
7002
7050
  widths: cfg?.widths || {},
@@ -7658,8 +7706,14 @@ var import_react49 = require("react");
7658
7706
  var FORM_INSTANCE_METADATA_KEYS = /* @__PURE__ */ new Set([
7659
7707
  "appType",
7660
7708
  "code",
7709
+ "createTime",
7710
+ "created_at",
7661
7711
  "createdAt",
7662
7712
  "createdBy",
7713
+ "created_by",
7714
+ "created_by_department_id",
7715
+ "created_by_department_name",
7716
+ "created_by_name",
7663
7717
  "createdByDepartmentId",
7664
7718
  "createdByDepartmentName",
7665
7719
  "createdByName",
@@ -7671,9 +7725,18 @@ var FORM_INSTANCE_METADATA_KEYS = /* @__PURE__ */ new Set([
7671
7725
  "formUuid",
7672
7726
  "instanceTitle",
7673
7727
  "message",
7728
+ "modifiedTime",
7729
+ "modifyTime",
7730
+ "originator",
7731
+ "originatorCorp",
7732
+ "originatorCorpName",
7733
+ "originatorDepartmentName",
7734
+ "originatorName",
7735
+ "processInstanceTitle",
7674
7736
  "result",
7675
7737
  "success",
7676
7738
  "title",
7739
+ "updated_at",
7677
7740
  "updatedAt"
7678
7741
  ]);
7679
7742
  var isPlainRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -7720,6 +7783,76 @@ var extractFormValues = (formInstance, fieldIds) => {
7720
7783
  const flatValues = pickKnownFields(formInstance, fieldIds);
7721
7784
  return Object.keys(flatValues).length > 0 ? flatValues : null;
7722
7785
  };
7786
+ var firstValue = (source, keys) => {
7787
+ for (const key of keys) {
7788
+ const value = source[key];
7789
+ if (value !== void 0 && value !== null && value !== "") return value;
7790
+ }
7791
+ return void 0;
7792
+ };
7793
+ var normalizeFormInstanceInfo = (formInstance, fallback) => {
7794
+ if (!isPlainRecord(formInstance)) return null;
7795
+ const creator = isPlainRecord(formInstance.creator) ? formInstance.creator : {};
7796
+ const formInstanceId = firstValue(formInstance, [
7797
+ "formInstanceId",
7798
+ "formInstId",
7799
+ "form_instance_id",
7800
+ "id"
7801
+ ]);
7802
+ const createdByName = firstValue(formInstance, [
7803
+ "createdByName",
7804
+ "created_by_name",
7805
+ "originatorName",
7806
+ "creatorName"
7807
+ ]);
7808
+ const createdByDepartmentName = firstValue(formInstance, [
7809
+ "createdByDepartmentName",
7810
+ "created_by_department_name",
7811
+ "originatorDepartmentName",
7812
+ "originatorCorpName"
7813
+ ]);
7814
+ return {
7815
+ ...formInstance,
7816
+ formInstanceId: formInstanceId || fallback?.formInstanceId || "",
7817
+ formUuid: formInstance.formUuid || fallback?.formUuid || "",
7818
+ appType: formInstance.appType || fallback?.appType || "",
7819
+ data: isPlainRecord(formInstance.data) ? formInstance.data : {},
7820
+ title: firstValue(formInstance, [
7821
+ "title",
7822
+ "instanceTitle",
7823
+ "instance_title",
7824
+ "processInstanceTitle"
7825
+ ]) || void 0,
7826
+ instanceTitle: firstValue(formInstance, [
7827
+ "instanceTitle",
7828
+ "instance_title",
7829
+ "processInstanceTitle",
7830
+ "title"
7831
+ ]) || void 0,
7832
+ creator: {
7833
+ userId: creator.userId || creator.id || formInstance.createdBy || formInstance.originator || "",
7834
+ name: creator.name || createdByName || "",
7835
+ avatar: creator.avatar,
7836
+ department: creator.department || createdByDepartmentName || ""
7837
+ },
7838
+ createdBy: firstValue(formInstance, ["createdBy", "created_by", "originator"]),
7839
+ createdByName,
7840
+ createdByDepartmentId: firstValue(formInstance, [
7841
+ "createdByDepartmentId",
7842
+ "created_by_department_id",
7843
+ "originatorCorp"
7844
+ ]),
7845
+ createdByDepartmentName,
7846
+ createdAt: firstValue(formInstance, ["createdAt", "created_at", "createTime", "gmtCreate"]) || "",
7847
+ updatedAt: firstValue(formInstance, [
7848
+ "updatedAt",
7849
+ "updated_at",
7850
+ "modifiedTime",
7851
+ "modifyTime",
7852
+ "gmtModified"
7853
+ ])
7854
+ };
7855
+ };
7723
7856
 
7724
7857
  // src/hooks/useFormDetail.ts
7725
7858
  function useFormDetail(options) {
@@ -7750,8 +7883,13 @@ function useFormDetail(options) {
7750
7883
  if (!permResult || !hasViewOperation(permResult.operations, "view")) {
7751
7884
  onPermissionDenied?.();
7752
7885
  }
7886
+ const normalizedInfo = normalizeFormInstanceInfo(formResult, {
7887
+ formUuid,
7888
+ appType,
7889
+ formInstanceId
7890
+ });
7753
7891
  setPermissions(permResult);
7754
- setInstanceInfo(formResult);
7892
+ setInstanceInfo(normalizedInfo);
7755
7893
  setFormData(extractFormValues(formResult, fieldIds));
7756
7894
  } catch (error) {
7757
7895
  console.error("[useFormDetail] Failed to load data:", error);
@@ -8229,6 +8367,16 @@ function useApprovalActions(options) {
8229
8367
 
8230
8368
  // src/hooks/useChangeRecords.ts
8231
8369
  var import_react52 = require("react");
8370
+ var normalizeChangeRecordList = (value) => {
8371
+ const body = value?.data ?? value?.result ?? value ?? {};
8372
+ const records = body.records ?? body.data ?? body.list ?? body.items ?? [];
8373
+ return {
8374
+ records: Array.isArray(records) ? records : [],
8375
+ total: Number(body.total ?? body.totalCount ?? body.count ?? records.length) || 0,
8376
+ page: Number(body.page ?? body.currentPage ?? 1) || 1,
8377
+ pageSize: Number(body.pageSize ?? body.limit ?? 20) || 20
8378
+ };
8379
+ };
8232
8380
  function useChangeRecords(options) {
8233
8381
  const { formUuid, appType, formInstanceId, pageSize = 20, autoLoad = true } = options;
8234
8382
  const { api } = useFormContext();
@@ -8257,13 +8405,14 @@ function useChangeRecords(options) {
8257
8405
  pageSize
8258
8406
  });
8259
8407
  if (!mountedRef.current) return;
8408
+ const normalized = normalizeChangeRecordList(result);
8260
8409
  if (append) {
8261
- setRecords((prev) => [...prev, ...result.records]);
8410
+ setRecords((prev) => [...prev, ...normalized.records]);
8262
8411
  } else {
8263
- setRecords(result.records);
8412
+ setRecords(normalized.records);
8264
8413
  }
8265
- setTotal(result.total);
8266
- setPage(pageNum);
8414
+ setTotal(normalized.total);
8415
+ setPage(normalized.page || pageNum);
8267
8416
  } catch (error) {
8268
8417
  console.error("[useChangeRecords] Failed to load change records:", error);
8269
8418
  } finally {
@@ -8279,7 +8428,8 @@ function useChangeRecords(options) {
8279
8428
  fetchRecords(1, false);
8280
8429
  }
8281
8430
  }, [autoLoad, fetchRecords]);
8282
- const hasMore = records.length < total;
8431
+ const safeRecords = Array.isArray(records) ? records : [];
8432
+ const hasMore = safeRecords.length < total;
8283
8433
  const loadMore = (0, import_react52.useCallback)(async () => {
8284
8434
  if (!hasMore || loading) return;
8285
8435
  await fetchRecords(page + 1, true);
@@ -8291,7 +8441,7 @@ function useChangeRecords(options) {
8291
8441
  await fetchRecords(1, false);
8292
8442
  }, [fetchRecords]);
8293
8443
  return {
8294
- records,
8444
+ records: safeRecords,
8295
8445
  loading,
8296
8446
  total,
8297
8447
  page,
@@ -9057,6 +9207,21 @@ var import_icons6 = require("@ant-design/icons");
9057
9207
  var import_react57 = require("react");
9058
9208
  var import_antd24 = require("antd");
9059
9209
  var import_icons5 = require("@ant-design/icons");
9210
+
9211
+ // src/utils/confirmAction.ts
9212
+ var confirmAction = (title, content) => {
9213
+ const message2 = [title, content].filter(Boolean).join("\n") || "\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F";
9214
+ if (typeof window === "undefined" || typeof window.confirm !== "function") {
9215
+ return true;
9216
+ }
9217
+ try {
9218
+ return window.confirm(message2);
9219
+ } catch {
9220
+ return true;
9221
+ }
9222
+ };
9223
+
9224
+ // src/modules/StickyActionBar.tsx
9060
9225
  var import_jsx_runtime81 = require("react/jsx-runtime");
9061
9226
  var getActionPriority = (action) => {
9062
9227
  const maybePriority = action.priority;
@@ -9071,8 +9236,8 @@ var StickyActionBar = ({
9071
9236
  className = "",
9072
9237
  maxMobileButtons = 2,
9073
9238
  layoutMode = "default",
9074
- inDrawer = false,
9075
- maxWidth = 1120
9239
+ maxWidth = 1120,
9240
+ position = "sticky"
9076
9241
  }) => {
9077
9242
  const [isMobile, setIsMobile] = (0, import_react57.useState)(false);
9078
9243
  (0, import_react57.useEffect)(() => {
@@ -9091,6 +9256,14 @@ var StickyActionBar = ({
9091
9256
  const moreMobile = visibleActions.slice(maxMobileButtons);
9092
9257
  const leftActions = visibleActions.filter((action) => getPlacement(action) === "left");
9093
9258
  const rightActions = visibleActions.filter((action) => getPlacement(action) !== "left");
9259
+ const positionClass = position === "fixed" ? "fixed bottom-0 left-0 right-0" : position === "inline" ? "relative" : "sticky bottom-0";
9260
+ const runAction = (action) => {
9261
+ if (action.confirm) {
9262
+ const confirmed = confirmAction(action.confirm.title, action.confirm.content);
9263
+ if (!confirmed) return;
9264
+ }
9265
+ action.onClick();
9266
+ };
9094
9267
  const renderButton = (action, mobile = false) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
9095
9268
  import_antd24.Button,
9096
9269
  {
@@ -9099,19 +9272,7 @@ var StickyActionBar = ({
9099
9272
  loading: action.loading,
9100
9273
  disabled: action.disabled,
9101
9274
  icon: action.icon,
9102
- onClick: () => {
9103
- if (action.confirm) {
9104
- import_antd24.Modal.confirm({
9105
- title: action.confirm.title,
9106
- content: action.confirm.content,
9107
- okText: action.confirm.okText || "\u786E\u8BA4",
9108
- cancelText: action.confirm.cancelText || "\u53D6\u6D88",
9109
- onOk: action.onClick
9110
- });
9111
- return;
9112
- }
9113
- action.onClick();
9114
- },
9275
+ onClick: () => runAction(action),
9115
9276
  className: `${mobile ? "min-w-0 flex-1" : "min-w-[88px]"} rounded-md`,
9116
9277
  children: action.label
9117
9278
  },
@@ -9120,7 +9281,7 @@ var StickyActionBar = ({
9120
9281
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
9121
9282
  "div",
9122
9283
  {
9123
- 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}`,
9284
+ 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}`,
9124
9285
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
9125
9286
  "div",
9126
9287
  {
@@ -9140,19 +9301,7 @@ var StickyActionBar = ({
9140
9301
  danger: action.type === "danger",
9141
9302
  disabled: action.disabled,
9142
9303
  icon: action.icon,
9143
- onClick: () => {
9144
- if (action.confirm) {
9145
- import_antd24.Modal.confirm({
9146
- title: action.confirm.title,
9147
- content: action.confirm.content,
9148
- okText: action.confirm.okText || "\u786E\u8BA4",
9149
- cancelText: action.confirm.cancelText || "\u53D6\u6D88",
9150
- onOk: action.onClick
9151
- });
9152
- return;
9153
- }
9154
- action.onClick();
9155
- }
9304
+ onClick: () => runAction(action)
9156
9305
  }))
9157
9306
  },
9158
9307
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_antd24.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_icons5.MoreOutlined, {}), className: "rounded-md", children: "\u66F4\u591A" })
@@ -9319,6 +9468,7 @@ var ApprovalActionBar = ({
9319
9468
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
9320
9469
  import_antd25.Modal,
9321
9470
  {
9471
+ getContainer: false,
9322
9472
  title: getModalTitle(modalAction),
9323
9473
  open: modalAction !== null,
9324
9474
  okText: "\u786E\u8BA4",
@@ -9354,6 +9504,7 @@ var ApprovalActionBar = ({
9354
9504
  import_antd25.Select,
9355
9505
  {
9356
9506
  placeholder: "\u8BF7\u9009\u62E9\u9000\u56DE\u8282\u70B9",
9507
+ getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
9357
9508
  options: returnableNodes.map((node) => ({
9358
9509
  value: node.nodeId || node.id || "",
9359
9510
  label: renderReturnNodeLabel ? renderReturnNodeLabel(node) : node.nodeName || node.name || node.nodeId || node.id
@@ -9490,6 +9641,7 @@ var ApprovalActions = ({
9490
9641
  import_antd26.Dropdown,
9491
9642
  {
9492
9643
  trigger: ["click"],
9644
+ getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
9493
9645
  menu: {
9494
9646
  items: moreButtons.map((action) => ({
9495
9647
  key: action.action,
@@ -9507,6 +9659,7 @@ var ApprovalActions = ({
9507
9659
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
9508
9660
  import_antd26.Modal,
9509
9661
  {
9662
+ getContainer: false,
9510
9663
  title,
9511
9664
  open: modalAction !== null,
9512
9665
  okText: "\u786E\u8BA4",
@@ -9558,15 +9711,9 @@ var FormActionBar = ({
9558
9711
  });
9559
9712
  const handleClick = async (action) => {
9560
9713
  if (action.confirm) {
9561
- import_antd27.Modal.confirm({
9562
- title: action.confirm.title,
9563
- content: action.confirm.content,
9564
- okText: "\u786E\u8BA4",
9565
- cancelText: "\u53D6\u6D88",
9566
- onOk: async () => {
9567
- await executeAction(action);
9568
- }
9569
- });
9714
+ const confirmed = confirmAction(action.confirm.title, action.confirm.content);
9715
+ if (!confirmed) return;
9716
+ await executeAction(action);
9570
9717
  } else {
9571
9718
  await executeAction(action);
9572
9719
  }
@@ -9648,11 +9795,11 @@ var RuntimePageShell = ({
9648
9795
  }
9649
9796
  return children;
9650
9797
  };
9651
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `sy-runtime-page min-h-screen bg-ant-bg-layout text-ant-text ${className}`, children: [
9798
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `sy-runtime-page min-h-full bg-ant-bg-layout text-ant-text ${className}`, children: [
9652
9799
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9653
9800
  "div",
9654
9801
  {
9655
- 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}`,
9802
+ 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}`,
9656
9803
  style: { maxWidth: maxWidthStyle },
9657
9804
  children: renderState()
9658
9805
  }
@@ -9722,8 +9869,8 @@ var SummaryPanel = ({
9722
9869
  )
9723
9870
  ] }),
9724
9871
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h1", { className: "m-0 break-words text-2xl font-semibold leading-9 text-ant-text md:text-[28px]", children: title }),
9725
- items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mt-5 grid grid-cols-1 gap-4 md:grid-cols-3", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
9726
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gray-100 text-ant-text-secondary", children: item.icon }),
9872
+ items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mt-5 grid grid-cols-1 gap-4 md:grid-cols-4", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
9873
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gray-100 text-ant-text-secondary", children: item.icon }),
9727
9874
  /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { className: "min-w-0", children: [
9728
9875
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "block text-xs leading-5 text-ant-text-tertiary", children: item.label }),
9729
9876
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "block break-words text-sm font-medium leading-6 text-ant-text", children: item.value || "-" })
@@ -9795,9 +9942,11 @@ var ProcessPreview = ({
9795
9942
  routes,
9796
9943
  loading = false
9797
9944
  }) => {
9945
+ const routeList = Array.isArray(routes) ? routes : [];
9798
9946
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9799
9947
  import_antd31.Modal,
9800
9948
  {
9949
+ getContainer: false,
9801
9950
  title: "\u6D41\u7A0B\u9884\u89C8",
9802
9951
  open,
9803
9952
  onCancel: onClose,
@@ -9806,8 +9955,8 @@ var ProcessPreview = ({
9806
9955
  /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Button, { onClick: onClose, children: "\u53D6\u6D88" }),
9807
9956
  /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Button, { type: "primary", onClick: onConfirm, loading, children: "\u786E\u8BA4\u63D0\u4EA4" })
9808
9957
  ] }),
9809
- children: loading && routes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Skeleton, { active: true, paragraph: { rows: 4 } }) : routes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "text-sm text-gray-400 text-center py-8", children: "\u6682\u65E0\u6D41\u7A0B\u8282\u70B9" }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "py-2", children: routes.map((route, index) => {
9810
- const isLast = index === routes.length - 1;
9958
+ children: loading && routeList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Skeleton, { active: true, paragraph: { rows: 4 } }) : routeList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "text-sm text-gray-400 text-center py-8", children: "\u6682\u65E0\u6D41\u7A0B\u8282\u70B9" }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "py-2", children: routeList.map((route, index) => {
9959
+ const isLast = index === routeList.length - 1;
9811
9960
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex gap-3", children: [
9812
9961
  /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col items-center", children: [
9813
9962
  /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("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__ */ (0, import_jsx_runtime88.jsx)(import_icons10.CheckCircleOutlined, { className: "text-blue-500 text-xs" }) }),
@@ -9836,6 +9985,7 @@ var ProcessPreview = ({
9836
9985
  // src/modules/DataManagementList.tsx
9837
9986
  var import_react61 = require("react");
9838
9987
  var import_antd32 = require("antd");
9988
+ var import_dayjs5 = __toESM(require("dayjs"));
9839
9989
  var import_icons11 = require("@ant-design/icons");
9840
9990
  var import_jsx_runtime89 = require("react/jsx-runtime");
9841
9991
  var createGroup = () => ({
@@ -9870,6 +10020,11 @@ var formatPrimitive = (value) => {
9870
10020
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-ant-color-text-quaternary", children: "--" });
9871
10021
  return String(value);
9872
10022
  };
10023
+ var formatDateTime = (value) => {
10024
+ if (value === void 0 || value === null || value === "") return formatPrimitive("");
10025
+ const parsed = (0, import_dayjs5.default)(value);
10026
+ return parsed.isValid() ? parsed.format("YYYY-MM-DD HH:mm:ss") : String(value);
10027
+ };
9873
10028
  var pickOptionLabel = (field, value) => {
9874
10029
  const options = field.options || field.optionList || field.option_list || field.componentProps?.options || [];
9875
10030
  const scalar = typeof value === "object" ? value?.value ?? value?.id ?? value?.label ?? value?.name : value;
@@ -9897,6 +10052,9 @@ var renderStatusTag = (value, fieldId) => {
9897
10052
  var renderCellValue = (value, field) => {
9898
10053
  const status = renderStatusTag(value, field.fieldId);
9899
10054
  if (status) return status;
10055
+ if (field.componentName === "DateField" || field.componentName === "DateTimeField") {
10056
+ return formatDateTime(value);
10057
+ }
9900
10058
  if (Array.isArray(value)) {
9901
10059
  if (value.length === 0) return formatPrimitive("");
9902
10060
  if (field.componentName === "ImageField") {
@@ -10075,6 +10233,54 @@ function FilterGroupEditor({
10075
10233
  }
10076
10234
  );
10077
10235
  }
10236
+ function ResizableColumnTitle({
10237
+ label,
10238
+ width,
10239
+ onResize,
10240
+ onResizeEnd
10241
+ }) {
10242
+ const dragRef = (0, import_react61.useRef)({ startX: 0, startWidth: width, latestWidth: width });
10243
+ const handleMouseDown = (event) => {
10244
+ event.preventDefault();
10245
+ event.stopPropagation();
10246
+ dragRef.current = {
10247
+ startX: event.clientX,
10248
+ startWidth: width,
10249
+ latestWidth: width
10250
+ };
10251
+ const handleMouseMove = (moveEvent) => {
10252
+ const nextWidth = Math.min(
10253
+ 520,
10254
+ Math.max(96, dragRef.current.startWidth + moveEvent.clientX - dragRef.current.startX)
10255
+ );
10256
+ dragRef.current.latestWidth = nextWidth;
10257
+ onResize(nextWidth);
10258
+ };
10259
+ const handleMouseUp = () => {
10260
+ document.removeEventListener("mousemove", handleMouseMove);
10261
+ document.removeEventListener("mouseup", handleMouseUp);
10262
+ onResizeEnd(dragRef.current.latestWidth);
10263
+ };
10264
+ document.addEventListener("mousemove", handleMouseMove);
10265
+ document.addEventListener("mouseup", handleMouseUp);
10266
+ };
10267
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "relative flex min-w-0 items-center pr-3", children: [
10268
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "min-w-0 truncate", children: label }),
10269
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10270
+ "span",
10271
+ {
10272
+ "aria-hidden": true,
10273
+ className: "absolute -right-2 top-1/2 h-5 w-2 -translate-y-1/2 cursor-col-resize rounded hover:bg-ant-color-primary",
10274
+ onClick: (event) => {
10275
+ event.preventDefault();
10276
+ event.stopPropagation();
10277
+ },
10278
+ onMouseDown: handleMouseDown,
10279
+ title: "\u62D6\u62FD\u8C03\u6574\u5217\u5BBD"
10280
+ }
10281
+ )
10282
+ ] });
10283
+ }
10078
10284
  var DataManagementList = ({
10079
10285
  appType,
10080
10286
  formUuid,
@@ -10084,10 +10290,12 @@ var DataManagementList = ({
10084
10290
  configScope = "global",
10085
10291
  title,
10086
10292
  detailRenderer,
10293
+ detailPageUrlBuilder,
10087
10294
  submitRenderer,
10088
10295
  requestOverride,
10089
10296
  rowActions = []
10090
10297
  }) => {
10298
+ const rootRef = (0, import_react61.useRef)(null);
10091
10299
  const api = (0, import_react61.useMemo)(() => {
10092
10300
  if (typeof requestOverride === "function") {
10093
10301
  return createFormRuntimeApi({ request: requestOverride });
@@ -10096,9 +10304,11 @@ var DataManagementList = ({
10096
10304
  }, [requestOverride]);
10097
10305
  const [fields, setFields] = (0, import_react61.useState)([]);
10098
10306
  const [config, setConfig] = (0, import_react61.useState)({});
10307
+ const [formType, setFormType] = (0, import_react61.useState)("form");
10099
10308
  const [showFields, setShowFields] = (0, import_react61.useState)([]);
10100
10309
  const [lockFieldIds, setLockFieldIds] = (0, import_react61.useState)([]);
10101
10310
  const [widths, setWidths] = (0, import_react61.useState)({});
10311
+ const widthsRef = (0, import_react61.useRef)({});
10102
10312
  const [sort, setSort] = (0, import_react61.useState)([]);
10103
10313
  const [density, setDensity] = (0, import_react61.useState)("middle");
10104
10314
  const [detailOpenMode, setDetailOpenMode] = (0, import_react61.useState)("drawer");
@@ -10134,10 +10344,20 @@ var DataManagementList = ({
10134
10344
  const [submitOpen, setSubmitOpen] = (0, import_react61.useState)(false);
10135
10345
  const fetchStateRef = (0, import_react61.useRef)({});
10136
10346
  const request = api.request;
10347
+ const getPopupContainer = (0, import_react61.useCallback)(
10348
+ (triggerNode) => rootRef.current || triggerNode?.ownerDocument?.body || (typeof document !== "undefined" ? document.body : triggerNode?.parentElement),
10349
+ []
10350
+ );
10351
+ const confirmDanger = (0, import_react61.useCallback)((title2, content, onOk) => {
10352
+ if (confirmAction(title2, content)) onOk();
10353
+ }, []);
10137
10354
  const visibleFields = (0, import_react61.useMemo)(
10138
10355
  () => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
10139
10356
  [fields, showFields]
10140
10357
  );
10358
+ (0, import_react61.useEffect)(() => {
10359
+ widthsRef.current = widths;
10360
+ }, [widths]);
10141
10361
  (0, import_react61.useEffect)(() => {
10142
10362
  fetchStateRef.current = {
10143
10363
  current,
@@ -10205,16 +10425,18 @@ var DataManagementList = ({
10205
10425
  }).catch(() => void 0);
10206
10426
  if (!mounted) return;
10207
10427
  const resolved = normalizeColumnConfig(saved, allFields);
10428
+ const resolvedDetailOpenMode = detailPageUrlBuilder ? resolved.detailOpenMode : "drawer";
10208
10429
  const nextSearchKeyWord = saved?.filter?.searchKeyWord || "";
10209
10430
  const nextFilterGroup = hydrateFilterGroup(saved?.filter?.group);
10210
10431
  setFields(allFields);
10432
+ setFormType(schemaResult.formType || "form");
10211
10433
  setConfig(saved || {});
10212
10434
  setShowFields(resolved.showFields);
10213
10435
  setWidths(resolved.widths);
10214
10436
  setLockFieldIds(resolved.lockFieldIds);
10215
10437
  setSort(resolved.sort);
10216
10438
  setDensity(resolved.density);
10217
- setDetailOpenMode(resolved.detailOpenMode);
10439
+ setDetailOpenMode(resolvedDetailOpenMode);
10218
10440
  setPageSize(resolved.pageSize);
10219
10441
  setSearchKeyWord(nextSearchKeyWord);
10220
10442
  setFilterGroup(nextFilterGroup);
@@ -10236,7 +10458,7 @@ var DataManagementList = ({
10236
10458
  return () => {
10237
10459
  mounted = false;
10238
10460
  };
10239
- }, [appType, configScope, formUuid, loadData, menuFormUuid, request]);
10461
+ }, [appType, configScope, detailPageUrlBuilder, formUuid, loadData, menuFormUuid, request]);
10240
10462
  const persistConfig = (0, import_react61.useCallback)(
10241
10463
  async (patch) => {
10242
10464
  const nextConfig = { ...config, ...patch };
@@ -10260,22 +10482,62 @@ var DataManagementList = ({
10260
10482
  showFields,
10261
10483
  lockFieldIds,
10262
10484
  widths,
10485
+ sort,
10263
10486
  density,
10264
10487
  detailOpenMode,
10265
10488
  pageSize
10266
10489
  });
10490
+ await loadData({ current: 1, pageSize, sort });
10267
10491
  };
10492
+ const handleSortChange = (index, patch) => {
10493
+ setSort(
10494
+ (prev) => prev.map((item, itemIndex) => itemIndex === index ? { ...item, ...patch } : item)
10495
+ );
10496
+ };
10497
+ const handleAddSort = () => {
10498
+ const firstFieldId = showFields[0] || fields[0]?.fieldId;
10499
+ if (!firstFieldId) return;
10500
+ setSort((prev) => [...prev, { id: firstFieldId, isAsc: "y" }]);
10501
+ };
10502
+ const handleRemoveSort = (index) => {
10503
+ setSort((prev) => prev.filter((_, itemIndex) => itemIndex !== index));
10504
+ };
10505
+ const updateColumnWidth = (0, import_react61.useCallback)((fieldId, width) => {
10506
+ const nextWidth = Math.round(Math.max(96, Math.min(520, width)));
10507
+ widthsRef.current = { ...widthsRef.current, [fieldId]: nextWidth };
10508
+ setWidths(widthsRef.current);
10509
+ }, []);
10510
+ const commitColumnWidth = (0, import_react61.useCallback)(
10511
+ (fieldId, width) => {
10512
+ const nextWidth = Math.round(Math.max(96, Math.min(520, width)));
10513
+ const nextWidths = { ...widthsRef.current, [fieldId]: nextWidth };
10514
+ widthsRef.current = nextWidths;
10515
+ setWidths(nextWidths);
10516
+ void persistConfig({ widths: nextWidths });
10517
+ },
10518
+ [persistConfig]
10519
+ );
10268
10520
  const handleDetail = (0, import_react61.useCallback)(
10269
10521
  (record) => {
10270
10522
  const formInstanceId = getRecordId(record);
10271
- if (detailOpenMode === "newPage" && typeof window !== "undefined") {
10272
- window.open(`/${appType}/forms/${formUuid}/detail/${formInstanceId}`, "_blank");
10523
+ if (!formInstanceId) {
10524
+ import_antd32.message.warning("\u5F53\u524D\u8BB0\u5F55\u7F3A\u5C11\u5B9E\u4F8B ID\uFF0C\u65E0\u6CD5\u6253\u5F00\u8BE6\u60C5");
10273
10525
  return;
10274
10526
  }
10527
+ if (detailOpenMode === "newPage" && detailPageUrlBuilder && typeof window !== "undefined") {
10528
+ const detailUrl = detailPageUrlBuilder({ record, formInstanceId: String(formInstanceId) });
10529
+ if (detailUrl) {
10530
+ window.open(detailUrl, "_blank");
10531
+ return;
10532
+ }
10533
+ }
10534
+ if (detailOpenMode === "newPage" && !detailPageUrlBuilder) {
10535
+ setDetailOpenMode("drawer");
10536
+ }
10275
10537
  setActiveRecord(record);
10276
10538
  setDetailOpen(true);
10277
10539
  },
10278
- [appType, detailOpenMode, formUuid]
10540
+ [detailOpenMode, detailPageUrlBuilder]
10279
10541
  );
10280
10542
  const handleDelete = (0, import_react61.useCallback)(
10281
10543
  async (ids) => {
@@ -10391,22 +10653,33 @@ var DataManagementList = ({
10391
10653
  await loadData({ current: 1, pageSize });
10392
10654
  };
10393
10655
  const columns = (0, import_react61.useMemo)(() => {
10394
- const baseColumns = visibleFields.map((field) => ({
10395
- title: field.label,
10396
- dataIndex: field.fieldId,
10397
- key: field.fieldId,
10398
- width: widths[field.fieldId] || field.width || 160,
10399
- fixed: lockFieldIds.includes(field.fieldId) ? "left" : void 0,
10400
- ellipsis: true,
10401
- sorter: true,
10402
- render: (value) => renderCellValue(value, field)
10403
- })) || [];
10656
+ const baseColumns = visibleFields.map((field) => {
10657
+ const columnWidth = widths[field.fieldId] || field.width || 160;
10658
+ return {
10659
+ title: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10660
+ ResizableColumnTitle,
10661
+ {
10662
+ label: field.label,
10663
+ width: columnWidth,
10664
+ onResize: (width) => updateColumnWidth(field.fieldId, width),
10665
+ onResizeEnd: (width) => commitColumnWidth(field.fieldId, width)
10666
+ }
10667
+ ),
10668
+ dataIndex: field.fieldId,
10669
+ key: field.fieldId,
10670
+ width: columnWidth,
10671
+ fixed: lockFieldIds.includes(field.fieldId) ? "left" : void 0,
10672
+ ellipsis: true,
10673
+ sorter: true,
10674
+ render: (value) => renderCellValue(value, field)
10675
+ };
10676
+ }) || [];
10404
10677
  return [
10405
10678
  ...baseColumns,
10406
10679
  {
10407
10680
  title: "\u64CD\u4F5C",
10408
10681
  key: "__actions",
10409
- width: 148,
10682
+ width: 136,
10410
10683
  fixed: "right",
10411
10684
  render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { size: 4, children: [
10412
10685
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { type: "link", size: "small", onClick: () => handleDetail(record), children: "\u8BE6\u60C5" }),
@@ -10414,31 +10687,34 @@ var DataManagementList = ({
10414
10687
  import_antd32.Dropdown,
10415
10688
  {
10416
10689
  trigger: ["click"],
10690
+ getPopupContainer,
10417
10691
  menu: {
10418
10692
  items: [
10693
+ ...!readonly ? [
10694
+ {
10695
+ key: "delete",
10696
+ label: "\u5220\u9664",
10697
+ danger: true,
10698
+ icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
10699
+ onClick: () => confirmDanger(
10700
+ "\u786E\u8BA4\u5220\u9664",
10701
+ "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
10702
+ () => handleDelete([String(getRecordId(record))])
10703
+ )
10704
+ }
10705
+ ] : [],
10419
10706
  ...rowActions.map((action) => ({
10420
10707
  key: action.key,
10421
10708
  label: action.label,
10422
10709
  danger: action.danger,
10423
10710
  onClick: () => action.onClick(record)
10424
10711
  })),
10425
- {
10426
- key: "workflow",
10427
- label: "\u6D41\u7A0B\u65E5\u5FD7",
10428
- icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.HistoryOutlined, {}),
10429
- onClick: () => import_antd32.message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
10430
- },
10431
- ...!readonly ? [
10712
+ ...formType === "process" ? [
10432
10713
  {
10433
- key: "delete",
10434
- label: "\u5220\u9664",
10435
- danger: true,
10436
- icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
10437
- onClick: () => import_antd32.Modal.confirm({
10438
- title: "\u786E\u8BA4\u5220\u9664",
10439
- content: "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
10440
- onOk: () => handleDelete([String(getRecordId(record))])
10441
- })
10714
+ key: "workflow",
10715
+ label: "\u6D41\u7A0B\u65E5\u5FD7",
10716
+ icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.HistoryOutlined, {}),
10717
+ onClick: () => import_antd32.message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
10442
10718
  }
10443
10719
  ] : []
10444
10720
  ]
@@ -10449,8 +10725,25 @@ var DataManagementList = ({
10449
10725
  ] })
10450
10726
  }
10451
10727
  ];
10452
- }, [handleDelete, handleDetail, lockFieldIds, readonly, rowActions, visibleFields, widths]);
10728
+ }, [
10729
+ confirmDanger,
10730
+ commitColumnWidth,
10731
+ formType,
10732
+ getPopupContainer,
10733
+ handleDelete,
10734
+ handleDetail,
10735
+ lockFieldIds,
10736
+ readonly,
10737
+ rowActions,
10738
+ updateColumnWidth,
10739
+ visibleFields,
10740
+ widths
10741
+ ]);
10453
10742
  const tableSize = density === "compact" ? "small" : density === "loose" ? "large" : "middle";
10743
+ const tableScrollX = Math.max(
10744
+ 900,
10745
+ visibleFields.reduce((sum, field) => sum + (widths[field.fieldId] || field.width || 160), 136)
10746
+ );
10454
10747
  const importPreviewColumns = (0, import_react61.useMemo)(() => {
10455
10748
  const keys = Array.from(
10456
10749
  new Set(importPreview.flatMap((record) => Object.keys(record || {})))
@@ -10467,438 +10760,525 @@ var DataManagementList = ({
10467
10760
  };
10468
10761
  });
10469
10762
  }, [fields, importPreview]);
10470
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: `${fullHeight ? "h-full min-h-screen" : ""} bg-ant-bg-layout`, children: [
10471
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mx-auto flex h-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
10472
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
10473
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10474
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("h1", { className: "text-xl font-semibold text-ant-color-text", children: title || "\u6570\u636E\u7BA1\u7406" }),
10475
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("p", { className: "mt-1 text-sm text-ant-color-text-secondary", children: [
10476
- "\u5171 ",
10477
- total,
10478
- " \u6761\u6570\u636E\uFF0C\u5DF2\u9009\u62E9 ",
10479
- selectedRowKeys.length,
10480
- " \u6761"
10481
- ] })
10482
- ] }),
10483
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { wrap: true, children: [
10484
- !readonly && submitRenderer && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.PlusOutlined, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
10485
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10486
- import_antd32.Input.Search,
10763
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.ConfigProvider, { getPopupContainer, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
10764
+ "div",
10765
+ {
10766
+ ref: rootRef,
10767
+ className: `relative w-full bg-ant-bg-layout ${fullHeight ? "flex h-[calc(100vh-88px)] min-h-[560px] overflow-hidden" : ""}`,
10768
+ children: [
10769
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mx-auto flex min-h-0 w-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
10770
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
10771
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10772
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("h1", { className: "text-xl font-semibold text-ant-color-text", children: title || "\u6570\u636E\u7BA1\u7406" }),
10773
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("p", { className: "mt-1 text-sm text-ant-color-text-secondary", children: [
10774
+ "\u5171 ",
10775
+ total,
10776
+ " \u6761\u6570\u636E\uFF0C\u5DF2\u9009\u62E9 ",
10777
+ selectedRowKeys.length,
10778
+ " \u6761"
10779
+ ] })
10780
+ ] }),
10781
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { wrap: true, children: [
10782
+ !readonly && submitRenderer && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.PlusOutlined, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
10783
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10784
+ import_antd32.Input.Search,
10785
+ {
10786
+ allowClear: true,
10787
+ className: "w-[260px]",
10788
+ placeholder: "\u641C\u7D22\u5173\u952E\u5B57",
10789
+ value: searchKeyWord,
10790
+ onChange: (event) => setSearchKeyWord(event.target.value),
10791
+ onSearch: (value) => {
10792
+ const nextSearchKeyWord = String(value || "");
10793
+ setSearchKeyWord(nextSearchKeyWord);
10794
+ persistConfig({
10795
+ filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup }
10796
+ });
10797
+ loadData({
10798
+ current: 1,
10799
+ pageSize,
10800
+ searchKeyWord: nextSearchKeyWord,
10801
+ filterGroup
10802
+ });
10803
+ }
10804
+ }
10805
+ ),
10806
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.FilterOutlined, {}), onClick: () => setFilterOpen(true), children: "\u7B5B\u9009" }),
10807
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.SettingOutlined, {}), onClick: () => setColumnOpen(true), children: "\u5217\u8BBE\u7F6E" }),
10808
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10809
+ import_antd32.Dropdown,
10810
+ {
10811
+ getPopupContainer,
10812
+ menu: {
10813
+ items: [
10814
+ {
10815
+ key: "selected",
10816
+ label: "\u5BFC\u51FA\u9009\u4E2D",
10817
+ disabled: selectedRowKeys.length === 0,
10818
+ onClick: () => {
10819
+ setExportScope("selected");
10820
+ setExportFields(showFields);
10821
+ setExportOpen(true);
10822
+ }
10823
+ },
10824
+ {
10825
+ key: "all",
10826
+ label: "\u5BFC\u51FA\u5168\u90E8",
10827
+ onClick: () => {
10828
+ setExportScope("all");
10829
+ setExportFields(showFields);
10830
+ setExportOpen(true);
10831
+ }
10832
+ },
10833
+ {
10834
+ key: "records",
10835
+ label: "\u5BFC\u51FA\u8BB0\u5F55",
10836
+ onClick: () => loadTransferRecords("export")
10837
+ }
10838
+ ]
10839
+ },
10840
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DownloadOutlined, {}), children: "\u5BFC\u51FA" })
10841
+ }
10842
+ ),
10843
+ !readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10844
+ import_antd32.Dropdown,
10845
+ {
10846
+ getPopupContainer,
10847
+ menu: {
10848
+ items: [
10849
+ { key: "import", label: "\u5BFC\u5165\u6570\u636E", onClick: () => setImportOpen(true) },
10850
+ {
10851
+ key: "records",
10852
+ label: "\u5BFC\u5165\u8BB0\u5F55",
10853
+ onClick: () => loadTransferRecords("import")
10854
+ }
10855
+ ]
10856
+ },
10857
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.ImportOutlined, {}), children: "\u5BFC\u5165" })
10858
+ }
10859
+ ),
10860
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.ReloadOutlined, {}), onClick: () => loadData({ current, pageSize }) })
10861
+ ] })
10862
+ ] }),
10863
+ selectedRowKeys.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("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: [
10864
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "text-sm text-ant-color-text-secondary", children: [
10865
+ "\u5DF2\u9009 ",
10866
+ selectedRowKeys.length,
10867
+ " \u6761"
10868
+ ] }),
10869
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { wrap: true, children: [
10870
+ !readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.SwapOutlined, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
10871
+ !readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10872
+ import_antd32.Button,
10873
+ {
10874
+ danger: true,
10875
+ icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
10876
+ onClick: () => confirmDanger(
10877
+ "\u786E\u8BA4\u6279\u91CF\u5220\u9664",
10878
+ `\u5C06\u5220\u9664 ${selectedRowKeys.length} \u6761\u6570\u636E\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F`,
10879
+ () => handleDelete(selectedRowKeys.map(String))
10880
+ ),
10881
+ children: "\u6279\u91CF\u5220\u9664"
10882
+ }
10883
+ ),
10884
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { type: "link", onClick: () => setSelectedRowKeys([]), children: "\u53D6\u6D88\u9009\u62E9" })
10885
+ ] })
10886
+ ] }),
10887
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "relative flex-1 overflow-hidden rounded-lg border border-ant-border-secondary bg-ant-bg-container", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10888
+ import_antd32.Table,
10487
10889
  {
10488
- allowClear: true,
10489
- className: "w-[260px]",
10490
- placeholder: "\u641C\u7D22\u5173\u952E\u5B57",
10491
- value: searchKeyWord,
10492
- onChange: (event) => setSearchKeyWord(event.target.value),
10493
- onSearch: (value) => {
10494
- const nextSearchKeyWord = String(value || "");
10495
- setSearchKeyWord(nextSearchKeyWord);
10496
- persistConfig({ filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup } });
10890
+ rowKey: (record) => String(getRecordId(record)),
10891
+ loading: loading || schemaLoading,
10892
+ columns,
10893
+ dataSource,
10894
+ size: tableSize,
10895
+ scroll: {
10896
+ x: tableScrollX,
10897
+ y: fullHeight ? selectedRowKeys.length > 0 ? "calc(100vh - 360px)" : "calc(100vh - 300px)" : void 0
10898
+ },
10899
+ rowSelection: {
10900
+ selectedRowKeys,
10901
+ onChange: setSelectedRowKeys
10902
+ },
10903
+ pagination: {
10904
+ current,
10905
+ pageSize,
10906
+ total,
10907
+ showSizeChanger: true,
10908
+ showTotal: (count) => `\u5171 ${count} \u6761`
10909
+ },
10910
+ onChange: (pagination, _filters, sorter) => {
10911
+ const sorters = Array.isArray(sorter) ? sorter : [sorter];
10912
+ const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
10913
+ id: String(item.field),
10914
+ isAsc: item.order === "ascend" ? "y" : "n"
10915
+ }));
10916
+ setSort(nextSort);
10917
+ persistConfig({ sort: nextSort });
10497
10918
  loadData({
10498
- current: 1,
10499
- pageSize,
10500
- searchKeyWord: nextSearchKeyWord,
10501
- filterGroup
10919
+ current: pagination.current || 1,
10920
+ pageSize: pagination.pageSize || pageSize,
10921
+ sort: nextSort
10502
10922
  });
10503
10923
  }
10504
10924
  }
10505
- ),
10506
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.FilterOutlined, {}), onClick: () => setFilterOpen(true), children: "\u7B5B\u9009" }),
10507
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.SettingOutlined, {}), onClick: () => setColumnOpen(true), children: "\u5217\u8BBE\u7F6E" }),
10508
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10509
- import_antd32.Dropdown,
10510
- {
10511
- menu: {
10512
- items: [
10513
- {
10514
- key: "selected",
10515
- label: "\u5BFC\u51FA\u9009\u4E2D",
10516
- disabled: selectedRowKeys.length === 0,
10517
- onClick: () => {
10518
- setExportScope("selected");
10519
- setExportFields(showFields);
10520
- setExportOpen(true);
10521
- }
10522
- },
10523
- {
10524
- key: "all",
10525
- label: "\u5BFC\u51FA\u5168\u90E8",
10526
- onClick: () => {
10527
- setExportScope("all");
10528
- setExportFields(showFields);
10529
- setExportOpen(true);
10530
- }
10531
- },
10925
+ ) })
10926
+ ] }),
10927
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10928
+ import_antd32.Modal,
10929
+ {
10930
+ getContainer: false,
10931
+ title: "\u9AD8\u7EA7\u7B5B\u9009",
10932
+ open: filterOpen,
10933
+ width: 760,
10934
+ onCancel: () => setFilterOpen(false),
10935
+ onOk: () => {
10936
+ setFilterOpen(false);
10937
+ persistConfig({ filter: { searchKeyWord, group: filterGroup } });
10938
+ loadData({ current: 1, pageSize, searchKeyWord, filterGroup });
10939
+ },
10940
+ okText: "\u5E94\u7528\u7B5B\u9009",
10941
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(FilterGroupEditor, { group: filterGroup, fields, onChange: setFilterGroup })
10942
+ }
10943
+ ),
10944
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10945
+ import_antd32.Modal,
10946
+ {
10947
+ getContainer: false,
10948
+ title: "\u5217\u8BBE\u7F6E",
10949
+ open: columnOpen,
10950
+ width: 920,
10951
+ onCancel: () => setColumnOpen(false),
10952
+ onOk: handleColumnCommit,
10953
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "space-y-5", children: [
10954
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10955
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u663E\u793A\u5217" }),
10956
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10957
+ import_antd32.Checkbox.Group,
10532
10958
  {
10533
- key: "records",
10534
- label: "\u5BFC\u51FA\u8BB0\u5F55",
10535
- onClick: () => loadTransferRecords("export")
10959
+ className: "grid grid-cols-2 gap-2 md:grid-cols-3",
10960
+ value: showFields,
10961
+ options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
10962
+ onChange: (values) => setShowFields(values.map(String))
10536
10963
  }
10537
- ]
10538
- },
10539
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DownloadOutlined, {}), children: "\u5BFC\u51FA" })
10540
- }
10541
- ),
10542
- !readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10543
- import_antd32.Dropdown,
10544
- {
10545
- menu: {
10546
- items: [
10547
- { key: "import", label: "\u5BFC\u5165\u6570\u636E", onClick: () => setImportOpen(true) },
10964
+ )
10965
+ ] }),
10966
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10967
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5217\u5BBD" }),
10968
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "grid max-h-56 gap-2 overflow-auto rounded-lg border border-ant-border-secondary p-3 md:grid-cols-2", children: showFields.map((fieldId) => {
10969
+ const field = fields.find((item) => item.fieldId === fieldId);
10970
+ const width = widths[fieldId] || field?.width || 160;
10971
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
10972
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "min-w-0 truncate text-sm text-ant-color-text-secondary", children: field?.label || fieldId }),
10973
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10974
+ import_antd32.InputNumber,
10975
+ {
10976
+ min: 96,
10977
+ max: 520,
10978
+ value: width,
10979
+ addonAfter: "px",
10980
+ onChange: (value) => updateColumnWidth(fieldId, Number(value || 160)),
10981
+ onBlur: () => commitColumnWidth(fieldId, widthsRef.current[fieldId] || width)
10982
+ }
10983
+ )
10984
+ ] }, fieldId);
10985
+ }) })
10986
+ ] }),
10987
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10988
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u51BB\u7ED3\u5217" }),
10989
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10990
+ import_antd32.Select,
10548
10991
  {
10549
- key: "records",
10550
- label: "\u5BFC\u5165\u8BB0\u5F55",
10551
- onClick: () => loadTransferRecords("import")
10992
+ mode: "multiple",
10993
+ className: "w-full",
10994
+ value: lockFieldIds,
10995
+ options: showFields.map((fieldId) => {
10996
+ const field = fields.find((item) => item.fieldId === fieldId);
10997
+ return { label: field?.label || fieldId, value: fieldId };
10998
+ }),
10999
+ onChange: setLockFieldIds
10552
11000
  }
10553
- ]
10554
- },
10555
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.ImportOutlined, {}), children: "\u5BFC\u5165" })
10556
- }
10557
- ),
10558
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.ReloadOutlined, {}), onClick: () => loadData({ current, pageSize }) })
10559
- ] })
10560
- ] }),
10561
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "relative flex-1 overflow-hidden rounded-lg border border-ant-border-secondary bg-ant-bg-container", children: [
10562
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10563
- import_antd32.Table,
10564
- {
10565
- rowKey: (record) => String(getRecordId(record)),
10566
- loading: loading || schemaLoading,
10567
- columns,
10568
- dataSource,
10569
- size: tableSize,
10570
- scroll: {
10571
- x: Math.max(900, visibleFields.length * 160),
10572
- y: fullHeight ? "calc(100vh - 260px)" : void 0
10573
- },
10574
- rowSelection: {
10575
- selectedRowKeys,
10576
- onChange: setSelectedRowKeys
10577
- },
10578
- pagination: {
10579
- current,
10580
- pageSize,
10581
- total,
10582
- showSizeChanger: true,
10583
- showTotal: (count) => `\u5171 ${count} \u6761`
10584
- },
10585
- onChange: (pagination, _filters, sorter) => {
10586
- const sorters = Array.isArray(sorter) ? sorter : [sorter];
10587
- const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
10588
- id: String(item.field),
10589
- isAsc: item.order === "ascend" ? "y" : "n"
10590
- }));
10591
- setSort(nextSort);
10592
- persistConfig({ sort: nextSort });
10593
- loadData({
10594
- current: pagination.current || 1,
10595
- pageSize: pagination.pageSize || pageSize,
10596
- sort: nextSort
10597
- });
10598
- }
11001
+ )
11002
+ ] }),
11003
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Divider, { className: "my-1" }),
11004
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
11005
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
11006
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm font-medium text-ant-color-text", children: "\u6392\u5E8F\u89C4\u5219" }),
11007
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { size: "small", onClick: handleAddSort, disabled: fields.length === 0, children: "\u6DFB\u52A0\u6392\u5E8F" })
11008
+ ] }),
11009
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "space-y-2", children: sort.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "rounded-lg border border-dashed border-ant-border-secondary px-3 py-4 text-center text-sm text-ant-color-text-tertiary", children: "\u6682\u65E0\u6392\u5E8F\u89C4\u5219" }) : sort.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center gap-2", children: [
11010
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11011
+ import_antd32.Select,
11012
+ {
11013
+ className: "min-w-0 flex-1",
11014
+ value: item.id,
11015
+ options: fields.map((field) => ({
11016
+ label: field.label,
11017
+ value: field.fieldId
11018
+ })),
11019
+ onChange: (value) => handleSortChange(index, { id: value })
11020
+ }
11021
+ ),
11022
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11023
+ import_antd32.Segmented,
11024
+ {
11025
+ value: item.isAsc,
11026
+ options: [
11027
+ { label: "\u5347\u5E8F", value: "y" },
11028
+ { label: "\u964D\u5E8F", value: "n" }
11029
+ ],
11030
+ onChange: (value) => handleSortChange(index, { isAsc: value })
11031
+ }
11032
+ ),
11033
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11034
+ import_antd32.Button,
11035
+ {
11036
+ danger: true,
11037
+ type: "text",
11038
+ icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
11039
+ onClick: () => handleRemoveSort(index)
11040
+ }
11041
+ )
11042
+ ] }, `${item.id}_${index}`)) })
11043
+ ] }),
11044
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "grid gap-4 md:grid-cols-3", children: [
11045
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
11046
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8868\u683C\u5BC6\u5EA6" }),
11047
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11048
+ import_antd32.Segmented,
11049
+ {
11050
+ block: true,
11051
+ value: density,
11052
+ options: [
11053
+ { label: "\u7D27\u51D1", value: "compact" },
11054
+ { label: "\u6807\u51C6", value: "middle" },
11055
+ { label: "\u5BBD\u677E", value: "loose" }
11056
+ ],
11057
+ onChange: (value) => setDensity(value)
11058
+ }
11059
+ )
11060
+ ] }),
11061
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
11062
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8BE6\u60C5\u6253\u5F00\u65B9\u5F0F" }),
11063
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11064
+ import_antd32.Segmented,
11065
+ {
11066
+ block: true,
11067
+ value: detailOpenMode,
11068
+ options: detailPageUrlBuilder ? [
11069
+ { label: "\u62BD\u5C49", value: "drawer" },
11070
+ { label: "\u65B0\u9875", value: "newPage" }
11071
+ ] : [{ label: "\u62BD\u5C49", value: "drawer" }],
11072
+ onChange: (value) => setDetailOpenMode(value)
11073
+ }
11074
+ )
11075
+ ] }),
11076
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
11077
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u9875\u5927\u5C0F" }),
11078
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11079
+ import_antd32.Select,
11080
+ {
11081
+ className: "w-full",
11082
+ value: pageSize,
11083
+ options: [10, 20, 50, 100].map((value) => ({ label: `${value} \u6761`, value })),
11084
+ onChange: setPageSize
11085
+ }
11086
+ )
11087
+ ] })
11088
+ ] })
11089
+ ] })
10599
11090
  }
10600
11091
  ),
10601
- selectedRowKeys.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("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: [
10602
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "text-sm text-ant-color-text-secondary", children: [
10603
- "\u5DF2\u9009 ",
10604
- selectedRowKeys.length,
10605
- " \u6761"
10606
- ] }),
10607
- !readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.SwapOutlined, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
10608
- !readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10609
- import_antd32.Button,
10610
- {
10611
- danger: true,
10612
- icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
10613
- onClick: () => import_antd32.Modal.confirm({
10614
- title: "\u786E\u8BA4\u6279\u91CF\u5220\u9664",
10615
- content: `\u5C06\u5220\u9664 ${selectedRowKeys.length} \u6761\u6570\u636E\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F`,
10616
- onOk: () => handleDelete(selectedRowKeys.map(String))
10617
- }),
10618
- children: "\u6279\u91CF\u5220\u9664"
10619
- }
10620
- ),
10621
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { type: "link", onClick: () => setSelectedRowKeys([]), children: "\u53D6\u6D88\u9009\u62E9" })
10622
- ] })
10623
- ] })
10624
- ] }),
10625
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10626
- import_antd32.Modal,
10627
- {
10628
- title: "\u9AD8\u7EA7\u7B5B\u9009",
10629
- open: filterOpen,
10630
- width: 760,
10631
- onCancel: () => setFilterOpen(false),
10632
- onOk: () => {
10633
- setFilterOpen(false);
10634
- persistConfig({ filter: { searchKeyWord, group: filterGroup } });
10635
- loadData({ current: 1, pageSize, searchKeyWord, filterGroup });
10636
- },
10637
- okText: "\u5E94\u7528\u7B5B\u9009",
10638
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(FilterGroupEditor, { group: filterGroup, fields, onChange: setFilterGroup })
10639
- }
10640
- ),
10641
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10642
- import_antd32.Modal,
10643
- {
10644
- title: "\u5217\u8BBE\u7F6E",
10645
- open: columnOpen,
10646
- width: 720,
10647
- onCancel: () => setColumnOpen(false),
10648
- onOk: handleColumnCommit,
10649
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "space-y-5", children: [
10650
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10651
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u663E\u793A\u5217" }),
10652
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11092
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11093
+ import_antd32.Modal,
11094
+ {
11095
+ getContainer: false,
11096
+ title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
11097
+ open: exportOpen,
11098
+ onCancel: () => setExportOpen(false),
11099
+ footer: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { children: [
11100
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { onClick: () => setExportOpen(false), children: "\u53D6\u6D88" }),
11101
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11102
+ import_antd32.Button,
11103
+ {
11104
+ type: "primary",
11105
+ loading: exporting,
11106
+ disabled: exportScope === "selected" && selectedRowKeys.length === 0,
11107
+ onClick: () => handleExport(exportScope),
11108
+ children: exportScope === "selected" ? `\u5BFC\u51FA\u9009\u4E2D (${selectedRowKeys.length})` : "\u5BFC\u51FA\u5168\u90E8"
11109
+ }
11110
+ )
11111
+ ] }),
11112
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10653
11113
  import_antd32.Checkbox.Group,
10654
11114
  {
10655
- className: "grid grid-cols-2 gap-2 md:grid-cols-3",
10656
- value: showFields,
11115
+ className: "grid grid-cols-2 gap-2",
11116
+ value: exportFields,
10657
11117
  options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
10658
- onChange: (values) => setShowFields(values.map(String))
10659
- }
10660
- )
10661
- ] }),
10662
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10663
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u51BB\u7ED3\u5217" }),
10664
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10665
- import_antd32.Select,
10666
- {
10667
- mode: "multiple",
10668
- className: "w-full",
10669
- value: lockFieldIds,
10670
- options: showFields.map((fieldId) => {
10671
- const field = fields.find((item) => item.fieldId === fieldId);
10672
- return { label: field?.label || fieldId, value: fieldId };
10673
- }),
10674
- onChange: setLockFieldIds
11118
+ onChange: (values) => setExportFields(values.map(String))
10675
11119
  }
10676
11120
  )
10677
- ] }),
10678
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "grid gap-4 md:grid-cols-3", children: [
10679
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10680
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8868\u683C\u5BC6\u5EA6" }),
11121
+ }
11122
+ ),
11123
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11124
+ import_antd32.Modal,
11125
+ {
11126
+ getContainer: false,
11127
+ title: "\u6279\u91CF\u5BA1\u6279",
11128
+ open: batchApprovalOpen,
11129
+ onCancel: () => setBatchApprovalOpen(false),
11130
+ onOk: handleBatchApprovalConfirm,
11131
+ okText: batchApprovalAction === "approved" ? "\u786E\u8BA4\u901A\u8FC7" : "\u786E\u8BA4\u62D2\u7EDD",
11132
+ confirmLoading: batchApproving,
11133
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "space-y-4", children: [
11134
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "text-sm text-ant-color-text-secondary", children: [
11135
+ "\u5DF2\u9009\u62E9 ",
11136
+ selectedRowKeys.length,
11137
+ " \u6761\u8BB0\u5F55"
11138
+ ] }),
10681
11139
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10682
11140
  import_antd32.Segmented,
10683
11141
  {
10684
11142
  block: true,
10685
- value: density,
11143
+ value: batchApprovalAction,
10686
11144
  options: [
10687
- { label: "\u7D27\u51D1", value: "compact" },
10688
- { label: "\u6807\u51C6", value: "middle" },
10689
- { label: "\u5BBD\u677E", value: "loose" }
11145
+ { label: "\u540C\u610F", value: "approved" },
11146
+ { label: "\u62D2\u7EDD", value: "rejected" }
10690
11147
  ],
10691
- onChange: (value) => setDensity(value)
11148
+ onChange: (value) => setBatchApprovalAction(value)
11149
+ }
11150
+ ),
11151
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11152
+ import_antd32.Input.TextArea,
11153
+ {
11154
+ value: batchApprovalComments,
11155
+ rows: 4,
11156
+ maxLength: 500,
11157
+ showCount: true,
11158
+ placeholder: "\u586B\u5199\u5BA1\u6279\u610F\u89C1",
11159
+ onChange: (event) => setBatchApprovalComments(event.target.value)
10692
11160
  }
10693
11161
  )
10694
- ] }),
10695
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10696
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8BE6\u60C5\u6253\u5F00\u65B9\u5F0F" }),
11162
+ ] })
11163
+ }
11164
+ ),
11165
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
11166
+ import_antd32.Modal,
11167
+ {
11168
+ getContainer: false,
11169
+ title: "\u5BFC\u5165\u6570\u636E",
11170
+ open: importOpen,
11171
+ width: 720,
11172
+ onCancel: () => setImportOpen(false),
11173
+ onOk: handleImportConfirm,
11174
+ okButtonProps: { disabled: !importBase64 },
11175
+ okText: "\u786E\u8BA4\u5BFC\u5165",
11176
+ children: [
11177
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11178
+ import_antd32.Upload.Dragger,
11179
+ {
11180
+ accept: ".xlsx,.xls",
11181
+ maxCount: 1,
11182
+ beforeUpload: handleImportPreview,
11183
+ onRemove: () => {
11184
+ setImportBase64("");
11185
+ setImportPreview([]);
11186
+ },
11187
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "text-ant-color-text-secondary", children: "\u62D6\u62FD Excel \u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\u6587\u4EF6" })
11188
+ }
11189
+ ),
11190
+ importPreview.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mt-4", children: [
11191
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5BFC\u5165\u9884\u89C8" }),
11192
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11193
+ import_antd32.Table,
11194
+ {
11195
+ size: "small",
11196
+ dataSource: importPreview,
11197
+ columns: importPreviewColumns,
11198
+ scroll: { x: Math.max(600, (importPreviewColumns?.length || 0) * 150) },
11199
+ pagination: false,
11200
+ rowKey: (_, index) => String(index)
11201
+ }
11202
+ )
11203
+ ] })
11204
+ ]
11205
+ }
11206
+ ),
11207
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
11208
+ import_antd32.Drawer,
11209
+ {
11210
+ getContainer: false,
11211
+ rootStyle: { position: "absolute" },
11212
+ styles: { body: { padding: 24, overflow: "auto" } },
11213
+ title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
11214
+ open: recordsOpen,
11215
+ width: 720,
11216
+ onClose: () => setRecordsOpen(false),
11217
+ children: [
10697
11218
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10698
11219
  import_antd32.Segmented,
10699
11220
  {
10700
- block: true,
10701
- value: detailOpenMode,
11221
+ value: recordTab,
10702
11222
  options: [
10703
- { label: "\u62BD\u5C49", value: "drawer" },
10704
- { label: "\u65B0\u9875", value: "newPage" }
11223
+ { label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
11224
+ { label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
10705
11225
  ],
10706
- onChange: (value) => setDetailOpenMode(value)
11226
+ onChange: (value) => loadTransferRecords(value)
10707
11227
  }
10708
- )
10709
- ] }),
10710
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
10711
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u9875\u5927\u5C0F" }),
11228
+ ),
10712
11229
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10713
- import_antd32.Select,
11230
+ import_antd32.Table,
10714
11231
  {
10715
- className: "w-full",
10716
- value: pageSize,
10717
- options: [10, 20, 50, 100].map((value) => ({ label: `${value} \u6761`, value })),
10718
- onChange: setPageSize
11232
+ className: "mt-4",
11233
+ size: "small",
11234
+ dataSource: transferRecords,
11235
+ rowKey: (record) => record.id || record.recordId
10719
11236
  }
10720
11237
  )
10721
- ] })
10722
- ] })
10723
- ] })
10724
- }
10725
- ),
10726
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10727
- import_antd32.Modal,
10728
- {
10729
- title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
10730
- open: exportOpen,
10731
- onCancel: () => setExportOpen(false),
10732
- footer: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { children: [
10733
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { onClick: () => setExportOpen(false), children: "\u53D6\u6D88" }),
10734
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10735
- import_antd32.Button,
10736
- {
10737
- type: "primary",
10738
- loading: exporting,
10739
- disabled: exportScope === "selected" && selectedRowKeys.length === 0,
10740
- onClick: () => handleExport(exportScope),
10741
- children: exportScope === "selected" ? `\u5BFC\u51FA\u9009\u4E2D (${selectedRowKeys.length})` : "\u5BFC\u51FA\u5168\u90E8"
10742
- }
10743
- )
10744
- ] }),
10745
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10746
- import_antd32.Checkbox.Group,
11238
+ ]
11239
+ }
11240
+ ),
11241
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11242
+ import_antd32.Drawer,
10747
11243
  {
10748
- className: "grid grid-cols-2 gap-2",
10749
- value: exportFields,
10750
- options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
10751
- onChange: (values) => setExportFields(values.map(String))
11244
+ getContainer: false,
11245
+ rootStyle: { position: "absolute" },
11246
+ styles: { body: { padding: 0, overflow: "auto" } },
11247
+ title: "\u8BE6\u60C5",
11248
+ open: detailOpen,
11249
+ width: 720,
11250
+ onClose: () => setDetailOpen(false),
11251
+ destroyOnClose: true,
11252
+ children: activeRecord && detailRenderer ? detailRenderer({
11253
+ record: activeRecord,
11254
+ formInstanceId: String(getRecordId(activeRecord)),
11255
+ onClose: () => setDetailOpen(false)
11256
+ }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Empty, { description: "\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u8BE6\u60C5\u6A21\u677F" })
10752
11257
  }
10753
- )
10754
- }
10755
- ),
10756
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10757
- import_antd32.Modal,
10758
- {
10759
- title: "\u6279\u91CF\u5BA1\u6279",
10760
- open: batchApprovalOpen,
10761
- onCancel: () => setBatchApprovalOpen(false),
10762
- onOk: handleBatchApprovalConfirm,
10763
- okText: batchApprovalAction === "approved" ? "\u786E\u8BA4\u901A\u8FC7" : "\u786E\u8BA4\u62D2\u7EDD",
10764
- confirmLoading: batchApproving,
10765
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "space-y-4", children: [
10766
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "text-sm text-ant-color-text-secondary", children: [
10767
- "\u5DF2\u9009\u62E9 ",
10768
- selectedRowKeys.length,
10769
- " \u6761\u8BB0\u5F55"
10770
- ] }),
10771
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10772
- import_antd32.Segmented,
10773
- {
10774
- block: true,
10775
- value: batchApprovalAction,
10776
- options: [
10777
- { label: "\u540C\u610F", value: "approved" },
10778
- { label: "\u62D2\u7EDD", value: "rejected" }
10779
- ],
10780
- onChange: (value) => setBatchApprovalAction(value)
10781
- }
10782
- ),
10783
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10784
- import_antd32.Input.TextArea,
10785
- {
10786
- value: batchApprovalComments,
10787
- rows: 4,
10788
- maxLength: 500,
10789
- showCount: true,
10790
- placeholder: "\u586B\u5199\u5BA1\u6279\u610F\u89C1",
10791
- onChange: (event) => setBatchApprovalComments(event.target.value)
10792
- }
10793
- )
10794
- ] })
10795
- }
10796
- ),
10797
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
10798
- import_antd32.Modal,
10799
- {
10800
- title: "\u5BFC\u5165\u6570\u636E",
10801
- open: importOpen,
10802
- width: 720,
10803
- onCancel: () => setImportOpen(false),
10804
- onOk: handleImportConfirm,
10805
- okButtonProps: { disabled: !importBase64 },
10806
- okText: "\u786E\u8BA4\u5BFC\u5165",
10807
- children: [
10808
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10809
- import_antd32.Upload.Dragger,
10810
- {
10811
- accept: ".xlsx,.xls",
10812
- maxCount: 1,
10813
- beforeUpload: handleImportPreview,
10814
- onRemove: () => {
10815
- setImportBase64("");
10816
- setImportPreview([]);
10817
- },
10818
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "text-ant-color-text-secondary", children: "\u62D6\u62FD Excel \u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\u6587\u4EF6" })
10819
- }
10820
- ),
10821
- importPreview.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mt-4", children: [
10822
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5BFC\u5165\u9884\u89C8" }),
10823
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10824
- import_antd32.Table,
10825
- {
10826
- size: "small",
10827
- dataSource: importPreview,
10828
- columns: importPreviewColumns,
10829
- scroll: { x: Math.max(600, (importPreviewColumns?.length || 0) * 150) },
10830
- pagination: false,
10831
- rowKey: (_, index) => String(index)
11258
+ ),
11259
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
11260
+ import_antd32.Drawer,
11261
+ {
11262
+ getContainer: false,
11263
+ rootStyle: { position: "absolute" },
11264
+ styles: { body: { padding: 0, overflow: "auto" } },
11265
+ title: "\u65B0\u589E\u6570\u636E",
11266
+ open: submitOpen,
11267
+ width: 720,
11268
+ onClose: () => setSubmitOpen(false),
11269
+ destroyOnClose: true,
11270
+ children: submitRenderer ? submitRenderer({
11271
+ onClose: () => setSubmitOpen(false),
11272
+ onSubmitted: () => {
11273
+ setSubmitOpen(false);
11274
+ loadData({ current: 1, pageSize });
10832
11275
  }
10833
- )
10834
- ] })
10835
- ]
10836
- }
10837
- ),
10838
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
10839
- import_antd32.Drawer,
10840
- {
10841
- title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
10842
- open: recordsOpen,
10843
- width: 720,
10844
- onClose: () => setRecordsOpen(false),
10845
- children: [
10846
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10847
- import_antd32.Segmented,
10848
- {
10849
- value: recordTab,
10850
- options: [
10851
- { label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
10852
- { label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
10853
- ],
10854
- onChange: (value) => loadTransferRecords(value)
10855
- }
10856
- ),
10857
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10858
- import_antd32.Table,
10859
- {
10860
- className: "mt-4",
10861
- size: "small",
10862
- dataSource: transferRecords,
10863
- rowKey: (record) => record.id || record.recordId
10864
- }
10865
- )
10866
- ]
10867
- }
10868
- ),
10869
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10870
- import_antd32.Drawer,
10871
- {
10872
- title: "\u8BE6\u60C5",
10873
- open: detailOpen,
10874
- width: 720,
10875
- onClose: () => setDetailOpen(false),
10876
- destroyOnClose: true,
10877
- children: activeRecord && detailRenderer ? detailRenderer({
10878
- record: activeRecord,
10879
- formInstanceId: String(getRecordId(activeRecord)),
10880
- onClose: () => setDetailOpen(false)
10881
- }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Empty, { description: "\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u8BE6\u60C5\u6A21\u677F" })
10882
- }
10883
- ),
10884
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10885
- import_antd32.Drawer,
10886
- {
10887
- title: "\u65B0\u589E\u6570\u636E",
10888
- open: submitOpen,
10889
- width: 720,
10890
- onClose: () => setSubmitOpen(false),
10891
- destroyOnClose: true,
10892
- children: submitRenderer ? submitRenderer({
10893
- onClose: () => setSubmitOpen(false),
10894
- onSubmitted: () => {
10895
- setSubmitOpen(false);
10896
- loadData({ current: 1, pageSize });
11276
+ }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Empty, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
10897
11277
  }
10898
- }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Empty, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
10899
- }
10900
- )
10901
- ] });
11278
+ )
11279
+ ]
11280
+ }
11281
+ ) });
10902
11282
  };
10903
11283
 
10904
11284
  // src/templates/FormSubmitTemplate.tsx
@@ -11060,7 +11440,7 @@ var InnerFormContent = ({
11060
11440
  data: formData,
11061
11441
  submissionDepartmentId: departmentId
11062
11442
  });
11063
- setPreviewRoutes(routes);
11443
+ setPreviewRoutes(Array.isArray(routes) ? routes : []);
11064
11444
  } catch (error) {
11065
11445
  console.error("[FormSubmitTemplate] Preview failed:", error);
11066
11446
  setPreviewRoutes([]);
@@ -11150,56 +11530,72 @@ var InnerFormContent = ({
11150
11530
  }
11151
11531
  )
11152
11532
  ] }) : null;
11153
- const actionsNode = !submitted ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(StickyActionBar, { actions, inDrawer }) : null;
11154
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(RuntimePageShell, { actions: actionsNode, inDrawer, children: [
11155
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "space-y-6", children: [
11156
- header || /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11157
- SummaryPanel,
11158
- {
11159
- title: schema.formMeta.title,
11160
- eyebrow: formType === "process" ? "\u6D41\u7A0B\u53D1\u8D77" : "\u6570\u636E\u63D0\u4EA4",
11161
- status: formType === "process" ? { label: "\u5F85\u63D0\u4EA4", tone: "brand" } : void 0
11162
- }
11163
- ),
11164
- enableDraft && hasDraft && !submitted && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11165
- DraftManager,
11166
- {
11167
- hasDraft,
11168
- draftTimestamp,
11169
- onRestore: handleRestoreDraft,
11170
- onDiscard: clearDraft
11171
- }
11172
- ) }),
11173
- !submitted ? /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "rounded-lg border border-ant-border-secondary bg-ant-bg-container p-5 md:p-6", children: [
11174
- departmentSelector,
11175
- beforeForm,
11176
- renderForm ? renderForm({ schema, config }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FormRenderer, { columns: 2 }),
11177
- afterForm
11178
- ] }) : successInfo && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11179
- SubmitSuccessCard,
11180
- {
11181
- info: successInfo,
11182
- mode: submitSuccessMode,
11183
- isRedirecting,
11184
- countdown,
11185
- onContinue: handleContinue,
11186
- onViewDetail: handleViewDetail,
11187
- renderSuccess
11188
- }
11189
- ),
11190
- footer
11191
- ] }),
11192
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11193
- ProcessPreview,
11194
- {
11195
- open: previewOpen,
11196
- routes: previewRoutes,
11197
- loading: previewLoading,
11198
- onClose: () => setPreviewOpen(false),
11199
- onConfirm: handlePreviewConfirm
11200
- }
11201
- )
11202
- ] });
11533
+ const actionsNode = !submitted ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11534
+ StickyActionBar,
11535
+ {
11536
+ actions,
11537
+ inDrawer,
11538
+ position: "inline",
11539
+ className: inDrawer ? "mt-5 -mx-4 -mb-4 rounded-b-lg md:-mx-5 md:-mb-5" : "mt-6 -mx-5 -mb-5 rounded-b-lg md:-mx-6 md:-mb-6"
11540
+ }
11541
+ ) : null;
11542
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
11543
+ RuntimePageShell,
11544
+ {
11545
+ inDrawer,
11546
+ maxWidth: inDrawer ? "100%" : 1240,
11547
+ contentClassName: inDrawer ? "px-4 py-4 md:px-5" : "py-4 md:py-6",
11548
+ children: [
11549
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "space-y-6", children: [
11550
+ header,
11551
+ enableDraft && hasDraft && !submitted && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11552
+ DraftManager,
11553
+ {
11554
+ hasDraft,
11555
+ draftTimestamp,
11556
+ onRestore: handleRestoreDraft,
11557
+ onDiscard: clearDraft
11558
+ }
11559
+ ) }),
11560
+ !submitted ? /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
11561
+ "div",
11562
+ {
11563
+ className: `rounded-lg border border-ant-border-secondary bg-ant-bg-container ${inDrawer ? "p-4 md:p-5" : "p-5 shadow-sm md:p-6"}`,
11564
+ children: [
11565
+ departmentSelector,
11566
+ beforeForm,
11567
+ renderForm ? renderForm({ schema, config }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FormRenderer, { columns: 2 }),
11568
+ afterForm,
11569
+ actionsNode
11570
+ ]
11571
+ }
11572
+ ) : successInfo && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11573
+ SubmitSuccessCard,
11574
+ {
11575
+ info: successInfo,
11576
+ mode: submitSuccessMode,
11577
+ isRedirecting,
11578
+ countdown,
11579
+ onContinue: handleContinue,
11580
+ onViewDetail: handleViewDetail,
11581
+ renderSuccess
11582
+ }
11583
+ ),
11584
+ footer
11585
+ ] }),
11586
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
11587
+ ProcessPreview,
11588
+ {
11589
+ open: previewOpen,
11590
+ routes: previewRoutes,
11591
+ loading: previewLoading,
11592
+ onClose: () => setPreviewOpen(false),
11593
+ onConfirm: handlePreviewConfirm
11594
+ }
11595
+ )
11596
+ ]
11597
+ }
11598
+ );
11203
11599
  };
11204
11600
  var FormSubmitTemplate = ({
11205
11601
  schema,
@@ -11246,6 +11642,7 @@ var FormSubmitTemplate = ({
11246
11642
 
11247
11643
  // src/templates/FormDetailTemplate.tsx
11248
11644
  var import_react63 = require("react");
11645
+ var import_dayjs6 = __toESM(require("dayjs"));
11249
11646
 
11250
11647
  // src/templates/PageSkeleton.tsx
11251
11648
  var import_antd34 = require("antd");
@@ -11317,6 +11714,11 @@ function FormDataBridge({
11317
11714
  formDataRef.current = getFormData2;
11318
11715
  return null;
11319
11716
  }
11717
+ var formatDateTime2 = (value) => {
11718
+ if (!value || typeof value !== "string") return value || "-";
11719
+ const parsed = (0, import_dayjs6.default)(value);
11720
+ return parsed.isValid() ? parsed.format("YYYY-MM-DD HH:mm:ss") : value;
11721
+ };
11320
11722
  var InnerDetailContent = ({
11321
11723
  schema,
11322
11724
  formUuid,
@@ -11427,14 +11829,36 @@ var InnerDetailContent = ({
11427
11829
  renderSummary && instanceInfo ? renderSummary(instanceInfo) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
11428
11830
  SummaryPanel,
11429
11831
  {
11430
- title: instanceInfo?.title || formData?.instanceTitle || schema.formMeta.title,
11832
+ title: instanceInfo?.title || instanceInfo?.instanceTitle || schema.formMeta.title,
11431
11833
  eyebrow: `\u6570\u636E\u5B9E\u4F8B ${formInstanceId?.slice(0, 8) || "-"}`,
11432
- creator: instanceInfo?.creator ? {
11433
- name: instanceInfo.creator.name,
11434
- avatar: instanceInfo.creator.avatar,
11435
- department: instanceInfo.creator.department
11834
+ creator: instanceInfo?.creator || instanceInfo?.createdByName ? {
11835
+ name: instanceInfo?.creator?.name || instanceInfo?.createdByName,
11836
+ avatar: instanceInfo?.creator?.avatar,
11837
+ department: instanceInfo?.creator?.department || instanceInfo?.createdByDepartmentName
11436
11838
  } : void 0,
11437
- createdAt: instanceInfo?.createdAt,
11839
+ createdAt: formatDateTime2(instanceInfo?.createdAt),
11840
+ metaItems: [
11841
+ {
11842
+ key: "creator",
11843
+ label: "\u521B\u5EFA\u4EBA",
11844
+ value: instanceInfo?.creator?.name || instanceInfo?.createdByName || "\u672A\u77E5\u7528\u6237"
11845
+ },
11846
+ {
11847
+ key: "department",
11848
+ label: "\u521B\u5EFA\u4EBA\u90E8\u95E8",
11849
+ value: instanceInfo?.creator?.department || instanceInfo?.createdByDepartmentName || "-"
11850
+ },
11851
+ {
11852
+ key: "createdAt",
11853
+ label: "\u521B\u5EFA\u65F6\u95F4",
11854
+ value: formatDateTime2(instanceInfo?.createdAt)
11855
+ },
11856
+ {
11857
+ key: "updatedAt",
11858
+ label: "\u66F4\u65B0\u65F6\u95F4",
11859
+ value: formatDateTime2(instanceInfo?.updatedAt)
11860
+ }
11861
+ ],
11438
11862
  status: mode === "edit" ? { label: "\u7F16\u8F91\u4E2D", tone: "brand" } : void 0
11439
11863
  }
11440
11864
  ),