sy-form-components 0.2.8 → 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.mjs CHANGED
@@ -6745,6 +6745,38 @@ var normalizeField = (key, field, system = false) => ({
6745
6745
  width: field?.width,
6746
6746
  system
6747
6747
  });
6748
+ var SYSTEM_VALUE_ALIASES = {
6749
+ formInstanceId: ["formInstanceId", "formInstId", "form_instance_id", "processInstanceId"],
6750
+ instanceTitle: ["instanceTitle", "instance_title", "processInstanceTitle", "title"],
6751
+ createdBy: ["createdBy", "created_by", "originator"],
6752
+ createdByName: ["createdByName", "created_by_name", "originatorName", "creatorName"],
6753
+ createdByDepartmentId: ["createdByDepartmentId", "created_by_department_id", "originatorCorp"],
6754
+ createdByDepartmentName: [
6755
+ "createdByDepartmentName",
6756
+ "created_by_department_name",
6757
+ "originatorDepartmentName",
6758
+ "originatorCorpName"
6759
+ ],
6760
+ createdAt: ["createdAt", "created_at", "createTime", "gmtCreate"],
6761
+ updatedAt: ["updatedAt", "updated_at", "modifiedTime", "modifyTime", "gmtModified"]
6762
+ };
6763
+ var pickAliasValue = (record, aliases) => {
6764
+ for (const alias of aliases) {
6765
+ const value = record?.[alias];
6766
+ if (value !== void 0 && value !== null && value !== "") return value;
6767
+ }
6768
+ return void 0;
6769
+ };
6770
+ var normalizeDataManagementRecord = (record) => {
6771
+ if (!record || typeof record !== "object" || Array.isArray(record)) return record;
6772
+ const normalized = { ...record };
6773
+ Object.entries(SYSTEM_VALUE_ALIASES).forEach(([targetKey, aliases]) => {
6774
+ if (normalized[targetKey] !== void 0 && normalized[targetKey] !== null) return;
6775
+ const aliasValue = pickAliasValue(record, aliases);
6776
+ if (aliasValue !== void 0) normalized[targetKey] = aliasValue;
6777
+ });
6778
+ return normalized;
6779
+ };
6748
6780
  var PROCESS_INSTANCE_STATUS_OPTIONS = [
6749
6781
  { label: "\u5F85\u5904\u7406", value: "pending" },
6750
6782
  { label: "\u5BA1\u6279\u4E2D", value: "running" },
@@ -6799,15 +6831,29 @@ var PROCESS_SYSTEM_FIELDS = [
6799
6831
  )
6800
6832
  ];
6801
6833
  var BASE_SYSTEM_FIELDS = [
6802
- normalizeField("createTime", { label: "\u521B\u5EFA\u65F6\u95F4", componentName: "DateField", width: 170 }, true),
6803
6834
  normalizeField(
6804
- "modifiedTime",
6805
- { label: "\u66F4\u65B0\u65F6\u95F4", componentName: "DateField", width: 170 },
6835
+ "instanceTitle",
6836
+ { label: "\u5B9E\u4F8B\u6807\u9898", componentName: "TextField", width: 220, displayable: true },
6806
6837
  true
6807
6838
  ),
6808
6839
  normalizeField(
6809
- "originatorName",
6810
- { label: "\u521B\u5EFA\u4EBA", componentName: "TextField", width: 130 },
6840
+ "createdByName",
6841
+ { label: "\u521B\u5EFA\u4EBA", componentName: "TextField", width: 130, displayable: true },
6842
+ true
6843
+ ),
6844
+ normalizeField(
6845
+ "createdByDepartmentName",
6846
+ { label: "\u521B\u5EFA\u4EBA\u90E8\u95E8", componentName: "TextField", width: 150, displayable: true },
6847
+ true
6848
+ ),
6849
+ normalizeField(
6850
+ "createdAt",
6851
+ { label: "\u521B\u5EFA\u65F6\u95F4", componentName: "DateField", width: 170, displayable: true },
6852
+ true
6853
+ ),
6854
+ normalizeField(
6855
+ "updatedAt",
6856
+ { label: "\u66F4\u65B0\u65F6\u95F4", componentName: "DateField", width: 170, displayable: true },
6811
6857
  true
6812
6858
  )
6813
6859
  ];
@@ -6828,7 +6874,7 @@ var normalizeDataManagementList = (payload) => {
6828
6874
  const records = body?.data || body?.records || body?.list || body?.items || [];
6829
6875
  const total = body?.totalCount ?? body?.total ?? body?.count ?? records.length;
6830
6876
  return {
6831
- records: Array.isArray(records) ? records : [],
6877
+ records: Array.isArray(records) ? records.map(normalizeDataManagementRecord) : [],
6832
6878
  total: Number(total) || 0
6833
6879
  };
6834
6880
  };
