@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,259 @@
|
|
|
1
|
+
var _excluded = ["defaultValue", "eventIds", "appId", "platform", "options", "onChange", "onDelete"];
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
|
|
7
|
+
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."); }
|
|
8
|
+
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
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, { useContext, useEffect, useState } from 'react';
|
|
38
|
+
import { Select } from 'antd';
|
|
39
|
+
import { stringOperate } from '../data/operates';
|
|
40
|
+
import './style/index.less';
|
|
41
|
+
import { BizAttributeSelector, BizGlobalDataContext, BizMultipleSelector, IconFont } from '../..';
|
|
42
|
+
import { ajax, util } from '../../utils';
|
|
43
|
+
|
|
44
|
+
var BizConditionItem = function BizConditionItem(props) {
|
|
45
|
+
var _props$defaultValue = props.defaultValue,
|
|
46
|
+
defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
|
|
47
|
+
eventIds = props.eventIds,
|
|
48
|
+
appId = props.appId,
|
|
49
|
+
platform = props.platform,
|
|
50
|
+
options = props.options,
|
|
51
|
+
_onChange = props.onChange,
|
|
52
|
+
onDelete = props.onDelete,
|
|
53
|
+
res = _objectWithoutProperties(props, _excluded); // 筛选值下拉框内容
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
var _useState = useState([]),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
conditionOptions = _useState2[0],
|
|
59
|
+
setConditionOptions = _useState2[1]; // 属性
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var _useState3 = useState({}),
|
|
63
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
64
|
+
attr = _useState4[0],
|
|
65
|
+
setAttr = _useState4[1]; // 属性值
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
var _useState5 = useState(defaultValue.params || []),
|
|
69
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
70
|
+
condition = _useState6[0],
|
|
71
|
+
setCondition = _useState6[1]; // 条件式
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
var _useState7 = useState(defaultValue.operator || stringOperate[0].value),
|
|
75
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
76
|
+
operator = _useState8[0],
|
|
77
|
+
setOperator = _useState8[1]; // 软件信息
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
81
|
+
appInfo = _useContext.appInfo,
|
|
82
|
+
eventMeta = _useContext.eventMeta,
|
|
83
|
+
userProps = _useContext.userProps,
|
|
84
|
+
eventEnv = _useContext.eventEnv; // 初始化属性对象
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
useEffect(function () {
|
|
88
|
+
var attrOption = options || {
|
|
89
|
+
event: eventMeta,
|
|
90
|
+
user: userProps,
|
|
91
|
+
env: eventEnv
|
|
92
|
+
};
|
|
93
|
+
var eventOption = [];
|
|
94
|
+
var eventData = attrOption.event || []; // 取event中的attr列表
|
|
95
|
+
|
|
96
|
+
var _iterator = _createForOfIteratorHelper(eventData),
|
|
97
|
+
_step;
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
101
|
+
var data = _step.value;
|
|
102
|
+
var eList = (data === null || data === void 0 ? void 0 : data.eventList) || [];
|
|
103
|
+
|
|
104
|
+
var _iterator2 = _createForOfIteratorHelper(eList),
|
|
105
|
+
_step2;
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
109
|
+
var _event = _step2.value;
|
|
110
|
+
|
|
111
|
+
if (_event.event_id == eventIds) {
|
|
112
|
+
eventOption = eventOption.concat(_event.event_attrs);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!eventIds) {
|
|
117
|
+
eventOption = eventOption.concat(_event.event_attrs);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} catch (err) {
|
|
121
|
+
_iterator2.e(err);
|
|
122
|
+
} finally {
|
|
123
|
+
_iterator2.f();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} catch (err) {
|
|
127
|
+
_iterator.e(err);
|
|
128
|
+
} finally {
|
|
129
|
+
_iterator.f();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
var event = eventOption.find(function (item) {
|
|
133
|
+
return item.attr_id == defaultValue.attr_id;
|
|
134
|
+
});
|
|
135
|
+
var user = attrOption.user && attrOption.user.find(function (item) {
|
|
136
|
+
return item.alias_name === defaultValue.attr_name || item.text === defaultValue.attr_name;
|
|
137
|
+
});
|
|
138
|
+
var env = attrOption.env && attrOption.env.find(function (item) {
|
|
139
|
+
return item.text === defaultValue.attr_name;
|
|
140
|
+
});
|
|
141
|
+
var attrObj = event || user || env || {};
|
|
142
|
+
|
|
143
|
+
if (attrObj.operator) {
|
|
144
|
+
delete attrObj.operator;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (attrObj.params) {
|
|
148
|
+
delete attrObj.params;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (util.equal(attr, attrObj)) return;
|
|
152
|
+
setAttr(function () {
|
|
153
|
+
return _objectSpread({}, attrObj);
|
|
154
|
+
});
|
|
155
|
+
}, [defaultValue]); // 属性更改回调
|
|
156
|
+
|
|
157
|
+
useEffect(function () {
|
|
158
|
+
var requestData = {
|
|
159
|
+
app_id: (appInfo === null || appInfo === void 0 ? void 0 : appInfo.appId) || appId,
|
|
160
|
+
platform: (appInfo === null || appInfo === void 0 ? void 0 : appInfo.platform) || platform,
|
|
161
|
+
dimension_sub: attr.dimension_sub,
|
|
162
|
+
limit: 10000,
|
|
163
|
+
attr: attr.id,
|
|
164
|
+
v: operator || ''
|
|
165
|
+
};
|
|
166
|
+
ajax({
|
|
167
|
+
url: '/data/queryEsData.jsp',
|
|
168
|
+
data: requestData
|
|
169
|
+
}).then(function (res) {
|
|
170
|
+
var data = res.sources || [];
|
|
171
|
+
setConditionOptions(function () {
|
|
172
|
+
return _toConsumableArray(data);
|
|
173
|
+
});
|
|
174
|
+
}).catch(function () {
|
|
175
|
+
setConditionOptions(function () {
|
|
176
|
+
return [];
|
|
177
|
+
});
|
|
178
|
+
}); // 清空条件值
|
|
179
|
+
|
|
180
|
+
setCondition(function () {
|
|
181
|
+
return [];
|
|
182
|
+
});
|
|
183
|
+
}, [attr]);
|
|
184
|
+
return /*#__PURE__*/React.createElement(BizAttributeSelector, _objectSpread(_objectSpread({}, res), {}, {
|
|
185
|
+
defaultValue: attr,
|
|
186
|
+
eventIds: String(eventIds),
|
|
187
|
+
options: options,
|
|
188
|
+
onChange: function onChange(attr, attr2) {
|
|
189
|
+
var data = {};
|
|
190
|
+
|
|
191
|
+
if (_typeof(attr) === 'object') {
|
|
192
|
+
data = _objectSpread({}, attr);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (_typeof(attr2) === 'object') {
|
|
196
|
+
data = _objectSpread({}, attr2);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
setAttr(function () {
|
|
200
|
+
return _objectSpread({}, data);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
var data2 = _objectSpread(_objectSpread({}, data), {}, {
|
|
204
|
+
operator: operator,
|
|
205
|
+
params: _toConsumableArray(condition)
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
_onChange && _onChange(data2);
|
|
209
|
+
},
|
|
210
|
+
onDelete: onDelete,
|
|
211
|
+
showDeleteIcon: true,
|
|
212
|
+
responseType: 'object'
|
|
213
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
214
|
+
className: "biz-condition-value-container"
|
|
215
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
216
|
+
options: stringOperate,
|
|
217
|
+
defaultValue: operator,
|
|
218
|
+
className: "biz-condition-operate ".concat(!Object.keys(attr).length ? 'no-active' : ''),
|
|
219
|
+
bordered: false,
|
|
220
|
+
dropdownClassName: "small",
|
|
221
|
+
fieldNames: {
|
|
222
|
+
label: 'name',
|
|
223
|
+
value: 'value'
|
|
224
|
+
},
|
|
225
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
226
|
+
className: "biz-icon1",
|
|
227
|
+
type: 'icon-xiangxia'
|
|
228
|
+
}),
|
|
229
|
+
onChange: function onChange(operate) {
|
|
230
|
+
setOperator(function () {
|
|
231
|
+
return operate;
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
var data = _objectSpread(_objectSpread({}, attr), {}, {
|
|
235
|
+
operator: operate,
|
|
236
|
+
params: _toConsumableArray(condition)
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
_onChange && _onChange(data);
|
|
240
|
+
}
|
|
241
|
+
}), /*#__PURE__*/React.createElement(BizMultipleSelector, {
|
|
242
|
+
options: conditionOptions,
|
|
243
|
+
defaultValue: condition,
|
|
244
|
+
onChange: function onChange(condition) {
|
|
245
|
+
setCondition(function () {
|
|
246
|
+
return _toConsumableArray(condition);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
var data = _objectSpread(_objectSpread({}, attr), {}, {
|
|
250
|
+
operator: operator,
|
|
251
|
+
params: _toConsumableArray(condition)
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
_onChange && _onChange(data);
|
|
255
|
+
}
|
|
256
|
+
})));
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export default BizConditionItem;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@import '../../../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.biz-attr-group-container {
|
|
4
|
+
display: flex;
|
|
5
|
+
.biz-attr-group-content {
|
|
6
|
+
flex: 1;
|
|
7
|
+
.biz-select-cotainer:nth-last-child(1) {
|
|
8
|
+
margin-bottom: 0;
|
|
9
|
+
}
|
|
10
|
+
&:nth-child(:first-child) {
|
|
11
|
+
height: 300px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
.biz-attr-group-operate {
|
|
15
|
+
position: relative;
|
|
16
|
+
width: 1px;
|
|
17
|
+
margin-right: 16px;
|
|
18
|
+
margin-left: 8px;
|
|
19
|
+
background: #ecedf0;
|
|
20
|
+
.biz-attr-operate {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 50%;
|
|
23
|
+
left: 50%;
|
|
24
|
+
width: 16px;
|
|
25
|
+
border-radius: 3px;
|
|
26
|
+
transform: translate(-50%, -50%);
|
|
27
|
+
div {
|
|
28
|
+
width: 16px;
|
|
29
|
+
height: 16px;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
line-height: 16px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
.box-hover();
|
|
35
|
+
&:nth-child(:first-child) {
|
|
36
|
+
border-radius: 2px 2px 0px 0px;
|
|
37
|
+
}
|
|
38
|
+
&:nth-last-child(1) {
|
|
39
|
+
border-radius: 0px 0px 2px 2px;
|
|
40
|
+
}
|
|
41
|
+
&.active {
|
|
42
|
+
.box-active();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.biz-condition-value-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin-top: 2px;
|
|
5
|
+
|
|
6
|
+
.biz-condition-operate {
|
|
7
|
+
width: 88px !important;
|
|
8
|
+
margin-right: 8px;
|
|
9
|
+
background: #f6f6f6;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
.no-active {
|
|
13
|
+
.ant-select-selector {
|
|
14
|
+
color: #9797af;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const numberOperate: {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const stringOperate: {
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const strOperateMap: {
|
|
10
|
+
equal: string;
|
|
11
|
+
contains: string;
|
|
12
|
+
'not equal': string;
|
|
13
|
+
'not contains': string;
|
|
14
|
+
'begin with': string;
|
|
15
|
+
'end with': string;
|
|
16
|
+
'not begin with': string;
|
|
17
|
+
'not end with': string;
|
|
18
|
+
'is null': string;
|
|
19
|
+
'is not null': string;
|
|
20
|
+
};
|
|
21
|
+
export declare const dateOperate: {
|
|
22
|
+
name: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}[];
|
|
25
|
+
export declare const dimensionOperate: ({
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
children?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
children: {
|
|
33
|
+
name: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
})[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export var numberOperate = [{
|
|
2
|
+
name: '>',
|
|
3
|
+
value: 'gt'
|
|
4
|
+
}, {
|
|
5
|
+
name: '=',
|
|
6
|
+
value: 'equal'
|
|
7
|
+
}, {
|
|
8
|
+
name: '<',
|
|
9
|
+
value: 'lt'
|
|
10
|
+
}, {
|
|
11
|
+
name: '>=',
|
|
12
|
+
value: 'ge'
|
|
13
|
+
}, {
|
|
14
|
+
name: '<=',
|
|
15
|
+
value: 'le'
|
|
16
|
+
}, {
|
|
17
|
+
name: '≠',
|
|
18
|
+
value: 'not equal'
|
|
19
|
+
}];
|
|
20
|
+
export var stringOperate = [{
|
|
21
|
+
name: '是',
|
|
22
|
+
value: 'equal'
|
|
23
|
+
}, {
|
|
24
|
+
name: '包含',
|
|
25
|
+
value: 'contains'
|
|
26
|
+
}, {
|
|
27
|
+
name: '不是',
|
|
28
|
+
value: 'not equal'
|
|
29
|
+
}, {
|
|
30
|
+
name: '不包含',
|
|
31
|
+
value: 'not contains'
|
|
32
|
+
}, {
|
|
33
|
+
name: '开头是',
|
|
34
|
+
value: 'begin with'
|
|
35
|
+
}, {
|
|
36
|
+
name: '结尾是',
|
|
37
|
+
value: 'end with'
|
|
38
|
+
}, {
|
|
39
|
+
name: '开头不是',
|
|
40
|
+
value: 'not begin with'
|
|
41
|
+
}, {
|
|
42
|
+
name: '结尾不是',
|
|
43
|
+
value: 'not end with'
|
|
44
|
+
}, {
|
|
45
|
+
name: '是空值',
|
|
46
|
+
value: 'is null'
|
|
47
|
+
}, {
|
|
48
|
+
name: '不是空值',
|
|
49
|
+
value: 'is not null'
|
|
50
|
+
}];
|
|
51
|
+
export var strOperateMap = {
|
|
52
|
+
equal: '是',
|
|
53
|
+
contains: '包含',
|
|
54
|
+
'not equal': '不是',
|
|
55
|
+
'not contains': '不包含',
|
|
56
|
+
'begin with': '开头是',
|
|
57
|
+
'end with': '结尾是',
|
|
58
|
+
'not begin with': '开头不是',
|
|
59
|
+
'not end with': '结尾不是',
|
|
60
|
+
'is null': '是空值',
|
|
61
|
+
'is not null': '不是空值'
|
|
62
|
+
};
|
|
63
|
+
export var dateOperate = [{
|
|
64
|
+
name: '最近',
|
|
65
|
+
value: 'relative'
|
|
66
|
+
}, {
|
|
67
|
+
name: '固定时段',
|
|
68
|
+
value: 'absolute'
|
|
69
|
+
}];
|
|
70
|
+
export var dimensionOperate = [{
|
|
71
|
+
name: '人数',
|
|
72
|
+
value: 'number'
|
|
73
|
+
}, {
|
|
74
|
+
name: '次数',
|
|
75
|
+
value: 'count'
|
|
76
|
+
}, {
|
|
77
|
+
name: '活跃比',
|
|
78
|
+
value: 'ratio'
|
|
79
|
+
}, {
|
|
80
|
+
name: '人均次数',
|
|
81
|
+
value: 'perTimes'
|
|
82
|
+
}, {
|
|
83
|
+
name: '金额',
|
|
84
|
+
value: 'money',
|
|
85
|
+
children: [{
|
|
86
|
+
name: '总和',
|
|
87
|
+
value: 'sum'
|
|
88
|
+
}, {
|
|
89
|
+
name: '均值',
|
|
90
|
+
value: 'mean'
|
|
91
|
+
}, {
|
|
92
|
+
name: '分布',
|
|
93
|
+
value: 'distribution'
|
|
94
|
+
}, {
|
|
95
|
+
name: '中位数',
|
|
96
|
+
value: 'median'
|
|
97
|
+
}]
|
|
98
|
+
}];
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export default [{
|
|
2
|
+
dimension_sub: 'browser_brand',
|
|
3
|
+
value_dict: false,
|
|
4
|
+
name: 'browser_brand',
|
|
5
|
+
id: 0,
|
|
6
|
+
text: '浏览器品牌',
|
|
7
|
+
category: 'fixed',
|
|
8
|
+
type: 1,
|
|
9
|
+
alias_name: null
|
|
10
|
+
}, {
|
|
11
|
+
dimension_sub: 'browser_version',
|
|
12
|
+
value_dict: false,
|
|
13
|
+
name: 'browser_version',
|
|
14
|
+
id: 0,
|
|
15
|
+
text: '浏览器版本',
|
|
16
|
+
category: 'fixed',
|
|
17
|
+
type: 2,
|
|
18
|
+
alias_name: null
|
|
19
|
+
}, {
|
|
20
|
+
dimension_sub: 'website',
|
|
21
|
+
value_dict: false,
|
|
22
|
+
name: 'website',
|
|
23
|
+
id: 0,
|
|
24
|
+
text: '来源域名',
|
|
25
|
+
category: 'fixed',
|
|
26
|
+
type: 1,
|
|
27
|
+
alias_name: null
|
|
28
|
+
}, {
|
|
29
|
+
dimension_sub: 'platform',
|
|
30
|
+
value_dict: false,
|
|
31
|
+
name: 'platform',
|
|
32
|
+
id: 0,
|
|
33
|
+
text: '平台',
|
|
34
|
+
category: 'fixed',
|
|
35
|
+
type: 1,
|
|
36
|
+
alias_name: null
|
|
37
|
+
}, {
|
|
38
|
+
dimension_sub: 'referer_url',
|
|
39
|
+
value_dict: false,
|
|
40
|
+
name: 'referer_url',
|
|
41
|
+
id: 0,
|
|
42
|
+
text: '来源URL',
|
|
43
|
+
category: 'fixed',
|
|
44
|
+
type: 1,
|
|
45
|
+
alias_name: null
|
|
46
|
+
}, {
|
|
47
|
+
dimension_sub: 'current_url',
|
|
48
|
+
value_dict: false,
|
|
49
|
+
name: 'current_url',
|
|
50
|
+
id: 0,
|
|
51
|
+
text: '当前URL',
|
|
52
|
+
category: 'fixed',
|
|
53
|
+
type: 1,
|
|
54
|
+
alias_name: null
|
|
55
|
+
}, {
|
|
56
|
+
dimension_sub: 'country',
|
|
57
|
+
value_dict: false,
|
|
58
|
+
name: 'country',
|
|
59
|
+
id: 0,
|
|
60
|
+
text: '国家',
|
|
61
|
+
category: 'fixed',
|
|
62
|
+
type: 1,
|
|
63
|
+
alias_name: null
|
|
64
|
+
}, {
|
|
65
|
+
dimension_sub: 'area',
|
|
66
|
+
value_dict: false,
|
|
67
|
+
name: 'area',
|
|
68
|
+
id: 0,
|
|
69
|
+
text: '省份',
|
|
70
|
+
category: 'fixed',
|
|
71
|
+
type: 1,
|
|
72
|
+
alias_name: null
|
|
73
|
+
}, {
|
|
74
|
+
dimension_sub: 'city',
|
|
75
|
+
value_dict: false,
|
|
76
|
+
name: 'city',
|
|
77
|
+
id: 0,
|
|
78
|
+
text: '城市',
|
|
79
|
+
category: 'fixed',
|
|
80
|
+
type: 1,
|
|
81
|
+
alias_name: null
|
|
82
|
+
}, {
|
|
83
|
+
dimension_sub: 'os',
|
|
84
|
+
value_dict: false,
|
|
85
|
+
name: 'os',
|
|
86
|
+
id: 0,
|
|
87
|
+
text: '操作系统',
|
|
88
|
+
category: 'fixed',
|
|
89
|
+
type: 1,
|
|
90
|
+
alias_name: null
|
|
91
|
+
}, {
|
|
92
|
+
dimension_sub: 'ov',
|
|
93
|
+
value_dict: false,
|
|
94
|
+
name: 'ov',
|
|
95
|
+
id: 0,
|
|
96
|
+
text: '系统版本',
|
|
97
|
+
category: 'fixed',
|
|
98
|
+
type: 2,
|
|
99
|
+
alias_name: null
|
|
100
|
+
}, {
|
|
101
|
+
dimension_sub: 'resolution_h',
|
|
102
|
+
value_dict: false,
|
|
103
|
+
name: 'resolution_h',
|
|
104
|
+
id: 0,
|
|
105
|
+
text: '屏幕高度',
|
|
106
|
+
category: 'fixed',
|
|
107
|
+
type: 2,
|
|
108
|
+
alias_name: null
|
|
109
|
+
}, {
|
|
110
|
+
dimension_sub: 'resolution_l',
|
|
111
|
+
value_dict: false,
|
|
112
|
+
name: 'resolution_l',
|
|
113
|
+
id: 0,
|
|
114
|
+
text: '屏幕宽度',
|
|
115
|
+
category: 'fixed',
|
|
116
|
+
type: 2,
|
|
117
|
+
alias_name: null
|
|
118
|
+
}, {
|
|
119
|
+
dimension_sub: 'first_referer_url',
|
|
120
|
+
value_dict: false,
|
|
121
|
+
name: 'first_referer_url',
|
|
122
|
+
id: 0,
|
|
123
|
+
text: '初始来源URL',
|
|
124
|
+
category: 'fixed',
|
|
125
|
+
type: 1,
|
|
126
|
+
alias_name: null
|
|
127
|
+
}, {
|
|
128
|
+
dimension_sub: 'ip',
|
|
129
|
+
value_dict: false,
|
|
130
|
+
name: 'ip',
|
|
131
|
+
id: 0,
|
|
132
|
+
text: 'IP',
|
|
133
|
+
category: 'fixed',
|
|
134
|
+
type: 1,
|
|
135
|
+
alias_name: null
|
|
136
|
+
}, {
|
|
137
|
+
dimension_sub: 'utm_source',
|
|
138
|
+
value_dict: false,
|
|
139
|
+
name: 'utm_source',
|
|
140
|
+
id: 0,
|
|
141
|
+
text: 'utm_source',
|
|
142
|
+
category: 'fixed',
|
|
143
|
+
type: 1,
|
|
144
|
+
alias_name: null
|
|
145
|
+
}, {
|
|
146
|
+
dimension_sub: 'utm_medium',
|
|
147
|
+
value_dict: false,
|
|
148
|
+
name: 'utm_medium',
|
|
149
|
+
id: 0,
|
|
150
|
+
text: 'utm_medium',
|
|
151
|
+
category: 'fixed',
|
|
152
|
+
type: 1,
|
|
153
|
+
alias_name: null
|
|
154
|
+
}, {
|
|
155
|
+
dimension_sub: 'utm_campaign',
|
|
156
|
+
value_dict: false,
|
|
157
|
+
name: 'utm_campaign',
|
|
158
|
+
id: 0,
|
|
159
|
+
text: 'utm_campaign',
|
|
160
|
+
category: 'fixed',
|
|
161
|
+
type: 1,
|
|
162
|
+
alias_name: null
|
|
163
|
+
}, {
|
|
164
|
+
dimension_sub: 'utm_content',
|
|
165
|
+
value_dict: false,
|
|
166
|
+
name: 'utm_content',
|
|
167
|
+
id: 0,
|
|
168
|
+
text: 'utm_content',
|
|
169
|
+
category: 'fixed',
|
|
170
|
+
type: 1,
|
|
171
|
+
alias_name: null
|
|
172
|
+
}, {
|
|
173
|
+
dimension_sub: 'utm_term',
|
|
174
|
+
value_dict: false,
|
|
175
|
+
name: 'utm_term',
|
|
176
|
+
id: 0,
|
|
177
|
+
text: 'utm_term',
|
|
178
|
+
category: 'fixed',
|
|
179
|
+
type: 1,
|
|
180
|
+
alias_name: null
|
|
181
|
+
}];
|