@zgfe/business-lib 1.1.82-user.2 → 1.1.82-user.3
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 -1
- package/es/chart/demo/data/data.js +1 -1
- package/es/chart/index.js +52 -0
- package/es/chart/util/formatOption.js +5 -0
- package/es/context/index.d.ts +2 -0
- package/es/demoWrapper/content.js +6 -2
- package/es/hooks/useBizStore.d.ts +2 -0
- package/es/hooks/useBizStore.js +3 -1
- package/es/layout/optionTitle/index.js +1 -1
- package/es/layout/optionTitle/types.d.ts +1 -0
- package/es/userGroup/overlay.js +0 -1
- package/es/userGroupHeader/index.js +3 -1
- package/es/userGroupHeader/styles/index.less +2 -1
- package/package.json +2 -2
package/es/addToPanel/index.js
CHANGED
|
@@ -90,7 +90,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
90
90
|
if (!searchParam.appId && searchParam['app_id']) {
|
|
91
91
|
searchParam.appId = searchParam['app_id'];
|
|
92
92
|
}
|
|
93
|
-
searchParam.chartType = form.chartType;
|
|
93
|
+
searchParam.chartType = form.chartType || props.params.chartType;
|
|
94
94
|
form.extendTarget ? searchParam.extendTarget = form.extendTarget : null;
|
|
95
95
|
var resData = {
|
|
96
96
|
data: searchParam,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
xAxis: ['2022-03-31', '2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05', '2022-04-06', '2022-04-07', '2022-04-08', '2022-04-09', '2022-04-10', '2022-04-11', '
|
|
2
|
+
xAxis: ['2022-03-31', '2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05', '2022-04-06', '2022-04-07', '2022-04-08', '2022-04-09', '2022-04-10', '2022-04-11', '2023-09-17', '2023-09-18'],
|
|
3
3
|
series: [{
|
|
4
4
|
names: ['付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
|
|
5
5
|
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
|
package/es/chart/index.js
CHANGED
|
@@ -17,6 +17,8 @@ import { getChartOption, getPieOption, getMapOption } from './util/chartOptionCo
|
|
|
17
17
|
import { provinceSeries, citySeries, maxMinValue } from './util/mapUtil';
|
|
18
18
|
import { formatPieData, formatChartData } from './util/formatData';
|
|
19
19
|
import './util/data/china.js';
|
|
20
|
+
import moment from 'moment';
|
|
21
|
+
import _ from 'lodash';
|
|
20
22
|
var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
21
23
|
var type = props.type,
|
|
22
24
|
data = props.data,
|
|
@@ -46,6 +48,53 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
46
48
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
49
|
instance = _useState4[0],
|
|
48
50
|
setInstance = _useState4[1];
|
|
51
|
+
function dashedLineFormat(option) {
|
|
52
|
+
var overTime = false;
|
|
53
|
+
option.xAxis.data.forEach(function (label, index) {
|
|
54
|
+
if (overTime) return;
|
|
55
|
+
if (!/\d{4}-\d{2}-\d{2}/.test(label)) return;
|
|
56
|
+
var laterTime = label.replace(/[-:\s]*/g, '');
|
|
57
|
+
var currentDate = new Date();
|
|
58
|
+
var currentDateTime = moment().format('YYYYMMDD');
|
|
59
|
+
if (/\d{2}:\d{2}:\d{2}/.test(label)) {
|
|
60
|
+
currentDateTime += currentDate.toTimeString().match(/\d{2}:\d{2}:\d{2}/)[0].replace(/:/g, '');
|
|
61
|
+
} else if (/\|/.test(label)) {
|
|
62
|
+
laterTime = label.split('|')[1].replace(/[-:\s]*/g, '');
|
|
63
|
+
}
|
|
64
|
+
if (parseInt(laterTime) >= Number(currentDateTime)) {
|
|
65
|
+
overTime = true;
|
|
66
|
+
var dashedSeries = [];
|
|
67
|
+
option.series.forEach(function (series, seriesIndex) {
|
|
68
|
+
var dashedItem = addDashedSeries(series, index - 1);
|
|
69
|
+
dashedItem.itemStyle.normal.color = dashedItem.lineStyle.normal.color = option.color[seriesIndex];
|
|
70
|
+
dashedSeries.push(dashedItem);
|
|
71
|
+
});
|
|
72
|
+
option.series = option.series.concat(dashedSeries);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return option;
|
|
76
|
+
}
|
|
77
|
+
function addDashedSeries(series, dashedIndex) {
|
|
78
|
+
var dashedSeries = _.cloneDeep(series);
|
|
79
|
+
if (!dashedSeries.lineStyle) dashedSeries.lineStyle = {
|
|
80
|
+
normal: {}
|
|
81
|
+
};
|
|
82
|
+
dashedSeries.lineStyle.normal.type = 'dashed';
|
|
83
|
+
if (!dashedSeries.itemStyle) dashedSeries.itemStyle = {
|
|
84
|
+
normal: {}
|
|
85
|
+
};
|
|
86
|
+
series.data.forEach(function (_v, i) {
|
|
87
|
+
if (i > dashedIndex) {
|
|
88
|
+
series.data.splice(i, 1, null);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
dashedSeries.data.forEach(function (_v, i) {
|
|
92
|
+
if (i < dashedIndex) {
|
|
93
|
+
dashedSeries.data.splice(i, 1, null);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return dashedSeries;
|
|
97
|
+
}
|
|
49
98
|
useEffect(function () {
|
|
50
99
|
if (option) {
|
|
51
100
|
setChartOption(function () {
|
|
@@ -70,6 +119,9 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
70
119
|
if (colors) {
|
|
71
120
|
eOption.color = colors;
|
|
72
121
|
}
|
|
122
|
+
if (type === 'line') {
|
|
123
|
+
eOption = dashedLineFormat(eOption);
|
|
124
|
+
}
|
|
73
125
|
setChartOption(function () {
|
|
74
126
|
return _objectSpread({}, eOption);
|
|
75
127
|
});
|
|
@@ -14,7 +14,12 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
|
|
|
14
14
|
}
|
|
15
15
|
var htmlArray = [];
|
|
16
16
|
htmlArray.push("<div class=\"biz-chart-tooltip-title\">".concat(xLabel, "</div>"));
|
|
17
|
+
var seriesMap = {};
|
|
17
18
|
params.forEach(function (item) {
|
|
19
|
+
if (item.value === null || item.value === undefined || seriesMap[item.seriesName] !== null && seriesMap[item.seriesName] !== undefined) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
seriesMap[item.seriesName] = item.value;
|
|
18
23
|
var lineLabel = item.value;
|
|
19
24
|
if (item.seriesName.indexOf('CTR') > -1) {
|
|
20
25
|
lineLabel += '%';
|
package/es/context/index.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export interface GlobalContextProps {
|
|
|
54
54
|
tagList?: UserTagsSelectorTypes.Tag[];
|
|
55
55
|
tagLoading?: boolean;
|
|
56
56
|
setTagList?: React.Dispatch<React.SetStateAction<UserTagsSelectorTypes.Tag[]>>;
|
|
57
|
+
queryGroups?: () => void;
|
|
58
|
+
queryTags?: () => void;
|
|
57
59
|
showUserGroupModal?: (onCreate: (group: UserGroupTypes.Group) => void, onBack?: () => void) => void;
|
|
58
60
|
eventGroupList?: EventGroup[];
|
|
59
61
|
eventNameMap?: Record<string, AnalysisEvent>;
|
|
@@ -91,7 +91,9 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
91
91
|
setUserGroupList = _useBizStore.setUserGroupList,
|
|
92
92
|
tagList = _useBizStore.tagList,
|
|
93
93
|
tagLoading = _useBizStore.tagLoading,
|
|
94
|
-
setTagList = _useBizStore.setTagList
|
|
94
|
+
setTagList = _useBizStore.setTagList,
|
|
95
|
+
queryGroups = _useBizStore.queryGroups,
|
|
96
|
+
queryTags = _useBizStore.queryTags;
|
|
95
97
|
useEffect(function () {
|
|
96
98
|
if (!needMeta || !currentApp) return;
|
|
97
99
|
if (currentApp.appsHasData && currentApp.appsHasData.length) {
|
|
@@ -172,7 +174,9 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
172
174
|
setUserGroupList: setUserGroupList,
|
|
173
175
|
tagList: tagList,
|
|
174
176
|
tagLoading: tagLoading,
|
|
175
|
-
setTagList: setTagList
|
|
177
|
+
setTagList: setTagList,
|
|
178
|
+
queryGroups: queryGroups,
|
|
179
|
+
queryTags: queryTags
|
|
176
180
|
}, contextProps)
|
|
177
181
|
}, children));
|
|
178
182
|
};
|
|
@@ -12,5 +12,7 @@ declare function useBizStore({ currentApp, menuNameMap, }: {
|
|
|
12
12
|
tagLoading: boolean;
|
|
13
13
|
setUserGroupList: React.Dispatch<React.SetStateAction<UserGroupTypes.Group[]>>;
|
|
14
14
|
setTagList: React.Dispatch<React.SetStateAction<UserTagsSelectorTypes.Tag[]>>;
|
|
15
|
+
queryTags: () => void;
|
|
16
|
+
queryGroups: () => void;
|
|
15
17
|
};
|
|
16
18
|
export default useBizStore;
|
package/es/hooks/useBizStore.js
CHANGED
|
@@ -91,7 +91,9 @@ function useBizStore(_ref) {
|
|
|
91
91
|
tagList: tagList,
|
|
92
92
|
tagLoading: tagLoading,
|
|
93
93
|
setUserGroupList: setUserGroupList,
|
|
94
|
-
setTagList: setTagList
|
|
94
|
+
setTagList: setTagList,
|
|
95
|
+
queryTags: queryTags,
|
|
96
|
+
queryGroups: queryGroups
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
99
|
export default useBizStore;
|
|
@@ -44,7 +44,7 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
|
44
44
|
useEffect(function () {
|
|
45
45
|
var _props$value2, _props$value3;
|
|
46
46
|
if (!((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.panelId)) return;
|
|
47
|
-
setOptions(((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.target.id) ? panelBtn(onClick) : panelCreateBtn(onClick));
|
|
47
|
+
setOptions(((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.target.id) ? panelBtn(onClick, props === null || props === void 0 ? void 0 : props.disabled) : panelCreateBtn(onClick, props === null || props === void 0 ? void 0 : props.disabled));
|
|
48
48
|
}, []);
|
|
49
49
|
var onClick = function onClick(type) {
|
|
50
50
|
if (type === BizOptionTitleProps.OptionTypes.CANCEL) {
|
|
@@ -3,6 +3,7 @@ import AddToPanel from '../../addToPanel/types';
|
|
|
3
3
|
export declare namespace BizOptionTitleProps {
|
|
4
4
|
export interface Props {
|
|
5
5
|
value?: Value;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
styleOptions?: AddToPanel.TabItem[];
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
afterEditTarget?: (type: string, value?: any) => void;
|
package/es/userGroup/overlay.js
CHANGED
|
@@ -70,7 +70,6 @@ var Overlay = function Overlay(_ref2) {
|
|
|
70
70
|
}, []);
|
|
71
71
|
useEffect(function () {
|
|
72
72
|
if (!setValue) return;
|
|
73
|
-
console.log('setValue', type, currentGroup);
|
|
74
73
|
setValue(type === 'tag' ? chosenTags : currentGroup);
|
|
75
74
|
}, [type, chosenTags, currentGroup]);
|
|
76
75
|
function onSearch(v) {
|
|
@@ -81,7 +81,9 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
81
81
|
size: 12
|
|
82
82
|
}, /*#__PURE__*/React.createElement(Space, {
|
|
83
83
|
size: 16
|
|
84
|
-
}, /*#__PURE__*/React.createElement("label",
|
|
84
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
85
|
+
className: "".concat(classPrefix, "-title")
|
|
86
|
+
}, "\u5206\u6790\u7528\u6237\u7FA4"), showBtn && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", {
|
|
85
87
|
className: "".concat(classPrefix, "-sure"),
|
|
86
88
|
onClick: onSure
|
|
87
89
|
}, "\u786E\u5B9A"), /*#__PURE__*/React.createElement("a", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.82-user.
|
|
3
|
+
"version": "1.1.82-user.3",
|
|
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": "16fb86446971d7caf7832ab1f46d204f95c514aa",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|