sy-form-components 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +165 -121
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +180 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1374,6 +1374,7 @@ interface StickyActionBarProps {
|
|
|
1374
1374
|
layoutMode?: 'default' | 'approval';
|
|
1375
1375
|
inDrawer?: boolean;
|
|
1376
1376
|
maxWidth?: number | string;
|
|
1377
|
+
position?: 'sticky' | 'fixed' | 'inline';
|
|
1377
1378
|
}
|
|
1378
1379
|
declare const StickyActionBar: React__default.FC<StickyActionBarProps>;
|
|
1379
1380
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1374,6 +1374,7 @@ interface StickyActionBarProps {
|
|
|
1374
1374
|
layoutMode?: 'default' | 'approval';
|
|
1375
1375
|
inDrawer?: boolean;
|
|
1376
1376
|
maxWidth?: number | string;
|
|
1377
|
+
position?: 'sticky' | 'fixed' | 'inline';
|
|
1377
1378
|
}
|
|
1378
1379
|
declare const StickyActionBar: React__default.FC<StickyActionBarProps>;
|
|
1379
1380
|
|
package/dist/index.js
CHANGED
|
@@ -8229,6 +8229,16 @@ function useApprovalActions(options) {
|
|
|
8229
8229
|
|
|
8230
8230
|
// src/hooks/useChangeRecords.ts
|
|
8231
8231
|
var import_react52 = require("react");
|
|
8232
|
+
var normalizeChangeRecordList = (value) => {
|
|
8233
|
+
const body = value?.data ?? value?.result ?? value ?? {};
|
|
8234
|
+
const records = body.records ?? body.data ?? body.list ?? body.items ?? [];
|
|
8235
|
+
return {
|
|
8236
|
+
records: Array.isArray(records) ? records : [],
|
|
8237
|
+
total: Number(body.total ?? body.totalCount ?? body.count ?? records.length) || 0,
|
|
8238
|
+
page: Number(body.page ?? body.currentPage ?? 1) || 1,
|
|
8239
|
+
pageSize: Number(body.pageSize ?? body.limit ?? 20) || 20
|
|
8240
|
+
};
|
|
8241
|
+
};
|
|
8232
8242
|
function useChangeRecords(options) {
|
|
8233
8243
|
const { formUuid, appType, formInstanceId, pageSize = 20, autoLoad = true } = options;
|
|
8234
8244
|
const { api } = useFormContext();
|
|
@@ -8257,13 +8267,14 @@ function useChangeRecords(options) {
|
|
|
8257
8267
|
pageSize
|
|
8258
8268
|
});
|
|
8259
8269
|
if (!mountedRef.current) return;
|
|
8270
|
+
const normalized = normalizeChangeRecordList(result);
|
|
8260
8271
|
if (append) {
|
|
8261
|
-
setRecords((prev) => [...prev, ...
|
|
8272
|
+
setRecords((prev) => [...prev, ...normalized.records]);
|
|
8262
8273
|
} else {
|
|
8263
|
-
setRecords(
|
|
8274
|
+
setRecords(normalized.records);
|
|
8264
8275
|
}
|
|
8265
|
-
setTotal(
|
|
8266
|
-
setPage(pageNum);
|
|
8276
|
+
setTotal(normalized.total);
|
|
8277
|
+
setPage(normalized.page || pageNum);
|
|
8267
8278
|
} catch (error) {
|
|
8268
8279
|
console.error("[useChangeRecords] Failed to load change records:", error);
|
|
8269
8280
|
} finally {
|
|
@@ -8279,7 +8290,8 @@ function useChangeRecords(options) {
|
|
|
8279
8290
|
fetchRecords(1, false);
|
|
8280
8291
|
}
|
|
8281
8292
|
}, [autoLoad, fetchRecords]);
|
|
8282
|
-
const
|
|
8293
|
+
const safeRecords = Array.isArray(records) ? records : [];
|
|
8294
|
+
const hasMore = safeRecords.length < total;
|
|
8283
8295
|
const loadMore = (0, import_react52.useCallback)(async () => {
|
|
8284
8296
|
if (!hasMore || loading) return;
|
|
8285
8297
|
await fetchRecords(page + 1, true);
|
|
@@ -8291,7 +8303,7 @@ function useChangeRecords(options) {
|
|
|
8291
8303
|
await fetchRecords(1, false);
|
|
8292
8304
|
}, [fetchRecords]);
|
|
8293
8305
|
return {
|
|
8294
|
-
records,
|
|
8306
|
+
records: safeRecords,
|
|
8295
8307
|
loading,
|
|
8296
8308
|
total,
|
|
8297
8309
|
page,
|
|
@@ -9057,6 +9069,21 @@ var import_icons6 = require("@ant-design/icons");
|
|
|
9057
9069
|
var import_react57 = require("react");
|
|
9058
9070
|
var import_antd24 = require("antd");
|
|
9059
9071
|
var import_icons5 = require("@ant-design/icons");
|
|
9072
|
+
|
|
9073
|
+
// src/utils/confirmAction.ts
|
|
9074
|
+
var confirmAction = (title, content) => {
|
|
9075
|
+
const message2 = [title, content].filter(Boolean).join("\n") || "\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F";
|
|
9076
|
+
if (typeof window === "undefined" || typeof window.confirm !== "function") {
|
|
9077
|
+
return true;
|
|
9078
|
+
}
|
|
9079
|
+
try {
|
|
9080
|
+
return window.confirm(message2);
|
|
9081
|
+
} catch {
|
|
9082
|
+
return true;
|
|
9083
|
+
}
|
|
9084
|
+
};
|
|
9085
|
+
|
|
9086
|
+
// src/modules/StickyActionBar.tsx
|
|
9060
9087
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
9061
9088
|
var getActionPriority = (action) => {
|
|
9062
9089
|
const maybePriority = action.priority;
|
|
@@ -9071,8 +9098,8 @@ var StickyActionBar = ({
|
|
|
9071
9098
|
className = "",
|
|
9072
9099
|
maxMobileButtons = 2,
|
|
9073
9100
|
layoutMode = "default",
|
|
9074
|
-
|
|
9075
|
-
|
|
9101
|
+
maxWidth = 1120,
|
|
9102
|
+
position = "sticky"
|
|
9076
9103
|
}) => {
|
|
9077
9104
|
const [isMobile, setIsMobile] = (0, import_react57.useState)(false);
|
|
9078
9105
|
(0, import_react57.useEffect)(() => {
|
|
@@ -9091,6 +9118,14 @@ var StickyActionBar = ({
|
|
|
9091
9118
|
const moreMobile = visibleActions.slice(maxMobileButtons);
|
|
9092
9119
|
const leftActions = visibleActions.filter((action) => getPlacement(action) === "left");
|
|
9093
9120
|
const rightActions = visibleActions.filter((action) => getPlacement(action) !== "left");
|
|
9121
|
+
const positionClass = position === "fixed" ? "fixed bottom-0 left-0 right-0" : position === "inline" ? "relative" : "sticky bottom-0";
|
|
9122
|
+
const runAction = (action) => {
|
|
9123
|
+
if (action.confirm) {
|
|
9124
|
+
const confirmed = confirmAction(action.confirm.title, action.confirm.content);
|
|
9125
|
+
if (!confirmed) return;
|
|
9126
|
+
}
|
|
9127
|
+
action.onClick();
|
|
9128
|
+
};
|
|
9094
9129
|
const renderButton = (action, mobile = false) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9095
9130
|
import_antd24.Button,
|
|
9096
9131
|
{
|
|
@@ -9099,19 +9134,7 @@ var StickyActionBar = ({
|
|
|
9099
9134
|
loading: action.loading,
|
|
9100
9135
|
disabled: action.disabled,
|
|
9101
9136
|
icon: action.icon,
|
|
9102
|
-
onClick: () =>
|
|
9103
|
-
if (action.confirm) {
|
|
9104
|
-
import_antd24.Modal.confirm({
|
|
9105
|
-
title: action.confirm.title,
|
|
9106
|
-
content: action.confirm.content,
|
|
9107
|
-
okText: action.confirm.okText || "\u786E\u8BA4",
|
|
9108
|
-
cancelText: action.confirm.cancelText || "\u53D6\u6D88",
|
|
9109
|
-
onOk: action.onClick
|
|
9110
|
-
});
|
|
9111
|
-
return;
|
|
9112
|
-
}
|
|
9113
|
-
action.onClick();
|
|
9114
|
-
},
|
|
9137
|
+
onClick: () => runAction(action),
|
|
9115
9138
|
className: `${mobile ? "min-w-0 flex-1" : "min-w-[88px]"} rounded-md`,
|
|
9116
9139
|
children: action.label
|
|
9117
9140
|
},
|
|
@@ -9120,7 +9143,7 @@ var StickyActionBar = ({
|
|
|
9120
9143
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9121
9144
|
"div",
|
|
9122
9145
|
{
|
|
9123
|
-
className:
|
|
9146
|
+
className: `${positionClass} z-20 border-t border-ant-border-secondary bg-ant-bg-container/95 px-4 py-3 shadow-[0_-8px_24px_rgba(15,23,42,0.06)] backdrop-blur supports-[padding:max(0px)]:pb-[max(0.75rem,env(safe-area-inset-bottom))] ${className}`,
|
|
9124
9147
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
9125
9148
|
"div",
|
|
9126
9149
|
{
|
|
@@ -9140,19 +9163,7 @@ var StickyActionBar = ({
|
|
|
9140
9163
|
danger: action.type === "danger",
|
|
9141
9164
|
disabled: action.disabled,
|
|
9142
9165
|
icon: action.icon,
|
|
9143
|
-
onClick: () =>
|
|
9144
|
-
if (action.confirm) {
|
|
9145
|
-
import_antd24.Modal.confirm({
|
|
9146
|
-
title: action.confirm.title,
|
|
9147
|
-
content: action.confirm.content,
|
|
9148
|
-
okText: action.confirm.okText || "\u786E\u8BA4",
|
|
9149
|
-
cancelText: action.confirm.cancelText || "\u53D6\u6D88",
|
|
9150
|
-
onOk: action.onClick
|
|
9151
|
-
});
|
|
9152
|
-
return;
|
|
9153
|
-
}
|
|
9154
|
-
action.onClick();
|
|
9155
|
-
}
|
|
9166
|
+
onClick: () => runAction(action)
|
|
9156
9167
|
}))
|
|
9157
9168
|
},
|
|
9158
9169
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_antd24.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_icons5.MoreOutlined, {}), className: "rounded-md", children: "\u66F4\u591A" })
|
|
@@ -9319,6 +9330,7 @@ var ApprovalActionBar = ({
|
|
|
9319
9330
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
9320
9331
|
import_antd25.Modal,
|
|
9321
9332
|
{
|
|
9333
|
+
getContainer: false,
|
|
9322
9334
|
title: getModalTitle(modalAction),
|
|
9323
9335
|
open: modalAction !== null,
|
|
9324
9336
|
okText: "\u786E\u8BA4",
|
|
@@ -9354,6 +9366,7 @@ var ApprovalActionBar = ({
|
|
|
9354
9366
|
import_antd25.Select,
|
|
9355
9367
|
{
|
|
9356
9368
|
placeholder: "\u8BF7\u9009\u62E9\u9000\u56DE\u8282\u70B9",
|
|
9369
|
+
getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
|
|
9357
9370
|
options: returnableNodes.map((node) => ({
|
|
9358
9371
|
value: node.nodeId || node.id || "",
|
|
9359
9372
|
label: renderReturnNodeLabel ? renderReturnNodeLabel(node) : node.nodeName || node.name || node.nodeId || node.id
|
|
@@ -9490,6 +9503,7 @@ var ApprovalActions = ({
|
|
|
9490
9503
|
import_antd26.Dropdown,
|
|
9491
9504
|
{
|
|
9492
9505
|
trigger: ["click"],
|
|
9506
|
+
getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body,
|
|
9493
9507
|
menu: {
|
|
9494
9508
|
items: moreButtons.map((action) => ({
|
|
9495
9509
|
key: action.action,
|
|
@@ -9507,6 +9521,7 @@ var ApprovalActions = ({
|
|
|
9507
9521
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
9508
9522
|
import_antd26.Modal,
|
|
9509
9523
|
{
|
|
9524
|
+
getContainer: false,
|
|
9510
9525
|
title,
|
|
9511
9526
|
open: modalAction !== null,
|
|
9512
9527
|
okText: "\u786E\u8BA4",
|
|
@@ -9558,15 +9573,9 @@ var FormActionBar = ({
|
|
|
9558
9573
|
});
|
|
9559
9574
|
const handleClick = async (action) => {
|
|
9560
9575
|
if (action.confirm) {
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
okText: "\u786E\u8BA4",
|
|
9565
|
-
cancelText: "\u53D6\u6D88",
|
|
9566
|
-
onOk: async () => {
|
|
9567
|
-
await executeAction(action);
|
|
9568
|
-
}
|
|
9569
|
-
});
|
|
9576
|
+
const confirmed = confirmAction(action.confirm.title, action.confirm.content);
|
|
9577
|
+
if (!confirmed) return;
|
|
9578
|
+
await executeAction(action);
|
|
9570
9579
|
} else {
|
|
9571
9580
|
await executeAction(action);
|
|
9572
9581
|
}
|
|
@@ -9648,11 +9657,11 @@ var RuntimePageShell = ({
|
|
|
9648
9657
|
}
|
|
9649
9658
|
return children;
|
|
9650
9659
|
};
|
|
9651
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `sy-runtime-page min-h-
|
|
9660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: `sy-runtime-page min-h-full bg-ant-bg-layout text-ant-text ${className}`, children: [
|
|
9652
9661
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9653
9662
|
"div",
|
|
9654
9663
|
{
|
|
9655
|
-
className: `sy-runtime-page__content mx-auto w-full px-4 py-6 pb-
|
|
9664
|
+
className: `sy-runtime-page__content mx-auto w-full px-4 py-6 pb-8 md:px-6 ${inDrawer ? "py-4 md:px-4" : ""} ${contentClassName}`,
|
|
9656
9665
|
style: { maxWidth: maxWidthStyle },
|
|
9657
9666
|
children: renderState()
|
|
9658
9667
|
}
|
|
@@ -9795,9 +9804,11 @@ var ProcessPreview = ({
|
|
|
9795
9804
|
routes,
|
|
9796
9805
|
loading = false
|
|
9797
9806
|
}) => {
|
|
9807
|
+
const routeList = Array.isArray(routes) ? routes : [];
|
|
9798
9808
|
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9799
9809
|
import_antd31.Modal,
|
|
9800
9810
|
{
|
|
9811
|
+
getContainer: false,
|
|
9801
9812
|
title: "\u6D41\u7A0B\u9884\u89C8",
|
|
9802
9813
|
open,
|
|
9803
9814
|
onCancel: onClose,
|
|
@@ -9806,8 +9817,8 @@ var ProcessPreview = ({
|
|
|
9806
9817
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Button, { onClick: onClose, children: "\u53D6\u6D88" }),
|
|
9807
9818
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Button, { type: "primary", onClick: onConfirm, loading, children: "\u786E\u8BA4\u63D0\u4EA4" })
|
|
9808
9819
|
] }),
|
|
9809
|
-
children: loading &&
|
|
9810
|
-
const isLast = index ===
|
|
9820
|
+
children: loading && routeList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_antd31.Skeleton, { active: true, paragraph: { rows: 4 } }) : routeList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "text-sm text-gray-400 text-center py-8", children: "\u6682\u65E0\u6D41\u7A0B\u8282\u70B9" }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "py-2", children: routeList.map((route, index) => {
|
|
9821
|
+
const isLast = index === routeList.length - 1;
|
|
9811
9822
|
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex gap-3", children: [
|
|
9812
9823
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
9813
9824
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "w-6 h-6 rounded-full bg-blue-50 border-2 border-blue-400 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_icons10.CheckCircleOutlined, { className: "text-blue-500 text-xs" }) }),
|
|
@@ -10088,6 +10099,7 @@ var DataManagementList = ({
|
|
|
10088
10099
|
requestOverride,
|
|
10089
10100
|
rowActions = []
|
|
10090
10101
|
}) => {
|
|
10102
|
+
const rootRef = (0, import_react61.useRef)(null);
|
|
10091
10103
|
const api = (0, import_react61.useMemo)(() => {
|
|
10092
10104
|
if (typeof requestOverride === "function") {
|
|
10093
10105
|
return createFormRuntimeApi({ request: requestOverride });
|
|
@@ -10134,6 +10146,13 @@ var DataManagementList = ({
|
|
|
10134
10146
|
const [submitOpen, setSubmitOpen] = (0, import_react61.useState)(false);
|
|
10135
10147
|
const fetchStateRef = (0, import_react61.useRef)({});
|
|
10136
10148
|
const request = api.request;
|
|
10149
|
+
const getPopupContainer = (0, import_react61.useCallback)(
|
|
10150
|
+
(triggerNode) => triggerNode?.parentElement || rootRef.current || document.body,
|
|
10151
|
+
[]
|
|
10152
|
+
);
|
|
10153
|
+
const confirmDanger = (0, import_react61.useCallback)((title2, content, onOk) => {
|
|
10154
|
+
if (confirmAction(title2, content)) onOk();
|
|
10155
|
+
}, []);
|
|
10137
10156
|
const visibleFields = (0, import_react61.useMemo)(
|
|
10138
10157
|
() => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
|
|
10139
10158
|
[fields, showFields]
|
|
@@ -10414,6 +10433,7 @@ var DataManagementList = ({
|
|
|
10414
10433
|
import_antd32.Dropdown,
|
|
10415
10434
|
{
|
|
10416
10435
|
trigger: ["click"],
|
|
10436
|
+
getPopupContainer,
|
|
10417
10437
|
menu: {
|
|
10418
10438
|
items: [
|
|
10419
10439
|
...rowActions.map((action) => ({
|
|
@@ -10434,11 +10454,11 @@ var DataManagementList = ({
|
|
|
10434
10454
|
label: "\u5220\u9664",
|
|
10435
10455
|
danger: true,
|
|
10436
10456
|
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
|
|
10437
|
-
onClick: () =>
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10457
|
+
onClick: () => confirmDanger(
|
|
10458
|
+
"\u786E\u8BA4\u5220\u9664",
|
|
10459
|
+
"\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
|
|
10460
|
+
() => handleDelete([String(getRecordId(record))])
|
|
10461
|
+
)
|
|
10442
10462
|
}
|
|
10443
10463
|
] : []
|
|
10444
10464
|
]
|
|
@@ -10449,7 +10469,17 @@ var DataManagementList = ({
|
|
|
10449
10469
|
] })
|
|
10450
10470
|
}
|
|
10451
10471
|
];
|
|
10452
|
-
}, [
|
|
10472
|
+
}, [
|
|
10473
|
+
confirmDanger,
|
|
10474
|
+
getPopupContainer,
|
|
10475
|
+
handleDelete,
|
|
10476
|
+
handleDetail,
|
|
10477
|
+
lockFieldIds,
|
|
10478
|
+
readonly,
|
|
10479
|
+
rowActions,
|
|
10480
|
+
visibleFields,
|
|
10481
|
+
widths
|
|
10482
|
+
]);
|
|
10453
10483
|
const tableSize = density === "compact" ? "small" : density === "loose" ? "large" : "middle";
|
|
10454
10484
|
const importPreviewColumns = (0, import_react61.useMemo)(() => {
|
|
10455
10485
|
const keys = Array.from(
|
|
@@ -10467,7 +10497,7 @@ var DataManagementList = ({
|
|
|
10467
10497
|
};
|
|
10468
10498
|
});
|
|
10469
10499
|
}, [fields, importPreview]);
|
|
10470
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: `${fullHeight ? "h-full min-h-
|
|
10500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.ConfigProvider, { getPopupContainer, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { ref: rootRef, className: `${fullHeight ? "h-full min-h-full" : ""} bg-ant-bg-layout`, children: [
|
|
10471
10501
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mx-auto flex h-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
|
|
10472
10502
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
10473
10503
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
|
|
@@ -10493,7 +10523,9 @@ var DataManagementList = ({
|
|
|
10493
10523
|
onSearch: (value) => {
|
|
10494
10524
|
const nextSearchKeyWord = String(value || "");
|
|
10495
10525
|
setSearchKeyWord(nextSearchKeyWord);
|
|
10496
|
-
persistConfig({
|
|
10526
|
+
persistConfig({
|
|
10527
|
+
filter: { searchKeyWord: nextSearchKeyWord, group: filterGroup }
|
|
10528
|
+
});
|
|
10497
10529
|
loadData({
|
|
10498
10530
|
current: 1,
|
|
10499
10531
|
pageSize,
|
|
@@ -10508,6 +10540,7 @@ var DataManagementList = ({
|
|
|
10508
10540
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10509
10541
|
import_antd32.Dropdown,
|
|
10510
10542
|
{
|
|
10543
|
+
getPopupContainer,
|
|
10511
10544
|
menu: {
|
|
10512
10545
|
items: [
|
|
10513
10546
|
{
|
|
@@ -10542,6 +10575,7 @@ var DataManagementList = ({
|
|
|
10542
10575
|
!readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10543
10576
|
import_antd32.Dropdown,
|
|
10544
10577
|
{
|
|
10578
|
+
getPopupContainer,
|
|
10545
10579
|
menu: {
|
|
10546
10580
|
items: [
|
|
10547
10581
|
{ key: "import", label: "\u5BFC\u5165\u6570\u636E", onClick: () => setImportOpen(true) },
|
|
@@ -10558,73 +10592,74 @@ var DataManagementList = ({
|
|
|
10558
10592
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.ReloadOutlined, {}), onClick: () => loadData({ current, pageSize }) })
|
|
10559
10593
|
] })
|
|
10560
10594
|
] }),
|
|
10561
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "
|
|
10562
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
dataSource,
|
|
10569
|
-
size: tableSize,
|
|
10570
|
-
scroll: {
|
|
10571
|
-
x: Math.max(900, visibleFields.length * 160),
|
|
10572
|
-
y: fullHeight ? "calc(100vh - 260px)" : void 0
|
|
10573
|
-
},
|
|
10574
|
-
rowSelection: {
|
|
10575
|
-
selectedRowKeys,
|
|
10576
|
-
onChange: setSelectedRowKeys
|
|
10577
|
-
},
|
|
10578
|
-
pagination: {
|
|
10579
|
-
current,
|
|
10580
|
-
pageSize,
|
|
10581
|
-
total,
|
|
10582
|
-
showSizeChanger: true,
|
|
10583
|
-
showTotal: (count) => `\u5171 ${count} \u6761`
|
|
10584
|
-
},
|
|
10585
|
-
onChange: (pagination, _filters, sorter) => {
|
|
10586
|
-
const sorters = Array.isArray(sorter) ? sorter : [sorter];
|
|
10587
|
-
const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
|
|
10588
|
-
id: String(item.field),
|
|
10589
|
-
isAsc: item.order === "ascend" ? "y" : "n"
|
|
10590
|
-
}));
|
|
10591
|
-
setSort(nextSort);
|
|
10592
|
-
persistConfig({ sort: nextSort });
|
|
10593
|
-
loadData({
|
|
10594
|
-
current: pagination.current || 1,
|
|
10595
|
-
pageSize: pagination.pageSize || pageSize,
|
|
10596
|
-
sort: nextSort
|
|
10597
|
-
});
|
|
10598
|
-
}
|
|
10599
|
-
}
|
|
10600
|
-
),
|
|
10601
|
-
selectedRowKeys.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-3 rounded-lg border border-ant-border-secondary bg-ant-bg-elevated px-4 py-3 shadow-lg", children: [
|
|
10602
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "text-sm text-ant-color-text-secondary", children: [
|
|
10603
|
-
"\u5DF2\u9009 ",
|
|
10604
|
-
selectedRowKeys.length,
|
|
10605
|
-
" \u6761"
|
|
10606
|
-
] }),
|
|
10595
|
+
selectedRowKeys.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-ant-border-secondary bg-ant-bg-container px-4 py-3 shadow-sm", children: [
|
|
10596
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "text-sm text-ant-color-text-secondary", children: [
|
|
10597
|
+
"\u5DF2\u9009 ",
|
|
10598
|
+
selectedRowKeys.length,
|
|
10599
|
+
" \u6761"
|
|
10600
|
+
] }),
|
|
10601
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_antd32.Space, { wrap: true, children: [
|
|
10607
10602
|
!readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.SwapOutlined, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
|
|
10608
10603
|
!readonly && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10609
10604
|
import_antd32.Button,
|
|
10610
10605
|
{
|
|
10611
10606
|
danger: true,
|
|
10612
10607
|
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_icons11.DeleteOutlined, {}),
|
|
10613
|
-
onClick: () =>
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10608
|
+
onClick: () => confirmDanger(
|
|
10609
|
+
"\u786E\u8BA4\u6279\u91CF\u5220\u9664",
|
|
10610
|
+
`\u5C06\u5220\u9664 ${selectedRowKeys.length} \u6761\u6570\u636E\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F`,
|
|
10611
|
+
() => handleDelete(selectedRowKeys.map(String))
|
|
10612
|
+
),
|
|
10618
10613
|
children: "\u6279\u91CF\u5220\u9664"
|
|
10619
10614
|
}
|
|
10620
10615
|
),
|
|
10621
10616
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Button, { type: "link", onClick: () => setSelectedRowKeys([]), children: "\u53D6\u6D88\u9009\u62E9" })
|
|
10622
10617
|
] })
|
|
10623
|
-
] })
|
|
10618
|
+
] }),
|
|
10619
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "relative flex-1 overflow-hidden rounded-lg border border-ant-border-secondary bg-ant-bg-container", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10620
|
+
import_antd32.Table,
|
|
10621
|
+
{
|
|
10622
|
+
rowKey: (record) => String(getRecordId(record)),
|
|
10623
|
+
loading: loading || schemaLoading,
|
|
10624
|
+
columns,
|
|
10625
|
+
dataSource,
|
|
10626
|
+
size: tableSize,
|
|
10627
|
+
scroll: {
|
|
10628
|
+
x: Math.max(900, visibleFields.length * 160),
|
|
10629
|
+
y: fullHeight ? selectedRowKeys.length > 0 ? "calc(100vh - 320px)" : "calc(100vh - 260px)" : void 0
|
|
10630
|
+
},
|
|
10631
|
+
rowSelection: {
|
|
10632
|
+
selectedRowKeys,
|
|
10633
|
+
onChange: setSelectedRowKeys
|
|
10634
|
+
},
|
|
10635
|
+
pagination: {
|
|
10636
|
+
current,
|
|
10637
|
+
pageSize,
|
|
10638
|
+
total,
|
|
10639
|
+
showSizeChanger: true,
|
|
10640
|
+
showTotal: (count) => `\u5171 ${count} \u6761`
|
|
10641
|
+
},
|
|
10642
|
+
onChange: (pagination, _filters, sorter) => {
|
|
10643
|
+
const sorters = Array.isArray(sorter) ? sorter : [sorter];
|
|
10644
|
+
const nextSort = sorters.filter((item) => item?.field && item?.order).map((item) => ({
|
|
10645
|
+
id: String(item.field),
|
|
10646
|
+
isAsc: item.order === "ascend" ? "y" : "n"
|
|
10647
|
+
}));
|
|
10648
|
+
setSort(nextSort);
|
|
10649
|
+
persistConfig({ sort: nextSort });
|
|
10650
|
+
loadData({
|
|
10651
|
+
current: pagination.current || 1,
|
|
10652
|
+
pageSize: pagination.pageSize || pageSize,
|
|
10653
|
+
sort: nextSort
|
|
10654
|
+
});
|
|
10655
|
+
}
|
|
10656
|
+
}
|
|
10657
|
+
) })
|
|
10624
10658
|
] }),
|
|
10625
10659
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10626
10660
|
import_antd32.Modal,
|
|
10627
10661
|
{
|
|
10662
|
+
getContainer: false,
|
|
10628
10663
|
title: "\u9AD8\u7EA7\u7B5B\u9009",
|
|
10629
10664
|
open: filterOpen,
|
|
10630
10665
|
width: 760,
|
|
@@ -10641,6 +10676,7 @@ var DataManagementList = ({
|
|
|
10641
10676
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10642
10677
|
import_antd32.Modal,
|
|
10643
10678
|
{
|
|
10679
|
+
getContainer: false,
|
|
10644
10680
|
title: "\u5217\u8BBE\u7F6E",
|
|
10645
10681
|
open: columnOpen,
|
|
10646
10682
|
width: 720,
|
|
@@ -10726,6 +10762,7 @@ var DataManagementList = ({
|
|
|
10726
10762
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10727
10763
|
import_antd32.Modal,
|
|
10728
10764
|
{
|
|
10765
|
+
getContainer: false,
|
|
10729
10766
|
title: exportScope === "selected" ? "\u5BFC\u51FA\u9009\u4E2D\u6570\u636E" : "\u5BFC\u51FA\u5168\u90E8\u6570\u636E",
|
|
10730
10767
|
open: exportOpen,
|
|
10731
10768
|
onCancel: () => setExportOpen(false),
|
|
@@ -10756,6 +10793,7 @@ var DataManagementList = ({
|
|
|
10756
10793
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10757
10794
|
import_antd32.Modal,
|
|
10758
10795
|
{
|
|
10796
|
+
getContainer: false,
|
|
10759
10797
|
title: "\u6279\u91CF\u5BA1\u6279",
|
|
10760
10798
|
open: batchApprovalOpen,
|
|
10761
10799
|
onCancel: () => setBatchApprovalOpen(false),
|
|
@@ -10797,6 +10835,7 @@ var DataManagementList = ({
|
|
|
10797
10835
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
10798
10836
|
import_antd32.Modal,
|
|
10799
10837
|
{
|
|
10838
|
+
getContainer: false,
|
|
10800
10839
|
title: "\u5BFC\u5165\u6570\u636E",
|
|
10801
10840
|
open: importOpen,
|
|
10802
10841
|
width: 720,
|
|
@@ -10838,6 +10877,7 @@ var DataManagementList = ({
|
|
|
10838
10877
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
10839
10878
|
import_antd32.Drawer,
|
|
10840
10879
|
{
|
|
10880
|
+
getContainer: false,
|
|
10841
10881
|
title: recordTab === "import" ? "\u5BFC\u5165\u8BB0\u5F55" : "\u5BFC\u51FA\u8BB0\u5F55",
|
|
10842
10882
|
open: recordsOpen,
|
|
10843
10883
|
width: 720,
|
|
@@ -10869,6 +10909,7 @@ var DataManagementList = ({
|
|
|
10869
10909
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10870
10910
|
import_antd32.Drawer,
|
|
10871
10911
|
{
|
|
10912
|
+
getContainer: false,
|
|
10872
10913
|
title: "\u8BE6\u60C5",
|
|
10873
10914
|
open: detailOpen,
|
|
10874
10915
|
width: 720,
|
|
@@ -10884,6 +10925,7 @@ var DataManagementList = ({
|
|
|
10884
10925
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
10885
10926
|
import_antd32.Drawer,
|
|
10886
10927
|
{
|
|
10928
|
+
getContainer: false,
|
|
10887
10929
|
title: "\u65B0\u589E\u6570\u636E",
|
|
10888
10930
|
open: submitOpen,
|
|
10889
10931
|
width: 720,
|
|
@@ -10898,7 +10940,7 @@ var DataManagementList = ({
|
|
|
10898
10940
|
}) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_antd32.Empty, { description: "\u8BF7\u901A\u8FC7 submitRenderer \u63A5\u5165\u63D0\u4EA4\u6A21\u677F" })
|
|
10899
10941
|
}
|
|
10900
10942
|
)
|
|
10901
|
-
] });
|
|
10943
|
+
] }) });
|
|
10902
10944
|
};
|
|
10903
10945
|
|
|
10904
10946
|
// src/templates/FormSubmitTemplate.tsx
|
|
@@ -11060,7 +11102,7 @@ var InnerFormContent = ({
|
|
|
11060
11102
|
data: formData,
|
|
11061
11103
|
submissionDepartmentId: departmentId
|
|
11062
11104
|
});
|
|
11063
|
-
setPreviewRoutes(routes);
|
|
11105
|
+
setPreviewRoutes(Array.isArray(routes) ? routes : []);
|
|
11064
11106
|
} catch (error) {
|
|
11065
11107
|
console.error("[FormSubmitTemplate] Preview failed:", error);
|
|
11066
11108
|
setPreviewRoutes([]);
|
|
@@ -11150,17 +11192,18 @@ var InnerFormContent = ({
|
|
|
11150
11192
|
}
|
|
11151
11193
|
)
|
|
11152
11194
|
] }) : null;
|
|
11153
|
-
const actionsNode = !submitted ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11154
|
-
|
|
11195
|
+
const actionsNode = !submitted ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11196
|
+
StickyActionBar,
|
|
11197
|
+
{
|
|
11198
|
+
actions,
|
|
11199
|
+
inDrawer,
|
|
11200
|
+
position: "inline",
|
|
11201
|
+
className: "mt-6 -mx-5 -mb-5 rounded-b-lg md:-mx-6 md:-mb-6"
|
|
11202
|
+
}
|
|
11203
|
+
) : null;
|
|
11204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(RuntimePageShell, { inDrawer, children: [
|
|
11155
11205
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "space-y-6", children: [
|
|
11156
|
-
header
|
|
11157
|
-
SummaryPanel,
|
|
11158
|
-
{
|
|
11159
|
-
title: schema.formMeta.title,
|
|
11160
|
-
eyebrow: formType === "process" ? "\u6D41\u7A0B\u53D1\u8D77" : "\u6570\u636E\u63D0\u4EA4",
|
|
11161
|
-
status: formType === "process" ? { label: "\u5F85\u63D0\u4EA4", tone: "brand" } : void 0
|
|
11162
|
-
}
|
|
11163
|
-
),
|
|
11206
|
+
header,
|
|
11164
11207
|
enableDraft && hasDraft && !submitted && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11165
11208
|
DraftManager,
|
|
11166
11209
|
{
|
|
@@ -11174,7 +11217,8 @@ var InnerFormContent = ({
|
|
|
11174
11217
|
departmentSelector,
|
|
11175
11218
|
beforeForm,
|
|
11176
11219
|
renderForm ? renderForm({ schema, config }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FormRenderer, { columns: 2 }),
|
|
11177
|
-
afterForm
|
|
11220
|
+
afterForm,
|
|
11221
|
+
actionsNode
|
|
11178
11222
|
] }) : successInfo && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11179
11223
|
SubmitSuccessCard,
|
|
11180
11224
|
{
|