@@ -6848,7 +6894,9 @@ var buildFilterPayload = (group) => {
6848
6894
  var normalizeColumnConfig = (cfg, fields) => {
6849
6895
  const allowed = new Set(fields.map((field) => field.fieldId));
6850
6896
  const configured = Array.isArray(cfg?.showFields) ? cfg.showFields.filter((fieldId) => allowed.has(fieldId)) : [];
6851
- const defaultShow = fields.filter((field) => !field.system || field.displayable).slice(0, 8).map((field) => field.fieldId);
6897
+ const defaultBusinessFields = fields.filter((field) => !field.system).slice(0, 8).map((field) => field.fieldId);
6898
+ const defaultSystemFields = fields.filter((field) => field.system && field.displayable).map((field) => field.fieldId);
6899
+ const defaultShow = [...defaultBusinessFields, ...defaultSystemFields];
6852
6900
  return {
6853
6901
  showFields: configured.length > 0 ? configured : defaultShow,
6854
6902
  widths: cfg?.widths || {},
@@ -7510,8 +7558,14 @@ import { useState as useState24, useEffect as useEffect29, useCallback as useCal
7510
7558
  var FORM_INSTANCE_METADATA_KEYS = /* @__PURE__ */ new Set([
7511
7559
  "appType",
7512
7560
  "code",
7561
+ "createTime",
7562
+ "created_at",
7513
7563
  "createdAt",
7514
7564
  "createdBy",
7565
+ "created_by",
7566
+ "created_by_department_id",
7567
+ "created_by_department_name",
7568
+ "created_by_name",
7515
7569
  "createdByDepartmentId",
7516
7570
  "createdByDepartmentName",
7517
7571
  "createdByName",
@@ -7523,9 +7577,18 @@ var FORM_INSTANCE_METADATA_KEYS = /* @__PURE__ */ new Set([
7523
7577
  "formUuid",
7524
7578
  "instanceTitle",
7525
7579
  "message",
7580
+ "modifiedTime",
7581
+ "modifyTime",
7582
+ "originator",
7583
+ "originatorCorp",
7584
+ "originatorCorpName",
7585
+ "originatorDepartmentName",
7586
+ "originatorName",
7587
+ "processInstanceTitle",
7526
7588
  "result",
7527
7589
  "success",
7528
7590
  "title",
7591
+ "updated_at",
7529
7592
  "updatedAt"
7530
7593
  ]);
7531
7594
  var isPlainRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -7572,6 +7635,76 @@ var extractFormValues = (formInstance, fieldIds) => {
7572
7635
  const flatValues = pickKnownFields(formInstance, fieldIds);
7573
7636
  return Object.keys(flatValues).length > 0 ? flatValues : null;
7574
7637
  };
7638
+ var firstValue = (source, keys) => {
7639
+ for (const key of keys) {
7640
+ const value = source[key];
7641
+ if (value !== void 0 && value !== null && value !== "") return value;
7642
+ }
7643
+ return void 0;
7644
+ };
7645
+ var normalizeFormInstanceInfo = (formInstance, fallback) => {
7646
+ if (!isPlainRecord(formInstance)) return null;
7647
+ const creator = isPlainRecord(formInstance.creator) ? formInstance.creator : {};
7648
+ const formInstanceId = firstValue(formInstance, [
7649
+ "formInstanceId",
7650
+ "formInstId",
7651
+ "form_instance_id",
7652
+ "id"
7653
+ ]);
7654
+ const createdByName = firstValue(formInstance, [
7655
+ "createdByName",
7656
+ "created_by_name",
7657
+ "originatorName",
7658
+ "creatorName"
7659
+ ]);
7660
+ const createdByDepartmentName = firstValue(formInstance, [
7661
+ "createdByDepartmentName",
7662
+ "created_by_department_name",
7663
+ "originatorDepartmentName",
7664
+ "originatorCorpName"
7665
+ ]);
7666
+ return {
7667
+ ...formInstance,
7668
+ formInstanceId: formInstanceId || fallback?.formInstanceId || "",
7669
+ formUuid: formInstance.formUuid || fallback?.formUuid || "",
7670
+ appType: formInstance.appType || fallback?.appType || "",
7671
+ data: isPlainRecord(formInstance.data) ? formInstance.data : {},
7672
+ title: firstValue(formInstance, [
7673
+ "title",
7674
+ "instanceTitle",
7675
+ "instance_title",
7676
+ "processInstanceTitle"
7677
+ ]) || void 0,
7678
+ instanceTitle: firstValue(formInstance, [
7679
+ "instanceTitle",
7680
+ "instance_title",
7681
+ "processInstanceTitle",
7682
+ "title"
7683
+ ]) || void 0,
7684
+ creator: {
7685
+ userId: creator.userId || creator.id || formInstance.createdBy || formInstance.originator || "",
7686
+ name: creator.name || createdByName || "",
7687
+ avatar: creator.avatar,
7688
+ department: creator.department || createdByDepartmentName || ""
7689
+ },
7690
+ createdBy: firstValue(formInstance, ["createdBy", "created_by", "originator"]),
7691
+ createdByName,
7692
+ createdByDepartmentId: firstValue(formInstance, [
7693
+ "createdByDepartmentId",
7694
+ "created_by_department_id",
7695
+ "originatorCorp"
7696
+ ]),
7697
+ createdByDepartmentName,
7698
+ createdAt: firstValue(formInstance, ["createdAt", "created_at", "createTime", "gmtCreate"]) || "",
7699
+ updatedAt: firstValue(formInstance, [
7700
+ "updatedAt",
7701
+ "updated_at",
7702
+ "modifiedTime",
7703
+ "modifyTime",
7704
+ "gmtModified"
7705
+ ])
7706
+ };
7707
+ };
7575
7708
 
7576
7709
  // src/hooks/useFormDetail.ts
7577
7710
  function useFormDetail(options) {
@@ -7602,8 +7735,13 @@ function useFormDetail(options) {
7602
7735
  if (!permResult || !hasViewOperation(permResult.operations, "view")) {
7603
7736
  onPermissionDenied?.();
7604
7737
  }
7738
+ const normalizedInfo = normalizeFormInstanceInfo(formResult, {
7739
+ formUuid,
7740
+ appType,
7741
+ formInstanceId
7742
+ });
7605
7743
  setPermissions(permResult);
7606
- setInstanceInfo(formResult);
7744
+ setInstanceInfo(normalizedInfo);
7607
7745
  setFormData(extractFormValues(formResult, fieldIds));
7608
7746
  } catch (error) {
7609
7747
  console.error("[useFormDetail] Failed to load data:", error);
@@ -9609,8 +9747,8 @@ var SummaryPanel = ({
9609
9747
  )
9610
9748
  ] }),
9611
9749
  /* @__PURE__ */ jsx86("h1", { className: "m-0 break-words text-2xl font-semibold leading-9 text-ant-text md:text-[28px]", children: title }),
9612
- items.length > 0 && /* @__PURE__ */ jsx86("div", { className: "mt-5 grid grid-cols-1 gap-4 md:grid-cols-3", children: items.map((item) => /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 items-center gap-3", children: [
9613
- /* @__PURE__ */ jsx86("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 }),
9750
+ items.length > 0 && /* @__PURE__ */ jsx86("div", { className: "mt-5 grid grid-cols-1 gap-4 md:grid-cols-4", children: items.map((item) => /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 items-center gap-3", children: [
9751
+ item.icon && /* @__PURE__ */ jsx86("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 }),
9614
9752
  /* @__PURE__ */ jsxs38("span", { className: "min-w-0", children: [
9615
9753
  /* @__PURE__ */ jsx86("span", { className: "block text-xs leading-5 text-ant-text-tertiary", children: item.label }),
9616
9754
  /* @__PURE__ */ jsx86("span", { className: "block break-words text-sm font-medium leading-6 text-ant-text", children: item.value || "-" })
@@ -9728,10 +9866,12 @@ import {
9728
9866
  Button as Button15,
9729
9867
  Checkbox as Checkbox5,
9730
9868
  ConfigProvider,
9869
+ Divider,
9731
9870
  Drawer as Drawer2,
9732
9871
  Dropdown as Dropdown3,
9733
9872
  Empty as Empty5,
9734
9873
  Input as Input12,
9874
+ InputNumber as InputNumber2,
9735
9875
  Modal as Modal8,
9736
9876
  Segmented,
9737
9877
  Select as Select6,
@@ -9742,6 +9882,7 @@ import {
9742
9882
  Upload as Upload3,
9743
9883
  message
9744
9884
  } from "antd";
9885
+ import dayjs5 from "dayjs";
9745
9886
  import {
9746
9887
  DeleteOutlined,
9747
9888
  DownloadOutlined,
@@ -9787,6 +9928,11 @@ var formatPrimitive = (value) => {
9787
9928
  return /* @__PURE__ */ jsx89("span", { className: "text-ant-color-text-quaternary", children: "--" });
9788
9929
  return String(value);
9789
9930
  };
9931
+ var formatDateTime = (value) => {
9932
+ if (value === void 0 || value === null || value === "") return formatPrimitive("");
9933
+ const parsed = dayjs5(value);
9934
+ return parsed.isValid() ? parsed.format("YYYY-MM-DD HH:mm:ss") : String(value);
9935
+ };
9790
9936
  var pickOptionLabel = (field, value) => {
9791
9937
  const options = field.options || field.optionList || field.option_list || field.componentProps?.options || [];
9792
9938
  const scalar = typeof value === "object" ? value?.value ?? value?.id ?? value?.label ?? value?.name : value;
@@ -9814,6 +9960,9 @@ var renderStatusTag = (value, fieldId) => {
9814
9960
  var renderCellValue = (value, field) => {
9815
9961
  const status = renderStatusTag(value, field.fieldId);
9816
9962
  if (status) return status;
9963
+ if (field.componentName === "DateField" || field.componentName === "DateTimeField") {
9964
+ return formatDateTime(value);
9965
+ }
9817
9966
  if (Array.isArray(value)) {
9818
9967
  if (value.length === 0) return formatPrimitive("");
9819
9968
  if (field.componentName === "ImageField") {
@@ -9992,6 +10141,54 @@ function FilterGroupEditor({
9992
10141
  }
9993
10142
  );
9994
10143
  }
10144
+ function ResizableColumnTitle({
10145
+ label,
10146
+ width,
10147
+ onResize,
10148
+ onResizeEnd
10149
+ }) {
10150
+ const dragRef = useRef14({ startX: 0, startWidth: width, latestWidth: width });
10151
+ const handleMouseDown = (event) => {
10152
+ event.preventDefault();
10153
+ event.stopPropagation();
10154
+ dragRef.current = {
10155
+ startX: event.clientX,
10156
+ startWidth: width,
10157
+ latestWidth: width
10158
+ };
10159
+ const handleMouseMove = (moveEvent) => {
10160
+ const nextWidth = Math.min(
10161
+ 520,
10162
+ Math.max(96, dragRef.current.startWidth + moveEvent.clientX - dragRef.current.startX)
10163
+ );
10164
+ dragRef.current.latestWidth = nextWidth;
10165
+ onResize(nextWidth);
10166
+ };
10167
+ const handleMouseUp = () => {
10168
+ document.removeEventListener("mousemove", handleMouseMove);
10169
+ document.removeEventListener("mouseup", handleMouseUp);
10170
+ onResizeEnd(dragRef.current.latestWidth);
10171
+ };
10172
+ document.addEventListener("mousemove", handleMouseMove);
10173
+ document.addEventListener("mouseup", handleMouseUp);
10174
+ };
10175
+ return /* @__PURE__ */ jsxs41("span", { className: "relative flex min-w-0 items-center pr-3", children: [
10176
+ /* @__PURE__ */ jsx89("span", { className: "min-w-0 truncate", children: label }),
10177
+ /* @__PURE__ */ jsx89(
10178
+ "span",
10179
+ {
10180
+ "aria-hidden": true,
10181
+ className: "absolute -right-2 top-1/2 h-5 w-2 -translate-y-1/2 cursor-col-resize rounded hover:bg-ant-color-primary",
10182
+ onClick: (event) => {
10183
+ event.preventDefault();
10184
+ event.stopPropagation();
10185
+ },
10186
+ onMouseDown: handleMouseDown,
10187
+ title: "\u62D6\u62FD\u8C03\u6574\u5217\u5BBD"
10188
+ }
10189
+ )
10190
+ ] });
10191
+ }
9995
10192
  var DataManagementList = ({
9996
10193
  appType,
9997
10194
  formUuid,
@@ -10001,6 +10198,7 @@ var DataManagementList = ({
10001
10198
  configScope = "global",
10002
10199
  title,
10003
10200
  detailRenderer,
10201
+ detailPageUrlBuilder,
10004
10202
  submitRenderer,
10005
10203
  requestOverride,
10006
10204
  rowActions = []
@@ -10014,9 +10212,11 @@ var DataManagementList = ({
10014
10212
  }, [requestOverride]);
10015
10213
  const [fields, setFields] = useState35([]);
10016
10214
  const [config, setConfig] = useState35({});
10215
+ const [formType, setFormType] = useState35("form");
10017
10216
  const [showFields, setShowFields] = useState35([]);
10018
10217
  const [lockFieldIds, setLockFieldIds] = useState35([]);
10019
10218
  const [widths, setWidths] = useState35({});
10219
+ const widthsRef = useRef14({});
10020
10220
  const [sort, setSort] = useState35([]);
10021
10221
  const [density, setDensity] = useState35("middle");
10022
10222
  const [detailOpenMode, setDetailOpenMode] = useState35("drawer");
@@ -10053,7 +10253,7 @@ var DataManagementList = ({
10053
10253
  const fetchStateRef = useRef14({});
10054
10254
  const request = api.request;
10055
10255
  const getPopupContainer = useCallback17(
10056
- (triggerNode) => triggerNode?.parentElement || rootRef.current || document.body,
10256
+ (triggerNode) => rootRef.current || triggerNode?.ownerDocument?.body || (typeof document !== "undefined" ? document.body : triggerNode?.parentElement),
10057
10257
  []
10058
10258
  );
10059
10259
  const confirmDanger = useCallback17((title2, content, onOk) => {
@@ -10063,6 +10263,9 @@ var DataManagementList = ({
10063
10263
  () => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
10064
10264
  [fields, showFields]
10065
10265
  );
10266
+ useEffect36(() => {
10267
+ widthsRef.current = widths;
10268
+ }, [widths]);
10066
10269
  useEffect36(() => {
10067
10270
  fetchStateRef.current = {
10068
10271
  current,
@@ -10130,16 +10333,18 @@ var DataManagementList = ({
10130
10333
  }).catch(() => void 0);
10131
10334
  if (!mounted) return;
10132
10335
  const resolved = normalizeColumnConfig(saved, allFields);
10336
+ const resolvedDetailOpenMode = detailPageUrlBuilder ? resolved.detailOpenMode : "drawer";
10133
10337
  const nextSearchKeyWord = saved?.filter?.searchKeyWord || "";
10134
10338
  const nextFilterGroup = hydrateFilterGroup(saved?.filter?.group);
10135
10339
  setFields(allFields);
10340
+ setFormType(schemaResult.formType || "form");
10136
10341
  setConfig(saved || {});
10137
10342
  setShowFields(resolved.showFields);
10138
10343
  setWidths(resolved.widths);
10139
10344
  setLockFieldIds(resolved.lockFieldIds);
10140
10345
  setSort(resolved.sort);
10141
10346
  setDensity(resolved.density);
10142
- setDetailOpenMode(resolved.detailOpenMode);
10347
+ setDetailOpenMode(resolvedDetailOpenMode);
10143
10348
  setPageSize(resolved.pageSize);
10144
10349
  setSearchKeyWord(nextSearchKeyWord);
10145
10350
  setFilterGroup(nextFilterGroup);
@@ -10161,7 +10366,7 @@ var DataManagementList = ({
10161
10366
  return () => {
10162
10367
  mounted = false;
10163
10368
  };
10164
- }, [appType, configScope, formUuid, loadData, menuFormUuid, request]);
10369
+ }, [appType, configScope, detailPageUrlBuilder, formUuid, loadData, menuFormUuid, request]);
10165
10370
  const persistConfig = useCallback17(
10166
10371
  async (patch) => {
10167
10372
  const nextConfig = { ...config, ...patch };
@@ -10185,22 +10390,62 @@ var DataManagementList = ({
10185
10390
  showFields,
10186
10391
  lockFieldIds,
10187
10392
  widths,
10393
+ sort,
10188
10394
  density,
10189
10395
  detailOpenMode,
10190
10396
  pageSize
10191
10397
  });
10398
+ await loadData({ current: 1, pageSize, sort });
10399
+ };
10400
+ const handleSortChange = (index, patch) => {
10401
+ setSort(
10402
+ (prev) => prev.map((item, itemIndex) => itemIndex === index ? { ...item, ...patch } : item)
10403
+ );
10192
10404
  };
10405
+ const handleAddSort = () => {
10406
+ const firstFieldId = showFields[0] || fields[0]?.fieldId;
10407
+ if (!firstFieldId) return;
10408
+ setSort((prev) => [...prev, { id: firstFieldId, isAsc: "y" }]);
10409
+ };
10410
+ const handleRemoveSort = (index) => {
10411
+ setSort((prev) => prev.filter((_, itemIndex) => itemIndex !== index));
10412
+ };
10413
+ const updateColumnWidth = useCallback17((fieldId, width) => {
10414
+ const nextWidth = Math.round(Math.max(96, Math.min(520, width)));
10415
+ widthsRef.current = { ...widthsRef.current, [fieldId]: nextWidth };
10416
+ setWidths(widthsRef.current);
10417
+ }, []);
10418
+ const commitColumnWidth = useCallback17(
10419
+ (fieldId, width) => {
10420
+ const nextWidth = Math.round(Math.max(96, Math.min(520, width)));
10421
+ const nextWidths = { ...widthsRef.current, [fieldId]: nextWidth };
10422
+ widthsRef.current = nextWidths;
10423
+ setWidths(nextWidths);
10424
+ void persistConfig({ widths: nextWidths });
10425
+ },
10426
+ [persistConfig]
10427
+ );
10193
10428
  const handleDetail = useCallback17(
10194
10429
  (record) => {
10195
10430
  const formInstanceId = getRecordId(record);
10196
- if (detailOpenMode === "newPage" && typeof window !== "undefined") {
10197
- window.open(`/${appType}/forms/${formUuid}/detail/${formInstanceId}`, "_blank");
10431
+ if (!formInstanceId) {
10432
+ message.warning("\u5F53\u524D\u8BB0\u5F55\u7F3A\u5C11\u5B9E\u4F8B ID\uFF0C\u65E0\u6CD5\u6253\u5F00\u8BE6\u60C5");
10198
10433
  return;
10199
10434
  }
10435
+ if (detailOpenMode === "newPage" && detailPageUrlBuilder && typeof window !== "undefined") {
10436
+ const detailUrl = detailPageUrlBuilder({ record, formInstanceId: String(formInstanceId) });
10437
+ if (detailUrl) {
10438
+ window.open(detailUrl, "_blank");
10439
+ return;
10440
+ }
10441
+ }
10442
+ if (detailOpenMode === "newPage" && !detailPageUrlBuilder) {
10443
+ setDetailOpenMode("drawer");
10444
+ }
10200
10445
  setActiveRecord(record);
10201
10446
  setDetailOpen(true);
10202
10447
  },
10203
- [appType, detailOpenMode, formUuid]
10448
+ [detailOpenMode, detailPageUrlBuilder]
10204
10449
  );
10205
10450
  const handleDelete = useCallback17(
10206
10451
  async (ids) => {
@@ -10316,22 +10561,33 @@ var DataManagementList = ({
10316
10561
  await loadData({ current: 1, pageSize });
10317
10562
  };
10318
10563
  const columns = useMemo18(() => {
10319
- const baseColumns = visibleFields.map((field) => ({
10320
- title: field.label,
10321
- dataIndex: field.fieldId,
10322
- key: field.fieldId,
10323
- width: widths[field.fieldId] || field.width || 160,
10324
- fixed: lockFieldIds.includes(field.fieldId) ? "left" : void 0,
10325
- ellipsis: true,
10326
- sorter: true,
10327
- render: (value) => renderCellValue(value, field)
10328
- })) || [];
10564
+ const baseColumns = visibleFields.map((field) => {
10565
+ const columnWidth = widths[field.fieldId] || field.width || 160;
10566
+ return {
10567
+ title: /* @__PURE__ */ jsx89(
10568
+ ResizableColumnTitle,
10569
+ {
10570
+ label: field.label,
10571
+ width: columnWidth,
10572
+ onResize: (width) => updateColumnWidth(field.fieldId, width),
10573
+ onResizeEnd: (width) => commitColumnWidth(field.fieldId, width)
10574
+ }
10575
+ ),
10576
+ dataIndex: field.fieldId,
10577
+ key: field.fieldId,
10578
+ width: columnWidth,
10579
+ fixed: lockFieldIds.includes(field.fieldId) ? "left" : void 0,
10580
+ ellipsis: true,
10581
+ sorter: true,
10582
+ render: (value) => renderCellValue(value, field)
10583
+ };
10584
+ }) || [];
10329
10585
  return [
10330
10586
  ...baseColumns,
10331
10587
  {
10332
10588
  title: "\u64CD\u4F5C",
10333
10589
  key: "__actions",
10334
- width: 148,
10590
+ width: 136,
10335
10591
  fixed: "right",
10336
10592
  render: (_, record) => /* @__PURE__ */ jsxs41(Space9, { size: 4, children: [
10337
10593
  /* @__PURE__ */ jsx89(Button15, { type: "link", size: "small", onClick: () => handleDetail(record), children: "\u8BE6\u60C5" }),
@@ -10342,18 +10598,6 @@ var DataManagementList = ({
10342
10598
  getPopupContainer,
10343
10599
  menu: {
10344
10600
  items: [
10345
- ...rowActions.map((action) => ({
10346
- key: action.key,
10347
- label: action.label,
10348
- danger: action.danger,
10349
- onClick: () => action.onClick(record)
10350
- })),
10351
- {
10352
- key: "workflow",
10353
- label: "\u6D41\u7A0B\u65E5\u5FD7",
10354
- icon: /* @__PURE__ */ jsx89(HistoryOutlined2, {}),
10355
- onClick: () => message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
10356
- },
10357
10601
  ...!readonly ? [
10358
10602
  {
10359
10603
  key: "delete",
@@ -10366,6 +10610,20 @@ var DataManagementList = ({
10366
10610
  () => handleDelete([String(getRecordId(record))])
10367
10611
  )
10368
10612
  }
10613
+ ] : [],
10614
+ ...rowActions.map((action) => ({
10615
+ key: action.key,
10616
+ label: action.label,
10617
+ danger: action.danger,
10618
+ onClick: () => action.onClick(record)
10619
+ })),
10620
+ ...formType === "process" ? [
10621
+ {
10622
+ key: "workflow",
10623
+ label: "\u6D41\u7A0B\u65E5\u5FD7",
10624
+ icon: /* @__PURE__ */ jsx89(HistoryOutlined2, {}),
10625
+ onClick: () => message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
10626
+ }
10369
10627
  ] : []
10370
10628
  ]
10371
10629
  },
@@ -10377,16 +10635,23 @@ var DataManagementList = ({
10377
10635
  ];
10378
10636
  }, [
10379
10637
  confirmDanger,
10638
+ commitColumnWidth,
10639
+ formType,
10380
10640
  getPopupContainer,
10381
10641
  handleDelete,
10382
10642
  handleDetail,
10383
10643
  lockFieldIds,
10384
10644
  readonly,
10385
10645
  rowActions,
10646
+ updateColumnWidth,
10386
10647
  visibleFields,
10387
10648
  widths
10388
10649
  ]);
10389
10650
  const tableSize = density === "compact" ? "small" : density === "loose" ? "large" : "middle";
10651
+ const tableScrollX = Math.max(
10652
+ 900,
10653
+ visibleFields.reduce((sum, field) => sum + (widths[field.fieldId] || field.width || 160), 136)
10654
+ );
10390
10655
  const importPreviewColumns = useMemo18(() => {
10391
10656
  const keys = Array.from(
10392
10657
  new Set(importPreview.flatMap((record) => Object.keys(record || {})))
@@ -10403,450 +10668,525 @@ var DataManagementList = ({
10403
10668
  };
10404
10669
  });
10405
10670
  }, [fields, importPreview]);
10406
- return /* @__PURE__ */ jsx89(ConfigProvider, { getPopupContainer, children: /* @__PURE__ */ jsxs41("div", { ref: rootRef, className: `${fullHeight ? "h-full min-h-full" : ""} bg-ant-bg-layout`, children: [
10407
- /* @__PURE__ */ jsxs41("div", { className: "mx-auto flex h-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
10408
- /* @__PURE__ */ jsxs41("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
10409
- /* @__PURE__ */ jsxs41("div", { children: [
10410
- /* @__PURE__ */ jsx89("h1", { className: "text-xl font-semibold text-ant-color-text", children: title || "\u6570\u636E\u7BA1\u7406" }),
10411
- /* @__PURE__ */ jsxs41("p", { className: "mt-1 text-sm text-ant-color-text-secondary", children: [
10412
- "\u5171 ",
10413
- total,
10414
- " \u6761\u6570\u636E\uFF0C\u5DF2\u9009\u62E9 ",
10415
- selectedRowKeys.length,
10416
- " \u6761"
10417
- ] })
10418
- ] }),
10419
- /* @__PURE__ */ jsxs41(Space9, { wrap: true, children: [
10420
- !readonly && submitRenderer && /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(PlusOutlined, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
10421
- /* @__PURE__ */ jsx89(
10422
- Input12.Search,
10671
+ return /* @__PURE__ */ jsx89(ConfigProvider, { getPopupContainer, children: /* @__PURE__ */ jsxs41(
10672
+ "div",
10673
+ {
10674
+ ref: rootRef,
10675
+ className: `relative w-full bg-ant-bg-layout ${fullHeight ? "flex h-[calc(100vh-88px)] min-h-[560px] overflow-hidden" : ""}`,
10676
+ children: [
10677
+ /* @__PURE__ */ jsxs41("div", { className: "mx-auto flex min-h-0 w-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
10678
+ /* @__PURE__ */ jsxs41("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
10679
+ /* @__PURE__ */ jsxs41("div", { children: [
10680
+ /* @__PURE__ */ jsx89("h1", { className: "text-xl font-semibold text-ant-color-text", children: title || "\u6570\u636E\u7BA1\u7406" }),
10681
+ /* @__PURE__ */ jsxs41("p", { className: "mt-1 text-sm text-ant-color-text-secondary", children: [
10682
+ "\u5171 ",
10683
+ total,
10684
+ " \u6761\u6570\u636E\uFF0C\u5DF2\u9009\u62E9 ",
10685
+ selectedRowKeys.length,
10686
+ " \u6761"
10687
+ ] })
10688
+ ] }),
10689
+ /* @__PURE__ */ jsxs41(Space9, { wrap: true, children: [
10690
+ !readonly && submitRenderer && /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(PlusOutlined, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
10691
+ /* @__PURE__ */ jsx89(
10692
+ Input12.Search,
10693
+ {
10694
+ allowClear: true,
10695
+ className: "w-[260px]",
10696
+ placeholder: "\u641C\u7D22\u5173\u952E\u5B57",
10697
+ value: searchKeyWord,
10698
+ onChange: (event) => setSearchKeyWord(event.target.value),
10699
+ onSearch: (value) => {
10700
+ const nextSearchKeyWord = String(value || "");
10701
+ setSearchKeyWord(nextSearchKeyWord);
10702
+ persistConfig({
10703
+ filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup }
10704
+ });
10705
+ loadData({
10706
+ current: 1,
10707
+ pageSize,
10708
+ searchKeyWord: nextSearchKeyWord,
10709
+ filterGroup
10710
+ });
10711
+ }
10712
+ }
10713
+ ),
10714
+ /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(FilterOutlined, {}), onClick: () => setFilterOpen(true), children: "\u7B5B\u9009" }),
10715
+ /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(SettingOutlined, {}), onClick: () => setColumnOpen(true), children: "\u5217\u8BBE\u7F6E" }),
10716
+ /* @__PURE__ */ jsx89(
10717
+ Dropdown3,
10718
+ {
10719
+ getPopupContainer,
10720
+ menu: {
10721
+ items: [
10722
+ {
10723
+ key: "selected",
10724
+ label: "\u5BFC\u51FA\u9009\u4E2D",
10725
+ disabled: selectedRowKeys.length === 0,
10726
+ onClick: () => {
10727
+ setExportScope("selected");
10728
+ setExportFields(showFields);
10729
+ setExportOpen(true);
10730
+ }
10731
+ },
10732
+ {
10733
+ key: "all",
10734
+ label: "\u5BFC\u51FA\u5168\u90E8",
10735
+ onClick: () => {
10736
+ setExportScope("all");
10737
+ setExportFields(showFields);
10738
+ setExportOpen(true);
10739
+ }
10740
+ },
10741
+ {
10742
+ key: "records",
10743
+ label: "\u5BFC\u51FA\u8BB0\u5F55",
10744
+ onClick: () => loadTransferRecords("export")
10745
+ }
10746
+ ]
10747
+ },
10748
+ children: /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(DownloadOutlined, {}), children: "\u5BFC\u51FA" })
10749
+ }
10750
+ ),
10751
+ !readonly && /* @__PURE__ */ jsx89(
10752
+ Dropdown3,
10753
+ {
10754
+ getPopupContainer,
10755
+ menu: {
10756
+ items: [
10757
+ { key: "import", label: "\u5BFC\u5165\u6570\u636E", onClick: () => setImportOpen(true) },
10758
+ {
10759
+ key: "records",
10760
+ label: "\u5BFC\u5165\u8BB0\u5F55",
10761
+ onClick: () => loadTransferRecords("import")
10762
+ }
10763
+ ]
10764
+ },
10765
+ children: /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(ImportOutlined, {}), children: "\u5BFC\u5165" })
10766
+ }
10767
+ ),
10768
+ /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(ReloadOutlined3, {}), onClick: () => loadData({ current, pageSize }) })
10769
+ ] })
10770
+ ] }),
10771
+ 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: [
10772
+ /* @__PURE__ */ jsxs41("span", { className: "text-sm text-ant-color-text-secondary", children: [
10773
+ "\u5DF2\u9009 ",
10774
+ selectedRowKeys.length,
10775
+ " \u6761"
10776
+ ] }),
10777
+ /* @__PURE__ */ jsxs41(Space9, { wrap: true, children: [
10778
+ !readonly && /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(SwapOutlined2, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
10779
+ !readonly && /* @__PURE__ */ jsx89(
10780
+ Button15,
10781
+ {
10782
+ danger: true,
10783
+ icon: /* @__PURE__ */ jsx89(DeleteOutlined, {}),
10784
+ onClick: () => confirmDanger(
10785
+ "\u786E\u8BA4\u6279\u91CF\u5220\u9664",
10786
+ `\u5C06\u5220\u9664 ${selectedRowKeys.length} \u6761\u6570\u636E\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F`,
10787
+ () => handleDelete(selectedRowKeys.map(String))
10788
+ ),
10789
+ children: "\u6279\u91CF\u5220\u9664"
10790
+ }
10791
+ ),
10792
+ /* @__PURE__ */ jsx89(Button15, { type: "link", onClick: () => setSelectedRowKeys([]), children: "\u53D6\u6D88\u9009\u62E9" })
10793
+ ] })
10794
+ ] }),
10795
+ /* @__PURE__ */ jsx89("div", { className: "relative flex-1 overflow-hidden rounded-lg border border-ant-border-secondary bg-ant-bg-container", children: /* @__PURE__ */ jsx89(
10796
+ Table3,
10423
10797
  {
10424
- allowClear: true,
10425
- className: "w-[260px]",
10426
- placeholder: "\u641C\u7D22\u5173\u952E\u5B57",
10427
- value: searchKeyWord,
10428
- onChange: (event) => setSearchKeyWord(event.target.value),
10429
- onSearch: (value) => {
10430
- const nextSearchKeyWord = String(value || "");
10431
- setSearchKeyWord(nextSearchKeyWord);
10432
- persistConfig({
10433
- filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup }
10434
- });
10798
+ rowKey: (record) => String(getRecordId(record)),
10799
+ loading: loading || schemaLoading,
10800
+ columns,
10801
+ dataSource,
10802
+ size: tableSize,
10803
+ scroll: {
10804
+ x: tableScrollX,
10805
+ y: fullHeight ? selectedRowKeys.length > 0 ? "calc(100vh - 360px)" : "calc(100vh - 300px)" : void 0
10806
+ },
10807
+ rowSelection: {
10808
+ selectedRowKeys,
10809
+ onChange: setSelectedRowKeys
10810
+ },
10811
+ pagination: {
10812
+ current,
10813
+ pageSize,
10814
+ total,
10815
+ showSizeChanger: true,
10816
+ showTotal: (count) => `\u5171 ${count} \u6761`
10817
+ },
10818
+ onChange: (pagination, _filters, sorter) => {
10819
+ const sorters = Array.isArray(sorter) ? sorter : [sorter];
10820
+ const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
10821
+ id: String(item.field),
10822
+ isAsc: item.order === "ascend" ? "y" : "n"
10823
+ }));
10824
+ setSort(nextSort);
10825
+ persistConfig({ sort: nextSort });
10435
10826
  loadData({
10436
- current: 1,
10437
- pageSize,
10438
- searchKeyWord: nextSearchKeyWord,
10439
- filterGroup
10827
+ current: pagination.current || 1,
10828
+ pageSize: pagination.pageSize || pageSize,
10829
+ sort: nextSort
10440
10830
  });
10441
10831
  }
10442
10832
  }
10443
- ),
10444
- /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(FilterOutlined, {}), onClick: () => setFilterOpen(true), children: "\u7B5B\u9009" }),
10445
- /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(SettingOutlined, {}), onClick: () => setColumnOpen(true), children: "\u5217\u8BBE\u7F6E" }),
10446
- /* @__PURE__ */ jsx89(
10447
- Dropdown3,
10448
- {
10449
- getPopupContainer,
10450
- menu: {
10451
- items: [
10452
- {
10453
- key: "selected",
10454
- label: "\u5BFC\u51FA\u9009\u4E2D",
10455
- disabled: selectedRowKeys.length === 0,
10456
- onClick: () => {
10457
- setExportScope("selected");
10458
- setExportFields(showFields);
10459
- setExportOpen(true);
10460
- }
10461
- },
10462
- {
10463
- key: "all",
10464
- label: "\u5BFC\u51FA\u5168\u90E8",
10465
- onClick: () => {
10466
- setExportScope("all");
10467
- setExportFields(showFields);
10468
- setExportOpen(true);
10469
- }
10470
- },
10833
+ ) })
10834
+ ] }),
10835
+ /* @__PURE__ */ jsx89(
10836
+ Modal8,
10837
+ {
10838
+ getContainer: false,
10839
+ title: "\u9AD8\u7EA7\u7B5B\u9009",
10840
+ open: filterOpen,
10841
+ width: 760,
10842
+ onCancel: () => setFilterOpen(false),
10843
+ onOk: () => {
10844
+ setFilterOpen(false);
10845
+ persistConfig({ filter: { searchKeyWord, group: filterGroup } });
10846
+ loadData({ current: 1, pageSize, searchKeyWord, filterGroup });
10847
+ },
10848
+ okText: "\u5E94\u7528\u7B5B\u9009",
10849
+ children: /* @__PURE__ */ jsx89(FilterGroupEditor, { group: filterGroup, fields, onChange: setFilterGroup })
10850
+ }
10851
+ ),
10852
+ /* @__PURE__ */ jsx89(
10853
+ Modal8,
10854
+ {
10855
+ getContainer: false,
10856
+ title: "\u5217\u8BBE\u7F6E",
10857
+ open: columnOpen,
10858
+ width: 920,
10859
+ onCancel: () => setColumnOpen(false),
10860
+ onOk: handleColumnCommit,
10861
+ children: /* @__PURE__ */ jsxs41("div", { className: "space-y-5", children: [
10862
+ /* @__PURE__ */ jsxs41("div", { children: [
10863
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u663E\u793A\u5217" }),
10864
+ /* @__PURE__ */ jsx89(
10865
+ Checkbox5.Group,
10471
10866
  {
10472
- key: "records",
10473
- label: "\u5BFC\u51FA\u8BB0\u5F55",
10474
- onClick: () => loadTransferRecords("export")
10867
+ className: "grid grid-cols-2 gap-2 md:grid-cols-3",
10868
+ value: showFields,
10869
+ options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
10870
+ onChange: (values) => setShowFields(values.map(String))
10475
10871
  }
10476
- ]
10477
- },
10478
- children: /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(DownloadOutlined, {}), children: "\u5BFC\u51FA" })
10479
- }
10480
- ),
10481
- !readonly && /* @__PURE__ */ jsx89(
10482
- Dropdown3,
10483
- {
10484
- getPopupContainer,
10485
- menu: {
10486
- items: [
10487
- { key: "import", label: "\u5BFC\u5165\u6570\u636E", onClick: () => setImportOpen(true) },
10872
+ )
10873
+ ] }),
10874
+ /* @__PURE__ */ jsxs41("div", { children: [
10875
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5217\u5BBD" }),
10876
+ /* @__PURE__ */ jsx89("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) => {
10877
+ const field = fields.find((item) => item.fieldId === fieldId);
10878
+ const width = widths[fieldId] || field?.width || 160;
10879
+ return /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between gap-3", children: [
10880
+ /* @__PURE__ */ jsx89("span", { className: "min-w-0 truncate text-sm text-ant-color-text-secondary", children: field?.label || fieldId }),
10881
+ /* @__PURE__ */ jsx89(
10882
+ InputNumber2,
10883
+ {
10884
+ min: 96,
10885
+ max: 520,
10886
+ value: width,
10887
+ addonAfter: "px",
10888
+ onChange: (value) => updateColumnWidth(fieldId, Number(value || 160)),
10889
+ onBlur: () => commitColumnWidth(fieldId, widthsRef.current[fieldId] || width)
10890
+ }
10891
+ )
10892
+ ] }, fieldId);
10893
+ }) })
10894
+ ] }),
10895
+ /* @__PURE__ */ jsxs41("div", { children: [
10896
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u51BB\u7ED3\u5217" }),
10897
+ /* @__PURE__ */ jsx89(
10898
+ Select6,
10488
10899
  {
10489
- key: "records",
10490
- label: "\u5BFC\u5165\u8BB0\u5F55",
10491
- onClick: () => loadTransferRecords("import")
10900
+ mode: "multiple",
10901
+ className: "w-full",
10902
+ value: lockFieldIds,
10903
+ options: showFields.map((fieldId) => {
10904
+ const field = fields.find((item) => item.fieldId === fieldId);
10905
+ return { label: field?.label || fieldId, value: fieldId };
10906
+ }),
10907
+ onChange: setLockFieldIds
10492
10908
  }
10493
- ]
10494
- },
10495
- children: /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(ImportOutlined, {}), children: "\u5BFC\u5165" })
10496
- }
10497
- ),
10498
- /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(ReloadOutlined3, {}), onClick: () => loadData({ current, pageSize }) })
10499
- ] })
10500
- ] }),
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: [
10508
- !readonly && /* @__PURE__ */ jsx89(Button15, { icon: /* @__PURE__ */ jsx89(SwapOutlined2, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
10509
- !readonly && /* @__PURE__ */ jsx89(
10510
- Button15,
10511
- {
10512
- danger: true,
10513
- icon: /* @__PURE__ */ jsx89(DeleteOutlined, {}),
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
- ),
10519
- children: "\u6279\u91CF\u5220\u9664"
10520
- }
10521
- ),
10522
- /* @__PURE__ */ jsx89(Button15, { type: "link", onClick: () => setSelectedRowKeys([]), children: "\u53D6\u6D88\u9009\u62E9" })
10523
- ] })
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
- });
10909
+ )
10910
+ ] }),
10911
+ /* @__PURE__ */ jsx89(Divider, { className: "my-1" }),
10912
+ /* @__PURE__ */ jsxs41("div", { children: [
10913
+ /* @__PURE__ */ jsxs41("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
10914
+ /* @__PURE__ */ jsx89("span", { className: "text-sm font-medium text-ant-color-text", children: "\u6392\u5E8F\u89C4\u5219" }),
10915
+ /* @__PURE__ */ jsx89(Button15, { size: "small", onClick: handleAddSort, disabled: fields.length === 0, children: "\u6DFB\u52A0\u6392\u5E8F" })
10916
+ ] }),
10917
+ /* @__PURE__ */ jsx89("div", { className: "space-y-2", children: sort.length === 0 ? /* @__PURE__ */ jsx89("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__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
10918
+ /* @__PURE__ */ jsx89(
10919
+ Select6,
10920
+ {
10921
+ className: "min-w-0 flex-1",
10922
+ value: item.id,
10923
+ options: fields.map((field) => ({
10924
+ label: field.label,
10925
+ value: field.fieldId
10926
+ })),
10927
+ onChange: (value) => handleSortChange(index, { id: value })
10928
+ }
10929
+ ),
10930
+ /* @__PURE__ */ jsx89(
10931
+ Segmented,
10932
+ {
10933
+ value: item.isAsc,
10934
+ options: [
10935
+ { label: "\u5347\u5E8F", value: "y" },
10936
+ { label: "\u964D\u5E8F", value: "n" }
10937
+ ],
10938
+ onChange: (value) => handleSortChange(index, { isAsc: value })
10939
+ }
10940
+ ),
10941
+ /* @__PURE__ */ jsx89(
10942
+ Button15,
10943
+ {
10944
+ danger: true,
10945
+ type: "text",
10946
+ icon: /* @__PURE__ */ jsx89(DeleteOutlined, {}),
10947
+ onClick: () => handleRemoveSort(index)
10948
+ }
10949
+ )
10950
+ ] }, `${item.id}_${index}`)) })
10951
+ ] }),
10952
+ /* @__PURE__ */ jsxs41("div", { className: "grid gap-4 md:grid-cols-3", children: [
10953
+ /* @__PURE__ */ jsxs41("div", { children: [
10954
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8868\u683C\u5BC6\u5EA6" }),
10955
+ /* @__PURE__ */ jsx89(
10956
+ Segmented,
10957
+ {
10958
+ block: true,
10959
+ value: density,
10960
+ options: [
10961
+ { label: "\u7D27\u51D1", value: "compact" },
10962
+ { label: "\u6807\u51C6", value: "middle" },
10963
+ { label: "\u5BBD\u677E", value: "loose" }
10964
+ ],
10965
+ onChange: (value) => setDensity(value)
10966
+ }
10967
+ )
10968
+ ] }),
10969
+ /* @__PURE__ */ jsxs41("div", { children: [
10970
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8BE6\u60C5\u6253\u5F00\u65B9\u5F0F" }),
10971
+ /* @__PURE__ */ jsx89(
10972
+ Segmented,
10973
+ {
10974
+ block: true,
10975
+ value: detailOpenMode,
10976
+ options: detailPageUrlBuilder ? [
10977
+ { label: "\u62BD\u5C49", value: "drawer" },
10978
+ { label: "\u65B0\u9875", value: "newPage" }
10979
+ ] : [{ label: "\u62BD\u5C49", value: "drawer" }],
10980
+ onChange: (value) => setDetailOpenMode(value)
10981
+ }
10982
+ )
10983
+ ] }),
10984
+ /* @__PURE__ */ jsxs41("div", { children: [
10985
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u9875\u5927\u5C0F" }),
10986
+ /* @__PURE__ */ jsx89(
10987
+ Select6,
10988
+ {
10989
+ className: "w-full",
10990
+ value: pageSize,
10991
+ options: [10, 20, 50, 100].map((value) => ({ label: `${value} \u6761`, value })),
10992
+ onChange: setPageSize
10993
+ }
10994
+ )
10995
+ ] })
10996
+ ] })
10997
+ ] })
10561
10998
  }
10562
- }
10563
- ) })
10564
- ] }),
10565
- /* @__PURE__ */ jsx89(
10566
- Modal8,
10567
- {
10568
- getContainer: false,
10569
- title: "\u9AD8\u7EA7\u7B5B\u9009",
10570
- open: filterOpen,
10571
- width: 760,
10572
- onCancel: () => setFilterOpen(false),
10573
- onOk: () => {
10574
- setFilterOpen(false);
10575
- persistConfig({ filter: { searchKeyWord, group: filterGroup } });
10576
- loadData({ current: 1, pageSize, searchKeyWord, filterGroup });
10577
- },
10578
- okText: "\u5E94\u7528\u7B5B\u9009",
10579
- children: /* @__PURE__ */ jsx89(FilterGroupEditor, { group: filterGroup, fields, onChange: setFilterGroup })
10580
- }
10581
- ),
10582
- /* @__PURE__ */ jsx89(
10583
- Modal8,
10584
- {
10585
- getContainer: false,
10586
- title: "\u5217\u8BBE\u7F6E",
10587
- open: columnOpen,
10588
- width: 720,
10589
- onCancel: () => setColumnOpen(false),
10590
- onOk: handleColumnCommit,
10591
- children: /* @__PURE__ */ jsxs41("div", { className: "space-y-5", children: [
10592
- /* @__PURE__ */ jsxs41("div", { children: [
10593
- /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u663E\u793A\u5217" }),
10594
- /* @__PURE__ */ jsx89(
10999
+ ),
11000
+ /* @__PURE__ */ jsx89(
11001
+ Modal8,
11002
+ {
11003
+ getContainer: false,
11004
+ title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
11005
+ open: exportOpen,
11006
+ onCancel: () => setExportOpen(false),
11007
+ footer: /* @__PURE__ */ jsxs41(Space9, { children: [
11008
+ /* @__PURE__ */ jsx89(Button15, { onClick: () => setExportOpen(false), children: "\u53D6\u6D88" }),
11009
+ /* @__PURE__ */ jsx89(
11010
+ Button15,
11011
+ {
11012
+ type: "primary",
11013
+ loading: exporting,
11014
+ disabled: exportScope === "selected" && selectedRowKeys.length === 0,
11015
+ onClick: () => handleExport(exportScope),
11016
+ children: exportScope === "selected" ? `\u5BFC\u51FA\u9009\u4E2D (${selectedRowKeys.length})` : "\u5BFC\u51FA\u5168\u90E8"
11017
+ }
11018
+ )
11019
+ ] }),
11020
+ children: /* @__PURE__ */ jsx89(
10595
11021
  Checkbox5.Group,
10596
11022
  {
10597
- className: "grid grid-cols-2 gap-2 md:grid-cols-3",
10598
- value: showFields,
11023
+ className: "grid grid-cols-2 gap-2",
11024
+ value: exportFields,
10599
11025
  options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
10600
- onChange: (values) => setShowFields(values.map(String))
10601
- }
10602
- )
10603
- ] }),
10604
- /* @__PURE__ */ jsxs41("div", { children: [
10605
- /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u51BB\u7ED3\u5217" }),
10606
- /* @__PURE__ */ jsx89(
10607
- Select6,
10608
- {
10609
- mode: "multiple",
10610
- className: "w-full",
10611
- value: lockFieldIds,
10612
- options: showFields.map((fieldId) => {
10613
- const field = fields.find((item) => item.fieldId === fieldId);
10614
- return { label: field?.label || fieldId, value: fieldId };
10615
- }),
10616
- onChange: setLockFieldIds
11026
+ onChange: (values) => setExportFields(values.map(String))
10617
11027
  }
10618
11028
  )
10619
- ] }),
10620
- /* @__PURE__ */ jsxs41("div", { className: "grid gap-4 md:grid-cols-3", children: [
10621
- /* @__PURE__ */ jsxs41("div", { children: [
10622
- /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8868\u683C\u5BC6\u5EA6" }),
11029
+ }
11030
+ ),
11031
+ /* @__PURE__ */ jsx89(
11032
+ Modal8,
11033
+ {
11034
+ getContainer: false,
11035
+ title: "\u6279\u91CF\u5BA1\u6279",
11036
+ open: batchApprovalOpen,
11037
+ onCancel: () => setBatchApprovalOpen(false),
11038
+ onOk: handleBatchApprovalConfirm,
11039
+ okText: batchApprovalAction === "approved" ? "\u786E\u8BA4\u901A\u8FC7" : "\u786E\u8BA4\u62D2\u7EDD",
11040
+ confirmLoading: batchApproving,
11041
+ children: /* @__PURE__ */ jsxs41("div", { className: "space-y-4", children: [
11042
+ /* @__PURE__ */ jsxs41("div", { className: "text-sm text-ant-color-text-secondary", children: [
11043
+ "\u5DF2\u9009\u62E9 ",
11044
+ selectedRowKeys.length,
11045
+ " \u6761\u8BB0\u5F55"
11046
+ ] }),
10623
11047
  /* @__PURE__ */ jsx89(
10624
11048
  Segmented,
10625
11049
  {
10626
11050
  block: true,
10627
- value: density,
11051
+ value: batchApprovalAction,
10628
11052
  options: [
10629
- { label: "\u7D27\u51D1", value: "compact" },
10630
- { label: "\u6807\u51C6", value: "middle" },
10631
- { label: "\u5BBD\u677E", value: "loose" }
11053
+ { label: "\u540C\u610F", value: "approved" },
11054
+ { label: "\u62D2\u7EDD", value: "rejected" }
10632
11055
  ],
10633
- onChange: (value) => setDensity(value)
11056
+ onChange: (value) => setBatchApprovalAction(value)
11057
+ }
11058
+ ),
11059
+ /* @__PURE__ */ jsx89(
11060
+ Input12.TextArea,
11061
+ {
11062
+ value: batchApprovalComments,
11063
+ rows: 4,
11064
+ maxLength: 500,
11065
+ showCount: true,
11066
+ placeholder: "\u586B\u5199\u5BA1\u6279\u610F\u89C1",
11067
+ onChange: (event) => setBatchApprovalComments(event.target.value)
10634
11068
  }
10635
11069
  )
10636
- ] }),
10637
- /* @__PURE__ */ jsxs41("div", { children: [
10638
- /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u8BE6\u60C5\u6253\u5F00\u65B9\u5F0F" }),
11070
+ ] })
11071
+ }
11072
+ ),
11073
+ /* @__PURE__ */ jsxs41(
11074
+ Modal8,
11075
+ {
11076
+ getContainer: false,
11077
+ title: "\u5BFC\u5165\u6570\u636E",
11078
+ open: importOpen,
11079
+ width: 720,
11080
+ onCancel: () => setImportOpen(false),
11081
+ onOk: handleImportConfirm,
11082
+ okButtonProps: { disabled: !importBase64 },
11083
+ okText: "\u786E\u8BA4\u5BFC\u5165",
11084
+ children: [
11085
+ /* @__PURE__ */ jsx89(
11086
+ Upload3.Dragger,
11087
+ {
11088
+ accept: ".xlsx,.xls",
11089
+ maxCount: 1,
11090
+ beforeUpload: handleImportPreview,
11091
+ onRemove: () => {
11092
+ setImportBase64("");
11093
+ setImportPreview([]);
11094
+ },
11095
+ children: /* @__PURE__ */ jsx89("p", { className: "text-ant-color-text-secondary", children: "\u62D6\u62FD Excel \u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\u6587\u4EF6" })
11096
+ }
11097
+ ),
11098
+ importPreview.length > 0 && /* @__PURE__ */ jsxs41("div", { className: "mt-4", children: [
11099
+ /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5BFC\u5165\u9884\u89C8" }),
11100
+ /* @__PURE__ */ jsx89(
11101
+ Table3,
11102
+ {
11103
+ size: "small",
11104
+ dataSource: importPreview,
11105
+ columns: importPreviewColumns,
11106
+ scroll: { x: Math.max(600, (importPreviewColumns?.length || 0) * 150) },
11107
+ pagination: false,
11108
+ rowKey: (_, index) => String(index)
11109
+ }
11110
+ )
11111
+ ] })
11112
+ ]
11113
+ }
11114
+ ),
11115
+ /* @__PURE__ */ jsxs41(
11116
+ Drawer2,
11117
+ {
11118
+ getContainer: false,
11119
+ rootStyle: { position: "absolute" },
11120
+ styles: { body: { padding: 24, overflow: "auto" } },
11121
+ title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
11122
+ open: recordsOpen,
11123
+ width: 720,
11124
+ onClose: () => setRecordsOpen(false),
11125
+ children: [
10639
11126
  /* @__PURE__ */ jsx89(
10640
11127
  Segmented,
10641
11128
  {
10642
- block: true,
10643
- value: detailOpenMode,
11129
+ value: recordTab,
10644
11130
  options: [
10645
- { label: "\u62BD\u5C49", value: "drawer" },
10646
- { label: "\u65B0\u9875", value: "newPage" }
11131
+ { label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
11132
+ { label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
10647
11133
  ],
10648
- onChange: (value) => setDetailOpenMode(value)
11134
+ onChange: (value) => loadTransferRecords(value)
10649
11135
  }
10650
- )
10651
- ] }),
10652
- /* @__PURE__ */ jsxs41("div", { children: [
10653
- /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u9875\u5927\u5C0F" }),
11136
+ ),
10654
11137
  /* @__PURE__ */ jsx89(
10655
- Select6,
11138
+ Table3,
10656
11139
  {
10657
- className: "w-full",
10658
- value: pageSize,
10659
- options: [10, 20, 50, 100].map((value) => ({ label: `${value} \u6761`, value })),
10660
- onChange: setPageSize
11140
+ className: "mt-4",
11141
+ size: "small",
11142
+ dataSource: transferRecords,
11143
+ rowKey: (record) => record.id || record.recordId
10661
11144
  }
10662
11145
  )
10663
- ] })
10664
- ] })
10665
- ] })
10666
- }
10667
- ),
10668
- /* @__PURE__ */ jsx89(
10669
- Modal8,
10670
- {
10671
- getContainer: false,
10672
- title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
10673
- open: exportOpen,
10674
- onCancel: () => setExportOpen(false),
10675
- footer: /* @__PURE__ */ jsxs41(Space9, { children: [
10676
- /* @__PURE__ */ jsx89(Button15, { onClick: () => setExportOpen(false), children: "\u53D6\u6D88" }),
10677
- /* @__PURE__ */ jsx89(
10678
- Button15,
10679
- {
10680
- type: "primary",
10681
- loading: exporting,
10682
- disabled: exportScope === "selected" && selectedRowKeys.length === 0,
10683
- onClick: () => handleExport(exportScope),
10684
- children: exportScope === "selected" ? `\u5BFC\u51FA\u9009\u4E2D (${selectedRowKeys.length})` : "\u5BFC\u51FA\u5168\u90E8"
10685
- }
10686
- )
10687
- ] }),
10688
- children: /* @__PURE__ */ jsx89(
10689
- Checkbox5.Group,
11146
+ ]
11147
+ }
11148
+ ),
11149
+ /* @__PURE__ */ jsx89(
11150
+ Drawer2,
10690
11151
  {
10691
- className: "grid grid-cols-2 gap-2",
10692
- value: exportFields,
10693
- options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
10694
- onChange: (values) => setExportFields(values.map(String))
11152
+ getContainer: false,
11153
+ rootStyle: { position: "absolute" },
11154
+ styles: { body: { padding: 0, overflow: "auto" } },
11155
+ title: "\u8BE6\u60C5",
11156
+ open: detailOpen,
11157
+ width: 720,
11158
+ onClose: () => setDetailOpen(false),
11159
+ destroyOnClose: true,
11160
+ children: activeRecord && detailRenderer ? detailRenderer({
11161
+ record: activeRecord,
11162
+ formInstanceId: String(getRecordId(activeRecord)),
11163
+ onClose: () => setDetailOpen(false)
11164
+ }) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u8BE6\u60C5\u6A21\u677F" })
10695
11165
  }
10696
- )
10697
- }
10698
- ),
10699
- /* @__PURE__ */ jsx89(
10700
- Modal8,
10701
- {
10702
- getContainer: false,
10703
- title: "\u6279\u91CF\u5BA1\u6279",
10704
- open: batchApprovalOpen,
10705
- onCancel: () => setBatchApprovalOpen(false),
10706
- onOk: handleBatchApprovalConfirm,
10707
- okText: batchApprovalAction === "approved" ? "\u786E\u8BA4\u901A\u8FC7" : "\u786E\u8BA4\u62D2\u7EDD",
10708
- confirmLoading: batchApproving,
10709
- children: /* @__PURE__ */ jsxs41("div", { className: "space-y-4", children: [
10710
- /* @__PURE__ */ jsxs41("div", { className: "text-sm text-ant-color-text-secondary", children: [
10711
- "\u5DF2\u9009\u62E9 ",
10712
- selectedRowKeys.length,
10713
- " \u6761\u8BB0\u5F55"
10714
- ] }),
10715
- /* @__PURE__ */ jsx89(
10716
- Segmented,
10717
- {
10718
- block: true,
10719
- value: batchApprovalAction,
10720
- options: [
10721
- { label: "\u540C\u610F", value: "approved" },
10722
- { label: "\u62D2\u7EDD", value: "rejected" }
10723
- ],
10724
- onChange: (value) => setBatchApprovalAction(value)
10725
- }
10726
- ),
10727
- /* @__PURE__ */ jsx89(
10728
- Input12.TextArea,
10729
- {
10730
- value: batchApprovalComments,
10731
- rows: 4,
10732
- maxLength: 500,
10733
- showCount: true,
10734
- placeholder: "\u586B\u5199\u5BA1\u6279\u610F\u89C1",
10735
- onChange: (event) => setBatchApprovalComments(event.target.value)
10736
- }
10737
- )
10738
- ] })
10739
- }
10740
- ),
10741
- /* @__PURE__ */ jsxs41(
10742
- Modal8,
10743
- {
10744
- getContainer: false,
10745
- title: "\u5BFC\u5165\u6570\u636E",
10746
- open: importOpen,
10747
- width: 720,
10748
- onCancel: () => setImportOpen(false),
10749
- onOk: handleImportConfirm,
10750
- okButtonProps: { disabled: !importBase64 },
10751
- okText: "\u786E\u8BA4\u5BFC\u5165",
10752
- children: [
10753
- /* @__PURE__ */ jsx89(
10754
- Upload3.Dragger,
10755
- {
10756
- accept: ".xlsx,.xls",
10757
- maxCount: 1,
10758
- beforeUpload: handleImportPreview,
10759
- onRemove: () => {
10760
- setImportBase64("");
10761
- setImportPreview([]);
10762
- },
10763
- children: /* @__PURE__ */ jsx89("p", { className: "text-ant-color-text-secondary", children: "\u62D6\u62FD Excel \u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\u6587\u4EF6" })
10764
- }
10765
- ),
10766
- importPreview.length > 0 && /* @__PURE__ */ jsxs41("div", { className: "mt-4", children: [
10767
- /* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5BFC\u5165\u9884\u89C8" }),
10768
- /* @__PURE__ */ jsx89(
10769
- Table3,
10770
- {
10771
- size: "small",
10772
- dataSource: importPreview,
10773
- columns: importPreviewColumns,
10774
- scroll: { x: Math.max(600, (importPreviewColumns?.length || 0) * 150) },
10775
- pagination: false,
10776
- rowKey: (_, index) => String(index)
11166
+ ),
11167
+ /* @__PURE__ */ jsx89(
11168
+ Drawer2,
11169
+ {
11170
+ getContainer: false,
11171
+ rootStyle: { position: "absolute" },
11172
+ styles: { body: { padding: 0, overflow: "auto" } },
11173
+ title: "\u65B0\u589E\u6570\u636E",
11174
+ open: submitOpen,
11175
+ width: 720,
11176
+ onClose: () => setSubmitOpen(false),
11177
+ destroyOnClose: true,
11178
+ children: submitRenderer ? submitRenderer({
11179
+ onClose: () => setSubmitOpen(false),
11180
+ onSubmitted: () => {
11181
+ setSubmitOpen(false);
11182
+ loadData({ current: 1, pageSize });
10777
11183
  }
10778
- )
10779
- ] })
10780
- ]
10781
- }
10782
- ),
10783
- /* @__PURE__ */ jsxs41(
10784
- Drawer2,
10785
- {
10786
- getContainer: false,
10787
- title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
10788
- open: recordsOpen,
10789
- width: 720,
10790
- onClose: () => setRecordsOpen(false),
10791
- children: [
10792
- /* @__PURE__ */ jsx89(
10793
- Segmented,
10794
- {
10795
- value: recordTab,
10796
- options: [
10797
- { label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
10798
- { label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
10799
- ],
10800
- onChange: (value) => loadTransferRecords(value)
10801
- }
10802
- ),
10803
- /* @__PURE__ */ jsx89(
10804
- Table3,
10805
- {
10806
- className: "mt-4",
10807
- size: "small",
10808
- dataSource: transferRecords,
10809
- rowKey: (record) => record.id || record.recordId
10810
- }
10811
- )
10812
- ]
10813
- }
10814
- ),
10815
- /* @__PURE__ */ jsx89(
10816
- Drawer2,
10817
- {
10818
- getContainer: false,
10819
- title: "\u8BE6\u60C5",
10820
- open: detailOpen,
10821
- width: 720,
10822
- onClose: () => setDetailOpen(false),
10823
- destroyOnClose: true,
10824
- children: activeRecord && detailRenderer ? detailRenderer({
10825
- record: activeRecord,
10826
- formInstanceId: String(getRecordId(activeRecord)),
10827
- onClose: () => setDetailOpen(false)
10828
- }) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u8BE6\u60C5\u6A21\u677F" })
10829
- }
10830
- ),
10831
- /* @__PURE__ */ jsx89(
10832
- Drawer2,
10833
- {
10834
- getContainer: false,
10835
- title: "\u65B0\u589E\u6570\u636E",
10836
- open: submitOpen,
10837
- width: 720,
10838
- onClose: () => setSubmitOpen(false),
10839
- destroyOnClose: true,
10840
- children: submitRenderer ? submitRenderer({
10841
- onClose: () => setSubmitOpen(false),
10842
- onSubmitted: () => {
10843
- setSubmitOpen(false);
10844
- loadData({ current: 1, pageSize });
11184
+ }) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
10845
11185
  }
10846
- }) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
10847
- }
10848
- )
10849
- ] }) });
11186
+ )
11187
+ ]
11188
+ }
11189
+ ) });
10850
11190
  };
10851
11191
 
10852
11192
  // src/templates/FormSubmitTemplate.tsx
@@ -11104,52 +11444,66 @@ var InnerFormContent = ({
11104
11444
  actions,
11105
11445
  inDrawer,
11106
11446
  position: "inline",
11107
- className: "mt-6 -mx-5 -mb-5 rounded-b-lg md:-mx-6 md:-mb-6"
11447
+ 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"
11108
11448
  }
11109
11449
  ) : null;
11110
- return /* @__PURE__ */ jsxs42(RuntimePageShell, { inDrawer, children: [
11111
- /* @__PURE__ */ jsxs42("div", { className: "space-y-6", children: [
11112
- header,
11113
- enableDraft && hasDraft && !submitted && /* @__PURE__ */ jsx90("div", { children: /* @__PURE__ */ jsx90(
11114
- DraftManager,
11115
- {
11116
- hasDraft,
11117
- draftTimestamp,
11118
- onRestore: handleRestoreDraft,
11119
- onDiscard: clearDraft
11120
- }
11121
- ) }),
11122
- !submitted ? /* @__PURE__ */ jsxs42("div", { className: "rounded-lg border border-ant-border-secondary bg-ant-bg-container p-5 md:p-6", children: [
11123
- departmentSelector,
11124
- beforeForm,
11125
- renderForm ? renderForm({ schema, config }) : /* @__PURE__ */ jsx90(FormRenderer, { columns: 2 }),
11126
- afterForm,
11127
- actionsNode
11128
- ] }) : successInfo && /* @__PURE__ */ jsx90(
11129
- SubmitSuccessCard,
11130
- {
11131
- info: successInfo,
11132
- mode: submitSuccessMode,
11133
- isRedirecting,
11134
- countdown,
11135
- onContinue: handleContinue,
11136
- onViewDetail: handleViewDetail,
11137
- renderSuccess
11138
- }
11139
- ),
11140
- footer
11141
- ] }),
11142
- /* @__PURE__ */ jsx90(
11143
- ProcessPreview,
11144
- {
11145
- open: previewOpen,
11146
- routes: previewRoutes,
11147
- loading: previewLoading,
11148
- onClose: () => setPreviewOpen(false),
11149
- onConfirm: handlePreviewConfirm
11150
- }
11151
- )
11152
- ] });
11450
+ return /* @__PURE__ */ jsxs42(
11451
+ RuntimePageShell,
11452
+ {
11453
+ inDrawer,
11454
+ maxWidth: inDrawer ? "100%" : 1240,
11455
+ contentClassName: inDrawer ? "px-4 py-4 md:px-5" : "py-4 md:py-6",
11456
+ children: [
11457
+ /* @__PURE__ */ jsxs42("div", { className: "space-y-6", children: [
11458
+ header,
11459
+ enableDraft && hasDraft && !submitted && /* @__PURE__ */ jsx90("div", { children: /* @__PURE__ */ jsx90(
11460
+ DraftManager,
11461
+ {
11462
+ hasDraft,
11463
+ draftTimestamp,
11464
+ onRestore: handleRestoreDraft,
11465
+ onDiscard: clearDraft
11466
+ }
11467
+ ) }),
11468
+ !submitted ? /* @__PURE__ */ jsxs42(
11469
+ "div",
11470
+ {
11471
+ 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"}`,
11472
+ children: [
11473
+ departmentSelector,
11474
+ beforeForm,
11475
+ renderForm ? renderForm({ schema, config }) : /* @__PURE__ */ jsx90(FormRenderer, { columns: 2 }),
11476
+ afterForm,
11477
+ actionsNode
11478
+ ]
11479
+ }
11480
+ ) : successInfo && /* @__PURE__ */ jsx90(
11481
+ SubmitSuccessCard,
11482
+ {
11483
+ info: successInfo,
11484
+ mode: submitSuccessMode,
11485
+ isRedirecting,
11486
+ countdown,
11487
+ onContinue: handleContinue,
11488
+ onViewDetail: handleViewDetail,
11489
+ renderSuccess
11490
+ }
11491
+ ),
11492
+ footer
11493
+ ] }),
11494
+ /* @__PURE__ */ jsx90(
11495
+ ProcessPreview,
11496
+ {
11497
+ open: previewOpen,
11498
+ routes: previewRoutes,
11499
+ loading: previewLoading,
11500
+ onClose: () => setPreviewOpen(false),
11501
+ onConfirm: handlePreviewConfirm
11502
+ }
11503
+ )
11504
+ ]
11505
+ }
11506
+ );
11153
11507
  };
11154
11508
  var FormSubmitTemplate = ({
11155
11509
  schema,
@@ -11196,6 +11550,7 @@ var FormSubmitTemplate = ({
11196
11550
 
11197
11551
  // src/templates/FormDetailTemplate.tsx
11198
11552
  import { useCallback as useCallback19, useMemo as useMemo19, useRef as useRef15, useState as useState37 } from "react";
11553
+ import dayjs6 from "dayjs";
11199
11554
 
11200
11555
  // src/templates/PageSkeleton.tsx
11201
11556
  import { Skeleton as Skeleton3 } from "antd";
@@ -11267,6 +11622,11 @@ function FormDataBridge({
11267
11622
  formDataRef.current = getFormData2;
11268
11623
  return null;
11269
11624
  }
11625
+ var formatDateTime2 = (value) => {
11626
+ if (!value || typeof value !== "string") return value || "-";
11627
+ const parsed = dayjs6(value);
11628
+ return parsed.isValid() ? parsed.format("YYYY-MM-DD HH:mm:ss") : value;
11629
+ };
11270
11630
  var InnerDetailContent = ({
11271
11631
  schema,
11272
11632
  formUuid,
@@ -11377,14 +11737,36 @@ var InnerDetailContent = ({
11377
11737
  renderSummary && instanceInfo ? renderSummary(instanceInfo) : /* @__PURE__ */ jsx92(
11378
11738
  SummaryPanel,
11379
11739
  {
11380
- title: instanceInfo?.title || formData?.instanceTitle || schema.formMeta.title,
11740
+ title: instanceInfo?.title || instanceInfo?.instanceTitle || schema.formMeta.title,
11381
11741
  eyebrow: `\u6570\u636E\u5B9E\u4F8B ${formInstanceId?.slice(0, 8) || "-"}`,
11382
- creator: instanceInfo?.creator ? {
11383
- name: instanceInfo.creator.name,
11384
- avatar: instanceInfo.creator.avatar,
11385
- department: instanceInfo.creator.department
11742
+ creator: instanceInfo?.creator || instanceInfo?.createdByName ? {
11743
+ name: instanceInfo?.creator?.name || instanceInfo?.createdByName,
11744
+ avatar: instanceInfo?.creator?.avatar,
11745
+ department: instanceInfo?.creator?.department || instanceInfo?.createdByDepartmentName
11386
11746
  } : void 0,
11387
- createdAt: instanceInfo?.createdAt,
11747
+ createdAt: formatDateTime2(instanceInfo?.createdAt),
11748
+ metaItems: [
11749
+ {
11750
+ key: "creator",
11751
+ label: "\u521B\u5EFA\u4EBA",
11752
+ value: instanceInfo?.creator?.name || instanceInfo?.createdByName || "\u672A\u77E5\u7528\u6237"
11753
+ },
11754
+ {
11755
+ key: "department",
11756
+ label: "\u521B\u5EFA\u4EBA\u90E8\u95E8",
11757
+ value: instanceInfo?.creator?.department || instanceInfo?.createdByDepartmentName || "-"
11758
+ },
11759
+ {
11760
+ key: "createdAt",
11761
+ label: "\u521B\u5EFA\u65F6\u95F4",
11762
+ value: formatDateTime2(instanceInfo?.createdAt)
11763
+ },
11764
+ {
11765
+ key: "updatedAt",
11766
+ label: "\u66F4\u65B0\u65F6\u95F4",
11767
+ value: formatDateTime2(instanceInfo?.updatedAt)
11768
+ }
11769
+ ],
11388
11770
  status: mode === "edit" ? { label: "\u7F16\u8F91\u4E2D", tone: "brand" } : void 0
11389
11771
  }
11390
11772
  ),