vxe-table 3.4.12-beta.0 → 3.4.13

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 (49) hide show
  1. package/README.en.md +3 -1
  2. package/README.md +3 -1
  3. package/README.zh-TW.md +3 -1
  4. package/lib/edit/src/mixin.js +39 -13
  5. package/lib/edit/src/mixin.min.js +1 -1
  6. package/lib/export/src/mixin.js +15 -10
  7. package/lib/export/src/mixin.min.js +1 -1
  8. package/lib/footer/src/footer.js +11 -0
  9. package/lib/footer/src/footer.min.js +1 -1
  10. package/lib/form/src/form.js +2 -1
  11. package/lib/form/src/form.min.js +1 -1
  12. package/lib/grid/src/grid.js +5 -2
  13. package/lib/grid/src/grid.min.js +1 -1
  14. package/lib/header/src/header.js +12 -0
  15. package/lib/header/src/header.min.js +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.umd.js +229 -78
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/input/src/input.js +62 -39
  20. package/lib/input/src/input.min.js +1 -1
  21. package/lib/modal/src/modal.js +1 -1
  22. package/lib/modal/src/modal.min.js +1 -1
  23. package/lib/pulldown/src/pulldown.js +13 -0
  24. package/lib/pulldown/src/pulldown.min.js +1 -1
  25. package/lib/style.css +1 -1
  26. package/lib/style.min.css +1 -1
  27. package/lib/table/src/body.js +24 -5
  28. package/lib/table/src/body.min.js +1 -1
  29. package/lib/table/src/methods.js +48 -9
  30. package/lib/table/src/methods.min.js +1 -1
  31. package/lib/tools/src/utils.js +1 -0
  32. package/lib/tools/src/utils.min.js +1 -1
  33. package/package.json +4 -4
  34. package/packages/edit/src/mixin.js +20 -11
  35. package/packages/export/src/mixin.js +16 -9
  36. package/packages/footer/src/footer.js +10 -0
  37. package/packages/form/src/form.js +2 -1
  38. package/packages/grid/src/grid.js +3 -2
  39. package/packages/header/src/header.js +11 -0
  40. package/packages/input/src/input.js +46 -34
  41. package/packages/modal/src/modal.js +1 -1
  42. package/packages/pulldown/src/pulldown.js +12 -0
  43. package/packages/table/src/body.js +41 -7
  44. package/packages/table/src/methods.js +28 -9
  45. package/packages/tools/src/utils.js +1 -0
  46. package/styles/button.scss +4 -4
  47. package/styles/modal.scss +14 -13
  48. package/styles/table.scss +4 -4
  49. package/styles/variable.scss +8 -0
@@ -40,11 +40,18 @@ function hasTreeChildren ($xetable, row) {
40
40
  return row[treeOpts.children] && row[treeOpts.children].length > 0
41
41
  }
42
42
 
