vxe-table 3.14.0-beta.2 → 3.14.0-beta.21

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 (165) hide show
  1. package/es/grid/src/grid.js +78 -48
  2. package/es/locale/lang/ar-EG.js +7 -1
  3. package/es/locale/lang/de-DE.js +7 -1
  4. package/es/locale/lang/en-US.js +7 -1
  5. package/es/locale/lang/es-ES.js +7 -1
  6. package/es/locale/lang/fr-FR.js +7 -1
  7. package/es/locale/lang/hu-HU.js +7 -1
  8. package/es/locale/lang/hy-AM.js +7 -1
  9. package/es/locale/lang/id-ID.js +7 -1
  10. package/es/locale/lang/it-IT.js +7 -1
  11. package/es/locale/lang/ja-JP.js +7 -1
  12. package/es/locale/lang/ko-KR.js +7 -1
  13. package/es/locale/lang/nb-NO.js +7 -1
  14. package/es/locale/lang/pt-BR.js +7 -1
  15. package/es/locale/lang/ru-RU.js +7 -1
  16. package/es/locale/lang/th-TH.js +7 -1
  17. package/es/locale/lang/ug-CN.js +7 -1
  18. package/es/locale/lang/uk-UA.js +7 -1
  19. package/es/locale/lang/vi-VN.js +7 -1
  20. package/es/locale/lang/zh-CHT.js +7 -1
  21. package/es/locale/lang/zh-CN.js +7 -1
  22. package/es/style.css +1 -1
  23. package/es/table/module/edit/mixin.js +14 -9
  24. package/es/table/module/filter/panel.js +12 -2
  25. package/es/table/module/keyboard/mixin.js +86 -21
  26. package/es/table/module/validator/mixin.js +2 -2
  27. package/es/table/render/index.js +90 -59
  28. package/es/table/src/body.js +22 -17
  29. package/es/table/src/cell.js +25 -20
  30. package/es/table/src/footer.js +9 -4
  31. package/es/table/src/header.js +2 -2
  32. package/es/table/src/methods.js +942 -678
  33. package/es/table/src/props.js +4 -0
  34. package/es/table/src/table.js +74 -32
  35. package/es/table/src/util.js +65 -7
  36. package/es/ui/index.js +1 -1
  37. package/es/ui/src/log.js +1 -1
  38. package/helper/vetur/attributes.json +1 -1
  39. package/helper/vetur/tags.json +1 -1
  40. package/lib/grid/src/grid.js +85 -65
  41. package/lib/grid/src/grid.min.js +1 -1
  42. package/lib/index.umd.js +1641 -1076
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/locale/lang/ar-EG.js +7 -1
  45. package/lib/locale/lang/ar-EG.min.js +1 -1
  46. package/lib/locale/lang/de-DE.js +7 -1
  47. package/lib/locale/lang/de-DE.min.js +1 -1
  48. package/lib/locale/lang/en-US.js +7 -1
  49. package/lib/locale/lang/en-US.min.js +1 -1
  50. package/lib/locale/lang/en-US.umd.js +7 -1
  51. package/lib/locale/lang/es-ES.js +7 -1
  52. package/lib/locale/lang/es-ES.min.js +1 -1
  53. package/lib/locale/lang/es-ES.umd.js +7 -1
  54. package/lib/locale/lang/fr-FR.js +7 -1
  55. package/lib/locale/lang/fr-FR.min.js +1 -1
  56. package/lib/locale/lang/hu-HU.js +7 -1
  57. package/lib/locale/lang/hu-HU.min.js +1 -1
  58. package/lib/locale/lang/hu-HU.umd.js +7 -1
  59. package/lib/locale/lang/hy-AM.js +7 -1
  60. package/lib/locale/lang/hy-AM.min.js +1 -1
  61. package/lib/locale/lang/id-ID.js +7 -1
  62. package/lib/locale/lang/id-ID.min.js +1 -1
  63. package/lib/locale/lang/it-IT.js +7 -1
  64. package/lib/locale/lang/it-IT.min.js +1 -1
  65. package/lib/locale/lang/ja-JP.js +7 -1
  66. package/lib/locale/lang/ja-JP.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.umd.js +7 -1
  68. package/lib/locale/lang/ko-KR.js +7 -1
  69. package/lib/locale/lang/ko-KR.min.js +1 -1
  70. package/lib/locale/lang/ko-KR.umd.js +7 -1
  71. package/lib/locale/lang/nb-NO.js +7 -1
  72. package/lib/locale/lang/nb-NO.min.js +1 -1
  73. package/lib/locale/lang/pt-BR.js +7 -1
  74. package/lib/locale/lang/pt-BR.min.js +1 -1
  75. package/lib/locale/lang/pt-BR.umd.js +7 -1
  76. package/lib/locale/lang/ru-RU.js +7 -1
  77. package/lib/locale/lang/ru-RU.min.js +1 -1
  78. package/lib/locale/lang/ru-RU.umd.js +7 -1
  79. package/lib/locale/lang/th-TH.js +7 -1
  80. package/lib/locale/lang/th-TH.min.js +1 -1
  81. package/lib/locale/lang/ug-CN.js +7 -1
  82. package/lib/locale/lang/ug-CN.min.js +1 -1
  83. package/lib/locale/lang/uk-UA.js +7 -1
  84. package/lib/locale/lang/uk-UA.min.js +1 -1
  85. package/lib/locale/lang/uk-UA.umd.js +7 -1
  86. package/lib/locale/lang/vi-VN.js +7 -1
  87. package/lib/locale/lang/vi-VN.min.js +1 -1
  88. package/lib/locale/lang/zh-CHT.js +7 -1
  89. package/lib/locale/lang/zh-CHT.min.js +1 -1
  90. package/lib/locale/lang/zh-CHT.umd.js +7 -1
  91. package/lib/locale/lang/zh-CN.js +7 -1
  92. package/lib/locale/lang/zh-CN.min.js +1 -1
  93. package/lib/locale/lang/zh-CN.umd.js +7 -1
  94. package/lib/style.css +1 -1
  95. package/lib/table/module/edit/mixin.js +16 -11
  96. package/lib/table/module/edit/mixin.min.js +1 -1
  97. package/lib/table/module/filter/panel.js +8 -2
  98. package/lib/table/module/filter/panel.min.js +1 -1
  99. package/lib/table/module/keyboard/mixin.js +89 -25
  100. package/lib/table/module/keyboard/mixin.min.js +1 -1
  101. package/lib/table/module/validator/mixin.js +3 -3
  102. package/lib/table/module/validator/mixin.min.js +1 -1
  103. package/lib/table/render/index.js +99 -64
  104. package/lib/table/render/index.min.js +1 -1
  105. package/lib/table/src/body.js +27 -17
  106. package/lib/table/src/body.min.js +1 -1
  107. package/lib/table/src/cell.js +37 -21
  108. package/lib/table/src/cell.min.js +1 -1
  109. package/lib/table/src/footer.js +9 -3
  110. package/lib/table/src/footer.min.js +1 -1
  111. package/lib/table/src/header.js +2 -1
  112. package/lib/table/src/header.min.js +1 -1
  113. package/lib/table/src/methods.js +1101 -798
  114. package/lib/table/src/methods.min.js +1 -1
  115. package/lib/table/src/props.js +4 -0
  116. package/lib/table/src/props.min.js +1 -1
  117. package/lib/table/src/table.js +79 -31
  118. package/lib/table/src/table.min.js +1 -1
  119. package/lib/table/src/util.js +72 -7
  120. package/lib/table/src/util.min.js +1 -1
  121. package/lib/ui/index.js +1 -1
  122. package/lib/ui/index.min.js +1 -1
  123. package/lib/ui/src/log.js +1 -1
  124. package/lib/ui/src/log.min.js +1 -1
  125. package/package.json +2 -2
  126. package/packages/grid/src/grid.ts +92 -57
  127. package/packages/locale/lang/ar-EG.ts +7 -1
  128. package/packages/locale/lang/de-DE.ts +7 -1
  129. package/packages/locale/lang/en-US.ts +7 -1
  130. package/packages/locale/lang/es-ES.ts +7 -1
  131. package/packages/locale/lang/fr-FR.ts +7 -1
  132. package/packages/locale/lang/hu-HU.ts +7 -1
  133. package/packages/locale/lang/hy-AM.ts +7 -1
  134. package/packages/locale/lang/id-ID.ts +7 -1
  135. package/packages/locale/lang/it-IT.ts +7 -1
  136. package/packages/locale/lang/ja-JP.ts +7 -1
  137. package/packages/locale/lang/ko-KR.ts +7 -1
  138. package/packages/locale/lang/nb-NO.ts +7 -1
  139. package/packages/locale/lang/pt-BR.ts +7 -1
  140. package/packages/locale/lang/ru-RU.ts +7 -1
  141. package/packages/locale/lang/th-TH.ts +7 -1
  142. package/packages/locale/lang/ug-CN.ts +7 -1
  143. package/packages/locale/lang/uk-UA.ts +7 -1
  144. package/packages/locale/lang/vi-VN.ts +7 -1
  145. package/packages/locale/lang/zh-CHT.ts +7 -1
  146. package/packages/locale/lang/zh-CN.ts +7 -1
  147. package/packages/table/module/edit/mixin.ts +17 -12
  148. package/packages/table/module/filter/panel.ts +12 -2
  149. package/packages/table/module/keyboard/mixin.ts +94 -27
  150. package/packages/table/module/validator/mixin.ts +2 -2
  151. package/packages/table/render/index.ts +89 -57
  152. package/packages/table/src/body.ts +21 -16
  153. package/packages/table/src/cell.ts +25 -20
  154. package/packages/table/src/footer.ts +9 -4
  155. package/packages/table/src/header.ts +2 -2
  156. package/packages/table/src/methods.ts +1035 -720
  157. package/packages/table/src/props.ts +16 -12
  158. package/packages/table/src/table.ts +87 -35
  159. package/packages/table/src/util.ts +73 -7
  160. /package/es/{iconfont.1741079977180.ttf → iconfont.1742437924038.ttf} +0 -0
  161. /package/es/{iconfont.1741079977180.woff → iconfont.1742437924038.woff} +0 -0
  162. /package/es/{iconfont.1741079977180.woff2 → iconfont.1742437924038.woff2} +0 -0
  163. /package/lib/{iconfont.1741079977180.ttf → iconfont.1742437924038.ttf} +0 -0
  164. /package/lib/{iconfont.1741079977180.woff → iconfont.1742437924038.woff} +0 -0
  165. /package/lib/{iconfont.1741079977180.woff2 → iconfont.1742437924038.woff2} +0 -0
