@zgfe/business-lib 1.0.18 → 1.0.19

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 (104) hide show
  1. package/es/addToPanel/index.js +1 -0
  2. package/es/addToScene/index.js +1 -0
  3. package/es/assets/styles/chunks.less +3 -4
  4. package/es/assets/styles/resetAntd.less +47 -11
  5. package/es/attrConditions/components/operateList.d.ts +1 -0
  6. package/es/attrConditions/components/operateList.js +2 -2
  7. package/es/attrConditions/components/stringList.d.ts +1 -0
  8. package/es/attrConditions/components/stringList.js +2 -2
  9. package/es/attrConditions/components/valuesList.d.ts +1 -1
  10. package/es/attrConditions/components/valuesList.js +11 -12
  11. package/es/attrConditions/demo/group.js +13 -1
  12. package/es/attrConditions/group.js +14 -0
  13. package/es/attrConditions/index.js +16 -5
  14. package/es/attrConditions/styles/index.less +39 -5
  15. package/es/attrConditions/types.d.ts +4 -0
  16. package/es/attrConditions/utils/operates.js +2 -2
  17. package/es/attributeSelector/index.js +8 -4
  18. package/es/attributeSelector/listPanel.js +32 -19
  19. package/es/attributeSelector/styles/index.less +3 -3
  20. package/es/attributeSelector/types.d.ts +7 -0
  21. package/es/attributeSelector/types.js +8 -1
  22. package/es/attributeSelector/util.js +3 -2
  23. package/es/eventSelector/index.js +10 -4
  24. package/es/eventSelector/listPanel.js +18 -23
  25. package/es/eventSelector/styles/index.less +5 -5
  26. package/es/eventSelector/types.d.ts +4 -0
  27. package/es/index.d.ts +2 -1
  28. package/es/index.js +2 -1
  29. package/es/mock/event.js +214 -0
  30. package/es/select/demo/children.d.ts +2 -0
  31. package/es/select/demo/children.js +81 -0
  32. package/es/select/demo/customLabel.d.ts +2 -0
  33. package/es/select/demo/customLabel.js +23 -0
  34. package/es/select/demo/index.js +10 -4
  35. package/es/select/demo/multiple.js +10 -3
  36. package/es/select/handle.js +4 -2
  37. package/es/select/index.d.ts +2 -2
  38. package/es/select/index.js +7 -5
  39. package/es/select/option.js +8 -2
  40. package/es/select/overlay.js +5 -3
  41. package/es/select/styles/handle.less +23 -13
  42. package/es/select/types.d.ts +5 -1
  43. package/es/userCondition/conditionTypeList.js +29 -6
  44. package/es/userCondition/conditionWrap.js +4 -2
  45. package/es/userCondition/conditions/constants.d.ts +24 -0
  46. package/es/userCondition/conditions/constants.js +41 -0
  47. package/es/userCondition/conditions/eventCondition.js +13 -4
  48. package/es/userCondition/conditions/periodCondition.js +21 -10
  49. package/es/userCondition/conditions/propCondition.js +25 -6
  50. package/es/userCondition/conditions/runTimesCondition.js +2 -2
  51. package/es/userCondition/conditions/styles/eventCondition.less +9 -7
  52. package/es/userCondition/conditions/styles/periodCondition.less +12 -0
  53. package/es/userCondition/conditions/styles/propCondition.less +11 -3
  54. package/es/userCondition/conditions/styles/runTimesCondition.less +3 -0
  55. package/es/userCondition/conditions/styles/tagsCondition.less +20 -0
  56. package/es/userCondition/conditions/styles/textDesc.less +17 -0
  57. package/es/userCondition/conditions/tagsCondition.d.ts +9 -0
  58. package/es/userCondition/conditions/tagsCondition.js +107 -0
  59. package/es/userCondition/conditions/textDesc.d.ts +9 -0
  60. package/es/userCondition/conditions/textDesc.js +241 -0
  61. package/es/userCondition/demo/index.js +259 -31
  62. package/es/userCondition/index.d.ts +1 -1
  63. package/es/userCondition/index.js +52 -10
  64. package/es/userCondition/orConditions.js +69 -28
  65. package/es/userCondition/relationLabel.js +6 -1
  66. package/es/userCondition/styles/conditionTypeList.less +1 -1
  67. package/es/userCondition/styles/conditionWrap.less +3 -0
  68. package/es/userCondition/styles/index.less +21 -1
  69. package/es/userCondition/styles/orConditions.less +20 -2
  70. package/es/userCondition/styles/relationLabel.less +5 -4
  71. package/es/userCondition/types.d.ts +28 -2
  72. package/es/userCondition/util.d.ts +5 -1
  73. package/es/userCondition/util.js +42 -0
  74. package/es/userTagsSelector/cascaderOverlay.d.ts +5 -0
  75. package/es/userTagsSelector/cascaderOverlay.js +114 -0
  76. package/es/userTagsSelector/components/search/index.d.ts +8 -0
  77. package/es/userTagsSelector/components/search/index.js +16 -0
  78. package/es/userTagsSelector/components/search/index.less +6 -0
  79. package/es/userTagsSelector/context.d.ts +3 -0
  80. package/es/userTagsSelector/context.js +2 -0
  81. package/es/userTagsSelector/demo/index.d.ts +2 -0
  82. package/es/userTagsSelector/demo/index.js +48 -0
  83. package/es/userTagsSelector/groups/groupOption.d.ts +5 -0
  84. package/es/userTagsSelector/groups/groupOption.js +42 -0
  85. package/es/userTagsSelector/groups/index.d.ts +4 -0
  86. package/es/userTagsSelector/groups/index.js +86 -0
  87. package/es/userTagsSelector/groups/styles/index.less +0 -0
  88. package/es/userTagsSelector/groups/styles/option.less +50 -0
  89. package/es/userTagsSelector/index.d.ts +6 -0
  90. package/es/userTagsSelector/index.js +110 -0
  91. package/es/userTagsSelector/multipleCheckPanel/checkOption.d.ts +5 -0
  92. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +45 -0
  93. package/es/userTagsSelector/multipleCheckPanel/index.d.ts +4 -0
  94. package/es/userTagsSelector/multipleCheckPanel/index.js +80 -0
  95. package/es/userTagsSelector/multipleCheckPanel/styles/index.less +0 -0
  96. package/es/userTagsSelector/multipleCheckPanel/styles/option.less +40 -0
  97. package/es/userTagsSelector/styles/cascaderOverlay.less +27 -0
  98. package/es/userTagsSelector/styles/index.less +10 -0
  99. package/es/userTagsSelector/types.d.ts +67 -0
  100. package/es/userTagsSelector/types.js +1 -0
  101. package/es/userTagsSelector/util.d.ts +4 -0
  102. package/es/userTagsSelector/util.js +38 -0
  103. package/es/utils/type.d.ts +2 -2
  104. package/package.json +6 -7
