@zgfe/business-lib 1.0.0-beta.3 → 1.0.0-beta.6

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.
Files changed (72) hide show
  1. package/es/analysisLayout/index.d.ts +28 -0
  2. package/es/analysisLayout/index.js +6 -2
  3. package/es/analysisLayout/index.less +10 -3
  4. package/es/attributeSelector/index.d.ts +4 -2
  5. package/es/attributeSelector/index.js +30 -15
  6. package/es/chart/demo/bar.js +2 -2
  7. package/es/chart/demo/data/data2.d.ts +8 -0
  8. package/es/chart/demo/data/data2.js +7 -0
  9. package/es/chart/demo/data/data3.d.ts +10 -0
  10. package/es/chart/demo/data/data3.js +584 -0
  11. package/es/chart/demo/map.d.ts +2 -0
  12. package/es/chart/demo/map.js +11 -0
  13. package/es/chart/index.d.ts +29 -9
  14. package/es/chart/index.js +30 -71
  15. package/es/chart/type.d.ts +22 -0
  16. package/es/chart/type.js +1 -0
  17. package/es/chart/{chartConfig.d.ts → util/chartConfig.d.ts} +68 -3
  18. package/es/chart/{chartConfig.js → util/chartConfig.js} +85 -11
  19. package/es/chart/{color.d.ts → util/color.d.ts} +0 -0
  20. package/es/chart/{color.js → util/color.js} +0 -0
  21. package/es/chart/util/data/china.js +530 -0
  22. package/es/chart/util/data/cityGeoCoord.d.ts +22553 -0
  23. package/es/chart/util/data/cityGeoCoord.js +22552 -0
  24. package/es/chart/util/data/provinceGeoCoord.d.ts +343 -0
  25. package/es/chart/util/data/provinceGeoCoord.js +9258 -0
  26. package/es/chart/util/formatData.d.ts +13 -0
  27. package/es/chart/util/formatData.js +56 -0
  28. package/es/chart/util/{format.d.ts → formatOption.d.ts} +2 -1
  29. package/es/chart/util/{format.js → formatOption.js} +31 -1
  30. package/es/chart/util/mapUtil.d.ts +8 -0
  31. package/es/chart/util/mapUtil.js +195 -0
  32. package/es/commonStyle/icon.less +19 -3
  33. package/es/commonStyle/theme.less +5 -2
  34. package/es/dialog/components/selectToInput.d.ts +10 -3
  35. package/es/dialog/components/selectToInput.js +75 -12
  36. package/es/dialog/demo/index.js +27 -20
  37. package/es/dialog/index.d.ts +34 -2
  38. package/es/dialog/index.js +129 -55
  39. package/es/dialog/style/index.less +11 -1
  40. package/es/eventSelector/index.d.ts +5 -0
  41. package/es/eventSelector/index.js +111 -32
  42. package/es/globalAttributes/index.d.ts +3 -2
  43. package/es/globalAttributes/index.js +18 -23
  44. package/es/index.d.ts +2 -1
  45. package/es/index.js +2 -1
  46. package/es/multipleSelector/index.js +32 -4
  47. package/es/select/demo/index.js +2 -1
  48. package/es/select/index.d.ts +9 -1
  49. package/es/select/index.js +4 -2
  50. package/es/table/demo/index2.js +45 -3
  51. package/es/table/demo/index3.d.ts +2 -0
  52. package/es/table/demo/index3.js +227 -0
  53. package/es/table/index.d.ts +1 -1
  54. package/es/targetConditionGroup/components/conditionGroup.d.ts +4 -4
  55. package/es/targetConditionGroup/components/conditionGroup.js +27 -26
  56. package/es/targetConditionGroup/components/conditionItem.d.ts +4 -4
  57. package/es/targetConditionGroup/components/conditionItem.js +81 -108
  58. package/es/targetConditionGroup/data/operates.js +5 -5
  59. package/es/targetConditionGroup/demo/group.d.ts +2 -0
  60. package/es/targetConditionGroup/demo/group.js +42 -0
  61. package/es/targetConditionGroup/demo/index.js +15 -25
  62. package/es/targetConditionGroup/group.d.ts +56 -0
  63. package/es/targetConditionGroup/group.js +204 -0
  64. package/es/targetConditionGroup/index.d.ts +6 -0
  65. package/es/targetConditionGroup/index.js +148 -83
  66. package/es/targetConditionGroup/index.less +12 -0
  67. package/es/targetConditionGroup/type.d.ts +47 -2
  68. package/es/targetSelector/demo/form.js +1 -1
  69. package/es/targetSelector/demo/index.js +1 -1
  70. package/es/targetSelector/index.d.ts +17 -1
  71. package/es/targetSelector/index.js +56 -10
  72. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './style/index.less';
