@zgfe/business-lib 1.1.33-visual.7 → 1.1.33-visual.8

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.
@@ -11,17 +11,7 @@ export default (function () {
11
11
  var _Form$useForm = Form.useForm(),
12
12
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
13
13
  form = _Form$useForm2[0];
14
- var _useState = useState({
15
- condition: {
16
- attrId: 30183426,
17
- propCategory: 'eventProp',
18
- type: 1,
19
- operator: 'equal',
20
- values: [],
21
- dimensionSub: 'event_attr',
22
- attrName: '公众号名称'
23
- }
24
- }),
14
+ var _useState = useState({}),
25
15
  _useState2 = _slicedToArray(_useState, 2),
26
16
  formData = _useState2[0],
27
17
  setFormData = _useState2[1];
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import { AttributeSelect } from '../attributeSelector/types';
3
2
  import './styles/index.less';
4
- import { AttrConditionTypes, OperateTypes } from './types';
3
+ import { AttrConditionTypes } from './types';
5
4
  export declare const classPrefix = "biz-condition-item";
6
- export declare function getCondition(attr: AttributeSelect.Value, operate: OperateTypes, values: string[]): AttrConditionTypes.ItemValue | undefined;
7
5
  declare const BizConditionItem: React.FC<AttrConditionTypes.ItemProp>;
8
6
  export default BizConditionItem;
@@ -12,28 +12,6 @@ import BizOperateList from './components/operateList';
12
12
  import ValuesList from './components/valuesList';
13
13
  import { Skeleton } from 'antd';
14
14
  export var classPrefix = 'biz-condition-item';
15
- export function getCondition(attr, operate, values) {
16
- if (!attr) return;
17
- var responseData = {
18
- attrId: attr.id,
19
- propCategory: attr.propCategory,
20
- type: attr.type,
21
- operator: operate,
22
- values: values || [],
23
- dimensionSub: attr.dimensionSub,
24
- label: attr.label
25
- };
26
- if (attr.propCategory === PropCategory.EventProp) {
27
- responseData.attrName = attr.label;
28
- } else {
29
- responseData.attrName = attr.name;
30
- responseData.category = attr.category;
31
- if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
32
- responseData.subtype = attr.subtype;
33
- }
34
- }
35
- return responseData;
36
- }
37
15
  var BizConditionItem = function BizConditionItem(props) {
38
16
  var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
39
17
  var defaultValue = props.defaultValue,
@@ -72,6 +50,7 @@ var BizConditionItem = function BizConditionItem(props) {
72
50
  propCategory: data.propCategory,
73
51
  type: data.type,
74
52
  key: data.attrId,
53
+ label: data.label,
75
54
  dimensionSub: data.dimensionSub || 'event_attr'
76
55
  };
77
56
  }
@@ -100,7 +79,25 @@ var BizConditionItem = function BizConditionItem(props) {
100
79
  useEffect(function () {
101
80
  if (props.onChange) {
102
81
  if (!attr) return;
103
- props.onChange(getCondition(attr, operate, values));
82
+ var responseData = {
83
+ attrId: attr.id,
84
+ propCategory: attr.propCategory,
85
+ type: attr.type,
86
+ operator: operate,
87
+ values: values || [],
88
+ dimensionSub: attr.dimensionSub,
89
+ label: attr.alias || attr.label
90
+ };
91
+ if (attr.propCategory === PropCategory.EventProp) {
92
+ responseData.attrName = attr.label;
93
+ } else {
94
+ responseData.attrName = attr.name;
95
+ responseData.category = attr.category;
96
+ if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
97
+ responseData.subtype = attr.subtype;
98
+ }
99
+ }
100
+ props.onChange(responseData);
104
101
  }
105
102
  }, [attr, operate, values]);
106
103
  var onChangeAttr = function onChangeAttr(attrData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.33-visual.7",
3
+ "version": "1.1.33-visual.8",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -59,5 +59,5 @@
59
59
  "react": "^16.12.0 || ^17.0.0",
60
60
  "yorkie": "^2.0.0"
61
61
  },
62
- "gitHead": "9f5fb07ede61f809d3aa2efcd69ccfffeeea206a"
62
+ "gitHead": "b8fa7a22e144c79fe39ef77900a0b870b431182e"
63
63
  }