chore: save iconfont files locally

This commit is contained in:
jialin
2025-01-20 17:47:36 +08:00
parent 289c4b497d
commit 7487841385
2 changed files with 18 additions and 6 deletions
@@ -111,11 +111,10 @@ const TableRow: React.FC<
}; };
const filterUpdateChildrenHandler = () => { const filterUpdateChildrenHandler = () => {
_.each(tableContext.allChildren || [], (data: any) => { const dataList = _.filter(tableContext.allChildren, (data: any) => {
if (_.get(data, ['data', [childParentKey]]) === _.get(record, [rowKey])) { return _.get(data, [childParentKey]) === _.get(record, [rowKey]);
updateChunkedList(data);
}
}); });
setChildrenData(dataList);
}; };
const updateChildrenHandler = (list: any) => { const updateChildrenHandler = (list: any) => {
+15 -2
View File
@@ -59,6 +59,15 @@ const Models: React.FC = () => {
} }
}); });
const {
updateChunkedList: updateInstanceChunkedList,
cacheDataListRef: cacheInsDataListRef
} = useUpdateChunkedList({
dataList: modelInstances,
limit: 100,
setDataList: setModelInstances
});
const getWorkerList = async () => { const getWorkerList = async () => {
try { try {
const data = await queryWorkersList({ page: 1, perPage: 100 }); const data = await queryWorkersList({ page: 1, perPage: 100 });
@@ -119,7 +128,9 @@ const Models: React.FC = () => {
}; };
const updateInstanceHandler = (list: any) => { const updateInstanceHandler = (list: any) => {
setModelInstances(list); _.each(list, (data: any) => {
updateInstanceChunkedList(data);
});
}; };
const createModelsChunkRequest = useCallback(async () => { const createModelsChunkRequest = useCallback(async () => {
@@ -155,6 +166,7 @@ const Models: React.FC = () => {
isPageHidden.current = true; isPageHidden.current = true;
chunkRequedtRef.current?.current?.cancel?.(); chunkRequedtRef.current?.current?.cancel?.();
cacheDataListRef.current = []; cacheDataListRef.current = [];
cacheInsDataListRef.current = [];
chunkInstanceRequedtRef.current?.current?.cancel?.(); chunkInstanceRequedtRef.current?.current?.cancel?.();
}, []); }, []);
@@ -212,6 +224,7 @@ const Models: React.FC = () => {
return () => { return () => {
chunkRequedtRef.current?.current?.cancel?.(); chunkRequedtRef.current?.current?.cancel?.();
cacheDataListRef.current = []; cacheDataListRef.current = [];
cacheInsDataListRef.current = [];
chunkInstanceRequedtRef.current?.current?.cancel?.(); chunkInstanceRequedtRef.current?.current?.cancel?.();
instancesToken.current?.cancel?.(); instancesToken.current?.cancel?.();
}; };
@@ -221,7 +234,6 @@ const Models: React.FC = () => {
const handleVisibilityChange = async () => { const handleVisibilityChange = async () => {
if (document.visibilityState === 'visible') { if (document.visibilityState === 'visible') {
isPageHidden.current = false; isPageHidden.current = false;
// await fetchModelsInstances();
await Promise.all([ await Promise.all([
createModelsChunkRequest(), createModelsChunkRequest(),
createModelsInstanceChunkRequest() createModelsInstanceChunkRequest()
@@ -231,6 +243,7 @@ const Models: React.FC = () => {
isPageHidden.current = true; isPageHidden.current = true;
chunkRequedtRef.current?.current?.cancel?.(); chunkRequedtRef.current?.current?.cancel?.();
cacheDataListRef.current = []; cacheDataListRef.current = [];
cacheInsDataListRef.current = [];
chunkInstanceRequedtRef.current?.current?.cancel?.(); chunkInstanceRequedtRef.current?.current?.cancel?.();
} }
}; };