@hzab/hierarchical-statistics 0.0.5 → 0.0.6

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ # @hzab/component-boilerplate@0.0.6
2
+ - fix: 修复跳转同路由,listRender参数依赖没有更新问题
1
3
  # @hzab/component-boilerplate@0.0.5
2
4
  - fix: 暴露面包屑回显数据breadcrumbData
3
5
  # @hzab/component-boilerplate@0.0.4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/hierarchical-statistics",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -21,6 +21,7 @@ const InfiniteListUIMobile = (props: InfiniteListProps, ref: ForwardedRef<Infini
21
21
  listStyle,
22
22
  breadModel,
23
23
  className,
24
+ refreshKey,
24
25
  },
25
26
  actions: { fetchBreadData, handleSelectId, handleNodeClick, handleBreadcrumbClick },
26
27
  } = useInfiniteList({ ...props, terminal: "mobile" });
@@ -52,7 +53,13 @@ const InfiniteListUIMobile = (props: InfiniteListProps, ref: ForwardedRef<Infini
52
53
 
53
54
  <div className="infinite-level-list-box" style={listStyle}>
54
55
  {/* 移动端 */}
55
- <ListRender ref={listRef} model={listModal} {...listRenderProps} ItemRender={Slots.renderItem} />
56
+ <ListRender
57
+ key={refreshKey}
58
+ ref={listRef}
59
+ model={listModal}
60
+ {...listRenderProps}
61
+ ItemRender={Slots.renderItem}
62
+ />
56
63
  </div>
57
64
  </Spin>
58
65
  </div>
@@ -22,6 +22,7 @@ const InfiniteListUIPc = (props: InfiniteListProps, ref: ForwardedRef<InfiniteLi
22
22
  listRef,
23
23
  virtualPagedListProps,
24
24
  className,
25
+ refreshKey,
25
26
  },
26
27
  actions: { handleSelectId, handleNodeClick, handleBreadcrumbClick, fetchBreadData },
27
28
  } = useInfiniteList({ ...props, terminal: "pc" });
@@ -62,7 +63,7 @@ const InfiniteListUIPc = (props: InfiniteListProps, ref: ForwardedRef<InfiniteLi
62
63
  </div>
63
64
  <div className="infinite-level-list-box" style={listStyle}>
64
65
  <VirtualPagedList
65
- key={selectedLoadIdNode}
66
+ key={refreshKey}
66
67
  ref={listRef}
67
68
  {...virtualPagedListProps}
68
69
  renderItem={Slots.renderItem}
@@ -36,6 +36,7 @@ export function useInfiniteList(props: InfiniteListProps) {
36
36
  const [breadcrumbData, setBreadcrumbData] = useState<PathItem[]>(
37
37
  showHome ? [{ value: 0, label: homeBreadcrumb }] : [],
38
38
  );
39
+ const [refreshKey, setRefreshKey] = useState(1);
39
40
  const listRef = useRef<any>(null);
40
41
 
41
42
  /**
@@ -58,7 +59,7 @@ export function useInfiniteList(props: InfiniteListProps) {
58
59
  label: item[fieldList.label],
59
60
  },
60
61
  ]);
61
- listRef.current?.onSearch();
62
+ setRefreshKey((pre) => pre + 1);
62
63
  };
63
64
 
64
65
  /**
@@ -85,7 +86,7 @@ export function useInfiniteList(props: InfiniteListProps) {
85
86
  listModal.query = { ...listModal.query, [parentField]: item.value };
86
87
  setSelectedLoadIdNode(item.value);
87
88
  setBreadcrumbData(breadcrumbData.slice(0, index + 1));
88
- listRef.current?.onSearch();
89
+ setRefreshKey((pre) => pre + 1);
89
90
  };
90
91
 
91
92
  /**
@@ -133,6 +134,7 @@ export function useInfiniteList(props: InfiniteListProps) {
133
134
  listModal,
134
135
  breadModel,
135
136
  className,
137
+ refreshKey,
136
138
  },
137
139
  actions: {
138
140
  handleSelectId,