@zgfe/business-lib 1.0.0-beta.1
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/README.md +12 -0
- package/es/analysisLayout/demo/index.d.ts +3 -0
- package/es/analysisLayout/demo/index.js +30 -0
- package/es/analysisLayout/demo/index.less +12 -0
- package/es/analysisLayout/index.d.ts +13 -0
- package/es/analysisLayout/index.js +153 -0
- package/es/analysisLayout/index.less +115 -0
- package/es/attributeSelector/data/env.d.ts +11 -0
- package/es/attributeSelector/data/env.js +181 -0
- package/es/attributeSelector/data/event.d.ts +237 -0
- package/es/attributeSelector/data/event.js +3483 -0
- package/es/attributeSelector/data/user.d.ts +22 -0
- package/es/attributeSelector/data/user.js +218 -0
- package/es/attributeSelector/demo/multi.d.ts +2 -0
- package/es/attributeSelector/demo/multi.js +39 -0
- package/es/attributeSelector/demo/multiForm.d.ts +2 -0
- package/es/attributeSelector/demo/multiForm.js +64 -0
- package/es/attributeSelector/demo/single.d.ts +2 -0
- package/es/attributeSelector/demo/single.js +43 -0
- package/es/attributeSelector/demo/singleForm.d.ts +2 -0
- package/es/attributeSelector/demo/singleForm.js +66 -0
- package/es/attributeSelector/group.d.ts +31 -0
- package/es/attributeSelector/group.js +225 -0
- package/es/attributeSelector/index.d.ts +110 -0
- package/es/attributeSelector/index.js +578 -0
- package/es/attributeSelector/index.less +172 -0
- package/es/chart/chartConfig.d.ts +28 -0
- package/es/chart/chartConfig.js +256 -0
- package/es/chart/color.d.ts +1 -0
- package/es/chart/color.js +1 -0
- package/es/chart/demo/bar.d.ts +2 -0
- package/es/chart/demo/bar.js +19 -0
- package/es/chart/demo/data.d.ts +11 -0
- package/es/chart/demo/data.js +37 -0
- package/es/chart/demo/index.d.ts +2 -0
- package/es/chart/demo/index.js +9 -0
- package/es/chart/demo/pie.d.ts +2 -0
- package/es/chart/demo/pie.js +30 -0
- package/es/chart/index.d.ts +63 -0
- package/es/chart/index.js +76 -0
- package/es/chart/index.less +38 -0
- package/es/chart/style/circle.svg +4 -0
- package/es/commonStyle/icon.less +147 -0
- package/es/commonStyle/index.less +171 -0
- package/es/commonStyle/select.less +101 -0
- package/es/commonStyle/theme.less +432 -0
- package/es/commonStyle/variable.less +124 -0
- package/es/datePicker/data.d.ts +9 -0
- package/es/datePicker/data.js +65 -0
- package/es/datePicker/demo/form.d.ts +2 -0
- package/es/datePicker/demo/form.js +53 -0
- package/es/datePicker/demo/index.d.ts +2 -0
- package/es/datePicker/demo/index.js +30 -0
- package/es/datePicker/index.d.ts +29 -0
- package/es/datePicker/index.js +207 -0
- package/es/datePicker/index.less +388 -0
- package/es/dialog/components/list.d.ts +15 -0
- package/es/dialog/components/list.js +57 -0
- package/es/dialog/components/selectToInput.d.ts +43 -0
- package/es/dialog/components/selectToInput.js +107 -0
- package/es/dialog/components/style/list.less +59 -0
- package/es/dialog/components/style/tab.less +61 -0
- package/es/dialog/components/tab.d.ts +9 -0
- package/es/dialog/components/tab.js +50 -0
- package/es/dialog/data/chart.d.ts +11 -0
- package/es/dialog/data/chart.js +62 -0
- package/es/dialog/demo/index.d.ts +2 -0
- package/es/dialog/demo/index.js +122 -0
- package/es/dialog/demo/index2.d.ts +2 -0
- package/es/dialog/demo/index2.js +79 -0
- package/es/dialog/demo/index3.d.ts +2 -0
- package/es/dialog/demo/index3.js +61 -0
- package/es/dialog/index.d.ts +68 -0
- package/es/dialog/index.js +188 -0
- package/es/dialog/style/index.less +70 -0
- package/es/eventSelector/cascade.less +120 -0
- package/es/eventSelector/demo/form.d.ts +2 -0
- package/es/eventSelector/demo/form.js +89 -0
- package/es/eventSelector/demo/index.d.ts +2 -0
- package/es/eventSelector/demo/index.js +69 -0
- package/es/eventSelector/demo/nodata.d.ts +2 -0
- package/es/eventSelector/demo/nodata.js +13 -0
- package/es/eventSelector/index.d.ts +27 -0
- package/es/eventSelector/index.js +390 -0
- package/es/eventSelector/type.d.ts +41 -0
- package/es/eventSelector/type.js +1 -0
- package/es/globalAttributes/demo/data/env.d.ts +11 -0
- package/es/globalAttributes/demo/data/env.js +181 -0
- package/es/globalAttributes/demo/data/event.d.ts +237 -0
- package/es/globalAttributes/demo/data/event.js +3483 -0
- package/es/globalAttributes/demo/data/user.d.ts +22 -0
- package/es/globalAttributes/demo/data/user.js +218 -0
- package/es/globalAttributes/demo/index.d.ts +2 -0
- package/es/globalAttributes/demo/index.js +50 -0
- package/es/globalAttributes/index.d.ts +46 -0
- package/es/globalAttributes/index.js +116 -0
- package/es/index.d.ts +23 -0
- package/es/index.js +25 -0
- package/es/multipleSelector/demo/index.d.ts +2 -0
- package/es/multipleSelector/demo/index.js +35 -0
- package/es/multipleSelector/index.d.ts +36 -0
- package/es/multipleSelector/index.js +109 -0
- package/es/multipleSelector/index.less +138 -0
- package/es/select/demo/index.d.ts +2 -0
- package/es/select/demo/index.js +22 -0
- package/es/select/index.d.ts +42 -0
- package/es/select/index.js +142 -0
- package/es/table/demo/data/color.d.ts +1 -0
- package/es/table/demo/data/color.js +1 -0
- package/es/table/demo/data/data.d.ts +11 -0
- package/es/table/demo/data/data.js +37 -0
- package/es/table/demo/data/table.d.ts +4 -0
- package/es/table/demo/data/table.js +37 -0
- package/es/table/demo/index.d.ts +3 -0
- package/es/table/demo/index.js +171 -0
- package/es/table/demo/index.less +8 -0
- package/es/table/demo/index2.d.ts +2 -0
- package/es/table/demo/index2.js +9 -0
- package/es/table/index.d.ts +32 -0
- package/es/table/index.js +80 -0
- package/es/table/index.less +102 -0
- package/es/targetConditionGroup/components/conditionGroup.d.ts +30 -0
- package/es/targetConditionGroup/components/conditionGroup.js +111 -0
- package/es/targetConditionGroup/components/conditionItem.d.ts +47 -0
- package/es/targetConditionGroup/components/conditionItem.js +259 -0
- package/es/targetConditionGroup/components/style/group.less +47 -0
- package/es/targetConditionGroup/components/style/index.less +16 -0
- package/es/targetConditionGroup/data/operates.d.ts +36 -0
- package/es/targetConditionGroup/data/operates.js +98 -0
- package/es/targetConditionGroup/demo/data/env.d.ts +11 -0
- package/es/targetConditionGroup/demo/data/env.js +181 -0
- package/es/targetConditionGroup/demo/data/event.d.ts +237 -0
- package/es/targetConditionGroup/demo/data/event.js +3483 -0
- package/es/targetConditionGroup/demo/data/user.d.ts +22 -0
- package/es/targetConditionGroup/demo/data/user.js +218 -0
- package/es/targetConditionGroup/demo/form.d.ts +2 -0
- package/es/targetConditionGroup/demo/form.js +96 -0
- package/es/targetConditionGroup/demo/index.d.ts +2 -0
- package/es/targetConditionGroup/demo/index.js +73 -0
- package/es/targetConditionGroup/demo/item.d.ts +2 -0
- package/es/targetConditionGroup/demo/item.js +5 -0
- package/es/targetConditionGroup/index.d.ts +53 -0
- package/es/targetConditionGroup/index.js +265 -0
- package/es/targetConditionGroup/index.less +65 -0
- package/es/targetConditionGroup/type.d.ts +50 -0
- package/es/targetConditionGroup/type.js +1 -0
- package/es/targetSelector/components/BizCascadeBox.d.ts +34 -0
- package/es/targetSelector/components/BizCascadeBox.js +213 -0
- package/es/targetSelector/components/BizEventNameEditBox.d.ts +20 -0
- package/es/targetSelector/components/BizEventNameEditBox.js +57 -0
- package/es/targetSelector/demo/form.d.ts +2 -0
- package/es/targetSelector/demo/form.js +133 -0
- package/es/targetSelector/demo/index.d.ts +2 -0
- package/es/targetSelector/demo/index.js +107 -0
- package/es/targetSelector/demo/nodata.d.ts +2 -0
- package/es/targetSelector/demo/nodata.js +13 -0
- package/es/targetSelector/index.d.ts +40 -0
- package/es/targetSelector/index.js +204 -0
- package/es/targetSelector/index.less +53 -0
- package/es/userGroup/demo/cluster.d.ts +3 -0
- package/es/userGroup/demo/cluster.js +102 -0
- package/es/userGroup/demo/index.d.ts +3 -0
- package/es/userGroup/demo/index.js +115 -0
- package/es/userGroup/demo/index.less +3 -0
- package/es/userGroup/index.d.ts +79 -0
- package/es/userGroup/index.js +134 -0
- package/es/userGroup/index.less +2 -0
- package/es/userGroup/userCluster.d.ts +63 -0
- package/es/userGroup/userCluster.js +254 -0
- package/es/utils/ajax.d.ts +7 -0
- package/es/utils/ajax.js +139 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.js +3 -0
- package/es/utils/type.d.ts +54 -0
- package/es/utils/type.js +1 -0
- package/es/utils/util.d.ts +67 -0
- package/es/utils/util.js +204 -0
- package/package.json +55 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
var _excluded = ["option"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
|
|
9
|
+
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."); }
|
|
10
|
+
|
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
+
|
|
13
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
+
|
|
15
|
+
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; } } }; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
24
|
+
|
|
25
|
+
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."); }
|
|
26
|
+
|
|
27
|
+
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); }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
34
|
+
|
|
35
|
+
import React, { useEffect, useState } from 'react';
|
|
36
|
+
import { BizTargetSelector, BizEventSelector, BizConditionGroup, IconFont } from '..';
|
|
37
|
+
import { Dropdown, Menu } from 'antd';
|
|
38
|
+
import { dimensionOperate } from './data/operates';
|
|
39
|
+
import './index.less';
|
|
40
|
+
import SubMenu from 'antd/lib/menu/SubMenu';
|
|
41
|
+
|
|
42
|
+
var BizTargetCondition = function BizTargetCondition(props) {
|
|
43
|
+
var _props$defaultValue = props.defaultValue,
|
|
44
|
+
defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
|
|
45
|
+
_props$value = props.value,
|
|
46
|
+
value = _props$value === void 0 ? {} : _props$value,
|
|
47
|
+
options = props.options,
|
|
48
|
+
_props$max = props.max,
|
|
49
|
+
max = _props$max === void 0 ? 3 : _props$max,
|
|
50
|
+
_props$fieldNames = props.fieldNames,
|
|
51
|
+
fieldNames = _props$fieldNames === void 0 ? {
|
|
52
|
+
label: 'name',
|
|
53
|
+
value: 'id',
|
|
54
|
+
groupLabel: 'name',
|
|
55
|
+
groupValue: 'id',
|
|
56
|
+
children: 'children'
|
|
57
|
+
} : _props$fieldNames,
|
|
58
|
+
onChange = props.onChange,
|
|
59
|
+
onDelete = props.onDelete;
|
|
60
|
+
|
|
61
|
+
var _useState = useState({}),
|
|
62
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
63
|
+
targetData = _useState2[0],
|
|
64
|
+
setTargetData = _useState2[1];
|
|
65
|
+
|
|
66
|
+
var _useState3 = useState({}),
|
|
67
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
+
attrsData = _useState4[0],
|
|
69
|
+
setAttrsData = _useState4[1];
|
|
70
|
+
|
|
71
|
+
var _useState5 = useState(dimensionOperate[0]),
|
|
72
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
73
|
+
dimension = _useState6[0],
|
|
74
|
+
setDimension = _useState6[1];
|
|
75
|
+
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
var attrData = Object.keys(defaultValue).length > 0 ? defaultValue : value;
|
|
78
|
+
var attrs = attrData.attrs,
|
|
79
|
+
operator = attrData.operator,
|
|
80
|
+
eventId = attrData.eventId,
|
|
81
|
+
aliasName = attrData.aliasName,
|
|
82
|
+
dimension = attrData.dimension;
|
|
83
|
+
var arr = [];
|
|
84
|
+
|
|
85
|
+
if (attrs) {
|
|
86
|
+
arr = attrs.map(function (item) {
|
|
87
|
+
var data = _objectSpread({}, item);
|
|
88
|
+
|
|
89
|
+
var attrId = Math.random().toString();
|
|
90
|
+
return {
|
|
91
|
+
attrId: attrId,
|
|
92
|
+
data: data
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
arr = [{
|
|
97
|
+
attrId: Math.random().toString()
|
|
98
|
+
}];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (dimension) {
|
|
102
|
+
var getDefault = function getDefault(data) {
|
|
103
|
+
var _iterator = _createForOfIteratorHelper(data),
|
|
104
|
+
_step;
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
108
|
+
var _value = _step.value;
|
|
109
|
+
|
|
110
|
+
if (_value.value === dimension) {
|
|
111
|
+
return _value;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_iterator.e(err);
|
|
116
|
+
} finally {
|
|
117
|
+
_iterator.f();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
name: ''
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var _data = getDefault(dimensionOperate);
|
|
126
|
+
|
|
127
|
+
setDimension(function () {
|
|
128
|
+
return _objectSpread({}, _data);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
var data = {
|
|
133
|
+
option: eventId,
|
|
134
|
+
aliasName: aliasName
|
|
135
|
+
};
|
|
136
|
+
setTargetData(function () {
|
|
137
|
+
return _objectSpread({}, data);
|
|
138
|
+
});
|
|
139
|
+
setAttrsData(function () {
|
|
140
|
+
return {
|
|
141
|
+
operator: operator,
|
|
142
|
+
attrs: _toConsumableArray(arr)
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}, []);
|
|
146
|
+
|
|
147
|
+
var _onChange = function _onChange(target, attr) {
|
|
148
|
+
var dimensionData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : dimension;
|
|
149
|
+
var attrArray = attr.attrs ? attr.attrs.map(function (item) {
|
|
150
|
+
return item.data;
|
|
151
|
+
}) : [];
|
|
152
|
+
var operate = attrArray.length > 1 ? attr.operator : '';
|
|
153
|
+
|
|
154
|
+
var option = target.option,
|
|
155
|
+
res = _objectWithoutProperties(target, _excluded);
|
|
156
|
+
|
|
157
|
+
onChange && onChange(_objectSpread(_objectSpread({}, res), {}, {
|
|
158
|
+
dimension: dimensionData.value || '',
|
|
159
|
+
eventId: option,
|
|
160
|
+
operator: operate,
|
|
161
|
+
attrs: attrArray ? _toConsumableArray(attrArray) : []
|
|
162
|
+
}));
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
var _onDimensionClick = function _onDimensionClick(data) {
|
|
166
|
+
setDimension(function () {
|
|
167
|
+
return _objectSpread({}, data);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
_onChange(targetData, attrsData, data);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: "biz-target-condition-container"
|
|
175
|
+
}, /*#__PURE__*/React.createElement(BizTargetSelector, {
|
|
176
|
+
defaultValue: targetData,
|
|
177
|
+
onChange: function onChange(data) {
|
|
178
|
+
setTargetData(function () {
|
|
179
|
+
return _objectSpread({}, data);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
if (data.option != targetData.option) {
|
|
183
|
+
// 切换了事件
|
|
184
|
+
setAttrsData(function () {
|
|
185
|
+
return {};
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
_onChange(data, {});
|
|
189
|
+
} else {
|
|
190
|
+
// 切换别名
|
|
191
|
+
_onChange(data, _objectSpread({}, attrsData));
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
onAdd: function onAdd() {
|
|
195
|
+
if (attrsData.attrs && attrsData.attrs.length >= max) {
|
|
196
|
+
return;
|
|
197
|
+
} else {
|
|
198
|
+
setAttrsData(function (data) {
|
|
199
|
+
var arr = [{
|
|
200
|
+
attrId: Math.random().toString()
|
|
201
|
+
}];
|
|
202
|
+
|
|
203
|
+
if (!data.attrs) {
|
|
204
|
+
data.attrs = arr;
|
|
205
|
+
} else {
|
|
206
|
+
data.attrs = data.attrs.concat(arr);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return _objectSpread({}, data);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
onDelete: onDelete
|
|
214
|
+
}, /*#__PURE__*/React.createElement(BizEventSelector, {
|
|
215
|
+
fieldNames: fieldNames,
|
|
216
|
+
options: (options === null || options === void 0 ? void 0 : options.eventOption) || []
|
|
217
|
+
})), /*#__PURE__*/React.createElement(Dropdown, {
|
|
218
|
+
overlayClassName: "biz-dropdown-selector",
|
|
219
|
+
placement: "bottom",
|
|
220
|
+
overlay: /*#__PURE__*/React.createElement(Menu, null, dimensionOperate.map(function (item) {
|
|
221
|
+
if (item.children) {
|
|
222
|
+
return /*#__PURE__*/React.createElement(SubMenu, {
|
|
223
|
+
key: item.name,
|
|
224
|
+
title: item.name
|
|
225
|
+
}, item.children.map(function (sub) {
|
|
226
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
227
|
+
className: dimension.value === sub.value ? 'box-active' : '',
|
|
228
|
+
key: sub.value,
|
|
229
|
+
onClick: function onClick() {
|
|
230
|
+
_onDimensionClick(sub);
|
|
231
|
+
}
|
|
232
|
+
}, sub.name);
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
237
|
+
className: dimension.value === item.value ? 'box-active' : '',
|
|
238
|
+
key: item.value,
|
|
239
|
+
onClick: function onClick() {
|
|
240
|
+
_onDimensionClick(item);
|
|
241
|
+
}
|
|
242
|
+
}, item.name);
|
|
243
|
+
}))
|
|
244
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
245
|
+
className: "biz-select-cotainer biz-select-dimision"
|
|
246
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
247
|
+
className: "biz-select-content"
|
|
248
|
+
}, dimension.name || '', /*#__PURE__*/React.createElement(IconFont, {
|
|
249
|
+
className: "biz-select-zhankai",
|
|
250
|
+
type: 'icon-xiangxia'
|
|
251
|
+
}))))), /*#__PURE__*/React.createElement(BizConditionGroup, {
|
|
252
|
+
defaultValue: attrsData,
|
|
253
|
+
options: options === null || options === void 0 ? void 0 : options.attrOption,
|
|
254
|
+
eventIds: targetData.option,
|
|
255
|
+
onChange: function onChange(data) {
|
|
256
|
+
setAttrsData(function () {
|
|
257
|
+
return _objectSpread({}, data);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
_onChange(targetData, data);
|
|
261
|
+
}
|
|
262
|
+
}));
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export default BizTargetCondition;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import '../commonStyle/index.less';
|
|
2
|
+
@import '../commonStyle/theme.less';
|
|
3
|
+
|
|
4
|
+
.biz-attr-group-container {
|
|
5
|
+
display: flex;
|
|
6
|
+
.biz-attr-group-content {
|
|
7
|
+
flex: 1;
|
|
8
|
+
.biz-select-cotainer:nth-last-child(1) {
|
|
9
|
+
margin-bottom: 0;
|
|
10
|
+
}
|
|
11
|
+
&:nth-child(:first-child) {
|
|
12
|
+
height: 300px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
.biz-attr-group-operate {
|
|
16
|
+
position: relative;
|
|
17
|
+
width: 1px;
|
|
18
|
+
margin-right: 16px;
|
|
19
|
+
margin-left: 8px;
|
|
20
|
+
background: #ecedf0;
|
|
21
|
+
.biz-attr-operate {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 50%;
|
|
24
|
+
left: 50%;
|
|
25
|
+
width: 16px;
|
|
26
|
+
border-radius: 3px;
|
|
27
|
+
transform: translate(-50%, -50%);
|
|
28
|
+
div {
|
|
29
|
+
width: 16px;
|
|
30
|
+
height: 16px;
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
line-height: 16px;
|
|
33
|
+
text-align: center;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
.box-hover();
|
|
36
|
+
&:nth-child(:first-child) {
|
|
37
|
+
border-radius: 3px 3px 0px 0px;
|
|
38
|
+
}
|
|
39
|
+
&:nth-last-child(1) {
|
|
40
|
+
border-radius: 0px 0px 3px 3px;
|
|
41
|
+
}
|
|
42
|
+
&.active {
|
|
43
|
+
.box-active();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.biz-target-condition-container {
|
|
51
|
+
display: flex;
|
|
52
|
+
|
|
53
|
+
.biz-select-dimision {
|
|
54
|
+
flex: none;
|
|
55
|
+
width: 114px;
|
|
56
|
+
margin-left: 12px;
|
|
57
|
+
.ant-select {
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
.biz-select-content {
|
|
61
|
+
height: 32px;
|
|
62
|
+
padding: 6px 8px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface AttrType {
|
|
2
|
+
attrId?: string;
|
|
3
|
+
data?: AttrItemType;
|
|
4
|
+
[props: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface DataType {
|
|
7
|
+
attrs?: string | number | object;
|
|
8
|
+
values?: Array<string | number>;
|
|
9
|
+
operate?: string | number;
|
|
10
|
+
}
|
|
11
|
+
export interface AttrItemType {
|
|
12
|
+
attr_id?: string | number;
|
|
13
|
+
attr_name?: string;
|
|
14
|
+
params?: Array<string | number>;
|
|
15
|
+
operator?: string | number;
|
|
16
|
+
}
|
|
17
|
+
export interface ValueType {
|
|
18
|
+
operator?: string;
|
|
19
|
+
attrs?: Array<AttrType>;
|
|
20
|
+
}
|
|
21
|
+
interface Option {
|
|
22
|
+
groupValue?: string | number;
|
|
23
|
+
groupLabel?: string | number;
|
|
24
|
+
children?: Event[];
|
|
25
|
+
[prop: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export interface OptionType {
|
|
28
|
+
eventOption?: Array<Option>;
|
|
29
|
+
attrOption?: Array<object>;
|
|
30
|
+
}
|
|
31
|
+
export interface TargetCondition {
|
|
32
|
+
aliasName?: string;
|
|
33
|
+
eventId?: string | number;
|
|
34
|
+
operator?: string;
|
|
35
|
+
attrs?: Array<AttrType>;
|
|
36
|
+
dimension?: string | number;
|
|
37
|
+
}
|
|
38
|
+
export interface TargetType {
|
|
39
|
+
aliasName?: string;
|
|
40
|
+
option?: string | number;
|
|
41
|
+
}
|
|
42
|
+
export interface CurrentType {
|
|
43
|
+
operator?: string;
|
|
44
|
+
attrs?: Array<AttrType>;
|
|
45
|
+
}
|
|
46
|
+
export interface AttrObjectType {
|
|
47
|
+
dimension_sub?: string;
|
|
48
|
+
[prop: string]: any;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../cascade.less';
|
|
3
|
+
import { Event, Option } from '../../eventSelector/type';
|
|
4
|
+
interface DropDownProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 可选项数据源
|
|
7
|
+
* @default -
|
|
8
|
+
*/
|
|
9
|
+
options: Option[];
|
|
10
|
+
/**
|
|
11
|
+
* @description 选择完成后的回调
|
|
12
|
+
* @default -
|
|
13
|
+
*/
|
|
14
|
+
onChange: (selectedOptions: object) => void;
|
|
15
|
+
/**
|
|
16
|
+
* @description 默认的选中项
|
|
17
|
+
* @default -
|
|
18
|
+
*/
|
|
19
|
+
defaultValue?: Event;
|
|
20
|
+
/**
|
|
21
|
+
* @description 自定义节点 label、value 的字段
|
|
22
|
+
* @description.zh-CN
|
|
23
|
+
* @default -
|
|
24
|
+
*/
|
|
25
|
+
fieldNames?: {
|
|
26
|
+
label: string;
|
|
27
|
+
value: string;
|
|
28
|
+
groupLabel: string;
|
|
29
|
+
groupValue: string;
|
|
30
|
+
};
|
|
31
|
+
onFocusChange?: (value: boolean) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const BizEventSelector: React.FC<DropDownProps>;
|
|
34
|
+
export default BizEventSelector;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
var _excluded = ["children"];
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
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."); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
+
|
|
23
|
+
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
|
+
|
|
25
|
+
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); }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 级联下拉框
|
|
35
|
+
*/
|
|
36
|
+
import { Input, List, Skeleton } from 'antd';
|
|
37
|
+
import React, { useEffect, useState } from 'react';
|
|
38
|
+
import '../cascade.less';
|
|
39
|
+
import { UserOutlined } from '@ant-design/icons';
|
|
40
|
+
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
41
|
+
export var BizEventSelector = function BizEventSelector(props) {
|
|
42
|
+
// export const BizEventSelector = (props: DropDownProps, ref: any) => {
|
|
43
|
+
var defaultValue = props.defaultValue,
|
|
44
|
+
_props$fieldNames = props.fieldNames,
|
|
45
|
+
fieldNames = _props$fieldNames === void 0 ? {
|
|
46
|
+
label: 'name',
|
|
47
|
+
value: 'id',
|
|
48
|
+
groupLabel: 'name',
|
|
49
|
+
groupValue: 'id'
|
|
50
|
+
} : _props$fieldNames,
|
|
51
|
+
options = props.options,
|
|
52
|
+
onChange = props.onChange,
|
|
53
|
+
onFocusChange = props.onFocusChange; // 分组(下拉框第一列)信息,用于存储hover的信息,(事件搜索后)
|
|
54
|
+
|
|
55
|
+
var _useState = useState([]),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
group = _useState2[0],
|
|
58
|
+
setGroup = _useState2[1]; // 分组(下拉框第一列)信息, 原始信息
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
var _useState3 = useState([]),
|
|
62
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
+
group2 = _useState4[0],
|
|
64
|
+
setGroup2 = _useState4[1]; // group的children数量
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
var _useState5 = useState(0),
|
|
68
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
69
|
+
eventCount = _useState6[0],
|
|
70
|
+
setEventCount = _useState6[1]; // 搜索框是否是聚焦状态
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
var _useState7 = useState(false),
|
|
74
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
75
|
+
focused = _useState8[0],
|
|
76
|
+
setFocused = _useState8[1]; // 第二列数据 虚拟滚动,每次滚动10条
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
var _useState9 = useState([]),
|
|
80
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
81
|
+
eventData = _useState10[0],
|
|
82
|
+
setEventData = _useState10[1];
|
|
83
|
+
|
|
84
|
+
var _useState11 = useState({}),
|
|
85
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
86
|
+
event = _useState12[0],
|
|
87
|
+
setEvent = _useState12[1]; // 搜索值
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
var _useState13 = useState(''),
|
|
91
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
92
|
+
searchValue = _useState14[0],
|
|
93
|
+
setSearchValue = _useState14[1];
|
|
94
|
+
|
|
95
|
+
var pagesize = 9;
|
|
96
|
+
useEffect(function () {
|
|
97
|
+
if (options.length > 0) {
|
|
98
|
+
setGroup(options[0]);
|
|
99
|
+
setGroup2(options[0]);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (defaultValue && defaultValue !== {}) {
|
|
103
|
+
setEvent(defaultValue);
|
|
104
|
+
}
|
|
105
|
+
}, []); // 更改group后,事件列表响应
|
|
106
|
+
|
|
107
|
+
useEffect(function () {
|
|
108
|
+
var arr = [],
|
|
109
|
+
size = 0;
|
|
110
|
+
|
|
111
|
+
if (group && group.children) {
|
|
112
|
+
var _group$children;
|
|
113
|
+
|
|
114
|
+
arr = (_group$children = group.children) === null || _group$children === void 0 ? void 0 : _group$children.slice(0, pagesize);
|
|
115
|
+
size = group.children.length;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
setEventData(arr);
|
|
119
|
+
setEventCount(size);
|
|
120
|
+
}, [group]); // 搜索结果
|
|
121
|
+
|
|
122
|
+
useEffect(function () {
|
|
123
|
+
var arr = group2.children && group2.children.filter(function (item) {
|
|
124
|
+
return item[fieldNames.label] && JSON.stringify(item[fieldNames.label]).toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
|
125
|
+
});
|
|
126
|
+
setGroup(function (group) {
|
|
127
|
+
var children = group.children,
|
|
128
|
+
res = _objectWithoutProperties(group, _excluded);
|
|
129
|
+
|
|
130
|
+
return _objectSpread(_objectSpread({}, res), {}, {
|
|
131
|
+
children: arr
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}, [searchValue, group2]); // 加载更多
|
|
135
|
+
|
|
136
|
+
var loadMoreData = function loadMoreData() {
|
|
137
|
+
var _group$children2;
|
|
138
|
+
|
|
139
|
+
var arr = group.children ? (_group$children2 = group.children) === null || _group$children2 === void 0 ? void 0 : _group$children2.slice(eventData.length, eventData.length + pagesize) : [];
|
|
140
|
+
setEventData([].concat(_toConsumableArray(eventData), _toConsumableArray(arr)));
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "biz-dropdown-cascade biz-flex"
|
|
145
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
className: "biz-dropdown-menu"
|
|
147
|
+
}, options.map(function (menu, index) {
|
|
148
|
+
var _menu$children;
|
|
149
|
+
|
|
150
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: "biz-dropdown-item ".concat(menu[fieldNames.groupValue] === group[fieldNames.groupValue] && 'box-hover'),
|
|
152
|
+
key: menu[fieldNames.groupValue],
|
|
153
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
setGroup(function () {
|
|
156
|
+
return _objectSpread({}, menu);
|
|
157
|
+
});
|
|
158
|
+
setGroup2(function () {
|
|
159
|
+
return _objectSpread({}, menu);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}, /*#__PURE__*/React.createElement("span", null, menu[fieldNames.groupLabel]), /*#__PURE__*/React.createElement("span", {
|
|
163
|
+
className: "biz-count"
|
|
164
|
+
}, (_menu$children = menu.children) === null || _menu$children === void 0 ? void 0 : _menu$children.length));
|
|
165
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
className: "biz-dropdown-content"
|
|
167
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: "biz-search ".concat(focused && 'active')
|
|
169
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
170
|
+
className: "biz-search-box",
|
|
171
|
+
prefix: /*#__PURE__*/React.createElement(UserOutlined, null),
|
|
172
|
+
value: searchValue,
|
|
173
|
+
placeholder: "\u641C\u7D22\u57CB\u70B9\u4E8B\u4EF6",
|
|
174
|
+
onChange: function onChange(e) {
|
|
175
|
+
setSearchValue(e.target.value);
|
|
176
|
+
},
|
|
177
|
+
onFocus: function onFocus() {
|
|
178
|
+
setFocused(true);
|
|
179
|
+
onFocusChange && onFocusChange(true);
|
|
180
|
+
},
|
|
181
|
+
onBlur: function onBlur() {
|
|
182
|
+
setFocused(false);
|
|
183
|
+
onFocusChange && onFocusChange(false);
|
|
184
|
+
}
|
|
185
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
className: "biz-dropdown-box",
|
|
187
|
+
id: "scrollableDiv"
|
|
188
|
+
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
189
|
+
dataLength: eventData.length,
|
|
190
|
+
next: loadMoreData,
|
|
191
|
+
hasMore: eventData.length < eventCount,
|
|
192
|
+
loader: /*#__PURE__*/React.createElement(Skeleton, {
|
|
193
|
+
paragraph: {
|
|
194
|
+
rows: 1
|
|
195
|
+
},
|
|
196
|
+
active: true
|
|
197
|
+
}),
|
|
198
|
+
scrollableTarget: "scrollableDiv"
|
|
199
|
+
}, /*#__PURE__*/React.createElement(List, {
|
|
200
|
+
dataSource: eventData,
|
|
201
|
+
renderItem: function renderItem(item) {
|
|
202
|
+
return /*#__PURE__*/React.createElement(List.Item, {
|
|
203
|
+
key: item[fieldNames.value],
|
|
204
|
+
className: "biz-dropdown-item ".concat(item[fieldNames.value] === event[fieldNames.value] && 'box-active'),
|
|
205
|
+
onClick: function onClick(e) {
|
|
206
|
+
e.stopPropagation();
|
|
207
|
+
onChange(item);
|
|
208
|
+
}
|
|
209
|
+
}, /*#__PURE__*/React.createElement("div", null, item[fieldNames.label]));
|
|
210
|
+
}
|
|
211
|
+
})))));
|
|
212
|
+
};
|
|
213
|
+
export default BizEventSelector; // export default React.forwardRef(BizEventSelector);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ModalProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description 取消编辑别名
|
|
5
|
+
* @default -
|
|
6
|
+
*/
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
/**
|
|
9
|
+
* @description 编辑别名的回调
|
|
10
|
+
* @default -
|
|
11
|
+
*/
|
|
12
|
+
onChange: (alias: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* @description 别名
|
|
15
|
+
* @default -
|
|
16
|
+
*/
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const BizEventNameEditBox: React.FC<ModalProps>;
|
|
20
|
+
export default BizEventNameEditBox;
|