@arim-aisdc/public-components 2.3.80 → 2.3.81
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.
|
@@ -524,10 +524,22 @@ var TableMax = function TableMax(_ref) {
|
|
|
524
524
|
/**根据缓存数据设置一些状态 */
|
|
525
525
|
var setColumnInfoFromCache = function setColumnInfoFromCache(tableColumns) {
|
|
526
526
|
var _localStorage$getItem, _tableMaxConfig$cache, _cache$columnVisibili, _cache$columnPinning$, _cache$columnPinning, _cache$columnPinning$2, _cache$columnPinning2;
|
|
527
|
-
|
|
527
|
+
var newColumnOrder = tableColumns === null || tableColumns === void 0 ? void 0 : tableColumns.map(function (column) {
|
|
528
|
+
return column.id;
|
|
529
|
+
});
|
|
530
|
+
var arr = newColumnOrder;
|
|
531
|
+
if (!tableId) {
|
|
532
|
+
setColumnOrder(arr);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
528
535
|
var cache = JSON.parse((_localStorage$getItem = localStorage.getItem(tableKey)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '{}');
|
|
529
|
-
if (version && version !== (cache === null || cache === void 0 ? void 0 : cache.version))
|
|
536
|
+
if (version && version !== (cache === null || cache === void 0 ? void 0 : cache.version)) {
|
|
537
|
+
setColumnOrder(arr);
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
;
|
|
530
541
|
if (cache && cache !== null && cache !== void 0 && cache.editTime && +new Date() - cache.editTime > ((_tableMaxConfig$cache = tableMaxConfig.cacheMaxAge) !== null && _tableMaxConfig$cache !== void 0 ? _tableMaxConfig$cache : CACHE_MAX_AGE)) {
|
|
542
|
+
setColumnOrder(arr);
|
|
531
543
|
return;
|
|
532
544
|
}
|
|
533
545
|
var columnsIdSet = new Set(tableColumns.map(function (column) {
|
|
@@ -593,10 +605,6 @@ var TableMax = function TableMax(_ref) {
|
|
|
593
605
|
right: Array.from(new Set(_toConsumableArray(cacheColumnPinning.right)))
|
|
594
606
|
});
|
|
595
607
|
}
|
|
596
|
-
var newColumnOrder = tableColumns === null || tableColumns === void 0 ? void 0 : tableColumns.map(function (column) {
|
|
597
|
-
return column.id;
|
|
598
|
-
});
|
|
599
|
-
var arr = newColumnOrder;
|
|
600
608
|
if (cacheColumnOrder && tableColumns.length === cacheColumnOrder.length && cacheColumnOrder.filter(function (columnId) {
|
|
601
609
|
return !newColumnOrder.includes(columnId);
|
|
602
610
|
}).length === 0) {
|
|
@@ -840,6 +848,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
840
848
|
useUpdateEffect(function () {
|
|
841
849
|
if (!tableId) return;
|
|
842
850
|
var tableState = table.getState();
|
|
851
|
+
debugger;
|
|
843
852
|
localStorage.setItem(tableKey, JSON.stringify({
|
|
844
853
|
enableFilters: enableFilters,
|
|
845
854
|
headerRowNum: headerRowNum,
|