@nokecy/qc-ui 1.0.90 → 1.0.91
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/setting/ColumnConfigTable.js +2 -104
- package/dist/cjs/ag-grid-plus/setting/ColumnSetting.js +34 -83
- package/dist/esm/ag-grid-plus/errors/ErrorBoundary.d.ts +1 -1
- package/dist/esm/ag-grid-plus/setting/ColumnConfigTable.d.ts.map +1 -1
- package/dist/esm/ag-grid-plus/setting/ColumnConfigTable.js +2 -104
- package/dist/esm/ag-grid-plus/setting/ColumnSetting.d.ts.map +1 -1
- package/dist/esm/ag-grid-plus/setting/ColumnSetting.js +34 -83
- package/dist/esm/components/RegexEditor/validation/types.d.ts.map +1 -1
- package/dist/esm/components/RegexEditor/visualizer/astToRailroad.d.ts.map +1 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/ag-grid-plus/setting/ColumnConfigTable.d.ts.map +0 -1
|
@@ -89,17 +89,12 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
89
89
|
var _schemeManager$curren;
|
|
90
90
|
// 优先使用当前方案中保存的完整列配置(包含分组结构)
|
|
91
91
|
if (schemeManager !== null && schemeManager !== void 0 && (_schemeManager$curren = schemeManager.currentScheme) !== null && _schemeManager$curren !== void 0 && _schemeManager$curren.columnConfig) {
|
|
92
|
-
console.log('[ColumnSetting] 使用方案中保存的 columnConfig:', schemeManager.currentScheme.columnConfig);
|
|
93
92
|
return schemeManager.currentScheme.columnConfig;
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
// 如果方案中没有 columnConfig,则从 Grid 读取
|
|
97
96
|
var columnDefs = gridApi.getColumnDefs() || [];
|
|
98
97
|
var columnStates = gridApi.getColumnState();
|
|
99
|
-
console.log('[ColumnSetting] 从 Grid 读取列配置:', {
|
|
100
|
-
columnDefs: columnDefs,
|
|
101
|
-
columnStates: columnStates
|
|
102
|
-
});
|
|
103
98
|
|
|
104
99
|
// 将 Grid 状态转换为扁平化配置
|
|
105
100
|
var flatConfig = gridStateToFlatConfig(columnDefs);
|
|
@@ -225,13 +220,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
225
220
|
}
|
|
226
221
|
|
|
227
222
|
// 转换为 AG-Grid 的列定义
|
|
228
|
-
gridColumnDefs = flatConfigToGridState(configToSave);
|
|
229
|
-
console.log('[ColumnSetting] 保存列配置:', {
|
|
230
|
-
flatConfig: configToSave,
|
|
231
|
-
gridColumnDefs: gridColumnDefs
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
// 先应用列配置到 Grid
|
|
223
|
+
gridColumnDefs = flatConfigToGridState(configToSave); // 先应用列配置到 Grid
|
|
235
224
|
if (type !== 'formArrayTable') {
|
|
236
225
|
gridApi.setGridOption("columnDefs", gridColumnDefs);
|
|
237
226
|
}
|
|
@@ -240,69 +229,54 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
240
229
|
|
|
241
230
|
// 等待 Grid 状态更新完成后再保存到方案
|
|
242
231
|
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
243
|
-
var updatedState, filterModel, defaultScheme,
|
|
232
|
+
var updatedState, filterModel, defaultScheme, newScheme;
|
|
244
233
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
245
234
|
while (1) switch (_context.prev = _context.next) {
|
|
246
235
|
case 0:
|
|
247
236
|
if (!(schemeManager && gridKey)) {
|
|
248
|
-
_context.next =
|
|
237
|
+
_context.next = 25;
|
|
249
238
|
break;
|
|
250
239
|
}
|
|
251
240
|
_context.prev = 1;
|
|
252
241
|
// 从 Grid 获取应用后的最新列状态和过滤器状态
|
|
253
242
|
updatedState = gridApi.getColumnState();
|
|
254
243
|
filterModel = gridApi.getFilterModel();
|
|
255
|
-
console.log('[ColumnSetting] 准备保存到方案:', {
|
|
256
|
-
columnConfig: configToSave,
|
|
257
|
-
columnConfigLength: configToSave.length,
|
|
258
|
-
columnConfigDetail: configToSave.map(function (item, idx) {
|
|
259
|
-
return {
|
|
260
|
-
index: idx,
|
|
261
|
-
type: item.type,
|
|
262
|
-
headerName: item.headerName,
|
|
263
|
-
field: item.field,
|
|
264
|
-
order: item.order,
|
|
265
|
-
parentId: item.parentId
|
|
266
|
-
};
|
|
267
|
-
}),
|
|
268
|
-
filterModel: filterModel
|
|
269
|
-
});
|
|
270
244
|
if (!schemeManager.currentScheme) {
|
|
271
|
-
_context.next =
|
|
245
|
+
_context.next = 9;
|
|
272
246
|
break;
|
|
273
247
|
}
|
|
274
|
-
_context.next =
|
|
248
|
+
_context.next = 7;
|
|
275
249
|
return schemeManager.saveScheme({
|
|
276
250
|
columnConfig: configToSave,
|
|
277
251
|
// 保存完整的列配置(包含分组结构)
|
|
278
252
|
filterModel: filterModel
|
|
279
253
|
});
|
|
280
|
-
case
|
|
281
|
-
_context.next =
|
|
254
|
+
case 7:
|
|
255
|
+
_context.next = 20;
|
|
282
256
|
break;
|
|
283
|
-
case
|
|
257
|
+
case 9:
|
|
284
258
|
// 如果没有激活的方案,查找或创建"默认配置"方案
|
|
285
259
|
defaultScheme = schemeManager.schemes.find(function (s) {
|
|
286
260
|
return s.isDefault;
|
|
287
261
|
});
|
|
288
262
|
if (!defaultScheme) {
|
|
289
|
-
_context.next =
|
|
263
|
+
_context.next = 17;
|
|
290
264
|
break;
|
|
291
265
|
}
|
|
292
|
-
_context.next =
|
|
266
|
+
_context.next = 13;
|
|
293
267
|
return schemeManager.loadScheme(defaultScheme.id);
|
|
294
|
-
case
|
|
295
|
-
_context.next =
|
|
268
|
+
case 13:
|
|
269
|
+
_context.next = 15;
|
|
296
270
|
return schemeManager.saveScheme({
|
|
297
271
|
columnConfig: configToSave,
|
|
298
272
|
// 保存完整的列配置(包含分组结构)
|
|
299
273
|
filterModel: filterModel
|
|
300
274
|
});
|
|
301
|
-
case
|
|
302
|
-
_context.next = 22;
|
|
303
|
-
break;
|
|
304
|
-
case 18:
|
|
275
|
+
case 15:
|
|
305
276
|
_context.next = 20;
|
|
277
|
+
break;
|
|
278
|
+
case 17:
|
|
279
|
+
_context.next = 19;
|
|
306
280
|
return schemeManager.createScheme('默认配置', configToSave,
|
|
307
281
|
// 使用 columnConfig 而不是 columnState
|
|
308
282
|
{
|
|
@@ -311,33 +285,27 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
311
285
|
filterModel: filterModel,
|
|
312
286
|
activate: true // 立即激活该方案
|
|
313
287
|
});
|
|
314
|
-
case
|
|
288
|
+
case 19:
|
|
315
289
|
newScheme = _context.sent;
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
schemeName: newScheme.name,
|
|
319
|
-
hasColumnConfig: !!newScheme.columnConfig,
|
|
320
|
-
columnConfigLength: ((_newScheme$columnConf = newScheme.columnConfig) === null || _newScheme$columnConf === void 0 ? void 0 : _newScheme$columnConf.length) || 0
|
|
321
|
-
});
|
|
322
|
-
case 22:
|
|
323
|
-
_context.next = 27;
|
|
290
|
+
case 20:
|
|
291
|
+
_context.next = 25;
|
|
324
292
|
break;
|
|
325
|
-
case
|
|
326
|
-
_context.prev =
|
|
293
|
+
case 22:
|
|
294
|
+
_context.prev = 22;
|
|
327
295
|
_context.t0 = _context["catch"](1);
|
|
328
|
-
console.error('
|
|
329
|
-
case
|
|
296
|
+
console.error('保存列配置到方案失败:', _context.t0);
|
|
297
|
+
case 25:
|
|
330
298
|
case "end":
|
|
331
299
|
return _context.stop();
|
|
332
300
|
}
|
|
333
|
-
}, _callee, null, [[1,
|
|
301
|
+
}, _callee, null, [[1, 22]]);
|
|
334
302
|
})), 50);
|
|
335
303
|
|
|
336
304
|
// 保存成功后清除备份
|
|
337
305
|
setOriginalColumnDefs(null);
|
|
338
306
|
message.success('列配置已保存');
|
|
339
307
|
onClose();
|
|
340
|
-
case
|
|
308
|
+
case 12:
|
|
341
309
|
case "end":
|
|
342
310
|
return _context2.stop();
|
|
343
311
|
}
|
|
@@ -667,7 +635,14 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
667
635
|
}
|
|
668
636
|
}];
|
|
669
637
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DraggableModal, {
|
|
670
|
-
title: "\u5217\u65B9\u6848\u7BA1\u7406",
|
|
638
|
+
title: /*#__PURE__*/React.createElement("span", null, "\u5217\u65B9\u6848\u7BA1\u7406", (schemeManager === null || schemeManager === void 0 ? void 0 : schemeManager.currentScheme) && /*#__PURE__*/React.createElement("span", {
|
|
639
|
+
style: {
|
|
640
|
+
marginLeft: 16,
|
|
641
|
+
fontSize: 14,
|
|
642
|
+
fontWeight: 'normal',
|
|
643
|
+
color: '#1890ff'
|
|
644
|
+
}
|
|
645
|
+
}, "- \u5F53\u524D\u65B9\u6848: ", schemeManager.currentScheme.name)),
|
|
671
646
|
open: visible,
|
|
672
647
|
onCancel: handleClose,
|
|
673
648
|
width: 1100,
|
|
@@ -696,31 +671,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
696
671
|
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
697
672
|
tab: "\u5217\u914D\u7F6E",
|
|
698
673
|
key: "columns"
|
|
699
|
-
},
|
|
700
|
-
style: {
|
|
701
|
-
marginBottom: 16,
|
|
702
|
-
padding: '12px 16px',
|
|
703
|
-
background: schemeManager.currentScheme ? '#e6f7ff' : '#f5f5f5',
|
|
704
|
-
borderRadius: 4,
|
|
705
|
-
border: '1px solid',
|
|
706
|
-
borderColor: schemeManager.currentScheme ? '#91d5ff' : '#d9d9d9'
|
|
707
|
-
}
|
|
708
|
-
}, schemeManager.currentScheme ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
709
|
-
style: {
|
|
710
|
-
fontWeight: 600,
|
|
711
|
-
marginBottom: 4,
|
|
712
|
-
color: '#1890ff'
|
|
713
|
-
}
|
|
714
|
-
}, "\u5F53\u524D\u65B9\u6848: ", schemeManager.currentScheme.name), schemeManager.currentScheme.description && /*#__PURE__*/React.createElement("div", {
|
|
715
|
-
style: {
|
|
716
|
-
fontSize: 12,
|
|
717
|
-
color: '#666'
|
|
718
|
-
}
|
|
719
|
-
}, schemeManager.currentScheme.description)) : /*#__PURE__*/React.createElement("div", {
|
|
720
|
-
style: {
|
|
721
|
-
color: '#666'
|
|
722
|
-
}
|
|
723
|
-
}, "\u672A\u9009\u62E9\u65B9\u6848 - \u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E")), /*#__PURE__*/React.createElement(ColumnConfigTable, {
|
|
674
|
+
}, /*#__PURE__*/React.createElement(ColumnConfigTable, {
|
|
724
675
|
items: form.values.items || [],
|
|
725
676
|
onChange: handleColumnChange,
|
|
726
677
|
simple: type === 'formArrayTable'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;AAEH;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE3E,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC;AAC9B,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AAEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astToRailroad.d.ts","sourceRoot":"","sources":["astToRailroad.ts"],"names":[],"mappings":"AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"astToRailroad.d.ts","sourceRoot":"","sources":["astToRailroad.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;AAEH,OAAO,EACL,OAAO,EASP,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAyJ9D;AAYD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAS3D"}
|