@zgfe/business-lib 1.1.82-user.3 → 1.1.82-user.5
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/attrCondition/group.js +7 -6
- package/es/attrCondition/styles/index.less +11 -3
- package/es/userGroup/styles/index.less +3 -0
- package/es/userGroupHeader/demo/index.js +1 -1
- package/es/userGroupHeader/index.js +12 -45
- package/es/userGroupHeader/styles/index.less +10 -14
- package/es/utils/ajax.js +12 -4
- package/es/utils/demo/interruption.js +20 -18
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import useConditionGroup from './useConditionGroup';
|
|
3
|
-
import { Skeleton
|
|
3
|
+
import { Skeleton } from 'antd';
|
|
4
4
|
import BizAttrCondition from '.';
|
|
5
5
|
var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
6
6
|
var showHandle = props.showHandle,
|
|
@@ -38,11 +38,12 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
38
38
|
className: "".concat(classPrefix, "-operate-text ").concat(relation === 'and' || props.onlyAnd ? 'active' : '', " ").concat(props.onlyAnd ? 'only-and' : '')
|
|
39
39
|
}, /*#__PURE__*/React.createElement("span", null, "\u4E14")), !props.onlyAnd && /*#__PURE__*/React.createElement("div", {
|
|
40
40
|
className: "".concat(classPrefix, "-operate-text ").concat(relation === 'or' ? 'active' : '')
|
|
41
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u6216")))) : null, /*#__PURE__*/React.createElement(
|
|
42
|
-
className: "".concat(classPrefix, "-container")
|
|
43
|
-
direction: "vertical"
|
|
41
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u6216")))) : null, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "".concat(classPrefix, "-container")
|
|
44
43
|
}, conditions.map(function (item, index) {
|
|
45
|
-
return /*#__PURE__*/React.createElement(
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "".concat(classPrefix, "-container-item")
|
|
46
|
+
}, /*#__PURE__*/React.createElement(BizAttrCondition, {
|
|
46
47
|
key: item.key,
|
|
47
48
|
value: item.data,
|
|
48
49
|
eventIdList: eventIdList,
|
|
@@ -57,7 +58,7 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
57
58
|
onDelete: function onDelete() {
|
|
58
59
|
return _onDelete(index);
|
|
59
60
|
}
|
|
60
|
-
});
|
|
61
|
+
}));
|
|
61
62
|
}))));
|
|
62
63
|
});
|
|
63
64
|
BizAttrConditionGroup.defaultProps = {
|
|
@@ -29,14 +29,22 @@
|
|
|
29
29
|
}
|
|
30
30
|
&-container {
|
|
31
31
|
flex: 1;
|
|
32
|
-
gap: 12px !important;
|
|
33
32
|
width: 100%;
|
|
33
|
+
max-width: calc(100% + 24px);
|
|
34
|
+
margin-left: -24px;
|
|
35
|
+
|
|
36
|
+
&-item {
|
|
37
|
+
padding: 4px 0 4px 48px;
|
|
38
|
+
&:hover {
|
|
39
|
+
background: @primary-color-hover;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
&-handle {
|
|
36
44
|
position: relative;
|
|
37
45
|
width: 1px;
|
|
38
|
-
margin-right:
|
|
39
|
-
margin-left:
|
|
46
|
+
margin-right: 0;
|
|
47
|
+
margin-left: 32px;
|
|
40
48
|
background: @border-color-base;
|
|
41
49
|
}
|
|
42
50
|
&-operate {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
.__select-handle();
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: row;
|
|
11
|
+
align-items: center;
|
|
11
12
|
width: 100%;
|
|
12
13
|
min-height: @height-base;
|
|
13
14
|
padding: 4px 4px 4px 12px;
|
|
@@ -50,6 +51,8 @@
|
|
|
50
51
|
display: none;
|
|
51
52
|
flex: none;
|
|
52
53
|
width: 16px;
|
|
54
|
+
max-height: 24px;
|
|
55
|
+
margin-left: 6px;
|
|
53
56
|
text-align: center;
|
|
54
57
|
border-radius: @border-radius-small;
|
|
55
58
|
&:hover {
|
|
@@ -11,7 +11,7 @@ export default (function () {
|
|
|
11
11
|
}, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
|
|
12
12
|
max: 3,
|
|
13
13
|
enableTags: true,
|
|
14
|
-
value: [['
|
|
14
|
+
value: [['4077:685001635528704'], 836, 837],
|
|
15
15
|
onChange: function onChange(value) {
|
|
16
16
|
console.log('>>>>>>>>回传值', value);
|
|
17
17
|
}
|
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useEffect } from 'react';
|
|
12
12
|
import './styles/index.less';
|
|
13
|
-
import { Space } from 'antd';
|
|
13
|
+
import { Space, Tooltip } from 'antd';
|
|
14
14
|
import BizUserGroup from '../userGroup';
|
|
15
15
|
import IconFont from '../icon/iconFont';
|
|
16
16
|
import _ from 'lodash';
|
|
@@ -22,16 +22,8 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
22
22
|
var classPrefix = 'biz-user-group-header';
|
|
23
23
|
var _React$useState = React.useState([]),
|
|
24
24
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var _React$useState3 = React.useState([]),
|
|
28
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
29
|
-
tempValue = _React$useState4[0],
|
|
30
|
-
setTempValue = _React$useState4[1];
|
|
31
|
-
var _React$useState5 = React.useState(false),
|
|
32
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
33
|
-
showBtn = _React$useState6[0],
|
|
34
|
-
setShowBtn = _React$useState6[1];
|
|
25
|
+
tempValue = _React$useState2[0],
|
|
26
|
+
setTempValue = _React$useState2[1];
|
|
35
27
|
useEffect(function () {
|
|
36
28
|
var defaultValue = (value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
37
29
|
return {
|
|
@@ -41,22 +33,14 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
41
33
|
})) || [{
|
|
42
34
|
id: Math.random().toString()
|
|
43
35
|
}];
|
|
44
|
-
setGroupList(defaultValue);
|
|
45
36
|
setTempValue(_.cloneDeep(defaultValue));
|
|
46
37
|
}, []);
|
|
47
38
|
useEffect(function () {
|
|
48
39
|
if (!onChange) return;
|
|
49
|
-
onChange(
|
|
40
|
+
onChange(tempValue.map(function (item) {
|
|
50
41
|
return item.value;
|
|
51
42
|
}));
|
|
52
|
-
}, [
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
setShowBtn(!_.isEqual(groupList.map(function (item) {
|
|
55
|
-
return item.value;
|
|
56
|
-
}), tempValue.map(function (item) {
|
|
57
|
-
return item.value;
|
|
58
|
-
})));
|
|
59
|
-
}, [groupList, tempValue]);
|
|
43
|
+
}, [tempValue]);
|
|
60
44
|
function onAdd() {
|
|
61
45
|
if (max && tempValue.length >= max) return;
|
|
62
46
|
var list = _toConsumableArray(tempValue);
|
|
@@ -65,32 +49,13 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
65
49
|
});
|
|
66
50
|
setTempValue(list);
|
|
67
51
|
}
|
|
68
|
-
function onSure() {
|
|
69
|
-
setGroupList(_.cloneDeep(tempValue));
|
|
70
|
-
}
|
|
71
|
-
function onCancel() {
|
|
72
|
-
setTempValue(_.cloneDeep(groupList).map(function (item) {
|
|
73
|
-
item.id = Math.random().toString();
|
|
74
|
-
return item;
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
52
|
return /*#__PURE__*/React.createElement("div", {
|
|
78
53
|
className: classPrefix
|
|
79
|
-
}, /*#__PURE__*/React.createElement(
|
|
80
|
-
direction: "vertical",
|
|
81
|
-
size: 12
|
|
82
|
-
}, /*#__PURE__*/React.createElement(Space, {
|
|
83
|
-
size: 16
|
|
84
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
55
|
className: "".concat(classPrefix, "-title")
|
|
86
|
-
}, "\u5206\u6790\u7528\u6237\u7FA4"),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, "\u786E\u5B9A"), /*#__PURE__*/React.createElement("a", {
|
|
90
|
-
className: "".concat(classPrefix, "-cancel"),
|
|
91
|
-
onClick: onCancel
|
|
92
|
-
}, "\u53D6\u6D88"))), /*#__PURE__*/React.createElement(Space, {
|
|
93
|
-
size: 16
|
|
56
|
+
}, "\u5206\u6790\u7528\u6237\u7FA4"), /*#__PURE__*/React.createElement(Space, {
|
|
57
|
+
size: 16,
|
|
58
|
+
className: "".concat(classPrefix, "-container")
|
|
94
59
|
}, [tempValue.map(function (item, i) {
|
|
95
60
|
return /*#__PURE__*/React.createElement(BizUserGroup, {
|
|
96
61
|
key: item.id,
|
|
@@ -108,7 +73,9 @@ var BizUserGroupHeader = function BizUserGroupHeader(_ref) {
|
|
|
108
73
|
setTempValue(list);
|
|
109
74
|
}
|
|
110
75
|
});
|
|
111
|
-
})], /*#__PURE__*/React.createElement(
|
|
76
|
+
})], /*#__PURE__*/React.createElement(Tooltip, {
|
|
77
|
+
title: "\u6DFB\u52A0\u7528\u6237\u7FA4\u505A\u5BF9\u6BD4"
|
|
78
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
112
79
|
type: "tianjia",
|
|
113
80
|
className: "".concat(classPrefix, "-add ").concat(max && tempValue.length >= max ? 'disabled' : ''),
|
|
114
81
|
onClick: onAdd
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
@import '../../assets/styles/inner.less';
|
|
2
2
|
.biz-user-group-header {
|
|
3
|
-
padding: 6px @margin-lg;
|
|
4
3
|
background: #fff;
|
|
5
4
|
&-title {
|
|
5
|
+
margin-bottom: @margin-xs;
|
|
6
|
+
padding-left: @padding-lg;
|
|
6
7
|
color: @text-color-secondary;
|
|
7
8
|
font-weight: 500;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
display: none;
|
|
11
|
-
color: @primary-color;
|
|
12
|
-
}
|
|
13
|
-
&-cancel {
|
|
14
|
-
display: none;
|
|
15
|
-
color: @text-color-secondary;
|
|
16
|
-
}
|
|
10
|
+
|
|
17
11
|
&-add {
|
|
18
12
|
color: @primary-color;
|
|
13
|
+
font-size: 20px !important;
|
|
19
14
|
cursor: pointer;
|
|
20
15
|
&.disabled {
|
|
21
16
|
display: none;
|
|
@@ -24,11 +19,12 @@
|
|
|
24
19
|
.biz-user {
|
|
25
20
|
width: 208px;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
&-container {
|
|
23
|
+
width: 100%;
|
|
24
|
+
padding: @padding-xss @padding-lg;
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
background: #e8efff;
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
}
|
package/es/utils/ajax.js
CHANGED
|
@@ -36,7 +36,9 @@ var errorHandler = function errorHandler(error) {
|
|
|
36
36
|
});
|
|
37
37
|
} else if (!response) {
|
|
38
38
|
if (Request.isCancel(error) || (error === null || error === void 0 ? void 0 : error.type) === 'AbortError') {
|
|
39
|
-
|
|
39
|
+
var abortError = new Error('AbortError');
|
|
40
|
+
abortError.isCancel = true;
|
|
41
|
+
throw abortError;
|
|
40
42
|
}
|
|
41
43
|
notification.error({
|
|
42
44
|
description: '您的网络发生异常,无法连接服务器',
|
|
@@ -161,14 +163,20 @@ function _request() {
|
|
|
161
163
|
case 26:
|
|
162
164
|
_context.prev = 26;
|
|
163
165
|
_context.t0 = _context["catch"](0);
|
|
164
|
-
if (!
|
|
166
|
+
if (!_context.t0.isCancel) {
|
|
165
167
|
_context.next = 30;
|
|
166
168
|
break;
|
|
167
169
|
}
|
|
168
|
-
throw
|
|
170
|
+
throw _context.t0;
|
|
169
171
|
case 30:
|
|
172
|
+
if (!(_context.t0.message === 'Request Interruption')) {
|
|
173
|
+
_context.next = 32;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
throw new Error('Request Interruption');
|
|
177
|
+
case 32:
|
|
170
178
|
return _context.abrupt("return", null);
|
|
171
|
-
case
|
|
179
|
+
case 33:
|
|
172
180
|
case "end":
|
|
173
181
|
return _context.stop();
|
|
174
182
|
}
|
|
@@ -1,38 +1,40 @@
|
|
|
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 { Button, message } from 'antd';
|
|
2
8
|
import React from 'react';
|
|
3
9
|
import { ajax } from '@zgfe/business-lib';
|
|
4
|
-
import
|
|
5
|
-
var CancelToken = Request.CancelToken;
|
|
6
|
-
var cancel;
|
|
10
|
+
import InnerDemo from '../../demoWrapper/innerDemo';
|
|
7
11
|
export default (function () {
|
|
12
|
+
var _React$useState = React.useState(),
|
|
13
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14
|
+
controller = _React$useState2[0],
|
|
15
|
+
setController = _React$useState2[1];
|
|
8
16
|
var getPanels = function getPanels() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
var control = new AbortController();
|
|
18
|
+
var signal = control.signal;
|
|
19
|
+
controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
20
|
+
setController(control);
|
|
12
21
|
ajax('/zg/web/v2/apppanel/panels', {
|
|
13
22
|
method: 'post',
|
|
14
23
|
data: {
|
|
15
24
|
appId: 501648,
|
|
16
25
|
platform: 0
|
|
17
26
|
},
|
|
18
|
-
|
|
19
|
-
cancel = c;
|
|
20
|
-
}),
|
|
21
|
-
responseWrapper: function responseWrapper(_url, res) {
|
|
22
|
-
if (/07$/.test(res.code)) {
|
|
23
|
-
console.log('reLogin-----');
|
|
24
|
-
throw new Error('reLogin');
|
|
25
|
-
}
|
|
26
|
-
return res;
|
|
27
|
-
}
|
|
27
|
+
signal: signal
|
|
28
28
|
}).then(function (res) {
|
|
29
29
|
if (!res) return;
|
|
30
30
|
message.success('请求成功');
|
|
31
31
|
}).catch(function (e) {
|
|
32
|
-
|
|
32
|
+
if (e.isCancel) {
|
|
33
|
+
console.log('请求被取消了');
|
|
34
|
+
}
|
|
33
35
|
});
|
|
34
36
|
};
|
|
35
|
-
return /*#__PURE__*/React.createElement(
|
|
37
|
+
return /*#__PURE__*/React.createElement(InnerDemo, null, /*#__PURE__*/React.createElement(Button, {
|
|
36
38
|
onClick: getPanels
|
|
37
39
|
}, "\u8BF7\u6C42\u63A5\u53E3"));
|
|
38
40
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.82-user.
|
|
3
|
+
"version": "1.1.82-user.5",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "aeea8df5432a158d085d299f4e525166b117b2b3",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|