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

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) {
@@ -54,12 +54,18 @@ export default (function () {
54
54
  envPropList: envData
55
55
  });
56
56
  var onValuesChange = function onValuesChange() {
57
- setTarget(arguments.length <= 1 ? undefined : arguments[1]);
57
+ for (var _len = arguments.length, res = new Array(_len), _key = 0; _key < _len; _key++) {
58
+ res[_key] = arguments[_key];
59
+ }
60
+ setTarget({
61
+ targets: res[1].targets.filter(function (item) {
62
+ return !!item;
63
+ })
64
+ });
58
65
  };
59
66
  useEffect(function () {
60
67
  var flag = true,
61
68
  show = true;
62
- console.log(target.targets, target.targets.length > 1);
63
69
  if ((target === null || target === void 0 ? void 0 : target.targets) && target.targets.length > 0) {
64
70
  if (target.targets[0] && target.targets[0].eventId === -100) {
65
71
  flag = false;
@@ -21,7 +21,7 @@ import { BuiltinIndicators } from '../constants/common';
21
21
  import { BizAttrConditionGroup, IconFont } from '..';
22
22
  export var classPrefix = 'biz-target';
23
23
  var BizTargetCondition = function BizTargetCondition(props) {
24
- var _targetData$value2, _targetData$value2$gr, _targetData$value3, _targetData$value3$ev, _targetData$value4, _targetData$value4$ev, _targetData$value5, _targetData$value5$ev, _targetData$value6, _targetData$value6$ev, _targetData$value7, _targetData$value7$ev;
24
+ var _targetData$value3, _targetData$value3$gr, _targetData$value4, _targetData$value4$ev, _targetData$value5, _targetData$value5$ev, _targetData$value6, _targetData$value6$ev, _targetData$value7, _targetData$value8, _targetData$value8$ev, _targetData$value9, _targetData$value9$ev;
25
25
  var max = props.max;
26
26
  var _useState = useState(),
27
27
  _useState2 = _slicedToArray(_useState, 2),
@@ -221,7 +221,9 @@ var BizTargetCondition = function BizTargetCondition(props) {
221
221
  }, 0);
222
222
  };
223
223
  var onDelete = function onDelete() {
224
- if (!(props.enableDelete !== undefined ? props.enableDelete : enableDelete)) return;
224
+ var _targetData$value2;
225
+ var canDelete = props.enableDelete !== undefined ? props.enableDelete || !(targetData === null || targetData === void 0 ? void 0 : (_targetData$value2 = targetData.value) === null || _targetData$value2 === void 0 ? void 0 : _targetData$value2.event) : enableDelete;
226
+ if (!canDelete) return;
225
227
  if (props.onDelete) props.onDelete();
226
228
  };
227
229
  return /*#__PURE__*/React.createElement("div", {
@@ -237,8 +239,8 @@ var BizTargetCondition = function BizTargetCondition(props) {
237
239
  }, /*#__PURE__*/React.createElement(BizTargetSelector, {
238
240
  value: targetData,
239
241
  onChange: onChangeTarget
240
- }, props.children), (targetData === null || targetData === void 0 ? void 0 : (_targetData$value2 = targetData.value) === null || _targetData$value2 === void 0 ? void 0 : (_targetData$value2$gr = _targetData$value2.group) === null || _targetData$value2$gr === void 0 ? void 0 : _targetData$value2$gr.id) === -2 || (targetData === null || targetData === void 0 ? void 0 : (_targetData$value3 = targetData.value) === null || _targetData$value3 === void 0 ? void 0 : (_targetData$value3$ev = _targetData$value3.event) === null || _targetData$value3$ev === void 0 ? void 0 : _targetData$value3$ev.isBuiltIn) ? null : /*#__PURE__*/React.createElement(BizTargetDimension, {
241
- eventId: (targetData === null || targetData === void 0 ? void 0 : (_targetData$value4 = targetData.value) === null || _targetData$value4 === void 0 ? void 0 : (_targetData$value4$ev = _targetData$value4.event) === null || _targetData$value4$ev === void 0 ? void 0 : _targetData$value4$ev.id) ? targetData === null || targetData === void 0 ? void 0 : (_targetData$value5 = targetData.value) === null || _targetData$value5 === void 0 ? void 0 : (_targetData$value5$ev = _targetData$value5.event) === null || _targetData$value5$ev === void 0 ? void 0 : _targetData$value5$ev.id : undefined,
242
+ }, props.children), (targetData === null || targetData === void 0 ? void 0 : (_targetData$value3 = targetData.value) === null || _targetData$value3 === void 0 ? void 0 : (_targetData$value3$gr = _targetData$value3.group) === null || _targetData$value3$gr === void 0 ? void 0 : _targetData$value3$gr.id) === -2 || (targetData === null || targetData === void 0 ? void 0 : (_targetData$value4 = targetData.value) === null || _targetData$value4 === void 0 ? void 0 : (_targetData$value4$ev = _targetData$value4.event) === null || _targetData$value4$ev === void 0 ? void 0 : _targetData$value4$ev.isBuiltIn) ? null : /*#__PURE__*/React.createElement(BizTargetDimension, {
243
+ eventId: (targetData === null || targetData === void 0 ? void 0 : (_targetData$value5 = targetData.value) === null || _targetData$value5 === void 0 ? void 0 : (_targetData$value5$ev = _targetData$value5.event) === null || _targetData$value5$ev === void 0 ? void 0 : _targetData$value5$ev.id) ? targetData === null || targetData === void 0 ? void 0 : (_targetData$value6 = targetData.value) === null || _targetData$value6 === void 0 ? void 0 : (_targetData$value6$ev = _targetData$value6.event) === null || _targetData$value6$ev === void 0 ? void 0 : _targetData$value6$ev.id : undefined,
242
244
  value: dimension,
243
245
  onChange: onChangeDimension
244
246
  }), /*#__PURE__*/React.createElement(Tooltip, {
@@ -248,7 +250,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
248
250
  type: "shaixuan",
249
251
  onClick: onAdd
250
252
  })), /*#__PURE__*/React.createElement(IconFont, {
251
- className: "".concat(classPrefix, "-icon delete ").concat(!(props.enableDelete !== undefined ? props.enableDelete : enableDelete) ? 'disabled' : ''),
253
+ className: "".concat(classPrefix, "-icon delete ").concat(!(props.enableDelete !== undefined ? props.enableDelete || !(targetData === null || targetData === void 0 ? void 0 : (_targetData$value7 = targetData.value) === null || _targetData$value7 === void 0 ? void 0 : _targetData$value7.event) : enableDelete) ? 'disabled' : ''),
252
254
  type: "qingchu",
253
255
  onClick: onDelete
254
256
  })), (filters || isAdd) && /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
@@ -257,7 +259,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
257
259
  onlyAnd: props.onlyAnd,
258
260
  enableEventProp: true,
259
261
  enableDelete: true,
260
- eventIdList: (targetData === null || targetData === void 0 ? void 0 : (_targetData$value6 = targetData.value) === null || _targetData$value6 === void 0 ? void 0 : (_targetData$value6$ev = _targetData$value6.event) === null || _targetData$value6$ev === void 0 ? void 0 : _targetData$value6$ev.id) ? [targetData === null || targetData === void 0 ? void 0 : (_targetData$value7 = targetData.value) === null || _targetData$value7 === void 0 ? void 0 : (_targetData$value7$ev = _targetData$value7.event) === null || _targetData$value7$ev === void 0 ? void 0 : _targetData$value7$ev.id] : undefined,
262
+ eventIdList: (targetData === null || targetData === void 0 ? void 0 : (_targetData$value8 = targetData.value) === null || _targetData$value8 === void 0 ? void 0 : (_targetData$value8$ev = _targetData$value8.event) === null || _targetData$value8$ev === void 0 ? void 0 : _targetData$value8$ev.id) ? [targetData === null || targetData === void 0 ? void 0 : (_targetData$value9 = targetData.value) === null || _targetData$value9 === void 0 ? void 0 : (_targetData$value9$ev = _targetData$value9.event) === null || _targetData$value9$ev === void 0 ? void 0 : _targetData$value9$ev.id] : undefined,
261
263
  onChange: onChangeFilters,
262
264
  onConditionsCount: setCount
263
265
  })));
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.9",
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
  }