@pointcloud/pcloud-components 0.1.15 → 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.
package/dist/esm/DTable/index.js
CHANGED
|
@@ -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 =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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) {
|
|
@@ -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
|
}));
|