vxe-table 3.19.0 → 3.19.1
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/README.md +2 -2
- package/es/grid/src/grid.js +27 -31
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/en-US.js +22 -22
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/methods.js +52 -15
- package/es/table/src/table.js +18 -5
- package/es/table/src/util.js +29 -23
- package/es/table/style.css +29 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +29 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +48 -52
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +136 -95
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +22 -22
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +22 -22
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +55 -15
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +14 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +17 -23
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +29 -2
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +29 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +64 -68
- package/packages/locale/lang/en-US.ts +22 -22
- package/packages/table/src/methods.ts +55 -15
- package/packages/table/src/table.ts +19 -5
- package/packages/table/src/util.ts +37 -23
- package/styles/components/table.scss +52 -2
- /package/es/{iconfont.1760925668508.ttf → iconfont.1761181583983.ttf} +0 -0
- /package/es/{iconfont.1760925668508.woff → iconfont.1761181583983.woff} +0 -0
- /package/es/{iconfont.1760925668508.woff2 → iconfont.1761181583983.woff2} +0 -0
- /package/lib/{iconfont.1760925668508.ttf → iconfont.1761181583983.ttf} +0 -0
- /package/lib/{iconfont.1760925668508.woff → iconfont.1761181583983.woff} +0 -0
- /package/lib/{iconfont.1760925668508.woff2 → iconfont.1761181583983.woff2} +0 -0
|
@@ -438,8 +438,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
438
438
|
*/
|
|
439
439
|
getExcludeHeight () {
|
|
440
440
|
const $xeGrid = this
|
|
441
|
+
const props = $xeGrid
|
|
441
442
|
const reactData = $xeGrid.reactData
|
|
442
443
|
|
|
444
|
+
const { height } = props
|
|
443
445
|
const { isZMax } = reactData
|
|
444
446
|
const el = $xeGrid.$refs.refElem as HTMLDivElement
|
|
445
447
|
if (el) {
|
|
@@ -449,7 +451,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
449
451
|
const bottomWrapper = $xeGrid.$refs.refBottomWrapper as HTMLDivElement
|
|
450
452
|
const pagerWrapper = $xeGrid.$refs.refPagerWrapper as HTMLDivElement
|
|
451
453
|
const parentEl = el.parentElement as HTMLElement
|
|
452
|
-
|
|
454
|
+
let parentPaddingSize = 0
|
|
455
|
+
if (parentEl && (height === '100%' || height === 'auto')) {
|
|
456
|
+
parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(parentEl)
|
|
457
|
+
}
|
|
453
458
|
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
|
|
454
459
|
}
|
|
455
460
|
return 0
|
|
@@ -673,6 +678,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
673
678
|
if (!isInited && reactData.tableLoading) {
|
|
674
679
|
return $xeGrid.$nextTick()
|
|
675
680
|
}
|
|
681
|
+
let operPromise = null
|
|
676
682
|
let sortList: any[] = []
|
|
677
683
|
let filterList: VxeTableDefines.FilterCheckedParams[] = []
|
|
678
684
|
let pageParams: any = {}
|
|
@@ -724,7 +730,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
724
730
|
} else {
|
|
725
731
|
if ($xeTable) {
|
|
726
732
|
if (isReload) {
|
|
727
|
-
$xeTable.clearAll()
|
|
733
|
+
operPromise = $xeTable.clearAll()
|
|
728
734
|
} else {
|
|
729
735
|
sortList = $xeTable.getSortColumns()
|
|
730
736
|
filterList = $xeTable.getCheckedFilters()
|
|
@@ -749,51 +755,53 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
749
755
|
reactData.sortData = sortList
|
|
750
756
|
reactData.filterData = filterList
|
|
751
757
|
reactData.tableLoading = true
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
} else {
|
|
770
|
-
const listProp = resConfigs.list
|
|
771
|
-
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
|
|
758
|
+
return Promise.all([
|
|
759
|
+
Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args)),
|
|
760
|
+
operPromise
|
|
761
|
+
]).then(([rest]) => {
|
|
762
|
+
let tableData: any[] = []
|
|
763
|
+
reactData.tableLoading = false
|
|
764
|
+
if (rest) {
|
|
765
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
766
|
+
const totalProp = resConfigs.total
|
|
767
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
|
|
768
|
+
tablePage.total = XEUtils.toNumber(total)
|
|
769
|
+
const resultProp = resConfigs.result
|
|
770
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || []
|
|
771
|
+
// 检验当前页码,不能超出当前最大页数
|
|
772
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
773
|
+
if (tablePage.currentPage > pageCount) {
|
|
774
|
+
tablePage.currentPage = pageCount
|
|
772
775
|
}
|
|
773
|
-
}
|
|
774
|
-
if ($xeTable as any) {
|
|
775
|
-
$xeTable.loadData(tableData)
|
|
776
776
|
} else {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
$xeTable.loadData(tableData)
|
|
780
|
-
}
|
|
781
|
-
})
|
|
782
|
-
}
|
|
783
|
-
if (afterQuery) {
|
|
784
|
-
afterQuery(...applyArgs)
|
|
785
|
-
}
|
|
786
|
-
if (querySuccessMethods) {
|
|
787
|
-
querySuccessMethods({ ...commitParams, response: rest })
|
|
777
|
+
const listProp = resConfigs.list
|
|
778
|
+
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
|
|
788
779
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
780
|
+
}
|
|
781
|
+
if ($xeTable) {
|
|
782
|
+
$xeTable.loadData(tableData)
|
|
783
|
+
} else {
|
|
784
|
+
$xeGrid.$nextTick(() => {
|
|
785
|
+
const $xeTable = $xeGrid.$refs.refTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
786
|
+
if ($xeTable) {
|
|
787
|
+
$xeTable.loadData(tableData)
|
|
788
|
+
}
|
|
789
|
+
})
|
|
790
|
+
}
|
|
791
|
+
if (afterQuery) {
|
|
792
|
+
afterQuery(commitParams, ...args)
|
|
793
|
+
}
|
|
794
|
+
if (querySuccessMethods) {
|
|
795
|
+
querySuccessMethods({ ...commitParams, response: rest })
|
|
796
|
+
}
|
|
797
|
+
return { status: true }
|
|
798
|
+
}).catch((rest) => {
|
|
799
|
+
reactData.tableLoading = false
|
|
800
|
+
if (queryErrorMethods) {
|
|
801
|
+
queryErrorMethods({ ...commitParams, response: rest })
|
|
802
|
+
}
|
|
803
|
+
return { status: false }
|
|
804
|
+
})
|
|
797
805
|
} else {
|
|
798
806
|
errLog('vxe.error.notFunc', ['[grid] proxy-config.ajax.query'])
|
|
799
807
|
}
|
|
@@ -829,11 +837,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
829
837
|
reactData.tableLoading = false
|
|
830
838
|
$xeTable.setPendingRow(removeRecords, false)
|
|
831
839
|
if (isRespMsg) {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
840
|
+
if (VxeUI.modal) {
|
|
841
|
+
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
835
842
|
}
|
|
836
|
-
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
837
843
|
}
|
|
838
844
|
if (afterDelete) {
|
|
839
845
|
afterDelete(...applyArgs)
|
|
@@ -848,11 +854,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
848
854
|
.catch(rest => {
|
|
849
855
|
reactData.tableLoading = false
|
|
850
856
|
if (isRespMsg) {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
857
|
+
if (VxeUI.modal) {
|
|
858
|
+
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
854
859
|
}
|
|
855
|
-
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
856
860
|
}
|
|
857
861
|
if (deleteErrorMethods) {
|
|
858
862
|
deleteErrorMethods({ ...commitParams, response: rest })
|
|
@@ -862,11 +866,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
862
866
|
})
|
|
863
867
|
} else {
|
|
864
868
|
if (isActiveMsg) {
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
869
|
+
if (VxeUI.modal) {
|
|
870
|
+
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
868
871
|
}
|
|
869
|
-
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
870
872
|
}
|
|
871
873
|
}
|
|
872
874
|
} else {
|
|
@@ -917,11 +919,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
917
919
|
reactData.tableLoading = false
|
|
918
920
|
$xeTable.clearPendingRow()
|
|
919
921
|
if (isRespMsg) {
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
922
|
+
if (VxeUI.modal) {
|
|
923
|
+
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
923
924
|
}
|
|
924
|
-
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
925
925
|
}
|
|
926
926
|
if (afterSave) {
|
|
927
927
|
afterSave(...applyArgs)
|
|
@@ -936,11 +936,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
936
936
|
.catch(rest => {
|
|
937
937
|
reactData.tableLoading = false
|
|
938
938
|
if (isRespMsg) {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
939
|
+
if (VxeUI.modal) {
|
|
940
|
+
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
942
941
|
}
|
|
943
|
-
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
944
942
|
}
|
|
945
943
|
if (saveErrorMethods) {
|
|
946
944
|
saveErrorMethods({ ...commitParams, response: rest })
|
|
@@ -949,11 +947,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
949
947
|
})
|
|
950
948
|
} else {
|
|
951
949
|
if (isActiveMsg) {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
950
|
+
if (VxeUI.modal) {
|
|
951
|
+
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
955
952
|
}
|
|
956
|
-
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
957
953
|
}
|
|
958
954
|
}
|
|
959
955
|
})
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
fullStop: '。'
|
|
8
8
|
},
|
|
9
9
|
loading: {
|
|
10
|
-
text: '
|
|
10
|
+
text: 'Loading...'
|
|
11
11
|
},
|
|
12
12
|
error: {
|
|
13
13
|
downErr: 'Download failed',
|
|
@@ -181,7 +181,7 @@ export default {
|
|
|
181
181
|
insertBottom: 'Append at the bottom (append new data at the bottom of the table)'
|
|
182
182
|
},
|
|
183
183
|
impTitle: 'Import data',
|
|
184
|
-
impFile: '
|
|
184
|
+
impFile: 'File name',
|
|
185
185
|
impSelect: 'Select file',
|
|
186
186
|
impType: 'File type',
|
|
187
187
|
impOpts: 'Parameter settings',
|
|
@@ -207,9 +207,9 @@ export default {
|
|
|
207
207
|
},
|
|
208
208
|
printTitle: 'Print data',
|
|
209
209
|
expTitle: 'Export data',
|
|
210
|
-
expName: '
|
|
210
|
+
expName: 'File name',
|
|
211
211
|
expNamePlaceholder: 'Please enter a file name',
|
|
212
|
-
expSheetName: '
|
|
212
|
+
expSheetName: 'Title',
|
|
213
213
|
expSheetNamePlaceholder: 'Please enter a title',
|
|
214
214
|
expType: 'Save type',
|
|
215
215
|
expMode: 'Select data',
|
|
@@ -643,10 +643,10 @@ export default {
|
|
|
643
643
|
},
|
|
644
644
|
cases: {
|
|
645
645
|
equal: 'equal',
|
|
646
|
-
gt: 'Greater
|
|
647
|
-
lt: 'Less
|
|
648
|
-
begin: '
|
|
649
|
-
endin: '
|
|
646
|
+
gt: 'Greater',
|
|
647
|
+
lt: 'Less',
|
|
648
|
+
begin: 'Start',
|
|
649
|
+
endin: 'End',
|
|
650
650
|
include: 'Include',
|
|
651
651
|
isSensitive: 'case sensitive'
|
|
652
652
|
}
|
|
@@ -675,14 +675,14 @@ export default {
|
|
|
675
675
|
},
|
|
676
676
|
cases: {
|
|
677
677
|
equal: 'equal',
|
|
678
|
-
unequal: 'Not equal
|
|
679
|
-
gt: 'Greater
|
|
680
|
-
ge: 'Greater
|
|
681
|
-
lt: 'Less
|
|
682
|
-
le: 'Less
|
|
683
|
-
begin: '
|
|
678
|
+
unequal: 'Not equal',
|
|
679
|
+
gt: 'Greater',
|
|
680
|
+
ge: 'Greater or equal',
|
|
681
|
+
lt: 'Less',
|
|
682
|
+
le: 'Less or equal',
|
|
683
|
+
begin: 'Start',
|
|
684
684
|
notbegin: "It's not at the beginning",
|
|
685
|
-
endin: '
|
|
685
|
+
endin: 'End',
|
|
686
686
|
notendin: 'The ending is not',
|
|
687
687
|
include: 'Include',
|
|
688
688
|
exclude: 'Not included',
|
|
@@ -740,14 +740,14 @@ export default {
|
|
|
740
740
|
search: 'search',
|
|
741
741
|
cases: {
|
|
742
742
|
equal: 'equal',
|
|
743
|
-
unequal: 'Not equal
|
|
744
|
-
gt: 'Greater
|
|
745
|
-
ge: 'Greater
|
|
746
|
-
lt: 'Less
|
|
747
|
-
le: 'Less
|
|
748
|
-
begin: '
|
|
743
|
+
unequal: 'Not equal',
|
|
744
|
+
gt: 'Greater',
|
|
745
|
+
ge: 'Greater or equal',
|
|
746
|
+
lt: 'Less',
|
|
747
|
+
le: 'Less or equal',
|
|
748
|
+
begin: 'Start',
|
|
749
749
|
notbegin: "It's not at the beginning",
|
|
750
|
-
endin: '
|
|
750
|
+
endin: 'End',
|
|
751
751
|
notendin: 'The ending is not',
|
|
752
752
|
include: 'Include',
|
|
753
753
|
exclude: 'Not included',
|
|
@@ -1002,7 +1002,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1002
1002
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
1003
1003
|
const $xeGanttView = internalData.xeGanttView
|
|
1004
1004
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
1005
|
-
if (!el || !el.clientHeight) {
|
|
1005
|
+
if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
|
|
1006
1006
|
return
|
|
1007
1007
|
}
|
|
1008
1008
|
const containerList = ['main', 'left', 'right']
|
|
@@ -2359,7 +2359,7 @@ function calcTableHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
2359
2359
|
const props = $xeTable
|
|
2360
2360
|
const reactData = $xeTable as unknown as TableReactData
|
|
2361
2361
|
|
|
2362
|
-
const { editConfig } = props
|
|
2362
|
+
const { editConfig, editRules } = props
|
|
2363
2363
|
const { parentHeight } = reactData
|
|
2364
2364
|
let val = props[key]
|
|
2365
2365
|
if (key === 'minHeight') {
|
|
@@ -2367,7 +2367,7 @@ function calcTableHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
2367
2367
|
if (XEUtils.eqNull(val)) {
|
|
2368
2368
|
if (eqEmptyValue(defMinHeight)) {
|
|
2369
2369
|
// 编辑模式默认最小高度
|
|
2370
|
-
if (isEnableConf(editConfig)) {
|
|
2370
|
+
if (editRules && isEnableConf(editConfig)) {
|
|
2371
2371
|
val = 144
|
|
2372
2372
|
}
|
|
2373
2373
|
} else {
|
|
@@ -10824,17 +10824,45 @@ const Methods = {
|
|
|
10824
10824
|
*/
|
|
10825
10825
|
getScroll () {
|
|
10826
10826
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
10827
|
+
|
|
10828
|
+
return $xeTable.getScrollData()
|
|
10829
|
+
},
|
|
10830
|
+
/**
|
|
10831
|
+
* 获取表格的滚动数据
|
|
10832
|
+
*/
|
|
10833
|
+
getScrollData () {
|
|
10834
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
10827
10835
|
const reactData = $xeTable as unknown as TableReactData
|
|
10828
10836
|
const internalData = $xeTable as unknown as TableInternalData
|
|
10829
10837
|
|
|
10830
|
-
const { scrollXLoad, scrollYLoad } = reactData
|
|
10838
|
+
const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData
|
|
10831
10839
|
const { elemStore } = internalData
|
|
10832
10840
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
10841
|
+
const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0
|
|
10842
|
+
const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
10843
|
+
const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0
|
|
10844
|
+
const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0
|
|
10845
|
+
const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0
|
|
10846
|
+
const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0
|
|
10847
|
+
const isTop = scrollTop <= 0
|
|
10848
|
+
const isBottom = scrollTop + clientHeight >= scrollHeight
|
|
10849
|
+
const isLeft = scrollLeft <= 0
|
|
10850
|
+
const isRight = scrollLeft + clientWidth >= scrollWidth
|
|
10833
10851
|
return {
|
|
10834
10852
|
virtualX: scrollXLoad,
|
|
10835
10853
|
virtualY: scrollYLoad,
|
|
10836
|
-
|
|
10837
|
-
|
|
10854
|
+
isTop,
|
|
10855
|
+
isBottom,
|
|
10856
|
+
isLeft,
|
|
10857
|
+
isRight,
|
|
10858
|
+
scrollbarHeight,
|
|
10859
|
+
scrollbarWidth,
|
|
10860
|
+
scrollTop,
|
|
10861
|
+
scrollLeft,
|
|
10862
|
+
scrollHeight,
|
|
10863
|
+
scrollWidth,
|
|
10864
|
+
clientHeight,
|
|
10865
|
+
clientWidth
|
|
10838
10866
|
}
|
|
10839
10867
|
},
|
|
10840
10868
|
handleScrollEvent (evnt: Event, isRollY: boolean, isRollX: boolean, scrollTop: number, scrollLeft: number, params: any) {
|
|
@@ -11152,12 +11180,11 @@ const Methods = {
|
|
|
11152
11180
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
11153
11181
|
const leftFixedWidth = $xeTable.computeLeftFixedWidth
|
|
11154
11182
|
const rightFixedWidth = $xeTable.computeRightFixedWidth
|
|
11155
|
-
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11156
|
-
return
|
|
11157
|
-
}
|
|
11158
11183
|
|
|
11159
11184
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
11160
11185
|
const rowOpts = $xeTable.computeRowOpts
|
|
11186
|
+
const scrollbarXOpts = $xeTable.computeScrollbarXOpts
|
|
11187
|
+
const scrollbarYOpts = $xeTable.computeScrollbarYOpts
|
|
11161
11188
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem as HTMLDivElement
|
|
11162
11189
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem as HTMLDivElement
|
|
11163
11190
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
@@ -11166,12 +11193,6 @@ const Methods = {
|
|
|
11166
11193
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
11167
11194
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
11168
11195
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
|
|
11169
|
-
if (!xHandleEl) {
|
|
11170
|
-
return
|
|
11171
|
-
}
|
|
11172
|
-
if (!yHandleEl) {
|
|
11173
|
-
return
|
|
11174
|
-
}
|
|
11175
11196
|
if (!bodyScrollElem) {
|
|
11176
11197
|
return
|
|
11177
11198
|
}
|
|
@@ -11188,7 +11209,19 @@ const Methods = {
|
|
|
11188
11209
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
11189
11210
|
const isRollY = scrollTop !== lastScrollTop
|
|
11190
11211
|
|
|
11212
|
+
if (isRollX) {
|
|
11213
|
+
// 如果禁用滚动
|
|
11214
|
+
if (scrollbarXOpts.visible === 'hidden') {
|
|
11215
|
+
evnt.preventDefault()
|
|
11216
|
+
return
|
|
11217
|
+
}
|
|
11218
|
+
}
|
|
11191
11219
|
if (isRollY) {
|
|
11220
|
+
// 如果禁用滚动
|
|
11221
|
+
if (scrollbarYOpts.visible === 'hidden') {
|
|
11222
|
+
evnt.preventDefault()
|
|
11223
|
+
return
|
|
11224
|
+
}
|
|
11192
11225
|
const isTopWheel = deltaTop < 0
|
|
11193
11226
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11194
11227
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
@@ -11196,6 +11229,10 @@ const Methods = {
|
|
|
11196
11229
|
}
|
|
11197
11230
|
}
|
|
11198
11231
|
|
|
11232
|
+
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11233
|
+
return
|
|
11234
|
+
}
|
|
11235
|
+
|
|
11199
11236
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11200
11237
|
$xeTable.clearHoverRow()
|
|
11201
11238
|
}
|
|
@@ -11745,7 +11782,10 @@ const Methods = {
|
|
|
11745
11782
|
scrollYStore.visibleStartIndex = 0
|
|
11746
11783
|
scrollYStore.endIndex = scrollYStore.visibleSize
|
|
11747
11784
|
scrollYStore.visibleEndIndex = scrollYStore.visibleSize
|
|
11785
|
+
|
|
11748
11786
|
return $xeTable.$nextTick().then(() => {
|
|
11787
|
+
internalData.lastScrollLeft = 0
|
|
11788
|
+
internalData.lastScrollTop = 0
|
|
11749
11789
|
internalData.intoRunScroll = false
|
|
11750
11790
|
})
|
|
11751
11791
|
},
|
|
@@ -88,7 +88,7 @@ function renderViewFixed (h: CreateElement, $xeTable: VxeTableConstructor & VxeT
|
|
|
88
88
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
|
|
89
89
|
return h('div', {
|
|
90
90
|
ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
|
|
91
|
-
class: [`vxe-table--fixed-${fixedType}-wrapper`, {
|
|
91
|
+
class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
|
|
92
92
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
93
93
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
94
94
|
}]
|
|
@@ -446,7 +446,7 @@ function renderViewport (h: CreateElement, $xeTable: VxeTableConstructor & VxeTa
|
|
|
446
446
|
}]
|
|
447
447
|
}, [
|
|
448
448
|
h('div', {
|
|
449
|
-
class: 'vxe-table--main-wrapper'
|
|
449
|
+
class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
|
|
450
450
|
}, [
|
|
451
451
|
/**
|
|
452
452
|
* 表头
|
|
@@ -1475,6 +1475,13 @@ export default {
|
|
|
1475
1475
|
},
|
|
1476
1476
|
computeVxeLanguage () {
|
|
1477
1477
|
return VxeUI.getLanguage()
|
|
1478
|
+
},
|
|
1479
|
+
computeScrollbarVisible () {
|
|
1480
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1481
|
+
|
|
1482
|
+
const scrollbarXOpts = $xeTable.computeScrollbarXOpts
|
|
1483
|
+
const scrollbarYOpts = $xeTable.computeScrollbarYOpts
|
|
1484
|
+
return `${scrollbarXOpts.visible}${scrollbarYOpts.visible}`
|
|
1478
1485
|
}
|
|
1479
1486
|
} as any,
|
|
1480
1487
|
watch: {
|
|
@@ -1547,6 +1554,9 @@ export default {
|
|
|
1547
1554
|
computeVxeLanguage () {
|
|
1548
1555
|
this.reLayoutFlag++
|
|
1549
1556
|
},
|
|
1557
|
+
computeScrollbarVisible () {
|
|
1558
|
+
this.reLayoutFlag++
|
|
1559
|
+
},
|
|
1550
1560
|
reLayoutFlag () {
|
|
1551
1561
|
const $xeTable = this
|
|
1552
1562
|
|
|
@@ -2211,11 +2221,15 @@ export default {
|
|
|
2211
2221
|
h('div', {
|
|
2212
2222
|
key: 'tn',
|
|
2213
2223
|
ref: 'refEmptyPlaceholder',
|
|
2214
|
-
class: 'vxe-table--empty-
|
|
2224
|
+
class: 'vxe-table--empty-place-wrapper'
|
|
2215
2225
|
}, [
|
|
2216
2226
|
h('div', {
|
|
2217
|
-
class: 'vxe-table--empty-
|
|
2218
|
-
},
|
|
2227
|
+
class: 'vxe-table--empty-placeholder'
|
|
2228
|
+
}, [
|
|
2229
|
+
h('div', {
|
|
2230
|
+
class: 'vxe-table--empty-content'
|
|
2231
|
+
}, renderEmptyBody(h, $xeTable))
|
|
2232
|
+
])
|
|
2219
2233
|
]),
|
|
2220
2234
|
/**
|
|
2221
2235
|
* 边框线
|
|
@@ -630,29 +630,43 @@ export function getRefElem (refEl: any) {
|
|
|
630
630
|
return null
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
-
export function clearTableDefaultStatus (
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
if (
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
633
|
+
export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
634
|
+
const props = $xeTable
|
|
635
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
636
|
+
|
|
637
|
+
internalData.initStatus = false
|
|
638
|
+
const actionList = [
|
|
639
|
+
$xeTable.clearSort(),
|
|
640
|
+
$xeTable.clearCurrentRow(),
|
|
641
|
+
$xeTable.clearCurrentColumn(),
|
|
642
|
+
$xeTable.clearRadioRow(),
|
|
643
|
+
$xeTable.clearRadioReserve(),
|
|
644
|
+
$xeTable.clearCheckboxRow(),
|
|
645
|
+
$xeTable.clearCheckboxReserve(),
|
|
646
|
+
$xeTable.clearRowExpand(),
|
|
647
|
+
$xeTable.clearTreeExpand(),
|
|
648
|
+
$xeTable.clearTreeExpandReserve(),
|
|
649
|
+
$xeTable.clearPendingRow()
|
|
650
|
+
]
|
|
651
|
+
if ($xeTable.clearFilter) {
|
|
652
|
+
actionList.push(
|
|
653
|
+
$xeTable.clearFilter()
|
|
654
|
+
)
|
|
655
|
+
}
|
|
656
|
+
if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
|
|
657
|
+
actionList.push(
|
|
658
|
+
$xeTable.clearSelected()
|
|
659
|
+
)
|
|
660
|
+
}
|
|
661
|
+
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
662
|
+
actionList.push(
|
|
663
|
+
$xeTable.clearCellAreas(),
|
|
664
|
+
$xeTable.clearCopyCellArea()
|
|
665
|
+
)
|
|
666
|
+
}
|
|
667
|
+
return Promise.all(actionList).then(() => {
|
|
668
|
+
return $xeTable.clearScroll()
|
|
669
|
+
})
|
|
656
670
|
}
|
|
657
671
|
|
|
658
672
|
export function clearTableAllStatus (_vm: any) {
|
|
@@ -136,6 +136,51 @@ $btnThemeList: (
|
|
|
136
136
|
overflow-x: scroll;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
// 禁用滚动条
|
|
140
|
+
.vxe-table--main-wrapper {
|
|
141
|
+
&.sx--hidden {
|
|
142
|
+
& > .vxe-table--header-wrapper {
|
|
143
|
+
& > .vxe-table--header-inner-wrapper {
|
|
144
|
+
overflow-x: hidden;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
& > .vxe-table--body-wrapper {
|
|
148
|
+
& > .vxe-table--body-inner-wrapper {
|
|
149
|
+
overflow-x: hidden;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
& > .vxe-table--footer-wrapper {
|
|
153
|
+
& > .vxe-table--footer-inner-wrapper {
|
|
154
|
+
overflow-x: hidden;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
&.sy--hidden {
|
|
159
|
+
& > .vxe-table--body-wrapper {
|
|
160
|
+
& > .vxe-table--body-inner-wrapper {
|
|
161
|
+
overflow-y: hidden;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.vxe-table--fixed-left-wrapper,
|
|
167
|
+
.vxe-table--fixed-right-wrapper {
|
|
168
|
+
&.sx--hidden {
|
|
169
|
+
& > .vxe-table--body-wrapper {
|
|
170
|
+
& > .vxe-table--body-inner-wrapper {
|
|
171
|
+
overflow-x: hidden;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
&.sy--hidden {
|
|
176
|
+
& > .vxe-table--body-wrapper {
|
|
177
|
+
& > .vxe-table--body-inner-wrapper {
|
|
178
|
+
overflow-y: hidden;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
139
184
|
.vxe-loading--custom-wrapper {
|
|
140
185
|
display: none;
|
|
141
186
|
position: absolute;
|
|
@@ -2141,11 +2186,16 @@ $btnThemeList: (
|
|
|
2141
2186
|
display: none;
|
|
2142
2187
|
visibility: hidden;
|
|
2143
2188
|
}
|
|
2144
|
-
.vxe-table--empty-
|
|
2189
|
+
.vxe-table--empty-place-wrapper {
|
|
2145
2190
|
display: none;
|
|
2146
2191
|
position: absolute;
|
|
2192
|
+
width: 100%;
|
|
2147
2193
|
top: 0;
|
|
2148
2194
|
z-index: 5;
|
|
2195
|
+
overflow: hidden;
|
|
2196
|
+
}
|
|
2197
|
+
.vxe-table--empty-placeholder {
|
|
2198
|
+
display: flex;
|
|
2149
2199
|
}
|
|
2150
2200
|
.vxe-table--empty-content {
|
|
2151
2201
|
display: block;
|
|
@@ -2154,7 +2204,7 @@ $btnThemeList: (
|
|
|
2154
2204
|
}
|
|
2155
2205
|
&.is--empty {
|
|
2156
2206
|
.vxe-table--empty-block,
|
|
2157
|
-
.vxe-table--empty-
|
|
2207
|
+
.vxe-table--empty-place-wrapper{
|
|
2158
2208
|
display: flex;
|
|
2159
2209
|
}
|
|
2160
2210
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|