@@ -208,6 +208,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
208
208
  placeholder: "\u9009\u62E9\u770B\u677F",
209
209
  keyField: "id",
210
210
  labelField: "name",
211
+ popupContainer: false,
211
212
  dropdownExtra: /*#__PURE__*/React.createElement(Button, {
212
213
  className: "".concat(classPrefix, "-btn-add"),
213
214
  type: "ghost",
@@ -164,6 +164,7 @@ var BizAddToScene = function BizAddToScene(props) {
164
164
  enableSearch: true,
165
165
  keyField: "groupId",
166
166
  labelField: "groupName",
167
+ popupContainer: false,
167
168
  dropdownExtra: /*#__PURE__*/React.createElement(Button, {
168
169
  className: "".concat(classPrefix, "-btn-add"),
169
170
  type: "ghost",
@@ -50,15 +50,14 @@
50
50
  .__default-hover();
51
51
  }
52
52
 
53
- &.active {
53
+ &.active:not(.biz-select-option-multiple) {
54
54
  color: #fff;
55
55
  background: @primary-color;
56
56
  }
57
57
 
58
- &:not(.active).disabled {
58
+ &.disabled {
59
59
  color: @disabled-color;
60
60
  cursor: not-allowed;
61
-
62
61
  &:hover {
63
62
  background: none;
64
63
  }
@@ -87,7 +86,7 @@
87
86
  cursor: not-allowed;
88
87
 
89
88
  &:hover {
90
- background-color: none;
89
+ background-color: unset;
91
90
  }
92
91
  }
93
92
 
@@ -144,6 +144,14 @@
144
144
  .ant-picker-active-bar {
145
145
  display: none !important;
146
146
  }
147
+
148
+ &.ant-picker-range {
149
+ background-color: @background-color-base;
150
+ border: none;
151
+ &.ant-picker-large {
152
+ height: 40px;
153
+ }
154
+ }
147
155
  }
148
156
 
149
157
  /*日历下拉框*/
@@ -297,10 +305,14 @@
297
305
  }
298
306
 
299
307
  .ant-modal-body {
308
+ max-height: 400px;
300
309
  max-height: 400px !important;
301
310
  padding-top: @padding-xs !important;
302
- padding-bottom: 0 !important;
311
+ // padding-bottom: 0 !important;
303
312
  overflow: auto !important;
313
+ &:not(:last-child) {
314
+ padding-bottom: 0 !important;
315
+ }
304
316
  }
305
317
  }
306
318
 
@@ -370,10 +382,6 @@
370
382
  &::before {
371
383
  width: 0 !important;
372
384
  }
373
-
374
- &.ant-table-cell-fix-left-last {
375
- border-right: 1px solid @border-color-base!important;
376
- }
377
385
  }
378
386
 
379
387
  .ant-table-tbody {
@@ -386,12 +394,6 @@
386
394
 
387
395
  .ant-table-tbody > tr > td {
388
396
  line-height: 15px !important;
389
-
390
- &.ant-table-cell-fix-left {
391
- &.ant-table-cell-fix-left-last {
392
- border-right: 1px solid @border-color-base!important;
393
- }
394
- }
395
397
  }
396
398
  }
397
399
 
@@ -399,8 +401,33 @@
399
401
  .ant-table-tbody > tr > td.ant-table-cell-row-hover {
400
402
  background: color(~`colorPalette('@{primary-color}', 0.1) `) !important;
401
403
  }
404
+ .ant-table-thead {
405
+ .ant-table-cell {
406
+ &.ant-table-column-has-sorters {
407
+ .ant-table-column-sorters {
408
+ justify-content: flex-start;
409
+ .ant-table-column-title {
410
+ flex: none;
411
+ }
412
+ .ant-table-column-sorter {
413
+ margin-left: @margin-xs;
414
+ }
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ //气泡弹框
422
+ .ant-popover-inner {
423
+ border-radius: @border-radius-small;
402
424
  }
403
425
 
426
+ //tooltip
427
+ .ant-tooltip-inner {
428
+ padding: @margin-sm @margin-md;
429
+ border-radius: @border-radius-normal;
430
+ }
404
431
  /* 提示框 */
405
432
  .ant-tooltip-inner {
406
433
  padding: @padding-sm @padding-md!important;
@@ -432,3 +459,12 @@
432
459
  .ant-form-item-explain-error {
433
460
  color: @error-color!important;
434
461
  }
462
+
463
+ //dropdown
464
+ .ant-dropdown {
465
+ z-index: 6666 !important;
466
+ }
467
+ //message
468
+ .ant-message {
469
+ z-index: 99999 !important;
470
+ }
@@ -4,5 +4,6 @@ declare const BizOperateList: React.FC<{
4
4
  attr?: AttributeSelect.Value;
5
5
  defaultValue?: string;
6
6
  onChange?: (value: string) => void;
7
+ theme: string;
7
8
  }>;
8
9
  export default BizOperateList;
@@ -67,7 +67,7 @@ var BizOperateList = function BizOperateList(props) {
67
67
  if (!props.attr || !current || !options.length) {
68
68
  return /*#__PURE__*/React.createElement(BizSelect, {
69
69
  className: "".concat(classPrefix, "-single-select"),
70
- theme: "secondary",
70
+ theme: props.theme,
71
71
  disable: true,
72
72
  options: []
73
73
  });
@@ -79,7 +79,7 @@ var BizOperateList = function BizOperateList(props) {
79
79
  value: current,
80
80
  labelField: "name",
81
81
  keyField: "value",
82
- theme: "secondary",
82
+ theme: props.theme,
83
83
  options: options,
84
84
  onChange: onChange
85
85
  });
@@ -5,5 +5,6 @@ declare const StringList: React.FC<{
5
5
  operate: string;
6
6
  value?: string[];
7
7
  onChange?: (value: string[]) => void;
8
+ theme: string;
8
9
  }>;
9
10
  export default StringList;
@@ -164,7 +164,7 @@ var StringList = function StringList(props) {
164
164
  return /*#__PURE__*/React.createElement(BizSelect, {
165
165
  multiple: true,
166
166
  enableCreate: true,
167
- theme: "secondary",
167
+ theme: props.theme,
168
168
  size: "base",
169
169
  className: "".concat(classPrefix, "-multi-select"),
170
170
  options: [],
@@ -177,7 +177,7 @@ var StringList = function StringList(props) {
177
177
  value: current,
178
178
  multiple: true,
179
179
  enableCreate: true,
180
- theme: "secondary",
180
+ theme: props.theme,
181
181
  size: "base",
182
182
  disable: props.operate === OperateTypes.IsNull || props.operate === OperateTypes.IsNotNull,
183
183
  labelField: "name",
@@ -4,7 +4,7 @@ declare const ValuesList: React.FC<{
4
4
  attr?: AttributeSelect.Value;
5
5
  operate?: string;
6
6
  defaultValue?: string[];
7
- includeToday?: boolean;
8
7
  onChange?: (value: string[]) => void;
8
+ theme: string;
9
9
  }>;
10
10
  export default ValuesList;
@@ -27,8 +27,8 @@ var ValuesList = function ValuesList(props) {
27
27
  var attr = props.attr,
28
28
  defaultValue = props.defaultValue,
29
29
  operate = props.operate,
30
- includeToday = props.includeToday;
31
- var initValue = [moment().subtract(1, 'weeks').format('YYYY-MM-DD'), moment().subtract(includeToday ? 0 : 1, 'days').format('YYYY-MM-DD')];
30
+ theme = props.theme;
31
+ var initValue = [moment().subtract(1, 'weeks').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')];
32
32
 
33
33
  var _useState = useState(),
34
34
  _useState2 = _slicedToArray(_useState, 2),
@@ -119,14 +119,14 @@ var ValuesList = function ValuesList(props) {
119
119
  return /*#__PURE__*/React.createElement(BizSelect, {
120
120
  disable: true,
121
121
  className: "".concat(classPrefix, "-multi-select"),
122
- theme: "secondary",
123
- size: "base",
122
+ theme: theme,
124
123
  options: []
125
124
  });
126
125
  }
127
126
 
128
127
  if (attr.type === PropType.STRING) {
129
128
  return /*#__PURE__*/React.createElement(StringList, {
129
+ theme: theme,
130
130
  attr: attr,
131
131
  operate: operate,
132
132
  value: current,
@@ -139,19 +139,21 @@ var ValuesList = function ValuesList(props) {
139
139
  },
140
140
  keyField: "value",
141
141
  labelField: "label",
142
- theme: "secondary",
142
+ theme: props.theme,
143
143
  className: "".concat(classPrefix, "-input-select"),
144
144
  onChange: onChangeUnit,
145
145
  options: propSubtype
146
146
  });
147
- return /*#__PURE__*/React.createElement(Input, {
147
+ return /*#__PURE__*/React.createElement("div", {
148
+ className: "".concat(classPrefix, "-value-content")
149
+ }, /*#__PURE__*/React.createElement(Input, {
148
150
  className: "".concat(classPrefix, "-input"),
149
151
  value: current && current.length ? current[0] : '',
150
152
  placeholder: "\u8BF7\u8F93\u5165",
151
153
  type: "number",
152
154
  onChange: onChangeNumber,
153
- addonAfter: attr.propCategory === 'userProp' && attr.subtype === 1 ? '%' : attr.propCategory === 'userProp' && attr.subtype === 2 ? numberAfter : null
154
- });
155
+ suffix: attr.propCategory === 'userProp' && attr.subtype === 1 ? '%' : null
156
+ }), attr.propCategory === 'userProp' && attr.subtype === 2 && numberAfter);
155
157
  } else {
156
158
  if (operate === OperateTypes.Absolute) {
157
159
  return /*#__PURE__*/React.createElement(RangePicker, {
@@ -175,14 +177,11 @@ var ValuesList = function ValuesList(props) {
175
177
  value: current && current[0] ? current[0] : 30,
176
178
  placeholder: "\u8BF7\u8F93\u5165",
177
179
  type: "number",
178
- addonAfter: "\u5929",
180
+ suffix: "\u5929",
179
181
  onChange: onChangeDate
180
182
  });
181
183
  }
182
184
  }
183
185
  };
184
186
 
185
- ValuesList.defaultProps = {
186
- includeToday: false
187
- };
188
187
  export default ValuesList;
@@ -62,6 +62,13 @@ export default (function () {
62
62
  conditionRef.current.add();
63
63
  };
64
64
 
65
+ var onClear = function onClear() {
66
+ conditionRef.current.setValue();
67
+ setData({
68
+ conditions: []
69
+ });
70
+ };
71
+
65
72
  return /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
66
73
  value: {
67
74
  eventGroupList: store.eventGroupList,
@@ -79,5 +86,10 @@ export default (function () {
79
86
  onConditionsCount: setCount
80
87
  }), /*#__PURE__*/React.createElement("br", null), count < 3 && /*#__PURE__*/React.createElement(Button, {
81
88
  onClick: onClick
82
- }, "\u6DFB\u52A0"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(data)));
89
+ }, "\u6DFB\u52A0"), count > 0 && /*#__PURE__*/React.createElement(Button, {
90
+ onClick: onClear,
91
+ style: {
92
+ marginLeft: '20px'
93
+ }
94
+ }, "\u6E05\u7A7A"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(data)));
83
95
  });
@@ -74,6 +74,20 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
74
74
  });
75
75
  return _toConsumableArray(conditions);
76
76
  });
77
+ },
78
+ setValue: function setValue(data) {
79
+ if (data) {
80
+ if (data.relation) setRelation(data.relation);
81
+
82
+ if (data.conditions) {
83
+ setConditions(function () {
84
+ return addKeyToGroup(data.conditions);
85
+ });
86
+ }
87
+ } else {
88
+ setRelation('and');
89
+ setConditions([]);
90
+ }
77
91
  }
78
92
  };
79
93
  });
@@ -28,7 +28,9 @@ var BizConditionItem = function BizConditionItem(props) {
28
28
  enableEventProp = props.enableEventProp,
29
29
  enableUserProp = props.enableUserProp,
30
30
  enableEnvProp = props.enableEnvProp,
31
- disableItemList = props.disableItemList;
31
+ disableItemList = props.disableItemList,
32
+ border = props.border,
33
+ theme = props.theme;
32
34
 
33
35
  var _useState = useState(),
34
36
  _useState2 = _slicedToArray(_useState, 2),
@@ -101,7 +103,8 @@ var BizConditionItem = function BizConditionItem(props) {
101
103
  type: attr.type,
102
104
  operator: operate,
103
105
  values: values || [],
104
- dimensionSub: attr.dimensionSub
106
+ dimensionSub: attr.dimensionSub,
107
+ label: attr.label
105
108
  };
106
109
 
107
110
  if (attr.propCategory === PropCategory.EventProp) {
@@ -132,7 +135,7 @@ var BizConditionItem = function BizConditionItem(props) {
132
135
  };
133
136
 
134
137
  return /*#__PURE__*/React.createElement("div", {
135
- className: classPrefix
138
+ className: [classPrefix, border ? 'border' : ''].join(' ')
136
139
  }, /*#__PURE__*/React.createElement(Skeleton, {
137
140
  loading: ready,
138
141
  active: true,
@@ -148,10 +151,13 @@ var BizConditionItem = function BizConditionItem(props) {
148
151
  enableEnvProp: enableEnvProp,
149
152
  disableItemList: disableItemList,
150
153
  onChange: onChangeAttr,
151
- onDelete: onDelete
154
+ onDelete: onDelete,
155
+ theme: theme,
156
+ destroyPopupOnHide: props.destroyPopupOnHide
152
157
  }), /*#__PURE__*/React.createElement("div", {
153
158
  className: "".concat(classPrefix, "-panel")
154
159
  }, /*#__PURE__*/React.createElement(BizOperateList, {
160
+ theme: theme,
155
161
  attr: attr,
156
162
  defaultValue: operate,
157
163
  onChange: onChangeOperate
@@ -159,8 +165,13 @@ var BizConditionItem = function BizConditionItem(props) {
159
165
  attr: attr,
160
166
  operate: operate,
161
167
  defaultValue: values,
162
- onChange: onChangeValues
168
+ onChange: onChangeValues,
169
+ theme: theme
163
170
  }))));
164
171
  };
165
172
 
173
+ BizConditionItem.defaultProps = {
174
+ border: true,
175
+ theme: 'secondary'
176
+ };
166
177
  export default BizConditionItem;
@@ -2,8 +2,9 @@
2
2
 
3
3
  /* 筛选条件 */
4
4
  .biz-condition-item {
5
- .__select-handle();
6
-
5
+ &.border {
6
+ .__select-handle();
7
+ }
7
8
  &-panel {
8
9
  display: flex;
9
10
  width: 100%;
@@ -48,7 +49,7 @@
48
49
 
49
50
  &-single-select {
50
51
  width: 100px;
51
- margin-right: 8px;
52
+ margin-right: @margin-xs;
52
53
 
53
54
  &.gray {
54
55
  color: @text-color-secondary;
@@ -59,16 +60,49 @@
59
60
  }
60
61
  }
61
62
 
63
+ &-value-content {
64
+ display: flex;
65
+ flex: 1;
66
+
67
+ .biz-select-handle {
68
+ margin-left: @margin-xs;
69
+ }
70
+ }
71
+
62
72
  &-input {
63
- .ant-input-group-addon {
73
+ border: none;
74
+
75
+ &.ant-input-affix-wrapper {
76
+ height: @height-base !important;
64
77
  background-color: @background-color-gray !important;
78
+
79
+ input {
80
+ background-color: @background-color-gray !important;
81
+ }
82
+
83
+ &.ant-input-affix-wrapper-focused {
84
+ background-color: #fff !important;
85
+ border: 1px solid @primary-color;
86
+
87
+ input {
88
+ background-color: #fff !important;
89
+ }
90
+ }
91
+ }
92
+
93
+ &:focus {
94
+ border: 1px solid @primary-color;
95
+ }
96
+
97
+ .ant-input-group-addon {
98
+ // background-color: @background-color-gray !important;
65
99
  border: none;
66
100
  }
67
101
 
68
102
  &-select {
69
103
  width: 60px;
70
104
  border: none;
71
- border-left: 1px solid @border-color-split;
105
+ // border-left: 1px solid @border-color-split;
72
106
  }
73
107
  }
74
108
 
@@ -6,12 +6,14 @@ interface BasicAttrTypes {
6
6
  enableUserProp?: boolean;
7
7
  enableEnvProp?: boolean;
8
8
  disableItemList?: (EventProp | UserProp | EnvProp)[];
9
+ theme?: string;
9
10
  }
10
11
  export declare namespace AttrConditionTypes {
11
12
  interface ItemValue {
12
13
  subtype?: number;
13
14
  attrId?: number;
14
15
  attrName?: string;
16
+ label?: string;
15
17
  type?: PropType;
16
18
  propCategory?: 'userProp' | 'eventProp' | 'envProp';
17
19
  category?: 'fixed' | 'custom';
@@ -28,6 +30,8 @@ export declare namespace AttrConditionTypes {
28
30
  value?: ItemValue;
29
31
  onChange?: (value: ItemValue) => void;
30
32
  onDelete?: (value?: ItemValue) => void;
33
+ border?: boolean;
34
+ destroyPopupOnHide?: boolean;
31
35
  }
32
36
  interface GroupProp extends BasicAttrTypes {
33
37
  defaultValue?: GroupValue;
@@ -39,10 +39,10 @@ export var numberOperate = [{
39
39
  name: '<',
40
40
  value: 'lt'
41
41
  }, {
42
- name: '>=',
42
+ name: '',
43
43
  value: 'ge'
44
44
  }, {
45
- name: '<=',
45
+ name: '',
46
46
  value: 'le'
47
47
  }, {
48
48
  name: '≠',
@@ -26,7 +26,8 @@ import SelectHandle from '../select/handle';
26
26
 
27
27
  var BizAttributeSelector = function BizAttributeSelector(props) {
28
28
  var enableDelete = props.enableDelete,
29
- placeholder = props.placeholder;
29
+ placeholder = props.placeholder,
30
+ theme = props.theme;
30
31
 
31
32
  var _useState = useState(),
32
33
  _useState2 = _slicedToArray(_useState, 2),
@@ -120,14 +121,15 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
120
121
  width: width
121
122
  },
122
123
  visible: visible,
123
- onVisibleChange: onVisibleChange
124
+ onVisibleChange: onVisibleChange,
125
+ destroyPopupOnHide: props.destroyPopupOnHide
124
126
  }, /*#__PURE__*/React.createElement("div", {
125
127
  style: {
126
128
  width: '100%'
127
129
  }
128
130
  }, /*#__PURE__*/React.createElement(SelectHandle, {
129
131
  ref: boxRef,
130
- theme: "secondary",
132
+ theme: theme,
131
133
  border: false,
132
134
  label: currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.label,
133
135
  placeholder: placeholder
@@ -145,7 +147,9 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
145
147
  BizAttributeSelector.defaultProps = {
146
148
  enableDelete: false,
147
149
  placeholder: '请选择',
150
+ theme: 'secondary',
148
151
  propSymbol: '*',
149
- optionsHeaderTip: '带*的属性每日凌晨更新'
152
+ optionsHeaderTip: '带*的属性每日凌晨更新',
153
+ destroyPopupOnHide: false
150
154
  };
151
155
  export default BizAttributeSelector;
@@ -1,3 +1,11 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ 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."); }
4
+
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+
1
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
10
 
3
11
  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."); }
@@ -11,7 +19,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
11
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
20
 
13
21
  import { Anchor, Button } from 'antd';
14
- import React, { useContext, useEffect, useState } from 'react';
22
+ import React, { useContext, useEffect, useMemo, useState } from 'react';
15
23
  import { BizGlobalDataContext } from '..';
16
24
  import BizSearchInput from '../searchInput';
17
25
  import Option from './option';
@@ -46,6 +54,17 @@ var AttrListPanel = function AttrListPanel(props) {
46
54
  currentAttr = _useState6[0],
47
55
  setCurrentAttr = _useState6[1];
48
56
 
57
+ var eventIdMap = useMemo(function () {
58
+ var eventIdMap = {};
59
+ var eventList = (eventGroupList || []).reduce(function (pre, group) {
60
+ return [].concat(_toConsumableArray(pre), _toConsumableArray(group.eventList));
61
+ }, []);
62
+ eventList.forEach(function (event) {
63
+ if (eventIdMap[event.id]) return;
64
+ eventIdMap[event.id] = event;
65
+ });
66
+ return eventIdMap;
67
+ }, [eventGroupList]);
49
68
  var disableItemlist = (_props$disableItemLis = props.disableItemList) === null || _props$disableItemLis === void 0 ? void 0 : _props$disableItemLis.map(function (item) {
50
69
  if (item.propCategory === 'envProp') {
51
70
  item.key = "envProp-".concat(item.name);
@@ -69,23 +88,17 @@ var AttrListPanel = function AttrListPanel(props) {
69
88
 
70
89
  if (enableEventProp) {
71
90
  var hasAnchor = false;
72
- eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
73
- group.eventList.forEach(function (event) {
74
- if (event.isDelete || event.isStop) return;
75
- if (eventIdList && eventIdList.length && !eventIdList.includes(event.id)) return;
76
- var group = {
77
- isEvent: true,
78
- groupName: event.alias || event.name,
79
- anchor: hasAnchor ? String(Math.random()) : anchor.event,
80
- key: "event-".concat(event.id),
81
- children: []
82
- };
83
- hasAnchor = true;
84
- event.attrList.forEach(function (attr) {
85
- group.children.push(attr);
86
- });
87
- list.push(group);
88
- });
91
+ eventIdList === null || eventIdList === void 0 ? void 0 : eventIdList.forEach(function (id) {
92
+ var event = eventIdMap[id];
93
+ if (!event) return;
94
+ var group = {
95
+ isEvent: true,
96
+ groupName: event.alias || event.name,
97
+ anchor: hasAnchor ? String(Math.random()) : anchor.event,
98
+ key: "event-".concat(event.id),
99
+ children: event.attrList.slice()
100
+ };
101
+ list.push(group);
89
102
  });
90
103
  }
91
104
 
@@ -110,7 +123,7 @@ var AttrListPanel = function AttrListPanel(props) {
110
123
  }
111
124
 
112
125
  setOptionList(list);
113
- }, [eventGroupList, userPropList, eventEnvList, eventIdList]);
126
+ }, [eventIdMap, userPropList, eventEnvList, eventIdList]);
114
127
  useEffect(function () {
115
128
  setCurrentAttr(props.value);
116
129
  }, [props.value]);
@@ -5,7 +5,9 @@
5
5
  flex-direction: row;
6
6
  .__select-handle();
7
7
  &:hover .biz-attr-select-del-icon {
8
- display: inline-block;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
9
11
  }
10
12
  }
11
13
  &-del-icon {
@@ -13,8 +15,6 @@
13
15
  flex: none;
14
16
  width: @icon-width;
15
17
  color: @text-color-secondary;
16
- line-height: 2em;
17
- text-align: center;
18
18
  border-radius: @border-radius-small;
19
19
 
20
20
  &:hover {
@@ -9,6 +9,10 @@ export declare enum PropCategory {
9
9
  UserProp = "userProp",
10
10
  EnvProp = "envProp"
11
11
  }
12
+ export declare enum ShowStatus {
13
+ show = 0,
14
+ hidden = 1
15
+ }
12
16
  export interface AnalysisEvent {
13
17
  id: number;
14
18
  name: string;
@@ -17,6 +21,7 @@ export interface AnalysisEvent {
17
21
  isDelete?: boolean;
18
22
  isStop?: boolean;
19
23
  isOverview?: boolean;
24
+ eventHidden?: ShowStatus;
20
25
  }
21
26
  export interface EventGroup {
22
27
  id: number;
@@ -72,6 +77,8 @@ export declare namespace AttributeSelect {
72
77
  optionsHeaderTip?: string;
73
78
  onChange?: (value: Value) => void;
74
79
  onDelete?: (value?: Value) => void;
80
+ theme?: string;
81
+ destroyPopupOnHide?: boolean;
75
82
  }
76
83
  interface Option {
77
84
  groupName: string;
@@ -12,4 +12,11 @@ export var PropCategory;
12
12
  PropCategory["EventProp"] = "eventProp";
13
13
  PropCategory["UserProp"] = "userProp";
14
14
  PropCategory["EnvProp"] = "envProp";
15
- })(PropCategory || (PropCategory = {}));
15
+ })(PropCategory || (PropCategory = {}));
16
+
17
+ export var ShowStatus;
18
+
19
+ (function (ShowStatus) {
20
+ ShowStatus[ShowStatus["show"] = 0] = "show";
21
+ ShowStatus[ShowStatus["hidden"] = 1] = "hidden";
22
+ })(ShowStatus || (ShowStatus = {}));