@nokecy/qc-ui 1.1.9 → 1.1.10

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.
@@ -224,16 +224,16 @@ var ColumnSetting = function ColumnSetting(_ref) {
224
224
  * 保存列配置
225
225
  * 将扁平化配置转换回 Grid State 并应用到 AG-Grid
226
226
  */
227
- var handleSaveColumns = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
228
- var values, flatConfig, configToSave, invalidColumns, gridColumnDefs, columnState;
229
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
230
- while (1) switch (_context2.prev = _context2.next) {
227
+ var handleSaveColumns = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
228
+ var values, flatConfig, configToSave, invalidColumns, gridColumnDefs, columnState, filterModel, defaultScheme, newScheme;
229
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
230
+ while (1) switch (_context.prev = _context.next) {
231
231
  case 0:
232
232
  if (form) {
233
- _context2.next = 2;
233
+ _context.next = 2;
234
234
  break;
235
235
  }
236
- return _context2.abrupt("return");
236
+ return _context.abrupt("return");
237
237
  case 2:
238
238
  values = form.values;
239
239
  flatConfig = values.items || []; // 检查是否是旧版本数据,如果是则先迁移
@@ -257,14 +257,11 @@ var ColumnSetting = function ColumnSetting(_ref) {
257
257
 
258
258
  // 【修复】转换为 AG-Grid 的列定义,传入原始列定义以保留自定义属性
259
259
  gridColumnDefs = (0, _columnGroupUtils.flatConfigToGridState)(configToSave, originalColumnDefs); // 【关键修复】先更新 columnDefs(处理分组结构变化)
260
- gridApi.setGridOption('columnDefs', gridColumnDefs);
261
-
262
- // 等待 columnDefs 更新完成
263
- _context2.next = 12;
260
+ _context.next = 11;
264
261
  return new Promise(function (resolve) {
265
262
  return setTimeout(resolve, 100);
266
263
  });
267
- case 12:
264
+ case 11:
268
265
  // 【修复】然后应用列状态(宽度、隐藏、顺序等)
269
266
  columnState = (0, _columnGroupUtils.flatConfigToColumnState)(configToSave);
270
267
  gridApi.applyColumnState({
@@ -272,113 +269,113 @@ var ColumnSetting = function ColumnSetting(_ref) {
272
269
  applyOrder: true // 强制应用列顺序
273
270
  });
274
271
 
275
- // 等待 Grid 状态更新完成后再保存到方案
276
- setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
277
- var filterModel, defaultScheme, newScheme;
278
- return _regeneratorRuntime().wrap(function _callee$(_context) {
279
- while (1) switch (_context.prev = _context.next) {
280
- case 0:
281
- _context.prev = 0;
282
- filterModel = gridApi.getFilterModel();
283
- if (!currentScheme) {
284
- _context.next = 8;
285
- break;
286
- }
287
- _context.next = 5;
288
- return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, currentScheme), {}, {
289
- columnConfig: configToSave,
290
- filterModel: filterModel,
291
- updatedAt: Date.now()
292
- }));
293
- case 5:
294
- _antd.message.success('列配置已保存到方案');
295
- _context.next = 23;
296
- break;
297
- case 8:
298
- // 如果没有激活的方案,自动创建默认方案
299
- defaultScheme = schemes.find(function (s) {
300
- return s.isDefault;
301
- });
302
- if (!defaultScheme) {
303
- _context.next = 17;
304
- break;
305
- }
306
- _context.next = 12;
307
- return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, defaultScheme), {}, {
308
- columnConfig: configToSave,
309
- filterModel: filterModel,
310
- updatedAt: Date.now()
311
- }));
312
- case 12:
313
- _context.next = 14;
314
- return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, defaultScheme.id);
315
- case 14:
316
- _antd.message.success('列配置已保存到默认方案');
317
- _context.next = 23;
318
- break;
319
- case 17:
320
- // 创建新的默认方案并激活
321
- newScheme = {
322
- id: (0, _uuid.v4)(),
323
- name: '默认配置',
324
- description: '自动创建的默认列配置',
325
- columnConfig: configToSave,
326
- filterModel: filterModel,
327
- isDefault: true,
328
- isSystem: false,
329
- createdAt: Date.now(),
330
- updatedAt: Date.now()
331
- };
332
- _context.next = 20;
333
- return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, newScheme);
334
- case 20:
335
- _context.next = 22;
336
- return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, newScheme.id);
337
- case 22:
338
- _antd.message.success('已创建并保存到默认方案');
339
- case 23:
340
- _context.next = 29;
341
- break;
342
- case 25:
343
- _context.prev = 25;
344
- _context.t0 = _context["catch"](0);
345
- console.error('保存列配置到方案失败:', _context.t0);
346
- _antd.message.error('保存列配置失败');
347
- case 29:
348
- case "end":
349
- return _context.stop();
350
- }
351
- }, _callee, null, [[0, 25]]);
352
- })), 50);
353
-
272
+ // 【关键修复】等待 Grid 状态更新完成后再保存到方案
273
+ // 使用 await 确保保存完成后再关闭弹窗,避免生产环境竞态条件
274
+ _context.next = 15;
275
+ return new Promise(function (resolve) {
276
+ return setTimeout(resolve, 50);
277
+ });
278
+ case 15:
279
+ _context.prev = 15;
280
+ filterModel = gridApi.getFilterModel();
281
+ if (!currentScheme) {
282
+ _context.next = 23;
283
+ break;
284
+ }
285
+ _context.next = 20;
286
+ return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, currentScheme), {}, {
287
+ columnConfig: configToSave,
288
+ filterModel: filterModel,
289
+ updatedAt: Date.now()
290
+ }));
291
+ case 20:
292
+ _antd.message.success('列配置已保存到方案');
293
+ _context.next = 38;
294
+ break;
295
+ case 23:
296
+ // 如果没有激活的方案,自动创建默认方案
297
+ defaultScheme = schemes.find(function (s) {
298
+ return s.isDefault;
299
+ });
300
+ if (!defaultScheme) {
301
+ _context.next = 32;
302
+ break;
303
+ }
304
+ _context.next = 27;
305
+ return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, defaultScheme), {}, {
306
+ columnConfig: configToSave,
307
+ filterModel: filterModel,
308
+ updatedAt: Date.now()
309
+ }));
310
+ case 27:
311
+ _context.next = 29;
312
+ return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, defaultScheme.id);
313
+ case 29:
314
+ _antd.message.success('列配置已保存到默认方案');
315
+ _context.next = 38;
316
+ break;
317
+ case 32:
318
+ // 创建新的默认方案并激活
319
+ newScheme = {
320
+ id: (0, _uuid.v4)(),
321
+ name: '默认配置',
322
+ description: '自动创建的默认列配置',
323
+ columnConfig: configToSave,
324
+ filterModel: filterModel,
325
+ isDefault: true,
326
+ isSystem: false,
327
+ createdAt: Date.now(),
328
+ updatedAt: Date.now()
329
+ };
330
+ _context.next = 35;
331
+ return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, newScheme);
332
+ case 35:
333
+ _context.next = 37;
334
+ return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, newScheme.id);
335
+ case 37:
336
+ _antd.message.success('已创建并保存到默认方案');
337
+ case 38:
338
+ _context.next = 40;
339
+ return new Promise(function (resolve) {
340
+ return setTimeout(resolve, 100);
341
+ });
342
+ case 40:
343
+ _context.next = 46;
344
+ break;
345
+ case 42:
346
+ _context.prev = 42;
347
+ _context.t0 = _context["catch"](15);
348
+ console.error('保存列配置到方案失败:', _context.t0);
349
+ _antd.message.error('保存列配置失败');
350
+ case 46:
354
351
  // 【修复】保存成功后清除快照
