@nokecy/qc-ui 1.0.52 → 1.0.53

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.
@@ -223,9 +223,14 @@ function AgGridPlus(props) {
223
223
  sorter: getSort(sortColumn)
224
224
  });
225
225
  request && request(params, undefined, queryFilter).then(function (response) {
226
+ var _apiRef$current2;
226
227
  var rowData = response.data;
227
228
  var rowCount = response.total;
228
229
  setRowData(rowData);
230
+ // 刷新所有单元格
231
+ (_apiRef$current2 = apiRef.current) === null || _apiRef$current2 === void 0 || _apiRef$current2.refreshCells({
232
+ force: true
233
+ });
229
234
  setPagination(_objectSpread(_objectSpread({}, pagination), {}, {
230
235
  total: rowCount
231
236
  }));
@@ -520,8 +525,8 @@ function AgGridPlus(props) {
520
525
  });
521
526
  }
522
527
  if (!allColDefs || displayedData.length === 0) {
523
- var _apiRef$current2;
524
- (_apiRef$current2 = apiRef.current) === null || _apiRef$current2 === void 0 || _apiRef$current2.setGridOption('pinnedBottomRowData', undefined);
528
+ var _apiRef$current3;
529
+ (_apiRef$current3 = apiRef.current) === null || _apiRef$current3 === void 0 || _apiRef$current3.setGridOption('pinnedBottomRowData', undefined);
525
530
  return;
526
531
  }
527
532
  var calcColFields = allColDefs.filter(function (col) {
@@ -535,9 +540,9 @@ function AgGridPlus(props) {
535
540
  };
536
541
  });
537
542
  if (calcColFields.length > 0) {
538
- var _apiRef$current3;
543
+ var _apiRef$current4;
539
544
  var calculatedValues = calculatefun(calcColFields, displayedData);
540
- (_apiRef$current3 = apiRef.current) === null || _apiRef$current3 === void 0 || _apiRef$current3.setGridOption('pinnedBottomRowData', calculatedValues);
545
+ (_apiRef$current4 = apiRef.current) === null || _apiRef$current4 === void 0 || _apiRef$current4.setGridOption('pinnedBottomRowData', calculatedValues);
541
546
  }
542
547
  };
