vxe-table 3.5.9 → 3.6.0-beta.10

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 (142) hide show
  1. package/helper/vetur/attributes.json +17 -5
  2. package/helper/vetur/tags.json +10 -2
  3. package/lib/button/style/style.css +15 -63
  4. package/lib/button/style/style.min.css +1 -1
  5. package/lib/checkbox/src/checkbox.js +22 -9
  6. package/lib/checkbox/src/checkbox.min.js +1 -1
  7. package/lib/checkbox/src/group.js +13 -0
  8. package/lib/checkbox/src/group.min.js +1 -1
  9. package/lib/checkbox/style/style.css +37 -60
  10. package/lib/checkbox/style/style.min.css +1 -1
  11. package/lib/edit/src/mixin.js +10 -10
  12. package/lib/edit/src/mixin.min.js +1 -1
  13. package/lib/export/src/export-panel.js +10 -16
  14. package/lib/export/src/export-panel.min.js +1 -1
  15. package/lib/export/style/style.css +23 -92
  16. package/lib/export/style/style.min.css +1 -1
  17. package/lib/filter/src/panel.js +11 -15
  18. package/lib/filter/src/panel.min.js +1 -1
  19. package/lib/filter/style/style.css +24 -90
  20. package/lib/filter/style/style.min.css +1 -1
  21. package/lib/form/src/form.js +2 -2
  22. package/lib/form/src/form.min.js +1 -1
  23. package/lib/form/style/style.css +0 -3
  24. package/lib/form/style/style.min.css +1 -1
  25. package/lib/grid/style/style.css +1 -1
  26. package/lib/grid/style/style.min.css +1 -1
  27. package/lib/icon/index.js +10 -4
  28. package/lib/icon/index.min.js +1 -1
  29. package/lib/icon/src/icon.js +29 -0
  30. package/lib/icon/src/icon.min.js +1 -0
  31. package/lib/icon/style/style.css +453 -518
  32. package/lib/icon/style/style.min.css +1 -1
  33. package/lib/index.css +1 -1
  34. package/lib/index.umd.js +552 -445
  35. package/lib/index.umd.min.js +1 -1
  36. package/lib/input/src/input.js +3 -3
  37. package/lib/input/src/input.min.js +1 -1
  38. package/lib/input/style/style.css +18 -9
  39. package/lib/input/style/style.min.css +1 -1
  40. package/lib/list/src/list.js +1 -1
  41. package/lib/list/src/list.min.js +1 -1
  42. package/lib/loading/src/loading.js +19 -9
  43. package/lib/loading/src/loading.min.js +1 -1
  44. package/lib/locale/lang/en-US.js +1 -1
  45. package/lib/locale/lang/en-US.min.js +1 -1
  46. package/lib/locale/lang/en-US.umd.js +1 -1
  47. package/lib/locale/lang/ja-JP.js +1 -1
  48. package/lib/locale/lang/ja-JP.min.js +1 -1
  49. package/lib/locale/lang/ja-JP.umd.js +1 -1
  50. package/lib/locale/lang/zh-CN.js +1 -1
  51. package/lib/locale/lang/zh-CN.min.js +1 -1
  52. package/lib/locale/lang/zh-CN.umd.js +1 -1
  53. package/lib/locale/lang/zh-HK.min.js +1 -1
  54. package/lib/locale/lang/zh-HK.umd.js +1 -1
  55. package/lib/locale/lang/zh-MO.min.js +1 -1
  56. package/lib/locale/lang/zh-MO.umd.js +1 -1
  57. package/lib/locale/lang/zh-TC.js +1 -1
  58. package/lib/locale/lang/zh-TC.min.js +1 -1
  59. package/lib/locale/lang/zh-TC.umd.js +1 -1
  60. package/lib/locale/lang/zh-TW.min.js +1 -1
  61. package/lib/locale/lang/zh-TW.umd.js +1 -1
  62. package/lib/modal/src/modal.js +13 -6
  63. package/lib/modal/src/modal.min.js +1 -1
  64. package/lib/modal/style/style.css +22 -14
  65. package/lib/modal/style/style.min.css +1 -1
  66. package/lib/pager/style/style.css +4 -2
  67. package/lib/pager/style/style.min.css +1 -1
  68. package/lib/radio/src/radio.js +7 -5
  69. package/lib/radio/src/radio.min.js +1 -1
  70. package/lib/radio/style/style.css +32 -57
  71. package/lib/radio/style/style.min.css +1 -1
  72. package/lib/select/src/select.js +32 -3
  73. package/lib/select/src/select.min.js +1 -1
  74. package/lib/select/style/style.css +1 -0
  75. package/lib/select/style/style.min.css +1 -1
  76. package/lib/style.css +1 -1
  77. package/lib/style.min.css +1 -1
  78. package/lib/table/src/body.js +15 -7
  79. package/lib/table/src/body.min.js +1 -1
  80. package/lib/table/src/cell.js +13 -26
  81. package/lib/table/src/cell.min.js +1 -1
  82. package/lib/table/src/methods.js +281 -270
  83. package/lib/table/src/methods.min.js +1 -1
  84. package/lib/table/src/table.js +10 -2
  85. package/lib/table/src/table.min.js +1 -1
  86. package/lib/table/style/style.css +69 -146
  87. package/lib/table/style/style.min.css +1 -1
  88. package/lib/toolbar/src/toolbar.js +11 -15
  89. package/lib/toolbar/src/toolbar.min.js +1 -1
  90. package/lib/toolbar/style/style.css +24 -86
  91. package/lib/toolbar/style/style.min.css +1 -1
  92. package/lib/tools/log.js +1 -1
  93. package/lib/tools/log.min.js +1 -1
  94. package/lib/v-x-e-table/index.js +1 -1
  95. package/lib/v-x-e-table/index.min.js +1 -1
  96. package/lib/v-x-e-table/src/conf.js +43 -39
  97. package/lib/v-x-e-table/src/conf.min.js +1 -1
  98. package/lib/v-x-e-table/style/style.css +443 -484
  99. package/lib/v-x-e-table/style/style.min.css +1 -1
  100. package/package.json +4 -4
  101. package/packages/checkbox/src/checkbox.js +19 -5
  102. package/packages/checkbox/src/group.js +9 -0
  103. package/packages/edit/src/mixin.js +10 -10
  104. package/packages/export/src/export-panel.js +9 -19
  105. package/packages/filter/src/panel.js +9 -17
  106. package/packages/form/src/form.js +2 -2
  107. package/packages/icon/index.js +7 -4
  108. package/packages/icon/src/icon.js +20 -0
  109. package/packages/input/src/input.js +3 -3
  110. package/packages/list/src/list.js +1 -1
  111. package/packages/loading/src/loading.js +18 -9
  112. package/packages/locale/lang/en-US.js +1 -1
  113. package/packages/locale/lang/ja-JP.js +1 -1
  114. package/packages/locale/lang/zh-CN.js +1 -1
  115. package/packages/locale/lang/zh-TC.js +1 -1
  116. package/packages/modal/src/modal.js +30 -22
  117. package/packages/radio/src/radio.js +7 -3
  118. package/packages/select/src/select.js +25 -3
  119. package/packages/table/src/body.js +14 -7
  120. package/packages/table/src/cell.js +12 -33
  121. package/packages/table/src/methods.js +50 -42
  122. package/packages/table/src/table.js +10 -2
  123. package/packages/toolbar/src/toolbar.js +11 -19
  124. package/packages/v-x-e-table/src/conf.js +43 -38
  125. package/styles/base/checked.scss +44 -148
  126. package/styles/button.scss +5 -45
  127. package/styles/checkbox.scss +6 -65
  128. package/styles/export.scss +2 -38
  129. package/styles/filter.scss +3 -36
  130. package/styles/form.scss +0 -3
  131. package/styles/icon.scss +509 -616
  132. package/styles/input.scss +8 -0
  133. package/styles/loading.scss +2 -2
  134. package/styles/modal.scss +19 -17
  135. package/styles/old-icon.scss +713 -0
  136. package/styles/pager.scss +2 -0
  137. package/styles/radio.scss +9 -77
  138. package/styles/select.scss +1 -0
  139. package/styles/table.scss +17 -28
  140. package/styles/toolbar.scss +2 -26
  141. package/styles/variable.scss +11 -10
  142. package/types/table.d.ts +57 -18
