@zgfe/business-lib 1.2.23-ht.2 → 1.2.24

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/chart/index.js CHANGED
@@ -39,8 +39,7 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
39
39
  valueUnit = props.valueUnit,
40
40
  legendPosition = props.legendPosition,
41
41
  legendOrient = props.legendOrient,
42
- autoHeight = props.autoHeight,
43
- isHideLegend = props.isHideLegend;
42
+ autoHeight = props.autoHeight;
44
43
  var _useState = useState({}),
45
44
  _useState2 = _slicedToArray(_useState, 2),
46
45
  chartOption = _useState2[0],
@@ -110,7 +109,7 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
110
109
  eOption = getPieOption(rData, legendPosition, legendOrient, props.showLabel, props.radius, props.center, tooltipFormatter);
111
110
  } else if (type === 'line' || type === 'bar' || type === 'line_bar') {
112
111
  var _rData = formatChartData(data, showAll, showList, reverseXAxis, colors, type === 'line_bar');
113
- eOption = getChartOption(type, _rData, legendPosition, legendOrient, valueUnit, xRotate, yRotate, tooltipFormatter, xAxisFormatter, yAxisFormatter, legendFormatter, reverseXAxis, seriesName, isHideLegend);
112
+ eOption = getChartOption(type, _rData, legendPosition, legendOrient, valueUnit, xRotate, yRotate, tooltipFormatter, xAxisFormatter, yAxisFormatter, legendFormatter, reverseXAxis, seriesName);
114
113
  if (type === 'line_bar') {
115
114
  eOption.grid.right = '1%';
116
115
  eOption.grid.left = '1%';
@@ -52,6 +52,5 @@ export declare namespace ChartTypes {
52
52
  reverseXAxis?: boolean;
53
53
  seriesName?: string;
54
54
  autoHeight?: boolean;
55
- isHideLegend?: boolean;
56
55
  }
57
56
  }
@@ -10,7 +10,7 @@ export declare const gridConfig: GridOption;
10
10
  export declare const xAxisConfig: XAXisOption;
11
11
  export declare const yAxisConfig: YAXisOption;
12
12
  export declare const tooltipConfig: TooltipComponentOption;
13
- export declare const getChartOption: (chartType: string, data: ChartTypes.Value, legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', unit?: string, xRotate?: number, yRotate?: number, tooltipFormatter?: ((value: any) => string) | undefined, xAxisFormatter?: ((value: any) => string) | undefined, yAxisFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined, reverseXAxis?: boolean, seriesName?: string, isHideLegend?: boolean) => EChartsOption;
13
+ export declare const getChartOption: (chartType: string, data: ChartTypes.Value, legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', unit?: string, xRotate?: number, yRotate?: number, tooltipFormatter?: ((value: any) => string) | undefined, xAxisFormatter?: ((value: any) => string) | undefined, yAxisFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined, reverseXAxis?: boolean, seriesName?: string) => EChartsOption;
14
14
  export declare const getPieOption: (seriesData?: object[], legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', showLabel?: boolean, radius?: string | number | Array<string | number>, center?: Array<string | number>, tooltipFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined) => EChartsOption;
15
15
  export declare const getMapOption: (seriesData: object[] | undefined, maxMinValue: {
16
16
  min: number;
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { tooltipFormatterDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault, tooltipFormatterItemDefault } from './formatOption';
7
+ import { tooltipFormatterDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault } from './formatOption';
8
8
  import { chartColors } from './color';
9
9
  import '../styles/index.less';
10
10
  import { util } from '../../utils';
@@ -122,7 +122,6 @@ export var getChartOption = function getChartOption(chartType, data) {
122
122
  var legendFormatter = arguments.length > 10 ? arguments[10] : undefined;
123
123
  var reverseXAxis = arguments.length > 11 ? arguments[11] : undefined;
124
124
  var seriesName = arguments.length > 12 ? arguments[12] : undefined;
125
- var isHideLegend = arguments.length > 13 ? arguments[13] : undefined;
126
125
  var xAxis = JSON.parse(JSON.stringify(xAxisConfig)),
127
126
  tooltip = JSON.parse(JSON.stringify(tooltipConfig)),
128
127
  yAxis = _objectSpread({}, yAxisConfig),
@@ -161,9 +160,6 @@ export var getChartOption = function getChartOption(chartType, data) {
161
160
  }
162
161
  if (!reverseXAxis) {
163
162
  series = data.series.map(function (item) {
164
- if (item.stack) {
165
- tooltip.trigger = 'item';
166
- }
167
163
  return _objectSpread(_objectSpread(_objectSpread({}, item), seriesItem), {}, {
168
164
  type: chartType === 'line_bar' ? item.type : chartType
169
165
  }, chartType === 'line_bar' ? {
@@ -183,7 +179,7 @@ export var getChartOption = function getChartOption(chartType, data) {
183
179
  tooltip.axisPointer = tooltip.axisPointer || {};
184
180
  tooltip.axisPointer.type = chartType === 'bar' || chartType === 'line_bar' ? 'shadow' : 'line';
185
181
  tooltip.formatter = function (params) {
186
- return tooltipFormatter ? tooltipFormatter(params) : tooltip.trigger === 'item' ? tooltipFormatterItemDefault(params, data.resultFormatMap, unit) : tooltipFormatterDefault(params, data.resultFormatMap, unit);
182
+ return tooltipFormatter ? tooltipFormatter(params) : tooltipFormatterDefault(params, data.resultFormatMap, unit);
187
183
  };
188
184
  if (legendPosition === 'top') {
189
185
  grid.top = series.length > 1 || series.length > 0 && series[0].name ? 45 : 10;
@@ -192,9 +188,6 @@ export var getChartOption = function getChartOption(chartType, data) {
192
188
  }
193
189
  legend.top = legendPosition;
194
190
  legend.orient = legendOrient;
195
- if (isHideLegend) {
196
- legend.show = false;
197
- }
198
191
  if (legendOrient === 'vertical') {
199
192
  legend.left = 'left';
200
193
  legend.height = 'auto';
@@ -1,9 +1,3 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  import util from '../../utils/util';
8
2
  import { chartColors } from './color';
9
3
  export var formatPieData = function formatPieData(data, showAll, showList, showOther) {
@@ -64,14 +58,11 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
64
58
  }
65
59
  });
66
60
  } else {
67
- sData.push(_objectSpread(_objectSpread({
61
+ sData.push({
68
62
  name: showName,
69
- data: seriesItem.values
70
- }, seriesItem.stack ? {
71
- stack: seriesItem.stack
72
- } : {}), {}, {
63
+ data: seriesItem.values,
73
64
  type: isUseSelf ? seriesItem.type : undefined
74
- }));
65
+ });
75
66
  }
76
67
  }
77
68
  });
@@ -1,11 +1,8 @@
1
1
  declare const tooltipFormatterDefault: (params: any, resultFormatMap?: {
2
2
  [key: string]: string;
3
3
  } | undefined, unit?: string) => string;
4
- declare const tooltipFormatterItemDefault: (params: any, resultFormatMap?: {
5
- [key: string]: string;
6
- } | undefined, unit?: string) => string | undefined;
7
4
  declare const yAxisFormatterDefault: (value: number, unit?: string) => string;
8
5
  declare const xAxisFormatterDefault: (value: string) => string;
9
6
  declare const mapTooltipFormatter: (params: any) => string | undefined;
10
7
  declare const legendFormatterDefault: (label: string) => string;
11
- export { tooltipFormatterDefault, tooltipFormatterItemDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault, };
8
+ export { tooltipFormatterDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault, };
@@ -41,45 +41,6 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
41
41
  });
42
42
  return htmlArray.join('');
43
43
  };
44
- var tooltipFormatterItemDefault = function tooltipFormatterItemDefault(params, resultFormatMap, unit) {
45
- var xDate = params.name;
46
- var xLabel = xDate;
47
- var lengthReg = new RegExp('\\S{1,' + maxLength + '}', 'g');
48
- if (/^\d{4}-\d{2}-\d{2}$/.test(xLabel)) {
49
- xLabel = xLabel.replace(/\d{4}-/, '');
50
- } else if (/^\d{4}-\d{2}-\d{2}\|\d{4}-\d{2}-\d{2}$/.test(xLabel)) {
51
- var dates = xLabel.match(/\d{4}-\d{2}-\d{2}/g);
52
- xLabel = dates[0].replace(/\d{4}-/, '') + '~' + dates[1].replace(/\d{4}-/, '');
53
- } else {
54
- xLabel = (xLabel.match(lengthReg) || []).join('<br/>');
55
- }
56
- var htmlArray = [];
57
- htmlArray.push("<div class=\"biz-chart-tooltip-title\">".concat(xLabel, "</div>"));
58
- var seriesMap = {};
59
- if (params.value === null || params.value === undefined || seriesMap[params.seriesName] !== null && seriesMap[params.seriesName] !== undefined) {
60
- return;
61
- }
62
- seriesMap[params.seriesName] = params.value;
63
- var lineLabel = params.value;
64
- if (params.seriesName.indexOf('CTR') > -1) {
65
- lineLabel += '%';
66
- } else if (resultFormatMap && resultFormatMap[params.seriesName] && /percent/.test(resultFormatMap[params.seriesName])) {
67
- lineLabel = util.toThousands(lineLabel) + '%';
68
- } else if (unit && unit === 'time') {
69
- lineLabel = util.timeFormat(lineLabel, 'hhhmmmsss', 1);
70
- } else {
71
- lineLabel = util.toThousands(lineLabel) + (unit || '');
72
- }
73
- var name = params.seriesName.trim();
74
- if (params.seriesType === 'bar' && params.length === 1 && !name) {
75
- name = (params.data && params.data.label ? params.data.label : params.name).trim();
76
- }
77
- var nameArr = name.split('|:|');
78
- name = nameArr[0];
79
- var orderNum = nameArr[1];
80
- 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(params.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>"));
81
- return htmlArray.join('');
82
- };
83
44
  var yAxisFormatterDefault = function yAxisFormatterDefault(value, unit) {
84
45
  if (unit && unit === '%') {
85
46
  return value + '%';
@@ -131,4 +92,4 @@ var legendFormatterDefault = function legendFormatterDefault(label) {
131
92
  replaceStr: '...'
132
93
  });
133
94
  };
134
- export { tooltipFormatterDefault, tooltipFormatterItemDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault };
95
+ export { tooltipFormatterDefault, xAxisFormatterDefault, yAxisFormatterDefault, mapTooltipFormatter, legendFormatterDefault };
@@ -2,5 +2,6 @@ import React from 'react';
2
2
  declare const BizDate: React.FC<{
3
3
  selectRange?: number;
4
4
  selectRangeUnit?: 'days' | 'weeks' | 'months';
5
+ onOpenChange?: (data: boolean) => void;
5
6
  }>;
6
7
  export default BizDate;
@@ -19,7 +19,8 @@ var RangePicker = DatePicker.RangePicker;
19
19
  var BizDateBeyondRange = false;
20
20
  var BizDate = function BizDate(_ref) {
21
21
  var selectRange = _ref.selectRange,
22
- selectRangeUnit = _ref.selectRangeUnit;
22
+ selectRangeUnit = _ref.selectRangeUnit,
23
+ _onOpenChange = _ref.onOpenChange;
23
24
  var _useContext = useContext(DatePickerContext),
24
25
  includeToday = _useContext.includeToday,
25
26
  currentType = _useContext.currentType,
@@ -99,11 +100,12 @@ var BizDate = function BizDate(_ref) {
99
100
  }),
100
101
  format: 'YYYY-MM-DD',
101
102
  disabledDate: disabledDate,
102
- onOpenChange: function onOpenChange() {
103
+ onOpenChange: function onOpenChange(open) {
103
104
  if (BizDateBeyondRange) {
104
105
  message.error("\u65F6\u95F4\u6BB5\u6700\u5927\u652F\u6301".concat(selectRange ? selectRange : 12).concat(selectRangeUnitText));
105
106
  BizDateBeyondRange = false;
106
107
  }
108
+ _onOpenChange && _onOpenChange(open);
107
109
  },
108
110
  onChange: function onChange(value) {
109
111
  var subtractDays = 0;
@@ -29,7 +29,7 @@ export default (function () {
29
29
  onChange: setIncludeToday
30
30
  })), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePicker, {
31
31
  onChange: handleChange,
32
- dateTypeList: ['week', 'month', 'quarter', 'custom'],
32
+ dateTypeList: ['week', 'month', 'custom'],
33
33
  includeToday: includeToday,
34
34
  defaultValue: time
35
35
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time)));
@@ -29,7 +29,8 @@ var BizDatePicker = function BizDatePicker(_ref) {
29
29
  selectRange = _ref.selectRange,
30
30
  selectRangeUnit = _ref.selectRangeUnit,
31
31
  dateTypeList = _ref.dateTypeList,
32
- onChange = _ref.onChange;
32
+ onChange = _ref.onChange,
33
+ onOpenChange = _ref.onOpenChange;
33
34
  var _useState = useState(false),
34
35
  _useState2 = _slicedToArray(_useState, 2),
35
36
  ready = _useState2[0],
@@ -61,7 +62,6 @@ var BizDatePicker = function BizDatePicker(_ref) {
61
62
  day: '按天',
62
63
  week: '按周',
63
64
  month: '按月',
64
- quarter: '按季度',
65
65
  custom: '自定义'
66
66
  };
67
67
  return {
@@ -155,7 +155,8 @@ var BizDatePicker = function BizDatePicker(_ref) {
155
155
  }
156
156
  }), /*#__PURE__*/React.createElement(PickerShortcut, null), /*#__PURE__*/React.createElement(BizDate, {
157
157
  selectRange: selectRange,
158
- selectRangeUnit: selectRangeUnit
158
+ selectRangeUnit: selectRangeUnit,
159
+ onOpenChange: onOpenChange
159
160
  })));
160
161
  };
161
162
  BizDatePicker.defaultProps = {
@@ -67,19 +67,6 @@ var getTypeList = function getTypeList(currentType, mode, includeToday) {
67
67
  value: '3个月',
68
68
  count: 3
69
69
  }]
70
- }, {
71
- label: '按季度',
72
- value: DatePickerTypes.Unit.quarter,
73
- children: [{
74
- value: '1季度',
75
- count: 1
76
- }, {
77
- value: '2季度',
78
- count: 2
79
- }, {
80
- value: '4季度',
81
- count: 4
82
- }]
83
70
  }];
84
71
  var list = (((_shortcuts$find = shortcuts.find(function (item) {
85
72
  return item.value === currentType;
@@ -4,7 +4,6 @@ export declare namespace DatePickerTypes {
4
4
  'day' = "day",
5
5
  'week' = "week",
6
6
  'month' = "month",
7
- 'quarter' = "quarter",
8
7
  'custom' = "custom"
9
8
  }
10
9
  interface Range {
@@ -22,6 +21,7 @@ export declare namespace DatePickerTypes {
22
21
  selectRange?: number;
23
22
  selectRangeUnit?: 'days' | 'weeks' | 'months';
24
23
  onChange?: (data: Value) => void;
24
+ onOpenChange?: (data: boolean) => void;
25
25
  mode?: 'general' | 'simple' | 'superSimple';
26
26
  dateTypeList?: Unit[];
27
27
  }
@@ -6,7 +6,6 @@ export var DatePickerTypes;
6
6
  Unit["day"] = "day";
7
7
  Unit["week"] = "week";
8
8
  Unit["month"] = "month";
9
- Unit["quarter"] = "quarter";
10
9
  Unit["custom"] = "custom";
11
10
  })(Unit = DatePickerTypes.Unit || (DatePickerTypes.Unit = {}));
12
11
  })(DatePickerTypes || (DatePickerTypes = {}));
@@ -22,12 +22,6 @@ function getAbsoluteDate(unit, count, maxDate) {
22
22
  firstOfMonth.setMonth(firstOfMonth.getMonth() - count);
23
23
  res.startDate = new Date(firstOfMonth);
24
24
  break;
25
- case DatePickerTypes.Unit.quarter:
26
- res.endDate = maxDate;
27
- var firstOfQuarter = new Date(maxDate.getTime() - (maxDate.getDate() - 1) * dayTime);
28
- firstOfQuarter.setMonth(firstOfQuarter.getMonth() + 1 - (firstOfQuarter.getMonth() + 1) % 3 - 3 * (count - 1));
29
- res.startDate = new Date(firstOfQuarter);
30
- break;
31
25
  }
32
26
  return res;
33
27
  }
@@ -5,7 +5,7 @@ var InnerDemo = function InnerDemo(_ref) {
5
5
  contextProps = _ref.contextProps;
6
6
  return /*#__PURE__*/React.createElement(DemoWrapper, {
7
7
  needMeta: true,
8
- defaultApp: globalConfig.appId,
8
+ defaultApp: 461,
9
9
  contextProps: contextProps
10
10
  }, /*#__PURE__*/React.createElement("div", {
11
11
  style: {
@@ -45,7 +45,7 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
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
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
+ }, [props === null || props === void 0 ? void 0 : props.disabled]);
49
49
  var onClick = function onClick(type) {
50
50
  if (type === BizOptionTitleProps.OptionTypes.CANCEL) {
51
51
  var _props$value4;
@@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useState } from 'react';
8
8
  import eventData from '../../mock/event';
9
9
  import envData from '../../mock/env';
10
10
  import userData from '../../mock/user';
11
- import { BizUserCondition, BizGlobalDataContext, convertAttributeData } from '@zgfe/business-lib';
11
+ import { BizUserCondition, DemoWrapper, convertAttributeData } from '@zgfe/business-lib';
12
12
  import { conditions, tagList } from './mockData';
13
13
  import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
14
14
  export default (function () {
@@ -45,16 +45,9 @@ export default (function () {
45
45
  userTagsData: userTagsData,
46
46
  isRealTime: true
47
47
  });
48
- return /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
49
- value: {
50
- eventGroupList: newStore.eventGroupList,
51
- userPropList: newStore.userPropList,
52
- eventEnvList: newStore.envPropList,
53
- currentApp: {
54
- appId: 204,
55
- platform: 0
56
- }
57
- }
48
+ return /*#__PURE__*/React.createElement(DemoWrapper, {
49
+ needMeta: true,
50
+ defaultApp: 461
58
51
  }, /*#__PURE__*/React.createElement("div", {
59
52
  style: {
60
53
  display: 'inline-block'
@@ -143,6 +143,11 @@ var BizUserGroup = function BizUserGroup(_ref) {
143
143
  },
144
144
  trigger: ['click'],
145
145
  onOpenChange: function onOpenChange(open) {
146
+ if (_.isArray(chosen) && !chosen.length || chosen === undefined) {
147
+ setChosen(userGroupList === null || userGroupList === void 0 ? void 0 : userGroupList.find(function (item) {
148
+ return item.id === 0;
149
+ }));
150
+ }
146
151
  setOpen(open);
147
152
  },
148
153
  open: open,
package/es/utils/ajax.js CHANGED
@@ -106,7 +106,7 @@ function request(_x, _x2) {
106
106
  }
107
107
  function _request() {
108
108
  _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, options) {
109
- var _globalConfig$request, _globalConfig$request2, _params$options, _params$options2, err, option, list, optionsWrapper, responseWrapper, params, res;
109
+ var _globalConfig$request, _globalConfig$request2, _params$options, _params$options2, err, option, list, optionsWrapper, responseWrapper, params, res, _params$options3;
110
110
  return _regeneratorRuntime().wrap(function _callee$(_context) {
111
111
  while (1) switch (_context.prev = _context.next) {
112
112
  case 0:
@@ -150,39 +150,48 @@ function _request() {
150
150
  throw new Error('Request Interruption');
151
151
  case 17:
152
152
  if (!(((_params$options2 = params.options) === null || _params$options2 === void 0 ? void 0 : _params$options2.responseType) === 'blob')) {
153
- _context.next = 23;
153
+ _context.next = 27;
154
154
  break;
155
155
  }
156
156
  if (!util.isBlob(res.data)) {
157
- _context.next = 22;
157
+ _context.next = 26;
158
158
  break;
159
159
  }
160
+ if (!(((_params$options3 = params.options) === null || _params$options3 === void 0 ? void 0 : _params$options3.downloadFile) === false)) {
161
+ _context.next = 23;
162
+ break;
163
+ }
164
+ return _context.abrupt("return", res.data);
165
+ case 23:
160
166
  return _context.abrupt("return", downloadFile(res, params.options.fileName));
161
- case 22:
167
+ case 24:
168
+ _context.next = 27;
169
+ break;
170
+ case 26:
162
171
  res = res.data;
163
- case 23:
172
+ case 27:
164
173
  return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType));
165
- case 26:
166
- _context.prev = 26;
174
+ case 30:
175
+ _context.prev = 30;
167
176
  _context.t0 = _context["catch"](0);
168
177
  if (!_context.t0.isCancel) {
169
- _context.next = 30;
178
+ _context.next = 34;
170
179
  break;
171
180
  }
172
181
  throw _context.t0;
173
- case 30:
182
+ case 34:
174
183
  if (!(_context.t0.message === 'Request Interruption')) {
175
- _context.next = 32;
184
+ _context.next = 36;
176
185
  break;
177
186
  }
178
187
  throw new Error('Request Interruption');
179
- case 32:
188
+ case 36:
180
189
  return _context.abrupt("return", null);
181
- case 33:
190
+ case 37:
182
191
  case "end":
183
192
  return _context.stop();
184
193
  }
185
- }, _callee, null, [[0, 26]]);
194
+ }, _callee, null, [[0, 30]]);
186
195
  }));
187
196
  return _request.apply(this, arguments);
188
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.23-ht.2",
3
+ "version": "1.2.24",
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": "6d012b3df5ec10e7fdcc69ffe1aaf55f069e07cf",
58
+ "gitHead": "c5c469154168cd30cf997ce8c6859c4323a2d8fc",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }
@@ -1,44 +0,0 @@
1
- declare const _default: {
2
- series: ({
3
- names: string[];
4
- index: string;
5
- type: string;
6
- itemStyle: {
7
- normal: {
8
- color: string;
9
- };
10
- };
11
- values: number[];
12
- stack?: undefined;
13
- duration?: undefined;
14
- } | {
15
- names: string[];
16
- index: string;
17
- type: string;
18
- stack: string;
19
- itemStyle: {
20
- normal: {
21
- color: string;
22
- };
23
- };
24
- values: number[];
25
- duration?: undefined;
26
- } | {
27
- duration: never[];
28
- type: string;
29
- index: string;
30
- names: string[];
31
- values: number[];
32
- itemStyle?: undefined;
33
- stack?: undefined;
34
- })[];
35
- xAxis: string[];
36
- };
37
- export default _default;
38
- export declare const barData: {
39
- xAxis: string[];
40
- series: {
41
- names: string[];
42
- values: number[];
43
- }[];
44
- };
@@ -1,143 +0,0 @@
1
- export default {
2
- series: [{
3
- names: ['Direct'],
4
- index: '人数',
5
- type: 'bar',
6
- itemStyle: {
7
- normal: {
8
- color: '#457DFF'
9
- }
10
- },
11
- values: [490, 540, 490, 510, 570, 890, 930]
12
- }, {
13
- names: ['Email'],
14
- index: '人数',
15
- type: 'bar',
16
- stack: 'Ad',
17
- itemStyle: {
18
- normal: {
19
- color: '#5888F4'
20
- }
21
- },
22
- values: [120, 130, 100, 130, 90, 230, 210]
23
- }, {
24
- names: ['Union Ads'],
25
- index: '人数',
26
- type: 'bar',
27
- stack: 'Ad',
28
- itemStyle: {
29
- normal: {
30
- color: '#457DFF'
31
- }
32
- },
33
- values: [220, 180, 190, 230, 290, 330, 310]
34
- }, {
35
- names: ['Video Ads'],
36
- index: '人数',
37
- type: 'bar',
38
- stack: 'Ad',
39
- itemStyle: {
40
- normal: {
41
- color: '#3F72EA'
42
- }
43
- },
44
- values: [150, 230, 200, 150, 190, 330, 410]
45
- }, {
46
- names: ['Search1'],
47
- type: 'bar',
48
- index: '人数',
49
- values: [86, 118, 664, 626, 169, 600, 570],
50
- itemStyle: {
51
- normal: {
52
- color: '#80E1D9'
53
- }
54
- }
55
- }, {
56
- names: ['Search3'],
57
- type: 'bar',
58
- index: '人数',
59
- values: [862, 1018, 964, 1026, 1679, 1600, 1570],
60
- itemStyle: {
61
- normal: {
62
- color: '#65789B'
63
- }
64
- }
65
- }, {
66
- names: ['Baidu'],
67
- type: 'bar',
68
- index: '人数',
69
- stack: 'Search Engine',
70
- itemStyle: {
71
- normal: {
72
- color: '#A0BEF6'
73
- }
74
- },
75
- values: [620, 732, 701, 734, 1090, 1130, 1120]
76
- }, {
77
- names: ['Google'],
78
- type: 'bar',
79
- index: '人数',
80
- stack: 'Search Engine',
81
- itemStyle: {
82
- normal: {
83
- color: '#92ADE0'
84
- }
85
- },
86
- values: [120, 132, 101, 134, 290, 230, 220]
87
- }, {
88
- names: ['Bing'],
89
- index: '人数',
90
- type: 'bar',
91
- stack: 'Search Engine',
92
- itemStyle: {
93
- normal: {
94
- color: '#869FCD'
95
- }
96
- },
97
- values: [60, 72, 71, 74, 190, 130, 110]
98
- }, {
99
- names: ['Others'],
100
- type: 'bar',
101
- index: '人数',
102
- stack: 'Search Engine',
103
- itemStyle: {
104
- normal: {
105
- color: '#7990BB'
106
- }
107
- },
108
- values: [62, 82, 91, 84, 109, 110, 120]
109
- }, {
110
- names: ['Search2'],
111
- type: 'bar',
112
- index: '人数',
113
- values: [86, 118, 664, 626, 169, 600, 570],
114
- itemStyle: {
115
- normal: {
116
- color: '#F8BC3B'
117
- }
118
- }
119
- }, {
120
- duration: [],
121
- type: 'line',
122
- index: '额度',
123
- names: ['lineChartFirstNv'],
124
- values: [1280, 2560, 5120, 10240, 20480, 40960, 81920]
125
- }, {
126
- duration: [],
127
- type: 'line',
128
- index: '额度',
129
- names: ['lineChartSecondNv'],
130
- values: [10, 20, 30, 40, 50, 60, 70]
131
- }],
132
- xAxis: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
133
- };
134
- export var barData = {
135
- xAxis: ['2022-08-23|2022-08-30'],
136
- series: [{
137
- names: ['北京市', '所有用户', '查看商品'],
138
- values: [1560]
139
- }, {
140
- names: ['北京市', '最近7天活跃用户', '查看商品'],
141
- values: [1560]
142
- }]
143
- };
@@ -1,33 +0,0 @@
1
- declare const _default: {
2
- series: ({
3
- type: string;
4
- names: string[];
5
- stack: string;
6
- values: number[];
7
- duration?: undefined;
8
- index?: undefined;
9
- } | {
10
- duration: never[];
11
- type: string;
12
- index: string;
13
- names: string[];
14
- stack: string;
15
- values: number[];
16
- } | {
17
- duration: never[];
18
- type: string;
19
- index: string;
20
- names: string[];
21
- values: number[];
22
- stack?: undefined;
23
- })[];
24
- xAxis: string[];
25
- };
26
- export default _default;
27
- export declare const barData: {
28
- xAxis: string[];
29
- series: {
30
- names: string[];
31
- values: number[];
32
- }[];
33
- };
@@ -1,64 +0,0 @@
1
- export default {
2
- series: [{
3
- type: 'bar',
4
- names: ['histogramFirstUv'],
5
- stack: 'uv',
6
- values: [0, 0, 1, 0, 0, 10, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
7
- }, {
8
- duration: [],
9
- type: 'bar',
10
- index: '人数',
11
- names: ['histogramSecondUv'],
12
- stack: 'uv',
13
- values: [0, 0, 0, 0, 0, 0, 10, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
14
- }, {
15
- duration: [],
16
- type: 'bar',
17
- index: '人数',
18
- stack: 'uv',
19
- names: ['lineChartFirstUv'],
20
- values: [0, 0, 0, 0, 0, 0, 0, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
21
- }, {
22
- duration: [],
23
- type: 'bar',
24
- index: '人数',
25
- stack: 'uv',
26
- names: ['lineChartSecondUv'],
27
- values: [0, 0, 0, 0, 0, 0, 0, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
28
- }, {
29
- duration: [],
30
- type: 'line',
31
- index: '额度',
32
- names: ['histogramFirstNv'],
33
- values: [0, 0, 1, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
34
- }, {
35
- duration: [],
36
- type: 'line',
37
- index: '额度',
38
- names: ['histogramSecondNv'],
39
- values: [0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
40
- }, {
41
- duration: [],
42
- type: 'line',
43
- index: '额度',
44
- names: ['lineChartFirstNv'],
45
- values: [0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920]
46
- }, {
47
- duration: [],
48
- type: 'line',
49
- index: '额度',
50
- names: ['lineChartSecondNv'],
51
- values: [0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
52
- }],
53
- xAxis: ['2023-10-25 00:00:00', '2023-10-25 01:00:00', '2023-10-25 02:00:00', '2023-10-25 03:00:00', '2023-10-25 04:00:00', '2023-10-25 05:00:00', '2023-10-25 06:00:00', '2023-10-25 07:00:00', '2023-10-25 08:00:00', '2023-10-25 09:00:00', '2023-10-25 10:00:00', '2023-10-25 11:00:00', '2023-10-25 12:00:00', '2023-10-25 13:00:00', '2023-10-25 14:00:00', '2023-10-25 15:00:00', '2023-10-25 16:00:00', '2023-10-25 17:00:00', '2023-10-25 18:00:00', '2023-10-25 19:00:00', '2023-10-25 20:00:00', '2023-10-25 21:00:00', '2023-10-25 22:00:00', '2023-10-25 23:00:00']
54
- };
55
- export var barData = {
56
- xAxis: ['2022-08-23|2022-08-30'],
57
- series: [{
58
- names: ['北京市', '所有用户', '查看商品'],
59
- values: [1560]
60
- }, {
61
- names: ['北京市', '最近7天活跃用户', '查看商品'],
62
- values: [1560]
63
- }]
64
- };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const _default: () => React.JSX.Element;
3
- export default _default;
@@ -1,206 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
- 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."); }
13
- 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); }
14
- 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; }
15
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
16
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
- import React, { useEffect, useState } from 'react';
18
- import { BizChart } from '@zgfe/business-lib';
19
- import data from './data/data5';
20
- var color = ['#457DFF', '#80E1D9', '#65789B', '#F8BC3B', '#6F66ED', '#66AFED'];
21
- var colorKeyList = {
22
- '#457DFF': ['#5888F4', '#457DFF', '#3F72EA', '#3A69D8', '#3560C5', '#3057B3', '#2B4EA0', '#26458D', '#213C7B', '#1C3368'],
23
- '#80E1D9': ['#80E1D9', '#74CCC4', '#69B9B2', '#5FA6A0', '#54948F', '#4A817D', '#3F6F6B', '#355C59', '#2A4A47', '#1F3735'],
24
- '#65789B': ['#A0BEF6', '#92ADE0', '#869FCD', '#7990BB', '#65789B', '#586887', '#4B5A74', '#3F4B62', '#333D4F', '#272F3D'],
25
- '#F8BC3B': ['#F8BC3B', '#E2AC36', '#D09E32', '#BD902D', '#AB8229', '#987425', '#866620', '#73571C', '#614917', '#4E3B13'],
26
- '#6F66ED': ['#6F66ED', '#655DD8', '#5D55C6', '#544DB3', '#4B45A1', '#433D8E', '#3A357C', '#312D69', '#282556', '#201D44'],
27
- '#66AFED': ['#66AFED', '#5D9FD8', '#5591C6', '#4D84B3', '#4576A1', '#3D688E', '#355B7C', '#2D4D69', '#253F56', '#1D3244']
28
- };
29
- export default (function () {
30
- var _useState = useState({}),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- legendObj = _useState2[0],
33
- setLegendObj = _useState2[1];
34
- var _useState3 = useState([]),
35
- _useState4 = _slicedToArray(_useState3, 2),
36
- showList = _useState4[0],
37
- setShowList = _useState4[1];
38
- var _useState5 = useState([]),
39
- _useState6 = _slicedToArray(_useState5, 2),
40
- colorList = _useState6[0],
41
- setColorList = _useState6[1];
42
- var _useState7 = useState({}),
43
- _useState8 = _slicedToArray(_useState7, 2),
44
- legendToType = _useState8[0],
45
- setLegendToType = _useState8[1];
46
- var _useState9 = useState({}),
47
- _useState10 = _slicedToArray(_useState9, 2),
48
- legendToColor = _useState10[0],
49
- setLegendToColor = _useState10[1];
50
- var _useState11 = useState([]),
51
- _useState12 = _slicedToArray(_useState11, 2),
52
- selectLegendArr = _useState12[0],
53
- setSelectLegendArr = _useState12[1];
54
- useEffect(function () {
55
- setSelectLegendArr(Object.keys(legendObj).filter(function (item) {
56
- return !legendObj[item].isHide;
57
- }));
58
- }, [legendObj]);
59
- useEffect(function () {
60
- var dealShowList = [];
61
- var dealShowColorList = [];
62
- selectLegendArr.map(function (item) {
63
- dealShowList = [].concat(_toConsumableArray(dealShowList), _toConsumableArray(legendToType[item]));
64
- dealShowColorList = [].concat(_toConsumableArray(dealShowColorList), _toConsumableArray(legendToColor[item]));
65
- });
66
- setShowList(dealShowList);
67
- setColorList(dealShowColorList);
68
- }, [selectLegendArr]);
69
- useEffect(function () {
70
- var colors = [];
71
- var legendToTypeObj = {};
72
- var legendToColorObj = {};
73
- var colorIndex = 0;
74
- var colorKeyIndex = {};
75
- data.series.map(function (item) {
76
- if (item.stack) {
77
- if (colorKeyIndex[item.stack]) {
78
- colorKeyIndex[item.stack].index += 1;
79
- colors.push(colorKeyList[colorKeyIndex[item.stack].key][colorKeyIndex[item.stack].index]);
80
- legendToTypeObj[item.stack].push(item.names[0]);
81
- legendToColorObj[item.stack].push(colorKeyList[colorKeyIndex[item.stack].key][colorKeyIndex[item.stack].index]);
82
- } else {
83
- colorKeyIndex[item.stack] = {
84
- key: color[colorIndex],
85
- index: 0
86
- };
87
- colors.push(colorKeyList[colorKeyIndex[item.stack].key][colorKeyIndex[item.stack].index]);
88
- legendToTypeObj[item.stack] = [item.names[0]];
89
- legendToColorObj[item.stack] = [colorKeyList[colorKeyIndex[item.stack].key][colorKeyIndex[item.stack].index]];
90
- colorIndex++;
91
- }
92
- } else {
93
- legendToTypeObj[item.names[0]] = [item.names[0]];
94
- legendToColorObj[item.names[0]] = [color[colorIndex]];
95
- colorKeyIndex[item.names[0]] = {
96
- key: color[colorIndex],
97
- index: 0
98
- };
99
- colors.push(color[colorIndex]);
100
- colorIndex++;
101
- }
102
- });
103
- setLegendToType(legendToTypeObj);
104
- setLegendToColor(legendToColorObj);
105
- setLegendObj(colorKeyIndex);
106
- setColorList(colors);
107
- }, []);
108
- var dealStack = function dealStack(v) {
109
- var totalData = {};
110
- var isHasTotalDate = {};
111
- v.map(function (item) {
112
- if (item.stack) {
113
- isHasTotalDate[item.names[0]] = item.stack;
114
- var dealData = item.values;
115
- if (totalData[item.stack]) {
116
- dealData = dealData.map(function (value, index) {
117
- return value + totalData[item.stack][index];
118
- });
119
- }
120
- totalData[item.stack] = dealData;
121
- }
122
- });
123
- return {
124
- isHasTotalDateKey: isHasTotalDate,
125
- totalDateValue: totalData
126
- };
127
- };
128
- var tooltipFormatter = function tooltipFormatter(params) {
129
- var totalData = dealStack(data.series);
130
- console.log('params', params, totalData);
131
- var xDate = params.name;
132
- var xLabel = xDate;
133
- var lengthReg = new RegExp('\\S{1,' + 20 + '}', 'g');
134
- if (/^\d{4}-\d{2}-\d{2}$/.test(xLabel)) {
135
- xLabel = xLabel.replace(/\d{4}-/, '');
136
- } else if (/^\d{4}-\d{2}-\d{2}\|\d{4}-\d{2}-\d{2}$/.test(xLabel)) {
137
- var dates = xLabel.match(/\d{4}-\d{2}-\d{2}/g);
138
- xLabel = dates[0].replace(/\d{4}-/, '') + '~' + dates[1].replace(/\d{4}-/, '');
139
- } else {
140
- xLabel = (xLabel.match(lengthReg) || []).join('<br/>');
141
- }
142
- var htmlArray = [];
143
- htmlArray.push("<div class=\"biz-chart-tooltip-title\">".concat(xLabel, "</div>"));
144
- if (totalData.isHasTotalDateKey[params.seriesName]) {
145
- 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(totalData.isHasTotalDateKey[params.seriesName], "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(totalData.totalDateValue[totalData.isHasTotalDateKey[params.seriesName]][params.dataIndex], "</span>\n </div>"));
146
- }
147
- 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>"));
148
- return htmlArray.join('');
149
- };
150
- console.log('colorList', colorList);
151
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizChart, {
152
- showList: showList,
153
- data: data,
154
- type: "line_bar",
155
- showAll: false,
156
- legendPosition: "bottom",
157
- tooltipFormatter: tooltipFormatter,
158
- colors: colorList,
159
- isHideLegend: true
160
- }), /*#__PURE__*/React.createElement("div", {
161
- style: {
162
- position: 'relative',
163
- marginTop: -30,
164
- display: 'flex',
165
- flexDirection: 'row',
166
- justifyContent: 'center',
167
- alignItems: 'center',
168
- flexWrap: 'nowrap',
169
- gap: 20,
170
- height: '100%'
171
- }
172
- }, Object.keys(legendObj).map(function (item) {
173
- return /*#__PURE__*/React.createElement("div", {
174
- style: {
175
- display: 'flex',
176
- justifyContent: 'center',
177
- alignItems: 'center',
178
- height: 20,
179
- maxWidth: '12%',
180
- cursor: 'pointer'
181
- },
182
- onClick: function onClick() {
183
- (selectLegendArr.length > 1 || legendObj[item].isHide) && setLegendObj(_objectSpread(_objectSpread({}, legendObj), {}, _defineProperty({}, item, _objectSpread(_objectSpread({}, legendObj[item]), {}, {
184
- isHide: !legendObj[item].isHide
185
- }))));
186
- }
187
- }, /*#__PURE__*/React.createElement("div", {
188
- style: {
189
- marginRight: 5,
190
- borderRadius: '50%',
191
- width: 10,
192
- height: 10,
193
- backgroundColor: legendObj[item].isHide ? '#D9D9D9' : legendObj[item].key
194
- }
195
- }), /*#__PURE__*/React.createElement("div", {
196
- style: {
197
- width: 'calc(100% - 15px)',
198
- color: legendObj[item].isHide ? '#D9D9D9' : '#67727F',
199
- fontSize: 12,
200
- whiteSpace: 'nowrap',
201
- overflow: 'hidden',
202
- textOverflow: 'ellipsis'
203
- }
204
- }, item));
205
- })));
206
- });