@ztocwst/rc-pro-materials 0.2.38 → 0.2.39
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 +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/dist/SCM_Comps.css +1 -1
- package/dist/SCM_Comps.js +9 -9
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-data-stat/components/CardDetail/index.d.ts +6 -0
- package/es/components/z-data-stat/components/CardDetail/index.js +328 -0
- package/es/components/z-data-stat/components/CardDetail/index.less +164 -0
- package/es/components/z-data-stat/components/CardDetail/interface.d.ts +30 -0
- package/es/components/z-data-stat/components/CardDetail/interface.js +1 -0
- package/es/components/z-data-stat/components/StepBlock/index.d.ts +5 -0
- package/es/components/z-data-stat/components/StepBlock/index.js +104 -0
- package/es/components/z-data-stat/components/StepBlock/index.less +40 -0
- package/es/components/z-data-stat/components/StepBlock/interface.d.ts +11 -0
- package/es/components/z-data-stat/components/StepBlock/interface.js +1 -0
- package/es/components/z-data-stat/components/TargetBlock/index.d.ts +5 -0
- package/es/components/z-data-stat/components/TargetBlock/index.js +106 -0
- package/es/components/z-data-stat/components/TargetBlock/index.less +65 -0
- package/es/components/z-data-stat/components/TargetBlock/interface.d.ts +31 -0
- package/es/components/z-data-stat/components/TargetBlock/interface.js +1 -0
- package/es/components/z-data-stat/components/index.d.ts +7 -0
- package/es/components/z-data-stat/components/index.js +4 -0
- package/es/components/z-data-stat/data-stat.d.ts +19 -0
- package/es/components/z-data-stat/data-stat.js +326 -0
- package/es/components/z-data-stat/index.d.ts +3 -0
- package/es/components/z-data-stat/index.js +2 -0
- package/es/components/z-data-stat/util.d.ts +25 -0
- package/es/components/z-data-stat/util.js +178 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/es/style.js +9 -1
- package/lib/components/z-data-stat/components/CardDetail/index.d.ts +6 -0
- package/lib/components/z-data-stat/components/CardDetail/index.js +335 -0
- package/lib/components/z-data-stat/components/CardDetail/index.less +164 -0
- package/lib/components/z-data-stat/components/CardDetail/interface.d.ts +30 -0
- package/lib/components/z-data-stat/components/CardDetail/interface.js +3 -0
- package/lib/components/z-data-stat/components/StepBlock/index.d.ts +5 -0
- package/lib/components/z-data-stat/components/StepBlock/index.js +109 -0
- package/lib/components/z-data-stat/components/StepBlock/index.less +40 -0
- package/lib/components/z-data-stat/components/StepBlock/interface.d.ts +11 -0
- package/lib/components/z-data-stat/components/StepBlock/interface.js +3 -0
- package/lib/components/z-data-stat/components/TargetBlock/index.d.ts +5 -0
- package/lib/components/z-data-stat/components/TargetBlock/index.js +111 -0
- package/lib/components/z-data-stat/components/TargetBlock/index.less +65 -0
- package/lib/components/z-data-stat/components/TargetBlock/interface.d.ts +31 -0
- package/lib/components/z-data-stat/components/TargetBlock/interface.js +3 -0
- package/lib/components/z-data-stat/components/index.d.ts +7 -0
- package/lib/components/z-data-stat/components/index.js +13 -0
- package/lib/components/z-data-stat/data-stat.d.ts +19 -0
- package/lib/components/z-data-stat/data-stat.js +331 -0
- package/lib/components/z-data-stat/index.d.ts +3 -0
- package/lib/components/z-data-stat/index.js +7 -0
- package/lib/components/z-data-stat/util.d.ts +25 -0
- package/lib/components/z-data-stat/util.js +187 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -2
- package/lib/style.js +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
@gap: 16px;
|
|
2
|
+
|
|
3
|
+
.rc-card-detail {
|
|
4
|
+
width: 100%;
|
|
5
|
+
// height: 200px;
|
|
6
|
+
// background-color: #F8F8F9;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
|
|
9
|
+
.rc-card-detail_header-data {
|
|
10
|
+
display: flex;
|
|
11
|
+
// gap: @gap;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
}
|
|
14
|
+
// .rc-card-detail_header-target-item {
|
|
15
|
+
// border: 1px solid rgba(0, 0, 0, 0);
|
|
16
|
+
// }
|
|
17
|
+
.rc-card-detail_header-target {
|
|
18
|
+
z-index: 1;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex: 1;
|
|
21
|
+
gap: @gap;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
padding: 0 @gap @gap @gap;
|
|
24
|
+
background-color: #fff;
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
&:hover {
|
|
27
|
+
.rc-card-detail_header-target-item {
|
|
28
|
+
border: 1px solid #487ffb;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// .rc-card-detail_filter {
|
|
34
|
+
// width: 120px;
|
|
35
|
+
// padding: @gap 0;
|
|
36
|
+
// }
|
|
37
|
+
|
|
38
|
+
.rc-card-detail_filter-content {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
background-color: #f8f8f9;
|
|
47
|
+
border-radius: 8px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.rc-card-detail_filter {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
width: 120px;
|
|
55
|
+
padding: 0 0 @gap 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.rc-card-detail_filter-content-before {
|
|
59
|
+
&::before {
|
|
60
|
+
position: absolute;
|
|
61
|
+
bottom: -20px;
|
|
62
|
+
left: 0;
|
|
63
|
+
width: 104%;
|
|
64
|
+
height: 30px;
|
|
65
|
+
background-color: #f8f8f9;
|
|
66
|
+
content: '';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.rc-card-detail_target-before {
|
|
71
|
+
position: relative;
|
|
72
|
+
|
|
73
|
+
&::before {
|
|
74
|
+
position: absolute;
|
|
75
|
+
width: 100%;
|
|
76
|
+
content: '';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.rc-card-detail_list {
|
|
81
|
+
position: relative;
|
|
82
|
+
// height: 200px;
|
|
83
|
+
width: 100%;
|
|
84
|
+
background-color: #f8f8f9;
|
|
85
|
+
border-top-right-radius: 8px;
|
|
86
|
+
border-bottom-right-radius: 8px;
|
|
87
|
+
border-bottom-left-radius: 8px;
|
|
88
|
+
|
|
89
|
+
&::before {
|
|
90
|
+
position: absolute;
|
|
91
|
+
width: 100%;
|
|
92
|
+
content: '';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.rc-dard-detail_list-empty {
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 50%;
|
|
98
|
+
right: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
margin: 0;
|
|
101
|
+
transform: translateY(-50%);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.rc-card-detail_filter-name {
|
|
106
|
+
// margin-right: 12px;
|
|
107
|
+
// color: #008dff;
|
|
108
|
+
font-size: 16px;
|
|
109
|
+
|
|
110
|
+
.rc-card-detail_setting {
|
|
111
|
+
font-size: 14px;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
&:hover {
|
|
114
|
+
color: #008dff;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.rc-card-detail_list-item {
|
|
120
|
+
display: flex;
|
|
121
|
+
gap: @gap;
|
|
122
|
+
width: 100%;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
&:hover {
|
|
125
|
+
.rc-card-detail_header-target-item {
|
|
126
|
+
border: 1px solid #487ffb;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rc-card-detail_list-header {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
color: #262626;
|
|
136
|
+
font-weight: 500;
|
|
137
|
+
font-size: 14px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.rc-card-detail_popover-content {
|
|
142
|
+
.rc-card-detail_popover-content_item {
|
|
143
|
+
position: relative;
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
width: 155px;
|
|
147
|
+
padding: 10px 12px;
|
|
148
|
+
color: #262626;
|
|
149
|
+
font-size: 14px;
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
|
|
152
|
+
&:hover {
|
|
153
|
+
background: #f5f5f5;
|
|
154
|
+
border-radius: 4px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.active {
|
|
158
|
+
position: absolute;
|
|
159
|
+
top: 50%;
|
|
160
|
+
right: 12px;
|
|
161
|
+
transform: translateY(-50%);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TargetBlockProps } from '../TargetBlock/interface';
|
|
2
|
+
export interface CardDetailProps {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
columns: TargetBlockProps[];
|
|
5
|
+
request: (data: any) => Promise<any>;
|
|
6
|
+
handleClick?: (data?: any) => void;
|
|
7
|
+
filter: {
|
|
8
|
+
columns: Array<{
|
|
9
|
+
label: string;
|
|
10
|
+
key: string;
|
|
11
|
+
dim: Array<{
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
alias: string;
|
|
15
|
+
}>;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
list: {
|
|
19
|
+
columns: TargetBlockProps[];
|
|
20
|
+
formatter: (data: any) => any;
|
|
21
|
+
request: (data: any) => Promise<any>;
|
|
22
|
+
handleClick: (data: {
|
|
23
|
+
record: any;
|
|
24
|
+
filter: any;
|
|
25
|
+
}) => void;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface CardDetailRef {
|
|
29
|
+
refresh: (params: any) => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _TargetBlock = _interopRequireDefault(require("../TargetBlock"));
|
|
9
|
+
require("./index.less");
|
|
10
|
+
var _icons = _interopRequireDefault(require("@ant-design/icons"));
|
|
11
|
+
var SvgIcon = function SvgIcon(props) {
|
|
12
|
+
var color = props.color;
|
|
13
|
+
return /*#__PURE__*/_react["default"].createElement(_icons["default"], (0, _extends2["default"])({}, props, {
|
|
14
|
+
component: function component() {
|
|
15
|
+
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
16
|
+
width: "29px",
|
|
17
|
+
height: "14px",
|
|
18
|
+
viewBox: "0 0 29 14"
|
|
19
|
+
}, /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement("linearGradient", {
|
|
20
|
+
x1: "50%",
|
|
21
|
+
y1: "9.31946221%",
|
|
22
|
+
x2: "50%",
|
|
23
|
+
y2: "100%",
|
|
24
|
+
id: "" + color
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement("stop", {
|
|
26
|
+
stopColor: color,
|
|
27
|
+
stopOpacity: "0",
|
|
28
|
+
offset: "0%"
|
|
29
|
+
}), /*#__PURE__*/_react["default"].createElement("stop", {
|
|
30
|
+
stopColor: color,
|
|
31
|
+
stopOpacity: "0.851234703",
|
|
32
|
+
offset: "100%"
|
|
33
|
+
}))), /*#__PURE__*/_react["default"].createElement("g", {
|
|
34
|
+
stroke: "none",
|
|
35
|
+
strokeWidth: "1",
|
|
36
|
+
fill: "none",
|
|
37
|
+
fillRule: "evenodd"
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement("g", {
|
|
39
|
+
transform: "translate(-1147.000000, -709.000000)",
|
|
40
|
+
fill: "url(#" + color + ")"
|
|
41
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
42
|
+
d: "M1148.1208,715 L1154.57983,715 L1154.57983,715 L1152.36141,707.93602 C1152.27868,707.672564 1152.42518,707.391919 1152.68863,707.309181 C1152.78332,707.279445 1152.88471,707.27856 1152.9799,707.306639 L1161.5,709.819817 L1161.5,709.819817 L1169.72517,707.31419 C1169.98932,707.23372 1170.2687,707.382628 1170.34917,707.646785 C1170.37803,707.74152 1170.3781,707.842691 1170.34939,707.937469 L1168.20961,715 L1168.20961,715 L1174.8792,715 C1175.15534,715 1175.3792,715.223858 1175.3792,715.5 C1175.3792,715.689491 1175.27208,715.8627 1175.10254,715.947344 L1161.72335,722.627174 C1161.58272,722.697381 1161.41728,722.697381 1161.27665,722.627174 L1147.89746,715.947344 C1147.6504,715.823994 1147.55011,715.523716 1147.67346,715.276655 C1147.7581,715.107119 1147.93131,715 1148.1208,715 Z",
|
|
43
|
+
id: "\u77E9\u5F62\u5907\u4EFD-11"
|
|
44
|
+
}))));
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
var StepBlock = function StepBlock(props) {
|
|
49
|
+
var _data$dataIndex;
|
|
50
|
+
var title = props.title,
|
|
51
|
+
_props$style = props.style,
|
|
52
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
53
|
+
data = props.data,
|
|
54
|
+
dataIndex = props.dataIndex,
|
|
55
|
+
_props$valueStyle = props.valueStyle,
|
|
56
|
+
valueStyle = _props$valueStyle === void 0 ? {} : _props$valueStyle,
|
|
57
|
+
_props$columns = props.columns,
|
|
58
|
+
columns = _props$columns === void 0 ? [] : _props$columns,
|
|
59
|
+
_props$direction = props.direction,
|
|
60
|
+
direction = _props$direction === void 0 ? 'vertical' : _props$direction;
|
|
61
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
+
className: "rc-step-block",
|
|
63
|
+
style: style
|
|
64
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
65
|
+
className: "rc-step-block_title"
|
|
66
|
+
}, title), /*#__PURE__*/_react["default"].createElement("span", {
|
|
67
|
+
className: "rc-step-block_value",
|
|
68
|
+
style: valueStyle
|
|
69
|
+
}, (_data$dataIndex = data === null || data === void 0 ? void 0 : data[dataIndex]) !== null && _data$dataIndex !== void 0 ? _data$dataIndex : '')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
70
|
+
className: "rc-step-block_content",
|
|
71
|
+
style: direction === 'horizontal' ? {
|
|
72
|
+
flexDirection: direction === 'horizontal' ? 'row' : 'column',
|
|
73
|
+
flex: 1,
|
|
74
|
+
display: 'flex'
|
|
75
|
+
} : {}
|
|
76
|
+
}, columns.map(function (column) {
|
|
77
|
+
var _column$;
|
|
78
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
79
|
+
key: "" + (column === null || column === void 0 ? void 0 : (_column$ = column[0]) === null || _column$ === void 0 ? void 0 : _column$.dataIndex),
|
|
80
|
+
className: "rc-step-block_content-item",
|
|
81
|
+
style: direction === 'horizontal' ? {
|
|
82
|
+
flexDirection: direction === 'horizontal' ? 'row' : 'column',
|
|
83
|
+
flex: 1,
|
|
84
|
+
display: 'flex',
|
|
85
|
+
gap: '24px'
|
|
86
|
+
} : {}
|
|
87
|
+
}, Array.isArray(column) && (column === null || column === void 0 ? void 0 : column.map(function (target, idx) {
|
|
88
|
+
var _target$valueStyle;
|
|
89
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
90
|
+
key: target === null || target === void 0 ? void 0 : target.dataIndex,
|
|
91
|
+
className: "rc-step-block_content-target",
|
|
92
|
+
style: idx === column.length - 1 ? {} : {
|
|
93
|
+
marginBottom: '24px'
|
|
94
|
+
}
|
|
95
|
+
}, /*#__PURE__*/_react["default"].createElement(_TargetBlock["default"], (0, _extends2["default"])({}, target, {
|
|
96
|
+
valueStyle: (0, _extends2["default"])({
|
|
97
|
+
color: valueStyle.color
|
|
98
|
+
}, (_target$valueStyle = target === null || target === void 0 ? void 0 : target.valueStyle) !== null && _target$valueStyle !== void 0 ? _target$valueStyle : {}),
|
|
99
|
+
data: data,
|
|
100
|
+
style: (0, _extends2["default"])({
|
|
101
|
+
border: 'none'
|
|
102
|
+
}, target === null || target === void 0 ? void 0 : target.style)
|
|
103
|
+
})), idx < column.length - 1 && (target === null || target === void 0 ? void 0 : target.svgProps) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
104
|
+
className: "rc-step-block_item-svg"
|
|
105
|
+
}, /*#__PURE__*/_react["default"].createElement(SvgIcon, target === null || target === void 0 ? void 0 : target.svgProps)));
|
|
106
|
+
})));
|
|
107
|
+
})));
|
|
108
|
+
};
|
|
109
|
+
var _default = exports["default"] = StepBlock;
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _progress = _interopRequireDefault(require("antd/lib/progress"));
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
require("./index.less");
|
|
9
|
+
var _util = require("../../util");
|
|
10
|
+
var TargetBlock = function TargetBlock(props) {
|
|
11
|
+
var _processValue, _processValue2, _data$progress$dataIn;
|
|
12
|
+
var name = props.name,
|
|
13
|
+
_props$style = props.style,
|
|
14
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
15
|
+
_props$valueStyle = props.valueStyle,
|
|
16
|
+
valueStyle = _props$valueStyle === void 0 ? {} : _props$valueStyle,
|
|
17
|
+
progress = props.progress,
|
|
18
|
+
cTargets = props.cTargets,
|
|
19
|
+
icon = props.icon,
|
|
20
|
+
data = props.data,
|
|
21
|
+
dataIndex = props.dataIndex,
|
|
22
|
+
_props$className = props.className,
|
|
23
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
24
|
+
_props$direction = props.direction,
|
|
25
|
+
direction = _props$direction === void 0 ? 'vertical' : _props$direction,
|
|
26
|
+
handleClick = props.handleClick,
|
|
27
|
+
valueType = props.valueType;
|
|
28
|
+
// const _iconProps = {
|
|
29
|
+
// ...(iconProps ?? {}),
|
|
30
|
+
// style: {
|
|
31
|
+
// fontSize: '14px',
|
|
32
|
+
// position: 'absolute',
|
|
33
|
+
// top: '-1px',
|
|
34
|
+
// left: '0',
|
|
35
|
+
// ...(iconProps?.style ?? {}),
|
|
36
|
+
// },
|
|
37
|
+
// };
|
|
38
|
+
var targetNameClass = "rc-target-block_name " + (handleClick ? 'rc-target-block_name_underline' : '');
|
|
39
|
+
var processValue = function processValue(value) {
|
|
40
|
+
if (!valueType) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
switch (valueType) {
|
|
44
|
+
case 'thousandth':
|
|
45
|
+
return (0, _util.handleValueFormat)(value);
|
|
46
|
+
case 'percent':
|
|
47
|
+
return (0, _util.handlePercent)(value);
|
|
48
|
+
default:
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
+
className: "rc-target-block " + className,
|
|
54
|
+
style: style,
|
|
55
|
+
onClick: function onClick() {
|
|
56
|
+
handleClick === null || handleClick === void 0 ? void 0 : handleClick(data, dataIndex, cTargets);
|
|
57
|
+
}
|
|
58
|
+
}, direction === 'vertical' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
|
+
className: "rc-target-block_name-value"
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
61
|
+
className: targetNameClass
|
|
62
|
+
}, name), /*#__PURE__*/_react["default"].createElement("div", {
|
|
63
|
+
className: "rc-target-block_value",
|
|
64
|
+
style: valueStyle
|
|
65
|
+
}, (_processValue = processValue(data === null || data === void 0 ? void 0 : data[dataIndex])) !== null && _processValue !== void 0 ? _processValue : '-')) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
66
|
+
className: targetNameClass,
|
|
67
|
+
style: {
|
|
68
|
+
marginRight: '12px'
|
|
69
|
+
}
|
|
70
|
+
}, name), /*#__PURE__*/_react["default"].createElement("span", {
|
|
71
|
+
className: "rc-target-block_value",
|
|
72
|
+
style: valueStyle
|
|
73
|
+
}, (_processValue2 = processValue(data === null || data === void 0 ? void 0 : data[dataIndex])) !== null && _processValue2 !== void 0 ? _processValue2 : '-')), progress && /*#__PURE__*/_react["default"].createElement("div", {
|
|
74
|
+
className: "rc-target-block_progress",
|
|
75
|
+
style: progress.style
|
|
76
|
+
}, /*#__PURE__*/_react["default"].createElement(_progress["default"], {
|
|
77
|
+
size: "small",
|
|
78
|
+
percent: data === null || data === void 0 ? void 0 : data[progress.dataIndex],
|
|
79
|
+
showInfo: false
|
|
80
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
81
|
+
style: {
|
|
82
|
+
fontWeight: '400',
|
|
83
|
+
fontSize: '12px',
|
|
84
|
+
color: '#487FFB',
|
|
85
|
+
width: '110px',
|
|
86
|
+
background: '#EEF2FD',
|
|
87
|
+
borderRadius: '4px',
|
|
88
|
+
padding: '2px 4px',
|
|
89
|
+
marginLeft: '8px',
|
|
90
|
+
textAlign: 'center'
|
|
91
|
+
}
|
|
92
|
+
}, /*#__PURE__*/_react["default"].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["default"].createElement("span", null, progress === null || progress === void 0 ? void 0 : progress.text))), icon && icon, cTargets && /*#__PURE__*/_react["default"].createElement("div", {
|
|
93
|
+
className: "rc-target-block_ctarget"
|
|
94
|
+
}, cTargets.map(function (item, i) {
|
|
95
|
+
var _ref, _data$item$dataIndex;
|
|
96
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
97
|
+
className: "rc-target-block_ctarget-content",
|
|
98
|
+
style: (i + 1) % 2 === 0 ? {
|
|
99
|
+
justifySelf: 'end',
|
|
100
|
+
textAlign: 'right'
|
|
101
|
+
} : {},
|
|
102
|
+
key: (item === null || item === void 0 ? void 0 : item.name) || i
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
104
|
+
className: "rc-target-block_ctarget-name"
|
|
105
|
+
}, (item === null || item === void 0 ? void 0 : item.prefix) || '', item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/_react["default"].createElement("span", {
|
|
106
|
+
className: "rc-target-block_ctarget-value",
|
|
107
|
+
style: (item === null || item === void 0 ? void 0 : item.style) || {}
|
|
108
|
+
}, (_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) || ''));
|
|
109
|
+
})));
|
|
110
|
+
};
|
|
111
|
+
var _default = exports["default"] = TargetBlock;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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 };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
var _TargetBlock = _interopRequireDefault(require("./TargetBlock"));
|
|
6
|
+
exports.TargetBlock = _TargetBlock["default"];
|
|
7
|
+
var _CardDetail = _interopRequireWildcard(require("./CardDetail"));
|
|
8
|
+
exports.CardDetail = _CardDetail["default"];
|
|
9
|
+
exports.useCardDetailRef = _CardDetail.useCardDetailRef;
|
|
10
|
+
var _StepBlock = _interopRequireDefault(require("./StepBlock"));
|
|
11
|
+
exports.StepBlock = _StepBlock["default"];
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|