@@ -127,6 +127,7 @@ export default {
127
127
  const footerSlot = $scopedSlots.footer || slots.footer
128
128
  const headerSlot = $scopedSlots.header || slots.header
129
129
  const titleSlot = $scopedSlots.title || slots.title
130
+ const cornerSlot = $scopedSlots.corner || slots.corner
130
131
  const headerOns = {}
131
132
  if (draggable) {
132
133
  headerOns.mousedown = this.mousedownEvent
@@ -170,27 +171,34 @@ export default {
170
171
  }],
171
172
  on: headerOns
172
173
  }, headerSlot ? (!inited || (destroyOnClose && !visible) ? [] : getSlotVNs(headerSlot.call(this, { $modal: this }, h))) : [
173
- titleSlot ? getSlotVNs(titleSlot.call(this, { $modal: this }, h)) : h('span', {
174
- class: 'vxe-modal--title'
175
- }, title ? getFuncText(title) : GlobalConfig.i18n('vxe.alert.title')),
176
- showZoom ? h('i', {
177
- class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? GlobalConfig.icon.MODAL_ZOOM_OUT : GlobalConfig.icon.MODAL_ZOOM_IN],
178
- attrs: {
179
- title: GlobalConfig.i18n(`vxe.modal.zoom${zoomLocat ? 'Out' : 'In'}`)
180
- },
181
- on: {
182
- click: this.toggleZoomEvent
183
- }
184
- }) : _e(),
185
- showClose ? h('i', {
186
- class: ['vxe-modal--close-btn', 'trigger--btn', GlobalConfig.icon.MODAL_CLOSE],
187
- attrs: {
188
- title: GlobalConfig.i18n('vxe.modal.close')
189
- },
190
- on: {
191
- click: this.closeEvent
192
- }
193
- }) : _e()
174
+ h('div', {
175
+ class: 'vxe-modal--header-title'
176
+ }, titleSlot ? getSlotVNs(titleSlot.call(this, { $modal: this }, h)) : (title ? getFuncText(title) : GlobalConfig.i18n('vxe.alert.title'))),
177
+ h('div', {
178
+ class: 'vxe-modal--header-right'
179
+ }, [
180
+ cornerSlot ? h('span', {
181
+ class: 'vxe-modal--corner-warpper'
182
+ }, getSlotVNs(cornerSlot({ $modal: this }))) : _e(),
183
+ showZoom ? h('i', {
184
+ class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? GlobalConfig.icon.MODAL_ZOOM_OUT : GlobalConfig.icon.MODAL_ZOOM_IN],
185
+ attrs: {
186
+ title: GlobalConfig.i18n(`vxe.modal.zoom${zoomLocat ? 'Out' : 'In'}`)
187
+ },
188
+ on: {
189
+ click: this.toggleZoomEvent
190
+ }
191
+ }) : _e(),
192
+ showClose ? h('i', {
193
+ class: ['vxe-modal--close-btn', 'trigger--btn', GlobalConfig.icon.MODAL_CLOSE],
194
+ attrs: {
195
+ title: GlobalConfig.i18n('vxe.modal.close')
196
+ },
197
+ on: {
198
+ click: this.closeEvent
199
+ }
200
+ }) : _e()
201
+ ])
194
202
  ]) : null,
