@zgfe/business-lib 1.0.12 → 1.0.13-alpha.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 +26 -3
- package/es/assets/iconfont/iconfont.css +7 -3
- package/es/assets/iconfont/iconfont.js +1 -1
- package/es/assets/iconfont/iconfont.json +7 -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 +2 -2
- package/es/assets/styles/resetAntd.less +137 -133
- package/es/assets/styles/variable.less +1 -16
- package/es/assets/theme.d.ts +8 -1
- package/es/assets/theme.js +9 -2
- package/es/attrConditions/components/operateList.js +7 -2
- package/es/attrConditions/components/stringList.js +2 -3
- package/es/attrConditions/demo/group.js +1 -0
- package/es/attrConditions/demo/index.js +1 -0
- package/es/attrConditions/index.js +11 -5
- package/es/attrConditions/styles/index.less +2 -2
- package/es/attrConditions/types.d.ts +1 -0
- package/es/attributeSelector/index.js +3 -1
- package/es/attributeSelector/listPanel.js +2 -2
- package/es/attributeSelector/option.d.ts +2 -1
- package/es/attributeSelector/styles/index.less +1 -1
- package/es/attributeSelector/types.d.ts +5 -1
- package/es/attributeSelector/util.js +11 -6
- package/es/chart/util/chartOptionConfig.d.ts +1 -1
- package/es/chart/util/chartOptionConfig.js +3 -3
- package/es/config.d.ts +1 -1
- package/es/datePicker/styles/index.less +1 -1
- package/es/eventSelector/listPanel.js +1 -1
- package/es/mock/user.js +2 -2
- package/es/select/styles/index.less +1 -1
- package/es/targetConditionGroup/data/operates.js +0 -3
- package/es/targetSelector/editBox.js +2 -1
- package/es/targetSelector/styles/index.less +4 -0
- package/es/utils/ajax.d.ts +2 -32
- package/es/utils/ajax.js +8 -82
- package/es/utils/type.d.ts +33 -0
- package/es/utils/type.js +31 -1
- package/package.json +2 -2
|
@@ -62,18 +62,22 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
62
62
|
id: data.attrId,
|
|
63
63
|
propCategory: data.propCategory,
|
|
64
64
|
type: data.type,
|
|
65
|
-
key: data.attrId
|
|
65
|
+
key: data.attrId,
|
|
66
|
+
dimensionSub: data.dimensionSub || 'event_attr'
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
} else if (data.propCategory === PropCategory.UserProp || data.propCategory === PropCategory.EnvProp) {
|
|
69
70
|
if (data.attrName) {
|
|
71
|
+
var aId = data.attrId || 0;
|
|
70
72
|
attrData = {
|
|
73
|
+
id: aId,
|
|
71
74
|
name: data.attrName,
|
|
72
75
|
propCategory: data.propCategory,
|
|
73
76
|
type: data.type,
|
|
74
77
|
category: data.category,
|
|
75
|
-
key: "".concat(data.propCategory, "-").concat(data.attrName),
|
|
76
|
-
subtype: data.subtype
|
|
78
|
+
key: "".concat(data.propCategory, "-").concat(data.dimensionSub || data.attrName, "-").concat(aId),
|
|
79
|
+
subtype: data.subtype,
|
|
80
|
+
dimensionSub: data.dimensionSub || data.attrName
|
|
77
81
|
};
|
|
78
82
|
}
|
|
79
83
|
}
|
|
@@ -92,14 +96,16 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
92
96
|
if (props.onChange) {
|
|
93
97
|
if (!attr) return;
|
|
94
98
|
var responseData = {
|
|
99
|
+
attrId: attr.id,
|
|
95
100
|
propCategory: attr.propCategory,
|
|
96
101
|
type: attr.type,
|
|
97
102
|
operator: operate,
|
|
98
|
-
values: values || []
|
|
103
|
+
values: values || [],
|
|
104
|
+
dimensionSub: attr.dimensionSub
|
|
99
105
|
};
|
|
100
106
|
|
|
101
107
|
if (attr.propCategory === PropCategory.EventProp) {
|
|
102
|
-
responseData.
|
|
108
|
+
responseData.attrName = attr.label;
|
|
103
109
|
} else {
|
|
104
110
|
responseData.attrName = attr.name;
|
|
105
111
|
responseData.category = attr.category;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.ant-input {
|
|
26
|
-
background-color: @background-color-gray;
|
|
26
|
+
background-color: @background-color-gray !important;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.biz-attr-select-del-icon {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
&-input {
|
|
63
63
|
.ant-input-group-addon {
|
|
64
|
-
background-color: @background-color-gray;
|
|
64
|
+
background-color: @background-color-gray !important;
|
|
65
65
|
border: none;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -144,6 +144,8 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
144
144
|
|
|
145
145
|
BizAttributeSelector.defaultProps = {
|
|
146
146
|
enableDelete: false,
|
|
147
|
-
placeholder: '请选择'
|
|
147
|
+
placeholder: '请选择',
|
|
148
|
+
propSymbol: '*',
|
|
149
|
+
optionsHeaderTip: '带*的属性每日凌晨更新'
|
|
148
150
|
};
|
|
149
151
|
export default BizAttributeSelector;
|
|
@@ -166,7 +166,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
166
166
|
return setSearchValue(val);
|
|
167
167
|
},
|
|
168
168
|
placeholder: "\u641C\u7D22\u5C5E\u6027"
|
|
169
|
-
}), showList.length ? /*#__PURE__*/React.createElement(Anchor, {
|
|
169
|
+
}), showList.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
|
|
170
170
|
className: "".concat(classPrefix, "-anchor-panel"),
|
|
171
171
|
affix: false,
|
|
172
172
|
onClick: function onClick(e) {
|
|
@@ -191,7 +191,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
191
191
|
title: /*#__PURE__*/React.createElement(Button, {
|
|
192
192
|
size: "small"
|
|
193
193
|
}, "\u89E6\u53D1\u73AF\u5883")
|
|
194
|
-
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
195
195
|
id: anchor.container,
|
|
196
196
|
className: "".concat(classPrefix, "-container")
|
|
197
197
|
}, showList.length ? showList : /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { AttributeSelect } from './types';
|
|
3
3
|
declare const Option: React.FC<{
|
|
4
4
|
option?: AttributeSelect.Value;
|
|
@@ -9,6 +9,7 @@ declare const Option: React.FC<{
|
|
|
9
9
|
text: string;
|
|
10
10
|
color?: string;
|
|
11
11
|
};
|
|
12
|
+
propSymbol?: ReactNode;
|
|
12
13
|
checked?: boolean;
|
|
13
14
|
onClick?: (option: AttributeSelect.Value) => void;
|
|
14
15
|
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export declare enum PropType {
|
|
2
3
|
STRING = 1,
|
|
3
4
|
NUMBER = 2,
|
|
@@ -23,10 +24,12 @@ export interface EventGroup {
|
|
|
23
24
|
eventList: AnalysisEvent[];
|
|
24
25
|
}
|
|
25
26
|
export interface BasicProp {
|
|
27
|
+
id: number;
|
|
26
28
|
label?: string;
|
|
27
29
|
alias?: string;
|
|
28
30
|
type?: PropType;
|
|
29
31
|
realTime?: boolean;
|
|
32
|
+
dimensionSub?: string;
|
|
30
33
|
}
|
|
31
34
|
export interface UserProp extends BasicProp {
|
|
32
35
|
name: string;
|
|
@@ -43,7 +46,6 @@ export interface EnvProp extends BasicProp {
|
|
|
43
46
|
}
|
|
44
47
|
export interface EventProp extends BasicProp {
|
|
45
48
|
eventId?: number;
|
|
46
|
-
id: number;
|
|
47
49
|
propCategory: 'eventProp';
|
|
48
50
|
key?: number;
|
|
49
51
|
isHidden?: boolean;
|
|
@@ -66,6 +68,8 @@ export declare namespace AttributeSelect {
|
|
|
66
68
|
enableUserProp?: boolean;
|
|
67
69
|
enableEnvProp?: boolean;
|
|
68
70
|
eventIdList?: number[];
|
|
71
|
+
propSymbol?: ReactNode;
|
|
72
|
+
optionsHeaderTip?: string;
|
|
69
73
|
onChange?: (value: Value) => void;
|
|
70
74
|
onDelete?: (value?: Value) => void;
|
|
71
75
|
}
|
|
@@ -28,7 +28,8 @@ export default function convertAttributeData(store) {
|
|
|
28
28
|
label: item.attr_name,
|
|
29
29
|
propCategory: 'eventProp',
|
|
30
30
|
type: item.prop_type,
|
|
31
|
-
realTime: true
|
|
31
|
+
realTime: true,
|
|
32
|
+
dimensionSub: item.dimension_sub || 'event_attr'
|
|
32
33
|
};
|
|
33
34
|
}),
|
|
34
35
|
id: e.event_id,
|
|
@@ -42,27 +43,31 @@ export default function convertAttributeData(store) {
|
|
|
42
43
|
});
|
|
43
44
|
res.envPropList = (_store$envPropList = store.envPropList) === null || _store$envPropList === void 0 ? void 0 : _store$envPropList.map(function (prop) {
|
|
44
45
|
return {
|
|
46
|
+
id: prop.id || 0,
|
|
45
47
|
alias: prop.alias_name,
|
|
46
48
|
category: prop.category,
|
|
47
|
-
key: "envProp-".concat(prop.
|
|
49
|
+
key: "envProp-".concat(prop.dimension_sub, "-").concat(prop.id || 0),
|
|
48
50
|
label: prop.text,
|
|
49
51
|
name: prop.name,
|
|
50
52
|
propCategory: 'envProp',
|
|
51
53
|
type: prop.type,
|
|
52
|
-
realTime: true
|
|
54
|
+
realTime: true,
|
|
55
|
+
dimensionSub: prop.dimension_sub || prop.name
|
|
53
56
|
};
|
|
54
57
|
});
|
|
55
58
|
res.userPropList = (_store$userPropList = store.userPropList) === null || _store$userPropList === void 0 ? void 0 : _store$userPropList.map(function (prop) {
|
|
56
59
|
return {
|
|
60
|
+
id: prop.id || 0,
|
|
57
61
|
alias: prop.alias_name,
|
|
58
62
|
category: prop.category,
|
|
59
|
-
key: "userProp-".concat(prop.
|
|
60
|
-
label: prop.text,
|
|
63
|
+
key: "userProp-".concat(prop.dimension_sub, "-").concat(prop.id || 0),
|
|
64
|
+
label: prop.text || prop.name,
|
|
61
65
|
name: prop.name,
|
|
62
66
|
propCategory: 'userProp',
|
|
63
67
|
type: prop.type,
|
|
64
68
|
subtype: prop.subtype,
|
|
65
|
-
realTime: prop.category === 'custom'
|
|
69
|
+
realTime: prop.category === 'custom',
|
|
70
|
+
dimensionSub: prop.dimension_sub || prop.name
|
|
66
71
|
};
|
|
67
72
|
});
|
|
68
73
|
return res;
|
|
@@ -7,7 +7,7 @@ export declare const baseConfig: EChartsOption;
|
|
|
7
7
|
export declare const seriesConfig: any;
|
|
8
8
|
export declare const legendConfig: LegendComponentOption;
|
|
9
9
|
export declare const gridConfig: {
|
|
10
|
-
left:
|
|
10
|
+
left: string;
|
|
11
11
|
right: string;
|
|
12
12
|
bottom: number;
|
|
13
13
|
top: number;
|
|
@@ -44,7 +44,7 @@ export var legendConfig = {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
export var gridConfig = {
|
|
47
|
-
left:
|
|
47
|
+
left: '2%',
|
|
48
48
|
right: '3%',
|
|
49
49
|
bottom: 0,
|
|
50
50
|
top: 24,
|
|
@@ -188,7 +188,7 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
188
188
|
legend.left = 'left';
|
|
189
189
|
legend.height = 'auto';
|
|
190
190
|
legend.width = 50;
|
|
191
|
-
grid.left =
|
|
191
|
+
grid.left = '10%';
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
if (chartType === 'line') {
|
|
@@ -230,7 +230,7 @@ export var getPieOption = function getPieOption() {
|
|
|
230
230
|
legend.left = 'left';
|
|
231
231
|
legend.height = 'auto';
|
|
232
232
|
legend.width = 50;
|
|
233
|
-
grid.left =
|
|
233
|
+
grid.left = '10%';
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
tooltip.trigger = 'item';
|
package/es/config.d.ts
CHANGED
|
@@ -168,7 +168,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
168
168
|
onChange: function onChange(val) {
|
|
169
169
|
return setSearchValue(val);
|
|
170
170
|
},
|
|
171
|
-
placeholder: "\u641C\u7D22\u4E8B\u4EF6"
|
|
171
|
+
placeholder: "\u641C\u7D22\u57CB\u70B9\u4E8B\u4EF6"
|
|
172
172
|
}), /*#__PURE__*/React.createElement("div", {
|
|
173
173
|
className: "".concat(classPrefix, "-list")
|
|
174
174
|
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
package/es/mock/user.js
CHANGED
|
@@ -72,7 +72,8 @@ var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
|
72
72
|
className: "".concat(classPrefix, "-footer")
|
|
73
73
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
74
74
|
onClick: onCancel,
|
|
75
|
-
type: "text"
|
|
75
|
+
type: "text",
|
|
76
|
+
className: "".concat(classPrefix, "-mr8")
|
|
76
77
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
77
78
|
onClick: onClick,
|
|
78
79
|
type: "primary"
|
package/es/utils/ajax.d.ts
CHANGED
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare
|
|
3
|
-
success = 200,
|
|
4
|
-
exists = 201,
|
|
5
|
-
fail = 500,
|
|
6
|
-
sysNotInit = 501,
|
|
7
|
-
sysInited = 502,
|
|
8
|
-
notLoggin = 503,
|
|
9
|
-
paramError = 504,
|
|
10
|
-
success2 = "106000",
|
|
11
|
-
fail2 = "106001",
|
|
12
|
-
paramError2 = "106002",
|
|
13
|
-
paramError3 = "106003"
|
|
14
|
-
}
|
|
15
|
-
export interface InterfaceApiResult<T> {
|
|
16
|
-
code: ResponseStatus;
|
|
17
|
-
data?: T;
|
|
18
|
-
msg?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare class ApiResult<T> implements InterfaceApiResult<T> {
|
|
21
|
-
code: ResponseStatus;
|
|
22
|
-
data?: T;
|
|
23
|
-
msg?: string;
|
|
24
|
-
constructor(code: ResponseStatus, data: any, message?: string);
|
|
25
|
-
}
|
|
26
|
-
declare function request<T>(url: string, options?: RequestOptionsInit & {
|
|
27
|
-
optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
|
|
28
|
-
url: string;
|
|
29
|
-
options?: RequestOptionsInit;
|
|
30
|
-
};
|
|
31
|
-
responseWrapper?: (url: string, apiResult: ApiResult<T>) => ApiResult<T>;
|
|
32
|
-
}): Promise<InterfaceApiResult<T> | null>;
|
|
1
|
+
import { ajaxConfig, InterfaceApiResult } from './type';
|
|
2
|
+
declare function request<T>(url: string, options?: ajaxConfig<T>): Promise<InterfaceApiResult<T> | null>;
|
|
33
3
|
export default request;
|
package/es/utils/ajax.js
CHANGED
|
@@ -2,41 +2,10 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
2
2
|
|
|
3
3
|
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); }); }; }
|
|
4
4
|
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
-
|
|
9
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
-
|
|
11
5
|
import { extend } from 'umi-request';
|
|
12
6
|
import { notification } from 'antd';
|
|
13
7
|
import { globalConfig } from '../config';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(function (ResponseStatus) {
|
|
17
|
-
ResponseStatus[ResponseStatus["success"] = 200] = "success";
|
|
18
|
-
ResponseStatus[ResponseStatus["exists"] = 201] = "exists";
|
|
19
|
-
ResponseStatus[ResponseStatus["fail"] = 500] = "fail";
|
|
20
|
-
ResponseStatus[ResponseStatus["sysNotInit"] = 501] = "sysNotInit";
|
|
21
|
-
ResponseStatus[ResponseStatus["sysInited"] = 502] = "sysInited";
|
|
22
|
-
ResponseStatus[ResponseStatus["notLoggin"] = 503] = "notLoggin";
|
|
23
|
-
ResponseStatus[ResponseStatus["paramError"] = 504] = "paramError";
|
|
24
|
-
ResponseStatus["success2"] = "106000";
|
|
25
|
-
ResponseStatus["fail2"] = "106001";
|
|
26
|
-
ResponseStatus["paramError2"] = "106002";
|
|
27
|
-
ResponseStatus["paramError3"] = "106003";
|
|
28
|
-
})(ResponseStatus || (ResponseStatus = {}));
|
|
29
|
-
|
|
30
|
-
export var ApiResult = /*#__PURE__*/_createClass(function ApiResult(code, data, message) {
|
|
31
|
-
_classCallCheck(this, ApiResult);
|
|
32
|
-
|
|
33
|
-
this.code = void 0;
|
|
34
|
-
this.data = void 0;
|
|
35
|
-
this.msg = void 0;
|
|
36
|
-
this.code = code;
|
|
37
|
-
this.data = data;
|
|
38
|
-
this.msg = message;
|
|
39
|
-
});
|
|
8
|
+
import { ResponseStatus } from './type';
|
|
40
9
|
var codeMessage = {
|
|
41
10
|
200: '服务器成功返回请求的数据。',
|
|
42
11
|
201: '新建或修改数据成功。',
|
|
@@ -76,7 +45,7 @@ var errorHandler = function errorHandler(error) {
|
|
|
76
45
|
return response;
|
|
77
46
|
};
|
|
78
47
|
|
|
79
|
-
function responseErrorHandler(url, apiResult) {
|
|
48
|
+
function responseErrorHandler(url, apiResult, errorTitle) {
|
|
80
49
|
if (/\.jsp/.test(url)) {
|
|
81
50
|
return apiResult;
|
|
82
51
|
}
|
|
@@ -91,59 +60,16 @@ function responseErrorHandler(url, apiResult) {
|
|
|
91
60
|
var flag = false;
|
|
92
61
|
var message = '接口请求失败';
|
|
93
62
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
case ResponseStatus.sysInited:
|
|
100
|
-
message = '系统已初始化';
|
|
101
|
-
break;
|
|
102
|
-
|
|
103
|
-
case ResponseStatus.notLoggin:
|
|
104
|
-
message = '账户未登录或登录已失效';
|
|
105
|
-
break;
|
|
106
|
-
|
|
107
|
-
case ResponseStatus.paramError:
|
|
108
|
-
message = '请求参数错误';
|
|
109
|
-
break;
|
|
110
|
-
|
|
111
|
-
case ResponseStatus.paramError2:
|
|
112
|
-
message = '请求参数缺失';
|
|
113
|
-
break;
|
|
114
|
-
|
|
115
|
-
case ResponseStatus.paramError3:
|
|
116
|
-
message = '请求参数校验异常';
|
|
117
|
-
break;
|
|
118
|
-
|
|
119
|
-
case ResponseStatus.exists:
|
|
120
|
-
message = '数据已存在';
|
|
121
|
-
break;
|
|
122
|
-
|
|
123
|
-
case ResponseStatus.success:
|
|
124
|
-
flag = true;
|
|
125
|
-
break;
|
|
126
|
-
|
|
127
|
-
case ResponseStatus.success2:
|
|
128
|
-
flag = true;
|
|
129
|
-
break;
|
|
130
|
-
|
|
131
|
-
case ResponseStatus.fail:
|
|
132
|
-
message = apiResult.msg || '接口发生未知错误';
|
|
133
|
-
break;
|
|
134
|
-
|
|
135
|
-
case ResponseStatus.fail2:
|
|
136
|
-
message = apiResult.msg || '接口发生未知错误';
|
|
137
|
-
break;
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
throw new Error("\u65E0\u6CD5\u8BC6\u522B\u7684\u8BF7\u6C42\u54CD\u5E94\u7801: ".concat(apiResult.code));
|
|
63
|
+
if (new RegExp("".concat(ResponseStatus.success, "$")).test(apiResult.code)) {
|
|
64
|
+
flag = true;
|
|
65
|
+
} else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
|
|
66
|
+
message = '账户未登录或登录已失效';
|
|
141
67
|
}
|
|
142
68
|
|
|
143
69
|
if (!flag) {
|
|
144
70
|
message = apiResult.msg || message;
|
|
145
71
|
notification.error({
|
|
146
|
-
message: "\u8BF7\u6C42\u9519\u8BEF",
|
|
72
|
+
message: errorTitle || "\u8BF7\u6C42\u9519\u8BEF",
|
|
147
73
|
description: message
|
|
148
74
|
});
|
|
149
75
|
throw new Error(message);
|
|
@@ -205,7 +131,7 @@ function _request() {
|
|
|
205
131
|
|
|
206
132
|
case 13:
|
|
207
133
|
res = _context.sent;
|
|
208
|
-
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res)) : responseErrorHandler(url, res));
|
|
134
|
+
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle));
|
|
209
135
|
|
|
210
136
|
case 17:
|
|
211
137
|
_context.prev = 17;
|
package/es/utils/type.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RequestOptionsInit } from 'umi-request';
|
|
1
2
|
import { PropType } from '../attributeSelector/types';
|
|
2
3
|
export interface Event {
|
|
3
4
|
value?: string | number;
|
|
@@ -39,6 +40,7 @@ export declare namespace OldSystem {
|
|
|
39
40
|
prop_type: PropType;
|
|
40
41
|
}
|
|
41
42
|
interface UserProp {
|
|
43
|
+
id: number;
|
|
42
44
|
alias_name?: string;
|
|
43
45
|
category: 'fixed' | 'custom';
|
|
44
46
|
dimension_sub: string;
|
|
@@ -50,3 +52,34 @@ export declare namespace OldSystem {
|
|
|
50
52
|
interface EnvProp extends UserProp {
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
export declare enum ResponseStatus {
|
|
56
|
+
success = "00",
|
|
57
|
+
fail = "01",
|
|
58
|
+
paramNotFound = "02",
|
|
59
|
+
paramError = "03",
|
|
60
|
+
saveFileFail = "04",
|
|
61
|
+
readFileFail = "05",
|
|
62
|
+
notValid = "06",
|
|
63
|
+
notLogin = "07",
|
|
64
|
+
delFileFail = "08",
|
|
65
|
+
systemError = "09"
|
|
66
|
+
}
|
|
67
|
+
export interface InterfaceApiResult<T> {
|
|
68
|
+
code: string;
|
|
69
|
+
data?: T;
|
|
70
|
+
msg?: string;
|
|
71
|
+
}
|
|
72
|
+
export declare class ApiResult<T> implements InterfaceApiResult<T> {
|
|
73
|
+
code: string;
|
|
74
|
+
data?: T;
|
|
75
|
+
msg?: string;
|
|
76
|
+
constructor(code: ResponseStatus, data: any, message?: string);
|
|
77
|
+
}
|
|
78
|
+
export declare type ajaxConfig<T> = RequestOptionsInit & {
|
|
79
|
+
errorTitle?: string;
|
|
80
|
+
optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
|
|
81
|
+
url: string;
|
|
82
|
+
options?: RequestOptionsInit;
|
|
83
|
+
};
|
|
84
|
+
responseWrapper?: (url: string, apiResult: ApiResult<T>) => ApiResult<T>;
|
|
85
|
+
};
|
package/es/utils/type.js
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
2
|
+
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
|
|
7
|
+
export var ResponseStatus;
|
|
8
|
+
|
|
9
|
+
(function (ResponseStatus) {
|
|
10
|
+
ResponseStatus["success"] = "00";
|
|
11
|
+
ResponseStatus["fail"] = "01";
|
|
12
|
+
ResponseStatus["paramNotFound"] = "02";
|
|
13
|
+
ResponseStatus["paramError"] = "03";
|
|
14
|
+
ResponseStatus["saveFileFail"] = "04";
|
|
15
|
+
ResponseStatus["readFileFail"] = "05";
|
|
16
|
+
ResponseStatus["notValid"] = "06";
|
|
17
|
+
ResponseStatus["notLogin"] = "07";
|
|
18
|
+
ResponseStatus["delFileFail"] = "08";
|
|
19
|
+
ResponseStatus["systemError"] = "09";
|
|
20
|
+
})(ResponseStatus || (ResponseStatus = {}));
|
|
21
|
+
|
|
22
|
+
export var ApiResult = /*#__PURE__*/_createClass(function ApiResult(code, data, message) {
|
|
23
|
+
_classCallCheck(this, ApiResult);
|
|
24
|
+
|
|
25
|
+
this.code = void 0;
|
|
26
|
+
this.data = void 0;
|
|
27
|
+
this.msg = void 0;
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.data = data;
|
|
30
|
+
this.msg = message;
|
|
31
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13-alpha.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"prettier": "^2.2.1",
|
|
60
60
|
"yorkie": "^2.0.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "5bb31a0840b92867d28324abf58b5c006f9932e7"
|
|
63
63
|
}
|