openxiangda 1.0.136 → 1.0.138
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/lib/cli.js +687 -5
- package/lib/design-gates.js +16 -3
- package/openxiangda-skills/references/best-practices.md +18 -7
- package/openxiangda-skills/references/component-guide.md +7 -1
- package/openxiangda-skills/references/permission-design-patterns.md +95 -5
- package/openxiangda-skills/references/permissions-settings.md +165 -0
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +87 -0
- package/package.json +1 -1
- package/packages/sdk/dist/{ProcessPreview-Ci8_UsbN.d.mts → ProcessPreview-CZJP8n3e.d.mts} +6 -0
- package/packages/sdk/dist/{ProcessPreview-Ci8_UsbN.d.ts → ProcessPreview-CZJP8n3e.d.ts} +6 -0
- package/packages/sdk/dist/components/index.cjs +143 -16
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.d.mts +8 -2
- package/packages/sdk/dist/components/index.d.ts +8 -2
- package/packages/sdk/dist/components/index.mjs +143 -16
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +169 -25
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +1 -1
- package/packages/sdk/dist/runtime/index.d.ts +1 -1
- package/packages/sdk/dist/runtime/index.mjs +169 -25
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +26 -9
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +13 -3
- package/packages/sdk/dist/runtime/react.d.ts +13 -3
- package/packages/sdk/dist/runtime/react.mjs +26 -9
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
|
@@ -2898,7 +2898,27 @@ var useDataSource = (name, options = {}) => {
|
|
|
2898
2898
|
var import_react6 = require("react");
|
|
2899
2899
|
var EMPTY_SUMMARY = {
|
|
2900
2900
|
fieldPermissions: {},
|
|
2901
|
-
operations: []
|
|
2901
|
+
operations: [],
|
|
2902
|
+
actions: []
|
|
2903
|
+
};
|
|
2904
|
+
var normalizeSummary = (summary) => {
|
|
2905
|
+
const actions = Array.from(
|
|
2906
|
+
/* @__PURE__ */ new Set([...summary?.actions || [], ...summary?.operations || []])
|
|
2907
|
+
);
|
|
2908
|
+
const can = actions.reduce(
|
|
2909
|
+
(result, operation) => {
|
|
2910
|
+
result[operation] = Boolean(summary?.can?.[operation] ?? true);
|
|
2911
|
+
return result;
|
|
2912
|
+
},
|
|
2913
|
+
{}
|
|
2914
|
+
);
|
|
2915
|
+
return {
|
|
2916
|
+
...summary,
|
|
2917
|
+
fieldPermissions: summary?.fieldPermissions || {},
|
|
2918
|
+
operations: actions,
|
|
2919
|
+
actions,
|
|
2920
|
+
can
|
|
2921
|
+
};
|
|
2902
2922
|
};
|
|
2903
2923
|
var toError = (error) => {
|
|
2904
2924
|
if (error instanceof Error) {
|
|
@@ -2932,10 +2952,7 @@ var useFormViewPermissions = (formUuid, options = {}) => {
|
|
|
2932
2952
|
});
|
|
2933
2953
|
const nextSummary = nextResponse.result || EMPTY_SUMMARY;
|
|
2934
2954
|
setResponse(nextResponse);
|
|
2935
|
-
setSummary(
|
|
2936
|
-
fieldPermissions: nextSummary.fieldPermissions || {},
|
|
2937
|
-
operations: nextSummary.operations || []
|
|
2938
|
-
});
|
|
2955
|
+
setSummary(normalizeSummary(nextSummary));
|
|
2939
2956
|
return nextResponse;
|
|
2940
2957
|
} catch (requestError) {
|
|
2941
2958
|
const nextError = toError(requestError);
|
|
@@ -2954,12 +2971,12 @@ var useFormViewPermissions = (formUuid, options = {}) => {
|
|
|
2954
2971
|
void refresh();
|
|
2955
2972
|
}, [immediate, refresh]);
|
|
2956
2973
|
const operationSet = (0, import_react6.useMemo)(
|
|
2957
|
-
() => new Set(summary.operations),
|
|
2958
|
-
[summary.operations]
|
|
2974
|
+
() => new Set(summary.actions || summary.operations),
|
|
2975
|
+
[summary.actions, summary.operations]
|
|
2959
2976
|
);
|
|
2960
2977
|
const can = (0, import_react6.useCallback)(
|
|
2961
|
-
(operation) => operationSet.has(operation),
|
|
2962
|
-
[operationSet]
|
|
2978
|
+
(operation) => Boolean(summary.can?.[operation] ?? operationSet.has(operation)),
|
|
2979
|
+
[operationSet, summary.can]
|
|
2963
2980
|
);
|
|
2964
2981
|
const getFieldPermission = (0, import_react6.useCallback)(
|
|
2965
2982
|
(fieldName) => summary.fieldPermissions[fieldName] || null,
|
|
@@ -21459,6 +21476,16 @@ var StandardFormPage = ({
|
|
|
21459
21476
|
};
|
|
21460
21477
|
|
|
21461
21478
|
// packages/sdk/src/components/core/dataManagementApi.ts
|
|
21479
|
+
var FORM_ACTION_PERMISSIONS = [
|
|
21480
|
+
"view",
|
|
21481
|
+
"create",
|
|
21482
|
+
"edit",
|
|
21483
|
+
"delete",
|
|
21484
|
+
"export",
|
|
21485
|
+
"import",
|
|
21486
|
+
"change_records",
|
|
21487
|
+
"workflow"
|
|
21488
|
+
];
|
|
21462
21489
|
var unwrap = (response) => {
|
|
21463
21490
|
if (response instanceof Blob) return response;
|
|
21464
21491
|
if (response?.data?.result !== void 0) return response.data.result;
|
|
@@ -21467,6 +21494,24 @@ var unwrap = (response) => {
|
|
|
21467
21494
|
return response;
|
|
21468
21495
|
};
|
|
21469
21496
|
var pickData = (value) => value?.data ?? value?.result ?? value;
|
|
21497
|
+
var normalizeActionSummary = (value) => {
|
|
21498
|
+
const raw = pickData(value) || {};
|
|
21499
|
+
const actions = Array.from(
|
|
21500
|
+
/* @__PURE__ */ new Set([...raw.actions || [], ...raw.operations || []])
|
|
21501
|
+
).filter(
|
|
21502
|
+
(action) => FORM_ACTION_PERMISSIONS.includes(action)
|
|
21503
|
+
);
|
|
21504
|
+
const can = FORM_ACTION_PERMISSIONS.reduce((result, action) => {
|
|
21505
|
+
result[action] = Boolean(raw.can?.[action] ?? actions.includes(action));
|
|
21506
|
+
return result;
|
|
21507
|
+
}, {});
|
|
21508
|
+
return {
|
|
21509
|
+
...raw,
|
|
21510
|
+
actions,
|
|
21511
|
+
operations: actions,
|
|
21512
|
+
can
|
|
21513
|
+
};
|
|
21514
|
+
};
|
|
21470
21515
|
var normalizeComponentName = (field) => field?.componentName || field?.component_name || field?.component_type || field?.componentType || field?.type || "TextField";
|
|
21471
21516
|
var normalizeField = (key, field, system = false) => ({
|
|
21472
21517
|
...field,
|
|
@@ -21718,6 +21763,14 @@ async function getDataManagementConfig(request, options) {
|
|
|
21718
21763
|
});
|
|
21719
21764
|
return unwrap(response);
|
|
21720
21765
|
}
|
|
21766
|
+
async function getDataManagementActionSummary(request, params) {
|
|
21767
|
+
const response = await request({
|
|
21768
|
+
url: "/permission/form-group/view-permissions",
|
|
21769
|
+
method: "get",
|
|
21770
|
+
params
|
|
21771
|
+
});
|
|
21772
|
+
return normalizeActionSummary(response);
|
|
21773
|
+
}
|
|
21721
21774
|
async function saveDataManagementConfig(request, options) {
|
|
21722
21775
|
const targetFormUuid = options.menuFormUuid || options.formUuid;
|
|
21723
21776
|
const personal = options.scope === "personal";
|
|
@@ -22778,7 +22831,9 @@ var DataManagementList = ({
|
|
|
22778
22831
|
requestOverride,
|
|
22779
22832
|
allowSchemaFallback = false,
|
|
22780
22833
|
rowActions = [],
|
|
22781
|
-
maxVisibleRowActions
|
|
22834
|
+
maxVisibleRowActions,
|
|
22835
|
+
permissionMode = "auto",
|
|
22836
|
+
actionOverrides
|
|
22782
22837
|
}) => {
|
|
22783
22838
|
const rootRef = (0, import_react82.useRef)(null);
|
|
22784
22839
|
const api = (0, import_react82.useMemo)(() => {
|
|
@@ -22829,6 +22884,9 @@ var DataManagementList = ({
|
|
|
22829
22884
|
const [activeRecord, setActiveRecord] = (0, import_react82.useState)(null);
|
|
22830
22885
|
const [detailOpen, setDetailOpen] = (0, import_react82.useState)(false);
|
|
22831
22886
|
const [submitOpen, setSubmitOpen] = (0, import_react82.useState)(false);
|
|
22887
|
+
const [actionSummary, setActionSummary] = (0, import_react82.useState)(null);
|
|
22888
|
+
const [permissionLoading, setPermissionLoading] = (0, import_react82.useState)(permissionMode === "auto");
|
|
22889
|
+
const [permissionError, setPermissionError] = (0, import_react82.useState)(null);
|
|
22832
22890
|
const fetchStateRef = (0, import_react82.useRef)({});
|
|
22833
22891
|
const isProcessForm = isProcessFormType(formType);
|
|
22834
22892
|
const request = api.request;
|
|
@@ -22844,6 +22902,67 @@ var DataManagementList = ({
|
|
|
22844
22902
|
const confirmDanger = (0, import_react82.useCallback)((title2, content, onOk) => {
|
|
22845
22903
|
if (confirmAction(title2, content)) onOk();
|
|
22846
22904
|
}, []);
|
|
22905
|
+
(0, import_react82.useEffect)(() => {
|
|
22906
|
+
let mounted = true;
|
|
22907
|
+
if (permissionMode !== "auto") {
|
|
22908
|
+
setActionSummary(null);
|
|
22909
|
+
setPermissionLoading(false);
|
|
22910
|
+
setPermissionError(null);
|
|
22911
|
+
return () => {
|
|
22912
|
+
mounted = false;
|
|
22913
|
+
};
|
|
22914
|
+
}
|
|
22915
|
+
if (!appType || !formUuid) return void 0;
|
|
22916
|
+
setPermissionLoading(true);
|
|
22917
|
+
setPermissionError(null);
|
|
22918
|
+
getDataManagementActionSummary(request, { appType, formUuid }).then((summary) => {
|
|
22919
|
+
if (!mounted) return;
|
|
22920
|
+
setActionSummary(summary);
|
|
22921
|
+
}).catch((error) => {
|
|
22922
|
+
if (!mounted) return;
|
|
22923
|
+
setActionSummary(null);
|
|
22924
|
+
setPermissionError(error instanceof Error ? error : new Error(String(error)));
|
|
22925
|
+
}).finally(() => {
|
|
22926
|
+
if (mounted) setPermissionLoading(false);
|
|
22927
|
+
});
|
|
22928
|
+
return () => {
|
|
22929
|
+
mounted = false;
|
|
22930
|
+
};
|
|
22931
|
+
}, [appType, formUuid, permissionMode, request]);
|
|
22932
|
+
const baseActionCan = (0, import_react82.useMemo)(() => {
|
|
22933
|
+
if (permissionMode === "auto") {
|
|
22934
|
+
return FORM_ACTION_PERMISSIONS.reduce((result, action) => {
|
|
22935
|
+
result[action] = Boolean(actionSummary?.can?.[action]);
|
|
22936
|
+
return result;
|
|
22937
|
+
}, {});
|
|
22938
|
+
}
|
|
22939
|
+
return FORM_ACTION_PERMISSIONS.reduce((result, action) => {
|
|
22940
|
+
result[action] = true;
|
|
22941
|
+
return result;
|
|
22942
|
+
}, {});
|
|
22943
|
+
}, [actionSummary?.can, permissionMode]);
|
|
22944
|
+
const canAction = (0, import_react82.useCallback)(
|
|
22945
|
+
(action) => {
|
|
22946
|
+
if (permissionLoading && permissionMode === "auto") return false;
|
|
22947
|
+
if (permissionError && permissionMode === "auto") return action === "view";
|
|
22948
|
+
let allowed = permissionMode === "off" ? true : Boolean(baseActionCan[action]);
|
|
22949
|
+
if (permissionMode === "auto") {
|
|
22950
|
+
allowed = allowed && actionOverrides?.[action] !== false;
|
|
22951
|
+
} else if (actionOverrides?.[action] === false) {
|
|
22952
|
+
allowed = false;
|
|
22953
|
+
}
|
|
22954
|
+
if (readonly && ["create", "edit", "delete", "import"].includes(action)) {
|
|
22955
|
+
return false;
|
|
22956
|
+
}
|
|
22957
|
+
return allowed;
|
|
22958
|
+
},
|
|
22959
|
+
[actionOverrides, baseActionCan, permissionError, permissionLoading, permissionMode, readonly]
|
|
22960
|
+
);
|
|
22961
|
+
const canCreate = canAction("create");
|
|
22962
|
+
const canDelete = canAction("delete");
|
|
22963
|
+
const canExport = canAction("export");
|
|
22964
|
+
const canImport = canAction("import");
|
|
22965
|
+
const canWorkflow = canAction("workflow");
|
|
22847
22966
|
const visibleFields = (0, import_react82.useMemo)(
|
|
22848
22967
|
() => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
|
|
22849
22968
|
[fields, showFields]
|
|
@@ -23087,11 +23206,15 @@ var DataManagementList = ({
|
|
|
23087
23206
|
const handleDelete = (0, import_react82.useCallback)(
|
|
23088
23207
|
async (ids) => {
|
|
23089
23208
|
if (ids.length === 0) return;
|
|
23209
|
+
if (!canDelete) {
|
|
23210
|
+
import_antd39.message.error("\u65E0\u6743\u9650\u5220\u9664\u6570\u636E");
|
|
23211
|
+
return;
|
|
23212
|
+
}
|
|
23090
23213
|
await deleteDataManagementRows(request, { appType, formUuid, formInstanceIds: ids });
|
|
23091
23214
|
setSelectedRowKeys([]);
|
|
23092
23215
|
await loadData({ current, pageSize });
|
|
23093
23216
|
},
|
|
23094
|
-
[appType, current, formUuid, loadData, pageSize, request]
|
|
23217
|
+
[appType, canDelete, current, formUuid, loadData, pageSize, request]
|
|
23095
23218
|
);
|
|
23096
23219
|
const getSelectedRecordIds = (0, import_react82.useCallback)(
|
|
23097
23220
|
() => selectedRowKeys.map((key) => {
|
|
@@ -23131,6 +23254,10 @@ var DataManagementList = ({
|
|
|
23131
23254
|
}
|
|
23132
23255
|
};
|
|
23133
23256
|
const handleExport = async (scope) => {
|
|
23257
|
+
if (!canExport) {
|
|
23258
|
+
import_antd39.message.error("\u65E0\u6743\u9650\u5BFC\u51FA\u6570\u636E");
|
|
23259
|
+
return;
|
|
23260
|
+
}
|
|
23134
23261
|
const selectedIds = scope === "selected" ? getSelectedRecordIds() : [];
|
|
23135
23262
|
if (scope === "selected" && selectedIds.length === 0) {
|
|
23136
23263
|
import_antd39.message.warning("\u8BF7\u5148\u9009\u62E9\u8981\u5BFC\u51FA\u7684\u8BB0\u5F55");
|
|
@@ -23169,6 +23296,10 @@ var DataManagementList = ({
|
|
|
23169
23296
|
}
|
|
23170
23297
|
};
|
|
23171
23298
|
const handleDownloadTemplate = async () => {
|
|
23299
|
+
if (!canImport) {
|
|
23300
|
+
import_antd39.message.error("\u65E0\u6743\u9650\u5BFC\u5165\u6570\u636E");
|
|
23301
|
+
return;
|
|
23302
|
+
}
|
|
23172
23303
|
setTemplateDownloading(true);
|
|
23173
23304
|
try {
|
|
23174
23305
|
const response = await downloadDataManagementImportTemplate(request, { appType, formUuid });
|
|
@@ -23182,6 +23313,8 @@ var DataManagementList = ({
|
|
|
23182
23313
|
}
|
|
23183
23314
|
};
|
|
23184
23315
|
const loadTransferRecords = async (type) => {
|
|
23316
|
+
if (type === "import" && !canImport) return;
|
|
23317
|
+
if (type === "export" && !canExport) return;
|
|
23185
23318
|
setRecordTab(type);
|
|
23186
23319
|
setRecordsOpen(true);
|
|
23187
23320
|
const result = await getDataManagementTransferRecords(request, {
|
|
@@ -23194,6 +23327,10 @@ var DataManagementList = ({
|
|
|
23194
23327
|
setTransferRecords(result.records);
|
|
23195
23328
|
};
|
|
23196
23329
|
const handleImportPreview = async (file) => {
|
|
23330
|
+
if (!canImport) {
|
|
23331
|
+
import_antd39.message.error("\u65E0\u6743\u9650\u5BFC\u5165\u6570\u636E");
|
|
23332
|
+
return import_antd39.Upload.LIST_IGNORE;
|
|
23333
|
+
}
|
|
23197
23334
|
const base64 = await fileToBase64(file);
|
|
23198
23335
|
setImportBase64(base64);
|
|
23199
23336
|
const result = await importPreviewDataManagementRows(request, {
|
|
@@ -23207,6 +23344,10 @@ var DataManagementList = ({
|
|
|
23207
23344
|
};
|
|
23208
23345
|
const handleImportConfirm = async () => {
|
|
23209
23346
|
if (!importBase64) return;
|
|
23347
|
+
if (!canImport) {
|
|
23348
|
+
import_antd39.message.error("\u65E0\u6743\u9650\u5BFC\u5165\u6570\u636E");
|
|
23349
|
+
return;
|
|
23350
|
+
}
|
|
23210
23351
|
await importDataManagementRows(request, { appType, formUuid, fileBase64: importBase64 });
|
|
23211
23352
|
import_antd39.message.success("\u5BFC\u5165\u4EFB\u52A1\u5DF2\u521B\u5EFA");
|
|
23212
23353
|
setImportOpen(false);
|
|
@@ -23215,7 +23356,7 @@ var DataManagementList = ({
|
|
|
23215
23356
|
await loadData({ current: 1, pageSize });
|
|
23216
23357
|
};
|
|
23217
23358
|
const visibleRowActionLimit = normalizeMaxVisibleRowActions(maxVisibleRowActions);
|
|
23218
|
-
const rowActionCount = 1 + rowActions.length + (
|
|
23359
|
+
const rowActionCount = 1 + rowActions.filter((action) => !action.requiredAction || canAction(action.requiredAction)).length + (canDelete ? 1 : 0) + (isProcessForm && canWorkflow ? 1 : 0);
|
|
23219
23360
|
const actionColumnWidth = Math.max(
|
|
23220
23361
|
ACTION_COLUMN_MIN_WIDTH,
|
|
23221
23362
|
Math.min(rowActionCount, visibleRowActionLimit) * ACTION_BUTTON_ESTIMATED_WIDTH + (rowActionCount > visibleRowActionLimit ? ACTION_MORE_BUTTON_WIDTH : 0) + ACTION_COLUMN_HORIZONTAL_PADDING
|
|
@@ -23255,13 +23396,13 @@ var DataManagementList = ({
|
|
|
23255
23396
|
label: "\u8BE6\u60C5",
|
|
23256
23397
|
onClick: () => handleDetail(record)
|
|
23257
23398
|
},
|
|
23258
|
-
...rowActions.map((action) => ({
|
|
23399
|
+
...rowActions.filter((action) => !action.requiredAction || canAction(action.requiredAction)).map((action) => ({
|
|
23259
23400
|
key: action.key,
|
|
23260
23401
|
label: action.label,
|
|
23261
23402
|
danger: action.danger,
|
|
23262
23403
|
onClick: () => action.onClick(record)
|
|
23263
23404
|
})),
|
|
23264
|
-
|
|
23405
|
+
...canDelete ? [
|
|
23265
23406
|
{
|
|
23266
23407
|
key: "delete",
|
|
23267
23408
|
label: "\u5220\u9664",
|
|
@@ -23274,7 +23415,7 @@ var DataManagementList = ({
|
|
|
23274
23415
|
)
|
|
23275
23416
|
}
|
|
23276
23417
|
] : [],
|
|
23277
|
-
...isProcessForm ? [
|
|
23418
|
+
...isProcessForm && canWorkflow ? [
|
|
23278
23419
|
{
|
|
23279
23420
|
key: "workflow",
|
|
23280
23421
|
label: "\u6D41\u7A0B\u65E5\u5FD7",
|
|
@@ -23335,7 +23476,9 @@ var DataManagementList = ({
|
|
|
23335
23476
|
handleDetail,
|
|
23336
23477
|
isProcessForm,
|
|
23337
23478
|
lockFieldIds,
|
|
23338
|
-
|
|
23479
|
+
canAction,
|
|
23480
|
+
canDelete,
|
|
23481
|
+
canWorkflow,
|
|
23339
23482
|
rowActions,
|
|
23340
23483
|
updateColumnWidth,
|
|
23341
23484
|
visibleRowActionLimit,
|
|
@@ -23375,7 +23518,7 @@ var DataManagementList = ({
|
|
|
23375
23518
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "mx-auto flex min-h-0 w-full max-w-[1440px] flex-col px-4 py-4 md:px-6", children: [
|
|
23376
23519
|
title && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("h2", { className: "m-0 text-xl font-semibold text-ant-color-text", children: title }) }),
|
|
23377
23520
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "mb-4 flex flex-col gap-3 md:flex-row md:items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_antd39.Space, { wrap: true, children: [
|
|
23378
|
-
|
|
23521
|
+
canCreate && (submitRenderer || runtimeFormSchema) && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_antd39.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.PlusOutlined, {}), type: "primary", onClick: () => setSubmitOpen(true), children: "\u65B0\u589E" }),
|
|
23379
23522
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23380
23523
|
import_antd39.Input.Search,
|
|
23381
23524
|
{
|
|
@@ -23401,7 +23544,7 @@ var DataManagementList = ({
|
|
|
23401
23544
|
),
|
|
23402
23545
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_antd39.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.FilterOutlined, {}), onClick: () => setFilterOpen(true), children: "\u7B5B\u9009" }),
|
|
23403
23546
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_antd39.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.SettingOutlined, {}), onClick: () => setColumnOpen(true), children: "\u5217\u8BBE\u7F6E" }),
|
|
23404
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23547
|
+
canExport && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23405
23548
|
import_antd39.Dropdown,
|
|
23406
23549
|
{
|
|
23407
23550
|
getPopupContainer,
|
|
@@ -23426,7 +23569,7 @@ var DataManagementList = ({
|
|
|
23426
23569
|
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_antd39.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.DownloadOutlined, {}), children: "\u5BFC\u51FA" })
|
|
23427
23570
|
}
|
|
23428
23571
|
),
|
|
23429
|
-
|
|
23572
|
+
canImport && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23430
23573
|
import_antd39.Dropdown,
|
|
23431
23574
|
{
|
|
23432
23575
|
getPopupContainer,
|
|
@@ -23452,7 +23595,7 @@ var DataManagementList = ({
|
|
|
23452
23595
|
" \u6761"
|
|
23453
23596
|
] }),
|
|
23454
23597
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_antd39.Space, { wrap: true, children: [
|
|
23455
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23598
|
+
canExport && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23456
23599
|
import_antd39.Button,
|
|
23457
23600
|
{
|
|
23458
23601
|
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.DownloadOutlined, {}),
|
|
@@ -23464,8 +23607,8 @@ var DataManagementList = ({
|
|
|
23464
23607
|
children: "\u5BFC\u51FA\u9009\u4E2D"
|
|
23465
23608
|
}
|
|
23466
23609
|
),
|
|
23467
|
-
|
|
23468
|
-
|
|
23610
|
+
isProcessForm && canWorkflow && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_antd39.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.SwapOutlined, {}), onClick: handleBatchApprove, children: "\u6279\u91CF\u5BA1\u6279" }),
|
|
23611
|
+
canDelete && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
23469
23612
|
import_antd39.Button,
|
|
23470
23613
|
{
|
|
23471
23614
|
danger: true,
|
|
@@ -23770,7 +23913,7 @@ var DataManagementList = ({
|
|
|
23770
23913
|
width: 720,
|
|
23771
23914
|
onCancel: () => setImportOpen(false),
|
|
23772
23915
|
onOk: handleImportConfirm,
|
|
23773
|
-
okButtonProps: { disabled: !importBase64 },
|
|
23916
|
+
okButtonProps: { disabled: !importBase64 || !canImport },
|
|
23774
23917
|
okText: "\u786E\u8BA4\u5BFC\u5165",
|
|
23775
23918
|
children: [
|
|
23776
23919
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "mb-3 flex flex-col gap-3 rounded-lg border border-ant-border-secondary bg-ant-bg-container px-4 py-3 md:flex-row md:items-center md:justify-between", children: [
|
|
@@ -23783,6 +23926,7 @@ var DataManagementList = ({
|
|
|
23783
23926
|
{
|
|
23784
23927
|
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons17.DownloadOutlined, {}),
|
|
23785
23928
|
loading: templateDownloading,
|
|
23929
|
+
disabled: !canImport,
|
|
23786
23930
|
onClick: handleDownloadTemplate,
|
|
23787
23931
|
children: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F"
|
|
23788
23932
|
}
|
|
@@ -23833,8 +23977,8 @@ var DataManagementList = ({
|
|
|
23833
23977
|
{
|
|
23834
23978
|
value: recordTab,
|
|
23835
23979
|
options: [
|
|
23836
|
-
{ label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" },
|
|
23837
|
-
{ label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }
|
|
23980
|
+
...canImport ? [{ label: "\u5BFC\u5165\u8BB0\u5F55", value: "import" }] : [],
|
|
23981
|
+
...canExport ? [{ label: "\u5BFC\u51FA\u8BB0\u5F55", value: "export" }] : []
|
|
23838
23982
|
],
|
|
23839
23983
|
onChange: (value) => loadTransferRecords(value)
|
|
23840
23984
|
}
|