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.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +966 -542
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +978 -551
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
-
"
|
|
6805
|
-
{ label: "\
|
|
6835
|
+
"instanceTitle",
|
|
6836
|
+
{ label: "\u5B9E\u4F8B\u6807\u9898", componentName: "TextField", width: 220, displayable: true },
|
|
6806
6837
|
true
|
|
6807
6838
|
),
|
|
6808
6839
|
normalizeField(
|
|
6809
|
-
"
|
|
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
|
|
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(
|
|
7744
|
+
setInstanceInfo(normalizedInfo);
|
|
7607
7745
|
setFormData(extractFormValues(formResult, fieldIds));
|
|
7608
7746
|
} catch (error) {
|
|
7609
7747
|
console.error("[useFormDetail] Failed to load data:", error);
|
|
@@ -8081,6 +8219,16 @@ function useApprovalActions(options) {
|
|
|
8081
8219
|
|
|
8082
8220
|
// src/hooks/useChangeRecords.ts
|
|
8083
8221
|
import { useState as useState27, useEffect as useEffect32, useCallback as useCallback14, useRef as useRef12 } from "react";
|
|
8222
|
+
var normalizeChangeRecordList = (value) => {
|
|
8223
|
+
const body = value?.data ?? value?.result ?? value ?? {};
|
|
8224
|
+
const records = body.records ?? body.data ?? body.list ?? body.items ?? [];
|
|
8225
|
+
return {
|
|
8226
|
+
records: Array.isArray(records) ? records : [],
|
|
8227
|
+
total: Number(body.total ?? body.totalCount ?? body.count ?? records.length) || 0,
|
|
8228
|
+
page: Number(body.page ?? body.currentPage ?? 1) || 1,
|
|
8229
|
+
pageSize: Number(body.pageSize ?? body.limit ?? 20) || 20
|
|
8230
|
+
};
|
|
8231
|
+
};
|
|
8084
8232
|
function useChangeRecords(options) {
|
|
8085
8233
|
const { formUuid, appType, formInstanceId, pageSize = 20, autoLoad = true } = options;
|
|
8086
8234
|
const { api } = useFormContext();
|
|
@@ -8109,13 +8257,14 @@ function useChangeRecords(options) {
|
|
|
8109
8257
|
pageSize
|
|
8110
8258
|
});
|
|
8111
8259
|
if (!mountedRef.current) return;
|
|
8260
|
+
const normalized = normalizeChangeRecordList(result);
|
|
8112
8261
|
if (append) {
|
|
8113
|
-
setRecords((prev) => [...prev, ...
|
|
8262
|
+
setRecords((prev) => [...prev, ...normalized.records]);
|
|
8114
8263
|
} else {
|
|
8115
|
-
setRecords(
|
|
8264
|
+
setRecords(normalized.records);
|
|
8116
8265
|
}
|
|
8117
|
-
setTotal(
|
|
8118
|
-
setPage(pageNum);
|
|
8266
|
+
setTotal(normalized.total);
|
|
8267
|
+
setPage(normalized.page || pageNum);
|
|
8119
8268
|
} catch (error) {
|
|
8120
8269
|
console.error("[useChangeRecords] Failed to load change records:", error);
|
|
8121
8270
|
} finally {
|
|
@@ -8131,7 +8280,8 @@ function useChangeRecords(options) {
|
|
|
8131
8280
|
fetchRecords(1, false);
|
|
8132
8281
|
}
|
|
8133
8282
|
}, [autoLoad, fetchRecords]);
|
|
8134
|
-
const
|
|
8283
|
+
const safeRecords = Array.isArray(records) ? records : [];
|
|
8284
|
+
const hasMore = safeRecords.length < total;
|
|
8135
8285
|
const loadMore = useCallback14(async () => {
|
|
8136
8286
|
if (!hasMore || loading) return;
|
|
8137
8287
|
await fetchRecords(page + 1, true);
|
|
@@ -8143,7 +8293,7 @@ function useChangeRecords(options) {
|
|
|
8143
8293
|
await fetchRecords(1, false);
|
|
8144
8294
|
}, [fetchRecords]);
|
|
8145
8295
|
return {
|
|
8146
|
-
records,
|
|
8296
|
+
records: safeRecords,
|
|
8147
8297
|
loading,
|
|
8148
8298
|
total,
|
|
8149
8299
|
page,
|
|
@@ -8922,7 +9072,7 @@ var ApprovalTimeline = ({
|
|
|
8922
9072
|
|
|
8923
9073
|
// src/modules/ApprovalActionBar.tsx
|
|
8924
9074
|
import { useMemo as useMemo16, useState as useState32 } from "react";
|
|
8925
|
-
import { Form, Input as Input10, Modal as
|
|
9075
|
+
import { Form, Input as Input10, Modal as Modal5, Select as Select5 } from "antd";
|
|
8926
9076
|
import {
|
|
8927
9077
|
CheckOutlined,
|
|
8928
9078
|
CloseOutlined,
|
|
@@ -8933,8 +9083,23 @@ import {
|
|
|
8933
9083
|
|
|
8934
9084
|
// src/modules/StickyActionBar.tsx
|
|
8935
9085
|
import { useEffect as useEffect35, useMemo as useMemo15, useState as useState31 } from "react";
|
|
8936
|
-
import { Button as Button10, Dropdown
|
|
9086
|
+
import { Button as Button10, Dropdown } from "antd";
|
|
8937
9087
|
import { MoreOutlined } from "@ant-design/icons";
|
|
9088
|
+
|
|
9089
|
+
// src/utils/confirmAction.ts
|
|
9090
|
+
var confirmAction = (title, content) => {
|
|
9091
|
+
const message2 = [title, content].filter(Boolean).join("\n") || "\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F";
|
|
9092
|
+
if (typeof window === "undefined" || typeof window.confirm !== "function") {
|
|
9093
|
+
return true;
|
|
9094
|
+
}
|
|
9095
|
+
try {
|
|
9096
|
+
return window.confirm(message2);
|
|
9097
|
+
} catch {
|
|
9098
|
+
return true;
|
|
9099
|
+
}
|
|
9100
|
+
};
|
|
9101
|
+
|
|
9102
|
+
// src/modules/StickyActionBar.tsx
|
|
8938
9103
|
import { Fragment as Fragment2, jsx as jsx81, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8939
9104
|
var getActionPriority = (action) => {
|
|
8940
9105
|
const maybePriority = action.priority;
|
|
@@ -8949,8 +9114,8 @@ var StickyActionBar = ({
|
|
|
8949
9114
|
className = "",
|
|
8950
9115
|
maxMobileButtons = 2,
|
|
8951
9116
|
layoutMode = "default",
|
|
8952
|
-
|
|
8953
|
-
|
|
9117
|
+
maxWidth = 1120,
|
|
9118
|
+
position = "sticky"
|
|
8954
9119
|
}) => {
|
|
8955
9120
|
const [isMobile, setIsMobile] = useState31(false);
|
|
8956
9121
|
useEffect35(() => {
|
|
@@ -8969,6 +9134,14 @@ var StickyActionBar = ({
|
|
|
8969
9134
|
const moreMobile = visibleActions.slice(maxMobileButtons);
|
|
8970
9135
|
const leftActions = visibleActions.filter((action) => getPlacement(action) === "left");
|
|
8971
9136
|
const rightActions = visibleActions.filter((action) => getPlacement(action) !== "left");
|
|
9137
|
+
const positionClass = position === "fixed" ? "fixed bottom-0 left-0 right-0" : position === "inline" ? "relative" : "sticky bottom-0";
|
|
9138
|
+
const runAction = (action) => {
|
|
9139
|
+
if (action.confirm) {
|
|
9140
|
+
const confirmed = confirmAction(action.confirm.title, action.confirm.content);
|
|
9141
|
+
if (!confirmed) return;
|
|
9142
|
+
}
|
|
9143
|
+
action.onClick();
|
|
9144
|
+
};
|
|
8972
9145
|
const renderButton = (action, mobile = false) => /* @__PURE__ */ jsx81(
|
|
8973
9146
|
Button10,
|
|
8974
9147
|
{
|
|
@@ -8977,19 +9150,7 @@ var StickyActionBar = ({
|
|
|
8977
9150
|
loading: action.loading,
|
|
8978
9151
|
disabled: action.disabled,
|
|
8979
9152
|
icon: action.icon,
|
|
8980
|
-
onClick: () =>
|
|
8981
|
-
if (action.confirm) {
|
|
8982
|
-
Modal5.confirm({
|
|
8983
|
-
title: action.confirm.title,
|
|
8984
|
-
content: action.confirm.content,
|
|
8985
|
-
okText: action.confirm.okText || "\u786E\u8BA4",
|
|
8986
|
-
cancelText: action.confirm.cancelText || "\u53D6\u6D88",
|
|
8987
|
-
onOk: action.onClick
|
|
8988
|
-
});
|
|
8989
|
-
return;
|
|
8990
|
-
}
|
|
8991
|
-
action.onClick();
|
|
8992
|
-
},
|
|
9153
|
+
onClick: () => runAction(action),
|
|
8993
9154
|
className: `${mobile ? "min-w-0 flex-1" : "min-w-[88px]"} rounded-md`,
|
|
8994
9155
|
children: action.label
|
|
8995
9156
|
},
|
|
@@ -8998,7 +9159,7 @@ var StickyActionBar = ({
|
|
|
8998
9159
|
return /* @__PURE__ */ jsx81(
|
|
8999
9160
|
"div",
|
|
9000
9161
|
{
|
|
9001
|
-
className:
|
|
9162
|
+
className: `${positionClass} z-20 border-t border-ant-border-secondary bg-ant-bg-container/95 px-4 py-3 shadow-[0_-8px_24px_rgba(15,23,42,0.06)] backdrop-blur supports-[padding:max(0px)]:pb-[max(0.75rem,env(safe-area-inset-bottom))] ${className}`,
|
|
9002
9163
|
children: /* @__PURE__ */ jsx81(
|
|
9003
9164
|
"div",
|
|
9004
9165
|
{
|
|
@@ -9018,19 +9179,7 @@ var StickyActionBar = ({
|
|
|
9018
9179
|
danger: action.type === "danger",
|
|
9019
9180
|
disabled: action.disabled,
|
|
9020
9181
|
icon: action.icon,
|
|
9021
|
-
onClick: () =>
|
|
9022
|
-
if (action.confirm) {
|
|
9023
|
-
Modal5.confirm({
|
|
9024
|
-
title: action.confirm.title,
|
|
9025
|
-
content: action.confirm.content,
|
|
9026
|
-
okText: action.confirm.okText || "\u786E\u8BA4",
|
|
9027
|
-
cancelText: action.confirm.cancelText || "\u53D6\u6D88",
|
|
9028
|
-
onOk: action.onClick
|
|
9029
|
-
});
|
|
9030
|
-
return;
|
|
9031
|
-
}
|
|
9032
|
-
action.onClick();
|
|
9033
|
-
}
|
|
9182
|
+
onClick: () => runAction(action)
|
|
9034
9183
|
}))
|
|
9035
9184
|
},
|
|
9036
9185
|
children: /* @__PURE__ */ jsx81(Button10, { icon: /* @__PURE__ */ jsx81(MoreOutlined, {}), className: "rounded-md", children: "\u66F4\u591A" })
|
|
@@ -9195,8 +9344,9 @@ var ApprovalActionBar = ({
|
|
|
9195
9344
|
}
|
|
9196
9345
|
),
|
|
9197
9346
|
/* @__PURE__ */ jsx82(
|
|
9198
|
-
|
|
9347
|
+
Modal5,
|
|
9199
9348
|
{
|
|
9349
|
+
getContainer: false,
|
|
9200
9350
|
title: getModalTitle(modalAction),
|
|
9201
9351
|
open: modalAction !== null,
|
|
9202
9352
|
okText: "\u786E\u8BA4",
|
|
@@ -9232,6 +9382,7 @@ var ApprovalActionBar = ({
|
|
|
9232
9382
|
Select5,
|
|
9233
9383
|
{
|
|
9234
9384
|
placeholder: "\u8BF7\u9009\u62E9\u9000\u56DE\u8282\u70B9",
|
|
9385
|
+
getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
|
|
9235
9386
|
options: returnableNodes.map((node) => ({
|
|
9236
9387
|
value: node.nodeId || node.id || "",
|
|
9237
9388
|
label: renderReturnNodeLabel ? renderReturnNodeLabel(node) : node.nodeName || node.name || node.nodeId || node.id
|
|
@@ -9258,7 +9409,7 @@ var ApprovalActionBar = ({
|
|
|
9258
9409
|
|
|
9259
9410
|
// src/modules/ApprovalActions.tsx
|
|
9260
9411
|
import { useMemo as useMemo17, useState as useState33 } from "react";
|
|
9261
|
-
import { Button as Button11, Dropdown as Dropdown2, Form as Form2, Input as Input11, Modal as
|
|
9412
|
+
import { Button as Button11, Dropdown as Dropdown2, Form as Form2, Input as Input11, Modal as Modal6 } from "antd";
|
|
9262
9413
|
import { MoreOutlined as MoreOutlined2 } from "@ant-design/icons";
|
|
9263
9414
|
import { Fragment as Fragment4, jsx as jsx83, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9264
9415
|
var priority = {
|
|
@@ -9368,6 +9519,7 @@ var ApprovalActions = ({
|
|
|
9368
9519
|
Dropdown2,
|
|
9369
9520
|
{
|
|
9370
9521
|
trigger: ["click"],
|
|
9522
|
+
getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
|
|
9371
9523
|
menu: {
|
|
9372
9524
|
items: moreButtons.map((action) => ({
|
|
9373
9525
|
key: action.action,
|
|
@@ -9383,8 +9535,9 @@ var ApprovalActions = ({
|
|
|
9383
9535
|
}
|
|
9384
9536
|
),
|
|
9385
9537
|
/* @__PURE__ */ jsx83(
|
|
9386
|
-
|
|
9538
|
+
Modal6,
|
|
9387
9539
|
{
|
|
9540
|
+
getContainer: false,
|
|
9388
9541
|
title,
|
|
9389
9542
|
open: modalAction !== null,
|
|
9390
9543
|
okText: "\u786E\u8BA4",
|
|
@@ -9418,7 +9571,7 @@ var ApprovalActions = ({
|
|
|
9418
9571
|
|
|
9419
9572
|
// src/modules/FormActionBar.tsx
|
|
9420
9573
|
import { useState as useState34 } from "react";
|
|
9421
|
-
import { Button as Button12
|
|
9574
|
+
import { Button as Button12 } from "antd";
|
|
9422
9575
|
import { Fragment as Fragment5, jsx as jsx84, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
9423
9576
|
var FormActionBar = ({
|
|
9424
9577
|
actions,
|
|
@@ -9436,15 +9589,9 @@ var FormActionBar = ({
|
|
|
9436
9589
|
});
|
|
9437
9590
|
const handleClick = async (action) => {
|
|
9438
9591
|
if (action.confirm) {
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
okText: "\u786E\u8BA4",
|
|
9443
|
-
cancelText: "\u53D6\u6D88",
|
|
9444
|
-
onOk: async () => {
|
|
9445
|
-
await executeAction(action);
|
|
9446
|
-
}
|
|
9447
|
-
});
|
|
9592
|
+
const confirmed = confirmAction(action.confirm.title, action.confirm.content);
|
|
9593
|
+
if (!confirmed) return;
|
|
9594
|
+
await executeAction(action);
|
|
9448
9595
|
} else {
|
|
9449
9596
|
await executeAction(action);
|
|
9450
9597
|
}
|
|
@@ -9526,11 +9673,11 @@ var RuntimePageShell = ({
|
|
|
9526
9673
|
}
|
|
9527
9674
|
return children;
|
|
9528
9675
|
};
|
|
9529
|
-
return /* @__PURE__ */ jsxs37("div", { className: `sy-runtime-page min-h-
|
|
9676
|
+
return /* @__PURE__ */ jsxs37("div", { className: `sy-runtime-page min-h-full bg-ant-bg-layout text-ant-text ${className}`, children: [
|
|
9530
9677
|
/* @__PURE__ */ jsx85(
|
|
9531
9678
|
"div",
|
|
9532
9679
|
{
|
|
9533
|
-
className: `sy-runtime-page__content mx-auto w-full px-4 py-6 pb-
|
|
9680
|
+
className: `sy-runtime-page__content mx-auto w-full px-4 py-6 pb-8 md:px-6 ${inDrawer ? "py-4 md:px-4" : ""} ${contentClassName}`,
|
|
9534
9681
|
style: { maxWidth: maxWidthStyle },
|
|
9535
9682
|
children: renderState()
|
|
9536
9683
|
}
|
|
@@ -9600,8 +9747,8 @@ var SummaryPanel = ({
|
|
|
9600
9747
|
)
|
|
9601
9748
|
] }),
|
|
9602
9749
|
/* @__PURE__ */ jsx86("h1", { className: "m-0 break-words text-2xl font-semibold leading-9 text-ant-text md:text-[28px]", children: title }),
|
|
9603
|
-
items.length > 0 && /* @__PURE__ */ jsx86("div", { className: "mt-5 grid grid-cols-1 gap-4 md:grid-cols-
|
|
9604
|
-
/* @__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 }),
|
|
9605
9752
|
/* @__PURE__ */ jsxs38("span", { className: "min-w-0", children: [
|
|
9606
9753
|
/* @__PURE__ */ jsx86("span", { className: "block text-xs leading-5 text-ant-text-tertiary", children: item.label }),
|
|
9607
9754
|
/* @__PURE__ */ jsx86("span", { className: "block break-words text-sm font-medium leading-6 text-ant-text", children: item.value || "-" })
|
|
@@ -9663,7 +9810,7 @@ var DraftManager = ({
|
|
|
9663
9810
|
};
|
|
9664
9811
|
|
|
9665
9812
|
// src/modules/ProcessPreview.tsx
|
|
9666
|
-
import { Modal as
|
|
9813
|
+
import { Modal as Modal7, Skeleton as Skeleton2, Button as Button14 } from "antd";
|
|
9667
9814
|
import { CheckCircleOutlined, UserOutlined as UserOutlined3 } from "@ant-design/icons";
|
|
9668
9815
|
import { jsx as jsx88, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9669
9816
|
var ProcessPreview = ({
|
|
@@ -9673,9 +9820,11 @@ var ProcessPreview = ({
|
|
|
9673
9820
|
routes,
|
|
9674
9821
|
loading = false
|
|
9675
9822
|
}) => {
|
|
9823
|
+
const routeList = Array.isArray(routes) ? routes : [];
|
|
9676
9824
|
return /* @__PURE__ */ jsx88(
|
|
9677
|
-
|
|
9825
|
+
Modal7,
|
|
9678
9826
|
{
|
|
9827
|
+
getContainer: false,
|
|
9679
9828
|
title: "\u6D41\u7A0B\u9884\u89C8",
|
|
9680
9829
|
open,
|
|
9681
9830
|
onCancel: onClose,
|
|
@@ -9684,8 +9833,8 @@ var ProcessPreview = ({
|
|
|
9684
9833
|
/* @__PURE__ */ jsx88(Button14, { onClick: onClose, children: "\u53D6\u6D88" }),
|
|
9685
9834
|
/* @__PURE__ */ jsx88(Button14, { type: "primary", onClick: onConfirm, loading, children: "\u786E\u8BA4\u63D0\u4EA4" })
|
|
9686
9835
|
] }),
|
|
9687
|
-
children: loading &&
|
|
9688
|
-
const isLast = index ===
|
|
9836
|
+
children: loading && routeList.length === 0 ? /* @__PURE__ */ jsx88(Skeleton2, { active: true, paragraph: { rows: 4 } }) : routeList.length === 0 ? /* @__PURE__ */ jsx88("p", { className: "text-sm text-gray-400 text-center py-8", children: "\u6682\u65E0\u6D41\u7A0B\u8282\u70B9" }) : /* @__PURE__ */ jsx88("div", { className: "py-2", children: routeList.map((route, index) => {
|
|
9837
|
+
const isLast = index === routeList.length - 1;
|
|
9689
9838
|
return /* @__PURE__ */ jsxs40("div", { className: "flex gap-3", children: [
|
|
9690
9839
|
/* @__PURE__ */ jsxs40("div", { className: "flex flex-col items-center", children: [
|
|
9691
9840
|
/* @__PURE__ */ jsx88("div", { className: "w-6 h-6 rounded-full bg-blue-50 border-2 border-blue-400 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx88(CheckCircleOutlined, { className: "text-blue-500 text-xs" }) }),
|
|
@@ -9716,11 +9865,14 @@ import { useCallback as useCallback17, useEffect as useEffect36, useMemo as useM
|
|
|
9716
9865
|
import {
|
|
9717
9866
|
Button as Button15,
|
|
9718
9867
|
Checkbox as Checkbox5,
|
|
9868
|
+
ConfigProvider,
|
|
9869
|
+
Divider,
|
|
9719
9870
|
Drawer as Drawer2,
|
|
9720
9871
|
Dropdown as Dropdown3,
|
|
9721
9872
|
Empty as Empty5,
|
|
9722
9873
|
Input as Input12,
|
|
9723
|
-
|
|
9874
|
+
InputNumber as InputNumber2,
|
|
9875
|
+
Modal as Modal8,
|
|
9724
9876
|
Segmented,
|
|
9725
9877
|
Select as Select6,
|
|
9726
9878
|
Space as Space9,
|
|
@@ -9730,6 +9882,7 @@ import {
|
|
|
9730
9882
|
Upload as Upload3,
|
|
9731
9883
|
message
|
|
9732
9884
|
} from "antd";
|
|
9885
|
+
import dayjs5 from "dayjs";
|
|
9733
9886
|
import {
|
|
9734
9887
|
DeleteOutlined,
|
|
9735
9888
|
DownloadOutlined,
|
|
@@ -9775,6 +9928,11 @@ var formatPrimitive = (value) => {
|
|
|
9775
9928
|
return /* @__PURE__ */ jsx89("span", { className: "text-ant-color-text-quaternary", children: "--" });
|
|
9776
9929
|
return String(value);
|
|
9777
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
|
+
};
|
|
9778
9936
|
var pickOptionLabel = (field, value) => {
|
|
9779
9937
|
const options = field.options || field.optionList || field.option_list || field.componentProps?.options || [];
|
|
9780
9938
|
const scalar = typeof value === "object" ? value?.value ?? value?.id ?? value?.label ?? value?.name : value;
|
|
@@ -9802,6 +9960,9 @@ var renderStatusTag = (value, fieldId) => {
|
|
|
9802
9960
|
var renderCellValue = (value, field) => {
|
|
9803
9961
|
const status = renderStatusTag(value, field.fieldId);
|
|
9804
9962
|
if (status) return status;
|
|
9963
|
+
if (field.componentName === "DateField" || field.componentName === "DateTimeField") {
|
|
9964
|
+
return formatDateTime(value);
|
|
9965
|
+
}
|
|
9805
9966
|
if (Array.isArray(value)) {
|
|
9806
9967
|
if (value.length === 0) return formatPrimitive("");
|
|
9807
9968
|
if (field.componentName === "ImageField") {
|
|
@@ -9980,6 +10141,54 @@ function FilterGroupEditor({
|
|
|
9980
10141
|
}
|
|
9981
10142
|
);
|
|
9982
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
|
+
}
|
|
9983
10192
|
var DataManagementList = ({
|
|
9984
10193
|
appType,
|
|
9985
10194
|
formUuid,
|
|
@@ -9989,10 +10198,12 @@ var DataManagementList = ({
|
|
|
9989
10198
|
configScope = "global",
|
|
9990
10199
|
title,
|
|
9991
10200
|
detailRenderer,
|
|
10201
|
+
detailPageUrlBuilder,
|
|
9992
10202
|
submitRenderer,
|
|
9993
10203
|
requestOverride,
|
|
9994
10204
|
rowActions = []
|
|
9995
10205
|
}) => {
|
|
10206
|
+
const rootRef = useRef14(null);
|
|
9996
10207
|
const api = useMemo18(() => {
|
|
9997
10208
|
if (typeof requestOverride === "function") {
|
|
9998
10209
|
return createFormRuntimeApi({ request: requestOverride });
|
|
@@ -10001,9 +10212,11 @@ var DataManagementList = ({
|
|
|
10001
10212
|
}, [requestOverride]);
|
|
10002
10213
|
const [fields, setFields] = useState35([]);
|
|
10003
10214
|
const [config, setConfig] = useState35({});
|
|
10215
|
+
const [formType, setFormType] = useState35("form");
|
|
10004
10216
|
const [showFields, setShowFields] = useState35([]);
|
|
10005
10217
|
const [lockFieldIds, setLockFieldIds] = useState35([]);
|
|
10006
10218
|
const [widths, setWidths] = useState35({});
|
|
10219
|
+
const widthsRef = useRef14({});
|
|
10007
10220
|
const [sort, setSort] = useState35([]);
|
|
10008
10221
|
const [density, setDensity] = useState35("middle");
|
|
10009
10222
|
const [detailOpenMode, setDetailOpenMode] = useState35("drawer");
|
|
@@ -10039,10 +10252,20 @@ var DataManagementList = ({
|
|
|
10039
10252
|
const [submitOpen, setSubmitOpen] = useState35(false);
|
|
10040
10253
|
const fetchStateRef = useRef14({});
|
|
10041
10254
|
const request = api.request;
|
|
10255
|
+
const getPopupContainer = useCallback17(
|
|
10256
|
+
(triggerNode) => rootRef.current || triggerNode?.ownerDocument?.body || (typeof document !== "undefined" ? document.body : triggerNode?.parentElement),
|
|
10257
|
+
[]
|
|
10258
|
+
);
|
|
10259
|
+
const confirmDanger = useCallback17((title2, content, onOk) => {
|
|
10260
|
+
if (confirmAction(title2, content)) onOk();
|
|
10261
|
+
}, []);
|
|
10042
10262
|
const visibleFields = useMemo18(
|
|
10043
10263
|
() => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
|
|
10044
10264
|
[fields, showFields]
|
|
10045
10265
|
);
|
|
10266
|
+
useEffect36(() => {
|
|
10267
|
+
widthsRef.current = widths;
|
|
10268
|
+
}, [widths]);
|
|
10046
10269
|
useEffect36(() => {
|
|
10047
10270
|
fetchStateRef.current = {
|
|
10048
10271
|
current,
|
|
@@ -10110,16 +10333,18 @@ var DataManagementList = ({
|
|
|
10110
10333
|
}).catch(() => void 0);
|
|
10111
10334
|
if (!mounted) return;
|
|
10112
10335
|
const resolved = normalizeColumnConfig(saved, allFields);
|
|
10336
|
+
const resolvedDetailOpenMode = detailPageUrlBuilder ? resolved.detailOpenMode : "drawer";
|
|
10113
10337
|
const nextSearchKeyWord = saved?.filter?.searchKeyWord || "";
|
|
10114
10338
|
const nextFilterGroup = hydrateFilterGroup(saved?.filter?.group);
|
|
10115
10339
|
setFields(allFields);
|
|
10340
|
+
setFormType(schemaResult.formType || "form");
|
|
10116
10341
|
setConfig(saved || {});
|
|
10117
10342
|
setShowFields(resolved.showFields);
|
|
10118
10343
|
setWidths(resolved.widths);
|
|
10119
10344
|
setLockFieldIds(resolved.lockFieldIds);
|
|
10120
10345
|
setSort(resolved.sort);
|
|
10121
10346
|
setDensity(resolved.density);
|
|
10122
|
-
setDetailOpenMode(
|
|
10347
|
+
setDetailOpenMode(resolvedDetailOpenMode);
|
|
10123
10348
|
setPageSize(resolved.pageSize);
|
|
10124
10349
|
setSearchKeyWord(nextSearchKeyWord);
|
|
10125
10350
|
setFilterGroup(nextFilterGroup);
|
|
@@ -10141,7 +10366,7 @@ var DataManagementList = ({
|
|
|
10141
10366
|
return () => {
|
|
10142
10367
|
mounted = false;
|
|
10143
10368
|
};
|
|
10144
|
-
}, [appType, configScope, formUuid, loadData, menuFormUuid, request]);
|
|
10369
|
+
}, [appType, configScope, detailPageUrlBuilder, formUuid, loadData, menuFormUuid, request]);
|
|
10145
10370
|
const persistConfig = useCallback17(
|
|
10146
10371
|
async (patch) => {
|
|
10147
10372
|
const nextConfig = { ...config, ...patch };
|
|
@@ -10165,22 +10390,62 @@ var DataManagementList = ({
|
|
|
10165
10390
|
showFields,
|
|
10166
10391
|
lockFieldIds,
|
|
10167
10392
|
widths,
|
|
10393
|
+
sort,
|
|
10168
10394
|
density,
|
|
10169
10395
|
detailOpenMode,
|
|
10170
10396
|
pageSize
|
|
10171
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
|
+
);
|
|
10172
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
|
+
);
|
|
10173
10428
|
const handleDetail = useCallback17(
|
|
10174
10429
|
(record) => {
|
|
10175
10430
|
const formInstanceId = getRecordId(record);
|
|
10176
|
-
if (
|
|
10177
|
-
|
|
10431
|
+
if (!formInstanceId) {
|
|
10432
|
+
message.warning("\u5F53\u524D\u8BB0\u5F55\u7F3A\u5C11\u5B9E\u4F8B ID\uFF0C\u65E0\u6CD5\u6253\u5F00\u8BE6\u60C5");
|
|
10178
10433
|
return;
|
|
10179
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
|
+
}
|
|
10180
10445
|
setActiveRecord(record);
|
|
10181
10446
|
setDetailOpen(true);
|
|
10182
10447
|
},
|
|
10183
|
-
[
|
|
10448
|
+
[detailOpenMode, detailPageUrlBuilder]
|
|
10184
10449
|
);
|
|
10185
10450
|
const handleDelete = useCallback17(
|
|
10186
10451
|
async (ids) => {
|
|
@@ -10296,22 +10561,33 @@ var DataManagementList = ({
|
|
|
10296
10561
|
await loadData({ current: 1, pageSize });
|
|
10297
10562
|
};
|
|
10298
10563
|
const columns = useMemo18(() => {
|
|
10299
|
-
const baseColumns = visibleFields.map((field) =>
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
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
|
+
}) || [];
|
|
10309
10585
|
return [
|
|
10310
10586
|
...baseColumns,
|
|
10311
10587
|
{
|
|
10312
10588
|
title: "\u64CD\u4F5C",
|
|
10313
10589
|
key: "__actions",
|
|
10314
|
-
width:
|
|
10590
|
+
width: 136,
|
|
10315
10591
|
fixed: "right",
|
|
10316
10592
|
render: (_, record) => /* @__PURE__ */ jsxs41(Space9, { size: 4, children: [
|
|
10317
10593
|
/* @__PURE__ */ jsx89(Button15, { type: "link", size: "small", onClick: () => handleDetail(record), children: "\u8BE6\u60C5" }),
|
|
@@ -10319,31 +10595,34 @@ var DataManagementList = ({
|
|
|
10319
10595
|
Dropdown3,
|
|
10320
10596
|
{
|
|
10321
10597
|
trigger: ["click"],
|
|
10598
|
+
getPopupContainer,
|
|
10322
10599
|
menu: {
|
|
10323
10600
|
items: [
|
|
10601
|
+
...!readonly ? [
|
|
10602
|
+
{
|
|
10603
|
+
key: "delete",
|
|
10604
|
+
label: "\u5220\u9664",
|
|
10605
|
+
danger: true,
|
|
10606
|
+
icon: /* @__PURE__ */ jsx89(DeleteOutlined, {}),
|
|
10607
|
+
onClick: () => confirmDanger(
|
|
10608
|
+
"\u786E\u8BA4\u5220\u9664",
|
|
10609
|
+
"\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
|
|
10610
|
+
() => handleDelete([String(getRecordId(record))])
|
|
10611
|
+
)
|
|
10612
|
+
}
|
|
10613
|
+
] : [],
|
|
10324
10614
|
...rowActions.map((action) => ({
|
|
10325
10615
|
key: action.key,
|
|
10326
10616
|
label: action.label,
|
|
10327
10617
|
danger: action.danger,
|
|
10328
10618
|
onClick: () => action.onClick(record)
|
|
10329
10619
|
})),
|
|
10330
|
-
|
|
10331
|
-
key: "workflow",
|
|
10332
|
-
label: "\u6D41\u7A0B\u65E5\u5FD7",
|
|
10333
|
-
icon: /* @__PURE__ */ jsx89(HistoryOutlined2, {}),
|
|
10334
|
-
onClick: () => message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
|
|
10335
|
-
},
|
|
10336
|
-
...!readonly ? [
|
|
10620
|
+
...formType === "process" ? [
|
|
10337
10621
|
{
|
|
10338
|
-
key: "
|
|
10339
|
-
label: "\
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
onClick: () => Modal10.confirm({
|
|
10343
|
-
title: "\u786E\u8BA4\u5220\u9664",
|
|
10344
|
-
content: "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
|
|
10345
|
-
onOk: () => handleDelete([String(getRecordId(record))])
|
|
10346
|
-
})
|
|
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")
|
|
10347
10626
|
}
|
|
10348
10627
|
] : []
|
|
10349
10628
|
]
|
|
@@ -10354,8 +10633,25 @@ var DataManagementList = ({
|
|
|
10354
10633
|
] })
|
|
10355
10634
|
}
|
|
10356
10635
|
];
|
|
10357
|
-
}, [
|
|
10636
|
+
}, [
|
|
10637
|
+
confirmDanger,
|
|
10638
|
+
commitColumnWidth,
|
|
10639
|
+
formType,
|
|
10640
|
+
getPopupContainer,
|
|
10641
|
+
handleDelete,
|
|
10642
|
+
handleDetail,
|
|
10643
|
+
lockFieldIds,
|
|
10644
|
+
readonly,
|
|
10645
|
+
rowActions,
|
|
10646
|
+
updateColumnWidth,
|
|
10647
|
+
visibleFields,
|
|
10648
|
+
widths
|
|
10649
|
+
]);
|
|
10358
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
|
+
);
|
|
10359
10655
|
const importPreviewColumns = useMemo18(() => {
|
|
10360
10656
|
const keys = Array.from(
|
|
10361
10657
|
new Set(importPreview.flatMap((record) => Object.keys(record || {})))
|
|
@@ -10372,438 +10668,525 @@ var DataManagementList = ({
|
|
|
10372
10668
|
};
|
|
10373
10669
|
});
|
|
10374
10670
|
}, [fields, importPreview]);
|
|
10375
|
-
return /* @__PURE__ */
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
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,
|
|
10392
10797
|
{
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
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 });
|
|
10402
10826
|
loadData({
|
|
10403
|
-
current: 1,
|
|
10404
|
-
pageSize,
|
|
10405
|
-
|
|
10406
|
-
filterGroup
|
|
10827
|
+
current: pagination.current || 1,
|
|
10828
|
+
pageSize: pagination.pageSize || pageSize,
|
|
10829
|
+
sort: nextSort
|
|
10407
10830
|
});
|
|
10408
10831
|
}
|
|
10409
10832
|
}
|
|
10410
|
-
)
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
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,
|
|
10437
10866
|
{
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
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))
|
|
10441
10871
|
}
|
|
10442
|
-
|
|
10443
|
-
},
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
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,
|
|
10453
10899
|
{
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
|
|
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
|
|
10457
10908
|
}
|
|
10458
|
-
|
|
10459
|
-
},
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
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
|
+
] })
|
|
10504
10998
|
}
|
|
10505
10999
|
),
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
" \
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
] })
|
|
10528
|
-
] })
|
|
10529
|
-
] }),
|
|
10530
|
-
/* @__PURE__ */ jsx89(
|
|
10531
|
-
Modal10,
|
|
10532
|
-
{
|
|
10533
|
-
title: "\u9AD8\u7EA7\u7B5B\u9009",
|
|
10534
|
-
open: filterOpen,
|
|
10535
|
-
width: 760,
|
|
10536
|
-
onCancel: () => setFilterOpen(false),
|
|
10537
|
-
onOk: () => {
|
|
10538
|
-
setFilterOpen(false);
|
|
10539
|
-
persistConfig({ filter: { searchKeyWord, group: filterGroup } });
|
|
10540
|
-
loadData({ current: 1, pageSize, searchKeyWord, filterGroup });
|
|
10541
|
-
},
|
|
10542
|
-
okText: "\u5E94\u7528\u7B5B\u9009",
|
|
10543
|
-
children: /* @__PURE__ */ jsx89(FilterGroupEditor, { group: filterGroup, fields, onChange: setFilterGroup })
|
|
10544
|
-
}
|
|
10545
|
-
),
|
|
10546
|
-
/* @__PURE__ */ jsx89(
|
|
10547
|
-
Modal10,
|
|
10548
|
-
{
|
|
10549
|
-
title: "\u5217\u8BBE\u7F6E",
|
|
10550
|
-
open: columnOpen,
|
|
10551
|
-
width: 720,
|
|
10552
|
-
onCancel: () => setColumnOpen(false),
|
|
10553
|
-
onOk: handleColumnCommit,
|
|
10554
|
-
children: /* @__PURE__ */ jsxs41("div", { className: "space-y-5", children: [
|
|
10555
|
-
/* @__PURE__ */ jsxs41("div", { children: [
|
|
10556
|
-
/* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u663E\u793A\u5217" }),
|
|
10557
|
-
/* @__PURE__ */ jsx89(
|
|
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(
|
|
10558
11021
|
Checkbox5.Group,
|
|
10559
11022
|
{
|
|
10560
|
-
className: "grid grid-cols-2 gap-2
|
|
10561
|
-
value:
|
|
11023
|
+
className: "grid grid-cols-2 gap-2",
|
|
11024
|
+
value: exportFields,
|
|
10562
11025
|
options: fields.map((field) => ({ label: field.label, value: field.fieldId })),
|
|
10563
|
-
onChange: (values) =>
|
|
10564
|
-
}
|
|
10565
|
-
)
|
|
10566
|
-
] }),
|
|
10567
|
-
/* @__PURE__ */ jsxs41("div", { children: [
|
|
10568
|
-
/* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u51BB\u7ED3\u5217" }),
|
|
10569
|
-
/* @__PURE__ */ jsx89(
|
|
10570
|
-
Select6,
|
|
10571
|
-
{
|
|
10572
|
-
mode: "multiple",
|
|
10573
|
-
className: "w-full",
|
|
10574
|
-
value: lockFieldIds,
|
|
10575
|
-
options: showFields.map((fieldId) => {
|
|
10576
|
-
const field = fields.find((item) => item.fieldId === fieldId);
|
|
10577
|
-
return { label: field?.label || fieldId, value: fieldId };
|
|
10578
|
-
}),
|
|
10579
|
-
onChange: setLockFieldIds
|
|
11026
|
+
onChange: (values) => setExportFields(values.map(String))
|
|
10580
11027
|
}
|
|
10581
11028
|
)
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
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
|
+
] }),
|
|
10586
11047
|
/* @__PURE__ */ jsx89(
|
|
10587
11048
|
Segmented,
|
|
10588
11049
|
{
|
|
10589
11050
|
block: true,
|
|
10590
|
-
value:
|
|
11051
|
+
value: batchApprovalAction,
|
|
10591
11052
|
options: [
|
|
10592
|
-
{ label: "\
|
|
10593
|
-
{ label: "\
|
|
10594
|
-
{ label: "\u5BBD\u677E", value: "loose" }
|
|
11053
|
+
{ label: "\u540C\u610F", value: "approved" },
|
|
11054
|
+
{ label: "\u62D2\u7EDD", value: "rejected" }
|
|
10595
11055
|
],
|
|
10596
|
-
onChange: (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)
|
|
10597
11068
|
}
|
|
10598
11069
|
)
|
|
10599
|
-
] })
|
|
10600
|
-
|
|
10601
|
-
|
|
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: [
|
|
10602
11126
|
/* @__PURE__ */ jsx89(
|
|
10603
11127
|
Segmented,
|
|
10604
11128
|
{
|
|
10605
|
-
|
|
10606
|
-
value: detailOpenMode,
|
|
11129
|
+
value: recordTab,
|
|
10607
11130
|
options: [
|
|
10608
|
-
{ label: "\
|
|
10609
|
-
{ label: "\
|
|
11131
|
+
{ label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
|
|
11132
|
+
{ label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
|
|
10610
11133
|
],
|
|
10611
|
-
onChange: (value) =>
|
|
11134
|
+
onChange: (value) => loadTransferRecords(value)
|
|
10612
11135
|
}
|
|
10613
|
-
)
|
|
10614
|
-
] }),
|
|
10615
|
-
/* @__PURE__ */ jsxs41("div", { children: [
|
|
10616
|
-
/* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u9875\u5927\u5C0F" }),
|
|
11136
|
+
),
|
|
10617
11137
|
/* @__PURE__ */ jsx89(
|
|
10618
|
-
|
|
11138
|
+
Table3,
|
|
10619
11139
|
{
|
|
10620
|
-
className: "
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
11140
|
+
className: "mt-4",
|
|
11141
|
+
size: "small",
|
|
11142
|
+
dataSource: transferRecords,
|
|
11143
|
+
rowKey: (record) => record.id || record.recordId
|
|
10624
11144
|
}
|
|
10625
11145
|
)
|
|
10626
|
-
]
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
/* @__PURE__ */ jsx89(
|
|
10632
|
-
Modal10,
|
|
10633
|
-
{
|
|
10634
|
-
title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
|
|
10635
|
-
open: exportOpen,
|
|
10636
|
-
onCancel: () => setExportOpen(false),
|
|
10637
|
-
footer: /* @__PURE__ */ jsxs41(Space9, { children: [
|
|
10638
|
-
/* @__PURE__ */ jsx89(Button15, { onClick: () => setExportOpen(false), children: "\u53D6\u6D88" }),
|
|
10639
|
-
/* @__PURE__ */ jsx89(
|
|
10640
|
-
Button15,
|
|
10641
|
-
{
|
|
10642
|
-
type: "primary",
|
|
10643
|
-
loading: exporting,
|
|
10644
|
-
disabled: exportScope === "selected" && selectedRowKeys.length === 0,
|
|
10645
|
-
onClick: () => handleExport(exportScope),
|
|
10646
|
-
children: exportScope === "selected" ? `\u5BFC\u51FA\u9009\u4E2D (${selectedRowKeys.length})` : "\u5BFC\u51FA\u5168\u90E8"
|
|
10647
|
-
}
|
|
10648
|
-
)
|
|
10649
|
-
] }),
|
|
10650
|
-
children: /* @__PURE__ */ jsx89(
|
|
10651
|
-
Checkbox5.Group,
|
|
11146
|
+
]
|
|
11147
|
+
}
|
|
11148
|
+
),
|
|
11149
|
+
/* @__PURE__ */ jsx89(
|
|
11150
|
+
Drawer2,
|
|
10652
11151
|
{
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
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" })
|
|
10657
11165
|
}
|
|
10658
|
-
)
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
] }),
|
|
10676
|
-
/* @__PURE__ */ jsx89(
|
|
10677
|
-
Segmented,
|
|
10678
|
-
{
|
|
10679
|
-
block: true,
|
|
10680
|
-
value: batchApprovalAction,
|
|
10681
|
-
options: [
|
|
10682
|
-
{ label: "\u540C\u610F", value: "approved" },
|
|
10683
|
-
{ label: "\u62D2\u7EDD", value: "rejected" }
|
|
10684
|
-
],
|
|
10685
|
-
onChange: (value) => setBatchApprovalAction(value)
|
|
10686
|
-
}
|
|
10687
|
-
),
|
|
10688
|
-
/* @__PURE__ */ jsx89(
|
|
10689
|
-
Input12.TextArea,
|
|
10690
|
-
{
|
|
10691
|
-
value: batchApprovalComments,
|
|
10692
|
-
rows: 4,
|
|
10693
|
-
maxLength: 500,
|
|
10694
|
-
showCount: true,
|
|
10695
|
-
placeholder: "\u586B\u5199\u5BA1\u6279\u610F\u89C1",
|
|
10696
|
-
onChange: (event) => setBatchApprovalComments(event.target.value)
|
|
10697
|
-
}
|
|
10698
|
-
)
|
|
10699
|
-
] })
|
|
10700
|
-
}
|
|
10701
|
-
),
|
|
10702
|
-
/* @__PURE__ */ jsxs41(
|
|
10703
|
-
Modal10,
|
|
10704
|
-
{
|
|
10705
|
-
title: "\u5BFC\u5165\u6570\u636E",
|
|
10706
|
-
open: importOpen,
|
|
10707
|
-
width: 720,
|
|
10708
|
-
onCancel: () => setImportOpen(false),
|
|
10709
|
-
onOk: handleImportConfirm,
|
|
10710
|
-
okButtonProps: { disabled: !importBase64 },
|
|
10711
|
-
okText: "\u786E\u8BA4\u5BFC\u5165",
|
|
10712
|
-
children: [
|
|
10713
|
-
/* @__PURE__ */ jsx89(
|
|
10714
|
-
Upload3.Dragger,
|
|
10715
|
-
{
|
|
10716
|
-
accept: ".xlsx,.xls",
|
|
10717
|
-
maxCount: 1,
|
|
10718
|
-
beforeUpload: handleImportPreview,
|
|
10719
|
-
onRemove: () => {
|
|
10720
|
-
setImportBase64("");
|
|
10721
|
-
setImportPreview([]);
|
|
10722
|
-
},
|
|
10723
|
-
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" })
|
|
10724
|
-
}
|
|
10725
|
-
),
|
|
10726
|
-
importPreview.length > 0 && /* @__PURE__ */ jsxs41("div", { className: "mt-4", children: [
|
|
10727
|
-
/* @__PURE__ */ jsx89("div", { className: "mb-2 text-sm font-medium text-ant-color-text", children: "\u5BFC\u5165\u9884\u89C8" }),
|
|
10728
|
-
/* @__PURE__ */ jsx89(
|
|
10729
|
-
Table3,
|
|
10730
|
-
{
|
|
10731
|
-
size: "small",
|
|
10732
|
-
dataSource: importPreview,
|
|
10733
|
-
columns: importPreviewColumns,
|
|
10734
|
-
scroll: { x: Math.max(600, (importPreviewColumns?.length || 0) * 150) },
|
|
10735
|
-
pagination: false,
|
|
10736
|
-
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 });
|
|
10737
11183
|
}
|
|
10738
|
-
)
|
|
10739
|
-
] })
|
|
10740
|
-
]
|
|
10741
|
-
}
|
|
10742
|
-
),
|
|
10743
|
-
/* @__PURE__ */ jsxs41(
|
|
10744
|
-
Drawer2,
|
|
10745
|
-
{
|
|
10746
|
-
title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
|
|
10747
|
-
open: recordsOpen,
|
|
10748
|
-
width: 720,
|
|
10749
|
-
onClose: () => setRecordsOpen(false),
|
|
10750
|
-
children: [
|
|
10751
|
-
/* @__PURE__ */ jsx89(
|
|
10752
|
-
Segmented,
|
|
10753
|
-
{
|
|
10754
|
-
value: recordTab,
|
|
10755
|
-
options: [
|
|
10756
|
-
{ label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
|
|
10757
|
-
{ label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
|
|
10758
|
-
],
|
|
10759
|
-
onChange: (value) => loadTransferRecords(value)
|
|
10760
|
-
}
|
|
10761
|
-
),
|
|
10762
|
-
/* @__PURE__ */ jsx89(
|
|
10763
|
-
Table3,
|
|
10764
|
-
{
|
|
10765
|
-
className: "mt-4",
|
|
10766
|
-
size: "small",
|
|
10767
|
-
dataSource: transferRecords,
|
|
10768
|
-
rowKey: (record) => record.id || record.recordId
|
|
10769
|
-
}
|
|
10770
|
-
)
|
|
10771
|
-
]
|
|
10772
|
-
}
|
|
10773
|
-
),
|
|
10774
|
-
/* @__PURE__ */ jsx89(
|
|
10775
|
-
Drawer2,
|
|
10776
|
-
{
|
|
10777
|
-
title: "\u8BE6\u60C5",
|
|
10778
|
-
open: detailOpen,
|
|
10779
|
-
width: 720,
|
|
10780
|
-
onClose: () => setDetailOpen(false),
|
|
10781
|
-
destroyOnClose: true,
|
|
10782
|
-
children: activeRecord && detailRenderer ? detailRenderer({
|
|
10783
|
-
record: activeRecord,
|
|
10784
|
-
formInstanceId: String(getRecordId(activeRecord)),
|
|
10785
|
-
onClose: () => setDetailOpen(false)
|
|
10786
|
-
}) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u8BE6\u60C5\u6A21\u677F" })
|
|
10787
|
-
}
|
|
10788
|
-
),
|
|
10789
|
-
/* @__PURE__ */ jsx89(
|
|
10790
|
-
Drawer2,
|
|
10791
|
-
{
|
|
10792
|
-
title: "\u65B0\u589E\u6570\u636E",
|
|
10793
|
-
open: submitOpen,
|
|
10794
|
-
width: 720,
|
|
10795
|
-
onClose: () => setSubmitOpen(false),
|
|
10796
|
-
destroyOnClose: true,
|
|
10797
|
-
children: submitRenderer ? submitRenderer({
|
|
10798
|
-
onClose: () => setSubmitOpen(false),
|
|
10799
|
-
onSubmitted: () => {
|
|
10800
|
-
setSubmitOpen(false);
|
|
10801
|
-
loadData({ current: 1, pageSize });
|
|
11184
|
+
}) : /* @__PURE__ */ jsx89(Empty5, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
|
|
10802
11185
|
}
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
11186
|
+
)
|
|
11187
|
+
]
|
|
11188
|
+
}
|
|
11189
|
+
) });
|
|
10807
11190
|
};
|
|
10808
11191
|
|
|
10809
11192
|
// src/templates/FormSubmitTemplate.tsx
|
|
@@ -10965,7 +11348,7 @@ var InnerFormContent = ({
|
|
|
10965
11348
|
data: formData,
|
|
10966
11349
|
submissionDepartmentId: departmentId
|
|
10967
11350
|
});
|
|
10968
|
-
setPreviewRoutes(routes);
|
|
11351
|
+
setPreviewRoutes(Array.isArray(routes) ? routes : []);
|
|
10969
11352
|
} catch (error) {
|
|
10970
11353
|
console.error("[FormSubmitTemplate] Preview failed:", error);
|
|
10971
11354
|
setPreviewRoutes([]);
|
|
@@ -11055,56 +11438,72 @@ var InnerFormContent = ({
|
|
|
11055
11438
|
}
|
|
11056
11439
|
)
|
|
11057
11440
|
] }) : null;
|
|
11058
|
-
const actionsNode = !submitted ? /* @__PURE__ */ jsx90(
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11441
|
+
const actionsNode = !submitted ? /* @__PURE__ */ jsx90(
|
|
11442
|
+
StickyActionBar,
|
|
11443
|
+
{
|
|
11444
|
+
actions,
|
|
11445
|
+
inDrawer,
|
|
11446
|
+
position: "inline",
|
|
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"
|
|
11448
|
+
}
|
|
11449
|
+
) : null;
|
|
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
|
+
);
|
|
11108
11507
|
};
|
|
11109
11508
|
var FormSubmitTemplate = ({
|
|
11110
11509
|
schema,
|
|
@@ -11151,6 +11550,7 @@ var FormSubmitTemplate = ({
|
|
|
11151
11550
|
|
|
11152
11551
|
// src/templates/FormDetailTemplate.tsx
|
|
11153
11552
|
import { useCallback as useCallback19, useMemo as useMemo19, useRef as useRef15, useState as useState37 } from "react";
|
|
11553
|
+
import dayjs6 from "dayjs";
|
|
11154
11554
|
|
|
11155
11555
|
// src/templates/PageSkeleton.tsx
|
|
11156
11556
|
import { Skeleton as Skeleton3 } from "antd";
|
|
@@ -11222,6 +11622,11 @@ function FormDataBridge({
|
|
|
11222
11622
|
formDataRef.current = getFormData2;
|
|
11223
11623
|
return null;
|
|
11224
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
|
+
};
|
|
11225
11630
|
var InnerDetailContent = ({
|
|
11226
11631
|
schema,
|
|
11227
11632
|
formUuid,
|
|
@@ -11332,14 +11737,36 @@ var InnerDetailContent = ({
|
|
|
11332
11737
|
renderSummary && instanceInfo ? renderSummary(instanceInfo) : /* @__PURE__ */ jsx92(
|
|
11333
11738
|
SummaryPanel,
|
|
11334
11739
|
{
|
|
11335
|
-
title: instanceInfo?.title ||
|
|
11740
|
+
title: instanceInfo?.title || instanceInfo?.instanceTitle || schema.formMeta.title,
|
|
11336
11741
|
eyebrow: `\u6570\u636E\u5B9E\u4F8B ${formInstanceId?.slice(0, 8) || "-"}`,
|
|
11337
|
-
creator: instanceInfo?.creator ? {
|
|
11338
|
-
name: instanceInfo
|
|
11339
|
-
avatar: instanceInfo
|
|
11340
|
-
department: instanceInfo
|
|
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
|
|
11341
11746
|
} : void 0,
|
|
11342
|
-
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
|
+
],
|
|
11343
11770
|
status: mode === "edit" ? { label: "\u7F16\u8F91\u4E2D", tone: "brand" } : void 0
|
|
11344
11771
|
}
|
|
11345
11772
|
),
|