vxe-table 3.10.0 → 3.10.2
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/locale/lang/en-US.js +4 -2
- package/es/locale/lang/es-ES.js +4 -2
- package/es/locale/lang/hu-HU.js +4 -2
- package/es/locale/lang/ja-JP.js +4 -2
- package/es/locale/lang/ko-KR.js +4 -2
- package/es/locale/lang/pt-BR.js +4 -2
- package/es/locale/lang/ru-RU.js +4 -2
- package/es/locale/lang/uk-UA.js +4 -2
- package/es/locale/lang/vi-VN.js +4 -2
- package/es/locale/lang/zh-CHT.js +4 -2
- package/es/locale/lang/zh-CN.js +4 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +9 -4
- package/es/table/module/export/export-panel.js +2 -2
- package/es/table/module/export/import-panel.js +1 -1
- package/es/table/src/body.js +43 -24
- package/es/table/src/cell.js +54 -24
- package/es/table/src/column.js +3 -1
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/methods.js +211 -14
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +16 -1
- package/es/table/style.css +80 -3
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +80 -3
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +371 -78
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -2
- package/lib/locale/lang/es-ES.js +4 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -2
- package/lib/locale/lang/hu-HU.js +4 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -2
- package/lib/locale/lang/ja-JP.js +4 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -2
- package/lib/locale/lang/ko-KR.js +4 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -2
- package/lib/locale/lang/pt-BR.js +4 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -2
- package/lib/locale/lang/ru-RU.js +4 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -2
- package/lib/locale/lang/uk-UA.js +4 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -2
- package/lib/locale/lang/vi-VN.js +4 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +4 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +4 -2
- package/lib/locale/lang/zh-CN.js +4 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +9 -4
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +2 -2
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +1 -1
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/src/body.js +41 -22
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +58 -24
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +227 -14
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +15 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +80 -3
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -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 +80 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +4 -2
- package/packages/locale/lang/es-ES.ts +4 -2
- package/packages/locale/lang/hu-HU.ts +4 -2
- package/packages/locale/lang/ja-JP.ts +4 -2
- package/packages/locale/lang/ko-KR.ts +4 -2
- package/packages/locale/lang/pt-BR.ts +4 -2
- package/packages/locale/lang/ru-RU.ts +4 -2
- package/packages/locale/lang/uk-UA.ts +4 -2
- package/packages/locale/lang/vi-VN.ts +4 -2
- package/packages/locale/lang/zh-CHT.ts +4 -2
- package/packages/locale/lang/zh-CN.ts +4 -2
- package/packages/table/module/custom/panel.ts +8 -8
- package/packages/table/module/edit/mixin.ts +10 -4
- package/packages/table/module/export/export-panel.ts +2 -2
- package/packages/table/module/export/import-panel.ts +1 -1
- package/packages/table/src/body.ts +43 -24
- package/packages/table/src/cell.ts +58 -24
- package/packages/table/src/column.ts +3 -1
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/methods.ts +227 -14
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +16 -1
- package/packages/ui/index.ts +3 -0
- package/styles/components/table-module/custom.scss +9 -3
- package/styles/components/table.scss +89 -0
- /package/es/{iconfont.1730681241769.ttf → iconfont.1730873052490.ttf} +0 -0
- /package/es/{iconfont.1730681241769.woff → iconfont.1730873052490.woff} +0 -0
- /package/es/{iconfont.1730681241769.woff2 → iconfont.1730873052490.woff2} +0 -0
- /package/lib/{iconfont.1730681241769.ttf → iconfont.1730873052490.ttf} +0 -0
- /package/lib/{iconfont.1730681241769.woff → iconfont.1730873052490.woff} +0 -0
- /package/lib/{iconfont.1730681241769.woff2 → iconfont.1730873052490.woff2} +0 -0
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功導入 {0} 筆記錄',
|
|
63
63
|
expLoading: '正在匯出中',
|
|
64
64
|
expSuccess: '匯出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '導出_{0}',
|
|
66
67
|
expOriginFilename: '匯出_來源_{0}',
|
|
67
68
|
customTitle: '列設定',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '關閉',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢復預設',
|
|
73
|
-
maxFixedCol: '最大凍結列的數量不能超過 {0} 個'
|
|
74
|
+
maxFixedCol: '最大凍結列的數量不能超過 {0} 個',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '請至少選擇一筆記錄!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '確定',
|
|
123
125
|
cstmConfirmRestore: '請確認是否恢復成預設列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移動:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '點擊並拖曳圖示可以調整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -901,21 +901,21 @@ export default {
|
|
|
901
901
|
}
|
|
902
902
|
$xetable.checkCustomStatus()
|
|
903
903
|
},
|
|
904
|
-
sortMousedownEvent (evnt:
|
|
904
|
+
sortMousedownEvent (evnt: MouseEvent) {
|
|
905
905
|
const { $xetable } = this
|
|
906
|
-
const btnEl = evnt.currentTarget
|
|
907
|
-
const tdEl = btnEl.parentNode
|
|
908
|
-
const trEl = tdEl.parentNode
|
|
906
|
+
const btnEl = evnt.currentTarget as HTMLElement
|
|
907
|
+
const tdEl = btnEl.parentNode as HTMLElement
|
|
908
|
+
const trEl = tdEl.parentNode as HTMLElement
|
|
909
909
|
const colid = trEl.getAttribute('colid')
|
|
910
910
|
const column = $xetable.getColumnById(colid)
|
|
911
911
|
trEl.draggable = true
|
|
912
912
|
this.dragColumn = column
|
|
913
913
|
addClass(trEl, 'active--drag-origin')
|
|
914
914
|
},
|
|
915
|
-
sortMouseupEvent (evnt:
|
|
916
|
-
const btnEl = evnt.currentTarget
|
|
917
|
-
const tdEl = btnEl.parentNode
|
|
918
|
-
const trEl = tdEl.parentNode
|
|
915
|
+
sortMouseupEvent (evnt: MouseEvent) {
|
|
916
|
+
const btnEl = evnt.currentTarget as HTMLElement
|
|
917
|
+
const tdEl = btnEl.parentNode as HTMLElement
|
|
918
|
+
const trEl = tdEl.parentNode as HTMLElement
|
|
919
919
|
const dragHintEl = this.$refs.dragHintElemRef
|
|
920
920
|
trEl.draggable = false
|
|
921
921
|
this.dragColumn = null
|
|
@@ -547,9 +547,13 @@ export default {
|
|
|
547
547
|
* 清除激活的编辑
|
|
548
548
|
*/
|
|
549
549
|
_clearEdit (evnt: any) {
|
|
550
|
-
const
|
|
550
|
+
const $xeTable = this
|
|
551
|
+
const reactData = $xeTable
|
|
552
|
+
|
|
553
|
+
const { editStore } = reactData
|
|
551
554
|
const { actived, focused } = editStore
|
|
552
555
|
const { row, column } = actived
|
|
556
|
+
const validOpts = $xeTable.validOpts
|
|
553
557
|
if (row || column) {
|
|
554
558
|
this._syncActivedCell()
|
|
555
559
|
actived.args = null
|
|
@@ -567,9 +571,11 @@ export default {
|
|
|
567
571
|
}
|
|
568
572
|
focused.row = null
|
|
569
573
|
focused.column = null
|
|
570
|
-
if (
|
|
571
|
-
if (
|
|
572
|
-
|
|
574
|
+
if (validOpts.autoClear) {
|
|
575
|
+
if (validOpts.msgMode !== 'full' || getConfig().cellVaildMode === 'obsolete') {
|
|
576
|
+
if (this.clearValidate) {
|
|
577
|
+
return this.clearValidate()
|
|
578
|
+
}
|
|
573
579
|
}
|
|
574
580
|
}
|
|
575
581
|
return this.$nextTick()
|
|
@@ -226,7 +226,7 @@ export default {
|
|
|
226
226
|
options: storeData.typeList
|
|
227
227
|
},
|
|
228
228
|
on: {
|
|
229
|
-
|
|
229
|
+
modelValue (value: any) {
|
|
230
230
|
defaultOptions.type = value
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -263,7 +263,7 @@ export default {
|
|
|
263
263
|
options: storeData.modeList
|
|
264
264
|
},
|
|
265
265
|
on: {
|
|
266
|
-
|
|
266
|
+
modelValue (value: any) {
|
|
267
267
|
defaultOptions.mode = value
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -299,7 +299,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
|
|
|
299
299
|
getClass(className, params),
|
|
300
300
|
getClass(allCellClassName, params)
|
|
301
301
|
],
|
|
302
|
-
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
302
|
+
key: columnKey || columnOpts.useKey || rowOpts.useKey ? column.id : $columnIndex,
|
|
303
303
|
attrs,
|
|
304
304
|
style: Object.assign({
|
|
305
305
|
height: cellHeight
|
|
@@ -308,7 +308,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
|
|
|
308
308
|
}, tdVNs)
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
function renderRows (h: CreateElement, _vm: any, $
|
|
311
|
+
function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any, tableData: any, tableColumn: any) {
|
|
312
312
|
const {
|
|
313
313
|
stripe,
|
|
314
314
|
rowKey,
|
|
@@ -332,35 +332,47 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
332
332
|
rowOpts,
|
|
333
333
|
pendingRowList,
|
|
334
334
|
pendingRowMaps
|
|
335
|
-
} = $
|
|
335
|
+
} = $xeTable
|
|
336
336
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
337
337
|
const rows: any[] = []
|
|
338
338
|
tableData.forEach((row: any, $rowIndex: any) => {
|
|
339
339
|
const trOn: any = {}
|
|
340
340
|
let rowIndex = $rowIndex
|
|
341
|
-
const _rowIndex = $
|
|
341
|
+
const _rowIndex = $xeTable.getVTRowIndex(row)
|
|
342
342
|
// 确保任何情况下 rowIndex 都精准指向真实 data 索引
|
|
343
|
-
rowIndex = $
|
|
344
|
-
//
|
|
343
|
+
rowIndex = $xeTable.getRowIndex(row)
|
|
344
|
+
// 当前行事件
|
|
345
345
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
346
346
|
trOn.mouseenter = (evnt: any) => {
|
|
347
|
-
if (isVMScrollProcess($
|
|
347
|
+
if (isVMScrollProcess($xeTable)) {
|
|
348
348
|
return
|
|
349
349
|
}
|
|
350
|
-
$
|
|
350
|
+
$xeTable.triggerHoverEvent(evnt, { row, rowIndex })
|
|
351
351
|
}
|
|
352
352
|
trOn.mouseleave = () => {
|
|
353
|
-
if (isVMScrollProcess($
|
|
353
|
+
if (isVMScrollProcess($xeTable)) {
|
|
354
354
|
return
|
|
355
355
|
}
|
|
356
|
-
$
|
|
356
|
+
$xeTable.clearHoverRow()
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// 拖拽行事件
|
|
360
|
+
if (rowOpts.drag) {
|
|
361
|
+
trOn.dragstart = (evnt: DragEvent) => {
|
|
362
|
+
$xeTable.handleRowDragDragstartEvent(evnt)
|
|
363
|
+
}
|
|
364
|
+
trOn.dragover = (evnt: DragEvent) => {
|
|
365
|
+
$xeTable.handleRowDragDragoverEvent(evnt)
|
|
366
|
+
}
|
|
367
|
+
trOn.dragend = (evnt: DragEvent) => {
|
|
368
|
+
$xeTable.handleRowDragDragendEvent(evnt)
|
|
357
369
|
}
|
|
358
370
|
}
|
|
359
|
-
const rowid = getRowid($
|
|
371
|
+
const rowid = getRowid($xeTable, row)
|
|
360
372
|
const rest = fullAllDataRowIdData[rowid]
|
|
361
373
|
const rowLevel = rest ? rest.level : 0
|
|
362
374
|
const seq = rest ? rest.seq : -1
|
|
363
|
-
const params = { $table: $
|
|
375
|
+
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
364
376
|
// 行是否被展开
|
|
365
377
|
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
366
378
|
// 树节点是否被展开
|
|
@@ -369,7 +381,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
369
381
|
// 是否新增行
|
|
370
382
|
let isNewRow = false
|
|
371
383
|
if (editConfig) {
|
|
372
|
-
isNewRow = $
|
|
384
|
+
isNewRow = $xeTable.isInsertByRow(row)
|
|
373
385
|
}
|
|
374
386
|
if (treeConfig && !scrollYLoad && !treeOpts.transform) {
|
|
375
387
|
rowChildren = row[childrenField]
|
|
@@ -381,13 +393,13 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
381
393
|
'vxe-body--row',
|
|
382
394
|
treeConfig ? `row--level-${rowLevel}` : '',
|
|
383
395
|
{
|
|
384
|
-
'row--stripe': stripe && ($
|
|
396
|
+
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
385
397
|
'is--new': isNewRow,
|
|
386
398
|
'is--expand-row': isExpandRow,
|
|
387
399
|
'is--expand-tree': isExpandTree,
|
|
388
400
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
389
|
-
'row--radio': radioOpts.highlight && $
|
|
390
|
-
'row--checked': checkboxOpts.highlight && $
|
|
401
|
+
'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
|
|
402
|
+
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
391
403
|
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
392
404
|
},
|
|
393
405
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
@@ -396,10 +408,10 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
396
408
|
rowid
|
|
397
409
|
},
|
|
398
410
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
399
|
-
key:
|
|
411
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
400
412
|
on: trOn
|
|
401
413
|
}, tableColumn.map((column: any, $columnIndex: any) => {
|
|
402
|
-
return renderColumn(h, _vm, $
|
|
414
|
+
return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
403
415
|
}))
|
|
404
416
|
)
|
|
405
417
|
// 如果行被展开了
|
|
@@ -414,7 +426,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
414
426
|
}
|
|
415
427
|
const { showOverflow } = expandColumn
|
|
416
428
|
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
|
|
417
|
-
const expandParams = { $table: $
|
|
429
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
418
430
|
rows.push(
|
|
419
431
|
h('tr', {
|
|
420
432
|
class: ['vxe-body--expanded-row', {
|
|
@@ -449,7 +461,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
|
|
|
449
461
|
}
|
|
450
462
|
// 如果是树形表格
|
|
451
463
|
if (isExpandTree) {
|
|
452
|
-
rows.push(...renderRows(h, _vm, $
|
|
464
|
+
rows.push(...renderRows(h, _vm, $xeTable, fixedType, rowChildren, tableColumn))
|
|
453
465
|
}
|
|
454
466
|
})
|
|
455
467
|
return rows
|
|
@@ -501,7 +513,7 @@ export default {
|
|
|
501
513
|
},
|
|
502
514
|
render (this: any, h: CreateElement) {
|
|
503
515
|
const { _e, $parent: $xetable, fixedColumn, fixedType } = this
|
|
504
|
-
let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts } = $xetable
|
|
516
|
+
let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts, rowOpts, isDragRowMove } = $xetable
|
|
505
517
|
// 如果是使用优化模式
|
|
506
518
|
if (fixedType) {
|
|
507
519
|
// 如果存在展开行使用全量渲染
|
|
@@ -580,9 +592,16 @@ export default {
|
|
|
580
592
|
/**
|
|
581
593
|
* 内容
|
|
582
594
|
*/
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
595
|
+
rowOpts.drag
|
|
596
|
+
? h('transition-group', {
|
|
597
|
+
props: {
|
|
598
|
+
tag: 'tbody',
|
|
599
|
+
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
|
|
600
|
+
}
|
|
601
|
+
}, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
|
|
602
|
+
: h('tbody', {
|
|
603
|
+
ref: 'tbody'
|
|
604
|
+
}, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
|
|
586
605
|
]),
|
|
587
606
|
h('div', {
|
|
588
607
|
class: 'vxe-table--checkbox-range'
|
|
@@ -6,7 +6,7 @@ import { updateCellTitle } from '../../ui/src/dom'
|
|
|
6
6
|
import { createColumn, getRowid } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
|
-
const { getI18n, getIcon, renderer, formats } = VxeUI
|
|
9
|
+
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
10
10
|
|
|
11
11
|
function renderTitlePrefixIcon (h: CreateElement, params: any) {
|
|
12
12
|
const { $table, column } = params
|
|
@@ -48,6 +48,38 @@ function renderTitleSuffixIcon (h: CreateElement, params: any) {
|
|
|
48
48
|
: []
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
function renderCellDragIcon (h: CreateElement, params: any) {
|
|
52
|
+
const { $table } = params
|
|
53
|
+
return h('span', {
|
|
54
|
+
key: 'dg',
|
|
55
|
+
class: 'vxe-cell--drag-handle',
|
|
56
|
+
on: {
|
|
57
|
+
mousedown (evnt: DragEvent) {
|
|
58
|
+
$table.handleCellDragMousedownEvent(evnt, params)
|
|
59
|
+
},
|
|
60
|
+
mouseup: $table.handleCellDragMouseupEvent
|
|
61
|
+
}
|
|
62
|
+
}, [
|
|
63
|
+
h('i', {
|
|
64
|
+
class: 'vxe-table-icon-drag-handle'
|
|
65
|
+
})
|
|
66
|
+
])
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
|
|
70
|
+
const { $table, column } = params
|
|
71
|
+
const { dragSort } = column
|
|
72
|
+
const vns: any[] = XEUtils.isArray(content) ? content : [content]
|
|
73
|
+
const rowOpts = $table.computeRowOpts
|
|
74
|
+
const dragOpts = $table.computeDragOpts
|
|
75
|
+
if (dragSort && rowOpts.drag && dragOpts.showIcon) {
|
|
76
|
+
vns.unshift(
|
|
77
|
+
renderCellDragIcon(h, params)
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
return vns
|
|
81
|
+
}
|
|
82
|
+
|
|
51
83
|
function renderTitleContent (h: CreateElement, params: any, content: any) {
|
|
52
84
|
const { $table, column } = params
|
|
53
85
|
const { type, showHeaderOverflow } = column
|
|
@@ -234,7 +266,7 @@ export const Cell = {
|
|
|
234
266
|
const { slots, editRender, cellRender } = column
|
|
235
267
|
const renderOpts = editRender || cellRender
|
|
236
268
|
if (slots && slots.default) {
|
|
237
|
-
return $table.callSlot(slots.default, params, h)
|
|
269
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
238
270
|
}
|
|
239
271
|
if (renderOpts) {
|
|
240
272
|
const compConf = renderer.get(renderOpts.name)
|
|
@@ -242,12 +274,12 @@ export const Cell = {
|
|
|
242
274
|
const rtCell = compConf ? (compConf.renderTableCell || compConf.renderCell) : null
|
|
243
275
|
const renderFn = editRender ? rtCell : rtDefault
|
|
244
276
|
if (renderFn) {
|
|
245
|
-
return getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)))
|
|
277
|
+
return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))))
|
|
246
278
|
}
|
|
247
279
|
}
|
|
248
280
|
const cellValue = $table.getCellLabel(row, column)
|
|
249
281
|
const cellPlaceholder = editRender ? editRender.placeholder : ''
|
|
250
|
-
return [
|
|
282
|
+
return renderCellBaseVNs(h, params, [
|
|
251
283
|
h('span', {
|
|
252
284
|
class: 'vxe-cell--label'
|
|
253
285
|
}, [
|
|
@@ -258,7 +290,7 @@ export const Cell = {
|
|
|
258
290
|
}, formatText(getFuncText(cellPlaceholder), 1))
|
|
259
291
|
: h('span', formatText(cellValue, 1))
|
|
260
292
|
])
|
|
261
|
-
]
|
|
293
|
+
])
|
|
262
294
|
},
|
|
263
295
|
renderTreeCell (h: CreateElement, params: any) {
|
|
264
296
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
|
|
@@ -348,11 +380,13 @@ export const Cell = {
|
|
|
348
380
|
const { treeConfig, seqOpts } = $table
|
|
349
381
|
const { slots } = column
|
|
350
382
|
if (slots && slots.default) {
|
|
351
|
-
return $table.callSlot(slots.default, params, h)
|
|
383
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
352
384
|
}
|
|
353
385
|
const { seq } = params
|
|
354
386
|
const seqMethod = seqOpts.seqMethod
|
|
355
|
-
return
|
|
387
|
+
return renderCellBaseVNs(h, params, [
|
|
388
|
+
h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
|
|
389
|
+
])
|
|
356
390
|
},
|
|
357
391
|
renderTreeIndexCell (h: CreateElement, params: any) {
|
|
358
392
|
return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params))
|
|
@@ -400,7 +434,7 @@ export const Cell = {
|
|
|
400
434
|
}
|
|
401
435
|
const radioParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible }
|
|
402
436
|
if (radioSlot) {
|
|
403
|
-
return $table.callSlot(radioSlot, radioParams, h)
|
|
437
|
+
return renderCellBaseVNs(h, params, $table.callSlot(radioSlot, radioParams, h))
|
|
404
438
|
}
|
|
405
439
|
const radioVNs = []
|
|
406
440
|
if (isVisible) {
|
|
@@ -417,7 +451,7 @@ export const Cell = {
|
|
|
417
451
|
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams, h) : XEUtils.get(row, labelField))
|
|
418
452
|
)
|
|
419
453
|
}
|
|
420
|
-
return [
|
|
454
|
+
return renderCellBaseVNs(h, params, [
|
|
421
455
|
h('span', {
|
|
422
456
|
class: ['vxe-cell--radio', {
|
|
423
457
|
'is--checked': isChecked,
|
|
@@ -425,7 +459,7 @@ export const Cell = {
|
|
|
425
459
|
}],
|
|
426
460
|
on
|
|
427
461
|
}, radioVNs)
|
|
428
|
-
]
|
|
462
|
+
])
|
|
429
463
|
},
|
|
430
464
|
renderTreeRadioCell (h: CreateElement, params: any) {
|
|
431
465
|
return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params))
|
|
@@ -518,7 +552,7 @@ export const Cell = {
|
|
|
518
552
|
}
|
|
519
553
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
520
554
|
if (checkboxSlot) {
|
|
521
|
-
return $table.callSlot(checkboxSlot, checkboxParams, h)
|
|
555
|
+
return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h))
|
|
522
556
|
}
|
|
523
557
|
const checkVNs = []
|
|
524
558
|
if (isVisible) {
|
|
@@ -535,7 +569,7 @@ export const Cell = {
|
|
|
535
569
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : XEUtils.get(row, labelField))
|
|
536
570
|
)
|
|
537
571
|
}
|
|
538
|
-
return [
|
|
572
|
+
return renderCellBaseVNs(h, params, [
|
|
539
573
|
h('span', {
|
|
540
574
|
class: ['vxe-cell--checkbox', {
|
|
541
575
|
'is--checked': isChecked,
|
|
@@ -545,7 +579,7 @@ export const Cell = {
|
|
|
545
579
|
}],
|
|
546
580
|
on
|
|
547
581
|
}, checkVNs)
|
|
548
|
-
]
|
|
582
|
+
])
|
|
549
583
|
},
|
|
550
584
|
renderTreeSelectionCell (h: CreateElement, params: any) {
|
|
551
585
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params))
|
|
@@ -582,7 +616,7 @@ export const Cell = {
|
|
|
582
616
|
}
|
|
583
617
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
584
618
|
if (checkboxSlot) {
|
|
585
|
-
return $table.callSlot(checkboxSlot, checkboxParams, h)
|
|
619
|
+
return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h))
|
|
586
620
|
}
|
|
587
621
|
const checkVNs = []
|
|
588
622
|
if (isVisible) {
|
|
@@ -599,7 +633,7 @@ export const Cell = {
|
|
|
599
633
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : XEUtils.get(row, labelField))
|
|
600
634
|
)
|
|
601
635
|
}
|
|
602
|
-
return [
|
|
636
|
+
return renderCellBaseVNs(h, params, [
|
|
603
637
|
h('span', {
|
|
604
638
|
class: ['vxe-cell--checkbox', {
|
|
605
639
|
'is--checked': isChecked,
|
|
@@ -609,7 +643,7 @@ export const Cell = {
|
|
|
609
643
|
}],
|
|
610
644
|
on
|
|
611
645
|
}, checkVNs)
|
|
612
|
-
]
|
|
646
|
+
])
|
|
613
647
|
},
|
|
614
648
|
renderTreeSelectionCellByProp (h: CreateElement, params: any) {
|
|
615
649
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params))
|
|
@@ -627,7 +661,7 @@ export const Cell = {
|
|
|
627
661
|
let isAceived = false
|
|
628
662
|
let isLazyLoading = false
|
|
629
663
|
if (slots && slots.icon) {
|
|
630
|
-
return $table.callSlot(slots.icon, params, h)
|
|
664
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.icon, params, h))
|
|
631
665
|
}
|
|
632
666
|
if (!isHidden) {
|
|
633
667
|
const rowid = getRowid($table, row)
|
|
@@ -636,7 +670,7 @@ export const Cell = {
|
|
|
636
670
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid]
|
|
637
671
|
}
|
|
638
672
|
}
|
|
639
|
-
return [
|
|
673
|
+
return renderCellBaseVNs(h, params, [
|
|
640
674
|
showIcon && (!visibleMethod || visibleMethod(params))
|
|
641
675
|
? h('span', {
|
|
642
676
|
class: ['vxe-table--expanded', {
|
|
@@ -652,13 +686,13 @@ export const Cell = {
|
|
|
652
686
|
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
653
687
|
})
|
|
654
688
|
])
|
|
655
|
-
:
|
|
689
|
+
: renderEmptyElement($table),
|
|
656
690
|
defaultSlot || labelField
|
|
657
691
|
? h('span', {
|
|
658
692
|
class: 'vxe-table--expand-label'
|
|
659
693
|
}, defaultSlot ? $table.callSlot(defaultSlot, params, h) : XEUtils.get(row, labelField))
|
|
660
|
-
:
|
|
661
|
-
]
|
|
694
|
+
: renderEmptyElement($table)
|
|
695
|
+
])
|
|
662
696
|
},
|
|
663
697
|
renderExpandData (h: CreateElement, params: any) {
|
|
664
698
|
const { $table, column } = params
|
|
@@ -683,16 +717,16 @@ export const Cell = {
|
|
|
683
717
|
const { $table, column } = params
|
|
684
718
|
const { slots } = column
|
|
685
719
|
if (slots && slots.default) {
|
|
686
|
-
return $table.callSlot(slots.default, params, h)
|
|
720
|
+
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
687
721
|
}
|
|
688
|
-
return [
|
|
722
|
+
return renderCellBaseVNs(h, params, [
|
|
689
723
|
h('span', {
|
|
690
724
|
class: 'vxe-cell--html',
|
|
691
725
|
domProps: {
|
|
692
726
|
innerHTML: getDefaultCellLabel(params)
|
|
693
727
|
}
|
|
694
728
|
})
|
|
695
|
-
]
|
|
729
|
+
])
|
|
696
730
|
},
|
|
697
731
|
renderTreeHTMLCell (h: CreateElement, params: any) {
|
|
698
732
|
return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params))
|