element-assits 0.0.94 → 0.0.95

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 (2) hide show
  1. package/lib/index.js +16 -12
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2420,21 +2420,25 @@ const Qx = {
2420
2420
  },
2421
2421
  getList() {
2422
2422
  if (!this.pageRequest) {
2423
- let r = [];
2423
+ let t = [];
2424
2424
  if (this.thePagination.show) {
2425
- const t = (this.page.current - 1) * this.page.pageSize;
2426
- r = this.data.slice(t, t + this.page.pageSize);
2425
+ const i = (this.page.current - 1) * this.page.pageSize;
2426
+ t = this.data.slice(i, i + this.page.pageSize);
2427
2427
  } else
2428
- r = this.data;
2429
- return this.tableData = r, this.page.total = this.data.length, this.asyncPageCurrent = this.page.current, Promise.resolve();
2430
- }
2431
- return this.innerLoading = !0, this.errMsg = void 0, this.pageRequest(this.page, this.theForm.attrs.model).then((r) => {
2432
- const { data: t, total: i, current: a } = r || {};
2433
- this.tableData = t || [], this.page.total = i || 0, this.asyncPageCurrent = a || this.page.current, le(this.tableData) && !this.tableData.length && this.page.current > 1 && this.handleCurrentChange(this.page.current - 1);
2434
- }).catch((r) => {
2435
- this.errMsg = r && r.message;
2428
+ t = this.data;
2429
+ return this.tableData = t, this.page.total = this.data.length, this.asyncPageCurrent = this.page.current, Promise.resolve();
2430
+ }
2431
+ this.innerLoading = !0, this.errMsg = void 0;
2432
+ const r = this.timestamp = Date.now();
2433
+ return this.pageRequest(this.page, this.theForm.attrs.model).then((t) => {
2434
+ if (r !== this.timestamp)
2435
+ return;
2436
+ const { data: i, total: a, current: o } = t || {};
2437
+ this.tableData = i || [], this.page.total = a || 0, this.asyncPageCurrent = o || this.page.current, le(this.tableData) && !this.tableData.length && this.page.current > 1 && this.handleCurrentChange(this.page.current - 1);
2438
+ }).catch((t) => {
2439
+ r === this.timestamp && (this.errMsg = t && t.message);
2436
2440
  }).finally(() => {
2437
- this.innerLoading = !1;
2441
+ r === this.timestamp && (this.innerLoading = !1);
2438
2442
  });
2439
2443
  },
2440
2444
  hideRefresh() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-assits",
3
- "version": "0.0.94",
3
+ "version": "0.0.95",
4
4
  "description": "element-ui 的扩展组件库",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",