fix(web): 成员名称列 dataIndex;改 key 归属后刷新成员缓存
This commit is contained in:
@@ -44,6 +44,8 @@ export function useKeys(filters: () => KeyListFilters) {
|
||||
return useQuery({
|
||||
queryKey: () => qk.admin.keys(filters()),
|
||||
queryFn: () => fetchKeys(filters()),
|
||||
// 切页回列表时立即反映最新归属/状态
|
||||
staleTime: 0,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -53,6 +55,7 @@ export function useRegisterKey() {
|
||||
mutationFn: registerKey,
|
||||
onSuccess: () => {
|
||||
void qc.invalidateQueries({ queryKey: ["admin", "keys"] });
|
||||
void qc.invalidateQueries({ queryKey: qk.admin.members() });
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -69,6 +72,8 @@ export function usePatchKey() {
|
||||
}) => patchKey(id, body),
|
||||
onSuccess: () => {
|
||||
void qc.invalidateQueries({ queryKey: ["admin", "keys"] });
|
||||
// 归属变更会改成员「名下 Key 数」
|
||||
void qc.invalidateQueries({ queryKey: qk.admin.members() });
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -122,6 +127,7 @@ export function useMembers() {
|
||||
return useQuery({
|
||||
queryKey: qk.admin.members(),
|
||||
queryFn: fetchMembers,
|
||||
staleTime: 0,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ function tipTitle(label: string, tip: string) {
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{ title: "名称", key: "name", width: 140 },
|
||||
{ title: "名称", key: "name", dataIndex: "name", width: 140 },
|
||||
{ title: "备注", key: "remark" },
|
||||
{ title: "状态", key: "status", width: 100 },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user