3
- import { AttrItemType } from '../type';
3
+ import { AttrItem } from '../type';
4
4
  import { EventMetaProps } from '../../utils/type';
5
5
  interface ConditionItemProps {
6
6
  /**
@@ -8,7 +8,7 @@ interface ConditionItemProps {
8
8
  * @description.zh-CN
9
9
  * @default -
10
10
  */
11
- defaultValue?: AttrItemType;
11
+ defaultValue?: AttrItem;
12
12
  /**
13
13
  * @description 属性的配置项
14
14
  * @description.zh-CN
@@ -19,7 +19,7 @@ interface ConditionItemProps {
19
19
  * @description 如果是事件属性,则传事件id,多个用逗号隔开
20
20
  * @default -
21
21
  */
22
- eventIds?: string | number;
22
+ eventId?: string | number;
23
23
  /**
24
24
  * @description 软件id
25
25
  * @default -
@@ -35,7 +35,7 @@ interface ConditionItemProps {
35
35
  * @description.zh-CN
36
36
  * @default
37
37
  */
38
- onChange?: (data: object) => void;
38
+ onChange?: (data: AttrItem) => void;
39
39
  /**
40
40
  * @description 删除属性
41
41
  * @description.zh-CN
@@ -1,7 +1,13 @@
1
- var _excluded = ["defaultValue", "eventIds", "appId", "platform", "options", "onChange", "onDelete"];
1
+ var _excluded = ["defaultValue", "eventId", "appId", "platform", "options", "onChange", "onDelete"];
2
2
 
3
3
  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); }
4
4
 
5
+ 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; }
6
+
7
+ 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; }
8
+
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+
5
11
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
12
 
7
13
  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."); }
@@ -10,14 +16,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
10
16
 
11
17
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
18
 
13
- 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; }
14
-
15
- 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; }
16
-
17
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
-
19
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
20
-
21
19
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
22
20
 
23
21
  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."); }
@@ -40,16 +38,16 @@ import { stringOperate } from '../data/operates';
40
38
  import './style/index.less';
41
39
  import { BizAttributeSelector, BizGlobalDataContext, BizMultipleSelector } from '../..';
42
40
  import IconFont from '../../components/iconFont';
43
- import { ajax, util } from '../../utils';
41
+ import { ajax } from '../../utils';
44
42
 
45
43
  var BizConditionItem = function BizConditionItem(props) {
46
44
  var _props$defaultValue = props.defaultValue,
47
45
  defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
48
- eventIds = props.eventIds,
46
+ eventId = props.eventId,
49
47
  appId = props.appId,
50
48
  platform = props.platform,
51
49
  options = props.options,
52
- _onChange = props.onChange,
50
+ onChange = props.onChange,
53
51
  onDelete = props.onDelete,
54
52
  res = _objectWithoutProperties(props, _excluded); // 筛选值下拉框内容
55
53
 
@@ -66,13 +64,13 @@ var BizConditionItem = function BizConditionItem(props) {
66
64
  setAttr = _useState4[1]; // 属性值
67
65
 
68
66
 
69
- var _useState5 = useState(defaultValue.params || []),
67
+ var _useState5 = useState([]),
70
68
  _useState6 = _slicedToArray(_useState5, 2),
71
69
  condition = _useState6[0],
72
70
  setCondition = _useState6[1]; // 条件式
73
71
 
74
72
 
75
- var _useState7 = useState(defaultValue.operator || stringOperate[0].value),
73
+ var _useState7 = useState(stringOperate[0].value),
76
74
  _useState8 = _slicedToArray(_useState7, 2),
77
75
  operator = _useState8[0],
78
76
  setOperator = _useState8[1]; // 软件信息
@@ -86,76 +84,35 @@ var BizConditionItem = function BizConditionItem(props) {
86
84
 
87
85
 
88
86
  useEffect(function () {
89
- var attrOption = options || {
90
- event: eventMeta,
91
- user: userProps,
92
- env: eventEnv
93
- };
94
- var eventOption = [];
95
- var eventData = attrOption.event || []; // 取event中的attr列表
96
-
97
- var _iterator = _createForOfIteratorHelper(eventData),
98
- _step;
99
-
100
- try {
101
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
102
- var data = _step.value;
103
- var eList = (data === null || data === void 0 ? void 0 : data.eventList) || [];
104
-
105
- var _iterator2 = _createForOfIteratorHelper(eList),
106
- _step2;
107
-
108
- try {
109
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
110
- var _event = _step2.value;
111
-
112
- if (_event.event_id == eventIds) {
113
- eventOption = eventOption.concat(_event.event_attrs);
114
- break;
115
- }
116
-
117
- if (!eventIds) {
118
- eventOption = eventOption.concat(_event.event_attrs);
119
- }
120
- }
121
- } catch (err) {
122
- _iterator2.e(err);
123
- } finally {
124
- _iterator2.f();
125
- }
126
- }
127
- } catch (err) {
128
- _iterator.e(err);
129
- } finally {
130
- _iterator.f();
87
+ if (defaultValue.attrId !== attr.id) {
88
+ var data = {
89
+ id: defaultValue.attrId,
90
+ value: defaultValue.attrName,
91
+ type: defaultValue.attrType,
92
+ attrType: defaultValue.type,
93
+ dimensionId: defaultValue.dimensionId,
94
+ dimension_sub: defaultValue.dimension_sub
95
+ };
96
+ setAttr(function () {
97
+ return data;
98
+ });
131
99
  }
132
100
 
133
- var event = eventOption.find(function (item) {
134
- return item.attr_id == defaultValue.attr_id;
135
- });
136
- var user = attrOption.user && attrOption.user.find(function (item) {
137
- return item.alias_name === defaultValue.attr_name || item.text === defaultValue.attr_name;
138
- });
139
- var env = attrOption.env && attrOption.env.find(function (item) {
140
- return item.text === defaultValue.attr_name;
141
- });
142
- var attrObj = event || user || env || {};
143
-
144
- if (attrObj.operator) {
145
- delete attrObj.operator;
101
+ if (JSON.stringify(defaultValue.values) !== JSON.stringify(condition)) {
102
+ setCondition(function () {
103
+ return defaultValue.values || [];
104
+ });
146
105
  }
147
106
 
148
- if (attrObj.params) {
149
- delete attrObj.params;
107
+ if (operator !== defaultValue.operation) {
108
+ setOperator(function () {
109
+ return defaultValue.operation || stringOperate[0].value;
110
+ });
150
111
  }
151
-
152
- if (util.equal(attr, attrObj)) return;
153
- setAttr(function () {
154
- return _objectSpread({}, attrObj);
155
- });
156
112
  }, [defaultValue]); // 属性更改回调
157
113
 
158
114
  useEffect(function () {
115
+ if (!attr.id) return;
159
116
  var requestData = {
160
117
  app_id: (appInfo === null || appInfo === void 0 ? void 0 : appInfo.appId) || appId,
161
118
  platform: (appInfo === null || appInfo === void 0 ? void 0 : appInfo.platform) || platform,
@@ -176,37 +133,63 @@ var BizConditionItem = function BizConditionItem(props) {
176
133
  setConditionOptions(function () {
177
134
  return [];
178
135
  });
179
- }); // 清空条件值
180
-
181
- setCondition(function () {
182
- return [];
183
136
  });
184
137
  }, [attr]);
138
+
139
+ var _onChange = function _onChange(data, operation, values) {
140
+ var result = {
141
+ attrType: data.type,
142
+ type: data.attrType,
143
+ attrId: data.id,
144
+ attrName: data.value,
145
+ dimensionId: data.dimensionId,
146
+ dimension_sub: data.dimension_sub,
147
+ operation: operation,
148
+ values: values
149
+ };
150
+ onChange && onChange(result);
151
+ };
152
+
185
153
  return /*#__PURE__*/React.createElement(BizAttributeSelector, _objectSpread(_objectSpread({}, res), {}, {
186
154
  defaultValue: attr,
187
- eventIds: String(eventIds),
155
+ eventIds: String(eventId),
188
156
  options: options,
189
- onChange: function onChange(attr, attr2) {
157
+ onChange: function onChange(attr1, attr2) {
190
158
  var data = {};
191
159
 
192
- if (_typeof(attr) === 'object') {
193
- data = _objectSpread({}, attr);
160
+ if (_typeof(attr1) === 'object') {
161
+ data = _objectSpread({}, attr1);
194
162
  }
195
163
 
196
164
  if (_typeof(attr2) === 'object') {
197
165
  data = _objectSpread({}, attr2);
198
166
  }
199
167
 
200
- setAttr(function () {
201
- return _objectSpread({}, data);
202
- });
203
-
204
- var data2 = _objectSpread(_objectSpread({}, data), {}, {
205
- operator: operator,
206
- params: _toConsumableArray(condition)
207
- });
208
-
209
- _onChange && _onChange(data2);
168
+ var _data = data,
169
+ id = _data.id,
170
+ value = _data.value,
171
+ type = _data.type,
172
+ attrType = _data.attrType,
173
+ dimension_sub = _data.dimension_sub,
174
+ dimensionId = _data.dimensionId;
175
+ var result = {
176
+ id: id,
177
+ value: value,
178
+ type: type,
179
+ attrType: attrType,
180
+ dimension_sub: dimension_sub,
181
+ dimensionId: dimensionId
182
+ };
183
+
184
+ if (dimensionId && dimensionId !== attr.id) {
185
+ // 清空条件值
186
+ setCondition([]);
187
+ setAttr(function () {
188
+ return _objectSpread({}, result);
189
+ });
190
+
191
+ _onChange(result, operator, []);
192
+ }
210
193
  },
211
194
  onDelete: onDelete,
212
195
  showDeleteIcon: true,
@@ -231,27 +214,17 @@ var BizConditionItem = function BizConditionItem(props) {
231
214
  return operate;
232
215
  });
233
216
 
234
- var data = _objectSpread(_objectSpread({}, attr), {}, {
235
- operator: operate,
236
- params: _toConsumableArray(condition)
237
- });
238
-
239
- _onChange && _onChange(data);
217
+ _onChange(attr, operate, condition);
240
218
  }
241
219
  }), /*#__PURE__*/React.createElement(BizMultipleSelector, {
242
220
  options: conditionOptions,
243
221
  defaultValue: condition,
244
- onChange: function onChange(condition) {
222
+ onChange: function onChange(values) {
245
223
  setCondition(function () {
246
- return _toConsumableArray(condition);
247
- });
248
-
249
- var data = _objectSpread(_objectSpread({}, attr), {}, {
250
- operator: operator,
251
- params: _toConsumableArray(condition)
224
+ return _toConsumableArray(values);
252
225
  });
253
226
 
254
- _onChange && _onChange(data);
227
+ _onChange(attr, operator, values);
255
228
  }
256
229
  })));
257
230
  };
