@zgfe/business-lib 1.0.1-beta.0 → 1.0.5
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/analysisLayout/index.js +11 -9
- package/es/attrConditions/components/stringList.js +1 -0
- package/es/attrConditions/components/valuesList.js +4 -2
- package/es/attrConditions/group.js +1 -2
- package/es/attributeSelector/index.js +6 -4
- package/es/attributeSelector/listPanel.js +11 -9
- package/es/chart/index.js +12 -10
- package/es/components/iconFont.d.ts +4 -1
- package/es/components/iconFont.js +8 -4
- package/es/dialog/components/itemNode.d.ts +1 -0
- package/es/dialog/components/itemNode.js +15 -13
- package/es/dialog/components/list.js +7 -5
- package/es/dialog/components/selectToInput.js +8 -6
- package/es/dialog/index.js +14 -11
- package/es/dialog/types.d.ts +1 -1
- package/es/eventSelector/listPanel.js +4 -2
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/searchInput/demo/index.d.ts +2 -0
- package/es/searchInput/demo/index.js +5 -0
- package/es/select/handle.d.ts +2 -2
- package/es/select/handle.js +8 -8
- package/es/select/index.js +6 -4
- package/es/table/index.js +12 -10
- package/es/targetConditionGroup/index.js +5 -2
- package/es/targetSelector/index.js +6 -4
- package/es/userCondition/conditionTypeList.d.ts +10 -0
- package/es/userCondition/conditionTypeList.js +43 -0
- package/es/userCondition/conditionWrap.d.ts +7 -0
- package/es/userCondition/conditionWrap.js +18 -0
- package/es/userCondition/conditions/eventCondition.d.ts +8 -0
- package/es/userCondition/conditions/eventCondition.js +104 -0
- package/es/userCondition/conditions/periodCondition.d.ts +11 -0
- package/es/userCondition/conditions/periodCondition.js +156 -0
- package/es/userCondition/conditions/propCondition.d.ts +5 -0
- package/es/userCondition/conditions/propCondition.js +198 -0
- package/es/userCondition/conditions/runTimesCondition.d.ts +9 -0
- package/es/userCondition/conditions/runTimesCondition.js +78 -0
- package/es/userCondition/conditions/styles/eventCondition.less +49 -0
- package/es/userCondition/conditions/styles/periodCondition.less +14 -0
- package/es/userCondition/conditions/styles/propCondition.less +36 -0
- package/es/userCondition/conditions/styles/runTimesCondition.less +16 -0
- package/es/userCondition/demo/index.d.ts +2 -0
- package/es/userCondition/demo/index.js +73 -0
- package/es/userCondition/index.d.ts +7 -0
- package/es/userCondition/index.js +143 -0
- package/es/userCondition/orConditions.d.ts +5 -0
- package/es/userCondition/orConditions.js +202 -0
- package/es/userCondition/relationLabel.d.ts +6 -0
- package/es/userCondition/relationLabel.js +12 -0
- package/es/userCondition/styles/conditionTypeList.less +31 -0
- package/es/userCondition/styles/conditionWrap.less +14 -0
- package/es/userCondition/styles/index.less +13 -0
- package/es/userCondition/styles/orConditions.less +16 -0
- package/es/userCondition/styles/relationLabel.less +18 -0
- package/es/userCondition/types.d.ts +96 -0
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.d.ts +3 -0
- package/es/userCondition/util.js +73 -0
- package/es/userGroup/index.js +6 -4
- package/package.json +2 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type Unpacked<T, U extends keyof T> = Required<T> extends {
|
|
3
|
+
[key in U]: infer R;
|
|
4
|
+
} ? R : never;
|
|
5
|
+
export interface RunPeriodI {
|
|
6
|
+
operator: 'relative' | 'unlimited_time' | 'join_time' | 'absolute';
|
|
7
|
+
values: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface RunTimesI {
|
|
10
|
+
operator: '>' | '=' | '<' | '>=' | '<=' | '>=' | 'not equal';
|
|
11
|
+
values: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface AllConditionBasePropsI<T> {
|
|
14
|
+
dataId: number;
|
|
15
|
+
onChange: (dataId: number, newData: T) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace BizUserConditionT {
|
|
18
|
+
type ConditionType = 'add' | 'active' | 'event' | 'prop';
|
|
19
|
+
interface PropsI {
|
|
20
|
+
defaultValue: BizUserConditionT.Conditions;
|
|
21
|
+
onChange: (value: any[]) => void;
|
|
22
|
+
andConditionNum?: number;
|
|
23
|
+
orConditionNum?: number;
|
|
24
|
+
eventAttrNum?: number;
|
|
25
|
+
}
|
|
26
|
+
interface AttrCondition {
|
|
27
|
+
attrId: number;
|
|
28
|
+
attrName: string;
|
|
29
|
+
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'>;
|
|
30
|
+
params: string[];
|
|
31
|
+
attrType: 'cont-string' | 'cont-num' | 'cont-date';
|
|
32
|
+
category: 'fixed' | 'custom';
|
|
33
|
+
propCategory?: string;
|
|
34
|
+
}
|
|
35
|
+
interface EventCondition {
|
|
36
|
+
attrs: AttrCondition[];
|
|
37
|
+
runTimes: RunTimesI;
|
|
38
|
+
runPeriod: RunPeriodI;
|
|
39
|
+
eventId: number;
|
|
40
|
+
}
|
|
41
|
+
interface AddCondition {
|
|
42
|
+
eventId: '-3';
|
|
43
|
+
attrs: [];
|
|
44
|
+
runPeriod: RunPeriodI;
|
|
45
|
+
runTimes: RunTimesI;
|
|
46
|
+
}
|
|
47
|
+
interface ActiveCondition {
|
|
48
|
+
eventId: '-4';
|
|
49
|
+
attrs: [];
|
|
50
|
+
runPeriod: RunPeriodI;
|
|
51
|
+
runTimes: RunTimesI;
|
|
52
|
+
}
|
|
53
|
+
interface PropCondition {
|
|
54
|
+
attrs: AttrCondition[];
|
|
55
|
+
eventId: undefined;
|
|
56
|
+
}
|
|
57
|
+
type Condition = EventCondition | AddCondition | ActiveCondition | PropCondition;
|
|
58
|
+
type Conditions = Condition[][];
|
|
59
|
+
interface ShowItemI {
|
|
60
|
+
id: number;
|
|
61
|
+
orConditions: Conditions[number];
|
|
62
|
+
}
|
|
63
|
+
type ShowListT = ShowItemI[];
|
|
64
|
+
}
|
|
65
|
+
export declare namespace OrConditionsT {
|
|
66
|
+
interface PropI {
|
|
67
|
+
onChange: (value: any[]) => void;
|
|
68
|
+
orConditions: BizUserConditionT.Conditions[number];
|
|
69
|
+
}
|
|
70
|
+
interface ShowItemI {
|
|
71
|
+
id: number;
|
|
72
|
+
condition: BizUserConditionT.Conditions[number][number];
|
|
73
|
+
}
|
|
74
|
+
type ShowListT = ShowItemI[];
|
|
75
|
+
}
|
|
76
|
+
export declare namespace RunTimesConditionTypes {
|
|
77
|
+
type Options = {
|
|
78
|
+
text: string;
|
|
79
|
+
value: RunTimesI extends {
|
|
80
|
+
operator: infer U;
|
|
81
|
+
} ? U : never;
|
|
82
|
+
}[];
|
|
83
|
+
}
|
|
84
|
+
export declare namespace PropConditionType {
|
|
85
|
+
type ShowListI = {
|
|
86
|
+
attr: BizUserConditionT.AttrCondition;
|
|
87
|
+
id: number;
|
|
88
|
+
default?: BizUserConditionT.AttrCondition;
|
|
89
|
+
}[];
|
|
90
|
+
interface PropsI extends AllConditionBasePropsI<any> {
|
|
91
|
+
isEvent?: boolean;
|
|
92
|
+
label?: string | React.ReactDOM;
|
|
93
|
+
eventId?: number;
|
|
94
|
+
attrs: BizUserConditionT.AttrCondition[];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BizUserConditionT } from './types';
|
|
2
|
+
export declare function buildCondition(type: BizUserConditionT.ConditionType): BizUserConditionT.EventCondition | BizUserConditionT.AddCondition | BizUserConditionT.ActiveCondition | BizUserConditionT.PropCondition;
|
|
3
|
+
export declare function transformNumberOperate(key: string, output?: boolean): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export function buildCondition(type) {
|
|
2
|
+
switch (type) {
|
|
3
|
+
case 'add':
|
|
4
|
+
var condition = {
|
|
5
|
+
eventId: '-3',
|
|
6
|
+
runPeriod: {
|
|
7
|
+
operator: 'relative',
|
|
8
|
+
values: ['30', '0']
|
|
9
|
+
},
|
|
10
|
+
runTimes: {
|
|
11
|
+
operator: '>=',
|
|
12
|
+
values: ['1']
|
|
13
|
+
},
|
|
14
|
+
attrs: []
|
|
15
|
+
};
|
|
16
|
+
return condition;
|
|
17
|
+
|
|
18
|
+
case 'active':
|
|
19
|
+
return {
|
|
20
|
+
eventId: '-4',
|
|
21
|
+
runPeriod: {
|
|
22
|
+
operator: 'relative',
|
|
23
|
+
values: ['30', '0']
|
|
24
|
+
},
|
|
25
|
+
runTimes: {
|
|
26
|
+
operator: '>=',
|
|
27
|
+
values: ['1']
|
|
28
|
+
},
|
|
29
|
+
attrs: []
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
case 'event':
|
|
33
|
+
return {
|
|
34
|
+
eventId: 0,
|
|
35
|
+
runTimes: {
|
|
36
|
+
operator: '>=',
|
|
37
|
+
values: ['1']
|
|
38
|
+
},
|
|
39
|
+
attrs: [],
|
|
40
|
+
runPeriod: {
|
|
41
|
+
operator: 'relative',
|
|
42
|
+
values: ['30', '0']
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
case 'prop':
|
|
47
|
+
return {
|
|
48
|
+
eventId: undefined,
|
|
49
|
+
attrs: [{
|
|
50
|
+
attrId: 0
|
|
51
|
+
}]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function transformNumberOperate(key) {
|
|
56
|
+
var output = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
57
|
+
var outputMap = {
|
|
58
|
+
gt: '>',
|
|
59
|
+
equal: '=',
|
|
60
|
+
lt: '<',
|
|
61
|
+
ge: '>=',
|
|
62
|
+
le: '<='
|
|
63
|
+
};
|
|
64
|
+
var inputMap = {
|
|
65
|
+
'>': 'gt',
|
|
66
|
+
'=': 'equal',
|
|
67
|
+
'<': 'lt',
|
|
68
|
+
'>=': 'ge',
|
|
69
|
+
'<=': 'le'
|
|
70
|
+
};
|
|
71
|
+
if (output) return outputMap[key] || key;
|
|
72
|
+
return inputMap[key] || key;
|
|
73
|
+
}
|
package/es/userGroup/index.js
CHANGED
|
@@ -18,10 +18,8 @@ import { Skeleton } from 'antd';
|
|
|
18
18
|
|
|
19
19
|
var BizUserGroup = function BizUserGroup(props) {
|
|
20
20
|
var enableDelete = props.enableDelete,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_props$labelField = props.labelField,
|
|
24
|
-
labelField = _props$labelField === void 0 ? 'name' : _props$labelField;
|
|
21
|
+
keyField = props.keyField,
|
|
22
|
+
labelField = props.labelField;
|
|
25
23
|
|
|
26
24
|
var _useState = useState(),
|
|
27
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -80,4 +78,8 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
80
78
|
})));
|
|
81
79
|
};
|
|
82
80
|
|
|
81
|
+
BizUserGroup.defaultProps = {
|
|
82
|
+
keyField: 'id',
|
|
83
|
+
labelField: 'name'
|
|
84
|
+
};
|
|
83
85
|
export default BizUserGroup;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"prettier": "^2.2.1",
|
|
59
59
|
"yorkie": "^2.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "d01bb3a8b365c50b8c99c2a63a6501d87fba27e9"
|
|
62
62
|
}
|