diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index-tree.tsx.ftl b/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index-tree.tsx.ftl index 9284902cd..6c8eb4110 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index-tree.tsx.ftl +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index-tree.tsx.ftl @@ -62,6 +62,7 @@ import { useDict } from '@/hooks/useDict'; <#if enableExport> import { useTableExport } from '@/hooks/useTableExport'; +import { useTableScroll } from '@/hooks/useTableScroll'; import { useTreeTableExpand } from '@/hooks/useTreeTableExpand'; import { useUserStore } from '@/stores/userStore'; <#if needDict> @@ -103,6 +104,7 @@ const ${statusField}InactiveValue = <#if statusColumn.javaType == "Boolean">fals export default function ${BusinessName}Page() { const actionRef = useRef(undefined); + const { tableScroll } = useTableScroll(1000); const [form] = Form.useForm<${BusinessName}Form>(); const userInfo = useUserStore(state => state.userInfo); <#if needDict> @@ -308,7 +310,7 @@ export default function ${BusinessName}Page() { actionRef={actionRef} rowKey="${treeCode}" columns={columns} - scroll={{ x: 1000 }} + scroll={tableScroll} pagination={false} search={{ labelWidth: 90 }} expandable={{ diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index.tsx.ftl b/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index.tsx.ftl index e5ca8dec8..b6444d222 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index.tsx.ftl +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/fm/react/index.tsx.ftl @@ -64,6 +64,7 @@ import { useDateRangeQuery } from '@/hooks/useDateRangeQuery'; <#if enableExport> import { useTableExport } from '@/hooks/useTableExport'; +import { useTableScroll } from '@/hooks/useTableScroll'; import { useTableSelection } from '@/hooks/useTableSelection'; import { useUserStore } from '@/stores/userStore'; <#if needDict> @@ -90,6 +91,7 @@ const ${statusField}InactiveValue = <#if statusColumn.javaType == "Boolean">fals export default function ${BusinessName}Page() { const actionRef = useRef(undefined); + const { tableScroll } = useTableScroll(1000); const [form] = Form.useForm<${BusinessName}Form>(); const userInfo = useUserStore(state => state.userInfo); <#if needDict> @@ -292,7 +294,7 @@ const { applyDateRange: apply${column.capJavaField}DateRange } = useDateRangeQue actionRef={actionRef} rowKey="${pkColumn.javaField}" columns={columns} - scroll={{ x: 1000 }} + scroll={tableScroll} search={{ labelWidth: 90 }} pagination={{ defaultPageSize: 10, showSizeChanger: true }} rowSelection={{ selectedRowKeys: ids, onChange: handleSelectionChange }}