@nokecy/qc-ui 1.0.58 → 1.0.60
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/cjs/ag-grid-plus/ag-gridPlus.js +2 -4
- package/dist/cjs/array-table/index.js +194 -7
- package/dist/cjs/deleteConfirm/index.d.ts +31 -0
- package/dist/cjs/deleteConfirm/index.js +64 -0
- package/dist/cjs/editable/index.js +104 -21
- package/dist/cjs/fullScreenAlert/index.d.ts +25 -4
- package/dist/cjs/fullScreenAlert/index.js +50 -17
- package/dist/cjs/generatedListPage/ConfigurableToolbar.d.ts +35 -0
- package/dist/cjs/generatedListPage/ConfigurableToolbar.js +179 -0
- package/dist/cjs/generatedListPage/GeneratedListPage.d.ts +8 -0
- package/dist/cjs/generatedListPage/GeneratedListPage.js +545 -0
- package/dist/cjs/generatedListPage/OptionsColumn.d.ts +9 -0
- package/dist/cjs/generatedListPage/OptionsColumn.js +135 -0
- package/dist/cjs/generatedListPage/PerformanceMonitor.d.ts +55 -0
- package/dist/cjs/generatedListPage/PerformanceMonitor.js +277 -0
- package/dist/cjs/generatedListPage/RequestManager.d.ts +97 -0
- package/dist/cjs/generatedListPage/RequestManager.js +404 -0
- package/dist/cjs/generatedListPage/_utils/AccessWrapper.d.ts +16 -0
- package/dist/cjs/generatedListPage/_utils/AccessWrapper.js +26 -0
- package/dist/cjs/generatedListPage/_utils/defaultHandlers.d.ts +22 -0
- package/dist/cjs/generatedListPage/_utils/defaultHandlers.js +127 -0
- package/dist/cjs/generatedListPage/index.d.ts +20 -0
- package/dist/cjs/generatedListPage/index.js +92 -0
- package/dist/cjs/generatedListPage/types.d.ts +221 -0
- package/dist/cjs/generatedListPage/types.js +5 -0
- package/dist/cjs/generatedListPage/usePermissionCheck.d.ts +66 -0
- package/dist/cjs/generatedListPage/usePermissionCheck.js +150 -0
- package/dist/cjs/generatedListPage/useRequestManager.d.ts +35 -0
- package/dist/cjs/generatedListPage/useRequestManager.js +121 -0
- package/dist/cjs/importModal/index.d.ts +21 -3
- package/dist/cjs/importModal/index.js +30 -10
- package/dist/cjs/index.d.ts +9 -1
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/standardFormDialog/FormValidation.d.ts +150 -0
- package/dist/cjs/standardFormDialog/FormValidation.js +229 -0
- package/dist/cjs/standardFormDialog/PortalManager.d.ts +94 -0
- package/dist/cjs/standardFormDialog/PortalManager.js +259 -0
- package/dist/cjs/standardFormDialog/StandardFormDialog.d.ts +10 -0
- package/dist/cjs/standardFormDialog/StandardFormDialog.js +516 -0
- package/dist/cjs/standardFormDialog/index.d.ts +7 -0
- package/dist/cjs/standardFormDialog/index.js +83 -0
- package/dist/cjs/standardFormDialog/types.d.ts +107 -0
- package/dist/cjs/standardFormDialog/types.js +5 -0
- package/dist/cjs/standardFormDialog/useStandardFormSchema.d.ts +68 -0
- package/dist/cjs/standardFormDialog/useStandardFormSchema.js +197 -0
- package/dist/cjs/standardFormDialog/withStandardForm.d.ts +193 -0
- package/dist/cjs/standardFormDialog/withStandardForm.js +388 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +2 -4
- package/dist/esm/array-table/index.js +194 -7
- package/dist/esm/deleteConfirm/index.d.ts +31 -0
- package/dist/esm/deleteConfirm/index.js +57 -0
- package/dist/esm/editable/index.js +105 -22
- package/dist/esm/fullScreenAlert/index.d.ts +25 -4
- package/dist/esm/fullScreenAlert/index.js +50 -18
- package/dist/esm/generatedListPage/ConfigurableToolbar.d.ts +35 -0
- package/dist/esm/generatedListPage/ConfigurableToolbar.js +171 -0
- package/dist/esm/generatedListPage/GeneratedListPage.d.ts +8 -0
- package/dist/esm/generatedListPage/GeneratedListPage.js +535 -0
- package/dist/esm/generatedListPage/OptionsColumn.d.ts +9 -0
- package/dist/esm/generatedListPage/OptionsColumn.js +127 -0
- package/dist/esm/generatedListPage/PerformanceMonitor.d.ts +55 -0
- package/dist/esm/generatedListPage/PerformanceMonitor.js +272 -0
- package/dist/esm/generatedListPage/RequestManager.d.ts +97 -0
- package/dist/esm/generatedListPage/RequestManager.js +398 -0
- package/dist/esm/generatedListPage/_utils/AccessWrapper.d.ts +16 -0
- package/dist/esm/generatedListPage/_utils/AccessWrapper.js +20 -0
- package/dist/esm/generatedListPage/_utils/defaultHandlers.d.ts +22 -0
- package/dist/esm/generatedListPage/_utils/defaultHandlers.js +122 -0
- package/dist/esm/generatedListPage/index.d.ts +20 -0
- package/dist/esm/generatedListPage/index.js +26 -0
- package/dist/esm/generatedListPage/types.d.ts +221 -0
- package/dist/esm/generatedListPage/types.js +1 -0
- package/dist/esm/generatedListPage/usePermissionCheck.d.ts +66 -0
- package/dist/esm/generatedListPage/usePermissionCheck.js +145 -0
- package/dist/esm/generatedListPage/useRequestManager.d.ts +35 -0
- package/dist/esm/generatedListPage/useRequestManager.js +116 -0
- package/dist/esm/importModal/index.d.ts +21 -3
- package/dist/esm/importModal/index.js +29 -10
- package/dist/esm/index.d.ts +9 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/standardFormDialog/FormValidation.d.ts +150 -0
- package/dist/esm/standardFormDialog/FormValidation.js +223 -0
- package/dist/esm/standardFormDialog/PortalManager.d.ts +94 -0
- package/dist/esm/standardFormDialog/PortalManager.js +253 -0
- package/dist/esm/standardFormDialog/StandardFormDialog.d.ts +10 -0
- package/dist/esm/standardFormDialog/StandardFormDialog.js +508 -0
- package/dist/esm/standardFormDialog/index.d.ts +7 -0
- package/dist/esm/standardFormDialog/index.js +6 -0
- package/dist/esm/standardFormDialog/types.d.ts +107 -0
- package/dist/esm/standardFormDialog/types.js +1 -0
- package/dist/esm/standardFormDialog/useStandardFormSchema.d.ts +68 -0
- package/dist/esm/standardFormDialog/useStandardFormSchema.js +191 -0
- package/dist/esm/standardFormDialog/withStandardForm.d.ts +193 -0
- package/dist/esm/standardFormDialog/withStandardForm.js +382 -0
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withStandardForm = exports.default = exports.createSelectField = exports.createCascaderField = exports.FieldCreators = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _StandardFormDialog = _interopRequireDefault(require("./StandardFormDialog"));
|
|
9
|
+
var _excluded = ["entityId", "title", "width", "onAfterSubmit", "children", "buttonProps"];
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
/**
|
|
21
|
+
* 标准表单配置接口 - 向后兼容
|
|
22
|
+
* @deprecated 请使用 WithStandardFormConfig 类型
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 重新导出类型以保持向后兼容性
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 创建带有标准表单的高阶组件
|
|
31
|
+
*
|
|
32
|
+
* 这个工厂函数创建一个标准化的表单对话框组件,包含:
|
|
33
|
+
* - 支持外部Schema文件导入或自动Schema构建
|
|
34
|
+
* - 标准的 API 调用逻辑
|
|
35
|
+
* - 统一的错误处理
|
|
36
|
+
* - 可配置的业务字段
|
|
37
|
+
*
|
|
38
|
+
* @param config 标准表单配置
|
|
39
|
+
* @returns 标准表单对话框组件
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // 使用businessFields(内部构建schema)
|
|
43
|
+
* const FormDialog = withStandardForm({
|
|
44
|
+
* formId: 'Common.Materials',
|
|
45
|
+
* businessFields: {
|
|
46
|
+
* code: FieldCreators.input('物料编码', true),
|
|
47
|
+
* name: FieldCreators.input('物料名称', true)
|
|
48
|
+
* },
|
|
49
|
+
* apiConfig: { get: GetAsync, create: CreateAsync }
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // 使用外部schema文件
|
|
54
|
+
* import { form, schema } from './schema';
|
|
55
|
+
* const FormDialog = withStandardForm({
|
|
56
|
+
* formId: 'Common.Materials',
|
|
57
|
+
* externalSchema: { form, schema },
|
|
58
|
+
* apiConfig: { get: GetAsync, create: CreateAsync }
|
|
59
|
+
* });
|
|
60
|
+
*/
|
|
61
|
+
var withStandardForm = exports.withStandardForm = function withStandardForm(config) {
|
|
62
|
+
var formId = config.formId,
|
|
63
|
+
businessFields = config.businessFields,
|
|
64
|
+
externalSchema = config.externalSchema,
|
|
65
|
+
apiConfig = config.apiConfig,
|
|
66
|
+
_config$defaultDialog = config.defaultDialogConfig,
|
|
67
|
+
defaultDialogConfig = _config$defaultDialog === void 0 ? {} : _config$defaultDialog,
|
|
68
|
+
_config$customHandler = config.customHandlers,
|
|
69
|
+
customHandlers = _config$customHandler === void 0 ? {} : _config$customHandler;
|
|
70
|
+
|
|
71
|
+
// 验证配置
|
|
72
|
+
if (!externalSchema && !businessFields) {
|
|
73
|
+
throw new Error("withStandardForm: formId \"".concat(formId, "\" \u5FC5\u987B\u63D0\u4F9B businessFields \u6216 externalSchema \u5176\u4E2D\u4E4B\u4E00"));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 使用外部Schema或构建内部Schema
|
|
77
|
+
var finalFormConfig;
|
|
78
|
+
var finalFormSchema;
|
|
79
|
+
if (externalSchema) {
|
|
80
|
+
// 使用外部传入的schema配置
|
|
81
|
+
finalFormConfig = externalSchema.form;
|
|
82
|
+
finalFormSchema = externalSchema.schema;
|
|
83
|
+
console.log("\u2705 withStandardForm: ".concat(formId, " \u4F7F\u7528\u5916\u90E8Schema\u914D\u7F6E"));
|
|
84
|
+
} else {
|
|
85
|
+
// 构建表单 Schema(向后兼容)
|
|
86
|
+
finalFormSchema = {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: _objectSpread(_objectSpread({
|
|
89
|
+
// 系统字段
|
|
90
|
+
id: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
'x-component': 'Input',
|
|
93
|
+
'x-display': 'hidden'
|
|
94
|
+
}
|
|
95
|
+
}, businessFields), {}, {
|
|
96
|
+
// 审计字段(如果需要)
|
|
97
|
+
creationTime: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
title: '创建时间',
|
|
100
|
+
'x-component': 'DatePicker',
|
|
101
|
+
'x-component-props': {
|
|
102
|
+
format: 'YYYY-MM-DD HH:mm:ss',
|
|
103
|
+
showTime: true,
|
|
104
|
+
disabled: true
|
|
105
|
+
},
|
|
106
|
+
'x-display': 'hidden'
|
|
107
|
+
},
|
|
108
|
+
lastModificationTime: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
title: '最后修改时间',
|
|
111
|
+
'x-component': 'DatePicker',
|
|
112
|
+
'x-component-props': {
|
|
113
|
+
format: 'YYYY-MM-DD HH:mm:ss',
|
|
114
|
+
showTime: true,
|
|
115
|
+
disabled: true
|
|
116
|
+
},
|
|
117
|
+
'x-display': 'hidden'
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// 表单布局配置(向后兼容)
|
|
123
|
+
finalFormConfig = {
|
|
124
|
+
labelCol: 6,
|
|
125
|
+
wrapperCol: 16,
|
|
126
|
+
colon: false,
|
|
127
|
+
layout: 'horizontal',
|
|
128
|
+
// FormGrid 配置
|
|
129
|
+
grid: {
|
|
130
|
+
strictAutoFit: true,
|
|
131
|
+
minColumns: 1,
|
|
132
|
+
maxColumns: 2
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
console.log("\u2705 withStandardForm: ".concat(formId, " \u4F7F\u7528\u5185\u90E8\u6784\u5EFASchema"));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// 创建标准表单组件
|
|
139
|
+
var StandardFormComponent = function StandardFormComponent(props) {
|
|
140
|
+
var entityId = props.entityId,
|
|
141
|
+
_props$title = props.title,
|
|
142
|
+
title = _props$title === void 0 ? defaultDialogConfig.title || '表单' : _props$title,
|
|
143
|
+
_props$width = props.width,
|
|
144
|
+
width = _props$width === void 0 ? defaultDialogConfig.width || 800 : _props$width,
|
|
145
|
+
onAfterSubmit = props.onAfterSubmit,
|
|
146
|
+
children = props.children,
|
|
147
|
+
buttonProps = props.buttonProps,
|
|
148
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
149
|
+
return /*#__PURE__*/_react.default.createElement(_StandardFormDialog.default, _extends({
|
|
150
|
+
schemaConfig: {
|
|
151
|
+
formId: formId,
|
|
152
|
+
form: finalFormConfig,
|
|
153
|
+
schema: finalFormSchema
|
|
154
|
+
},
|
|
155
|
+
apiConfig: apiConfig,
|
|
156
|
+
entityId: entityId,
|
|
157
|
+
title: title,
|
|
158
|
+
width: width,
|
|
159
|
+
onAfterSubmit: onAfterSubmit,
|
|
160
|
+
buttonProps: buttonProps,
|
|
161
|
+
customInitializer: customHandlers.initializer,
|
|
162
|
+
customSubmitHandler: customHandlers.submitHandler
|
|
163
|
+
}, restProps), children);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// 设置组件显示名称
|
|
167
|
+
StandardFormComponent.displayName = "withStandardForm(".concat(formId, ")");
|
|
168
|
+
return StandardFormComponent;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 字段创建器工具函数集合
|
|
173
|
+
* 提供常用字段类型的快速创建方法
|
|
174
|
+
*/
|
|
175
|
+
var FieldCreators = exports.FieldCreators = {
|
|
176
|
+
/**
|
|
177
|
+
* 输入框字段
|
|
178
|
+
*/
|
|
179
|
+
input: function input(title) {
|
|
180
|
+
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
181
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
182
|
+
return {
|
|
183
|
+
type: 'string',
|
|
184
|
+
title: title,
|
|
185
|
+
required: required,
|
|
186
|
+
'x-component': 'Input',
|
|
187
|
+
'x-component-props': _objectSpread({
|
|
188
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(title)
|
|
189
|
+
}, props)
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* 数字输入字段
|
|
194
|
+
*/
|
|
195
|
+
number: function number(title) {
|
|
196
|
+
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
197
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
198
|
+
return {
|
|
199
|
+
type: 'number',
|
|
200
|
+
title: title,
|
|
201
|
+
required: required,
|
|
202
|
+
'x-component': 'NumberPicker',
|
|
203
|
+
'x-component-props': _objectSpread({
|
|
204
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(title),
|
|
205
|
+
style: {
|
|
206
|
+
width: '100%'
|
|
207
|
+
}
|
|
208
|
+
}, props)
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* 文本域字段
|
|
213
|
+
*/
|
|
214
|
+
textarea: function textarea(title) {
|
|
215
|
+
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
216
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
217
|
+
return {
|
|
218
|
+
type: 'string',
|
|
219
|
+
title: title,
|
|
220
|
+
required: required,
|
|
221
|
+
'x-component': 'Input.TextArea',
|
|
222
|
+
'x-component-props': _objectSpread({
|
|
223
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(title),
|
|
224
|
+
rows: 4,
|
|
225
|
+
maxLength: 500,
|
|
226
|
+
showCount: true
|
|
227
|
+
}, props)
|
|
228
|
+
};
|
|
229
|
+
},
|
|
230
|
+
/**
|
|
231
|
+
* 日期字段
|
|
232
|
+
*/
|
|
233
|
+
date: function date(title) {
|
|
234
|
+
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
235
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
236
|
+
return {
|
|
237
|
+
type: 'string',
|
|
238
|
+
title: title,
|
|
239
|
+
required: required,
|
|
240
|
+
'x-component': 'DatePicker',
|
|
241
|
+
'x-component-props': _objectSpread({
|
|
242
|
+
placeholder: "\u8BF7\u9009\u62E9".concat(title),
|
|
243
|
+
style: {
|
|
244
|
+
width: '100%'
|
|
245
|
+
},
|
|
246
|
+
format: 'YYYY-MM-DD'
|
|
247
|
+
}, props)
|
|
248
|
+
};
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* 日期时间字段
|
|
252
|
+
*/
|
|
253
|
+
datetime: function datetime(title) {
|
|
254
|
+
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
255
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
256
|
+
return {
|
|
257
|
+
type: 'string',
|
|
258
|
+
title: title,
|
|
259
|
+
required: required,
|
|
260
|
+
'x-component': 'DatePicker',
|
|
261
|
+
'x-component-props': _objectSpread({
|
|
262
|
+
placeholder: "\u8BF7\u9009\u62E9".concat(title),
|
|
263
|
+
style: {
|
|
264
|
+
width: '100%'
|
|
265
|
+
},
|
|
266
|
+
format: 'YYYY-MM-DD HH:mm:ss',
|
|
267
|
+
showTime: true
|
|
268
|
+
}, props)
|
|
269
|
+
};
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* 开关字段
|
|
273
|
+
*/
|
|
274
|
+
switch: function _switch(title) {
|
|
275
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
276
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
277
|
+
return {
|
|
278
|
+
type: 'boolean',
|
|
279
|
+
title: title,
|
|
280
|
+
default: defaultValue,
|
|
281
|
+
'x-component': 'Switch',
|
|
282
|
+
'x-component-props': props
|
|
283
|
+
};
|
|
284
|
+
},
|
|
285
|
+
/**
|
|
286
|
+
* 选择字段
|
|
287
|
+
*/
|
|
288
|
+
select: function select(title) {
|
|
289
|
+
var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
290
|
+
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
291
|
+
return {
|
|
292
|
+
type: 'string',
|
|
293
|
+
title: title,
|
|
294
|
+
required: required,
|
|
295
|
+
'x-component': 'Select',
|
|
296
|
+
'x-component-props': _objectSpread({
|
|
297
|
+
placeholder: "\u8BF7\u9009\u62E9".concat(title),
|
|
298
|
+
style: {
|
|
299
|
+
width: '100%'
|
|
300
|
+
},
|
|
301
|
+
allowClear: true
|
|
302
|
+
}, props)
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
/**
|
|
306
|
+
* 隐藏字段
|
|
307
|
+
*/
|
|
308
|
+
hidden: function hidden() {
|
|
309
|
+
var defaultValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
|
|
310
|
+
return {
|
|
311
|
+
type: 'string',
|
|
312
|
+
default: defaultValue,
|
|
313
|
+
'x-component': 'Input',
|
|
314
|
+
'x-display': 'hidden'
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* 创建选择字段
|
|
321
|
+
*/
|
|
322
|
+
var createSelectField = exports.createSelectField = function createSelectField(title, options) {
|
|
323
|
+
var _options$;
|
|
324
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
325
|
+
var _config$required = config.required,
|
|
326
|
+
required = _config$required === void 0 ? false : _config$required,
|
|
327
|
+
_config$multiple = config.multiple,
|
|
328
|
+
multiple = _config$multiple === void 0 ? false : _config$multiple,
|
|
329
|
+
_config$allowClear = config.allowClear,
|
|
330
|
+
allowClear = _config$allowClear === void 0 ? true : _config$allowClear,
|
|
331
|
+
_config$showSearch = config.showSearch,
|
|
332
|
+
showSearch = _config$showSearch === void 0 ? false : _config$showSearch,
|
|
333
|
+
placeholder = config.placeholder;
|
|
334
|
+
return {
|
|
335
|
+
type: multiple ? 'array' : _typeof((_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
|
336
|
+
title: title,
|
|
337
|
+
required: required,
|
|
338
|
+
enum: options.map(function (opt) {
|
|
339
|
+
return opt.value;
|
|
340
|
+
}),
|
|
341
|
+
'x-component': 'Select',
|
|
342
|
+
'x-component-props': {
|
|
343
|
+
placeholder: placeholder || "\u8BF7\u9009\u62E9".concat(title),
|
|
344
|
+
style: {
|
|
345
|
+
width: '100%'
|
|
346
|
+
},
|
|
347
|
+
allowClear: allowClear,
|
|
348
|
+
showSearch: showSearch,
|
|
349
|
+
mode: multiple ? 'multiple' : undefined,
|
|
350
|
+
options: options.map(function (opt) {
|
|
351
|
+
return {
|
|
352
|
+
label: opt.label,
|
|
353
|
+
value: opt.value
|
|
354
|
+
};
|
|
355
|
+
})
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* 创建级联选择字段
|
|
362
|
+
*/
|
|
363
|
+
var createCascaderField = exports.createCascaderField = function createCascaderField(title, options) {
|
|
364
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
365
|
+
var _config$required2 = config.required,
|
|
366
|
+
required = _config$required2 === void 0 ? false : _config$required2,
|
|
367
|
+
_config$changeOnSelec = config.changeOnSelect,
|
|
368
|
+
changeOnSelect = _config$changeOnSelec === void 0 ? false : _config$changeOnSelec,
|
|
369
|
+
_config$expandTrigger = config.expandTrigger,
|
|
370
|
+
expandTrigger = _config$expandTrigger === void 0 ? 'click' : _config$expandTrigger,
|
|
371
|
+
placeholder = config.placeholder;
|
|
372
|
+
return {
|
|
373
|
+
type: 'array',
|
|
374
|
+
title: title,
|
|
375
|
+
required: required,
|
|
376
|
+
'x-component': 'Cascader',
|
|
377
|
+
'x-component-props': {
|
|
378
|
+
placeholder: placeholder || "\u8BF7\u9009\u62E9".concat(title),
|
|
379
|
+
style: {
|
|
380
|
+
width: '100%'
|
|
381
|
+
},
|
|
382
|
+
options: options,
|
|
383
|
+
changeOnSelect: changeOnSelect,
|
|
384
|
+
expandTrigger: expandTrigger
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
var _default = exports.default = withStandardForm;
|
|
@@ -397,10 +397,8 @@ function AgGridPlus(props) {
|
|
|
397
397
|
var shouldCalculate = !valueEnum || valueEnum.length === 0;
|
|
398
398
|
return {
|
|
399
399
|
type: "number",
|
|
400
|
-
calculateType: shouldCalculate ? "sum" : false
|
|
401
|
-
cellStyle: {
|
|
402
|
-
'text-align': 'right'
|
|
403
|
-
}
|
|
400
|
+
calculateType: shouldCalculate ? "sum" : false
|
|
401
|
+
// cellStyle: { 'text-align': 'right' }
|
|
404
402
|
};
|
|
405
403
|
}
|
|
406
404
|
return undefined;
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
7
8
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
8
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
10
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -54,8 +55,7 @@ var ArrayTable = observer(function (props) {
|
|
|
54
55
|
var addition = useAddition();
|
|
55
56
|
var _useGridPlusColumnSta = useGridPlusColumnState(),
|
|
56
57
|
onSaveColumnState = _useGridPlusColumnSta.onSaveColumnState,
|
|
57
|
-
gridPlusColumnState = _useGridPlusColumnSta.columnState
|
|
58
|
-
extensibleColumns = _useGridPlusColumnSta.extensibleColumns;
|
|
58
|
+
gridPlusColumnState = _useGridPlusColumnSta.columnState;
|
|
59
59
|
useEffect(function () {
|
|
60
60
|
if (props.gridKey && gridPlusColumnState && gridPlusColumnState[props.gridKey] && apiRef.current) {
|
|
61
61
|
setTimeout(function () {
|
|
@@ -65,7 +65,7 @@ var ArrayTable = observer(function (props) {
|
|
|
65
65
|
});
|
|
66
66
|
}, 10);
|
|
67
67
|
}
|
|
68
|
-
}, [gridPlusColumnState,
|
|
68
|
+
}, [gridPlusColumnState, props.gridKey]);
|
|
69
69
|
|
|
70
70
|
//@ts-ignore
|
|
71
71
|
if (columns.length > 0) {
|
|
@@ -92,12 +92,88 @@ var ArrayTable = observer(function (props) {
|
|
|
92
92
|
arr.splice(fromIndex, 1);
|
|
93
93
|
arr.splice(toIndex, 0, element);
|
|
94
94
|
}
|
|
95
|
-
}, []);
|
|
95
|
+
}, [field]);
|
|
96
96
|
var onColumnStateChanged = function onColumnStateChanged(columnState) {
|
|
97
97
|
if (props.gridKey) {
|
|
98
98
|
onSaveColumnState && onSaveColumnState(props.gridKey, columnState);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
+
|
|
102
|
+
// 通用的聚焦函数
|
|
103
|
+
var focusInputInCell = useCallback(function (cell) {
|
|
104
|
+
// 首先查找Editable包装的元素
|
|
105
|
+
var editableElement = cell.querySelector('.ant-formily-editable');
|
|
106
|
+
if (editableElement) {
|
|
107
|
+
// 检查Editable是否已经处于编辑状态
|
|
108
|
+
var isEditing = editableElement.getAttribute('data-editable-state') === 'editing';
|
|
109
|
+
if (isEditing) {
|
|
110
|
+
// 如果已经处于编辑状态,查找输入框并直接聚焦
|
|
111
|
+
var existingInput = editableElement.querySelector('input:not([readonly]):not([disabled]), textarea:not([readonly]):not([disabled])');
|
|
112
|
+
if (existingInput) {
|
|
113
|
+
existingInput.focus();
|
|
114
|
+
if ('setSelectionRange' in existingInput && existingInput.type !== 'number' && existingInput.type !== 'date') {
|
|
115
|
+
var _existingInput$value;
|
|
116
|
+
var length = ((_existingInput$value = existingInput.value) === null || _existingInput$value === void 0 ? void 0 : _existingInput$value.length) || 0;
|
|
117
|
+
setTimeout(function () {
|
|
118
|
+
existingInput.setSelectionRange(length, length);
|
|
119
|
+
}, 10);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
// 如果还没有进入编辑状态,触发编辑状态
|
|
124
|
+
editableElement.click();
|
|
125
|
+
var focusEvent = new Event('focus', {
|
|
126
|
+
bubbles: true
|
|
127
|
+
});
|
|
128
|
+
editableElement.dispatchEvent(focusEvent);
|
|
129
|
+
|
|
130
|
+
// 延迟查找输入框并设置光标
|
|
131
|
+
setTimeout(function () {
|
|
132
|
+
var newInput = editableElement.querySelector('input:not([readonly]):not([disabled]), textarea:not([readonly]):not([disabled])');
|
|
133
|
+
if (newInput) {
|
|
134
|
+
newInput.focus();
|
|
135
|
+
if ('setSelectionRange' in newInput && newInput.type !== 'number' && newInput.type !== 'date') {
|
|
136
|
+
var _newInput$value;
|
|
137
|
+
var _length = ((_newInput$value = newInput.value) === null || _newInput$value === void 0 ? void 0 : _newInput$value.length) || 0;
|
|
138
|
+
setTimeout(function () {
|
|
139
|
+
newInput.setSelectionRange(_length, _length);
|
|
140
|
+
}, 10);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, 150);
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
// 如果没有Editable包装,尝试多种选择器查找输入框
|
|
147
|
+
var inputElement = cell.querySelector('input:not([readonly]):not([disabled]), textarea:not([readonly]):not([disabled])');
|
|
148
|
+
if (!inputElement) {
|
|
149
|
+
// 尝试更宽泛的选择器
|
|
150
|
+
inputElement = cell.querySelector('input, textarea');
|
|
151
|
+
}
|
|
152
|
+
if (!inputElement) {
|
|
153
|
+
// 尝试查找Ant Design的输入框
|
|
154
|
+
inputElement = cell.querySelector('.ant-input');
|
|
155
|
+
}
|
|
156
|
+
if (!inputElement) {
|
|
157
|
+
// 查找任何可聚焦的元素
|
|
158
|
+
inputElement = cell.querySelector('[contenteditable="true"], [tabindex]');
|
|
159
|
+
}
|
|
160
|
+
if (inputElement) {
|
|
161
|
+
inputElement.focus();
|
|
162
|
+
|
|
163
|
+
// 将光标定位到末尾
|
|
164
|
+
if ('setSelectionRange' in inputElement && inputElement.type !== 'number' && inputElement.type !== 'date') {
|
|
165
|
+
var _inputElement$value;
|
|
166
|
+
var _length2 = ((_inputElement$value = inputElement.value) === null || _inputElement$value === void 0 ? void 0 : _inputElement$value.length) || 0;
|
|
167
|
+
setTimeout(function () {
|
|
168
|
+
inputElement.setSelectionRange(_length2, _length2);
|
|
169
|
+
}, 10);
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
// 尝试直接聚焦到单元格本身
|
|
173
|
+
cell.focus();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, []);
|
|
101
177
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
102
178
|
ref: ref,
|
|
103
179
|
style: {
|
|
@@ -160,7 +236,120 @@ var ArrayTable = observer(function (props) {
|
|
|
160
236
|
suppressColumnVirtualisation: true,
|
|
161
237
|
gridOptions: {
|
|
162
238
|
enableCellTextSelection: true,
|
|
163
|
-
ensureDomOrder: true
|
|
239
|
+
ensureDomOrder: true,
|
|
240
|
+
suppressCopyRowsToClipboard: true,
|
|
241
|
+
suppressCopySingleCellRanges: true,
|
|
242
|
+
enterNavigatesVertically: true,
|
|
243
|
+
enterNavigatesVerticallyAfterEdit: true
|
|
244
|
+
},
|
|
245
|
+
onCellKeyDown: function onCellKeyDown(event) {
|
|
246
|
+
var keyEvent = event.event,
|
|
247
|
+
node = event.node,
|
|
248
|
+
colDef = event.colDef,
|
|
249
|
+
api = event.api;
|
|
250
|
+
if (!keyEvent) return;
|
|
251
|
+
|
|
252
|
+
// 处理上下左右键导航
|
|
253
|
+
if (keyEvent.key === 'ArrowDown' || keyEvent.key === 'ArrowUp' || keyEvent.key === 'ArrowLeft' || keyEvent.key === 'ArrowRight') {
|
|
254
|
+
var currentRowIndex = node.rowIndex;
|
|
255
|
+
var currentColId = colDef.field;
|
|
256
|
+
var targetRowIndex = currentRowIndex;
|
|
257
|
+
var targetColId = currentColId;
|
|
258
|
+
|
|
259
|
+
// 确定目标位置
|
|
260
|
+
if (keyEvent.key === 'ArrowDown') {
|
|
261
|
+
targetRowIndex = currentRowIndex + 1;
|
|
262
|
+
} else if (keyEvent.key === 'ArrowUp') {
|
|
263
|
+
targetRowIndex = currentRowIndex - 1;
|
|
264
|
+
} else if (keyEvent.key === 'ArrowLeft' || keyEvent.key === 'ArrowRight') {
|
|
265
|
+
// 对于左右键,使用AG-Grid的API获取列信息
|
|
266
|
+
var visibleColumns = api.getAllDisplayedColumns();
|
|
267
|
+
if (visibleColumns && visibleColumns.length > 0) {
|
|
268
|
+
// 找到当前列的索引
|
|
269
|
+
var currentColIndex = visibleColumns.findIndex(function (col) {
|
|
270
|
+
return col.getColId() === currentColId;
|
|
271
|
+
});
|
|
272
|
+
var targetColIndex;
|
|
273
|
+
if (keyEvent.key === 'ArrowLeft') {
|
|
274
|
+
targetColIndex = currentColIndex - 1;
|
|
275
|
+
} else {
|
|
276
|
+
targetColIndex = currentColIndex + 1;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// 检查目标列索引是否有效
|
|
280
|
+
if (targetColIndex >= 0 && targetColIndex < visibleColumns.length) {
|
|
281
|
+
targetColId = visibleColumns[targetColIndex].getColId();
|
|
282
|
+
} else {
|
|
283
|
+
return; // 无法移动到目标列
|
|
284
|
+
}
|
|
285
|
+
} else {
|
|
286
|
+
return; // 无列信息
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// 检查目标位置是否有效
|
|
291
|
+
var isValidTarget = keyEvent.key === 'ArrowLeft' || keyEvent.key === 'ArrowRight' || targetRowIndex >= 0 && targetRowIndex < dataSource.length;
|
|
292
|
+
if (isValidTarget) {
|
|
293
|
+
// 延迟执行以确保当前编辑完成
|
|
294
|
+
setTimeout(function () {
|
|
295
|
+
api.setFocusedCell(targetRowIndex, targetColId);
|
|
296
|
+
|
|
297
|
+
// 不使用原生startEditingCell,而是手动触发编辑状态
|
|
298
|
+
// 使用DOM选择器查找目标单元格
|
|
299
|
+
setTimeout(function () {
|
|
300
|
+
var _ref$current;
|
|
301
|
+
// 通过ref获取网格容器
|
|
302
|
+
var gridContainer = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector('.ag-theme-alpine');
|
|
303
|
+
if (gridContainer) {
|
|
304
|
+
// 尝试通过行和列分步查找目标单元格
|
|
305
|
+
var rows = gridContainer.querySelectorAll('.ag-row');
|
|
306
|
+
if (rows[targetRowIndex]) {
|
|
307
|
+
var targetRow = rows[targetRowIndex];
|
|
308
|
+
|
|
309
|
+
// 在行内查找指定列的单元格
|
|
310
|
+
var targetCell = targetRow.querySelector(".ag-cell[col-id=\"".concat(targetColId, "\"]"));
|
|
311
|
+
if (!targetCell) {
|
|
312
|
+
// 如果通过col-id找不到,遍历所有单元格查找匹配的列
|
|
313
|
+
var cells = targetRow.querySelectorAll('.ag-cell');
|
|
314
|
+
var _iterator = _createForOfIteratorHelper(cells),
|
|
315
|
+
_step;
|
|
316
|
+
try {
|
|
317
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
318
|
+
var cell = _step.value;
|
|
319
|
+
var colId = cell.getAttribute('col-id') || cell.getAttribute('data-col-id');
|
|
320
|
+
if (colId === targetColId) {
|
|
321
|
+
targetCell = cell;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} catch (err) {
|
|
326
|
+
_iterator.e(err);
|
|
327
|
+
} finally {
|
|
328
|
+
_iterator.f();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (targetCell) {
|
|
332
|
+
focusInputInCell(targetCell);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}, 150);
|
|
337
|
+
}, 10);
|
|
338
|
+
}
|
|
339
|
+
keyEvent.preventDefault();
|
|
340
|
+
keyEvent.stopPropagation();
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
onCellClicked: function onCellClicked(event) {
|
|
344
|
+
var _event$event;
|
|
345
|
+
// 点击单元格时触发编辑状态
|
|
346
|
+
var cellElement = (_event$event = event.event) === null || _event$event === void 0 ? void 0 : _event$event.target;
|
|
347
|
+
setTimeout(function () {
|
|
348
|
+
var gridCell = cellElement === null || cellElement === void 0 ? void 0 : cellElement.closest('[data-ag-grid-cell]');
|
|
349
|
+
if (gridCell) {
|
|
350
|
+
focusInputInCell(gridCell);
|
|
351
|
+
}
|
|
352
|
+
}, 10);
|
|
164
353
|
},
|
|
165
354
|
onRowDragMove: onRowDragMove,
|
|
166
355
|
onRowDataUpdated: function onRowDataUpdated(e) {
|
|
@@ -175,8 +364,6 @@ var ArrayTable = observer(function (props) {
|
|
|
175
364
|
suppressClipboardPaste: true,
|
|
176
365
|
preventDefaultOnContextMenu: true,
|
|
177
366
|
enableCellTextSelection: true,
|
|
178
|
-
suppressCopyRowsToClipboard: true,
|
|
179
|
-
suppressCopySingleCellRanges: true,
|
|
180
367
|
className: "ag-theme-alpine",
|
|
181
368
|
defaultColDef: {
|
|
182
369
|
resizable: true,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DeleteConfirmProps {
|
|
3
|
+
/** 确认框标题 */
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
/** 确认框内容,不提供时会使用默认内容 */
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
/** 确认回调函数 */
|
|
8
|
+
onConfirm: () => Promise<any>;
|
|
9
|
+
/** 子组件(触发按钮) */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* DeleteConfirm 删除确认组件
|
|
14
|
+
*
|
|
15
|
+
* 基于 Modal.confirm 的删除确认对话框组件,提供统一的危险操作确认体验
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <DeleteConfirm
|
|
20
|
+
* title="确认删除"
|
|
21
|
+
* content="删除后数据将无法恢复,确定要删除吗?"
|
|
22
|
+
* onConfirm={async () => {
|
|
23
|
+
* await deleteApi({ id: record.id });
|
|
24
|
+
* }}
|
|
25
|
+
* >
|
|
26
|
+
* <Button danger>删除</Button>
|
|
27
|
+
* </DeleteConfirm>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const DeleteConfirm: React.FC<DeleteConfirmProps>;
|
|
31
|
+
export default DeleteConfirm;
|