@nokecy/qc-ui 1.0.98 → 1.1.0
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/ConfirmPro/index.js +1 -1
- package/dist/cjs/ag-grid-plus/ag-gridPlus.js +2 -22
- package/dist/cjs/ag-grid-plus/context/useSchemeDataFlow.js +2 -14
- package/dist/cjs/ag-grid-plus/context/useSchemeManager.js +52 -84
- package/dist/cjs/ag-grid-plus/setting/ColumnSetting.js +27 -30
- package/dist/cjs/ag-grid-plus/shared/storage/backendApiAdapter.js +90 -30
- package/dist/cjs/ag-grid-plus/shared/storage/localStorageAdapter.js +0 -2
- package/dist/cjs/ag-grid-plus/utils/logger.js +1 -2
- package/dist/cjs/array-table/index.js +1 -18
- package/dist/cjs/components/RegexEditor/visualizer/astToRailroad.js +1 -7
- package/dist/cjs/dashboard/dashboard/index.js +0 -1
- package/dist/cjs/dashboard/widget/selector/index.js +0 -3
- package/dist/cjs/deleteConfirm/index.js +1 -1
- package/dist/cjs/formDesigner/FormDesigner.js +1 -3
- package/dist/cjs/formDesigner/widgets/SchemaEditorWidget.js +0 -1
- package/dist/cjs/generatedListPage/PerformanceMonitor.js +0 -3
- package/dist/cjs/generatedListPage/RequestManager.js +9 -11
- package/dist/cjs/standardFormDialog/PortalManager.js +2 -10
- package/dist/cjs/standardFormDialog/withStandardForm.js +0 -2
- package/dist/cjs/toolBar/index.js +1 -1
- package/dist/esm/ConfirmPro/index.js +1 -1
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +2 -22
- package/dist/esm/ag-grid-plus/context/useSchemeDataFlow.js +2 -14
- package/dist/esm/ag-grid-plus/context/useSchemeManager.js +52 -84
- package/dist/esm/ag-grid-plus/setting/ColumnSetting.js +27 -30
- package/dist/esm/ag-grid-plus/shared/storage/backendApiAdapter.js +90 -30
- package/dist/esm/ag-grid-plus/shared/storage/localStorageAdapter.js +0 -2
- package/dist/esm/ag-grid-plus/utils/logger.js +1 -2
- package/dist/esm/array-table/index.js +1 -18
- package/dist/esm/components/RegexEditor/visualizer/astToRailroad.js +1 -7
- package/dist/esm/dashboard/dashboard/index.js +0 -1
- package/dist/esm/dashboard/widget/selector/index.js +0 -3
- package/dist/esm/deleteConfirm/index.js +1 -1
- package/dist/esm/formDesigner/FormDesigner.js +1 -3
- package/dist/esm/formDesigner/widgets/SchemaEditorWidget.js +0 -1
- package/dist/esm/generatedListPage/PerformanceMonitor.js +0 -3
- package/dist/esm/generatedListPage/RequestManager.js +9 -11
- package/dist/esm/standardFormDialog/PortalManager.js +2 -10
- package/dist/esm/standardFormDialog/withStandardForm.js +0 -2
- package/dist/esm/toolBar/index.js +1 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +2 -1
|
@@ -76,11 +76,9 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
76
76
|
key: "log",
|
|
77
77
|
value: function log(message) {
|
|
78
78
|
if (this.config.enableDebugLog) {
|
|
79
|
-
var _console;
|
|
80
79
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
81
80
|
args[_key - 1] = arguments[_key];
|
|
82
81
|
}
|
|
83
|
-
(_console = console).log.apply(_console, ["[BackendApiAdapter] ".concat(message)].concat(args));
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
|
|
@@ -198,23 +196,55 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
198
196
|
return this.request(url);
|
|
199
197
|
case 5:
|
|
200
198
|
response = _context2.sent;
|
|
199
|
+
// 将所有列方案的 columnConfig 从字符串解析为对象数组
|
|
200
|
+
if (response.columnSchemes) {
|
|
201
|
+
Object.keys(response.columnSchemes).forEach(function (gridId) {
|
|
202
|
+
response.columnSchemes[gridId] = response.columnSchemes[gridId].map(function (scheme) {
|
|
203
|
+
if (typeof scheme.columnConfig === 'string') {
|
|
204
|
+
return _objectSpread(_objectSpread({}, scheme), {}, {
|
|
205
|
+
columnConfig: JSON.parse(scheme.columnConfig)
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return scheme;
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// 将所有查询方案的字段从字符串解析为数组和对象
|
|
214
|
+
if (response.querySchemes) {
|
|
215
|
+
Object.keys(response.querySchemes).forEach(function (gridId) {
|
|
216
|
+
response.querySchemes[gridId] = response.querySchemes[gridId].map(function (scheme) {
|
|
217
|
+
var parsedScheme = _objectSpread({}, scheme);
|
|
218
|
+
if (typeof parsedScheme.itemsOrder === 'string') {
|
|
219
|
+
parsedScheme.itemsOrder = JSON.parse(parsedScheme.itemsOrder);
|
|
220
|
+
}
|
|
221
|
+
if (typeof parsedScheme.hiddenFields === 'string') {
|
|
222
|
+
parsedScheme.hiddenFields = JSON.parse(parsedScheme.hiddenFields);
|
|
223
|
+
}
|
|
224
|
+
if (typeof parsedScheme.formValues === 'string') {
|
|
225
|
+
parsedScheme.formValues = JSON.parse(parsedScheme.formValues);
|
|
226
|
+
}
|
|
227
|
+
return parsedScheme;
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
}
|
|
201
231
|
this.log('加载完成', {
|
|
202
232
|
columnSchemes: Object.keys(response.columnSchemes || {}).length,
|
|
203
233
|
querySchemes: Object.keys(response.querySchemes || {}).length,
|
|
204
234
|
version: response.version
|
|
205
235
|
});
|
|
206
236
|
return _context2.abrupt("return", response);
|
|
207
|
-
case
|
|
208
|
-
_context2.prev =
|
|
237
|
+
case 12:
|
|
238
|
+
_context2.prev = 12;
|
|
209
239
|
_context2.t0 = _context2["catch"](0);
|
|
210
240
|
console.error('[BackendApiAdapter] 加载方案失败:', _context2.t0);
|
|
211
241
|
_antd.message.error('加载方案失败');
|
|
212
242
|
throw _context2.t0;
|
|
213
|
-
case
|
|
243
|
+
case 17:
|
|
214
244
|
case "end":
|
|
215
245
|
return _context2.stop();
|
|
216
246
|
}
|
|
217
|
-
}, _callee2, this, [[0,
|
|
247
|
+
}, _callee2, this, [[0, 12]]);
|
|
218
248
|
}));
|
|
219
249
|
function loadAllSchemes() {
|
|
220
250
|
return _loadAllSchemes.apply(this, arguments);
|
|
@@ -225,42 +255,52 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
225
255
|
key: "saveColumnScheme",
|
|
226
256
|
value: function () {
|
|
227
257
|
var _saveColumnScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(gridId, scheme) {
|
|
228
|
-
var url, response;
|
|
258
|
+
var schemeForBackend, url, response, savedScheme;
|
|
229
259
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
230
260
|
while (1) switch (_context3.prev = _context3.next) {
|
|
231
261
|
case 0:
|
|
232
262
|
_context3.prev = 0;
|
|
233
263
|
this.log("\u4FDD\u5B58\u5217\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
264
|
+
|
|
265
|
+
// 将 columnConfig 转换为 JSON 字符串
|
|
266
|
+
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
267
|
+
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
268
|
+
});
|
|
234
269
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-column-scheme");
|
|
235
|
-
_context3.next =
|
|
270
|
+
_context3.next = 6;
|
|
236
271
|
return this.request(url, {
|
|
237
272
|
method: 'POST',
|
|
238
273
|
body: JSON.stringify({
|
|
239
274
|
gridId: gridId,
|
|
240
|
-
scheme:
|
|
275
|
+
scheme: schemeForBackend
|
|
241
276
|
})
|
|
242
277
|
});
|
|
243
|
-
case
|
|
278
|
+
case 6:
|
|
244
279
|
response = _context3.sent;
|
|
245
280
|
if (response.success) {
|
|
246
|
-
_context3.next =
|
|
281
|
+
_context3.next = 9;
|
|
247
282
|
break;
|
|
248
283
|
}
|
|
249
284
|
throw new Error(response.message || '保存失败');
|
|
250
|
-
case
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
285
|
+
case 9:
|
|
286
|
+
// 将返回的 columnConfig 从字符串解析为对象数组
|
|
287
|
+
savedScheme = response.scheme;
|
|
288
|
+
if (savedScheme && typeof savedScheme.columnConfig === 'string') {
|
|
289
|
+
savedScheme.columnConfig = JSON.parse(savedScheme.columnConfig);
|
|
290
|
+
}
|
|
291
|
+
this.log('保存成功', savedScheme);
|
|
292
|
+
return _context3.abrupt("return", savedScheme);
|
|
293
|
+
case 15:
|
|
294
|
+
_context3.prev = 15;
|
|
255
295
|
_context3.t0 = _context3["catch"](0);
|
|
256
296
|
console.error('[BackendApiAdapter] 保存列方案失败:', _context3.t0);
|
|
257
297
|
_antd.message.error('保存列方案失败');
|
|
258
298
|
throw _context3.t0;
|
|
259
|
-
case
|
|
299
|
+
case 20:
|
|
260
300
|
case "end":
|
|
261
301
|
return _context3.stop();
|
|
262
302
|
}
|
|
263
|
-
}, _callee3, this, [[0,
|
|
303
|
+
}, _callee3, this, [[0, 15]]);
|
|
264
304
|
}));
|
|
265
305
|
function saveColumnScheme(_x2, _x3) {
|
|
266
306
|
return _saveColumnScheme.apply(this, arguments);
|
|
@@ -314,42 +354,62 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
314
354
|
key: "saveQueryScheme",
|
|
315
355
|
value: function () {
|
|
316
356
|
var _saveQueryScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(gridId, scheme) {
|
|
317
|
-
var url, response;
|
|
357
|
+
var schemeForBackend, url, response, savedScheme;
|
|
318
358
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
319
359
|
while (1) switch (_context5.prev = _context5.next) {
|
|
320
360
|
case 0:
|
|
321
361
|
_context5.prev = 0;
|
|
322
362
|
this.log("\u4FDD\u5B58\u67E5\u8BE2\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
363
|
+
|
|
364
|
+
// 将数组和对象字段转换为 JSON 字符串
|
|
365
|
+
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
366
|
+
itemsOrder: scheme.itemsOrder ? JSON.stringify(scheme.itemsOrder) : undefined,
|
|
367
|
+
hiddenFields: scheme.hiddenFields ? JSON.stringify(scheme.hiddenFields) : undefined,
|
|
368
|
+
formValues: scheme.formValues ? JSON.stringify(scheme.formValues) : undefined
|
|
369
|
+
});
|
|
323
370
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-query-scheme");
|
|
324
|
-
_context5.next =
|
|
371
|
+
_context5.next = 6;
|
|
325
372
|
return this.request(url, {
|
|
326
373
|
method: 'POST',
|
|
327
374
|
body: JSON.stringify({
|
|
328
375
|
gridId: gridId,
|
|
329
|
-
scheme:
|
|
376
|
+
scheme: schemeForBackend
|
|
330
377
|
})
|
|
331
378
|
});
|
|
332
|
-
case
|
|
379
|
+
case 6:
|
|
333
380
|
response = _context5.sent;
|
|
334
381
|
if (response.success) {
|
|
335
|
-
_context5.next =
|
|
382
|
+
_context5.next = 9;
|
|
336
383
|
break;
|
|
337
384
|
}
|
|
338
385
|
throw new Error(response.message || '保存失败');
|
|
339
|
-
case
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
386
|
+
case 9:
|
|
387
|
+
// 将返回的字符串字段解析为数组和对象
|
|
388
|
+
savedScheme = response.scheme;
|
|
389
|
+
if (savedScheme) {
|
|
390
|
+
if (typeof savedScheme.itemsOrder === 'string') {
|
|
391
|
+
savedScheme.itemsOrder = JSON.parse(savedScheme.itemsOrder);
|
|
392
|
+
}
|
|
393
|
+
if (typeof savedScheme.hiddenFields === 'string') {
|
|
394
|
+
savedScheme.hiddenFields = JSON.parse(savedScheme.hiddenFields);
|
|
395
|
+
}
|
|
396
|
+
if (typeof savedScheme.formValues === 'string') {
|
|
397
|
+
savedScheme.formValues = JSON.parse(savedScheme.formValues);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
this.log('保存成功', savedScheme);
|
|
401
|
+
return _context5.abrupt("return", savedScheme);
|
|
402
|
+
case 15:
|
|
403
|
+
_context5.prev = 15;
|
|
344
404
|
_context5.t0 = _context5["catch"](0);
|
|
345
405
|
console.error('[BackendApiAdapter] 保存查询方案失败:', _context5.t0);
|
|
346
406
|
_antd.message.error('保存查询方案失败');
|
|
347
407
|
throw _context5.t0;
|
|
348
|
-
case
|
|
408
|
+
case 20:
|
|
349
409
|
case "end":
|
|
350
410
|
return _context5.stop();
|
|
351
411
|
}
|
|
352
|
-
}, _callee5, this, [[0,
|
|
412
|
+
}, _callee5, this, [[0, 15]]);
|
|
353
413
|
}));
|
|
354
414
|
function saveQueryScheme(_x6, _x7) {
|
|
355
415
|
return _saveQueryScheme.apply(this, arguments);
|
|
@@ -50,11 +50,9 @@ var LocalStorageSchemeAdapter = exports.LocalStorageSchemeAdapter = /*#__PURE__*
|
|
|
50
50
|
key: "log",
|
|
51
51
|
value: function log(message) {
|
|
52
52
|
if (this.enableDebugLog) {
|
|
53
|
-
var _console;
|
|
54
53
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
55
54
|
args[_key - 1] = arguments[_key];
|
|
56
55
|
}
|
|
57
|
-
(_console = console).log.apply(_console, ["[LocalStorageAdapter] ".concat(message)].concat(args));
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
|
|
@@ -58,10 +58,9 @@ var Logger = /*#__PURE__*/function () {
|
|
|
58
58
|
var timestamp = new Date().toLocaleTimeString();
|
|
59
59
|
switch (level) {
|
|
60
60
|
case LogLevel.DEBUG:
|
|
61
|
-
this.isDevelopment &&
|
|
61
|
+
this.isDevelopment && void 0;
|
|
62
62
|
break;
|
|
63
63
|
case LogLevel.INFO:
|
|
64
|
-
console.log("".concat(prefix, " ").concat(timestamp), message, context || '');
|
|
65
64
|
break;
|
|
66
65
|
case LogLevel.WARN:
|
|
67
66
|
console.warn("".concat(prefix, " ").concat(timestamp), message, context || '');
|
|
@@ -115,17 +115,8 @@ var ArrayTableInner = (0, _react2.observer)(function (props) {
|
|
|
115
115
|
firstCol: (_currentScheme$column = currentScheme.columnConfig[0]) === null || _currentScheme$column === void 0 ? void 0 : _currentScheme$column.field,
|
|
116
116
|
updatedAt: currentScheme.updatedAt
|
|
117
117
|
});
|
|
118
|
-
console.log('[ArrayTable] 方案恢复检查:', {
|
|
119
|
-
schemeId: currentScheme === null || currentScheme === void 0 ? void 0 : currentScheme.id,
|
|
120
|
-
schemeName: currentScheme === null || currentScheme === void 0 ? void 0 : currentScheme.name,
|
|
121
|
-
configHash: configHash,
|
|
122
|
-
lastHash: lastAppliedRef.current.configHash,
|
|
123
|
-
shouldApply: configHash !== lastAppliedRef.current.configHash
|
|
124
|
-
});
|
|
125
|
-
|
|
126
118
|
// 【关键】检查配置是否真正变化,避免重复应用
|
|
127
119
|
if (configHash === lastAppliedRef.current.configHash) {
|
|
128
|
-
console.log('[ArrayTable] 配置未变化,跳过应用');
|
|
129
120
|
return;
|
|
130
121
|
}
|
|
131
122
|
|
|
@@ -141,12 +132,9 @@ var ArrayTableInner = (0, _react2.observer)(function (props) {
|
|
|
141
132
|
state: columnState,
|
|
142
133
|
applyOrder: true // 强制应用列顺序
|
|
143
134
|
});
|
|
144
|
-
console.log('[ArrayTable] 方案已成功应用');
|
|
145
|
-
|
|
146
135
|
// 如果方案中包含过滤器配置,也一并应用
|
|
147
136
|
if (currentScheme.filterModel) {
|
|
148
137
|
gridApiState.setFilterModel(currentScheme.filterModel);
|
|
149
|
-
console.log('[ArrayTable] 过滤器已应用');
|
|
150
138
|
}
|
|
151
139
|
|
|
152
140
|
// 记录本次应用的配置哈希
|
|
@@ -159,19 +147,14 @@ var ArrayTableInner = (0, _react2.observer)(function (props) {
|
|
|
159
147
|
// 使用 requestAnimationFrame 延迟应用
|
|
160
148
|
var rafId = requestAnimationFrame(function () {
|
|
161
149
|
try {
|
|
162
|
-
console.log('[ArrayTable] 正在应用方案:', currentScheme.name);
|
|
163
|
-
|
|
164
150
|
// 【关键检测】检查是否包含分组配置
|
|
165
151
|
var hasGroups = currentScheme.columnConfig.some(function (item) {
|
|
166
152
|
return item.type === 'group';
|
|
167
153
|
});
|
|
168
|
-
console.log('[ArrayTable] 是否包含分组:', hasGroups);
|
|
169
|
-
|
|
170
154
|
// 【条件更新】只有在包含分组时才更新 columnDefs
|
|
171
155
|
// 原因:array-table 的列是动态生成的,无分组时不应该覆盖动态列定义
|
|
172
156
|
if (hasGroups) {
|
|
173
157
|
var gridColumnDefs = (0, _columnGroupUtils.flatConfigToGridState)(currentScheme.columnConfig);
|
|
174
|
-
console.log('[ArrayTable] 检测到分组,更新 columnDefs');
|
|
175
158
|
gridApiState.setGridOption('columnDefs', gridColumnDefs);
|
|
176
159
|
|
|
177
160
|
// 等待 columnDefs 更新完成后再应用列状态
|
|
@@ -184,7 +167,7 @@ var ArrayTableInner = (0, _react2.observer)(function (props) {
|
|
|
184
167
|
}, 100);
|
|
185
168
|
} else {
|
|
186
169
|
// 无分组时,直接应用列状态即可
|
|
187
|
-
|
|
170
|
+
|
|
188
171
|
applyColumnStateAndFilter();
|
|
189
172
|
}
|
|
190
173
|
} catch (error) {
|
|
@@ -22,13 +22,7 @@ function convertASTToRailroad(ast) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// 调试日志
|
|
25
|
-
if (ast.type === 'Alternative' || ast.type === 'CharacterClass') {
|
|
26
|
-
console.log("\u5904\u7406 ".concat(ast.type, " \u8282\u70B9:"), {
|
|
27
|
-
type: ast.type,
|
|
28
|
-
expressions: ast.expressions,
|
|
29
|
-
isArray: Array.isArray(ast.expressions)
|
|
30
|
-
});
|
|
31
|
-
}
|
|
25
|
+
if (ast.type === 'Alternative' || ast.type === 'CharacterClass') {}
|
|
32
26
|
switch (ast.type) {
|
|
33
27
|
case 'RegExp':
|
|
34
28
|
// 正则表达式根节点,提取 body
|
|
@@ -344,7 +344,6 @@ var Dashboard = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
344
344
|
var res = (0, _utils3.formatLayout)(currentLayout);
|
|
345
345
|
(0, _utils3.copy)(JSON.stringify(res));
|
|
346
346
|
_antd.message.success('已复制布局数据到剪切板');
|
|
347
|
-
console.log('currentLayout', res);
|
|
348
347
|
}, [currentLayout]);
|
|
349
348
|
|
|
350
349
|
//默认存储
|
|
@@ -113,13 +113,10 @@ var WidgetSelector = function WidgetSelector(props) {
|
|
|
113
113
|
finData[key].visible = false;
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
-
console.log('finData', finData);
|
|
117
116
|
//已添加次数
|
|
118
117
|
currentLayout.forEach(function (item) {
|
|
119
118
|
var _finData$key;
|
|
120
119
|
var key = item.i.split('-')[0];
|
|
121
|
-
console.log('item.i', item.i);
|
|
122
|
-
console.log('finData[key]', finData[key]);
|
|
123
120
|
finData[key].length = finData[key].length ? ((_finData$key = finData[key]) === null || _finData$key === void 0 ? void 0 : _finData$key.length) + 1 : 1;
|
|
124
121
|
});
|
|
125
122
|
return finData;
|
|
@@ -63,9 +63,7 @@ var FormDesigner = function FormDesigner(props) {
|
|
|
63
63
|
var getComponents = function getComponents() {
|
|
64
64
|
var components = {};
|
|
65
65
|
businessComponents.map(function (x) {
|
|
66
|
-
if (!x.Behavior) {
|
|
67
|
-
console.log(x);
|
|
68
|
-
}
|
|
66
|
+
if (!x.Behavior) {}
|
|
69
67
|
components[x.Behavior[0].name] = x;
|
|
70
68
|
});
|
|
71
69
|
return components;
|
|
@@ -12,7 +12,6 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
12
12
|
// import MonacoEditor from 'react-monaco-editor';
|
|
13
13
|
|
|
14
14
|
var SchemaEditorWidget = exports.SchemaEditorWidget = function SchemaEditorWidget(props) {
|
|
15
|
-
console.log(JSON.stringify((0, _designableFormilyTransformer.transformToSchema)(props.tree), null, 2));
|
|
16
15
|
return /*#__PURE__*/_react.default.createElement(_designableReactSettingsForm.MonacoInput, _extends({}, props, {
|
|
17
16
|
value: JSON.stringify((0, _designableFormilyTransformer.transformToSchema)(props.tree), null, 2),
|
|
18
17
|
onChange: function onChange(value) {
|
|
@@ -208,9 +208,6 @@ var PerformanceDevTools = exports.PerformanceDevTools = function PerformanceDevT
|
|
|
208
208
|
}
|
|
209
209
|
var handleShowReport = function handleShowReport() {
|
|
210
210
|
var report = onGetReport();
|
|
211
|
-
console.group("\uD83D\uDE80 Performance Report: ".concat(componentName));
|
|
212
|
-
console.table(report);
|
|
213
|
-
console.groupEnd();
|
|
214
211
|
setShowDetails(!showDetails);
|
|
215
212
|
};
|
|
216
213
|
var getPerformanceColor = function getPerformanceColor(value, thresholds) {
|
|
@@ -210,32 +210,30 @@ var RequestManager = exports.RequestManager = /*#__PURE__*/function () {
|
|
|
210
210
|
case 0:
|
|
211
211
|
key = this.generateCacheKey(params); // 1. 检查缓存
|
|
212
212
|
if (!this.options.enableCache) {
|
|
213
|
-
_context3.next =
|
|
213
|
+
_context3.next = 5;
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
cachedData = this.getFromCache(key);
|
|
217
217
|
if (!(cachedData !== null)) {
|
|
218
|
-
_context3.next =
|
|
218
|
+
_context3.next = 5;
|
|
219
219
|
break;
|
|
220
220
|
}
|
|
221
|
-
console.debug('[RequestManager] Cache hit:', key);
|
|
222
221
|
return _context3.abrupt("return", cachedData);
|
|
223
|
-
case
|
|
222
|
+
case 5:
|
|
224
223
|
if (!this.options.enableDedup) {
|
|
225
|
-
_context3.next =
|
|
224
|
+
_context3.next = 9;
|
|
226
225
|
break;
|
|
227
226
|
}
|
|
228
227
|
pending = this.pendingRequests.get(key);
|
|
229
228
|
if (!pending) {
|
|
230
|
-
_context3.next =
|
|
229
|
+
_context3.next = 9;
|
|
231
230
|
break;
|
|
232
231
|
}
|
|
233
|
-
console.debug('[RequestManager] Dedup request:', key);
|
|
234
232
|
return _context3.abrupt("return", pending.promise);
|
|
235
|
-
case
|
|
236
|
-
_context3.next =
|
|
233
|
+
case 9:
|
|
234
|
+
_context3.next = 11;
|
|
237
235
|
return this.waitForSlot();
|
|
238
|
-
case
|
|
236
|
+
case 11:
|
|
239
237
|
// 4. 创建新请求
|
|
240
238
|
abortController = new AbortController();
|
|
241
239
|
this.activeRequests++;
|
|
@@ -289,7 +287,7 @@ var RequestManager = exports.RequestManager = /*#__PURE__*/function () {
|
|
|
289
287
|
key: key
|
|
290
288
|
});
|
|
291
289
|
return _context3.abrupt("return", promise);
|
|
292
|
-
case
|
|
290
|
+
case 16:
|
|
293
291
|
case "end":
|
|
294
292
|
return _context3.stop();
|
|
295
293
|
}
|
|
@@ -74,7 +74,6 @@ var PortalManager = /*#__PURE__*/function () {
|
|
|
74
74
|
lastAccessedAt: now,
|
|
75
75
|
isOpen: true
|
|
76
76
|
});
|
|
77
|
-
console.debug("[PortalManager] Registered portal: ".concat(id));
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
/**
|
|
@@ -101,7 +100,6 @@ var PortalManager = /*#__PURE__*/function () {
|
|
|
101
100
|
if (portal) {
|
|
102
101
|
portal.isOpen = false;
|
|
103
102
|
portal.lastAccessedAt = Date.now();
|
|
104
|
-
console.debug("[PortalManager] Marked portal as closed: ".concat(id));
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
105
|
|
|
@@ -112,9 +110,7 @@ var PortalManager = /*#__PURE__*/function () {
|
|
|
112
110
|
}, {
|
|
113
111
|
key: "unregister",
|
|
114
112
|
value: function unregister(id) {
|
|
115
|
-
if (this.portals.delete(id)) {
|
|
116
|
-
console.debug("[PortalManager] Unregistered portal: ".concat(id));
|
|
117
|
-
}
|
|
113
|
+
if (this.portals.delete(id)) {}
|
|
118
114
|
}
|
|
119
115
|
|
|
120
116
|
/**
|
|
@@ -176,12 +172,9 @@ var PortalManager = /*#__PURE__*/function () {
|
|
|
176
172
|
if (shouldClean) {
|
|
177
173
|
_this.portals.delete(id);
|
|
178
174
|
cleanedCount++;
|
|
179
|
-
console.debug("[PortalManager] Cleaned up portal: ".concat(id));
|
|
180
175
|
}
|
|
181
176
|
});
|
|
182
|
-
if (cleanedCount > 0) {
|
|
183
|
-
console.info("[PortalManager] Cleanup completed: removed ".concat(cleanedCount, " portals"));
|
|
184
|
-
}
|
|
177
|
+
if (cleanedCount > 0) {}
|
|
185
178
|
}
|
|
186
179
|
|
|
187
180
|
/**
|
|
@@ -216,7 +209,6 @@ var PortalManager = /*#__PURE__*/function () {
|
|
|
216
209
|
key: "clear",
|
|
217
210
|
value: function clear() {
|
|
218
211
|
this.portals.clear();
|
|
219
|
-
console.info('[PortalManager] All portals cleared');
|
|
220
212
|
}
|
|
221
213
|
|
|
222
214
|
/**
|
|
@@ -86,7 +86,6 @@ var withStandardForm = exports.withStandardForm = function withStandardForm(conf
|
|
|
86
86
|
// 使用外部传入的schema配置
|
|
87
87
|
finalFormConfig = externalSchema.form;
|
|
88
88
|
finalFormSchema = externalSchema.schema;
|
|
89
|
-
console.log("\u2705 withStandardForm: ".concat(formId, " \u4F7F\u7528\u5916\u90E8Schema\u914D\u7F6E"));
|
|
90
89
|
} else {
|
|
91
90
|
// 构建表单 Schema(向后兼容)
|
|
92
91
|
finalFormSchema = {
|
|
@@ -138,7 +137,6 @@ var withStandardForm = exports.withStandardForm = function withStandardForm(conf
|
|
|
138
137
|
maxColumns: 2
|
|
139
138
|
}
|
|
140
139
|
};
|
|
141
|
-
console.log("\u2705 withStandardForm: ".concat(formId, " \u4F7F\u7528\u5185\u90E8\u6784\u5EFASchema"));
|
|
142
140
|
}
|
|
143
141
|
|
|
144
142
|
// 创建自定义的 useSchemaField hook
|
|
@@ -24,7 +24,7 @@ var ToolBar = function ToolBar(props) {
|
|
|
24
24
|
style: style,
|
|
25
25
|
offsetBottom: 2,
|
|
26
26
|
onChange: function onChange(affixed) {
|
|
27
|
-
return
|
|
27
|
+
return void 0;
|
|
28
28
|
},
|
|
29
29
|
target: getTargetContainer
|
|
30
30
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -314,13 +314,6 @@ function AgGridPlus(props) {
|
|
|
314
314
|
* 4. 使用 Promise 链和 requestAnimationFrame 解决竞态条件
|
|
315
315
|
*/
|
|
316
316
|
useEffect(function () {
|
|
317
|
-
console.log('[AgGridPlus] 方案应用 useEffect 触发:', {
|
|
318
|
-
hasGridKey: !!gridKey,
|
|
319
|
-
hasApiRef: !!apiRef.current,
|
|
320
|
-
hasDerivedColumnState: !!derivedColumnState,
|
|
321
|
-
derivedColumnStateLength: derivedColumnState === null || derivedColumnState === void 0 ? void 0 : derivedColumnState.length,
|
|
322
|
-
currentSchemeId: currentColumnScheme === null || currentColumnScheme === void 0 ? void 0 : currentColumnScheme.id
|
|
323
|
-
});
|
|
324
317
|
if (!gridKey || !apiRef.current) return;
|
|
325
318
|
|
|
326
319
|
// 使用 Promise 链确保顺序执行,避免竞态条件
|
|
@@ -330,17 +323,11 @@ function AgGridPlus(props) {
|
|
|
330
323
|
|
|
331
324
|
// 1. 应用派生的列状态(使用 applyColumnState API)
|
|
332
325
|
if (derivedColumnState && derivedColumnState.length > 0) {
|
|
333
|
-
console.log('[AgGridPlus] 正在应用 derivedColumnState:', {
|
|
334
|
-
length: derivedColumnState.length,
|
|
335
|
-
firstState: derivedColumnState[0]
|
|
336
|
-
});
|
|
337
|
-
|
|
338
326
|
// 使用 applyColumnState 而不是 setGridOption("columnDefs")
|
|
339
327
|
apiRef.current.applyColumnState({
|
|
340
328
|
state: derivedColumnState,
|
|
341
329
|
applyOrder: true // 应用列顺序
|
|
342
330
|
});
|
|
343
|
-
console.log('[AgGridPlus] derivedColumnState 已应用');
|
|
344
331
|
}
|
|
345
332
|
|
|
346
333
|
// 2. 应用派生的列样式
|
|
@@ -366,9 +353,7 @@ function AgGridPlus(props) {
|
|
|
366
353
|
|
|
367
354
|
// 3. 应用过滤器(在列状态稳定后执行)
|
|
368
355
|
if (currentColumnScheme !== null && currentColumnScheme !== void 0 && currentColumnScheme.filterModel) {
|
|
369
|
-
console.log('[AgGridPlus] 正在应用 filterModel');
|
|
370
356
|
apiRef.current.setFilterModel(currentColumnScheme.filterModel);
|
|
371
|
-
console.log('[AgGridPlus] filterModel 已应用');
|
|
372
357
|
}
|
|
373
358
|
}).catch(function (error) {
|
|
374
359
|
if (!cancelled) {
|
|
@@ -381,7 +366,8 @@ function AgGridPlus(props) {
|
|
|
381
366
|
return function () {
|
|
382
367
|
cancelled = true;
|
|
383
368
|
};
|
|
384
|
-
}, [gridKey, currentColumnScheme === null || currentColumnScheme === void 0 ? void 0 : currentColumnScheme.id, derivedColumnState
|
|
369
|
+
}, [gridKey, currentColumnScheme === null || currentColumnScheme === void 0 ? void 0 : currentColumnScheme.id, derivedColumnState, ready // 添加 ready 依赖,确保 Grid 初始化完成后再应用方案
|
|
370
|
+
]);
|
|
385
371
|
useEffect(function () {
|
|
386
372
|
setRowData(dataSource || propRowData || []);
|
|
387
373
|
}, [dataSource, propRowData]);
|
|
@@ -605,12 +591,6 @@ function AgGridPlus(props) {
|
|
|
605
591
|
}, [propsRowSelection, enableClickSelection]);
|
|
606
592
|
var onGridReady = useCallback(function (params) {
|
|
607
593
|
var _apiRef$current;
|
|
608
|
-
console.log('[AgGridPlus] onGridReady 被调用:', {
|
|
609
|
-
hasCurrentScheme: !!currentColumnScheme,
|
|
610
|
-
currentSchemeId: currentColumnScheme === null || currentColumnScheme === void 0 ? void 0 : currentColumnScheme.id,
|
|
611
|
-
currentSchemeName: currentColumnScheme === null || currentColumnScheme === void 0 ? void 0 : currentColumnScheme.name,
|
|
612
|
-
hasColumnConfig: !!(currentColumnScheme !== null && currentColumnScheme !== void 0 && currentColumnScheme.columnConfig)
|
|
613
|
-
});
|
|
614
594
|
apiRef.current = params.api;
|
|
615
595
|
onReady && onReady(params);
|
|
616
596
|
///@ts-ignore
|
|
@@ -69,28 +69,15 @@ export function useSchemeSource(gridKey, schemeData) {
|
|
|
69
69
|
*/
|
|
70
70
|
export function useDerivedGridState(currentScheme, allColDefs) {
|
|
71
71
|
return useMemo(function () {
|
|
72
|
-
var _currentScheme$column;
|
|
73
|
-
console.log('[useDerivedGridState] 输入参数:', {
|
|
74
|
-
hasScheme: !!currentScheme,
|
|
75
|
-
schemeId: currentScheme === null || currentScheme === void 0 ? void 0 : currentScheme.id,
|
|
76
|
-
configLength: currentScheme === null || currentScheme === void 0 || (_currentScheme$column = currentScheme.columnConfig) === null || _currentScheme$column === void 0 ? void 0 : _currentScheme$column.length,
|
|
77
|
-
allColDefsLength: allColDefs === null || allColDefs === void 0 ? void 0 : allColDefs.length
|
|
78
|
-
});
|
|
79
72
|
if (!(currentScheme !== null && currentScheme !== void 0 && currentScheme.columnConfig) || !allColDefs || allColDefs.length === 0) {
|
|
80
|
-
console.log('[useDerivedGridState] 返回 null (缺少必要数据)');
|
|
81
73
|
return null;
|
|
82
74
|
}
|
|
83
75
|
try {
|
|
84
|
-
var _result$;
|
|
85
76
|
var _require = require("../setting/columnGroupUtils"),
|
|
86
77
|
flatConfigToGridState = _require.flatConfigToGridState;
|
|
87
78
|
|
|
88
79
|
// 转换并缓存结果
|
|
89
80
|
var result = flatConfigToGridState(currentScheme.columnConfig, allColDefs);
|
|
90
|
-
console.log('[useDerivedGridState] 转换成功:', {
|
|
91
|
-
resultLength: result === null || result === void 0 ? void 0 : result.length,
|
|
92
|
-
firstColumn: result === null || result === void 0 || (_result$ = result[0]) === null || _result$ === void 0 ? void 0 : _result$.field
|
|
93
|
-
});
|
|
94
81
|
return result;
|
|
95
82
|
} catch (error) {
|
|
96
83
|
console.error('[useDerivedGridState] 转换失败:', error);
|
|
@@ -116,7 +103,8 @@ export function useDerivedColumnState(currentScheme) {
|
|
|
116
103
|
flatConfigToColumnState = _require2.flatConfigToColumnState;
|
|
117
104
|
|
|
118
105
|
// 转换列状态
|
|
119
|
-
|
|
106
|
+
var result = flatConfigToColumnState(currentScheme.columnConfig);
|
|
107
|
+
return result;
|
|
120
108
|
} catch (error) {
|
|
121
109
|
console.error('[useDerivedColumnState] 转换失败:', error);
|
|
122
110
|
return null;
|