@ztocwst/rc-pro-materials 0.2.23 → 0.2.25
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 +5 -5
- package/build/lowcode/view.js +5 -5
- package/dist/SCM_Comps.js +3 -3
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-data-table/components/custom-renderer/index.d.ts +4 -0
- package/es/components/{z-templates-data-common → z-data-table}/components/custom-renderer/index.js +28 -18
- package/{lib/components/z-templates-data-common → es/components/z-data-table}/components/dim-target/dim-target.helper.d.ts +1 -1
- package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/index.js +1 -1
- package/es/components/z-data-table/components/link-renderer/index.d.ts +16 -0
- package/es/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.js +5 -2
- package/es/components/z-data-table/components/table-renderer/index.d.ts +4 -0
- package/es/components/{z-templates-data-common → z-data-table}/components/table-renderer/index.js +88 -87
- package/es/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.d.ts +9 -9
- package/es/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.js +1 -1
- package/es/components/z-data-table/data-table.d.ts +120 -0
- package/es/components/{z-templates-data-common/data-common.helper.js → z-data-table/data-table.helper.js} +1 -1
- package/es/components/z-data-table/data-table.js +52 -0
- package/es/components/z-data-table/index.d.ts +7 -0
- package/es/components/z-data-table/index.js +5 -0
- package/es/components/z-templates-data-common/components/chart-renderer/index.d.ts +1 -1
- package/es/components/z-templates-data-common/components/chart-renderer/index.js +18 -9
- package/es/components/z-templates-data-common/data-common.d.ts +2 -111
- package/es/components/z-templates-data-common/data-common.js +10 -11
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/style.js +4 -4
- package/es/utils/props/form.js +5 -2
- package/lib/components/z-data-table/components/custom-renderer/index.d.ts +4 -0
- package/lib/components/{z-templates-data-common → z-data-table}/components/custom-renderer/index.js +30 -20
- package/{es/components/z-templates-data-common → lib/components/z-data-table}/components/dim-target/dim-target.helper.d.ts +1 -1
- package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/index.js +3 -3
- package/lib/components/z-data-table/components/link-renderer/index.d.ts +16 -0
- package/lib/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.js +18 -15
- package/lib/components/z-data-table/components/table-renderer/index.d.ts +4 -0
- package/lib/components/{z-templates-data-common → z-data-table}/components/table-renderer/index.js +96 -95
- package/lib/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.d.ts +9 -9
- package/lib/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.js +12 -12
- package/lib/components/z-data-table/data-table.d.ts +120 -0
- package/lib/components/{z-templates-data-common/data-common.helper.js → z-data-table/data-table.helper.js} +1 -1
- package/lib/components/z-data-table/data-table.js +58 -0
- package/lib/components/z-data-table/index.d.ts +7 -0
- package/lib/components/z-data-table/index.js +14 -0
- package/lib/components/z-templates-data-common/components/chart-renderer/index.d.ts +1 -1
- package/lib/components/z-templates-data-common/components/chart-renderer/index.js +24 -15
- package/lib/components/z-templates-data-common/data-common.d.ts +2 -111
- package/lib/components/z-templates-data-common/data-common.js +10 -10
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/style.js +2 -2
- package/lib/utils/props/form.js +5 -2
- package/package.json +3 -3
- package/es/components/z-templates-data-common/components/custom-renderer/index.d.ts +0 -13
- package/es/components/z-templates-data-common/components/link-renderer/index.d.ts +0 -16
- package/es/components/z-templates-data-common/components/table-renderer/index.d.ts +0 -6
- package/lib/components/z-templates-data-common/components/custom-renderer/index.d.ts +0 -13
- package/lib/components/z-templates-data-common/components/link-renderer/index.d.ts +0 -16
- package/lib/components/z-templates-data-common/components/table-renderer/index.d.ts +0 -6
- /package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/dim-target.helper.js +0 -0
- /package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/index.d.ts +0 -0
- /package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/index.less +0 -0
- /package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/useUpdateEffect.d.ts +0 -0
- /package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/useUpdateEffect.js +0 -0
- /package/es/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.less +0 -0
- /package/es/components/{z-templates-data-common/data-common.helper.d.ts → z-data-table/data-table.helper.d.ts} +0 -0
- /package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/dim-target.helper.js +0 -0
- /package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/index.d.ts +0 -0
- /package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/index.less +0 -0
- /package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/useUpdateEffect.d.ts +0 -0
- /package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/useUpdateEffect.js +0 -0
- /package/lib/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.less +0 -0
- /package/lib/components/{z-templates-data-common/data-common.helper.d.ts → z-data-table/data-table.helper.d.ts} +0 -0
package/lib/components/{z-templates-data-common → z-data-table}/components/dim-target/index.js
RENAMED
|
@@ -10,7 +10,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _rcPro = require("@ztocwst/rc-pro");
|
|
13
|
-
var
|
|
13
|
+
var _dataTable = require("../../data-table.helper");
|
|
14
14
|
var _useUpdateEffect = _interopRequireDefault(require("./useUpdateEffect"));
|
|
15
15
|
require("./index.less");
|
|
16
16
|
var _excluded = ["checked"],
|
|
@@ -69,7 +69,7 @@ var DimTarget = function DimTarget(_ref) {
|
|
|
69
69
|
var _item = _step2.value;
|
|
70
70
|
dimensionIndex.push(_item.name);
|
|
71
71
|
}
|
|
72
|
-
setDimTargetWidth((0,
|
|
72
|
+
setDimTargetWidth((0, _dataTable.getMaxWidth)(dimensionIndex));
|
|
73
73
|
setDims((0, _extends2["default"])({}, DimsDefault, value === null || value === void 0 ? void 0 : value.dims));
|
|
74
74
|
setTargets((0, _extends2["default"])({}, TargetsDefault, value === null || value === void 0 ? void 0 : value.targets));
|
|
75
75
|
setRememberCheck(value === null || value === void 0 ? void 0 : value.rememberCheck);
|
|
@@ -338,7 +338,7 @@ var DimTarget = function DimTarget(_ref) {
|
|
|
338
338
|
};
|
|
339
339
|
_context.prev = 8;
|
|
340
340
|
_context.next = 11;
|
|
341
|
-
return (0,
|
|
341
|
+
return (0, _dataTable.saveDimTarget)(rcProContext, data);
|
|
342
342
|
case 11:
|
|
343
343
|
_context.next = 16;
|
|
344
344
|
break;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CheckboxValueType } from 'antd/es/checkbox/Group';
|
|
3
|
+
import type { TypeZDataTableProps } from '../../data-table';
|
|
4
|
+
import './index.less';
|
|
5
|
+
export interface linkParamsType extends Pick<TypeZDataTableProps, 'dataSetName'> {
|
|
6
|
+
index?: number | string;
|
|
7
|
+
width?: number;
|
|
8
|
+
dimension?: CheckboxValueType[];
|
|
9
|
+
record?: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
export interface linkStateType extends linkParamsType, Pick<TypeZDataTableProps, 'chartTitle' | 'custom' | 'child' | 'title' | 'autoLoad' | 'refreshRate' | 'actionJson' | 'exporter' | 'exportConfig'> {
|
|
12
|
+
}
|
|
13
|
+
declare const LinkRenderer: (props: Pick<TypeZDataTableProps, "onConfirm" | "dimJson" | "linkPage" | "linkPageTitle" | "chartRef"> & {
|
|
14
|
+
onBack?: () => void;
|
|
15
|
+
}) => import("react").JSX.Element;
|
|
16
|
+
export default LinkRenderer;
|
package/lib/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.js
RENAMED
|
@@ -13,7 +13,7 @@ var _react = require("react");
|
|
|
13
13
|
var _rcPro = require("@ztocwst/rc-pro");
|
|
14
14
|
var _icons = require("@ant-design/icons");
|
|
15
15
|
var _moment = _interopRequireDefault(require("moment"));
|
|
16
|
-
var
|
|
16
|
+
var _dataTable = require("../../data-table.helper");
|
|
17
17
|
var _tableRenderer = require("../table-renderer/table-renderer.helper");
|
|
18
18
|
require("./index.less");
|
|
19
19
|
var _excluded = ["queryBind", "formatter"],
|
|
@@ -77,7 +77,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
77
77
|
handleClearInterval();
|
|
78
78
|
timer = window.setInterval(function () {
|
|
79
79
|
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
80
|
-
}, refreshRate *
|
|
80
|
+
}, refreshRate * _dataTable.timeUnit);
|
|
81
81
|
} else {
|
|
82
82
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
83
83
|
}
|
|
@@ -130,7 +130,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
130
130
|
find = (0, _objectWithoutPropertiesLoose2["default"])(_linkPage$index, _excluded);
|
|
131
131
|
var _ref3 = (0, _tableRenderer.handleDimTargetFormat)(find) || {},
|
|
132
132
|
targets = _ref3.targets;
|
|
133
|
-
var queryCache = queryCacheRef.current;
|
|
133
|
+
var queryCache = queryCacheRef.current || {};
|
|
134
134
|
var query = {};
|
|
135
135
|
var queryKeys = Object.keys(queryCache);
|
|
136
136
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
@@ -148,10 +148,10 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
148
148
|
var value = queryCache[k];
|
|
149
149
|
if (key) {
|
|
150
150
|
// 类型为时间时 处理
|
|
151
|
-
if ((0,
|
|
151
|
+
if ((0, _dataTable.getType)(value) === 'array' && value.length === 2 && value.some(function (d) {
|
|
152
152
|
return (0, _moment["default"])(d).isValid();
|
|
153
153
|
})) {
|
|
154
|
-
var i = key.includes(
|
|
154
|
+
var i = key.includes(_dataTable.dateStart) ? 0 : 1;
|
|
155
155
|
query[key] = value[i];
|
|
156
156
|
} else {
|
|
157
157
|
query[key] = value;
|
|
@@ -202,12 +202,12 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
202
202
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
203
203
|
orderBys.push({
|
|
204
204
|
name: cur.name,
|
|
205
|
-
sort:
|
|
205
|
+
sort: _dataTable.defaultSort
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
var queryParams = (0,
|
|
210
|
+
var queryParams = (0, _dataTable.handleQueryParams)(query);
|
|
211
211
|
var _params = params,
|
|
212
212
|
pageNum = _params.pageNum,
|
|
213
213
|
pageSize = _params.pageSize,
|
|
@@ -256,7 +256,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
256
256
|
if (linkState.custom) {
|
|
257
257
|
setLoading(true);
|
|
258
258
|
}
|
|
259
|
-
return _context.abrupt("return", (0,
|
|
259
|
+
return _context.abrupt("return", (0, _dataTable.getReportData)(rcProContext, queryData).then(function (_ref5) {
|
|
260
260
|
var success = _ref5.success,
|
|
261
261
|
_ref5$result = _ref5.result,
|
|
262
262
|
result = _ref5$result === void 0 ? {} : _ref5$result;
|
|
@@ -312,7 +312,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
312
312
|
linkTitle.push(item.title);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
var width = (0,
|
|
315
|
+
var width = (0, _dataTable.getMaxWidth)(linkTitle);
|
|
316
316
|
|
|
317
317
|
/** 二级页出现重复相同的时候 索引未配置正确 取dataSetName 出现最近一次下标 防止报错 */
|
|
318
318
|
if (!isNumber || isNumber && (index < 0 || index >= Length)) {
|
|
@@ -330,7 +330,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
330
330
|
index: index
|
|
331
331
|
});
|
|
332
332
|
/** 当前进入与上次进入link页不同时需要清空数据 */
|
|
333
|
-
var isSource = "" + paramsState.dataSetName +
|
|
333
|
+
var isSource = "" + paramsState.dataSetName + _dataTable.separator + index === "" + linkState.dataSetName + _dataTable.separator + (linkState === null || linkState === void 0 ? void 0 : linkState.index);
|
|
334
334
|
var isSame = JSON.stringify(paramsState === null || paramsState === void 0 ? void 0 : paramsState.record) === JSON.stringify(linkState === null || linkState === void 0 ? void 0 : linkState.record);
|
|
335
335
|
if (!currentState.custom && (!isSource || !isSame)) {
|
|
336
336
|
var _tableRef$current2, _tableRef$current2$up;
|
|
@@ -363,7 +363,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
363
363
|
var handleLinkChange = function handleLinkChange(event) {
|
|
364
364
|
var value = event.target.value;
|
|
365
365
|
// dataSetName 可能会重复配置 所以使用 dataSetName + 分隔符 + index
|
|
366
|
-
var _ref7 = (value === null || value === void 0 ? void 0 : value.split(
|
|
366
|
+
var _ref7 = (value === null || value === void 0 ? void 0 : value.split(_dataTable.separator)) || [],
|
|
367
367
|
dataSetName = _ref7[0],
|
|
368
368
|
index = _ref7[1];
|
|
369
369
|
var currentState = linkPage[index];
|
|
@@ -383,12 +383,12 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
383
383
|
}), /*#__PURE__*/React.createElement("span", null, linkState.chartTitle || linkPageTitle)), (linkPage === null || linkPage === void 0 ? void 0 : (_linkPage$filter = linkPage.filter(function (field) {
|
|
384
384
|
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName && (field === null || field === void 0 ? void 0 : field.chartTitle) === linkState.chartTitle;
|
|
385
385
|
})) === null || _linkPage$filter === void 0 ? void 0 : _linkPage$filter.length) <= 1 ? null : /*#__PURE__*/React.createElement(_radio["default"].Group, {
|
|
386
|
-
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) +
|
|
386
|
+
value: "" + (linkState === null || linkState === void 0 ? void 0 : linkState.dataSetName) + _dataTable.separator + linkState.index,
|
|
387
387
|
onChange: handleLinkChange
|
|
388
388
|
}, linkPage === null || linkPage === void 0 ? void 0 : linkPage.map(function (field, index) {
|
|
389
389
|
return (field === null || field === void 0 ? void 0 : field.dataSetName) === linkState.dataSetName && (field === null || field === void 0 ? void 0 : field.chartTitle) === linkState.chartTitle ? /*#__PURE__*/React.createElement(_radio["default"].Button, {
|
|
390
|
-
value: "" + (field === null || field === void 0 ? void 0 : field.dataSetName) +
|
|
391
|
-
key: "" + (field === null || field === void 0 ? void 0 : field.dataSetName) +
|
|
390
|
+
value: "" + (field === null || field === void 0 ? void 0 : field.dataSetName) + _dataTable.separator + index.toString(),
|
|
391
|
+
key: "" + (field === null || field === void 0 ? void 0 : field.dataSetName) + _dataTable.separator + index.toString()
|
|
392
392
|
}, /*#__PURE__*/React.createElement("div", {
|
|
393
393
|
style: {
|
|
394
394
|
textAlign: 'center',
|
|
@@ -401,6 +401,9 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
401
401
|
items: [{
|
|
402
402
|
action: 'btn',
|
|
403
403
|
name: linkState === null || linkState === void 0 ? void 0 : linkState.exportConfig.name,
|
|
404
|
+
props: {
|
|
405
|
+
disabled: !queryCacheRef.current
|
|
406
|
+
},
|
|
404
407
|
fileConfig: {
|
|
405
408
|
type: 'export',
|
|
406
409
|
params: {
|
|
@@ -443,7 +446,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
443
446
|
spinning: loading
|
|
444
447
|
}, (_linkState$child = linkState.child) === null || _linkState$child === void 0 ? void 0 : _linkState$child.call(linkState, result)) : /*#__PURE__*/React.createElement(_rcPro.ProTable, {
|
|
445
448
|
ref: tableRef,
|
|
446
|
-
config: (0, _extends2["default"])({},
|
|
449
|
+
config: (0, _extends2["default"])({}, _dataTable.tableConfigDefault, {
|
|
447
450
|
pagination: {
|
|
448
451
|
showSizeChanger: true,
|
|
449
452
|
defaultPageSize: defaultPageSize
|
package/lib/components/{z-templates-data-common → z-data-table}/components/table-renderer/index.js
RENAMED
|
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _rcPro = require("@ztocwst/rc-pro");
|
|
13
13
|
var _moment = _interopRequireDefault(require("moment"));
|
|
14
|
-
var
|
|
14
|
+
var _dataTable = require("../../data-table.helper");
|
|
15
15
|
var _tableRenderer = require("./table-renderer.helper");
|
|
16
16
|
var _dimTarget = _interopRequireDefault(require("../dim-target"));
|
|
17
17
|
var _linkRenderer = _interopRequireDefault(require("../link-renderer"));
|
|
@@ -21,13 +21,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
21
21
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
22
22
|
var TableRenderer = function TableRenderer(props) {
|
|
23
23
|
var _tableOptions$paginat;
|
|
24
|
-
var
|
|
24
|
+
var currentKey = props.currentKey,
|
|
25
25
|
autoLoad = props.autoLoad,
|
|
26
26
|
refreshRate = props.refreshRate,
|
|
27
27
|
dataSetName = props.dataSetName,
|
|
28
28
|
remember = props.remember,
|
|
29
29
|
exporter = props.exporter,
|
|
30
30
|
exportConfig = props.exportConfig,
|
|
31
|
+
confirmConfig = props.confirmConfig,
|
|
31
32
|
dimJson = props.dimJson,
|
|
32
33
|
indexJson = props.indexJson,
|
|
33
34
|
actionJson = props.actionJson,
|
|
@@ -44,7 +45,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
44
45
|
var _useState = (0, _react.useState)(false),
|
|
45
46
|
loading = _useState[0],
|
|
46
47
|
setLoading = _useState[1];
|
|
47
|
-
var _useState2 = (0, _react.useState)(
|
|
48
|
+
var _useState2 = (0, _react.useState)(_dataTable.tableConfigDefault),
|
|
48
49
|
config = _useState2[0],
|
|
49
50
|
setConfig = _useState2[1];
|
|
50
51
|
/** 维度指标初始数据 */
|
|
@@ -69,20 +70,25 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
69
70
|
return (dimTargetRef === null || dimTargetRef === void 0 ? void 0 : (_dimTargetRef$current = dimTargetRef.current) === null || _dimTargetRef$current === void 0 ? void 0 : _dimTargetRef$current.getDimTargetValues()) || {};
|
|
70
71
|
};
|
|
71
72
|
var buttons = [{
|
|
72
|
-
name:
|
|
73
|
+
name: confirmConfig === null || confirmConfig === void 0 ? void 0 : confirmConfig.name,
|
|
73
74
|
action: 'btn',
|
|
74
75
|
props: {
|
|
75
76
|
loading: loading,
|
|
76
77
|
type: 'primary'
|
|
77
78
|
},
|
|
78
79
|
onClick: function onClick() {
|
|
80
|
+
var _confirmConfig$onClic;
|
|
79
81
|
var option = getDimTargetValues();
|
|
80
82
|
handleUpdateColumns(option);
|
|
83
|
+
confirmConfig === null || confirmConfig === void 0 ? void 0 : (_confirmConfig$onClic = confirmConfig.onClick) === null || _confirmConfig$onClic === void 0 ? void 0 : _confirmConfig$onClic.call(confirmConfig);
|
|
81
84
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
82
85
|
}
|
|
83
86
|
}, exporter ? {
|
|
84
87
|
action: 'btn',
|
|
85
88
|
name: exportConfig === null || exportConfig === void 0 ? void 0 : exportConfig.name,
|
|
89
|
+
props: {
|
|
90
|
+
disabled: !queryCacheRef.current
|
|
91
|
+
},
|
|
86
92
|
fileConfig: {
|
|
87
93
|
type: 'export',
|
|
88
94
|
params: {
|
|
@@ -157,27 +163,13 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
157
163
|
dimension: dimension
|
|
158
164
|
}));
|
|
159
165
|
};
|
|
160
|
-
var handleUpdateColumns =
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
columns = (0, _tableRenderer.handleColumns)((0, _extends2["default"])({}, option, {
|
|
168
|
-
actionJson: actionJson
|
|
169
|
-
}), expressions, linkPage, onLink);
|
|
170
|
-
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
171
|
-
case 2:
|
|
172
|
-
case "end":
|
|
173
|
-
return _context2.stop();
|
|
174
|
-
}
|
|
175
|
-
}, _callee2);
|
|
176
|
-
}));
|
|
177
|
-
return function handleUpdateColumns(_x2) {
|
|
178
|
-
return _ref3.apply(this, arguments);
|
|
179
|
-
};
|
|
180
|
-
}();
|
|
166
|
+
var handleUpdateColumns = function handleUpdateColumns(option) {
|
|
167
|
+
var _tableRef$current;
|
|
168
|
+
var columns = (0, _tableRenderer.handleColumns)((0, _extends2["default"])({}, option, {
|
|
169
|
+
actionJson: actionJson
|
|
170
|
+
}), expressions, linkPage, onLink);
|
|
171
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
172
|
+
};
|
|
181
173
|
var getBigDataBody = function getBigDataBody(params) {
|
|
182
174
|
if (params === void 0) {
|
|
183
175
|
params = {};
|
|
@@ -193,7 +185,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
193
185
|
indexSource = _getDimTargetValues3$4 === void 0 ? [] : _getDimTargetValues3$4;
|
|
194
186
|
|
|
195
187
|
/** 通过 queryBind查看是否有绑定关系 有的话替换成绑定关系中的key 没有则是默认配置的key */
|
|
196
|
-
var queryCache = queryCacheRef.current;
|
|
188
|
+
var queryCache = queryCacheRef.current || {};
|
|
197
189
|
var query = {};
|
|
198
190
|
var queryKeys = Object.keys(queryCache);
|
|
199
191
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
@@ -211,10 +203,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
211
203
|
var value = queryCache[k];
|
|
212
204
|
if (key) {
|
|
213
205
|
// 类型为时间时 处理
|
|
214
|
-
if ((0,
|
|
206
|
+
if ((0, _dataTable.getType)(value) === 'array' && value.length === 2 && value.some(function (d) {
|
|
215
207
|
return (0, _moment["default"])(d).isValid();
|
|
216
208
|
})) {
|
|
217
|
-
var i = key.includes(
|
|
209
|
+
var i = key.includes(_dataTable.dateStart) ? 0 : 1;
|
|
218
210
|
query[key] = value[i];
|
|
219
211
|
} else {
|
|
220
212
|
query[key] = value;
|
|
@@ -240,7 +232,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
240
232
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
241
233
|
orderBys.push({
|
|
242
234
|
name: cur.description,
|
|
243
|
-
sort:
|
|
235
|
+
sort: _dataTable.defaultSort
|
|
244
236
|
});
|
|
245
237
|
}
|
|
246
238
|
}
|
|
@@ -257,12 +249,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
257
249
|
if (_cur !== null && _cur !== void 0 && _cur.sorted) {
|
|
258
250
|
orderBys.push({
|
|
259
251
|
name: _cur.name,
|
|
260
|
-
sort:
|
|
252
|
+
sort: _dataTable.defaultSort
|
|
261
253
|
});
|
|
262
254
|
}
|
|
263
255
|
}
|
|
264
256
|
}
|
|
265
|
-
var queryParams = (0,
|
|
257
|
+
var queryParams = (0, _dataTable.handleQueryParams)(query);
|
|
266
258
|
var _params = params,
|
|
267
259
|
pageNum = _params.pageNum,
|
|
268
260
|
pageSize = _params.pageSize,
|
|
@@ -298,57 +290,57 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
298
290
|
|
|
299
291
|
// 获取数据源
|
|
300
292
|
var getDataSource = /*#__PURE__*/function () {
|
|
301
|
-
var
|
|
293
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(params) {
|
|
302
294
|
var data, _yield$getReportData, success, _yield$getReportData$, result;
|
|
303
|
-
return _regenerator["default"].wrap(function
|
|
304
|
-
while (1) switch (
|
|
295
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
296
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
305
297
|
case 0:
|
|
306
298
|
if (params === void 0) {
|
|
307
299
|
params = {};
|
|
308
300
|
}
|
|
309
301
|
if (!loading) {
|
|
310
|
-
|
|
302
|
+
_context2.next = 3;
|
|
311
303
|
break;
|
|
312
304
|
}
|
|
313
|
-
return
|
|
305
|
+
return _context2.abrupt("return");
|
|
314
306
|
case 3:
|
|
315
|
-
|
|
307
|
+
_context2.prev = 3;
|
|
316
308
|
data = getBigDataBody(params);
|
|
317
309
|
setLoading(true);
|
|
318
|
-
|
|
319
|
-
return (0,
|
|
310
|
+
_context2.next = 8;
|
|
311
|
+
return (0, _dataTable.getReportData)(rcProContext, data);
|
|
320
312
|
case 8:
|
|
321
|
-
_yield$getReportData =
|
|
313
|
+
_yield$getReportData = _context2.sent;
|
|
322
314
|
success = _yield$getReportData.success;
|
|
323
315
|
_yield$getReportData$ = _yield$getReportData.result;
|
|
324
316
|
result = _yield$getReportData$ === void 0 ? {} : _yield$getReportData$;
|
|
325
317
|
setLoading(false);
|
|
326
|
-
return
|
|
318
|
+
return _context2.abrupt("return", {
|
|
327
319
|
success: success,
|
|
328
320
|
result: result
|
|
329
321
|
});
|
|
330
322
|
case 16:
|
|
331
|
-
|
|
332
|
-
|
|
323
|
+
_context2.prev = 16;
|
|
324
|
+
_context2.t0 = _context2["catch"](3);
|
|
333
325
|
setLoading(false);
|
|
334
|
-
console.error(
|
|
326
|
+
console.error(_context2.t0);
|
|
335
327
|
case 20:
|
|
336
328
|
case "end":
|
|
337
|
-
return
|
|
329
|
+
return _context2.stop();
|
|
338
330
|
}
|
|
339
|
-
},
|
|
331
|
+
}, _callee2, null, [[3, 16]]);
|
|
340
332
|
}));
|
|
341
|
-
return function getDataSource(
|
|
342
|
-
return
|
|
333
|
+
return function getDataSource(_x2) {
|
|
334
|
+
return _ref3.apply(this, arguments);
|
|
343
335
|
};
|
|
344
336
|
}();
|
|
345
337
|
var initial = /*#__PURE__*/function () {
|
|
346
|
-
var
|
|
338
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(params) {
|
|
347
339
|
var result, dims, targets, option;
|
|
348
|
-
return _regenerator["default"].wrap(function
|
|
349
|
-
while (1) switch (
|
|
340
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
341
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
350
342
|
case 0:
|
|
351
|
-
|
|
343
|
+
_context3.next = 2;
|
|
352
344
|
return (0, _tableRenderer.getDimTargetData)(rcProContext, (0, _extends2["default"])({
|
|
353
345
|
dataSetName: dataSetName
|
|
354
346
|
}, params), {
|
|
@@ -356,7 +348,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
356
348
|
indexJson: indexJson
|
|
357
349
|
});
|
|
358
350
|
case 2:
|
|
359
|
-
result =
|
|
351
|
+
result = _context3.sent;
|
|
360
352
|
if (result) {
|
|
361
353
|
dims = result.dims, targets = result.targets;
|
|
362
354
|
option = {
|
|
@@ -367,7 +359,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
367
359
|
};
|
|
368
360
|
handleUpdateColumns(option);
|
|
369
361
|
setDimTargetValue(result);
|
|
370
|
-
setConfig((0, _extends2["default"])({},
|
|
362
|
+
setConfig((0, _extends2["default"])({}, _dataTable.tableConfigDefault, {
|
|
371
363
|
pagination: {
|
|
372
364
|
showSizeChanger: true,
|
|
373
365
|
defaultPageSize: defaultPageSize
|
|
@@ -395,12 +387,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
395
387
|
}
|
|
396
388
|
case 4:
|
|
397
389
|
case "end":
|
|
398
|
-
return
|
|
390
|
+
return _context3.stop();
|
|
399
391
|
}
|
|
400
|
-
},
|
|
392
|
+
}, _callee3);
|
|
401
393
|
}));
|
|
402
|
-
return function initial(
|
|
403
|
-
return
|
|
394
|
+
return function initial(_x3) {
|
|
395
|
+
return _ref4.apply(this, arguments);
|
|
404
396
|
};
|
|
405
397
|
}();
|
|
406
398
|
(0, _react.useEffect)(function () {
|
|
@@ -414,42 +406,51 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
414
406
|
timer = null;
|
|
415
407
|
}
|
|
416
408
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}, refreshRate * _dataCommon.timeUnit);
|
|
427
|
-
} else {
|
|
428
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
429
|
-
}
|
|
409
|
+
var onload = function onload() {
|
|
410
|
+
if (autoLoad) {
|
|
411
|
+
if (refreshRate) {
|
|
412
|
+
handleClearInterval();
|
|
413
|
+
timer = window.setInterval(function () {
|
|
414
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
415
|
+
}, refreshRate * _dataTable.timeUnit);
|
|
416
|
+
} else {
|
|
417
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
430
418
|
}
|
|
431
419
|
} else {
|
|
432
420
|
handleClearInterval();
|
|
433
421
|
}
|
|
422
|
+
};
|
|
423
|
+
(0, _react.useEffect)(function () {
|
|
424
|
+
if (currentKey) {
|
|
425
|
+
var _ref5 = currentKey.split(_dataTable.separator) || [],
|
|
426
|
+
curDataSetName = _ref5[0];
|
|
427
|
+
if (curDataSetName === dataSetName) {
|
|
428
|
+
onload();
|
|
429
|
+
} else {
|
|
430
|
+
handleClearInterval();
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
onload();
|
|
434
|
+
}
|
|
434
435
|
return function () {
|
|
435
436
|
handleClearInterval();
|
|
436
437
|
};
|
|
437
|
-
}, [
|
|
438
|
+
}, [currentKey, autoLoad]);
|
|
438
439
|
var queryChart = /*#__PURE__*/function () {
|
|
439
|
-
var
|
|
440
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(value) {
|
|
440
441
|
var _linkChartRef$current3;
|
|
441
|
-
return _regenerator["default"].wrap(function
|
|
442
|
-
while (1) switch (
|
|
442
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
443
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
443
444
|
case 0:
|
|
444
445
|
if (isLink) {
|
|
445
446
|
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(value);
|
|
446
447
|
} else {
|
|
447
448
|
queryCacheRef.current = value[dataSetName] || value;
|
|
448
|
-
setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
449
|
+
setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
449
450
|
var _tableRef$current2;
|
|
450
|
-
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur,
|
|
451
|
-
return _regenerator["default"].wrap(function
|
|
452
|
-
while (1) switch (
|
|
451
|
+
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur, _ref8, success, _ref8$result, result, _result$data, _result$data$, data;
|
|
452
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
453
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
453
454
|
case 0:
|
|
454
455
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.refreshTable({
|
|
455
456
|
current: 1
|
|
@@ -459,7 +460,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
459
460
|
return cur.amounted;
|
|
460
461
|
});
|
|
461
462
|
if (!(indexAmounted !== null && indexAmounted !== void 0 && indexAmounted.length)) {
|
|
462
|
-
|
|
463
|
+
_context4.next = 16;
|
|
463
464
|
break;
|
|
464
465
|
}
|
|
465
466
|
target = [];
|
|
@@ -469,42 +470,42 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
469
470
|
description: cur.name
|
|
470
471
|
});
|
|
471
472
|
}
|
|
472
|
-
|
|
473
|
+
_context4.next = 8;
|
|
473
474
|
return getDataSource({
|
|
474
475
|
dim: [],
|
|
475
476
|
target: target
|
|
476
477
|
});
|
|
477
478
|
case 8:
|
|
478
|
-
|
|
479
|
-
if (
|
|
480
|
-
|
|
479
|
+
_context4.t0 = _context4.sent;
|
|
480
|
+
if (_context4.t0) {
|
|
481
|
+
_context4.next = 11;
|
|
481
482
|
break;
|
|
482
483
|
}
|
|
483
|
-
|
|
484
|
+
_context4.t0 = {};
|
|
484
485
|
case 11:
|
|
485
|
-
|
|
486
|
-
success =
|
|
487
|
-
|
|
488
|
-
result =
|
|
486
|
+
_ref8 = _context4.t0;
|
|
487
|
+
success = _ref8.success;
|
|
488
|
+
_ref8$result = _ref8.result;
|
|
489
|
+
result = _ref8$result === void 0 ? {} : _ref8$result;
|
|
489
490
|
if (success) {
|
|
490
491
|
_result$data = result === null || result === void 0 ? void 0 : result.data, _result$data$ = _result$data[0], data = _result$data$ === void 0 ? {} : _result$data$;
|
|
491
492
|
amounted.current = data;
|
|
492
493
|
}
|
|
493
494
|
case 16:
|
|
494
495
|
case "end":
|
|
495
|
-
return
|
|
496
|
+
return _context4.stop();
|
|
496
497
|
}
|
|
497
|
-
},
|
|
498
|
+
}, _callee4);
|
|
498
499
|
})), 200);
|
|
499
500
|
}
|
|
500
501
|
case 1:
|
|
501
502
|
case "end":
|
|
502
|
-
return
|
|
503
|
+
return _context5.stop();
|
|
503
504
|
}
|
|
504
|
-
},
|
|
505
|
+
}, _callee5);
|
|
505
506
|
}));
|
|
506
|
-
return function queryChart(
|
|
507
|
-
return
|
|
507
|
+
return function queryChart(_x4) {
|
|
508
|
+
return _ref6.apply(this, arguments);
|
|
508
509
|
};
|
|
509
510
|
}();
|
|
510
511
|
(0, _react.useImperativeHandle)(chartRef, function () {
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TypeZDataTableProps } from '../../data-table';
|
|
2
|
+
import type { valueType } from '../../data-table.helper';
|
|
2
3
|
import type { linkParamsType } from '../link-renderer';
|
|
3
4
|
import type { DimTargetChangeOptionType } from '../dim-target/dim-target.helper';
|
|
4
|
-
import type { valueType } from '../../data-common.helper';
|
|
5
5
|
export declare const stringTrim: (str: string) => string;
|
|
6
6
|
/**
|
|
7
7
|
* 维度指标数据源处理
|
|
8
8
|
*/
|
|
9
|
-
export declare const handleDimTargetFormat: (dimTargetSource: Pick<
|
|
9
|
+
export declare const handleDimTargetFormat: (dimTargetSource: Pick<TypeZDataTableProps, 'dimJson' | 'indexJson'>, result?: Record<string, any>) => {
|
|
10
10
|
rememberCheck: boolean;
|
|
11
11
|
dims: {
|
|
12
12
|
all: boolean;
|
|
13
13
|
title: string;
|
|
14
14
|
indeterminate: boolean;
|
|
15
15
|
dimension: any[];
|
|
16
|
-
dimensionSource: Omit<import("../../data-
|
|
16
|
+
dimensionSource: Omit<import("../../data-table").TypeTargetProps, "amounted" | "enName" | "isFilter">[];
|
|
17
17
|
};
|
|
18
18
|
targets: {
|
|
19
19
|
all: boolean;
|
|
20
20
|
title: string;
|
|
21
21
|
indeterminate: boolean;
|
|
22
22
|
index: any[];
|
|
23
|
-
indexSource: import("../../data-
|
|
23
|
+
indexSource: import("../../data-table").TypeTargetProps[];
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* 获取维度指标数据源
|
|
28
28
|
*/
|
|
29
|
-
export declare const getDimTargetData: (rcProContext: any, params: Record<string, any>, dimTargetSource: Pick<
|
|
29
|
+
export declare const getDimTargetData: (rcProContext: any, params: Record<string, any>, dimTargetSource: Pick<TypeZDataTableProps, 'dimJson' | 'indexJson'>) => Promise<{
|
|
30
30
|
rememberCheck: boolean;
|
|
31
31
|
dims: {
|
|
32
32
|
all: boolean;
|
|
33
33
|
title: string;
|
|
34
34
|
indeterminate: boolean;
|
|
35
35
|
dimension: any[];
|
|
36
|
-
dimensionSource: Omit<import("../../data-
|
|
36
|
+
dimensionSource: Omit<import("../../data-table").TypeTargetProps, "amounted" | "enName" | "isFilter">[];
|
|
37
37
|
};
|
|
38
38
|
targets: {
|
|
39
39
|
all: boolean;
|
|
40
40
|
title: string;
|
|
41
41
|
indeterminate: boolean;
|
|
42
42
|
index: any[];
|
|
43
|
-
indexSource: import("../../data-
|
|
43
|
+
indexSource: import("../../data-table").TypeTargetProps[];
|
|
44
44
|
};
|
|
45
45
|
}>;
|
|
46
46
|
/**
|
|
@@ -54,7 +54,7 @@ export type ExpressionsType = any[] | [];
|
|
|
54
54
|
/**
|
|
55
55
|
* 根据维度指标获取表格列
|
|
56
56
|
*/
|
|
57
|
-
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<
|
|
57
|
+
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>, expressions?: ExpressionsType, linkPage?: TypeZDataTableProps[], onLink?: (v: linkParamsType) => void) => {
|
|
58
58
|
title: import("antd/es/checkbox/Group").CheckboxValueType;
|
|
59
59
|
dataIndex: string;
|
|
60
60
|
ellipsis: boolean;
|