@zgfe/business-lib 1.0.16 → 1.0.18-esfix.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 +46 -19
- package/es/assets/theme.js +1 -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 +67 -45
- 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 +5 -4
- 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/index.js +10 -4
- package/es/eventSelector/listPanel.js +2 -0
- 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 +10 -8
- package/es/select/index.d.ts +2 -2
- package/es/select/index.js +12 -30
- package/es/select/option.js +8 -2
- package/es/select/overlay.js +31 -4
- package/es/select/styles/handle.less +29 -13
- package/es/select/types.d.ts +6 -3
- 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 +260 -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/package.json +6 -7
|
@@ -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
|
|
|
@@ -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;
|
|
@@ -429,15 +456,15 @@
|
|
|
429
456
|
background-color: #94a6ce !important;
|
|
430
457
|
}
|
|
431
458
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
color: #fff !important;
|
|
459
|
+
.ant-form-item-explain-error {
|
|
460
|
+
color: @error-color!important;
|
|
435
461
|
}
|
|
436
462
|
|
|
437
|
-
|
|
438
|
-
|
|
463
|
+
//dropdown
|
|
464
|
+
.ant-dropdown {
|
|
465
|
+
z-index: 6666 !important;
|
|
439
466
|
}
|
|
440
|
-
|
|
441
|
-
.ant-
|
|
442
|
-
|
|
467
|
+
//message
|
|
468
|
+
.ant-message {
|
|
469
|
+
z-index: 99999 !important;
|
|
443
470
|
}
|
package/es/assets/theme.js
CHANGED
|
@@ -6,7 +6,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
exports.theme = {
|
|
9
|
-
'primary-color': '
|
|
9
|
+
'primary-color': '#165dff',
|
|
10
10
|
'border-color-base': '#ECEDF0',
|
|
11
11
|
'background-color-base': '#fafafb',
|
|
12
12
|
'text-color': '#021429',
|
|
@@ -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
|
});
|
|
@@ -43,6 +43,16 @@ var StringList = function StringList(props) {
|
|
|
43
43
|
isFirst = _useState6[0],
|
|
44
44
|
setIsFirst = _useState6[1];
|
|
45
45
|
|
|
46
|
+
var _useState7 = useState(''),
|
|
47
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
48
|
+
searchValue = _useState8[0],
|
|
49
|
+
setSearchValue = _useState8[1];
|
|
50
|
+
|
|
51
|
+
var _useState9 = useState(0),
|
|
52
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
53
|
+
timer = _useState10[0],
|
|
54
|
+
setTimer = _useState10[1];
|
|
55
|
+
|
|
46
56
|
useEffect(function () {
|
|
47
57
|
if (props.value) {
|
|
48
58
|
var data = props.value.map(function (item) {
|
|
@@ -57,7 +67,7 @@ var StringList = function StringList(props) {
|
|
|
57
67
|
}
|
|
58
68
|
}, [props.value]);
|
|
59
69
|
useEffect(function () {
|
|
60
|
-
fetchValues(
|
|
70
|
+
fetchValues();
|
|
61
71
|
|
|
62
72
|
if (isFirst) {
|
|
63
73
|
setIsFirst(false);
|
|
@@ -71,55 +81,66 @@ var StringList = function StringList(props) {
|
|
|
71
81
|
onChange([]);
|
|
72
82
|
}
|
|
73
83
|
}, [props.operate]);
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
fetchValues();
|
|
86
|
+
}, [searchValue]);
|
|
74
87
|
|
|
75
88
|
var fetchValues = /*#__PURE__*/function () {
|
|
76
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(
|
|
77
|
-
var
|
|
89
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
90
|
+
var fetch;
|
|
78
91
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
79
92
|
while (1) {
|
|
80
93
|
switch (_context.prev = _context.next) {
|
|
81
94
|
case 0:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
fetch = function fetch() {
|
|
96
|
+
var attrData = props.attr;
|
|
97
|
+
var requestData = {
|
|
98
|
+
app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
99
|
+
platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform,
|
|
100
|
+
limit: 20,
|
|
101
|
+
attr: (attrData === null || attrData === void 0 ? void 0 : attrData.id) || 0,
|
|
102
|
+
dimension_sub: attrData === null || attrData === void 0 ? void 0 : attrData.dimensionSub,
|
|
103
|
+
v: searchValue || ''
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
var transformRequest = function transformRequest(params) {
|
|
107
|
+
var arr = [];
|
|
108
|
+
|
|
109
|
+
for (var key in params) {
|
|
110
|
+
arr.push("".concat(key, "=").concat(encodeURIComponent(params[key])));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return arr.join('&');
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var formData = transformRequest(requestData);
|
|
117
|
+
request(Apis.esQuery, {
|
|
118
|
+
method: 'post',
|
|
119
|
+
data: formData,
|
|
120
|
+
headers: {
|
|
121
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
122
|
+
}
|
|
123
|
+
}).then(function (result) {
|
|
124
|
+
setOptions(function () {
|
|
125
|
+
return result && result.sources ? result.sources.map(function (item) {
|
|
126
|
+
return {
|
|
127
|
+
name: item,
|
|
128
|
+
value: item
|
|
129
|
+
};
|
|
130
|
+
}) : [];
|
|
131
|
+
});
|
|
132
|
+
}).catch(function (e) {
|
|
133
|
+
console.error(e);
|
|
134
|
+
setOptions([]);
|
|
135
|
+
});
|
|
99
136
|
};
|
|
100
137
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
headers: {
|
|
106
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
107
|
-
}
|
|
108
|
-
}).then(function (result) {
|
|
109
|
-
setOptions(function () {
|
|
110
|
-
return result && result.sources ? result.sources.map(function (item) {
|
|
111
|
-
return {
|
|
112
|
-
name: item,
|
|
113
|
-
value: item
|
|
114
|
-
};
|
|
115
|
-
}) : [];
|
|
116
|
-
});
|
|
117
|
-
}).catch(function (e) {
|
|
118
|
-
console.error(e);
|
|
119
|
-
setOptions([]);
|
|
120
|
-
});
|
|
138
|
+
if (timer) clearTimeout(timer);
|
|
139
|
+
setTimer(setTimeout(function () {
|
|
140
|
+
fetch();
|
|
141
|
+
}, 400));
|
|
121
142
|
|
|
122
|
-
case
|
|
143
|
+
case 3:
|
|
123
144
|
case "end":
|
|
124
145
|
return _context.stop();
|
|
125
146
|
}
|
|
@@ -127,7 +148,7 @@ var StringList = function StringList(props) {
|
|
|
127
148
|
}, _callee);
|
|
128
149
|
}));
|
|
129
150
|
|
|
130
|
-
return function fetchValues(
|
|
151
|
+
return function fetchValues() {
|
|
131
152
|
return _ref.apply(this, arguments);
|
|
132
153
|
};
|
|
133
154
|
}();
|
|
@@ -143,7 +164,7 @@ var StringList = function StringList(props) {
|
|
|
143
164
|
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
144
165
|
multiple: true,
|
|
145
166
|
enableCreate: true,
|
|
146
|
-
theme:
|
|
167
|
+
theme: props.theme,
|
|
147
168
|
size: "base",
|
|
148
169
|
className: "".concat(classPrefix, "-multi-select"),
|
|
149
170
|
options: [],
|
|
@@ -156,13 +177,14 @@ var StringList = function StringList(props) {
|
|
|
156
177
|
value: current,
|
|
157
178
|
multiple: true,
|
|
158
179
|
enableCreate: true,
|
|
159
|
-
theme:
|
|
180
|
+
theme: props.theme,
|
|
160
181
|
size: "base",
|
|
161
182
|
disable: props.operate === OperateTypes.IsNull || props.operate === OperateTypes.IsNotNull,
|
|
162
183
|
labelField: "name",
|
|
163
184
|
keyField: "value",
|
|
164
185
|
options: options,
|
|
165
|
-
onChange: onChange
|
|
186
|
+
onChange: onChange,
|
|
187
|
+
onSearch: setSearchValue
|
|
166
188
|
});
|
|
167
189
|
};
|
|
168
190
|
|
|
@@ -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: 30183426,
|
|
27
|
+
propCategory: 'eventProp',
|
|
28
|
+
type: 1,
|
|
29
|
+
operator: 'equal',
|
|
30
|
+
values: [],
|
|
31
|
+
dimensionSub: 'event_attr',
|
|
32
|
+
attrName: '公众号名称'
|
|
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;
|
|
@@ -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%;
|
|
@@ -60,15 +61,15 @@
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
&-input {
|
|
64
|
+
flex: 1;
|
|
63
65
|
.ant-input-group-addon {
|
|
64
|
-
background-color: @background-color-gray !important;
|
|
66
|
+
// background-color: @background-color-gray !important;
|
|
65
67
|
border: none;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
&-select {
|
|
69
71
|
width: 60px;
|
|
70
72
|
border: none;
|
|
71
|
-
border-left: 1px solid @border-color-split;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -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 {
|