Merge commit '4e1c66a221fe6620e0ca67dc976ff4fd72503178' into iipbs/wr/form_fuction

This commit is contained in:
jyha00
2025-06-25 14:18:55 +09:00
@@ -19,6 +19,8 @@ type UiTableProps = {
resetPageNo?: boolean;
children?: React.ReactNode | undefined;
boldArray?: number[];
resetSelection?: boolean;
index?:number;
}
type UiHeadProps = {
@@ -28,9 +30,9 @@ type UiHeadProps = {
visible?:boolean;
}
export function UiTable({ tableData, headlist, pageSize, total, headName, children, cellClick, onPageChange, className = '', resetPageNo = false, boldArray = [] }: UiTableProps) {
export function UiTable({ tableData, headlist, pageSize, total, headName, children, cellClick, onPageChange, className = '', resetPageNo = false, boldArray = [], resetSelection = false, index=-1 }: UiTableProps) {
const [cur, setCur] = useState<number>(1);
const [idx, setIdx] = useState<number>(-1);
const [idx, setIdx] = useState<number>(index);
const [isCheck, seIsCheck] = useState<boolean>(false);
@@ -41,6 +43,12 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr
}
}, [onPageChange, resetPageNo]);
useEffect(() => {
if (resetSelection) {
setIdx(-1);
}
}, [resetSelection]);
const handlePageChange = (page: number) => {
setCur(page);
onPageChange(page);