vxe-table 3.17.0-beta.8 → 3.17.0
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/grid/src/grid.js +88 -23
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +22 -14
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/src/body.js +7 -6
- package/es/table/src/cell.js +5 -5
- package/es/table/src/columnInfo.js +5 -0
- package/es/table/src/methods.js +201 -76
- package/es/table/src/table.js +7 -6
- package/es/table/src/util.js +9 -0
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +104 -29
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +407 -131
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +25 -13
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/edit/mixin.js +5 -0
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +7 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +5 -4
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +5 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +238 -73
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +7 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -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/grid/src/grid.ts +101 -25
- package/packages/table/module/custom/mixin.ts +21 -13
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/src/body.ts +7 -6
- package/packages/table/src/cell.ts +5 -5
- package/packages/table/src/columnInfo.ts +7 -0
- package/packages/table/src/methods.ts +215 -76
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +7 -6
- package/packages/table/src/util.ts +10 -0
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1753445505513.ttf → iconfont.1753928711953.ttf} +0 -0
- /package/es/{iconfont.1753445505513.woff → iconfont.1753928711953.woff} +0 -0
- /package/es/{iconfont.1753445505513.woff2 → iconfont.1753928711953.woff2} +0 -0
- /package/lib/{iconfont.1753445505513.ttf → iconfont.1753928711953.ttf} +0 -0
- /package/lib/{iconfont.1753445505513.woff → iconfont.1753928711953.woff} +0 -0
- /package/lib/{iconfont.1753445505513.woff2 → iconfont.1753928711953.woff2} +0 -0
|
@@ -31,9 +31,11 @@ function getTableOns (_vm: any) {
|
|
|
31
31
|
if (proxyConfig) {
|
|
32
32
|
if (proxyOpts.sort) {
|
|
33
33
|
ons['sort-change'] = _vm.sortChangeEvent
|
|
34
|
+
ons['clear-all-sort'] = _vm.clearAllSortEvent
|
|
34
35
|
}
|
|
35
36
|
if (proxyOpts.filter) {
|
|
36
37
|
ons['filter-change'] = _vm.filterChangeEvent
|
|
38
|
+
ons['clear-all-filter'] = _vm.clearAllFilterEvent
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
return ons
|
|
@@ -309,6 +311,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
309
311
|
const pagerOpts = $xeGrid.computePagerOpts as VxeGridPropTypes.PagerConfig
|
|
310
312
|
return pagerOpts.total
|
|
311
313
|
},
|
|
314
|
+
computePageCount () {
|
|
315
|
+
const $xeGrid = this
|
|
316
|
+
const reactData = ($xeGrid as any).reactData as GridReactData
|
|
317
|
+
|
|
318
|
+
const { tablePage } = reactData
|
|
319
|
+
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1)
|
|
320
|
+
},
|
|
312
321
|
computeIsLoading () {
|
|
313
322
|
const $xeGrid = this
|
|
314
323
|
const props = $xeGrid
|
|
@@ -391,7 +400,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
391
400
|
tablePage.pageSize = pageSize
|
|
392
401
|
}
|
|
393
402
|
if (total) {
|
|
394
|
-
tablePage.
|
|
403
|
+
tablePage.total = total
|
|
395
404
|
}
|
|
396
405
|
}
|
|
397
406
|
}
|
|
@@ -972,7 +981,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
972
981
|
if ($form) {
|
|
973
982
|
return $form.validate()
|
|
974
983
|
}
|
|
975
|
-
return $xeGrid.$nextTick()
|
|
984
|
+
return $xeGrid.$nextTick() as unknown as Promise<VxeFormDefines.ValidateErrorMapParams>
|
|
976
985
|
},
|
|
977
986
|
validateFormField (field: VxeFormItemPropTypes.Field | VxeFormItemPropTypes.Field[] | VxeFormDefines.ItemInfo | VxeFormDefines.ItemInfo[] | null) {
|
|
978
987
|
const $xeGrid = this
|
|
@@ -981,7 +990,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
981
990
|
if ($form) {
|
|
982
991
|
return $form.validateField(field)
|
|
983
992
|
}
|
|
984
|
-
return $xeGrid.$nextTick()
|
|
993
|
+
return $xeGrid.$nextTick() as unknown as Promise<VxeFormDefines.ValidateErrorMapParams>
|
|
985
994
|
},
|
|
986
995
|
clearFormValidate (field?: VxeFormItemPropTypes.Field | VxeFormItemPropTypes.Field[] | VxeFormDefines.ItemInfo | VxeFormDefines.ItemInfo[] | null) {
|
|
987
996
|
const $xeGrid = this
|
|
@@ -994,31 +1003,70 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
994
1003
|
},
|
|
995
1004
|
homePage () {
|
|
996
1005
|
const $xeGrid = this
|
|
1006
|
+
const reactData = $xeGrid.reactData
|
|
1007
|
+
|
|
1008
|
+
const { tablePage } = reactData
|
|
1009
|
+
tablePage.currentPage = 1
|
|
1010
|
+
return $xeGrid.$nextTick()
|
|
1011
|
+
},
|
|
1012
|
+
homePageByEvent (evnt: Event) {
|
|
1013
|
+
const $xeGrid = this
|
|
997
1014
|
|
|
998
1015
|
const $pager = $xeGrid.$refs.refPager as VxePagerInstance
|
|
999
1016
|
if ($pager) {
|
|
1000
|
-
|
|
1017
|
+
$pager.homePageByEvent(evnt)
|
|
1001
1018
|
}
|
|
1002
|
-
return $xeGrid.$nextTick()
|
|
1003
1019
|
},
|
|
1004
1020
|
endPage () {
|
|
1005
1021
|
const $xeGrid = this
|
|
1022
|
+
const reactData = $xeGrid.reactData
|
|
1023
|
+
|
|
1024
|
+
const { tablePage } = reactData
|
|
1025
|
+
const pageCount = $xeGrid.computePageCount
|
|
1026
|
+
tablePage.currentPage = pageCount
|
|
1027
|
+
return $xeGrid.$nextTick()
|
|
1028
|
+
},
|
|
1029
|
+
endPageByEvent (evnt: Event) {
|
|
1030
|
+
const $xeGrid = this
|
|
1006
1031
|
|
|
1007
1032
|
const $pager = $xeGrid.$refs.refPager as VxePagerInstance
|
|
1008
1033
|
if ($pager) {
|
|
1009
|
-
|
|
1034
|
+
$pager.endPageByEvent(evnt)
|
|
1010
1035
|
}
|
|
1036
|
+
},
|
|
1037
|
+
setCurrentPage (currentPage: number | string | null | undefined) {
|
|
1038
|
+
const $xeGrid = this
|
|
1039
|
+
const reactData = $xeGrid.reactData
|
|
1040
|
+
|
|
1041
|
+
const { tablePage } = reactData
|
|
1042
|
+
const pageCount = $xeGrid.computePageCount
|
|
1043
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, XEUtils.toNumber(currentPage)))
|
|
1011
1044
|
return $xeGrid.$nextTick()
|
|
1012
1045
|
},
|
|
1013
|
-
|
|
1046
|
+
setCurrentPageByEvent (evnt: Event, currentPage: number | string | null | undefined) {
|
|
1014
1047
|
const $xeGrid = this
|
|
1015
1048
|
|
|
1016
1049
|
const $pager = $xeGrid.$refs.refPager as VxePagerInstance
|
|
1017
1050
|
if ($pager) {
|
|
1018
|
-
|
|
1051
|
+
$pager.setCurrentPageByEvent(evnt, currentPage)
|
|
1019
1052
|
}
|
|
1053
|
+
},
|
|
1054
|
+
setPageSize (pageSize: number | string | null | undefined) {
|
|
1055
|
+
const $xeGrid = this
|
|
1056
|
+
const reactData = $xeGrid.reactData
|
|
1057
|
+
|
|
1058
|
+
const { tablePage } = reactData
|
|
1059
|
+
tablePage.pageSize = Math.max(1, XEUtils.toNumber(pageSize))
|
|
1020
1060
|
return $xeGrid.$nextTick()
|
|
1021
1061
|
},
|
|
1062
|
+
setPageSizeByEvent (evnt: Event, pageSize: number | string | null | undefined) {
|
|
1063
|
+
const $xeGrid = this
|
|
1064
|
+
|
|
1065
|
+
const $pager = $xeGrid.$refs.refPager as VxePagerInstance
|
|
1066
|
+
if ($pager) {
|
|
1067
|
+
$pager.setPageSizeByEvent(evnt, pageSize)
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1022
1070
|
triggerToolbarCommitEvent (params: any, evnt: any) {
|
|
1023
1071
|
const $xeGrid = this
|
|
1024
1072
|
|
|
@@ -1041,7 +1089,25 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1041
1089
|
$xeGrid.triggerToolbarCommitEvent(tool, evnt)
|
|
1042
1090
|
$xeGrid.dispatchEvent('toolbar-tool-click', { code: tool.code, tool }, evnt)
|
|
1043
1091
|
},
|
|
1044
|
-
|
|
1092
|
+
pageChangeEvent (params: VxePagerDefines.PageChangeEventParams) {
|
|
1093
|
+
const $xeGrid = this
|
|
1094
|
+
const props = $xeGrid
|
|
1095
|
+
const reactData = $xeGrid.reactData
|
|
1096
|
+
|
|
1097
|
+
const { proxyConfig } = props
|
|
1098
|
+
const { tablePage } = reactData
|
|
1099
|
+
const { $event, currentPage, pageSize } = params
|
|
1100
|
+
const proxyOpts = $xeGrid.computeProxyOpts
|
|
1101
|
+
tablePage.currentPage = currentPage
|
|
1102
|
+
tablePage.pageSize = pageSize
|
|
1103
|
+
$xeGrid.dispatchEvent('page-change', params, $event)
|
|
1104
|
+
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
1105
|
+
$xeGrid.commitProxy('query').then((rest) => {
|
|
1106
|
+
$xeGrid.dispatchEvent('proxy-query', rest, $event)
|
|
1107
|
+
})
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
handleSortEvent (params: VxeTableDefines.SortChangeEventParams) {
|
|
1045
1111
|
const $xeGrid = this
|
|
1046
1112
|
const props = $xeGrid
|
|
1047
1113
|
const reactData = $xeGrid.reactData
|
|
@@ -1060,27 +1126,20 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1060
1126
|
})
|
|
1061
1127
|
}
|
|
1062
1128
|
}
|
|
1129
|
+
},
|
|
1130
|
+
sortChangeEvent (params: VxeTableDefines.SortChangeEventParams) {
|
|
1131
|
+
const $xeGrid = this
|
|
1132
|
+
|
|
1133
|
+
$xeGrid.handleSortEvent(params)
|
|
1063
1134
|
$xeGrid.dispatchEvent('sort-change', params, params.$event)
|
|
1064
1135
|
},
|
|
1065
|
-
|
|
1136
|
+
clearAllSortEvent (params: VxeTableDefines.SortChangeEventParams) {
|
|
1066
1137
|
const $xeGrid = this
|
|
1067
|
-
const props = $xeGrid
|
|
1068
|
-
const reactData = $xeGrid.reactData
|
|
1069
1138
|
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
const { $event, currentPage, pageSize } = params
|
|
1073
|
-
const proxyOpts = $xeGrid.computeProxyOpts
|
|
1074
|
-
tablePage.currentPage = currentPage
|
|
1075
|
-
tablePage.pageSize = pageSize
|
|
1076
|
-
$xeGrid.dispatchEvent('page-change', params, $event)
|
|
1077
|
-
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
1078
|
-
$xeGrid.commitProxy('query').then((rest) => {
|
|
1079
|
-
$xeGrid.dispatchEvent('proxy-query', rest, $event)
|
|
1080
|
-
})
|
|
1081
|
-
}
|
|
1139
|
+
$xeGrid.handleSortEvent(params)
|
|
1140
|
+
$xeGrid.dispatchEvent('clear-all-sort', params, params.$event)
|
|
1082
1141
|
},
|
|
1083
|
-
|
|
1142
|
+
handleFilterEvent (params: VxeTableDefines.ClearAllFilterEventParams) {
|
|
1084
1143
|
const $xeGrid = this
|
|
1085
1144
|
const props = $xeGrid
|
|
1086
1145
|
const reactData = $xeGrid.reactData
|
|
@@ -1099,8 +1158,19 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1099
1158
|
})
|
|
1100
1159
|
}
|
|
1101
1160
|
}
|
|
1161
|
+
},
|
|
1162
|
+
filterChangeEvent (params: VxeTableDefines.ClearAllFilterEventParams) {
|
|
1163
|
+
const $xeGrid = this
|
|
1164
|
+
|
|
1165
|
+
$xeGrid.handleFilterEvent(params)
|
|
1102
1166
|
$xeGrid.dispatchEvent('filter-change', params, params.$event)
|
|
1103
1167
|
},
|
|
1168
|
+
clearAllFilterEvent (params: VxeTableDefines.ClearAllFilterEventParams) {
|
|
1169
|
+
const $xeGrid = this
|
|
1170
|
+
|
|
1171
|
+
$xeGrid.handleFilterEvent(params)
|
|
1172
|
+
$xeGrid.dispatchEvent('clear-all-filter', params, params.$event)
|
|
1173
|
+
},
|
|
1104
1174
|
submitFormEvent (params: VxeFormDefines.SubmitEventParams) {
|
|
1105
1175
|
const $xeGrid = this
|
|
1106
1176
|
const props = $xeGrid
|
|
@@ -1153,6 +1223,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1153
1223
|
$xeGrid.zoom()
|
|
1154
1224
|
$xeGrid.dispatchEvent('zoom', { type: reactData.isZMax ? 'max' : 'revert' }, evnt)
|
|
1155
1225
|
},
|
|
1226
|
+
getParams () {
|
|
1227
|
+
const $xeGrid = this
|
|
1228
|
+
const props = $xeGrid
|
|
1229
|
+
|
|
1230
|
+
return (props as any).params
|
|
1231
|
+
},
|
|
1156
1232
|
zoom () {
|
|
1157
1233
|
const $xeGrid = this
|
|
1158
1234
|
const reactData = $xeGrid.reactData
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
+
import { getColumnList } from '../../src/util'
|
|
2
3
|
|
|
3
4
|
import type { VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeGridConstructor, VxeTableDefines, GridPrivateMethods, TableReactData, TableInternalData } from '../../../../types'
|
|
4
5
|
|
|
@@ -96,21 +97,20 @@ export default {
|
|
|
96
97
|
}
|
|
97
98
|
})
|
|
98
99
|
reactData.isCustomStatus = true
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
$xeTable.setRowGroups(aggHandleFields)
|
|
105
|
-
} else {
|
|
106
|
-
$xeTable.clearRowGroups()
|
|
107
|
-
}
|
|
100
|
+
if (allowGroup && allowValues && !!$xeTable.handlePivotTableAggregateData) {
|
|
101
|
+
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
102
|
+
// 更新数据分组
|
|
103
|
+
if (aggHandleFields.length) {
|
|
104
|
+
$xeTable.setRowGroups(aggHandleFields)
|
|
108
105
|
} else {
|
|
109
|
-
|
|
110
|
-
$xeTable.handleUpdateAggData()
|
|
106
|
+
$xeTable.clearRowGroups()
|
|
111
107
|
}
|
|
108
|
+
} else if (allowValues) {
|
|
109
|
+
// 更新聚合函数
|
|
110
|
+
$xeTable.handleUpdateAggData()
|
|
112
111
|
}
|
|
113
|
-
}
|
|
112
|
+
}
|
|
113
|
+
return $xeTable.saveCustomStore('confirm')
|
|
114
114
|
},
|
|
115
115
|
_cancelCustom () {
|
|
116
116
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -157,6 +157,7 @@ export default {
|
|
|
157
157
|
sort: options === true,
|
|
158
158
|
aggFunc: options === true
|
|
159
159
|
}, options)
|
|
160
|
+
const allCols: VxeTableDefines.ColumnInfo[] = []
|
|
160
161
|
XEUtils.eachTree(collectColumn, (column) => {
|
|
161
162
|
if (opts.resizable) {
|
|
162
163
|
column.resizeWidth = 0
|
|
@@ -166,6 +167,7 @@ export default {
|
|
|
166
167
|
}
|
|
167
168
|
if (opts.sort) {
|
|
168
169
|
column.renderSortNumber = column.sortNumber
|
|
170
|
+
column.parentId = column.defaultParentId
|
|
169
171
|
}
|
|
170
172
|
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
171
173
|
column.visible = column.defaultVisible
|
|
@@ -175,9 +177,14 @@ export default {
|
|
|
175
177
|
column.renderAggFn = column.defaultAggFunc
|
|
176
178
|
}
|
|
177
179
|
column.renderResizeWidth = column.renderWidth
|
|
180
|
+
allCols.push(column)
|
|
178
181
|
})
|
|
182
|
+
if (opts.sort) {
|
|
183
|
+
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' })
|
|
184
|
+
internalData.collectColumn = newCollectCols
|
|
185
|
+
internalData.tableFullColumn = getColumnList(newCollectCols)
|
|
186
|
+
}
|
|
179
187
|
reactData.isCustomStatus = false
|
|
180
|
-
$xeTable.saveCustomStore('reset')
|
|
181
188
|
return $xeTable.handleCustom().then(() => {
|
|
182
189
|
if (opts.aggFunc && ($xeTable as any).handlePivotTableAggregateData) {
|
|
183
190
|
const rowGroupFields = $xeTable.computeRowGroupFields
|
|
@@ -191,6 +198,7 @@ export default {
|
|
|
191
198
|
$xeTable.handleUpdateAggData()
|
|
192
199
|
}
|
|
193
200
|
}
|
|
201
|
+
$xeTable.saveCustomStore('reset')
|
|
194
202
|
})
|
|
195
203
|
},
|
|
196
204
|
_toggleCustomAllCheckbox () {
|
|
@@ -80,7 +80,7 @@ function insertTreeRow ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
|
|
|
80
80
|
}
|
|
81
81
|
parentChilds[funcName](item)
|
|
82
82
|
mapChilds[funcName](item)
|
|
83
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
83
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
84
84
|
fullDataRowIdData[rowid] = rest
|
|
85
85
|
fullAllDataRowIdData[rowid] = rest
|
|
86
86
|
} else {
|
|
@@ -89,7 +89,7 @@ function insertTreeRow ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
|
|
|
89
89
|
}
|
|
90
90
|
afterFullData[funcName](item)
|
|
91
91
|
tableFullTreeData[funcName](item)
|
|
92
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
92
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
93
93
|
fullDataRowIdData[rowid] = rest
|
|
94
94
|
fullAllDataRowIdData[rowid] = rest
|
|
95
95
|
}
|
|
@@ -129,7 +129,7 @@ function handleInsertRowAt ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
|
|
|
129
129
|
} else {
|
|
130
130
|
newRecords.forEach(item => {
|
|
131
131
|
const rowid = getRowid($xeTable, item)
|
|
132
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
132
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
133
133
|
fullDataRowIdData[rowid] = rest
|
|
134
134
|
fullAllDataRowIdData[rowid] = rest
|
|
135
135
|
afterFullData.unshift(item)
|
|
@@ -158,7 +158,7 @@ function handleInsertRowAt ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
|
|
|
158
158
|
} else {
|
|
159
159
|
newRecords.forEach(item => {
|
|
160
160
|
const rowid = getRowid($xeTable, item)
|
|
161
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
161
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
162
162
|
fullDataRowIdData[rowid] = rest
|
|
163
163
|
fullAllDataRowIdData[rowid] = rest
|
|
164
164
|
afterFullData.push(item)
|
|
@@ -189,7 +189,7 @@ function handleInsertRowAt ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
|
|
|
189
189
|
targetIndex = targetIndex + 1
|
|
190
190
|
}
|
|
191
191
|
parentMapChilds.splice(targetIndex, 0, item)
|
|
192
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
192
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
193
193
|
fullDataRowIdData[rowid] = rest
|
|
194
194
|
fullAllDataRowIdData[rowid] = rest
|
|
195
195
|
})
|
|
@@ -267,7 +267,7 @@ function renderTdColumn (
|
|
|
267
267
|
isDirty = $xeTable.isUpdateByRow(row, column.field)
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
const isVNAutoHeight =
|
|
270
|
+
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad)
|
|
271
271
|
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
272
272
|
|
|
273
273
|
const isLastColumn = $columnIndex === columns.length - 1
|
|
@@ -307,7 +307,7 @@ function renderTdColumn (
|
|
|
307
307
|
}
|
|
308
308
|
tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`
|
|
309
309
|
}
|
|
310
|
-
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
310
|
+
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
311
311
|
tcStyle.height = `${cellHeight}px`
|
|
312
312
|
} else {
|
|
313
313
|
tcStyle.minHeight = `${cellHeight}px`
|
|
@@ -502,14 +502,15 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
if (rowRest) {
|
|
505
|
+
rowIndex = rowRest.index
|
|
506
|
+
_rowIndex = rowRest._index
|
|
505
507
|
rowLevel = rowRest.level
|
|
508
|
+
seq = rowRest.seq
|
|
506
509
|
if (hasRowGroupAggregate || (treeConfig && transform && seqMode === 'increasing')) {
|
|
507
510
|
seq = rowRest._index + 1
|
|
508
|
-
} else {
|
|
509
|
-
seq = rowRest.
|
|
511
|
+
} else if ((treeConfig && seqMode === 'fixed')) {
|
|
512
|
+
seq = rowRest._tIndex + 1
|
|
510
513
|
}
|
|
511
|
-
rowIndex = rowRest.index
|
|
512
|
-
_rowIndex = rowRest._index
|
|
513
514
|
}
|
|
514
515
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
515
516
|
// 行是否被展开
|
|
@@ -395,7 +395,7 @@ export const Cell = {
|
|
|
395
395
|
const { fullColumnFieldData } = tableInternalData
|
|
396
396
|
const aggregateOpts = $table.computeAggregateOpts
|
|
397
397
|
const { mode, showTotal, totalMethod, countFields, contentMethod, mapChildrenField } = aggregateOpts
|
|
398
|
-
const
|
|
398
|
+
const aggCalcMethod = aggregateOpts.calcValuesMethod || aggregateOpts.countMethod || aggregateOpts.aggregateMethod
|
|
399
399
|
const groupField = aggRow.groupField
|
|
400
400
|
const groupContent = aggRow.groupContent
|
|
401
401
|
const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : []
|
|
@@ -428,9 +428,9 @@ export const Cell = {
|
|
|
428
428
|
} else if ($table.getPivotTableAggregateCellAggValue) {
|
|
429
429
|
cellValue = $table.getPivotTableAggregateCellAggValue(params)
|
|
430
430
|
} else if (aggFunc === true || (countFields && countFields.includes(field))) {
|
|
431
|
-
if (
|
|
431
|
+
if (aggCalcMethod) {
|
|
432
432
|
ctParams.aggValue = childCount
|
|
433
|
-
cellValue = `${
|
|
433
|
+
cellValue = `${aggCalcMethod(ctParams)}`
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
} else {
|
|
@@ -480,14 +480,14 @@ export const Cell = {
|
|
|
480
480
|
const { rowGroupExpandedFlag } = tableReactData
|
|
481
481
|
const { rowGroupExpandedMaps } = tableInternalData
|
|
482
482
|
const aggregateOpts = $table.computeAggregateOpts
|
|
483
|
-
const { padding, indent } = aggregateOpts
|
|
483
|
+
const { mode, padding, indent } = aggregateOpts
|
|
484
484
|
const rowid = getRowid($table, row)
|
|
485
485
|
const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid]
|
|
486
486
|
return h('div', {
|
|
487
487
|
class: ['vxe-row-group--tree-node', {
|
|
488
488
|
'is--expanded': isExpand
|
|
489
489
|
}],
|
|
490
|
-
style: padding && indent
|
|
490
|
+
style: mode !== 'column' && padding && indent
|
|
491
491
|
? {
|
|
492
492
|
paddingLeft: `${level * indent}px`
|
|
493
493
|
}
|
|
@@ -127,15 +127,22 @@ export class ColumnInfo {
|
|
|
127
127
|
parentId: null,
|
|
128
128
|
visible,
|
|
129
129
|
// 内部属性(一旦被使用,将导致不可升级版本)
|
|
130
|
+
defaultParentId: null,
|
|
130
131
|
halfVisible: false,
|
|
131
132
|
defaultVisible: visible,
|
|
132
133
|
defaultFixed: _vm.fixed,
|
|
134
|
+
|
|
135
|
+
defaultAggGroup: _vm.aggGroup,
|
|
133
136
|
defaultAggFunc: _vm.aggFunc,
|
|
137
|
+
|
|
134
138
|
checked: false,
|
|
135
139
|
halfChecked: false,
|
|
136
140
|
disabled: false,
|
|
141
|
+
// 分组层级
|
|
137
142
|
level: 1,
|
|
143
|
+
// 跨行
|
|
138
144
|
rowSpan: 1,
|
|
145
|
+
// 跨列
|
|
139
146
|
colSpan: 1,
|
|
140
147
|
|
|
141
148
|
// 数据排序
|