543
548
  var onFilterChanged = function onFilterChanged(event) {
@@ -654,6 +659,7 @@ function AgGridPlus(props) {
654
659
  }), /*#__PURE__*/_react.default.createElement(_agGridReact.AgGridReact, _extends({
655
660
  className: "ag-theme-custom"
656
661
  }, rest, {
662
+ // immutableData: true,
657
663
  gridOptions: {
658
664
  enableCellTextSelection: true,
659
665
  ensureDomOrder: true
@@ -668,11 +674,9 @@ function AgGridPlus(props) {
668
674
  maintainColumnOrder: true,
669
675
  rowData: rowDataMemo,
670
676
  onGridReady: onGridReady,
671
- defaultColDef: defaultColDef,
672
- getRowId: props.getRowId || function (params) {
673
- var _params$data3, _params$data4;
674
- return ((_params$data3 = params.data) === null || _params$data3 === void 0 ? void 0 : _params$data3.id) || ((_params$data4 = params.data) === null || _params$data4 === void 0 ? void 0 : _params$data4._id);
675
- },
677
+ defaultColDef: defaultColDef
678
+ // getRowId={props.getRowId || ((params) => params.data?.id || params.data?._id)}
679
+ ,
676
680
  onSortChanged: function onSortChanged(event) {
677
681
  sortChanged(event.api);
678
682
  props.onSortChanged && props.onSortChanged(event);
@@ -682,8 +686,8 @@ function AgGridPlus(props) {
682
686
  onRowSelected: onRowSelected,
683
687
  onDragStopped: function onDragStopped(e) {
684
688
  if (apiRef.current) {
685
- var _apiRef$current4;
686
- var _columnState = (_apiRef$current4 = apiRef.current) === null || _apiRef$current4 === void 0 ? void 0 : _apiRef$current4.getColumnState();
689
+ var _apiRef$current5;
690
+ var _columnState = (_apiRef$current5 = apiRef.current) === null || _apiRef$current5 === void 0 ? void 0 : _apiRef$current5.getColumnState();
687
691
  setColumnState(_columnState);
688
692
 
689
693
  // onColumnStateChanged && onColumnStateChanged(columnState)
@@ -214,9 +214,14 @@ function AgGridPlus(props) {
214
214
  sorter: getSort(sortColumn)
215
215
  });
216
216
  request && request(params, undefined, queryFilter).then(function (response) {
217
+ var _apiRef$current2;
217
218
  var rowData = response.data;
218
219
  var rowCount = response.total;
219
220
  setRowData(rowData);
221
+ // 刷新所有单元格
222
+ (_apiRef$current2 = apiRef.current) === null || _apiRef$current2 === void 0 || _apiRef$current2.refreshCells({
223
+ force: true
224
+ });
220
225
  setPagination(_objectSpread(_objectSpread({}, pagination), {}, {
221
226
  total: rowCount
222
227
  }));
@@ -511,8 +516,8 @@ function AgGridPlus(props) {
511
516
  });
512
517
  }
513
518
  if (!allColDefs || displayedData.length === 0) {
514
- var _apiRef$current2;
515
- (_apiRef$current2 = apiRef.current) === null || _apiRef$current2 === void 0 || _apiRef$current2.setGridOption('pinnedBottomRowData', undefined);
519
+ var _apiRef$current3;
520
+ (_apiRef$current3 = apiRef.current) === null || _apiRef$current3 === void 0 || _apiRef$current3.setGridOption('pinnedBottomRowData', undefined);
516
521
  return;
517
522
  }
518
523
  var calcColFields = allColDefs.filter(function (col) {
@@ -526,9 +531,9 @@ function AgGridPlus(props) {
526
531
  };
527
532
  });
528
533
  if (calcColFields.length > 0) {
529
- var _apiRef$current3;
534
+ var _apiRef$current4;
530
535
  var calculatedValues = calculatefun(calcColFields, displayedData);
531
- (_apiRef$current3 = apiRef.current) === null || _apiRef$current3 === void 0 || _apiRef$current3.setGridOption('pinnedBottomRowData', calculatedValues);
536
+ (_apiRef$current4 = apiRef.current) === null || _apiRef$current4 === void 0 || _apiRef$current4.setGridOption('pinnedBottomRowData', calculatedValues);
532
537
  }
533
538
  };
534
539
  var onFilterChanged = function onFilterChanged(event) {
@@ -645,6 +650,7 @@ function AgGridPlus(props) {
645
650
  }), /*#__PURE__*/React.createElement(AgGridReact, _extends({
646
651
  className: "ag-theme-custom"
647
652
  }, rest, {
653
+ // immutableData: true,
648
654
  gridOptions: {
649
655
  enableCellTextSelection: true,
650
656
  ensureDomOrder: true
@@ -659,11 +665,9 @@ function AgGridPlus(props) {
659
665
  maintainColumnOrder: true,
660
666
  rowData: rowDataMemo,
661
667
  onGridReady: onGridReady,
662
- defaultColDef: defaultColDef,
663
- getRowId: props.getRowId || function (params) {
664
- var _params$data3, _params$data4;
665
- return ((_params$data3 = params.data) === null || _params$data3 === void 0 ? void 0 : _params$data3.id) || ((_params$data4 = params.data) === null || _params$data4 === void 0 ? void 0 : _params$data4._id);
666
- },
668
+ defaultColDef: defaultColDef
669
+ // getRowId={props.getRowId || ((params) => params.data?.id || params.data?._id)}
670
+ ,
667
671
  onSortChanged: function onSortChanged(event) {
668
672
  sortChanged(event.api);
669
673
  props.onSortChanged && props.onSortChanged(event);
@@ -673,8 +677,8 @@ function AgGridPlus(props) {
673
677
  onRowSelected: onRowSelected,
674
678
  onDragStopped: function onDragStopped(e) {
675
679
  if (apiRef.current) {
676
- var _apiRef$current4;
677
- var _columnState = (_apiRef$current4 = apiRef.current) === null || _apiRef$current4 === void 0 ? void 0 : _apiRef$current4.getColumnState();
680
+ var _apiRef$current5;
681
+ var _columnState = (_apiRef$current5 = apiRef.current) === null || _apiRef$current5 === void 0 ? void 0 : _apiRef$current5.getColumnState();
678
682
  setColumnState(_columnState);
679
683
 
680
684
  // onColumnStateChanged && onColumnStateChanged(columnState)