355
352
  setSnapshotColumnDefs(null);
356
353
 
357
- // message.success 已经在上面的逻辑中处理了
354
+ // 【关键修复】确保在方案保存完成并传播后才关闭弹窗
358
355
  onClose();
359
- case 17:
356
+ case 48:
360
357
  case "end":
361
- return _context2.stop();
358
+ return _context.stop();
362
359
  }
363
- }, _callee2);
360
+ }, _callee, null, [[15, 42]]);
364
361
  })), [form, gridApi, onSaveColumnState, onClose, saveColumnScheme, setCurrentColumnScheme, currentScheme, schemes, gridKey, originalColumnDefs]);
365
362
 
366
363
  // 保存为新方案
367
- var handleSaveScheme = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
364
+ var handleSaveScheme = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
368
365
  var columnConfigToSave, values, gridColumnDefs, columnState, _values, filterModel, newScheme;
369
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
370
- while (1) switch (_context3.prev = _context3.next) {
366
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
367
+ while (1) switch (_context2.prev = _context2.next) {
371
368
  case 0:
372
369
  if (schemeName.trim()) {
373
- _context3.next = 3;
370
+ _context2.next = 3;
374
371
  break;
375
372
  }
376
373
  _antd.message.warning('请输入方案名称');
377
- return _context3.abrupt("return");
374
+ return _context2.abrupt("return");
378
375
  case 3:
379
- _context3.prev = 3;
376
+ _context2.prev = 3;
380
377
  if (!(activeTab === 'columns' && form)) {
381
- _context3.next = 17;
378
+ _context2.next = 17;
382
379
  break;
383
380
  }
384
381
  values = form.values;
@@ -388,7 +385,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
388
385
  gridApi.setGridOption('columnDefs', gridColumnDefs);
389
386
 
390
387
  // 等待 columnDefs 更新完成
391
- _context3.next = 11;
388
+ _context2.next = 11;
392
389
  return new Promise(function (resolve) {
393
390
  return setTimeout(resolve, 100);
394
391
  });
@@ -401,12 +398,12 @@ var ColumnSetting = function ColumnSetting(_ref) {
401
398
  });
402
399
 
403
400
  // 等待状态更新
404
- _context3.next = 15;
401
+ _context2.next = 15;
405
402
  return new Promise(function (resolve) {
406
403
  return setTimeout(resolve, 50);
407
404
  });
408
405
  case 15:
409
- _context3.next = 19;
406
+ _context2.next = 19;
410
407
  break;
411
408
  case 17:
412
409
  // 如果在"方案管理"标签页,使用当前表单数据
@@ -426,7 +423,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
426
423
  createdAt: Date.now(),
427
424
  updatedAt: Date.now()
428
425
  };