@@ -164,9 +164,11 @@ export default {
164
164
  // 是否自动根据状态属性去更新响应式表格宽高
165
165
  syncResize: [Boolean, String, Number],
166
166
  // 响应式布局配置项
167
- resizeConfig: Object,
167
+ resizeConfig: Object as PropType<VxeTablePropTypes.ResizeConfig>,
168
168
  // 列配置信息
169
- columnConfig: Object,
169
+ columnConfig: Object as PropType<VxeTablePropTypes.ColumnConfig>,
170
+ // 当前列配置信息
171
+ currentColumnConfig: Object as PropType<VxeTablePropTypes.CurrentColumnConfig>,
170
172
  // 单元格配置信息
171
173
  cellConfig: Object as PropType<VxeTablePropTypes.CellConfig>,
172
174
  // 表头单元格配置信息
@@ -174,7 +176,9 @@ export default {
174
176
  // 表尾单元格配置信息
175
177
  footerCellConfig: Object as PropType<VxeTablePropTypes.FooterCellConfig>,
176
178
  // 行配置信息
177
- rowConfig: Object,
179
+ rowConfig: Object as PropType<VxeTablePropTypes.RowConfig>,
180
+ // 当前行配置信息
181
+ currentRowConfig: Object as PropType<VxeTablePropTypes.CurrentRowConfig>,
178
182
  // 已废弃,被 rowDragConfig 替换
179
183
  dragConfig: Object as PropType<VxeTablePropTypes.DragConfig>,
180
184
  // 行拖拽排序配置项
@@ -182,27 +186,27 @@ export default {
182
186
  // 列拖拽排序配置项
183
187
  columnDragConfig: Object as PropType<VxeTablePropTypes.ColumnDragConfig>,
184
188
  // 列调整配置项
185
- resizableConfig: Object,
189
+ resizableConfig: Object as PropType<VxeTablePropTypes.ResizableConfig>,
186
190
  // 序号配置项
187
- seqConfig: Object,
191
+ seqConfig: Object as PropType<VxeTablePropTypes.SeqConfig>,
188
192
  // 排序配置项
189
- sortConfig: Object,
193
+ sortConfig: Object as PropType<VxeTablePropTypes.SortConfig>,
190
194
  // 筛选配置项
191
- filterConfig: Object,
195
+ filterConfig: Object as PropType<VxeTablePropTypes.FilterConfig>,
192
196
  // 单选框配置
193
- radioConfig: Object,
197
+ radioConfig: Object as PropType<VxeTablePropTypes.RadioConfig>,
194
198
  // 复选框配置项
195
- checkboxConfig: Object,
199
+ checkboxConfig: Object as PropType<VxeTablePropTypes.CheckboxConfig>,
196
200
  // tooltip 配置项
197
- tooltipConfig: Object,
201
+ tooltipConfig: Object as PropType<VxeTablePropTypes.TooltipConfig>,
198
202
  // 导出配置项
199
203
  exportConfig: [Boolean, Object],
200
204
  // 导入配置项
201
205
  importConfig: [Boolean, Object],
202
206
  // 打印配置项
203
- printConfig: Object,
207
+ printConfig: Object as PropType<VxeTablePropTypes.PrintConfig>,
204
208
  // 展开行配置项
205
- expandConfig: Object,
209
+ expandConfig: Object as PropType<VxeTablePropTypes.ExpandConfig>,
206
210
  // 树形结构配置项
207
211
  treeConfig: [Boolean, Object],
208
212
  // 快捷菜单配置项
@@ -2,7 +2,7 @@ import { CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { getFuncText, isEnableConf } from '../../ui/src/utils'
4
4
  import { initTpImg } from '../../ui/src/dom'
5
- import { getRowid } from './util'
5
+ import { createHandleGetRowId } from './util'
6
6
  import { VxeUI } from '../../ui'
7
7
  import methods from './methods'
8
8
  import TableBodyComponent from './body'
@@ -209,6 +209,7 @@ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor &
209
209
  ]
210
210
 
211
211
  if (expandColumn) {
212
+ const { handleGetRowId } = createHandleGetRowId($xeTable)
212
213
  tableRowExpandedList.forEach((row) => {
213
214
  const expandOpts = $xeTable.computeExpandOpts
214
215
  const { height: expandHeight, padding } = expandOpts
@@ -216,7 +217,7 @@ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor &
216
217
  const treeOpts = $xeTable.computeTreeOpts
217
218
  const { transform, seqMode } = treeOpts
218
219
  const cellStyle: Record<string, string> = {}
219
- const rowid = getRowid($xeTable, row)
220
+ const rowid = handleGetRowId(row)
220
221
  const rest = fullAllDataRowIdData[rowid]
221
222
  let rowLevel = 0
222
223
  let seq: string | number = -1
@@ -471,8 +472,6 @@ export default {
471
472
  isAllSelected: false,
472
473
  // 复选框属性,有选中且非全选状态
473
474
  isIndeterminate: false,
474
- // 复选框属性,已选中的行集合
475
- selectCheckboxMaps: {},
476
475
  // 当前行
477
476
  currentRow: null,
478
477
  // 单选框属性,选中列
@@ -486,16 +485,6 @@ export default {
486
485
  hasFixedColumn: false,
487
486
  // 树节点列信息
488
487
  treeNodeColumn: null,
489
- // 已展开的行集合
490
- rowExpandedMaps: {},
491
- // 懒加载中的展开行的集合
492
- rowExpandLazyLoadedMaps: {},
493
- // 已展开树节点集合
494
- treeExpandedMaps: {},
495
- // 懒加载中的树节点的集合
496
- treeExpandLazyLoadedMaps: {},
497
- // 树节点不确定状态的集合
498
- treeIndeterminateMaps: {},
499
488
  // 合并单元格的对象集
500
489
  mergeList: [],
501
490
  // 合并表尾数据的对象集
@@ -512,8 +501,6 @@ export default {
512
501
  upDataFlag: 0,
513
502
  // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
514
503
  reColumnFlag: 0,
515
- // 已标记的对象集
516
- pendingRowMaps: {},
517
504
  // 自定义列相关的信息
518
505
  customStore: {
519
506
  btnEl: null,
@@ -649,6 +636,11 @@ export default {
649
636
  isFooter: false
650
637
  },
651
638
 
639
+ rowExpandedFlag: 1,
640
+ treeExpandedFlag: 1,
641
+ updateCheckboxFlag: 1,
642
+ pendingRowFlag: 1,
643
+
652
644
  rowHeightStore: {
653
645
  default: 48,
654
646
  medium: 44,
@@ -774,13 +766,13 @@ export default {
774
766
  return this.computeRowHeightMaps
775
767
  },
776
768
  computeRowHeightMaps () {
777
- const $xeTable = this
778
- const reactData = $xeTable as TableReactData
769
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
770
+ const reactData = $xeTable as unknown as TableReactData
779
771
 
780
772
  return reactData.rowHeightStore
781
773
  },
782
774
  computeDefaultRowHeight () {
783
- const $xeTable = this
775
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
784
776
 
785
777
  const vSize = $xeTable.computeSize
786
778
  const rowHeightMaps = $xeTable.computeRowHeightMaps
@@ -790,31 +782,61 @@ export default {
790
782
  return this.computeColumnOpts
791
783
  },
792
784
  computeColumnOpts () {
793
- return Object.assign({}, getConfig().table.columnConfig, this.columnConfig)
785
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
786
+ const props = $xeTable
787
+
788
+ return Object.assign({}, getConfig().table.columnConfig, props.columnConfig)
789
+ },
790
+ computeCurrentColumnOpts () {
791
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
792
+ const props = $xeTable
793
+
794
+ return Object.assign({}, getConfig().table.currentColumnConfig, props.currentColumnConfig)
794
795
  },
795
796
  computeCellOpts () {
796
797
  const $xeTable = this
797
798
  const props = $xeTable
798
799
 
799
- return Object.assign({}, getConfig().table.cellConfig, props.cellConfig)
800
+ const cellOpts = Object.assign({}, getConfig().table.cellConfig, props.cellConfig)
801
+ if (cellOpts.height) {
802
+ cellOpts.height = XEUtils.toNumber(cellOpts.height)
803
+ }
804
+ return cellOpts
800
805
  },
801
806
  computeHeaderCellOpts () {
802
807
  const $xeTable = this
803
808
  const props = $xeTable
804
809
 
805
- return Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig)
810
+ const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig)
811
+ if (headerCellOpts.height) {
812
+ headerCellOpts.height = XEUtils.toNumber(headerCellOpts.height)
813
+ }
814
+ return headerCellOpts
806
815
  },
807
816
  computeFooterCellOpts () {
808
817
  const $xeTable = this
809
818
  const props = $xeTable
810
819
 
811
- return Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig)
820
+ const footerCellOpts = Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig)
821
+ if (footerCellOpts.height) {
822
+ footerCellOpts.height = XEUtils.toNumber(footerCellOpts.height)
823
+ }
824
+ return footerCellOpts
812
825
  },
813
826
  rowOpts () {
814
827
  return this.computeRowOpts
815
828
  },
816
829
  computeRowOpts () {
817
- return Object.assign({}, getConfig().table.rowConfig, this.rowConfig)
830
+ const $xeTable = this
831
+ const props = $xeTable
832
+
833
+ return Object.assign({}, getConfig().table.rowConfig, props.rowConfig)
834
+ },
835
+ computeCurrentRowOpts () {
836
+ const $xeTable = this
837
+ const props = $xeTable
838
+
839
+ return Object.assign({}, getConfig().table.currentRowConfig, props.currentRowConfig)
818
840
  },
819
841
  computeRowDragOpts () {
820
842
  return Object.assign({}, getConfig().table.rowDragConfig, this.rowDragConfig)
@@ -838,25 +860,37 @@ export default {
838
860
  return this.computeSeqOpts
839
861
  },
840
862
  computeSeqOpts () {
841
- return Object.assign({ startIndex: 0 }, getConfig().table.seqConfig, this.seqConfig)
863
+ const $xeTable = this
864
+ const props = $xeTable
865
+
866
+ return Object.assign({ startIndex: 0 }, getConfig().table.seqConfig, props.seqConfig)
842
867
  },
843
868
  radioOpts () {
844
869
  return this.computeRadioOpts
845
870
  },
846
871
  computeRadioOpts () {
847
- return Object.assign({}, getConfig().table.radioConfig, this.radioConfig)
872
+ const $xeTable = this
873
+ const props = $xeTable
874
+
875
+ return Object.assign({}, getConfig().table.radioConfig, props.radioConfig)
848
876
  },
849
877
  checkboxOpts () {
850
878
  return this.computeCheckboxOpts
851
879
  },
852
880
  computeCheckboxOpts () {
853
- return Object.assign({}, getConfig().table.checkboxConfig, this.checkboxConfig)
881
+ const $xeTable = this
882
+ const props = $xeTable
883
+
884
+ return Object.assign({}, getConfig().table.checkboxConfig, props.checkboxConfig)
854
885
  },
855
886
  tooltipOpts () {
856
887
  return this.computeTooltipOpts
857
888
  },
858
889
  computeTooltipOpts () {
859
- return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, this.tooltipConfig)
890
+ const $xeTable = this
891
+ const props = $xeTable
892
+
893
+ return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, props.tooltipConfig)
860
894
  },
861
895
  tipConfig () {
862
896
  return { ...this.tooltipOpts }
@@ -1071,13 +1105,16 @@ export default {
1071
1105
  computeTableRowExpandedList () {
1072
1106
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1073
1107
  const reactData = $xeTable as unknown as TableReactData
1108
+ const internalData = $xeTable as unknown as TableInternalData
1074
1109
 
1075
- const { rowExpandedMaps, tableData, expandColumn } = reactData
1110
+ const { rowExpandedFlag, tableData, expandColumn } = reactData
1111
+ const { rowExpandedMaps } = internalData
1112
+ const { handleGetRowId } = createHandleGetRowId($xeTable)
1076
1113
  const expandList: any[] = []
1077
- if (expandColumn) {
1114
+ if (expandColumn && rowExpandedFlag) {
1078
1115
  const rowKeys: Record<string, boolean> = {}
1079
1116
  tableData.forEach(row => {
1080
- rowKeys[getRowid($xeTable, row)] = true
1117
+ rowKeys[handleGetRowId(row)] = true
1081
1118
  })
1082
1119
  XEUtils.each(rowExpandedMaps, (row, rowid) => {
1083
1120
  if (rowKeys[rowid]) {
@@ -1330,13 +1367,15 @@ export default {
1330
1367
  lastScrollTop: 0,
1331
1368
  // 单选框属性,已选中保留的行
1332
1369
  radioReserveRow: null,
1333
- // 复选框属性,已选中保留的行
1370
+ // 复选框属性,已选中保留的行集合
1334
1371
  checkboxReserveRowMap: {},
1335
- // 行数据,已展开保留的行
1372
+ // 行数据,已展开保留的行集合
1336
1373
  rowExpandedReserveRowMap: {},
1337
- // 树结构数据,已展开保留的行
1374
+ // 树结构数据,已展开保留的行集合
1338
1375
  treeExpandedReserveRowMap: {},
1339
- // 完整数据、条件处理后
1376
+ // 树结构数据,不确定状态的集合
1377
+ treeIndeterminateRowMaps: {},
1378
+ // 列表完整数据、条件处理后
1340
1379
  tableFullData: [],
1341
1380
  afterFullData: [],
1342
1381
  // 列表条件处理后数据集合
@@ -1355,6 +1394,19 @@ export default {
1355
1394
  fullColumnIdData: {},
1356
1395
  fullColumnFieldData: {},
1357
1396
 
1397
+ // 已展开的行集合
1398
+ rowExpandedMaps: {},
1399
+ // 懒加载中的展开行的集合
1400
+ rowExpandLazyLoadedMaps: {},
1401
+ // 已展开树节点集合
1402
+ treeExpandedMaps: {},
1403
+ // 懒加载中的树节点的集合
1404
+ treeExpandLazyLoadedMaps: {},
1405
+ // 复选框属性,已选中的行集合
1406
+ selectCheckboxMaps: {},
1407
+ // 已标记的对象集
1408
+ pendingRowMaps: {},
1409
+
1358
1410
  swYSize: 0,
1359
1411
  swYInterval: 0,
1360
1412
  swYTotal: 0
@@ -2,6 +2,7 @@ import XEUtils from 'xe-utils'
2
2
  import { ColumnInfo } from './columnInfo'
3
3
  import { isScale, isPx } from '../../ui/src/dom'
4
4
  import { warnLog, errLog } from '../../ui/src/log'
5
+ import { eqEmptyValue } from '../../ui/src/utils'
5
6
 
6
7
  import type { VxeTableDefines, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePrivateMethods } from '../../../types'
7
8
 
@@ -102,14 +103,71 @@ export function getRowUniqueId () {
102
103
  }
103
104
 
104
105
  // 行主键 key
105
- export function getRowkey ($xetable: any) {
106
- return $xetable.rowOpts.keyField || $xetable.rowId || '_X_ROW_KEY'
106
+ export function getRowkey ($xeTable: VxeTableConstructor) {
107
+ const props = $xeTable
108
+ const rowOpts = $xeTable.computeRowOpts
109
+ return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`
107
110
  }
108
111
 
109
112
  // 行主键 value
110
- export function getRowid ($xetable: any, row: any) {
111
- const rowid = XEUtils.get(row, getRowkey($xetable))
112
- return XEUtils.eqNull(rowid) ? '' : encodeURIComponent(rowid)
113
+ export function getRowid ($xeTable: VxeTableConstructor, row: any) {
114
+ const rowid = XEUtils.get(row, getRowkey($xeTable))
115
+ return encodeRowid(rowid)
116
+ }
117
+
118
+ export function createHandleUpdateRowId ($xeTable: VxeTableConstructor) {
119
+ const rowKey = getRowkey($xeTable)
120
+ const isDeepKey = rowKey.indexOf('.') > -1
121
+ const updateRId = isDeepKey ? updateDeepRowKey : updateFastRowKey
122
+ return {
123
+ rowKey,
124
+ handleUpdateRowId (row: any) {
125
+ return row ? updateRId(row, rowKey) : null
126
+ }
127
+ }
128
+ }
129
+
130
+ export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
131
+ const rowKey = getRowkey($xeTable)
132
+ const isDeepKey = rowKey.indexOf('.') > -1
133
+ const getRId = isDeepKey ? getDeepRowIdByKey : getFastRowIdByKey
134
+ return {
135
+ rowKey,
136
+ handleGetRowId (row: any) {
137
+ return row ? getRId(row, rowKey) : null
138
+ }
139
+ }
140
+ }
141
+
142
+ // 编码行主键
143
+ export function encodeRowid (rowVal: string) {
144
+ return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
145
+ }
146
+
147
+ function getDeepRowIdByKey (row: any, rowKey: string) {
148
+ return XEUtils.get(row, rowKey)
149
+ }
150
+
151
+ export function updateDeepRowKey (row: any, rowKey: string) {
152
+ let rowid = getDeepRowIdByKey(row, rowKey)
153
+ if (eqEmptyValue(rowid)) {
154
+ rowid = getRowUniqueId()
155
+ XEUtils.set(row, rowKey, rowid)
156
+ }
157
+ return rowid
158
+ }
159
+
160
+ function getFastRowIdByKey (row: any, rowKey: string) {
161
+ return row[rowKey]
162
+ }
163
+
164
+ export function updateFastRowKey (row: any, rowKey: string) {
165
+ let rowid = getFastRowIdByKey(row, rowKey)
166
+ if (eqEmptyValue(rowid)) {
167
+ rowid = getRowUniqueId()
168
+ row[rowKey] = rowid
169
+ }
170
+ return rowid
113
171
  }
114
172
 
115
173
  function getPaddingLeftRightSize (elem: any) {
@@ -139,9 +197,17 @@ export function getCellHeight (height: number | 'unset' | undefined | null) {
139
197
  return height || 0
140
198
  }
141
199
 
142
- export function handleFieldOrColumn (_vm: any, fieldOrColumn: any) {
200
+ export function handleFieldOrColumn ($xeTable: VxeTableConstructor, fieldOrColumn: any) {
143
201
  if (fieldOrColumn) {
144
- return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn
202
+ return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn
203
+ }
204
+ return null
205
+ }
206
+
207
+ export const handleRowidOrRow = ($xeTable: VxeTableConstructor, rowidOrRow: any) => {
208
+ if (rowidOrRow) {
209
+ const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow)
210
+ return $xeTable.getRowById(rowid)
145
211
  }
146
212
  return null
147
213
  }