@zgfe/business-lib 1.0.0-beta.6 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/analysisLayout/demo/index.js +4 -1
- package/es/analysisLayout/index.d.ts +1 -28
- package/es/analysisLayout/index.js +38 -48
- package/es/analysisLayout/index.less +1 -1
- package/es/assets/styles/chunks.less +143 -0
- package/es/assets/styles/inner.less +3 -0
- package/es/assets/styles/resetAntd.less +398 -0
- package/es/assets/styles/variable.less +21 -0
- package/es/assets/theme.d.ts +5 -0
- package/es/assets/theme.js +4 -0
- package/es/attrConditions/components/operateList.d.ts +8 -0
- package/es/attrConditions/components/operateList.js +83 -0
- package/es/attrConditions/components/stringList.d.ts +9 -0
- package/es/attrConditions/components/stringList.js +168 -0
- package/es/attrConditions/components/valuesList.d.ts +10 -0
- package/es/attrConditions/components/valuesList.js +188 -0
- package/es/{attributeSelector/demo/multi.d.ts → attrConditions/demo/group.d.ts} +0 -0
- package/es/attrConditions/demo/group.js +82 -0
- package/es/{globalAttributes → attrConditions}/demo/index.d.ts +0 -0
- package/es/{datePicker/demo/form.js → attrConditions/demo/index.js} +43 -23
- package/es/attrConditions/group.d.ts +5 -0
- package/es/attrConditions/group.js +183 -0
- package/es/attrConditions/index.d.ts +6 -0
- package/es/attrConditions/index.js +160 -0
- package/es/attrConditions/styles/group.less +49 -0
- package/es/attrConditions/styles/index.less +94 -0
- package/es/attrConditions/types.d.ts +63 -0
- package/es/attrConditions/types.js +19 -0
- package/es/attrConditions/utils/operates.d.ts +16 -0
- package/es/attrConditions/utils/operates.js +67 -0
- package/es/attributeSelector/demo/index.d.ts +3 -0
- package/es/attributeSelector/demo/{singleForm.js → index.js} +42 -44
- package/es/attributeSelector/index.d.ts +4 -111
- package/es/attributeSelector/index.js +88 -543
- package/es/attributeSelector/listPanel.d.ts +4 -0
- package/es/attributeSelector/listPanel.js +208 -0
- package/es/attributeSelector/option.d.ts +15 -0
- package/es/attributeSelector/option.js +53 -0
- package/es/attributeSelector/styles/index.less +100 -0
- package/es/attributeSelector/types.d.ts +79 -0
- package/es/attributeSelector/types.js +15 -0
- package/es/attributeSelector/util.d.ts +7 -0
- package/es/attributeSelector/util.js +69 -0
- package/es/chart/demo/pie.js +1 -0
- package/es/chart/index.d.ts +2 -96
- package/es/chart/index.js +28 -35
- package/es/chart/styles/index.less +50 -0
- package/es/chart/types.d.ts +46 -0
- package/es/chart/{type.js → types.js} +0 -0
- package/es/chart/util/{chartConfig.d.ts → chartOptionConfig.d.ts} +4 -35
- package/es/chart/util/{chartConfig.js → chartOptionConfig.js} +45 -111
- package/es/chart/util/formatData.d.ts +3 -7
- package/es/chart/util/formatData.js +47 -26
- package/es/chart/util/formatOption.d.ts +2 -1
- package/es/chart/util/formatOption.js +22 -9
- package/es/chart/util/mapUtil.d.ts +3 -3
- package/es/chart/util/mapUtil.js +9 -19
- package/es/commonStyle/icon.less +116 -112
- package/es/commonStyle/select.less +1 -1
- package/es/commonStyle/theme.less +520 -473
- package/es/components/iconFont.js +4 -2
- package/es/context/index.d.ts +16 -0
- package/es/context/index.js +3 -0
- package/es/datePicker/datePicker.d.ts +10 -0
- package/es/datePicker/datePicker.js +115 -0
- package/es/datePicker/demo/index.d.ts +1 -0
- package/es/datePicker/demo/index.js +9 -2
- package/es/datePicker/index.d.ts +4 -27
- package/es/datePicker/index.js +72 -148
- package/es/datePicker/styles/index.less +48 -0
- package/es/datePicker/types.d.ts +24 -0
- package/es/{eventSelector/type.js → datePicker/types.js} +0 -0
- package/es/datePicker/utils.d.ts +6 -0
- package/es/datePicker/utils.js +70 -0
- package/es/dialog/components/itemNode.d.ts +10 -0
- package/es/dialog/components/itemNode.js +109 -0
- package/es/dialog/components/list.d.ts +3 -13
- package/es/dialog/components/list.js +15 -12
- package/es/dialog/components/selectToInput.d.ts +4 -48
- package/es/dialog/components/selectToInput.js +74 -80
- package/es/dialog/components/styles/handle.less +39 -0
- package/es/dialog/components/styles/list.less +60 -0
- package/es/dialog/components/styles/tab.less +55 -0
- package/es/dialog/components/tab.d.ts +3 -7
- package/es/dialog/components/tab.js +57 -19
- package/es/dialog/data/{chart.d.ts → data.d.ts} +9 -0
- package/es/dialog/data/{chart.js → data.js} +11 -0
- package/es/dialog/demo/index.d.ts +23 -0
- package/es/dialog/demo/index.js +34 -3
- package/es/dialog/demo/index2.js +14 -2
- package/es/dialog/index.d.ts +4 -97
- package/es/dialog/index.js +54 -109
- package/es/dialog/styles/index.less +11 -0
- package/es/dialog/types.d.ts +77 -0
- package/es/{targetConditionGroup/type.js → dialog/types.js} +0 -0
- package/es/eventSelector/demo/index.js +26 -44
- package/es/eventSelector/index.d.ts +4 -30
- package/es/eventSelector/index.js +90 -416
- package/es/eventSelector/listPanel.d.ts +4 -0
- package/es/eventSelector/listPanel.js +197 -0
- package/es/eventSelector/option.d.ts +17 -0
- package/es/eventSelector/option.js +54 -0
- package/es/eventSelector/styles/index.less +77 -0
- package/es/eventSelector/types.d.ts +31 -0
- package/es/eventSelector/types.js +1 -0
- package/es/index.d.ts +14 -11
- package/es/index.js +9 -11
- package/es/{attributeSelector/data → mock}/env.d.ts +0 -0
- package/es/{attributeSelector/data → mock}/env.js +0 -0
- package/es/{attributeSelector/data → mock}/event.d.ts +0 -0
- package/es/{attributeSelector/data → mock}/event.js +0 -0
- package/es/{attributeSelector/data → mock}/user.d.ts +0 -0
- package/es/{attributeSelector/data → mock}/user.js +0 -0
- package/es/{multipleSelector → searchInput}/demo/index.d.ts +0 -0
- package/es/searchInput/demo/index.js +5 -0
- package/es/searchInput/index.d.ts +8 -0
- package/es/searchInput/index.js +31 -0
- package/es/{attributeSelector/demo/multiForm.d.ts → select/demo/group.d.ts} +0 -0
- package/es/{globalAttributes/demo/index.js → select/demo/group.js} +49 -31
- package/es/select/demo/index.js +49 -21
- package/es/{attributeSelector/demo/single.d.ts → select/demo/multiple.d.ts} +0 -0
- package/es/{multipleSelector/demo/index.js → select/demo/multiple.js} +55 -12
- package/es/select/handle.d.ts +5 -0
- package/es/select/handle.js +119 -0
- package/es/select/index.d.ts +4 -49
- package/es/select/index.js +168 -122
- package/es/select/option.d.ts +4 -0
- package/es/select/option.js +59 -0
- package/es/select/overlay.d.ts +4 -0
- package/es/select/overlay.js +154 -0
- package/es/select/styles/handle.less +111 -0
- package/es/select/styles/index.less +99 -0
- package/es/select/types.d.ts +65 -0
- package/es/select/types.js +1 -0
- package/es/table/demo/data/table.js +1 -1
- package/es/table/demo/index.d.ts +1 -1
- package/es/table/demo/index.js +9 -8
- package/es/table/demo/index3.js +9 -18
- package/es/table/index.d.ts +4 -30
- package/es/table/index.js +30 -26
- package/es/table/styles/index.less +5 -0
- package/es/table/type.d.ts +10 -0
- package/es/table/type.js +1 -0
- package/es/targetConditionGroup/components/targetDimension.d.ts +8 -0
- package/es/targetConditionGroup/components/targetDimension.js +153 -0
- package/es/targetConditionGroup/data/operates.d.ts +8 -24
- package/es/targetConditionGroup/data/operates.js +26 -69
- package/es/targetConditionGroup/demo/group.d.ts +1 -0
- package/es/targetConditionGroup/demo/group.js +108 -23
- package/es/targetConditionGroup/demo/index.js +34 -34
- package/es/targetConditionGroup/demo/styles/index.less +29 -0
- package/es/targetConditionGroup/index.d.ts +4 -57
- package/es/targetConditionGroup/index.js +177 -274
- package/es/targetConditionGroup/styles/index.less +25 -0
- package/es/targetConditionGroup/types.d.ts +32 -0
- package/es/targetConditionGroup/types.js +1 -0
- package/es/targetSelector/demo/index.d.ts +1 -0
- package/es/targetSelector/demo/index.js +29 -71
- package/es/targetSelector/editBox.d.ts +8 -0
- package/es/targetSelector/{components/BizEventNameEditBox.js → editBox.js} +49 -24
- package/es/targetSelector/index.d.ts +5 -55
- package/es/targetSelector/index.js +103 -214
- package/es/targetSelector/optionIcon.d.ts +9 -0
- package/es/targetSelector/optionIcon.js +24 -0
- package/es/targetSelector/optionMenu.d.ts +7 -0
- package/es/targetSelector/optionMenu.js +38 -0
- package/es/targetSelector/styles/index.less +88 -0
- package/es/targetSelector/types.d.ts +18 -0
- package/es/targetSelector/types.js +1 -0
- package/es/userCondition/conditionTypeList.d.ts +10 -0
- package/es/userCondition/conditionTypeList.js +43 -0
- package/es/userCondition/conditionWrap.d.ts +7 -0
- package/es/userCondition/conditionWrap.js +18 -0
- package/es/userCondition/conditions/eventCondition.d.ts +8 -0
- package/es/userCondition/conditions/eventCondition.js +104 -0
- package/es/userCondition/conditions/periodCondition.d.ts +11 -0
- package/es/userCondition/conditions/periodCondition.js +156 -0
- package/es/userCondition/conditions/propCondition.d.ts +11 -0
- package/es/userCondition/conditions/propCondition.js +147 -0
- package/es/userCondition/conditions/runTimesCondition.d.ts +9 -0
- package/es/userCondition/conditions/runTimesCondition.js +78 -0
- package/es/userCondition/conditions/styles/eventCondition.less +49 -0
- package/es/userCondition/conditions/styles/periodCondition.less +14 -0
- package/es/userCondition/conditions/styles/propCondition.less +36 -0
- package/es/userCondition/conditions/styles/runTimesCondition.less +16 -0
- package/es/{attributeSelector/demo/singleForm.d.ts → userCondition/demo/index.d.ts} +0 -0
- package/es/userCondition/demo/index.js +97 -0
- package/es/userCondition/index.d.ts +7 -0
- package/es/userCondition/index.js +146 -0
- package/es/userCondition/orConditions.d.ts +5 -0
- package/es/userCondition/orConditions.js +202 -0
- package/es/userCondition/relationLabel.d.ts +6 -0
- package/es/userCondition/relationLabel.js +12 -0
- package/es/userCondition/styles/conditionTypeList.less +31 -0
- package/es/userCondition/styles/conditionWrap.less +14 -0
- package/es/userCondition/styles/index.less +13 -0
- package/es/userCondition/styles/orConditions.less +16 -0
- package/es/userCondition/styles/relationLabel.less +18 -0
- package/es/userCondition/types.d.ts +79 -0
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.d.ts +2 -0
- package/es/userCondition/util.js +54 -0
- package/es/{datePicker/demo/form.d.ts → userGroup/demo/group.d.ts} +0 -0
- package/es/{targetConditionGroup/demo/form.js → userGroup/demo/group.js} +68 -72
- package/es/userGroup/demo/index.d.ts +0 -1
- package/es/userGroup/demo/index.js +5 -62
- package/es/userGroup/index.d.ts +3 -77
- package/es/userGroup/index.js +60 -108
- package/es/userGroup/styles/index.less +20 -0
- package/es/userGroup/types.d.ts +15 -0
- package/es/userGroup/types.js +1 -0
- package/es/utils/ajax.js +5 -20
- package/es/utils/type.d.ts +42 -44
- package/es/utils/util.d.ts +1 -35
- package/es/utils/util.js +27 -57
- package/package.json +11 -4
- package/es/attributeSelector/demo/multi.js +0 -39
- package/es/attributeSelector/demo/multiForm.js +0 -64
- package/es/attributeSelector/demo/single.js +0 -43
- package/es/attributeSelector/group.d.ts +0 -31
- package/es/attributeSelector/group.js +0 -225
- package/es/attributeSelector/index.less +0 -172
- package/es/chart/index.less +0 -38
- package/es/chart/style/circle.svg +0 -4
- package/es/chart/type.d.ts +0 -22
- package/es/datePicker/data.d.ts +0 -9
- package/es/datePicker/data.js +0 -65
- package/es/datePicker/index.less +0 -364
- package/es/dialog/components/style/list.less +0 -59
- package/es/dialog/components/style/tab.less +0 -61
- package/es/dialog/style/index.less +0 -86
- package/es/eventSelector/demo/form.d.ts +0 -2
- package/es/eventSelector/demo/form.js +0 -89
- package/es/eventSelector/demo/nodata.d.ts +0 -2
- package/es/eventSelector/demo/nodata.js +0 -13
- package/es/eventSelector/index.less +0 -121
- package/es/eventSelector/type.d.ts +0 -41
- package/es/globalAttributes/demo/data/env.d.ts +0 -11
- package/es/globalAttributes/demo/data/env.js +0 -181
- package/es/globalAttributes/demo/data/event.d.ts +0 -237
- package/es/globalAttributes/demo/data/event.js +0 -3483
- package/es/globalAttributes/demo/data/user.d.ts +0 -22
- package/es/globalAttributes/demo/data/user.js +0 -218
- package/es/globalAttributes/index.d.ts +0 -47
- package/es/globalAttributes/index.js +0 -112
- package/es/multipleSelector/index.d.ts +0 -36
- package/es/multipleSelector/index.js +0 -131
- package/es/multipleSelector/index.less +0 -136
- package/es/table/demo/index.less +0 -8
- package/es/table/index.less +0 -139
- package/es/targetConditionGroup/components/conditionGroup.d.ts +0 -30
- package/es/targetConditionGroup/components/conditionGroup.js +0 -112
- package/es/targetConditionGroup/components/conditionItem.d.ts +0 -47
- package/es/targetConditionGroup/components/conditionItem.js +0 -232
- package/es/targetConditionGroup/components/style/group.less +0 -47
- package/es/targetConditionGroup/components/style/index.less +0 -16
- package/es/targetConditionGroup/demo/data/env.d.ts +0 -11
- package/es/targetConditionGroup/demo/data/env.js +0 -181
- package/es/targetConditionGroup/demo/data/event.d.ts +0 -237
- package/es/targetConditionGroup/demo/data/event.js +0 -3483
- package/es/targetConditionGroup/demo/data/user.d.ts +0 -22
- package/es/targetConditionGroup/demo/data/user.js +0 -218
- package/es/targetConditionGroup/demo/form.d.ts +0 -2
- package/es/targetConditionGroup/demo/item.d.ts +0 -2
- package/es/targetConditionGroup/demo/item.js +0 -5
- package/es/targetConditionGroup/group.d.ts +0 -56
- package/es/targetConditionGroup/group.js +0 -204
- package/es/targetConditionGroup/index.less +0 -76
- package/es/targetConditionGroup/type.d.ts +0 -95
- package/es/targetSelector/components/BizCascadeBox.d.ts +0 -34
- package/es/targetSelector/components/BizCascadeBox.js +0 -213
- package/es/targetSelector/components/BizEventNameEditBox.d.ts +0 -20
- package/es/targetSelector/demo/form.d.ts +0 -2
- package/es/targetSelector/demo/form.js +0 -133
- package/es/targetSelector/demo/nodata.d.ts +0 -2
- package/es/targetSelector/demo/nodata.js +0 -13
- package/es/targetSelector/index.less +0 -28
- package/es/userGroup/demo/cluster.d.ts +0 -3
- package/es/userGroup/demo/cluster.js +0 -102
- package/es/userGroup/demo/index.less +0 -3
- package/es/userGroup/index.less +0 -2
- package/es/userGroup/userCluster.d.ts +0 -63
- package/es/userGroup/userCluster.js +0 -255
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
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 _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); }
|
|
8
|
-
|
|
9
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
2
|
|
|
11
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
4
|
|
|
13
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
6
|
|
|
15
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
16
|
-
|
|
17
|
-
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."); }
|
|
18
|
-
|
|
19
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
20
|
-
|
|
21
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
22
|
-
|
|
23
|
-
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; } } }; }
|
|
24
|
-
|
|
25
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26
8
|
|
|
27
9
|
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."); }
|
|
@@ -34,561 +16,124 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
34
16
|
|
|
35
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
18
|
|
|
37
|
-
import {
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
19
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
20
|
+
import './styles/index.less';
|
|
21
|
+
import { Dropdown, Tooltip } from 'antd';
|
|
22
|
+
import AttrListPanel from './listPanel';
|
|
40
23
|
import IconFont from '../components/iconFont';
|
|
41
|
-
import {
|
|
42
|
-
import '
|
|
43
|
-
var Link = Anchor.Link;
|
|
24
|
+
import { BizGlobalDataContext } from '..';
|
|
25
|
+
import SelectHandle from '../select/handle';
|
|
44
26
|
|
|
45
27
|
var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
eventIds = props.eventIds,
|
|
49
|
-
_props$responseType = props.responseType,
|
|
50
|
-
responseType = _props$responseType === void 0 ? 'id' : _props$responseType,
|
|
51
|
-
_props$showDeleteIcon = props.showDeleteIcon,
|
|
52
|
-
showDeleteIcon = _props$showDeleteIcon === void 0 ? false : _props$showDeleteIcon,
|
|
53
|
-
_props$showUserProp = props.showUserProp,
|
|
54
|
-
showUserProp = _props$showUserProp === void 0 ? true : _props$showUserProp,
|
|
55
|
-
_props$showEventEnv = props.showEventEnv,
|
|
56
|
-
showEventEnv = _props$showEventEnv === void 0 ? true : _props$showEventEnv,
|
|
57
|
-
_props$showEventProp = props.showEventProp,
|
|
58
|
-
showEventProp = _props$showEventProp === void 0 ? true : _props$showEventProp,
|
|
59
|
-
options = props.options,
|
|
60
|
-
onDelete = props.onDelete,
|
|
61
|
-
onChange = props.onChange,
|
|
62
|
-
_props$index = props.index,
|
|
63
|
-
index = _props$index === void 0 ? 0 : _props$index,
|
|
64
|
-
_props$disabled = props.disabled,
|
|
65
|
-
disabled = _props$disabled === void 0 ? [] : _props$disabled,
|
|
66
|
-
_props$placeholder = props.placeholder,
|
|
67
|
-
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
|
68
|
-
children = props.children;
|
|
69
|
-
|
|
70
|
-
var _useContext = useContext(BizGlobalDataContext),
|
|
71
|
-
eventMeta = _useContext.eventMeta,
|
|
72
|
-
userProps = _useContext.userProps,
|
|
73
|
-
eventEnv = _useContext.eventEnv;
|
|
28
|
+
var enableDelete = props.enableDelete,
|
|
29
|
+
placeholder = props.placeholder;
|
|
74
30
|
|
|
75
|
-
var _useState = useState(
|
|
31
|
+
var _useState = useState(),
|
|
76
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
-
|
|
78
|
-
|
|
33
|
+
currentAttr = _useState2[0],
|
|
34
|
+
setCurrentAttr = _useState2[1];
|
|
79
35
|
|
|
80
|
-
var _useState3 = useState(
|
|
36
|
+
var _useState3 = useState(false),
|
|
81
37
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var _useState5 = useState(false),
|
|
86
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
87
|
-
showDropdown = _useState6[0],
|
|
88
|
-
setShowDropdown = _useState6[1];
|
|
89
|
-
|
|
90
|
-
var attrsRef = useRef(null); // 锚点:{event:{id,children}, user:{id,children}}
|
|
91
|
-
|
|
92
|
-
var _useState7 = useState({}),
|
|
93
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
94
|
-
anchorList = _useState8[0],
|
|
95
|
-
setAnchorList = _useState8[1]; // 动态id
|
|
38
|
+
visible = _useState4[0],
|
|
39
|
+
setVisible = _useState4[1];
|
|
96
40
|
|
|
41
|
+
var classPrefix = 'biz-attr-select';
|
|
97
42
|
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setListID = _useState10[1];
|
|
43
|
+
var _useState5 = useState(String(Math.random())),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
45
|
+
id = _useState6[0];
|
|
102
46
|
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
var _useState13 = useState(false),
|
|
110
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
111
|
-
focused = _useState14[0],
|
|
112
|
-
setFocused = _useState14[1]; // 搜索值
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var _useState15 = useState(''),
|
|
116
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
117
|
-
searchValue = _useState16[0],
|
|
118
|
-
setSearchValue = _useState16[1]; // 选中值
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var _useState17 = useState({
|
|
122
|
-
value: ''
|
|
123
|
-
}),
|
|
124
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
125
|
-
attrs = _useState18[0],
|
|
126
|
-
setAttrs = _useState18[1];
|
|
127
|
-
|
|
128
|
-
var _useState19 = useState(''),
|
|
129
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
130
|
-
defaultAttrValue = _useState20[0],
|
|
131
|
-
setDefaultAttrValue = _useState20[1]; // 处理事件数据
|
|
132
|
-
// data: 所有事件(分组+属性) eventIds: 要提取属性的事件id
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var formateEvent = function formateEvent(data, eventIds) {
|
|
136
|
-
var eventList = [];
|
|
137
|
-
var idMap = {};
|
|
138
|
-
var nameMap = {}; // 获取事件列表
|
|
47
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
48
|
+
eventGroupList = _useContext.eventGroupList,
|
|
49
|
+
userPropList = _useContext.userPropList,
|
|
50
|
+
eventEnvList = _useContext.eventEnvList;
|
|
139
51
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
prop.value = prop.attr_name;
|
|
148
|
-
prop.type = prop.prop_type;
|
|
149
|
-
prop.dimensionId = [prop.dimension_sub, prop.value].join(','); // 增加属性细分唯一字段,区分同名自定义属性
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (!props.defaultValue) return;
|
|
54
|
+
setCurrentAttr(getValue(props.defaultValue));
|
|
55
|
+
}, []);
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
setCurrentAttr(getValue(props.value));
|
|
58
|
+
}, [props.value]);
|
|
150
59
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
prop.custom = true;
|
|
154
|
-
prop.attrType = 'EVENT_PROP';
|
|
155
|
-
});
|
|
156
|
-
var randomId = Math.random().toString(); // 事件(分组)添加锚点id
|
|
60
|
+
function getValue(param) {
|
|
61
|
+
var res = undefined;
|
|
157
62
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
nameMap[event.event_name] = event;
|
|
63
|
+
if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
|
|
64
|
+
eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
|
|
65
|
+
if (attr.name === param.name) res = attr;
|
|
162
66
|
});
|
|
163
|
-
})
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var firstId = Math.random().toString(); // 如果没传eventid,就展示所有属性
|
|
169
|
-
|
|
170
|
-
var ids = [];
|
|
171
|
-
|
|
172
|
-
if (eventIds) {
|
|
173
|
-
if (typeof eventIds === 'number') {
|
|
174
|
-
ids = [JSON.stringify(eventIds)];
|
|
175
|
-
} else {
|
|
176
|
-
ids = eventIds.split(',');
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (ids.length > 0) {
|
|
181
|
-
ids.forEach(function (id) {
|
|
182
|
-
var event = idMap[id.trim()];
|
|
183
|
-
|
|
184
|
-
if (event) {
|
|
185
|
-
// 要展示的属性
|
|
186
|
-
var eventProps = event.event_attrs.filter(function (prop) {
|
|
187
|
-
return !prop.hidden;
|
|
188
|
-
});
|
|
189
|
-
var randomId = Math.random().toString(); // 添加锚点
|
|
190
|
-
|
|
191
|
-
anchorList.push({
|
|
192
|
-
attrId: event.attrId || randomId,
|
|
193
|
-
name: event.alias_name || event.event_name
|
|
67
|
+
} else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'eventProp') {
|
|
68
|
+
eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
|
|
69
|
+
group.eventList.forEach(function (event) {
|
|
70
|
+
event.attrList.forEach(function (attr) {
|
|
71
|
+
if (attr.id === param.id) res = attr;
|
|
194
72
|
});
|
|
195
|
-
|
|
196
|
-
attrId: event.attrId || randomId,
|
|
197
|
-
name: ids.length > 1 ? "\u4E8B\u4EF6[".concat(event.alias_name || event.event_name, "]\u5C5E\u6027") : '事件属性',
|
|
198
|
-
children: eventProps
|
|
199
|
-
});
|
|
200
|
-
}
|
|
73
|
+
});
|
|
201
74
|
});
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var _attrs = [];
|
|
206
|
-
|
|
207
|
-
var _iterator = _createForOfIteratorHelper(eventList),
|
|
208
|
-
_step;
|
|
209
|
-
|
|
210
|
-
try {
|
|
211
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
212
|
-
var _event = _step.value;
|
|
213
|
-
|
|
214
|
-
var eventProps = _event.event_attrs.filter(function (prop) {
|
|
215
|
-
return !prop.hidden;
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
_attrs = _attrs.concat(eventProps);
|
|
219
|
-
}
|
|
220
|
-
} catch (err) {
|
|
221
|
-
_iterator.e(err);
|
|
222
|
-
} finally {
|
|
223
|
-
_iterator.f();
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
eventResult.push({
|
|
227
|
-
attrId: firstId,
|
|
228
|
-
name: '事件属性',
|
|
229
|
-
children: _toConsumableArray(_attrs)
|
|
75
|
+
} else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'userProp') {
|
|
76
|
+
userPropList === null || userPropList === void 0 ? void 0 : userPropList.forEach(function (attr) {
|
|
77
|
+
if (attr.name === param.name && attr.category === param.category) res = attr;
|
|
230
78
|
});
|
|
231
|
-
} else {
|
|
232
|
-
firstId = eventResult[0].attrId || firstId;
|
|
233
79
|
}
|
|
234
80
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
name: '事件属性',
|
|
238
|
-
children: anchorList.length > 1 ? [].concat(anchorList) : []
|
|
239
|
-
};
|
|
240
|
-
return {
|
|
241
|
-
event: event,
|
|
242
|
-
eventResult: eventResult
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
var getOptions = function getOptions() {
|
|
247
|
-
// 所有属性 eventMeta, userProps, eventEnv
|
|
248
|
-
var attrsList = [],
|
|
249
|
-
anchors = {}; // 事件属性
|
|
250
|
-
|
|
251
|
-
if (showEventProp) {
|
|
252
|
-
var eventOptions = JSON.parse(JSON.stringify(options && options.event || eventMeta));
|
|
253
|
-
|
|
254
|
-
var _formateEvent = formateEvent(eventOptions, eventIds),
|
|
255
|
-
event = _formateEvent.event,
|
|
256
|
-
eventResult = _formateEvent.eventResult;
|
|
257
|
-
|
|
258
|
-
anchors = _objectSpread({
|
|
259
|
-
event: event
|
|
260
|
-
}, anchors);
|
|
261
|
-
attrsList = attrsList.concat(eventResult);
|
|
262
|
-
} // 如果展示用户属性
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
if (showUserProp) {
|
|
266
|
-
// 添加锚点
|
|
267
|
-
var attrId = Math.random().toString();
|
|
268
|
-
var user = {
|
|
269
|
-
attrId: attrId,
|
|
270
|
-
name: '用户属性'
|
|
271
|
-
};
|
|
272
|
-
var userOptions = JSON.parse(JSON.stringify(options && options.user || userProps)); // 添加属性
|
|
273
|
-
|
|
274
|
-
var userList = userOptions.map(function (prop) {
|
|
275
|
-
prop.attrId = Math.random().toString();
|
|
276
|
-
prop.label = prop.alias_name || prop.text;
|
|
277
|
-
prop.value = prop.name;
|
|
278
|
-
prop.isUserProp = true;
|
|
279
|
-
prop.custom = prop.category === 'custom';
|
|
280
|
-
prop.attrType = 'USER_PROP'; // 内置属性(名称、类型、诸葛ID 、用户ID): 实时
|
|
281
|
-
|
|
282
|
-
if (prop.name === 'name' || prop.name === 'is_anonymous' || prop.name === 'zg_id' || prop.name === 'app_user_id') {
|
|
283
|
-
prop.realTime = true;
|
|
284
|
-
} else {
|
|
285
|
-
prop.realTime = false;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
prop.dimensionId = [prop.dimension_sub, prop.value].join(','); // 增加属性细分唯一字段,区分同名自定义属性
|
|
289
|
-
|
|
290
|
-
return prop;
|
|
291
|
-
});
|
|
292
|
-
anchors = _objectSpread(_objectSpread({}, anchors), {}, {
|
|
293
|
-
user: user
|
|
294
|
-
});
|
|
295
|
-
attrsList.push(_objectSpread(_objectSpread({}, user), {}, {
|
|
296
|
-
children: _toConsumableArray(userList)
|
|
297
|
-
}));
|
|
298
|
-
} // 如果展示环境属性
|
|
299
|
-
|
|
81
|
+
return res;
|
|
82
|
+
}
|
|
300
83
|
|
|
301
|
-
|
|
302
|
-
|
|
84
|
+
function onDelete() {
|
|
85
|
+
if (props.onDelete) props.onDelete(currentAttr);
|
|
86
|
+
}
|
|
303
87
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
var envList = envOptions.map(function (prop) {
|
|
310
|
-
prop.attrId = Math.random().toString();
|
|
311
|
-
prop.label = prop.text;
|
|
312
|
-
prop.value = prop.name;
|
|
313
|
-
prop.dimensionId = [prop.dimension_sub, prop.value].join(','); // 增加属性细分唯一字段,区分同名自定义属性
|
|
314
|
-
|
|
315
|
-
prop.isEnvProp = true;
|
|
316
|
-
prop.realTime = true;
|
|
317
|
-
prop.custom = false;
|
|
318
|
-
prop.attrType = 'ENV_PROP';
|
|
319
|
-
return prop;
|
|
320
|
-
});
|
|
321
|
-
anchors = _objectSpread(_objectSpread({}, anchors), {}, {
|
|
322
|
-
env: env
|
|
323
|
-
});
|
|
324
|
-
attrsList.push(_objectSpread(_objectSpread({}, env), {}, {
|
|
325
|
-
children: _toConsumableArray(envList)
|
|
326
|
-
}));
|
|
327
|
-
}
|
|
88
|
+
function onChange(val) {
|
|
89
|
+
setVisible(false);
|
|
90
|
+
setCurrentAttr(val);
|
|
91
|
+
if (props.onChange) props.onChange(val);
|
|
92
|
+
}
|
|
328
93
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return _toConsumableArray(attrsList);
|
|
332
|
-
});
|
|
333
|
-
setPrimaryAttrOptions(function () {
|
|
334
|
-
return _toConsumableArray(attrsList);
|
|
335
|
-
});
|
|
94
|
+
var onVisibleChange = function onVisibleChange(flag) {
|
|
95
|
+
setVisible(flag);
|
|
336
96
|
};
|
|
337
97
|
|
|
338
|
-
useEffect(function () {
|
|
339
|
-
setListID(function () {
|
|
340
|
-
var id = Math.random().toString();
|
|
341
|
-
return "list_".concat(id);
|
|
342
|
-
});
|
|
343
|
-
setAllID(function () {
|
|
344
|
-
var id = Math.random().toString();
|
|
345
|
-
return "list_".concat(id);
|
|
346
|
-
}); // 添加点击事件监听,隐藏下拉框
|
|
347
|
-
|
|
348
|
-
var handleClick = function handleClick(e) {
|
|
349
|
-
if (!attrsRef.current || !attrsRef.current.contains(e.target)) {
|
|
350
|
-
setShowDropdown(false);
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
document.addEventListener('click', handleClick);
|
|
355
|
-
return function () {
|
|
356
|
-
document.removeEventListener('click', handleClick);
|
|
357
|
-
};
|
|
358
|
-
}, []);
|
|
359
|
-
useEffect(function () {
|
|
360
|
-
var intoValue = defaultValue || value;
|
|
361
|
-
|
|
362
|
-
if (intoValue) {
|
|
363
|
-
var defaultData;
|
|
364
|
-
|
|
365
|
-
if (_typeof(intoValue) === 'object') {
|
|
366
|
-
defaultData = intoValue.value || intoValue.attr_name || intoValue.name || '';
|
|
367
|
-
} else {
|
|
368
|
-
defaultData = intoValue || '';
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
if (util.equal(defaultAttrValue, defaultData)) return;
|
|
372
|
-
setDefaultAttrValue(function () {
|
|
373
|
-
return defaultData || '';
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
}, [defaultValue, value]);
|
|
377
|
-
useEffect(function () {
|
|
378
|
-
getOptions();
|
|
379
|
-
}, [eventIds]); // 初始内容
|
|
380
|
-
|
|
381
|
-
useEffect(function () {
|
|
382
|
-
if (defaultAttrValue === '') return;
|
|
383
|
-
|
|
384
|
-
var _iterator2 = _createForOfIteratorHelper(primaryAttrOptions),
|
|
385
|
-
_step2;
|
|
386
|
-
|
|
387
|
-
try {
|
|
388
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
389
|
-
var attr = _step2.value;
|
|
390
|
-
|
|
391
|
-
var _iterator3 = _createForOfIteratorHelper(attr.children),
|
|
392
|
-
_step3;
|
|
393
|
-
|
|
394
|
-
try {
|
|
395
|
-
var _loop = function _loop() {
|
|
396
|
-
var data = _step3.value;
|
|
397
|
-
|
|
398
|
-
if (data.value === defaultAttrValue) {
|
|
399
|
-
setAttrs(function () {
|
|
400
|
-
return _objectSpread({}, data);
|
|
401
|
-
});
|
|
402
|
-
return "break";
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
407
|
-
var _ret = _loop();
|
|
408
|
-
|
|
409
|
-
if (_ret === "break") break;
|
|
410
|
-
}
|
|
411
|
-
} catch (err) {
|
|
412
|
-
_iterator3.e(err);
|
|
413
|
-
} finally {
|
|
414
|
-
_iterator3.f();
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
} catch (err) {
|
|
418
|
-
_iterator2.e(err);
|
|
419
|
-
} finally {
|
|
420
|
-
_iterator2.f();
|
|
421
|
-
}
|
|
422
|
-
}, [defaultAttrValue, primaryAttrOptions]); // 初始化搜索框
|
|
423
|
-
|
|
424
|
-
useEffect(function () {
|
|
425
|
-
setSearchValue(function () {
|
|
426
|
-
return '';
|
|
427
|
-
});
|
|
428
|
-
}, [showDropdown]);
|
|
429
|
-
useEffect(function () {
|
|
430
|
-
if (!showDropdown) return;
|
|
431
|
-
var searchOptions = [];
|
|
432
|
-
|
|
433
|
-
var _iterator4 = _createForOfIteratorHelper(primaryAttrOptions),
|
|
434
|
-
_step4;
|
|
435
|
-
|
|
436
|
-
try {
|
|
437
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
438
|
-
var attr = _step4.value;
|
|
439
|
-
|
|
440
|
-
var _children = attr.children,
|
|
441
|
-
res = _objectWithoutProperties(attr, _excluded);
|
|
442
|
-
|
|
443
|
-
var child = _children.filter(function (item) {
|
|
444
|
-
return item.label && item.label.indexOf(searchValue) > -1;
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
searchOptions.push(_objectSpread(_objectSpread({}, res), {}, {
|
|
448
|
-
children: _toConsumableArray(child)
|
|
449
|
-
}));
|
|
450
|
-
}
|
|
451
|
-
} catch (err) {
|
|
452
|
-
_iterator4.e(err);
|
|
453
|
-
} finally {
|
|
454
|
-
_iterator4.f();
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
setAttrOptions(function () {
|
|
458
|
-
return [].concat(searchOptions);
|
|
459
|
-
});
|
|
460
|
-
}, [searchValue, primaryAttrOptions, showDropdown]);
|
|
461
98
|
return /*#__PURE__*/React.createElement("div", {
|
|
462
|
-
className:
|
|
463
|
-
ref: attrsRef
|
|
99
|
+
className: classPrefix
|
|
464
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
465
|
-
className: "
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
className: "biz-select-zhankai",
|
|
477
|
-
type: 'icon-xiangxia'
|
|
478
|
-
})), showDeleteIcon && /*#__PURE__*/React.createElement("div", {
|
|
479
|
-
className: "biz-option-icon biz-option-icon-delete",
|
|
480
|
-
onClick: onDelete
|
|
481
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
482
|
-
title: function title() {
|
|
483
|
-
return '删除';
|
|
484
|
-
},
|
|
485
|
-
color: "#242541",
|
|
486
|
-
key: 'delete'
|
|
487
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
488
|
-
className: "biz-icon-delete",
|
|
489
|
-
type: 'icon-qingchu'
|
|
490
|
-
}))), /*#__PURE__*/React.createElement("br", null), children, showDropdown && (attrOptions.length === 0 ? /*#__PURE__*/React.createElement("div", {
|
|
491
|
-
className: "biz-select-nodata"
|
|
492
|
-
}, "\u6682\u65E0\u6570\u636E") : /*#__PURE__*/React.createElement("div", {
|
|
493
|
-
className: "biz-dropdown-container"
|
|
494
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
495
|
-
className: "biz-search-box",
|
|
496
|
-
prefix: /*#__PURE__*/React.createElement(IconFont, {
|
|
497
|
-
className: "biz-icon",
|
|
498
|
-
type: 'icon-sousuo'
|
|
499
|
-
}),
|
|
500
|
-
value: searchValue,
|
|
501
|
-
allowClear: {
|
|
502
|
-
clearIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
503
|
-
className: "biz-icon",
|
|
504
|
-
type: 'icon-qingchu'
|
|
505
|
-
})
|
|
101
|
+
className: "".concat(classPrefix, "-handle")
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
103
|
+
overlay: /*#__PURE__*/React.createElement(AttrListPanel, _objectSpread(_objectSpread({
|
|
104
|
+
id: id
|
|
105
|
+
}, props), {}, {
|
|
106
|
+
value: currentAttr,
|
|
107
|
+
onChange: onChange
|
|
108
|
+
})),
|
|
109
|
+
trigger: ['click'],
|
|
110
|
+
overlayStyle: {
|
|
111
|
+
minWidth: 0
|
|
506
112
|
},
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
setSearchValue(e.target.value);
|
|
510
|
-
}
|
|
511
|
-
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
512
|
-
className: "biz-archon biz-archon-first",
|
|
513
|
-
affix: false,
|
|
514
|
-
onClick: function onClick(e) {
|
|
515
|
-
e.preventDefault();
|
|
516
|
-
},
|
|
517
|
-
getContainer: function getContainer() {
|
|
518
|
-
return document.getElementById(listID) || window;
|
|
519
|
-
}
|
|
520
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
521
|
-
href: "#".concat(allID),
|
|
522
|
-
title: '全部属性'
|
|
523
|
-
}), anchorList.event && /*#__PURE__*/React.createElement(Link, {
|
|
524
|
-
href: "#".concat(anchorList.event.attrId),
|
|
525
|
-
title: anchorList.event.name
|
|
526
|
-
}), anchorList.user && /*#__PURE__*/React.createElement(Link, {
|
|
527
|
-
href: "#".concat(anchorList.user.attrId),
|
|
528
|
-
title: anchorList.user.name
|
|
529
|
-
}), anchorList.env && /*#__PURE__*/React.createElement(Link, {
|
|
530
|
-
"data-type": 'event',
|
|
531
|
-
href: "#".concat(anchorList.env.attrId),
|
|
532
|
-
title: anchorList.env.name
|
|
533
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
534
|
-
id: listID,
|
|
535
|
-
className: "biz-select-list-container"
|
|
113
|
+
visible: visible,
|
|
114
|
+
onVisibleChange: onVisibleChange
|
|
536
115
|
}, /*#__PURE__*/React.createElement("div", {
|
|
537
|
-
id: allID,
|
|
538
116
|
style: {
|
|
539
|
-
width: '100%'
|
|
540
|
-
height: '5px'
|
|
117
|
+
width: '100%'
|
|
541
118
|
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
className: "biz-drop-option biz-drop-index boxBg\n ".concat(child.value === attrs.value && 'box-active', "\n ").concat(child.value && attrs.value !== child.value && disabled.indexOf(child.value) > -1 && 'box-disabled'),
|
|
557
|
-
onClick: function onClick(e) {
|
|
558
|
-
e.stopPropagation();
|
|
559
|
-
|
|
560
|
-
if (child.value && attrs.value !== child.value && disabled.indexOf(child.value) > -1) {
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
setAttrs(function () {
|
|
565
|
-
return _objectSpread({}, child);
|
|
566
|
-
});
|
|
567
|
-
setShowDropdown(false);
|
|
568
|
-
|
|
569
|
-
if (onChange) {
|
|
570
|
-
var data = JSON.parse(JSON.stringify(child));
|
|
571
|
-
delete data.attrId;
|
|
572
|
-
|
|
573
|
-
if (responseType === 'id') {
|
|
574
|
-
onChange(data.value || '', data, index);
|
|
575
|
-
} else {
|
|
576
|
-
onChange(data, data.value || '', index);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
581
|
-
className: "biz-icon biz-icon-index",
|
|
582
|
-
type: "".concat(item.name && item.name.indexOf('用户') > -1 ? 'icon-yonghushuxing' : item.name && ((_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.indexOf('事件')) > -1 ? 'icon-shijianshuxing1' : 'icon-chufahuanjing')
|
|
583
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
584
|
-
dangerouslySetInnerHTML: {
|
|
585
|
-
__html: util.setHighLight(child.label || '', searchValue)
|
|
586
|
-
}
|
|
587
|
-
}));
|
|
588
|
-
});
|
|
589
|
-
childList.unshift(group);
|
|
590
|
-
return childList;
|
|
591
|
-
})))));
|
|
119
|
+
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
120
|
+
theme: "secondary",
|
|
121
|
+
border: false,
|
|
122
|
+
label: currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.label,
|
|
123
|
+
placeholder: placeholder
|
|
124
|
+
}))), enableDelete && /*#__PURE__*/React.createElement(Tooltip, {
|
|
125
|
+
title: function title() {
|
|
126
|
+
return '删除';
|
|
127
|
+
}
|
|
128
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
129
|
+
className: "".concat(classPrefix, "-del-icon"),
|
|
130
|
+
type: 'icon-qingchu',
|
|
131
|
+
onClick: onDelete
|
|
132
|
+
}))));
|
|
592
133
|
};
|
|
593
134
|
|
|
135
|
+
BizAttributeSelector.defaultProps = {
|
|
136
|
+
enableDelete: false,
|
|
137
|
+
placeholder: '请选择'
|
|
138
|
+
};
|
|
594
139
|
export default BizAttributeSelector;
|