@zgfe/business-lib 1.1.27 → 1.1.28
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.js +8 -21
- package/es/addToPanel/components/radioGroup.js +1 -3
- package/es/addToPanel/components/styleList.js +5 -22
- package/es/addToPanel/demo/edit.js +5 -12
- package/es/addToPanel/demo/index.js +5 -12
- package/es/addToPanel/index.js +21 -58
- package/es/addToScene/addGroup.js +0 -4
- package/es/addToScene/demo/index.js +5 -12
- package/es/addToScene/index.js +13 -40
- package/es/assets/demo/index.js +0 -2
- package/es/assets/demo/input.js +5 -12
- package/es/assets/iconfont/iconfont.js +10 -17
- package/es/assets/theme.js +0 -1
- package/es/attrConditions/components/operateList.js +10 -27
- package/es/attrConditions/components/stringList.js +69 -98
- package/es/attrConditions/components/valuesList.js +14 -40
- package/es/attrConditions/demo/group.js +11 -23
- package/es/attrConditions/demo/index.js +17 -26
- package/es/attrConditions/group.js +17 -48
- package/es/attrConditions/index.js +22 -49
- package/es/attrConditions/types.js +0 -1
- package/es/attributeSelector/demo/disable.js +8 -16
- package/es/attributeSelector/demo/index.js +8 -17
- package/es/attributeSelector/index.js +22 -45
- package/es/attributeSelector/listPanel.js +18 -46
- package/es/attributeSelector/option.js +3 -13
- package/es/attributeSelector/types.js +0 -5
- package/es/attributeSelector/util.js +0 -3
- package/es/chart/demo/index.js +5 -14
- package/es/chart/index.js +30 -44
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +13 -37
- package/es/chart/util/data/china.js +1 -4
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +0 -5
- package/es/chart/util/formatOption.js +0 -13
- package/es/chart/util/mapUtil.js +5 -26
- package/es/config.js +0 -2
- package/es/cycleTime/demo/disable.js +0 -1
- package/es/cycleTime/index.js +19 -46
- package/es/cycleTime/month.js +8 -27
- package/es/datePicker/datePicker.js +5 -23
- package/es/datePicker/demo/customType.js +13 -22
- package/es/datePicker/demo/day.js +13 -22
- package/es/datePicker/demo/index.js +12 -21
- package/es/datePicker/index.js +18 -41
- package/es/datePicker/utils.js +0 -7
- package/es/demoWrapper/content.js +31 -56
- package/es/demoWrapper/head.js +9 -23
- package/es/demoWrapper/index.js +14 -30
- package/es/dialog/demo/index.js +5 -12
- package/es/dialog/index.js +4 -6
- package/es/dnd/demo/data.js +19 -28
- package/es/dnd/demo/handle.js +19 -28
- package/es/dnd/index.js +21 -45
- package/es/dnd/item.js +10 -30
- package/es/eventSelector/demo/index.js +12 -23
- package/es/eventSelector/index.js +14 -42
- package/es/eventSelector/listPanel.js +27 -61
- package/es/eventSelector/option.js +6 -11
- package/es/icon/iconFont.js +7 -13
- package/es/layout/analysisLayout/demo/index.js +0 -6
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +16 -34
- package/es/layout/detail/index.js +1 -3
- package/es/loginForm/index.js +7 -18
- package/es/searchInput/index.js +2 -7
- package/es/select/demo/children.js +8 -16
- package/es/select/demo/customLabel.js +0 -2
- package/es/select/demo/group.js +8 -17
- package/es/select/demo/index.js +11 -19
- package/es/select/demo/loading.js +8 -18
- package/es/select/demo/multiple.js +8 -16
- package/es/select/handle.js +14 -34
- package/es/select/index.js +22 -59
- package/es/select/option.js +10 -30
- package/es/select/overlay.js +25 -62
- package/es/table/demo/data/table.js +0 -2
- package/es/table/demo/index.js +13 -39
- package/es/table/demo/index2.js +5 -15
- package/es/table/demo/index3.js +7 -28
- package/es/table/index.js +14 -33
- package/es/targetConditionGroup/components/targetDimension.js +12 -38
- package/es/targetConditionGroup/demo/group.js +21 -36
- package/es/targetConditionGroup/demo/index.js +5 -13
- package/es/targetConditionGroup/index.js +31 -84
- package/es/targetSelector/demo/index.js +15 -28
- package/es/targetSelector/editBox.js +5 -20
- package/es/targetSelector/index.js +15 -36
- package/es/targetSelector/optionIcon.js +1 -5
- package/es/targetSelector/optionMenu.js +0 -3
- package/es/userCondition/conditionTypeList.js +7 -12
- package/es/userCondition/conditionWrap.js +0 -2
- package/es/userCondition/conditions/cdpCondition.js +51 -97
- package/es/userCondition/conditions/eventCondition.js +6 -16
- package/es/userCondition/conditions/periodCondition.js +8 -26
- package/es/userCondition/conditions/propCondition.js +29 -61
- package/es/userCondition/conditions/runTimesCondition.js +5 -10
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +15 -33
- package/es/userCondition/conditions/textDesc.js +16 -67
- package/es/userCondition/demo/index.js +11 -21
- package/es/userCondition/index.js +51 -91
- package/es/userCondition/orConditions.js +11 -48
- package/es/userCondition/relationLabel.js +1 -4
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +0 -1
- package/es/userCondition/util.js +4 -13
- package/es/userGroup/demo/group.js +14 -23
- package/es/userGroup/demo/index.js +5 -15
- package/es/userGroup/index.js +12 -30
- package/es/userTagsSelector/cascaderOverlay.js +19 -51
- package/es/userTagsSelector/components/search/index.js +0 -2
- package/es/userTagsSelector/demo/index.js +0 -3
- package/es/userTagsSelector/groups/groupOption.js +6 -8
- package/es/userTagsSelector/groups/index.js +15 -30
- package/es/userTagsSelector/index.js +17 -35
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +3 -6
- package/es/userTagsSelector/multipleCheckPanel/index.js +8 -21
- package/es/userTagsSelector/util.js +0 -2
- package/es/utils/ajax.js +45 -71
- package/es/utils/base64.js +3 -22
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +4 -7
- package/es/utils/util.js +0 -16
- package/package.json +2 -2
package/es/utils/ajax.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
|
|
1
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); } }
|
|
2
|
-
|
|
3
4
|
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
|
-
|
|
5
5
|
import Request, { extend } from 'umi-request';
|
|
6
6
|
import { notification } from 'antd';
|
|
7
7
|
import { globalConfig } from '../config';
|
|
@@ -23,14 +23,12 @@ var codeMessage = {
|
|
|
23
23
|
503: '服务不可用,服务器暂时过载或维护。',
|
|
24
24
|
504: '网关超时。'
|
|
25
25
|
};
|
|
26
|
-
|
|
27
26
|
var errorHandler = function errorHandler(error) {
|
|
28
27
|
var response = error.response;
|
|
29
|
-
|
|
30
28
|
if (response && response.status) {
|
|
31
29
|
var errorText = codeMessage[response.status] || response.statusText;
|
|
32
30
|
var status = response.status,
|
|
33
|
-
|
|
31
|
+
url = response.url;
|
|
34
32
|
notification.error({
|
|
35
33
|
message: "\u8BF7\u6C42\u9519\u8BEF ".concat(status, ": ").concat(url),
|
|
36
34
|
description: errorText
|
|
@@ -39,35 +37,28 @@ var errorHandler = function errorHandler(error) {
|
|
|
39
37
|
if (Request.isCancel(error)) {
|
|
40
38
|
return response;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
notification.error({
|
|
44
41
|
description: '您的网络发生异常,无法连接服务器',
|
|
45
42
|
message: '网络异常'
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
|
|
49
45
|
return response;
|
|
50
46
|
};
|
|
51
|
-
|
|
52
47
|
function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
53
48
|
if (/\.jsp/.test(url)) {
|
|
54
49
|
return apiResult;
|
|
55
50
|
}
|
|
56
|
-
|
|
57
51
|
if (/^2\d+|(700)/.test(String(apiResult.status))) {
|
|
58
52
|
return apiResult;
|
|
59
53
|
}
|
|
60
|
-
|
|
61
54
|
if (!apiResult.code) {
|
|
62
55
|
notification.error({
|
|
63
56
|
message: "\u63A5\u53E3\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38"
|
|
64
57
|
});
|
|
65
58
|
throw new Error('接口响应结构异常,缺少code');
|
|
66
59
|
}
|
|
67
|
-
|
|
68
60
|
var flag = false;
|
|
69
61
|
var message = '接口请求失败';
|
|
70
|
-
|
|
71
62
|
if (new RegExp("".concat(ResponseStatus.success, "$")).test(apiResult.code)) {
|
|
72
63
|
flag = true;
|
|
73
64
|
} else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
|
|
@@ -77,7 +68,6 @@ function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
77
68
|
window.location.href = '/webapp/app/noPermission';
|
|
78
69
|
throw new Error(apiResult.msg);
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
if (!flag) {
|
|
82
72
|
message = apiResult.msg || message;
|
|
83
73
|
notification[notifyType || 'error']({
|
|
@@ -86,78 +76,62 @@ function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
86
76
|
});
|
|
87
77
|
throw new Error(message);
|
|
88
78
|
}
|
|
89
|
-
|
|
90
79
|
return apiResult;
|
|
91
80
|
}
|
|
92
|
-
|
|
93
81
|
var req = extend({
|
|
94
82
|
errorHandler: errorHandler,
|
|
95
83
|
credentials: 'include'
|
|
96
84
|
});
|
|
97
|
-
|
|
98
85
|
function request(_x, _x2) {
|
|
99
86
|
return _request.apply(this, arguments);
|
|
100
87
|
}
|
|
101
|
-
|
|
102
88
|
function _request() {
|
|
103
|
-
_request = _asyncToGenerator( /*#__PURE__*/
|
|
89
|
+
_request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, options) {
|
|
104
90
|
var _globalConfig$request, _globalConfig$request2, err, option, list, optionsWrapper, responseWrapper, params, res;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
_context.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType));
|
|
147
|
-
|
|
148
|
-
case 17:
|
|
149
|
-
_context.prev = 17;
|
|
150
|
-
_context.t0 = _context["catch"](0);
|
|
151
|
-
return _context.abrupt("return", null);
|
|
152
|
-
|
|
153
|
-
case 20:
|
|
154
|
-
case "end":
|
|
155
|
-
return _context.stop();
|
|
156
|
-
}
|
|
91
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
92
|
+
while (1) switch (_context.prev = _context.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
_context.prev = 0;
|
|
95
|
+
if (!/{{\S*}}/.test(url)) {
|
|
96
|
+
_context.next = 8;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (!(!options || !options.params)) {
|
|
100
|
+
_context.next = 5;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
err = new Error("\u5E26\u53C2URL(".concat(url, ")\u8BF7\u6C42\u4E2D\uFF0C\u7F3A\u5C11params\u53C2\u6570"));
|
|
104
|
+
throw err;
|
|
105
|
+
case 5:
|
|
106
|
+
option = options;
|
|
107
|
+
list = url.match(/{{\S*?}}/g) || [];
|
|
108
|
+
list.forEach(function (param) {
|
|
109
|
+
var key = param.replace(/[{|}]/g, '');
|
|
110
|
+
url = url.replace(param, option.params[key]);
|
|
111
|
+
delete option.params[key];
|
|
112
|
+
});
|
|
113
|
+
case 8:
|
|
114
|
+
optionsWrapper = (options === null || options === void 0 ? void 0 : options.optionsWrapper) || ((_globalConfig$request = globalConfig.request) === null || _globalConfig$request === void 0 ? void 0 : _globalConfig$request.optionsWrapper);
|
|
115
|
+
responseWrapper = (options === null || options === void 0 ? void 0 : options.responseWrapper) || ((_globalConfig$request2 = globalConfig.request) === null || _globalConfig$request2 === void 0 ? void 0 : _globalConfig$request2.responseWrapper);
|
|
116
|
+
params = optionsWrapper ? optionsWrapper(url, options) : {
|
|
117
|
+
url: url,
|
|
118
|
+
options: options
|
|
119
|
+
};
|
|
120
|
+
_context.next = 13;
|
|
121
|
+
return req(params.url, params.options);
|
|
122
|
+
case 13:
|
|
123
|
+
res = _context.sent;
|
|
124
|
+
return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType));
|
|
125
|
+
case 17:
|
|
126
|
+
_context.prev = 17;
|
|
127
|
+
_context.t0 = _context["catch"](0);
|
|
128
|
+
return _context.abrupt("return", null);
|
|
129
|
+
case 20:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context.stop();
|
|
157
132
|
}
|
|
158
133
|
}, _callee, null, [[0, 17]]);
|
|
159
134
|
}));
|
|
160
135
|
return _request.apply(this, arguments);
|
|
161
136
|
}
|
|
162
|
-
|
|
163
137
|
export default request;
|
package/es/utils/base64.js
CHANGED
|
@@ -3,10 +3,8 @@ var base64 = {
|
|
|
3
3
|
_utf8_encode: function _utf8_encode(string) {
|
|
4
4
|
string = string.replace(/\r\n/g, '\n');
|
|
5
5
|
var utftext = '';
|
|
6
|
-
|
|
7
6
|
for (var n = 0; n < string.length; n++) {
|
|
8
7
|
var c = string.charCodeAt(n);
|
|
9
|
-
|
|
10
8
|
if (c < 128) {
|
|
11
9
|
utftext += String.fromCharCode(c);
|
|
12
10
|
} else if (c > 127 && c < 2048) {
|
|
@@ -18,19 +16,16 @@ var base64 = {
|
|
|
18
16
|
utftext += String.fromCharCode(c & 63 | 128);
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
return utftext;
|
|
23
20
|
},
|
|
24
21
|
_utf8_decode: function _utf8_decode(utftext) {
|
|
25
22
|
var string = '';
|
|
26
23
|
var i = 0,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
c = 0,
|
|
25
|
+
c2 = 0,
|
|
26
|
+
c3 = 0;
|
|
31
27
|
while (i < utftext.length) {
|
|
32
28
|
c = utftext.charCodeAt(i);
|
|
33
|
-
|
|
34
29
|
if (c < 128) {
|
|
35
30
|
string += String.fromCharCode(c);
|
|
36
31
|
i++;
|
|
@@ -45,7 +40,6 @@ var base64 = {
|
|
|
45
40
|
i += 3;
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
|
|
49
43
|
return string;
|
|
50
44
|
},
|
|
51
45
|
encode: function encode(input, type) {
|
|
@@ -53,7 +47,6 @@ var base64 = {
|
|
|
53
47
|
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
|
54
48
|
var i = 0;
|
|
55
49
|
input = this._utf8_encode(input);
|
|
56
|
-
|
|
57
50
|
while (i < input.length) {
|
|
58
51
|
chr1 = input.charCodeAt(i++);
|
|
59
52
|
chr2 = input.charCodeAt(i++);
|
|
@@ -62,16 +55,13 @@ var base64 = {
|
|
|
62
55
|
enc2 = (chr1 & 3) << 4 | chr2 >> 4;
|
|
63
56
|
enc3 = (chr2 & 15) << 2 | chr3 >> 6;
|
|
64
57
|
enc4 = chr3 & 63;
|
|
65
|
-
|
|
66
58
|
if (isNaN(chr2)) {
|
|
67
59
|
enc3 = enc4 = 64;
|
|
68
60
|
} else if (isNaN(chr3)) {
|
|
69
61
|
enc4 = 64;
|
|
70
62
|
}
|
|
71
|
-
|
|
72
63
|
output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
|
73
64
|
}
|
|
74
|
-
|
|
75
65
|
if (type) {
|
|
76
66
|
return output.replace(/[\+]?[\/]?[\=]?/g, '');
|
|
77
67
|
} else {
|
|
@@ -84,7 +74,6 @@ var base64 = {
|
|
|
84
74
|
var chr1, chr2, chr3;
|
|
85
75
|
var enc1, enc2, enc3, enc4;
|
|
86
76
|
var i = 0;
|
|
87
|
-
|
|
88
77
|
while (i < input.length) {
|
|
89
78
|
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
|
90
79
|
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
|
@@ -94,16 +83,13 @@ var base64 = {
|
|
|
94
83
|
chr2 = (enc2 & 15) << 4 | enc3 >> 2;
|
|
95
84
|
chr3 = (enc3 & 3) << 6 | enc4;
|
|
96
85
|
output = output + String.fromCharCode(chr1);
|
|
97
|
-
|
|
98
86
|
if (enc3 != 64) {
|
|
99
87
|
output = output + String.fromCharCode(chr2);
|
|
100
88
|
}
|
|
101
|
-
|
|
102
89
|
if (enc4 != 64) {
|
|
103
90
|
output = output + String.fromCharCode(chr3);
|
|
104
91
|
}
|
|
105
92
|
}
|
|
106
|
-
|
|
107
93
|
output = this._utf8_decode(output);
|
|
108
94
|
return output;
|
|
109
95
|
},
|
|
@@ -114,21 +100,17 @@ var base64 = {
|
|
|
114
100
|
var O26e = Array(0x100);
|
|
115
101
|
var O999 = O492['\x6c\x65\x6e\x67\x74\x68'];
|
|
116
102
|
var O453 = O6b8['\x6c\x65\x6e\x67\x74\x68'];
|
|
117
|
-
|
|
118
103
|
for (var O98c = 0x0; O98c < 0x100; O98c++) {
|
|
119
104
|
dfc4[O98c] = O492[O98c % O999]['\x63\x68\x61\x72\x41\x74'](0x0)['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74']();
|
|
120
105
|
O26e[O98c] = O98c;
|
|
121
106
|
}
|
|
122
|
-
|
|
123
107
|
for (var O8cf = O98c = 0x0; O98c < 0x100; O98c++) {
|
|
124
108
|
O8cf = (O8cf + O26e[O98c] + dfc4[O98c]) % 0x100;
|
|
125
109
|
var O23f = O26e[O98c];
|
|
126
110
|
O26e[O98c] = O26e[O8cf];
|
|
127
111
|
O26e[O8cf] = O23f;
|
|
128
112
|
}
|
|
129
|
-
|
|
130
113
|
var ac35 = this._$[0];
|
|
131
|
-
|
|
132
114
|
for (var O577 = O8cf = O98c = 0x0; O98c < O453; O98c++) {
|
|
133
115
|
O577 = (O577 + 0x1) % 0x100;
|
|
134
116
|
O8cf = (O8cf + O26e[O577]) % 0x100;
|
|
@@ -138,7 +120,6 @@ var base64 = {
|
|
|
138
120
|
var O3d6 = O26e[(O26e[O577] + O26e[O8cf]) % 0x100];
|
|
139
121
|
ac35 += String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](O6b8[O98c]['\x63\x68\x61\x72\x41\x74'](0x0)['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74']() ^ O3d6);
|
|
140
122
|
}
|
|
141
|
-
|
|
142
123
|
return ac35;
|
|
143
124
|
}
|
|
144
125
|
};
|
package/es/utils/type.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export declare class ApiResult<T> implements InterfaceApiResult<T> {
|
|
|
83
83
|
status?: number;
|
|
84
84
|
constructor(code: ResponseStatus, data: any, message?: string);
|
|
85
85
|
}
|
|
86
|
-
export
|
|
86
|
+
export type ajaxConfig<T> = RequestOptionsInit & {
|
|
87
87
|
errorTitle?: string;
|
|
88
88
|
notifyType?: 'warning' | 'error' | 'info';
|
|
89
89
|
optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
|
package/es/utils/type.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
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); }
|
|
2
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
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
|
-
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
6
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
7
|
export var ResponseStatus;
|
|
8
|
-
|
|
9
8
|
(function (ResponseStatus) {
|
|
10
9
|
ResponseStatus["success"] = "00";
|
|
11
10
|
ResponseStatus["fail"] = "01";
|
|
@@ -19,10 +18,8 @@ export var ResponseStatus;
|
|
|
19
18
|
ResponseStatus["systemError"] = "09";
|
|
20
19
|
ResponseStatus["noPermission"] = "44";
|
|
21
20
|
})(ResponseStatus || (ResponseStatus = {}));
|
|
22
|
-
|
|
23
21
|
export var ApiResult = /*#__PURE__*/_createClass(function ApiResult(code, data, message) {
|
|
24
22
|
_classCallCheck(this, ApiResult);
|
|
25
|
-
|
|
26
23
|
this.code = void 0;
|
|
27
24
|
this.data = void 0;
|
|
28
25
|
this.msg = void 0;
|
package/es/utils/util.js
CHANGED
|
@@ -37,13 +37,11 @@ var util = {
|
|
|
37
37
|
function s4() {
|
|
38
38
|
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
40
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
42
41
|
},
|
|
43
42
|
mergeObject: function mergeObject(defaults, option) {
|
|
44
43
|
defaults = defaults || {};
|
|
45
44
|
option = option || {};
|
|
46
|
-
|
|
47
45
|
for (var prop in defaults) {
|
|
48
46
|
if (this.isObject(defaults[prop])) {
|
|
49
47
|
option[prop] = option[prop] ? option[prop] : {};
|
|
@@ -55,7 +53,6 @@ var util = {
|
|
|
55
53
|
var i = 0;
|
|
56
54
|
var optLenght = option[prop].length;
|
|
57
55
|
var defaultLength = defaults[prop].length;
|
|
58
|
-
|
|
59
56
|
for (i; i < optLenght && i < defaultLength; i++) {
|
|
60
57
|
option[prop][i] = this.mergeObject(defaults[prop][i], option[prop][i]);
|
|
61
58
|
}
|
|
@@ -64,7 +61,6 @@ var util = {
|
|
|
64
61
|
option[prop] = option[prop] === null || option[prop] === undefined ? defaults[prop] : option[prop];
|
|
65
62
|
}
|
|
66
63
|
}
|
|
67
|
-
|
|
68
64
|
return option;
|
|
69
65
|
},
|
|
70
66
|
toThousands: function toThousands(num) {
|
|
@@ -85,7 +81,6 @@ var util = {
|
|
|
85
81
|
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
86
82
|
var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm:ss';
|
|
87
83
|
var autoShort = arguments.length > 2 ? arguments[2] : undefined;
|
|
88
|
-
|
|
89
84
|
if (this.isDate(date)) {
|
|
90
85
|
return formatter.replace('hh', this.toDoubleNumber(date.getHours())).replace('mm', this.toDoubleNumber(date.getMinutes())).replace('ss', this.toDoubleNumber(date.getSeconds()));
|
|
91
86
|
} else if (this.isNumber(date)) {
|
|
@@ -94,16 +89,13 @@ var util = {
|
|
|
94
89
|
var h = parseInt(m / 60 + '');
|
|
95
90
|
s = s - m * 60;
|
|
96
91
|
m = m - h * 60;
|
|
97
|
-
|
|
98
92
|
if (!h && autoShort) {
|
|
99
93
|
formatter = formatter.replace(/hh\S*?mm/, 'mm');
|
|
100
|
-
|
|
101
94
|
if (!m) {
|
|
102
95
|
formatter = formatter.replace(/mm\S*?ss/, 'ss');
|
|
103
96
|
return formatter.replace('ss', s + '');
|
|
104
97
|
}
|
|
105
98
|
}
|
|
106
|
-
|
|
107
99
|
return formatter.replace('hh', this.toDoubleNumber(h)).replace('mm', this.toDoubleNumber(m)).replace('ss', this.toDoubleNumber(s));
|
|
108
100
|
}
|
|
109
101
|
},
|
|
@@ -126,7 +118,6 @@ var util = {
|
|
|
126
118
|
var beginLength = 0;
|
|
127
119
|
var endArr = [];
|
|
128
120
|
var endLength = 0;
|
|
129
|
-
|
|
130
121
|
if (fullLength > config.maxLength) {
|
|
131
122
|
var strArr = str.match(reg.anyChars) || [];
|
|
132
123
|
strArr.forEach(function (char) {
|
|
@@ -143,32 +134,25 @@ var util = {
|
|
|
143
134
|
});
|
|
144
135
|
return beginArr.join('') + config.replaceStr + endArr.reverse().join('');
|
|
145
136
|
}
|
|
146
|
-
|
|
147
137
|
return str;
|
|
148
138
|
},
|
|
149
139
|
setHighLight: function setHighLight(content, search, wrapper) {
|
|
150
140
|
var res = [];
|
|
151
141
|
var match = content.match(_.isRegExp(search) ? search : new RegExp(_.escapeRegExp(search), 'i'));
|
|
152
|
-
|
|
153
142
|
if (!match) {
|
|
154
143
|
res.push(content);
|
|
155
144
|
return res;
|
|
156
145
|
}
|
|
157
|
-
|
|
158
146
|
var text = match[0];
|
|
159
147
|
var matchIndex = match.index;
|
|
160
|
-
|
|
161
148
|
if (matchIndex - 1 >= 0) {
|
|
162
149
|
res.push(content.substring(0, matchIndex));
|
|
163
150
|
}
|
|
164
|
-
|
|
165
151
|
res.push(wrapper(text, "".concat(content, "-").concat(search)));
|
|
166
|
-
|
|
167
152
|
if (matchIndex + text.length < content.length) {
|
|
168
153
|
var beginIndex = matchIndex + text.length;
|
|
169
154
|
res.push(this.setHighLight(content.substring(beginIndex, content.length), search, wrapper));
|
|
170
155
|
}
|
|
171
|
-
|
|
172
156
|
return res;
|
|
173
157
|
}
|
|
174
158
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"react": "^16.12.0 || ^17.0.0",
|
|
60
60
|
"yorkie": "^2.0.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b59ca61de9f4c170e848cba3fdea4cff69968872"
|
|
63
63
|
}
|