@zgfe/business-lib 1.0.14 → 1.0.15-user.1
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.
- package/es/assets/styles/chunks.less +3 -4
- package/es/assets/styles/resetAntd.less +36 -1
- package/es/attrConditions/components/operateList.d.ts +1 -0
- package/es/attrConditions/components/operateList.js +2 -2
- package/es/attrConditions/components/stringList.d.ts +1 -0
- package/es/attrConditions/components/stringList.js +2 -2
- package/es/attrConditions/components/valuesList.d.ts +1 -0
- package/es/attrConditions/components/valuesList.js +5 -4
- package/es/attrConditions/demo/index.js +7 -8
- package/es/attrConditions/index.js +14 -4
- package/es/attrConditions/styles/index.less +3 -2
- package/es/attrConditions/types.d.ts +3 -0
- package/es/attrConditions/utils/operates.js +2 -2
- package/es/attributeSelector/index.js +8 -4
- package/es/attributeSelector/listPanel.js +32 -19
- package/es/attributeSelector/styles/index.less +3 -3
- package/es/attributeSelector/types.d.ts +7 -0
- package/es/attributeSelector/types.js +8 -1
- package/es/attributeSelector/util.js +3 -2
- package/es/eventSelector/demo/index.js +11 -2
- package/es/eventSelector/index.js +40 -7
- package/es/eventSelector/listPanel.js +37 -22
- package/es/eventSelector/styles/index.less +5 -3
- package/es/eventSelector/types.d.ts +7 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/mock/event.js +214 -0
- package/es/select/demo/children.d.ts +2 -0
- package/es/select/demo/children.js +81 -0
- package/es/select/demo/index.js +10 -4
- package/es/select/demo/multiple.js +10 -3
- package/es/select/handle.js +4 -2
- package/es/select/index.d.ts +2 -2
- package/es/select/index.js +14 -7
- package/es/select/overlay.js +1 -1
- package/es/select/styles/handle.less +22 -13
- package/es/select/types.d.ts +3 -1
- package/es/userCondition/conditionTypeList.js +14 -3
- package/es/userCondition/conditionWrap.js +4 -2
- package/es/userCondition/conditions/constants.d.ts +21 -0
- package/es/userCondition/conditions/constants.js +21 -0
- package/es/userCondition/conditions/eventCondition.js +13 -4
- package/es/userCondition/conditions/periodCondition.js +20 -10
- package/es/userCondition/conditions/propCondition.js +28 -8
- package/es/userCondition/conditions/runTimesCondition.js +2 -2
- package/es/userCondition/conditions/styles/eventCondition.less +7 -5
- package/es/userCondition/conditions/styles/propCondition.less +3 -3
- package/es/userCondition/conditions/styles/tagsCondition.less +18 -0
- package/es/userCondition/conditions/styles/textDesc.less +17 -0
- package/es/userCondition/conditions/tagsCondition.d.ts +9 -0
- package/es/userCondition/conditions/tagsCondition.js +107 -0
- package/es/userCondition/conditions/textDesc.d.ts +9 -0
- package/es/userCondition/conditions/textDesc.js +197 -0
- package/es/userCondition/demo/index.js +200 -31
- package/es/userCondition/index.d.ts +1 -1
- package/es/userCondition/index.js +31 -10
- package/es/userCondition/orConditions.js +64 -17
- package/es/userCondition/relationLabel.js +6 -1
- package/es/userCondition/styles/conditionTypeList.less +1 -1
- package/es/userCondition/styles/conditionWrap.less +3 -0
- package/es/userCondition/styles/index.less +19 -0
- package/es/userCondition/styles/orConditions.less +13 -0
- package/es/userCondition/types.d.ts +21 -2
- package/es/userCondition/util.d.ts +5 -1
- package/es/userCondition/util.js +42 -0
- package/es/userTagsSelector/cascaderOverlay.d.ts +5 -0
- package/es/userTagsSelector/cascaderOverlay.js +114 -0
- package/es/userTagsSelector/components/search/index.d.ts +8 -0
- package/es/userTagsSelector/components/search/index.js +16 -0
- package/es/userTagsSelector/components/search/index.less +6 -0
- package/es/userTagsSelector/context.d.ts +3 -0
- package/es/userTagsSelector/context.js +2 -0
- package/es/userTagsSelector/demo/index.d.ts +2 -0
- package/es/userTagsSelector/demo/index.js +48 -0
- package/es/userTagsSelector/groups/groupOption.d.ts +5 -0
- package/es/userTagsSelector/groups/groupOption.js +42 -0
- package/es/userTagsSelector/groups/index.d.ts +4 -0
- package/es/userTagsSelector/groups/index.js +86 -0
- package/es/userTagsSelector/groups/styles/index.less +0 -0
- package/es/userTagsSelector/groups/styles/option.less +50 -0
- package/es/userTagsSelector/index.d.ts +6 -0
- package/es/userTagsSelector/index.js +110 -0
- package/es/userTagsSelector/multipleCheckPanel/checkOption.d.ts +5 -0
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +45 -0
- package/es/userTagsSelector/multipleCheckPanel/index.d.ts +4 -0
- package/es/userTagsSelector/multipleCheckPanel/index.js +80 -0
- package/es/userTagsSelector/multipleCheckPanel/styles/index.less +0 -0
- package/es/userTagsSelector/multipleCheckPanel/styles/option.less +39 -0
- package/es/userTagsSelector/styles/cascaderOverlay.less +27 -0
- package/es/userTagsSelector/styles/index.less +10 -0
- package/es/userTagsSelector/types.d.ts +67 -0
- package/es/userTagsSelector/types.js +1 -0
- package/es/userTagsSelector/util.d.ts +4 -0
- package/es/userTagsSelector/util.js +38 -0
- package/es/utils/type.d.ts +2 -2
- package/package.json +4 -2
|
@@ -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
|
-
|
|
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:
|
|
89
|
+
background-color: unset;
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
|
|
@@ -297,9 +297,14 @@
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
.ant-modal-body {
|
|
300
|
+
max-height: 400px;
|
|
301
|
+
// &:not(:last-child) {
|
|
302
|
+
// padding-bottom: 0;
|
|
303
|
+
// }
|
|
300
304
|
max-height: 400px !important;
|
|
301
305
|
padding-top: @padding-xs !important;
|
|
302
306
|
padding-bottom: 0 !important;
|
|
307
|
+
overflow: auto;
|
|
303
308
|
overflow: auto !important;
|
|
304
309
|
}
|
|
305
310
|
}
|
|
@@ -389,7 +394,7 @@
|
|
|
389
394
|
|
|
390
395
|
&.ant-table-cell-fix-left {
|
|
391
396
|
&.ant-table-cell-fix-left-last {
|
|
392
|
-
border-right: 1px solid @border-color-base
|
|
397
|
+
// border-right: 1px solid @border-color-base;
|
|
393
398
|
}
|
|
394
399
|
}
|
|
395
400
|
}
|
|
@@ -399,8 +404,33 @@
|
|
|
399
404
|
.ant-table-tbody > tr > td.ant-table-cell-row-hover {
|
|
400
405
|
background: color(~`colorPalette('@{primary-color}', 0.1) `) !important;
|
|
401
406
|
}
|
|
407
|
+
.ant-table-thead {
|
|
408
|
+
.ant-table-cell {
|
|
409
|
+
&.ant-table-column-has-sorters {
|
|
410
|
+
.ant-table-column-sorters {
|
|
411
|
+
justify-content: flex-start;
|
|
412
|
+
.ant-table-column-title {
|
|
413
|
+
flex: none;
|
|
414
|
+
}
|
|
415
|
+
.ant-table-column-sorter {
|
|
416
|
+
margin-left: @margin-xs;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
//气泡弹框
|
|
425
|
+
.ant-popover-inner {
|
|
426
|
+
border-radius: @border-radius-small;
|
|
402
427
|
}
|
|
403
428
|
|
|
429
|
+
//tooltip
|
|
430
|
+
.ant-tooltip-inner {
|
|
431
|
+
padding: @margin-sm @margin-md;
|
|
432
|
+
border-radius: @border-radius-normal;
|
|
433
|
+
}
|
|
404
434
|
/* 提示框 */
|
|
405
435
|
.ant-tooltip-inner {
|
|
406
436
|
padding: @padding-sm @padding-md!important;
|
|
@@ -441,3 +471,8 @@
|
|
|
441
471
|
.ant-form-item-explain-error {
|
|
442
472
|
color: @error-color!important;
|
|
443
473
|
}
|
|
474
|
+
|
|
475
|
+
//dropdown
|
|
476
|
+
.ant-dropdown {
|
|
477
|
+
z-index: 6666 !important;
|
|
478
|
+
}
|
|
@@ -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:
|
|
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:
|
|
82
|
+
theme: props.theme,
|
|
83
83
|
options: options,
|
|
84
84
|
onChange: onChange
|
|
85
85
|
});
|
|
@@ -143,7 +143,7 @@ var StringList = function StringList(props) {
|
|
|
143
143
|
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
144
144
|
multiple: true,
|
|
145
145
|
enableCreate: true,
|
|
146
|
-
theme:
|
|
146
|
+
theme: props.theme,
|
|
147
147
|
size: "base",
|
|
148
148
|
className: "".concat(classPrefix, "-multi-select"),
|
|
149
149
|
options: [],
|
|
@@ -156,7 +156,7 @@ var StringList = function StringList(props) {
|
|
|
156
156
|
value: current,
|
|
157
157
|
multiple: true,
|
|
158
158
|
enableCreate: true,
|
|
159
|
-
theme:
|
|
159
|
+
theme: props.theme,
|
|
160
160
|
size: "base",
|
|
161
161
|
disable: props.operate === OperateTypes.IsNull || props.operate === OperateTypes.IsNotNull,
|
|
162
162
|
labelField: "name",
|
|
@@ -27,7 +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
|
|
30
|
+
includeToday = props.includeToday,
|
|
31
|
+
theme = props.theme;
|
|
31
32
|
var initValue = [moment().subtract(1, 'weeks').format('YYYY-MM-DD'), moment().subtract(includeToday ? 0 : 1, 'days').format('YYYY-MM-DD')];
|
|
32
33
|
|
|
33
34
|
var _useState = useState(),
|
|
@@ -119,14 +120,14 @@ var ValuesList = function ValuesList(props) {
|
|
|
119
120
|
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
120
121
|
disable: true,
|
|
121
122
|
className: "".concat(classPrefix, "-multi-select"),
|
|
122
|
-
theme:
|
|
123
|
-
size: "base",
|
|
123
|
+
theme: theme,
|
|
124
124
|
options: []
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
if (attr.type === PropType.STRING) {
|
|
129
129
|
return /*#__PURE__*/React.createElement(StringList, {
|
|
130
|
+
theme: theme,
|
|
130
131
|
attr: attr,
|
|
131
132
|
operate: operate,
|
|
132
133
|
value: current,
|
|
@@ -139,7 +140,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
139
140
|
},
|
|
140
141
|
keyField: "value",
|
|
141
142
|
labelField: "label",
|
|
142
|
-
theme:
|
|
143
|
+
theme: props.theme,
|
|
143
144
|
className: "".concat(classPrefix, "-input-select"),
|
|
144
145
|
onChange: onChangeUnit,
|
|
145
146
|
options: propSubtype
|
|
@@ -23,14 +23,13 @@ export default (function () {
|
|
|
23
23
|
|
|
24
24
|
var _useState = useState({
|
|
25
25
|
condition: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
category: 'fixed'
|
|
26
|
+
attrId: 30183431,
|
|
27
|
+
propCategory: 'eventProp',
|
|
28
|
+
type: 1,
|
|
29
|
+
operator: 'equal',
|
|
30
|
+
values: ['Microsoft Edge', 'Safari', 'Apple WebKit'],
|
|
31
|
+
dimensionSub: 'event_attr',
|
|
32
|
+
attrName: '用户open_id'
|
|
34
33
|
}
|
|
35
34
|
}),
|
|
36
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -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),
|
|
@@ -132,7 +134,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
-
className: classPrefix
|
|
137
|
+
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
136
138
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
137
139
|
loading: ready,
|
|
138
140
|
active: true,
|
|
@@ -148,10 +150,13 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
148
150
|
enableEnvProp: enableEnvProp,
|
|
149
151
|
disableItemList: disableItemList,
|
|
150
152
|
onChange: onChangeAttr,
|
|
151
|
-
onDelete: onDelete
|
|
153
|
+
onDelete: onDelete,
|
|
154
|
+
theme: theme,
|
|
155
|
+
destroyPopupOnHide: props.destroyPopupOnHide
|
|
152
156
|
}), /*#__PURE__*/React.createElement("div", {
|
|
153
157
|
className: "".concat(classPrefix, "-panel")
|
|
154
158
|
}, /*#__PURE__*/React.createElement(BizOperateList, {
|
|
159
|
+
theme: theme,
|
|
155
160
|
attr: attr,
|
|
156
161
|
defaultValue: operate,
|
|
157
162
|
onChange: onChangeOperate
|
|
@@ -159,8 +164,13 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
159
164
|
attr: attr,
|
|
160
165
|
operate: operate,
|
|
161
166
|
defaultValue: values,
|
|
162
|
-
onChange: onChangeValues
|
|
167
|
+
onChange: onChangeValues,
|
|
168
|
+
theme: theme
|
|
163
169
|
}))));
|
|
164
170
|
};
|
|
165
171
|
|
|
172
|
+
BizConditionItem.defaultProps = {
|
|
173
|
+
border: true,
|
|
174
|
+
theme: 'secondary'
|
|
175
|
+
};
|
|
166
176
|
export default BizConditionItem;
|
|
@@ -6,6 +6,7 @@ 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 {
|
|
@@ -28,6 +29,8 @@ export declare namespace AttrConditionTypes {
|
|
|
28
29
|
value?: ItemValue;
|
|
29
30
|
onChange?: (value: ItemValue) => void;
|
|
30
31
|
onDelete?: (value?: ItemValue) => void;
|
|
32
|
+
border?: boolean;
|
|
33
|
+
destroyPopupOnHide?: boolean;
|
|
31
34
|
}
|
|
32
35
|
interface GroupProp extends BasicAttrTypes {
|
|
33
36
|
defaultValue?: GroupValue;
|
|
@@ -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:
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
}, [
|
|
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:
|
|
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 = {}));
|
|
@@ -15,7 +15,7 @@ export default function convertAttributeData(store) {
|
|
|
15
15
|
eventList: []
|
|
16
16
|
};
|
|
17
17
|
group_.eventList.forEach(function (e) {
|
|
18
|
-
if (e.is_delete
|
|
18
|
+
if (e.is_delete) return;
|
|
19
19
|
var event = {
|
|
20
20
|
alias: e.alias_name,
|
|
21
21
|
attrList: e.event_attrs.map(function (item) {
|
|
@@ -35,7 +35,8 @@ export default function convertAttributeData(store) {
|
|
|
35
35
|
id: e.event_id,
|
|
36
36
|
isDelete: e.is_delete,
|
|
37
37
|
isStop: e.is_stop,
|
|
38
|
-
name: e.event_name
|
|
38
|
+
name: e.event_name,
|
|
39
|
+
eventHidden: e.event_hidden
|
|
39
40
|
};
|
|
40
41
|
group.eventList.push(event);
|
|
41
42
|
});
|
|
@@ -35,7 +35,16 @@ var EventDemo = function EventDemo() {
|
|
|
35
35
|
setValue(data);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
return /*#__PURE__*/React.createElement("div",
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
style: {
|
|
40
|
+
height: '500px',
|
|
41
|
+
overflow: 'auto'
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
style: {
|
|
45
|
+
height: '700px'
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
39
48
|
value: {
|
|
40
49
|
eventGroupList: store.eventGroupList
|
|
41
50
|
}
|
|
@@ -43,7 +52,7 @@ var EventDemo = function EventDemo() {
|
|
|
43
52
|
defaultValue: value,
|
|
44
53
|
alias: "\u522B\u540D",
|
|
45
54
|
onChange: onChange
|
|
46
|
-
})));
|
|
55
|
+
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
|
|
47
56
|
};
|
|
48
57
|
|
|
49
58
|
export default (function () {
|
|
@@ -21,16 +21,25 @@ export var classPrefix = 'biz-event-select';
|
|
|
21
21
|
var BizEventSelector = function BizEventSelector(props) {
|
|
22
22
|
var alias = props.alias,
|
|
23
23
|
placeholder = props.placeholder,
|
|
24
|
-
showAllEvent = props.showAllEvent
|
|
24
|
+
showAllEvent = props.showAllEvent,
|
|
25
|
+
border = props.border,
|
|
26
|
+
theme = props.theme,
|
|
27
|
+
defaultSelectAble = props.defaultSelectAble;
|
|
25
28
|
|
|
26
29
|
var _useState = useState(),
|
|
27
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
31
|
currentValue = _useState2[0],
|
|
29
32
|
setCurrentValue = _useState2[1];
|
|
30
33
|
|
|
34
|
+
var _useState3 = useState(false),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
visible = _useState4[0],
|
|
37
|
+
setVisible = _useState4[1];
|
|
38
|
+
|
|
31
39
|
var _useContext = useContext(BizGlobalDataContext),
|
|
32
40
|
eventGroupList = _useContext.eventGroupList;
|
|
33
41
|
|
|
42
|
+
var selectId = (Math.random() + 10).toString();
|
|
34
43
|
useEffect(function () {
|
|
35
44
|
if (!props.defaultValue) return;
|
|
36
45
|
var data = getValue(props.defaultValue);
|
|
@@ -103,31 +112,55 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
103
112
|
};
|
|
104
113
|
|
|
105
114
|
var onChange = function onChange(value) {
|
|
115
|
+
if (!defaultSelectAble) {
|
|
116
|
+
setVisible(false);
|
|
117
|
+
}
|
|
118
|
+
|
|
106
119
|
setCurrentValue(value);
|
|
107
120
|
props.onChange && props.onChange(value);
|
|
108
121
|
};
|
|
109
122
|
|
|
123
|
+
var onVisibleChange = function onVisibleChange(flag) {
|
|
124
|
+
setVisible(flag);
|
|
125
|
+
};
|
|
126
|
+
|
|
110
127
|
return /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className: classPrefix
|
|
128
|
+
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
112
129
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
113
130
|
overlay: /*#__PURE__*/React.createElement(EventListPanel, {
|
|
114
131
|
value: currentValue,
|
|
115
132
|
onChange: onChange,
|
|
116
|
-
showOverview: showAllEvent
|
|
133
|
+
showOverview: showAllEvent,
|
|
134
|
+
defaultSelectAble: defaultSelectAble
|
|
117
135
|
}),
|
|
118
136
|
trigger: ['click'],
|
|
119
137
|
overlayStyle: {
|
|
120
|
-
minWidth: 0
|
|
138
|
+
minWidth: 0,
|
|
139
|
+
paddingLeft: 8
|
|
121
140
|
},
|
|
122
|
-
|
|
141
|
+
visible: visible,
|
|
142
|
+
onVisibleChange: onVisibleChange,
|
|
143
|
+
getPopupContainer: props.popupContainer ? function () {
|
|
144
|
+
return document.getElementById(selectId);
|
|
145
|
+
} : undefined,
|
|
146
|
+
destroyPopupOnHide: props.defaultSelectAble
|
|
123
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: "".concat(classPrefix, "-handle")
|
|
148
|
+
className: "".concat(classPrefix, "-handle"),
|
|
149
|
+
id: selectId
|
|
125
150
|
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
126
|
-
theme:
|
|
151
|
+
theme: theme,
|
|
127
152
|
border: false,
|
|
128
153
|
label: getLabel(),
|
|
129
154
|
placeholder: placeholder
|
|
130
155
|
}))));
|
|
131
156
|
};
|
|
132
157
|
|
|
158
|
+
BizEventSelector.defaultProps = {
|
|
159
|
+
showAllEvent: true,
|
|
160
|
+
defaultSelectAble: true,
|
|
161
|
+
popupContainer: true,
|
|
162
|
+
border: true,
|
|
163
|
+
theme: 'secondary',
|
|
164
|
+
destroyPopupOnHide: false
|
|
165
|
+
};
|
|
133
166
|
export default BizEventSelector;
|