|
@@ -78,6 +78,7 @@ function TableData(props: Prosp) {
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (originalColumns.length > 0) {
|
|
if (originalColumns.length > 0) {
|
|
|
|
+ console.log('=============originalColumns========>', sortData)
|
|
if (sortData?.field && sortData.order) {
|
|
if (sortData?.field && sortData.order) {
|
|
setNewColumns(originalColumns.map((item: any) => {
|
|
setNewColumns(originalColumns.map((item: any) => {
|
|
if (item.dataIndex === sortData?.field) {
|
|
if (item.dataIndex === sortData?.field) {
|
|
@@ -94,15 +95,15 @@ function TableData(props: Prosp) {
|
|
}))
|
|
}))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }, [originalColumns, sortData])
|
|
|
|
|
|
+ }, [originalColumns, sortData?.field, sortData?.order])
|
|
|
|
|
|
|
|
|
|
const { run: runSet } = useThrottleFn((newArr, newConfig, fixedData) => {
|
|
const { run: runSet } = useThrottleFn((newArr, newConfig, fixedData) => {
|
|
- console.log('设置配置改变重新赋值')
|
|
|
|
|
|
+ console.log('设置配置改变重新赋值', new Date().getTime())
|
|
setoldSelectData(selectData.selectData)
|
|
setoldSelectData(selectData.selectData)
|
|
setoldFixed(selectData.fixed)
|
|
setoldFixed(selectData.fixed)
|
|
if (newArr.length > 0) {
|
|
if (newArr.length > 0) {
|
|
- console.log('改变---->')
|
|
|
|
|
|
+ console.log('改变--------------------->', new Date().getTime())
|
|
let c: any[] = []
|
|
let c: any[] = []
|
|
newArr.forEach((newItem: any, index: number) => {
|
|
newArr.forEach((newItem: any, index: number) => {
|
|
let oldItem = newConfig.find((c: { dataIndex: any }) => c.dataIndex === newItem.dataIndex)
|
|
let oldItem = newConfig.find((c: { dataIndex: any }) => c.dataIndex === newItem.dataIndex)
|