@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
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, 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; }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
2
8
|
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); } }
|
|
3
9
|
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
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -7,8 +13,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
7
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
14
|
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); }
|
|
9
15
|
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); }
|
|
16
|
+
/* eslint-disable react/no-unknown-property */
|
|
10
17
|
import React, { isValidElement } from 'react';
|
|
11
18
|
import Notification, { notificationInstance } from '../Notification';
|
|
19
|
+
import { resolveRequestPath, debounce } from '../../compUtils';
|
|
12
20
|
import { drawerHandel } from '../Drawer';
|
|
13
21
|
import http from '../../http';
|
|
14
22
|
import { statusClrMap, errTypeTitMap, articleMap } from '../../const';
|
|
@@ -17,6 +25,11 @@ var isElm = function isElm(val) {
|
|
|
17
25
|
return ['number', 'string'].includes(_typeof(val)) || /*#__PURE__*/isValidElement(val);
|
|
18
26
|
};
|
|
19
27
|
var emptyTxt = '暂无匹配信息,请联系平台管理员';
|
|
28
|
+
var defaultFeedbackUrl = process.env.LingXi_ERROR_FEEBACK_URL || resolveRequestPath('/portal/IssueFeedback/addUserIssueFeedback');
|
|
29
|
+
var feedbackPlacements = ['notification', 'drawer'];
|
|
30
|
+
var feedbackTxts = ['故障上报', '故障已上报', '故障上报中...'];
|
|
31
|
+
var targetTypes = ['request', 'dom', 'event'];
|
|
32
|
+
var btnDisableClass = ['lx-notification-btn-disabled', 'lx-drawer-btn-disabled'];
|
|
20
33
|
var getInstance = function getInstance(placement) {
|
|
21
34
|
return notificationInstance["lx-notification-root ".concat(placement)];
|
|
22
35
|
};
|
|
@@ -100,34 +113,154 @@ var ErrorMsg = {
|
|
|
100
113
|
}
|
|
101
114
|
}
|
|
102
115
|
}
|
|
103
|
-
|
|
104
116
|
// 打开错误提示
|
|
105
117
|
Notification.open(_objectSpread({
|
|
106
118
|
title: renderTitle(msg),
|
|
107
119
|
code: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
108
120
|
content: msg === null || msg === void 0 ? void 0 : msg.msg,
|
|
109
121
|
footer: function () {
|
|
110
|
-
var _footer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
122
|
+
var _footer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_param) {
|
|
111
123
|
var _msg$resolve;
|
|
112
|
-
var resolve, _ref,
|
|
113
|
-
return _regeneratorRuntime().wrap(function
|
|
124
|
+
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;
|
|
125
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
114
126
|
while (1) {
|
|
115
|
-
switch (
|
|
127
|
+
switch (_context3.prev = _context3.next) {
|
|
116
128
|
case 0:
|
|
117
|
-
|
|
129
|
+
_context3.next = 2;
|
|
118
130
|
return (_msg$resolve = msg === null || msg === void 0 ? void 0 : msg.resolve) !== null && _msg$resolve !== void 0 ? _msg$resolve : opts.resolve;
|
|
119
131
|
case 2:
|
|
120
|
-
resolve =
|
|
121
|
-
|
|
132
|
+
resolve = _context3.sent;
|
|
133
|
+
_opts$feebackAction = opts.feebackAction, feebackAction = _opts$feebackAction === void 0 ? false : _opts$feebackAction;
|
|
134
|
+
_ref = msg || {}, _ref$target = _ref.target, target = _ref$target === void 0 ? {} : _ref$target, resMsg = _ref.msg, stack = _ref.stack;
|
|
122
135
|
footerContent = [];
|
|
123
|
-
|
|
136
|
+
loadingStates = ['loading', 'finish'];
|
|
137
|
+
mapFeebackTxt = {
|
|
138
|
+
loading: feedbackTxts[2],
|
|
139
|
+
finish: feedbackTxts[1]
|
|
140
|
+
}; // 故障上报loading
|
|
141
|
+
feedbackLoading = ''; // 故障上报地址
|
|
142
|
+
feedbackUrl = defaultFeedbackUrl; // 是否显示故障上报
|
|
143
|
+
isShowFeedback = true; // 页面请求路径
|
|
144
|
+
pageUrl = window.location.href;
|
|
145
|
+
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>"); // 故障上报数据
|
|
146
|
+
feedbackParams = {
|
|
147
|
+
feedbackType: '5000',
|
|
148
|
+
feedbackProductType: '5000',
|
|
149
|
+
feedbackTitle: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
150
|
+
feedbackContent: JSON.stringify({
|
|
151
|
+
target: target,
|
|
152
|
+
description: getDes
|
|
153
|
+
})
|
|
154
|
+
};
|
|
155
|
+
if (typeof feebackAction === 'boolean' && !feebackAction) {
|
|
156
|
+
isShowFeedback = false;
|
|
157
|
+
}
|
|
158
|
+
if (typeof feebackAction === 'string' && feebackAction) {
|
|
159
|
+
feedbackUrl = feebackAction;
|
|
160
|
+
}
|
|
161
|
+
if (!(typeof feebackAction === 'function')) {
|
|
162
|
+
_context3.next = 21;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
_context3.next = 19;
|
|
166
|
+
return feebackAction(_objectSpread({}, feedbackParams));
|
|
167
|
+
case 19:
|
|
168
|
+
feebackReturn = _context3.sent;
|
|
169
|
+
if (!feebackReturn) {
|
|
170
|
+
isShowFeedback = false;
|
|
171
|
+
} else {
|
|
172
|
+
feedbackUrl = feebackReturn === null || feebackReturn === void 0 ? void 0 : feebackReturn.url;
|
|
173
|
+
feedbackParams = feebackReturn === null || feebackReturn === void 0 ? void 0 : feebackReturn.payload;
|
|
174
|
+
}
|
|
175
|
+
case 21:
|
|
176
|
+
handleLoading = function handleLoading(_key, _state) {
|
|
177
|
+
var _error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
178
|
+
var getAllList = Notification.getOpenList().map(function (v) {
|
|
179
|
+
if (String(v.itemKey) === String(_key)) {
|
|
180
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
181
|
+
feedbackState: _state ? loadingStates[0] : loadingStates[1]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return v;
|
|
185
|
+
});
|
|
186
|
+
Notification.setOpenList(_toConsumableArray(getAllList));
|
|
187
|
+
var feedbackDrawerDom = document.getElementById("lx-feedback-drawer-".concat(_key));
|
|
188
|
+
if (feedbackDrawerDom) {
|
|
189
|
+
feedbackDrawerDom.innerHTML = _state ? feedbackTxts[2] : feedbackTxts[1];
|
|
190
|
+
feedbackDrawerDom.classList.add(btnDisableClass[1]);
|
|
191
|
+
if (_error) {
|
|
192
|
+
feedbackDrawerDom.innerHTML = feedbackTxts[0];
|
|
193
|
+
feedbackDrawerDom.classList.remove(btnDisableClass[1]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
feedbackLoading = _state ? loadingStates[0] : loadingStates[1];
|
|
197
|
+
if (_error) {
|
|
198
|
+
feedbackLoading = '';
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
handleFeeback = debounce( /*#__PURE__*/function () {
|
|
202
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(flag, elKey) {
|
|
203
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
204
|
+
while (1) {
|
|
205
|
+
switch (_context.prev = _context.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
_context.prev = 0;
|
|
208
|
+
_context.next = 3;
|
|
209
|
+
return http.post(feedbackUrl, {
|
|
210
|
+
data: _objectSpread({}, feedbackParams)
|
|
211
|
+
});
|
|
212
|
+
case 3:
|
|
213
|
+
handleLoading(elKey, false);
|
|
214
|
+
_context.next = 10;
|
|
215
|
+
break;
|
|
216
|
+
case 6:
|
|
217
|
+
_context.prev = 6;
|
|
218
|
+
_context.t0 = _context["catch"](0);
|
|
219
|
+
handleLoading(elKey, false, true);
|
|
220
|
+
// eslint-disable-next-line no-console
|
|
221
|
+
console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u6545\u969C\u4E0A\u62A5\u5931\u8D25\uFF0C".concat(_context.t0)));
|
|
222
|
+
case 10:
|
|
223
|
+
case "end":
|
|
224
|
+
return _context.stop();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}, _callee, null, [[0, 6]]);
|
|
228
|
+
}));
|
|
229
|
+
return function (_x2, _x3) {
|
|
230
|
+
return _ref2.apply(this, arguments);
|
|
231
|
+
};
|
|
232
|
+
}(), 400);
|
|
233
|
+
renderTxt = function renderTxt(_state) {
|
|
234
|
+
if (_state) {
|
|
235
|
+
return _state === loadingStates[0] ? feedbackTxts[2] : feedbackTxts[1];
|
|
236
|
+
}
|
|
237
|
+
return feedbackTxts[0];
|
|
238
|
+
};
|
|
239
|
+
renderDisabled = function renderDisabled(flag, _key) {
|
|
240
|
+
if (_param.feedbackState) {
|
|
241
|
+
return flag === feedbackPlacements[0] ? btnDisableClass[0] : btnDisableClass[1];
|
|
242
|
+
}
|
|
243
|
+
if (flag === feedbackPlacements[1] && feedbackLoading) {
|
|
244
|
+
var feedbackDrawerDom = document.getElementById("lx-feedback-drawer-".concat(_key));
|
|
245
|
+
if (feedbackDrawerDom) {
|
|
246
|
+
feedbackDrawerDom.innerHTML = feedbackLoading === loadingStates[0] ? feedbackTxts[2] : feedbackTxts[1];
|
|
247
|
+
}
|
|
248
|
+
return btnDisableClass[1];
|
|
249
|
+
}
|
|
250
|
+
return '';
|
|
251
|
+
};
|
|
252
|
+
if (isShowFeedback) {
|
|
124
253
|
footerContent.push( /*#__PURE__*/React.createElement("a", {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
254
|
+
className: "lx-feedback-notification-".concat(_param.itemKey, " ").concat(renderDisabled(feedbackPlacements[0], _param.itemKey)),
|
|
255
|
+
config: String(_param.itemKey),
|
|
256
|
+
onClick: function onClick(e) {
|
|
257
|
+
if (!(_param === null || _param === void 0 ? void 0 : _param.feedbackState)) {
|
|
258
|
+
var getKey = e.target.getAttribute('config');
|
|
259
|
+
handleLoading(getKey, true);
|
|
260
|
+
handleFeeback(feedbackPlacements[0], getKey);
|
|
128
261
|
}
|
|
129
262
|
}
|
|
130
|
-
},
|
|
263
|
+
}, mapFeebackTxt[_param === null || _param === void 0 ? void 0 : _param.feedbackState] || feedbackTxts[0]));
|
|
131
264
|
}
|
|
132
265
|
if (opts.extendFooter) {
|
|
133
266
|
if (typeof opts.footer === 'function') {
|
|
@@ -138,12 +271,12 @@ var ErrorMsg = {
|
|
|
138
271
|
}
|
|
139
272
|
if (resolve) {
|
|
140
273
|
footerContent.push( /*#__PURE__*/React.createElement("a", {
|
|
141
|
-
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
274
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
142
275
|
var _detRes;
|
|
143
|
-
var detRes, url, errMsg;
|
|
144
|
-
return _regeneratorRuntime().wrap(function
|
|
276
|
+
var detRes, url, errMsg, renderSubTitle;
|
|
277
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
145
278
|
while (1) {
|
|
146
|
-
switch (
|
|
279
|
+
switch (_context2.prev = _context2.next) {
|
|
147
280
|
case 0:
|
|
148
281
|
detRes = {};
|
|
149
282
|
if ((resolve === null || resolve === void 0 ? void 0 : resolve.article) || (resolve === null || resolve === void 0 ? void 0 : resolve.extend)) {
|
|
@@ -154,7 +287,7 @@ var ErrorMsg = {
|
|
|
154
287
|
};
|
|
155
288
|
}
|
|
156
289
|
if (!articleMap[msg.code]) {
|
|
157
|
-
|
|
290
|
+
_context2.next = 6;
|
|
158
291
|
break;
|
|
159
292
|
}
|
|
160
293
|
// 网络异常无法获取解决方案,使用内置的
|
|
@@ -162,7 +295,7 @@ var ErrorMsg = {
|
|
|
162
295
|
article: articleMap[msg.code],
|
|
163
296
|
extend: []
|
|
164
297
|
};
|
|
165
|
-
|
|
298
|
+
_context2.next = 21;
|
|
166
299
|
break;
|
|
167
300
|
case 6:
|
|
168
301
|
// 请求后端获取解决方案
|
|
@@ -173,11 +306,11 @@ var ErrorMsg = {
|
|
|
173
306
|
url = resolve.href;
|
|
174
307
|
}
|
|
175
308
|
if (!url) {
|
|
176
|
-
|
|
309
|
+
_context2.next = 20;
|
|
177
310
|
break;
|
|
178
311
|
}
|
|
179
|
-
|
|
180
|
-
|
|
312
|
+
_context2.prev = 8;
|
|
313
|
+
_context2.next = 11;
|
|
181
314
|
return http.get(url, {
|
|
182
315
|
params: {
|
|
183
316
|
errorCode: msg === null || msg === void 0 ? void 0 : msg.code,
|
|
@@ -185,30 +318,36 @@ var ErrorMsg = {
|
|
|
185
318
|
}
|
|
186
319
|
});
|
|
187
320
|
case 11:
|
|
188
|
-
errMsg =
|
|
321
|
+
errMsg = _context2.sent;
|
|
189
322
|
detRes = {
|
|
190
323
|
article: errMsg === null || errMsg === void 0 ? void 0 : errMsg.guidance,
|
|
191
324
|
extend: errMsg === null || errMsg === void 0 ? void 0 : errMsg.errorInfos
|
|
192
325
|
};
|
|
193
|
-
|
|
326
|
+
_context2.next = 18;
|
|
194
327
|
break;
|
|
195
328
|
case 15:
|
|
196
|
-
|
|
197
|
-
|
|
329
|
+
_context2.prev = 15;
|
|
330
|
+
_context2.t0 = _context2["catch"](8);
|
|
198
331
|
// eslint-disable-next-line no-console
|
|
199
|
-
console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u83B7\u53D6\u89E3\u51B3\u65B9\u6848\u5931\u8D25\uFF0C".concat(
|
|
332
|
+
console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u83B7\u53D6\u89E3\u51B3\u65B9\u6848\u5931\u8D25\uFF0C".concat(_context2.t0)));
|
|
200
333
|
case 18:
|
|
201
|
-
|
|
334
|
+
_context2.next = 21;
|
|
202
335
|
break;
|
|
203
336
|
case 20:
|
|
204
337
|
// eslint-disable-next-line no-console
|
|
205
338
|
console.error(new Error('ErrorMsg组件: 无效resolve'));
|
|
206
339
|
case 21:
|
|
340
|
+
renderSubTitle = function renderSubTitle() {
|
|
341
|
+
if (target.type === targetTypes[0] && (target === null || target === void 0 ? void 0 : target.id)) {
|
|
342
|
+
return "\u670D\u52A1\u5730\u5740\uFF1A".concat(target === null || target === void 0 ? void 0 : target.id);
|
|
343
|
+
}
|
|
344
|
+
return null;
|
|
345
|
+
};
|
|
207
346
|
drawerHandel.open({
|
|
208
347
|
title: "".concat(renderTitle(msg), "(").concat((msg === null || msg === void 0 ? void 0 : msg.code) || '', ")"),
|
|
209
348
|
status: 'error',
|
|
210
349
|
mode: 'errorInfo',
|
|
211
|
-
content: msg === null || msg === void 0 ? void 0 : msg.stack,
|
|
350
|
+
content: /*#__PURE__*/React.createElement(React.Fragment, null, (msg === null || msg === void 0 ? void 0 : msg.msg) ? /*#__PURE__*/React.createElement(React.Fragment, null, msg.msg, /*#__PURE__*/React.createElement("br", null)) : '', msg === null || msg === void 0 ? void 0 : msg.stack),
|
|
212
351
|
errorInfoProps: {
|
|
213
352
|
tabs: [{
|
|
214
353
|
key: 'article',
|
|
@@ -243,38 +382,43 @@ var ErrorMsg = {
|
|
|
243
382
|
}
|
|
244
383
|
}
|
|
245
384
|
},
|
|
246
|
-
|
|
385
|
+
subTitle: renderSubTitle(),
|
|
386
|
+
footer: isShowFeedback ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
247
387
|
className: "lx-drawer-btn",
|
|
248
388
|
onClick: function onClick() {
|
|
249
389
|
drawerHandel.close();
|
|
250
390
|
}
|
|
251
391
|
}, "\u53D6 \u6D88"), /*#__PURE__*/React.createElement("a", {
|
|
252
|
-
className: "lx-drawer-btn lx-drawer-btn-primary",
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
392
|
+
className: "lx-drawer-btn lx-drawer-btn-primary ".concat(renderDisabled(feedbackPlacements[1], _param.itemKey)),
|
|
393
|
+
id: "lx-feedback-drawer-".concat(_param.itemKey),
|
|
394
|
+
config: _param.itemKey,
|
|
395
|
+
onClick: function onClick(e) {
|
|
396
|
+
if (!_param.feedbackState) {
|
|
397
|
+
var getKey = e.target.getAttribute('config');
|
|
398
|
+
handleLoading(getKey, true);
|
|
399
|
+
handleFeeback(feedbackPlacements[1], getKey);
|
|
256
400
|
}
|
|
257
401
|
}
|
|
258
|
-
},
|
|
402
|
+
}, renderTxt(_param.feedbackState))) : null
|
|
259
403
|
});
|
|
260
|
-
case
|
|
404
|
+
case 23:
|
|
261
405
|
case "end":
|
|
262
|
-
return
|
|
406
|
+
return _context2.stop();
|
|
263
407
|
}
|
|
264
408
|
}
|
|
265
|
-
},
|
|
409
|
+
}, _callee2, null, [[8, 15]]);
|
|
266
410
|
}))
|
|
267
411
|
}, "\u5F02\u5E38\u5E2E\u52A9"));
|
|
268
412
|
}
|
|
269
|
-
return
|
|
270
|
-
case
|
|
413
|
+
return _context3.abrupt("return", footerContent);
|
|
414
|
+
case 29:
|
|
271
415
|
case "end":
|
|
272
|
-
return
|
|
416
|
+
return _context3.stop();
|
|
273
417
|
}
|
|
274
418
|
}
|
|
275
|
-
},
|
|
419
|
+
}, _callee3);
|
|
276
420
|
}));
|
|
277
|
-
function footer() {
|
|
421
|
+
function footer(_x) {
|
|
278
422
|
return _footer.apply(this, arguments);
|
|
279
423
|
}
|
|
280
424
|
return footer;
|
|
@@ -12,6 +12,8 @@ var isDomEle = function isDomEle(target) {
|
|
|
12
12
|
};
|
|
13
13
|
var Notice = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
14
|
var title = props.title,
|
|
15
|
+
itemKey = props.itemKey,
|
|
16
|
+
feedbackState = props.feedbackState,
|
|
15
17
|
code = props.code,
|
|
16
18
|
extra = props.extra,
|
|
17
19
|
content = props.content,
|
|
@@ -67,6 +69,8 @@ var Notice = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
67
69
|
footer({
|
|
68
70
|
title: title,
|
|
69
71
|
content: content,
|
|
72
|
+
itemKey: itemKey,
|
|
73
|
+
feedbackState: feedbackState,
|
|
70
74
|
handels: {
|
|
71
75
|
stopAutoClose: stopAutoClose,
|
|
72
76
|
autoClose: autoClose,
|
|
@@ -76,7 +80,7 @@ var Notice = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
76
80
|
setFooterContent(els);
|
|
77
81
|
});
|
|
78
82
|
}
|
|
79
|
-
}, []);
|
|
83
|
+
}, [feedbackState]);
|
|
80
84
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
85
|
className: "lx-notification-wraper opening",
|
|
82
86
|
ref: ref,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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
2
|
var _excluded = ["getContainer", "placement"];
|
|
3
|
-
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); }
|
|
4
3
|
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; }
|
|
5
4
|
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; }
|
|
5
|
+
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); }
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
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; }
|
|
8
8
|
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; }
|
|
@@ -63,6 +63,7 @@ var Notification = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
63
63
|
} else {
|
|
64
64
|
clone.push(_objectSpread(_objectSpread({}, config), {}, {
|
|
65
65
|
key: nowKey,
|
|
66
|
+
itemKey: config.itemKey || String(keyNbr - 1),
|
|
66
67
|
onClose: function onClose() {
|
|
67
68
|
onNoticeClose(nowKey);
|
|
68
69
|
}
|
|
@@ -85,13 +86,18 @@ var Notification = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
85
86
|
},
|
|
86
87
|
getOpenList: function getOpenList() {
|
|
87
88
|
return _toConsumableArray(openListRef.current);
|
|
89
|
+
},
|
|
90
|
+
setOpenList: function setOpenList(_param) {
|
|
91
|
+
setConfigList(_toConsumableArray(_param));
|
|
88
92
|
}
|
|
89
93
|
};
|
|
90
94
|
});
|
|
91
95
|
var renderCfgList = function renderCfgList() {
|
|
92
96
|
if (Array.isArray(configList) && configList.length > 0) {
|
|
93
97
|
return configList.map(function (notice) {
|
|
94
|
-
return /*#__PURE__*/React.createElement(Notice,
|
|
98
|
+
return /*#__PURE__*/React.createElement(Notice, _extends({
|
|
99
|
+
itemKey: notice === null || notice === void 0 ? void 0 : notice.itemKey
|
|
100
|
+
}, notice));
|
|
95
101
|
});
|
|
96
102
|
}
|
|
97
103
|
return '';
|
|
@@ -129,7 +135,8 @@ Notification.insert = function () {
|
|
|
129
135
|
open: notification.open,
|
|
130
136
|
close: notification.close,
|
|
131
137
|
destroy: notification.destroy,
|
|
132
|
-
getOpenList: notification.getOpenList
|
|
138
|
+
getOpenList: notification.getOpenList,
|
|
139
|
+
setOpenList: notification.setOpenList
|
|
133
140
|
});
|
|
134
141
|
};
|
|
135
142
|
render( /*#__PURE__*/React.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
|
}
|
|
@@ -9,7 +9,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
9
9
|
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); }); }; }
|
|
10
10
|
import Notification from './Notification';
|
|
11
11
|
var notificationInstance = {};
|
|
12
|
-
var notificationNbr = 0;
|
|
13
12
|
function getNotificationInstance() {
|
|
14
13
|
return _getNotificationInstance.apply(this, arguments);
|
|
15
14
|
}
|
|
@@ -67,16 +66,10 @@ var ontificationAPI = {
|
|
|
67
66
|
open: function open(_args) {
|
|
68
67
|
getNotificationInstance(_args, function (_ref) {
|
|
69
68
|
var instance = _ref.instance;
|
|
70
|
-
|
|
71
|
-
instance.open(_objectSpread(_objectSpread({}, _args), {}, {
|
|
72
|
-
key: nKey
|
|
73
|
-
}));
|
|
74
|
-
notificationNbr += 1;
|
|
75
|
-
ontificationAPI.key = nKey;
|
|
69
|
+
instance.open(_objectSpread({}, _args));
|
|
76
70
|
});
|
|
77
71
|
},
|
|
78
|
-
close: function close() {
|
|
79
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ontificationAPI.key;
|
|
72
|
+
close: function close(key) {
|
|
80
73
|
Object.keys(notificationInstance).forEach(function (cacheKey) {
|
|
81
74
|
return Promise.resolve(notificationInstance[cacheKey]).then(function (instance) {
|
|
82
75
|
instance.close(key);
|
|
@@ -90,6 +83,12 @@ var ontificationAPI = {
|
|
|
90
83
|
});
|
|
91
84
|
delete notificationInstance[cacheKey];
|
|
92
85
|
});
|
|
86
|
+
},
|
|
87
|
+
getOpenList: function getOpenList() {
|
|
88
|
+
return Object.values(notificationInstance)[0].getOpenList();
|
|
89
|
+
},
|
|
90
|
+
setOpenList: function setOpenList(_arr) {
|
|
91
|
+
return Object.values(notificationInstance)[0].setOpenList(_arr);
|
|
93
92
|
}
|
|
94
93
|
};
|
|
95
94
|
export { notificationInstance };
|
|
@@ -13,8 +13,10 @@ export var defaultGlobalConfig = {
|
|
|
13
13
|
extendFooter: null,
|
|
14
14
|
erorrListShowType: 'innerWindow',
|
|
15
15
|
// 'innerWindow' , 'openDrawer'
|
|
16
|
-
resolve: process.env.LingXi_ERROR_RESOLVE || resolveRequestPath('/lcdp/error/queryErrorInfoByCodeOrMsg')
|
|
16
|
+
resolve: process.env.LingXi_ERROR_RESOLVE || resolveRequestPath('/lcdp/error/queryErrorInfoByCodeOrMsg'),
|
|
17
|
+
feebackAction: false // 故障上报地址,默认不展示故障上报
|
|
17
18
|
};
|
|
19
|
+
|
|
18
20
|
export var setGlobalConfig = function setGlobalConfig() {
|
|
19
21
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
22
|
Object.assign(defaultGlobalConfig, config);
|
|
@@ -41,4 +41,20 @@ var getHttpErrorByCode = function getHttpErrorByCode(code, url, params, response
|
|
|
41
41
|
}
|
|
42
42
|
return null;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
// 防抖
|
|
46
|
+
var debounce = function debounce(_function, delay) {
|
|
47
|
+
var timeout;
|
|
48
|
+
return function () {
|
|
49
|
+
for (var _len = arguments.length, param = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
+
param[_key] = arguments[_key];
|
|
51
|
+
}
|
|
52
|
+
if (timeout) {
|
|
53
|
+
clearTimeout(timeout);
|
|
54
|
+
}
|
|
55
|
+
timeout = setTimeout(function () {
|
|
56
|
+
_function.apply(void 0, param);
|
|
57
|
+
}, delay);
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export { getChildren, resolveRequestPath, getHttpErrorByCode, debounce };
|
|
@@ -85,7 +85,7 @@ var http = {
|
|
|
85
85
|
},
|
|
86
86
|
post: function post(url, cfg) {
|
|
87
87
|
return request(url, _objectSpread({
|
|
88
|
-
body: JSON.stringify(cfg === null || cfg === void 0 ? void 0 : cfg.data),
|
|
88
|
+
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),
|
|
89
89
|
method: 'POST',
|
|
90
90
|
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
91
91
|
'content-type': 'application/json'
|
package/es/error/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import ErrorMsg from './errorDisplay/Web/ErrorMsg';
|
|
2
2
|
import MobileErrorMsg from './errorDisplay/Mobile/ErrorMsg';
|
|
3
|
+
import MobileDrawer from './errorDisplay/Mobile/Drawer';
|
|
4
|
+
import Drawer from './errorDisplay/Web/Drawer';
|
|
3
5
|
import { getHttpErrorByCode } from './errorDisplay/compUtils';
|
|
4
6
|
import errorCatch from './errorCatch';
|
|
5
|
-
export { ErrorMsg, MobileErrorMsg, getHttpErrorByCode, errorCatch };
|
|
7
|
+
export { ErrorMsg, MobileErrorMsg, getHttpErrorByCode, errorCatch, MobileDrawer, Drawer };
|
package/es/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 };
|