@zgfe/business-lib 1.1.66 → 1.1.67-beta.2
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/assets/iconfont/demo_index.html +118 -3
- package/es/assets/iconfont/iconfont.css +23 -3
- package/es/assets/iconfont/iconfont.js +1 -1
- package/es/assets/iconfont/iconfont.json +35 -0
- package/es/assets/iconfont/iconfont.ttf +0 -0
- package/es/assets/iconfont/iconfont.woff +0 -0
- package/es/assets/iconfont/iconfont.woff2 +0 -0
- package/es/assets/styles/chunks.less +18 -0
- package/es/assets/styles/variable.less +1 -0
- package/es/attrCondition/group.d.ts +2 -2
- package/es/attrCondition/group.js +10 -6
- package/es/attrCondition/index.js +43 -7
- package/es/attrCondition/styles/index.less +23 -7
- package/es/attrCondition/useAttrCondition.d.ts +3 -1
- package/es/attrCondition/useAttrCondition.js +2 -1
- package/es/attrCondition/useConditionGroup.js +14 -3
- package/es/attrConditions/components/stringList.d.ts +1 -0
- package/es/attrConditions/components/stringList.js +1 -0
- package/es/attrConditions/components/valuesList.d.ts +1 -0
- package/es/attrConditions/components/valuesList.js +6 -1
- package/es/attrConditions/index.js +4 -2
- package/es/attrConditions/types.d.ts +1 -0
- package/es/attributeSelector/demo/disable.js +6 -1
- package/es/attributeSelector/index.js +8 -13
- package/es/attributeSelector/styles/index.less +8 -19
- package/es/attributeSelector/types.d.ts +2 -1
- package/es/context/index.d.ts +4 -0
- package/es/context/index.js +2 -1
- package/es/eventSelector/index.js +0 -1
- package/es/eventSelector/listPanel.d.ts +10 -0
- package/es/eventSelector/listPanel.js +9 -9
- package/es/eventSelector/option.js +5 -2
- package/es/formulaTarget/components/formula/data.d.ts +16 -0
- package/es/formulaTarget/components/formula/data.js +40 -0
- package/es/formulaTarget/components/formula/demo.d.ts +2 -0
- package/es/formulaTarget/components/formula/demo.js +76 -0
- package/es/formulaTarget/components/formula/index.d.ts +6 -0
- package/es/formulaTarget/components/formula/index.js +132 -0
- package/es/formulaTarget/components/formula/index.less +68 -0
- package/es/formulaTarget/components/formula/types.d.ts +24 -0
- package/es/formulaTarget/components/formula/types.js +1 -0
- package/es/formulaTarget/components/formula/util.d.ts +28 -0
- package/es/formulaTarget/components/formula/util.js +245 -0
- package/es/formulaTarget/components/formulaItem/data.d.ts +2 -0
- package/es/formulaTarget/components/formulaItem/data.js +4 -0
- package/es/formulaTarget/components/formulaItem/index.d.ts +4 -0
- package/es/formulaTarget/components/formulaItem/index.js +190 -0
- package/es/formulaTarget/components/formulaItem/types.d.ts +10 -0
- package/es/formulaTarget/components/formulaItem/types.js +1 -0
- package/es/formulaTarget/components/panel/data.d.ts +8 -0
- package/es/formulaTarget/components/panel/data.js +32 -0
- package/es/formulaTarget/components/panel/demo.d.ts +2 -0
- package/es/formulaTarget/components/panel/demo.js +59 -0
- package/es/formulaTarget/components/panel/index.d.ts +6 -0
- package/es/formulaTarget/components/panel/index.js +162 -0
- package/es/formulaTarget/components/panel/index.less +131 -0
- package/es/formulaTarget/components/panel/item.d.ts +5 -0
- package/es/formulaTarget/components/panel/item.js +76 -0
- package/es/formulaTarget/components/panel/types.d.ts +13 -0
- package/es/formulaTarget/components/panel/types.js +1 -0
- package/es/formulaTarget/components/symbol/index.d.ts +7 -0
- package/es/formulaTarget/components/symbol/index.js +48 -0
- package/es/formulaTarget/components/symbol/index.less +48 -0
- package/es/formulaTarget/demo/group.d.ts +2 -0
- package/es/formulaTarget/demo/group.js +92 -0
- package/es/formulaTarget/demo/index.d.ts +2 -0
- package/es/formulaTarget/demo/index.js +21 -0
- package/es/formulaTarget/index.d.ts +5 -0
- package/es/formulaTarget/index.js +196 -0
- package/es/formulaTarget/styles/index.less +66 -0
- package/es/formulaTarget/types.d.ts +17 -0
- package/es/formulaTarget/types.js +1 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/select/handle.js +9 -2
- package/es/select/styles/handle.less +1 -0
- package/es/select/types.d.ts +1 -0
- package/es/targetConditionGroup/components/targetDimension.js +0 -2
- package/es/targetConditionGroup/demo/index.js +1 -0
- package/es/targetConditionGroup/index.js +15 -7
- package/es/targetConditionGroup/styles/index.less +31 -6
- package/es/targetSelector/index.js +11 -69
- package/es/targetSelector/optionIcon.js +3 -0
- package/es/targetSelector/styles/index.less +27 -13
- package/es/userGroup/index.js +5 -9
- package/es/userGroup/styles/index.less +9 -10
- package/package.json +2 -2
|
@@ -163,3 +163,21 @@
|
|
|
163
163
|
.__default-hover();
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
+
|
|
167
|
+
// 默认按钮
|
|
168
|
+
.__icon {
|
|
169
|
+
color: #9aa1a9;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
&:hover:not(.disabled) {
|
|
172
|
+
color: @primary-color;
|
|
173
|
+
}
|
|
174
|
+
&.disabled {
|
|
175
|
+
cursor: not-allowed;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.delete {
|
|
179
|
+
&:hover:not(.disabled) {
|
|
180
|
+
color: @error-color;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@box-shadow-small: 0px 1px 2px @shadow-color-light;
|
|
13
13
|
@primary-color-hover: color(~`colorPalette('@{primary-color}', 0.1) `);
|
|
14
14
|
@box-shadow-form: 0 0 0 4px @primary-color-hover;
|
|
15
|
+
@text-color-middle: #9aa1a9;
|
|
15
16
|
@custom-background: #fafafb;
|
|
16
17
|
@custom-focus: #f0f7ff;
|
|
17
18
|
@primary-color: '#165dff';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AttrConditionTypes } from '../attrConditions/types';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const BizAttrConditionGroup: React.ForwardRefExoticComponent<AttrConditionTypes.GroupProp & React.RefAttributes<any>>;
|
|
4
|
+
export default BizAttrConditionGroup;
|
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import useConditionGroup from './useConditionGroup';
|
|
3
3
|
import { Skeleton, Space } from 'antd';
|
|
4
4
|
import BizAttrCondition from '.';
|
|
5
|
-
var BizAttrConditionGroup = function
|
|
6
|
-
var
|
|
5
|
+
var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
6
|
+
var showHandle = props.showHandle,
|
|
7
|
+
eventIdList = props.eventIdList,
|
|
7
8
|
enableDelete = props.enableDelete,
|
|
8
9
|
enableEventProp = props.enableEventProp,
|
|
9
10
|
enableUserProp = props.enableUserProp,
|
|
@@ -25,16 +26,16 @@ var BizAttrConditionGroup = function BizAttrConditionGroup(props, ref) {
|
|
|
25
26
|
paragraph: {
|
|
26
27
|
rows: 2
|
|
27
28
|
}
|
|
28
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
}, showHandle ? /*#__PURE__*/React.createElement("div", {
|
|
29
30
|
className: "".concat(classPrefix, "-handle")
|
|
30
31
|
}, conditions.length > 1 && /*#__PURE__*/React.createElement("div", {
|
|
31
32
|
className: "".concat(classPrefix, "-operate"),
|
|
32
33
|
onClick: onClickRelation
|
|
33
34
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34
35
|
className: "".concat(classPrefix, "-operate-text ").concat(relation === 'and' || props.onlyAnd ? 'active' : '', " ").concat(props.onlyAnd ? 'only-and' : '')
|
|
35
|
-
}, "\u4E14"), !props.onlyAnd && /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u4E14")), !props.onlyAnd && /*#__PURE__*/React.createElement("div", {
|
|
36
37
|
className: "".concat(classPrefix, "-operate-text ").concat(relation === 'or' ? 'active' : '')
|
|
37
|
-
}, "\u6216"))), /*#__PURE__*/React.createElement(Space, {
|
|
38
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u6216")))) : null, /*#__PURE__*/React.createElement(Space, {
|
|
38
39
|
className: "".concat(classPrefix, "-container"),
|
|
39
40
|
direction: "vertical"
|
|
40
41
|
}, conditions.map(function (item, index) {
|
|
@@ -55,5 +56,8 @@ var BizAttrConditionGroup = function BizAttrConditionGroup(props, ref) {
|
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
}))));
|
|
59
|
+
});
|
|
60
|
+
BizAttrConditionGroup.defaultProps = {
|
|
61
|
+
showHandle: true
|
|
58
62
|
};
|
|
59
|
-
export default
|
|
63
|
+
export default BizAttrConditionGroup;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
7
|
import { Skeleton, Space } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
8
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
3
9
|
import BizAttributeSelector from '../attributeSelector';
|
|
4
10
|
import BizOperateList from '../attrConditions/components/operateList';
|
|
5
11
|
import ValuesList from '../attrConditions/components/valuesList';
|
|
12
|
+
import { OperateTypes } from '../attrConditions/types';
|
|
6
13
|
import useAttrCondition from './useAttrCondition';
|
|
7
14
|
import './styles/index.less';
|
|
8
15
|
import IconFont from '../icon/iconFont';
|
|
16
|
+
import { BizValidatorContext } from '../context';
|
|
9
17
|
var classPrefix = 'biz-attr-condition';
|
|
10
18
|
var BizAttrCondition = function BizAttrCondition(props) {
|
|
11
19
|
var eventIdList = props.eventIdList,
|
|
@@ -24,9 +32,29 @@ var BizAttrCondition = function BizAttrCondition(props) {
|
|
|
24
32
|
onChangeOperate = _useAttrCondition.onChangeOperate,
|
|
25
33
|
onChangeValues = _useAttrCondition.onChangeValues,
|
|
26
34
|
onDelete = _useAttrCondition.onDelete;
|
|
35
|
+
var _useContext = useContext(BizValidatorContext),
|
|
36
|
+
isValidate = _useContext.isValidate;
|
|
37
|
+
var _useState = useState(false),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
isAttrError = _useState2[0],
|
|
40
|
+
setIsAttrError = _useState2[1];
|
|
41
|
+
var _useState3 = useState(false),
|
|
42
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
43
|
+
isValueError = _useState4[0],
|
|
44
|
+
setValueError = _useState4[1];
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
setIsAttrError(function (error) {
|
|
47
|
+
return !!((isValidate || error) && !attr);
|
|
48
|
+
});
|
|
49
|
+
setValueError(function (error) {
|
|
50
|
+
return !!((isValidate || error) && attr && operate !== OperateTypes.IsNotNull && operate !== OperateTypes.IsNull && (!values || !values.length));
|
|
51
|
+
});
|
|
52
|
+
}, [isValidate, attr, operate, values]);
|
|
27
53
|
return /*#__PURE__*/React.createElement(Space, {
|
|
28
54
|
className: classPrefix
|
|
29
|
-
}, !loading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
55
|
+
}, !loading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "".concat(classPrefix, "-column")
|
|
57
|
+
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
30
58
|
value: attr,
|
|
31
59
|
eventIdList: eventIdList,
|
|
32
60
|
enableEventProp: enableEventProp,
|
|
@@ -36,19 +64,27 @@ var BizAttrCondition = function BizAttrCondition(props) {
|
|
|
36
64
|
onChange: onChangeAttr,
|
|
37
65
|
theme: theme,
|
|
38
66
|
destroyPopupOnHide: props.destroyPopupOnHide,
|
|
39
|
-
placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027"
|
|
40
|
-
|
|
67
|
+
placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027",
|
|
68
|
+
status: isAttrError ? 'error' : ''
|
|
69
|
+
}), isAttrError ? /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "".concat(classPrefix, "-error")
|
|
71
|
+
}, "\u5C5E\u6027\u4E0D\u53EF\u4E3A\u7A7A") : null), /*#__PURE__*/React.createElement(BizOperateList, {
|
|
41
72
|
theme: theme,
|
|
42
73
|
attr: attr,
|
|
43
74
|
defaultValue: operate,
|
|
44
75
|
onChange: onChangeOperate
|
|
45
|
-
}), /*#__PURE__*/React.createElement(
|
|
76
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "".concat(classPrefix, "-column")
|
|
78
|
+
}, /*#__PURE__*/React.createElement(ValuesList, {
|
|
46
79
|
attr: attr,
|
|
47
80
|
operate: operate,
|
|
48
81
|
defaultValue: values,
|
|
49
82
|
onChange: onChangeValues,
|
|
50
|
-
theme: theme
|
|
51
|
-
|
|
83
|
+
theme: theme,
|
|
84
|
+
status: isValueError ? 'error' : ''
|
|
85
|
+
}), isValueError ? /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: "".concat(classPrefix, "-error")
|
|
87
|
+
}, "\u5C5E\u6027\u503C\u4E0D\u53EF\u4E3A\u7A7A") : null), enableDelete && /*#__PURE__*/React.createElement(IconFont, {
|
|
52
88
|
type: "qingchu",
|
|
53
89
|
className: "".concat(classPrefix, "-btn-del"),
|
|
54
90
|
onClick: onDelete
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@import '../../assets/styles/inner.less';
|
|
2
2
|
.biz-attr-condition {
|
|
3
3
|
gap: 16px !important;
|
|
4
|
+
align-items: flex-start;
|
|
4
5
|
width: 100%;
|
|
5
6
|
&-btn-del {
|
|
6
7
|
color: #9aa1a9;
|
|
7
8
|
font-size: 16px !important;
|
|
9
|
+
line-height: 32px;
|
|
8
10
|
&:hover {
|
|
9
11
|
color: @error-color;
|
|
10
12
|
cursor: pointer;
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
&-handle {
|
|
34
36
|
position: relative;
|
|
35
37
|
width: 1px;
|
|
36
|
-
margin-right:
|
|
38
|
+
margin-right: 20px;
|
|
37
39
|
margin-left: 8px;
|
|
38
40
|
background: @border-color-base;
|
|
39
41
|
}
|
|
@@ -47,18 +49,25 @@
|
|
|
47
49
|
&-operate-text {
|
|
48
50
|
width: 16px;
|
|
49
51
|
height: 16px;
|
|
50
|
-
font-size: 12px;
|
|
51
52
|
line-height: 16px;
|
|
52
53
|
text-align: center;
|
|
54
|
+
span {
|
|
55
|
+
display: inline-block;
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
*font-size: 10px;
|
|
58
|
+
transform: scale(0.83, 0.83);
|
|
59
|
+
}
|
|
53
60
|
|
|
54
61
|
.__default-hover();
|
|
55
62
|
|
|
56
63
|
&:first-child {
|
|
57
|
-
border-
|
|
64
|
+
border-top-left-radius: 3px;
|
|
65
|
+
border-top-right-radius: 3px;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
&:last-child {
|
|
61
|
-
border-radius:
|
|
69
|
+
border-bottom-right-radius: 3px;
|
|
70
|
+
border-bottom-left-radius: 3px;
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
&.active {
|
|
@@ -66,8 +75,15 @@
|
|
|
66
75
|
background: @primary-color;
|
|
67
76
|
}
|
|
68
77
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-column {
|
|
81
|
+
position: relative;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
}
|
|
85
|
+
&-error {
|
|
86
|
+
padding-left: 4px;
|
|
87
|
+
color: @error-color;
|
|
72
88
|
}
|
|
73
89
|
}
|
|
@@ -5,7 +5,9 @@ declare const useAttrCondition: (props: AttrConditionTypes.ItemProp) => {
|
|
|
5
5
|
operate: import("../attrConditions/types").OperateTypes | undefined;
|
|
6
6
|
values: string[] | undefined;
|
|
7
7
|
loading: boolean;
|
|
8
|
-
onDelete: (
|
|
8
|
+
onDelete: (e: {
|
|
9
|
+
stopPropagation: () => void;
|
|
10
|
+
}) => void;
|
|
9
11
|
onChangeAttr: (attrData: AttributeSelect.Value) => void;
|
|
10
12
|
onChangeOperate: (data: any) => void;
|
|
11
13
|
onChangeValues: (data: any) => void;
|
|
@@ -59,7 +59,8 @@ var useAttrCondition = function useAttrCondition(props) {
|
|
|
59
59
|
}
|
|
60
60
|
setLoading(false);
|
|
61
61
|
}, []);
|
|
62
|
-
var onDelete = function onDelete() {
|
|
62
|
+
var onDelete = function onDelete(e) {
|
|
63
|
+
e.stopPropagation();
|
|
63
64
|
if (props.onDelete) props.onDelete();
|
|
64
65
|
};
|
|
65
66
|
useEffect(function () {
|
|
@@ -38,7 +38,7 @@ var useConditionGroup = function useConditionGroup(props, ref) {
|
|
|
38
38
|
}, []);
|
|
39
39
|
useImperativeHandle(ref, function () {
|
|
40
40
|
return {
|
|
41
|
-
add: function add() {
|
|
41
|
+
add: function add(changeCallBack) {
|
|
42
42
|
onConditionsCount && onConditionsCount(conditions.length + 1);
|
|
43
43
|
setConditions(function (conditions) {
|
|
44
44
|
conditions.push({
|
|
@@ -46,6 +46,13 @@ var useConditionGroup = function useConditionGroup(props, ref) {
|
|
|
46
46
|
});
|
|
47
47
|
return _toConsumableArray(conditions);
|
|
48
48
|
});
|
|
49
|
+
if (props.onChange && changeCallBack) {
|
|
50
|
+
var group = removeKeyToGroup(conditions, true);
|
|
51
|
+
props.onChange({
|
|
52
|
+
relation: relation,
|
|
53
|
+
conditions: group
|
|
54
|
+
});
|
|
55
|
+
}
|
|
49
56
|
},
|
|
50
57
|
setValue: function setValue(data) {
|
|
51
58
|
if (data) {
|
|
@@ -70,10 +77,14 @@ var useConditionGroup = function useConditionGroup(props, ref) {
|
|
|
70
77
|
};
|
|
71
78
|
});
|
|
72
79
|
};
|
|
73
|
-
var removeKeyToGroup = function removeKeyToGroup(data) {
|
|
80
|
+
var removeKeyToGroup = function removeKeyToGroup(data, addEmpty) {
|
|
74
81
|
var group = [];
|
|
75
82
|
data.forEach(function (item) {
|
|
76
|
-
if (item.data)
|
|
83
|
+
if (item.data) {
|
|
84
|
+
group.push(item.data);
|
|
85
|
+
} else if (addEmpty) {
|
|
86
|
+
group.push({});
|
|
87
|
+
}
|
|
77
88
|
});
|
|
78
89
|
return group;
|
|
79
90
|
};
|
|
@@ -157,6 +157,7 @@ var StringList = function StringList(props) {
|
|
|
157
157
|
disable: props.operate === OperateTypes.IsNull || props.operate === OperateTypes.IsNotNull,
|
|
158
158
|
labelField: "name",
|
|
159
159
|
keyField: "value",
|
|
160
|
+
status: props.status,
|
|
160
161
|
options: options,
|
|
161
162
|
onChange: onChange,
|
|
162
163
|
onSearch: setSearchValue,
|
|
@@ -20,7 +20,8 @@ var ValuesList = function ValuesList(props) {
|
|
|
20
20
|
var attr = props.attr,
|
|
21
21
|
defaultValue = props.defaultValue,
|
|
22
22
|
operate = props.operate,
|
|
23
|
-
theme = props.theme
|
|
23
|
+
theme = props.theme,
|
|
24
|
+
status = props.status;
|
|
24
25
|
var initValue = [moment().subtract(1, 'weeks').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')];
|
|
25
26
|
var _useState = useState(),
|
|
26
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -113,6 +114,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
113
114
|
attr: attr,
|
|
114
115
|
operate: operate,
|
|
115
116
|
value: current,
|
|
117
|
+
status: status,
|
|
116
118
|
onChange: onChange
|
|
117
119
|
});
|
|
118
120
|
} else if (attr.type === PropType.NUMBER) {
|
|
@@ -138,6 +140,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
138
140
|
placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u503C",
|
|
139
141
|
type: "number",
|
|
140
142
|
size: "middle",
|
|
143
|
+
status: status,
|
|
141
144
|
onChange: onChangeNumber,
|
|
142
145
|
suffix: attr.propCategory === 'userProp' && attr.subtype === 1 ? '%' : null
|
|
143
146
|
}), attr.propCategory === 'userProp' && attr.subtype === 2 && numberAfter);
|
|
@@ -148,6 +151,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
148
151
|
allowClear: false,
|
|
149
152
|
className: "".concat(classPrefix, "-date"),
|
|
150
153
|
inputReadOnly: true,
|
|
154
|
+
status: status,
|
|
151
155
|
locale: locale,
|
|
152
156
|
disabledDate: disabledDate,
|
|
153
157
|
placement: 'bottomRight',
|
|
@@ -165,6 +169,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
165
169
|
placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u503C",
|
|
166
170
|
type: "number",
|
|
167
171
|
suffix: "\u5929",
|
|
172
|
+
status: status,
|
|
168
173
|
onChange: onChangeDate
|
|
169
174
|
});
|
|
170
175
|
}
|
|
@@ -46,7 +46,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
46
46
|
onChangeAttr = _useAttrCondition.onChangeAttr,
|
|
47
47
|
onChangeOperate = _useAttrCondition.onChangeOperate,
|
|
48
48
|
onChangeValues = _useAttrCondition.onChangeValues,
|
|
49
|
-
|
|
49
|
+
_onDelete = _useAttrCondition.onDelete;
|
|
50
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
51
|
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
52
52
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -64,7 +64,9 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
64
64
|
enableEnvProp: enableEnvProp,
|
|
65
65
|
disableItemList: disableItemList,
|
|
66
66
|
onChange: onChangeAttr,
|
|
67
|
-
onDelete: onDelete,
|
|
67
|
+
onDelete: function onDelete(_data, e) {
|
|
68
|
+
return _onDelete(e);
|
|
69
|
+
},
|
|
68
70
|
theme: theme,
|
|
69
71
|
destroyPopupOnHide: props.destroyPopupOnHide
|
|
70
72
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -20,6 +20,11 @@ export default (function () {
|
|
|
20
20
|
}
|
|
21
21
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)), /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
22
22
|
needMeta: true
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
style: {
|
|
25
|
+
background: '#fff',
|
|
26
|
+
padding: 20
|
|
27
|
+
}
|
|
23
28
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
24
29
|
enableEventProp: true,
|
|
25
30
|
enableUserProp: true,
|
|
@@ -38,5 +43,5 @@ export default (function () {
|
|
|
38
43
|
propCategory: 'envProp'
|
|
39
44
|
}],
|
|
40
45
|
enableEnvProp: true
|
|
41
|
-
})));
|
|
46
|
+
}))));
|
|
42
47
|
});
|
|
@@ -71,8 +71,8 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
71
71
|
}
|
|
72
72
|
return res;
|
|
73
73
|
}
|
|
74
|
-
function onDelete() {
|
|
75
|
-
if (props.onDelete) props.onDelete(currentAttr);
|
|
74
|
+
function onDelete(e) {
|
|
75
|
+
if (props.onDelete) props.onDelete(currentAttr, e);
|
|
76
76
|
}
|
|
77
77
|
function onChange(val) {
|
|
78
78
|
setVisible(false);
|
|
@@ -83,9 +83,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
83
83
|
setVisible(flag);
|
|
84
84
|
};
|
|
85
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className:
|
|
87
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
className: "".concat(classPrefix, "-handle ").concat(visible ? 'focus' : '')
|
|
86
|
+
className: classPrefix
|
|
89
87
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
90
88
|
dropdownRender: function dropdownRender() {
|
|
91
89
|
return /*#__PURE__*/React.createElement(AttrListPanel, _objectSpread(_objectSpread({
|
|
@@ -104,30 +102,27 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
104
102
|
onOpenChange: onVisibleChange,
|
|
105
103
|
destroyPopupOnHide: props.destroyPopupOnHide
|
|
106
104
|
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
|
|
108
|
-
width: '100%'
|
|
109
|
-
}
|
|
105
|
+
className: "".concat(classPrefix, "-handle")
|
|
110
106
|
}, /*#__PURE__*/React.createElement(SelectHandle, {
|
|
111
107
|
ref: boxRef,
|
|
112
108
|
theme: theme,
|
|
113
|
-
border: false,
|
|
114
109
|
size: props.size,
|
|
115
110
|
label: (currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.alias) || (currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.label),
|
|
116
|
-
placeholder: placeholder
|
|
111
|
+
placeholder: placeholder,
|
|
112
|
+
status: props.status
|
|
117
113
|
}))), enableDelete && /*#__PURE__*/React.createElement(Tooltip, {
|
|
118
114
|
title: function title() {
|
|
119
115
|
return '删除';
|
|
120
116
|
}
|
|
121
117
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
122
|
-
className: "".concat(classPrefix, "-del-icon"),
|
|
118
|
+
className: "".concat(classPrefix, "-del-icon delete"),
|
|
123
119
|
type: 'qingchu',
|
|
124
120
|
onClick: onDelete
|
|
125
|
-
})))
|
|
121
|
+
})));
|
|
126
122
|
};
|
|
127
123
|
BizAttributeSelector.defaultProps = {
|
|
128
124
|
enableDelete: false,
|
|
129
125
|
placeholder: '请选择',
|
|
130
|
-
theme: 'secondary',
|
|
131
126
|
size: 'middle',
|
|
132
127
|
propSymbol: '*',
|
|
133
128
|
optionsHeaderTip: '带*的属性每日凌晨更新',
|
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
@import '../../assets/styles/inner.less';
|
|
2
2
|
|
|
3
3
|
.biz-attr-select {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: row;
|
|
8
|
-
.__select-handle();
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
justify-content: center;
|
|
14
|
-
}
|
|
7
|
+
&-handle {
|
|
8
|
+
min-width: 208px;
|
|
9
|
+
max-width: calc(100% - 56px);
|
|
15
10
|
}
|
|
16
11
|
|
|
17
12
|
&-del-icon {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
color: @text-color-secondary;
|
|
22
|
-
border-radius: @border-radius-small;
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
.__error-hover();
|
|
26
|
-
}
|
|
13
|
+
.__icon();
|
|
14
|
+
margin-left: 16px;
|
|
15
|
+
font-size: 16px !important;
|
|
27
16
|
}
|
|
28
17
|
|
|
29
18
|
&-drowdown {
|
|
@@ -82,10 +82,11 @@ export declare namespace AttributeSelect {
|
|
|
82
82
|
propSymbol?: ReactNode;
|
|
83
83
|
optionsHeaderTip?: string;
|
|
84
84
|
onChange?: (value: Value) => void;
|
|
85
|
-
onDelete?: (value?: Value) => void;
|
|
85
|
+
onDelete?: (value?: Value, e?: any) => void;
|
|
86
86
|
theme?: string;
|
|
87
87
|
destroyPopupOnHide?: boolean;
|
|
88
88
|
size?: SizeType;
|
|
89
|
+
status?: string;
|
|
89
90
|
}
|
|
90
91
|
interface Option {
|
|
91
92
|
groupName: string;
|
package/es/context/index.d.ts
CHANGED
|
@@ -48,3 +48,7 @@ export interface GlobalContextProps {
|
|
|
48
48
|
}
|
|
49
49
|
declare const BizGlobalDataContext: import("react").Context<GlobalContextProps>;
|
|
50
50
|
export default BizGlobalDataContext;
|
|
51
|
+
export declare const BizValidatorContext: import("react").Context<{
|
|
52
|
+
isValidate?: boolean | undefined;
|
|
53
|
+
setValidate?: ((isValidate?: boolean) => void) | undefined;
|
|
54
|
+
}>;
|
package/es/context/index.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AnalysisEvent } from '../attributeSelector/types';
|
|
2
3
|
import { EventSelectTypes } from './types';
|
|
3
4
|
declare const EventListPanel: React.FC<EventSelectTypes.DropdownProps>;
|
|
5
|
+
export declare const InfiniteScrollList: React.FC<{
|
|
6
|
+
scrollableTarget: string;
|
|
7
|
+
searchEventList: AnalysisEvent[];
|
|
8
|
+
searchValue: string;
|
|
9
|
+
groupId?: string | number;
|
|
10
|
+
currentId?: string | number;
|
|
11
|
+
selectList?: number[];
|
|
12
|
+
onClick: (data: AnalysisEvent) => void;
|
|
13
|
+
}>;
|
|
4
14
|
export default EventListPanel;
|
|
@@ -19,6 +19,7 @@ import { BuiltinIndicators } from '../constants/common';
|
|
|
19
19
|
import BizSearchInput from '../searchInput';
|
|
20
20
|
import EventListOption from './option';
|
|
21
21
|
var EventListPanel = function EventListPanel(props) {
|
|
22
|
+
var _currentValue$event2;
|
|
22
23
|
var showOverview = props.showOverview,
|
|
23
24
|
defaultSelectAble = props.defaultSelectAble;
|
|
24
25
|
var _useState = useState(''),
|
|
@@ -169,18 +170,18 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
169
170
|
scrollableTarget: scrollableId,
|
|
170
171
|
searchEventList: searchEventList,
|
|
171
172
|
searchValue: searchValue,
|
|
172
|
-
currentGroup: currentGroup,
|
|
173
|
-
currentValue: currentValue,
|
|
173
|
+
groupId: currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id,
|
|
174
|
+
currentId: currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event2 = currentValue.event) === null || _currentValue$event2 === void 0 ? void 0 : _currentValue$event2.id,
|
|
174
175
|
selectList: props.selectList,
|
|
175
176
|
onClick: onClickEvent
|
|
176
177
|
}))));
|
|
177
178
|
};
|
|
178
|
-
var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
179
|
+
export var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
179
180
|
var scrollableTarget = _ref.scrollableTarget,
|
|
180
181
|
searchEventList = _ref.searchEventList,
|
|
181
182
|
searchValue = _ref.searchValue,
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
groupId = _ref.groupId,
|
|
184
|
+
currentId = _ref.currentId,
|
|
184
185
|
onClick = _ref.onClick,
|
|
185
186
|
selectList = _ref.selectList;
|
|
186
187
|
var _useState11 = useState([]),
|
|
@@ -225,15 +226,14 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
225
226
|
className: "".concat(classPrefix, "-event-item-wrap"),
|
|
226
227
|
key: Math.random()
|
|
227
228
|
}, showList.map(function (e) {
|
|
228
|
-
var _currentValue$event2, _currentValue$event3;
|
|
229
229
|
var _disable = false;
|
|
230
|
-
if (selectList && (selectList === null || selectList === void 0 ? void 0 : selectList.indexOf(e.id)) !== -1 &&
|
|
230
|
+
if (selectList && (selectList === null || selectList === void 0 ? void 0 : selectList.indexOf(e.id)) !== -1 && currentId !== e.id) {
|
|
231
231
|
_disable = true;
|
|
232
232
|
}
|
|
233
233
|
return /*#__PURE__*/React.createElement(EventListOption, {
|
|
234
234
|
label: e.alias || e.name,
|
|
235
|
-
key: "".concat(
|
|
236
|
-
checked:
|
|
235
|
+
key: "".concat(groupId, "-").concat(e.id),
|
|
236
|
+
checked: currentId === e.id,
|
|
237
237
|
disable: _disable,
|
|
238
238
|
highlight: {
|
|
239
239
|
enable: true,
|
|
@@ -12,8 +12,9 @@ var EventListOption = function EventListOption(props) {
|
|
|
12
12
|
onClick = props.onClick,
|
|
13
13
|
data = props.data,
|
|
14
14
|
disable = props.disable;
|
|
15
|
-
var _onClick = function _onClick() {
|
|
15
|
+
var _onClick = function _onClick(e) {
|
|
16
16
|
if (disable) return;
|
|
17
|
+
e.stopPropagation();
|
|
17
18
|
if (onClick) onClick(data);
|
|
18
19
|
};
|
|
19
20
|
function getLabel(label) {
|
|
@@ -31,7 +32,9 @@ var EventListOption = function EventListOption(props) {
|
|
|
31
32
|
}
|
|
32
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
34
|
className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : '', " ").concat(disable ? 'disable' : ''),
|
|
34
|
-
onClick:
|
|
35
|
+
onClick: function onClick(e) {
|
|
36
|
+
return _onClick(e);
|
|
37
|
+
}
|
|
35
38
|
}, /*#__PURE__*/React.createElement("div", {
|
|
36
39
|
className: "".concat(classPrefix, "-option-label"),
|
|
37
40
|
title: label
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const formulaList: string[];
|
|
2
|
+
export declare const formulaList2: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
export declare const formulaObj: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const formulaDimensions: {
|
|
10
|
+
type: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const resultFormatList: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|