@zgfe/business-lib 1.0.15-user.1 → 1.0.15-user.10
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/resetAntd.less +19 -8
- package/es/assets/theme.js +24 -14
- package/es/attrConditions/demo/index.js +9 -7
- package/es/attrConditions/styles/index.less +2 -2
- package/es/eventSelector/listPanel.js +3 -11
- package/es/eventSelector/option.d.ts +0 -2
- package/es/eventSelector/option.js +1 -11
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/select/demo/customLabel.d.ts +2 -0
- package/es/select/demo/customLabel.js +23 -0
- package/es/select/option.js +8 -2
- package/es/select/overlay.js +4 -2
- package/es/select/styles/handle.less +1 -0
- package/es/select/types.d.ts +2 -0
- package/es/userCondition/conditionTypeList.js +16 -4
- package/es/userCondition/conditions/constants.d.ts +3 -0
- package/es/userCondition/conditions/constants.js +25 -5
- package/es/userCondition/conditions/periodCondition.js +1 -0
- package/es/userCondition/conditions/propCondition.js +9 -10
- package/es/userCondition/conditions/styles/eventCondition.less +2 -2
- package/es/userCondition/conditions/styles/periodCondition.less +11 -0
- package/es/userCondition/conditions/styles/propCondition.less +8 -0
- package/es/userCondition/conditions/styles/runTimesCondition.less +3 -0
- package/es/userCondition/conditions/textDesc.js +64 -20
- package/es/userCondition/demo/index.js +67 -7
- package/es/userCondition/index.d.ts +1 -1
- package/es/userCondition/index.js +27 -6
- package/es/userCondition/orConditions.js +6 -12
- package/es/userCondition/styles/index.less +1 -1
- package/es/userCondition/styles/orConditions.less +7 -2
- package/es/userCondition/styles/relationLabel.less +5 -4
- package/es/userCondition/types.d.ts +7 -0
- package/es/userTagsSelector/demo/index.js +1 -1
- package/es/userTagsSelector/groups/groupOption.js +1 -1
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +1 -1
- package/es/userTagsSelector/multipleCheckPanel/styles/option.less +1 -0
- package/es/userTagsSelector/styles/cascaderOverlay.less +6 -6
- package/package.json +3 -2
- package/es/assets/theme.d.ts +0 -15
|
@@ -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
|
/*日历下拉框*/
|
|
@@ -298,14 +306,14 @@
|
|
|
298
306
|
|
|
299
307
|
.ant-modal-body {
|
|
300
308
|
max-height: 400px;
|
|
301
|
-
// &:not(:last-child) {
|
|
302
|
-
// padding-bottom: 0;
|
|
303
|
-
// }
|
|
304
309
|
max-height: 400px !important;
|
|
305
310
|
padding-top: @padding-xs !important;
|
|
306
|
-
padding-bottom: 0 !important;
|
|
311
|
+
// padding-bottom: 0 !important;
|
|
307
312
|
overflow: auto;
|
|
308
313
|
overflow: auto !important;
|
|
314
|
+
&:not(:last-child) {
|
|
315
|
+
padding-bottom: 0 !important;
|
|
316
|
+
}
|
|
309
317
|
}
|
|
310
318
|
}
|
|
311
319
|
|
|
@@ -375,10 +383,6 @@
|
|
|
375
383
|
&::before {
|
|
376
384
|
width: 0 !important;
|
|
377
385
|
}
|
|
378
|
-
|
|
379
|
-
&.ant-table-cell-fix-left-last {
|
|
380
|
-
border-right: 1px solid @border-color-base!important;
|
|
381
|
-
}
|
|
382
386
|
}
|
|
383
387
|
|
|
384
388
|
.ant-table-tbody {
|
|
@@ -476,3 +480,10 @@
|
|
|
476
480
|
.ant-dropdown {
|
|
477
481
|
z-index: 6666 !important;
|
|
478
482
|
}
|
|
483
|
+
//message
|
|
484
|
+
.ant-message {
|
|
485
|
+
z-index: 99999 !important;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.ant-picker {
|
|
489
|
+
}
|
package/es/assets/theme.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
'
|
|
5
|
-
|
|
6
|
-
'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.acorn = {}));
|
|
5
|
+
})(this, function (exports) {
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
exports.theme = {
|
|
9
|
+
'primary-color': '#165dff',
|
|
10
|
+
'border-color-base': '#ECEDF0',
|
|
11
|
+
'background-color-base': '#fafafb',
|
|
12
|
+
'text-color': '#021429',
|
|
13
|
+
// 正文
|
|
14
|
+
'text-color-secondary': '#5f6085',
|
|
15
|
+
// 次要
|
|
16
|
+
'tooltip-bg': '#242541',
|
|
17
|
+
'error-color': '#fb5547',
|
|
18
|
+
'shadow-color': 'rgba(0, 0, 0, 0.1)',
|
|
19
|
+
'box-shadow-base': '0px 4px 10px rgba(0, 0, 0, 0.1)',
|
|
20
|
+
'btn-text-hover-bg': '#cacdd4',
|
|
21
|
+
'warning-color': '#FD9F41',
|
|
22
|
+
'border-color-split': '#E8EFFF'
|
|
23
|
+
};
|
|
24
|
+
});
|
|
@@ -23,13 +23,15 @@ export default (function () {
|
|
|
23
23
|
|
|
24
24
|
var _useState = useState({
|
|
25
25
|
condition: {
|
|
26
|
-
attrId:
|
|
27
|
-
propCategory: '
|
|
28
|
-
type:
|
|
29
|
-
operator: '
|
|
30
|
-
values: ['
|
|
31
|
-
dimensionSub: '
|
|
32
|
-
attrName: '
|
|
26
|
+
attrId: 0,
|
|
27
|
+
propCategory: 'userProp',
|
|
28
|
+
type: 2,
|
|
29
|
+
operator: 'gt',
|
|
30
|
+
values: ['72000', '1'],
|
|
31
|
+
dimensionSub: 'duration',
|
|
32
|
+
attrName: 'duration',
|
|
33
|
+
category: 'fixed',
|
|
34
|
+
subtype: 2
|
|
33
35
|
}
|
|
34
36
|
}),
|
|
35
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
&-input {
|
|
64
|
+
flex: 1;
|
|
64
65
|
.ant-input-group-addon {
|
|
65
|
-
background-color: @background-color-gray !important;
|
|
66
|
+
// background-color: @background-color-gray !important;
|
|
66
67
|
border: none;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
&-select {
|
|
70
71
|
width: 60px;
|
|
71
72
|
border: none;
|
|
72
|
-
border-left: 1px solid @border-color-split;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -133,6 +133,8 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
function onClickGroup(g) {
|
|
136
|
+
setCurrentGroup(g);
|
|
137
|
+
|
|
136
138
|
if (defaultSelectAble) {
|
|
137
139
|
var resVal = _.cloneDeep(currentValue) || {};
|
|
138
140
|
resVal.group = g;
|
|
@@ -145,14 +147,6 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
function onHoverGroup(g) {
|
|
149
|
-
setCurrentGroup(g);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function onMouseLeaveGroup() {
|
|
153
|
-
setCurrentGroup(currentSelectGroup);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
150
|
if (!groupList || !groupList.length || !groupList[0].eventList || !groupList[0].eventList.length) {
|
|
157
151
|
return /*#__PURE__*/React.createElement("div", {
|
|
158
152
|
className: "".concat(classPrefix, "-nodata-panel")
|
|
@@ -174,9 +168,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
174
168
|
key: group.id || 'overview',
|
|
175
169
|
checked: (currentSelectGroup === null || currentSelectGroup === void 0 ? void 0 : currentSelectGroup.id) === group.id,
|
|
176
170
|
data: group,
|
|
177
|
-
onClick: onClickGroup
|
|
178
|
-
onMouseOver: onHoverGroup,
|
|
179
|
-
onMouseLeave: onMouseLeaveGroup
|
|
171
|
+
onClick: onClickGroup
|
|
180
172
|
});
|
|
181
173
|
})), /*#__PURE__*/React.createElement("div", {
|
|
182
174
|
className: "".concat(classPrefix, "-right")
|
|
@@ -16,14 +16,6 @@ var EventListOption = function EventListOption(props) {
|
|
|
16
16
|
if (onClick) onClick(data);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
function onMouseOver() {
|
|
20
|
-
if (props.onMouseOver) props.onMouseOver(data);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function onMouseLeave() {
|
|
24
|
-
if (props.onMouseLeave) props.onMouseLeave(data);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
19
|
function getLabel(label) {
|
|
28
20
|
if (!highlight || !highlight.enable || !highlight.text) return label;
|
|
29
21
|
var text = highlight.text;
|
|
@@ -40,9 +32,7 @@ var EventListOption = function EventListOption(props) {
|
|
|
40
32
|
|
|
41
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
34
|
className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : ''),
|
|
43
|
-
onClick: _onClick
|
|
44
|
-
onMouseOver: onMouseOver,
|
|
45
|
-
onMouseLeave: onMouseLeave
|
|
35
|
+
onClick: _onClick
|
|
46
36
|
}, /*#__PURE__*/React.createElement("div", {
|
|
47
37
|
className: "".concat(classPrefix, "-option-label"),
|
|
48
38
|
title: label
|
package/es/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import BizChart from './chart';
|
|
|
14
14
|
import BizTable from './table';
|
|
15
15
|
import IconFont from './icon/iconFont';
|
|
16
16
|
import { util, ajax } from './utils';
|
|
17
|
-
import theme from './assets/theme';
|
|
17
|
+
import theme from './assets/theme.js';
|
|
18
18
|
import convertAttributeData from './attributeSelector/util';
|
|
19
19
|
import BizGlobalDataContext from './context';
|
|
20
20
|
import BizUserCondition from './userCondition';
|
package/es/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import BizChart from './chart';
|
|
|
13
13
|
import BizTable from './table';
|
|
14
14
|
import IconFont from './icon/iconFont';
|
|
15
15
|
import { util, ajax } from './utils';
|
|
16
|
-
import theme from './assets/theme';
|
|
16
|
+
import theme from './assets/theme.js';
|
|
17
17
|
import convertAttributeData from './attributeSelector/util';
|
|
18
18
|
import BizGlobalDataContext from './context';
|
|
19
19
|
import BizUserCondition from './userCondition';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BizSelect } from '@zgfe/business-lib';
|
|
3
|
+
import userData from '../../mock/user';
|
|
4
|
+
import convertAttributeData from '../../attributeSelector/util';
|
|
5
|
+
export default (function () {
|
|
6
|
+
var store = convertAttributeData({
|
|
7
|
+
userPropList: userData
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
function renderLabel(node, option) {
|
|
11
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, node, option.realTime ? '*' : null);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSelect, {
|
|
15
|
+
options: store.userPropList,
|
|
16
|
+
customLabel: renderLabel,
|
|
17
|
+
labelField: "name",
|
|
18
|
+
keyField: "name",
|
|
19
|
+
theme: "secondary",
|
|
20
|
+
popupContainer: true,
|
|
21
|
+
enableSearch: true
|
|
22
|
+
}));
|
|
23
|
+
});
|
package/es/select/option.js
CHANGED
|
@@ -8,7 +8,8 @@ var SelectOption = function SelectOption(props) {
|
|
|
8
8
|
group = props.group,
|
|
9
9
|
checked = props.checked,
|
|
10
10
|
disabled = props.disabled,
|
|
11
|
-
multiple = props.multiple
|
|
11
|
+
multiple = props.multiple,
|
|
12
|
+
customLabel = props.customLabel;
|
|
12
13
|
|
|
13
14
|
function onClick() {
|
|
14
15
|
if (disabled) return;
|
|
@@ -29,6 +30,11 @@ var SelectOption = function SelectOption(props) {
|
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
function renderLabel(option) {
|
|
34
|
+
var dom = getLabel(option[props.labelField]);
|
|
35
|
+
return customLabel ? customLabel(dom, option) : dom;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
if (group) {
|
|
33
39
|
return /*#__PURE__*/React.createElement("div", {
|
|
34
40
|
className: "".concat(classPrefix, "-group")
|
|
@@ -51,7 +57,7 @@ var SelectOption = function SelectOption(props) {
|
|
|
51
57
|
className: "".concat(classPrefix, "-option-icon")
|
|
52
58
|
}, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement("span", {
|
|
53
59
|
className: "".concat(classPrefix, "-option-label")
|
|
54
|
-
},
|
|
60
|
+
}, renderLabel(option)), !disabled && /*#__PURE__*/React.createElement("span", {
|
|
55
61
|
className: "".concat(classPrefix, "-option-btn")
|
|
56
62
|
}, props.extra && props.extra(option)));
|
|
57
63
|
};
|
package/es/select/overlay.js
CHANGED
|
@@ -25,7 +25,8 @@ var SelectOverlay = function SelectOverlay(props) {
|
|
|
25
25
|
multiple = props.multiple,
|
|
26
26
|
disableItemList = props.disableItemList,
|
|
27
27
|
dropdownExtra = props.dropdownExtra,
|
|
28
|
-
loading = props.loading
|
|
28
|
+
loading = props.loading,
|
|
29
|
+
customLabel = props.customLabel;
|
|
29
30
|
|
|
30
31
|
var _useState = useState(),
|
|
31
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -116,7 +117,8 @@ var SelectOverlay = function SelectOverlay(props) {
|
|
|
116
117
|
multiple: multiple,
|
|
117
118
|
onClick: onClick,
|
|
118
119
|
disabled: disabled,
|
|
119
|
-
key: option[keyField] || String(Math.random())
|
|
120
|
+
key: option[keyField] || String(Math.random()),
|
|
121
|
+
customLabel: customLabel
|
|
120
122
|
});
|
|
121
123
|
optionsDom.push(dom);
|
|
122
124
|
});
|
package/es/select/types.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare namespace BizSelectTypes {
|
|
|
36
36
|
onChange?: (val: Option) => void;
|
|
37
37
|
onVisibleChange?: (visible: boolean) => void;
|
|
38
38
|
destroyPopupOnHide?: boolean;
|
|
39
|
+
customLabel?: (node: ReactNode, option: Option) => ReactNode;
|
|
39
40
|
}
|
|
40
41
|
interface OverlayProps {
|
|
41
42
|
option?: Option;
|
|
@@ -51,6 +52,7 @@ export declare namespace BizSelectTypes {
|
|
|
51
52
|
labelField?: string;
|
|
52
53
|
extra?: (option: Option) => ReactNode;
|
|
53
54
|
onClick?: (option: Option) => void;
|
|
55
|
+
customLabel?: (node: ReactNode, option: Option) => ReactNode;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
export interface HandlerTypes {
|
|
@@ -22,25 +22,37 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
22
22
|
className: "biz-user-condition-type-container"
|
|
23
23
|
}, /*#__PURE__*/React.createElement("li", {
|
|
24
24
|
className: "condition-type",
|
|
25
|
+
key: "event",
|
|
25
26
|
onClick: function onClick() {
|
|
26
27
|
return onAdd('event');
|
|
27
28
|
}
|
|
28
|
-
}, /*#__PURE__*/React.createElement(Space,
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
30
|
+
key: "event"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u505A\u8FC7\uFF08\u6CA1\u505A\u8FC7\uFF09\u2026"))), /*#__PURE__*/React.createElement("li", {
|
|
29
32
|
className: "condition-type",
|
|
33
|
+
key: "add",
|
|
30
34
|
onClick: function onClick() {
|
|
31
35
|
return onAdd('add');
|
|
32
36
|
}
|
|
33
|
-
}, /*#__PURE__*/React.createElement(Space,
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
38
|
+
key: "add"
|
|
39
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u65B0\u589E\u4E8E"))), /*#__PURE__*/React.createElement("li", {
|
|
34
40
|
className: "condition-type",
|
|
41
|
+
key: "active",
|
|
35
42
|
onClick: function onClick() {
|
|
36
43
|
return onAdd('active');
|
|
37
44
|
}
|
|
38
|
-
}, /*#__PURE__*/React.createElement(Space,
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
46
|
+
key: "active"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u6D3B\u8DC3\u4E8E"))), /*#__PURE__*/React.createElement("li", {
|
|
39
48
|
className: "condition-type",
|
|
49
|
+
key: "prop",
|
|
40
50
|
onClick: function onClick() {
|
|
41
51
|
return onAdd('prop');
|
|
42
52
|
}
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Space,
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
54
|
+
key: "prop"
|
|
55
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition ? /*#__PURE__*/React.createElement("li", {
|
|
44
56
|
className: "condition-type",
|
|
45
57
|
onClick: function onClick() {
|
|
46
58
|
return onAdd('tag');
|
|
@@ -13,9 +13,29 @@ export var operatorMap = {
|
|
|
13
13
|
'not begin with': '开头不是',
|
|
14
14
|
'end with': '结尾是',
|
|
15
15
|
'not end with': '结尾不是',
|
|
16
|
-
'=': '',
|
|
17
|
-
'<': '',
|
|
18
|
-
'>': '',
|
|
19
|
-
'>=': '',
|
|
20
|
-
'<=': ''
|
|
16
|
+
'=': '=',
|
|
17
|
+
'<': '<',
|
|
18
|
+
'>': '>',
|
|
19
|
+
'>=': '≥',
|
|
20
|
+
'<=': '≤'
|
|
21
|
+
};
|
|
22
|
+
export var durationHandler = {
|
|
23
|
+
1: {
|
|
24
|
+
unit: '时',
|
|
25
|
+
format: function format(s) {
|
|
26
|
+
return Number(s) / 3600;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
2: {
|
|
30
|
+
unit: '分',
|
|
31
|
+
format: function format(s) {
|
|
32
|
+
return Number(s) / 60;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
3: {
|
|
36
|
+
unit: '秒',
|
|
37
|
+
format: function format(s) {
|
|
38
|
+
return s;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
21
41
|
};
|
|
@@ -118,6 +118,7 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
118
118
|
|
|
119
119
|
if (operator === 'absolute') {
|
|
120
120
|
return /*#__PURE__*/React.createElement(RangePicker, {
|
|
121
|
+
size: "large",
|
|
121
122
|
defaultValue: [moment(values[0]), moment(values[1])],
|
|
122
123
|
onChange: onDateChange,
|
|
123
124
|
allowClear: false
|
|
@@ -24,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
24
|
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
26
|
|
|
27
|
-
import React, { useEffect,
|
|
27
|
+
import React, { useEffect, useState } from 'react';
|
|
28
28
|
import { PlusOutlined } from '@ant-design/icons';
|
|
29
29
|
import BizConditionItem from '../../attrConditions';
|
|
30
30
|
import './styles/propCondition.less';
|
|
@@ -32,7 +32,6 @@ import { useContext } from 'react';
|
|
|
32
32
|
import { BizUserConditionContext, classPrefix } from '..';
|
|
33
33
|
import { transformNumberOperate } from '../util';
|
|
34
34
|
import { PropType } from '../../attributeSelector/types';
|
|
35
|
-
import BizGlobalDataContext from '../../context';
|
|
36
35
|
var numAttrTypeMap = {
|
|
37
36
|
1: 'cont-string',
|
|
38
37
|
2: 'cont-num',
|
|
@@ -45,8 +44,9 @@ var attrNumTypeMap = {
|
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
var PropCondition = function PropCondition(props) {
|
|
48
|
-
var _useContext = useContext(
|
|
49
|
-
|
|
47
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
48
|
+
envNameList = _useContext.envNameList,
|
|
49
|
+
userPropsMap = _useContext.userPropsMap;
|
|
50
50
|
|
|
51
51
|
var _useContext2 = useContext(BizUserConditionContext),
|
|
52
52
|
eventAttrNum = _useContext2.eventAttrNum;
|
|
@@ -62,11 +62,6 @@ var PropCondition = function PropCondition(props) {
|
|
|
62
62
|
showList = _useState2[0],
|
|
63
63
|
setShowList = _useState2[1];
|
|
64
64
|
|
|
65
|
-
var envNames = useMemo(function () {
|
|
66
|
-
return eventEnvList ? eventEnvList.map(function (env) {
|
|
67
|
-
return env.name;
|
|
68
|
-
}) : [];
|
|
69
|
-
}, [eventEnvList]);
|
|
70
65
|
useEffect(function () {
|
|
71
66
|
buildDefault();
|
|
72
67
|
}, []);
|
|
@@ -142,7 +137,7 @@ var PropCondition = function PropCondition(props) {
|
|
|
142
137
|
function getPropCategory(attrName) {
|
|
143
138
|
if (!isEvent) return 'userProp';
|
|
144
139
|
if (attrName === undefined) return 'eventProp';
|
|
145
|
-
if (
|
|
140
|
+
if (envNameList.includes(attrName)) return 'envProp';
|
|
146
141
|
return 'eventProp';
|
|
147
142
|
}
|
|
148
143
|
|
|
@@ -167,6 +162,10 @@ var PropCondition = function PropCondition(props) {
|
|
|
167
162
|
type: attrNumTypeMap[attrType]
|
|
168
163
|
};
|
|
169
164
|
attrId && (props.defaultValue.attrId = attrId);
|
|
165
|
+
|
|
166
|
+
if (userPropsMap[attrName] && userPropsMap[attrName].subtype) {
|
|
167
|
+
props.defaultValue.subtype = userPropsMap[attrName].subtype;
|
|
168
|
+
}
|
|
170
169
|
}
|
|
171
170
|
|
|
172
171
|
if (isEvent) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
flex: 1;
|
|
9
9
|
}
|
|
10
10
|
.biz-user-condition-event {
|
|
11
|
-
width:
|
|
11
|
+
width: 200px;
|
|
12
12
|
.biz-event-select-handle {
|
|
13
13
|
border-top-right-radius: 0;
|
|
14
14
|
border-bottom-right-radius: 0;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
justify-content: center;
|
|
27
|
-
width:
|
|
27
|
+
width: 38px;
|
|
28
28
|
height: 40px;
|
|
29
29
|
margin-right: @margin-xs;
|
|
30
30
|
margin-left: @border-radius-small;
|
|
@@ -7,8 +7,19 @@
|
|
|
7
7
|
&-values,
|
|
8
8
|
&-unit {
|
|
9
9
|
margin-right: @margin-xs;
|
|
10
|
+
> input {
|
|
11
|
+
border: none !important;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
&-operator {
|
|
12
15
|
width: 129px;
|
|
13
16
|
}
|
|
17
|
+
&-values {
|
|
18
|
+
.ant-picker-range.ant-picker-larg {
|
|
19
|
+
min-width: 255px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
&-today {
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
}
|
|
14
25
|
}
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
import React, { useContext, useMemo } from 'react';
|
|
2
8
|
import { BizUserConditionContext, classPrefix } from '..';
|
|
3
9
|
import BizGlobalDataContext from '../../context';
|
|
4
10
|
import { findEvent, findPropAndEnv, findTagFactory } from '../util';
|
|
5
|
-
import { operatorMap } from './constants';
|
|
11
|
+
import { durationHandler, operatorMap } from './constants';
|
|
6
12
|
import './styles/textDesc.less';
|
|
7
13
|
|
|
8
14
|
var Text = function Text(props) {
|
|
15
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
16
|
+
userPropsMap = _useContext.userPropsMap;
|
|
17
|
+
|
|
9
18
|
var condition = props.condition,
|
|
10
19
|
showOrDesc = props.showOrDesc;
|
|
11
20
|
|
|
12
|
-
var
|
|
13
|
-
eventGroupList =
|
|
14
|
-
userPropList =
|
|
15
|
-
eventEnvList =
|
|
21
|
+
var _useContext2 = useContext(BizGlobalDataContext),
|
|
22
|
+
eventGroupList = _useContext2.eventGroupList,
|
|
23
|
+
userPropList = _useContext2.userPropList,
|
|
24
|
+
eventEnvList = _useContext2.eventEnvList;
|
|
16
25
|
|
|
17
|
-
var
|
|
18
|
-
userTagsData =
|
|
26
|
+
var _useContext3 = useContext(BizUserConditionContext),
|
|
27
|
+
userTagsData = _useContext3.userTagsData;
|
|
19
28
|
|
|
20
29
|
function render() {
|
|
21
30
|
if (condition.labels) {
|
|
@@ -67,7 +76,7 @@ var Text = function Text(props) {
|
|
|
67
76
|
} : {}
|
|
68
77
|
}, /*#__PURE__*/React.createElement("span", {
|
|
69
78
|
className: "label"
|
|
70
|
-
}, label.before), /*#__PURE__*/React.createElement("span", null,
|
|
79
|
+
}, label.before), period.operator === 'relative' ? /*#__PURE__*/React.createElement("span", null, "\u6700\u8FD1") : null, valuesDom);
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
function renderProps(attr, type) {
|
|
@@ -84,13 +93,7 @@ var Text = function Text(props) {
|
|
|
84
93
|
}
|
|
85
94
|
}, /*#__PURE__*/React.createElement("span", {
|
|
86
95
|
className: "".concat(classPrefix, "-text-desc-label")
|
|
87
|
-
}, (_data = data) === null || _data === void 0 ? void 0 : _data.label),
|
|
88
|
-
className: "".concat(classPrefix, "-text-desc-operator")
|
|
89
|
-
}, operatorMap[attr.operator]), /*#__PURE__*/React.createElement("span", {
|
|
90
|
-
className: "".concat(classPrefix, "-text-desc-value")
|
|
91
|
-
}, attr.params.map(function (param, i) {
|
|
92
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, i > 0 ? /*#__PURE__*/React.createElement("span", null, "\u6216") : null, /*#__PURE__*/React.createElement("span", null, param));
|
|
93
|
-
})));
|
|
96
|
+
}, (_data = data) === null || _data === void 0 ? void 0 : _data.label), renderPropValues(attr));
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -139,11 +142,7 @@ var Text = function Text(props) {
|
|
|
139
142
|
if (label) {
|
|
140
143
|
var dom = /*#__PURE__*/React.createElement("span", {
|
|
141
144
|
key: i
|
|
142
|
-
}, /*#__PURE__*/React.createElement("span", null, label), /*#__PURE__*/React.createElement("span", null,
|
|
143
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
144
|
-
key: i
|
|
145
|
-
}, i > 0 ? '或' : '', param);
|
|
146
|
-
})), /*#__PURE__*/React.createElement("span", null, i !== attrs.length - 1 ? ',' : ''));
|
|
145
|
+
}, /*#__PURE__*/React.createElement("span", null, label), /*#__PURE__*/React.createElement("span", null, renderPropValues(attr)), i !== attrs.length - 1 ? ',' : '');
|
|
147
146
|
attrsDom.push(dom);
|
|
148
147
|
}
|
|
149
148
|
});
|
|
@@ -184,6 +183,51 @@ var Text = function Text(props) {
|
|
|
184
183
|
}), /*#__PURE__*/React.createElement("span", null, ")")));
|
|
185
184
|
}
|
|
186
185
|
|
|
186
|
+
function renderPropValues(attr) {
|
|
187
|
+
if (attr.attrType === 'cont-date') {
|
|
188
|
+
return renderDateValues(attr.operator, attr.params);
|
|
189
|
+
} else if (attr.attrType === 'cont-num') {
|
|
190
|
+
return renderNumValues(attr);
|
|
191
|
+
} else if (attr.attrType === 'cont-string') {
|
|
192
|
+
return renderStringValues(attr);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function renderStringValues(attr) {
|
|
197
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
198
|
+
className: "".concat(classPrefix, "-text-desc-operator")
|
|
199
|
+
}, operatorMap[attr.operator]), /*#__PURE__*/React.createElement("span", {
|
|
200
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
201
|
+
}, attr.params.map(function (param, i) {
|
|
202
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
203
|
+
key: param
|
|
204
|
+
}, i > 0 ? /*#__PURE__*/React.createElement("span", null, "\u6216") : null, /*#__PURE__*/React.createElement("span", null, param));
|
|
205
|
+
})));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function renderNumValues(attr) {
|
|
209
|
+
var numOperatorMap = _objectSpread(_objectSpread({}, operatorMap), {}, {
|
|
210
|
+
'not equal': '≠'
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
if (userPropsMap[attr.attrName] && userPropsMap[attr.attrName].subtype === 2) {
|
|
214
|
+
var handler = durationHandler[attr.params[1]];
|
|
215
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, numOperatorMap[attr.operator]), /*#__PURE__*/React.createElement("span", null, handler.format(attr.params[0])), /*#__PURE__*/React.createElement("span", null, handler.unit));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, operatorMap[attr.operator]), /*#__PURE__*/React.createElement("span", null, attr.params[0]));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function renderDateValues(operator, params) {
|
|
222
|
+
if (operator === 'relative') {
|
|
223
|
+
return /*#__PURE__*/React.createElement("span", null, "\u4E3A\u6700\u8FD1".concat(params[0], "\u5929"));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (operator === 'absolute') {
|
|
227
|
+
return /*#__PURE__*/React.createElement("span", null, "\u4E3A".concat(params[0], "\u5230").concat(params[1]));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
187
231
|
var findTag = useMemo(function () {
|
|
188
232
|
return findTagFactory(userTagsData);
|
|
189
233
|
}, [userTagsData]);
|
|
@@ -150,20 +150,79 @@ var getTagList = Promise.resolve([{
|
|
|
150
150
|
}]);
|
|
151
151
|
var data = {
|
|
152
152
|
json: [[{
|
|
153
|
+
eventId: '-4',
|
|
153
154
|
attrs: [],
|
|
154
|
-
|
|
155
|
-
operator: '
|
|
156
|
-
values: [
|
|
155
|
+
runPeriod: {
|
|
156
|
+
operator: 'relative',
|
|
157
|
+
values: ['30', '1']
|
|
158
|
+
},
|
|
159
|
+
runTimes: {
|
|
160
|
+
operator: '>=',
|
|
161
|
+
values: ['1']
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
eventId: '-3',
|
|
165
|
+
attrs: [],
|
|
166
|
+
runPeriod: {
|
|
167
|
+
operator: 'absolute',
|
|
168
|
+
values: ['2022-07-13', '2022-07-19']
|
|
169
|
+
},
|
|
170
|
+
runTimes: {
|
|
171
|
+
operator: '>=',
|
|
172
|
+
values: ['1']
|
|
157
173
|
}
|
|
158
174
|
}], [{
|
|
159
175
|
attrs: [{
|
|
160
|
-
attrId:
|
|
161
|
-
attrName: '
|
|
176
|
+
attrId: 0,
|
|
177
|
+
attrName: 'zg_id',
|
|
178
|
+
operator: '>',
|
|
179
|
+
params: ['20'],
|
|
180
|
+
attrType: 'cont-num',
|
|
181
|
+
category: 'fixed'
|
|
182
|
+
}]
|
|
183
|
+
}, {
|
|
184
|
+
attrs: [{
|
|
185
|
+
attrId: 0,
|
|
186
|
+
attrName: 'app_user_id',
|
|
187
|
+
operator: 'equal',
|
|
188
|
+
params: ['20'],
|
|
189
|
+
attrType: 'cont-string',
|
|
190
|
+
category: 'fixed'
|
|
191
|
+
}]
|
|
192
|
+
}], [{
|
|
193
|
+
attrs: [{
|
|
194
|
+
attrId: 0,
|
|
195
|
+
attrName: 'duration',
|
|
196
|
+
operator: 'not equal',
|
|
197
|
+
params: [1198800, '1'],
|
|
198
|
+
attrType: 'cont-num',
|
|
199
|
+
category: 'fixed'
|
|
200
|
+
}]
|
|
201
|
+
}, {
|
|
202
|
+
eventId: 24143017,
|
|
203
|
+
runTimes: {
|
|
204
|
+
operator: '>=',
|
|
205
|
+
values: ['1']
|
|
206
|
+
},
|
|
207
|
+
attrs: [{
|
|
208
|
+
attrId: 0,
|
|
209
|
+
attrName: 'resolution_l',
|
|
210
|
+
category: 'fixed',
|
|
211
|
+
operator: '>',
|
|
212
|
+
params: ['10'],
|
|
213
|
+
attrType: 'cont-num'
|
|
214
|
+
}, {
|
|
215
|
+
attrId: 30183430,
|
|
216
|
+
attrName: '扫码场景描述',
|
|
162
217
|
category: 'custom',
|
|
163
218
|
operator: 'equal',
|
|
164
|
-
params: ['Safari', '
|
|
219
|
+
params: ['Microsoft Edge', 'Safari', 'Apple WebKit'],
|
|
165
220
|
attrType: 'cont-string'
|
|
166
|
-
}]
|
|
221
|
+
}],
|
|
222
|
+
runPeriod: {
|
|
223
|
+
operator: 'relative',
|
|
224
|
+
values: ['30', '0']
|
|
225
|
+
}
|
|
167
226
|
}]]
|
|
168
227
|
};
|
|
169
228
|
export default (function () {
|
|
@@ -217,6 +276,7 @@ export default (function () {
|
|
|
217
276
|
}
|
|
218
277
|
|
|
219
278
|
var descDom = /*#__PURE__*/React.createElement(BizUserCondition, {
|
|
279
|
+
textMode: true,
|
|
220
280
|
defaultValue: defaultValue,
|
|
221
281
|
onChange: onChange,
|
|
222
282
|
eventAttrNum: 3,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BizUserConditionT } from './types';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
-
export declare const BizUserConditionContext: React.Context<
|
|
4
|
+
export declare const BizUserConditionContext: React.Context<BizUserConditionT.GlobalContext>;
|
|
5
5
|
export declare const classPrefix = "biz-user-condition";
|
|
6
6
|
declare const BizUserCondition: React.FC<BizUserConditionT.PropsI>;
|
|
7
7
|
export default BizUserCondition;
|
|
@@ -18,23 +18,30 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
18
18
|
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
|
|
21
|
-
import React, { createContext, useEffect, useState } from 'react';
|
|
21
|
+
import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
22
22
|
import ConditionTypeList from './conditionTypeList';
|
|
23
23
|
import RelationLabel from './relationLabel';
|
|
24
24
|
import OrConditions from './orConditions';
|
|
25
25
|
import './styles/index.less';
|
|
26
26
|
import { buildCondition } from './util';
|
|
27
27
|
import _ from 'lodash';
|
|
28
|
+
import BizGlobalDataContext from '../context';
|
|
28
29
|
export var BizUserConditionContext = /*#__PURE__*/createContext({
|
|
29
30
|
orConditionNum: 2,
|
|
30
31
|
eventAttrNum: 1,
|
|
31
32
|
textMode: false,
|
|
32
33
|
openTagCondition: false,
|
|
33
|
-
userTagsData: []
|
|
34
|
+
userTagsData: [],
|
|
35
|
+
envNameList: [],
|
|
36
|
+
userPropsMap: {}
|
|
34
37
|
});
|
|
35
38
|
export var classPrefix = 'biz-user-condition';
|
|
36
39
|
|
|
37
40
|
var BizUserCondition = function BizUserCondition(props) {
|
|
41
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
42
|
+
eventEnvList = _useContext.eventEnvList,
|
|
43
|
+
userPropList = _useContext.userPropList;
|
|
44
|
+
|
|
38
45
|
var andConditionNum = props.andConditionNum,
|
|
39
46
|
defaultValue = props.defaultValue,
|
|
40
47
|
openTagCondition = props.openTagCondition,
|
|
@@ -61,6 +68,18 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
61
68
|
value = _useState6[0],
|
|
62
69
|
setValue = _useState6[1];
|
|
63
70
|
|
|
71
|
+
var envNameList = useMemo(function () {
|
|
72
|
+
return eventEnvList ? eventEnvList.map(function (env) {
|
|
73
|
+
return env.name;
|
|
74
|
+
}) : [];
|
|
75
|
+
}, [eventEnvList]);
|
|
76
|
+
var userPropsMap = useMemo(function () {
|
|
77
|
+
if (!userPropList) return {};
|
|
78
|
+
return userPropList.reduce(function (pre, curr) {
|
|
79
|
+
pre[curr.name] = curr;
|
|
80
|
+
return pre;
|
|
81
|
+
}, {});
|
|
82
|
+
}, [userPropList]);
|
|
64
83
|
useEffect(function () {
|
|
65
84
|
initShowList();
|
|
66
85
|
}, []);
|
|
@@ -118,7 +137,7 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
118
137
|
|
|
119
138
|
setValue(newValue);
|
|
120
139
|
setDataList(newDataList);
|
|
121
|
-
props.onChange(newValue);
|
|
140
|
+
props.onChange && props.onChange(newValue);
|
|
122
141
|
}
|
|
123
142
|
|
|
124
143
|
return /*#__PURE__*/React.createElement(BizUserConditionContext.Provider, {
|
|
@@ -128,7 +147,9 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
128
147
|
textMode: props.textMode,
|
|
129
148
|
openTagCondition: openTagCondition,
|
|
130
149
|
userTagsData: userTagsData !== null && userTagsData !== void 0 ? userTagsData : [],
|
|
131
|
-
isRealTime: props.isRealTime
|
|
150
|
+
isRealTime: props.isRealTime,
|
|
151
|
+
envNameList: envNameList,
|
|
152
|
+
userPropsMap: userPropsMap
|
|
132
153
|
}
|
|
133
154
|
}, /*#__PURE__*/React.createElement("div", {
|
|
134
155
|
className: classPrefix
|
|
@@ -139,14 +160,14 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
139
160
|
}, "\u4E14"), showList.length ? /*#__PURE__*/React.createElement("div", {
|
|
140
161
|
className: ["".concat(classPrefix, "-and-conditions-wrap"), props.textMode ? 'text-mode' : ''].join(' ')
|
|
141
162
|
}, showList.map(function (item, i) {
|
|
142
|
-
return /*#__PURE__*/React.createElement(
|
|
163
|
+
return /*#__PURE__*/React.createElement(OrConditions, {
|
|
143
164
|
showAndDesc: i > 0,
|
|
144
165
|
orConditions: item.orConditions,
|
|
145
166
|
key: item.id,
|
|
146
167
|
onChange: function onChange(data) {
|
|
147
168
|
_onChange(item.id, data);
|
|
148
169
|
}
|
|
149
|
-
})
|
|
170
|
+
});
|
|
150
171
|
})) : null), /*#__PURE__*/React.createElement(ConditionTypeList, {
|
|
151
172
|
show: value.length < andConditionNum,
|
|
152
173
|
label: "\u4E14",
|
|
@@ -47,14 +47,8 @@ var OrConditions = function OrConditions(props) {
|
|
|
47
47
|
showList = _useState2[0],
|
|
48
48
|
setShowList = _useState2[1];
|
|
49
49
|
|
|
50
|
-
var _useState3 = useState(orConditions),
|
|
51
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
-
value = _useState4[0],
|
|
53
|
-
setValue = _useState4[1];
|
|
54
|
-
|
|
55
50
|
useEffect(function () {
|
|
56
51
|
if (orConditions) {
|
|
57
|
-
setValue(orConditions);
|
|
58
52
|
initShowList();
|
|
59
53
|
}
|
|
60
54
|
}, [orConditions]);
|
|
@@ -77,8 +71,9 @@ var OrConditions = function OrConditions(props) {
|
|
|
77
71
|
id: Math.random(),
|
|
78
72
|
condition: condition
|
|
79
73
|
};
|
|
80
|
-
var newValue =
|
|
81
|
-
|
|
74
|
+
var newValue = showList.map(function (item) {
|
|
75
|
+
return item.condition;
|
|
76
|
+
}).concat([condition]);
|
|
82
77
|
setShowList([].concat(_toConsumableArray(showList), [newData]));
|
|
83
78
|
props.onChange(newValue);
|
|
84
79
|
}
|
|
@@ -159,7 +154,6 @@ var OrConditions = function OrConditions(props) {
|
|
|
159
154
|
var newValue = newList.map(function (item) {
|
|
160
155
|
return item.condition;
|
|
161
156
|
});
|
|
162
|
-
setValue(newValue);
|
|
163
157
|
props.onChange(newValue);
|
|
164
158
|
}
|
|
165
159
|
|
|
@@ -179,7 +173,7 @@ var OrConditions = function OrConditions(props) {
|
|
|
179
173
|
if (textMode) {
|
|
180
174
|
return /*#__PURE__*/React.createElement(Text, {
|
|
181
175
|
showOrDesc: i > 0,
|
|
182
|
-
key:
|
|
176
|
+
key: id,
|
|
183
177
|
condition: condition
|
|
184
178
|
});
|
|
185
179
|
}
|
|
@@ -214,11 +208,11 @@ var OrConditions = function OrConditions(props) {
|
|
|
214
208
|
runPeriod: condition.runPeriod
|
|
215
209
|
});
|
|
216
210
|
} else if (util.isNumber(condition.eventId)) {
|
|
217
|
-
conditionDom = /*#__PURE__*/React.createElement(EventCondition, {
|
|
211
|
+
conditionDom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EventCondition, {
|
|
218
212
|
dataId: id,
|
|
219
213
|
onChange: onChangeEvent,
|
|
220
214
|
condition: condition
|
|
221
|
-
});
|
|
215
|
+
}));
|
|
222
216
|
}
|
|
223
217
|
|
|
224
218
|
return /*#__PURE__*/React.createElement(ConditionWrap, {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@import '../../assets/styles/variable.less';
|
|
2
2
|
.biz-user-condition-or {
|
|
3
|
-
|
|
3
|
+
&:not(:last-child) {
|
|
4
|
+
margin-bottom: @margin-lg;
|
|
5
|
+
}
|
|
4
6
|
&.text-mode {
|
|
5
7
|
display: flex;
|
|
6
8
|
min-width: 0;
|
|
@@ -17,10 +19,13 @@
|
|
|
17
19
|
&-content {
|
|
18
20
|
display: flex;
|
|
19
21
|
width: 100%;
|
|
20
|
-
|
|
22
|
+
|
|
21
23
|
background: #ffffff;
|
|
22
24
|
border: 1px solid @border-color-base;
|
|
23
25
|
border-radius: @border-radius-small;
|
|
26
|
+
&:not(:last-child) {
|
|
27
|
+
margin-bottom: @margin-md;
|
|
28
|
+
}
|
|
24
29
|
.biz-user-condition-conditions {
|
|
25
30
|
flex: 1;
|
|
26
31
|
padding: @padding-xs @padding-md 0 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import '../../
|
|
1
|
+
@import '../../assets/styles/inner.less';
|
|
2
2
|
.biz-user-condition-relation {
|
|
3
3
|
position: relative;
|
|
4
4
|
width: 2px;
|
|
5
|
-
margin-right:
|
|
6
|
-
background-color: @
|
|
5
|
+
margin-right: @margin-lg;
|
|
6
|
+
background-color: @border-color-split;
|
|
7
7
|
&-label {
|
|
8
8
|
position: absolute;
|
|
9
9
|
top: 50%;
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
height: 24px;
|
|
13
13
|
line-height: 24px;
|
|
14
14
|
text-align: center;
|
|
15
|
-
background-color: @
|
|
15
|
+
background-color: @border-color-split;
|
|
16
|
+
border-radius: @border-radius-small;
|
|
16
17
|
transform: translate(-50%, -50%);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { UserProp } from '../attributeSelector/types';
|
|
2
3
|
import { TagI } from './../userTagsSelector/types';
|
|
3
4
|
export declare type Unpacked<T, U extends keyof T> = Required<T> extends {
|
|
4
5
|
[key in U]: infer R;
|
|
@@ -79,6 +80,12 @@ export declare namespace BizUserConditionT {
|
|
|
79
80
|
orConditions: Conditions[number];
|
|
80
81
|
}
|
|
81
82
|
type ShowListT = ShowItemI[];
|
|
83
|
+
type GlobalContext = Pick<BizUserConditionT.PropsI, 'orConditionNum' | 'eventAttrNum' | 'openTagCondition' | 'userTagsData' | 'textMode' | 'isRealTime'> & {
|
|
84
|
+
envNameList: string[];
|
|
85
|
+
userPropsMap: {
|
|
86
|
+
[key: string]: UserProp;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
82
89
|
}
|
|
83
90
|
export declare namespace OrConditionsT {
|
|
84
91
|
interface PropI {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Badge } from 'antd';
|
|
3
3
|
import { classPrefix } from '..';
|
|
4
|
-
import theme from '../../assets/theme';
|
|
4
|
+
import theme from '../../assets/theme.js';
|
|
5
5
|
import './styles/option.less';
|
|
6
6
|
import { util } from '../../utils';
|
|
7
7
|
var GroupOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import { Checkbox } from 'antd';
|
|
3
3
|
import { classPrefix } from '..';
|
|
4
4
|
import { util } from '../../utils';
|
|
5
|
-
import theme from '../../assets/theme';
|
|
5
|
+
import theme from '../../assets/theme.js';
|
|
6
6
|
import './styles/option.less';
|
|
7
7
|
var CheckOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
8
|
var highlightText = props.highlightText,
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
min-width: 0;
|
|
18
18
|
padding: @padding-xs;
|
|
19
19
|
}
|
|
20
|
-
.rc-virtual-list-scrollbar {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
.rc-virtual-list-scrollbar-thumb {
|
|
24
|
-
|
|
25
|
-
}
|
|
20
|
+
// .rc-virtual-list-scrollbar {
|
|
21
|
+
// display: block !important;
|
|
22
|
+
// }
|
|
23
|
+
// .rc-virtual-list-scrollbar-thumb {
|
|
24
|
+
// background-color: #cacdd4 !important;
|
|
25
|
+
// }
|
|
26
26
|
}
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.15-user.
|
|
3
|
+
"version": "1.0.15-user.10",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@types/qs": "^6.9.7",
|
|
54
54
|
"@umijs/fabric": "^2.8.1",
|
|
55
55
|
"@umijs/test": "^3.0.5",
|
|
56
|
+
"@zgfe/business-lib": "^1.0.15-user.10",
|
|
56
57
|
"antd": "^4.19.2",
|
|
57
58
|
"dumi": "^1.1.0",
|
|
58
59
|
"father-build": "^1.17.2",
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
"prettier": "^2.2.1",
|
|
62
63
|
"yorkie": "^2.0.0"
|
|
63
64
|
},
|
|
64
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2ab0769309e533bb40620be5c21f6cfa682a3f6b"
|
|
65
66
|
}
|
package/es/assets/theme.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'primary-color': string;
|
|
3
|
-
'border-color-base': string;
|
|
4
|
-
'background-color-base': string;
|
|
5
|
-
'text-color': string;
|
|
6
|
-
'text-color-secondary': string;
|
|
7
|
-
'tooltip-bg': string;
|
|
8
|
-
'error-color': string;
|
|
9
|
-
'shadow-color': string;
|
|
10
|
-
'box-shadow-base': string;
|
|
11
|
-
'btn-text-hover-bg': string;
|
|
12
|
-
'warning-color': string;
|
|
13
|
-
'border-color-split': string;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|