@@ -72,13 +72,13 @@ export var dimensionOperate = [{
72
72
  value: 'number'
73
73
  }, {
74
74
  name: '次数',
75
- value: 'count'
75
+ value: 'times'
76
76
  }, {
77
77
  name: '活跃比',
78
- value: 'ratio'
78
+ value: 'active_ratio'
79
79
  }, {
80
80
  name: '人均次数',
81
- value: 'perTimes'
81
+ value: 'per'
82
82
  }, {
83
83
  name: '金额',
84
84
  value: 'money',
@@ -87,10 +87,10 @@ export var dimensionOperate = [{
87
87
  value: 'sum'
88
88
  }, {
89
89
  name: '均值',
90
- value: 'mean'
90
+ value: 'avg'
91
91
  }, {
92
92
  name: '分布',
93
- value: 'distribution'
93
+ value: 'duration_times'
94
94
  }, {
95
95
  name: '中位数',
96
96
  value: 'median'
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,42 @@
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 React, { useState } from 'react';
14
+ import { BizTargetConditionGroup } from '@zgfe/business-lib';
15
+ import eventData from './data/event';
16
+ import envData from './data/env';
17
+ import userData from './data/user';
18
+ var attrOption = {
19
+ event: eventData,
20
+ user: userData,
21
+ env: envData
22
+ };
23
+ export default (function () {
24
+ var _useState = useState([]),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ group = _useState2[0],
27
+ setGroup = _useState2[1];
28
+
29
+ var handleChange = function handleChange(data) {
30
+ setGroup(function () {
31
+ return data;
32
+ });
33
+ };
34
+
35
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizTargetConditionGroup, {
36
+ options: {
37
+ eventOption: eventData,
38
+ attrOption: attrOption
39
+ },
40
+ onChange: handleChange
41
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u503C\uFF1A", JSON.stringify(group)));
42
+ });
@@ -21,16 +21,20 @@ import { BizTargetCondition } from '@zgfe/business-lib';
21
21
  import eventData from './data/event';
22
22
  import envData from './data/env';
23
23
  import userData from './data/user';
24
- var attrsData = {
25
- operator: 'and',
26
- attrs: [{
27
- attr_id: 5461056,
28
- attr_name: '支付方式',
29
- operator: 'equal',
30
- params: ['BlackBerry'],
31
- attrType: 'cont-string',
32
- category: 'custom'
33
- }]
24
+ var initData = {
25
+ alias: 'test',
26
+ eventId: 7086289,
27
+ type: 'event',
28
+ filters: {
29
+ relation: 'or',
30
+ conditions: [{
31
+ type: 'EVENT_PROP',
32
+ operation: 'equal',
33
+ attrId: 5461056,
34
+ attrName: '支付方式',
35
+ values: ['BlackBerry']
36
+ }]
37
+ }
34
38
  };
35
39
  var attrOption = {
36
40
  event: eventData,
@@ -38,10 +42,7 @@ var attrOption = {
38
42
  env: envData
39
43
  };
40
44
  export default (function () {
41
- var _useState = useState(_objectSpread({
42
- aliasName: '',
43
- eventId: 7086289
44
- }, attrsData)),
45
+ var _useState = useState({}),
45
46
  _useState2 = _slicedToArray(_useState, 2),
46
47
  target = _useState2[0],
47
48
  setTarget = _useState2[1];
@@ -53,21 +54,10 @@ export default (function () {
53
54
  };
54
55
 
55
56
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizTargetCondition, {
56
- defaultValue: _objectSpread({
57
- aliasName: '4444',
58
- eventId: 7086289
59
- }, attrsData),
60
57
  options: {
61
58
  eventOption: eventData,
62
59
  attrOption: attrOption
63
60
  },
64
- fieldNames: {
65
- label: 'event_name',
66
- value: 'event_id',
67
- groupLabel: 'groupName',
68
- groupValue: 'groupId',
69
- children: 'eventList'
70
- },
71
61
  onChange: handleChange
72
62
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(target)));
73
63
  });
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import { OptionType, TargetCondition } from './type';
3
+ interface BizTargetConditionGrouppProps {
4
+ /**
5
+ * @description 默认值
6
+ * @default -
7
+ */
8
+ defaultValue?: Array<TargetCondition>;
9
+ /**
10
+ * @description 值
11
+ * @default -
12
+ */
13
+ value?: Array<TargetCondition>;
14
+ /**
15
+ * @description 最多几个指标
16
+ * @default 10
17
+ */
18
+ max?: number;
19
+ /**
20
+ * @description 指标下最多几个属性
21
+ * @default 10
22
+ */
23
+ attrMax?: number;
24
+ /**
25
+ * @description 数据化配置选项内容
26
+ * @description.zh-CN
27
+ * @default -
28
+ */
29
+ options?: OptionType;
30
+ /**
31
+ * @description 自定义指标下拉框 label、value 的字段
32
+ * @description.zh-CN
33
+ * @default { label: 'name', value: 'id', groupLabel: 'name', groupValue: 'id' }
34
+ */
35
+ fieldNames?: {
36
+ label: string;
37
+ value: string;
38
+ groupLabel: string;
39
+ groupValue: string;
40
+ children: string;
41
+ };
42
+ /**
43
+ * @description 指标删除回调
44
+ * @description.zh-CN
45
+ * @default
46
+ */
47
+ onDelete?: () => void;
48
+ /**
49
+ * @description 改变回调
50
+ * @description.zh-CN
51
+ * @default
52
+ */
53
+ onChange?: (data: Array<TargetCondition>) => void;
54
+ }
55
+ declare const BizTargetConditionGroup: React.FC<BizTargetConditionGrouppProps>;
56
+ export default BizTargetConditionGroup;