@ztocwst/rc-pro-materials 0.2.53 → 0.2.55
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +4 -4
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/dist/SCM_Comps.css +1 -1
- package/dist/SCM_Comps.js +8 -8
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-data-stat-description/z-data-stat-description.js +1 -1
- package/es/components/z-singleFactory/zSingerFactory.js +6 -2
- package/es/components/z-target-block/index.d.ts +3 -0
- package/es/components/z-target-block/index.js +2 -0
- package/es/components/z-target-block/z-target-block.d.ts +6 -0
- package/es/components/z-target-block/z-target-block.js +8 -0
- package/es/components/z-templates-data-common/components/chart-renderer/index.js +31 -28
- package/es/components/z-templates-data-common/data-common.helper.d.ts +11 -0
- package/es/components/z-templates-data-common/data-common.helper.js +75 -1
- package/es/components/z-warehouse/zWarehouse.js +6 -2
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -1
- package/es/style.js +0 -8
- package/lib/components/z-data-stat-description/z-data-stat-description.js +2 -2
- package/lib/components/z-singleFactory/zSingerFactory.js +7 -2
- package/lib/components/z-target-block/index.d.ts +3 -0
- package/lib/components/{z-data-stat → z-target-block}/index.js +2 -2
- package/lib/components/z-target-block/z-target-block.d.ts +6 -0
- package/lib/components/z-target-block/z-target-block.js +11 -0
- package/lib/components/z-templates-data-common/components/chart-renderer/index.js +30 -27
- package/lib/components/z-templates-data-common/data-common.helper.d.ts +11 -0
- package/lib/components/z-templates-data-common/data-common.helper.js +77 -1
- package/lib/components/z-warehouse/zWarehouse.js +7 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -3
- package/lib/style.js +0 -4
- package/package.json +4 -4
- package/es/components/z-data-stat/components/CardDetail/index.d.ts +0 -6
- package/es/components/z-data-stat/components/CardDetail/index.js +0 -328
- package/es/components/z-data-stat/components/CardDetail/index.less +0 -164
- package/es/components/z-data-stat/components/CardDetail/interface.d.ts +0 -30
- package/es/components/z-data-stat/components/CardDetail/interface.js +0 -1
- package/es/components/z-data-stat/components/StepBlock/index.d.ts +0 -5
- package/es/components/z-data-stat/components/StepBlock/index.js +0 -104
- package/es/components/z-data-stat/components/StepBlock/index.less +0 -40
- package/es/components/z-data-stat/components/StepBlock/interface.d.ts +0 -11
- package/es/components/z-data-stat/components/StepBlock/interface.js +0 -1
- package/es/components/z-data-stat/components/TargetBlock/index.d.ts +0 -5
- package/es/components/z-data-stat/components/TargetBlock/index.js +0 -106
- package/es/components/z-data-stat/components/TargetBlock/index.less +0 -65
- package/es/components/z-data-stat/components/TargetBlock/interface.d.ts +0 -31
- package/es/components/z-data-stat/components/TargetBlock/interface.js +0 -1
- package/es/components/z-data-stat/components/index.d.ts +0 -7
- package/es/components/z-data-stat/components/index.js +0 -4
- package/es/components/z-data-stat/data-stat.d.ts +0 -19
- package/es/components/z-data-stat/data-stat.js +0 -326
- package/es/components/z-data-stat/index.d.ts +0 -3
- package/es/components/z-data-stat/index.js +0 -2
- package/es/components/z-data-stat/util.d.ts +0 -25
- package/es/components/z-data-stat/util.js +0 -178
- package/lib/components/z-data-stat/components/CardDetail/index.d.ts +0 -6
- package/lib/components/z-data-stat/components/CardDetail/index.js +0 -335
- package/lib/components/z-data-stat/components/CardDetail/index.less +0 -164
- package/lib/components/z-data-stat/components/CardDetail/interface.d.ts +0 -30
- package/lib/components/z-data-stat/components/CardDetail/interface.js +0 -3
- package/lib/components/z-data-stat/components/StepBlock/index.d.ts +0 -5
- package/lib/components/z-data-stat/components/StepBlock/index.js +0 -109
- package/lib/components/z-data-stat/components/StepBlock/index.less +0 -40
- package/lib/components/z-data-stat/components/StepBlock/interface.d.ts +0 -11
- package/lib/components/z-data-stat/components/StepBlock/interface.js +0 -3
- package/lib/components/z-data-stat/components/TargetBlock/index.d.ts +0 -5
- package/lib/components/z-data-stat/components/TargetBlock/index.js +0 -111
- package/lib/components/z-data-stat/components/TargetBlock/index.less +0 -65
- package/lib/components/z-data-stat/components/TargetBlock/interface.d.ts +0 -31
- package/lib/components/z-data-stat/components/TargetBlock/interface.js +0 -3
- package/lib/components/z-data-stat/components/index.d.ts +0 -7
- package/lib/components/z-data-stat/components/index.js +0 -13
- package/lib/components/z-data-stat/data-stat.d.ts +0 -19
- package/lib/components/z-data-stat/data-stat.js +0 -331
- package/lib/components/z-data-stat/index.d.ts +0 -3
- package/lib/components/z-data-stat/util.d.ts +0 -25
- package/lib/components/z-data-stat/util.js +0 -187
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
@gap: 12px;
|
|
2
|
-
|
|
3
|
-
.rc-step-block {
|
|
4
|
-
padding: 12px;
|
|
5
|
-
border-radius: 8px;
|
|
6
|
-
|
|
7
|
-
.rc-step-block_title {
|
|
8
|
-
margin-right: 16px;
|
|
9
|
-
color: #262626;
|
|
10
|
-
font-weight: 500;
|
|
11
|
-
font-size: 15px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.rc-step-block_value {
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
font-size: 18px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.rc-step-block_content {
|
|
20
|
-
display: flex;
|
|
21
|
-
gap: @gap;
|
|
22
|
-
margin-top: 16px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.rc-step-block_content-item {
|
|
26
|
-
flex: 1;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.rc-step-block_content-target {
|
|
30
|
-
position: relative;
|
|
31
|
-
flex: 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.rc-step-block_item-svg {
|
|
35
|
-
position: absolute;
|
|
36
|
-
bottom: -24px;
|
|
37
|
-
left: 50%;
|
|
38
|
-
transform: translateX(-50%);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
import type { TargetBlockProps } from '../TargetBlock/interface';
|
|
3
|
-
export interface StepBlockProps {
|
|
4
|
-
title: string;
|
|
5
|
-
dataIndex: string;
|
|
6
|
-
columns: TargetBlockProps[][];
|
|
7
|
-
data?: Record<string, any>;
|
|
8
|
-
direction?: string;
|
|
9
|
-
style?: CSSProperties | undefined;
|
|
10
|
-
valueStyle?: CSSProperties | undefined;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import _Progress from "antd/es/progress";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import "./index.less";
|
|
4
|
-
import { handlePercent, handleValueFormat } from "../../util";
|
|
5
|
-
var TargetBlock = function TargetBlock(props) {
|
|
6
|
-
var _processValue, _processValue2, _data$progress$dataIn;
|
|
7
|
-
var name = props.name,
|
|
8
|
-
_props$style = props.style,
|
|
9
|
-
style = _props$style === void 0 ? {} : _props$style,
|
|
10
|
-
_props$valueStyle = props.valueStyle,
|
|
11
|
-
valueStyle = _props$valueStyle === void 0 ? {} : _props$valueStyle,
|
|
12
|
-
progress = props.progress,
|
|
13
|
-
cTargets = props.cTargets,
|
|
14
|
-
icon = props.icon,
|
|
15
|
-
data = props.data,
|
|
16
|
-
dataIndex = props.dataIndex,
|
|
17
|
-
_props$className = props.className,
|
|
18
|
-
className = _props$className === void 0 ? '' : _props$className,
|
|
19
|
-
_props$direction = props.direction,
|
|
20
|
-
direction = _props$direction === void 0 ? 'vertical' : _props$direction,
|
|
21
|
-
handleClick = props.handleClick,
|
|
22
|
-
valueType = props.valueType;
|
|
23
|
-
// const _iconProps = {
|
|
24
|
-
// ...(iconProps ?? {}),
|
|
25
|
-
// style: {
|
|
26
|
-
// fontSize: '14px',
|
|
27
|
-
// position: 'absolute',
|
|
28
|
-
// top: '-1px',
|
|
29
|
-
// left: '0',
|
|
30
|
-
// ...(iconProps?.style ?? {}),
|
|
31
|
-
// },
|
|
32
|
-
// };
|
|
33
|
-
var targetNameClass = "rc-target-block_name " + (handleClick ? 'rc-target-block_name_underline' : '');
|
|
34
|
-
var processValue = function processValue(value) {
|
|
35
|
-
if (!valueType) {
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
switch (valueType) {
|
|
39
|
-
case 'thousandth':
|
|
40
|
-
return handleValueFormat(value);
|
|
41
|
-
case 'percent':
|
|
42
|
-
return handlePercent(value);
|
|
43
|
-
default:
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: "rc-target-block " + className,
|
|
49
|
-
style: style,
|
|
50
|
-
onClick: function onClick() {
|
|
51
|
-
handleClick === null || handleClick === void 0 ? void 0 : handleClick(data, dataIndex, cTargets);
|
|
52
|
-
}
|
|
53
|
-
}, direction === 'vertical' ? /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: "rc-target-block_name-value"
|
|
55
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: targetNameClass
|
|
57
|
-
}, name), /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "rc-target-block_value",
|
|
59
|
-
style: valueStyle
|
|
60
|
-
}, (_processValue = processValue(data === null || data === void 0 ? void 0 : data[dataIndex])) !== null && _processValue !== void 0 ? _processValue : '-')) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
61
|
-
className: targetNameClass,
|
|
62
|
-
style: {
|
|
63
|
-
marginRight: '12px'
|
|
64
|
-
}
|
|
65
|
-
}, name), /*#__PURE__*/React.createElement("span", {
|
|
66
|
-
className: "rc-target-block_value",
|
|
67
|
-
style: valueStyle
|
|
68
|
-
}, (_processValue2 = processValue(data === null || data === void 0 ? void 0 : data[dataIndex])) !== null && _processValue2 !== void 0 ? _processValue2 : '-')), progress && /*#__PURE__*/React.createElement("div", {
|
|
69
|
-
className: "rc-target-block_progress",
|
|
70
|
-
style: progress.style
|
|
71
|
-
}, /*#__PURE__*/React.createElement(_Progress, {
|
|
72
|
-
size: "small",
|
|
73
|
-
percent: data === null || data === void 0 ? void 0 : data[progress.dataIndex],
|
|
74
|
-
showInfo: false
|
|
75
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
style: {
|
|
77
|
-
fontWeight: '400',
|
|
78
|
-
fontSize: '12px',
|
|
79
|
-
color: '#487FFB',
|
|
80
|
-
width: '110px',
|
|
81
|
-
background: '#EEF2FD',
|
|
82
|
-
borderRadius: '4px',
|
|
83
|
-
padding: '2px 4px',
|
|
84
|
-
marginLeft: '8px',
|
|
85
|
-
textAlign: 'center'
|
|
86
|
-
}
|
|
87
|
-
}, /*#__PURE__*/React.createElement("span", null, (_data$progress$dataIn = data === null || data === void 0 ? void 0 : data[progress.dataIndex]) !== null && _data$progress$dataIn !== void 0 ? _data$progress$dataIn : '-', "%"), /*#__PURE__*/React.createElement("span", null, progress === null || progress === void 0 ? void 0 : progress.text))), icon && icon, cTargets && /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
className: "rc-target-block_ctarget"
|
|
89
|
-
}, cTargets.map(function (item, i) {
|
|
90
|
-
var _ref, _data$item$dataIndex;
|
|
91
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
className: "rc-target-block_ctarget-content",
|
|
93
|
-
style: (i + 1) % 2 === 0 ? {
|
|
94
|
-
justifySelf: 'end',
|
|
95
|
-
textAlign: 'right'
|
|
96
|
-
} : {},
|
|
97
|
-
key: (item === null || item === void 0 ? void 0 : item.name) || i
|
|
98
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
99
|
-
className: "rc-target-block_ctarget-name"
|
|
100
|
-
}, (item === null || item === void 0 ? void 0 : item.prefix) || '', item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React.createElement("span", {
|
|
101
|
-
className: "rc-target-block_ctarget-value",
|
|
102
|
-
style: (item === null || item === void 0 ? void 0 : item.style) || {}
|
|
103
|
-
}, (_ref = (_data$item$dataIndex = data === null || data === void 0 ? void 0 : data[item === null || item === void 0 ? void 0 : item.dataIndex]) !== null && _data$item$dataIndex !== void 0 ? _data$item$dataIndex : item === null || item === void 0 ? void 0 : item.value) !== null && _ref !== void 0 ? _ref : '-', (item === null || item === void 0 ? void 0 : item.suffix) || ''));
|
|
104
|
-
})));
|
|
105
|
-
};
|
|
106
|
-
export default TargetBlock;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
.rc-target-block {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
padding: 10px;
|
|
7
|
-
background-color: #fff;
|
|
8
|
-
border: 1px solid #f0f0f0;
|
|
9
|
-
border-radius: 8px;
|
|
10
|
-
|
|
11
|
-
.rc-target-block_name-value {
|
|
12
|
-
display: grid;
|
|
13
|
-
grid-template-columns: 1fr 1fr;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.rc-target-block_name {
|
|
17
|
-
margin-right: 4px;
|
|
18
|
-
color: #666;
|
|
19
|
-
font-weight: bold;
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.rc-target-block_name_underline {
|
|
24
|
-
text-decoration: underline;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
text-underline-offset: 4px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.rc-target-block_value {
|
|
30
|
-
font-weight: 700;
|
|
31
|
-
font-size: 14px;
|
|
32
|
-
text-align: right;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.rc-target-block_progress {
|
|
36
|
-
display: flex;
|
|
37
|
-
width: 100%;
|
|
38
|
-
margin-top: 4px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.rc-target-block_ctarget {
|
|
42
|
-
// display: grid;
|
|
43
|
-
// grid-template-columns: 1fr 1fr;
|
|
44
|
-
display: flex;
|
|
45
|
-
justify-content: space-between;
|
|
46
|
-
margin-top: 4px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// .rc-target-block_ctarget-content {
|
|
50
|
-
// // display: flex;
|
|
51
|
-
// // justify-content: space-between;
|
|
52
|
-
// }
|
|
53
|
-
|
|
54
|
-
.rc-target-block_ctarget-name {
|
|
55
|
-
margin-right: 4px;
|
|
56
|
-
color: #898989;
|
|
57
|
-
font-size: 12px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.rc-target-block_ctarget-value {
|
|
61
|
-
font-weight: bold;
|
|
62
|
-
font-size: 12px;
|
|
63
|
-
text-align: right;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
export interface Target {
|
|
3
|
-
name: string;
|
|
4
|
-
dataIndex?: string;
|
|
5
|
-
value?: string;
|
|
6
|
-
prefix?: string | React.ReactElement;
|
|
7
|
-
suffix?: string | React.ReactElement;
|
|
8
|
-
style?: CSSProperties | undefined;
|
|
9
|
-
}
|
|
10
|
-
export interface TargetBlockProps {
|
|
11
|
-
data?: Record<string, any>;
|
|
12
|
-
name: string;
|
|
13
|
-
dataIndex: string;
|
|
14
|
-
handleClick?: (data: any, dataIndex: string, indexes: Target[]) => void;
|
|
15
|
-
suffix?: string | React.ReactElement;
|
|
16
|
-
style?: CSSProperties | undefined;
|
|
17
|
-
valueStyle?: CSSProperties | undefined;
|
|
18
|
-
className?: string;
|
|
19
|
-
hiddenArrow?: boolean;
|
|
20
|
-
icon?: React.ReactNode;
|
|
21
|
-
progress?: {
|
|
22
|
-
dataIndex: string;
|
|
23
|
-
text: string;
|
|
24
|
-
style?: CSSProperties | undefined;
|
|
25
|
-
};
|
|
26
|
-
direction?: string;
|
|
27
|
-
/** 额外指标 */
|
|
28
|
-
cTargets?: Target[];
|
|
29
|
-
/** 千分位 | 百分比(保留两位小数) */
|
|
30
|
-
valueType?: 'thousandth' | 'percent';
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { StepBlockProps } from './StepBlock/interface';
|
|
2
|
-
import TargetBlock from './TargetBlock';
|
|
3
|
-
import CardDetail, { useCardDetailRef } from './CardDetail';
|
|
4
|
-
import StepBlock from './StepBlock';
|
|
5
|
-
import type { CardDetailProps, CardDetailRef } from './CardDetail/interface';
|
|
6
|
-
export { TargetBlock, CardDetail, StepBlock, useCardDetailRef };
|
|
7
|
-
export type { CardDetailProps, CardDetailRef, StepBlockProps };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CardDetailProps } from './components/CardDetail/interface';
|
|
3
|
-
import type { StepBlockProps } from './components/StepBlock/interface';
|
|
4
|
-
export type TypeZDataStatProps = {
|
|
5
|
-
/** 查询参数 */
|
|
6
|
-
queryParams: Record<string, any> | (() => Promise<Record<string, any>>);
|
|
7
|
-
/** 自动加载 */
|
|
8
|
-
autoLoad?: boolean;
|
|
9
|
-
/** 数据集 */
|
|
10
|
-
datasetName: string;
|
|
11
|
-
/** 头部指标 */
|
|
12
|
-
dataStatColumns: CardDetailProps['columns'];
|
|
13
|
-
/** 详情维度 */
|
|
14
|
-
filter: CardDetailProps['filter'];
|
|
15
|
-
/** 卡片指标组 */
|
|
16
|
-
stepList: StepBlockProps[];
|
|
17
|
-
};
|
|
18
|
-
declare const ZDataStat: import("react").ForwardRefExoticComponent<TypeZDataStatProps & import("react").RefAttributes<any>>;
|
|
19
|
-
export default ZDataStat;
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import _Spin from "antd/es/spin";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import { CardDetail, StepBlock, useCardDetailRef } from "./components";
|
|
6
|
-
import { useEffect, useState, useContext, useImperativeHandle, forwardRef } from 'react';
|
|
7
|
-
import { getReportData, getQueryParams, getTargets, getStepBlockTarget } from "./util";
|
|
8
|
-
import { RcConfigContext } from '@ztocwst/rc-pro';
|
|
9
|
-
var generateQueryParams = /*#__PURE__*/function () {
|
|
10
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(queryParams) {
|
|
11
|
-
var q;
|
|
12
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
13
|
-
while (1) switch (_context.prev = _context.next) {
|
|
14
|
-
case 0:
|
|
15
|
-
if (!(typeof queryParams === 'function')) {
|
|
16
|
-
_context.next = 5;
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
_context.next = 3;
|
|
20
|
-
return queryParams();
|
|
21
|
-
case 3:
|
|
22
|
-
q = _context.sent;
|
|
23
|
-
return _context.abrupt("return", getQueryParams(q));
|
|
24
|
-
case 5:
|
|
25
|
-
return _context.abrupt("return", getQueryParams(queryParams));
|
|
26
|
-
case 6:
|
|
27
|
-
case "end":
|
|
28
|
-
return _context.stop();
|
|
29
|
-
}
|
|
30
|
-
}, _callee);
|
|
31
|
-
}));
|
|
32
|
-
return function generateQueryParams(_x) {
|
|
33
|
-
return _ref.apply(this, arguments);
|
|
34
|
-
};
|
|
35
|
-
}();
|
|
36
|
-
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
var ZDataStat = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
39
|
-
var dataStatColumns = props.dataStatColumns,
|
|
40
|
-
stepList = props.stepList,
|
|
41
|
-
filter = props.filter,
|
|
42
|
-
datasetName = props.datasetName,
|
|
43
|
-
autoLoad = props.autoLoad;
|
|
44
|
-
|
|
45
|
-
// @ts-ignore
|
|
46
|
-
var rcConfigContextValue = useContext(RcConfigContext);
|
|
47
|
-
var cardDetailRef = useCardDetailRef();
|
|
48
|
-
var _useState = useState(false),
|
|
49
|
-
stepDataLoading = _useState[0],
|
|
50
|
-
setStepDataLoading = _useState[1];
|
|
51
|
-
var _useState2 = useState({}),
|
|
52
|
-
stepData = _useState2[0],
|
|
53
|
-
setStepData = _useState2[1];
|
|
54
|
-
function getStepData(_x2, _x3) {
|
|
55
|
-
return _getStepData.apply(this, arguments);
|
|
56
|
-
}
|
|
57
|
-
function _getStepData() {
|
|
58
|
-
_getStepData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data, params) {
|
|
59
|
-
var otherParams, dim, _filter, record, _yield$getReportData3, success, result, _result$data2, _data;
|
|
60
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
61
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
62
|
-
case 0:
|
|
63
|
-
if (datasetName) {
|
|
64
|
-
_context6.next = 2;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
return _context6.abrupt("return");
|
|
68
|
-
case 2:
|
|
69
|
-
_context6.prev = 2;
|
|
70
|
-
otherParams = {};
|
|
71
|
-
dim = [];
|
|
72
|
-
if (data) {
|
|
73
|
-
_filter = data.filter, record = data.record;
|
|
74
|
-
dim = _filter.dim;
|
|
75
|
-
otherParams[_filter.key] = record.name ? [record.name] : undefined;
|
|
76
|
-
}
|
|
77
|
-
setStepDataLoading(true);
|
|
78
|
-
_context6.next = 9;
|
|
79
|
-
return getReportData({
|
|
80
|
-
dataSetName: datasetName,
|
|
81
|
-
target: [].concat(stepList.map(function (e) {
|
|
82
|
-
return getStepBlockTarget(e);
|
|
83
|
-
}).flat()),
|
|
84
|
-
dim: dim,
|
|
85
|
-
queryParams: _extends({}, otherParams, params)
|
|
86
|
-
}, {
|
|
87
|
-
request: rcConfigContextValue.materialsRequest,
|
|
88
|
-
env: rcConfigContextValue.env
|
|
89
|
-
});
|
|
90
|
-
case 9:
|
|
91
|
-
_yield$getReportData3 = _context6.sent;
|
|
92
|
-
success = _yield$getReportData3.success;
|
|
93
|
-
result = _yield$getReportData3.result;
|
|
94
|
-
if (success) {
|
|
95
|
-
if (result !== null && result !== void 0 && (_result$data2 = result.data) !== null && _result$data2 !== void 0 && _result$data2.length) {
|
|
96
|
-
_data = result.data[0];
|
|
97
|
-
Object.keys(_data).forEach(function (key) {
|
|
98
|
-
_data[key] = _data[key];
|
|
99
|
-
});
|
|
100
|
-
setStepData(_data);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
case 13:
|
|
104
|
-
_context6.prev = 13;
|
|
105
|
-
setStepDataLoading(false);
|
|
106
|
-
return _context6.finish(13);
|
|
107
|
-
case 16:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context6.stop();
|
|
110
|
-
}
|
|
111
|
-
}, _callee6, null, [[2,, 13, 16]]);
|
|
112
|
-
}));
|
|
113
|
-
return _getStepData.apply(this, arguments);
|
|
114
|
-
}
|
|
115
|
-
function getData(params) {
|
|
116
|
-
var _cardDetailRef$curren;
|
|
117
|
-
cardDetailRef === null || cardDetailRef === void 0 ? void 0 : (_cardDetailRef$curren = cardDetailRef.current) === null || _cardDetailRef$curren === void 0 ? void 0 : _cardDetailRef$curren.refresh({
|
|
118
|
-
params: params
|
|
119
|
-
});
|
|
120
|
-
getStepData(null, params);
|
|
121
|
-
}
|
|
122
|
-
useEffect(function () {
|
|
123
|
-
if (autoLoad) {
|
|
124
|
-
// 延迟执行,queryParams里异步获取表单时可能获取不到
|
|
125
|
-
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
126
|
-
var queryParams;
|
|
127
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
128
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
129
|
-
case 0:
|
|
130
|
-
_context2.next = 2;
|
|
131
|
-
return generateQueryParams(props.queryParams);
|
|
132
|
-
case 2:
|
|
133
|
-
queryParams = _context2.sent;
|
|
134
|
-
getData(queryParams);
|
|
135
|
-
case 4:
|
|
136
|
-
case "end":
|
|
137
|
-
return _context2.stop();
|
|
138
|
-
}
|
|
139
|
-
}, _callee2);
|
|
140
|
-
})), 200);
|
|
141
|
-
}
|
|
142
|
-
}, []);
|
|
143
|
-
useImperativeHandle(ref, function () {
|
|
144
|
-
return {
|
|
145
|
-
query: function () {
|
|
146
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(params) {
|
|
147
|
-
var queryParams;
|
|
148
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
149
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
150
|
-
case 0:
|
|
151
|
-
_context3.next = 2;
|
|
152
|
-
return generateQueryParams(props.queryParams);
|
|
153
|
-
case 2:
|
|
154
|
-
queryParams = _context3.sent;
|
|
155
|
-
getData(_extends({}, queryParams, params));
|
|
156
|
-
case 4:
|
|
157
|
-
case "end":
|
|
158
|
-
return _context3.stop();
|
|
159
|
-
}
|
|
160
|
-
}, _callee3);
|
|
161
|
-
}));
|
|
162
|
-
function query(_x4) {
|
|
163
|
-
return _query.apply(this, arguments);
|
|
164
|
-
}
|
|
165
|
-
return query;
|
|
166
|
-
}()
|
|
167
|
-
};
|
|
168
|
-
}, []);
|
|
169
|
-
var cProps = {
|
|
170
|
-
loading: false,
|
|
171
|
-
columns: dataStatColumns,
|
|
172
|
-
// todo CardDetailProps
|
|
173
|
-
request: function () {
|
|
174
|
-
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(options) {
|
|
175
|
-
var _yield$getReportData, success, result, _result$data, _data;
|
|
176
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
177
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
178
|
-
case 0:
|
|
179
|
-
if (datasetName) {
|
|
180
|
-
_context4.next = 2;
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
return _context4.abrupt("return", []);
|
|
184
|
-
case 2:
|
|
185
|
-
_context4.next = 4;
|
|
186
|
-
return getReportData({
|
|
187
|
-
dataSetName: datasetName,
|
|
188
|
-
target: getTargets(dataStatColumns),
|
|
189
|
-
queryParams: _extends({}, options.params)
|
|
190
|
-
}, {
|
|
191
|
-
request: rcConfigContextValue.materialsRequest,
|
|
192
|
-
env: rcConfigContextValue.env
|
|
193
|
-
});
|
|
194
|
-
case 4:
|
|
195
|
-
_yield$getReportData = _context4.sent;
|
|
196
|
-
success = _yield$getReportData.success;
|
|
197
|
-
result = _yield$getReportData.result;
|
|
198
|
-
if (!success) {
|
|
199
|
-
_context4.next = 16;
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
if (!(result !== null && result !== void 0 && (_result$data = result.data) !== null && _result$data !== void 0 && _result$data.length)) {
|
|
203
|
-
_context4.next = 13;
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
_data = result.data[0];
|
|
207
|
-
return _context4.abrupt("return", _data);
|
|
208
|
-
case 13:
|
|
209
|
-
return _context4.abrupt("return", []);
|
|
210
|
-
case 14:
|
|
211
|
-
_context4.next = 17;
|
|
212
|
-
break;
|
|
213
|
-
case 16:
|
|
214
|
-
return _context4.abrupt("return", []);
|
|
215
|
-
case 17:
|
|
216
|
-
case "end":
|
|
217
|
-
return _context4.stop();
|
|
218
|
-
}
|
|
219
|
-
}, _callee4);
|
|
220
|
-
}));
|
|
221
|
-
function request(_x5) {
|
|
222
|
-
return _request.apply(this, arguments);
|
|
223
|
-
}
|
|
224
|
-
return request;
|
|
225
|
-
}(),
|
|
226
|
-
filter: filter,
|
|
227
|
-
list: {
|
|
228
|
-
columns: [].concat(dataStatColumns),
|
|
229
|
-
formatter: function formatter(data) {
|
|
230
|
-
return _extends({}, data);
|
|
231
|
-
},
|
|
232
|
-
request: function () {
|
|
233
|
-
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(options) {
|
|
234
|
-
var _filter$dim;
|
|
235
|
-
var pageNum, pageSize, filter, params, _yield$getReportData2, success, result;
|
|
236
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
237
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
238
|
-
case 0:
|
|
239
|
-
pageNum = options.pageNum, pageSize = options.pageSize, filter = options.filter, params = options.params;
|
|
240
|
-
if (datasetName) {
|
|
241
|
-
_context5.next = 3;
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
return _context5.abrupt("return", []);
|
|
245
|
-
case 3:
|
|
246
|
-
_context5.next = 5;
|
|
247
|
-
return getReportData({
|
|
248
|
-
dataSetName: datasetName,
|
|
249
|
-
pageNum: pageNum,
|
|
250
|
-
pageSize: pageSize,
|
|
251
|
-
target: getTargets(dataStatColumns),
|
|
252
|
-
dim: filter === null || filter === void 0 ? void 0 : filter.dim,
|
|
253
|
-
queryParams: _extends({}, params),
|
|
254
|
-
// alias 目前写死name
|
|
255
|
-
columns: filter === null || filter === void 0 ? void 0 : (_filter$dim = filter.dim) === null || _filter$dim === void 0 ? void 0 : _filter$dim.filter(function (e) {
|
|
256
|
-
return e.alias;
|
|
257
|
-
}).map(function (e) {
|
|
258
|
-
return {
|
|
259
|
-
alias: e.alias,
|
|
260
|
-
description: e.description
|
|
261
|
-
};
|
|
262
|
-
})
|
|
263
|
-
// [
|
|
264
|
-
// { alias: 'name', description: },
|
|
265
|
-
// // { alias: 'name', description: '大区名称' },
|
|
266
|
-
// // { alias: 'name', description: '仓库名称' },
|
|
267
|
-
// ],
|
|
268
|
-
}, {
|
|
269
|
-
request: rcConfigContextValue.materialsRequest,
|
|
270
|
-
env: rcConfigContextValue.env
|
|
271
|
-
});
|
|
272
|
-
case 5:
|
|
273
|
-
_yield$getReportData2 = _context5.sent;
|
|
274
|
-
success = _yield$getReportData2.success;
|
|
275
|
-
result = _yield$getReportData2.result;
|
|
276
|
-
if (!success) {
|
|
277
|
-
_context5.next = 11;
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
if (!result.data) {
|
|
281
|
-
_context5.next = 11;
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
return _context5.abrupt("return", result.data.map(function (_data) {
|
|
285
|
-
return _extends({}, _data);
|
|
286
|
-
}));
|
|
287
|
-
case 11:
|
|
288
|
-
return _context5.abrupt("return", []);
|
|
289
|
-
case 12:
|
|
290
|
-
case "end":
|
|
291
|
-
return _context5.stop();
|
|
292
|
-
}
|
|
293
|
-
}, _callee5);
|
|
294
|
-
}));
|
|
295
|
-
function request(_x6) {
|
|
296
|
-
return _request2.apply(this, arguments);
|
|
297
|
-
}
|
|
298
|
-
return request;
|
|
299
|
-
}(),
|
|
300
|
-
handleClick: function handleClick(data) {
|
|
301
|
-
getStepData(data);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
306
|
-
ref: ref
|
|
307
|
-
}, /*#__PURE__*/React.createElement(CardDetail, _extends({
|
|
308
|
-
ref: cardDetailRef
|
|
309
|
-
}, cProps, {
|
|
310
|
-
handleClick: getStepData
|
|
311
|
-
})), /*#__PURE__*/React.createElement(_Spin, {
|
|
312
|
-
spinning: stepDataLoading
|
|
313
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
314
|
-
style: {
|
|
315
|
-
display: 'flex',
|
|
316
|
-
gap: '16px'
|
|
317
|
-
}
|
|
318
|
-
}, stepList.map(function (_step, index) {
|
|
319
|
-
return /*#__PURE__*/React.createElement(StepBlock, _extends({
|
|
320
|
-
key: index
|
|
321
|
-
}, _step, {
|
|
322
|
-
data: stepData
|
|
323
|
-
}));
|
|
324
|
-
}))));
|
|
325
|
-
});
|
|
326
|
-
export default ZDataStat;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare function reportQuery(path: string, data: Record<string, any>, other?: any): Promise<any>;
|
|
2
|
-
/**
|
|
3
|
-
* 海藻报表查询
|
|
4
|
-
* @param data
|
|
5
|
-
* @param other 请求方法\环境
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function getReportData(data: Record<string, any>, other: {
|
|
9
|
-
request: any;
|
|
10
|
-
env: string;
|
|
11
|
-
}): Promise<any>;
|
|
12
|
-
export declare function getStepBlockTarget(config: any): any[];
|
|
13
|
-
export declare function getQueryParams(queryParams?: Record<string, any>): Record<string, any>;
|
|
14
|
-
export declare function getTargets(columns?: any[]): any[];
|
|
15
|
-
type IValue = number | string | null | undefined;
|
|
16
|
-
export declare const handleDecimal: (value: IValue, decimal?: number) => string;
|
|
17
|
-
export declare const handleThousand: (value: IValue) => IValue;
|
|
18
|
-
export declare const handleValueFormat: (value: IValue, decimal?: number) => any;
|
|
19
|
-
/** 数据类型 */
|
|
20
|
-
export type valueType = number | string | null | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* 百分比转化
|
|
23
|
-
*/
|
|
24
|
-
export declare const handlePercent: (value: valueType, decimal?: number, unit?: number) => string;
|
|
25
|
-
export {};
|