vxe-table 3.10.1 → 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.
Files changed (119) hide show
  1. package/es/locale/lang/en-US.js +3 -2
  2. package/es/locale/lang/es-ES.js +3 -2
  3. package/es/locale/lang/hu-HU.js +3 -2
  4. package/es/locale/lang/ja-JP.js +3 -2
  5. package/es/locale/lang/ko-KR.js +3 -2
  6. package/es/locale/lang/pt-BR.js +3 -2
  7. package/es/locale/lang/ru-RU.js +3 -2
  8. package/es/locale/lang/uk-UA.js +3 -2
  9. package/es/locale/lang/vi-VN.js +3 -2
  10. package/es/locale/lang/zh-CHT.js +3 -2
  11. package/es/locale/lang/zh-CN.js +3 -2
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table/module/edit/mixin.js +9 -4
  15. package/es/table/src/body.js +43 -24
  16. package/es/table/src/cell.js +54 -24
  17. package/es/table/src/column.js +3 -1
  18. package/es/table/src/columnInfo.js +1 -0
  19. package/es/table/src/methods.js +211 -14
  20. package/es/table/src/props.js +2 -0
  21. package/es/table/src/table.js +16 -1
  22. package/es/table/style.css +74 -2
  23. package/es/table/style.min.css +1 -1
  24. package/es/ui/index.js +4 -1
  25. package/es/ui/src/log.js +1 -1
  26. package/es/vxe-table/style.css +74 -2
  27. package/es/vxe-table/style.min.css +1 -1
  28. package/helper/vetur/attributes.json +1 -1
  29. package/helper/vetur/tags.json +1 -1
  30. package/lib/index.umd.js +367 -75
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/locale/lang/en-US.js +3 -2
  33. package/lib/locale/lang/en-US.min.js +1 -1
  34. package/lib/locale/lang/en-US.umd.js +3 -2
  35. package/lib/locale/lang/es-ES.js +3 -2
  36. package/lib/locale/lang/es-ES.min.js +1 -1
  37. package/lib/locale/lang/es-ES.umd.js +3 -2
  38. package/lib/locale/lang/hu-HU.js +3 -2
  39. package/lib/locale/lang/hu-HU.min.js +1 -1
  40. package/lib/locale/lang/hu-HU.umd.js +3 -2
  41. package/lib/locale/lang/ja-JP.js +3 -2
  42. package/lib/locale/lang/ja-JP.min.js +1 -1
  43. package/lib/locale/lang/ja-JP.umd.js +3 -2
  44. package/lib/locale/lang/ko-KR.js +3 -2
  45. package/lib/locale/lang/ko-KR.min.js +1 -1
  46. package/lib/locale/lang/ko-KR.umd.js +3 -2
  47. package/lib/locale/lang/pt-BR.js +3 -2
  48. package/lib/locale/lang/pt-BR.min.js +1 -1
  49. package/lib/locale/lang/pt-BR.umd.js +3 -2
  50. package/lib/locale/lang/ru-RU.js +3 -2
  51. package/lib/locale/lang/ru-RU.min.js +1 -1
  52. package/lib/locale/lang/ru-RU.umd.js +3 -2
  53. package/lib/locale/lang/uk-UA.js +3 -2
  54. package/lib/locale/lang/uk-UA.min.js +1 -1
  55. package/lib/locale/lang/uk-UA.umd.js +3 -2
  56. package/lib/locale/lang/vi-VN.js +3 -2
  57. package/lib/locale/lang/vi-VN.min.js +1 -1
  58. package/lib/locale/lang/zh-CHT.js +3 -2
  59. package/lib/locale/lang/zh-CHT.min.js +1 -1
  60. package/lib/locale/lang/zh-CHT.umd.js +3 -2
  61. package/lib/locale/lang/zh-CN.js +3 -2
  62. package/lib/locale/lang/zh-CN.min.js +1 -1
  63. package/lib/locale/lang/zh-CN.umd.js +3 -2
  64. package/lib/style.css +1 -1
  65. package/lib/style.min.css +1 -1
  66. package/lib/table/module/edit/mixin.js +9 -4
  67. package/lib/table/module/edit/mixin.min.js +1 -1
  68. package/lib/table/src/body.js +41 -22
  69. package/lib/table/src/body.min.js +1 -1
  70. package/lib/table/src/cell.js +58 -24
  71. package/lib/table/src/cell.min.js +1 -1
  72. package/lib/table/src/column.js +3 -1
  73. package/lib/table/src/column.min.js +1 -1
  74. package/lib/table/src/columnInfo.js +1 -0
  75. package/lib/table/src/columnInfo.min.js +1 -1
  76. package/lib/table/src/methods.js +227 -14
  77. package/lib/table/src/methods.min.js +1 -1
  78. package/lib/table/src/props.js +2 -0
  79. package/lib/table/src/props.min.js +1 -1
  80. package/lib/table/src/table.js +15 -2
  81. package/lib/table/src/table.min.js +1 -1
  82. package/lib/table/style/style.css +74 -2
  83. package/lib/table/style/style.min.css +1 -1
  84. package/lib/ui/index.js +4 -1
  85. package/lib/ui/index.min.js +1 -1
  86. package/lib/ui/src/log.js +1 -1
  87. package/lib/ui/src/log.min.js +1 -1
  88. package/lib/vxe-table/style/style.css +74 -2
  89. package/lib/vxe-table/style/style.min.css +1 -1
  90. package/package.json +2 -2
  91. package/packages/locale/lang/en-US.ts +3 -2
  92. package/packages/locale/lang/es-ES.ts +3 -2
  93. package/packages/locale/lang/hu-HU.ts +3 -2
  94. package/packages/locale/lang/ja-JP.ts +3 -2
  95. package/packages/locale/lang/ko-KR.ts +3 -2
  96. package/packages/locale/lang/pt-BR.ts +3 -2
  97. package/packages/locale/lang/ru-RU.ts +3 -2
  98. package/packages/locale/lang/uk-UA.ts +3 -2
  99. package/packages/locale/lang/vi-VN.ts +3 -2
  100. package/packages/locale/lang/zh-CHT.ts +3 -2
  101. package/packages/locale/lang/zh-CN.ts +3 -2
  102. package/packages/table/module/custom/panel.ts +8 -8
  103. package/packages/table/module/edit/mixin.ts +10 -4
  104. package/packages/table/src/body.ts +43 -24
  105. package/packages/table/src/cell.ts +58 -24
  106. package/packages/table/src/column.ts +3 -1
  107. package/packages/table/src/columnInfo.ts +1 -0
  108. package/packages/table/src/methods.ts +227 -14
  109. package/packages/table/src/props.ts +2 -0
  110. package/packages/table/src/table.ts +16 -1
  111. package/packages/ui/index.ts +3 -0
  112. package/styles/components/table-module/custom.scss +9 -3
  113. package/styles/components/table.scss +80 -0
  114. /package/es/{iconfont.1730710763407.ttf → iconfont.1730873052490.ttf} +0 -0
  115. /package/es/{iconfont.1730710763407.woff → iconfont.1730873052490.woff} +0 -0
  116. /package/es/{iconfont.1730710763407.woff2 → iconfont.1730873052490.woff2} +0 -0
  117. /package/lib/{iconfont.1730710763407.ttf → iconfont.1730873052490.ttf} +0 -0
  118. /package/lib/{iconfont.1730710763407.woff → iconfont.1730873052490.woff} +0 -0
  119. /package/lib/{iconfont.1730710763407.woff2 → iconfont.1730873052490.woff2} +0 -0