429
- _context3.next = 23;
426
+ _context2.next = 23;
430
427
  return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, newScheme);
431
428
  case 23:
432
429
  _antd.message.success('方案保存成功');
@@ -436,28 +433,28 @@ var ColumnSetting = function ColumnSetting(_ref) {
436
433
 
437
434
  // 切换到方案管理标签页,显示新创建的方案
438
435
  setActiveTab('schemes');
439
- _context3.next = 33;
436
+ _context2.next = 33;
440
437
  break;
441
438
  case 30:
442
- _context3.prev = 30;
443
- _context3.t0 = _context3["catch"](3);
444
- _antd.message.error(_context3.t0.message || '保存方案失败');
439
+ _context2.prev = 30;
440
+ _context2.t0 = _context2["catch"](3);
441
+ _antd.message.error(_context2.t0.message || '保存方案失败');
445
442
  case 33:
446
443
  case "end":
447
- return _context3.stop();
444
+ return _context2.stop();
448
445
  }
449
- }, _callee3, null, [[3, 30]]);
446
+ }, _callee2, null, [[3, 30]]);
450
447
  })), [gridApi, saveColumnScheme, gridKey, schemeName, schemeDescription, activeTab, form, originalColumnDefs]);
451
448
 
452
449
  // 加载方案
453
450
  var handleLoadScheme = (0, _react.useCallback)( /*#__PURE__*/function () {
454
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(schemeId) {
451
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(schemeId) {
455
452
  var scheme, gridColumnDefs, columnState;
456
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
457
- while (1) switch (_context4.prev = _context4.next) {
453
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
454
+ while (1) switch (_context3.prev = _context3.next) {
458
455
  case 0:
459
- _context4.prev = 0;
460
- _context4.next = 3;
456
+ _context3.prev = 0;
457
+ _context3.next = 3;
461
458
  return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, schemeId);
462
459
  case 3:
463
460
  // 应用方案到 Grid
@@ -465,7 +462,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
465
462
  return s.id === schemeId;
466
463
  });
467
464
  if (!(scheme && gridApi)) {
468
- _context4.next = 12;
465
+ _context3.next = 12;
469
466
  break;
470
467
  }
471
468
  // 【关键修复】先更新 columnDefs(处理分组结构)
@@ -473,7 +470,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
473
470
  gridApi.setGridOption('columnDefs', gridColumnDefs);
474
471
 
475
472
  // 等待 columnDefs 更新完成
476
- _context4.next = 9;
473
+ _context3.next = 9;
477
474
  return new Promise(function (resolve) {
478
475
  return setTimeout(resolve, 100);
479
476
  });
@@ -504,73 +501,73 @@ var ColumnSetting = function ColumnSetting(_ref) {
504
501
 
505
502
  // 自动关闭弹窗,让用户看到Grid的变化
506
503
  onClose();
507
- _context4.next = 20;
504
+ _context3.next = 20;
508
505
  break;
509
506
  case 17:
510
- _context4.prev = 17;
511
- _context4.t0 = _context4["catch"](0);
512
- _antd.message.error(_context4.t0.message || '加载方案失败');
507
+ _context3.prev = 17;
508
+ _context3.t0 = _context3["catch"](0);
509
+ _antd.message.error(_context3.t0.message || '加载方案失败');
513
510
  case 20:
514
511
  case "end":
515
- return _context4.stop();
512
+ return _context3.stop();
516
513
  }
517
- }, _callee4, null, [[0, 17]]);
514
+ }, _callee3, null, [[0, 17]]);
518
515
  }));
