@lingxiteam/assets 0.9.30 → 0.11.30-alpha.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/es/error/errorCatch/index.js +0 -0
- package/es/error/errorDisplay/Mobile/Drawer/Drawer.js +111 -0
- package/es/error/errorDisplay/Mobile/Drawer/Drawer.less +176 -0
- package/es/error/errorDisplay/Mobile/Drawer/index.js +160 -0
- package/es/error/errorDisplay/Mobile/ErrorMsg/index.js +184 -0
- package/es/error/errorDisplay/Mobile/Modal/Modal.js +43 -0
- package/es/error/errorDisplay/Mobile/Modal/Modal.less +143 -0
- package/es/error/errorDisplay/Mobile/Modal/index.js +145 -0
- package/es/error/errorDisplay/SVGstring.js +6 -0
- package/es/error/errorDisplay/Web/Drawer/Drawer.js +267 -0
- package/es/error/errorDisplay/Web/Drawer/Drawer.less +340 -0
- package/es/error/errorDisplay/Web/Drawer/DrawerConnect.js +257 -0
- package/es/error/errorDisplay/Web/Drawer/index.js +145 -0
- package/es/error/errorDisplay/Web/ErrorMsg/index.js +206 -0
- package/es/error/errorDisplay/Web/Notification/Notice.js +94 -0
- package/es/error/errorDisplay/Web/Notification/Notification.js +166 -0
- package/es/error/errorDisplay/Web/Notification/Notification.less +105 -0
- package/es/error/errorDisplay/Web/Notification/index.js +98 -0
- package/es/error/errorDisplay/animation.less +102 -0
- package/es/error/errorDisplay/compUtils.js +20 -0
- package/es/error/errorDisplay/const.js +14 -0
- package/es/error/errorDisplay/http.js +120 -0
- package/es/error/index.js +3 -0
- package/es/images/ico-back.png +0 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/security/const.d.ts +14 -0
- package/es/security/const.js +16 -0
- package/es/security/encipher/aes.d.ts +2 -0
- package/es/security/encipher/aes.js +28 -0
- package/es/security/encipher/des.d.ts +2 -0
- package/es/security/encipher/des.js +27 -0
- package/es/security/encipher/rsa.d.ts +2 -0
- package/es/security/encipher/rsa.js +19 -0
- package/es/security/{sign.d.ts → encipher/sign.d.ts} +0 -0
- package/es/security/{sign.js → encipher/sign.js} +2 -2
- package/es/security/fetch.d.ts +6 -2
- package/es/security/fetch.js +230 -11
- package/es/security/httpEncryption.js +19 -5
- package/es/security/index.d.ts +11 -4
- package/es/security/index.js +5 -1
- package/es/utils/url.d.ts +1 -0
- package/es/utils/url.js +31 -0
- package/lib/index.js +14 -0
- package/package.json +4 -2
|
File without changes
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React, { forwardRef, isValidElement } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { BackIcon } from '../../SVGstring';
|
|
4
|
+
import { getSvgImageBase64 } from '../../../../utils/img';
|
|
5
|
+
import './Drawer.less';
|
|
6
|
+
|
|
7
|
+
var isDomEle = function isDomEle(target) {
|
|
8
|
+
return typeof target === 'string' || /*#__PURE__*/isValidElement(target);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
var emptyTxt = '暂无匹配信息,请联系平台管理员';
|
|
12
|
+
var Drawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
|
+
var visible = props.visible,
|
|
14
|
+
title = props.title,
|
|
15
|
+
tabs = props.tabs,
|
|
16
|
+
activeTabsKey = props.activeTabsKey,
|
|
17
|
+
onTabsChange = props.onTabsChange,
|
|
18
|
+
dataSource = props.dataSource,
|
|
19
|
+
onCancel = props.onCancel,
|
|
20
|
+
onClickRecord = props.onClickRecord,
|
|
21
|
+
_props$mode = props.mode,
|
|
22
|
+
mode = _props$mode === void 0 ? 'content' : _props$mode;
|
|
23
|
+
|
|
24
|
+
var renderItems = function renderItems() {
|
|
25
|
+
if (Array.isArray(dataSource) && dataSource.length > 0) {
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "lxm-drawer-list"
|
|
28
|
+
}, dataSource.map(function (item) {
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
key: item === null || item === void 0 ? void 0 : item.key,
|
|
31
|
+
className: classnames('lxm-drawer-list-item', item === null || item === void 0 ? void 0 : item.status),
|
|
32
|
+
onClick: function onClick() {
|
|
33
|
+
onClickRecord(item);
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "lxm-drawer-list-item-dt"
|
|
37
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "lxm-drawer-list-item-dt-title"
|
|
39
|
+
}, (item === null || item === void 0 ? void 0 : item.title) || ''), (item === null || item === void 0 ? void 0 : item.extra) ? /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "lxm-drawer-list-item-dt-extra"
|
|
41
|
+
}, item === null || item === void 0 ? void 0 : item.extra) : ''), /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "lxm-drawer-list-item-dd"
|
|
43
|
+
}, (item === null || item === void 0 ? void 0 : item.content) || ''));
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "lxm-drawer-empty"
|
|
49
|
+
}, "\u6682\u65E0\u6570\u636E");
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var renderContent = function renderContent() {
|
|
53
|
+
if (dataSource && ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.author) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.content))) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: "lxm-drawer-content"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: "lxm-drawer-content-head"
|
|
58
|
+
}, isDomEle(dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) ? /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "lxm-drawer-content-head-title"
|
|
60
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) : '', isDomEle(dataSource === null || dataSource === void 0 ? void 0 : dataSource.author) ? /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "lxm-drawer-content-head-author"
|
|
62
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.author) : ''), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "lxm-drawer-content-body"
|
|
64
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
// eslint-disable-next-line react/no-danger
|
|
66
|
+
dangerouslySetInnerHTML: {
|
|
67
|
+
__html: dataSource === null || dataSource === void 0 ? void 0 : dataSource.content
|
|
68
|
+
}
|
|
69
|
+
})));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "lxm-drawer-empty"
|
|
74
|
+
}, emptyTxt);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return visible ? /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
ref: ref,
|
|
79
|
+
className: "lxm-drawer-wraper"
|
|
80
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: "lxm-drawer-container"
|
|
82
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: "lxm-drawer-header"
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: "lxm-drawer-header-extend",
|
|
86
|
+
onClick: onCancel
|
|
87
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
88
|
+
src: getSvgImageBase64(BackIcon),
|
|
89
|
+
alt: "",
|
|
90
|
+
className: "lxm-drawer-header-close"
|
|
91
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "lxm-drawer-header-title"
|
|
93
|
+
}, isDomEle(title) ? title : ''), /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: "lxm-drawer-header-extend"
|
|
95
|
+
})), Array.isArray(tabs) && tabs.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: "lxm-drawer-tabs"
|
|
97
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "lxm-drawer-tabs-row"
|
|
99
|
+
}, tabs.map(function (item) {
|
|
100
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: classnames('lxm-drawer-tabs-btn', activeTabsKey === (item === null || item === void 0 ? void 0 : item.key) ? 'active' : ''),
|
|
102
|
+
key: item === null || item === void 0 ? void 0 : item.key,
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
onTabsChange(item);
|
|
105
|
+
}
|
|
106
|
+
}, item.tab);
|
|
107
|
+
}))) : '', /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: "lxm-drawer-main"
|
|
109
|
+
}, mode === 'list' ? renderItems() : renderContent()))) : '';
|
|
110
|
+
});
|
|
111
|
+
export default Drawer;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
@import url('../../animation.less');
|
|
2
|
+
|
|
3
|
+
.lxm-drawer {
|
|
4
|
+
&-wraper {
|
|
5
|
+
position: absolute;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
z-index: 9999;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-close-move &-container {
|
|
15
|
+
animation: lxmDrawerClose 0.3s;
|
|
16
|
+
animation-fill-mode: forwards;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-container {
|
|
20
|
+
position: relative;
|
|
21
|
+
height: 100%;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
background-color: #fff;
|
|
26
|
+
animation: lxmDrawerOpen 0.3s;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
height: 44px;
|
|
33
|
+
background-color: #f6f8fa;
|
|
34
|
+
|
|
35
|
+
&-close {
|
|
36
|
+
width: 24px;
|
|
37
|
+
height: 24px;
|
|
38
|
+
display: inline-block;
|
|
39
|
+
vertical-align: middle;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-extend {
|
|
44
|
+
width: 80px;
|
|
45
|
+
padding: 0 20px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-title {
|
|
49
|
+
flex: 1;
|
|
50
|
+
text-align: center;
|
|
51
|
+
font-size: 18px;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
color: #1c242e;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
text-overflow: ellipsis;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-tabs {
|
|
61
|
+
padding: 8px 20px;
|
|
62
|
+
background-color: #f6f8fa;
|
|
63
|
+
|
|
64
|
+
&-row {
|
|
65
|
+
background: #f0f0f0;
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
padding: 4px;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&-row &-btn {
|
|
73
|
+
color: #1c242e;
|
|
74
|
+
text-align: center;
|
|
75
|
+
padding: 4px;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
flex: 1;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&-row &-btn.active {
|
|
83
|
+
background-color: #fff;
|
|
84
|
+
font-weight: 500;
|
|
85
|
+
box-shadow: 0 1px 6px -4px rgba(28, 36, 46, 0.15);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&-main {
|
|
90
|
+
border-top: 1px solid #f0f0f0;
|
|
91
|
+
flex: 1;
|
|
92
|
+
background-color: #fff;
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&-content {
|
|
97
|
+
padding: 20px;
|
|
98
|
+
|
|
99
|
+
&-head {
|
|
100
|
+
margin-bottom: 20px;
|
|
101
|
+
|
|
102
|
+
&-title {
|
|
103
|
+
font-size: 21px;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
color: #1c242e;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&-author {
|
|
109
|
+
font-size: 13px;
|
|
110
|
+
color: rgba(28, 36, 46, 0.45);;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&-body {
|
|
115
|
+
font-size: 15px;
|
|
116
|
+
color: rgba(28, 36, 46, 0.75);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&-list {
|
|
121
|
+
padding: 0 20px;
|
|
122
|
+
|
|
123
|
+
&-item {
|
|
124
|
+
padding: 8px 0;
|
|
125
|
+
border-bottom: 1px solid #f0f0f0;
|
|
126
|
+
|
|
127
|
+
&.purple &-dt {
|
|
128
|
+
&-title {
|
|
129
|
+
color: #9747ff;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.blue &-dt {
|
|
134
|
+
&-title {
|
|
135
|
+
color: #47e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.red &-dt {
|
|
140
|
+
&-title {
|
|
141
|
+
color: #fa7570;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&-dt {
|
|
146
|
+
display: flex;
|
|
147
|
+
|
|
148
|
+
&-title {
|
|
149
|
+
flex: 1;
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&-extra {
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
color: rgba(28, 36, 46, 0.45);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&-title + &-extra {
|
|
160
|
+
margin-left: 8px;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-dd {
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
color: rgba(28, 36, 46, 0.75);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&-empty {
|
|
172
|
+
padding: 20px;
|
|
173
|
+
text-align: center;
|
|
174
|
+
color: rgba(28, 36, 46, 0.45);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
var _excluded = ["getContainer"],
|
|
2
|
+
_excluded2 = ["close", "onTabsChange", "visible", "getContainer"];
|
|
3
|
+
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { createPortal, render, unmountComponentAtNode } from 'react-dom';
|
|
18
|
+
import { getChildren } from '../../compUtils';
|
|
19
|
+
import Drawer from './Drawer';
|
|
20
|
+
|
|
21
|
+
var DrawerWraper = function DrawerWraper(props) {
|
|
22
|
+
var _props$getContainer = props.getContainer,
|
|
23
|
+
getContainer = _props$getContainer === void 0 ? function () {
|
|
24
|
+
return document.body;
|
|
25
|
+
} : _props$getContainer,
|
|
26
|
+
config = _objectWithoutProperties(props, _excluded);
|
|
27
|
+
|
|
28
|
+
var root = getContainer() || document.body;
|
|
29
|
+
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Drawer, config), root);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var LxMobileDrawerNodes = {};
|
|
33
|
+
var nbr = 0;
|
|
34
|
+
var closeTimer;
|
|
35
|
+
|
|
36
|
+
function open() {
|
|
37
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38
|
+
|
|
39
|
+
var close = props.close,
|
|
40
|
+
_onTabsChange = props.onTabsChange,
|
|
41
|
+
_props$visible = props.visible,
|
|
42
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
43
|
+
_props$getContainer2 = props.getContainer,
|
|
44
|
+
getContainer = _props$getContainer2 === void 0 ? function () {
|
|
45
|
+
return document.body;
|
|
46
|
+
} : _props$getContainer2,
|
|
47
|
+
config = _objectWithoutProperties(props, _excluded2);
|
|
48
|
+
|
|
49
|
+
var createDrawer = function createDrawer() {
|
|
50
|
+
var key = "lxm-drawer-".concat(nbr);
|
|
51
|
+
var root = getContainer() || document.body;
|
|
52
|
+
var rootChild = root ? getChildren(root) : [];
|
|
53
|
+
var div = rootChild.find(function (item) {
|
|
54
|
+
return item.getAttribute('lxm-drawer-key') === key;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (!div) {
|
|
58
|
+
div = document.createElement('div');
|
|
59
|
+
div.setAttribute('lxm-drawer-key', key);
|
|
60
|
+
root.appendChild(div);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var onCloseDrawer = function onCloseDrawer() {
|
|
64
|
+
if (LxMobileDrawerNodes[key]) {
|
|
65
|
+
var _LxMobileDrawerNodes$, _LxMobileDrawerNodes$2;
|
|
66
|
+
|
|
67
|
+
(_LxMobileDrawerNodes$ = LxMobileDrawerNodes[key]) === null || _LxMobileDrawerNodes$ === void 0 ? void 0 : (_LxMobileDrawerNodes$2 = _LxMobileDrawerNodes$.nodeDiv) === null || _LxMobileDrawerNodes$2 === void 0 ? void 0 : _LxMobileDrawerNodes$2.classList.add('lxm-drawer-close-move');
|
|
68
|
+
clearTimeout(closeTimer);
|
|
69
|
+
closeTimer = setTimeout(function () {
|
|
70
|
+
var _LxMobileDrawerNodes$3, _LxMobileDrawerNodes$4, _LxMobileDrawerNodes$5;
|
|
71
|
+
|
|
72
|
+
unmountComponentAtNode((_LxMobileDrawerNodes$3 = LxMobileDrawerNodes[key]) === null || _LxMobileDrawerNodes$3 === void 0 ? void 0 : _LxMobileDrawerNodes$3.nodeDiv);
|
|
73
|
+
(_LxMobileDrawerNodes$4 = LxMobileDrawerNodes[key]) === null || _LxMobileDrawerNodes$4 === void 0 ? void 0 : (_LxMobileDrawerNodes$5 = _LxMobileDrawerNodes$4.nodeDiv) === null || _LxMobileDrawerNodes$5 === void 0 ? void 0 : _LxMobileDrawerNodes$5.remove();
|
|
74
|
+
delete LxMobileDrawerNodes[key];
|
|
75
|
+
clearTimeout(closeTimer);
|
|
76
|
+
}, 300);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var renderNode = function renderNode() {
|
|
81
|
+
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
82
|
+
render( /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
83
|
+
visible: visible,
|
|
84
|
+
onCancel: function onCancel() {
|
|
85
|
+
if ((config === null || config === void 0 ? void 0 : config.onClose) instanceof Function) {
|
|
86
|
+
config === null || config === void 0 ? void 0 : config.onClose();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
onCloseDrawer();
|
|
90
|
+
},
|
|
91
|
+
onOk: function onOk() {
|
|
92
|
+
if ((config === null || config === void 0 ? void 0 : config.onOk) instanceof Function) {
|
|
93
|
+
config === null || config === void 0 ? void 0 : config.onOk();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
onCloseDrawer();
|
|
97
|
+
},
|
|
98
|
+
onTabsChange: function onTabsChange(record) {
|
|
99
|
+
if (_onTabsChange instanceof Function) {
|
|
100
|
+
_onTabsChange(_objectSpread(_objectSpread({}, record), {}, {
|
|
101
|
+
update: function update(prarms) {
|
|
102
|
+
if (LxMobileDrawerNodes[key]) {
|
|
103
|
+
var _LxMobileDrawerNodes$6;
|
|
104
|
+
|
|
105
|
+
(_LxMobileDrawerNodes$6 = LxMobileDrawerNodes[key]) === null || _LxMobileDrawerNodes$6 === void 0 ? void 0 : _LxMobileDrawerNodes$6.renderNode(_objectSpread(_objectSpread({}, config), prarms));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, args)), div);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
renderNode(config);
|
|
115
|
+
LxMobileDrawerNodes[key] = {
|
|
116
|
+
root: root,
|
|
117
|
+
nodeDiv: div,
|
|
118
|
+
renderNode: renderNode
|
|
119
|
+
};
|
|
120
|
+
nbr += 1;
|
|
121
|
+
return key;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var modalKey = createDrawer();
|
|
125
|
+
|
|
126
|
+
var onClose = function onClose() {
|
|
127
|
+
if (LxMobileDrawerNodes[modalKey]) {
|
|
128
|
+
var _LxMobileDrawerNodes$7, _LxMobileDrawerNodes$8;
|
|
129
|
+
|
|
130
|
+
(_LxMobileDrawerNodes$7 = LxMobileDrawerNodes[modalKey]) === null || _LxMobileDrawerNodes$7 === void 0 ? void 0 : (_LxMobileDrawerNodes$8 = _LxMobileDrawerNodes$7.nodeDiv) === null || _LxMobileDrawerNodes$8 === void 0 ? void 0 : _LxMobileDrawerNodes$8.classList.add('lxm-drawer-close-move');
|
|
131
|
+
clearTimeout(closeTimer);
|
|
132
|
+
closeTimer = setTimeout(function () {
|
|
133
|
+
var _LxMobileDrawerNodes$9, _LxMobileDrawerNodes$10, _LxMobileDrawerNodes$11;
|
|
134
|
+
|
|
135
|
+
unmountComponentAtNode((_LxMobileDrawerNodes$9 = LxMobileDrawerNodes[modalKey]) === null || _LxMobileDrawerNodes$9 === void 0 ? void 0 : _LxMobileDrawerNodes$9.nodeDiv);
|
|
136
|
+
(_LxMobileDrawerNodes$10 = LxMobileDrawerNodes[modalKey]) === null || _LxMobileDrawerNodes$10 === void 0 ? void 0 : (_LxMobileDrawerNodes$11 = _LxMobileDrawerNodes$10.nodeDiv) === null || _LxMobileDrawerNodes$11 === void 0 ? void 0 : _LxMobileDrawerNodes$11.remove();
|
|
137
|
+
delete LxMobileDrawerNodes[modalKey];
|
|
138
|
+
clearTimeout(closeTimer);
|
|
139
|
+
}, 300);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var onUpdate = function onUpdate() {
|
|
144
|
+
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
145
|
+
|
|
146
|
+
if (LxMobileDrawerNodes[modalKey]) {
|
|
147
|
+
var _LxMobileDrawerNodes$12;
|
|
148
|
+
|
|
149
|
+
(_LxMobileDrawerNodes$12 = LxMobileDrawerNodes[modalKey]) === null || _LxMobileDrawerNodes$12 === void 0 ? void 0 : _LxMobileDrawerNodes$12.renderNode(_objectSpread(_objectSpread({}, config), args));
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
onClose: onClose,
|
|
155
|
+
onUpdate: onUpdate
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
DrawerWraper.open = open;
|
|
160
|
+
export default DrawerWraper;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2
|
+
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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); }
|
|
14
|
+
|
|
15
|
+
import { isValidElement } from 'react';
|
|
16
|
+
import Modal from '../Modal';
|
|
17
|
+
import Drawer from '../Drawer';
|
|
18
|
+
import http from '../../http';
|
|
19
|
+
import { statusClrMap, errTypeTitMap } from '../../const';
|
|
20
|
+
|
|
21
|
+
var isElm = function isElm(val) {
|
|
22
|
+
return ['number', 'string'].includes(_typeof(val)) || /*#__PURE__*/isValidElement(val);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var renderErrList = function renderErrList(errList) {
|
|
26
|
+
if (Array.isArray(errList) && errList.length > 0) {
|
|
27
|
+
return errList.map(function (item) {
|
|
28
|
+
return {
|
|
29
|
+
key: item === null || item === void 0 ? void 0 : item.errorInfoId,
|
|
30
|
+
title: item === null || item === void 0 ? void 0 : item.errorTypeName,
|
|
31
|
+
extra: item === null || item === void 0 ? void 0 : item.errorCode,
|
|
32
|
+
content: item === null || item === void 0 ? void 0 : item.errorMsg,
|
|
33
|
+
status: statusClrMap[item === null || item === void 0 ? void 0 : item.errorType],
|
|
34
|
+
guidance: item === null || item === void 0 ? void 0 : item.guidance
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return null;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var renderTitle = function renderTitle(msg) {
|
|
43
|
+
if (isElm(msg === null || msg === void 0 ? void 0 : msg.title)) {
|
|
44
|
+
return msg.title;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (typeof (msg === null || msg === void 0 ? void 0 : msg.code) === 'string') {
|
|
48
|
+
var _msg$code;
|
|
49
|
+
|
|
50
|
+
var nbr = msg === null || msg === void 0 ? void 0 : (_msg$code = msg.code) === null || _msg$code === void 0 ? void 0 : _msg$code.split('-')[0];
|
|
51
|
+
return nbr && errTypeTitMap[nbr] ? errTypeTitMap[nbr] : '';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return '';
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var ErrorMsg = {
|
|
58
|
+
open: function open(msg) {
|
|
59
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
60
|
+
|
|
61
|
+
if (msg) {
|
|
62
|
+
var title = renderTitle(msg);
|
|
63
|
+
Modal.open(_objectSpread({
|
|
64
|
+
title: title,
|
|
65
|
+
subtitle: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
66
|
+
content: msg === null || msg === void 0 ? void 0 : msg.msg,
|
|
67
|
+
onOk: function () {
|
|
68
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
69
|
+
var _msg$resolve, _msg$resolve2, _detRes, detRes, _msg$resolve3, _msg$resolve4, url, errMsg;
|
|
70
|
+
|
|
71
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
72
|
+
while (1) {
|
|
73
|
+
switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
if (!(msg === null || msg === void 0 ? void 0 : msg.resolve)) {
|
|
76
|
+
_context.next = 12;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
detRes = {};
|
|
81
|
+
|
|
82
|
+
if (!((msg === null || msg === void 0 ? void 0 : (_msg$resolve = msg.resolve) === null || _msg$resolve === void 0 ? void 0 : _msg$resolve.article) || (msg === null || msg === void 0 ? void 0 : (_msg$resolve2 = msg.resolve) === null || _msg$resolve2 === void 0 ? void 0 : _msg$resolve2.extend))) {
|
|
83
|
+
_context.next = 6;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
detRes = {
|
|
88
|
+
article: msg === null || msg === void 0 ? void 0 : (_msg$resolve3 = msg.resolve) === null || _msg$resolve3 === void 0 ? void 0 : _msg$resolve3.article,
|
|
89
|
+
extend: msg === null || msg === void 0 ? void 0 : (_msg$resolve4 = msg.resolve) === null || _msg$resolve4 === void 0 ? void 0 : _msg$resolve4.extend
|
|
90
|
+
};
|
|
91
|
+
_context.next = 11;
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
case 6:
|
|
95
|
+
url = typeof (msg === null || msg === void 0 ? void 0 : msg.resolve) === 'string' && (msg === null || msg === void 0 ? void 0 : msg.resolve) ? msg === null || msg === void 0 ? void 0 : msg.resolve : '/api/lcdp/error/queryErrorInfoByCodeOrMsg';
|
|
96
|
+
_context.next = 9;
|
|
97
|
+
return http.get(url, {
|
|
98
|
+
params: {
|
|
99
|
+
errorCode: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
100
|
+
errorMsg: msg === null || msg === void 0 ? void 0 : msg.msg
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
case 9:
|
|
105
|
+
errMsg = _context.sent;
|
|
106
|
+
detRes = {
|
|
107
|
+
article: errMsg === null || errMsg === void 0 ? void 0 : errMsg.guidance,
|
|
108
|
+
extend: errMsg === null || errMsg === void 0 ? void 0 : errMsg.errorInfos
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
case 11:
|
|
112
|
+
Drawer.open({
|
|
113
|
+
title: title,
|
|
114
|
+
tabs: [{
|
|
115
|
+
key: 'article',
|
|
116
|
+
tab: '解决方案'
|
|
117
|
+
}, {
|
|
118
|
+
key: 'extend',
|
|
119
|
+
tab: '错误信息匹配'
|
|
120
|
+
}],
|
|
121
|
+
activeTabsKey: 'article',
|
|
122
|
+
mode: 'content',
|
|
123
|
+
dataSource: (_detRes = detRes) === null || _detRes === void 0 ? void 0 : _detRes.article,
|
|
124
|
+
onTabsChange: function onTabsChange(record) {
|
|
125
|
+
if ((record === null || record === void 0 ? void 0 : record.update) instanceof Function) {
|
|
126
|
+
if ((record === null || record === void 0 ? void 0 : record.key) === 'article') {
|
|
127
|
+
var _detRes2, _detRes2$article, _detRes3, _detRes3$article;
|
|
128
|
+
|
|
129
|
+
record === null || record === void 0 ? void 0 : record.update({
|
|
130
|
+
activeTabsKey: 'article',
|
|
131
|
+
mode: 'content',
|
|
132
|
+
dataSource: {
|
|
133
|
+
title: (_detRes2 = detRes) === null || _detRes2 === void 0 ? void 0 : (_detRes2$article = _detRes2.article) === null || _detRes2$article === void 0 ? void 0 : _detRes2$article.title,
|
|
134
|
+
content: (_detRes3 = detRes) === null || _detRes3 === void 0 ? void 0 : (_detRes3$article = _detRes3.article) === null || _detRes3$article === void 0 ? void 0 : _detRes3$article.content
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if ((record === null || record === void 0 ? void 0 : record.key) === 'extend') {
|
|
140
|
+
var _detRes4;
|
|
141
|
+
|
|
142
|
+
record === null || record === void 0 ? void 0 : record.update({
|
|
143
|
+
activeTabsKey: 'extend',
|
|
144
|
+
mode: 'list',
|
|
145
|
+
dataSource: renderErrList((_detRes4 = detRes) === null || _detRes4 === void 0 ? void 0 : _detRes4.extend),
|
|
146
|
+
onClickRecord: function onClickRecord(item) {
|
|
147
|
+
if (item === null || item === void 0 ? void 0 : item.guidance) {
|
|
148
|
+
var _item$guidance, _item$guidance2, _item$guidance3;
|
|
149
|
+
|
|
150
|
+
Drawer.open({
|
|
151
|
+
title: item === null || item === void 0 ? void 0 : (_item$guidance = item.guidance) === null || _item$guidance === void 0 ? void 0 : _item$guidance.title,
|
|
152
|
+
dataSource: {
|
|
153
|
+
title: item === null || item === void 0 ? void 0 : (_item$guidance2 = item.guidance) === null || _item$guidance2 === void 0 ? void 0 : _item$guidance2.title,
|
|
154
|
+
content: item === null || item === void 0 ? void 0 : (_item$guidance3 = item.guidance) === null || _item$guidance3 === void 0 ? void 0 : _item$guidance3.content
|
|
155
|
+
},
|
|
156
|
+
mode: 'content'
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
case 12:
|
|
167
|
+
case "end":
|
|
168
|
+
return _context.stop();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}, _callee);
|
|
172
|
+
}));
|
|
173
|
+
|
|
174
|
+
function onOk() {
|
|
175
|
+
return _onOk.apply(this, arguments);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return onOk;
|
|
179
|
+
}()
|
|
180
|
+
}, options));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
export default ErrorMsg;
|