@zgfe/business-lib 1.1.67-beta.7 → 1.1.67-beta.8

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.
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- x_axis: string[];
2
+ xAxis: string[];
3
3
  series: {
4
4
  names: string[];
5
5
  values: number[];
@@ -7,7 +7,7 @@ declare const _default: {
7
7
  };
8
8
  export default _default;
9
9
  export declare const barData: {
10
- x_axis: string[];
10
+ xAxis: string[];
11
11
  series: {
12
12
  names: string[];
13
13
  values: number[];
@@ -1,5 +1,5 @@
1
1
  export default {
2
- x_axis: ['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', '2022-04-12', '2022-04-13'],
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', '2022-04-12', '2022-04-13'],
3
3
  series: [{
4
4
  names: ['付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
5
5
  values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
@@ -27,7 +27,7 @@ export default {
27
27
  }]
28
28
  };
29
29
  export var barData = {
30
- x_axis: ['2022-08-23|2022-08-30'],
30
+ xAxis: ['2022-08-23|2022-08-30'],
31
31
  series: [{
32
32
  names: ['北京市', '所有用户', '查看商品'],
33
33
  values: [1560]
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- x_axis: string[];
2
+ xAxis: string[];
3
3
  series: {
4
4
  names: string[];
5
5
  values: number[];
@@ -1,5 +1,5 @@
1
1
  export default {
2
- x_axis: ['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', '2022-04-12', '2022-04-13'],
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', '2022-04-12', '2022-04-13'],
3
3
  series: [{
4
4
  names: ['付款成功'],
5
5
  values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- x_axis: string[];
2
+ xAxis: string[];
3
3
  series: {
4
4
  names: string[];
5
5
  values: number[];
@@ -1,5 +1,5 @@
1
1
  export default {
2
- x_axis: ['2022-08-25|2022-09-01'],
2
+ xAxis: ['2022-08-25|2022-09-01'],
3
3
  series: [{
4
4
  names: ['北京市', '所有用户', '加购商品'],
5
5
  values: [1370]
@@ -3,6 +3,7 @@ export interface ChartItmProps {
3
3
  names: Array<string>;
4
4
  values: Array<number>;
5
5
  userGroupCompareData?: object;
6
+ [key: string]: any;
6
7
  }
7
8
  export interface ItemDataProps {
8
9
  data: Array<object>;
@@ -19,7 +20,8 @@ export interface ProvinceMapDataProps {
19
20
  }
20
21
  export declare namespace ChartTypes {
21
22
  interface Value {
22
- x_axis: Array<string>;
23
+ xAxis: Array<string>;
24
+ x_axis?: Array<string>;
23
25
  series: Array<ChartItmProps>;
24
26
  }
25
27
  interface Props {
@@ -127,8 +127,8 @@ export var getChartOption = function getChartOption(chartType, data) {
127
127
  legend = _objectSpread({}, legendConfig),
128
128
  grid = _objectSpread({}, gridConfig),
129
129
  seriesItem = _objectSpread({}, seriesConfig);
130
- if (data.x_axis) {
131
- xAxis.data = data.x_axis;
130
+ if (data.xAxis) {
131
+ xAxis.data = data.xAxis;
132
132
  }
133
133
  xAxis.boundaryGap = chartType === 'bar';
134
134
  xAxis.axisLabel = xAxis.axisLabel || {
@@ -7,6 +7,6 @@ export declare const formatPieData: (data: ChartTypes.Value, showAll?: boolean,
7
7
  };
8
8
  }[];
9
9
  export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>, reverseXAxis?: boolean, color?: string[]) => {
10
- x_axis: string[];
10
+ xAxis: string[];
11
11
  series: any;
12
12
  };
@@ -30,16 +30,17 @@ export var formatPieData = function formatPieData(data, showAll, showList, showO
30
30
  };
31
31
  export var formatChartData = function formatChartData(data, showAll, showList, reverseXAxis, color) {
32
32
  var showMap = getShowMap(showList);
33
- var x_axis = reverseXAxis && data.series.length ? [] : data.x_axis;
33
+ var xAxisData = data.xAxis || data.x_axis;
34
+ var xAxis = reverseXAxis && data.series.length ? [] : xAxisData;
34
35
  var sData = [];
35
36
  var colorData = color || chartColors;
36
37
  data.series.forEach(function (seriesItem) {
37
38
  var name = seriesItem.names.join(',');
38
39
  if (showAll || showList && showMap[name] || !showList && sData.length < 10) {
39
40
  if (reverseXAxis) {
40
- x_axis.push(name);
41
+ xAxis.push(name);
41
42
  sData.push({
42
- name: data.x_axis[0],
43
+ name: xAxisData[0],
43
44
  value: seriesItem.values[0],
44
45
  label: name,
45
46
  itemStyle: {
@@ -57,7 +58,7 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
57
58
  }
58
59
  });
59
60
  return {
60
- x_axis: x_axis,
61
+ xAxis: xAxis,
61
62
  series: sData
62
63
  };
63
64
  };
@@ -31,7 +31,7 @@ var citySeries = function citySeries(data) {
31
31
  };
32
32
  var provinceMapData = {};
33
33
  var mapStore = formatMapData(data, 'city');
34
- mapStore.x_axis.forEach(function (xItem) {
34
+ (mapStore.xAxis || mapStore.x_axis).forEach(function (xItem) {
35
35
  scatterSeries.name = xItem;
36
36
  mapStore.series.forEach(function (cityItem) {
37
37
  var cityName = cityItem.name;
@@ -68,7 +68,7 @@ var citySeries = function citySeries(data) {
68
68
  var provinceSeries = function provinceSeries(data) {
69
69
  var series = [];
70
70
  var mapStore = formatMapData(data, 'province');
71
- mapStore.x_axis.forEach(function (xItem) {
71
+ (mapStore.xAxis || mapStore.x_axis).forEach(function (xItem) {
72
72
  var item = {
73
73
  name: xItem,
74
74
  type: 'map',
@@ -115,7 +115,7 @@ var maxMinValue = function maxMinValue(series) {
115
115
  };
116
116
  var formatMapData = function formatMapData(seriesData, type) {
117
117
  var store = {
118
- x_axis: seriesData.x_axis,
118
+ xAxis: seriesData.xAxis || seriesData.x_axis,
119
119
  series: []
120
120
  };
121
121
  var areaObjMap = {};
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- x_axis: string[];
2
+ xAxis: string[];
3
3
  series: {
4
4
  names: string[];
5
5
  values: number[];
@@ -9,7 +9,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
9
9
  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; }
10
10
  import { util } from '../../..';
11
11
  export default {
12
- x_axis: ['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', '2022-04-12', '2022-04-13'],
12
+ 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', '2022-04-12', '2022-04-13'],
13
13
  series: [{
14
14
  names: ['付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
15
15
  values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
@@ -19,7 +19,7 @@ export default (function () {
19
19
  setTableData = _useState4[1];
20
20
  var formRef = useRef(null);
21
21
  useEffect(function () {
22
- setColumn(getColumn(chartData.x_axis));
22
+ setColumn(getColumn(chartData.xAxis));
23
23
  setTableData(formateTableData(chartData.series));
24
24
  }, []);
25
25
  var onFinish = function onFinish(values) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.67-beta.7",
3
+ "version": "1.1.67-beta.8",
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": "36374f4bd6e15476920739f872d7d8bca8107d62"
63
+ "gitHead": "69f43c91e600c8c965e1f83da23b9e3d96e4b490"
64
64
  }