zmdms-webui 0.0.85 → 0.0.87

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.
@@ -70,24 +70,25 @@ function useDynamicListByColumns(columns, dynamicKey) {
70
70
  var _a = useState(function () {
71
71
  return getCurrentDynamicItems(dynamicKey, TABLE_DYNAMIC_KEY, defaultDynamicList);
72
72
  }), currentDynamicList = _a[0], setCurrentDynamicList = _a[1];
73
+ var currentDynamicListRef = useRef();
74
+ useEffect(function () {
75
+ currentDynamicListRef.current = currentDynamicList;
76
+ }, [currentDynamicList]);
73
77
  // columns发生变化时,更新数据默认配置
74
78
  useEffect(function () {
75
79
  var _a, _b;
76
80
  var defaultDynamicList = getDynamicList(dynamicKey, columns);
81
+ // 更新动态列配置信息
82
+ var newDynamicList = getCurrentDynamicItems(dynamicKey, TABLE_DYNAMIC_KEY, defaultDynamicList);
83
+ if (!isEqual(currentDynamicListRef.current, newDynamicList)) {
84
+ setCurrentDynamicList(newDynamicList);
85
+ }
77
86
  (_b = (_a = dynamicSettingRef === null || dynamicSettingRef === void 0 ? void 0 : dynamicSettingRef.current) === null || _a === void 0 ? void 0 : _a.setList) === null || _b === void 0 ? void 0 : _b.call(_a, function (preList) {
78
87
  if (isEqual(preList, defaultDynamicList)) {
79
88
  return preList;
80
89
  }
81
90
  return defaultDynamicList;
82
91
  });
83
- // 更新动态列配置信息
84
- var newDynamicList = getCurrentDynamicItems(dynamicKey, TABLE_DYNAMIC_KEY, defaultDynamicList);
85
- setCurrentDynamicList(function (preList) {
86
- if (isEqual(preList, newDynamicList)) {
87
- return preList;
88
- }
89
- return newDynamicList;
90
- });
91
92
  }, [dynamicKey, columns]);
92
93
  var onCurrentListChange = useCallback(function (newDynamicList) {
93
94
  // console.log(newDynamicList);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-webui",
3
- "version": "0.0.85",
3
+ "version": "0.0.87",
4
4
  "private": false,
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",