|
@@ -1,11 +1,12 @@
|
|
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
|
/* eslint-disable no-param-reassign */
|
|
/* eslint-disable no-param-reassign */
|
|
|
-import React, { useRef, useState, useLayoutEffect, useMemo } from 'react'
|
|
|
|
|
|
|
+import React, { useRef, useState, useMemo } from 'react'
|
|
|
import PermSelect from '@/pages/Customer/Company/components/PermSelect'
|
|
import PermSelect from '@/pages/Customer/Company/components/PermSelect'
|
|
|
import { TABLE_COLUMNS_MAP, ColumnStateEnum } from '@/utils/cache/cacheEnum'
|
|
import { TABLE_COLUMNS_MAP, ColumnStateEnum } from '@/utils/cache/cacheEnum'
|
|
|
import { isBoolean, isMobile, isNullOrUnDef, isObject, isUnDef } from '@/utils/is'
|
|
import { isBoolean, isMobile, isNullOrUnDef, isObject, isUnDef } from '@/utils/is'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
import { useModel } from 'umi'
|
|
import { useModel } from 'umi'
|
|
|
|
|
+import { useUpdateLayoutEffect } from 'ahooks'
|
|
|
import { getAuthCache, getPermAuthCache, setAuthCache } from '@/utils/auth'
|
|
import { getAuthCache, getPermAuthCache, setAuthCache } from '@/utils/auth'
|
|
|
import { useTableScroll } from './hooks/useTableScroll'
|
|
import { useTableScroll } from './hooks/useTableScroll'
|
|
|
import type { ColumnsState } from '@ant-design/pro-table'
|
|
import type { ColumnsState } from '@ant-design/pro-table'
|
|
@@ -76,7 +77,7 @@ const BasicTable: {
|
|
|
paginationRef: !isBoolean(resetProps.pagination)
|
|
paginationRef: !isBoolean(resetProps.pagination)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- useLayoutEffect(() => {
|
|
|
|
|
|
|
+ useUpdateLayoutEffect(() => {
|
|
|
if (state.dataSource || !isUnDef(resetProps.dataSource)) {
|
|
if (state.dataSource || !isUnDef(resetProps.dataSource)) {
|
|
|
redoHeight(state.dataSource || resetProps.dataSource)
|
|
redoHeight(state.dataSource || resetProps.dataSource)
|
|
|
}
|
|
}
|