@ztocwst/rc-pro-materials 0.2.24 → 0.2.26
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 +43 -25
- package/es/components/z-data-table/components/table-renderer/index.js +112 -108
- package/es/components/z-data-table/data-table.d.ts +6 -2
- package/es/components/z-data-table/data-table.helper.js +1 -1
- package/es/components/z-templates-data-common/components/chart-renderer/index.js +5 -1
- package/es/components/z-templates-data-common/data-common.js +9 -4
- package/es/style.js +2 -2
- package/lib/components/z-data-table/components/custom-renderer/index.js +67 -37
- package/lib/components/z-data-table/components/link-renderer/index.js +43 -25
- package/lib/components/z-data-table/components/table-renderer/index.js +112 -108
- package/lib/components/z-data-table/data-table.d.ts +6 -2
- package/lib/components/z-data-table/data-table.helper.js +1 -1
- package/lib/components/z-templates-data-common/components/chart-renderer/index.js +5 -1
- package/lib/components/z-templates-data-common/data-common.js +9 -4
- package/package.json +4 -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 {
|
|
@@ -240,42 +240,57 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
240
240
|
};
|
|
241
241
|
var getDataSource = /*#__PURE__*/function () {
|
|
242
242
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
243
|
-
var
|
|
243
|
+
var data, _ref5, success, _ref5$result, _result;
|
|
244
244
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
245
245
|
while (1) switch (_context.prev = _context.next) {
|
|
246
246
|
case 0:
|
|
247
247
|
if (params === void 0) {
|
|
248
248
|
params = {};
|
|
249
249
|
}
|
|
250
|
-
|
|
250
|
+
if (!loading) {
|
|
251
|
+
_context.next = 3;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
return _context.abrupt("return");
|
|
255
|
+
case 3:
|
|
256
|
+
_context.prev = 3;
|
|
257
|
+
data = getBigDataBody(params); // 自定义、非自定义都打开 loading 拦截重复请求
|
|
258
|
+
setLoading(true);
|
|
259
|
+
_context.next = 8;
|
|
260
|
+
return getReportData(rcProContext, data);
|
|
261
|
+
case 8:
|
|
262
|
+
_context.t0 = _context.sent;
|
|
263
|
+
if (_context.t0) {
|
|
264
|
+
_context.next = 11;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
_context.t0 = {};
|
|
268
|
+
case 11:
|
|
269
|
+
_ref5 = _context.t0;
|
|
270
|
+
success = _ref5.success;
|
|
271
|
+
_ref5$result = _ref5.result;
|
|
272
|
+
_result = _ref5$result === void 0 ? {} : _ref5$result;
|
|
273
|
+
setLoading(false);
|
|
251
274
|
if (linkState.custom) {
|
|
252
|
-
|
|
275
|
+
setResult(_result);
|
|
253
276
|
}
|
|
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:
|
|
277
|
+
return _context.abrupt("return", {
|
|
278
|
+
success: success,
|
|
279
|
+
result: _result
|
|
280
|
+
});
|
|
281
|
+
case 20:
|
|
282
|
+
_context.prev = 20;
|
|
283
|
+
_context.t1 = _context["catch"](3);
|
|
284
|
+
setLoading(false);
|
|
285
|
+
if (linkState.custom) {
|
|
286
|
+
setResult(null);
|
|
287
|
+
}
|
|
288
|
+
console.error(_context.t1);
|
|
289
|
+
case 25:
|
|
275
290
|
case "end":
|
|
276
291
|
return _context.stop();
|
|
277
292
|
}
|
|
278
|
-
}, _callee);
|
|
293
|
+
}, _callee, null, [[3, 20]]);
|
|
279
294
|
}));
|
|
280
295
|
return function getDataSource(_x) {
|
|
281
296
|
return _ref4.apply(this, arguments);
|
|
@@ -334,6 +349,9 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
334
349
|
setLinkState(stateData);
|
|
335
350
|
};
|
|
336
351
|
var queryChart = function queryChart(value) {
|
|
352
|
+
if (value === void 0) {
|
|
353
|
+
value = {};
|
|
354
|
+
}
|
|
337
355
|
queryCacheRef.current = value;
|
|
338
356
|
if (linkState.custom) {
|
|
339
357
|
getDataSource({
|
|
@@ -23,6 +23,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
23
23
|
remember = props.remember,
|
|
24
24
|
exporter = props.exporter,
|
|
25
25
|
exportConfig = props.exportConfig,
|
|
26
|
+
confirmConfig = props.confirmConfig,
|
|
26
27
|
dimJson = props.dimJson,
|
|
27
28
|
indexJson = props.indexJson,
|
|
28
29
|
actionJson = props.actionJson,
|
|
@@ -39,13 +40,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
39
40
|
var _useState = useState(false),
|
|
40
41
|
loading = _useState[0],
|
|
41
42
|
setLoading = _useState[1];
|
|
42
|
-
var _useState2 = useState(tableConfigDefault),
|
|
43
|
-
config = _useState2[0],
|
|
44
|
-
setConfig = _useState2[1];
|
|
45
43
|
/** 维度指标初始数据 */
|
|
46
|
-
var
|
|
47
|
-
dimTargetValue =
|
|
48
|
-
setDimTargetValue =
|
|
44
|
+
var _useState2 = useState(),
|
|
45
|
+
dimTargetValue = _useState2[0],
|
|
46
|
+
setDimTargetValue = _useState2[1];
|
|
49
47
|
/** 合计 数据 */
|
|
50
48
|
var amounted = useRef({});
|
|
51
49
|
var rcProContext = useContext(RcConfigContext);
|
|
@@ -54,25 +52,28 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
54
52
|
_ref$tableOptions = _ref.tableOptions,
|
|
55
53
|
tableOptions = _ref$tableOptions === void 0 ? {} : _ref$tableOptions;
|
|
56
54
|
var defaultPageSize = (tableOptions === null || tableOptions === void 0 ? void 0 : (_tableOptions$paginat = tableOptions.pagination) === null || _tableOptions$paginat === void 0 ? void 0 : _tableOptions$paginat.defaultPageSize) || 20;
|
|
57
|
-
var
|
|
58
|
-
isLink =
|
|
59
|
-
setIsLink =
|
|
55
|
+
var _useState3 = useState(false),
|
|
56
|
+
isLink = _useState3[0],
|
|
57
|
+
setIsLink = _useState3[1];
|
|
60
58
|
var linkChartRef = useRef();
|
|
61
59
|
var timer = null;
|
|
60
|
+
var timeout = null;
|
|
62
61
|
var getDimTargetValues = function getDimTargetValues() {
|
|
63
62
|
var _dimTargetRef$current;
|
|
64
63
|
return (dimTargetRef === null || dimTargetRef === void 0 ? void 0 : (_dimTargetRef$current = dimTargetRef.current) === null || _dimTargetRef$current === void 0 ? void 0 : _dimTargetRef$current.getDimTargetValues()) || {};
|
|
65
64
|
};
|
|
66
65
|
var buttons = [{
|
|
67
|
-
name:
|
|
66
|
+
name: confirmConfig === null || confirmConfig === void 0 ? void 0 : confirmConfig.name,
|
|
68
67
|
action: 'btn',
|
|
69
68
|
props: {
|
|
70
69
|
loading: loading,
|
|
71
70
|
type: 'primary'
|
|
72
71
|
},
|
|
73
72
|
onClick: function onClick() {
|
|
73
|
+
var _confirmConfig$onClic;
|
|
74
74
|
var option = getDimTargetValues();
|
|
75
75
|
handleUpdateColumns(option);
|
|
76
|
+
confirmConfig === null || confirmConfig === void 0 ? void 0 : (_confirmConfig$onClic = confirmConfig.onClick) === null || _confirmConfig$onClic === void 0 ? void 0 : _confirmConfig$onClic.call(confirmConfig);
|
|
76
77
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
77
78
|
}
|
|
78
79
|
}, exporter ? {
|
|
@@ -155,27 +156,13 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
155
156
|
dimension: dimension
|
|
156
157
|
}));
|
|
157
158
|
};
|
|
158
|
-
var handleUpdateColumns =
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
columns = handleColumns(_extends({}, option, {
|
|
166
|
-
actionJson: actionJson
|
|
167
|
-
}), expressions, linkPage, onLink);
|
|
168
|
-
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
169
|
-
case 2:
|
|
170
|
-
case "end":
|
|
171
|
-
return _context2.stop();
|
|
172
|
-
}
|
|
173
|
-
}, _callee2);
|
|
174
|
-
}));
|
|
175
|
-
return function handleUpdateColumns(_x2) {
|
|
176
|
-
return _ref3.apply(this, arguments);
|
|
177
|
-
};
|
|
178
|
-
}();
|
|
159
|
+
var handleUpdateColumns = function handleUpdateColumns(option) {
|
|
160
|
+
var _tableRef$current;
|
|
161
|
+
var columns = handleColumns(_extends({}, option, {
|
|
162
|
+
actionJson: actionJson
|
|
163
|
+
}), expressions, linkPage, onLink);
|
|
164
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
165
|
+
};
|
|
179
166
|
var getBigDataBody = function getBigDataBody(params) {
|
|
180
167
|
if (params === void 0) {
|
|
181
168
|
params = {};
|
|
@@ -296,57 +283,64 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
296
283
|
|
|
297
284
|
// 获取数据源
|
|
298
285
|
var getDataSource = /*#__PURE__*/function () {
|
|
299
|
-
var
|
|
300
|
-
var data,
|
|
301
|
-
return _regeneratorRuntime.wrap(function
|
|
302
|
-
while (1) switch (
|
|
286
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(params) {
|
|
287
|
+
var data, _ref4, success, _ref4$result, result;
|
|
288
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
289
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
303
290
|
case 0:
|
|
304
291
|
if (params === void 0) {
|
|
305
292
|
params = {};
|
|
306
293
|
}
|
|
307
294
|
if (!loading) {
|
|
308
|
-
|
|
295
|
+
_context2.next = 3;
|
|
309
296
|
break;
|
|
310
297
|
}
|
|
311
|
-
return
|
|
298
|
+
return _context2.abrupt("return");
|
|
312
299
|
case 3:
|
|
313
|
-
|
|
300
|
+
_context2.prev = 3;
|
|
314
301
|
data = getBigDataBody(params);
|
|
315
302
|
setLoading(true);
|
|
316
|
-
|
|
303
|
+
_context2.next = 8;
|
|
317
304
|
return getReportData(rcProContext, data);
|
|
318
305
|
case 8:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
306
|
+
_context2.t0 = _context2.sent;
|
|
307
|
+
if (_context2.t0) {
|
|
308
|
+
_context2.next = 11;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
_context2.t0 = {};
|
|
312
|
+
case 11:
|
|
313
|
+
_ref4 = _context2.t0;
|
|
314
|
+
success = _ref4.success;
|
|
315
|
+
_ref4$result = _ref4.result;
|
|
316
|
+
result = _ref4$result === void 0 ? {} : _ref4$result;
|
|
323
317
|
setLoading(false);
|
|
324
|
-
return
|
|
318
|
+
return _context2.abrupt("return", {
|
|
325
319
|
success: success,
|
|
326
320
|
result: result
|
|
327
321
|
});
|
|
328
|
-
case
|
|
329
|
-
|
|
330
|
-
|
|
322
|
+
case 19:
|
|
323
|
+
_context2.prev = 19;
|
|
324
|
+
_context2.t1 = _context2["catch"](3);
|
|
331
325
|
setLoading(false);
|
|
332
|
-
console.error(
|
|
333
|
-
case
|
|
326
|
+
console.error(_context2.t1);
|
|
327
|
+
case 23:
|
|
334
328
|
case "end":
|
|
335
|
-
return
|
|
329
|
+
return _context2.stop();
|
|
336
330
|
}
|
|
337
|
-
},
|
|
331
|
+
}, _callee2, null, [[3, 19]]);
|
|
338
332
|
}));
|
|
339
|
-
return function getDataSource(
|
|
340
|
-
return
|
|
333
|
+
return function getDataSource(_x2) {
|
|
334
|
+
return _ref3.apply(this, arguments);
|
|
341
335
|
};
|
|
342
336
|
}();
|
|
343
337
|
var initial = /*#__PURE__*/function () {
|
|
344
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
338
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(params) {
|
|
345
339
|
var result, dims, targets, option;
|
|
346
|
-
return _regeneratorRuntime.wrap(function
|
|
347
|
-
while (1) switch (
|
|
340
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
341
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
348
342
|
case 0:
|
|
349
|
-
|
|
343
|
+
_context3.next = 2;
|
|
350
344
|
return getDimTargetData(rcProContext, _extends({
|
|
351
345
|
dataSetName: dataSetName
|
|
352
346
|
}, params), {
|
|
@@ -354,7 +348,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
354
348
|
indexJson: indexJson
|
|
355
349
|
});
|
|
356
350
|
case 2:
|
|
357
|
-
result =
|
|
351
|
+
result = _context3.sent;
|
|
358
352
|
if (result) {
|
|
359
353
|
dims = result.dims, targets = result.targets;
|
|
360
354
|
option = {
|
|
@@ -365,39 +359,14 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
365
359
|
};
|
|
366
360
|
handleUpdateColumns(option);
|
|
367
361
|
setDimTargetValue(result);
|
|
368
|
-
setConfig(_extends({}, tableConfigDefault, {
|
|
369
|
-
pagination: {
|
|
370
|
-
showSizeChanger: true,
|
|
371
|
-
defaultPageSize: defaultPageSize
|
|
372
|
-
},
|
|
373
|
-
summary: summary,
|
|
374
|
-
request: function request(data) {
|
|
375
|
-
var _data$pagination, _data$pagination2, _data$sorter;
|
|
376
|
-
var pagination = {
|
|
377
|
-
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
378
|
-
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
379
|
-
};
|
|
380
|
-
var orderBy = [];
|
|
381
|
-
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
382
|
-
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
383
|
-
orderBy.push({
|
|
384
|
-
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
385
|
-
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)
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
return getDataSource(_extends({}, pagination, {
|
|
389
|
-
orderBy: orderBy
|
|
390
|
-
}));
|
|
391
|
-
}
|
|
392
|
-
}));
|
|
393
362
|
}
|
|
394
363
|
case 4:
|
|
395
364
|
case "end":
|
|
396
|
-
return
|
|
365
|
+
return _context3.stop();
|
|
397
366
|
}
|
|
398
|
-
},
|
|
367
|
+
}, _callee3);
|
|
399
368
|
}));
|
|
400
|
-
return function initial(
|
|
369
|
+
return function initial(_x3) {
|
|
401
370
|
return _ref5.apply(this, arguments);
|
|
402
371
|
};
|
|
403
372
|
}();
|
|
@@ -412,6 +381,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
412
381
|
timer = null;
|
|
413
382
|
}
|
|
414
383
|
};
|
|
384
|
+
var handleClearTimeout = function handleClearTimeout() {
|
|
385
|
+
if (timeout) {
|
|
386
|
+
clearTimeout(timeout);
|
|
387
|
+
timeout = null;
|
|
388
|
+
}
|
|
389
|
+
};
|
|
415
390
|
var onload = function onload() {
|
|
416
391
|
if (autoLoad) {
|
|
417
392
|
if (refreshRate) {
|
|
@@ -443,20 +418,23 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
443
418
|
};
|
|
444
419
|
}, [currentKey, autoLoad]);
|
|
445
420
|
var queryChart = /*#__PURE__*/function () {
|
|
446
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
447
|
-
var _linkChartRef$current3;
|
|
448
|
-
return _regeneratorRuntime.wrap(function
|
|
449
|
-
while (1) switch (
|
|
421
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(value) {
|
|
422
|
+
var _linkChartRef$current3, _value;
|
|
423
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
424
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
450
425
|
case 0:
|
|
426
|
+
if (value === void 0) {
|
|
427
|
+
value = {};
|
|
428
|
+
}
|
|
451
429
|
if (isLink) {
|
|
452
430
|
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(value);
|
|
453
431
|
} else {
|
|
454
|
-
queryCacheRef.current = value[dataSetName] || value;
|
|
455
|
-
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
432
|
+
queryCacheRef.current = ((_value = value) === null || _value === void 0 ? void 0 : _value[dataSetName]) || value;
|
|
433
|
+
timeout = window.setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
456
434
|
var _tableRef$current2;
|
|
457
435
|
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur, _ref9, success, _ref9$result, result, _result$data, _result$data$, data;
|
|
458
|
-
return _regeneratorRuntime.wrap(function
|
|
459
|
-
while (1) switch (
|
|
436
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
437
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
460
438
|
case 0:
|
|
461
439
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.refreshTable({
|
|
462
440
|
current: 1
|
|
@@ -466,7 +444,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
466
444
|
return cur.amounted;
|
|
467
445
|
});
|
|
468
446
|
if (!(indexAmounted !== null && indexAmounted !== void 0 && indexAmounted.length)) {
|
|
469
|
-
|
|
447
|
+
_context4.next = 16;
|
|
470
448
|
break;
|
|
471
449
|
}
|
|
472
450
|
target = [];
|
|
@@ -476,20 +454,20 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
476
454
|
description: cur.name
|
|
477
455
|
});
|
|
478
456
|
}
|
|
479
|
-
|
|
457
|
+
_context4.next = 8;
|
|
480
458
|
return getDataSource({
|
|
481
459
|
dim: [],
|
|
482
460
|
target: target
|
|
483
461
|
});
|
|
484
462
|
case 8:
|
|
485
|
-
|
|
486
|
-
if (
|
|
487
|
-
|
|
463
|
+
_context4.t0 = _context4.sent;
|
|
464
|
+
if (_context4.t0) {
|
|
465
|
+
_context4.next = 11;
|
|
488
466
|
break;
|
|
489
467
|
}
|
|
490
|
-
|
|
468
|
+
_context4.t0 = {};
|
|
491
469
|
case 11:
|
|
492
|
-
_ref9 =
|
|
470
|
+
_ref9 = _context4.t0;
|
|
493
471
|
success = _ref9.success;
|
|
494
472
|
_ref9$result = _ref9.result;
|
|
495
473
|
result = _ref9$result === void 0 ? {} : _ref9$result;
|
|
@@ -498,19 +476,21 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
498
476
|
amounted.current = data;
|
|
499
477
|
}
|
|
500
478
|
case 16:
|
|
479
|
+
handleClearTimeout();
|
|
480
|
+
case 17:
|
|
501
481
|
case "end":
|
|
502
|
-
return
|
|
482
|
+
return _context4.stop();
|
|
503
483
|
}
|
|
504
|
-
},
|
|
484
|
+
}, _callee4);
|
|
505
485
|
})), 200);
|
|
506
486
|
}
|
|
507
|
-
case
|
|
487
|
+
case 2:
|
|
508
488
|
case "end":
|
|
509
|
-
return
|
|
489
|
+
return _context5.stop();
|
|
510
490
|
}
|
|
511
|
-
},
|
|
491
|
+
}, _callee5);
|
|
512
492
|
}));
|
|
513
|
-
return function queryChart(
|
|
493
|
+
return function queryChart(_x4) {
|
|
514
494
|
return _ref7.apply(this, arguments);
|
|
515
495
|
};
|
|
516
496
|
}();
|
|
@@ -534,7 +514,31 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
534
514
|
})
|
|
535
515
|
}), /*#__PURE__*/React.createElement(ProTable, {
|
|
536
516
|
ref: tableRef,
|
|
537
|
-
config:
|
|
517
|
+
config: _extends({}, tableConfigDefault, {
|
|
518
|
+
pagination: {
|
|
519
|
+
showSizeChanger: true,
|
|
520
|
+
defaultPageSize: defaultPageSize
|
|
521
|
+
},
|
|
522
|
+
summary: summary,
|
|
523
|
+
request: function request(data) {
|
|
524
|
+
var _data$pagination, _data$pagination2, _data$sorter;
|
|
525
|
+
var pagination = {
|
|
526
|
+
pageNum: (_data$pagination = data.pagination) === null || _data$pagination === void 0 ? void 0 : _data$pagination.current,
|
|
527
|
+
pageSize: (_data$pagination2 = data.pagination) === null || _data$pagination2 === void 0 ? void 0 : _data$pagination2.pageSize
|
|
528
|
+
};
|
|
529
|
+
var orderBy = [];
|
|
530
|
+
if ((_data$sorter = data.sorter) !== null && _data$sorter !== void 0 && _data$sorter.order) {
|
|
531
|
+
var _data$sorter2, _data$sorter3, _data$sorter3$order;
|
|
532
|
+
orderBy.push({
|
|
533
|
+
name: (_data$sorter2 = data.sorter) === null || _data$sorter2 === void 0 ? void 0 : _data$sorter2.field,
|
|
534
|
+
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)
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
return getDataSource(_extends({}, pagination, {
|
|
538
|
+
orderBy: orderBy
|
|
539
|
+
}));
|
|
540
|
+
}
|
|
541
|
+
})
|
|
538
542
|
})), /*#__PURE__*/React.createElement("div", {
|
|
539
543
|
style: {
|
|
540
544
|
display: isLink ? 'block' : 'none'
|
|
@@ -63,8 +63,6 @@ export interface TypeZDataTableProps {
|
|
|
63
63
|
refreshRate?: number;
|
|
64
64
|
/** 记住勾选 */
|
|
65
65
|
remember?: boolean;
|
|
66
|
-
/** 导出 */
|
|
67
|
-
exporter?: boolean;
|
|
68
66
|
/** 操作列(表头)配置 */
|
|
69
67
|
actionJson?: {
|
|
70
68
|
/** 表头名称 */
|
|
@@ -80,6 +78,12 @@ export interface TypeZDataTableProps {
|
|
|
80
78
|
/** 自定义渲染方法 */
|
|
81
79
|
render?: (p: any) => React.ReactNode;
|
|
82
80
|
};
|
|
81
|
+
confirmConfig?: {
|
|
82
|
+
name?: string;
|
|
83
|
+
onClick?: () => void;
|
|
84
|
+
};
|
|
85
|
+
/** 导出 */
|
|
86
|
+
exporter?: boolean;
|
|
83
87
|
/** 导出配置 */
|
|
84
88
|
exportConfig?: {
|
|
85
89
|
name: string;
|
|
@@ -175,7 +175,7 @@ export var handleCondition = function handleCondition(value, handledValue, condi
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
// mock
|
|
178
|
-
var token = 'scm:tenant:token:2:104:
|
|
178
|
+
var token = 'scm:tenant:token:2:104:7c454641-c65c-4459-b5a3-d4be9fb16ffd';
|
|
179
179
|
|
|
180
180
|
/** 获取维度指标 */
|
|
181
181
|
export var getDimTarget = /*#__PURE__*/function () {
|