43
- function getSeq ($xetable, row, rowIndex, column, columnIndex) {
43
+ function getSeq ($xetable, row, $rowIndex, column, $columnIndex) {
44
44
  const seqOpts = $xetable.seqOpts
45
45
  const seqMethod = seqOpts.seqMethod || column.seqMethod
46
46
  if (seqMethod) {
47
- return seqMethod({ row, rowIndex, column, columnIndex })
47
+ return seqMethod({
48
+ row,
49
+ rowIndex: $xetable.getRowIndex(row),
50
+ $rowIndex,
51
+ column,
52
+ columnIndex: $xetable.getColumnIndex(column),
53
+ $columnIndex
54
+ })
48
55
  }
49
56
  return $xetable.getRowSeq(row)
50
57
  }
@@ -68,7 +75,7 @@ function toBooleanValue (cellValue) {
68
75
  }
69
76
 
70
77
  function getLabelData ($xetable, opts, columns, datas) {
71
- const { isAllExpand } = opts
78
+ const { isAllExpand, mode } = opts
72
79
  const { treeConfig, treeOpts, radioOpts, checkboxOpts } = $xetable
73
80
  if (!htmlCellElem) {
74
81
  htmlCellElem = document.createElement('div')
@@ -77,7 +84,7 @@ function getLabelData ($xetable, opts, columns, datas) {
77
84
  // 如果是树表格只允许导出数据源
78
85
  const rest = []
79
86
  const expandMaps = new Map()
80
- XEUtils.eachTree(datas, (item, rowIndex, items, path, parent, nodes) => {
87
+ XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
81
88
  const row = item._row || item
82
89
  const parentRow = parent && parent._row ? parent._row : parent
83
90
  if ((isAllExpand || !parentRow || (expandMaps.has(parentRow) && $xetable.isTreeExpandByRow(parentRow)))) {
@@ -88,7 +95,7 @@ function getLabelData ($xetable, opts, columns, datas) {
88
95
  _hasChild: hasRowChild,
89
96
  _expand: hasRowChild && $xetable.isTreeExpandByRow(row)
90
97
  }
91
- columns.forEach((column, columnIndex) => {
98
+ columns.forEach((column, $columnIndex) => {
92
99
  let cellValue = ''
93
100
  const renderOpts = column.editRender || column.cellRender
94
101
  let exportLabelMethod = column.exportMethod
@@ -103,7 +110,7 @@ function getLabelData ($xetable, opts, columns, datas) {
103
110
  } else {
104
111
  switch (column.type) {
105
112
  case 'seq':
106
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex)
113
+ cellValue = mode === 'all' ? path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('') : getSeq($xetable, row, $rowIndex, column, $columnIndex)
107
114
  break
108
115
  case 'checkbox':
109
116
  cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row))
@@ -140,11 +147,11 @@ function getLabelData ($xetable, opts, columns, datas) {
140
147
  }, treeOpts)
141
148
  return rest
142
149
  }
143
- return datas.map((row, rowIndex) => {
150
+ return datas.map((row, $rowIndex) => {
144
151
  const item = {
145
152
  _row: row
146
153
  }
147
- columns.forEach((column, columnIndex) => {
154
+ columns.forEach((column, $columnIndex) => {
148
155
  let cellValue = ''
149
156
  const renderOpts = column.editRender || column.cellRender
150
157
  let exportLabelMethod = column.exportMethod
@@ -159,7 +166,7 @@ function getLabelData ($xetable, opts, columns, datas) {
159
166
  } else {
160
167
  switch (column.type) {
161
168
  case 'seq':
162
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex)
169
+ cellValue = mode === 'all' ? $rowIndex + 1 : getSeq($xetable, row, $rowIndex, column, $columnIndex)
163
170
  break
164
171
  case 'checkbox':
165
172
  cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row))
@@ -36,6 +36,16 @@ export default {
36
36
  elemStore[`${prefix}list`] = $refs.tfoot
37
37
  elemStore[`${prefix}xSpace`] = $refs.xSpace
38
38
  },
39
+ destroyed () {
40
+ const { $parent: $xetable, fixedType } = this
41
+ const { elemStore } = $xetable
42
+ const prefix = `${fixedType || 'main'}-footer-`
43
+ elemStore[`${prefix}wrapper`] = null
44
+ elemStore[`${prefix}table`] = null
45
+ elemStore[`${prefix}colgroup`] = null
46
+ elemStore[`${prefix}list`] = null
47
+ elemStore[`${prefix}xSpace`] = null
48
+ },
39
49
  render (h) {
40
50
  let { _e, $parent: $xetable, fixedType, fixedColumn, tableColumn, footerTableData } = this
41
51
  const {
@@ -340,6 +340,7 @@ export default {
340
340
  submitEvent (evnt) {
341
341
  evnt.preventDefault()
342
342
  if (!this.preventSubmit) {
343
+ this.clearValidate()
343
344
  this.beginValidate(this.getItems()).then(() => {
344
345
  this.$emit('submit', { data: this.data, $form: this, $event: evnt })
345
346
  }).catch(errMap => {
@@ -442,6 +443,7 @@ export default {
442
443
  return this.$nextTick()
443
444
  },
444
445
  validate (callback) {
446
+ this.clearValidate()
445
447
  return this.beginValidate(this.getItems(), '', callback)
446
448
  },
447
449
  validateField (field, callback) {
@@ -452,7 +454,6 @@ export default {
452
454
  const validRest = {}
453
455
  const validFields = []
454
456
  const itemValids = []
455
- this.clearValidate()
456
457
  clearTimeout(this.showErrTime)
457
458
  if (data && formRules) {
458
459
  itemList.forEach(item => {
@@ -253,7 +253,7 @@ export default {
253
253
  created () {
254
254
  const { data, formOpts, proxyOpts, proxyConfig } = this
255
255
  if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
256
- console.error('[vxe-grid] There is a conflict between the props proxy-config and data.')
256
+ UtilTools.error('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
257
257
  }
258
258
 
259
259
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
@@ -401,7 +401,7 @@ export default {
401
401
  handleActiveMethod (params) {
402
402
  const { editConfig } = this
403
403
  const activeMethod = editConfig ? editConfig.activeMethod : null
404
- return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params))
404
+ return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod({ ...params, $grid: this }))
405
405
  },
406
406
  initToolbar () {
407
407
  this.$nextTick(() => {
@@ -531,6 +531,7 @@ export default {
531
531
  }
532
532
  sortList = defaultSort.map((item) => {
533
533
  return {
534
+ field: item.field,
534
535
  property: item.field,
535
536
  order: item.order
536
537
  }
@@ -39,6 +39,17 @@ export default {
39
39
  elemStore[`${prefix}xSpace`] = $refs.xSpace
40
40
  elemStore[`${prefix}repair`] = $refs.repair
41
41
  },
42
+ destroyed () {
43
+ const { $parent: $xetable, fixedType } = this
44
+ const { elemStore } = $xetable
45
+ const prefix = `${fixedType || 'main'}-header-`
46
+ elemStore[`${prefix}wrapper`] = null
47
+ elemStore[`${prefix}table`] = null
48
+ elemStore[`${prefix}colgroup`] = null
49
+ elemStore[`${prefix}list`] = null
50
+ elemStore[`${prefix}xSpace`] = null
51
+ elemStore[`${prefix}repair`] = null
52
+ },
42
53
  render (h) {
43
54
  const { _e, $parent: $xetable, fixedType, headerColumn, fixedColumn } = this
44
55
  const { $listeners: tableListeners, tId, isGroup, resizable, border, columnKey, headerRowClassName, headerCellClassName, headerRowStyle, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, highlightCurrentColumn, currentColumn, scrollXLoad, overflowX, scrollbarWidth, sortOpts, mouseConfig, columnOpts } = $xetable
@@ -756,15 +756,10 @@ export default {
756
756
  return this.maxDate ? XEUtils.toStringDate(this.maxDate) : null
757
757
  },
758
758
  dateValue () {
759
- const { value, isDatePickerType, type, dateValueFormat } = this
759
+ const { value, isDatePickerType, dateValueFormat } = this
760
760
  let val = null
761
761
  if (value && isDatePickerType) {
762
- let date
763
- if (type === 'time') {
764
- date = toStringTimeDate(value)
765
- } else {
766
- date = XEUtils.toStringDate(value, dateValueFormat)
767
- }
762
+ const date = this.parseDate(value, dateValueFormat)
768
763
  if (XEUtils.isValidDate(date)) {
769
764
  val = date
770
765
  }
@@ -812,11 +807,14 @@ export default {
812
807
  }
813
808
  return ''
814
809
  },
810
+ firstDayOfWeek () {
811
+ const { startDay, startWeek } = this
812
+ return XEUtils.toNumber(XEUtils.isNumber(startDay) || XEUtils.isString(startDay) ? startDay : startWeek)
813
+ },
815
814
  weekDatas () {
816
815
  const weeks = []
817
816
  if (this.isDatePickerType) {
818
- const { startDay, startWeek } = this
819
- let sWeek = XEUtils.toNumber(XEUtils.isNumber(startDay) || XEUtils.isString(startDay) ? startDay : startWeek)
817
+ let { firstDayOfWeek: sWeek } = this
820
818
  weeks.push(sWeek)
821
819
  for (let index = 0; index < 6; index++) {
822
820
  if (sWeek >= 6) {
@@ -957,7 +955,8 @@ export default {
957
955
  return XEUtils.chunk(this.dayList, 7)
958
956
  },
959
957
  weekDates () {
960
- return this.dayDatas.map(list => {
958
+ const { dayDatas, firstDayOfWeek } = this
959
+ return dayDatas.map(list => {
961
960
  const firstItem = list[0]
962
961
  const item = {
963
962
  date: firstItem.date,
@@ -966,7 +965,7 @@ export default {
966
965
  isCurrent: false,
967
966
  isNow: false,
968
967
  isNext: false,
969
- label: XEUtils.getYearWeek(firstItem.date)
968
+ label: XEUtils.getYearWeek(firstItem.date, firstDayOfWeek)
970
969
  }
971
970
  return [item].concat(list)
972
971
  })
@@ -1045,8 +1044,10 @@ export default {
1045
1044
  this.initValue()
1046
1045
  },
1047
1046
  dateLabelFormat () {
1048
- this.dateParseValue(this.datePanelValue)
1049
- this.inputValue = this.datePanelLabel
1047
+ if (this.isDatePickerType) {
1048
+ this.dateParseValue(this.datePanelValue)
1049
+ this.inputValue = this.datePanelLabel
1050
+ }
1050
1051
  }
1051
1052
  },
1052
1053
  created () {
@@ -1266,6 +1267,13 @@ export default {
1266
1267
  }
1267
1268
  this.$emit('clear', { $panel: $refs.panel, value, $event: evnt })
1268
1269
  },
1270
+ parseDate (value, format) {
1271
+ const { type } = this
1272
+ if (type === 'time') {
1273
+ return toStringTimeDate(value)
1274
+ }
1275
+ return XEUtils.toStringDate(value, format)
1276
+ },
1269
1277
  /**
1270
1278
  * 检查初始值
1271
1279
  */
@@ -1292,7 +1300,7 @@ export default {
1292
1300
  }
1293
1301
  },
1294
1302
  afterCheckValue () {
1295
- const { type, exponential, inpReadonly, inputValue, isDatePickerType, isNumType, datetimePanelValue, dateLabelFormat, min, max } = this
1303
+ const { type, exponential, inpReadonly, inputValue, isDatePickerType, isNumType, datetimePanelValue, dateLabelFormat, min, max, firstDayOfWeek } = this
1296
1304
  if (!inpReadonly) {
1297
1305
  if (isNumType) {
1298
1306
  if (inputValue) {
@@ -1315,12 +1323,7 @@ export default {
1315
1323
  if (type === 'week' || type === 'quarter') {
1316
1324
  // 周和季度选择器不支持解析,无需处理
1317
1325
  } else {
1318
- let inpDateVal
1319
- if (type === 'time') {
1320
- inpDateVal = toStringTimeDate(inputValue)
1321
- } else {
1322
- inpDateVal = XEUtils.toStringDate(inputValue, dateLabelFormat)
1323
- }
1326
+ let inpDateVal = this.parseDate(inputValue, dateLabelFormat)
1324
1327
  if (XEUtils.isValidDate(inpDateVal)) {
1325
1328
  if (type === 'time') {
1326
1329
  inpDateVal = toStringTimeDate(inpDateVal)
@@ -1340,7 +1343,7 @@ export default {
1340
1343
  } else {
1341
1344
  isChange = true
1342
1345
  }
1343
- this.inputValue = XEUtils.toDateString(inpDateVal, dateLabelFormat)
1346
+ this.inputValue = XEUtils.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek })
1344
1347
  if (isChange) {
1345
1348
  this.dateChange(inpDateVal)
1346
1349
  }
@@ -1650,18 +1653,27 @@ export default {
1650
1653
  }
1651
1654
  },
1652
1655
  dateParseValue (date) {
1653
- const { type, dateLabelFormat, valueFormat } = this
1656
+ const { type, dateLabelFormat, valueFormat, firstDayOfWeek } = this
1654
1657
  let dValue = null
1655
1658
  let dLabel = ''
1656
1659
  if (date) {
1657
- if (type === 'time') {
1658
- dValue = toStringTimeDate(date)
1659
- } else {
1660
- dValue = XEUtils.toStringDate(date, valueFormat)
1661
- }
1660
+ dValue = this.parseDate(date, valueFormat)
1662
1661
  }
1663
1662
  if (XEUtils.isValidDate(dValue)) {
1664
- dLabel = XEUtils.toDateString(dValue, dateLabelFormat)
1663
+ dLabel = XEUtils.toDateString(dValue, dateLabelFormat, { firstDay: firstDayOfWeek })
1664
+ // 由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年
1665
+ if (dateLabelFormat && type === 'week') {
1666
+ const firstWeekDate = XEUtils.getWhatWeek(dValue, 0, firstDayOfWeek, firstDayOfWeek)
1667
+ if (firstWeekDate.getFullYear() < dValue.getFullYear()) {
1668
+ const yyIndex = dateLabelFormat.indexOf('yyyy')
1669
+ if (yyIndex > -1) {
1670
+ const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4))
1671
+ if (yyNum && !isNaN(yyNum)) {
1672
+ dLabel = dLabel.replace(`${yyNum}`, `${yyNum - 1}`)
1673
+ }
1674
+ }
1675
+ }
1676
+ }
1665
1677
  } else {
1666
1678
  dValue = null
1667
1679
  }
@@ -1669,7 +1681,7 @@ export default {
1669
1681
  this.datePanelLabel = dLabel
1670
1682
  },
1671
1683
  dateOffsetEvent (evnt) {
1672
- const { isActivated, datePanelValue, datePanelType } = this
1684
+ const { isActivated, datePanelValue, datePanelType, firstDayOfWeek } = this
1673
1685
  if (isActivated) {
1674
1686
  evnt.preventDefault()
1675
1687
  const keyCode = evnt.keyCode
@@ -1718,11 +1730,11 @@ export default {
1718
1730
  if (isLeftArrow) {
1719
1731
  offsetDay = XEUtils.getWhatDay(offsetDay, -1)
1720
1732
  } else if (isUpArrow) {
1721
- offsetDay = XEUtils.getWhatWeek(offsetDay, -1)
1733
+ offsetDay = XEUtils.getWhatWeek(offsetDay, -1, firstDayOfWeek)
1722
1734
  } else if (isRightArrow) {
1723
1735
  offsetDay = XEUtils.getWhatDay(offsetDay, 1)
1724
1736
  } else if (isDwArrow) {
1725
- offsetDay = XEUtils.getWhatWeek(offsetDay, 1)
1737
+ offsetDay = XEUtils.getWhatWeek(offsetDay, 1, firstDayOfWeek)
1726
1738
  }
1727
1739
  this.dateMoveDay(offsetDay)
1728
1740
  }
@@ -1741,16 +1753,16 @@ export default {
1741
1753
  }
1742
1754
  },
1743
1755
  dateChange (date) {
1744
- const { value, datetimePanelValue, dateValueFormat } = this
1756
+ const { value, datetimePanelValue, dateValueFormat, firstDayOfWeek } = this
1745
1757
  if (this.type === 'week') {
1746
1758
  const sWeek = XEUtils.toNumber(this.selectDay)
1747
- date = XEUtils.getWhatWeek(date, 0, sWeek)
1759
+ date = XEUtils.getWhatWeek(date, 0, sWeek, firstDayOfWeek)
1748
1760
  } else if (this.hasTime) {
1749
1761
  date.setHours(datetimePanelValue.getHours())
1750
1762
  date.setMinutes(datetimePanelValue.getMinutes())
1751
1763
  date.setSeconds(datetimePanelValue.getSeconds())
1752
1764
  }
1753
- const inpVal = XEUtils.toDateString(date, dateValueFormat)
1765
+ const inpVal = XEUtils.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek })
1754
1766
  this.dateCheckMonth(date)
1755
1767
  if (!XEUtils.isEqual(value, inpVal)) {
1756
1768
  this.emitModel(inpVal, { type: 'update' })
@@ -459,7 +459,7 @@ export default {
459
459
  maximize () {
460
460
  return this.$nextTick().then(() => {
461
461
  if (!this.zoomLocat) {
462
- const marginSize = this.marginSize
462
+ const marginSize = Math.max(0, this.marginSize)
463
463
  const modalBoxElem = this.getBox()
464
464
  const { visibleHeight, visibleWidth } = DomTools.getDomNode()
465
465
  this.zoomLocat = {
@@ -6,6 +6,7 @@ export default {
6
6
  name: 'VxePulldown',
7
7
  mixins: [vSize],
8
8
  props: {
9
+ value: Boolean,
9
10
  disabled: Boolean,
10
11
  placement: String,
11
12
  size: { type: String, default: () => GlobalConfig.size },
@@ -24,6 +25,15 @@ export default {
24
25
  isActivated: false
25
26
  }
26
27
  },
28
+ watch: {
29
+ value (value) {
30
+ if (value) {
31
+ this.showPanel()
32
+ } else {
33
+ this.hidePanel()
34
+ }
35
+ }
36
+ },
27
37
  created () {
28
38
  GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent)
29
39
  GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent)
@@ -140,6 +150,7 @@ export default {
140
150
  this.animatVisible = true
141
151
  setTimeout(() => {
142
152
  this.visiblePanel = true
153
+ this.$emit('update:input', true)
143
154
  this.updatePlacement()
144
155
  setTimeout(() => {
145
156
  resolve(this.updatePlacement())
@@ -156,6 +167,7 @@ export default {
156
167
  */
157
168
  hidePanel () {
158
169
  this.visiblePanel = false
170
+ this.$emit('update:input', false)
159
171
  return new Promise(resolve => {
160
172
  if (this.animatVisible) {
161
173
  this.hidePanelTimeout = setTimeout(() => {
@@ -455,6 +455,18 @@ export default {
455
455
  this.$el._onscroll = null
456
456
  this.$el.onscroll = null
457
457
  },
458
+ destroyed () {
459
+ const { $parent: $xetable, fixedType } = this
460
+ const { elemStore } = $xetable
461
+ const prefix = `${fixedType || 'main'}-body-`
462
+ elemStore[`${prefix}wrapper`] = null
463
+ elemStore[`${prefix}table`] = null
464
+ elemStore[`${prefix}colgroup`] = null
465
+ elemStore[`${prefix}list`] = null
466
+ elemStore[`${prefix}xSpace`] = null
467
+ elemStore[`${prefix}ySpace`] = null
468
+ elemStore[`${prefix}emptyBlock`] = null
469
+ },
458
470
  render (h) {
459
471
  const { _e, $parent: $xetable, fixedColumn, fixedType } = this
460
472
  let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts } = $xetable
@@ -595,8 +607,8 @@ export default {
595
607
  const rightElem = rightBody ? rightBody.$el : null
596
608
  const bodyYElem = elemStore['main-body-ySpace']
597
609
  const bodyXElem = elemStore['main-body-xSpace']
598
- const bodyHeight = bodyYElem ? bodyYElem.clientHeight : 0
599
- const bodyWidth = bodyXElem ? bodyXElem.clientWidth : 0
610
+ const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
611
+ const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
600
612
  let scrollTop = scrollBodyElem.scrollTop
601
613
  const scrollLeft = bodyElem.scrollLeft
602
614
  const isRollX = scrollLeft !== lastScrollLeft
@@ -638,11 +650,22 @@ export default {
638
650
  if (isRollX && validTip && validTip.visible) {
639
651
  validTip.updatePlacement()
640
652
  }
641
- $xetable.emitEvent('scroll', { type: renderType, fixed: fixedType, scrollTop, scrollLeft, bodyHeight, bodyWidth, isX: isRollX, isY: isRollY }, evnt)
653
+ $xetable.emitEvent('scroll', {
654
+ type: renderType,
655
+ fixed: fixedType,
656
+ scrollTop,
657
+ scrollLeft,
658
+ scrollHeight: bodyElem.scrollHeight,
659
+ scrollWidth: bodyElem.scrollWidth,
660
+ bodyHeight,
661
+ bodyWidth,
662
+ isX: isRollX,
663
+ isY: isRollY
664
+ }, evnt)
642
665
  },
643
666
  handleWheel (evnt, isTopWheel, deltaTop, isRollX, isRollY) {
644
667
  const { $parent: $xetable } = this
645
- const { $refs, elemStore } = $xetable
668
+ const { $refs, elemStore, scrollYLoad, scrollXLoad } = $xetable
646
669
  const { tableBody, leftBody, rightBody } = $refs
647
670
  const bodyElem = tableBody.$el
648
671
  const leftElem = leftBody ? leftBody.$el : null
@@ -650,8 +673,8 @@ export default {
650
673
  const remainSize = this.isPrevWheelTop === isTopWheel ? Math.max(0, this.wheelYSize - this.wheelYTotal) : 0
651
674
  const bodyYElem = elemStore['main-body-ySpace']
652
675
  const bodyXElem = elemStore['main-body-xSpace']
653
- const bodyHeight = bodyYElem ? bodyYElem.clientHeight : 0
654
- const bodyWidth = bodyXElem ? bodyXElem.clientWidth : 0
676
+ const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
677
+ const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
655
678
  this.isPrevWheelTop = isTopWheel
656
679
  this.wheelYSize = Math.abs(isTopWheel ? deltaTop - remainSize : deltaTop + remainSize)
657
680
  this.wheelYInterval = 0
@@ -679,7 +702,18 @@ export default {
679
702
  }
680
703
  this.wheelYTotal = wheelYTotal
681
704
  this.wheelYInterval = wheelYInterval
682
- $xetable.emitEvent('scroll', { type: renderType, fixed: fixedType, scrollTop: bodyElem.scrollTop, scrollLeft: bodyElem.scrollLeft, bodyHeight, bodyWidth, isX: isRollX, isY: isRollY }, evnt)
705
+ $xetable.emitEvent('scroll', {
706
+ type: renderType,
707
+ fixed: fixedType,
708
+ scrollTop: bodyElem.scrollTop,
709
+ scrollLeft: bodyElem.scrollLeft,
710
+ scrollHeight: bodyElem.scrollHeight,
711
+ scrollWidth: bodyElem.scrollWidth,
712
+ bodyHeight,
713
+ bodyWidth,
714
+ isX: isRollX,
715
+ isY: isRollY
716
+ }, evnt)
683
717
  }
684
718
  }
685
719
  handleSmooth()
@@ -1083,20 +1083,21 @@ const Methods = {
1083
1083
  * 用于多选行,获取已选中的数据
1084
1084
  */
1085
1085
  getCheckboxRecords (isFull) {
1086
- const { tableFullData, afterFullData, treeConfig, treeOpts, checkboxOpts } = this
1086
+ const { tableFullData, afterFullData, treeConfig, treeOpts, checkboxOpts, tableFullTreeData, afterTreeFullData } = this
1087
+ const { transform, children, mapChildren } = treeOpts
1087
1088
  const { checkField: property } = checkboxOpts
1088
- const currTableData = isFull ? tableFullData : afterFullData
1089
+ const currTableData = isFull ? (transform ? tableFullTreeData : tableFullData) : (transform ? afterTreeFullData : afterFullData)
1089
1090
  let rowList = []
1090
1091
  if (property) {
1091
1092
  if (treeConfig) {
1092
- rowList = XEUtils.filterTree(currTableData, row => XEUtils.get(row, property), treeOpts)
1093
+ rowList = XEUtils.filterTree(currTableData, row => XEUtils.get(row, property), { children: transform ? mapChildren : children })
1093
1094
  } else {
1094
1095
  rowList = currTableData.filter(row => XEUtils.get(row, property))
1095
1096
  }
1096
1097
  } else {
1097
1098
  const { selection } = this
1098
1099
  if (treeConfig) {
1099
- rowList = XEUtils.filterTree(currTableData, row => selection.indexOf(row) > -1, treeOpts)
1100
+ rowList = XEUtils.filterTree(currTableData, row => selection.indexOf(row) > -1, { children: transform ? mapChildren : children })
1100
1101
  } else {
1101
1102
  rowList = currTableData.filter(row => selection.indexOf(row) > -1)
1102
1103
  }
@@ -1138,7 +1139,7 @@ const Methods = {
1138
1139
  const filterColumns = []
1139
1140
  const orderColumns = []
1140
1141
  tableFullColumn.forEach(column => {
1141
- const { sortable, order, filters } = column
1142
+ const { property, sortable, order, filters } = column
1142
1143
  if (!allRemoteFilter && filters && filters.length) {
1143
1144
  const valueList = []
1144
1145
  const itemList = []
@@ -1153,7 +1154,7 @@ const Methods = {
1153
1154
  }
1154
1155
  }
1155
1156
  if (!allRemoteSort && sortable && order) {
1156
- orderColumns.push({ column, property: column.property, order })
1157
+ orderColumns.push({ column, field: column.property, property, order })
1157
1158
  }
1158
1159
  })
1159
1160
  if (filterColumns.length) {
@@ -1268,6 +1269,24 @@ const Methods = {
1268
1269
  })
1269
1270
  }
1270
1271
  },
1272
+ /**
1273
+ * 只对 tree-config 有效,获取行的父级
1274
+ */
1275
+ getParentRow (rowOrRowid) {
1276
+ const { treeConfig, fullDataRowIdData } = this
1277
+ if (rowOrRowid && treeConfig) {
1278
+ let rowid
1279
+ if (XEUtils.isString(rowOrRowid)) {
1280
+ rowid = rowOrRowid
1281
+ } else {
1282
+ rowid = getRowid(this, rowOrRowid)
1283
+ }
1284
+ if (rowid) {
1285
+ return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].parent : null
1286
+ }
1287
+ }
1288
+ return null
1289
+ },
1271
1290
  /**
1272
1291
  * 根据行的唯一主键获取行
1273
1292
  * @param {String/Number} rowid 行主键
@@ -2443,7 +2462,7 @@ const Methods = {
2443
2462
  // }
2444
2463
  // 如果是按下非功能键之外允许直接编辑
2445
2464
  if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
2446
- if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
2465
+ if (!editOpts.activeMethod || editOpts.activeMethod({ ...selected.args, $table: this })) {
2447
2466
  if (editMethod) {
2448
2467
  editMethod({
2449
2468
  row: selected.row,
@@ -3567,9 +3586,9 @@ const Methods = {
3567
3586
  getSortColumns () {
3568
3587
  const sortList = []
3569
3588
  this.tableFullColumn.forEach((column) => {
3570
- const { order } = column
3589
+ const { property, order } = column
3571
3590
  if ((column.sortable || column.remoteSort) && order) {
3572
- sortList.push({ column, property: column.property, order })
3591
+ sortList.push({ column, field: column.property, property, order })
3573
3592
  }
3574
3593
  })
3575
3594
  return sortList
@@ -57,6 +57,7 @@ class ColumnInfo {
57
57
  // 基本属性
58
58
  type: _vm.type,
59
59
  property: _vm.field,
60
+ field: _vm.field,
60
61
  title: _vm.title,
61
62
  width: _vm.width,
62
63
  minWidth: _vm.minWidth,
@@ -124,7 +124,7 @@ $btnThemeList: (
124
124
  line-height: 1;
125
125
  border: 1px solid $vxe-input-border-color;
126
126
  &.is--round {
127
- border-radius: $vxe-button-height-default * 0.5;
127
+ border-radius: $vxe-button-round-border-radius-default;
128
128
  }
129
129
  &:not(.is--round) {
130
130
  border-radius: $vxe-border-radius;
@@ -223,7 +223,7 @@ $btnThemeList: (
223
223
  min-width: $vxe-button-height-medium;
224
224
  }
225
225
  &.is--round {
226
- border-radius: $vxe-button-height-medium * 0.5;
226
+ border-radius: $vxe-button-round-border-radius-medium;
227
227
  }
228
228
  }
229
229
  .vxe-button--loading-icon,
@@ -239,7 +239,7 @@ $btnThemeList: (
239
239
  min-width: $vxe-button-height-small;
240
240
  }
241
241
  &.is--round {
242
- border-radius: $vxe-button-height-small * 0.5;
242
+ border-radius: $vxe-button-round-border-radius-small;
243
243
  }
244
244
  }
245
245
  .vxe-button--loading-icon,
@@ -255,7 +255,7 @@ $btnThemeList: (
255
255
  min-width: $vxe-button-height-mini;
256
256
  }
257
257
  &.is--round {
258
- border-radius: $vxe-button-height-mini * 0.5;
258
+ border-radius: $vxe-button-round-border-radius-mini;
259
259
  }
260
260
  }
261
261
  .vxe-button--loading-icon,