195
203
  h('div', {
196
204
  class: 'vxe-modal--body'
@@ -211,7 +219,7 @@ export default {
211
219
  !isMsg ? h(VxeLoading, {
212
220
  class: 'vxe-modal--loading',
213
221
  props: {
214
- loading
222
+ value: loading
215
223
  }
216
224
  }) : null
217
225
  ]),
@@ -34,10 +34,13 @@ export default {
34
34
  isStrict () {
35
35
  const { $xeradiogroup } = this
36
36
  return $xeradiogroup ? $xeradiogroup.strict : this.strict
37
+ },
38
+ isChecked () {
39
+ return this.$xeradiogroup ? this.$xeradiogroup.value === this.label : this.value === this.label
37
40
  }
38
41
  },
39
42
  render (h) {
40
- const { $scopedSlots, $xeradiogroup, isDisabled, title, vSize, value, label, name, content } = this
43
+ const { $scopedSlots, $xeradiogroup, isDisabled, isChecked, title, vSize, name, content } = this
41
44
  const attrs = {}
42
45
  if (title) {
43
46
  attrs.title = title
@@ -45,6 +48,7 @@ export default {
45
48
  return h('label', {
46
49
  class: ['vxe-radio', {
47
50
  [`size--${vSize}`]: vSize,
51
+ 'is--checked': isChecked,
48
52
  'is--disabled': isDisabled
49
53
  }],
50
54
  attrs
@@ -57,7 +61,7 @@ export default {
57
61
  disabled: isDisabled
58
62
  },
59
63
  domProps: {
60
- checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
64
+ checked: isChecked
61
65
  },
62
66
  on: {
63
67
  change: this.changeEvent,
@@ -65,7 +69,7 @@ export default {
65
69
  }
66
70
  }),
67
71
  h('span', {
68
- class: 'vxe-radio--icon'
72
+ class: ['vxe-radio--icon', isChecked ? 'vxe-icon-radio-checked' : 'vxe-icon-radio-unchecked']
69
73
  }),
70
74
  h('span', {
71
75
  class: 'vxe-radio--label'
@@ -125,21 +125,35 @@ function getSelectLabel (_vm, value) {
125
125
  return XEUtils.toValueString(item ? item[_vm.labelField] : value)
126
126
  }
127
127
 
128
+ function checkOptionDisabled (_vm, isSelected, option, group) {
129
+ if (option.disabled) {
130
+ return true
131
+ }
132
+ if (group && group.disabled) {
133
+ return true
134
+ }
135
+ if (_vm.isMaximize && !isSelected) {
136
+ return true
137
+ }
138
+ return false
139
+ }
140
+
128
141
  export function renderOption (h, _vm, list, group) {
129
142
  const { isGroup, labelField, valueField, optionKey, value, multiple, currentValue, optionOpts } = _vm
130
143
  const { useKey } = optionOpts
131
144
  return list.map((option, cIndex) => {
132
145
  const { slots } = option
133
- const isVisible = !isGroup || isOptionVisible(option)
134
- const isDisabled = (group && group.disabled) || option.disabled
135
146
  const optionValue = option[valueField]
147
+ const isSelected = multiple ? (value && value.indexOf(optionValue) > -1) : value === optionValue
148
+ const isVisible = !isGroup || isOptionVisible(option)
149
+ const isDisabled = checkOptionDisabled(_vm, isSelected, option, group)
136
150
  const optid = getOptid(_vm, option)
137
151
  const defaultSlot = slots ? slots.default : null
138
152
  return isVisible ? h('div', {
139
153
  key: useKey || optionKey ? optid : cIndex,
140
154
  class: ['vxe-select-option', option.className, {
141
155
  'is--disabled': isDisabled,
142
- 'is--selected': multiple ? (value && value.indexOf(optionValue) > -1) : value === optionValue,
156
+ 'is--selected': isSelected,
143
157
  'is--hover': currentValue === optionValue
144
158
  }],
145
159
  attrs: {
@@ -240,6 +254,7 @@ export default {
240
254
  optionGroupProps: Object,
241
255
  optionConfig: Object,
242
256
  className: [String, Function],
257
+ max: [String, Number],
243
258
  size: { type: String, default: () => GlobalConfig.select.size || GlobalConfig.size },
244
259
  filterable: Boolean,
245
260
  filterMethod: Function,
@@ -336,6 +351,13 @@ export default {
336
351
  return getRemoteSelectLabel(this, value)
337
352
  }
338
353
  return getSelectLabel(this, value)
354
+ },
355
+ isMaximize () {
356
+ const { value, multiple, max } = this
357
+ if (multiple && max) {
358
+ return (value ? value.length : 0) >= XEUtils.toNumber(max)
359
+ }
360
+ return false
339
361
  }
340
362
  },
341
363
  watch: {
@@ -298,6 +298,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
298
298
  showOverflow: allColumnOverflow,
299
299
  treeConfig,
300
300
  treeOpts,
301
+ expandOpts,
301
302
  editOpts,
302
303
  treeExpandeds,
303
304
  scrollYLoad,
@@ -379,11 +380,13 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
379
380
  )
380
381
  // 如果行被展开了
381
382
  if (isExpandRow) {
382
- let cellStyle
383
+ const { height: expandHeight } = expandOpts
384
+ const cellStyle = {}
385
+ if (expandHeight) {
386
+ cellStyle.height = `${expandHeight}px`
387
+ }
383
388
  if (treeConfig) {
384
- cellStyle = {
385
- paddingLeft: `${(rowLevel * treeOpts.indent) + 30}px`
386
- }
389
+ cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
387
390
  }
388
391
  const { showOverflow } = expandColumn
389
392
  const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
@@ -396,16 +399,20 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
396
399
  on: trOn
397
400
  }, [
398
401
  h('td', {
399
- class: ['vxe-body--expanded-column', {
402
+ class: {
403
+ 'vxe-body--expanded-column': 1,
400
404
  'fixed--hidden': fixedType && !hasFixedColumn,
401
405
  'col--ellipsis': hasEllipsis
402
- }],
406
+ },
403
407
  attrs: {
404
408
  colspan: tableColumn.length
405
409
  }
406
410
  }, [
407
411
  h('div', {
408
- class: 'vxe-body--expanded-cell',
412
+ class: {
413
+ 'vxe-body--expanded-cell': 1,
414
+ 'is--ellipsis': expandHeight
415
+ },
409
416
  style: cellStyle
410
417
  }, [
411
418
  expandColumn.renderData(h, expandParams)
@@ -217,9 +217,9 @@ export const Cell = {
217
217
  return $table.callSlot(slots.icon, params, h, cellVNodes)
218
218
  }
219
219
  if (!isHidden) {
220
- isAceived = treeExpandeds.indexOf(row) > -1
220
+ isAceived = $table.findRowIndexOf(treeExpandeds, row) > -1
221
221
  if (lazy) {
222
- isLazyLoaded = treeLazyLoadeds.indexOf(row) > -1
222
+ isLazyLoaded = $table.findRowIndexOf(treeLazyLoadeds, row) > -1
223
223
  hasLazyChilds = row[hasChild]
224
224
  }
225
225
  }
@@ -321,10 +321,7 @@ export const Cell = {
321
321
  if (isVisible) {
322
322
  radioVNs.push(
323
323
  h('span', {
324
- class: 'vxe-radio--icon vxe-radio--checked-icon'
325
- }),
326
- h('span', {
327
- class: 'vxe-radio--icon vxe-radio--unchecked-icon'
324
+ class: ['vxe-radio--icon', isChecked ? GlobalConfig.icon.TABLE_RADIO_CHECKED : GlobalConfig.icon.TABLE_RADIO_UNCHECKED]
328
325
  })
329
326
  )
330
327
  }
@@ -394,13 +391,7 @@ export const Cell = {
394
391
  on
395
392
  }, [
396
393
  h('span', {
397
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
398
- }),
399
- h('span', {
400
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
401
- }),
402
- h('span', {
403
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
394
+ class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
404
395
  })
405
396
  ].concat(titleSlot || headerTitle ? [
406
397
  h('span', {
@@ -411,7 +402,7 @@ export const Cell = {
411
402
  },
412
403
  renderCheckboxCell (h, params) {
413
404
  const { $table, row, column, isHidden } = params
414
- const { treeConfig, treeIndeterminates } = $table
405
+ const { treeConfig, treeIndeterminates, selection } = $table
415
406
  const { labelField, checkMethod, visibleMethod } = $table.checkboxOpts
416
407
  const { slots } = column
417
408
  const defaultSlot = slots ? slots.default : null
@@ -422,7 +413,7 @@ export const Cell = {
422
413
  let isDisabled = !!checkMethod
423
414
  let on
424
415
  if (!isHidden) {
425
- isChecked = $table.selection.indexOf(row) > -1
416
+ isChecked = $table.findRowIndexOf(selection, row) > -1
426
417
  on = {
427
418
  click (evnt) {
428
419
  if (!isDisabled && isVisible) {
@@ -434,7 +425,7 @@ export const Cell = {
434
425
  isDisabled = !checkMethod({ row })
435
426
  }
436
427
  if (treeConfig) {
437
- indeterminate = treeIndeterminates.indexOf(row) > -1
428
+ indeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1
438
429
  }
439
430
  }
440
431
  const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
@@ -445,13 +436,7 @@ export const Cell = {
445
436
  if (isVisible) {
446
437
  checkVNs.push(
447
438
  h('span', {
448
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
449
- }),
450
- h('span', {
451
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
452
- }),
453
- h('span', {
454
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
439
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
455
440
  })
456
441
  )
457
442
  }
@@ -501,7 +486,7 @@ export const Cell = {
501
486
  isDisabled = !checkMethod({ row })
502
487
  }
503
488
  if (treeConfig) {
504
- indeterminate = treeIndeterminates.indexOf(row) > -1
489
+ indeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1
505
490
  }
506
491
  }
507
492
  const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
@@ -512,13 +497,7 @@ export const Cell = {
512
497
  if (isVisible) {
513
498
  checkVNs.push(
514
499
  h('span', {
515
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
516
- }),
517
- h('span', {
518
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
519
- }),
520
- h('span', {
521
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
500
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
522
501
  })
523
502
  )
524
503
  }
@@ -559,9 +538,9 @@ export const Cell = {
559
538
  return $table.callSlot(slots.icon, params, h)
560
539
  }
561
540
  if (!isHidden) {
562
- isAceived = rowExpandeds.indexOf(params.row) > -1
541
+ isAceived = $table.findRowIndexOf(rowExpandeds, params.row) > -1
563
542
  if (lazy) {
564
- isLazyLoaded = expandLazyLoadeds.indexOf(row) > -1
543
+ isLazyLoaded = $table.findRowIndexOf(expandLazyLoadeds, row) > -1
565
544
  }
566
545
  }
567
546
  return [
@@ -1125,9 +1125,9 @@ const Methods = {
1125
1125
  } else {
1126
1126
  const { selection } = this
1127
1127
  if (treeConfig) {
1128
- rowList = XEUtils.filterTree(currTableData, row => selection.indexOf(row) > -1, { children: transform ? mapChildren : children })
1128
+ rowList = XEUtils.filterTree(currTableData, row => this.findRowIndexOf(selection, row) > -1, { children: transform ? mapChildren : children })
1129
1129
  } else {
1130
- rowList = currTableData.filter(row => selection.indexOf(row) > -1)
1130
+ rowList = currTableData.filter(row => this.findRowIndexOf(selection, row) > -1)
1131
1131
  }
1132
1132
  }
1133
1133
  return rowList
@@ -2727,7 +2727,7 @@ const Methods = {
2727
2727
  getCheckboxIndeterminateRecords (isFull) {
2728
2728
  const { treeConfig, treeIndeterminates, afterFullData } = this
2729
2729
  if (treeConfig) {
2730
- return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(row => afterFullData.indexOf(row))
2730
+ return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(row => this.findRowIndexOf(afterFullData, row) > -1)
2731
2731
  }
2732
2732
  return []
2733
2733
  },
@@ -2762,14 +2762,16 @@ const Methods = {
2762
2762
  return this.$nextTick()
2763
2763
  },
2764
2764
  isCheckedByCheckboxRow (row) {
2765
+ const { selection } = this
2765
2766
  const { checkField } = this.checkboxOpts
2766
2767
  if (checkField) {
2767
2768
  return XEUtils.get(row, checkField)
2768
2769
  }
2769
- return this.selection.indexOf(row) > -1
2770
+ return this.findRowIndexOf(selection, row) > -1
2770
2771
  },
2771
2772
  isIndeterminateByCheckboxRow (row) {
2772
- return this.treeIndeterminates.indexOf(row) > -1 && !this.isCheckedByCheckboxRow(row)
2773
+ const { treeIndeterminates } = this
2774
+ return this.findRowIndexOf(treeIndeterminates, row) > -1 && !this.isCheckedByCheckboxRow(row)
2773
2775
  },
2774
2776
  /**
2775
2777
  * 多选,行选中事件
@@ -2781,31 +2783,31 @@ const Methods = {
2781
2783
  if (checkField) {
2782
2784
  if (treeConfig && !checkStrictly) {
2783
2785
  if (value === -1) {
2784
- if (treeIndeterminates.indexOf(row) === -1) {
2786
+ if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
2785
2787
  treeIndeterminates.push(row)
2786
2788
  }
2787
2789
  XEUtils.set(row, checkField, false)
2788
2790
  } else {
2789
2791
  // 更新子节点状态
2790
2792
  XEUtils.eachTree([row], (item) => {
2791
- if (row === item || (!checkMethod || checkMethod({ row: item }))) {
2793
+ if (this.eqRow(item, row) || (!checkMethod || checkMethod({ row: item }))) {
2792
2794
  XEUtils.set(item, checkField, value)
2793
- XEUtils.remove(treeIndeterminates, half => half === item)
2795
+ XEUtils.remove(treeIndeterminates, half => this.eqRow(half, item))
2794
2796
  this.handleCheckboxReserveRow(row, value)
2795
2797
  }
2796
2798
  }, treeOpts)
2797
2799
  }
2798
2800
  // 如果存在父节点,更新父节点状态
2799
- const matchObj = XEUtils.findTree(afterFullData, item => item === row, treeOpts)
2801
+ const matchObj = XEUtils.findTree(afterFullData, item => this.eqRow(item, row), treeOpts)
2800
2802
  if (matchObj && matchObj.parent) {
2801
2803
  let parentStatus
2802
2804
  const vItems = checkMethod ? matchObj.items.filter((item) => checkMethod({ row: item })) : matchObj.items
2803
- const indeterminatesItem = XEUtils.find(matchObj.items, item => treeIndeterminates.indexOf(item) > -1)
2805
+ const indeterminatesItem = XEUtils.find(matchObj.items, item => this.findRowIndexOf(treeIndeterminates, item) > -1)
2804
2806
  if (indeterminatesItem) {
2805
2807
  parentStatus = -1
2806
2808
  } else {
2807
2809
  const selectItems = matchObj.items.filter(item => XEUtils.get(item, checkField))
2808
- parentStatus = selectItems.filter(item => vItems.indexOf(item) > -1).length === vItems.length ? true : (selectItems.length || value === -1 ? -1 : false)
2810
+ parentStatus = selectItems.filter(item => this.findRowIndexOf(vItems, item) > -1).length === vItems.length ? true : (selectItems.length || value === -1 ? -1 : false)
2809
2811
  }
2810
2812
  return this.handleSelectRow({ row: matchObj.parent }, parentStatus)
2811
2813
  }
@@ -2818,46 +2820,46 @@ const Methods = {
2818
2820
  } else {
2819
2821
  if (treeConfig && !checkStrictly) {
2820
2822
  if (value === -1) {
2821
- if (treeIndeterminates.indexOf(row) === -1) {
2823
+ if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
2822
2824
  treeIndeterminates.push(row)
2823
2825
  }
2824
- XEUtils.remove(selection, item => item === row)
2826
+ XEUtils.remove(selection, item => this.eqRow(item, row))
2825
2827
  } else {
2826
2828
  // 更新子节点状态
2827
2829
  XEUtils.eachTree([row], (item) => {
2828
- if (row === item || (!checkMethod || checkMethod({ row: item }))) {
2830
+ if (this.eqRow(item, row) || (!checkMethod || checkMethod({ row: item }))) {
2829
2831
  if (value) {
2830
2832
  selection.push(item)
2831
2833
  } else {
2832
- XEUtils.remove(selection, select => select === item)
2834
+ XEUtils.remove(selection, select => this.eqRow(select, item))
2833
2835
  }
2834
- XEUtils.remove(treeIndeterminates, half => half === item)
2836
+ XEUtils.remove(treeIndeterminates, half => this.eqRow(half, item))
2835
2837
  this.handleCheckboxReserveRow(row, value)
2836
2838
  }
2837
2839
  }, treeOpts)
2838
2840
  }
2839
2841
  // 如果存在父节点,更新父节点状态
2840
- const matchObj = XEUtils.findTree(afterFullData, item => item === row, treeOpts)
2842
+ const matchObj = XEUtils.findTree(afterFullData, item => this.eqRow(item, row), treeOpts)
2841
2843
  if (matchObj && matchObj.parent) {
2842
2844
  let parentStatus
2843
2845
  const vItems = checkMethod ? matchObj.items.filter((item) => checkMethod({ row: item })) : matchObj.items
2844
- const indeterminatesItem = XEUtils.find(matchObj.items, item => treeIndeterminates.indexOf(item) > -1)
2846
+ const indeterminatesItem = XEUtils.find(matchObj.items, item => this.findRowIndexOf(treeIndeterminates, item) > -1)
2845
2847
  if (indeterminatesItem) {
2846
2848
  parentStatus = -1
2847
2849
  } else {
2848
- const selectItems = matchObj.items.filter(item => selection.indexOf(item) > -1)
2849
- parentStatus = selectItems.filter(item => vItems.indexOf(item) > -1).length === vItems.length ? true : (selectItems.length || value === -1 ? -1 : false)
2850
+ const selectItems = matchObj.items.filter(item => this.findRowIndexOf(selection, item) > -1)
2851
+ parentStatus = selectItems.filter(item => this.findRowIndexOf(vItems, item) > -1).length === vItems.length ? true : (selectItems.length || value === -1 ? -1 : false)
2850
2852
  }
2851
2853
  return this.handleSelectRow({ row: matchObj.parent }, parentStatus)
2852
2854
  }
2853
2855
  } else {
2854
2856
  if (!checkMethod || checkMethod({ row })) {
2855
2857
  if (value) {
2856
- if (selection.indexOf(row) === -1) {
2858
+ if (this.findRowIndexOf(selection, row) === -1) {
2857
2859
  selection.push(row)
2858
2860
  }
2859
2861
  } else {
2860
- XEUtils.remove(selection, item => item === row)
2862
+ XEUtils.remove(selection, item => this.eqRow(item, row))
2861
2863
  }
2862
2864
  this.handleCheckboxReserveRow(row, value)
2863
2865
  }
@@ -2869,7 +2871,7 @@ const Methods = {
2869
2871
  const { selection, checkboxOpts } = this
2870
2872
  const { checkField } = checkboxOpts
2871
2873
  const { row } = params
2872
- const value = checkField ? !XEUtils.get(row, checkField) : selection.indexOf(row) === -1
2874
+ const value = checkField ? !XEUtils.get(row, checkField) : this.findRowIndexOf(selection, row) === -1
2873
2875
  if (evnt) {
2874
2876
  this.triggerCheckRowEvent(evnt, params, value)
2875
2877
  } else {
@@ -2880,7 +2882,12 @@ const Methods = {
2880
2882
  const { checkMethod } = this.checkboxOpts
2881
2883
  if (!checkMethod || checkMethod({ row: params.row })) {
2882
2884
  this.handleSelectRow(params, value)
2883
- this.emitEvent('checkbox-change', Object.assign({ records: this.getCheckboxRecords(), reserves: this.getCheckboxReserveRecords(), indeterminates: this.getCheckboxIndeterminateRecords(), checked: value }, params), evnt)
2885
+ this.emitEvent('checkbox-change', Object.assign({
2886
+ records: this.getCheckboxRecords(),
2887
+ reserves: this.getCheckboxReserveRecords(),
2888
+ indeterminates: this.getCheckboxIndeterminateRecords(),
2889
+ checked: value
2890
+ }, params), evnt)
2884
2891
  }
2885
2892
  },
2886
2893
  /**
@@ -2898,7 +2905,7 @@ const Methods = {
2898
2905
  const { afterFullData, treeConfig, treeOpts, selection, checkboxReserveRowMap, checkboxOpts } = this
2899
2906
  const { checkField, reserve, checkStrictly, checkMethod } = checkboxOpts
2900
2907
  let selectRows = []
2901
- const beforeSelection = treeConfig ? [] : selection.filter(row => afterFullData.indexOf(row) === -1)
2908
+ const beforeSelection = treeConfig ? [] : selection.filter(row => this.findRowIndexOf(afterFullData, row) === -1)
2902
2909
  if (checkStrictly) {
2903
2910
  this.isAllSelected = value
2904
2911
  } else {
@@ -2945,7 +2952,7 @@ const Methods = {
2945
2952
  */
2946
2953
  if (checkMethod) {
2947
2954
  XEUtils.eachTree(afterFullData, (row) => {
2948
- if (checkMethod({ row }) ? 0 : selection.indexOf(row) > -1) {
2955
+ if (checkMethod({ row }) ? 0 : this.findRowIndexOf(selection, row) > -1) {
2949
2956
  selectRows.push(row)
2950
2957
  }
2951
2958
  }, treeOpts)
@@ -2959,7 +2966,7 @@ const Methods = {
2959
2966
  * 如果不存在选中方法,则添加所有数据到临时集合中
2960
2967
  */
2961
2968
  if (checkMethod) {
2962
- selectRows = afterFullData.filter((row) => selection.indexOf(row) > -1 || checkMethod({ row }))
2969
+ selectRows = afterFullData.filter((row) => this.findRowIndexOf(selection, row) > -1 || checkMethod({ row }))
2963
2970
  } else {
2964
2971
  selectRows = afterFullData.slice(0)
2965
2972
  }
@@ -2970,7 +2977,7 @@ const Methods = {
2970
2977
  * 如果不存在选中方法,无需处理,临时集合默认为空
2971
2978
  */
2972
2979
  if (checkMethod) {
2973
- selectRows = afterFullData.filter((row) => checkMethod({ row }) ? 0 : selection.indexOf(row) > -1)
2980
+ selectRows = afterFullData.filter((row) => checkMethod({ row }) ? 0 : this.findRowIndexOf(selection, row) > -1)
2974
2981
  }
2975
2982
  }
2976
2983
  }
@@ -3017,9 +3024,9 @@ const Methods = {
3017
3024
  isAllSelected = isAllResolve && afterFullData.length !== disableRows.length
3018
3025
  if (treeConfig) {
3019
3026
  if (halfField) {
3020
- isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || XEUtils.get(row, halfField) || treeIndeterminates.indexOf(row) > -1)
3027
+ isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || XEUtils.get(row, halfField) || this.findRowIndexOf(treeIndeterminates, row) > -1)
3021
3028
  } else {
3022
- isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || treeIndeterminates.indexOf(row) > -1)
3029
+ isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || this.findRowIndexOf(treeIndeterminates, row) > -1)
3023
3030
  }
3024
3031
  } else {
3025
3032
  if (halfField) {
@@ -3036,19 +3043,19 @@ const Methods = {
3036
3043
  disableRows.push(row)
3037
3044
  return true
3038
3045
  }
3039
- if (selection.indexOf(row) > -1) {
3046
+ if (this.findRowIndexOf(selection, row) > -1) {
3040
3047
  checkRows.push(row)
3041
3048
  return true
3042
3049
  }
3043
3050
  return false
3044
3051
  }
3045
- : row => selection.indexOf(row) > -1
3052
+ : row => this.findRowIndexOf(selection, row) > -1
3046
3053
  )
3047
3054
  isAllSelected = isAllResolve && afterFullData.length !== disableRows.length
3048
3055
  if (treeConfig) {
3049
- isIndeterminate = !isAllSelected && afterFullData.some(row => treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1)
3056
+ isIndeterminate = !isAllSelected && afterFullData.some(row => this.findRowIndexOf(treeIndeterminates, row) > -1 || this.findRowIndexOf(selection, row) > -1)
3050
3057
  } else {
3051
- isIndeterminate = !isAllSelected && afterFullData.some(row => selection.indexOf(row) > -1)
3058
+ isIndeterminate = !isAllSelected && afterFullData.some(row => this.findRowIndexOf(selection, row) > -1)
3052
3059
  }
3053
3060
  }
3054
3061
  this.isAllSelected = isAllSelected
@@ -3695,7 +3702,7 @@ const Methods = {
3695
3702
  const rest = fullAllDataRowMap.get(row)
3696
3703
  if (lazy && rest) {
3697
3704
  rest.expandLoaded = false
3698
- XEUtils.remove(expandLazyLoadeds, item => row === item)
3705
+ XEUtils.remove(expandLazyLoadeds, item => this.eqRow(item, row))
3699
3706
  }
3700
3707
  return this.$nextTick()
3701
3708
  },
@@ -3706,7 +3713,7 @@ const Methods = {
3706
3713
  reloadRowExpand (row) {
3707
3714
  const { expandOpts, expandLazyLoadeds } = this
3708
3715
  const { lazy } = expandOpts
3709
- if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
3716
+ if (lazy && this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
3710
3717
  this.clearRowExpandLoaded(row)
3711
3718
  .then(() => this.handleAsyncRowExpand(row))
3712
3719
  }
@@ -3726,7 +3733,7 @@ const Methods = {
3726
3733
  const { expandOpts, expandLazyLoadeds, expandColumn: column } = this
3727
3734
  const { row } = params
3728
3735
  const { lazy } = expandOpts
3729
- if (!lazy || expandLazyLoadeds.indexOf(row) === -1) {
3736
+ if (!lazy || this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
3730
3737
  const expanded = !this.isExpandByRow(row)
3731
3738
  const columnIndex = this.getColumnIndex(column)
3732
3739
  const $columnIndex = this.getVMColumnIndex(column)
@@ -3775,7 +3782,7 @@ const Methods = {
3775
3782
  }).catch(() => {
3776
3783
  rest.expandLoaded = false
3777
3784
  }).finally(() => {
3778
- XEUtils.remove(this.expandLazyLoadeds, item => item === row)
3785
+ XEUtils.remove(this.expandLazyLoadeds, item => this.eqRow(item, row))
3779
3786
  resolve(this.$nextTick().then(this.recalculate))
3780
3787
  })
3781
3788
  })
@@ -3806,9 +3813,9 @@ const Methods = {
3806
3813
  const validRows = toggleMethod ? rows.filter(row => toggleMethod({ expanded, column, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows
3807
3814
  if (expanded) {
3808
3815
  validRows.forEach(row => {
3809
- if (rowExpandeds.indexOf(row) === -1) {
3816
+ if (this.findRowIndexOf(rowExpandeds, row) === -1) {
3810
3817
  const rest = fullAllDataRowMap.get(row)
3811
- const isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1
3818
+ const isLoad = lazy && !rest.expandLoaded && this.findRowIndexOf(expandLazyLoadeds, row) === -1
3812
3819
  if (isLoad) {
3813
3820
  lazyRests.push(this.handleAsyncRowExpand(row))
3814
3821
  } else {
@@ -3817,7 +3824,7 @@ const Methods = {
3817
3824
  }
3818
3825
  })
3819
3826
  } else {
3820
- XEUtils.remove(rowExpandeds, row => validRows.indexOf(row) > -1)
3827
+ XEUtils.remove(rowExpandeds, row => this.findRowIndexOf(validRows, row) > -1)
3821
3828
  }
3822
3829
  if (reserve) {
3823
3830
  validRows.forEach(row => this.handleRowExpandReserve(row, expanded))
@@ -3831,7 +3838,8 @@ const Methods = {
3831
3838
  * @param {Row} row 行对象
3832
3839
  */
3833
3840
  isExpandByRow (row) {
3834
- return this.rowExpandeds.indexOf(row) > -1
3841
+ const { rowExpandeds } = this
3842
+ return this.findRowIndexOf(rowExpandeds, row) > -1
3835
3843
  },
3836
3844
  /**
3837
3845
  * 手动清空展开行状态,数据会恢复成未展开的状态