@zgfe/business-lib 1.0.18 → 1.0.21-cdp.0
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/addToPanel/components/radioGroup.js +2 -1
- package/es/addToPanel/index.js +2 -1
- package/es/addToPanel/styles/index.less +3 -0
- package/es/addToPanel/styles/style.less +1 -1
- package/es/addToScene/index.js +1 -0
- package/es/assets/demo/index.d.ts +4 -0
- package/es/assets/demo/index.js +9 -0
- package/es/assets/demo/input.d.ts +2 -0
- package/es/assets/demo/input.js +68 -0
- package/es/assets/iconfont/demo_index.html +26 -3
- package/es/assets/iconfont/iconfont.css +7 -3
- package/es/assets/iconfont/iconfont.js +10 -10
- package/es/assets/iconfont/iconfont.json +7 -0
- package/es/assets/iconfont/iconfont.ttf +0 -0
- package/es/assets/iconfont/iconfont.woff +0 -0
- package/es/assets/iconfont/iconfont.woff2 +0 -0
- package/es/assets/styles/chunks.less +3 -4
- package/es/assets/styles/resetAntd.less +44 -14
- 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 -1
- package/es/attrConditions/components/valuesList.js +11 -12
- package/es/attrConditions/demo/group.js +13 -1
- package/es/attrConditions/group.js +14 -0
- package/es/attrConditions/index.js +16 -5
- package/es/attrConditions/styles/index.less +39 -5
- package/es/attrConditions/types.d.ts +4 -0
- package/es/attrConditions/utils/operates.js +2 -2
- package/es/attributeSelector/index.js +8 -4
- package/es/attributeSelector/listPanel.js +34 -20
- 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/dialog/index.js +2 -7
- package/es/eventSelector/index.js +10 -4
- package/es/eventSelector/listPanel.js +19 -24
- package/es/eventSelector/styles/index.less +5 -5
- package/es/eventSelector/types.d.ts +4 -0
- 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/customLabel.d.ts +2 -0
- package/es/select/demo/customLabel.js +23 -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 +7 -5
- package/es/select/option.js +8 -2
- package/es/select/overlay.js +6 -4
- package/es/select/styles/handle.less +23 -14
- package/es/select/types.d.ts +5 -1
- package/es/userCondition/conditionTypeList.js +29 -6
- package/es/userCondition/conditionWrap.js +4 -2
- package/es/userCondition/conditions/constants.d.ts +24 -0
- package/es/userCondition/conditions/constants.js +41 -0
- package/es/userCondition/conditions/eventCondition.js +13 -4
- package/es/userCondition/conditions/periodCondition.js +21 -10
- package/es/userCondition/conditions/propCondition.js +25 -6
- package/es/userCondition/conditions/runTimesCondition.js +2 -2
- package/es/userCondition/conditions/styles/eventCondition.less +9 -7
- package/es/userCondition/conditions/styles/periodCondition.less +12 -0
- package/es/userCondition/conditions/styles/propCondition.less +11 -3
- package/es/userCondition/conditions/styles/runTimesCondition.less +3 -0
- package/es/userCondition/conditions/styles/tagsCondition.less +20 -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 +241 -0
- package/es/userCondition/demo/index.js +259 -31
- package/es/userCondition/index.d.ts +1 -1
- package/es/userCondition/index.js +52 -10
- package/es/userCondition/orConditions.js +69 -28
- 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 +21 -1
- package/es/userCondition/styles/orConditions.less +20 -2
- package/es/userCondition/styles/relationLabel.less +5 -4
- package/es/userCondition/types.d.ts +28 -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 +40 -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/es/utils/util.js +2 -1
- package/package.json +6 -7
- package/es/select/index.less +0 -1
|
@@ -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
|
-
|
|
31
|
-
var initValue = [moment().subtract(1, 'weeks').format('YYYY-MM-DD'), moment().
|
|
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:
|
|
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:
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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"),
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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;
|
|
@@ -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,10 +19,11 @@ 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';
|
|
26
|
+
import _ from 'lodash';
|
|
18
27
|
var Link = Anchor.Link;
|
|
19
28
|
|
|
20
29
|
var AttrListPanel = function AttrListPanel(props) {
|
|
@@ -46,6 +55,17 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
46
55
|
currentAttr = _useState6[0],
|
|
47
56
|
setCurrentAttr = _useState6[1];
|
|
48
57
|
|
|
58
|
+
var eventIdMap = useMemo(function () {
|
|
59
|
+
var eventIdMap = {};
|
|
60
|
+
var eventList = (eventGroupList || []).reduce(function (pre, group) {
|
|
61
|
+
return [].concat(_toConsumableArray(pre), _toConsumableArray(group.eventList));
|
|
62
|
+
}, []);
|
|
63
|
+
eventList.forEach(function (event) {
|
|
64
|
+
if (eventIdMap[event.id]) return;
|
|
65
|
+
eventIdMap[event.id] = event;
|
|
66
|
+
});
|
|
67
|
+
return eventIdMap;
|
|
68
|
+
}, [eventGroupList]);
|
|
49
69
|
var disableItemlist = (_props$disableItemLis = props.disableItemList) === null || _props$disableItemLis === void 0 ? void 0 : _props$disableItemLis.map(function (item) {
|
|
50
70
|
if (item.propCategory === 'envProp') {
|
|
51
71
|
item.key = "envProp-".concat(item.name);
|
|
@@ -69,23 +89,17 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
69
89
|
|
|
70
90
|
if (enableEventProp) {
|
|
71
91
|
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
|
-
});
|
|
92
|
+
eventIdList === null || eventIdList === void 0 ? void 0 : eventIdList.forEach(function (id) {
|
|
93
|
+
var event = eventIdMap[id];
|
|
94
|
+
if (!event) return;
|
|
95
|
+
var group = {
|
|
96
|
+
isEvent: true,
|
|
97
|
+
groupName: event.alias || event.name,
|
|
98
|
+
anchor: hasAnchor ? String(Math.random()) : anchor.event,
|
|
99
|
+
key: "event-".concat(event.id),
|
|
100
|
+
children: event.attrList.slice()
|
|
101
|
+
};
|
|
102
|
+
list.push(group);
|
|
89
103
|
});
|
|
90
104
|
}
|
|
91
105
|
|
|
@@ -110,7 +124,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
110
124
|
}
|
|
111
125
|
|
|
112
126
|
setOptionList(list);
|
|
113
|
-
}, [
|
|
127
|
+
}, [eventIdMap, userPropList, eventEnvList, eventIdList]);
|
|
114
128
|
useEffect(function () {
|
|
115
129
|
setCurrentAttr(props.value);
|
|
116
130
|
}, [props.value]);
|
|
@@ -130,7 +144,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
130
144
|
});
|
|
131
145
|
var childList = [];
|
|
132
146
|
group.children.forEach(function (option) {
|
|
133
|
-
if (searchValue && !new RegExp(searchValue, 'i').test(option === null || option === void 0 ? void 0 : option.label)) return;
|
|
147
|
+
if (searchValue && !new RegExp(_.escapeRegExp(searchValue), 'i').test(option === null || option === void 0 ? void 0 : option.label)) return;
|
|
134
148
|
var disabled = false;
|
|
135
149
|
disableItemlist === null || disableItemlist === void 0 ? void 0 : disableItemlist.forEach(function (item) {
|
|
136
150
|
if (item.key === option.key) disabled = true;
|
|
@@ -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
|
});
|
package/es/dialog/index.js
CHANGED
|
@@ -28,12 +28,7 @@ BizDialog.defaultProps = {
|
|
|
28
28
|
okText: '确定',
|
|
29
29
|
closable: false,
|
|
30
30
|
centered: true,
|
|
31
|
-
okButtonProps: {
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
cancelButtonProps: {
|
|
35
|
-
size: 'large',
|
|
36
|
-
type: 'text'
|
|
37
|
-
}
|
|
31
|
+
okButtonProps: {},
|
|
32
|
+
cancelButtonProps: {}
|
|
38
33
|
};
|
|
39
34
|
export default BizDialog;
|
|
@@ -22,6 +22,8 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
22
22
|
var alias = props.alias,
|
|
23
23
|
placeholder = props.placeholder,
|
|
24
24
|
showAllEvent = props.showAllEvent,
|
|
25
|
+
border = props.border,
|
|
26
|
+
theme = props.theme,
|
|
25
27
|
defaultSelectAble = props.defaultSelectAble;
|
|
26
28
|
|
|
27
29
|
var _useState = useState(),
|
|
@@ -123,7 +125,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
123
125
|
};
|
|
124
126
|
|
|
125
127
|
return /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className: classPrefix
|
|
128
|
+
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
127
129
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
128
130
|
overlay: /*#__PURE__*/React.createElement(EventListPanel, {
|
|
129
131
|
value: currentValue,
|
|
@@ -140,12 +142,13 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
140
142
|
onVisibleChange: onVisibleChange,
|
|
141
143
|
getPopupContainer: props.popupContainer ? function () {
|
|
142
144
|
return document.getElementById(selectId);
|
|
143
|
-
} : undefined
|
|
145
|
+
} : undefined,
|
|
146
|
+
destroyPopupOnHide: props.defaultSelectAble
|
|
144
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
145
148
|
className: "".concat(classPrefix, "-handle"),
|
|
146
149
|
id: selectId
|
|
147
150
|
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
148
|
-
theme:
|
|
151
|
+
theme: theme,
|
|
149
152
|
border: false,
|
|
150
153
|
label: getLabel(),
|
|
151
154
|
placeholder: placeholder
|
|
@@ -155,6 +158,9 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
155
158
|
BizEventSelector.defaultProps = {
|
|
156
159
|
showAllEvent: true,
|
|
157
160
|
defaultSelectAble: true,
|
|
158
|
-
popupContainer: true
|
|
161
|
+
popupContainer: true,
|
|
162
|
+
border: true,
|
|
163
|
+
theme: 'secondary',
|
|
164
|
+
destroyPopupOnHide: false
|
|
159
165
|
};
|
|
160
166
|
export default BizEventSelector;
|
|
@@ -24,6 +24,7 @@ import React, { useContext, useEffect, useState } from 'react';
|
|
|
24
24
|
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
25
25
|
import { classPrefix } from '.';
|
|
26
26
|
import { BizGlobalDataContext } from '..';
|
|
27
|
+
import { ShowStatus } from '../attributeSelector/types';
|
|
27
28
|
import BizSearchInput from '../searchInput';
|
|
28
29
|
import EventListOption from './option';
|
|
29
30
|
|
|
@@ -49,25 +50,20 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
49
50
|
currentGroup = _useState6[0],
|
|
50
51
|
setCurrentGroup = _useState6[1];
|
|
51
52
|
|
|
52
|
-
var _useState7 = useState(),
|
|
53
|
+
var _useState7 = useState([]),
|
|
53
54
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
searchEventList = _useState8[0],
|
|
56
|
+
setSearchEventList = _useState8[1];
|
|
56
57
|
|
|
57
58
|
var _useState9 = useState([]),
|
|
58
59
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
showList = _useState10[0],
|
|
61
|
+
setShowList = _useState10[1];
|
|
61
62
|
|
|
62
|
-
var _useState11 = useState(
|
|
63
|
+
var _useState11 = useState(),
|
|
63
64
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _useState13 = useState(),
|
|
68
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
69
|
-
currentValue = _useState14[0],
|
|
70
|
-
setCurrentValue = _useState14[1];
|
|
65
|
+
currentValue = _useState12[0],
|
|
66
|
+
setCurrentValue = _useState12[1];
|
|
71
67
|
|
|
72
68
|
var overviewData = {
|
|
73
69
|
id: -100,
|
|
@@ -97,7 +93,6 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
97
93
|
return [group].concat(_toConsumableArray(list));
|
|
98
94
|
});
|
|
99
95
|
setCurrentGroup(group);
|
|
100
|
-
setCurrentSelectGroup(group);
|
|
101
96
|
}, []);
|
|
102
97
|
useEffect(function () {
|
|
103
98
|
setCurrentValue(props.value);
|
|
@@ -105,7 +100,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
105
100
|
useEffect(function () {
|
|
106
101
|
var list = [];
|
|
107
102
|
currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.eventList.forEach(function (event) {
|
|
108
|
-
if (searchValue && !new RegExp(searchValue, 'i').test(event.alias || event.name)) return;
|
|
103
|
+
if (searchValue && !new RegExp(_.escapeRegExp(searchValue), 'i').test(event.alias || event.name)) return;
|
|
109
104
|
list.push(event);
|
|
110
105
|
});
|
|
111
106
|
if (showOverview) list.unshift(overviewData);
|
|
@@ -139,10 +134,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
139
134
|
resVal.group = g;
|
|
140
135
|
resVal.event = searchEventList[0];
|
|
141
136
|
setCurrentValue(resVal);
|
|
142
|
-
setCurrentSelectGroup(g);
|
|
143
137
|
if (props.onChange) props.onChange(resVal);
|
|
144
|
-
} else {
|
|
145
|
-
setCurrentSelectGroup(g);
|
|
146
138
|
}
|
|
147
139
|
}
|
|
148
140
|
|
|
@@ -165,7 +157,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
165
157
|
count: group.eventList.length,
|
|
166
158
|
label: group.name || '未分组',
|
|
167
159
|
key: group.id || 'overview',
|
|
168
|
-
checked: (
|
|
160
|
+
checked: (currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id) === group.id,
|
|
169
161
|
data: group,
|
|
170
162
|
onClick: onClickGroup
|
|
171
163
|
});
|
|
@@ -178,21 +170,24 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
178
170
|
},
|
|
179
171
|
placeholder: "\u641C\u7D22\u57CB\u70B9\u4E8B\u4EF6"
|
|
180
172
|
}), /*#__PURE__*/React.createElement("div", {
|
|
181
|
-
className: "".concat(classPrefix, "-list")
|
|
173
|
+
className: "".concat(classPrefix, "-list"),
|
|
174
|
+
id: "scrollableDiv"
|
|
182
175
|
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
183
|
-
dataLength:
|
|
184
|
-
|
|
185
|
-
hasMore: (showList === null || showList === void 0 ? void 0 : showList.length) < searchEventList.length,
|
|
176
|
+
dataLength: showList.length,
|
|
177
|
+
hasMore: showList.length < searchEventList.length,
|
|
186
178
|
loader: /*#__PURE__*/React.createElement(Skeleton, {
|
|
187
179
|
paragraph: {
|
|
188
180
|
rows: 1
|
|
189
181
|
},
|
|
190
182
|
active: true
|
|
191
183
|
}),
|
|
192
|
-
|
|
184
|
+
next: loadMoreData,
|
|
185
|
+
scrollableTarget: "scrollableDiv",
|
|
186
|
+
key: Math.random()
|
|
193
187
|
}, showList === null || showList === void 0 ? void 0 : showList.map(function (e) {
|
|
194
188
|
var _currentValue$event;
|
|
195
189
|
|
|
190
|
+
if (e.eventHidden === ShowStatus.hidden) return null;
|
|
196
191
|
return /*#__PURE__*/React.createElement(EventListOption, {
|
|
197
192
|
label: e.alias || e.name,
|
|
198
193
|
key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
|