vxe-table 4.15.0-beta.10 → 4.15.0-beta.12
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/es/grid/src/grid.js +48 -38
- package/es/style.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +58 -46
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +60 -48
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +51 -38
- /package/es/{iconfont.1753519951433.ttf → iconfont.1753674951920.ttf} +0 -0
- /package/es/{iconfont.1753519951433.woff → iconfont.1753674951920.woff} +0 -0
- /package/es/{iconfont.1753519951433.woff2 → iconfont.1753674951920.woff2} +0 -0
- /package/lib/{iconfont.1753519951433.ttf → iconfont.1753674951920.ttf} +0 -0
- /package/lib/{iconfont.1753519951433.woff → iconfont.1753674951920.woff} +0 -0
- /package/lib/{iconfont.1753519951433.woff2 → iconfont.1753674951920.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -205,6 +205,10 @@ export default defineVxeComponent({
|
|
|
205
205
|
const pagerOpts = computePagerOpts.value;
|
|
206
206
|
return pagerOpts.total;
|
|
207
207
|
});
|
|
208
|
+
const computePageCount = computed(() => {
|
|
209
|
+
const { tablePage } = reactData;
|
|
210
|
+
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
|
|
211
|
+
});
|
|
208
212
|
const computeIsLoading = computed(() => {
|
|
209
213
|
const { loading, proxyConfig } = props;
|
|
210
214
|
const { tableLoading } = reactData;
|
|
@@ -272,7 +276,7 @@ export default defineVxeComponent({
|
|
|
272
276
|
tablePage.pageSize = pageSize;
|
|
273
277
|
}
|
|
274
278
|
if (total) {
|
|
275
|
-
tablePage.
|
|
279
|
+
tablePage.total = total;
|
|
276
280
|
}
|
|
277
281
|
}
|
|
278
282
|
}
|
|
@@ -343,7 +347,7 @@ export default defineVxeComponent({
|
|
|
343
347
|
});
|
|
344
348
|
}
|
|
345
349
|
};
|
|
346
|
-
const
|
|
350
|
+
const handleSortEvent = (params) => {
|
|
347
351
|
const $xeTable = refTable.value;
|
|
348
352
|
const { proxyConfig } = props;
|
|
349
353
|
const { computeSortOpts } = $xeTable.getComputeMaps();
|
|
@@ -359,27 +363,16 @@ export default defineVxeComponent({
|
|
|
359
363
|
});
|
|
360
364
|
}
|
|
361
365
|
}
|
|
366
|
+
};
|
|
367
|
+
const sortChangeEvent = (params) => {
|
|
368
|
+
handleSortEvent(params);
|
|
362
369
|
$xeGrid.dispatchEvent('sort-change', params, params.$event);
|
|
363
370
|
};
|
|
364
371
|
const clearAllSortEvent = (params) => {
|
|
365
|
-
|
|
366
|
-
const { proxyConfig } = props;
|
|
367
|
-
const { computeSortOpts } = $xeTable.getComputeMaps();
|
|
368
|
-
const proxyOpts = computeProxyOpts.value;
|
|
369
|
-
const sortOpts = computeSortOpts.value;
|
|
370
|
-
// 如果是服务端排序
|
|
371
|
-
if (sortOpts.remote) {
|
|
372
|
-
reactData.sortData = params.sortList;
|
|
373
|
-
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
374
|
-
reactData.tablePage.currentPage = 1;
|
|
375
|
-
$xeGrid.commitProxy('query').then((rest) => {
|
|
376
|
-
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
}
|
|
372
|
+
handleSortEvent(params);
|
|
380
373
|
$xeGrid.dispatchEvent('clear-all-sort', params, params.$event);
|
|
381
374
|
};
|
|
382
|
-
const
|
|
375
|
+
const handleFilterEvent = (params) => {
|
|
383
376
|
const $xeTable = refTable.value;
|
|
384
377
|
const { proxyConfig } = props;
|
|
385
378
|
const { computeFilterOpts } = $xeTable.getComputeMaps();
|
|
@@ -395,24 +388,13 @@ export default defineVxeComponent({
|
|
|
395
388
|
});
|
|
396
389
|
}
|
|
397
390
|
}
|
|
391
|
+
};
|
|
392
|
+
const filterChangeEvent = (params) => {
|
|
393
|
+
handleFilterEvent(params);
|
|
398
394
|
$xeGrid.dispatchEvent('filter-change', params, params.$event);
|
|
399
395
|
};
|
|
400
396
|
const clearAllFilterEvent = (params) => {
|
|
401
|
-
|
|
402
|
-
const { proxyConfig } = props;
|
|
403
|
-
const { computeFilterOpts } = $xeTable.getComputeMaps();
|
|
404
|
-
const proxyOpts = computeProxyOpts.value;
|
|
405
|
-
const filterOpts = computeFilterOpts.value;
|
|
406
|
-
// 如果是服务端过滤
|
|
407
|
-
if (filterOpts.remote) {
|
|
408
|
-
reactData.filterData = params.filterList;
|
|
409
|
-
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
410
|
-
reactData.tablePage.currentPage = 1;
|
|
411
|
-
$xeGrid.commitProxy('query').then((rest) => {
|
|
412
|
-
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}
|
|
397
|
+
handleFilterEvent(params);
|
|
416
398
|
$xeGrid.dispatchEvent('clear-all-filter', params, params.$event);
|
|
417
399
|
};
|
|
418
400
|
const submitFormEvent = (params) => {
|
|
@@ -1190,6 +1172,9 @@ export default defineVxeComponent({
|
|
|
1190
1172
|
}
|
|
1191
1173
|
return nextTick();
|
|
1192
1174
|
},
|
|
1175
|
+
getParams() {
|
|
1176
|
+
return props.params;
|
|
1177
|
+
},
|
|
1193
1178
|
zoom() {
|
|
1194
1179
|
if (reactData.isZMax) {
|
|
1195
1180
|
return gridMethods.revert();
|
|
@@ -1245,26 +1230,51 @@ export default defineVxeComponent({
|
|
|
1245
1230
|
return nextTick();
|
|
1246
1231
|
},
|
|
1247
1232
|
homePage() {
|
|
1233
|
+
const { tablePage } = reactData;
|
|
1234
|
+
tablePage.currentPage = 1;
|
|
1235
|
+
return nextTick();
|
|
1236
|
+
},
|
|
1237
|
+
homePageByEvent(evnt) {
|
|
1248
1238
|
const $pager = refPager.value;
|
|
1249
1239
|
if ($pager) {
|
|
1250
|
-
|
|
1240
|
+
$pager.homePageByEvent(evnt);
|
|
1251
1241
|
}
|
|
1252
|
-
return nextTick();
|
|
1253
1242
|
},
|
|
1254
1243
|
endPage() {
|
|
1244
|
+
const { tablePage } = reactData;
|
|
1245
|
+
const pageCount = computePageCount.value;
|
|
1246
|
+
tablePage.currentPage = pageCount;
|
|
1247
|
+
return nextTick();
|
|
1248
|
+
},
|
|
1249
|
+
endPageByEvent(evnt) {
|
|
1255
1250
|
const $pager = refPager.value;
|
|
1256
1251
|
if ($pager) {
|
|
1257
|
-
|
|
1252
|
+
$pager.endPageByEvent(evnt);
|
|
1258
1253
|
}
|
|
1254
|
+
},
|
|
1255
|
+
setCurrentPage(currentPage) {
|
|
1256
|
+
const { tablePage } = reactData;
|
|
1257
|
+
const pageCount = computePageCount.value;
|
|
1258
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, XEUtils.toNumber(currentPage)));
|
|
1259
1259
|
return nextTick();
|
|
1260
1260
|
},
|
|
1261
|
-
|
|
1261
|
+
setCurrentPageByEvent(evnt, currentPage) {
|
|
1262
1262
|
const $pager = refPager.value;
|
|
1263
1263
|
if ($pager) {
|
|
1264
|
-
|
|
1264
|
+
$pager.setCurrentPageByEvent(evnt, currentPage);
|
|
1265
1265
|
}
|
|
1266
|
+
},
|
|
1267
|
+
setPageSize(pageSize) {
|
|
1268
|
+
const { tablePage } = reactData;
|
|
1269
|
+
tablePage.pageSize = Math.max(1, XEUtils.toNumber(pageSize));
|
|
1266
1270
|
return nextTick();
|
|
1267
1271
|
},
|
|
1272
|
+
setPageSizeByEvent(evnt, pageSize) {
|
|
1273
|
+
const $pager = refPager.value;
|
|
1274
|
+
if ($pager) {
|
|
1275
|
+
$pager.setPageSizeByEvent(evnt, pageSize);
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1268
1278
|
getProxyInfo() {
|
|
1269
1279
|
const $xeTable = refTable.value;
|
|
1270
1280
|
if (props.proxyConfig) {
|