@zgfe/business-lib 1.0.0-beta.6 → 1.0.3
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 +38 -48
- package/es/analysisLayout/index.less +1 -1
- 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 +168 -0
- package/es/attrConditions/components/valuesList.d.ts +10 -0
- package/es/attrConditions/components/valuesList.js +188 -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 +183 -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/attributeSelector/demo/index.d.ts +3 -0
- package/es/attributeSelector/demo/{singleForm.js → index.js} +42 -44
- package/es/attributeSelector/index.d.ts +4 -111
- package/es/attributeSelector/index.js +88 -543
- package/es/attributeSelector/listPanel.d.ts +4 -0
- package/es/attributeSelector/listPanel.js +208 -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/pie.js +1 -0
- package/es/chart/index.d.ts +2 -96
- package/es/chart/index.js +28 -35
- 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} +45 -111
- 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 +116 -112
- package/es/commonStyle/select.less +1 -1
- package/es/commonStyle/theme.less +520 -473
- package/es/components/iconFont.js +4 -2
- 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 +10 -0
- package/es/dialog/components/itemNode.js +109 -0
- package/es/dialog/components/list.d.ts +3 -13
- package/es/dialog/components/list.js +15 -12
- package/es/dialog/components/selectToInput.d.ts +4 -48
- package/es/dialog/components/selectToInput.js +74 -80
- 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 +34 -3
- package/es/dialog/demo/index2.js +14 -2
- package/es/dialog/index.d.ts +4 -97
- package/es/dialog/index.js +54 -109
- 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 -30
- package/es/eventSelector/index.js +90 -416
- package/es/eventSelector/listPanel.d.ts +4 -0
- package/es/eventSelector/listPanel.js +197 -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 +14 -11
- package/es/index.js +9 -11
- 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/{multipleSelector → searchInput}/demo/index.d.ts +0 -0
- package/es/searchInput/demo/index.js +5 -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 -49
- package/es/select/index.js +168 -122
- 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/index3.js +9 -18
- package/es/table/index.d.ts +4 -30
- package/es/table/index.js +30 -26
- 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 +1 -0
- package/es/targetConditionGroup/demo/group.js +108 -23
- package/es/targetConditionGroup/demo/index.js +34 -34
- package/es/targetConditionGroup/demo/styles/index.less +29 -0
- package/es/targetConditionGroup/index.d.ts +4 -57
- package/es/targetConditionGroup/index.js +177 -274
- 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 -55
- package/es/targetSelector/index.js +103 -214
- 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/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 +11 -0
- package/es/userCondition/conditions/propCondition.js +147 -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/{attributeSelector/demo/singleForm.d.ts → userCondition/demo/index.d.ts} +0 -0
- package/es/userCondition/demo/index.js +97 -0
- package/es/userCondition/index.d.ts +7 -0
- package/es/userCondition/index.js +146 -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 +79 -0
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.d.ts +2 -0
- package/es/userCondition/util.js +54 -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 +60 -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 -86
- 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 -47
- package/es/globalAttributes/index.js +0 -112
- package/es/multipleSelector/index.d.ts +0 -36
- package/es/multipleSelector/index.js +0 -131
- 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 -112
- package/es/targetConditionGroup/components/conditionItem.d.ts +0 -47
- package/es/targetConditionGroup/components/conditionItem.js +0 -232
- 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/group.d.ts +0 -56
- package/es/targetConditionGroup/group.js +0 -204
- package/es/targetConditionGroup/index.less +0 -76
- package/es/targetConditionGroup/type.d.ts +0 -95
- 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
|
@@ -12,8 +12,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
12
|
|
|
13
13
|
import React, { useState } from 'react';
|
|
14
14
|
import { BizUserGroup } from '@zgfe/business-lib';
|
|
15
|
-
import './index.less';
|
|
16
|
-
import { Button, Form } from 'antd';
|
|
17
15
|
var groupOptions = [{
|
|
18
16
|
id: 1,
|
|
19
17
|
name: '用户群1'
|
|
@@ -35,79 +33,24 @@ var groupOptions = [{
|
|
|
35
33
|
}];
|
|
36
34
|
|
|
37
35
|
var UserGroupDemo = function UserGroupDemo() {
|
|
38
|
-
var _Form$useForm = Form.useForm(),
|
|
39
|
-
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
40
|
-
form = _Form$useForm2[0];
|
|
41
|
-
|
|
42
36
|
var _useState = useState(),
|
|
43
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
38
|
group = _useState2[0],
|
|
45
39
|
setGroup = _useState2[1];
|
|
46
40
|
|
|
47
|
-
var _useState3 = useState(null),
|
|
48
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
-
group2 = _useState4[0],
|
|
50
|
-
setGroup2 = _useState4[1];
|
|
51
|
-
|
|
52
|
-
var onFinish = function onFinish(values) {
|
|
53
|
-
setGroup(JSON.stringify(values));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var onFinishFailed = function onFinishFailed(errorInfo) {
|
|
57
|
-
console.log('Failed:', errorInfo);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
41
|
var handleChange = function handleChange(value) {
|
|
61
42
|
console.log('change', value);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var handleChange2 = function handleChange2(value) {
|
|
65
|
-
setGroup2(value.name);
|
|
43
|
+
setGroup(value);
|
|
66
44
|
};
|
|
67
45
|
|
|
68
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
69
47
|
className: "biz-user-group-demo"
|
|
70
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
71
|
-
form: form,
|
|
72
|
-
onFinish: onFinish,
|
|
73
|
-
onFinishFailed: onFinishFailed,
|
|
74
|
-
initialValues: {
|
|
75
|
-
group: 1,
|
|
76
|
-
group2: {
|
|
77
|
-
id: 2,
|
|
78
|
-
name: '用户群2'
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
82
|
-
label: "\u7528\u6237\u7FA4",
|
|
83
|
-
name: "group"
|
|
84
48
|
}, /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
85
49
|
options: groupOptions,
|
|
86
|
-
onChange: handleChange
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
91
|
-
options: groupOptions,
|
|
92
|
-
responseType: 'object',
|
|
93
|
-
onChange: handleChange
|
|
94
|
-
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
95
|
-
wrapperCol: {
|
|
96
|
-
offset: 8,
|
|
97
|
-
span: 16
|
|
98
|
-
}
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
100
|
-
type: "primary",
|
|
101
|
-
htmlType: "submit"
|
|
102
|
-
}, "Submit"))), /*#__PURE__*/React.createElement("p", null, "\u5DF2\u9009\u7528\u6237\u7FA4\uFF1A", group), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
103
|
-
options: groupOptions,
|
|
104
|
-
responseType: 'object',
|
|
105
|
-
defaultValue: {
|
|
106
|
-
id: 2,
|
|
107
|
-
name: '用户群2'
|
|
108
|
-
},
|
|
109
|
-
onChange: handleChange2
|
|
110
|
-
}), /*#__PURE__*/React.createElement("p", null, "\u5DF2\u9009\u7528\u6237\u7FA4\uFF1A", group2));
|
|
50
|
+
onChange: handleChange,
|
|
51
|
+
defaultValue: groupOptions[0],
|
|
52
|
+
enableDelete: true
|
|
53
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5DF2\u9009\u7528\u6237\u7FA4\uFF1A", JSON.stringify(group)));
|
|
111
54
|
};
|
|
112
55
|
|
|
113
56
|
export default (function () {
|
package/es/userGroup/index.d.ts
CHANGED
|
@@ -1,79 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
[prop: string]: any;
|
|
6
|
-
}
|
|
7
|
-
interface UserGroupProps {
|
|
8
|
-
/**
|
|
9
|
-
* @description 若组件是表单选项,value就是form的initialValues,也是组件的默认选项
|
|
10
|
-
* @description.zh-CN
|
|
11
|
-
* @default -
|
|
12
|
-
*/
|
|
13
|
-
value?: string | number | Option | null;
|
|
14
|
-
/**
|
|
15
|
-
* @description 默认选项
|
|
16
|
-
* @description.zh-CN
|
|
17
|
-
* @default -
|
|
18
|
-
*/
|
|
19
|
-
defaultValue?: string | number | Option | null;
|
|
20
|
-
/**
|
|
21
|
-
* @description 返回数据类型
|
|
22
|
-
* @description.zh-CN id | object
|
|
23
|
-
* @default id
|
|
24
|
-
*/
|
|
25
|
-
responseType?: string;
|
|
26
|
-
/**
|
|
27
|
-
* @description 禁选数组
|
|
28
|
-
* @description.zh-CN id | object []
|
|
29
|
-
* @default -
|
|
30
|
-
*/
|
|
31
|
-
disabled?: Array<string | number>;
|
|
32
|
-
/**
|
|
33
|
-
* @description 自定义节点 label、value 的字段
|
|
34
|
-
* @description.zh-CN
|
|
35
|
-
* @default -
|
|
36
|
-
*/
|
|
37
|
-
fieldNames?: {
|
|
38
|
-
label: string;
|
|
39
|
-
value: string;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* @description 数据化配置选项内容
|
|
43
|
-
* @description.zh-CN
|
|
44
|
-
* @default { label: 'name', value: 'id' }
|
|
45
|
-
*/
|
|
46
|
-
options: Option[];
|
|
47
|
-
/**
|
|
48
|
-
* @description 选中 option 时,调用此函数
|
|
49
|
-
* @description.zh-CN
|
|
50
|
-
* @default
|
|
51
|
-
*/
|
|
52
|
-
onChange?: (option: string | number | object, value: string | number | object, index: number) => void;
|
|
53
|
-
/**
|
|
54
|
-
* @description 删除选择框
|
|
55
|
-
* @description.zh-CN
|
|
56
|
-
* @default -
|
|
57
|
-
*/
|
|
58
|
-
onDelete?: () => void;
|
|
59
|
-
/**
|
|
60
|
-
* @description 是否展示删除按钮
|
|
61
|
-
* @description.zh-CN
|
|
62
|
-
* @default false
|
|
63
|
-
*/
|
|
64
|
-
showDeleteIcon?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* @description 选择框是第几个
|
|
67
|
-
* @description.zh-CN
|
|
68
|
-
* @default 0
|
|
69
|
-
*/
|
|
70
|
-
index?: number;
|
|
71
|
-
/**
|
|
72
|
-
* @description 选择框默认文本
|
|
73
|
-
* @description.zh-CN
|
|
74
|
-
* @default 请选择
|
|
75
|
-
*/
|
|
76
|
-
placeholder?: string;
|
|
77
|
-
}
|
|
78
|
-
declare const BizUserGroup: React.FC<UserGroupProps>;
|
|
2
|
+
import './styles/index.less';
|
|
3
|
+
import { UserGroupTypes } from './types';
|
|
4
|
+
declare const BizUserGroup: React.FC<UserGroupTypes.Props>;
|
|
79
5
|
export default BizUserGroup;
|
package/es/userGroup/index.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
|
|
15
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
2
|
|
|
17
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."); }
|
|
@@ -24,110 +10,76 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
10
|
|
|
25
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
12
|
|
|
27
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
28
|
-
|
|
29
|
-
import { Select, Tooltip } from 'antd';
|
|
30
13
|
import React, { useEffect, useState } from 'react';
|
|
31
|
-
import
|
|
32
|
-
import '
|
|
14
|
+
import './styles/index.less';
|
|
15
|
+
import BizSelect from '../select';
|
|
16
|
+
import BizTargetOptionIcon from '../targetSelector/optionIcon';
|
|
17
|
+
import { Skeleton } from 'antd';
|
|
33
18
|
|
|
34
19
|
var BizUserGroup = function BizUserGroup(props) {
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_props$showDeleteIcon = props.showDeleteIcon,
|
|
41
|
-
showDeleteIcon = _props$showDeleteIcon === void 0 ? false : _props$showDeleteIcon,
|
|
42
|
-
_props$fieldNames = props.fieldNames,
|
|
43
|
-
fieldNames = _props$fieldNames === void 0 ? {
|
|
44
|
-
label: 'name',
|
|
45
|
-
value: 'id'
|
|
46
|
-
} : _props$fieldNames,
|
|
47
|
-
options = props.options,
|
|
48
|
-
onDelete = props.onDelete,
|
|
49
|
-
onChange = props.onChange,
|
|
50
|
-
_props$index = props.index,
|
|
51
|
-
index = _props$index === void 0 ? 0 : _props$index,
|
|
52
|
-
_props$placeholder = props.placeholder,
|
|
53
|
-
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder;
|
|
54
|
-
var intoValue = defaultValue || value;
|
|
55
|
-
var selectValue = intoValue && _typeof(intoValue) === 'object' ? intoValue[fieldNames.value] : intoValue;
|
|
56
|
-
|
|
57
|
-
var _useState = useState(selectValue),
|
|
20
|
+
var enableDelete = props.enableDelete,
|
|
21
|
+
keyField = props.keyField,
|
|
22
|
+
labelField = props.labelField;
|
|
23
|
+
|
|
24
|
+
var _useState = useState(),
|
|
58
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
-
|
|
60
|
-
|
|
26
|
+
current = _useState2[0],
|
|
27
|
+
setCurrent = _useState2[1];
|
|
61
28
|
|
|
62
|
-
var _useState3 = useState(
|
|
29
|
+
var _useState3 = useState(true),
|
|
63
30
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (responseType == 'id') {
|
|
74
|
-
onChange(value, option, index);
|
|
75
|
-
} else {
|
|
76
|
-
onChange(option, value, index);
|
|
77
|
-
}
|
|
31
|
+
ready = _useState4[0],
|
|
32
|
+
setReady = _useState4[1];
|
|
33
|
+
|
|
34
|
+
var classPrefix = 'biz-user';
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
var value = props.defaultValue || props.value;
|
|
37
|
+
|
|
38
|
+
if (value) {
|
|
39
|
+
setCurrent(value);
|
|
78
40
|
}
|
|
41
|
+
|
|
42
|
+
setReady(false);
|
|
43
|
+
}, []);
|
|
44
|
+
|
|
45
|
+
var onClickDelete = function onClickDelete() {
|
|
46
|
+
if (props.onDelete) props.onDelete(current);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var onChange = function onChange(value) {
|
|
50
|
+
setCurrent(value);
|
|
51
|
+
if (props.onChange) props.onChange(value);
|
|
79
52
|
};
|
|
80
53
|
|
|
81
|
-
useEffect(function () {
|
|
82
|
-
if (!disabled || !disabled.length) return;
|
|
83
|
-
var selectOptions = options.map(function (item) {
|
|
84
|
-
if (disabled.indexOf(item[fieldNames.value]) > -1) {
|
|
85
|
-
if (userId && item[fieldNames.value] == userId) {
|
|
86
|
-
delete item.disabled;
|
|
87
|
-
} else {
|
|
88
|
-
item.disabled = true;
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
delete item.disabled;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return _objectSpread({}, item);
|
|
95
|
-
});
|
|
96
|
-
setUserOptions(function () {
|
|
97
|
-
return _toConsumableArray(selectOptions);
|
|
98
|
-
});
|
|
99
|
-
}, [disabled]);
|
|
100
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className:
|
|
102
|
-
}, /*#__PURE__*/React.createElement(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
color: "#242541",
|
|
126
|
-
key: 'delete'
|
|
127
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
128
|
-
className: "biz-icon-delete",
|
|
129
|
-
type: 'icon-qingchu'
|
|
130
|
-
}))));
|
|
55
|
+
className: classPrefix
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
57
|
+
loading: ready,
|
|
58
|
+
active: true,
|
|
59
|
+
paragraph: {
|
|
60
|
+
rows: 1
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
63
|
+
value: current,
|
|
64
|
+
options: props.options,
|
|
65
|
+
keyField: keyField,
|
|
66
|
+
labelField: labelField,
|
|
67
|
+
theme: "secondary",
|
|
68
|
+
border: false,
|
|
69
|
+
disableItemList: props.disableItemList,
|
|
70
|
+
onChange: onChange,
|
|
71
|
+
overlayWidth: 284
|
|
72
|
+
}), /*#__PURE__*/React.createElement(BizTargetOptionIcon, {
|
|
73
|
+
name: "delete",
|
|
74
|
+
icon: "icon-qingchu",
|
|
75
|
+
title: "\u5220\u9664",
|
|
76
|
+
enabled: enableDelete,
|
|
77
|
+
onClick: onClickDelete
|
|
78
|
+
})));
|
|
131
79
|
};
|
|
132
80
|
|
|
81
|
+
BizUserGroup.defaultProps = {
|
|
82
|
+
keyField: 'id',
|
|
83
|
+
labelField: 'name'
|
|
84
|
+
};
|
|
133
85
|
export default BizUserGroup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import '../../assets/styles/inner.less';
|
|
2
|
+
|
|
3
|
+
.biz-user {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
.__select-handle();
|
|
7
|
+
|
|
8
|
+
.biz-select-handle {
|
|
9
|
+
flex: 1;
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 0;
|
|
12
|
+
border: none;
|
|
13
|
+
border-radius: 0;
|
|
14
|
+
}
|
|
15
|
+
&:hover {
|
|
16
|
+
.biz-target-select-option-icon {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BizSelectTypes } from '../select/types';
|
|
2
|
+
export declare namespace UserGroupTypes {
|
|
3
|
+
interface Props {
|
|
4
|
+
defaultValue?: BizSelectTypes.Option;
|
|
5
|
+
value?: BizSelectTypes.Option;
|
|
6
|
+
className?: string;
|
|
7
|
+
options: BizSelectTypes.Option[];
|
|
8
|
+
labelField?: string;
|
|
9
|
+
keyField?: string;
|
|
10
|
+
enableDelete?: boolean;
|
|
11
|
+
disableItemList?: BizSelectTypes.Option[];
|
|
12
|
+
onChange?: (val: BizSelectTypes.Option) => void;
|
|
13
|
+
onDelete?: (val?: BizSelectTypes.Option) => void;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/utils/ajax.js
CHANGED
|
@@ -6,9 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
import axios from 'axios';
|
|
8
8
|
var history = {
|
|
9
|
-
|
|
10
|
-
option: [// 等待队列
|
|
11
|
-
{
|
|
9
|
+
option: [{
|
|
12
10
|
resolve: null,
|
|
13
11
|
reject: null
|
|
14
12
|
}]
|
|
@@ -19,8 +17,7 @@ var timer = {
|
|
|
19
17
|
cancel: null,
|
|
20
18
|
reject: function reject() {}
|
|
21
19
|
}
|
|
22
|
-
};
|
|
23
|
-
|
|
20
|
+
};
|
|
24
21
|
var CancelToken = axios.CancelToken;
|
|
25
22
|
|
|
26
23
|
var _request = function _request(ajax) {
|
|
@@ -28,30 +25,21 @@ var _request = function _request(ajax) {
|
|
|
28
25
|
var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
29
26
|
url: '',
|
|
30
27
|
responseOnce: false,
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 指定unique后,代表同一时间内,该url的请求只能存在一个(取消前置请求)
|
|
34
|
-
* 当值为字符串时,url+unique值共同组成timer的key,以此来作为相同请求的判定
|
|
35
|
-
*/
|
|
36
28
|
unique: false,
|
|
37
|
-
delay: 0
|
|
38
|
-
|
|
29
|
+
delay: 0
|
|
39
30
|
};
|
|
40
31
|
return new Promise(function (resolve, reject) {
|
|
41
|
-
// 如果请求返回之前,同样的请求传递过来,则在返回中将后续请求一并resolve,而不再重复发送请求到服务器
|
|
42
32
|
var key = JSON.stringify(option);
|
|
43
33
|
var timerKey = option.url + '_' + (Object.prototype.toString.call(option.unique) === '[object String]' ? option.unique : '');
|
|
44
34
|
|
|
45
35
|
if (option.unique && timer[timerKey]) {
|
|
46
|
-
// 如果查询已存在,则取消前一个请求
|
|
47
36
|
clearTimeout(timer[timerKey].id);
|
|
48
37
|
|
|
49
38
|
if (timer[timerKey].cancel) {
|
|
50
39
|
timer[timerKey].cancel();
|
|
51
40
|
} else {
|
|
52
41
|
var cancel = new Error('cancel: before request');
|
|
53
|
-
cancel.__CANCEL__ = true;
|
|
54
|
-
|
|
42
|
+
cancel.__CANCEL__ = true;
|
|
55
43
|
timer[timerKey].reject(cancel);
|
|
56
44
|
}
|
|
57
45
|
|
|
@@ -99,14 +87,11 @@ var _request = function _request(ajax) {
|
|
|
99
87
|
request();
|
|
100
88
|
}
|
|
101
89
|
} else if (option.responseOnce) {
|
|
102
|
-
// 如果已经有相同请求在进行,且responseOnce,则以cancel形式取消该请求
|
|
103
90
|
var _cancel = new Error('cancel: before request');
|
|
104
91
|
|
|
105
|
-
_cancel.__CANCEL__ = true;
|
|
106
|
-
|
|
92
|
+
_cancel.__CANCEL__ = true;
|
|
107
93
|
reject(_cancel);
|
|
108
94
|
} else {
|
|
109
|
-
// 有相同请求,但是请求需要以正常结果返回,则加入请求队列,第一个请求响应后一并响应
|
|
110
95
|
history[key].push({
|
|
111
96
|
resolve: resolve,
|
|
112
97
|
reject: reject
|
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;
|