@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,18 @@
1
1
  import { FormItemProps, ModalProps } from 'antd';
2
2
  import React from 'react';
3
+ interface BizObjectDefaultProps {
4
+ [key: string]: any;
5
+ }
6
+ interface fieldNamesProps {
7
+ label: string;
8
+ value: string;
9
+ }
3
10
  interface FieldProps {
11
+ /**
12
+ * @description form.item名称
13
+ * @default -
14
+ */
15
+ label?: string;
4
16
  /**
5
17
  * @description form.item类型
6
18
  * @default input
@@ -11,13 +23,18 @@ interface FieldProps {
11
23
  * @default -
12
24
  */
13
25
  value?: string | number;
26
+ /**
27
+ * @description form.item 依赖项及其值 {age:20}
28
+ * @default -
29
+ */
30
+ dependenceFields?: BizObjectDefaultProps;
14
31
  /**
15
32
  * @description 提示
16
33
  * @default -
17
34
  */
18
35
  placeholder?: string;
19
36
  /**
20
- * @description form.item p排列方向
37
+ * @description form.item 排列方向 'horizontal' | 'vertical'
21
38
  * @default horizontal
22
39
  */
23
40
  direction?: 'horizontal' | 'vertical';
@@ -26,11 +43,26 @@ interface FieldProps {
26
43
  * @default -
27
44
  */
28
45
  options?: Array<any>;
46
+ /**
47
+ * @description 扩展名称
48
+ * @default -
49
+ */
50
+ extendName?: string;
51
+ /**
52
+ * @description 下拉框的自定义节点 label、value
53
+ * @default { label: 'label', value: 'value' }
54
+ */
55
+ fieldNames?: fieldNamesProps;
29
56
  /**
30
57
  * @description 影响的表单项
31
58
  * @default -
32
59
  */
33
60
  children?: Array<string>;
61
+ /**
62
+ * @description 值发生改变
63
+ * @default -
64
+ */
65
+ onChange?: () => void;
34
66
  }
35
67
  interface BizDialogProps {
36
68
  /**
@@ -64,5 +96,5 @@ interface BizDialogProps {
64
96
  */
65
97
  onCancel?: () => void;
66
98
  }
67
- declare const BizDialog: React.FC<ModalProps & BizDialogProps>;
99
+ declare const BizDialog: React.FC<ModalProps & BizDialogProps & FormItemProps>;
68
100
  export default BizDialog;
@@ -1,3 +1,7 @@
1
+ var _excluded = ["width", "initialValues", "fields", "visible", "showMark", "layout", "onOk", "onCancel"];
2
+
3
+ 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; } } }; }
4
+
1
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; }
2
6
 
3
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; }
@@ -24,6 +28,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
24
28
 
25
29
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
30
 
31
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
32
+
33
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
34
+
27
35
  import { Form, Input, Modal, Radio, Space } from 'antd';
28
36
  import React, { useEffect, useState } from 'react';
29
37
  import BizSelectToInput from './components/selectToInput';
