@zgfe/business-lib 1.1.11 → 1.1.13-alpha.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/addToPanel/index.js +1 -0
- package/es/chart/styles/index.less +11 -2
- package/es/chart/util/chartOptionConfig.js +7 -1
- package/es/chart/util/formatData.js +1 -1
- package/es/chart/util/formatOption.js +1 -1
- package/es/select/index.js +1 -1
- package/es/select/option.js +37 -6
- package/es/targetConditionGroup/index.js +2 -1
- package/es/userGroup/index.js +12 -6
- package/es/userGroup/types.d.ts +1 -1
- package/es/utils/ajax.js +2 -2
- package/package.json +2 -2
package/es/addToPanel/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@import '../../assets/styles/variable.less';
|
|
2
2
|
|
|
3
3
|
.biz-chart-tooltip {
|
|
4
|
+
max-height: 324px;
|
|
4
5
|
padding: @padding-xs;
|
|
6
|
+
overflow: auto;
|
|
5
7
|
background-color: rgba(250, 251, 253, 0.8);
|
|
6
8
|
border-color: transparent;
|
|
7
9
|
backdrop-filter: blur(4px);
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
display: flex;
|
|
19
21
|
align-items: center;
|
|
20
22
|
justify-content: space-between;
|
|
21
|
-
height: @height-sm;
|
|
23
|
+
min-height: @height-sm;
|
|
22
24
|
padding: 0px @padding-xs;
|
|
23
25
|
font-size: @font-size-sm;
|
|
24
26
|
background: @white;
|
|
@@ -30,15 +32,22 @@
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
.biz-chart-tooltip-content {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
33
37
|
color: @text-color-secondary;
|
|
34
38
|
|
|
35
39
|
.biz-tooltip-marker {
|
|
36
|
-
display: inline-block;
|
|
37
40
|
width: 8px;
|
|
38
41
|
height: 8px;
|
|
39
42
|
margin-right: @margin-xs;
|
|
40
43
|
border-radius: 50%;
|
|
41
44
|
}
|
|
45
|
+
.biz-tooltip-name {
|
|
46
|
+
max-width: 300px;
|
|
47
|
+
white-space: pre-wrap;
|
|
48
|
+
word-wrap: break-word;
|
|
49
|
+
word-break: break-all;
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
.biz-chart-tooltip-value {
|
|
@@ -41,7 +41,12 @@ export var legendConfig = {
|
|
|
41
41
|
color: '#5F6085'
|
|
42
42
|
},
|
|
43
43
|
tooltip: {
|
|
44
|
-
show: true
|
|
44
|
+
show: true,
|
|
45
|
+
formatter: function formatter(param) {
|
|
46
|
+
var maxLength = 20;
|
|
47
|
+
var names = param.name.match(new RegExp("\\S{1,".concat(maxLength, "}"), 'g'));
|
|
48
|
+
return names ? names.join('<br/>') : '';
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
};
|
|
47
52
|
export var gridConfig = {
|
|
@@ -87,6 +92,7 @@ export var yAxisConfig = {
|
|
|
87
92
|
};
|
|
88
93
|
export var tooltipConfig = {
|
|
89
94
|
trigger: 'axis',
|
|
95
|
+
enterable: true,
|
|
90
96
|
confine: false,
|
|
91
97
|
backgroundColor: 'rgba(250, 251, 253, 0.8)',
|
|
92
98
|
borderColor: 'transparent',
|
|
@@ -28,7 +28,7 @@ export var formatPieData = function formatPieData(data, showAll, showList) {
|
|
|
28
28
|
};
|
|
29
29
|
export var formatChartData = function formatChartData(data, showAll, showList, reverseXAxis, color) {
|
|
30
30
|
var showMap = getShowMap(showList);
|
|
31
|
-
var x_axis = reverseXAxis ? [] : data.x_axis;
|
|
31
|
+
var x_axis = reverseXAxis && data.series.length ? [] : data.x_axis;
|
|
32
32
|
var sData = [];
|
|
33
33
|
var colorData = color || chartColors;
|
|
34
34
|
data.series.forEach(function (seriesItem) {
|
|
@@ -27,7 +27,7 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var name = (params.length > 1 ? item.seriesName : item.data && item.data.label ? item.data.label : item.name).trim();
|
|
30
|
-
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <
|
|
30
|
+
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(item.color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span>\n </div>"));
|
|
31
31
|
});
|
|
32
32
|
return htmlArray.join('');
|
|
33
33
|
};
|
package/es/select/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var BizSelect = function BizSelect(props) {
|
|
|
94
94
|
useEffect(function () {
|
|
95
95
|
if (!props.value) return;
|
|
96
96
|
setCurrent(getValue(props.value));
|
|
97
|
-
}, [props.value]);
|
|
97
|
+
}, [props.value, props.options]);
|
|
98
98
|
|
|
99
99
|
var getValue = function getValue(data) {
|
|
100
100
|
if (props.multiple) {
|
package/es/select/option.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { Tooltip } from 'antd';
|
|
14
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
15
|
import { classPrefix } from '.';
|
|
3
16
|
import IconFont from '../icon/iconFont';
|
|
4
17
|
import { util } from '../utils';
|
|
@@ -10,6 +23,20 @@ var SelectOption = function SelectOption(props) {
|
|
|
10
23
|
disabled = props.disabled,
|
|
11
24
|
multiple = props.multiple,
|
|
12
25
|
customLabel = props.customLabel;
|
|
26
|
+
var optionRef = useRef(null);
|
|
27
|
+
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
isOverflow = _useState2[0],
|
|
31
|
+
setIsOverflow = _useState2[1];
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var _optionRef$current, _optionRef$current2;
|
|
35
|
+
|
|
36
|
+
var clientWidth = (_optionRef$current = optionRef.current) === null || _optionRef$current === void 0 ? void 0 : _optionRef$current.clientWidth;
|
|
37
|
+
var scrollWidth = (_optionRef$current2 = optionRef.current) === null || _optionRef$current2 === void 0 ? void 0 : _optionRef$current2.scrollWidth;
|
|
38
|
+
setIsOverflow(clientWidth < scrollWidth);
|
|
39
|
+
}, []);
|
|
13
40
|
|
|
14
41
|
function onClick() {
|
|
15
42
|
if (disabled) return;
|
|
@@ -43,10 +70,13 @@ var SelectOption = function SelectOption(props) {
|
|
|
43
70
|
}), /*#__PURE__*/React.createElement("span", null, group.name));
|
|
44
71
|
}
|
|
45
72
|
|
|
46
|
-
return /*#__PURE__*/React.createElement(
|
|
73
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
74
|
+
placement: "rightBottom",
|
|
75
|
+
title: isOverflow ? option[props.labelField] : null,
|
|
76
|
+
zIndex: 100000
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
47
78
|
className: "".concat(classPrefix, "-option ").concat(multiple ? classPrefix + '-option-multiple' : '', " ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
|
|
48
|
-
onClick: onClick
|
|
49
|
-
title: option[props.labelField]
|
|
79
|
+
onClick: onClick
|
|
50
80
|
}, multiple && (checked ? /*#__PURE__*/React.createElement(IconFont, {
|
|
51
81
|
className: "".concat(classPrefix, "-checkbox ").concat(classPrefix, "-checked"),
|
|
52
82
|
type: 'a-Property1xuanzhong'
|
|
@@ -56,10 +86,11 @@ var SelectOption = function SelectOption(props) {
|
|
|
56
86
|
})), (option === null || option === void 0 ? void 0 : option.icon) && /*#__PURE__*/React.createElement("span", {
|
|
57
87
|
className: "".concat(classPrefix, "-option-icon")
|
|
58
88
|
}, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement("span", {
|
|
59
|
-
className: "".concat(classPrefix, "-option-label")
|
|
89
|
+
className: "".concat(classPrefix, "-option-label"),
|
|
90
|
+
ref: optionRef
|
|
60
91
|
}, renderLabel(option)), !disabled && /*#__PURE__*/React.createElement("span", {
|
|
61
92
|
className: "".concat(classPrefix, "-option-btn")
|
|
62
|
-
}, props.extra && props.extra(option)));
|
|
93
|
+
}, props.extra && props.extra(option))));
|
|
63
94
|
};
|
|
64
95
|
|
|
65
96
|
export default SelectOption;
|
|
@@ -31,7 +31,8 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
31
31
|
setTargetData = _useState2[1];
|
|
32
32
|
|
|
33
33
|
var _useContext = useContext(BizGlobalDataContext),
|
|
34
|
-
|
|
34
|
+
_useContext$eventGrou = _useContext.eventGroupList,
|
|
35
|
+
eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou;
|
|
35
36
|
|
|
36
37
|
var _useState3 = useState({
|
|
37
38
|
analysisIndex: 'number'
|
package/es/userGroup/index.js
CHANGED
|
@@ -10,11 +10,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
10
10
|
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
13
|
-
import React, { useEffect, useState } from 'react';
|
|
13
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
14
14
|
import './styles/index.less';
|
|
15
15
|
import BizSelect from '../select';
|
|
16
16
|
import BizTargetOptionIcon from '../targetSelector/optionIcon';
|
|
17
17
|
import { Skeleton } from 'antd';
|
|
18
|
+
import BizGlobalDataContext from '../context';
|
|
18
19
|
|
|
19
20
|
var BizUserGroup = function BizUserGroup(props) {
|
|
20
21
|
var enableDelete = props.enableDelete,
|
|
@@ -28,10 +29,15 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
28
29
|
|
|
29
30
|
var _useState3 = useState(true),
|
|
30
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
loading = _useState4[0],
|
|
33
|
+
setLoading = _useState4[1];
|
|
33
34
|
|
|
34
35
|
var classPrefix = 'biz-user';
|
|
36
|
+
|
|
37
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
38
|
+
_useContext$userGroup = _useContext.userGroupList,
|
|
39
|
+
userGroupList = _useContext$userGroup === void 0 ? [] : _useContext$userGroup;
|
|
40
|
+
|
|
35
41
|
useEffect(function () {
|
|
36
42
|
var value = props.defaultValue || props.value;
|
|
37
43
|
|
|
@@ -39,7 +45,7 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
39
45
|
setCurrent(value);
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
setLoading(false);
|
|
43
49
|
}, []);
|
|
44
50
|
|
|
45
51
|
var onClickDelete = function onClickDelete() {
|
|
@@ -54,14 +60,14 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
54
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
61
|
className: classPrefix
|
|
56
62
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
57
|
-
loading:
|
|
63
|
+
loading: loading,
|
|
58
64
|
active: true,
|
|
59
65
|
paragraph: {
|
|
60
66
|
rows: 1
|
|
61
67
|
}
|
|
62
68
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
63
69
|
value: current,
|
|
64
|
-
options: props.options,
|
|
70
|
+
options: props.options || userGroupList,
|
|
65
71
|
keyField: keyField,
|
|
66
72
|
labelField: labelField,
|
|
67
73
|
theme: "secondary",
|
package/es/userGroup/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare namespace UserGroupTypes {
|
|
|
4
4
|
defaultValue?: BizSelectTypes.Option;
|
|
5
5
|
value?: BizSelectTypes.Option;
|
|
6
6
|
className?: string;
|
|
7
|
-
options
|
|
7
|
+
options?: BizSelectTypes.Option[];
|
|
8
8
|
labelField?: string;
|
|
9
9
|
keyField?: string;
|
|
10
10
|
enableDelete?: boolean;
|
package/es/utils/ajax.js
CHANGED
|
@@ -59,7 +59,7 @@ function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
if (!apiResult.code) {
|
|
62
|
-
notification
|
|
62
|
+
notification.error({
|
|
63
63
|
message: "\u63A5\u53E3\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38"
|
|
64
64
|
});
|
|
65
65
|
throw new Error('接口响应结构异常,缺少code');
|
|
@@ -77,7 +77,7 @@ function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
77
77
|
|
|
78
78
|
if (!flag) {
|
|
79
79
|
message = apiResult.msg || message;
|
|
80
|
-
notification
|
|
80
|
+
notification[notifyType || 'error']({
|
|
81
81
|
message: errorTitle || "\u8BF7\u6C42\u9519\u8BEF",
|
|
82
82
|
description: message
|
|
83
83
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13-alpha.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "63fcf4f2e0e0d79129b80b974bae79b15f4cc65c"
|
|
64
64
|
}
|