@zgfe/business-lib 1.0.9 → 1.0.12
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/addToPanel/components/addPanel.d.ts +7 -0
- package/es/addToPanel/components/addPanel.js +101 -0
- package/es/addToPanel/components/radioGroup.d.ts +7 -0
- package/es/addToPanel/components/radioGroup.js +29 -0
- package/es/addToPanel/components/styleList.d.ts +5 -0
- package/es/{dialog/components/tab.js → addToPanel/components/styleList.js} +12 -7
- package/es/{dialog/demo/index2.d.ts → addToPanel/demo/edit.d.ts} +0 -0
- package/es/{dialog/components/list.js → addToPanel/demo/edit.js} +64 -44
- package/es/{dialog/demo/index3.d.ts → addToPanel/demo/index.d.ts} +0 -0
- package/es/addToPanel/demo/index.js +78 -0
- package/es/addToPanel/index.d.ts +6 -0
- package/es/addToPanel/index.js +268 -0
- package/es/addToPanel/styles/addPanel.less +25 -0
- package/es/addToPanel/styles/index.less +6 -0
- package/es/{dialog/components/styles/tab.less → addToPanel/styles/style.less} +7 -2
- package/es/addToPanel/types.d.ts +57 -0
- package/es/addToPanel/types.js +1 -0
- package/es/addToScene/addGroup.d.ts +11 -0
- package/es/addToScene/addGroup.js +34 -0
- package/es/addToScene/demo/index.d.ts +2 -0
- package/es/addToScene/demo/index.js +34 -0
- package/es/addToScene/index.d.ts +6 -0
- package/es/addToScene/index.js +195 -0
- package/es/addToScene/styles/index.less +23 -0
- package/es/addToScene/types.d.ts +29 -0
- package/es/addToScene/types.js +1 -0
- package/es/analysisLayout/demo/index.d.ts +1 -0
- package/es/analysisLayout/demo/index.js +1 -0
- package/es/analysisLayout/index.js +1 -1
- package/es/analysisLayout/index.less +3 -2
- package/es/assets/iconfont/demo_index.html +49 -3
- package/es/assets/iconfont/iconfont.css +11 -3
- package/es/assets/iconfont/iconfont.js +1 -1
- package/es/assets/iconfont/iconfont.json +14 -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 +17 -1
- package/es/assets/styles/resetAntd.less +61 -20
- package/es/assets/styles/variable.less +8 -1
- package/es/assets/theme.d.ts +3 -0
- package/es/assets/theme.js +4 -1
- package/es/attrConditions/components/stringList.js +4 -3
- package/es/attributeSelector/styles/index.less +2 -0
- package/es/config.d.ts +15 -0
- package/es/config.js +8 -0
- package/es/constants/apis.d.ts +9 -0
- package/es/constants/apis.js +9 -0
- package/es/datePicker/styles/index.less +4 -0
- package/es/dialog/demo/index.d.ts +0 -29
- package/es/dialog/demo/index.js +6 -130
- package/es/dialog/index.d.ts +1 -2
- package/es/dialog/index.js +15 -183
- package/es/dialog/types.d.ts +2 -74
- package/es/eventSelector/listPanel.js +8 -0
- package/es/eventSelector/styles/index.less +11 -5
- package/es/index.d.ts +4 -1
- package/es/index.js +4 -1
- package/es/select/index.js +1 -0
- package/es/select/overlay.js +3 -1
- package/es/select/styles/handle.less +2 -0
- package/es/select/styles/index.less +0 -3
- package/es/select/types.d.ts +1 -0
- package/es/targetSelector/styles/index.less +3 -1
- package/es/utils/ajax.d.ts +33 -7
- package/es/utils/ajax.js +212 -111
- package/package.json +4 -3
- package/es/dialog/components/itemNode.d.ts +0 -10
- package/es/dialog/components/itemNode.js +0 -109
- package/es/dialog/components/list.d.ts +0 -5
- package/es/dialog/components/selectToInput.d.ts +0 -6
- package/es/dialog/components/selectToInput.js +0 -175
- package/es/dialog/components/styles/handle.less +0 -39
- package/es/dialog/components/styles/list.less +0 -60
- package/es/dialog/components/tab.d.ts +0 -5
- package/es/dialog/data/data.d.ts +0 -20
- package/es/dialog/data/data.js +0 -73
- package/es/dialog/demo/index2.js +0 -109
- package/es/dialog/demo/index3.js +0 -61
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
display: none;
|
|
30
30
|
flex: none;
|
|
31
31
|
width: @icon-width;
|
|
32
|
+
color: @text-color-secondary;
|
|
32
33
|
line-height: 2em;
|
|
33
34
|
text-align: center;
|
|
34
35
|
border-radius: @border-radius-small;
|
|
@@ -67,7 +68,8 @@
|
|
|
67
68
|
top: 45px;
|
|
68
69
|
left: 0;
|
|
69
70
|
z-index: 1000;
|
|
70
|
-
width:
|
|
71
|
+
width: 100%;
|
|
72
|
+
min-width: 280px;
|
|
71
73
|
.__select-panel();
|
|
72
74
|
}
|
|
73
75
|
|
package/es/utils/ajax.d.ts
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { RequestOptionsInit } from 'umi-request';
|
|
2
|
+
declare enum ResponseStatus {
|
|
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>;
|
|
33
|
+
export default request;
|
package/es/utils/ajax.js
CHANGED
|
@@ -1,124 +1,225 @@
|
|
|
1
|
-
function
|
|
1
|
+
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); } }
|
|
2
2
|
|
|
3
|
-
function
|
|
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
|
|
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
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
import { extend } from 'umi-request';
|
|
12
|
+
import { notification } from 'antd';
|
|
13
|
+
import { globalConfig } from '../config';
|
|
14
|
+
var ResponseStatus;
|
|
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
|
+
});
|
|
40
|
+
var codeMessage = {
|
|
41
|
+
200: '服务器成功返回请求的数据。',
|
|
42
|
+
201: '新建或修改数据成功。',
|
|
43
|
+
202: '一个请求已经进入后台排队(异步任务)。',
|
|
44
|
+
204: '删除数据成功。',
|
|
45
|
+
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
|
46
|
+
401: '用户没有权限(令牌、用户名、密码错误)。',
|
|
47
|
+
403: '用户得到授权,但是访问是被禁止的。',
|
|
48
|
+
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
|
49
|
+
406: '请求的格式不可得。',
|
|
50
|
+
410: '请求的资源被永久删除,且不会再得到的。',
|
|
51
|
+
422: '当创建一个对象时,发生一个验证错误。',
|
|
52
|
+
500: '服务器发生错误,请检查服务器。',
|
|
53
|
+
502: '网关错误。',
|
|
54
|
+
503: '服务不可用,服务器暂时过载或维护。',
|
|
55
|
+
504: '网关超时。'
|
|
13
56
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
57
|
+
|
|
58
|
+
var errorHandler = function errorHandler(error) {
|
|
59
|
+
var response = error.response;
|
|
60
|
+
|
|
61
|
+
if (response && response.status) {
|
|
62
|
+
var errorText = codeMessage[response.status] || response.statusText;
|
|
63
|
+
var status = response.status,
|
|
64
|
+
url = response.url;
|
|
65
|
+
notification.error({
|
|
66
|
+
message: "\u8BF7\u6C42\u9519\u8BEF ".concat(status, ": ").concat(url),
|
|
67
|
+
description: errorText
|
|
68
|
+
});
|
|
69
|
+
} else if (!response) {
|
|
70
|
+
notification.error({
|
|
71
|
+
description: '您的网络发生异常,无法连接服务器',
|
|
72
|
+
message: '网络异常'
|
|
73
|
+
});
|
|
19
74
|
}
|
|
20
|
-
};
|
|
21
|
-
var CancelToken = axios.CancelToken;
|
|
22
|
-
|
|
23
|
-
var _request = function _request(ajax) {
|
|
24
|
-
return function () {
|
|
25
|
-
var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
26
|
-
url: '',
|
|
27
|
-
responseOnce: false,
|
|
28
|
-
unique: false,
|
|
29
|
-
delay: 0
|
|
30
|
-
};
|
|
31
|
-
return new Promise(function (resolve, reject) {
|
|
32
|
-
var key = JSON.stringify(option);
|
|
33
|
-
var timerKey = option.url + '_' + (Object.prototype.toString.call(option.unique) === '[object String]' ? option.unique : '');
|
|
34
|
-
|
|
35
|
-
if (option.unique && timer[timerKey]) {
|
|
36
|
-
clearTimeout(timer[timerKey].id);
|
|
37
|
-
|
|
38
|
-
if (timer[timerKey].cancel) {
|
|
39
|
-
timer[timerKey].cancel();
|
|
40
|
-
} else {
|
|
41
|
-
var cancel = new Error('cancel: before request');
|
|
42
|
-
cancel.__CANCEL__ = true;
|
|
43
|
-
timer[timerKey].reject(cancel);
|
|
44
|
-
}
|
|
45
75
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
76
|
+
return response;
|
|
77
|
+
};
|
|
49
78
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}];
|
|
79
|
+
function responseErrorHandler(url, apiResult) {
|
|
80
|
+
if (/\.jsp/.test(url)) {
|
|
81
|
+
return apiResult;
|
|
82
|
+
}
|
|
55
83
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
item.resolve(res);
|
|
60
|
-
});
|
|
61
|
-
}).catch(function (err) {
|
|
62
|
-
history[key].forEach(function (item) {
|
|
63
|
-
item.reject(err);
|
|
64
|
-
});
|
|
65
|
-
}).finally(function () {
|
|
66
|
-
delete timer[timerKey];
|
|
67
|
-
delete history[key];
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
if (option.unique) {
|
|
72
|
-
timer[timerKey] = {
|
|
73
|
-
id: 0,
|
|
74
|
-
option: option,
|
|
75
|
-
cancel: null,
|
|
76
|
-
reject: reject
|
|
77
|
-
};
|
|
78
|
-
timer[timerKey].id = setTimeout(function () {
|
|
79
|
-
option.cancelToken = new CancelToken(function (c) {
|
|
80
|
-
if (timer[timerKey]) {
|
|
81
|
-
timer[timerKey].cancel = c;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
request();
|
|
85
|
-
}, option.delay || 0);
|
|
86
|
-
} else {
|
|
87
|
-
request();
|
|
88
|
-
}
|
|
89
|
-
} else if (option.responseOnce) {
|
|
90
|
-
var _cancel = new Error('cancel: before request');
|
|
91
|
-
|
|
92
|
-
_cancel.__CANCEL__ = true;
|
|
93
|
-
reject(_cancel);
|
|
94
|
-
} else {
|
|
95
|
-
history[key].push({
|
|
96
|
-
resolve: resolve,
|
|
97
|
-
reject: reject
|
|
98
|
-
});
|
|
99
|
-
}
|
|
84
|
+
if (!apiResult.code) {
|
|
85
|
+
notification.error({
|
|
86
|
+
message: "\u63A5\u53E3\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38"
|
|
100
87
|
});
|
|
101
|
-
|
|
102
|
-
}
|
|
88
|
+
throw new Error('接口响应结构异常,缺少code');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var flag = false;
|
|
92
|
+
var message = '接口请求失败';
|
|
93
|
+
|
|
94
|
+
switch (apiResult.code) {
|
|
95
|
+
case ResponseStatus.sysNotInit:
|
|
96
|
+
message = '系统未初始化';
|
|
97
|
+
break;
|
|
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;
|
|
103
110
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (!flag) {
|
|
144
|
+
message = apiResult.msg || message;
|
|
145
|
+
notification.error({
|
|
146
|
+
message: "\u8BF7\u6C42\u9519\u8BEF",
|
|
147
|
+
description: message
|
|
118
148
|
});
|
|
119
|
-
|
|
120
|
-
}
|
|
149
|
+
throw new Error(message);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return apiResult;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
var req = extend({
|
|
156
|
+
errorHandler: errorHandler,
|
|
157
|
+
credentials: 'include'
|
|
158
|
+
});
|
|
121
159
|
|
|
122
|
-
|
|
160
|
+
function request(_x, _x2) {
|
|
161
|
+
return _request.apply(this, arguments);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function _request() {
|
|
165
|
+
_request = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, options) {
|
|
166
|
+
var _globalConfig$request, _globalConfig$request2, err, option, list, optionsWrapper, responseWrapper, params, res;
|
|
167
|
+
|
|
168
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
169
|
+
while (1) {
|
|
170
|
+
switch (_context.prev = _context.next) {
|
|
171
|
+
case 0:
|
|
172
|
+
_context.prev = 0;
|
|
173
|
+
|
|
174
|
+
if (!/{{\S*}}/.test(url)) {
|
|
175
|
+
_context.next = 8;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (!(!options || !options.params)) {
|
|
180
|
+
_context.next = 5;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
err = new Error("\u5E26\u53C2URL(".concat(url, ")\u8BF7\u6C42\u4E2D\uFF0C\u7F3A\u5C11params\u53C2\u6570"));
|
|
185
|
+
throw err;
|
|
186
|
+
|
|
187
|
+
case 5:
|
|
188
|
+
option = options;
|
|
189
|
+
list = url.match(/{{\S*?}}/g) || [];
|
|
190
|
+
list.forEach(function (param) {
|
|
191
|
+
var key = param.replace(/[{|}]/g, '');
|
|
192
|
+
url = url.replace(param, option.params[key]);
|
|
193
|
+
delete option.params[key];
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
case 8:
|
|
197
|
+
optionsWrapper = (options === null || options === void 0 ? void 0 : options.optionsWrapper) || ((_globalConfig$request = globalConfig.request) === null || _globalConfig$request === void 0 ? void 0 : _globalConfig$request.optionsWrapper);
|
|
198
|
+
responseWrapper = (options === null || options === void 0 ? void 0 : options.responseWrapper) || ((_globalConfig$request2 = globalConfig.request) === null || _globalConfig$request2 === void 0 ? void 0 : _globalConfig$request2.responseWrapper);
|
|
199
|
+
params = optionsWrapper ? optionsWrapper(url, options) : {
|
|
200
|
+
url: url,
|
|
201
|
+
options: options
|
|
202
|
+
};
|
|
203
|
+
_context.next = 13;
|
|
204
|
+
return req(params.url, params.options);
|
|
205
|
+
|
|
206
|
+
case 13:
|
|
207
|
+
res = _context.sent;
|
|
208
|
+
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res)) : responseErrorHandler(url, res));
|
|
209
|
+
|
|
210
|
+
case 17:
|
|
211
|
+
_context.prev = 17;
|
|
212
|
+
_context.t0 = _context["catch"](0);
|
|
213
|
+
return _context.abrupt("return", null);
|
|
214
|
+
|
|
215
|
+
case 20:
|
|
216
|
+
case "end":
|
|
217
|
+
return _context.stop();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}, _callee, null, [[0, 17]]);
|
|
221
|
+
}));
|
|
222
|
+
return _request.apply(this, arguments);
|
|
223
|
+
}
|
|
123
224
|
|
|
124
|
-
export default
|
|
225
|
+
export default request;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"echarts": "^5.3.2",
|
|
37
37
|
"echarts-for-react": "^3.0.2",
|
|
38
38
|
"lerna": "^4.0.0",
|
|
39
|
-
"react-infinite-scroll-component": "^6.1.0"
|
|
39
|
+
"react-infinite-scroll-component": "^6.1.0",
|
|
40
|
+
"umi-request": "^1.4.0"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"@types/lodash": "^4.14.182",
|
|
@@ -58,5 +59,5 @@
|
|
|
58
59
|
"prettier": "^2.2.1",
|
|
59
60
|
"yorkie": "^2.0.0"
|
|
60
61
|
},
|
|
61
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "05a2117de228e421103ba3de3bff19af21132b83"
|
|
62
63
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FormItemProps } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { DialogTypes } from '../types';
|
|
4
|
-
declare const ItemNode: React.FC<{
|
|
5
|
-
value?: any;
|
|
6
|
-
field: DialogTypes.FieldProps & FormItemProps;
|
|
7
|
-
fieldNames?: DialogTypes.FieldOption;
|
|
8
|
-
onChange?: (value: any) => void;
|
|
9
|
-
}>;
|
|
10
|
-
export default ItemNode;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Input, Radio, Space } from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { classPrefix } from '..';
|
|
4
|
-
import IconFont from '../../icon/iconFont';
|
|
5
|
-
import BizSelect from '../../select';
|
|
6
|
-
import BizList from './list';
|
|
7
|
-
import BizSelectToInput from './selectToInput';
|
|
8
|
-
import BizTab from './tab';
|
|
9
|
-
|
|
10
|
-
var ItemNode = function ItemNode(props) {
|
|
11
|
-
var _props$field = props.field,
|
|
12
|
-
type = _props$field.type,
|
|
13
|
-
label = _props$field.label,
|
|
14
|
-
options = _props$field.options,
|
|
15
|
-
placeholder = _props$field.placeholder,
|
|
16
|
-
extendName = _props$field.extendName,
|
|
17
|
-
direction = _props$field.direction,
|
|
18
|
-
multiple = _props$field.multiple,
|
|
19
|
-
enableSearch = _props$field.enableSearch,
|
|
20
|
-
selectType = _props$field.selectType,
|
|
21
|
-
overlayWidth = _props$field.overlayWidth,
|
|
22
|
-
extra = _props$field.extra,
|
|
23
|
-
fieldNames = props.fieldNames;
|
|
24
|
-
|
|
25
|
-
var onChange = function onChange(data) {
|
|
26
|
-
if (props.onChange) props.onChange(data);
|
|
27
|
-
if (props.field.onChange) props.field.onChange(data);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
if (type === 'input') {
|
|
31
|
-
return /*#__PURE__*/React.createElement(Input, {
|
|
32
|
-
defaultValue: props.value,
|
|
33
|
-
className: "".concat(classPrefix, "-input"),
|
|
34
|
-
placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
|
|
35
|
-
autoComplete: "off",
|
|
36
|
-
allowClear: {
|
|
37
|
-
clearIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
38
|
-
className: "biz-icon",
|
|
39
|
-
type: 'qingchu'
|
|
40
|
-
})
|
|
41
|
-
},
|
|
42
|
-
onChange: onChange
|
|
43
|
-
});
|
|
44
|
-
} else if (type === 'password') {
|
|
45
|
-
return /*#__PURE__*/React.createElement(Input.Password, {
|
|
46
|
-
className: "".concat(classPrefix, "-input"),
|
|
47
|
-
defaultValue: props.value,
|
|
48
|
-
placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label),
|
|
49
|
-
onChange: onChange
|
|
50
|
-
});
|
|
51
|
-
} else if (type === 'select') {
|
|
52
|
-
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
53
|
-
className: "".concat(classPrefix, "-select"),
|
|
54
|
-
options: options || [],
|
|
55
|
-
defaultValue: props.value,
|
|
56
|
-
keyField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value,
|
|
57
|
-
labelField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label,
|
|
58
|
-
multiple: multiple,
|
|
59
|
-
enableSearch: enableSearch,
|
|
60
|
-
type: selectType,
|
|
61
|
-
overlayWidth: overlayWidth,
|
|
62
|
-
extra: extra,
|
|
63
|
-
onChange: onChange
|
|
64
|
-
});
|
|
65
|
-
} else if (type === 'selectToInput') {
|
|
66
|
-
return /*#__PURE__*/React.createElement(BizSelectToInput, {
|
|
67
|
-
value: props.value,
|
|
68
|
-
options: options || [],
|
|
69
|
-
keyField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value,
|
|
70
|
-
labelField: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label,
|
|
71
|
-
onChange: onChange,
|
|
72
|
-
extendName: extendName
|
|
73
|
-
});
|
|
74
|
-
} else if (type === 'tab') {
|
|
75
|
-
return /*#__PURE__*/React.createElement(BizTab, {
|
|
76
|
-
value: props.value,
|
|
77
|
-
options: options,
|
|
78
|
-
onChange: onChange
|
|
79
|
-
});
|
|
80
|
-
} else if (type === 'radio') {
|
|
81
|
-
return /*#__PURE__*/React.createElement(Radio.Group, {
|
|
82
|
-
onChange: onChange,
|
|
83
|
-
defaultValue: props.value
|
|
84
|
-
}, /*#__PURE__*/React.createElement(Space, {
|
|
85
|
-
direction: direction || 'horizontal'
|
|
86
|
-
}, options && options.map(function (item) {
|
|
87
|
-
return /*#__PURE__*/React.createElement(Radio, {
|
|
88
|
-
key: item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value],
|
|
89
|
-
value: item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value]
|
|
90
|
-
}, item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label]);
|
|
91
|
-
})));
|
|
92
|
-
} else if (type === 'list') {
|
|
93
|
-
return /*#__PURE__*/React.createElement(BizList, {
|
|
94
|
-
value: props.value,
|
|
95
|
-
options: options && options.length > 0 ? options : undefined,
|
|
96
|
-
onChange: onChange
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u76F8\u5173\u7EC4\u4EF6");
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
ItemNode.defaultProps = {
|
|
104
|
-
fieldNames: {
|
|
105
|
-
label: 'label',
|
|
106
|
-
value: 'value'
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
export default ItemNode;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BizSelectTypes } from '../../select/types';
|
|
3
|
-
import './styles/handle.less';
|
|
4
|
-
import { SelectInputProps } from '../types';
|
|
5
|
-
declare const BizSelectToInput: React.FC<BizSelectTypes.Props & SelectInputProps>;
|
|
6
|
-
export default BizSelectToInput;
|