@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,225 @@
|
|
|
1
|
+
var _excluded = ["defaultValue", "value", "responseType", "maxAttrGroup", "onChange", "disabled"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
10
|
+
|
|
11
|
+
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."); }
|
|
12
|
+
|
|
13
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
+
|
|
15
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; } } }; }
|
|
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
|
+
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; }
|
|
34
|
+
|
|
35
|
+
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; }
|
|
36
|
+
|
|
37
|
+
import React, { useEffect, useState } from 'react';
|
|
38
|
+
import { IconFont } from '..';
|
|
39
|
+
import './index.less';
|
|
40
|
+
import BizAttributeSelector from './index';
|
|
41
|
+
|
|
42
|
+
var BizGroupSelect = function BizGroupSelect(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
|
+
_props$responseType = props.responseType,
|
|
48
|
+
responseType = _props$responseType === void 0 ? 'id' : _props$responseType,
|
|
49
|
+
_props$maxAttrGroup = props.maxAttrGroup,
|
|
50
|
+
maxAttrGroup = _props$maxAttrGroup === void 0 ? 3 : _props$maxAttrGroup,
|
|
51
|
+
onChange = props.onChange,
|
|
52
|
+
_props$disabled = props.disabled,
|
|
53
|
+
disabled = _props$disabled === void 0 ? [] : _props$disabled,
|
|
54
|
+
restProp = _objectWithoutProperties(props, _excluded);
|
|
55
|
+
|
|
56
|
+
var _useState = useState([]),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
attrGroups = _useState2[0],
|
|
59
|
+
setAttrGroups = _useState2[1];
|
|
60
|
+
|
|
61
|
+
var _useState3 = useState(false),
|
|
62
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
+
isChange = _useState4[0],
|
|
64
|
+
setIsChange = _useState4[1];
|
|
65
|
+
|
|
66
|
+
var _useState5 = useState(disabled),
|
|
67
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
68
|
+
disableData = _useState6[0],
|
|
69
|
+
setDisableData = _useState6[1]; // 初始化添加key
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
var inValue = defaultValue.length ? defaultValue : value;
|
|
74
|
+
var groups = [];
|
|
75
|
+
|
|
76
|
+
var _iterator = _createForOfIteratorHelper(inValue),
|
|
77
|
+
_step;
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
81
|
+
var data = _step.value;
|
|
82
|
+
var id = _typeof(data) === 'object' ? data.value : data;
|
|
83
|
+
var obj = {
|
|
84
|
+
value: id
|
|
85
|
+
};
|
|
86
|
+
groups.push({
|
|
87
|
+
key: Math.random().toString(),
|
|
88
|
+
data: obj
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
} catch (err) {
|
|
92
|
+
_iterator.e(err);
|
|
93
|
+
} finally {
|
|
94
|
+
_iterator.f();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!groups.length) {
|
|
98
|
+
groups = [{
|
|
99
|
+
key: Math.random().toString()
|
|
100
|
+
}];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setAttrGroups(groups);
|
|
104
|
+
}, []); // 选项发生变化
|
|
105
|
+
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
if (!isChange) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var newDis = [];
|
|
112
|
+
|
|
113
|
+
var _iterator2 = _createForOfIteratorHelper(attrGroups),
|
|
114
|
+
_step2;
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
118
|
+
var _group$data;
|
|
119
|
+
|
|
120
|
+
var group = _step2.value;
|
|
121
|
+
var key = (_group$data = group.data) === null || _group$data === void 0 ? void 0 : _group$data.value;
|
|
122
|
+
|
|
123
|
+
if (key) {
|
|
124
|
+
newDis.push(key);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
} catch (err) {
|
|
128
|
+
_iterator2.e(err);
|
|
129
|
+
} finally {
|
|
130
|
+
_iterator2.f();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
setIsChange(false);
|
|
134
|
+
setDisableData(function () {
|
|
135
|
+
return [].concat(newDis, _toConsumableArray(disabled));
|
|
136
|
+
});
|
|
137
|
+
handleChange();
|
|
138
|
+
}, [attrGroups]); // 选择回调
|
|
139
|
+
|
|
140
|
+
var handleChange = function handleChange() {
|
|
141
|
+
var ids = [],
|
|
142
|
+
datas = [];
|
|
143
|
+
|
|
144
|
+
var _iterator3 = _createForOfIteratorHelper(attrGroups),
|
|
145
|
+
_step3;
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
149
|
+
var group = _step3.value;
|
|
150
|
+
|
|
151
|
+
if (group.data) {
|
|
152
|
+
datas.push(group.data);
|
|
153
|
+
group.data.value && ids.push(group.data.value);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
} catch (err) {
|
|
157
|
+
_iterator3.e(err);
|
|
158
|
+
} finally {
|
|
159
|
+
_iterator3.f();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (responseType === 'id') {
|
|
163
|
+
onChange(ids, datas);
|
|
164
|
+
} else {
|
|
165
|
+
onChange(datas, ids);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
className: "biz-attr-group"
|
|
171
|
+
}, attrGroups.map(function (item, index) {
|
|
172
|
+
return /*#__PURE__*/React.createElement(BizAttributeSelector, _objectSpread(_objectSpread({}, restProp), {}, {
|
|
173
|
+
key: item.key,
|
|
174
|
+
defaultValue: item.data,
|
|
175
|
+
onChange: function onChange(data, data2) {
|
|
176
|
+
setAttrGroups(function (group) {
|
|
177
|
+
var key = group[index].key;
|
|
178
|
+
var dd = {};
|
|
179
|
+
|
|
180
|
+
if (_typeof(data) === 'object') {
|
|
181
|
+
dd = data;
|
|
182
|
+
} else if (_typeof(data2) === 'object') {
|
|
183
|
+
dd = data2;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
group[index] = {
|
|
187
|
+
key: key,
|
|
188
|
+
data: _objectSpread({}, dd)
|
|
189
|
+
};
|
|
190
|
+
return _toConsumableArray(group);
|
|
191
|
+
});
|
|
192
|
+
setIsChange(true);
|
|
193
|
+
},
|
|
194
|
+
onDelete: function onDelete() {
|
|
195
|
+
setAttrGroups(function (group) {
|
|
196
|
+
group.splice(index, 1);
|
|
197
|
+
return _toConsumableArray(group);
|
|
198
|
+
});
|
|
199
|
+
setIsChange(true);
|
|
200
|
+
},
|
|
201
|
+
responseType: 'object',
|
|
202
|
+
disabled: disableData,
|
|
203
|
+
index: index,
|
|
204
|
+
showDeleteIcon: attrGroups.length > 1
|
|
205
|
+
}));
|
|
206
|
+
}), attrGroups.length < maxAttrGroup && /*#__PURE__*/React.createElement("div", {
|
|
207
|
+
className: "biz-icon-add",
|
|
208
|
+
onClick: function onClick() {
|
|
209
|
+
setIsChange(false);
|
|
210
|
+
setAttrGroups(function (group) {
|
|
211
|
+
var empityGroup = {
|
|
212
|
+
key: Math.random().toString()
|
|
213
|
+
};
|
|
214
|
+
return [].concat(_toConsumableArray(group), [empityGroup]);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
218
|
+
className: "biz-icon",
|
|
219
|
+
type: 'icon-tianjia1'
|
|
220
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
221
|
+
className: "biz-icon-text"
|
|
222
|
+
}, "\u6DFB\u52A0\u5C5E\u6027")));
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export default BizGroupSelect;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { EventMetaProps } from '../utils/type';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface AttrsListProps extends BasicOption {
|
|
5
|
+
value?: string | number;
|
|
6
|
+
text?: string;
|
|
7
|
+
attr_id?: string | number;
|
|
8
|
+
attr_name?: string;
|
|
9
|
+
alias_name?: string | null;
|
|
10
|
+
prop_type?: string | number;
|
|
11
|
+
icon?: string;
|
|
12
|
+
value_dict?: boolean;
|
|
13
|
+
hidden?: boolean | number;
|
|
14
|
+
dimension_sub?: string | number;
|
|
15
|
+
[prop: string]: any;
|
|
16
|
+
}
|
|
17
|
+
interface BasicOption {
|
|
18
|
+
attrId?: string;
|
|
19
|
+
id?: string | number;
|
|
20
|
+
label?: string | number;
|
|
21
|
+
name?: string;
|
|
22
|
+
dimensionId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AttributeProps {
|
|
25
|
+
/**
|
|
26
|
+
* @description 若组件是表单选项,value就是form的initialValues,也是组件的默认选项
|
|
27
|
+
* @description.zh-CN
|
|
28
|
+
* @default -
|
|
29
|
+
*/
|
|
30
|
+
value?: string | number | AttrsListProps | null;
|
|
31
|
+
/**
|
|
32
|
+
* @description 默认选项
|
|
33
|
+
* @description.zh-CN
|
|
34
|
+
* @default -
|
|
35
|
+
*/
|
|
36
|
+
defaultValue?: string | number | AttrsListProps | null;
|
|
37
|
+
/**
|
|
38
|
+
* @description 禁用的选项列表:key值列表
|
|
39
|
+
* @description.zh-CN
|
|
40
|
+
* @default []
|
|
41
|
+
*/
|
|
42
|
+
disabled?: Array<string | number>;
|
|
43
|
+
/**
|
|
44
|
+
* @description 返回数据类型
|
|
45
|
+
* @description.zh-CN id | object
|
|
46
|
+
* @default id
|
|
47
|
+
*/
|
|
48
|
+
responseType?: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description 数据化配置选项内容
|
|
51
|
+
* @description.zh-CN
|
|
52
|
+
* @default -
|
|
53
|
+
*/
|
|
54
|
+
options?: EventMetaProps;
|
|
55
|
+
/**
|
|
56
|
+
* @description 是否展示删除按钮
|
|
57
|
+
* @description.zh-CN
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
showDeleteIcon?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @description 选择框是第几个
|
|
63
|
+
* @description.zh-CN
|
|
64
|
+
* @default 0
|
|
65
|
+
*/
|
|
66
|
+
index?: number;
|
|
67
|
+
/**
|
|
68
|
+
* @description 选择框默认文本
|
|
69
|
+
* @description.zh-CN
|
|
70
|
+
* @default 请选择
|
|
71
|
+
*/
|
|
72
|
+
placeholder?: string;
|
|
73
|
+
/**
|
|
74
|
+
* @description 是否展示事件属性
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
showEventProp?: Boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @description 是否展示用户属性
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
showUserProp?: Boolean;
|
|
83
|
+
/**
|
|
84
|
+
* @description 是否展示触发环境
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
showEventEnv?: Boolean;
|
|
88
|
+
/**
|
|
89
|
+
* @description 如果是事件属性,则传事件id,多个用逗号隔开
|
|
90
|
+
* @default -
|
|
91
|
+
*/
|
|
92
|
+
eventIds?: string;
|
|
93
|
+
children?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
export interface AttributeSingleProps extends AttributeProps {
|
|
96
|
+
/**
|
|
97
|
+
* @description 选中 option 时,调用此函数
|
|
98
|
+
* @description.zh-CN
|
|
99
|
+
* @default
|
|
100
|
+
*/
|
|
101
|
+
onChange?: (option: string | number | AttrsListProps, value: string | number | AttrsListProps, index: number) => void;
|
|
102
|
+
/**
|
|
103
|
+
* @description 删除选择框
|
|
104
|
+
* @description.zh-CN
|
|
105
|
+
* @default -
|
|
106
|
+
*/
|
|
107
|
+
onDelete?: () => void;
|
|
108
|
+
}
|
|
109
|
+
declare const BizAttributeSelector: React.FC<AttributeSingleProps>;
|
|
110
|
+
export default BizAttributeSelector;
|