519
516
  return function (_x) {
520
- return _ref5.apply(this, arguments);
517
+ return _ref4.apply(this, arguments);
521
518
  };
522
519
  }(), [setCurrentColumnScheme, gridKey, schemes, gridApi, originalColumnDefs, form, getColumnData, onClose]);
523
520
 
524
521
  // 设置默认方案
525
522
  var handleSetDefault = (0, _react.useCallback)( /*#__PURE__*/function () {
526
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(schemeId) {
523
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(schemeId) {
527
524
  var scheme, _iterator, _step, s;
528
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
529
- while (1) switch (_context5.prev = _context5.next) {
525
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
526
+ while (1) switch (_context4.prev = _context4.next) {
530
527
  case 0:
531
- _context5.prev = 0;
528
+ _context4.prev = 0;
532
529
  scheme = schemes.find(function (s) {
533
530
  return s.id === schemeId;
534
531
  });
535
532
  if (!scheme) {
536
- _context5.next = 24;
533
+ _context4.next = 24;
537
534
  break;
538
535
  }
539
536
  // 将其他方案设为非默认
540
537
  _iterator = _createForOfIteratorHelper(schemes);
541
- _context5.prev = 4;
538
+ _context4.prev = 4;
542
539
  _iterator.s();
543
540
  case 6:
544
541
  if ((_step = _iterator.n()).done) {
545
- _context5.next = 13;
542
+ _context4.next = 13;
546
543
  break;
547
544
  }
548
545
  s = _step.value;
549
546
  if (!(s.isDefault && s.id !== schemeId)) {
550
- _context5.next = 11;
547
+ _context4.next = 11;
551
548
  break;
552
549
  }
553
- _context5.next = 11;
550
+ _context4.next = 11;
554
551
  return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, s), {}, {
555
552
  isDefault: false,
556
553
  updatedAt: Date.now()
557
554
  }));
558
555
  case 11:
559
- _context5.next = 6;
556
+ _context4.next = 6;
560
557
  break;
561
558
  case 13:
562
- _context5.next = 18;
559
+ _context4.next = 18;
563
560
  break;
564
561
  case 15:
565
- _context5.prev = 15;
566
- _context5.t0 = _context5["catch"](4);
567
- _iterator.e(_context5.t0);
562
+ _context4.prev = 15;
563
+ _context4.t0 = _context4["catch"](4);
564
+ _iterator.e(_context4.t0);
568
565
  case 18:
569
- _context5.prev = 18;
566
+ _context4.prev = 18;
570
567
  _iterator.f();
571
- return _context5.finish(18);
568
+ return _context4.finish(18);
572
569
  case 21:
573
- _context5.next = 23;
570
+ _context4.next = 23;
574
571
  return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, scheme), {}, {
575
572
  isDefault: true,
576
573
  updatedAt: Date.now()
@@ -578,37 +575,37 @@ var ColumnSetting = function ColumnSetting(_ref) {
578
575
  case 23:
579
576
  _antd.message.success('已设置为默认方案');
580
577
  case 24:
581
- _context5.next = 29;
578
+ _context4.next = 29;
582
579
  break;
583
580
  case 26:
584
- _context5.prev = 26;
585
- _context5.t1 = _context5["catch"](0);
586
- _antd.message.error(_context5.t1.message || '设置失败');
581
+ _context4.prev = 26;
582
+ _context4.t1 = _context4["catch"](0);
583
+ _antd.message.error(_context4.t1.message || '设置失败');
587
584
  case 29:
588
585
  case "end":
589
- return _context5.stop();
586
+ return _context4.stop();
590
587
  }
591
- }, _callee5, null, [[0, 26], [4, 15, 18, 21]]);
588
+ }, _callee4, null, [[0, 26], [4, 15, 18, 21]]);
592
589
  }));
593
590
  return function (_x2) {
594
- return _ref6.apply(this, arguments);
591
+ return _ref5.apply(this, arguments);
595
592
  };
596
593
  }(), [schemes, saveColumnScheme, gridKey]);
597
594
 
598
595
  // 删除方案
