@zgfe/business-lib 1.0.0-beta.3 → 1.0.0-beta.6
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.d.ts +28 -0
- package/es/analysisLayout/index.js +6 -2
- package/es/analysisLayout/index.less +10 -3
- package/es/attributeSelector/index.d.ts +4 -2
- package/es/attributeSelector/index.js +30 -15
- package/es/chart/demo/bar.js +2 -2
- package/es/chart/demo/data/data2.d.ts +8 -0
- package/es/chart/demo/data/data2.js +7 -0
- package/es/chart/demo/data/data3.d.ts +10 -0
- package/es/chart/demo/data/data3.js +584 -0
- package/es/chart/demo/map.d.ts +2 -0
- package/es/chart/demo/map.js +11 -0
- package/es/chart/index.d.ts +29 -9
- package/es/chart/index.js +30 -71
- package/es/chart/type.d.ts +22 -0
- package/es/chart/type.js +1 -0
- package/es/chart/{chartConfig.d.ts → util/chartConfig.d.ts} +68 -3
- package/es/chart/{chartConfig.js → util/chartConfig.js} +85 -11
- package/es/chart/{color.d.ts → util/color.d.ts} +0 -0
- package/es/chart/{color.js → util/color.js} +0 -0
- package/es/chart/util/data/china.js +530 -0
- package/es/chart/util/data/cityGeoCoord.d.ts +22553 -0
- package/es/chart/util/data/cityGeoCoord.js +22552 -0
- package/es/chart/util/data/provinceGeoCoord.d.ts +343 -0
- package/es/chart/util/data/provinceGeoCoord.js +9258 -0
- package/es/chart/util/formatData.d.ts +13 -0
- package/es/chart/util/formatData.js +56 -0
- package/es/chart/util/{format.d.ts → formatOption.d.ts} +2 -1
- package/es/chart/util/{format.js → formatOption.js} +31 -1
- package/es/chart/util/mapUtil.d.ts +8 -0
- package/es/chart/util/mapUtil.js +195 -0
- package/es/commonStyle/icon.less +19 -3
- package/es/commonStyle/theme.less +5 -2
- package/es/dialog/components/selectToInput.d.ts +10 -3
- package/es/dialog/components/selectToInput.js +75 -12
- package/es/dialog/demo/index.js +27 -20
- package/es/dialog/index.d.ts +34 -2
- package/es/dialog/index.js +129 -55
- package/es/dialog/style/index.less +11 -1
- package/es/eventSelector/index.d.ts +5 -0
- package/es/eventSelector/index.js +111 -32
- package/es/globalAttributes/index.d.ts +3 -2
- package/es/globalAttributes/index.js +18 -23
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/multipleSelector/index.js +32 -4
- package/es/select/demo/index.js +2 -1
- package/es/select/index.d.ts +9 -1
- package/es/select/index.js +4 -2
- package/es/table/demo/index2.js +45 -3
- package/es/table/demo/index3.d.ts +2 -0
- package/es/table/demo/index3.js +227 -0
- package/es/table/index.d.ts +1 -1
- package/es/targetConditionGroup/components/conditionGroup.d.ts +4 -4
- package/es/targetConditionGroup/components/conditionGroup.js +27 -26
- package/es/targetConditionGroup/components/conditionItem.d.ts +4 -4
- package/es/targetConditionGroup/components/conditionItem.js +81 -108
- package/es/targetConditionGroup/data/operates.js +5 -5
- package/es/targetConditionGroup/demo/group.d.ts +2 -0
- package/es/targetConditionGroup/demo/group.js +42 -0
- package/es/targetConditionGroup/demo/index.js +15 -25
- package/es/targetConditionGroup/group.d.ts +56 -0
- package/es/targetConditionGroup/group.js +204 -0
- package/es/targetConditionGroup/index.d.ts +6 -0
- package/es/targetConditionGroup/index.js +148 -83
- package/es/targetConditionGroup/index.less +12 -0
- package/es/targetConditionGroup/type.d.ts +47 -2
- package/es/targetSelector/demo/form.js +1 -1
- package/es/targetSelector/demo/index.js +1 -1
- package/es/targetSelector/index.d.ts +17 -1
- package/es/targetSelector/index.js +56 -10
- package/package.json +1 -1
package/es/dialog/index.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { FormItemProps, ModalProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
interface BizObjectDefaultProps {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
interface fieldNamesProps {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
3
10
|
interface FieldProps {
|
|
11
|
+
/**
|
|
12
|
+
* @description form.item名称
|
|
13
|
+
* @default -
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
4
16
|
/**
|
|
5
17
|
* @description form.item类型
|
|
6
18
|
* @default input
|
|
@@ -11,13 +23,18 @@ interface FieldProps {
|
|
|
11
23
|
* @default -
|
|
12
24
|
*/
|
|
13
25
|
value?: string | number;
|
|
26
|
+
/**
|
|
27
|
+
* @description form.item 依赖项及其值 {age:20}
|
|
28
|
+
* @default -
|
|
29
|
+
*/
|
|
30
|
+
dependenceFields?: BizObjectDefaultProps;
|
|
14
31
|
/**
|
|
15
32
|
* @description 提示
|
|
16
33
|
* @default -
|
|
17
34
|
*/
|
|
18
35
|
placeholder?: string;
|
|
19
36
|
/**
|
|
20
|
-
* @description form.item
|
|
37
|
+
* @description form.item 排列方向 'horizontal' | 'vertical'
|
|
21
38
|
* @default horizontal
|
|
22
39
|
*/
|
|
23
40
|
direction?: 'horizontal' | 'vertical';
|
|
@@ -26,11 +43,26 @@ interface FieldProps {
|
|
|
26
43
|
* @default -
|
|
27
44
|
*/
|
|
28
45
|
options?: Array<any>;
|
|
46
|
+
/**
|
|
47
|
+
* @description 扩展名称
|
|
48
|
+
* @default -
|
|
49
|
+
*/
|
|
50
|
+
extendName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* @description 下拉框的自定义节点 label、value
|
|
53
|
+
* @default { label: 'label', value: 'value' }
|
|
54
|
+
*/
|
|
55
|
+
fieldNames?: fieldNamesProps;
|
|
29
56
|
/**
|
|
30
57
|
* @description 影响的表单项
|
|
31
58
|
* @default -
|
|
32
59
|
*/
|
|
33
60
|
children?: Array<string>;
|
|
61
|
+
/**
|
|
62
|
+
* @description 值发生改变
|
|
63
|
+
* @default -
|
|
64
|
+
*/
|
|
65
|
+
onChange?: () => void;
|
|
34
66
|
}
|
|
35
67
|
interface BizDialogProps {
|
|
36
68
|
/**
|
|
@@ -64,5 +96,5 @@ interface BizDialogProps {
|
|
|
64
96
|
*/
|
|
65
97
|
onCancel?: () => void;
|
|
66
98
|
}
|
|
67
|
-
declare const BizDialog: React.FC<ModalProps & BizDialogProps>;
|
|
99
|
+
declare const BizDialog: React.FC<ModalProps & BizDialogProps & FormItemProps>;
|
|
68
100
|
export default BizDialog;
|
package/es/dialog/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
var _excluded = ["width", "initialValues", "fields", "visible", "showMark", "layout", "onOk", "onCancel"];
|
|
2
|
+
|
|
3
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
|
+
|
|
1
5
|
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; }
|
|
2
6
|
|
|
3
7
|
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; }
|
|
@@ -24,6 +28,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
28
|
|
|
25
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
30
|
|
|
31
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
32
|
+
|
|
33
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
34
|
+
|
|
27
35
|
import { Form, Input, Modal, Radio, Space } from 'antd';
|
|
28
36
|
import React, { useEffect, useState } from 'react';
|
|
29
37
|
import BizSelectToInput from './components/selectToInput';
|
|
@@ -34,8 +42,6 @@ import BizList from './components/list';
|
|
|
34
42
|
var BizDialog = function BizDialog(props) {
|
|
35
43
|
var _props$width = props.width,
|
|
36
44
|
width = _props$width === void 0 ? 520 : _props$width,
|
|
37
|
-
_props$title = props.title,
|
|
38
|
-
title = _props$title === void 0 ? 'Title' : _props$title,
|
|
39
45
|
initialValues = props.initialValues,
|
|
40
46
|
fields = props.fields,
|
|
41
47
|
_props$visible = props.visible,
|
|
@@ -45,7 +51,8 @@ var BizDialog = function BizDialog(props) {
|
|
|
45
51
|
_props$layout = props.layout,
|
|
46
52
|
layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
|
|
47
53
|
_onOk = props.onOk,
|
|
48
|
-
_onCancel = props.onCancel
|
|
54
|
+
_onCancel = props.onCancel,
|
|
55
|
+
res = _objectWithoutProperties(props, _excluded);
|
|
49
56
|
|
|
50
57
|
var _Form$useForm = Form.useForm(),
|
|
51
58
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
@@ -56,74 +63,74 @@ var BizDialog = function BizDialog(props) {
|
|
|
56
63
|
formFields = _useState2[0],
|
|
57
64
|
setFormFields = _useState2[1];
|
|
58
65
|
|
|
59
|
-
var getFormItem = function getFormItem(
|
|
60
|
-
var type =
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
var getFormItem = function getFormItem(_ref) {
|
|
67
|
+
var type = _ref.type,
|
|
68
|
+
label = _ref.label,
|
|
69
|
+
options = _ref.options,
|
|
70
|
+
placeholder = _ref.placeholder,
|
|
71
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
72
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
73
|
+
label: 'label',
|
|
74
|
+
value: 'value'
|
|
75
|
+
} : _ref$fieldNames,
|
|
76
|
+
extendName = _ref.extendName,
|
|
77
|
+
direction = _ref.direction,
|
|
78
|
+
onChange = _ref.onChange;
|
|
63
79
|
|
|
64
80
|
if (type === 'selectToInput') {
|
|
65
81
|
return /*#__PURE__*/React.createElement(BizSelectToInput, {
|
|
66
|
-
name:
|
|
82
|
+
name: label,
|
|
67
83
|
options: options,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var arr = [];
|
|
73
|
-
fields.forEach(function (item) {
|
|
74
|
-
var field = _objectSpread({}, item);
|
|
75
|
-
|
|
76
|
-
if (children.indexOf(item.name) > -1) {
|
|
77
|
-
field.hidden = isSelect;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
arr.push(field);
|
|
81
|
-
});
|
|
82
|
-
setFormFields(function () {
|
|
83
|
-
return [].concat(arr);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
84
|
+
fieldNames: fieldNames,
|
|
85
|
+
extendName: extendName,
|
|
86
|
+
onChange: onChange
|
|
87
87
|
});
|
|
88
88
|
} else if (type === 'select') {
|
|
89
89
|
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
90
90
|
options: options,
|
|
91
|
-
name:
|
|
92
|
-
size: "middle"
|
|
91
|
+
name: label,
|
|
92
|
+
size: "middle",
|
|
93
|
+
onChange: onChange
|
|
93
94
|
});
|
|
94
95
|
} else if (type === 'input') {
|
|
95
96
|
return /*#__PURE__*/React.createElement(Input, {
|
|
96
97
|
className: "biz-input",
|
|
97
|
-
placeholder:
|
|
98
|
+
placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
|
|
98
99
|
autoComplete: "off",
|
|
99
100
|
allowClear: {
|
|
100
101
|
clearIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
101
102
|
className: "biz-icon",
|
|
102
103
|
type: 'icon-qingchu'
|
|
103
104
|
})
|
|
104
|
-
}
|
|
105
|
+
},
|
|
106
|
+
onChange: onChange
|
|
105
107
|
});
|
|
106
108
|
} else if (type === 'password') {
|
|
107
109
|
return /*#__PURE__*/React.createElement(Input.Password, {
|
|
108
110
|
className: "biz-input",
|
|
109
|
-
placeholder:
|
|
111
|
+
placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
|
|
112
|
+
onChange: onChange
|
|
110
113
|
});
|
|
111
114
|
} else if (type === 'tab') {
|
|
112
115
|
return /*#__PURE__*/React.createElement(BizTab, {
|
|
113
|
-
options: options
|
|
116
|
+
options: options,
|
|
117
|
+
onChange: onChange
|
|
114
118
|
});
|
|
115
119
|
} else if (type === 'radio') {
|
|
116
|
-
return /*#__PURE__*/React.createElement(Radio.Group,
|
|
117
|
-
|
|
118
|
-
},
|
|
120
|
+
return /*#__PURE__*/React.createElement(Radio.Group, {
|
|
121
|
+
onChange: onChange
|
|
122
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
123
|
+
direction: direction || 'horizontal'
|
|
124
|
+
}, options && options.map(function (item) {
|
|
119
125
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
120
|
-
key: item.value,
|
|
121
|
-
value: item.value
|
|
122
|
-
}, item.label);
|
|
126
|
+
key: item[fieldNames.value],
|
|
127
|
+
value: item[fieldNames.value]
|
|
128
|
+
}, item[fieldNames.label]);
|
|
123
129
|
})));
|
|
124
130
|
} else if (type === 'list') {
|
|
125
131
|
return /*#__PURE__*/React.createElement(BizList, {
|
|
126
|
-
options: options.length > 0 ? options : undefined
|
|
132
|
+
options: options && options.length > 0 ? options : undefined,
|
|
133
|
+
onChange: onChange
|
|
127
134
|
});
|
|
128
135
|
}
|
|
129
136
|
};
|
|
@@ -138,11 +145,10 @@ var BizDialog = function BizDialog(props) {
|
|
|
138
145
|
return _toConsumableArray(fields);
|
|
139
146
|
});
|
|
140
147
|
}, [fields]);
|
|
141
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
148
|
+
return /*#__PURE__*/React.createElement(Modal, _objectSpread(_objectSpread({
|
|
142
149
|
width: width,
|
|
143
150
|
centered: true,
|
|
144
151
|
visible: visible,
|
|
145
|
-
title: title,
|
|
146
152
|
maskStyle: {
|
|
147
153
|
background: '#021429',
|
|
148
154
|
opacity: 0.8
|
|
@@ -152,7 +158,8 @@ var BizDialog = function BizDialog(props) {
|
|
|
152
158
|
},
|
|
153
159
|
cancelText: "\u53D6\u6D88",
|
|
154
160
|
okText: "\u786E\u5B9A",
|
|
155
|
-
closable: false
|
|
161
|
+
closable: false
|
|
162
|
+
}, res), {}, {
|
|
156
163
|
onCancel: function onCancel() {
|
|
157
164
|
return _onCancel && _onCancel();
|
|
158
165
|
},
|
|
@@ -163,7 +170,7 @@ var BizDialog = function BizDialog(props) {
|
|
|
163
170
|
console.log('Validate Failed:', info);
|
|
164
171
|
});
|
|
165
172
|
}
|
|
166
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
173
|
+
}), /*#__PURE__*/React.createElement(Form, {
|
|
167
174
|
className: "biz-dialog",
|
|
168
175
|
form: form,
|
|
169
176
|
name: "form_in_modal",
|
|
@@ -171,17 +178,84 @@ var BizDialog = function BizDialog(props) {
|
|
|
171
178
|
initialValues: initialValues,
|
|
172
179
|
layout: layout
|
|
173
180
|
}, formFields === null || formFields === void 0 ? void 0 : formFields.map(function (item, index) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
// 判断是否有依赖项,如果依赖项的值符合,则展示,否则不展示
|
|
182
|
+
if (item.dependenceFields && Object.keys(item.dependenceFields).length > 0) {
|
|
183
|
+
var keys = Object.keys(item.dependenceFields);
|
|
184
|
+
var dependenceFields = item.dependenceFields;
|
|
185
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
186
|
+
key: item.name,
|
|
187
|
+
noStyle: true,
|
|
188
|
+
shouldUpdate: function shouldUpdate(prevValues, curValues) {
|
|
189
|
+
var flag = false;
|
|
190
|
+
|
|
191
|
+
var _iterator = _createForOfIteratorHelper(keys),
|
|
192
|
+
_step;
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
196
|
+
var key = _step.value;
|
|
197
|
+
|
|
198
|
+
if (prevValues[key] !== curValues[key]) {
|
|
199
|
+
flag = true;
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
} catch (err) {
|
|
204
|
+
_iterator.e(err);
|
|
205
|
+
} finally {
|
|
206
|
+
_iterator.f();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return flag;
|
|
210
|
+
}
|
|
211
|
+
}, function (_ref2) {
|
|
212
|
+
var getFieldValue = _ref2.getFieldValue;
|
|
213
|
+
var flag = true;
|
|
214
|
+
|
|
215
|
+
var _iterator2 = _createForOfIteratorHelper(keys),
|
|
216
|
+
_step2;
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
220
|
+
var key = _step2.value;
|
|
221
|
+
|
|
222
|
+
if (getFieldValue(key) !== dependenceFields[key]) {
|
|
223
|
+
flag = false;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
} catch (err) {
|
|
228
|
+
_iterator2.e(err);
|
|
229
|
+
} finally {
|
|
230
|
+
_iterator2.f();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return flag ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
234
|
+
label: item.label,
|
|
235
|
+
name: item.name,
|
|
236
|
+
hidden: item.hidden,
|
|
237
|
+
rules: item.rules,
|
|
238
|
+
help: item.help,
|
|
239
|
+
wrapperCol: {
|
|
240
|
+
offset: !item.label && layout === 'horizontal' ? 2 : 0
|
|
241
|
+
},
|
|
242
|
+
shouldUpdate: true
|
|
243
|
+
}, getFormItem(item)) : null;
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
247
|
+
key: item.name,
|
|
248
|
+
label: item.label,
|
|
249
|
+
name: item.name,
|
|
250
|
+
hidden: item.hidden,
|
|
251
|
+
rules: item.rules,
|
|
252
|
+
help: item.help,
|
|
253
|
+
wrapperCol: {
|
|
254
|
+
offset: !item.label && layout === 'horizontal' ? 2 : 0
|
|
255
|
+
},
|
|
256
|
+
shouldUpdate: true
|
|
257
|
+
}, getFormItem(item));
|
|
258
|
+
}
|
|
185
259
|
})));
|
|
186
260
|
};
|
|
187
261
|
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
&.ant-form-horizontal .ant-form-item-label > label {
|
|
45
45
|
height: 40px;
|
|
46
46
|
}
|
|
47
|
+
|
|
47
48
|
&.ant-form-vertical .ant-form-item-label {
|
|
48
49
|
margin-bottom: 12px;
|
|
49
50
|
color: @titleColor;
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.ant-modal-footer {
|
|
54
|
-
padding
|
|
55
|
+
padding: 0 24px 24px 24px;
|
|
55
56
|
border-top: none;
|
|
56
57
|
|
|
57
58
|
.ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
|
|
@@ -67,10 +68,19 @@
|
|
|
67
68
|
color: #000;
|
|
68
69
|
font-weight: 500;
|
|
69
70
|
font-size: 24px;
|
|
71
|
+
line-height: 24px;
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
.ant-modal-body {
|
|
74
76
|
max-height: 400px;
|
|
77
|
+
padding-bottom: 0;
|
|
75
78
|
overflow: auto;
|
|
76
79
|
}
|
|
80
|
+
|
|
81
|
+
.biz-form-radio {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 40px;
|
|
84
|
+
color: @titleColor;
|
|
85
|
+
line-height: 40px;
|
|
86
|
+
}
|
|
@@ -45,6 +45,8 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
45
45
|
options = _props$options === void 0 ? [] : _props$options,
|
|
46
46
|
defaultValue = props.defaultValue,
|
|
47
47
|
value = props.value,
|
|
48
|
+
_props$showAll = props.showAll,
|
|
49
|
+
showAll = _props$showAll === void 0 ? true : _props$showAll,
|
|
48
50
|
_props$fieldNames = props.fieldNames,
|
|
49
51
|
fieldNames = _props$fieldNames === void 0 ? {
|
|
50
52
|
label: 'name',
|
|
@@ -119,10 +121,15 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
119
121
|
eventOptions = _useState18[0],
|
|
120
122
|
setEventOptions = _useState18[1];
|
|
121
123
|
|
|
122
|
-
var _useState19 = useState(
|
|
124
|
+
var _useState19 = useState(true),
|
|
123
125
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
showOverview = _useState20[0],
|
|
127
|
+
setShowOverview = _useState20[1];
|
|
128
|
+
|
|
129
|
+
var _useState21 = useState(aliasName),
|
|
130
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
131
|
+
alias = _useState22[0],
|
|
132
|
+
setAlias = _useState22[1];
|
|
126
133
|
|
|
127
134
|
useEffect(function () {
|
|
128
135
|
setAlias(function () {
|
|
@@ -134,8 +141,9 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
134
141
|
var initValue = function initValue() {
|
|
135
142
|
// 所有的option
|
|
136
143
|
var firstGroup = {};
|
|
137
|
-
firstGroup[fieldNames.groupLabel] = '整体概览';
|
|
138
|
-
|
|
144
|
+
firstGroup[fieldNames.groupLabel] = '所有分组'; // firstGroup[fieldNames.groupLabel] = '整体概览';
|
|
145
|
+
|
|
146
|
+
firstGroup[fieldNames.groupValue] = -2;
|
|
139
147
|
firstGroup[fieldNames.children] = [];
|
|
140
148
|
|
|
141
149
|
var _iterator = _createForOfIteratorHelper(options),
|
|
@@ -166,11 +174,24 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
166
174
|
_iterator.f();
|
|
167
175
|
}
|
|
168
176
|
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
var result = JSON.parse(JSON.stringify(eventOptions));
|
|
178
|
+
|
|
179
|
+
if (result.length > 1) {
|
|
180
|
+
result = [firstGroup].concat(_toConsumableArray(result));
|
|
181
|
+
} // // 丢弃事件分组不显示
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
var index = result.findIndex(function (group) {
|
|
185
|
+
return group.groupName === '丢弃事件';
|
|
171
186
|
});
|
|
172
|
-
|
|
173
|
-
|
|
187
|
+
if (index > -1) result.splice(index, 1);
|
|
188
|
+
setEventOptions(function (option) {
|
|
189
|
+
return _toConsumableArray(result); // return [firstGroup, ...option];
|
|
190
|
+
}); // setGroup(firstGroup);
|
|
191
|
+
// setGroup2(firstGroup);
|
|
192
|
+
|
|
193
|
+
setGroup(result[0]);
|
|
194
|
+
setGroup2(result[0]);
|
|
174
195
|
};
|
|
175
196
|
|
|
176
197
|
if (options && options.length > 0) {
|
|
@@ -195,42 +216,87 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
195
216
|
if (!inValue || inValue === {}) return;
|
|
196
217
|
var id = _typeof(inValue) === 'object' ? inValue[fieldNames.value] : inValue;
|
|
197
218
|
if (event && event[fieldNames.value] === id) return;
|
|
219
|
+
var eid = id.split(',');
|
|
198
220
|
|
|
199
|
-
|
|
200
|
-
|
|
221
|
+
if (parseFloat(eid[0]) < 0) {
|
|
222
|
+
// 事件概览
|
|
223
|
+
if (eid[1] < 0) {
|
|
224
|
+
setEvent(function () {
|
|
225
|
+
var _ref;
|
|
201
226
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
227
|
+
return _ref = {}, _defineProperty(_ref, fieldNames.value, id), _defineProperty(_ref, fieldNames.label, '事件概览'), _ref;
|
|
228
|
+
});
|
|
229
|
+
setGroup(function () {
|
|
230
|
+
var _ref2;
|
|
206
231
|
|
|
207
|
-
|
|
208
|
-
|
|
232
|
+
return _ref2 = {}, _defineProperty(_ref2, fieldNames.groupLabel, '所有分组'), _defineProperty(_ref2, fieldNames.groupValue, -2), _ref2;
|
|
233
|
+
});
|
|
234
|
+
} else {
|
|
235
|
+
var _iterator3 = _createForOfIteratorHelper(eventOptions),
|
|
236
|
+
_step3;
|
|
209
237
|
|
|
210
238
|
try {
|
|
211
239
|
var _loop = function _loop() {
|
|
212
|
-
var
|
|
240
|
+
var option = _step3.value;
|
|
213
241
|
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
242
|
+
if (option[fieldNames.groupValue] === eid[1]) {
|
|
243
|
+
setGroup(function () {
|
|
244
|
+
var _ref3;
|
|
245
|
+
|
|
246
|
+
return _ref3 = {}, _defineProperty(_ref3, fieldNames.groupLabel, option[fieldNames.groupLabel]), _defineProperty(_ref3, fieldNames.groupValue, option[fieldNames.groupValue]), _ref3;
|
|
217
247
|
});
|
|
248
|
+
return "break";
|
|
218
249
|
}
|
|
219
250
|
};
|
|
220
251
|
|
|
221
|
-
for (
|
|
222
|
-
_loop();
|
|
252
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
253
|
+
var _ret = _loop();
|
|
254
|
+
|
|
255
|
+
if (_ret === "break") break;
|
|
223
256
|
}
|
|
224
257
|
} catch (err) {
|
|
225
|
-
|
|
258
|
+
_iterator3.e(err);
|
|
226
259
|
} finally {
|
|
227
|
-
|
|
260
|
+
_iterator3.f();
|
|
228
261
|
}
|
|
229
262
|
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
263
|
+
} else {
|
|
264
|
+
var _iterator4 = _createForOfIteratorHelper(options),
|
|
265
|
+
_step4;
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
269
|
+
var option = _step4.value;
|
|
270
|
+
var children = option[fieldNames.children] || [];
|
|
271
|
+
|
|
272
|
+
var _iterator5 = _createForOfIteratorHelper(children),
|
|
273
|
+
_step5;
|
|
274
|
+
|
|
275
|
+
try {
|
|
276
|
+
var _loop2 = function _loop2() {
|
|
277
|
+
var event = _step5.value;
|
|
278
|
+
|
|
279
|
+
if (event[fieldNames.value] == id) {
|
|
280
|
+
setEvent(function () {
|
|
281
|
+
return _objectSpread({}, event);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
287
|
+
_loop2();
|
|
288
|
+
}
|
|
289
|
+
} catch (err) {
|
|
290
|
+
_iterator5.e(err);
|
|
291
|
+
} finally {
|
|
292
|
+
_iterator5.f();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
} catch (err) {
|
|
296
|
+
_iterator4.e(err);
|
|
297
|
+
} finally {
|
|
298
|
+
_iterator4.f();
|
|
299
|
+
}
|
|
234
300
|
}
|
|
235
301
|
}, [defaultValue, value]); // 更改group后,事件列表响应
|
|
236
302
|
|
|
@@ -245,9 +311,20 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
245
311
|
size = group[fieldNames.children].length;
|
|
246
312
|
}
|
|
247
313
|
|
|
314
|
+
if (showOverview) {
|
|
315
|
+
var _arr$unshift;
|
|
316
|
+
|
|
317
|
+
arr.unshift((_arr$unshift = {}, _defineProperty(_arr$unshift, fieldNames.value, "-2,".concat(group[fieldNames.groupValue])), _defineProperty(_arr$unshift, fieldNames.label, '事件概览'), _arr$unshift));
|
|
318
|
+
}
|
|
319
|
+
|
|
248
320
|
setEventData(arr);
|
|
249
321
|
setEventCount(size);
|
|
250
|
-
}, [group]);
|
|
322
|
+
}, [group]);
|
|
323
|
+
useEffect(function () {
|
|
324
|
+
setShowOverview(function () {
|
|
325
|
+
return showAll;
|
|
326
|
+
});
|
|
327
|
+
}, [showAll]); // 初始化搜索框
|
|
251
328
|
|
|
252
329
|
useEffect(function () {
|
|
253
330
|
setSearchValue(function () {
|
|
@@ -285,7 +362,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
285
362
|
}
|
|
286
363
|
}, /*#__PURE__*/React.createElement("div", {
|
|
287
364
|
className: "biz-input"
|
|
288
|
-
}, event[fieldNames.label] ? event[fieldNames.label] : /*#__PURE__*/React.createElement("span", {
|
|
365
|
+
}, event[fieldNames.label] ? event[fieldNames.label] === '事件概览' ? "".concat(group[fieldNames.groupLabel], "/").concat(event[fieldNames.label]) : event[fieldNames.label] : /*#__PURE__*/React.createElement("span", {
|
|
289
366
|
className: "biz-placeholder"
|
|
290
367
|
}, placeholder), /*#__PURE__*/React.createElement("span", null, alias && alias !== '' && "(".concat(alias, ")"))), /*#__PURE__*/React.createElement(IconFont, {
|
|
291
368
|
className: "biz-select-zhankai",
|
|
@@ -299,7 +376,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
299
376
|
|
|
300
377
|
return /*#__PURE__*/React.createElement("div", {
|
|
301
378
|
className: "biz-dropdown-item ".concat(menu[fieldNames.groupValue] === group[fieldNames.groupValue] && 'box-hover'),
|
|
302
|
-
key: menu[fieldNames.groupValue],
|
|
379
|
+
key: menu[fieldNames.groupValue] || 'key' + index,
|
|
303
380
|
onMouseEnter: function onMouseEnter(e) {
|
|
304
381
|
e.stopPropagation();
|
|
305
382
|
setGroup(function () {
|
|
@@ -359,6 +436,8 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
359
436
|
setShowDropdown(false);
|
|
360
437
|
|
|
361
438
|
if (onChange) {
|
|
439
|
+
item.groupId = group[fieldNames.groupValue];
|
|
440
|
+
|
|
362
441
|
if (responseType === 'id') {
|
|
363
442
|
onChange(item[fieldNames.value], item);
|
|
364
443
|
} else {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AttrGroup } from '../targetConditionGroup/type';
|
|
2
3
|
interface AttrType {
|
|
3
4
|
attrId?: string;
|
|
4
5
|
[props: string]: any;
|
|
@@ -12,12 +13,12 @@ interface GlobalAttributeProps {
|
|
|
12
13
|
* @description 默认值
|
|
13
14
|
* @default {}
|
|
14
15
|
*/
|
|
15
|
-
defaultValue?:
|
|
16
|
+
defaultValue?: AttrGroup;
|
|
16
17
|
/**
|
|
17
18
|
* @description 默认值
|
|
18
19
|
* @default {}
|
|
19
20
|
*/
|
|
20
|
-
value?:
|
|
21
|
+
value?: AttrGroup;
|
|
21
22
|
/**
|
|
22
23
|
* @description 数据化配置选项内容
|
|
23
24
|
* @description.zh-CN
|