@@ -71,7 +71,8 @@ export default {
71
71
  customClose: '关闭',
72
72
  customCancel: '取消',
73
73
  customRestore: '恢复默认',
74
- maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
74
+ maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
75
+ dragTip: '移动:{0}'
75
76
  },
76
77
  grid: {
77
78
  selectOneRecord: '请至少选择一条记录!',
@@ -122,7 +123,7 @@ export default {
122
123
  cstmCancel: '取消',
123
124
  cstmConfirm: '确定',
124
125
  cstmConfirmRestore: '请确认是否恢复成默认列配置?',
125
- cstmDragTarget: '移动目标:{0}',
126
+ cstmDragTarget: '移动:{0}',
126
127
  setting: {
127
128
  colSort: '排序',
128
129
  sortHelpTip: '点击并拖动图标可以调整列的排序',
@@ -901,21 +901,21 @@ export default {
901
901
  }
902
902
  $xetable.checkCustomStatus()
903
903
  },
904
- sortMousedownEvent (evnt: any) {
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: any) {
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 { editStore } = this
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 (getConfig().cellVaildMode === 'obsolete') {
571
- if (this.clearValidate) {
572
- return this.clearValidate()
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()
@@ -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, $xetable: any, fixedType: any, tableData: any, tableColumn: 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
- } = $xetable
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 = $xetable.getVTRowIndex(row)
341
+ const _rowIndex = $xeTable.getVTRowIndex(row)
342
342
  // 确保任何情况下 rowIndex 都精准指向真实 data 索引
343
- rowIndex = $xetable.getRowIndex(row)
344
- // 事件绑定
343
+ rowIndex = $xeTable.getRowIndex(row)
344
+ // 当前行事件
345
345
  if (rowOpts.isHover || highlightHoverRow) {
346
346
  trOn.mouseenter = (evnt: any) => {
347
- if (isVMScrollProcess($xetable)) {
347
+ if (isVMScrollProcess($xeTable)) {
348
348
  return
349
349
  }
350
- $xetable.triggerHoverEvent(evnt, { row, rowIndex })
350
+ $xeTable.triggerHoverEvent(evnt, { row, rowIndex })
351
351
  }
352
352
  trOn.mouseleave = () => {
353
- if (isVMScrollProcess($xetable)) {
353
+ if (isVMScrollProcess($xeTable)) {
354
354
  return
355
355
  }
356
- $xetable.clearHoverRow()
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($xetable, row)
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: $xetable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
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 = $xetable.isInsertByRow(row)
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 && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
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 && $xetable.selectRadioRow === row,
390
- 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row),
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: (rowKey || rowOpts.useKey) || treeConfig ? rowid : $rowIndex,
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, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
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: $xetable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
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, $xetable, fixedType, rowChildren, tableColumn))
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
- h('tbody', {
584
- ref: 'tbody'
585
- }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
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 [formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)]
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
- : null,
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
- : null
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))
@@ -64,8 +64,10 @@ const props = {
64
64
  filterRecoverMethod: Function,
65
65
  // 筛选模板配置项
66
66
  filterRender: Object,
67
- // 指定为树节点
67
+ // 设置为树节点
68
68
  treeNode: Boolean,
69
+ // 设置为拖拽排序
70
+ dragSort: Boolean,
69
71
  // 是否可视
70
72
  visible: { type: Boolean, default: null },
71
73
  // 表头单元格数据导出方法
@@ -88,6 +88,7 @@ export class ColumnInfo {
88
88
  filterRecoverMethod: _vm.filterRecoverMethod,
89
89
  filterRender: _vm.filterRender,
90
90
  treeNode: _vm.treeNode,
91
+ dragSort: _vm.dragSort,
91
92
  cellType: _vm.cellType,
92
93
  cellRender: _vm.cellRender,
93
94
  editRender: _vm.editRender,