@donglegeyu/company-ui 1.2.36 → 1.2.37

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.
@@ -604,6 +604,11 @@ function SmartListTemplate({
604
604
  },
605
605
  [rowKey, expandedRowKeys, onExpand]
606
606
  );
607
+ (0, import_react.useEffect)(() => {
608
+ if (isRecordingBaseline) {
609
+ setInitializedFilterParams(JSON.parse(JSON.stringify(effectiveFilterParams)));
610
+ }
611
+ }, [isRecordingBaseline, effectiveFilterParams]);
607
612
  (0, import_react.useEffect)(() => {
608
613
  if (!isRecordingBaseline && hasSearched) {
609
614
  const allKeys = /* @__PURE__ */ new Set([
@@ -615,9 +620,6 @@ function SmartListTemplate({
615
620
  });
616
621
  setHasModified(changed);
617
622
  }
618
- if (isRecordingBaseline) {
619
- setInitializedFilterParams(JSON.parse(JSON.stringify(effectiveFilterParams)));
620
- }
621
623
  }, [effectiveFilterParams, isRecordingBaseline, hasSearched, initializedFilterParams]);
622
624
  const updateTableHeight = (0, import_react.useCallback)(() => {
623
625
  var _a, _b, _c, _d, _e;
@@ -842,6 +842,16 @@ export default function SmartListTemplate(_ref) {
842
842
  expandedRowKeys: newKeys
843
843
  });
844
844
  }, [rowKey, expandedRowKeys, onExpand]);
845
+
846
+ // 基线录制:isRecordingBaseline 期间快照当前筛选参数
847
+ // (不能依赖 initializedFilterParams——快照每次生成新引用,会形成 set -> 依赖变化 -> 再 set 的无限循环)
848
+ useEffect(function () {
849
+ if (isRecordingBaseline) {
850
+ setInitializedFilterParams(JSON.parse(JSON.stringify(effectiveFilterParams)));
851
+ }
852
+ }, [isRecordingBaseline, effectiveFilterParams]);
853
+
854
+ // 修改检测:搜索后与基线对比
845
855
  useEffect(function () {
846
856
  if (!isRecordingBaseline && hasSearched) {
847
857
  var allKeys = new Set([].concat(_toConsumableArray(Object.keys(initializedFilterParams)), _toConsumableArray(Object.keys(effectiveFilterParams))));
@@ -850,9 +860,6 @@ export default function SmartListTemplate(_ref) {
850
860
  });
851
861
  setHasModified(changed);
852
862
  }
853
- if (isRecordingBaseline) {
854
- setInitializedFilterParams(JSON.parse(JSON.stringify(effectiveFilterParams)));
855
- }
856
863
  }, [effectiveFilterParams, isRecordingBaseline, hasSearched, initializedFilterParams]);
857
864
  var updateTableHeight = useCallback(function () {
858
865
  var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donglegeyu/company-ui",
3
- "version": "1.2.36",
3
+ "version": "1.2.37",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",