vxe-table 3.10.7 → 3.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +3 -2
- package/es/table/src/body.js +4 -8
- package/es/table/src/cell.js +7 -3
- package/es/table/src/footer.js +2 -4
- package/es/table/src/header.js +2 -2
- package/es/table/src/methods.js +206 -79
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +225 -100
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +2 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/body.js +4 -8
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +10 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +2 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +2 -2
- package/lib/table/src/methods.js +204 -81
- package/lib/table/src/methods.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/panel.ts +5 -2
- package/packages/table/src/body.ts +4 -8
- package/packages/table/src/cell.ts +9 -5
- package/packages/table/src/footer.ts +2 -4
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/methods.ts +210 -77
- /package/es/{iconfont.1731028570313.ttf → iconfont.1731143527990.ttf} +0 -0
- /package/es/{iconfont.1731028570313.woff → iconfont.1731143527990.woff} +0 -0
- /package/es/{iconfont.1731028570313.woff2 → iconfont.1731143527990.woff2} +0 -0
- /package/lib/{iconfont.1731028570313.ttf → iconfont.1731143527990.ttf} +0 -0
- /package/lib/{iconfont.1731028570313.woff → iconfont.1731143527990.woff} +0 -0
- /package/lib/{iconfont.1731028570313.woff2 → iconfont.1731143527990.woff2} +0 -0
|
@@ -692,11 +692,9 @@ export default {
|
|
|
692
692
|
setScrollTop(leftElem, scrollTop)
|
|
693
693
|
setScrollTop(rightElem, scrollTop)
|
|
694
694
|
}
|
|
695
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
695
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
696
696
|
type: renderType,
|
|
697
|
-
fixed: fixedType
|
|
698
|
-
scrollTop,
|
|
699
|
-
scrollLeft
|
|
697
|
+
fixed: fixedType
|
|
700
698
|
})
|
|
701
699
|
}
|
|
702
700
|
if (xHandleEl) {
|
|
@@ -706,11 +704,9 @@ export default {
|
|
|
706
704
|
$xeTable.lastScrollLeft = scrollLeft
|
|
707
705
|
setScrollLeft(headerElem, scrollLeft)
|
|
708
706
|
setScrollLeft(footerElem, scrollLeft)
|
|
709
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
707
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
710
708
|
type: renderType,
|
|
711
|
-
fixed: fixedType
|
|
712
|
-
scrollTop,
|
|
713
|
-
scrollLeft
|
|
709
|
+
fixed: fixedType
|
|
714
710
|
})
|
|
715
711
|
}
|
|
716
712
|
},
|
|
@@ -74,16 +74,20 @@ function renderCellDragIcon (h: CreateElement, params: any) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
|
|
77
|
-
const { $table, column, row } = params
|
|
77
|
+
const { $table, column, row, level } = params
|
|
78
78
|
const { dragSort } = column
|
|
79
|
-
const
|
|
79
|
+
const tableProps = $table
|
|
80
|
+
const { treeConfig } = tableProps
|
|
80
81
|
const rowOpts = $table.computeRowOpts
|
|
81
82
|
const dragOpts = $table.computeDragOpts
|
|
82
83
|
const { showRowIcon, rowVisibleMethod } = dragOpts
|
|
84
|
+
const vns: any[] = XEUtils.isArray(content) ? content : [content]
|
|
83
85
|
if (dragSort && rowOpts.drag && (showRowIcon && (!rowVisibleMethod || rowVisibleMethod({ row, column })))) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
if (!treeConfig || !level) {
|
|
87
|
+
vns.unshift(
|
|
88
|
+
renderCellDragIcon(h, params)
|
|
89
|
+
)
|
|
90
|
+
}
|
|
87
91
|
}
|
|
88
92
|
return vns
|
|
89
93
|
}
|
|
@@ -295,11 +295,9 @@ export default {
|
|
|
295
295
|
$xeTable.lastScrollTime = Date.now()
|
|
296
296
|
setScrollLeft(headerElem, scrollLeft)
|
|
297
297
|
setScrollLeft(bodyElem, scrollLeft)
|
|
298
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
298
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
299
299
|
type: renderType,
|
|
300
|
-
fixed: fixedType
|
|
301
|
-
scrollTop,
|
|
302
|
-
scrollLeft
|
|
300
|
+
fixed: fixedType
|
|
303
301
|
})
|
|
304
302
|
}
|
|
305
303
|
}
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
},
|
|
57
57
|
render (h: CreateElement) {
|
|
58
58
|
const { _e, $parent: $xetable, fixedType, headerColumn, tableColumn, fixedColumn } = this
|
|
59
|
-
const { $listeners: tableListeners, tId, isGroup, visibleColumn, resizable, border, columnKey, headerRowClassName, headerCellClassName, headerRowStyle, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, highlightCurrentColumn, currentColumn, scrollXLoad, overflowX, scrollbarWidth, sortOpts, mouseConfig, columnOpts } = $xetable
|
|
59
|
+
const { $listeners: tableListeners, tId, isGroup, visibleColumn, resizable: allResizable, border, columnKey, headerRowClassName, headerCellClassName, headerRowStyle, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, highlightCurrentColumn, currentColumn, scrollXLoad, overflowX, scrollbarWidth, sortOpts, mouseConfig, columnOpts } = $xetable
|
|
60
60
|
let headerGroups = headerColumn
|
|
61
61
|
let renderColumnList = tableColumn
|
|
62
62
|
if (isGroup) {
|
|
@@ -188,7 +188,7 @@ export default {
|
|
|
188
188
|
/**
|
|
189
189
|
* 列宽拖动
|
|
190
190
|
*/
|
|
191
|
-
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable ||
|
|
191
|
+
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
192
192
|
? h('div', {
|
|
193
193
|
class: ['vxe-resizable', {
|
|
194
194
|
'is--line': !border || border === 'none'
|
|
@@ -339,6 +339,17 @@ function clearRowDropOrigin ($xeTable: any) {
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
+
function updateRowDropOrigin ($xeTable: any, row: any) {
|
|
343
|
+
const el = $xeTable.$el
|
|
344
|
+
if (el) {
|
|
345
|
+
const clss = 'row--drag-origin'
|
|
346
|
+
const rowid = getRowid($xeTable, row)
|
|
347
|
+
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), (elem) => {
|
|
348
|
+
addClass(elem, clss)
|
|
349
|
+
})
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
342
353
|
function clearRowDropTarget ($xeTable: any) {
|
|
343
354
|
const el = $xeTable.$el
|
|
344
355
|
if (el) {
|
|
@@ -349,6 +360,18 @@ function clearRowDropTarget ($xeTable: any) {
|
|
|
349
360
|
}
|
|
350
361
|
}
|
|
351
362
|
|
|
363
|
+
function updateRowDropTarget ($xeTable: any, row: any, dragPos: string) {
|
|
364
|
+
const el = $xeTable.$el
|
|
365
|
+
if (el) {
|
|
366
|
+
const clss = 'row--drag-active-target'
|
|
367
|
+
const rowid = getRowid($xeTable, row)
|
|
368
|
+
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), (elem: any) => {
|
|
369
|
+
addClass(elem, clss)
|
|
370
|
+
elem.setAttribute('drag-pos', dragPos)
|
|
371
|
+
})
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
352
375
|
function showRowDropTip (evnt: DragEvent | MouseEvent, $xeTable: any) {
|
|
353
376
|
const rdTipEl = $xeTable.$refs.refRowDragTipElem as HTMLDivElement
|
|
354
377
|
if (!rdTipEl) {
|
|
@@ -1785,80 +1808,137 @@ const Methods = {
|
|
|
1785
1808
|
* 设置为固定列
|
|
1786
1809
|
*/
|
|
1787
1810
|
setColumnFixed (fieldOrColumn: any, fixed: any) {
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1811
|
+
const $xeTable = this
|
|
1812
|
+
|
|
1813
|
+
let status = false
|
|
1814
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn]
|
|
1815
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
1816
|
+
const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
|
|
1817
|
+
for (let i = 0; i < cols.length; i++) {
|
|
1818
|
+
const item = cols[i]
|
|
1819
|
+
const column = handleFieldOrColumn($xeTable, item)
|
|
1820
|
+
const targetColumn = getRootColumn($xeTable, column as any)
|
|
1821
|
+
if (targetColumn && targetColumn.fixed !== fixed) {
|
|
1822
|
+
// 是否超过最大固定列数量
|
|
1823
|
+
if (!targetColumn.fixed && isMaxFixedColumn) {
|
|
1824
|
+
if (VxeUI.modal) {
|
|
1825
|
+
VxeUI.modal.message({
|
|
1826
|
+
status: 'error',
|
|
1827
|
+
content: getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
|
|
1828
|
+
})
|
|
1829
|
+
}
|
|
1830
|
+
return $xeTable.$nextTick()
|
|
1831
|
+
}
|
|
1832
|
+
XEUtils.eachTree([targetColumn], (column) => {
|
|
1833
|
+
column.fixed = fixed
|
|
1834
|
+
})
|
|
1835
|
+
$xeTable.saveCustomStore('update:fixed')
|
|
1836
|
+
if (!status) {
|
|
1837
|
+
status = true
|
|
1799
1838
|
}
|
|
1800
|
-
return this.$nextTick()
|
|
1801
1839
|
}
|
|
1802
|
-
XEUtils.eachTree([targetColumn], (column) => {
|
|
1803
|
-
column.fixed = fixed
|
|
1804
|
-
})
|
|
1805
|
-
this.saveCustomStore('update:fixed')
|
|
1806
|
-
return this.refreshColumn()
|
|
1807
1840
|
}
|
|
1808
|
-
|
|
1841
|
+
if (status) {
|
|
1842
|
+
return $xeTable.refreshColumn()
|
|
1843
|
+
}
|
|
1844
|
+
return $xeTable.$nextTick()
|
|
1809
1845
|
},
|
|
1810
1846
|
/**
|
|
1811
1847
|
* 取消指定固定列
|
|
1812
1848
|
*/
|
|
1813
1849
|
clearColumnFixed (fieldOrColumn: any) {
|
|
1814
|
-
const
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1850
|
+
const $xeTable = this
|
|
1851
|
+
|
|
1852
|
+
let status = false
|
|
1853
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn]
|
|
1854
|
+
cols.forEach(item => {
|
|
1855
|
+
const column = handleFieldOrColumn($xeTable, item)
|
|
1856
|
+
const targetColumn = getRootColumn($xeTable, column as any)
|
|
1857
|
+
if (targetColumn && targetColumn.fixed) {
|
|
1858
|
+
XEUtils.eachTree([targetColumn], (column) => {
|
|
1859
|
+
column.fixed = null
|
|
1860
|
+
})
|
|
1861
|
+
$xeTable.saveCustomStore('update:fixed')
|
|
1862
|
+
if (!status) {
|
|
1863
|
+
status = true
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
})
|
|
1867
|
+
if (status) {
|
|
1868
|
+
return $xeTable.refreshColumn()
|
|
1822
1869
|
}
|
|
1823
|
-
return
|
|
1870
|
+
return $xeTable.$nextTick()
|
|
1824
1871
|
},
|
|
1825
1872
|
/**
|
|
1826
1873
|
* 隐藏指定列
|
|
1827
1874
|
*/
|
|
1828
1875
|
hideColumn (fieldOrColumn: any) {
|
|
1829
|
-
const
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1876
|
+
const $xeTable = this
|
|
1877
|
+
|
|
1878
|
+
let status = false
|
|
1879
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn]
|
|
1880
|
+
cols.forEach(item => {
|
|
1881
|
+
const column = handleFieldOrColumn($xeTable, item)
|
|
1882
|
+
if (column && column.visible) {
|
|
1883
|
+
column.visible = false
|
|
1884
|
+
if (!status) {
|
|
1885
|
+
status = true
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
})
|
|
1889
|
+
if (status) {
|
|
1890
|
+
return $xeTable.handleCustom()
|
|
1833
1891
|
}
|
|
1834
|
-
return
|
|
1892
|
+
return $xeTable.$nextTick()
|
|
1835
1893
|
},
|
|
1836
1894
|
/**
|
|
1837
1895
|
* 显示指定列
|
|
1838
1896
|
*/
|
|
1839
1897
|
showColumn (fieldOrColumn: any) {
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1898
|
+
const $xeTable = this
|
|
1899
|
+
|
|
1900
|
+
let status = false
|
|
1901
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn]
|
|
1902
|
+
cols.forEach(item => {
|
|
1903
|
+
const column = handleFieldOrColumn($xeTable, item)
|
|
1904
|
+
if (column && !column.visible) {
|
|
1905
|
+
column.visible = true
|
|
1906
|
+
if (!status) {
|
|
1907
|
+
status = true
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
})
|
|
1911
|
+
if (status) {
|
|
1912
|
+
return $xeTable.handleCustom()
|
|
1844
1913
|
}
|
|
1845
|
-
return
|
|
1914
|
+
return $xeTable.$nextTick()
|
|
1846
1915
|
},
|
|
1847
1916
|
setColumnWidth (fieldOrColumn: any, width: any) {
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
const
|
|
1856
|
-
rdWidth =
|
|
1917
|
+
const $xeTable = this
|
|
1918
|
+
|
|
1919
|
+
let status = false
|
|
1920
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn]
|
|
1921
|
+
cols.forEach(item => {
|
|
1922
|
+
const column = handleFieldOrColumn($xeTable, item)
|
|
1923
|
+
if (column) {
|
|
1924
|
+
const colWidth = XEUtils.toInteger(width)
|
|
1925
|
+
let rdWidth = colWidth
|
|
1926
|
+
if (isScale(width)) {
|
|
1927
|
+
const tableBody = $xeTable.$refs.tableBody
|
|
1928
|
+
const bodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
1929
|
+
const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0
|
|
1930
|
+
rdWidth = Math.floor(colWidth * bodyWidth)
|
|
1931
|
+
}
|
|
1932
|
+
column.resizeWidth = rdWidth
|
|
1933
|
+
if (!status) {
|
|
1934
|
+
status = true
|
|
1935
|
+
}
|
|
1857
1936
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1937
|
+
})
|
|
1938
|
+
if (status) {
|
|
1939
|
+
return $xeTable.refreshColumn()
|
|
1860
1940
|
}
|
|
1861
|
-
return
|
|
1941
|
+
return $xeTable.$nextTick()
|
|
1862
1942
|
},
|
|
1863
1943
|
getColumnWidth (fieldOrColumn: any) {
|
|
1864
1944
|
const column = handleFieldOrColumn(this, fieldOrColumn)
|
|
@@ -4588,7 +4668,7 @@ const Methods = {
|
|
|
4588
4668
|
const treeOpts = $xeTable.computeTreeOpts
|
|
4589
4669
|
const { transform } = treeOpts
|
|
4590
4670
|
const { dragRow } = reactData
|
|
4591
|
-
const { afterFullData, tableFullData, prevDragRow, prevDragPos } = internalData
|
|
4671
|
+
const { afterFullData, afterTreeFullData, tableFullData, tableFullTreeData, prevDragRow, prevDragPos } = internalData
|
|
4592
4672
|
if (prevDragRow && dragRow) {
|
|
4593
4673
|
// 判断是否有拖动
|
|
4594
4674
|
if (prevDragRow !== dragRow) {
|
|
@@ -4605,18 +4685,36 @@ const Methods = {
|
|
|
4605
4685
|
}
|
|
4606
4686
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
|
|
4607
4687
|
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4688
|
+
let oafIndex = -1
|
|
4689
|
+
let nafIndex = -1
|
|
4690
|
+
if (treeConfig) {
|
|
4691
|
+
// 移出源位置
|
|
4692
|
+
oafIndex = $xeTable.findRowIndexOf(afterTreeFullData, dragRow)
|
|
4693
|
+
const otfIndex = $xeTable.findRowIndexOf(tableFullTreeData, dragRow)
|
|
4694
|
+
afterTreeFullData.splice(oafIndex, 1)
|
|
4695
|
+
tableFullTreeData.splice(otfIndex, 1)
|
|
4696
|
+
|
|
4697
|
+
// 插新位置
|
|
4698
|
+
const pafIndex = $xeTable.findRowIndexOf(afterTreeFullData, prevDragRow)
|
|
4699
|
+
const ptfIndex = $xeTable.findRowIndexOf(tableFullTreeData, prevDragRow)
|
|
4700
|
+
nafIndex = pafIndex + dragOffsetIndex
|
|
4701
|
+
const ntfIndex = ptfIndex + dragOffsetIndex
|
|
4702
|
+
afterTreeFullData.splice(nafIndex, 0, dragRow)
|
|
4703
|
+
tableFullTreeData.splice(ntfIndex, 0, dragRow)
|
|
4704
|
+
} else {
|
|
4705
|
+
// 移出源位置
|
|
4706
|
+
oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow)
|
|
4707
|
+
const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow)
|
|
4708
|
+
afterFullData.splice(oafIndex, 1)
|
|
4709
|
+
tableFullData.splice(otfIndex, 1)
|
|
4710
|
+
// 插新位置
|
|
4711
|
+
const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow)
|
|
4712
|
+
const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow)
|
|
4713
|
+
nafIndex = pafIndex + dragOffsetIndex
|
|
4714
|
+
const ntfIndex = ptfIndex + dragOffsetIndex
|
|
4715
|
+
afterFullData.splice(nafIndex, 0, dragRow)
|
|
4716
|
+
tableFullData.splice(ntfIndex, 0, dragRow)
|
|
4717
|
+
}
|
|
4620
4718
|
|
|
4621
4719
|
reactData.isDragRowMove = true
|
|
4622
4720
|
$xeTable.cacheRowMap()
|
|
@@ -4670,8 +4768,7 @@ const Methods = {
|
|
|
4670
4768
|
const { dragRow } = reactData
|
|
4671
4769
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y
|
|
4672
4770
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom'
|
|
4673
|
-
|
|
4674
|
-
trEl.setAttribute('drag-pos', dragPos)
|
|
4771
|
+
updateRowDropTarget($xeTable, row, dragPos)
|
|
4675
4772
|
internalData.prevDragRow = row
|
|
4676
4773
|
internalData.prevDragPos = dragPos
|
|
4677
4774
|
$xeTable.dispatchEvent('row-dragover', {
|
|
@@ -4703,7 +4800,7 @@ const Methods = {
|
|
|
4703
4800
|
}
|
|
4704
4801
|
reactData.dragRow = row
|
|
4705
4802
|
trEl.draggable = true
|
|
4706
|
-
|
|
4803
|
+
updateRowDropOrigin($xeTable, row)
|
|
4707
4804
|
showRowDropTip(evnt, $xeTable)
|
|
4708
4805
|
updateRowDropTipContent($xeTable, tdEl)
|
|
4709
4806
|
$xeTable.dispatchEvent('row-dragstart', params, evnt)
|
|
@@ -5554,7 +5651,7 @@ const Methods = {
|
|
|
5554
5651
|
}
|
|
5555
5652
|
this.closeTooltip()
|
|
5556
5653
|
},
|
|
5557
|
-
handleScrollEvent (evnt: Event, isRollY: boolean, isRollX: boolean, params: any) {
|
|
5654
|
+
handleScrollEvent (evnt: Event, isRollY: boolean, isRollX: boolean, scrollTop: number, scrollLeft: number, params: any) {
|
|
5558
5655
|
const $xeTable = this
|
|
5559
5656
|
const props = $xeTable
|
|
5560
5657
|
|
|
@@ -5580,13 +5677,35 @@ const Methods = {
|
|
|
5580
5677
|
const bodyWidth = bodyElem ? bodyElem.clientWidth : 0
|
|
5581
5678
|
const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0
|
|
5582
5679
|
const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0
|
|
5680
|
+
let isTop = false
|
|
5681
|
+
let isBottom = false
|
|
5682
|
+
let isLeft = false
|
|
5683
|
+
let isRight = false
|
|
5684
|
+
if (isRollX) {
|
|
5685
|
+
isLeft = scrollLeft <= 0
|
|
5686
|
+
if (!isTop) {
|
|
5687
|
+
isRight = scrollLeft + bodyWidth >= scrollWidth
|
|
5688
|
+
}
|
|
5689
|
+
$xeTable.checkScrolling()
|
|
5690
|
+
} else {
|
|
5691
|
+
isTop = scrollTop <= 0
|
|
5692
|
+
if (!isTop) {
|
|
5693
|
+
isBottom = scrollTop + bodyHeight >= scrollHeight
|
|
5694
|
+
}
|
|
5695
|
+
}
|
|
5583
5696
|
const evntParams = {
|
|
5697
|
+
scrollTop,
|
|
5698
|
+
scrollLeft,
|
|
5584
5699
|
bodyHeight,
|
|
5585
5700
|
bodyWidth,
|
|
5586
5701
|
scrollHeight,
|
|
5587
5702
|
scrollWidth,
|
|
5588
5703
|
isX: isRollX,
|
|
5589
5704
|
isY: isRollY,
|
|
5705
|
+
isTop,
|
|
5706
|
+
isBottom,
|
|
5707
|
+
isLeft,
|
|
5708
|
+
isRight,
|
|
5590
5709
|
...params
|
|
5591
5710
|
}
|
|
5592
5711
|
$xeTable.dispatchEvent('scroll', evntParams, evnt)
|
|
@@ -5634,11 +5753,9 @@ const Methods = {
|
|
|
5634
5753
|
$xeTable.lastScrollTime = Date.now()
|
|
5635
5754
|
$xeTable.handleSyncScrollX(scrollLeft)
|
|
5636
5755
|
$xeTable.triggerScrollXEvent(evnt)
|
|
5637
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
5756
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
5638
5757
|
type: 'table',
|
|
5639
|
-
fixed: ''
|
|
5640
|
-
scrollTop,
|
|
5641
|
-
scrollLeft
|
|
5758
|
+
fixed: ''
|
|
5642
5759
|
})
|
|
5643
5760
|
},
|
|
5644
5761
|
debounceScrollYCalculate: XEUtils.debounce(function () {
|
|
@@ -5670,11 +5787,9 @@ const Methods = {
|
|
|
5670
5787
|
$xeTable.lastScrollTime = Date.now()
|
|
5671
5788
|
$xeTable.handleSyncScrollY(scrollTop)
|
|
5672
5789
|
$xeTable.triggerScrollYEvent(evnt)
|
|
5673
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
5790
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
5674
5791
|
type: 'table',
|
|
5675
|
-
fixed: ''
|
|
5676
|
-
scrollTop,
|
|
5677
|
-
scrollLeft
|
|
5792
|
+
fixed: ''
|
|
5678
5793
|
})
|
|
5679
5794
|
},
|
|
5680
5795
|
/**
|
|
@@ -5871,16 +5986,34 @@ const Methods = {
|
|
|
5871
5986
|
* @param {Number} scrollTop 上距离
|
|
5872
5987
|
*/
|
|
5873
5988
|
scrollTo (scrollLeft: any, scrollTop: any) {
|
|
5989
|
+
const $xeTable = this
|
|
5990
|
+
|
|
5874
5991
|
const { $refs } = this
|
|
5875
|
-
const { tableBody, rightBody, tableFooter } = $refs
|
|
5992
|
+
const { tableBody, tableHeader, leftBody, rightBody, tableFooter } = $refs
|
|
5876
5993
|
const tableBodyElem = tableBody ? tableBody.$el : null
|
|
5994
|
+
const leftBodyElem = leftBody ? leftBody.$el : null
|
|
5877
5995
|
const rightBodyElem = rightBody ? rightBody.$el : null
|
|
5996
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null
|
|
5878
5997
|
const tableFooterElem = tableFooter ? tableFooter.$el : null
|
|
5879
5998
|
if (XEUtils.isNumber(scrollLeft)) {
|
|
5880
|
-
|
|
5999
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem
|
|
6000
|
+
if (xHandleEl) {
|
|
6001
|
+
setScrollLeft(xHandleEl, scrollLeft)
|
|
6002
|
+
} else {
|
|
6003
|
+
setScrollLeft(tableBodyElem, scrollLeft)
|
|
6004
|
+
setScrollLeft(tableHeaderElem, scrollLeft)
|
|
6005
|
+
setScrollLeft(tableFooterElem, scrollLeft)
|
|
6006
|
+
}
|
|
5881
6007
|
}
|
|
5882
6008
|
if (XEUtils.isNumber(scrollTop)) {
|
|
5883
|
-
|
|
6009
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem
|
|
6010
|
+
if (yHandleEl) {
|
|
6011
|
+
setScrollTop(yHandleEl, scrollTop)
|
|
6012
|
+
} else {
|
|
6013
|
+
setScrollTop(tableBodyElem, scrollTop)
|
|
6014
|
+
setScrollTop(leftBodyElem, scrollTop)
|
|
6015
|
+
setScrollTop(rightBodyElem, scrollTop)
|
|
6016
|
+
}
|
|
5884
6017
|
}
|
|
5885
6018
|
if (this.scrollXLoad || this.scrollYLoad) {
|
|
5886
6019
|
return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 50))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|