@zgfe/business-lib 1.1.13-attr.0 → 1.1.13-attr.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/attrConditions/demo/group.js +3 -0
- package/es/attrConditions/demo/index.js +2 -0
- package/es/attrConditions/group.js +3 -1
- package/es/attrConditions/index.js +4 -3
- package/es/attrConditions/types.d.ts +3 -1
- package/es/attributeSelector/index.js +8 -10
- package/es/userCondition/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -65,6 +65,9 @@ export default (function () {
|
|
|
65
65
|
}, /*#__PURE__*/React.createElement(BizConditionGroup, {
|
|
66
66
|
ref: conditionRef,
|
|
67
67
|
value: data,
|
|
68
|
+
showCommonAttr: true,
|
|
69
|
+
eventIdList: [3767, 3768],
|
|
70
|
+
enableEventProp: true,
|
|
68
71
|
onChange: onChange,
|
|
69
72
|
onConditionsCount: setCount
|
|
70
73
|
}), /*#__PURE__*/React.createElement("br", null), count < 3 && /*#__PURE__*/React.createElement(Button, {
|
|
@@ -47,6 +47,8 @@ export default (function () {
|
|
|
47
47
|
name: "condition"
|
|
48
48
|
}, /*#__PURE__*/React.createElement(BizConditionItem, {
|
|
49
49
|
enableEventProp: true,
|
|
50
|
+
showCommonAttr: true,
|
|
51
|
+
eventIdList: [3767, 3768],
|
|
50
52
|
disableItemList: [{
|
|
51
53
|
name: 'is_anonymous',
|
|
52
54
|
propCategory: 'userProp'
|
|
@@ -31,7 +31,8 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
31
31
|
enableUserProp = props.enableUserProp,
|
|
32
32
|
enableEnvProp = props.enableEnvProp,
|
|
33
33
|
disableItemList = props.disableItemList,
|
|
34
|
-
onConditionsCount = props.onConditionsCount
|
|
34
|
+
onConditionsCount = props.onConditionsCount,
|
|
35
|
+
showCommonAttr = props.showCommonAttr;
|
|
35
36
|
|
|
36
37
|
var _useState = useState('and'),
|
|
37
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -179,6 +180,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
179
180
|
key: item.key,
|
|
180
181
|
value: item.data,
|
|
181
182
|
eventIdList: eventIdList,
|
|
183
|
+
showCommonAttr: showCommonAttr,
|
|
182
184
|
enableDelete: enableDelete,
|
|
183
185
|
enableEventProp: enableEventProp,
|
|
184
186
|
enableUserProp: enableUserProp,
|
|
@@ -14,7 +14,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
14
14
|
import BizAttributeSelector from '../attributeSelector';
|
|
15
15
|
import { PropCategory } from '../attributeSelector/types';
|
|
16
16
|
import './styles/index.less';
|
|
17
|
-
import _ from 'lodash';
|
|
18
17
|
import BizOperateList from './components/operateList';
|
|
19
18
|
import ValuesList from './components/valuesList';
|
|
20
19
|
import { Skeleton } from 'antd';
|
|
@@ -31,7 +30,8 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
31
30
|
enableEnvProp = props.enableEnvProp,
|
|
32
31
|
disableItemList = props.disableItemList,
|
|
33
32
|
border = props.border,
|
|
34
|
-
theme = props.theme
|
|
33
|
+
theme = props.theme,
|
|
34
|
+
showCommonAttr = props.showCommonAttr;
|
|
35
35
|
|
|
36
36
|
var _useState = useState(),
|
|
37
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -99,7 +99,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
99
99
|
if (props.onChange) {
|
|
100
100
|
if (!attr) return;
|
|
101
101
|
var responseData = {
|
|
102
|
-
attrId:
|
|
102
|
+
attrId: attr.id,
|
|
103
103
|
propCategory: attr.propCategory,
|
|
104
104
|
type: attr.type,
|
|
105
105
|
operator: operate,
|
|
@@ -146,6 +146,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
146
146
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
147
147
|
value: attr,
|
|
148
148
|
eventIdList: eventIdList,
|
|
149
|
+
showCommonAttr: showCommonAttr,
|
|
149
150
|
enableDelete: enableDelete,
|
|
150
151
|
enableEventProp: enableEventProp,
|
|
151
152
|
enableUserProp: enableUserProp,
|
|
@@ -11,7 +11,7 @@ interface BasicAttrTypes {
|
|
|
11
11
|
export declare namespace AttrConditionTypes {
|
|
12
12
|
interface ItemValue {
|
|
13
13
|
subtype?: number;
|
|
14
|
-
attrId?: number;
|
|
14
|
+
attrId?: number | string;
|
|
15
15
|
attrName?: string;
|
|
16
16
|
label?: string;
|
|
17
17
|
type?: PropType;
|
|
@@ -32,11 +32,13 @@ export declare namespace AttrConditionTypes {
|
|
|
32
32
|
onDelete?: (value?: ItemValue) => void;
|
|
33
33
|
border?: boolean;
|
|
34
34
|
destroyPopupOnHide?: boolean;
|
|
35
|
+
showCommonAttr?: boolean;
|
|
35
36
|
}
|
|
36
37
|
interface GroupProp extends BasicAttrTypes {
|
|
37
38
|
defaultValue?: GroupValue;
|
|
38
39
|
value?: GroupValue;
|
|
39
40
|
onlyAnd?: boolean;
|
|
41
|
+
showCommonAttr?: boolean;
|
|
40
42
|
onChange?: (value: GroupValue) => void;
|
|
41
43
|
onConditionsCount?: (value: number) => void;
|
|
42
44
|
}
|
|
@@ -89,7 +89,6 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
89
89
|
|
|
90
90
|
function getValue(param) {
|
|
91
91
|
var res = undefined;
|
|
92
|
-
var resEvent = undefined;
|
|
93
92
|
|
|
94
93
|
if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
|
|
95
94
|
eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
|
|
@@ -100,13 +99,13 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
100
99
|
var event = eventIdMap[id];
|
|
101
100
|
if (!event) return;
|
|
102
101
|
event.attrList.forEach(function (attr) {
|
|
103
|
-
if (typeof param.id == 'string' && param.id.includes(attr.id.toString())) {
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
if (typeof param.id == 'string' && param.id.split(',').length > 1 && param.id.includes(attr.id.toString())) {
|
|
103
|
+
if (res) {
|
|
104
|
+
res.id += ",".concat(attr.id);
|
|
105
|
+
res.key += ",".concat(attr.key);
|
|
106
|
+
res.eventId += ",".concat(attr.eventId);
|
|
108
107
|
} else {
|
|
109
|
-
|
|
108
|
+
res = _.cloneDeep(attr);
|
|
110
109
|
}
|
|
111
110
|
} else if (attr.id === param.id) {
|
|
112
111
|
res = attr;
|
|
@@ -119,7 +118,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
119
118
|
});
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
return
|
|
121
|
+
return res;
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
function onDelete() {
|
|
@@ -184,7 +183,6 @@ BizAttributeSelector.defaultProps = {
|
|
|
184
183
|
size: 'middle',
|
|
185
184
|
propSymbol: '*',
|
|
186
185
|
optionsHeaderTip: '带*的属性每日凌晨更新',
|
|
187
|
-
destroyPopupOnHide: false
|
|
188
|
-
showCommonAttr: false
|
|
186
|
+
destroyPopupOnHide: false
|
|
189
187
|
};
|
|
190
188
|
export default BizAttributeSelector;
|
|
@@ -63,7 +63,7 @@ export declare namespace BizUserConditionT {
|
|
|
63
63
|
}[];
|
|
64
64
|
}
|
|
65
65
|
interface AttrCondition {
|
|
66
|
-
attrId: number;
|
|
66
|
+
attrId: number | string;
|
|
67
67
|
attrName: string;
|
|
68
68
|
operator: 'is not null' | 'is null' | 'not contains' | 'contains' | 'equal' | 'not equal' | 'begin with' | 'not begin with' | 'end with' | 'not end with' | Unpacked<RunTimesI, 'operator'>;
|
|
69
69
|
params: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.13-attr.
|
|
3
|
+
"version": "1.1.13-attr.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "0b36177aafd37255bd885d2958c92bf3138afed5"
|
|
64
64
|
}
|