@zgfe/business-lib 1.2.54 → 1.2.55-heyh.0
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/es/assets/iconfont/demo_index.html +3 -3
- package/es/assets/iconfont/iconfont.css +3 -3
- package/es/assets/iconfont/iconfont.ttf +0 -0
- package/es/assets/iconfont/iconfont.woff +0 -0
- package/es/assets/iconfont/iconfont.woff2 +0 -0
- package/es/chart/demo/data/data.d.ts +2 -0
- package/es/chart/demo/data/data.js +5 -37
- package/es/chart/demo/line_bar_stack.js +0 -1
- package/es/chart/index.js +10 -0
- package/es/chart/styles/index.less +45 -0
- package/es/chart/util/chartOptionConfig.js +12 -0
- package/es/chart/util/formatData.js +3 -1
- package/es/chart/util/formatOption.js +21 -11
- package/package.json +2 -2
|
@@ -1398,9 +1398,9 @@
|
|
|
1398
1398
|
<pre><code class="language-css"
|
|
1399
1399
|
>@font-face {
|
|
1400
1400
|
font-family: 'bsicon';
|
|
1401
|
-
src: url('iconfont.woff2?t=
|
|
1402
|
-
url('iconfont.woff?t=
|
|
1403
|
-
url('iconfont.ttf?t=
|
|
1401
|
+
src: url('iconfont.woff2?t=1724914693920') format('woff2'),
|
|
1402
|
+
url('iconfont.woff?t=1724914693920') format('woff'),
|
|
1403
|
+
url('iconfont.ttf?t=1724914693920') format('truetype');
|
|
1404
1404
|
}
|
|
1405
1405
|
</code></pre>
|
|
1406
1406
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "bsicon"; /* Project id 2545884 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1724914693920') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1724914693920') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1724914693920') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.bsicon {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,49 +1,17 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
xAxis: ['2022-12-01', '2022-12-02', '2022-12-03', '2022-12-04', '2022-12-05', '2022-12-06', '2022-12-07', '2022-12-08', '2022-12-09', '2022-12-10', '2022-12-11', '
|
|
2
|
+
xAxis: ['2022-12-01', '2022-12-02', '2022-12-03', '2022-12-04', '2022-12-05', '2022-12-06', '2022-12-07', '2022-12-08', '2022-12-09', '2022-12-10', '2022-12-11', '2024-08-19', '2024-09-16', '2024-10-16'],
|
|
3
3
|
series: [{
|
|
4
|
-
names: ['付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
|
|
5
|
-
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38],
|
|
6
|
-
orderNum: 1
|
|
7
|
-
}, {
|
|
8
|
-
names: ['注册-发送手机验证码'],
|
|
9
|
-
values: [11, 10, 7, 5, 13, 18, 14, 17, 11, 6, 10, 12, 15, 10],
|
|
10
|
-
orderNum: 1
|
|
11
|
-
}, {
|
|
12
|
-
names: ['搜索商品'],
|
|
13
|
-
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79],
|
|
14
|
-
orderNum: 2
|
|
15
|
-
}, {
|
|
16
4
|
names: ['pv'],
|
|
17
5
|
values: [104, 89, 109, 103, 112, 93, 87, 101, 101, 97, 102, 110, 106, 98],
|
|
6
|
+
minValues: [null, null, null, null, null, null, null, null, null, null, null, 102, 0, 1, 2],
|
|
7
|
+
maxValues: [null, null, null, null, null, null, null, null, null, null, null, 666, 1111, 2222],
|
|
18
8
|
orderNum: 3
|
|
19
9
|
}, {
|
|
20
10
|
names: ['申请退货2'],
|
|
21
11
|
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10],
|
|
12
|
+
minValues: [null, null, null, null, null, null, null, null, null, null, null, null, 44, 55, 66],
|
|
13
|
+
maxValues: [null, null, null, null, null, null, null, null, null, null, null, null, 888, 5555],
|
|
22
14
|
orderNum: 4
|
|
23
|
-
}, {
|
|
24
|
-
names: ['搜索商品'],
|
|
25
|
-
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79],
|
|
26
|
-
orderNum: 5
|
|
27
|
-
}, {
|
|
28
|
-
names: ['付款成功11付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
|
|
29
|
-
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38],
|
|
30
|
-
orderNum: 1
|
|
31
|
-
}, {
|
|
32
|
-
names: ['查看商品详情'],
|
|
33
|
-
values: [122, 107, 132, 113, 133, 115, 106, 127, 132, 117, 119, 123, 119, 117],
|
|
34
|
-
orderNum: 2
|
|
35
|
-
}, {
|
|
36
|
-
names: ['scroll'],
|
|
37
|
-
values: [98, 96, 106, 109, 113, 105, 91, 111, 99, 99, 104, 108, 116, 92],
|
|
38
|
-
orderNum: 3
|
|
39
|
-
}, {
|
|
40
|
-
names: ['click'],
|
|
41
|
-
values: [108, 102, 111, 90, 111, 105, 91, 129, 117, 101, 109, 109, 105, 96],
|
|
42
|
-
orderNum: 4
|
|
43
|
-
}, {
|
|
44
|
-
names: ['申请退货'],
|
|
45
|
-
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10],
|
|
46
|
-
orderNum: 5
|
|
47
15
|
}]
|
|
48
16
|
};
|
|
49
17
|
export var barData = {
|
|
@@ -146,7 +146,6 @@ export default (function () {
|
|
|
146
146
|
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-order\" style=\"background:".concat(params.color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(params.seriesName, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(params.value, "</span>\n </div>"));
|
|
147
147
|
return htmlArray.join('');
|
|
148
148
|
};
|
|
149
|
-
console.log('colorList', colorList);
|
|
150
149
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizChart, {
|
|
151
150
|
showList: showList,
|
|
152
151
|
data: data,
|
package/es/chart/index.js
CHANGED
|
@@ -71,6 +71,16 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
71
71
|
option.series.forEach(function (series, seriesIndex) {
|
|
72
72
|
var dashedItem = addDashedSeries(series, index - 1);
|
|
73
73
|
dashedItem.itemStyle.normal.color = dashedItem.lineStyle.normal.color = option.color[seriesIndex];
|
|
74
|
+
dashedItem.markArea = {
|
|
75
|
+
itemStyle: {
|
|
76
|
+
color: 'rgba(22, 93, 255, 0.08)'
|
|
77
|
+
},
|
|
78
|
+
data: [[{
|
|
79
|
+
xAxis: option.xAxis.data[index]
|
|
80
|
+
}, {
|
|
81
|
+
xAxis: option.xAxis.data[option.xAxis.data.length - 1]
|
|
82
|
+
}]]
|
|
83
|
+
};
|
|
74
84
|
dashedSeries.push(dashedItem);
|
|
75
85
|
});
|
|
76
86
|
option.series = option.series.concat(dashedSeries);
|
|
@@ -65,4 +65,49 @@
|
|
|
65
65
|
font-weight: 500;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
.biz-chart-tooltip-item-new {
|
|
70
|
+
min-height: @height-sm;
|
|
71
|
+
margin-bottom: 4px;
|
|
72
|
+
padding: 0px @padding-xs;
|
|
73
|
+
font-size: @font-size-sm;
|
|
74
|
+
background: @white;
|
|
75
|
+
border-radius: @border-radius-small;
|
|
76
|
+
box-shadow: @box-shadow-small;
|
|
77
|
+
.biz-chart-tooltip-content {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
color: @text-color-secondary;
|
|
81
|
+
|
|
82
|
+
.biz-tooltip-marker {
|
|
83
|
+
width: 8px;
|
|
84
|
+
height: 8px;
|
|
85
|
+
margin-right: @margin-xs;
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
}
|
|
88
|
+
.biz-tooltip-order {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
width: 12.8px;
|
|
93
|
+
height: 12.8px;
|
|
94
|
+
margin-right: @margin-xs;
|
|
95
|
+
color: #fff;
|
|
96
|
+
font-weight: 500;
|
|
97
|
+
font-size: 8.96px;
|
|
98
|
+
background: #457dff;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
}
|
|
101
|
+
.biz-tooltip-name {
|
|
102
|
+
max-width: 300px;
|
|
103
|
+
white-space: pre-wrap;
|
|
104
|
+
word-wrap: break-word;
|
|
105
|
+
word-break: break-all;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
&-value {
|
|
109
|
+
font-weight: 700;
|
|
110
|
+
// font-size: 14px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
68
113
|
}
|
|
@@ -161,6 +161,7 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
161
161
|
yAxis.minInterval = 1;
|
|
162
162
|
}
|
|
163
163
|
var series = [];
|
|
164
|
+
var seriesObject = {};
|
|
164
165
|
if (chartType === 'bar') {
|
|
165
166
|
seriesItem.barMaxWidth = 40;
|
|
166
167
|
}
|
|
@@ -174,6 +175,9 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
174
175
|
yAxisIndex: item.yAxisIndex
|
|
175
176
|
} : {});
|
|
176
177
|
});
|
|
178
|
+
series.map(function (item) {
|
|
179
|
+
seriesObject[item.name] = item;
|
|
180
|
+
});
|
|
177
181
|
} else {
|
|
178
182
|
series = [_objectSpread(_objectSpread(_objectSpread({
|
|
179
183
|
name: seriesName || '',
|
|
@@ -189,6 +193,14 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
189
193
|
tooltip.axisPointer = tooltip.axisPointer || {};
|
|
190
194
|
tooltip.axisPointer.type = chartType === 'bar' || chartType === 'line_bar' || chartType === 'muit_y' ? 'shadow' : 'line';
|
|
191
195
|
tooltip.formatter = function (params) {
|
|
196
|
+
if (Object.keys(seriesObject).length > 0) {
|
|
197
|
+
params.map(function (item) {
|
|
198
|
+
var _minValues = seriesObject[item.seriesName].minValues;
|
|
199
|
+
var _mixValues = seriesObject[item.seriesName].maxValues;
|
|
200
|
+
item.minValues = _minValues ? _minValues[item.dataIndex] : null;
|
|
201
|
+
item.maxValues = _mixValues ? _mixValues[item.dataIndex] : null;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
192
204
|
return tooltipFormatter ? tooltipFormatter(params) : tooltip.trigger === 'item' ? tooltipFormatterItemDefault(params, data.resultFormatMap, unit) : tooltipFormatterDefault(params, data.resultFormatMap, unit);
|
|
193
205
|
};
|
|
194
206
|
if (legendPosition === 'top') {
|
|
@@ -66,7 +66,9 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
|
|
|
66
66
|
} else {
|
|
67
67
|
sData.push(_objectSpread(_objectSpread({
|
|
68
68
|
name: showName,
|
|
69
|
-
data: seriesItem.values
|
|
69
|
+
data: seriesItem.values,
|
|
70
|
+
minValues: seriesItem === null || seriesItem === void 0 ? void 0 : seriesItem.minValues,
|
|
71
|
+
maxValues: seriesItem === null || seriesItem === void 0 ? void 0 : seriesItem.maxValues
|
|
70
72
|
}, seriesItem.stack ? {
|
|
71
73
|
stack: seriesItem.stack
|
|
72
74
|
} : {}), {}, {
|
|
@@ -20,16 +20,22 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
seriesMap[item.seriesName] = item.value;
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
var unitHandle = function unitHandle(_value) {
|
|
24
|
+
var _data = _value;
|
|
25
|
+
if (item.seriesName.indexOf('CTR') > -1) {
|
|
26
|
+
_data += '%';
|
|
27
|
+
} else if (resultFormatMap && resultFormatMap[item.seriesName] && /percent/.test(resultFormatMap[item.seriesName])) {
|
|
28
|
+
_data = util.toThousands(_data) + '%';
|
|
29
|
+
} else if (unit && unit === 'time') {
|
|
30
|
+
_data = util.timeFormat(_data, 'hhhmmmsss', 1);
|
|
31
|
+
} else {
|
|
32
|
+
_data = util.toThousands(_data) + (unit || '');
|
|
33
|
+
}
|
|
34
|
+
return _data;
|
|
35
|
+
};
|
|
36
|
+
var lineLabel = unitHandle(item.value);
|
|
37
|
+
var minValues = item.minValues && unitHandle(item.minValues);
|
|
38
|
+
var maxValues = item.maxValues && unitHandle(item.maxValues);
|
|
33
39
|
var name = item.seriesName.trim();
|
|
34
40
|
if (item.seriesType === 'bar' && params.length === 1 && !name) {
|
|
35
41
|
name = (item.data && item.data.label ? item.data.label : item.name).trim();
|
|
@@ -37,7 +43,11 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
|
|
|
37
43
|
var nameArr = name.split('|:|');
|
|
38
44
|
name = nameArr[0];
|
|
39
45
|
var orderNum = nameArr[1];
|
|
40
|
-
|
|
46
|
+
if (item.minValues === null && item.maxValues === null) {
|
|
47
|
+
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"".concat(orderNum ? 'biz-tooltip-order' : 'biz-tooltip-marker', "\" style=\"background:").concat(item.color, "\">").concat(orderNum || '', "</span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span>\n </div>"));
|
|
48
|
+
} else {
|
|
49
|
+
htmlArray.push("<div class=\"biz-chart-tooltip-item-new\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"".concat(orderNum ? 'biz-tooltip-order' : 'biz-tooltip-marker', "\" style=\"background:").concat(item.color, "\">").concat(orderNum || '', "</span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <div>\n <div>\n <span>\u9884\u6D4B\u503C\uFF1A</span>\n <span class=\"biz-chart-tooltip-item-new-value\">").concat(lineLabel, "</span>\n </div>\n <div>\n <span>\u9884\u6D4B\u6700\u5927\u503C\uFF1A</span>\n <span class=\"biz-chart-tooltip-item-new-value\">").concat(maxValues, "</span>\n </div>\n <div>\n <span>\u9884\u6D4B\u6700\u5C0F\u503C\uFF1A</span>\n <span class=\"biz-chart-tooltip-item-new-value\">").concat(minValues, "</span>\n </div>\n </div>\n </div>"));
|
|
50
|
+
}
|
|
41
51
|
});
|
|
42
52
|
return htmlArray.join('');
|
|
43
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.55-heyh.0",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "29e5dfa09ea08105d1395b17f8a28178557fbb4d",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|