From e571f339b475f4abc5f201c5c776f71771830ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 30 Jun 2026 11:35:57 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=20react=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi-gen/src/main/resources/fm/react/index-tree.tsx.ftl | 4 +++- .../ruoyi-gen/src/main/resources/fm/react/index.tsx.ftl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 }}