@ztocwst/rc-pro-materials 0.2.22 → 0.2.24
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.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/dist/SCM_Comps.css +1 -1
- 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 +202 -102
- package/es/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.less +4 -0
- 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 +66 -25
- package/es/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.d.ts +10 -9
- package/es/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.js +23 -12
- package/es/components/z-data-table/data-table.d.ts +116 -0
- package/es/components/{z-templates-data-common/data-common.helper.d.ts → z-data-table/data-table.helper.d.ts} +2 -0
- package/es/components/{z-templates-data-common/data-common.helper.js → z-data-table/data-table.helper.js} +4 -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 +13 -8
- package/es/components/z-templates-data-common/data-common.d.ts +2 -111
- package/es/components/z-templates-data-common/data-common.js +1 -7
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/style.js +2 -2
- package/es/utils/props/form.js +5 -2
- package/es/utils/props/tpl.d.ts +2 -0
- 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 +208 -108
- package/lib/components/{z-templates-data-common → z-data-table}/components/link-renderer/index.less +4 -0
- 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 +72 -31
- package/lib/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.d.ts +10 -9
- package/lib/components/{z-templates-data-common → z-data-table}/components/table-renderer/table-renderer.helper.js +30 -19
- package/lib/components/z-data-table/data-table.d.ts +116 -0
- package/lib/components/{z-templates-data-common/data-common.helper.d.ts → z-data-table/data-table.helper.d.ts} +2 -0
- package/lib/components/{z-templates-data-common/data-common.helper.js → z-data-table/data-table.helper.js} +7 -3
- 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 +19 -14
- package/lib/components/z-templates-data-common/data-common.d.ts +2 -111
- package/lib/components/z-templates-data-common/data-common.js +1 -6
- 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/lib/utils/props/tpl.d.ts +2 -0
- package/package.json +4 -4
- 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/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
|
@@ -1,120 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ProFormRenderProps } from '@ztocwst/rc-pro';
|
|
3
|
-
|
|
4
|
-
export interface TypeTargetProps {
|
|
5
|
-
/** 指标名称 */
|
|
6
|
-
name: string;
|
|
7
|
-
/** 是否默认选中 */
|
|
8
|
-
checked: boolean;
|
|
9
|
-
/** 别名 */
|
|
10
|
-
alias: string;
|
|
11
|
-
/** 英文名 */
|
|
12
|
-
enName: string;
|
|
13
|
-
/** 是否过滤 */
|
|
14
|
-
isFilter: boolean;
|
|
15
|
-
/** 是否可选 */
|
|
16
|
-
optional: boolean;
|
|
17
|
-
/** 小数位 精确度 */
|
|
18
|
-
precision: number;
|
|
19
|
-
/** 是否展示百分号 */
|
|
20
|
-
percent: boolean;
|
|
21
|
-
/** 是否允许排序 */
|
|
22
|
-
sorted: boolean;
|
|
23
|
-
/** 宽度 */
|
|
24
|
-
width: number;
|
|
25
|
-
/** 是否合计 */
|
|
26
|
-
amounted: boolean;
|
|
27
|
-
/** 指标描述 */
|
|
28
|
-
description?: string;
|
|
29
|
-
/** 下转二级页 */
|
|
30
|
-
link?: string;
|
|
31
|
-
/** 查询绑定关系 */
|
|
32
|
-
queryBind?: string;
|
|
33
|
-
/** 依赖 */
|
|
34
|
-
dependencies?: string[];
|
|
35
|
-
}
|
|
36
|
-
/** 表格相关配置 */
|
|
37
|
-
export interface TypeChartSettingProps {
|
|
38
|
-
/** 二级页标题 */
|
|
39
|
-
chartTitle?: string;
|
|
40
|
-
/** 自定义渲染 */
|
|
41
|
-
custom?: boolean;
|
|
42
|
-
/** 自定义渲染方法 */
|
|
43
|
-
child?: (p: any) => React.ReactNode;
|
|
44
|
-
/** 标题 */
|
|
45
|
-
title?: string;
|
|
46
|
-
/** 维度配置 */
|
|
47
|
-
dimJson?: {
|
|
48
|
-
/** 维度标题 */
|
|
49
|
-
title: string;
|
|
50
|
-
/** 维度项配置 */
|
|
51
|
-
data: Array<Omit<TypeTargetProps, 'amounted' | 'enName' | 'isFilter'>>;
|
|
52
|
-
};
|
|
53
|
-
/** 指标配置 */
|
|
54
|
-
indexJson: {
|
|
55
|
-
title: string;
|
|
56
|
-
/** 指标项配置 */
|
|
57
|
-
data: TypeTargetProps[];
|
|
58
|
-
};
|
|
59
|
-
dataSetName: string;
|
|
60
|
-
/** 自动请求 */
|
|
61
|
-
autoLoad: boolean;
|
|
62
|
-
/** 刷新时间 */
|
|
63
|
-
refreshRate?: number;
|
|
64
|
-
/** 记住勾选 */
|
|
65
|
-
remember?: boolean;
|
|
66
|
-
/** 导出 */
|
|
67
|
-
exporter?: boolean;
|
|
68
|
-
/** 操作列(表头)配置 */
|
|
69
|
-
actionJson?: {
|
|
70
|
-
/** 表头名称 */
|
|
71
|
-
title: string;
|
|
72
|
-
/** 宽度 */
|
|
73
|
-
width?: number;
|
|
74
|
-
/** 固定列 */
|
|
75
|
-
isFixed: boolean;
|
|
76
|
-
/** 固定到 */
|
|
77
|
-
fixed?: string;
|
|
78
|
-
/** 自定义渲染 */
|
|
79
|
-
custom: boolean;
|
|
80
|
-
/** 自定义渲染方法 */
|
|
81
|
-
render?: (p: any) => React.ReactNode;
|
|
82
|
-
};
|
|
83
|
-
/** 导出配置 */
|
|
84
|
-
exportConfig?: {
|
|
85
|
-
name: string;
|
|
86
|
-
code: string;
|
|
87
|
-
menuId: string;
|
|
88
|
-
};
|
|
89
|
-
/** 条件格式设置 */
|
|
90
|
-
expressions?: any[] | [];
|
|
91
|
-
linkPageTitle?: string;
|
|
92
|
-
/** 下钻二级页设置 */
|
|
93
|
-
linkPage?: TypeChartSettingProps[];
|
|
94
|
-
/** 数据源参数"键"" 和 查询参数"值" 和 上一级维度(dim)"值" 关系绑定 */
|
|
95
|
-
queryBind?: Array<{
|
|
96
|
-
sourceQueryKey: string;
|
|
97
|
-
currentQueryKey: string;
|
|
98
|
-
parentDimKey: string;
|
|
99
|
-
}>;
|
|
100
|
-
/** chartRef */
|
|
101
|
-
chartRef?: React.Ref<{
|
|
102
|
-
queryChart: (v: Record<string, any>, d: string | undefined) => void;
|
|
103
|
-
}>;
|
|
104
|
-
/** 确认 */
|
|
105
|
-
onConfirm?: () => void;
|
|
106
|
-
/** 查询参数转换 */
|
|
107
|
-
formatter?: (v: Record<string, any>) => Record<string, any>;
|
|
108
|
-
}
|
|
3
|
+
import type { TypeZDataTableProps } from '../z-data-table';
|
|
109
4
|
export interface TypeZTemplatesDataCommonProps {
|
|
110
5
|
/** 查询表单配置 */
|
|
111
6
|
querySetting: ProFormRenderProps;
|
|
112
7
|
/** 内容区配置 */
|
|
113
|
-
chartSetting:
|
|
114
|
-
custom: boolean;
|
|
115
|
-
child: (p: any) => React.ReactNode;
|
|
116
|
-
title: string;
|
|
117
|
-
}> | React.ReactNode;
|
|
8
|
+
chartSetting: TypeZDataTableProps | TypeZDataTableProps[] | React.ReactNode;
|
|
118
9
|
_unsafe_MixedSetter_chartSetting_select?: any;
|
|
119
10
|
}
|
|
120
11
|
export default class ZTemplatesDataCommonContainer extends React.Component<TypeZTemplatesDataCommonProps, any> {
|
|
@@ -7,15 +7,10 @@ import React, { useRef, useImperativeHandle } from 'react';
|
|
|
7
7
|
import { ProFormRender } from '@ztocwst/rc-pro';
|
|
8
8
|
import ChartRenderer from "./components/chart-renderer";
|
|
9
9
|
import { processFormProps } from "../../utils";
|
|
10
|
-
|
|
11
|
-
/** 指标配置 */
|
|
12
|
-
|
|
13
|
-
/** 表格相关配置 */
|
|
14
|
-
|
|
15
10
|
var ZTemplatesDataCommon = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
16
11
|
var querySetting = props.querySetting,
|
|
12
|
+
chartSetting = props.chartSetting,
|
|
17
13
|
_unsafe_MixedSetter_chartSetting_select = props._unsafe_MixedSetter_chartSetting_select;
|
|
18
|
-
var chartSetting = props.chartSetting;
|
|
19
14
|
var formRef = useRef();
|
|
20
15
|
var chartRenderRef = useRef();
|
|
21
16
|
// todo 不知道meta里是哪里配置有问题,出现_unsafe_MixedSetter...
|
|
@@ -107,7 +102,6 @@ var ZTemplatesDataCommon = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
107
102
|
console.log("formProps", formProps);
|
|
108
103
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ProFormRender, _extends({}, formProps, {
|
|
109
104
|
formRef: formRef,
|
|
110
|
-
onValuesChange: function onValuesChange(changeValues) {},
|
|
111
105
|
onFinish: /*#__PURE__*/function () {
|
|
112
106
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(formatData) {
|
|
113
107
|
var _formProps$onFinish;
|
package/es/index.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export { default as ZPointerBlock } from './components/z-pointer-block';
|
|
|
34
34
|
export type { TypeZPointerBlockProps } from './components/z-pointer-block';
|
|
35
35
|
export { default as ZAggBlock } from './components/z-agg-block';
|
|
36
36
|
export type { TypeAggBlockProps } from './components/z-agg-block';
|
|
37
|
+
export { default as ZDataTable } from './components/z-data-table';
|
|
38
|
+
export type { TypeZDataTableProps } from './components/z-data-table';
|
|
37
39
|
export { default as ZTemplatesDataCommon } from './components/z-templates-data-common';
|
|
38
40
|
export type { TypeZTemplatesDataCommonProps } from './components/z-templates-data-common';
|
|
39
41
|
export { default as ZSlick } from './components/z-slick';
|
package/es/index.js
CHANGED
|
@@ -22,6 +22,8 @@ export { default as ZOperationRecords } from "./components/z-operation-records";
|
|
|
22
22
|
export { default as ZPointerBlock } from "./components/z-pointer-block";
|
|
23
23
|
// 聚合指标
|
|
24
24
|
export { default as ZAggBlock } from "./components/z-agg-block";
|
|
25
|
+
// 数据表格
|
|
26
|
+
export { default as ZDataTable } from "./components/z-data-table";
|
|
25
27
|
export { default as ZTemplatesDataCommon } from "./components/z-templates-data-common";
|
|
26
28
|
export { default as ZSlick } from "./components/z-slick";
|
|
27
29
|
|
package/es/style.js
CHANGED
|
@@ -18,10 +18,10 @@ import 'antd/es/table/style';
|
|
|
18
18
|
import 'antd/es/typography/style';
|
|
19
19
|
import 'antd/es/row/style';
|
|
20
20
|
import 'antd/es/col/style';
|
|
21
|
-
import 'antd/es/message/style';
|
|
22
|
-
import 'antd/es/tabs/style';
|
|
23
21
|
import 'antd/es/checkbox/style';
|
|
24
22
|
import 'antd/es/spin/style';
|
|
25
23
|
import 'antd/es/radio/style';
|
|
24
|
+
import 'antd/es/message/style';
|
|
25
|
+
import 'antd/es/tabs/style';
|
|
26
26
|
import 'antd/es/carousel/style';
|
|
27
27
|
import './index.scss';
|
package/es/utils/props/form.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
|
3
3
|
var _excluded = ["fieldProps", "formItemProps", "dependencyColumns", "required", "initialValue"],
|
|
4
4
|
_excluded2 = ["restFieldProps", "renderItemSlot"],
|
|
5
5
|
_excluded3 = ["restFormProps"],
|
|
6
|
-
_excluded4 = ["fieldProps"],
|
|
6
|
+
_excluded4 = ["fieldProps", "hideInDependency"],
|
|
7
7
|
_excluded5 = ["requestOptions"],
|
|
8
8
|
_excluded6 = ["columns", "switchGroup"];
|
|
9
9
|
/**
|
|
@@ -62,10 +62,13 @@ var processInitialValue = function processInitialValue(e) {
|
|
|
62
62
|
}
|
|
63
63
|
var childRest = processInitialValue(child);
|
|
64
64
|
var childFieldProps = childRest.fieldProps,
|
|
65
|
+
hideInDependency = childRest.hideInDependency,
|
|
65
66
|
childItemRest = _objectWithoutPropertiesLoose(childRest, _excluded4);
|
|
66
67
|
var requestOptions = childFieldProps.requestOptions,
|
|
67
68
|
childRestFieldProps = _objectWithoutPropertiesLoose(childFieldProps, _excluded5);
|
|
68
|
-
return _extends({},
|
|
69
|
+
return _extends({}, hideInDependency ? {
|
|
70
|
+
hideInForm: !hideInDependency(obj)
|
|
71
|
+
} : {}, childItemRest, {
|
|
69
72
|
fieldProps: _extends({}, childRestFieldProps, (childRest === null || childRest === void 0 ? void 0 : childRest.valueType) === 'asyncSelect' &&
|
|
70
73
|
// 接口请求前置校验, 通过请求 asyncSelect 接口
|
|
71
74
|
requestOptionsCheck(childRestFieldProps === null || childRestFieldProps === void 0 ? void 0 : childRestFieldProps.requestOptionsCheck, obj) ? {
|
package/es/utils/props/tpl.d.ts
CHANGED
|
@@ -148,6 +148,8 @@ export declare const processTplProps: (props: RcPageProps, extra?: {
|
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
150
|
key?: string;
|
|
151
|
+
className?: string;
|
|
152
|
+
style?: React.CSSProperties;
|
|
151
153
|
tab?: React.ReactNode;
|
|
152
154
|
onBillSuccess?: (res: any) => void;
|
|
153
155
|
onBillError?: (res: any) => void;
|
package/lib/components/{z-templates-data-common → z-data-table}/components/custom-renderer/index.js
RENAMED
|
@@ -9,7 +9,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _rcPro = require("@ztocwst/rc-pro");
|
|
12
|
-
var
|
|
12
|
+
var _dataTable = require("../../data-table.helper");
|
|
13
13
|
var _linkRenderer = _interopRequireDefault(require("../link-renderer"));
|
|
14
14
|
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."); }
|
|
15
15
|
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); }
|
|
@@ -17,7 +17,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
17
17
|
var CustomRenderer = function CustomRenderer(props) {
|
|
18
18
|
var _props$child;
|
|
19
19
|
var _ref = props || {},
|
|
20
|
-
|
|
20
|
+
currentKey = _ref.currentKey,
|
|
21
21
|
autoLoad = _ref.autoLoad,
|
|
22
22
|
refreshRate = _ref.refreshRate,
|
|
23
23
|
dataSetName = _ref.dataSetName,
|
|
@@ -25,6 +25,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
25
25
|
indexJson = _ref.indexJson,
|
|
26
26
|
linkPage = _ref.linkPage,
|
|
27
27
|
linkPageTitle = _ref.linkPageTitle,
|
|
28
|
+
chartRef = _ref.chartRef,
|
|
28
29
|
onConfirm = _ref.onConfirm,
|
|
29
30
|
formatter = _ref.formatter;
|
|
30
31
|
var rcProContext = (0, _react.useContext)(_rcPro.RcConfigContext);
|
|
@@ -65,7 +66,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
queryParams = (0,
|
|
69
|
+
queryParams = (0, _dataTable.handleQueryParams)(query);
|
|
69
70
|
data = {
|
|
70
71
|
target: target,
|
|
71
72
|
queryParams: queryParams,
|
|
@@ -73,7 +74,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
73
74
|
};
|
|
74
75
|
setLoading(true);
|
|
75
76
|
_context.next = 9;
|
|
76
|
-
return (0,
|
|
77
|
+
return (0, _dataTable.getReportData)(rcProContext, formatter ? formatter === null || formatter === void 0 ? void 0 : formatter(data) : data);
|
|
77
78
|
case 9:
|
|
78
79
|
res = _context.sent;
|
|
79
80
|
setLoading(false);
|
|
@@ -126,28 +127,37 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
126
127
|
timer = null;
|
|
127
128
|
}
|
|
128
129
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}, refreshRate * _dataCommon.timeUnit);
|
|
139
|
-
} else {
|
|
140
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
141
|
-
}
|
|
130
|
+
var onload = function onload() {
|
|
131
|
+
if (autoLoad) {
|
|
132
|
+
if (refreshRate) {
|
|
133
|
+
handleClearInterval();
|
|
134
|
+
timer = window.setInterval(function () {
|
|
135
|
+
return onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
136
|
+
}, refreshRate * _dataTable.timeUnit);
|
|
137
|
+
} else {
|
|
138
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
142
139
|
}
|
|
143
140
|
} else {
|
|
144
141
|
handleClearInterval();
|
|
145
142
|
}
|
|
143
|
+
};
|
|
144
|
+
(0, _react.useEffect)(function () {
|
|
145
|
+
if (currentKey) {
|
|
146
|
+
var _ref4 = currentKey.split(_dataTable.separator) || [],
|
|
147
|
+
curDataSetName = _ref4[0];
|
|
148
|
+
if (curDataSetName === dataSetName) {
|
|
149
|
+
onload();
|
|
150
|
+
} else {
|
|
151
|
+
handleClearInterval();
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
onload();
|
|
155
|
+
}
|
|
146
156
|
return function () {
|
|
147
157
|
handleClearInterval();
|
|
148
158
|
};
|
|
149
|
-
}, [
|
|
150
|
-
(0, _react.useImperativeHandle)(
|
|
159
|
+
}, [currentKey, autoLoad]);
|
|
160
|
+
(0, _react.useImperativeHandle)(chartRef, function () {
|
|
151
161
|
return {
|
|
152
162
|
onLink: onLink,
|
|
153
163
|
queryChart: queryChart
|
|
@@ -159,7 +169,7 @@ var CustomRenderer = function CustomRenderer(props) {
|
|
|
159
169
|
}
|
|
160
170
|
}, /*#__PURE__*/React.createElement(_spin["default"], {
|
|
161
171
|
spinning: loading
|
|
162
|
-
}, (_props$child = props.child) === null || _props$child === void 0 ? void 0 : _props$child.call(props, result))), /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
}, 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", {
|
|
163
173
|
style: {
|
|
164
174
|
display: isLink ? 'block' : 'none'
|
|
165
175
|
}
|
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;
|