@pointcloud/pcloud-components 0.1.14 → 0.1.16

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.
@@ -9,7 +9,7 @@ var _excluded = ["loadMore", "defaultColumnProps", "actionColumn", "showErrorMsg
9
9
  * @LastEditTime : 2023-08-16 16:45:15
10
10
  * @Description : 基于antd的Table组件
11
11
  */
12
- import React, { forwardRef, useEffect, useRef, useState, useContext } from 'react';
12
+ import React, { forwardRef, useEffect, useRef, useState, useContext, useMemo } from 'react';
13
13
  import { message, Table } from 'antd';
14
14
  import { ConfigContext } from "../ConfigProvider";
15
15
  import "./index.less";
@@ -125,13 +125,15 @@ function InternalTable(props, ref) {
125
125
  var _className = "".concat(getPrefixCls('table'), " ").concat(className || '', " ").concat(_pagination ? 'height-on-page' : '');
126
126
 
127
127
  // loading 默认延迟 600ms
128
- var _loading = typeof loading === 'boolean' ? {
129
- spinning: loading,
130
- delay: 600
131
- } : _objectSpread({
132
- delay: 600,
133
- spinning: false
134
- }, loading);
128
+ var _loading = useMemo(function () {
129
+ return typeof loading === 'boolean' ? {
130
+ spinning: loading,
131
+ delay: 500
132
+ } : _objectSpread({
133
+ delay: 500,
134
+ spinning: false
135
+ }, loading);
136
+ }, [loading]);
135
137
 
136
138
  // 加载数据
137
139
  var loadData = function loadData(params) {
@@ -172,7 +174,7 @@ function InternalTable(props, ref) {
172
174
  setTableParams(_objectSpread(_objectSpread({}, getTablePage(_pagination)), params));
173
175
  setTableSource({
174
176
  total: total,
175
- loading: false,
177
+ loading: !!loading,
176
178
  records: dataSource
177
179
  });
178
180
  }
@@ -212,7 +214,7 @@ function InternalTable(props, ref) {
212
214
  dataSource: tableSource.records,
213
215
  pagination: _tablePagination,
214
216
  scroll: _scroll,
215
- loading: _objectSpread(_objectSpread({}, _loading), {}, {
217
+ loading: dataSource ? _loading : _objectSpread(_objectSpread({}, _loading), {}, {
216
218
  spinning: tableSource.loading
217
219
  })
218
220
  }));