599
596
  var handleDeleteScheme = (0, _react.useCallback)( /*#__PURE__*/function () {
600
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(schemeId, schemeName) {
597
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(schemeId, schemeName) {
601
598
  var _currentSchemes$gridK2, isCurrentScheme, defaultScheme;
602
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
603
- while (1) switch (_context6.prev = _context6.next) {
599
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
600
+ while (1) switch (_context5.prev = _context5.next) {
604
601
  case 0:
605
- _context6.prev = 0;
602
+ _context5.prev = 0;
606
603
  // 检查是否删除的是当前方案
607
604
  isCurrentScheme = schemeId === (currentSchemes === null || currentSchemes === void 0 || (_currentSchemes$gridK2 = currentSchemes[gridKey]) === null || _currentSchemes$gridK2 === void 0 ? void 0 : _currentSchemes$gridK2.columnSchemeId); // 查找默认方案
608
605
  defaultScheme = schemes.find(function (s) {
609
606
  return s.isDefault && s.id !== schemeId;
610
607
  });
611
- _context6.next = 5;
608
+ _context5.next = 5;
612
609
  return deleteColumnScheme === null || deleteColumnScheme === void 0 ? void 0 : deleteColumnScheme(gridKey, schemeId);
613
610
  case 5:
614
611
  // 根据情况显示不同的提示消息
@@ -619,20 +616,20 @@ var ColumnSetting = function ColumnSetting(_ref) {
619
616
  } else {
620
617
  _antd.message.success("\u65B9\u6848\"".concat(schemeName, "\"\u5DF2\u5220\u9664"));
621
618
  }
622
- _context6.next = 11;
619
+ _context5.next = 11;
623
620
  break;
624
621
  case 8:
625
- _context6.prev = 8;
626
- _context6.t0 = _context6["catch"](0);
627
- _antd.message.error(_context6.t0.message || '删除失败');
622
+ _context5.prev = 8;
623
+ _context5.t0 = _context5["catch"](0);
624
+ _antd.message.error(_context5.t0.message || '删除失败');
628
625
  case 11:
629
626
  case "end":
630
- return _context6.stop();
627
+ return _context5.stop();
631
628
  }
632
- }, _callee6, null, [[0, 8]]);
629
+ }, _callee5, null, [[0, 8]]);
633
630
  }));
634
631
  return function (_x3, _x4) {
635
- return _ref7.apply(this, arguments);
632
+ return _ref6.apply(this, arguments);
636
633
  };
637
634
  }(), [deleteColumnScheme, gridKey, schemes, currentSchemes]);
638
635
 
@@ -644,26 +641,26 @@ var ColumnSetting = function ColumnSetting(_ref) {
644
641
  }, []);
645
642
 
646
643
  // 保存编辑
647
- var handleSaveEdit = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
644
+ var handleSaveEdit = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
648
645
  var scheme;
649
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
650
- while (1) switch (_context7.prev = _context7.next) {
646
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
647
+ while (1) switch (_context6.prev = _context6.next) {
651
648
  case 0:
652
649
  if (editingId) {
653
- _context7.next = 2;
650
+ _context6.next = 2;
654
651
  break;
655
652
  }
656
- return _context7.abrupt("return");
653
+ return _context6.abrupt("return");
657
654
  case 2:
658
- _context7.prev = 2;
655
+ _context6.prev = 2;
659
656
  scheme = schemes.find(function (s) {
660
657
  return s.id === editingId;
661
658
  });
662
659
  if (!scheme) {
663
- _context7.next = 9;
660
+ _context6.next = 9;
664
661
  break;
665
662
  }
666
- _context7.next = 7;
663
+ _context6.next = 7;
667
664
  return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, scheme), {}, {
668
665
  name: editingName.trim(),
669
666
  description: editingDescription.trim() || undefined,
@@ -673,17 +670,17 @@ var ColumnSetting = function ColumnSetting(_ref) {
673
670
  _antd.message.success('更新成功');
674
671
  setEditingId(null);
675
672
  case 9:
676
- _context7.next = 14;
673
+ _context6.next = 14;
677
674
  break;
678
675
  case 11:
679
- _context7.prev = 11;
680
- _context7.t0 = _context7["catch"](2);
681
- _antd.message.error(_context7.t0.message || '更新失败');
676
+ _context6.prev = 11;
677
+ _context6.t0 = _context6["catch"](2);
678
+ _antd.message.error(_context6.t0.message || '更新失败');
682
679
  case 14:
683
680
  case "end":
684
- return _context7.stop();
681
+ return _context6.stop();
685
682
  }
686
- }, _callee7, null, [[2, 11]]);
683
+ }, _callee6, null, [[2, 11]]);
687
684
  })), [schemes, saveColumnScheme, gridKey, editingId, editingName, editingDescription]);
688
685
 
689
686
  // 筛选方案列表