@zgfe/business-lib 1.0.0-beta.4 → 1.0.1-beta.0
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/demo/index.js +4 -1
- package/es/analysisLayout/index.d.ts +1 -28
- package/es/analysisLayout/index.js +32 -42
- package/es/analysisLayout/index.less +7 -5
- package/es/assets/styles/chunks.less +143 -0
- package/es/assets/styles/inner.less +3 -0
- package/es/assets/styles/resetAntd.less +398 -0
- package/es/assets/styles/variable.less +21 -0
- package/es/assets/theme.d.ts +5 -0
- package/es/assets/theme.js +4 -0
- package/es/attrConditions/components/operateList.d.ts +8 -0
- package/es/attrConditions/components/operateList.js +83 -0
- package/es/attrConditions/components/stringList.d.ts +9 -0
- package/es/attrConditions/components/stringList.js +167 -0
- package/es/attrConditions/components/valuesList.d.ts +10 -0
- package/es/attrConditions/components/valuesList.js +186 -0
- package/es/{attributeSelector/demo/multi.d.ts → attrConditions/demo/group.d.ts} +0 -0
- package/es/attrConditions/demo/group.js +82 -0
- package/es/{globalAttributes → attrConditions}/demo/index.d.ts +0 -0
- package/es/{datePicker/demo/form.js → attrConditions/demo/index.js} +43 -23
- package/es/attrConditions/group.d.ts +5 -0
- package/es/attrConditions/group.js +184 -0
- package/es/attrConditions/index.d.ts +6 -0
- package/es/attrConditions/index.js +160 -0
- package/es/attrConditions/styles/group.less +49 -0
- package/es/attrConditions/styles/index.less +94 -0
- package/es/attrConditions/types.d.ts +63 -0
- package/es/attrConditions/types.js +19 -0
- package/es/attrConditions/utils/operates.d.ts +16 -0
- package/es/attrConditions/utils/operates.js +67 -0
- package/es/{multipleSelector → attributeSelector}/demo/index.d.ts +1 -0
- package/es/attributeSelector/demo/{singleForm.js → index.js} +42 -44
- package/es/attributeSelector/index.d.ts +4 -109
- package/es/attributeSelector/index.js +85 -527
- package/es/attributeSelector/listPanel.d.ts +4 -0
- package/es/attributeSelector/listPanel.js +206 -0
- package/es/attributeSelector/option.d.ts +15 -0
- package/es/attributeSelector/option.js +53 -0
- package/es/attributeSelector/styles/index.less +100 -0
- package/es/attributeSelector/types.d.ts +79 -0
- package/es/attributeSelector/types.js +15 -0
- package/es/attributeSelector/util.d.ts +7 -0
- package/es/attributeSelector/util.js +69 -0
- package/es/chart/demo/bar.js +2 -1
- package/es/chart/demo/pie.js +1 -0
- package/es/chart/index.d.ts +2 -80
- package/es/chart/index.js +27 -24
- package/es/chart/styles/index.less +50 -0
- package/es/chart/types.d.ts +46 -0
- package/es/chart/{type.js → types.js} +0 -0
- package/es/chart/util/{chartConfig.d.ts → chartOptionConfig.d.ts} +4 -35
- package/es/chart/util/{chartConfig.js → chartOptionConfig.js} +46 -109
- package/es/chart/util/formatData.d.ts +3 -7
- package/es/chart/util/formatData.js +47 -26
- package/es/chart/util/formatOption.d.ts +2 -1
- package/es/chart/util/formatOption.js +22 -9
- package/es/chart/util/mapUtil.d.ts +3 -3
- package/es/chart/util/mapUtil.js +9 -19
- package/es/commonStyle/icon.less +130 -110
- package/es/commonStyle/select.less +1 -1
- package/es/commonStyle/theme.less +520 -470
- package/es/context/index.d.ts +16 -0
- package/es/context/index.js +3 -0
- package/es/datePicker/datePicker.d.ts +10 -0
- package/es/datePicker/datePicker.js +115 -0
- package/es/datePicker/demo/index.d.ts +1 -0
- package/es/datePicker/demo/index.js +9 -2
- package/es/datePicker/index.d.ts +4 -27
- package/es/datePicker/index.js +72 -148
- package/es/datePicker/styles/index.less +48 -0
- package/es/datePicker/types.d.ts +24 -0
- package/es/{eventSelector/type.js → datePicker/types.js} +0 -0
- package/es/datePicker/utils.d.ts +6 -0
- package/es/datePicker/utils.js +70 -0
- package/es/dialog/components/itemNode.d.ts +9 -0
- package/es/dialog/components/itemNode.js +107 -0
- package/es/dialog/components/list.d.ts +3 -13
- package/es/dialog/components/list.js +8 -7
- package/es/dialog/components/selectToInput.d.ts +4 -41
- package/es/dialog/components/selectToInput.js +109 -54
- package/es/dialog/components/styles/handle.less +39 -0
- package/es/dialog/components/styles/list.less +60 -0
- package/es/dialog/components/styles/tab.less +55 -0
- package/es/dialog/components/tab.d.ts +3 -7
- package/es/dialog/components/tab.js +57 -19
- package/es/dialog/data/{chart.d.ts → data.d.ts} +9 -0
- package/es/dialog/data/{chart.js → data.js} +11 -0
- package/es/dialog/demo/index.d.ts +23 -0
- package/es/dialog/demo/index.js +60 -22
- package/es/dialog/demo/index2.js +14 -2
- package/es/dialog/index.d.ts +4 -65
- package/es/dialog/index.js +124 -108
- package/es/dialog/styles/index.less +11 -0
- package/es/dialog/types.d.ts +77 -0
- package/es/{targetConditionGroup/type.js → dialog/types.js} +0 -0
- package/es/eventSelector/demo/index.js +26 -44
- package/es/eventSelector/index.d.ts +4 -25
- package/es/eventSelector/index.js +91 -338
- package/es/eventSelector/listPanel.d.ts +4 -0
- package/es/eventSelector/listPanel.js +195 -0
- package/es/eventSelector/option.d.ts +17 -0
- package/es/eventSelector/option.js +54 -0
- package/es/eventSelector/styles/index.less +77 -0
- package/es/eventSelector/types.d.ts +31 -0
- package/es/eventSelector/types.js +1 -0
- package/es/index.d.ts +12 -10
- package/es/index.js +7 -10
- package/es/{attributeSelector/data → mock}/env.d.ts +0 -0
- package/es/{attributeSelector/data → mock}/env.js +0 -0
- package/es/{attributeSelector/data → mock}/event.d.ts +0 -0
- package/es/{attributeSelector/data → mock}/event.js +0 -0
- package/es/{attributeSelector/data → mock}/user.d.ts +0 -0
- package/es/{attributeSelector/data → mock}/user.js +0 -0
- package/es/searchInput/index.d.ts +8 -0
- package/es/searchInput/index.js +31 -0
- package/es/{attributeSelector/demo/multiForm.d.ts → select/demo/group.d.ts} +0 -0
- package/es/{globalAttributes/demo/index.js → select/demo/group.js} +49 -31
- package/es/select/demo/index.js +49 -21
- package/es/{attributeSelector/demo/single.d.ts → select/demo/multiple.d.ts} +0 -0
- package/es/{multipleSelector/demo/index.js → select/demo/multiple.js} +55 -12
- package/es/select/handle.d.ts +5 -0
- package/es/select/handle.js +119 -0
- package/es/select/index.d.ts +4 -41
- package/es/select/index.js +166 -121
- package/es/select/option.d.ts +4 -0
- package/es/select/option.js +59 -0
- package/es/select/overlay.d.ts +4 -0
- package/es/select/overlay.js +154 -0
- package/es/select/styles/handle.less +111 -0
- package/es/select/styles/index.less +99 -0
- package/es/select/types.d.ts +65 -0
- package/es/select/types.js +1 -0
- package/es/table/demo/data/table.js +1 -1
- package/es/table/demo/index.d.ts +1 -1
- package/es/table/demo/index.js +9 -8
- package/es/table/demo/index2.js +45 -3
- package/es/{attributeSelector/demo/singleForm.d.ts → table/demo/index3.d.ts} +0 -0
- package/es/table/demo/index3.js +218 -0
- package/es/table/index.d.ts +4 -30
- package/es/table/index.js +19 -17
- package/es/table/styles/index.less +5 -0
- package/es/table/type.d.ts +10 -0
- package/es/table/type.js +1 -0
- package/es/targetConditionGroup/components/targetDimension.d.ts +8 -0
- package/es/targetConditionGroup/components/targetDimension.js +153 -0
- package/es/targetConditionGroup/data/operates.d.ts +8 -24
- package/es/targetConditionGroup/data/operates.js +26 -69
- package/es/targetConditionGroup/demo/group.d.ts +3 -0
- package/es/targetConditionGroup/demo/group.js +127 -0
- package/es/targetConditionGroup/demo/index.js +41 -51
- package/es/targetConditionGroup/demo/styles/index.less +29 -0
- package/es/targetConditionGroup/index.d.ts +4 -51
- package/es/targetConditionGroup/index.js +187 -222
- package/es/targetConditionGroup/styles/index.less +25 -0
- package/es/targetConditionGroup/types.d.ts +32 -0
- package/es/targetConditionGroup/types.js +1 -0
- package/es/targetSelector/demo/index.d.ts +1 -0
- package/es/targetSelector/demo/index.js +29 -71
- package/es/targetSelector/editBox.d.ts +8 -0
- package/es/targetSelector/{components/BizEventNameEditBox.js → editBox.js} +49 -24
- package/es/targetSelector/index.d.ts +5 -39
- package/es/targetSelector/index.js +102 -169
- package/es/targetSelector/optionIcon.d.ts +9 -0
- package/es/targetSelector/optionIcon.js +24 -0
- package/es/targetSelector/optionMenu.d.ts +7 -0
- package/es/targetSelector/optionMenu.js +38 -0
- package/es/targetSelector/styles/index.less +88 -0
- package/es/targetSelector/types.d.ts +18 -0
- package/es/targetSelector/types.js +1 -0
- package/es/{datePicker/demo/form.d.ts → userGroup/demo/group.d.ts} +0 -0
- package/es/{targetConditionGroup/demo/form.js → userGroup/demo/group.js} +68 -72
- package/es/userGroup/demo/index.d.ts +0 -1
- package/es/userGroup/demo/index.js +5 -62
- package/es/userGroup/index.d.ts +3 -77
- package/es/userGroup/index.js +58 -108
- package/es/userGroup/styles/index.less +20 -0
- package/es/userGroup/types.d.ts +15 -0
- package/es/userGroup/types.js +1 -0
- package/es/utils/ajax.js +5 -20
- package/es/utils/type.d.ts +42 -44
- package/es/utils/util.d.ts +1 -35
- package/es/utils/util.js +27 -57
- package/package.json +11 -4
- package/es/attributeSelector/demo/multi.js +0 -39
- package/es/attributeSelector/demo/multiForm.js +0 -64
- package/es/attributeSelector/demo/single.js +0 -43
- package/es/attributeSelector/group.d.ts +0 -31
- package/es/attributeSelector/group.js +0 -225
- package/es/attributeSelector/index.less +0 -172
- package/es/chart/index.less +0 -38
- package/es/chart/style/circle.svg +0 -4
- package/es/chart/type.d.ts +0 -22
- package/es/datePicker/data.d.ts +0 -9
- package/es/datePicker/data.js +0 -65
- package/es/datePicker/index.less +0 -364
- package/es/dialog/components/style/list.less +0 -59
- package/es/dialog/components/style/tab.less +0 -61
- package/es/dialog/style/index.less +0 -76
- package/es/eventSelector/demo/form.d.ts +0 -2
- package/es/eventSelector/demo/form.js +0 -89
- package/es/eventSelector/demo/nodata.d.ts +0 -2
- package/es/eventSelector/demo/nodata.js +0 -13
- package/es/eventSelector/index.less +0 -121
- package/es/eventSelector/type.d.ts +0 -41
- package/es/globalAttributes/demo/data/env.d.ts +0 -11
- package/es/globalAttributes/demo/data/env.js +0 -181
- package/es/globalAttributes/demo/data/event.d.ts +0 -237
- package/es/globalAttributes/demo/data/event.js +0 -3483
- package/es/globalAttributes/demo/data/user.d.ts +0 -22
- package/es/globalAttributes/demo/data/user.js +0 -218
- package/es/globalAttributes/index.d.ts +0 -46
- package/es/globalAttributes/index.js +0 -117
- package/es/multipleSelector/index.d.ts +0 -36
- package/es/multipleSelector/index.js +0 -103
- package/es/multipleSelector/index.less +0 -136
- package/es/table/demo/index.less +0 -8
- package/es/table/index.less +0 -139
- package/es/targetConditionGroup/components/conditionGroup.d.ts +0 -30
- package/es/targetConditionGroup/components/conditionGroup.js +0 -111
- package/es/targetConditionGroup/components/conditionItem.d.ts +0 -47
- package/es/targetConditionGroup/components/conditionItem.js +0 -259
- package/es/targetConditionGroup/components/style/group.less +0 -47
- package/es/targetConditionGroup/components/style/index.less +0 -16
- package/es/targetConditionGroup/demo/data/env.d.ts +0 -11
- package/es/targetConditionGroup/demo/data/env.js +0 -181
- package/es/targetConditionGroup/demo/data/event.d.ts +0 -237
- package/es/targetConditionGroup/demo/data/event.js +0 -3483
- package/es/targetConditionGroup/demo/data/user.d.ts +0 -22
- package/es/targetConditionGroup/demo/data/user.js +0 -218
- package/es/targetConditionGroup/demo/form.d.ts +0 -2
- package/es/targetConditionGroup/demo/item.d.ts +0 -2
- package/es/targetConditionGroup/demo/item.js +0 -5
- package/es/targetConditionGroup/index.less +0 -64
- package/es/targetConditionGroup/type.d.ts +0 -50
- package/es/targetSelector/components/BizCascadeBox.d.ts +0 -34
- package/es/targetSelector/components/BizCascadeBox.js +0 -213
- package/es/targetSelector/components/BizEventNameEditBox.d.ts +0 -20
- package/es/targetSelector/demo/form.d.ts +0 -2
- package/es/targetSelector/demo/form.js +0 -133
- package/es/targetSelector/demo/nodata.d.ts +0 -2
- package/es/targetSelector/demo/nodata.js +0 -13
- package/es/targetSelector/index.less +0 -28
- package/es/userGroup/demo/cluster.d.ts +0 -3
- package/es/userGroup/demo/cluster.js +0 -102
- package/es/userGroup/demo/index.less +0 -3
- package/es/userGroup/index.less +0 -2
- package/es/userGroup/userCluster.d.ts +0 -63
- package/es/userGroup/userCluster.js +0 -255
package/es/utils/type.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropType } from '../attributeSelector/types';
|
|
1
2
|
export interface Event {
|
|
2
3
|
value?: string | number;
|
|
3
4
|
label?: string | number;
|
|
@@ -7,48 +8,45 @@ export interface EventType {
|
|
|
7
8
|
aliasName?: string;
|
|
8
9
|
option?: string | number | Event;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
eventEnv?: Array<any>;
|
|
52
|
-
appInfo?: AppInfoProps;
|
|
11
|
+
export declare namespace OldSystem {
|
|
12
|
+
interface EventGroup {
|
|
13
|
+
groupId: number;
|
|
14
|
+
groupName?: string;
|
|
15
|
+
eventList: Event[];
|
|
16
|
+
}
|
|
17
|
+
interface Event {
|
|
18
|
+
event_id: number;
|
|
19
|
+
event_name: string;
|
|
20
|
+
alias_name?: string;
|
|
21
|
+
click_analysis: boolean;
|
|
22
|
+
event_attrs: EventProp[];
|
|
23
|
+
event_hidden: boolean;
|
|
24
|
+
event_type: number;
|
|
25
|
+
insert_time: string;
|
|
26
|
+
is_delete: boolean;
|
|
27
|
+
is_stop: boolean;
|
|
28
|
+
plats: number[];
|
|
29
|
+
}
|
|
30
|
+
interface EventProp {
|
|
31
|
+
alias_name?: string;
|
|
32
|
+
attr_id: number;
|
|
33
|
+
attr_name: string;
|
|
34
|
+
dimension_sub: 'event_attr';
|
|
35
|
+
encryption_type: 0 | 1;
|
|
36
|
+
event_id: number;
|
|
37
|
+
hidden: boolean;
|
|
38
|
+
is_stop: boolean;
|
|
39
|
+
prop_type: PropType;
|
|
40
|
+
}
|
|
41
|
+
interface UserProp {
|
|
42
|
+
alias_name?: string;
|
|
43
|
+
category: 'fixed' | 'custom';
|
|
44
|
+
dimension_sub: string;
|
|
45
|
+
name: string;
|
|
46
|
+
text: string;
|
|
47
|
+
type: PropType;
|
|
48
|
+
subtype?: number;
|
|
49
|
+
}
|
|
50
|
+
interface EnvProp extends UserProp {
|
|
51
|
+
}
|
|
53
52
|
}
|
|
54
|
-
export {};
|
package/es/utils/util.d.ts
CHANGED
|
@@ -9,12 +9,6 @@ declare let util: {
|
|
|
9
9
|
isFunction(obj: any): boolean;
|
|
10
10
|
isEqual(a?: {}, b?: {}): boolean;
|
|
11
11
|
equal(a: any, b: any): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 获取指定范围的随机数
|
|
14
|
-
* @param min
|
|
15
|
-
* @param max
|
|
16
|
-
* @returns {*}
|
|
17
|
-
*/
|
|
18
12
|
random(min: number, max: number): number;
|
|
19
13
|
guid(): string;
|
|
20
14
|
mergeObject(defaults: {
|
|
@@ -24,44 +18,16 @@ declare let util: {
|
|
|
24
18
|
}): {
|
|
25
19
|
[x: string]: any;
|
|
26
20
|
};
|
|
27
|
-
/**
|
|
28
|
-
* 将数字转为千分位分割格式
|
|
29
|
-
* @param num
|
|
30
|
-
* @returns {string}
|
|
31
|
-
*/
|
|
32
21
|
toThousands(num: number): string;
|
|
33
|
-
/**
|
|
34
|
-
* 为单数前补0
|
|
35
|
-
* @param num
|
|
36
|
-
* @returns {string}
|
|
37
|
-
*/
|
|
38
22
|
toDoubleNumber(num: number): string;
|
|
39
|
-
/**
|
|
40
|
-
* 日期格式化
|
|
41
|
-
* @param date
|
|
42
|
-
* @param formatter
|
|
43
|
-
* @returns {string}
|
|
44
|
-
*/
|
|
45
23
|
dateFormat(date?: any, formatter?: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* 日期格式化
|
|
48
|
-
* @param date
|
|
49
|
-
* @param formatter
|
|
50
|
-
* @returns {string}
|
|
51
|
-
*/
|
|
52
24
|
timeFormat(date: any, formatter: string | undefined, autoShort: any): string | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* 从中间拆分字符串,长度超出的话,解析为xxx...xxx
|
|
55
|
-
* @param str
|
|
56
|
-
* @param config
|
|
57
|
-
* @returns {string}
|
|
58
|
-
*/
|
|
59
25
|
strMiddleSplit(str: string, config?: {
|
|
60
26
|
maxLength: number;
|
|
61
27
|
beginLength: number;
|
|
62
28
|
endLength: number;
|
|
63
29
|
replaceStr: string;
|
|
64
30
|
}): string;
|
|
65
|
-
setHighLight(content: string, search: string):
|
|
31
|
+
setHighLight(content: string, search: string, wrapper: (text: string, key: string) => any): any[];
|
|
66
32
|
};
|
|
67
33
|
export default util;
|
package/es/utils/util.js
CHANGED
|
@@ -29,13 +29,6 @@ var util = {
|
|
|
29
29
|
equal: function equal(a, b) {
|
|
30
30
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 获取指定范围的随机数
|
|
35
|
-
* @param min
|
|
36
|
-
* @param max
|
|
37
|
-
* @returns {*}
|
|
38
|
-
*/
|
|
39
32
|
random: function random(min, max) {
|
|
40
33
|
return Math.round(Math.random() * (max - min)) + min;
|
|
41
34
|
},
|
|
@@ -73,49 +66,20 @@ var util = {
|
|
|
73
66
|
|
|
74
67
|
return option;
|
|
75
68
|
},
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 将数字转为千分位分割格式
|
|
79
|
-
* @param num
|
|
80
|
-
* @returns {string}
|
|
81
|
-
*/
|
|
82
69
|
toThousands: function toThousands(num) {
|
|
83
|
-
var source = String(num).split('.');
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return source.join('.'); // 再将小数部分合并进来
|
|
70
|
+
var source = String(num).split('.');
|
|
71
|
+
source[0] = source[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)', 'ig'), '$1,');
|
|
72
|
+
return source.join('.');
|
|
88
73
|
},
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* 为单数前补0
|
|
92
|
-
* @param num
|
|
93
|
-
* @returns {string}
|
|
94
|
-
*/
|
|
95
74
|
toDoubleNumber: function toDoubleNumber(num) {
|
|
96
|
-
// num += ''
|
|
97
75
|
var num2 = num.toString();
|
|
98
76
|
return num > 9 ? num2 : '0' + num2;
|
|
99
77
|
},
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* 日期格式化
|
|
103
|
-
* @param date
|
|
104
|
-
* @param formatter
|
|
105
|
-
* @returns {string}
|
|
106
|
-
*/
|
|
107
78
|
dateFormat: function dateFormat() {
|
|
108
79
|
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
109
80
|
var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
|
|
110
81
|
return formatter.replace('yyyy', date.getFullYear()).replace('mm', this.toDoubleNumber(date.getMonth() + 1)).replace('dd', this.toDoubleNumber(date.getDate()));
|
|
111
82
|
},
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 日期格式化
|
|
115
|
-
* @param date
|
|
116
|
-
* @param formatter
|
|
117
|
-
* @returns {string}
|
|
118
|
-
*/
|
|
119
83
|
timeFormat: function timeFormat() {
|
|
120
84
|
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
121
85
|
var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm:ss';
|
|
@@ -124,7 +88,6 @@ var util = {
|
|
|
124
88
|
if (this.isDate(date)) {
|
|
125
89
|
return formatter.replace('hh', this.toDoubleNumber(date.getHours())).replace('mm', this.toDoubleNumber(date.getMinutes())).replace('ss', this.toDoubleNumber(date.getSeconds()));
|
|
126
90
|
} else if (this.isNumber(date)) {
|
|
127
|
-
// formatter 格式化规则 如:{s:'秒', h:'小时', m: '分钟'}
|
|
128
91
|
var s = parseInt(date / 1000 + '');
|
|
129
92
|
var m = parseInt(s / 60 + '');
|
|
130
93
|
var h = parseInt(m / 60 + '');
|
|
@@ -143,13 +106,6 @@ var util = {
|
|
|
143
106
|
return formatter.replace('hh', this.toDoubleNumber(h)).replace('mm', this.toDoubleNumber(m)).replace('ss', this.toDoubleNumber(s));
|
|
144
107
|
}
|
|
145
108
|
},
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* 从中间拆分字符串,长度超出的话,解析为xxx...xxx
|
|
149
|
-
* @param str
|
|
150
|
-
* @param config
|
|
151
|
-
* @returns {string}
|
|
152
|
-
*/
|
|
153
109
|
strMiddleSplit: function strMiddleSplit(str) {
|
|
154
110
|
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
155
111
|
maxLength: 20,
|
|
@@ -159,9 +115,7 @@ var util = {
|
|
|
159
115
|
};
|
|
160
116
|
str += '';
|
|
161
117
|
var reg = {
|
|
162
|
-
// eslint-disable-next-line
|
|
163
118
|
fullCharReg: /[^\x00-\xff]/,
|
|
164
|
-
// eslint-disable-next-line
|
|
165
119
|
fullCharsReg: /[^\x00-\xff]/g,
|
|
166
120
|
anyChars: /[\S\s]{1}/g
|
|
167
121
|
};
|
|
@@ -191,14 +145,30 @@ var util = {
|
|
|
191
145
|
|
|
192
146
|
return str;
|
|
193
147
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
148
|
+
setHighLight: function setHighLight(content, search, wrapper) {
|
|
149
|
+
var res = [];
|
|
150
|
+
var match = content.match(new RegExp(search, 'i'));
|
|
151
|
+
|
|
152
|
+
if (!match) {
|
|
153
|
+
res.push(content);
|
|
154
|
+
return res;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var text = match[0];
|
|
158
|
+
var matchIndex = match.index;
|
|
159
|
+
|
|
160
|
+
if (matchIndex - 1 >= 0) {
|
|
161
|
+
res.push(content.substring(0, matchIndex));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
res.push(wrapper(text, "".concat(content, "-").concat(search)));
|
|
165
|
+
|
|
166
|
+
if (matchIndex + text.length < content.length) {
|
|
167
|
+
var beginIndex = matchIndex + text.length;
|
|
168
|
+
res.push(this.setHighLight(content.substring(beginIndex, content.length), search, wrapper));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return res;
|
|
202
172
|
}
|
|
203
173
|
};
|
|
204
174
|
export default util;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-beta.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -10,14 +10,17 @@
|
|
|
10
10
|
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
|
11
11
|
"test": "umi-test",
|
|
12
12
|
"test:coverage": "umi-test --coverage",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
13
|
+
"prepublishOnly": "npm run build",
|
|
14
|
+
"pub": "lerna publish"
|
|
14
15
|
},
|
|
15
16
|
"module": "es/index.js",
|
|
16
17
|
"typings": "es/index.d.ts",
|
|
17
18
|
"gitHooks": {
|
|
18
19
|
"pre-commit": "lint-staged"
|
|
19
20
|
},
|
|
20
|
-
"files": [
|
|
21
|
+
"files": [
|
|
22
|
+
"es"
|
|
23
|
+
],
|
|
21
24
|
"lint-staged": {
|
|
22
25
|
"*.{js,jsx,less,md,json}": [
|
|
23
26
|
"prettier --write"
|
|
@@ -32,9 +35,12 @@
|
|
|
32
35
|
"babel-plugin-import": "^1.13.3",
|
|
33
36
|
"echarts": "^5.3.2",
|
|
34
37
|
"echarts-for-react": "^3.0.2",
|
|
38
|
+
"lerna": "^4.0.0",
|
|
35
39
|
"react-infinite-scroll-component": "^6.1.0"
|
|
36
40
|
},
|
|
37
41
|
"peerDependencies": {
|
|
42
|
+
"@types/lodash": "^4.14.182",
|
|
43
|
+
"lodash": "^4.17.21",
|
|
38
44
|
"react": "^16.12.0 || ^17.0.0"
|
|
39
45
|
},
|
|
40
46
|
"devDependencies": {
|
|
@@ -51,5 +57,6 @@
|
|
|
51
57
|
"lint-staged": "^10.0.7",
|
|
52
58
|
"prettier": "^2.2.1",
|
|
53
59
|
"yorkie": "^2.0.0"
|
|
54
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"gitHead": "559dc4dacce4682df696e0da5e8940f5949a8c9d"
|
|
55
62
|
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
|
-
import React, { useState } from 'react';
|
|
14
|
-
import { BizGroupSelect } from '@zgfe/business-lib';
|
|
15
|
-
import eventData from '../data/event';
|
|
16
|
-
import envData from '../data/env';
|
|
17
|
-
import userData from '../data/user';
|
|
18
|
-
var options = {
|
|
19
|
-
event: eventData,
|
|
20
|
-
user: userData,
|
|
21
|
-
env: envData
|
|
22
|
-
};
|
|
23
|
-
export default (function () {
|
|
24
|
-
var _useState = useState(['browser_version']),
|
|
25
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
-
attribute = _useState2[0],
|
|
27
|
-
setAttribute = _useState2[1];
|
|
28
|
-
|
|
29
|
-
var handleChange = function handleChange(value) {
|
|
30
|
-
setAttribute(value);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizGroupSelect, {
|
|
34
|
-
defaultValue: attribute,
|
|
35
|
-
options: options,
|
|
36
|
-
eventIds: '24095076,24256188,24143017,24143013',
|
|
37
|
-
onChange: handleChange
|
|
38
|
-
}), /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)));
|
|
39
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
|
-
import React, { useState } from 'react';
|
|
14
|
-
import { Button, Form } from 'antd';
|
|
15
|
-
import { BizGroupSelect } from '@zgfe/business-lib';
|
|
16
|
-
import eventData from '../data/event';
|
|
17
|
-
import envData from '../data/env';
|
|
18
|
-
import userData from '../data/user';
|
|
19
|
-
var options = {
|
|
20
|
-
event: eventData,
|
|
21
|
-
user: userData,
|
|
22
|
-
env: envData
|
|
23
|
-
};
|
|
24
|
-
export default (function () {
|
|
25
|
-
var _Form$useForm = Form.useForm(),
|
|
26
|
-
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
27
|
-
form = _Form$useForm2[0];
|
|
28
|
-
|
|
29
|
-
var _useState = useState({
|
|
30
|
-
attr: ['visit_times']
|
|
31
|
-
}),
|
|
32
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
-
formData = _useState2[0],
|
|
34
|
-
setFormData = _useState2[1];
|
|
35
|
-
|
|
36
|
-
var onFinish = function onFinish(values) {
|
|
37
|
-
setFormData(values);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var onFinishFailed = function onFinishFailed(errorInfo) {
|
|
41
|
-
console.log('Failed:', errorInfo);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
45
|
-
form: form,
|
|
46
|
-
onFinish: onFinish,
|
|
47
|
-
onFinishFailed: onFinishFailed,
|
|
48
|
-
initialValues: formData
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
50
|
-
label: "\u5C5E\u6027",
|
|
51
|
-
name: "attr"
|
|
52
|
-
}, /*#__PURE__*/React.createElement(BizGroupSelect, {
|
|
53
|
-
options: options,
|
|
54
|
-
eventIds: '24095076,24256188,24143017,24143013'
|
|
55
|
-
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
56
|
-
wrapperCol: {
|
|
57
|
-
offset: 8,
|
|
58
|
-
span: 16
|
|
59
|
-
}
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
61
|
-
type: "primary",
|
|
62
|
-
htmlType: "submit"
|
|
63
|
-
}, "Submit"))), /*#__PURE__*/React.createElement("p", null, JSON.stringify(formData)));
|
|
64
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
|
-
import React, { useState } from 'react';
|
|
14
|
-
import { BizAttributeSelector } from '@zgfe/business-lib';
|
|
15
|
-
import eventData from '../data/event';
|
|
16
|
-
import envData from '../data/env';
|
|
17
|
-
import userData from '../data/user';
|
|
18
|
-
var options = {
|
|
19
|
-
event: eventData,
|
|
20
|
-
user: userData,
|
|
21
|
-
env: envData
|
|
22
|
-
};
|
|
23
|
-
export default (function () {
|
|
24
|
-
var _useState = useState('browser_version'),
|
|
25
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
-
attribute = _useState2[0],
|
|
27
|
-
setAttribute = _useState2[1];
|
|
28
|
-
|
|
29
|
-
var handleChange = function handleChange(value) {
|
|
30
|
-
setAttribute(value);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
34
|
-
defaultValue: attribute,
|
|
35
|
-
options: options,
|
|
36
|
-
disabled: ['项目id'],
|
|
37
|
-
eventIds: '24095076,24256188,24143017,24143013',
|
|
38
|
-
onChange: handleChange,
|
|
39
|
-
showUserProp: false,
|
|
40
|
-
showEventEnv: false,
|
|
41
|
-
showEventProp: false
|
|
42
|
-
}), /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", attribute));
|
|
43
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
import { AttributeProps, AttrsListProps } from './index';
|
|
4
|
-
interface AttributeGroupProps extends AttributeProps {
|
|
5
|
-
/**
|
|
6
|
-
* @description 若组件是表单选项,value就是form的initialValues,也是组件的默认选项
|
|
7
|
-
* @description.zh-CN
|
|
8
|
-
* @default -
|
|
9
|
-
*/
|
|
10
|
-
value?: Array<string | number | AttrsListProps>;
|
|
11
|
-
/**
|
|
12
|
-
* @description 默认选项
|
|
13
|
-
* @description.zh-CN
|
|
14
|
-
* @default -
|
|
15
|
-
*/
|
|
16
|
-
defaultValue?: Array<string | number | AttrsListProps>;
|
|
17
|
-
/**
|
|
18
|
-
* @description 最多个数
|
|
19
|
-
* @description.zh-CN
|
|
20
|
-
* @default 3
|
|
21
|
-
*/
|
|
22
|
-
maxAttrGroup?: number;
|
|
23
|
-
/**
|
|
24
|
-
* @description 选中 option 时,调用此函数
|
|
25
|
-
* @description.zh-CN
|
|
26
|
-
* @default -
|
|
27
|
-
*/
|
|
28
|
-
onChange: (valueObject: object[] | (string | number)[], value: object[] | (string | number)[]) => void;
|
|
29
|
-
}
|
|
30
|
-
declare const BizGroupSelect: React.FC<AttributeGroupProps>;
|
|
31
|
-
export default BizGroupSelect;
|