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

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.
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
+ import { AttributeSelect } from '../attributeSelector/types';
2
3
  import './styles/index.less';
3
- import { AttrConditionTypes } from './types';
4
+ import { AttrConditionTypes, OperateTypes } from './types';
4
5
  export declare const classPrefix = "biz-condition-item";
6
+ export declare function getCondition(attr: AttributeSelect.Value, operate: OperateTypes, values: string[]): AttrConditionTypes.ItemValue | undefined;
5
7
  declare const BizConditionItem: React.FC<AttrConditionTypes.ItemProp>;
6
8
  export default BizConditionItem;
@@ -12,6 +12,28 @@ 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
+ }
15
37
  var BizConditionItem = function BizConditionItem(props) {
16
38
  var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
17
39
  var defaultValue = props.defaultValue,
@@ -79,25 +101,7 @@ var BizConditionItem = function BizConditionItem(props) {
79
101
  useEffect(function () {
80
102
  if (props.onChange) {
81
103
  if (!attr) return;
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
+ props.onChange(getCondition(attr, operate, values));
101
105
  }
102
106
  }, [attr, operate, values]);
103
107
  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.8",
3
+ "version": "1.1.33-visual.9",
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": "b8fa7a22e144c79fe39ef77900a0b870b431182e"
62
+ "gitHead": "9bce830783e47fec9562481bcf7d0a84c4c77a09"
63
63
  }