@lingxiteam/assets 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/dealDsl/index.d.ts +1 -2
- package/es/dealDsl/index.js +1 -2
- package/es/dealDsl/preprocess/common.js +179 -37
- package/es/dealDsl/preprocessDSL.d.ts +2 -14
- package/es/dealDsl/preprocessDSL.js +2 -42
- package/es/error/errorDisplay/Web/Drawer/Drawer.js +6 -2
- package/es/error/errorDisplay/Web/Drawer/Drawer.less +25 -0
- package/es/error/errorDisplay/Web/ErrorMsg/index.js +187 -43
- package/es/error/errorDisplay/Web/Notification/Notice.js +5 -1
- package/es/error/errorDisplay/Web/Notification/Notification.js +10 -3
- package/es/error/errorDisplay/Web/Notification/Notification.less +13 -1
- package/es/error/errorDisplay/Web/Notification/index.js +8 -9
- package/es/error/errorDisplay/Web/defaultGlobalConfig.js +3 -1
- package/es/error/errorDisplay/compUtils.js +17 -1
- package/es/error/errorDisplay/const.js +1 -1
- package/es/error/errorDisplay/http.js +1 -1
- package/es/error/index.js +3 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/rootConfig/mobile/BusiComp.d.ts +5 -0
- package/es/rootConfig/mobile/BusiComp.js +32 -3
- package/es/rootConfig/mobile/MobileModal.d.ts +13 -5
- package/es/rootConfig/mobile/MobileModal.js +38 -9
- package/es/rootConfig/mobile/MobilePopover.d.ts +5 -0
- package/es/rootConfig/mobile/MobilePopover.js +31 -2
- package/es/rootConfig/mobile/page.d.ts +25 -5
- package/es/rootConfig/mobile/page.js +70 -10
- package/es/rootConfig/pc/BusiComp.d.ts +4 -0
- package/es/rootConfig/pc/BusiComp.js +64 -3
- package/es/rootConfig/pc/Drawer.d.ts +12 -0
- package/es/rootConfig/pc/Drawer.js +68 -2
- package/es/rootConfig/pc/Modal.d.ts +6 -0
- package/es/rootConfig/pc/Modal.js +62 -2
- package/es/rootConfig/pc/Popover.d.ts +5 -0
- package/es/rootConfig/pc/Popover.js +58 -2
- package/es/rootConfig/pc/page.d.ts +25 -10
- package/es/rootConfig/pc/page.js +103 -15
- package/es/rootConfig/todoActionList.d.ts +170 -50
- package/es/rootConfig/todoActionList.js +221 -70
- package/es/rootConfig/todoOptionList.d.ts +38 -6
- package/es/rootConfig/todoOptionList.js +44 -6
- package/es/security/encipher/sign.js +8 -1
- package/es/security/encipher/token.d.ts +3 -0
- package/es/security/encipher/token.js +30 -0
- package/es/security/index.d.ts +2 -0
- package/es/security/index.js +4 -1
- package/es/theme/bin/default/modalWidth.js +8 -0
- package/es/theme/bin/default/theme.js +282 -207
- package/es/theme/bin/default/theme.less +282 -207
- package/es/theme/bin/default/theme.scss +282 -207
- package/es/theme/build.js +9 -0
- package/es/theme/src/default/index.js +169 -61
- package/es/theme/utils/renderColors.js +13 -2
- package/es/utils/cookieUtil.js +36 -0
- package/lib/dealDsl/index.d.ts +1 -2
- package/lib/dealDsl/index.js +1 -20
- package/lib/dealDsl/preprocess/common.js +179 -37
- package/lib/dealDsl/preprocessDSL.d.ts +2 -14
- package/lib/dealDsl/preprocessDSL.js +4 -46
- package/lib/error/errorDisplay/Web/Drawer/Drawer.js +6 -2
- package/lib/error/errorDisplay/Web/Drawer/Drawer.less +25 -0
- package/lib/error/errorDisplay/Web/ErrorMsg/index.js +186 -43
- package/lib/error/errorDisplay/Web/Notification/Notice.js +5 -1
- package/lib/error/errorDisplay/Web/Notification/Notification.js +10 -3
- package/lib/error/errorDisplay/Web/Notification/Notification.less +13 -1
- package/lib/error/errorDisplay/Web/Notification/index.js +8 -9
- package/lib/error/errorDisplay/Web/defaultGlobalConfig.js +2 -1
- package/lib/error/errorDisplay/compUtils.js +19 -1
- package/lib/error/errorDisplay/const.js +1 -1
- package/lib/error/errorDisplay/http.js +1 -1
- package/lib/error/index.js +14 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +14 -0
- package/lib/rootConfig/mobile/BusiComp.d.ts +5 -0
- package/lib/rootConfig/mobile/BusiComp.js +32 -3
- package/lib/rootConfig/mobile/MobileModal.d.ts +13 -5
- package/lib/rootConfig/mobile/MobileModal.js +38 -9
- package/lib/rootConfig/mobile/MobilePopover.d.ts +5 -0
- package/lib/rootConfig/mobile/MobilePopover.js +31 -2
- package/lib/rootConfig/mobile/page.d.ts +25 -5
- package/lib/rootConfig/mobile/page.js +70 -10
- package/lib/rootConfig/pc/BusiComp.d.ts +4 -0
- package/lib/rootConfig/pc/BusiComp.js +64 -3
- package/lib/rootConfig/pc/Drawer.d.ts +12 -0
- package/lib/rootConfig/pc/Drawer.js +68 -2
- package/lib/rootConfig/pc/Modal.d.ts +6 -0
- package/lib/rootConfig/pc/Modal.js +62 -2
- package/lib/rootConfig/pc/Popover.d.ts +5 -0
- package/lib/rootConfig/pc/Popover.js +58 -2
- package/lib/rootConfig/pc/page.d.ts +25 -10
- package/lib/rootConfig/pc/page.js +103 -15
- package/lib/rootConfig/todoActionList.d.ts +170 -50
- package/lib/rootConfig/todoActionList.js +221 -70
- package/lib/rootConfig/todoOptionList.d.ts +38 -6
- package/lib/rootConfig/todoOptionList.js +44 -6
- package/lib/security/encipher/sign.js +9 -1
- package/lib/security/encipher/token.d.ts +3 -0
- package/lib/security/encipher/token.js +38 -0
- package/lib/security/index.d.ts +2 -0
- package/lib/security/index.js +4 -1
- package/lib/theme/bin/default/modalWidth.js +15 -0
- package/lib/theme/bin/default/theme.js +282 -207
- package/lib/theme/bin/default/theme.less +282 -207
- package/lib/theme/bin/default/theme.scss +282 -207
- package/lib/theme/build.js +9 -0
- package/lib/theme/src/default/index.js +169 -61
- package/lib/theme/utils/renderColors.js +13 -2
- package/lib/utils/cookieUtil.js +43 -0
- package/package.json +1 -1
- package/es/dealDsl/events/actionObj.d.ts +0 -3
- package/es/dealDsl/events/actionObj.js +0 -6
- package/es/dealDsl/events/index.d.ts +0 -6
- package/es/dealDsl/events/index.js +0 -14
- package/es/dealDsl/preprocess/editor.d.ts +0 -9
- package/es/dealDsl/preprocess/editor.js +0 -21
- package/es/dealDsl/preprocess/engine.d.ts +0 -9
- package/es/dealDsl/preprocess/engine.js +0 -19
- package/es/theme/bin/cucc/theme.js +0 -275
- package/es/theme/bin/cucc/theme.less +0 -272
- package/es/theme/bin/cucc/theme.scss +0 -272
- package/es/theme/src/cucc/index.js +0 -131
- package/lib/dealDsl/events/actionObj.d.ts +0 -3
- package/lib/dealDsl/events/actionObj.js +0 -13
- package/lib/dealDsl/events/index.d.ts +0 -6
- package/lib/dealDsl/events/index.js +0 -21
- package/lib/dealDsl/preprocess/editor.d.ts +0 -9
- package/lib/dealDsl/preprocess/editor.js +0 -28
- package/lib/dealDsl/preprocess/engine.d.ts +0 -9
- package/lib/dealDsl/preprocess/engine.js +0 -26
- package/lib/theme/bin/cucc/theme.js +0 -277
- package/lib/theme/bin/cucc/theme.less +0 -272
- package/lib/theme/bin/cucc/theme.scss +0 -272
- package/lib/theme/src/cucc/index.js +0 -133
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _Notification = _interopRequireWildcard(require("../Notification"));
|
|
9
|
+
var _compUtils = require("../../compUtils");
|
|
9
10
|
var _Drawer = require("../Drawer");
|
|
10
11
|
var _http = _interopRequireDefault(require("../../http"));
|
|
11
12
|
var _const = require("../../const");
|
|
@@ -14,6 +15,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
17
|
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; }
|
|
18
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
19
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
24
|
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); } }
|
|
18
25
|
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); }); }; }
|
|
19
26
|
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; }
|
|
@@ -26,6 +33,11 @@ var isElm = function isElm(val) {
|
|
|
26
33
|
return ['number', 'string'].includes(_typeof(val)) || /*#__PURE__*/(0, _react.isValidElement)(val);
|
|
27
34
|
};
|
|
28
35
|
var emptyTxt = '暂无匹配信息,请联系平台管理员';
|
|
36
|
+
var defaultFeedbackUrl = process.env.LingXi_ERROR_FEEBACK_URL || (0, _compUtils.resolveRequestPath)('/portal/IssueFeedback/addUserIssueFeedback');
|
|
37
|
+
var feedbackPlacements = ['notification', 'drawer'];
|
|
38
|
+
var feedbackTxts = ['故障上报', '故障已上报', '故障上报中...'];
|
|
39
|
+
var targetTypes = ['request', 'dom', 'event'];
|
|
40
|
+
var btnDisableClass = ['lx-notification-btn-disabled', 'lx-drawer-btn-disabled'];
|
|
29
41
|
var getInstance = function getInstance(placement) {
|
|
30
42
|
return _Notification.notificationInstance["lx-notification-root ".concat(placement)];
|
|
31
43
|
};
|
|
@@ -109,34 +121,154 @@ var ErrorMsg = {
|
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
}
|
|
112
|
-
|
|
113
124
|
// 打开错误提示
|
|
114
125
|
_Notification.default.open(_objectSpread({
|
|
115
126
|
title: renderTitle(msg),
|
|
116
127
|
code: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
117
128
|
content: msg === null || msg === void 0 ? void 0 : msg.msg,
|
|
118
129
|
footer: function () {
|
|
119
|
-
var _footer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
130
|
+
var _footer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_param) {
|
|
120
131
|
var _msg$resolve;
|
|
121
|
-
var resolve, _ref,
|
|
122
|
-
return _regeneratorRuntime().wrap(function
|
|
132
|
+
var resolve, _opts$feebackAction, feebackAction, _ref, _ref$target, target, resMsg, stack, footerContent, loadingStates, mapFeebackTxt, feedbackLoading, feedbackUrl, isShowFeedback, pageUrl, getDes, feedbackParams, feebackReturn, handleLoading, handleFeeback, renderTxt, renderDisabled;
|
|
133
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
123
134
|
while (1) {
|
|
124
|
-
switch (
|
|
135
|
+
switch (_context3.prev = _context3.next) {
|
|
125
136
|
case 0:
|
|
126
|
-
|
|
137
|
+
_context3.next = 2;
|
|
127
138
|
return (_msg$resolve = msg === null || msg === void 0 ? void 0 : msg.resolve) !== null && _msg$resolve !== void 0 ? _msg$resolve : opts.resolve;
|
|
128
139
|
case 2:
|
|
129
|
-
resolve =
|
|
130
|
-
|
|
140
|
+
resolve = _context3.sent;
|
|
141
|
+
_opts$feebackAction = opts.feebackAction, feebackAction = _opts$feebackAction === void 0 ? false : _opts$feebackAction;
|
|
142
|
+
_ref = msg || {}, _ref$target = _ref.target, target = _ref$target === void 0 ? {} : _ref$target, resMsg = _ref.msg, stack = _ref.stack;
|
|
131
143
|
footerContent = [];
|
|
132
|
-
|
|
144
|
+
loadingStates = ['loading', 'finish'];
|
|
145
|
+
mapFeebackTxt = {
|
|
146
|
+
loading: feedbackTxts[2],
|
|
147
|
+
finish: feedbackTxts[1]
|
|
148
|
+
}; // 故障上报loading
|
|
149
|
+
feedbackLoading = ''; // 故障上报地址
|
|
150
|
+
feedbackUrl = defaultFeedbackUrl; // 是否显示故障上报
|
|
151
|
+
isShowFeedback = true; // 页面请求路径
|
|
152
|
+
pageUrl = window.location.href;
|
|
153
|
+
getDes = "<h3>\u9875\u9762\u8BF7\u6C42\u8DEF\u5F84<h3><p>".concat(pageUrl, "</p><h3>\u63A5\u53E3\u8BF7\u6C42\u8DEF\u5F84<h3><p>").concat(target === null || target === void 0 ? void 0 : target.id, "</p><h3>\u63A5\u53E3\u8FD4\u56DE\u62A5\u6587<h3><p>").concat(resMsg, " ").concat(stack, "</p>"); // 故障上报数据
|
|
154
|
+
feedbackParams = {
|
|
155
|
+
feedbackType: '5000',
|
|
156
|
+
feedbackProductType: '5000',
|
|
157
|
+
feedbackTitle: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
158
|
+
feedbackContent: JSON.stringify({
|
|
159
|
+
target: target,
|
|
160
|
+
description: getDes
|
|
161
|
+
})
|
|
162
|
+
};
|
|
163
|
+
if (typeof feebackAction === 'boolean' && !feebackAction) {
|
|
164
|
+
isShowFeedback = false;
|
|
165
|
+
}
|
|
166
|
+
if (typeof feebackAction === 'string' && feebackAction) {
|
|
167
|
+
feedbackUrl = feebackAction;
|
|
168
|
+
}
|
|
169
|
+
if (!(typeof feebackAction === 'function')) {
|
|
170
|
+
_context3.next = 21;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
_context3.next = 19;
|
|
174
|
+
return feebackAction(_objectSpread({}, feedbackParams));
|
|
175
|
+
case 19:
|
|
176
|
+
feebackReturn = _context3.sent;
|
|
177
|
+
if (!feebackReturn) {
|
|
178
|
+
isShowFeedback = false;
|
|
179
|
+
} else {
|
|
180
|
+
feedbackUrl = feebackReturn === null || feebackReturn === void 0 ? void 0 : feebackReturn.url;
|
|
181
|
+
feedbackParams = feebackReturn === null || feebackReturn === void 0 ? void 0 : feebackReturn.payload;
|
|
182
|
+
}
|
|
183
|
+
case 21:
|
|
184
|
+
handleLoading = function handleLoading(_key, _state) {
|
|
185
|
+
var _error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
186
|
+
var getAllList = _Notification.default.getOpenList().map(function (v) {
|
|
187
|
+
if (String(v.itemKey) === String(_key)) {
|
|
188
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
189
|
+
feedbackState: _state ? loadingStates[0] : loadingStates[1]
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return v;
|
|
193
|
+
});
|
|
194
|
+
_Notification.default.setOpenList(_toConsumableArray(getAllList));
|
|
195
|
+
var feedbackDrawerDom = document.getElementById("lx-feedback-drawer-".concat(_key));
|
|
196
|
+
if (feedbackDrawerDom) {
|
|
197
|
+
feedbackDrawerDom.innerHTML = _state ? feedbackTxts[2] : feedbackTxts[1];
|
|
198
|
+
feedbackDrawerDom.classList.add(btnDisableClass[1]);
|
|
199
|
+
if (_error) {
|
|
200
|
+
feedbackDrawerDom.innerHTML = feedbackTxts[0];
|
|
201
|
+
feedbackDrawerDom.classList.remove(btnDisableClass[1]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
feedbackLoading = _state ? loadingStates[0] : loadingStates[1];
|
|
205
|
+
if (_error) {
|
|
206
|
+
feedbackLoading = '';
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
handleFeeback = (0, _compUtils.debounce)( /*#__PURE__*/function () {
|
|
210
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(flag, elKey) {
|
|
211
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
212
|
+
while (1) {
|
|
213
|
+
switch (_context.prev = _context.next) {
|
|
214
|
+
case 0:
|
|
215
|
+
_context.prev = 0;
|
|
216
|
+
_context.next = 3;
|
|
217
|
+
return _http.default.post(feedbackUrl, {
|
|
218
|
+
data: _objectSpread({}, feedbackParams)
|
|
219
|
+
});
|
|
220
|
+
case 3:
|
|
221
|
+
handleLoading(elKey, false);
|
|
222
|
+
_context.next = 10;
|
|
223
|
+
break;
|
|
224
|
+
case 6:
|
|
225
|
+
_context.prev = 6;
|
|
226
|
+
_context.t0 = _context["catch"](0);
|
|
227
|
+
handleLoading(elKey, false, true);
|
|
228
|
+
// eslint-disable-next-line no-console
|
|
229
|
+
console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u6545\u969C\u4E0A\u62A5\u5931\u8D25\uFF0C".concat(_context.t0)));
|
|
230
|
+
case 10:
|
|
231
|
+
case "end":
|
|
232
|
+
return _context.stop();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}, _callee, null, [[0, 6]]);
|
|
236
|
+
}));
|
|
237
|
+
return function (_x2, _x3) {
|
|
238
|
+
return _ref2.apply(this, arguments);
|
|
239
|
+
};
|
|
240
|
+
}(), 400);
|
|
241
|
+
renderTxt = function renderTxt(_state) {
|
|
242
|
+
if (_state) {
|
|
243
|
+
return _state === loadingStates[0] ? feedbackTxts[2] : feedbackTxts[1];
|
|
244
|
+
}
|
|
245
|
+
return feedbackTxts[0];
|
|
246
|
+
};
|
|
247
|
+
renderDisabled = function renderDisabled(flag, _key) {
|
|
248
|
+
if (_param.feedbackState) {
|
|
249
|
+
return flag === feedbackPlacements[0] ? btnDisableClass[0] : btnDisableClass[1];
|
|
250
|
+
}
|
|
251
|
+
if (flag === feedbackPlacements[1] && feedbackLoading) {
|
|
252
|
+
var feedbackDrawerDom = document.getElementById("lx-feedback-drawer-".concat(_key));
|
|
253
|
+
if (feedbackDrawerDom) {
|
|
254
|
+
feedbackDrawerDom.innerHTML = feedbackLoading === loadingStates[0] ? feedbackTxts[2] : feedbackTxts[1];
|
|
255
|
+
}
|
|
256
|
+
return btnDisableClass[1];
|
|
257
|
+
}
|
|
258
|
+
return '';
|
|
259
|
+
};
|
|
260
|
+
if (isShowFeedback) {
|
|
133
261
|
footerContent.push( /*#__PURE__*/_react.default.createElement("a", {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
262
|
+
className: "lx-feedback-notification-".concat(_param.itemKey, " ").concat(renderDisabled(feedbackPlacements[0], _param.itemKey)),
|
|
263
|
+
config: String(_param.itemKey),
|
|
264
|
+
onClick: function onClick(e) {
|
|
265
|
+
if (!(_param === null || _param === void 0 ? void 0 : _param.feedbackState)) {
|
|
266
|
+
var getKey = e.target.getAttribute('config');
|
|
267
|
+
handleLoading(getKey, true);
|
|
268
|
+
handleFeeback(feedbackPlacements[0], getKey);
|
|
137
269
|
}
|
|
138
270
|
}
|
|
139
|
-
},
|
|
271
|
+
}, mapFeebackTxt[_param === null || _param === void 0 ? void 0 : _param.feedbackState] || feedbackTxts[0]));
|
|
140
272
|
}
|
|
141
273
|
if (opts.extendFooter) {
|
|
142
274
|
if (typeof opts.footer === 'function') {
|
|
@@ -147,12 +279,12 @@ var ErrorMsg = {
|
|
|
147
279
|
}
|
|
148
280
|
if (resolve) {
|
|
149
281
|
footerContent.push( /*#__PURE__*/_react.default.createElement("a", {
|
|
150
|
-
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
282
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
151
283
|
var _detRes;
|
|
152
|
-
var detRes, url, errMsg;
|
|
153
|
-
return _regeneratorRuntime().wrap(function
|
|
284
|
+
var detRes, url, errMsg, renderSubTitle;
|
|
285
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
154
286
|
while (1) {
|
|
155
|
-
switch (
|
|
287
|
+
switch (_context2.prev = _context2.next) {
|
|
156
288
|
case 0:
|
|
157
289
|
detRes = {};
|
|
158
290
|
if ((resolve === null || resolve === void 0 ? void 0 : resolve.article) || (resolve === null || resolve === void 0 ? void 0 : resolve.extend)) {
|
|
@@ -163,7 +295,7 @@ var ErrorMsg = {
|
|
|
163
295
|
};
|
|
164
296
|
}
|
|
165
297
|
if (!_const.articleMap[msg.code]) {
|
|
166
|
-
|
|
298
|
+
_context2.next = 6;
|
|
167
299
|
break;
|
|
168
300
|
}
|
|
169
301
|
// 网络异常无法获取解决方案,使用内置的
|
|
@@ -171,7 +303,7 @@ var ErrorMsg = {
|
|
|
171
303
|
article: _const.articleMap[msg.code],
|
|
172
304
|
extend: []
|
|
173
305
|
};
|
|
174
|
-
|
|
306
|
+
_context2.next = 21;
|
|
175
307
|
break;
|
|
176
308
|
case 6:
|
|
177
309
|
// 请求后端获取解决方案
|
|
@@ -182,11 +314,11 @@ var ErrorMsg = {
|
|
|
182
314
|
url = resolve.href;
|
|
183
315
|
}
|
|
184
316
|
if (!url) {
|
|
185
|
-
|
|
317
|
+
_context2.next = 20;
|
|
186
318
|
break;
|
|
187
319
|
}
|
|
188
|
-
|
|
189
|
-
|
|
320
|
+
_context2.prev = 8;
|
|
321
|
+
_context2.next = 11;
|
|
190
322
|
return _http.default.get(url, {
|
|
191
323
|
params: {
|
|
192
324
|
errorCode: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
@@ -194,30 +326,36 @@ var ErrorMsg = {
|
|
|
194
326
|
}
|
|
195
327
|
});
|
|
196
328
|
case 11:
|
|
197
|
-
errMsg =
|
|
329
|
+
errMsg = _context2.sent;
|
|
198
330
|
detRes = {
|
|
199
331
|
article: errMsg === null || errMsg === void 0 ? void 0 : errMsg.guidance,
|
|
200
332
|
extend: errMsg === null || errMsg === void 0 ? void 0 : errMsg.errorInfos
|
|
201
333
|
};
|
|
202
|
-
|
|
334
|
+
_context2.next = 18;
|
|
203
335
|
break;
|
|
204
336
|
case 15:
|
|
205
|
-
|
|
206
|
-
|
|
337
|
+
_context2.prev = 15;
|
|
338
|
+
_context2.t0 = _context2["catch"](8);
|
|
207
339
|
// eslint-disable-next-line no-console
|
|
208
|
-
console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u83B7\u53D6\u89E3\u51B3\u65B9\u6848\u5931\u8D25\uFF0C".concat(
|
|
340
|
+
console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u83B7\u53D6\u89E3\u51B3\u65B9\u6848\u5931\u8D25\uFF0C".concat(_context2.t0)));
|
|
209
341
|
case 18:
|
|
210
|
-
|
|
342
|
+
_context2.next = 21;
|
|
211
343
|
break;
|
|
212
344
|
case 20:
|
|
213
345
|
// eslint-disable-next-line no-console
|
|
214
346
|
console.error(new Error('ErrorMsg组件: 无效resolve'));
|
|
215
347
|
case 21:
|
|
348
|
+
renderSubTitle = function renderSubTitle() {
|
|
349
|
+
if (target.type === targetTypes[0] && (target === null || target === void 0 ? void 0 : target.id)) {
|
|
350
|
+
return "\u670D\u52A1\u5730\u5740\uFF1A".concat(target === null || target === void 0 ? void 0 : target.id);
|
|
351
|
+
}
|
|
352
|
+
return null;
|
|
353
|
+
};
|
|
216
354
|
_Drawer.drawerHandel.open({
|
|
217
355
|
title: "".concat(renderTitle(msg), "(").concat((msg === null || msg === void 0 ? void 0 : msg.code) || '', ")"),
|
|
218
356
|
status: 'error',
|
|
219
357
|
mode: 'errorInfo',
|
|
220
|
-
content: msg === null || msg === void 0 ? void 0 : msg.stack,
|
|
358
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (msg === null || msg === void 0 ? void 0 : msg.msg) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, msg.msg, /*#__PURE__*/_react.default.createElement("br", null)) : '', msg === null || msg === void 0 ? void 0 : msg.stack),
|
|
221
359
|
errorInfoProps: {
|
|
222
360
|
tabs: [{
|
|
223
361
|
key: 'article',
|
|
@@ -252,38 +390,43 @@ var ErrorMsg = {
|
|
|
252
390
|
}
|
|
253
391
|
}
|
|
254
392
|
},
|
|
255
|
-
|
|
393
|
+
subTitle: renderSubTitle(),
|
|
394
|
+
footer: isShowFeedback ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("a", {
|
|
256
395
|
className: "lx-drawer-btn",
|
|
257
396
|
onClick: function onClick() {
|
|
258
397
|
_Drawer.drawerHandel.close();
|
|
259
398
|
}
|
|
260
399
|
}, "\u53D6 \u6D88"), /*#__PURE__*/_react.default.createElement("a", {
|
|
261
|
-
className: "lx-drawer-btn lx-drawer-btn-primary",
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
400
|
+
className: "lx-drawer-btn lx-drawer-btn-primary ".concat(renderDisabled(feedbackPlacements[1], _param.itemKey)),
|
|
401
|
+
id: "lx-feedback-drawer-".concat(_param.itemKey),
|
|
402
|
+
config: _param.itemKey,
|
|
403
|
+
onClick: function onClick(e) {
|
|
404
|
+
if (!_param.feedbackState) {
|
|
405
|
+
var getKey = e.target.getAttribute('config');
|
|
406
|
+
handleLoading(getKey, true);
|
|
407
|
+
handleFeeback(feedbackPlacements[1], getKey);
|
|
265
408
|
}
|
|
266
409
|
}
|
|
267
|
-
},
|
|
410
|
+
}, renderTxt(_param.feedbackState))) : null
|
|
268
411
|
});
|
|
269
|
-
case
|
|
412
|
+
case 23:
|
|
270
413
|
case "end":
|
|
271
|
-
return
|
|
414
|
+
return _context2.stop();
|
|
272
415
|
}
|
|
273
416
|
}
|
|
274
|
-
},
|
|
417
|
+
}, _callee2, null, [[8, 15]]);
|
|
275
418
|
}))
|
|
276
419
|
}, "\u5F02\u5E38\u5E2E\u52A9"));
|
|
277
420
|
}
|
|
278
|
-
return
|
|
279
|
-
case
|
|
421
|
+
return _context3.abrupt("return", footerContent);
|
|
422
|
+
case 29:
|
|
280
423
|
case "end":
|
|
281
|
-
return
|
|
424
|
+
return _context3.stop();
|
|
282
425
|
}
|
|
283
426
|
}
|
|
284
|
-
},
|
|
427
|
+
}, _callee3);
|
|
285
428
|
}));
|
|
286
|
-
function footer() {
|
|
429
|
+
function footer(_x) {
|
|
287
430
|
return _footer.apply(this, arguments);
|
|
288
431
|
}
|
|
289
432
|
return footer;
|
|
@@ -21,6 +21,8 @@ var isDomEle = function isDomEle(target) {
|
|
|
21
21
|
};
|
|
22
22
|
var Notice = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
23
23
|
var title = props.title,
|
|
24
|
+
itemKey = props.itemKey,
|
|
25
|
+
feedbackState = props.feedbackState,
|
|
24
26
|
code = props.code,
|
|
25
27
|
extra = props.extra,
|
|
26
28
|
content = props.content,
|
|
@@ -76,6 +78,8 @@ var Notice = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
76
78
|
footer({
|
|
77
79
|
title: title,
|
|
78
80
|
content: content,
|
|
81
|
+
itemKey: itemKey,
|
|
82
|
+
feedbackState: feedbackState,
|
|
79
83
|
handels: {
|
|
80
84
|
stopAutoClose: stopAutoClose,
|
|
81
85
|
autoClose: autoClose,
|
|
@@ -85,7 +89,7 @@ var Notice = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
85
89
|
setFooterContent(els);
|
|
86
90
|
});
|
|
87
91
|
}
|
|
88
|
-
}, []);
|
|
92
|
+
}, [feedbackState]);
|
|
89
93
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
90
94
|
className: "lx-notification-wraper opening",
|
|
91
95
|
ref: ref,
|
|
@@ -14,9 +14,9 @@ var _excluded = ["getContainer", "placement"];
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
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); }
|
|
18
17
|
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; }
|
|
19
18
|
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; }
|
|
19
|
+
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); }
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
22
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -72,6 +72,7 @@ var Notification = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
72
72
|
} else {
|
|
73
73
|
clone.push(_objectSpread(_objectSpread({}, config), {}, {
|
|
74
74
|
key: nowKey,
|
|
75
|
+
itemKey: config.itemKey || String(keyNbr - 1),
|
|
75
76
|
onClose: function onClose() {
|
|
76
77
|
onNoticeClose(nowKey);
|
|
77
78
|
}
|
|
@@ -94,13 +95,18 @@ var Notification = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
94
95
|
},
|
|
95
96
|
getOpenList: function getOpenList() {
|
|
96
97
|
return _toConsumableArray(openListRef.current);
|
|
98
|
+
},
|
|
99
|
+
setOpenList: function setOpenList(_param) {
|
|
100
|
+
setConfigList(_toConsumableArray(_param));
|
|
97
101
|
}
|
|
98
102
|
};
|
|
99
103
|
});
|
|
100
104
|
var renderCfgList = function renderCfgList() {
|
|
101
105
|
if (Array.isArray(configList) && configList.length > 0) {
|
|
102
106
|
return configList.map(function (notice) {
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement(_Notice.default,
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(_Notice.default, _extends({
|
|
108
|
+
itemKey: notice === null || notice === void 0 ? void 0 : notice.itemKey
|
|
109
|
+
}, notice));
|
|
104
110
|
});
|
|
105
111
|
}
|
|
106
112
|
return '';
|
|
@@ -138,7 +144,8 @@ Notification.insert = function () {
|
|
|
138
144
|
open: notification.open,
|
|
139
145
|
close: notification.close,
|
|
140
146
|
destroy: notification.destroy,
|
|
141
|
-
getOpenList: notification.getOpenList
|
|
147
|
+
getOpenList: notification.getOpenList,
|
|
148
|
+
setOpenList: notification.setOpenList
|
|
142
149
|
});
|
|
143
150
|
};
|
|
144
151
|
(0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(Notification, _extends({}, props, {
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
color: rgba(28, 36, 46, 0.85);
|
|
110
110
|
font-size: 14px;
|
|
111
111
|
line-height: 22px;
|
|
112
|
+
word-break: break-all;
|
|
112
113
|
&.max-line {
|
|
113
114
|
display: -webkit-box;
|
|
114
115
|
overflow: hidden;
|
|
@@ -130,8 +131,19 @@
|
|
|
130
131
|
&-footer {
|
|
131
132
|
text-align: right;
|
|
132
133
|
a {
|
|
133
|
-
|
|
134
|
+
display: inline-block;
|
|
135
|
+
padding: 3px 0 2px 14px;
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
}
|
|
139
|
+
|
|
140
|
+
&-btn-disabled {
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
pointer-events: none;
|
|
143
|
+
&,
|
|
144
|
+
&:hover {
|
|
145
|
+
color: rgba(28,36,46,0.75) !important;
|
|
146
|
+
background-color: white !important;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
137
149
|
}
|
|
@@ -17,7 +17,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
17
17
|
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); }); }; }
|
|
18
18
|
var notificationInstance = {};
|
|
19
19
|
exports.notificationInstance = notificationInstance;
|
|
20
|
-
var notificationNbr = 0;
|
|
21
20
|
function getNotificationInstance() {
|
|
22
21
|
return _getNotificationInstance.apply(this, arguments);
|
|
23
22
|
}
|
|
@@ -75,16 +74,10 @@ var ontificationAPI = {
|
|
|
75
74
|
open: function open(_args) {
|
|
76
75
|
getNotificationInstance(_args, function (_ref) {
|
|
77
76
|
var instance = _ref.instance;
|
|
78
|
-
|
|
79
|
-
instance.open(_objectSpread(_objectSpread({}, _args), {}, {
|
|
80
|
-
key: nKey
|
|
81
|
-
}));
|
|
82
|
-
notificationNbr += 1;
|
|
83
|
-
ontificationAPI.key = nKey;
|
|
77
|
+
instance.open(_objectSpread({}, _args));
|
|
84
78
|
});
|
|
85
79
|
},
|
|
86
|
-
close: function close() {
|
|
87
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ontificationAPI.key;
|
|
80
|
+
close: function close(key) {
|
|
88
81
|
Object.keys(notificationInstance).forEach(function (cacheKey) {
|
|
89
82
|
return Promise.resolve(notificationInstance[cacheKey]).then(function (instance) {
|
|
90
83
|
instance.close(key);
|
|
@@ -98,6 +91,12 @@ var ontificationAPI = {
|
|
|
98
91
|
});
|
|
99
92
|
delete notificationInstance[cacheKey];
|
|
100
93
|
});
|
|
94
|
+
},
|
|
95
|
+
getOpenList: function getOpenList() {
|
|
96
|
+
return Object.values(notificationInstance)[0].getOpenList();
|
|
97
|
+
},
|
|
98
|
+
setOpenList: function setOpenList(_arr) {
|
|
99
|
+
return Object.values(notificationInstance)[0].setOpenList(_arr);
|
|
101
100
|
}
|
|
102
101
|
};
|
|
103
102
|
var _default = ontificationAPI;
|
|
@@ -19,7 +19,8 @@ var defaultGlobalConfig = {
|
|
|
19
19
|
extendFooter: null,
|
|
20
20
|
erorrListShowType: 'innerWindow',
|
|
21
21
|
// 'innerWindow' , 'openDrawer'
|
|
22
|
-
resolve: process.env.LingXi_ERROR_RESOLVE || (0, _compUtils.resolveRequestPath)('/lcdp/error/queryErrorInfoByCodeOrMsg')
|
|
22
|
+
resolve: process.env.LingXi_ERROR_RESOLVE || (0, _compUtils.resolveRequestPath)('/lcdp/error/queryErrorInfoByCodeOrMsg'),
|
|
23
|
+
feebackAction: false // 故障上报地址,默认不展示故障上报
|
|
23
24
|
};
|
|
24
25
|
exports.defaultGlobalConfig = defaultGlobalConfig;
|
|
25
26
|
var setGlobalConfig = function setGlobalConfig() {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.debounce = void 0;
|
|
6
7
|
exports.getChildren = getChildren;
|
|
7
8
|
exports.resolveRequestPath = exports.getHttpErrorByCode = void 0;
|
|
8
9
|
var _const = require("./const");
|
|
@@ -49,4 +50,21 @@ var getHttpErrorByCode = function getHttpErrorByCode(code, url, params, response
|
|
|
49
50
|
}
|
|
50
51
|
return null;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
// 防抖
|
|
55
|
+
exports.getHttpErrorByCode = getHttpErrorByCode;
|
|
56
|
+
var debounce = function debounce(_function, delay) {
|
|
57
|
+
var timeout;
|
|
58
|
+
return function () {
|
|
59
|
+
for (var _len = arguments.length, param = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
60
|
+
param[_key] = arguments[_key];
|
|
61
|
+
}
|
|
62
|
+
if (timeout) {
|
|
63
|
+
clearTimeout(timeout);
|
|
64
|
+
}
|
|
65
|
+
timeout = setTimeout(function () {
|
|
66
|
+
_function.apply(void 0, param);
|
|
67
|
+
}, delay);
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
exports.debounce = debounce;
|
|
@@ -91,7 +91,7 @@ var http = {
|
|
|
91
91
|
},
|
|
92
92
|
post: function post(url, cfg) {
|
|
93
93
|
return request(url, _objectSpread({
|
|
94
|
-
body: JSON.stringify(cfg === null || cfg === void 0 ? void 0 : cfg.data),
|
|
94
|
+
body: (cfg === null || cfg === void 0 ? void 0 : cfg.data) instanceof FormData ? cfg === null || cfg === void 0 ? void 0 : cfg.data : JSON.stringify(cfg === null || cfg === void 0 ? void 0 : cfg.data),
|
|
95
95
|
method: 'POST',
|
|
96
96
|
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
97
97
|
'content-type': 'application/json'
|
package/lib/error/index.js
CHANGED
|
@@ -3,12 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "Drawer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Drawer2.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "ErrorMsg", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function get() {
|
|
9
15
|
return _ErrorMsg.default;
|
|
10
16
|
}
|
|
11
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "MobileDrawer", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _Drawer.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
12
24
|
Object.defineProperty(exports, "MobileErrorMsg", {
|
|
13
25
|
enumerable: true,
|
|
14
26
|
get: function get() {
|
|
@@ -29,6 +41,8 @@ Object.defineProperty(exports, "getHttpErrorByCode", {
|
|
|
29
41
|
});
|
|
30
42
|
var _ErrorMsg = _interopRequireDefault(require("./errorDisplay/Web/ErrorMsg"));
|
|
31
43
|
var _ErrorMsg2 = _interopRequireDefault(require("./errorDisplay/Mobile/ErrorMsg"));
|
|
44
|
+
var _Drawer = _interopRequireDefault(require("./errorDisplay/Mobile/Drawer"));
|
|
45
|
+
var _Drawer2 = _interopRequireDefault(require("./errorDisplay/Web/Drawer"));
|
|
32
46
|
var _compUtils = require("./errorDisplay/compUtils");
|
|
33
47
|
var _errorCatch = _interopRequireDefault(require("./errorCatch"));
|
|
34
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import security from './security';
|
|
2
|
-
import { ErrorMsg, MobileErrorMsg, getHttpErrorByCode, errorCatch } from './error';
|
|
2
|
+
import { ErrorMsg, MobileErrorMsg, getHttpErrorByCode, errorCatch, Drawer, MobileDrawer } from './error';
|
|
3
3
|
import { parseUrlExpression } from './utils/url';
|
|
4
4
|
export * from './dealDsl';
|
|
5
5
|
export * from './rootConfig';
|
|
6
6
|
export declare const IconCheckSvg: string;
|
|
7
7
|
export declare const IconNormalCheckSvg: string;
|
|
8
8
|
export declare const IconWebViewErrorSvg: string;
|
|
9
|
-
export { security, ErrorMsg, MobileErrorMsg, getHttpErrorByCode, errorCatch, parseUrlExpression };
|
|
9
|
+
export { security, ErrorMsg, MobileErrorMsg, getHttpErrorByCode, errorCatch, parseUrlExpression, Drawer, MobileDrawer };
|