diff --git a/src/components/image-editor/index.tsx b/src/components/image-editor/index.tsx index 3c73b52b..570e9fe5 100644 --- a/src/components/image-editor/index.tsx +++ b/src/components/image-editor/index.tsx @@ -104,6 +104,10 @@ const CanvasImageEditor: React.FC = ({ }; const handleMouseEnter = (e: React.MouseEvent) => { + if (disabled) { + overlayCanvasRef.current!.style.cursor = 'default'; + return; + } overlayCanvasRef.current!.style.cursor = 'none'; cursorRef.current!.style.display = 'block'; cursorRef.current!.style.top = `${e.clientY}px`; @@ -111,6 +115,9 @@ const CanvasImageEditor: React.FC = ({ }; const handleMouseMove = (e: React.MouseEvent) => { + if (disabled) { + return; + } overlayCanvasRef.current!.style.cursor = 'none'; cursorRef.current!.style.display = 'block'; cursorRef.current!.style.top = `${e.clientY}px`; @@ -118,6 +125,9 @@ const CanvasImageEditor: React.FC = ({ }; const handleMouseLeave = () => { + if (disabled) { + return; + } overlayCanvasRef.current!.style.cursor = 'default'; cursorRef.current!.style.display = 'none'; }; @@ -284,6 +294,9 @@ const CanvasImageEditor: React.FC = ({ }, []); const draw = (e: React.MouseEvent) => { + if (disabled) { + return; + } if (!isDrawing.current) return; const { offsetX, offsetY } = e.nativeEvent; @@ -315,6 +328,9 @@ const CanvasImageEditor: React.FC = ({ }; const startDrawing = (e: React.MouseEvent) => { + if (disabled) { + return; + } isDrawing.current = true; currentStroke.current = []; @@ -340,6 +356,9 @@ const CanvasImageEditor: React.FC = ({ const endDrawing = (e: React.MouseEvent) => { console.log('End Drawing:', e); + if (disabled) { + return; + } if (!isDrawing.current) { return; } @@ -610,13 +629,13 @@ const CanvasImageEditor: React.FC = ({ }; }, []); - useEffect(() => { - if (disabled) { - overlayCanvasRef.current!.style.pointerEvents = 'none'; - } else { - overlayCanvasRef.current!.style.pointerEvents = 'auto'; - } - }, [disabled]); + // useEffect(() => { + // if (disabled) { + // overlayCanvasRef.current!.style.pointerEvents = 'none'; + // } else { + // overlayCanvasRef.current!.style.pointerEvents = 'auto'; + // } + // }, [disabled]); return (
diff --git a/src/components/seal-table/components/table-row.tsx b/src/components/seal-table/components/table-row.tsx index fdb30e84..13ae3664 100644 --- a/src/components/seal-table/components/table-row.tsx +++ b/src/components/seal-table/components/table-row.tsx @@ -183,6 +183,20 @@ const TableRow: React.FC< } }, [expanded]); + useEffect(() => { + const handleVisibilityChange = async () => { + if (document.visibilityState === 'hidden') { + cacheDataListRef.current = []; + } + }; + + document.addEventListener('visibilitychange', handleVisibilityChange); + + return () => { + document.removeEventListener('visibilitychange', handleVisibilityChange); + }; + }, []); + useEffect(() => { if (!firstLoad && expanded) { cacheDataListRef.current = childrenData; diff --git a/src/components/tags-wrapper/index.less b/src/components/tags-wrapper/index.less index 4eca0bf6..c87c10b5 100644 --- a/src/components/tags-wrapper/index.less +++ b/src/components/tags-wrapper/index.less @@ -18,3 +18,16 @@ display: flex; } } + +.tags-wrapper-dropdown { + .ant-dropdown-menu { + .ant-dropdown-menu-item { + background-color: transparent; + cursor: default; + + &:hover { + background-color: transparent; + } + } + } +} diff --git a/src/components/tags-wrapper/index.tsx b/src/components/tags-wrapper/index.tsx index 35cd64f3..1dd03749 100644 --- a/src/components/tags-wrapper/index.tsx +++ b/src/components/tags-wrapper/index.tsx @@ -72,6 +72,10 @@ const TagsWrapper: React.FC = (props) => { } }; + const handleClick = (data: any) => { + data.domEvent?.stopPropagation(); + }; + useEffect(() => { if (tagsContentRef.current) { calculateHiddenIndices(); @@ -98,13 +102,15 @@ const TagsWrapper: React.FC = (props) => { {hiddenIndices.end < dataList.length && ( { return { label: renderTag?.(item), - key: index + key: index, + onClick: handleClick }; } ) diff --git a/src/pages/llmodels/components/table-list.tsx b/src/pages/llmodels/components/table-list.tsx index e8164179..dd70c1df 100644 --- a/src/pages/llmodels/components/table-list.tsx +++ b/src/pages/llmodels/components/table-list.tsx @@ -127,7 +127,7 @@ const Models: React.FC = ({ loading, total }) => { - const [expandAtom] = useAtom(modelsExpandKeysAtom); + const [expandAtom, setExpandAtom] = useAtom(modelsExpandKeysAtom); const access = useAccess(); const intl = useIntl(); const navigate = useNavigate(); @@ -227,6 +227,12 @@ const Models: React.FC = ({ } }, [deleteIds]); + useEffect(() => { + return () => { + setExpandAtom([]); + }; + }, []); + const sourceOptions = [ { label: intl.formatMessage({ id: 'menu.models.modelCatalog' }), diff --git a/src/pages/llmodels/index.tsx b/src/pages/llmodels/index.tsx index ef460956..97fd5601 100644 --- a/src/pages/llmodels/index.tsx +++ b/src/pages/llmodels/index.tsx @@ -43,21 +43,20 @@ const Models: React.FC = () => { categories: [] }); - const { updateChunkedList, cacheDataListRef, deletedIdsRef } = - useUpdateChunkedList({ - events: ['UPDATE'], - dataList: dataSource.dataList, - setDataList(list, opts?: any) { - setDataSource((pre) => { - return { - total: pre.total, - loading: false, - dataList: list, - deletedIds: opts?.deletedIds || [] - }; - }); - } - }); + const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({ + events: ['UPDATE'], + dataList: dataSource.dataList, + setDataList(list, opts?: any) { + setDataSource((pre) => { + return { + total: pre.total, + loading: false, + dataList: list, + deletedIds: opts?.deletedIds || [] + }; + }); + } + }); const getWorkerList = async () => { try {