@@ -34,8 +42,6 @@ import BizList from './components/list';
34
42
  var BizDialog = function BizDialog(props) {
35
43
  var _props$width = props.width,
36
44
  width = _props$width === void 0 ? 520 : _props$width,
37
- _props$title = props.title,
38
- title = _props$title === void 0 ? 'Title' : _props$title,
39
45
  initialValues = props.initialValues,
40
46
  fields = props.fields,
41
47
  _props$visible = props.visible,
@@ -45,7 +51,8 @@ var BizDialog = function BizDialog(props) {
45
51
  _props$layout = props.layout,
46
52
  layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
47
53
  _onOk = props.onOk,
48
- _onCancel = props.onCancel;
54
+ _onCancel = props.onCancel,
55
+ res = _objectWithoutProperties(props, _excluded);
49
56
 
50
57
  var _Form$useForm = Form.useForm(),
51
58
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -56,74 +63,74 @@ var BizDialog = function BizDialog(props) {
56
63
  formFields = _useState2[0],
57
64
  setFormFields = _useState2[1];
58
65
 
59
- var getFormItem = function getFormItem(data) {
60
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'input';
61
- var name = arguments.length > 2 ? arguments[2] : undefined;
62
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
66
+ var getFormItem = function getFormItem(_ref) {
67
+ var type = _ref.type,
68
+ label = _ref.label,
69
+ options = _ref.options,
70
+ placeholder = _ref.placeholder,
71
+ _ref$fieldNames = _ref.fieldNames,
72
+ fieldNames = _ref$fieldNames === void 0 ? {
73
+ label: 'label',
74
+ value: 'value'
75
+ } : _ref$fieldNames,
76
+ extendName = _ref.extendName,
77
+ direction = _ref.direction,
78
+ onChange = _ref.onChange;
63
79
 
64
80
  if (type === 'selectToInput') {
65
81
  return /*#__PURE__*/React.createElement(BizSelectToInput, {
66
- name: name,
82
+ name: label,
67
83
  options: options,
68
- onChangeType: function onChangeType(isSelect) {
69
- if (data.children && data.children.length > 0) {
70
- var children = _toConsumableArray(data.children);
71
-
72
- var arr = [];
73
- fields.forEach(function (item) {
74
- var field = _objectSpread({}, item);
75
-
76
- if (children.indexOf(item.name) > -1) {
77
- field.hidden = isSelect;
78
- }
79
-
80
- arr.push(field);
81
- });
82
- setFormFields(function () {
83
- return [].concat(arr);
84
- });
85
- }
86
- }
84
+ fieldNames: fieldNames,
85
+ extendName: extendName,
86
+ onChange: onChange
87
87
  });
88
88
  } else if (type === 'select') {
89
89
  return /*#__PURE__*/React.createElement(BizSelect, {
90
90
  options: options,
91
- name: name,
92
- size: "middle"
91
+ name: label,
92
+ size: "middle",
93
+ onChange: onChange
93
94
  });
94
95
  } else if (type === 'input') {
95
96
  return /*#__PURE__*/React.createElement(Input, {
96
97
  className: "biz-input",
97
- placeholder: data.placeholder || "\u8BF7\u8F93\u5165".concat(name),
98
+ placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
98
99
  autoComplete: "off",
99
100
  allowClear: {
100
101
  clearIcon: /*#__PURE__*/React.createElement(IconFont, {
101
102
  className: "biz-icon",
102
103
  type: 'icon-qingchu'
103
104
  })
104
- }
105
+ },
106
+ onChange: onChange
105
107
  });
106
108
  } else if (type === 'password') {
107
109
  return /*#__PURE__*/React.createElement(Input.Password, {
108
110
  className: "biz-input",
109
- placeholder: data.placeholder || "\u8BF7\u8F93\u5165".concat(name)
111
+ placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
112
+ onChange: onChange
110
113
  });
111
114
  } else if (type === 'tab') {
112
115
  return /*#__PURE__*/React.createElement(BizTab, {
113
- options: options
116
+ options: options,
117
+ onChange: onChange
114
118
  });
115
119
  } else if (type === 'radio') {
116
- return /*#__PURE__*/React.createElement(Radio.Group, null, /*#__PURE__*/React.createElement(Space, {
117
- direction: data.direction || 'horizontal'
118
- }, options.map(function (item) {
120
+ return /*#__PURE__*/React.createElement(Radio.Group, {
121
+ onChange: onChange
122
+ }, /*#__PURE__*/React.createElement(Space, {
123
+ direction: direction || 'horizontal'
124
+ }, options && options.map(function (item) {
119
125
  return /*#__PURE__*/React.createElement(Radio, {
120
- key: item.value,
121
- value: item.value
122
- }, item.label);
126
+ key: item[fieldNames.value],
127
+ value: item[fieldNames.value]
128
+ }, item[fieldNames.label]);
123
129
  })));
124
130
  } else if (type === 'list') {
125
131
  return /*#__PURE__*/React.createElement(BizList, {
126
- options: options.length > 0 ? options : undefined
132
+ options: options && options.length > 0 ? options : undefined,
133
+ onChange: onChange
127
134
  });
128
135
  }
129
136
  };
@@ -138,11 +145,10 @@ var BizDialog = function BizDialog(props) {
138
145
  return _toConsumableArray(fields);
139
146
  });
140
147
  }, [fields]);
141
- return /*#__PURE__*/React.createElement(Modal, {
148
+ return /*#__PURE__*/React.createElement(Modal, _objectSpread(_objectSpread({
142
149
  width: width,
143
150
  centered: true,
144
151
  visible: visible,
145
- title: title,
146
152
  maskStyle: {
147
153
  background: '#021429',
148
154
  opacity: 0.8
@@ -152,7 +158,8 @@ var BizDialog = function BizDialog(props) {
152
158
  },
153
159
  cancelText: "\u53D6\u6D88",
154
160
  okText: "\u786E\u5B9A",
155
- closable: false,
161
+ closable: false
162
+ }, res), {}, {
156
163
  onCancel: function onCancel() {
157
164
  return _onCancel && _onCancel();
158
165
  },
@@ -163,7 +170,7 @@ var BizDialog = function BizDialog(props) {
163
170
  console.log('Validate Failed:', info);
164
171
  });
165
172
  }
166
- }, /*#__PURE__*/React.createElement(Form, {
173
+ }), /*#__PURE__*/React.createElement(Form, {
167
174
  className: "biz-dialog",
168
175
  form: form,
169
176
  name: "form_in_modal",
@@ -171,17 +178,84 @@ var BizDialog = function BizDialog(props) {
171
178
  initialValues: initialValues,
172
179
  layout: layout
173
180
  }, formFields === null || formFields === void 0 ? void 0 : formFields.map(function (item, index) {
174
- return /*#__PURE__*/React.createElement(Form.Item, {
175
- key: item.name,
176
- label: item.label,
177
- name: item.name,
178
- hidden: item.hidden,
179
- rules: item.rules,
180
- help: item.help,
181
- wrapperCol: {
182
- offset: !item.label && layout === 'horizontal' ? 2 : 0
183
- }
184
- }, getFormItem(item, item.type, item.label, item.options));
181
+ // 判断是否有依赖项,如果依赖项的值符合,则展示,否则不展示
182
+ if (item.dependenceFields && Object.keys(item.dependenceFields).length > 0) {
183
+ var keys = Object.keys(item.dependenceFields);
184
+ var dependenceFields = item.dependenceFields;
185
+ return /*#__PURE__*/React.createElement(Form.Item, {
186
+ key: item.name,
187
+ noStyle: true,
188
+ shouldUpdate: function shouldUpdate(prevValues, curValues) {
189
+ var flag = false;
190
+
191
+ var _iterator = _createForOfIteratorHelper(keys),
192
+ _step;
193
+
194
+ try {
195
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
196
+ var key = _step.value;
197
+
198
+ if (prevValues[key] !== curValues[key]) {
199
+ flag = true;
200
+ break;
201
+ }
202
+ }
203
+ } catch (err) {
204
+ _iterator.e(err);
205
+ } finally {
206
+ _iterator.f();
207
+ }
208
+
209
+ return flag;
210
+ }
211
+ }, function (_ref2) {
212
+ var getFieldValue = _ref2.getFieldValue;
213
+ var flag = true;
214
+
215
+ var _iterator2 = _createForOfIteratorHelper(keys),
216
+ _step2;
217
+
218
+ try {
219
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
220
+ var key = _step2.value;
221
+
222
+ if (getFieldValue(key) !== dependenceFields[key]) {
223
+ flag = false;
224
+ break;
225
+ }
226
+ }
227
+ } catch (err) {
228
+ _iterator2.e(err);
229
+ } finally {
230
+ _iterator2.f();
231
+ }
232
+
233
+ return flag ? /*#__PURE__*/React.createElement(Form.Item, {
234
+ label: item.label,
235
+ name: item.name,
236
+ hidden: item.hidden,
237
+ rules: item.rules,
238
+ help: item.help,
239
+ wrapperCol: {
240
+ offset: !item.label && layout === 'horizontal' ? 2 : 0
241
+ },
242
+ shouldUpdate: true
243
+ }, getFormItem(item)) : null;
244
+ });
245
+ } else {
246
+ return /*#__PURE__*/React.createElement(Form.Item, {
247
+ key: item.name,
248
+ label: item.label,
249
+ name: item.name,
250
+ hidden: item.hidden,
251
+ rules: item.rules,
252
+ help: item.help,
253
+ wrapperCol: {
254
+ offset: !item.label && layout === 'horizontal' ? 2 : 0
255
+ },
256
+ shouldUpdate: true
257
+ }, getFormItem(item));
258
+ }
185
259
  })));
186
260
  };
187
261
 
@@ -44,6 +44,7 @@
44
44
  &.ant-form-horizontal .ant-form-item-label > label {
45
45
  height: 40px;
46
46
  }
47
+
47
48
  &.ant-form-vertical .ant-form-item-label {
48
49
  margin-bottom: 12px;
49
50
  color: @titleColor;
@@ -51,7 +52,7 @@
51
52
  }
52
53
 
53
54
  .ant-modal-footer {
54
- padding-bottom: 32px;
55
+ padding: 0 24px 24px 24px;
55
56
  border-top: none;
56
57
 
57
58
  .ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
@@ -67,10 +68,19 @@
67
68
  color: #000;
68
69
  font-weight: 500;
69
70
  font-size: 24px;
71
+ line-height: 24px;
70
72
  }
71
73
  }
72
74
 
73
75
  .ant-modal-body {
74
76
  max-height: 400px;
77
+ padding-bottom: 0;
75
78
  overflow: auto;
76
79
  }
80
+
81
+ .biz-form-radio {
82
+ width: 100%;
83
+ height: 40px;
84
+ color: @titleColor;
85
+ line-height: 40px;
86
+ }
@@ -17,6 +17,11 @@ interface EventBoxProps extends FormProps {
17
17
  * @default -
18
18
  */
19
19
  aliasName?: string;
20
+ /**
21
+ * @description 是否展示事件概览
22
+ * @default true
23
+ */
24
+ showAll?: boolean;
20
25
  /**
21
26
  * @description 选择完成后的回调
22
27
  * @default -
@@ -45,6 +45,8 @@ var BizEventSelector = function BizEventSelector(props) {
45
45
  options = _props$options === void 0 ? [] : _props$options,
46
46
  defaultValue = props.defaultValue,
47
47
  value = props.value,
48
+ _props$showAll = props.showAll,
49
+ showAll = _props$showAll === void 0 ? true : _props$showAll,
48
50
  _props$fieldNames = props.fieldNames,
49
51
  fieldNames = _props$fieldNames === void 0 ? {
50
52
  label: 'name',
@@ -119,10 +121,15 @@ var BizEventSelector = function BizEventSelector(props) {
119
121
  eventOptions = _useState18[0],
120
122
  setEventOptions = _useState18[1];
121
123
 
122
- var _useState19 = useState(aliasName),
124
+ var _useState19 = useState(true),
123
125
  _useState20 = _slicedToArray(_useState19, 2),
124
- alias = _useState20[0],
125
- setAlias = _useState20[1];
126
+ showOverview = _useState20[0],
127
+ setShowOverview = _useState20[1];
128
+
129
+ var _useState21 = useState(aliasName),
130
+ _useState22 = _slicedToArray(_useState21, 2),
131
+ alias = _useState22[0],
132
+ setAlias = _useState22[1];
126
133
 
127
134
  useEffect(function () {
128
135
  setAlias(function () {
@@ -134,8 +141,9 @@ var BizEventSelector = function BizEventSelector(props) {
134
141
  var initValue = function initValue() {
135
142
  // 所有的option
136
143
  var firstGroup = {};
137
- firstGroup[fieldNames.groupLabel] = '整体概览';
138
- firstGroup[fieldNames.groupValue] = 'all';
144
+ firstGroup[fieldNames.groupLabel] = '所有分组'; // firstGroup[fieldNames.groupLabel] = '整体概览';
145
+
146
+ firstGroup[fieldNames.groupValue] = -2;
139
147
  firstGroup[fieldNames.children] = [];
140
148
 
141
149
  var _iterator = _createForOfIteratorHelper(options),
@@ -166,11 +174,24 @@ var BizEventSelector = function BizEventSelector(props) {
166
174
  _iterator.f();
167
175
  }
168
176
 
169
- setEventOptions(function (option) {
170
- return [firstGroup].concat(_toConsumableArray(option));
177
+ var result = JSON.parse(JSON.stringify(eventOptions));
178
+
179
+ if (result.length > 1) {
180
+ result = [firstGroup].concat(_toConsumableArray(result));
181
+ } // // 丢弃事件分组不显示
182
+
183
+
184
+ var index = result.findIndex(function (group) {
185
+ return group.groupName === '丢弃事件';
171
186
  });
172
- setGroup(firstGroup);
173
- setGroup2(firstGroup);
187
+ if (index > -1) result.splice(index, 1);
188
+ setEventOptions(function (option) {
189
+ return _toConsumableArray(result); // return [firstGroup, ...option];
190
+ }); // setGroup(firstGroup);
191
+ // setGroup2(firstGroup);
192
+
193
+ setGroup(result[0]);
194
+ setGroup2(result[0]);
174
195
  };
175
196
 
176
197
  if (options && options.length > 0) {
@@ -195,42 +216,87 @@ var BizEventSelector = function BizEventSelector(props) {
195
216
  if (!inValue || inValue === {}) return;
196
217
  var id = _typeof(inValue) === 'object' ? inValue[fieldNames.value] : inValue;
197
218
  if (event && event[fieldNames.value] === id) return;
219
+ var eid = id.split(',');
198
220
 
199
- var _iterator3 = _createForOfIteratorHelper(options),
200
- _step3;
221
+ if (parseFloat(eid[0]) < 0) {
222
+ // 事件概览
223
+ if (eid[1] < 0) {
224
+ setEvent(function () {
225
+ var _ref;
201
226
 
202
- try {
203
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
204
- var option = _step3.value;
205
- var children = option[fieldNames.children] || [];
227
+ return _ref = {}, _defineProperty(_ref, fieldNames.value, id), _defineProperty(_ref, fieldNames.label, '事件概览'), _ref;
228
+ });
229
+ setGroup(function () {
230
+ var _ref2;
206
231
 
207
- var _iterator4 = _createForOfIteratorHelper(children),
208
- _step4;
232
+ return _ref2 = {}, _defineProperty(_ref2, fieldNames.groupLabel, '所有分组'), _defineProperty(_ref2, fieldNames.groupValue, -2), _ref2;
233
+ });
234
+ } else {
235
+ var _iterator3 = _createForOfIteratorHelper(eventOptions),
236
+ _step3;
209
237
 
210
238
  try {
211
239
  var _loop = function _loop() {
212
- var event = _step4.value;
240
+ var option = _step3.value;
213
241
 
214
- if (event[fieldNames.value] == id) {
215
- setEvent(function () {
216
- return _objectSpread({}, event);
242
+ if (option[fieldNames.groupValue] === eid[1]) {
243
+ setGroup(function () {
244
+ var _ref3;
245
+
246
+ return _ref3 = {}, _defineProperty(_ref3, fieldNames.groupLabel, option[fieldNames.groupLabel]), _defineProperty(_ref3, fieldNames.groupValue, option[fieldNames.groupValue]), _ref3;
217
247
  });
248
+ return "break";
218
249
  }
219
250
  };
220
251
 
221
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
222
- _loop();
252
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
253
+ var _ret = _loop();
254
+
255
+ if (_ret === "break") break;
223
256
  }
224
257
  } catch (err) {
225
- _iterator4.e(err);
258
+ _iterator3.e(err);
226
259
  } finally {
227
- _iterator4.f();
260
+ _iterator3.f();
228
261
  }
229
262
  }
230
- } catch (err) {
231
- _iterator3.e(err);
232
- } finally {
233
- _iterator3.f();
263
+ } else {
264
+ var _iterator4 = _createForOfIteratorHelper(options),
265
+ _step4;
266
+
267
+ try {
268
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
269
+ var option = _step4.value;
270
+ var children = option[fieldNames.children] || [];
271
+
272
+ var _iterator5 = _createForOfIteratorHelper(children),
273
+ _step5;
274
+
275
+ try {
276
+ var _loop2 = function _loop2() {
277
+ var event = _step5.value;
278
+
279
+ if (event[fieldNames.value] == id) {
280
+ setEvent(function () {
281
+ return _objectSpread({}, event);
282
+ });
283
+ }
284
+ };
285
+
286
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
287
+ _loop2();
288
+ }
289
+ } catch (err) {
290
+ _iterator5.e(err);
291
+ } finally {
292
+ _iterator5.f();
293
+ }
294
+ }
295
+ } catch (err) {
296
+ _iterator4.e(err);
297
+ } finally {
298
+ _iterator4.f();
299
+ }
234
300
  }
235
301
  }, [defaultValue, value]); // 更改group后,事件列表响应
236
302
 
@@ -245,9 +311,20 @@ var BizEventSelector = function BizEventSelector(props) {
245
311
  size = group[fieldNames.children].length;
246
312
  }
247
313
 
314
+ if (showOverview) {
315
+ var _arr$unshift;
316
+
317
+ arr.unshift((_arr$unshift = {}, _defineProperty(_arr$unshift, fieldNames.value, "-2,".concat(group[fieldNames.groupValue])), _defineProperty(_arr$unshift, fieldNames.label, '事件概览'), _arr$unshift));
318
+ }
319
+
248
320
  setEventData(arr);
249
321
  setEventCount(size);
250
- }, [group]); // 初始化搜索框
322
+ }, [group]);
323
+ useEffect(function () {
324
+ setShowOverview(function () {
325
+ return showAll;
326
+ });
327
+ }, [showAll]); // 初始化搜索框
251
328
 
252
329
  useEffect(function () {
253
330
  setSearchValue(function () {
@@ -285,7 +362,7 @@ var BizEventSelector = function BizEventSelector(props) {
285
362
  }
286
363
  }, /*#__PURE__*/React.createElement("div", {
287
364
  className: "biz-input"
288
- }, event[fieldNames.label] ? event[fieldNames.label] : /*#__PURE__*/React.createElement("span", {
365
+ }, event[fieldNames.label] ? event[fieldNames.label] === '事件概览' ? "".concat(group[fieldNames.groupLabel], "/").concat(event[fieldNames.label]) : event[fieldNames.label] : /*#__PURE__*/React.createElement("span", {
289
366
  className: "biz-placeholder"
290
367
  }, placeholder), /*#__PURE__*/React.createElement("span", null, alias && alias !== '' && "(".concat(alias, ")"))), /*#__PURE__*/React.createElement(IconFont, {
291
368
  className: "biz-select-zhankai",
@@ -299,7 +376,7 @@ var BizEventSelector = function BizEventSelector(props) {
299
376
 
300
377
  return /*#__PURE__*/React.createElement("div", {
301
378
  className: "biz-dropdown-item ".concat(menu[fieldNames.groupValue] === group[fieldNames.groupValue] && 'box-hover'),
302
- key: menu[fieldNames.groupValue],
379
+ key: menu[fieldNames.groupValue] || 'key' + index,
303
380
  onMouseEnter: function onMouseEnter(e) {
304
381
  e.stopPropagation();
305
382
  setGroup(function () {
@@ -359,6 +436,8 @@ var BizEventSelector = function BizEventSelector(props) {
359
436
  setShowDropdown(false);
360
437
 
361
438
  if (onChange) {
439
+ item.groupId = group[fieldNames.groupValue];
440
+
362
441
  if (responseType === 'id') {
363
442
  onChange(item[fieldNames.value], item);
364
443
  } else {
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { AttrGroup } from '../targetConditionGroup/type';
2
3
  interface AttrType {
3
4
  attrId?: string;
4
5
  [props: string]: any;
@@ -12,12 +13,12 @@ interface GlobalAttributeProps {
12
13
  * @description 默认值
13
14
  * @default {}
14
15
  */
15
- defaultValue?: ValueType;
16
+ defaultValue?: AttrGroup;
16
17
  /**
17
18
  * @description 默认值
18
19
  * @default {}
19
20
  */
20
- value?: ValueType;
21
+ value?: AttrGroup;
21
22
  /**
22
23
  * @description 数据化配置选项内容
23
24
  * @description.zh-CN