@ztocwst/rc-pro-materials 0.2.25 → 0.2.27
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/dist/SCM_Comps.js +2 -2
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-data-table/components/custom-renderer/index.js +67 -37
- package/es/components/z-data-table/components/link-renderer/index.js +45 -26
- package/es/components/z-data-table/components/table-renderer/index.js +81 -65
- package/es/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +1 -14
- package/es/components/z-data-table/components/table-renderer/table-renderer.helper.js +26 -35
- package/es/components/z-data-table/data-table.d.ts +2 -1
- package/es/components/z-data-table/data-table.helper.d.ts +1 -0
- package/es/components/z-data-table/data-table.helper.js +2 -1
- package/lib/components/z-data-table/components/custom-renderer/index.js +67 -37
- package/lib/components/z-data-table/components/link-renderer/index.js +45 -26
- package/lib/components/z-data-table/components/table-renderer/index.js +81 -65
- package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +1 -14
- package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.js +26 -34
- package/lib/components/z-data-table/data-table.d.ts +2 -1
- package/lib/components/z-data-table/data-table.helper.d.ts +1 -0
- package/lib/components/z-data-table/data-table.helper.js +2 -1
- package/package.json +5 -5
|
@@ -40,80 +40,110 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
40
40
|
setIsLink(true);
|
|
41
41
|
(_linkChartRef$current = linkChartRef.current) === null || _linkChartRef$current === void 0 ? void 0 : (_linkChartRef$current2 = _linkChartRef$current.initial) === null || _linkChartRef$current2 === void 0 ? void 0 : _linkChartRef$current2.call(_linkChartRef$current, _extends({}, values));
|
|
42
42
|
};
|
|
43
|
+
var getBigDataBody = function getBigDataBody(params) {
|
|
44
|
+
var _indexJson$data;
|
|
45
|
+
if (params === void 0) {
|
|
46
|
+
params = {};
|
|
47
|
+
}
|
|
48
|
+
var target = [];
|
|
49
|
+
if (indexJson !== null && indexJson !== void 0 && (_indexJson$data = indexJson.data) !== null && _indexJson$data !== void 0 && _indexJson$data.length) {
|
|
50
|
+
for (var _iterator = _createForOfIteratorHelperLoose(indexJson.data), _step; !(_step = _iterator()).done;) {
|
|
51
|
+
var item = _step.value;
|
|
52
|
+
target.push({
|
|
53
|
+
description: item.name
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
var queryParams = handleQueryParams(params);
|
|
58
|
+
var data = {
|
|
59
|
+
target: target,
|
|
60
|
+
queryParams: queryParams,
|
|
61
|
+
dataSetName: dataSetName
|
|
62
|
+
};
|
|
63
|
+
return formatter ? formatter === null || formatter === void 0 ? void 0 : formatter(data) : data;
|
|
64
|
+
};
|
|
43
65
|
|
|
44
66
|
// 获取数据源
|
|
45
67
|
var getDataSource = /*#__PURE__*/function () {
|
|
46
68
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
|
|
47
|
-
var
|
|
69
|
+
var data, _ref3, success, _ref3$result, _result;
|
|
48
70
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
49
71
|
while (1) switch (_context.prev = _context.next) {
|
|
50
72
|
case 0:
|
|
51
73
|
if (query === void 0) {
|
|
52
74
|
query = {};
|
|
53
75
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
for (_iterator = _createForOfIteratorHelperLoose(indexJson.data); !(_step = _iterator()).done;) {
|
|
58
|
-
item = _step.value;
|
|
59
|
-
target.push({
|
|
60
|
-
description: item.name
|
|
61
|
-
});
|
|
62
|
-
}
|
|
76
|
+
if (!loading) {
|
|
77
|
+
_context.next = 3;
|
|
78
|
+
break;
|
|
63
79
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
dataSetName: dataSetName
|
|
69
|
-
};
|
|
80
|
+
return _context.abrupt("return");
|
|
81
|
+
case 3:
|
|
82
|
+
_context.prev = 3;
|
|
83
|
+
data = getBigDataBody(query);
|
|
70
84
|
setLoading(true);
|
|
71
|
-
_context.next =
|
|
72
|
-
return getReportData(rcProContext,
|
|
73
|
-
case
|
|
74
|
-
|
|
85
|
+
_context.next = 8;
|
|
86
|
+
return getReportData(rcProContext, data);
|
|
87
|
+
case 8:
|
|
88
|
+
_context.t0 = _context.sent;
|
|
89
|
+
if (_context.t0) {
|
|
90
|
+
_context.next = 11;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
_context.t0 = {};
|
|
94
|
+
case 11:
|
|
95
|
+
_ref3 = _context.t0;
|
|
96
|
+
success = _ref3.success;
|
|
97
|
+
_ref3$result = _ref3.result;
|
|
98
|
+
_result = _ref3$result === void 0 ? {} : _ref3$result;
|
|
75
99
|
setLoading(false);
|
|
76
|
-
if (
|
|
77
|
-
setResult(
|
|
100
|
+
if (success) {
|
|
101
|
+
setResult(_result);
|
|
102
|
+
} else {
|
|
103
|
+
setResult(null);
|
|
78
104
|
}
|
|
79
|
-
_context.next =
|
|
105
|
+
_context.next = 24;
|
|
80
106
|
break;
|
|
81
|
-
case
|
|
82
|
-
_context.prev =
|
|
83
|
-
_context.
|
|
107
|
+
case 19:
|
|
108
|
+
_context.prev = 19;
|
|
109
|
+
_context.t1 = _context["catch"](3);
|
|
84
110
|
setLoading(false);
|
|
85
111
|
setResult(null);
|
|
86
|
-
console.error(_context.
|
|
87
|
-
case
|
|
112
|
+
console.error(_context.t1);
|
|
113
|
+
case 24:
|
|
88
114
|
case "end":
|
|
89
115
|
return _context.stop();
|
|
90
116
|
}
|
|
91
|
-
}, _callee, null, [[
|
|
117
|
+
}, _callee, null, [[3, 19]]);
|
|
92
118
|
}));
|
|
93
119
|
return function getDataSource(_x) {
|
|
94
120
|
return _ref2.apply(this, arguments);
|
|
95
121
|
};
|
|
96
122
|
}();
|
|
97
123
|
var queryChart = /*#__PURE__*/function () {
|
|
98
|
-
var
|
|
99
|
-
var
|
|
124
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) {
|
|
125
|
+
var _value;
|
|
126
|
+
var queryParams, _linkChartRef$current3, _linkChartRef$current4;
|
|
100
127
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
101
128
|
while (1) switch (_context2.prev = _context2.next) {
|
|
102
129
|
case 0:
|
|
103
|
-
|
|
130
|
+
if (value === void 0) {
|
|
131
|
+
value = {};
|
|
132
|
+
}
|
|
133
|
+
queryParams = ((_value = value) === null || _value === void 0 ? void 0 : _value[dataSetName]) || value;
|
|
104
134
|
if (isLink) {
|
|
105
|
-
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(queryParams);
|
|
135
|
+
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : (_linkChartRef$current4 = _linkChartRef$current3.queryChart) === null || _linkChartRef$current4 === void 0 ? void 0 : _linkChartRef$current4.call(_linkChartRef$current3, queryParams);
|
|
106
136
|
} else {
|
|
107
137
|
getDataSource(queryParams);
|
|
108
138
|
}
|
|
109
|
-
case
|
|
139
|
+
case 3:
|
|
110
140
|
case "end":
|
|
111
141
|
return _context2.stop();
|
|
112
142
|
}
|
|
113
143
|
}, _callee2);
|
|
114
144
|
}));
|
|
115
145
|
return function queryChart(_x2) {
|
|
116
|
-
return
|
|
146
|
+
return _ref4.apply(this, arguments);
|
|
117
147
|
};
|
|
118
148
|
}();
|
|
119
149
|
var handleClearInterval = function handleClearInterval() {
|
|
@@ -138,8 +168,8 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
138
168
|
};
|
|
139
169
|
useEffect(function () {
|
|
140
170
|
if (currentKey) {
|
|
141
|
-
var
|
|
142
|
-
curDataSetName =
|
|
171
|
+
var _ref5 = currentKey.split(separator) || [],
|
|
172
|
+
curDataSetName = _ref5[0];
|
|
143
173
|
if (curDataSetName === dataSetName) {
|
|
144
174
|
onload();
|
|
145
175
|
} else {
|
|
@@ -195,9 +195,10 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
195
195
|
for (var _iterator = _createForOfIteratorHelperLoose(targets.indexSource), _step; !(_step = _iterator()).done;) {
|
|
196
196
|
var cur = _step.value;
|
|
197
197
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
198
|
+
var _cur$defaultSorted;
|
|
198
199
|
orderBys.push({
|
|
199
200
|
name: cur.name,
|
|
200
|
-
sort: defaultSort
|
|
201
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : defaultSort
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
204
|
}
|
|
@@ -240,42 +241,57 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
240
241
|
};
|
|
241
242
|
var getDataSource = /*#__PURE__*/function () {
|
|
242
243
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
243
|
-
var
|
|
244
|
+
var data, _ref5, success, _ref5$result, _result;
|
|
244
245
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
245
246
|
while (1) switch (_context.prev = _context.next) {
|
|
246
247
|
case 0:
|
|
247
248
|
if (params === void 0) {
|
|
248
249
|
params = {};
|
|
249
250
|
}
|
|
250
|
-
|
|
251
|
+
if (!loading) {
|
|
252
|
+
_context.next = 3;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
return _context.abrupt("return");
|
|
256
|
+
case 3:
|
|
257
|
+
_context.prev = 3;
|
|
258
|
+
data = getBigDataBody(params); // 自定义、非自定义都打开 loading 拦截重复请求
|
|
259
|
+
setLoading(true);
|
|
260
|
+
_context.next = 8;
|
|
261
|
+
return getReportData(rcProContext, data);
|
|
262
|
+
case 8:
|
|
263
|
+
_context.t0 = _context.sent;
|
|
264
|
+
if (_context.t0) {
|
|
265
|
+
_context.next = 11;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
_context.t0 = {};
|
|
269
|
+
case 11:
|
|
270
|
+
_ref5 = _context.t0;
|
|
271
|
+
success = _ref5.success;
|
|
272
|
+
_ref5$result = _ref5.result;
|
|
273
|
+
_result = _ref5$result === void 0 ? {} : _ref5$result;
|
|
274
|
+
setLoading(false);
|
|
251
275
|
if (linkState.custom) {
|
|
252
|
-
|
|
276
|
+
setResult(_result);
|
|
253
277
|
}
|
|
254
|
-
return _context.abrupt("return",
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
268
|
-
})["catch"](function () {
|
|
269
|
-
if (linkState.custom) {
|
|
270
|
-
setLoading(false);
|
|
271
|
-
setResult(null);
|
|
272
|
-
}
|
|
273
|
-
}));
|
|
274
|
-
case 4:
|
|
278
|
+
return _context.abrupt("return", {
|
|
279
|
+
success: success,
|
|
280
|
+
result: _result
|
|
281
|
+
});
|
|
282
|
+
case 20:
|
|
283
|
+
_context.prev = 20;
|
|
284
|
+
_context.t1 = _context["catch"](3);
|
|
285
|
+
setLoading(false);
|
|
286
|
+
if (linkState.custom) {
|
|
287
|
+
setResult(null);
|
|
288
|
+
}
|
|
289
|
+
console.error(_context.t1);
|
|
290
|
+
case 25:
|
|
275
291
|
case "end":
|
|
276
292
|
return _context.stop();
|
|
277
293
|
}
|
|
278
|
-
}, _callee);
|
|
294
|
+
}, _callee, null, [[3, 20]]);
|
|
279
295
|
}));
|
|
280
296
|
return function getDataSource(_x) {
|
|
281
297
|
return _ref4.apply(this, arguments);
|
|
@@ -334,6 +350,9 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
334
350
|
setLinkState(stateData);
|
|
335
351
|
};
|
|
336
352
|
var queryChart = function queryChart(value) {
|
|
353
|
+
if (value === void 0) {
|
|
354
|
+
value = {};
|
|
355
|
+
}
|
|
337
356
|
queryCacheRef.current = value;
|
|
338
357
|
if (linkState.custom) {
|
|
339
358
|
getDataSource({
|
|
@@ -27,7 +27,6 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
27
27
|
dimJson = props.dimJson,
|
|
28
28
|
indexJson = props.indexJson,
|
|
29
29
|
actionJson = props.actionJson,
|
|
30
|
-
expressions = props.expressions,
|
|
31
30
|
linkPageTitle = props.linkPageTitle,
|
|
32
31
|
linkPage = props.linkPage,
|
|
33
32
|
queryBind = props.queryBind,
|
|
@@ -40,13 +39,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
40
39
|
var _useState = useState(false),
|
|
41
40
|
loading = _useState[0],
|
|
42
41
|
setLoading = _useState[1];
|
|
43
|
-
var _useState2 = useState(tableConfigDefault),
|
|
44
|
-
config = _useState2[0],
|
|
45
|
-
setConfig = _useState2[1];
|
|
46
42
|
/** 维度指标初始数据 */
|
|
47
|
-
var
|
|
48
|
-
dimTargetValue =
|
|
49
|
-
setDimTargetValue =
|
|
43
|
+
var _useState2 = useState(),
|
|
44
|
+
dimTargetValue = _useState2[0],
|
|
45
|
+
setDimTargetValue = _useState2[1];
|
|
50
46
|
/** 合计 数据 */
|
|
51
47
|
var amounted = useRef({});
|
|
52
48
|
var rcProContext = useContext(RcConfigContext);
|
|
@@ -55,11 +51,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
55
51
|
_ref$tableOptions = _ref.tableOptions,
|
|
56
52
|
tableOptions = _ref$tableOptions === void 0 ? {} : _ref$tableOptions;
|
|
57
53
|
var defaultPageSize = (tableOptions === null || tableOptions === void 0 ? void 0 : (_tableOptions$paginat = tableOptions.pagination) === null || _tableOptions$paginat === void 0 ? void 0 : _tableOptions$paginat.defaultPageSize) || 20;
|
|
58
|
-
var
|
|
59
|
-
isLink =
|
|
60
|
-
setIsLink =
|
|
54
|
+
var _useState3 = useState(false),
|
|
55
|
+
isLink = _useState3[0],
|
|
56
|
+
setIsLink = _useState3[1];
|
|
61
57
|
var linkChartRef = useRef();
|
|
62
58
|
var timer = null;
|
|
59
|
+
var timeout = null;
|
|
63
60
|
var getDimTargetValues = function getDimTargetValues() {
|
|
64
61
|
var _dimTargetRef$current;
|
|
65
62
|
return (dimTargetRef === null || dimTargetRef === void 0 ? void 0 : (_dimTargetRef$current = dimTargetRef.current) === null || _dimTargetRef$current === void 0 ? void 0 : _dimTargetRef$current.getDimTargetValues()) || {};
|
|
@@ -162,7 +159,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
162
159
|
var _tableRef$current;
|
|
163
160
|
var columns = handleColumns(_extends({}, option, {
|
|
164
161
|
actionJson: actionJson
|
|
165
|
-
}),
|
|
162
|
+
}), linkPage, onLink);
|
|
166
163
|
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
167
164
|
};
|
|
168
165
|
var getBigDataBody = function getBigDataBody(params) {
|
|
@@ -225,9 +222,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
225
222
|
description: cur.description
|
|
226
223
|
});
|
|
227
224
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
225
|
+
var _cur$defaultSorted;
|
|
228
226
|
orderBys.push({
|
|
229
227
|
name: cur.description,
|
|
230
|
-
sort: defaultSort
|
|
228
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : defaultSort
|
|
231
229
|
});
|
|
232
230
|
}
|
|
233
231
|
}
|
|
@@ -242,9 +240,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
242
240
|
description: _cur.name
|
|
243
241
|
});
|
|
244
242
|
if (_cur !== null && _cur !== void 0 && _cur.sorted) {
|
|
243
|
+
var _cur$defaultSorted2;
|
|
245
244
|
orderBys.push({
|
|
246
245
|
name: _cur.name,
|
|
247
|
-
sort: defaultSort
|
|
246
|
+
sort: _cur.defaultSorted ? (_cur$defaultSorted2 = _cur.defaultSorted) === null || _cur$defaultSorted2 === void 0 ? void 0 : _cur$defaultSorted2.slice(0, -3) : defaultSort
|
|
248
247
|
});
|
|
249
248
|
}
|
|
250
249
|
}
|
|
@@ -286,7 +285,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
286
285
|
// 获取数据源
|
|
287
286
|
var getDataSource = /*#__PURE__*/function () {
|
|
288
287
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(params) {
|
|
289
|
-
var data,
|
|
288
|
+
var data, _ref4, success, _ref4$result, result;
|
|
290
289
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
291
290
|
while (1) switch (_context2.prev = _context2.next) {
|
|
292
291
|
case 0:
|
|
@@ -305,32 +304,39 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
305
304
|
_context2.next = 8;
|
|
306
305
|
return getReportData(rcProContext, data);
|
|
307
306
|
case 8:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
_context2.t0 = _context2.sent;
|
|
308
|
+
if (_context2.t0) {
|
|
309
|
+
_context2.next = 11;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
_context2.t0 = {};
|
|
313
|
+
case 11:
|
|
314
|
+
_ref4 = _context2.t0;
|
|
315
|
+
success = _ref4.success;
|
|
316
|
+
_ref4$result = _ref4.result;
|
|
317
|
+
result = _ref4$result === void 0 ? {} : _ref4$result;
|
|
312
318
|
setLoading(false);
|
|
313
319
|
return _context2.abrupt("return", {
|
|
314
320
|
success: success,
|
|
315
321
|
result: result
|
|
316
322
|
});
|
|
317
|
-
case
|
|
318
|
-
_context2.prev =
|
|
319
|
-
_context2.
|
|
323
|
+
case 19:
|
|
324
|
+
_context2.prev = 19;
|
|
325
|
+
_context2.t1 = _context2["catch"](3);
|
|
320
326
|
setLoading(false);
|
|
321
|
-
console.error(_context2.
|
|
322
|
-
case
|
|
327
|
+
console.error(_context2.t1);
|
|
328
|
+
case 23:
|
|
323
329
|
case "end":
|
|
324
330
|
return _context2.stop();
|
|
325
331
|
}
|
|
326
|
-
}, _callee2, null, [[3,
|
|
332
|
+
}, _callee2, null, [[3, 19]]);
|
|
327
333
|
}));
|
|
328
334
|
return function getDataSource(_x2) {
|
|
329
335
|
return _ref3.apply(this, arguments);
|
|
330
336
|
};
|
|
331
337
|
}();
|
|
332
338
|
var initial = /*#__PURE__*/function () {
|
|
333
|
-
var
|
|
339
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(params) {
|
|
334
340
|
var result, dims, targets, option;
|
|
335
341
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
336
342
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -354,31 +360,6 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
354
360
|
};
|
|
355
361
|
handleUpdateColumns(option);
|
|
356
362
|
setDimTargetValue(result);
|
|
357
|
-
setConfig(_extends({}, tableConfigDefault, {
|
|
358
|
-
pagination: {
|
|
359
|
-
showSizeChanger: true,
|
|
360
|
-
defaultPageSize: defaultPageSize
|
|
361
|
-
},
|
|
362
|
-
summary: summary,
|
|
363
|
-
request: function request(data) {
|
|
364
|
-
var _data$pagination, _data$pagination2, _data$sorter;
|
|
365
|
-
var pagination = {
|
|
366
|
-
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
367
|
-
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
368
|
-
};
|
|
369
|
-
var orderBy = [];
|
|
370
|
-
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
371
|
-
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
372
|
-
orderBy.push({
|
|
373
|
-
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
374
|
-
sort: (_data$sorter3 = data.sorter) === null || _data$sorter3 === void 0 ? void 0 : (_data$sorter3$order = _data$sorter3.order) === null || _data$sorter3$order === void 0 ? void 0 : _data$sorter3$order.slice(0, -3)
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
return getDataSource(_extends({}, pagination, {
|
|
378
|
-
orderBy: orderBy
|
|
379
|
-
}));
|
|
380
|
-
}
|
|
381
|
-
}));
|
|
382
363
|
}
|
|
383
364
|
case 4:
|
|
384
365
|
case "end":
|
|
@@ -387,7 +368,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
387
368
|
}, _callee3);
|
|
388
369
|
}));
|
|
389
370
|
return function initial(_x3) {
|
|
390
|
-
return
|
|
371
|
+
return _ref5.apply(this, arguments);
|
|
391
372
|
};
|
|
392
373
|
}();
|
|
393
374
|
useEffect(function () {
|
|
@@ -401,6 +382,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
401
382
|
timer = null;
|
|
402
383
|
}
|
|
403
384
|
};
|
|
385
|
+
var handleClearTimeout = function handleClearTimeout() {
|
|
386
|
+
if (timeout) {
|
|
387
|
+
clearTimeout(timeout);
|
|
388
|
+
timeout = null;
|
|
389
|
+
}
|
|
390
|
+
};
|
|
404
391
|
var onload = function onload() {
|
|
405
392
|
if (autoLoad) {
|
|
406
393
|
if (refreshRate) {
|
|
@@ -417,8 +404,8 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
417
404
|
};
|
|
418
405
|
useEffect(function () {
|
|
419
406
|
if (currentKey) {
|
|
420
|
-
var
|
|
421
|
-
curDataSetName =
|
|
407
|
+
var _ref6 = currentKey.split(separator) || [],
|
|
408
|
+
curDataSetName = _ref6[0];
|
|
422
409
|
if (curDataSetName === dataSetName) {
|
|
423
410
|
onload();
|
|
424
411
|
} else {
|
|
@@ -432,18 +419,21 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
432
419
|
};
|
|
433
420
|
}, [currentKey, autoLoad]);
|
|
434
421
|
var queryChart = /*#__PURE__*/function () {
|
|
435
|
-
var
|
|
436
|
-
var _linkChartRef$current3;
|
|
422
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(value) {
|
|
423
|
+
var _linkChartRef$current3, _value;
|
|
437
424
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
438
425
|
while (1) switch (_context5.prev = _context5.next) {
|
|
439
426
|
case 0:
|
|
427
|
+
if (value === void 0) {
|
|
428
|
+
value = {};
|
|
429
|
+
}
|
|
440
430
|
if (isLink) {
|
|
441
431
|
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(value);
|
|
442
432
|
} else {
|
|
443
|
-
queryCacheRef.current = value[dataSetName] || value;
|
|
444
|
-
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
433
|
+
queryCacheRef.current = ((_value = value) === null || _value === void 0 ? void 0 : _value[dataSetName]) || value;
|
|
434
|
+
timeout = window.setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
445
435
|
var _tableRef$current2;
|
|
446
|
-
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur,
|
|
436
|
+
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur, _ref9, success, _ref9$result, result, _result$data, _result$data$, data;
|
|
447
437
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
448
438
|
while (1) switch (_context4.prev = _context4.next) {
|
|
449
439
|
case 0:
|
|
@@ -478,29 +468,31 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
478
468
|
}
|
|
479
469
|
_context4.t0 = {};
|
|
480
470
|
case 11:
|
|
481
|
-
|
|
482
|
-
success =
|
|
483
|
-
|
|
484
|
-
result =
|
|
471
|
+
_ref9 = _context4.t0;
|
|
472
|
+
success = _ref9.success;
|
|
473
|
+
_ref9$result = _ref9.result;
|
|
474
|
+
result = _ref9$result === void 0 ? {} : _ref9$result;
|
|
485
475
|
if (success) {
|
|
486
476
|
_result$data = result === null || result === void 0 ? void 0 : result.data, _result$data$ = _result$data[0], data = _result$data$ === void 0 ? {} : _result$data$;
|
|
487
477
|
amounted.current = data;
|
|
488
478
|
}
|
|
489
479
|
case 16:
|
|
480
|
+
handleClearTimeout();
|
|
481
|
+
case 17:
|
|
490
482
|
case "end":
|
|
491
483
|
return _context4.stop();
|
|
492
484
|
}
|
|
493
485
|
}, _callee4);
|
|
494
486
|
})), 200);
|
|
495
487
|
}
|
|
496
|
-
case
|
|
488
|
+
case 2:
|
|
497
489
|
case "end":
|
|
498
490
|
return _context5.stop();
|
|
499
491
|
}
|
|
500
492
|
}, _callee5);
|
|
501
493
|
}));
|
|
502
494
|
return function queryChart(_x4) {
|
|
503
|
-
return
|
|
495
|
+
return _ref7.apply(this, arguments);
|
|
504
496
|
};
|
|
505
497
|
}();
|
|
506
498
|
useImperativeHandle(chartRef, function () {
|
|
@@ -523,7 +515,31 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
523
515
|
})
|
|
524
516
|
}), /*#__PURE__*/React.createElement(ProTable, {
|
|
525
517
|
ref: tableRef,
|
|
526
|
-
config:
|
|
518
|
+
config: _extends({}, tableConfigDefault, {
|
|
519
|
+
pagination: {
|
|
520
|
+
showSizeChanger: true,
|
|
521
|
+
defaultPageSize: defaultPageSize
|
|
522
|
+
},
|
|
523
|
+
summary: summary,
|
|
524
|
+
request: function request(data) {
|
|
525
|
+
var _data$pagination, _data$pagination2, _data$sorter;
|
|
526
|
+
var pagination = {
|
|
527
|
+
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
528
|
+
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
529
|
+
};
|
|
530
|
+
var orderBy = [];
|
|
531
|
+
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
532
|
+
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
533
|
+
orderBy.push({
|
|
534
|
+
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
535
|
+
sort: (_data$sorter3 = data.sorter) === null || _data$sorter3 === void 0 ? void 0 : (_data$sorter3$order = _data$sorter3.order) === null || _data$sorter3$order === void 0 ? void 0 : _data$sorter3$order.slice(0, -3)
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
return getDataSource(_extends({}, pagination, {
|
|
539
|
+
orderBy: orderBy
|
|
540
|
+
}));
|
|
541
|
+
}
|
|
542
|
+
})
|
|
527
543
|
})), /*#__PURE__*/React.createElement("div", {
|
|
528
544
|
style: {
|
|
529
545
|
display: isLink ? 'block' : 'none'
|
|
@@ -47,20 +47,7 @@ export declare const getDimTargetData: (rcProContext: any, params: Record<string
|
|
|
47
47
|
* 数据渲染格式处理
|
|
48
48
|
*/
|
|
49
49
|
export declare const handleValueFormat: (value: valueType, record: Record<string, any>, config?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
|
|
50
|
-
/**
|
|
51
|
-
* 条件格式
|
|
52
|
-
*/
|
|
53
|
-
export type ExpressionsType = any[] | [];
|
|
54
50
|
/**
|
|
55
51
|
* 根据维度指标获取表格列
|
|
56
52
|
*/
|
|
57
|
-
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>,
|
|
58
|
-
title: import("antd/es/checkbox/Group").CheckboxValueType;
|
|
59
|
-
dataIndex: string;
|
|
60
|
-
ellipsis: boolean;
|
|
61
|
-
defaultSortOrder: string;
|
|
62
|
-
sorter: any;
|
|
63
|
-
width: any;
|
|
64
|
-
fixed: any;
|
|
65
|
-
render: (value: valueType, record: Record<string, any>) => any;
|
|
66
|
-
}[];
|
|
53
|
+
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>, linkPage?: TypeZDataTableProps[], onLink?: (v: linkParamsType) => void) => any[];
|