vxe-table 4.11.16 → 4.12.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,14 +28,15 @@
28
28
  * [x] ~~v3.0 基于 vue2.6+,支持现代浏览器并保留兼容 IE11~~
29
29
  * [x] v3.9 基于 vue2.6+,内部重构,拆分 Table 库和 UI 库,只支持现代浏览器,不支持 IE
30
30
  * [x] v3.13 重构展开行功能,同时支持展开行与虚拟渲染和冻结列
31
+ * [x] v3.14 重构虚拟渲染,支持百万级数据渲染、渲染性能及流畅度大幅提升
31
32
  * **V4**
32
33
  * [x] ~~v4.0 基于 vue3.2+,只支持现代浏览器,不支持 IE~~
33
34
  * [x] v4.7 基于 vue3.2+,内部重构,拆分 Table 库和 UI 库,只支持现代浏览器,不支持 IE
34
35
  * [x] v4.11 重构展开行功能,同时支持展开行与虚拟渲染和冻结列
36
+ * [x] v4.12 重构虚拟渲染,支持百万级数据渲染、渲染性能及流畅度大幅提升
35
37
  * 版本计划
36
- * [ ] 虚拟滚动渲染性能提升到极致
37
- * [ ] 虚拟渲染,支持百万级数据渲染
38
- * [ ] 虚拟渲染,支持千万级数据渲染
38
+ * [ ] 优化展开行与冻结列
39
+ * [ ] 优化虚拟渲染,支持千万级数据渲染
39
40
  * [ ] 数据图表可视化
40
41
 
41
42
  ## 浏览器支持
@@ -139,30 +139,29 @@ export default defineComponent({
139
139
  });
140
140
  const computeTableProps = computed(() => {
141
141
  const { seqConfig, pagerConfig, loading, editConfig, proxyConfig } = props;
142
- const { isZMax, tableLoading, tablePage, tableData } = reactData;
142
+ const { isZMax, tableLoading, tablePage } = reactData;
143
143
  const tableExtendProps = computeTableExtendProps.value;
144
144
  const proxyOpts = computeProxyOpts.value;
145
145
  const pagerOpts = computePagerOpts.value;
146
- const tableProps = Object.assign({}, tableExtendProps);
146
+ const tProps = Object.assign({}, tableExtendProps);
147
147
  if (isZMax) {
148
148
  if (tableExtendProps.maxHeight) {
149
- tableProps.maxHeight = '100%';
149
+ tProps.maxHeight = '100%';
150
150
  }
151
151
  else {
152
- tableProps.height = '100%';
152
+ tProps.height = '100%';
153
153
  }
154
154
  }
155
155
  if (proxyConfig && isEnableConf(proxyOpts)) {
156
- tableProps.loading = loading || tableLoading;
157
- tableProps.data = tableData;
156
+ tProps.loading = loading || tableLoading;
158
157
  if (pagerConfig && proxyOpts.seq && isEnableConf(pagerOpts)) {
159
- tableProps.seqConfig = Object.assign({}, seqConfig, { startIndex: (tablePage.currentPage - 1) * tablePage.pageSize });
158
+ tProps.seqConfig = Object.assign({}, seqConfig, { startIndex: (tablePage.currentPage - 1) * tablePage.pageSize });
160
159
  }
161
160
  }
162
161
  if (editConfig) {
163
- tableProps.editConfig = Object.assign({}, editConfig);
162
+ tProps.editConfig = Object.assign({}, editConfig);
164
163
  }
165
- return tableProps;
164
+ return tProps;
166
165
  });
167
166
  const computeCurrLayoutConf = computed(() => {
168
167
  const { layouts } = props;
@@ -877,6 +876,7 @@ export default defineComponent({
877
876
  reactData.tableLoading = true;
878
877
  return Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args))
879
878
  .then(rest => {
879
+ let tableData = [];
880
880
  reactData.tableLoading = false;
881
881
  if (rest) {
882
882
  if (pagerConfig && isEnableConf(pagerOpts)) {
@@ -884,7 +884,7 @@ export default defineComponent({
884
884
  const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
885
885
  tablePage.total = XEUtils.toNumber(total);
886
886
  const resultProp = resConfigs.result;
887
- reactData.tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, resultProp || 'result')) || [];
887
+ tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, resultProp || 'result')) || [];
888
888
  // 检验当前页码,不能超出当前最大页数
889
889
  const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
890
890
  if (tablePage.currentPage > pageCount) {
@@ -893,11 +893,18 @@ export default defineComponent({
893
893
  }
894
894
  else {
895
895
  const listProp = resConfigs.list;
896
- reactData.tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, listProp)) : rest) || [];
896
+ tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, listProp)) : rest) || [];
897
897
  }
898
898
  }
899
+ if ($xeTable) {
900
+ $xeTable.loadData(tableData);
901
+ }
899
902
  else {
900
- reactData.tableData = [];
903
+ nextTick(() => {
904
+ if ($xeTable) {
905
+ $xeTable.loadData(tableData);
906
+ }
907
+ });
901
908
  }
902
909
  if (afterQuery) {
903
910
  afterQuery(commitParams, ...args);
@@ -1110,7 +1117,7 @@ export default defineComponent({
1110
1117
  if (props.proxyConfig) {
1111
1118
  const { sortData } = reactData;
1112
1119
  return {
1113
- data: reactData.tableData,
1120
+ data: $xeTable ? $xeTable.getFullData() : [],
1114
1121
  filter: reactData.filterData,
1115
1122
  form: getFormData(),
1116
1123
  sort: sortData.length ? sortData[0] : {},