@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/es/components/{z-templates-data-common → z-data-table}/components/custom-renderer/index.js
RENAMED
|
@@ -7,12 +7,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
7
7
|
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; }
|
|
8
8
|
import { useState, useEffect, useRef, useContext, useImperativeHandle } from 'react';
|
|
9
9
|
import { RcConfigContext } from '@ztocwst/rc-pro';
|
|
10
|
-
import { separator, timeUnit, handleQueryParams, getReportData } from "../../data-
|
|
10
|
+
import { separator, timeUnit, handleQueryParams, getReportData } from "../../data-table.helper";
|
|
11
11
|
import LinkRenderer from "../link-renderer";
|
|
12
12
|
var CustomRenderer = function CustomRenderer(props) {
|
|
13
13
|
var _props$child;
|
|
14
14
|
var _ref = props || {},
|
|
15
|
-
|
|
15
|
+
currentKey = _ref.currentKey,
|
|
16
16
|
autoLoad = _ref.autoLoad,
|
|
17
17
|
refreshRate = _ref.refreshRate,
|
|
18
18
|
dataSetName = _ref.dataSetName,
|
|
@@ -20,6 +20,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
20
20
|
indexJson = _ref.indexJson,
|
|
21
21
|
linkPage = _ref.linkPage,
|
|
22
22
|
linkPageTitle = _ref.linkPageTitle,
|
|
23
|
+
chartRef = _ref.chartRef,
|
|
23
24
|
onConfirm = _ref.onConfirm,
|
|
24
25
|
formatter = _ref.formatter;
|
|
25
26
|
var rcProContext = useContext(RcConfigContext);
|
|
@@ -121,28 +122,37 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
121
122
|
timer = null;
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}, refreshRate * timeUnit);
|
|
134
|
-
} else {
|
|
135
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
136
|
-
}
|
|
125
|
+
var onload = function onload() {
|
|
126
|
+
if (autoLoad) {
|
|
127
|
+
if (refreshRate) {
|
|
128
|
+
handleClearInterval();
|
|
129
|
+
timer = window.setInterval(function () {
|
|
130
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
131
|
+
}, refreshRate * timeUnit);
|
|
132
|
+
} else {
|
|
133
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
137
134
|
}
|
|
138
135
|
} else {
|
|
139
136
|
handleClearInterval();
|
|
140
137
|
}
|
|
138
|
+
};
|
|
139
|
+
useEffect(function () {
|
|
140
|
+
if (currentKey) {
|
|
141
|
+
var _ref4 = currentKey.split(separator) || [],
|
|
142
|
+
curDataSetName = _ref4[0];
|
|
143
|
+
if (curDataSetName === dataSetName) {
|
|
144
|
+
onload();
|
|
145
|
+
} else {
|
|
146
|
+
handleClearInterval();
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
onload();
|
|
150
|
+
}
|
|
141
151
|
return function () {
|
|
142
152
|
handleClearInterval();
|
|
143
153
|
};
|
|
144
|
-
}, [
|
|
145
|
-
useImperativeHandle(
|
|
154
|
+
}, [currentKey, autoLoad]);
|
|
155
|
+
useImperativeHandle(chartRef, function () {
|
|
146
156
|
return {
|
|
147
157
|
onLink: onLink,
|
|
148
158
|
queryChart: queryChart
|
|
@@ -154,7 +164,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
154
164
|
}
|
|
155
165
|
}, /*#__PURE__*/React.createElement(_Spin, {
|
|
156
166
|
spinning: loading
|
|
157
|
-
}, (_props$child = props.child) === null || _props$child === void 0 ? void 0 : _props$child.call(props, result))), /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
}, props === null || props === void 0 ? void 0 : (_props$child = props.child) === null || _props$child === void 0 ? void 0 : _props$child.call(props, result))), /*#__PURE__*/React.createElement("div", {
|
|
158
168
|
style: {
|
|
159
169
|
display: isLink ? 'block' : 'none'
|
|
160
170
|
}
|
package/es/components/{z-templates-data-common → z-data-table}/components/dim-target/index.js
RENAMED
|
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
import React, { useState, useEffect, useImperativeHandle, useContext } from 'react';
|
|
12
12
|
import { ProButton, RcConfigContext } from '@ztocwst/rc-pro';
|
|
13
|
-
import { getMaxWidth, saveDimTarget } from "../../data-
|
|
13
|
+
import { getMaxWidth, saveDimTarget } from "../../data-table.helper";
|
|
14
14
|
import useUpdateEffect from "./useUpdateEffect";
|
|
15
15
|
import "./index.less";
|
|
16
16
|
var DimsDefault = {
|
|
@@ -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/es/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.js
RENAMED
|
@@ -13,7 +13,7 @@ import { useEffect, useState, useRef, useContext, useImperativeHandle } from 're
|
|
|
13
13
|
import { ProTable, ProButton, RcConfigContext } from '@ztocwst/rc-pro';
|
|
14
14
|
import { ArrowLeftOutlined } from '@ant-design/icons';
|
|
15
15
|
import moment from 'moment';
|
|
16
|
-
import { tableConfigDefault, dateStart, separator, timeUnit, defaultSort, getType, getMaxWidth, handleQueryParams, getReportData } from "../../data-
|
|
16
|
+
import { tableConfigDefault, dateStart, separator, timeUnit, defaultSort, getType, getMaxWidth, handleQueryParams, getReportData } from "../../data-table.helper";
|
|
17
17
|
import { handleDimTargetFormat, handleColumns } from "../table-renderer/table-renderer.helper";
|
|
18
18
|
import "./index.less";
|
|
19
19
|
var linkStateDefault = {
|
|
@@ -125,7 +125,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
125
125
|
find = _objectWithoutPropertiesLoose(_linkPage$index, _excluded);
|
|
126
126
|
var _ref3 = handleDimTargetFormat(find) || {},
|
|
127
127
|
targets = _ref3.targets;
|
|
128
|
-
var queryCache = queryCacheRef.current;
|
|
128
|
+
var queryCache = queryCacheRef.current || {};
|
|
129
129
|
var query = {};
|
|
130
130
|
var queryKeys = Object.keys(queryCache);
|
|
131
131
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
@@ -396,6 +396,9 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
396
396
|
items: [{
|
|
397
397
|
action: 'btn',
|
|
398
398
|
name: linkState === null || linkState === void 0 ? void 0 : linkState.exportConfig.name,
|
|
399
|
+
props: {
|
|
400
|
+
disabled: !queryCacheRef.current
|
|
401
|
+
},
|
|
399
402
|
fileConfig: {
|
|
400
403
|
type: 'export',
|
|
401
404
|
params: {
|
package/es/components/{z-templates-data-common → z-data-table}/components/table-renderer/index.js
RENAMED
|
@@ -10,19 +10,20 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
10
10
|
import { useRef, useState, useEffect, useImperativeHandle, useContext } from 'react';
|
|
11
11
|
import { ProTable, RcConfigContext } from '@ztocwst/rc-pro';
|
|
12
12
|
import moment from 'moment';
|
|
13
|
-
import { tableConfigDefault, dateStart, separator, timeUnit, defaultSort, getType, handleQueryParams, getReportData } from "../../data-
|
|
13
|
+
import { tableConfigDefault, dateStart, separator, timeUnit, defaultSort, getType, handleQueryParams, getReportData } from "../../data-table.helper";
|
|
14
14
|
import { handleColumns, handleValueFormat, getDimTargetData } from "./table-renderer.helper";
|
|
15
15
|
import DimTarget from "../dim-target";
|
|
16
16
|
import LinkRenderer from "../link-renderer";
|
|
17
17
|
var TableRenderer = function TableRenderer(props) {
|
|
18
18
|
var _tableOptions$paginat;
|
|
19
|
-
var
|
|
19
|
+
var currentKey = props.currentKey,
|
|
20
20
|
autoLoad = props.autoLoad,
|
|
21
21
|
refreshRate = props.refreshRate,
|
|
22
22
|
dataSetName = props.dataSetName,
|
|
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,
|
|
@@ -64,20 +65,25 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
64
65
|
return (dimTargetRef === null || dimTargetRef === void 0 ? void 0 : (_dimTargetRef$current = dimTargetRef.current) === null || _dimTargetRef$current === void 0 ? void 0 : _dimTargetRef$current.getDimTargetValues()) || {};
|
|
65
66
|
};
|
|
66
67
|
var buttons = [{
|
|
67
|
-
name:
|
|
68
|
+
name: confirmConfig === null || confirmConfig === void 0 ? void 0 : confirmConfig.name,
|
|
68
69
|
action: 'btn',
|
|
69
70
|
props: {
|
|
70
71
|
loading: loading,
|
|
71
72
|
type: 'primary'
|
|
72
73
|
},
|
|
73
74
|
onClick: function onClick() {
|
|
75
|
+
var _confirmConfig$onClic;
|
|
74
76
|
var option = getDimTargetValues();
|
|
75
77
|
handleUpdateColumns(option);
|
|
78
|
+
confirmConfig === null || confirmConfig === void 0 ? void 0 : (_confirmConfig$onClic = confirmConfig.onClick) === null || _confirmConfig$onClic === void 0 ? void 0 : _confirmConfig$onClic.call(confirmConfig);
|
|
76
79
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
77
80
|
}
|
|
78
81
|
}, exporter ? {
|
|
79
82
|
action: 'btn',
|
|
80
83
|
name: exportConfig === null || exportConfig === void 0 ? void 0 : exportConfig.name,
|
|
84
|
+
props: {
|
|
85
|
+
disabled: !queryCacheRef.current
|
|
86
|
+
},
|
|
81
87
|
fileConfig: {
|
|
82
88
|
type: 'export',
|
|
83
89
|
params: {
|
|
@@ -152,27 +158,13 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
152
158
|
dimension: dimension
|
|
153
159
|
}));
|
|
154
160
|
};
|
|
155
|
-
var handleUpdateColumns =
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
columns = handleColumns(_extends({}, option, {
|
|
163
|
-
actionJson: actionJson
|
|
164
|
-
}), expressions, linkPage, onLink);
|
|
165
|
-
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
166
|
-
case 2:
|
|
167
|
-
case "end":
|
|
168
|
-
return _context2.stop();
|
|
169
|
-
}
|
|
170
|
-
}, _callee2);
|
|
171
|
-
}));
|
|
172
|
-
return function handleUpdateColumns(_x2) {
|
|
173
|
-
return _ref3.apply(this, arguments);
|
|
174
|
-
};
|
|
175
|
-
}();
|
|
161
|
+
var handleUpdateColumns = function handleUpdateColumns(option) {
|
|
162
|
+
var _tableRef$current;
|
|
163
|
+
var columns = handleColumns(_extends({}, option, {
|
|
164
|
+
actionJson: actionJson
|
|
165
|
+
}), expressions, linkPage, onLink);
|
|
166
|
+
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
167
|
+
};
|
|
176
168
|
var getBigDataBody = function getBigDataBody(params) {
|
|
177
169
|
if (params === void 0) {
|
|
178
170
|
params = {};
|
|
@@ -188,7 +180,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
188
180
|
indexSource = _getDimTargetValues3$4 === void 0 ? [] : _getDimTargetValues3$4;
|
|
189
181
|
|
|
190
182
|
/** 通过 queryBind查看是否有绑定关系 有的话替换成绑定关系中的key 没有则是默认配置的key */
|
|
191
|
-
var queryCache = queryCacheRef.current;
|
|
183
|
+
var queryCache = queryCacheRef.current || {};
|
|
192
184
|
var query = {};
|
|
193
185
|
var queryKeys = Object.keys(queryCache);
|
|
194
186
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
@@ -293,57 +285,57 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
293
285
|
|
|
294
286
|
// 获取数据源
|
|
295
287
|
var getDataSource = /*#__PURE__*/function () {
|
|
296
|
-
var
|
|
288
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(params) {
|
|
297
289
|
var data, _yield$getReportData, success, _yield$getReportData$, result;
|
|
298
|
-
return _regeneratorRuntime.wrap(function
|
|
299
|
-
while (1) switch (
|
|
290
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
291
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
300
292
|
case 0:
|
|
301
293
|
if (params === void 0) {
|
|
302
294
|
params = {};
|
|
303
295
|
}
|
|
304
296
|
if (!loading) {
|
|
305
|
-
|
|
297
|
+
_context2.next = 3;
|
|
306
298
|
break;
|
|
307
299
|
}
|
|
308
|
-
return
|
|
300
|
+
return _context2.abrupt("return");
|
|
309
301
|
case 3:
|
|
310
|
-
|
|
302
|
+
_context2.prev = 3;
|
|
311
303
|
data = getBigDataBody(params);
|
|
312
304
|
setLoading(true);
|
|
313
|
-
|
|
305
|
+
_context2.next = 8;
|
|
314
306
|
return getReportData(rcProContext, data);
|
|
315
307
|
case 8:
|
|
316
|
-
_yield$getReportData =
|
|
308
|
+
_yield$getReportData = _context2.sent;
|
|
317
309
|
success = _yield$getReportData.success;
|
|
318
310
|
_yield$getReportData$ = _yield$getReportData.result;
|
|
319
311
|
result = _yield$getReportData$ === void 0 ? {} : _yield$getReportData$;
|
|
320
312
|
setLoading(false);
|
|
321
|
-
return
|
|
313
|
+
return _context2.abrupt("return", {
|
|
322
314
|
success: success,
|
|
323
315
|
result: result
|
|
324
316
|
});
|
|
325
317
|
case 16:
|
|
326
|
-
|
|
327
|
-
|
|
318
|
+
_context2.prev = 16;
|
|
319
|
+
_context2.t0 = _context2["catch"](3);
|
|
328
320
|
setLoading(false);
|
|
329
|
-
console.error(
|
|
321
|
+
console.error(_context2.t0);
|
|
330
322
|
case 20:
|
|
331
323
|
case "end":
|
|
332
|
-
return
|
|
324
|
+
return _context2.stop();
|
|
333
325
|
}
|
|
334
|
-
},
|
|
326
|
+
}, _callee2, null, [[3, 16]]);
|
|
335
327
|
}));
|
|
336
|
-
return function getDataSource(
|
|
337
|
-
return
|
|
328
|
+
return function getDataSource(_x2) {
|
|
329
|
+
return _ref3.apply(this, arguments);
|
|
338
330
|
};
|
|
339
331
|
}();
|
|
340
332
|
var initial = /*#__PURE__*/function () {
|
|
341
|
-
var
|
|
333
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(params) {
|
|
342
334
|
var result, dims, targets, option;
|
|
343
|
-
return _regeneratorRuntime.wrap(function
|
|
344
|
-
while (1) switch (
|
|
335
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
336
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
345
337
|
case 0:
|
|
346
|
-
|
|
338
|
+
_context3.next = 2;
|
|
347
339
|
return getDimTargetData(rcProContext, _extends({
|
|
348
340
|
dataSetName: dataSetName
|
|
349
341
|
}, params), {
|
|
@@ -351,7 +343,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
351
343
|
indexJson: indexJson
|
|
352
344
|
});
|
|
353
345
|
case 2:
|
|
354
|
-
result =
|
|
346
|
+
result = _context3.sent;
|
|
355
347
|
if (result) {
|
|
356
348
|
dims = result.dims, targets = result.targets;
|
|
357
349
|
option = {
|
|
@@ -390,12 +382,12 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
390
382
|
}
|
|
391
383
|
case 4:
|
|
392
384
|
case "end":
|
|
393
|
-
return
|
|
385
|
+
return _context3.stop();
|
|
394
386
|
}
|
|
395
|
-
},
|
|
387
|
+
}, _callee3);
|
|
396
388
|
}));
|
|
397
|
-
return function initial(
|
|
398
|
-
return
|
|
389
|
+
return function initial(_x3) {
|
|
390
|
+
return _ref4.apply(this, arguments);
|
|
399
391
|
};
|
|
400
392
|
}();
|
|
401
393
|
useEffect(function () {
|
|
@@ -409,42 +401,51 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
409
401
|
timer = null;
|
|
410
402
|
}
|
|
411
403
|
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}, refreshRate * timeUnit);
|
|
422
|
-
} else {
|
|
423
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
424
|
-
}
|
|
404
|
+
var onload = function onload() {
|
|
405
|
+
if (autoLoad) {
|
|
406
|
+
if (refreshRate) {
|
|
407
|
+
handleClearInterval();
|
|
408
|
+
timer = window.setInterval(function () {
|
|
409
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
410
|
+
}, refreshRate * timeUnit);
|
|
411
|
+
} else {
|
|
412
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
425
413
|
}
|
|
426
414
|
} else {
|
|
427
415
|
handleClearInterval();
|
|
428
416
|
}
|
|
417
|
+
};
|
|
418
|
+
useEffect(function () {
|
|
419
|
+
if (currentKey) {
|
|
420
|
+
var _ref5 = currentKey.split(separator) || [],
|
|
421
|
+
curDataSetName = _ref5[0];
|
|
422
|
+
if (curDataSetName === dataSetName) {
|
|
423
|
+
onload();
|
|
424
|
+
} else {
|
|
425
|
+
handleClearInterval();
|
|
426
|
+
}
|
|
427
|
+
} else {
|
|
428
|
+
onload();
|
|
429
|
+
}
|
|
429
430
|
return function () {
|
|
430
431
|
handleClearInterval();
|
|
431
432
|
};
|
|
432
|
-
}, [
|
|
433
|
+
}, [currentKey, autoLoad]);
|
|
433
434
|
var queryChart = /*#__PURE__*/function () {
|
|
434
|
-
var
|
|
435
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(value) {
|
|
435
436
|
var _linkChartRef$current3;
|
|
436
|
-
return _regeneratorRuntime.wrap(function
|
|
437
|
-
while (1) switch (
|
|
437
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
438
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
438
439
|
case 0:
|
|
439
440
|
if (isLink) {
|
|
440
441
|
(_linkChartRef$current3 = linkChartRef.current) === null || _linkChartRef$current3 === void 0 ? void 0 : _linkChartRef$current3.queryChart(value);
|
|
441
442
|
} else {
|
|
442
443
|
queryCacheRef.current = value[dataSetName] || value;
|
|
443
|
-
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
444
|
+
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
444
445
|
var _tableRef$current2;
|
|
445
|
-
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur,
|
|
446
|
-
return _regeneratorRuntime.wrap(function
|
|
447
|
-
while (1) switch (
|
|
446
|
+
var _getDimTargetValues4, _getDimTargetValues4$, indexSource, indexAmounted, target, _iterator4, _step4, cur, _ref8, success, _ref8$result, result, _result$data, _result$data$, data;
|
|
447
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
448
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
448
449
|
case 0:
|
|
449
450
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.refreshTable({
|
|
450
451
|
current: 1
|
|
@@ -454,7 +455,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
454
455
|
return cur.amounted;
|
|
455
456
|
});
|
|
456
457
|
if (!(indexAmounted !== null && indexAmounted !== void 0 && indexAmounted.length)) {
|
|
457
|
-
|
|
458
|
+
_context4.next = 16;
|
|
458
459
|
break;
|
|
459
460
|
}
|
|
460
461
|
target = [];
|
|
@@ -464,42 +465,42 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
464
465
|
description: cur.name
|
|
465
466
|
});
|
|
466
467
|
}
|
|
467
|
-
|
|
468
|
+
_context4.next = 8;
|
|
468
469
|
return getDataSource({
|
|
469
470
|
dim: [],
|
|
470
471
|
target: target
|
|
471
472
|
});
|
|
472
473
|
case 8:
|
|
473
|
-
|
|
474
|
-
if (
|
|
475
|
-
|
|
474
|
+
_context4.t0 = _context4.sent;
|
|
475
|
+
if (_context4.t0) {
|
|
476
|
+
_context4.next = 11;
|
|
476
477
|
break;
|
|
477
478
|
}
|
|
478
|
-
|
|
479
|
+
_context4.t0 = {};
|
|
479
480
|
case 11:
|
|
480
|
-
|
|
481
|
-
success =
|
|
482
|
-
|
|
483
|
-
result =
|
|
481
|
+
_ref8 = _context4.t0;
|
|
482
|
+
success = _ref8.success;
|
|
483
|
+
_ref8$result = _ref8.result;
|
|
484
|
+
result = _ref8$result === void 0 ? {} : _ref8$result;
|
|
484
485
|
if (success) {
|
|
485
486
|
_result$data = result === null || result === void 0 ? void 0 : result.data, _result$data$ = _result$data[0], data = _result$data$ === void 0 ? {} : _result$data$;
|
|
486
487
|
amounted.current = data;
|
|
487
488
|
}
|
|
488
489
|
case 16:
|
|
489
490
|
case "end":
|
|
490
|
-
return
|
|
491
|
+
return _context4.stop();
|
|
491
492
|
}
|
|
492
|
-
},
|
|
493
|
+
}, _callee4);
|
|
493
494
|
})), 200);
|
|
494
495
|
}
|
|
495
496
|
case 1:
|
|
496
497
|
case "end":
|
|
497
|
-
return
|
|
498
|
+
return _context5.stop();
|
|
498
499
|
}
|
|
499
|
-
},
|
|
500
|
+
}, _callee5);
|
|
500
501
|
}));
|
|
501
|
-
return function queryChart(
|
|
502
|
-
return
|
|
502
|
+
return function queryChart(_x4) {
|
|
503
|
+
return _ref6.apply(this, arguments);
|
|
503
504
|
};
|
|
504
505
|
}();
|
|
505
506
|
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;
|
|
@@ -6,7 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
8
|
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; }
|
|
9
|
-
import { separator, defaultSort, computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-
|
|
9
|
+
import { separator, defaultSort, computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-table.helper";
|
|
10
10
|
export var stringTrim = function stringTrim(str) {
|
|
11
11
|
if (!str) return '';
|
|
12
12
|
return str.replace(/`|'|"/g, '');
|