@zgfe/business-lib 1.0.14 → 1.0.15-user.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/styles/chunks.less +3 -4
- package/es/assets/styles/resetAntd.less +36 -1
- package/es/attrConditions/components/operateList.d.ts +1 -0
- package/es/attrConditions/components/operateList.js +2 -2
- package/es/attrConditions/components/stringList.d.ts +1 -0
- package/es/attrConditions/components/stringList.js +2 -2
- package/es/attrConditions/components/valuesList.d.ts +1 -0
- package/es/attrConditions/components/valuesList.js +5 -4
- package/es/attrConditions/demo/index.js +7 -8
- package/es/attrConditions/index.js +14 -4
- package/es/attrConditions/styles/index.less +3 -2
- package/es/attrConditions/types.d.ts +3 -0
- package/es/attrConditions/utils/operates.js +2 -2
- package/es/attributeSelector/index.js +8 -4
- package/es/attributeSelector/listPanel.js +32 -19
- package/es/attributeSelector/styles/index.less +3 -3
- package/es/attributeSelector/types.d.ts +7 -0
- package/es/attributeSelector/types.js +8 -1
- package/es/attributeSelector/util.js +3 -2
- package/es/eventSelector/demo/index.js +11 -2
- package/es/eventSelector/index.js +40 -7
- package/es/eventSelector/listPanel.js +37 -22
- package/es/eventSelector/styles/index.less +5 -3
- package/es/eventSelector/types.d.ts +7 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/mock/event.js +214 -0
- package/es/select/demo/children.d.ts +2 -0
- package/es/select/demo/children.js +81 -0
- package/es/select/demo/index.js +10 -4
- package/es/select/demo/multiple.js +10 -3
- package/es/select/handle.js +4 -2
- package/es/select/index.d.ts +2 -2
- package/es/select/index.js +14 -7
- package/es/select/overlay.js +1 -1
- package/es/select/styles/handle.less +22 -13
- package/es/select/types.d.ts +3 -1
- package/es/userCondition/conditionTypeList.js +14 -3
- package/es/userCondition/conditionWrap.js +4 -2
- package/es/userCondition/conditions/constants.d.ts +21 -0
- package/es/userCondition/conditions/constants.js +21 -0
- package/es/userCondition/conditions/eventCondition.js +13 -4
- package/es/userCondition/conditions/periodCondition.js +20 -10
- package/es/userCondition/conditions/propCondition.js +28 -8
- package/es/userCondition/conditions/runTimesCondition.js +2 -2
- package/es/userCondition/conditions/styles/eventCondition.less +7 -5
- package/es/userCondition/conditions/styles/propCondition.less +3 -3
- package/es/userCondition/conditions/styles/tagsCondition.less +18 -0
- package/es/userCondition/conditions/styles/textDesc.less +17 -0
- package/es/userCondition/conditions/tagsCondition.d.ts +9 -0
- package/es/userCondition/conditions/tagsCondition.js +107 -0
- package/es/userCondition/conditions/textDesc.d.ts +9 -0
- package/es/userCondition/conditions/textDesc.js +197 -0
- package/es/userCondition/demo/index.js +200 -31
- package/es/userCondition/index.d.ts +1 -1
- package/es/userCondition/index.js +31 -10
- package/es/userCondition/orConditions.js +64 -17
- package/es/userCondition/relationLabel.js +6 -1
- package/es/userCondition/styles/conditionTypeList.less +1 -1
- package/es/userCondition/styles/conditionWrap.less +3 -0
- package/es/userCondition/styles/index.less +19 -0
- package/es/userCondition/styles/orConditions.less +13 -0
- package/es/userCondition/types.d.ts +21 -2
- package/es/userCondition/util.d.ts +5 -1
- package/es/userCondition/util.js +42 -0
- package/es/userTagsSelector/cascaderOverlay.d.ts +5 -0
- package/es/userTagsSelector/cascaderOverlay.js +114 -0
- package/es/userTagsSelector/components/search/index.d.ts +8 -0
- package/es/userTagsSelector/components/search/index.js +16 -0
- package/es/userTagsSelector/components/search/index.less +6 -0
- package/es/userTagsSelector/context.d.ts +3 -0
- package/es/userTagsSelector/context.js +2 -0
- package/es/userTagsSelector/demo/index.d.ts +2 -0
- package/es/userTagsSelector/demo/index.js +48 -0
- package/es/userTagsSelector/groups/groupOption.d.ts +5 -0
- package/es/userTagsSelector/groups/groupOption.js +42 -0
- package/es/userTagsSelector/groups/index.d.ts +4 -0
- package/es/userTagsSelector/groups/index.js +86 -0
- package/es/userTagsSelector/groups/styles/index.less +0 -0
- package/es/userTagsSelector/groups/styles/option.less +50 -0
- package/es/userTagsSelector/index.d.ts +6 -0
- package/es/userTagsSelector/index.js +110 -0
- package/es/userTagsSelector/multipleCheckPanel/checkOption.d.ts +5 -0
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +45 -0
- package/es/userTagsSelector/multipleCheckPanel/index.d.ts +4 -0
- package/es/userTagsSelector/multipleCheckPanel/index.js +80 -0
- package/es/userTagsSelector/multipleCheckPanel/styles/index.less +0 -0
- package/es/userTagsSelector/multipleCheckPanel/styles/option.less +39 -0
- package/es/userTagsSelector/styles/cascaderOverlay.less +27 -0
- package/es/userTagsSelector/styles/index.less +10 -0
- package/es/userTagsSelector/types.d.ts +67 -0
- package/es/userTagsSelector/types.js +1 -0
- package/es/userTagsSelector/util.d.ts +4 -0
- package/es/userTagsSelector/util.js +38 -0
- package/es/utils/type.d.ts +2 -2
- package/package.json +4 -2
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
height: auto;
|
|
46
46
|
min-height: @height-lg;
|
|
47
47
|
overflow: visible;
|
|
48
|
-
|
|
48
|
+
line-height: 1;
|
|
49
49
|
&.sm {
|
|
50
50
|
height: auto;
|
|
51
51
|
min-height: @height-sm;
|
|
@@ -87,19 +87,28 @@
|
|
|
87
87
|
font-size: @font-size-lg;
|
|
88
88
|
transform: translateY(-50%);
|
|
89
89
|
}
|
|
90
|
+
&-input {
|
|
91
|
+
#biz-select-handle-tag {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
margin: 2px 4px 2px 0;
|
|
95
|
+
padding-top: 1px;
|
|
96
|
+
padding-bottom: 1px;
|
|
97
|
+
background: none;
|
|
98
|
+
border-color: #cacdd4;
|
|
99
|
+
border-radius: @border-radius-small;
|
|
100
|
+
&-label {
|
|
101
|
+
min-width: 0;
|
|
102
|
+
max-width: 100px;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
}
|
|
106
|
+
&:hover {
|
|
107
|
+
.__default-hover();
|
|
90
108
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
margin: 2px 4px 2px 0;
|
|
95
|
-
background: none;
|
|
96
|
-
border-color: #cacdd4;
|
|
97
|
-
|
|
98
|
-
&:hover {
|
|
99
|
-
.__default-hover();
|
|
100
|
-
|
|
101
|
-
.anticon {
|
|
102
|
-
color: @primary-color;
|
|
109
|
+
.anticon {
|
|
110
|
+
color: @primary-color;
|
|
111
|
+
}
|
|
103
112
|
}
|
|
104
113
|
}
|
|
105
114
|
}
|
package/es/select/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare namespace BizSelectTypes {
|
|
|
6
6
|
}
|
|
7
7
|
interface Option {
|
|
8
8
|
icon?: ReactNode;
|
|
9
|
-
[otherProp: string]: any;
|
|
9
|
+
[otherProp: string | symbol | number]: any;
|
|
10
10
|
}
|
|
11
11
|
interface Props {
|
|
12
12
|
disable?: boolean;
|
|
@@ -34,6 +34,8 @@ export declare namespace BizSelectTypes {
|
|
|
34
34
|
notFound?: string | ReactNode;
|
|
35
35
|
loading?: boolean;
|
|
36
36
|
onChange?: (val: Option) => void;
|
|
37
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
38
|
+
destroyPopupOnHide?: boolean;
|
|
37
39
|
}
|
|
38
40
|
interface OverlayProps {
|
|
39
41
|
option?: Option;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { Space } from 'antd';
|
|
3
3
|
import { PlusOutlined } from '@ant-design/icons';
|
|
4
4
|
import './styles/conditionTypeList.less';
|
|
5
|
+
import { BizUserConditionContext } from '.';
|
|
5
6
|
|
|
6
7
|
var ConditionTypeList = function ConditionTypeList(props) {
|
|
7
8
|
var onAdd = props.onAdd,
|
|
8
9
|
label = props.label,
|
|
9
10
|
show = props.show;
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
13
|
+
textMode = _useContext.textMode,
|
|
14
|
+
openTagCondition = _useContext.openTagCondition;
|
|
15
|
+
|
|
16
|
+
if (!show || textMode) return null;
|
|
11
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
18
|
className: "biz-user-condition-type-list"
|
|
13
19
|
}, label ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -34,7 +40,12 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
34
40
|
onClick: function onClick() {
|
|
35
41
|
return onAdd('prop');
|
|
36
42
|
}
|
|
37
|
-
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3")))
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition ? /*#__PURE__*/React.createElement("li", {
|
|
44
|
+
className: "condition-type",
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
return onAdd('tag');
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u6807\u7B7E"))) : null));
|
|
38
49
|
};
|
|
39
50
|
|
|
40
51
|
ConditionTypeList.defaultProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import IconFont from '../icon/iconFont';
|
|
3
3
|
import './styles/conditionWrap.less';
|
|
4
4
|
|
|
5
5
|
var ConditionWrap = function ConditionWrap(props) {
|
|
@@ -12,7 +12,9 @@ var ConditionWrap = function ConditionWrap(props) {
|
|
|
12
12
|
onClick: function onClick() {
|
|
13
13
|
return props.onDelte();
|
|
14
14
|
}
|
|
15
|
-
}, /*#__PURE__*/React.createElement(
|
|
15
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
16
|
+
type: "qingchu"
|
|
17
|
+
})));
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export default ConditionWrap;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const operatorMap: {
|
|
2
|
+
relative: string;
|
|
3
|
+
absolute: string;
|
|
4
|
+
unlimited_time: string;
|
|
5
|
+
join_time: string;
|
|
6
|
+
'is not null': string;
|
|
7
|
+
'is null': string;
|
|
8
|
+
'not contains': string;
|
|
9
|
+
contains: string;
|
|
10
|
+
equal: string;
|
|
11
|
+
'not equal': string;
|
|
12
|
+
'begin with': string;
|
|
13
|
+
'not begin with': string;
|
|
14
|
+
'end with': string;
|
|
15
|
+
'not end with': string;
|
|
16
|
+
'=': string;
|
|
17
|
+
'<': string;
|
|
18
|
+
'>': string;
|
|
19
|
+
'>=': string;
|
|
20
|
+
'<=': string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var operatorMap = {
|
|
2
|
+
relative: '最近',
|
|
3
|
+
absolute: '固定时段',
|
|
4
|
+
unlimited_time: '任意时间',
|
|
5
|
+
join_time: '新增后',
|
|
6
|
+
'is not null': '不是空值',
|
|
7
|
+
'is null': '是空值',
|
|
8
|
+
'not contains': '不包含',
|
|
9
|
+
contains: '包含',
|
|
10
|
+
equal: '是',
|
|
11
|
+
'not equal': '不是',
|
|
12
|
+
'begin with': '开头是',
|
|
13
|
+
'not begin with': '开头不是',
|
|
14
|
+
'end with': '结尾是',
|
|
15
|
+
'not end with': '结尾不是',
|
|
16
|
+
'=': '',
|
|
17
|
+
'<': '',
|
|
18
|
+
'>': '',
|
|
19
|
+
'>=': '',
|
|
20
|
+
'<=': ''
|
|
21
|
+
};
|
|
@@ -4,16 +4,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
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
6
|
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { useContext } from 'react';
|
|
8
8
|
import { RightOutlined } from '@ant-design/icons';
|
|
9
9
|
import BizEventSelector from '../../eventSelector';
|
|
10
10
|
import RunTimesCondition from './runTimesCondition';
|
|
11
11
|
import PeriodCondition from './periodCondition';
|
|
12
12
|
import PropCondition from './propCondition';
|
|
13
13
|
import './styles/eventCondition.less';
|
|
14
|
-
import { classPrefix } from '..';
|
|
14
|
+
import { BizUserConditionContext, classPrefix } from '..';
|
|
15
15
|
|
|
16
16
|
var EventCondition = function EventCondition(props) {
|
|
17
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
18
|
+
isRealTime = _useContext.isRealTime;
|
|
19
|
+
|
|
17
20
|
var condition = props.condition,
|
|
18
21
|
dataId = props.dataId;
|
|
19
22
|
|
|
@@ -70,7 +73,12 @@ var EventCondition = function EventCondition(props) {
|
|
|
70
73
|
id: condition.eventId
|
|
71
74
|
}
|
|
72
75
|
},
|
|
73
|
-
onChange: onEventChange
|
|
76
|
+
onChange: onEventChange,
|
|
77
|
+
border: false,
|
|
78
|
+
theme: "normal",
|
|
79
|
+
placeholder: "\u9009\u62E9\u4E00\u4E2A\u4E8B\u4EF6",
|
|
80
|
+
destroyPopupOnHide: true,
|
|
81
|
+
defaultSelectAble: false
|
|
74
82
|
})), /*#__PURE__*/React.createElement("div", {
|
|
75
83
|
className: "".concat(classPrefix, "-event-condition-expand-attr"),
|
|
76
84
|
onClick: onAddAttr
|
|
@@ -97,7 +105,8 @@ var EventCondition = function EventCondition(props) {
|
|
|
97
105
|
dataId: dataId,
|
|
98
106
|
runPeriod: condition.runPeriod,
|
|
99
107
|
onChange: onPeriodChange,
|
|
100
|
-
isEvent: true
|
|
108
|
+
isEvent: true,
|
|
109
|
+
isRealTime: isRealTime
|
|
101
110
|
})))));
|
|
102
111
|
};
|
|
103
112
|
|
|
@@ -4,19 +4,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
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
6
|
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
8
|
import BizSelect from '../../select';
|
|
9
9
|
import { Input, DatePicker, Checkbox } from 'antd';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import './styles/periodCondition.less';
|
|
12
12
|
import { classPrefix } from '..';
|
|
13
|
+
import { operatorMap } from './constants';
|
|
13
14
|
var RangePicker = DatePicker.RangePicker;
|
|
14
|
-
var operatorMap = {
|
|
15
|
-
relative: '最近',
|
|
16
|
-
absolute: '固定时段',
|
|
17
|
-
unlimited_time: '任意时间',
|
|
18
|
-
join_time: '新增后'
|
|
19
|
-
};
|
|
20
15
|
|
|
21
16
|
var PeriodCondition = function PeriodCondition(props) {
|
|
22
17
|
var dataId = props.dataId,
|
|
@@ -36,11 +31,21 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
36
31
|
text: '任意时间',
|
|
37
32
|
value: 'unlimited_time'
|
|
38
33
|
}, {
|
|
39
|
-
text: '
|
|
34
|
+
text: '新增后*',
|
|
40
35
|
value: 'join_time'
|
|
41
36
|
}]);
|
|
42
37
|
}
|
|
43
38
|
|
|
39
|
+
var unit = useMemo(function () {
|
|
40
|
+
if (runPeriod.operator === 'absolute' || runPeriod.operator === 'unlimited_time') {
|
|
41
|
+
return '';
|
|
42
|
+
} else if (runPeriod.operator === 'relative') {
|
|
43
|
+
return '天';
|
|
44
|
+
} else if (runPeriod.operator === 'join_time') {
|
|
45
|
+
return '天内';
|
|
46
|
+
}
|
|
47
|
+
}, [runPeriod.operator]);
|
|
48
|
+
|
|
44
49
|
function onChange(data) {
|
|
45
50
|
props.onChange(dataId, data);
|
|
46
51
|
}
|
|
@@ -127,7 +132,12 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
127
132
|
}, label) : null, /*#__PURE__*/React.createElement("div", {
|
|
128
133
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
129
134
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
130
|
-
|
|
135
|
+
dropdownExtra: isEvent ? /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
style: {
|
|
137
|
+
lineHeight: '29px'
|
|
138
|
+
}
|
|
139
|
+
}, "*\u7528\u6237\u65B0\u589E\u6570\u636E\u4E3A\u6BCF\u65E5\u51CC\u6668\u751F\u6210") : null,
|
|
140
|
+
overlayWidth: isEvent ? 210 : 114,
|
|
131
141
|
options: options,
|
|
132
142
|
labelField: "text",
|
|
133
143
|
keyField: "value",
|
|
@@ -140,7 +150,7 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
140
150
|
className: "".concat(classPrefix, "-period-condition-values")
|
|
141
151
|
}, renderValues()), /*#__PURE__*/React.createElement("div", {
|
|
142
152
|
className: "".concat(classPrefix, "-period-condition-unit")
|
|
143
|
-
},
|
|
153
|
+
}, unit), props.isRealTime && runPeriod.operator === 'relative' ? /*#__PURE__*/React.createElement("div", {
|
|
144
154
|
className: "".concat(classPrefix, "-period-condition-today")
|
|
145
155
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
146
156
|
checked: runPeriod.values[1] === '1',
|
|
@@ -24,13 +24,15 @@ 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, useState } from 'react';
|
|
27
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
28
28
|
import { PlusOutlined } from '@ant-design/icons';
|
|
29
29
|
import BizConditionItem from '../../attrConditions';
|
|
30
30
|
import './styles/propCondition.less';
|
|
31
31
|
import { useContext } from 'react';
|
|
32
32
|
import { BizUserConditionContext, classPrefix } from '..';
|
|
33
33
|
import { transformNumberOperate } from '../util';
|
|
34
|
+
import { PropType } from '../../attributeSelector/types';
|
|
35
|
+
import BizGlobalDataContext from '../../context';
|
|
34
36
|
var numAttrTypeMap = {
|
|
35
37
|
1: 'cont-string',
|
|
36
38
|
2: 'cont-num',
|
|
@@ -43,19 +45,28 @@ var attrNumTypeMap = {
|
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
var PropCondition = function PropCondition(props) {
|
|
46
|
-
var _useContext = useContext(
|
|
47
|
-
|
|
48
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
49
|
+
eventEnvList = _useContext.eventEnvList;
|
|
50
|
+
|
|
51
|
+
var _useContext2 = useContext(BizUserConditionContext),
|
|
52
|
+
eventAttrNum = _useContext2.eventAttrNum;
|
|
48
53
|
|
|
49
54
|
var isEvent = props.isEvent,
|
|
50
55
|
label = props.label,
|
|
51
56
|
attrs = props.attrs,
|
|
52
|
-
dataId = props.dataId
|
|
57
|
+
dataId = props.dataId,
|
|
58
|
+
eventId = props.eventId;
|
|
53
59
|
|
|
54
60
|
var _useState = useState([]),
|
|
55
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
56
62
|
showList = _useState2[0],
|
|
57
63
|
setShowList = _useState2[1];
|
|
58
64
|
|
|
65
|
+
var envNames = useMemo(function () {
|
|
66
|
+
return eventEnvList ? eventEnvList.map(function (env) {
|
|
67
|
+
return env.name;
|
|
68
|
+
}) : [];
|
|
69
|
+
}, [eventEnvList]);
|
|
59
70
|
useEffect(function () {
|
|
60
71
|
buildDefault();
|
|
61
72
|
}, []);
|
|
@@ -97,8 +108,8 @@ var PropCondition = function PropCondition(props) {
|
|
|
97
108
|
var newAttr = {
|
|
98
109
|
attrName: attrName,
|
|
99
110
|
attrId: attrId,
|
|
100
|
-
category: category,
|
|
101
|
-
operator: transformNumberOperate(operator),
|
|
111
|
+
category: category || 'custom',
|
|
112
|
+
operator: type === PropType.NUMBER ? transformNumberOperate(operator) : operator,
|
|
102
113
|
params: values,
|
|
103
114
|
attrType: numAttrTypeMap[type]
|
|
104
115
|
};
|
|
@@ -130,7 +141,9 @@ var PropCondition = function PropCondition(props) {
|
|
|
130
141
|
|
|
131
142
|
function getPropCategory(attrName) {
|
|
132
143
|
if (!isEvent) return 'userProp';
|
|
133
|
-
|
|
144
|
+
if (attrName === undefined) return 'eventProp';
|
|
145
|
+
if (envNames.includes(attrName)) return 'envProp';
|
|
146
|
+
return 'eventProp';
|
|
134
147
|
}
|
|
135
148
|
|
|
136
149
|
function renderAttr(item, i) {
|
|
@@ -156,6 +169,10 @@ var PropCondition = function PropCondition(props) {
|
|
|
156
169
|
attrId && (props.defaultValue.attrId = attrId);
|
|
157
170
|
}
|
|
158
171
|
|
|
172
|
+
if (isEvent) {
|
|
173
|
+
props.eventIdList = [eventId];
|
|
174
|
+
}
|
|
175
|
+
|
|
159
176
|
return /*#__PURE__*/React.createElement("div", {
|
|
160
177
|
className: "".concat(classPrefix, "-prop-condition-attr"),
|
|
161
178
|
key: id
|
|
@@ -171,7 +188,10 @@ var PropCondition = function PropCondition(props) {
|
|
|
171
188
|
onDelete: function onDelete() {
|
|
172
189
|
return onRemoveAttr(i);
|
|
173
190
|
},
|
|
174
|
-
enableDelete: isEvent
|
|
191
|
+
enableDelete: isEvent,
|
|
192
|
+
border: false,
|
|
193
|
+
destroyPopupOnHide: true,
|
|
194
|
+
theme: "normal"
|
|
175
195
|
}, props))));
|
|
176
196
|
}
|
|
177
197
|
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
.biz-event-select-handle {
|
|
13
13
|
border-top-right-radius: 0;
|
|
14
14
|
border-bottom-right-radius: 0;
|
|
15
|
+
.biz-select-handle-input {
|
|
16
|
+
background-color: @background-color-gray;
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
&-times-period-wrap {
|
|
@@ -22,13 +25,11 @@
|
|
|
22
25
|
align-items: center;
|
|
23
26
|
justify-content: center;
|
|
24
27
|
width: 30px;
|
|
25
|
-
height:
|
|
28
|
+
height: 40px;
|
|
26
29
|
margin-right: @margin-xs;
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
margin-left: @border-radius-small;
|
|
31
|
+
background-color: @background-color-gray;
|
|
29
32
|
border-radius: @border-radius-small;
|
|
30
|
-
border-top-left-radius: 0;
|
|
31
|
-
border-bottom-left-radius: 0;
|
|
32
33
|
cursor: pointer;
|
|
33
34
|
}
|
|
34
35
|
&-attrs {
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
&-label {
|
|
41
42
|
display: flex;
|
|
42
43
|
align-items: center;
|
|
44
|
+
min-width: 28px;
|
|
43
45
|
height: 42px;
|
|
44
46
|
margin-right: @margin-xs;
|
|
45
47
|
}
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
justify-content: center;
|
|
29
|
-
width:
|
|
30
|
-
height:
|
|
31
|
-
|
|
29
|
+
width: 40px;
|
|
30
|
+
height: 40px;
|
|
31
|
+
background-color: @background-color-gray;
|
|
32
32
|
border-radius: @border-radius-sx;
|
|
33
33
|
cursor: pointer;
|
|
34
34
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@import '../../../assets/styles/variable.less';
|
|
2
|
+
.biz-user-condition-tags-condition {
|
|
3
|
+
display: flex;
|
|
4
|
+
&-label,
|
|
5
|
+
&-value {
|
|
6
|
+
margin-right: @margin-xs;
|
|
7
|
+
}
|
|
8
|
+
&-label {
|
|
9
|
+
line-height: 40px;
|
|
10
|
+
}
|
|
11
|
+
&-value {
|
|
12
|
+
flex: 1;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
}
|
|
15
|
+
&-operator {
|
|
16
|
+
width: 96px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import '../../../assets/styles/variable.less';
|
|
2
|
+
.biz-user-condition {
|
|
3
|
+
&-text-desc {
|
|
4
|
+
color: @text-color-secondary;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
&-or {
|
|
7
|
+
margin: 0 @margin-xs;
|
|
8
|
+
}
|
|
9
|
+
&-label {
|
|
10
|
+
}
|
|
11
|
+
&-operator {
|
|
12
|
+
}
|
|
13
|
+
&-value {
|
|
14
|
+
color: @text-color;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AllConditionBasePropsI, BizUserConditionT } from '../types';
|
|
3
|
+
import './styles/tagsCondition.less';
|
|
4
|
+
declare type Labels = BizUserConditionT.Labels;
|
|
5
|
+
export interface TagsConditionPropI extends AllConditionBasePropsI<Labels> {
|
|
6
|
+
labels: Labels;
|
|
7
|
+
}
|
|
8
|
+
declare const TagsCondition: React.FC<TagsConditionPropI>;
|
|
9
|
+
export default TagsCondition;
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
9
|
+
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."); }
|
|
10
|
+
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
+
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
19
|
+
import React, { useContext, useState } from 'react';
|
|
20
|
+
import { BizUserConditionContext, classPrefix } from '..';
|
|
21
|
+
import BizSelect from '../../select';
|
|
22
|
+
import { operatorMap } from './constants';
|
|
23
|
+
import BizUserTagsSelect from '../../userTagsSelector';
|
|
24
|
+
import './styles/tagsCondition.less';
|
|
25
|
+
import { findTagFactory } from '../util';
|
|
26
|
+
var options = [{
|
|
27
|
+
value: 'equal',
|
|
28
|
+
text: '是'
|
|
29
|
+
}, {
|
|
30
|
+
value: 'not equal',
|
|
31
|
+
text: '不是'
|
|
32
|
+
}];
|
|
33
|
+
|
|
34
|
+
var TagsCondition = function TagsCondition(props) {
|
|
35
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
36
|
+
userTagsData = _useContext.userTagsData;
|
|
37
|
+
|
|
38
|
+
var labels = props.labels,
|
|
39
|
+
dataId = props.dataId,
|
|
40
|
+
onChange = props.onChange;
|
|
41
|
+
|
|
42
|
+
var _useState = useState(function () {
|
|
43
|
+
return buildDefaultValues();
|
|
44
|
+
}),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
46
|
+
defaultValues = _useState2[0];
|
|
47
|
+
|
|
48
|
+
function onOperatorChange(operator) {
|
|
49
|
+
onChange(dataId, _objectSpread(_objectSpread({}, labels), {}, {
|
|
50
|
+
operator: operator.value
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function onTagsChange(data) {
|
|
55
|
+
var values = data.map(function (item) {
|
|
56
|
+
return item[1].labelId;
|
|
57
|
+
});
|
|
58
|
+
onChange(dataId, _objectSpread(_objectSpread({}, labels), {}, {
|
|
59
|
+
values: values
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function buildDefaultValues() {
|
|
64
|
+
var values = [];
|
|
65
|
+
var findTag = findTagFactory(userTagsData);
|
|
66
|
+
labels.values.forEach(function (id) {
|
|
67
|
+
var tag = findTag(id);
|
|
68
|
+
|
|
69
|
+
if (tag) {
|
|
70
|
+
values.push([tag.labelGroup, tag]);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return values;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "".concat(classPrefix, "-tags-condition")
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "".concat(classPrefix, "-tags-condition-label")
|
|
80
|
+
}, "\u7528\u6237\u6807\u7B7E"), /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: "".concat(classPrefix, "-tags-condition-value")
|
|
82
|
+
}, /*#__PURE__*/React.createElement(BizUserTagsSelect, {
|
|
83
|
+
defaultValue: defaultValues,
|
|
84
|
+
data: userTagsData,
|
|
85
|
+
childFields: ['children'],
|
|
86
|
+
keyFields: ['labelGroup', 'labelId'],
|
|
87
|
+
labelFields: ['labelGroup', 'labelName'],
|
|
88
|
+
valueFields: ['labelGroup', 'labelId'],
|
|
89
|
+
onChange: onTagsChange,
|
|
90
|
+
destroyPopupOnHide: true
|
|
91
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "".concat(classPrefix, "-tags-condition-operator")
|
|
93
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
94
|
+
options: options,
|
|
95
|
+
labelField: "text",
|
|
96
|
+
keyField: "value",
|
|
97
|
+
value: {
|
|
98
|
+
value: labels.operator,
|
|
99
|
+
text: operatorMap[labels.operator]
|
|
100
|
+
},
|
|
101
|
+
onChange: onOperatorChange
|
|
102
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
className: "".concat(classPrefix, "-tags-condition-unit")
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export default TagsCondition;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BizUserConditionT } from '../types';
|
|
3
|
+
import './styles/textDesc.less';
|
|
4
|
+
export interface TextProps {
|
|
5
|
+
condition: BizUserConditionT.ActiveCondition | BizUserConditionT.AddCondition | BizUserConditionT.PropCondition | BizUserConditionT.EventCondition | BizUserConditionT.TagsCondition;
|
|
6
|
+
showOrDesc: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const Text: React.FC<TextProps>;
|
|
9
|
+
export default Text;
|