systemrobotassistant 3.0.8
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.
Potentially problematic release.
This version of systemrobotassistant might be problematic. Click here for more details.
- package/.eslintignore +6 -0
- package/.eslintrc +45 -0
- package/.gitlab-ci.yml +52 -0
- package/.lecprc.ts +76 -0
- package/.yarnrc +1 -0
- package/CHANGELOG.md +114 -0
- package/README.md +14 -0
- package/custom-amd-plugin.ts +46 -0
- package/es/component/answer-itme/index.d.ts +20 -0
- package/es/component/answer-itme/index.d.ts.map +1 -0
- package/es/component/answer-itme/index.js +41 -0
- package/es/component/answer-itme/style.css +35 -0
- package/es/component/data-container/index.d.ts +19 -0
- package/es/component/data-container/index.d.ts.map +1 -0
- package/es/component/data-container/index.js +37 -0
- package/es/component/data-container/style.css +26 -0
- package/es/component/days-tab/index.d.ts +6 -0
- package/es/component/days-tab/index.d.ts.map +1 -0
- package/es/component/days-tab/index.js +119 -0
- package/es/component/days-tab/style.css +43 -0
- package/es/component/days-tab/utils.d.ts +32 -0
- package/es/component/days-tab/utils.d.ts.map +1 -0
- package/es/component/days-tab/utils.js +98 -0
- package/es/component/error-boundary/index.d.ts +2 -0
- package/es/component/error-boundary/index.d.ts.map +1 -0
- package/es/component/error-boundary/index.js +33 -0
- package/es/component/it-notice-modal/columns.d.ts +11 -0
- package/es/component/it-notice-modal/columns.d.ts.map +1 -0
- package/es/component/it-notice-modal/columns.js +108 -0
- package/es/component/it-notice-modal/double-tab.d.ts +6 -0
- package/es/component/it-notice-modal/double-tab.d.ts.map +1 -0
- package/es/component/it-notice-modal/double-tab.js +94 -0
- package/es/component/it-notice-modal/index.d.ts +6 -0
- package/es/component/it-notice-modal/index.d.ts.map +1 -0
- package/es/component/it-notice-modal/index.js +488 -0
- package/es/component/it-notice-modal/server.d.ts +8 -0
- package/es/component/it-notice-modal/server.d.ts.map +1 -0
- package/es/component/it-notice-modal/server.js +43 -0
- package/es/component/it-notice-modal/single-tab.d.ts +6 -0
- package/es/component/it-notice-modal/single-tab.d.ts.map +1 -0
- package/es/component/it-notice-modal/single-tab.js +82 -0
- package/es/component/it-notice-modal/style.css +301 -0
- package/es/component/it-notice-modal/utils.d.ts +2 -0
- package/es/component/it-notice-modal/utils.d.ts.map +1 -0
- package/es/component/it-notice-modal/utils.js +8 -0
- package/es/component/it-notice-tab/index.d.ts +6 -0
- package/es/component/it-notice-tab/index.d.ts.map +1 -0
- package/es/component/it-notice-tab/index.js +206 -0
- package/es/component/it-notice-tab/server.d.ts +3 -0
- package/es/component/it-notice-tab/server.d.ts.map +1 -0
- package/es/component/it-notice-tab/server.js +13 -0
- package/es/component/it-notice-tab/style.css +103 -0
- package/es/component/mail-list-modal/index.d.ts +2 -0
- package/es/component/mail-list-modal/index.d.ts.map +1 -0
- package/es/component/mail-list-modal/index.js +306 -0
- package/es/component/mail-list-modal/server.d.ts +7 -0
- package/es/component/mail-list-modal/server.d.ts.map +1 -0
- package/es/component/mail-list-modal/server.js +38 -0
- package/es/component/mail-list-modal/style.css +132 -0
- package/es/component/myself-chat-card/index.d.ts +15 -0
- package/es/component/myself-chat-card/index.d.ts.map +1 -0
- package/es/component/myself-chat-card/index.js +25 -0
- package/es/component/myself-chat-card/style.css +22 -0
- package/es/component/need-answer/index.d.ts +15 -0
- package/es/component/need-answer/index.d.ts.map +1 -0
- package/es/component/need-answer/index.js +60 -0
- package/es/component/need-answer/style.css +19 -0
- package/es/component/opppsition-chat-card/index.d.ts +11 -0
- package/es/component/opppsition-chat-card/index.d.ts.map +1 -0
- package/es/component/opppsition-chat-card/index.js +25 -0
- package/es/component/opppsition-chat-card/style.css +23 -0
- package/es/component/question-library/index.d.ts +10 -0
- package/es/component/question-library/index.d.ts.map +1 -0
- package/es/component/question-library/index.js +291 -0
- package/es/component/question-library/server.d.ts +4 -0
- package/es/component/question-library/server.d.ts.map +1 -0
- package/es/component/question-library/server.js +19 -0
- package/es/component/question-library/style.css +75 -0
- package/es/component/question-tag/index.d.ts +11 -0
- package/es/component/question-tag/index.d.ts.map +1 -0
- package/es/component/question-tag/index.js +23 -0
- package/es/component/question-tag/style.css +12 -0
- package/es/component/recommend-questions-card/index.d.ts +10 -0
- package/es/component/recommend-questions-card/index.d.ts.map +1 -0
- package/es/component/recommend-questions-card/index.js +104 -0
- package/es/component/recommend-questions-card/style.css +54 -0
- package/es/component/scroll-view/index.d.ts +3 -0
- package/es/component/scroll-view/index.d.ts.map +1 -0
- package/es/component/scroll-view/index.js +2 -0
- package/es/component/scroll-view/scroll-view.d.ts +18 -0
- package/es/component/scroll-view/scroll-view.d.ts.map +1 -0
- package/es/component/scroll-view/scroll-view.js +66 -0
- package/es/component/scroll-view/style.css +34 -0
- package/es/component/tab/index.d.ts +2 -0
- package/es/component/tab/index.d.ts.map +1 -0
- package/es/component/tab/index.js +18 -0
- package/es/component/tab/style.css +26 -0
- package/es/component/tips-answer/index.d.ts +15 -0
- package/es/component/tips-answer/index.d.ts.map +1 -0
- package/es/component/tips-answer/index.js +28 -0
- package/es/component/tips-answer/style.css +10 -0
- package/es/images/expire-robot.svg +16 -0
- package/es/images/pc-invalid.svg +11 -0
- package/es/images/screenshot-5.png +0 -0
- package/es/index.d.ts +92 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +506 -0
- package/es/js/const.d.ts +41 -0
- package/es/js/const.d.ts.map +1 -0
- package/es/js/const.js +46 -0
- package/es/js/gen-render-promise.d.ts +9 -0
- package/es/js/gen-render-promise.d.ts.map +1 -0
- package/es/js/gen-render-promise.js +30 -0
- package/es/js/get-time.d.ts +15 -0
- package/es/js/get-time.d.ts.map +1 -0
- package/es/js/get-time.js +35 -0
- package/es/js/hfc-space.d.ts +16 -0
- package/es/js/hfc-space.d.ts.map +1 -0
- package/es/js/hfc-space.js +71 -0
- package/es/js/render-special.d.ts +16 -0
- package/es/js/render-special.d.ts.map +1 -0
- package/es/js/render-special.js +53 -0
- package/es/js/request/fetch.d.ts +10 -0
- package/es/js/request/fetch.d.ts.map +1 -0
- package/es/js/request/fetch.js +81 -0
- package/es/js/request/request.d.ts +3 -0
- package/es/js/request/request.d.ts.map +1 -0
- package/es/js/request/request.js +63 -0
- package/es/js/showMessage.d.ts +15 -0
- package/es/js/showMessage.d.ts.map +1 -0
- package/es/js/showMessage.js +75 -0
- package/es/js/state-immer.d.ts +3 -0
- package/es/js/state-immer.d.ts.map +1 -0
- package/es/js/state-immer.js +19 -0
- package/es/js/timer-executor.d.ts +3 -0
- package/es/js/timer-executor.d.ts.map +1 -0
- package/es/js/timer-executor.js +83 -0
- package/es/js/to-hfc.d.ts +2 -0
- package/es/js/to-hfc.d.ts.map +1 -0
- package/es/js/to-hfc.js +8 -0
- package/es/js/utils.d.ts +3 -0
- package/es/js/utils.d.ts.map +1 -0
- package/es/js/utils.js +11 -0
- package/es/jsx/chat-modal.d.ts +16 -0
- package/es/jsx/chat-modal.d.ts.map +1 -0
- package/es/jsx/chat-modal.js +268 -0
- package/es/server.d.ts +8 -0
- package/es/server.d.ts.map +1 -0
- package/es/server.js +44 -0
- package/es/style.css +174 -0
- package/lib/component/answer-itme/index.d.ts +20 -0
- package/lib/component/answer-itme/index.d.ts.map +1 -0
- package/lib/component/answer-itme/index.js +51 -0
- package/lib/component/answer-itme/style.css +35 -0
- package/lib/component/data-container/index.d.ts +19 -0
- package/lib/component/data-container/index.d.ts.map +1 -0
- package/lib/component/data-container/index.js +45 -0
- package/lib/component/data-container/style.css +26 -0
- package/lib/component/days-tab/index.d.ts +6 -0
- package/lib/component/days-tab/index.d.ts.map +1 -0
- package/lib/component/days-tab/index.js +129 -0
- package/lib/component/days-tab/style.css +43 -0
- package/lib/component/days-tab/utils.d.ts +32 -0
- package/lib/component/days-tab/utils.d.ts.map +1 -0
- package/lib/component/days-tab/utils.js +110 -0
- package/lib/component/error-boundary/index.d.ts +2 -0
- package/lib/component/error-boundary/index.d.ts.map +1 -0
- package/lib/component/error-boundary/index.js +40 -0
- package/lib/component/it-notice-modal/columns.d.ts +11 -0
- package/lib/component/it-notice-modal/columns.d.ts.map +1 -0
- package/lib/component/it-notice-modal/columns.js +116 -0
- package/lib/component/it-notice-modal/double-tab.d.ts +6 -0
- package/lib/component/it-notice-modal/double-tab.d.ts.map +1 -0
- package/lib/component/it-notice-modal/double-tab.js +104 -0
- package/lib/component/it-notice-modal/index.d.ts +6 -0
- package/lib/component/it-notice-modal/index.d.ts.map +1 -0
- package/lib/component/it-notice-modal/index.js +499 -0
- package/lib/component/it-notice-modal/server.d.ts +8 -0
- package/lib/component/it-notice-modal/server.d.ts.map +1 -0
- package/lib/component/it-notice-modal/server.js +55 -0
- package/lib/component/it-notice-modal/single-tab.d.ts +6 -0
- package/lib/component/it-notice-modal/single-tab.d.ts.map +1 -0
- package/lib/component/it-notice-modal/single-tab.js +92 -0
- package/lib/component/it-notice-modal/style.css +301 -0
- package/lib/component/it-notice-modal/utils.d.ts +2 -0
- package/lib/component/it-notice-modal/utils.d.ts.map +1 -0
- package/lib/component/it-notice-modal/utils.js +15 -0
- package/lib/component/it-notice-tab/index.d.ts +6 -0
- package/lib/component/it-notice-tab/index.d.ts.map +1 -0
- package/lib/component/it-notice-tab/index.js +216 -0
- package/lib/component/it-notice-tab/server.d.ts +3 -0
- package/lib/component/it-notice-tab/server.d.ts.map +1 -0
- package/lib/component/it-notice-tab/server.js +20 -0
- package/lib/component/it-notice-tab/style.css +103 -0
- package/lib/component/mail-list-modal/index.d.ts +2 -0
- package/lib/component/mail-list-modal/index.d.ts.map +1 -0
- package/lib/component/mail-list-modal/index.js +316 -0
- package/lib/component/mail-list-modal/server.d.ts +7 -0
- package/lib/component/mail-list-modal/server.d.ts.map +1 -0
- package/lib/component/mail-list-modal/server.js +50 -0
- package/lib/component/mail-list-modal/style.css +132 -0
- package/lib/component/myself-chat-card/index.d.ts +15 -0
- package/lib/component/myself-chat-card/index.d.ts.map +1 -0
- package/lib/component/myself-chat-card/index.js +35 -0
- package/lib/component/myself-chat-card/style.css +22 -0
- package/lib/component/need-answer/index.d.ts +15 -0
- package/lib/component/need-answer/index.d.ts.map +1 -0
- package/lib/component/need-answer/index.js +70 -0
- package/lib/component/need-answer/style.css +19 -0
- package/lib/component/opppsition-chat-card/index.d.ts +11 -0
- package/lib/component/opppsition-chat-card/index.d.ts.map +1 -0
- package/lib/component/opppsition-chat-card/index.js +35 -0
- package/lib/component/opppsition-chat-card/style.css +23 -0
- package/lib/component/question-library/index.d.ts +10 -0
- package/lib/component/question-library/index.d.ts.map +1 -0
- package/lib/component/question-library/index.js +301 -0
- package/lib/component/question-library/server.d.ts +4 -0
- package/lib/component/question-library/server.d.ts.map +1 -0
- package/lib/component/question-library/server.js +27 -0
- package/lib/component/question-library/style.css +75 -0
- package/lib/component/question-tag/index.d.ts +11 -0
- package/lib/component/question-tag/index.d.ts.map +1 -0
- package/lib/component/question-tag/index.js +33 -0
- package/lib/component/question-tag/style.css +12 -0
- package/lib/component/recommend-questions-card/index.d.ts +10 -0
- package/lib/component/recommend-questions-card/index.d.ts.map +1 -0
- package/lib/component/recommend-questions-card/index.js +114 -0
- package/lib/component/recommend-questions-card/style.css +54 -0
- package/lib/component/scroll-view/index.d.ts +3 -0
- package/lib/component/scroll-view/index.d.ts.map +1 -0
- package/lib/component/scroll-view/index.js +10 -0
- package/lib/component/scroll-view/scroll-view.d.ts +18 -0
- package/lib/component/scroll-view/scroll-view.d.ts.map +1 -0
- package/lib/component/scroll-view/scroll-view.js +76 -0
- package/lib/component/scroll-view/style.css +34 -0
- package/lib/component/tab/index.d.ts +2 -0
- package/lib/component/tab/index.d.ts.map +1 -0
- package/lib/component/tab/index.js +28 -0
- package/lib/component/tab/style.css +26 -0
- package/lib/component/tips-answer/index.d.ts +15 -0
- package/lib/component/tips-answer/index.d.ts.map +1 -0
- package/lib/component/tips-answer/index.js +38 -0
- package/lib/component/tips-answer/style.css +10 -0
- package/lib/images/expire-robot.svg +16 -0
- package/lib/images/pc-invalid.svg +11 -0
- package/lib/images/screenshot-5.png +0 -0
- package/lib/index.d.ts +92 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +516 -0
- package/lib/js/const.d.ts +41 -0
- package/lib/js/const.d.ts.map +1 -0
- package/lib/js/const.js +55 -0
- package/lib/js/gen-render-promise.d.ts +9 -0
- package/lib/js/gen-render-promise.d.ts.map +1 -0
- package/lib/js/gen-render-promise.js +37 -0
- package/lib/js/get-time.d.ts +15 -0
- package/lib/js/get-time.d.ts.map +1 -0
- package/lib/js/get-time.js +43 -0
- package/lib/js/hfc-space.d.ts +16 -0
- package/lib/js/hfc-space.d.ts.map +1 -0
- package/lib/js/hfc-space.js +91 -0
- package/lib/js/render-special.d.ts +16 -0
- package/lib/js/render-special.d.ts.map +1 -0
- package/lib/js/render-special.js +61 -0
- package/lib/js/request/fetch.d.ts +10 -0
- package/lib/js/request/fetch.d.ts.map +1 -0
- package/lib/js/request/fetch.js +88 -0
- package/lib/js/request/request.d.ts +3 -0
- package/lib/js/request/request.d.ts.map +1 -0
- package/lib/js/request/request.js +71 -0
- package/lib/js/showMessage.d.ts +15 -0
- package/lib/js/showMessage.d.ts.map +1 -0
- package/lib/js/showMessage.js +83 -0
- package/lib/js/state-immer.d.ts +3 -0
- package/lib/js/state-immer.d.ts.map +1 -0
- package/lib/js/state-immer.js +27 -0
- package/lib/js/timer-executor.d.ts +3 -0
- package/lib/js/timer-executor.d.ts.map +1 -0
- package/lib/js/timer-executor.js +91 -0
- package/lib/js/to-hfc.d.ts +2 -0
- package/lib/js/to-hfc.d.ts.map +1 -0
- package/lib/js/to-hfc.js +14 -0
- package/lib/js/utils.d.ts +3 -0
- package/lib/js/utils.d.ts.map +1 -0
- package/lib/js/utils.js +19 -0
- package/lib/jsx/chat-modal.d.ts +16 -0
- package/lib/jsx/chat-modal.d.ts.map +1 -0
- package/lib/jsx/chat-modal.js +278 -0
- package/lib/server.d.ts +8 -0
- package/lib/server.d.ts.map +1 -0
- package/lib/server.js +58 -0
- package/lib/style.css +174 -0
- package/package.json +57 -0
- package/rct.config.js +8 -0
- package/src/component/answer-itme/index.jsx +64 -0
- package/src/component/answer-itme/style.less +37 -0
- package/src/component/data-container/index.jsx +45 -0
- package/src/component/data-container/style.less +27 -0
- package/src/component/days-tab/index.jsx +114 -0
- package/src/component/days-tab/style.less +55 -0
- package/src/component/days-tab/utils.js +87 -0
- package/src/component/error-boundary/index.jsx +39 -0
- package/src/component/it-notice-modal/columns.js +102 -0
- package/src/component/it-notice-modal/double-tab.jsx +83 -0
- package/src/component/it-notice-modal/index.jsx +404 -0
- package/src/component/it-notice-modal/server.js +43 -0
- package/src/component/it-notice-modal/single-tab.jsx +70 -0
- package/src/component/it-notice-modal/style.less +367 -0
- package/src/component/it-notice-modal/utils.js +8 -0
- package/src/component/it-notice-tab/index.jsx +196 -0
- package/src/component/it-notice-tab/server.js +14 -0
- package/src/component/it-notice-tab/style.less +120 -0
- package/src/component/mail-list-modal/index.jsx +270 -0
- package/src/component/mail-list-modal/server.js +38 -0
- package/src/component/mail-list-modal/style.less +154 -0
- package/src/component/myself-chat-card/index.jsx +27 -0
- package/src/component/myself-chat-card/style.less +30 -0
- package/src/component/need-answer/index.jsx +56 -0
- package/src/component/need-answer/style.less +21 -0
- package/src/component/opppsition-chat-card/index.jsx +25 -0
- package/src/component/opppsition-chat-card/style.less +33 -0
- package/src/component/question-library/index.jsx +316 -0
- package/src/component/question-library/server.js +19 -0
- package/src/component/question-library/style.less +102 -0
- package/src/component/question-tag/index.jsx +27 -0
- package/src/component/question-tag/style.less +15 -0
- package/src/component/recommend-questions-card/index.jsx +111 -0
- package/src/component/recommend-questions-card/style.less +66 -0
- package/src/component/scroll-view/index.js +3 -0
- package/src/component/scroll-view/scroll-view.jsx +74 -0
- package/src/component/scroll-view/style.less +37 -0
- package/src/component/tab/index.jsx +17 -0
- package/src/component/tab/style.less +26 -0
- package/src/component/tips-answer/index.jsx +38 -0
- package/src/component/tips-answer/style.less +11 -0
- package/src/images/expire-robot.svg +16 -0
- package/src/images/pc-invalid.svg +11 -0
- package/src/images/screenshot-5.png +0 -0
- package/src/index.jsx +554 -0
- package/src/js/const.js +48 -0
- package/src/js/gen-render-promise.js +32 -0
- package/src/js/get-time.js +35 -0
- package/src/js/hfc-space.js +91 -0
- package/src/js/render-special.js +64 -0
- package/src/js/request/fetch.js +87 -0
- package/src/js/request/request.js +74 -0
- package/src/js/showMessage.js +81 -0
- package/src/js/state-immer.js +12 -0
- package/src/js/timer-executor.js +37 -0
- package/src/js/to-hfc.js +9 -0
- package/src/js/utils.js +13 -0
- package/src/jsx/chat-modal.jsx +254 -0
- package/src/main.js +1 -0
- package/src/server.js +45 -0
- package/src/style.less +229 -0
- package/test/cases/case-01.assert.js +6 -0
- package/test/cases/case-01.source.jsx +17 -0
- package/test/cases/case-02.assert.js +6 -0
- package/test/cases/case-02.source.jsx +25 -0
- package/test/cases/case-02.style.less +15 -0
- package/test/cases/case-03.source.jsx +69 -0
- package/test/cases/case-03.style.less +3 -0
- package/tsconfig.json +48 -0
- package/typings.d.ts +5 -0
- package/umd/b415d90208c277ba3703.png +0 -0
- package/umd/index.css +1753 -0
- package/umd/index.js +36258 -0
- package/umd/index.min.css +1 -0
- package/umd/index.min.js +657 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _renderSpecial = _interopRequireDefault(require("./render-special"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
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); }
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param {ReactNode} InnerComponent
|
|
14
|
+
* @param {String} name
|
|
15
|
+
* @returns {Promise}
|
|
16
|
+
*/
|
|
17
|
+
var genRenderPromise = (InnerComponent, name, useHistory) => function () {
|
|
18
|
+
var record = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19
|
+
var render = new _renderSpecial.default(name, useHistory);
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
var el = /*#__PURE__*/_react.default.createElement(InnerComponent, _extends({}, record, {
|
|
22
|
+
onOk: res => {
|
|
23
|
+
render.unmountComponentAtNode();
|
|
24
|
+
render = null;
|
|
25
|
+
resolve(res);
|
|
26
|
+
},
|
|
27
|
+
onClose: rej => {
|
|
28
|
+
render.unmountComponentAtNode();
|
|
29
|
+
render = null;
|
|
30
|
+
reject(rej);
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
render.render(el);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var _default = genRenderPromise;
|
|
37
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function getNow(): string;
|
|
2
|
+
/**
|
|
3
|
+
* 获取指定时间的前几天或者后几天
|
|
4
|
+
* @param date 时间 2012-12-12
|
|
5
|
+
* @param day 前几天 如2 或者后几天 如-2
|
|
6
|
+
* @returns {String} 如2012-12-10
|
|
7
|
+
*/
|
|
8
|
+
export function getNextOrPreDate(date: any, day: any): string;
|
|
9
|
+
/**
|
|
10
|
+
* 获取指定时间的当周的周一和周日
|
|
11
|
+
* @param date 时间 2012-12-12
|
|
12
|
+
* @returns {Array} [2012-12-09,2012-12-15]
|
|
13
|
+
*/
|
|
14
|
+
export function getWeekByDate(date: any): any[];
|
|
15
|
+
//# sourceMappingURL=get-time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-time.d.ts","sourceRoot":"","sources":["../../src/js/get-time.js"],"names":[],"mappings":"AAAA,yCAOC;AAED;;;;;GAKG;AACH,8DAOC;AAED;;;;GAIG;AACH,gDAKC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getNow;
|
|
7
|
+
exports.getNextOrPreDate = getNextOrPreDate;
|
|
8
|
+
exports.getWeekByDate = getWeekByDate;
|
|
9
|
+
function getNow() {
|
|
10
|
+
var now = new Date();
|
|
11
|
+
var h = now.getHours();
|
|
12
|
+
h = h < 10 ? `0${h}` : h;
|
|
13
|
+
var m = now.getMinutes();
|
|
14
|
+
m = m < 10 ? `0${m}` : m;
|
|
15
|
+
return `${h}:${m}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 获取指定时间的前几天或者后几天
|
|
20
|
+
* @param date 时间 2012-12-12
|
|
21
|
+
* @param day 前几天 如2 或者后几天 如-2
|
|
22
|
+
* @returns {String} 如2012-12-10
|
|
23
|
+
*/
|
|
24
|
+
function getNextOrPreDate(date, day) {
|
|
25
|
+
var dd = new Date(date);
|
|
26
|
+
dd.setDate(dd.getDate() + day);
|
|
27
|
+
var y = dd.getFullYear();
|
|
28
|
+
var m = dd.getMonth() + 1 < 10 ? `0${dd.getMonth() + 1}` : dd.getMonth() + 1;
|
|
29
|
+
var d = dd.getDate() < 10 ? `0${dd.getDate()}` : dd.getDate();
|
|
30
|
+
return `${y}-${m}-${d}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 获取指定时间的当周的周一和周日
|
|
35
|
+
* @param date 时间 2012-12-12
|
|
36
|
+
* @returns {Array} [2012-12-09,2012-12-15]
|
|
37
|
+
*/
|
|
38
|
+
function getWeekByDate(date) {
|
|
39
|
+
var dt = new Date(date).getDay() === 0 ? 7 : new Date(date).getDay();
|
|
40
|
+
var pre = getNextOrPreDate(date, -dt + 1);
|
|
41
|
+
var next = getNextOrPreDate(date, 7 - dt);
|
|
42
|
+
return [pre, next];
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function setHfcSpace(str: any): void;
|
|
2
|
+
export function getHfcSpace(): any;
|
|
3
|
+
export function setHfcUserName(str: any): void;
|
|
4
|
+
export function getHfcUserName(): any;
|
|
5
|
+
export function setTranslateFn(fn: any): void;
|
|
6
|
+
export function getTranslateFn(): any;
|
|
7
|
+
export function setHfcToken(str: any): void;
|
|
8
|
+
export function getHfcToken(): string | null;
|
|
9
|
+
export function setLocalStorage(obj: any): void;
|
|
10
|
+
export function getLocalStorage(key: any): string | null;
|
|
11
|
+
export function setHfcEnv(str: any): void;
|
|
12
|
+
export function getOrigin(): any;
|
|
13
|
+
export function setTokenInvalidCallback(fn: any): void;
|
|
14
|
+
export function invokeTokenInvalidCallback(res: any): void;
|
|
15
|
+
export function clearAll(): void;
|
|
16
|
+
//# sourceMappingURL=hfc-space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hfc-space.d.ts","sourceRoot":"","sources":["../../src/js/hfc-space.js"],"names":[],"mappings":"AAIA,4CAEC;AAED,mCAEC;AAED,+CAEC;AAED,sCAEC;AAED,8CAEC;AAED,sCAEC;AAID,4CAEC;AAED,6CAEC;AAED,gDAYC;AAED,yDAEC;AAID,0CAEC;AASD,iCAEC;AAID,uDAEC;AAED,2DAIC;AAED,iCAKC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearAll = clearAll;
|
|
7
|
+
exports.getHfcSpace = getHfcSpace;
|
|
8
|
+
exports.getHfcToken = getHfcToken;
|
|
9
|
+
exports.getHfcUserName = getHfcUserName;
|
|
10
|
+
exports.getLocalStorage = getLocalStorage;
|
|
11
|
+
exports.getOrigin = getOrigin;
|
|
12
|
+
exports.getTranslateFn = getTranslateFn;
|
|
13
|
+
exports.invokeTokenInvalidCallback = invokeTokenInvalidCallback;
|
|
14
|
+
exports.setHfcEnv = setHfcEnv;
|
|
15
|
+
exports.setHfcSpace = setHfcSpace;
|
|
16
|
+
exports.setHfcToken = setHfcToken;
|
|
17
|
+
exports.setHfcUserName = setHfcUserName;
|
|
18
|
+
exports.setLocalStorage = setLocalStorage;
|
|
19
|
+
exports.setTokenInvalidCallback = setTokenInvalidCallback;
|
|
20
|
+
exports.setTranslateFn = setTranslateFn;
|
|
21
|
+
var hfcSpace;
|
|
22
|
+
var hfcUserName;
|
|
23
|
+
var translateFn;
|
|
24
|
+
function setHfcSpace(str) {
|
|
25
|
+
hfcSpace = str;
|
|
26
|
+
}
|
|
27
|
+
function getHfcSpace() {
|
|
28
|
+
return hfcSpace;
|
|
29
|
+
}
|
|
30
|
+
function setHfcUserName(str) {
|
|
31
|
+
hfcUserName = str;
|
|
32
|
+
}
|
|
33
|
+
function getHfcUserName() {
|
|
34
|
+
return hfcUserName;
|
|
35
|
+
}
|
|
36
|
+
function setTranslateFn(fn) {
|
|
37
|
+
translateFn = fn;
|
|
38
|
+
}
|
|
39
|
+
function getTranslateFn() {
|
|
40
|
+
return translateFn;
|
|
41
|
+
}
|
|
42
|
+
var setHfcTokenKey = '$$hfc_token';
|
|
43
|
+
function setHfcToken(str) {
|
|
44
|
+
window.localStorage.setItem(setHfcTokenKey, str);
|
|
45
|
+
}
|
|
46
|
+
function getHfcToken() {
|
|
47
|
+
return window.localStorage.getItem(setHfcTokenKey);
|
|
48
|
+
}
|
|
49
|
+
function setLocalStorage(obj) {
|
|
50
|
+
var keyList = Object.keys(obj);
|
|
51
|
+
if (keyList.length > 0) {
|
|
52
|
+
keyList.forEach(key => {
|
|
53
|
+
var value = obj[key];
|
|
54
|
+
if (typeof obj[key] === 'object') {
|
|
55
|
+
value = JSON.stringify(obj[key]);
|
|
56
|
+
}
|
|
57
|
+
window.localStorage.setItem(key, String(value));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function getLocalStorage(key) {
|
|
62
|
+
return window.localStorage.getItem(key);
|
|
63
|
+
}
|
|
64
|
+
var env;
|
|
65
|
+
function setHfcEnv(str) {
|
|
66
|
+
env = str;
|
|
67
|
+
}
|
|
68
|
+
var origin = {
|
|
69
|
+
dev: 'hfc-dev01.dotfashion.cn',
|
|
70
|
+
test: 'hfc-test01.dotfashion.cn',
|
|
71
|
+
sit: 'hfc-sit01.dotfashion.cn',
|
|
72
|
+
online: 'hfc.dotfashion.cn'
|
|
73
|
+
};
|
|
74
|
+
function getOrigin() {
|
|
75
|
+
return origin[env];
|
|
76
|
+
}
|
|
77
|
+
var tokenInvalidCallback;
|
|
78
|
+
function setTokenInvalidCallback(fn) {
|
|
79
|
+
tokenInvalidCallback = fn;
|
|
80
|
+
}
|
|
81
|
+
function invokeTokenInvalidCallback(res) {
|
|
82
|
+
if (typeof tokenInvalidCallback === 'function') {
|
|
83
|
+
tokenInvalidCallback(res);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function clearAll() {
|
|
87
|
+
window.localStorage.removeItem(setHfcTokenKey);
|
|
88
|
+
env = undefined;
|
|
89
|
+
hfcSpace = undefined;
|
|
90
|
+
hfcUserName = undefined;
|
|
91
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default Render;
|
|
2
|
+
declare class Render {
|
|
3
|
+
constructor(name: any, useHistory: any);
|
|
4
|
+
div: HTMLDivElement | null;
|
|
5
|
+
name: any;
|
|
6
|
+
hidden: boolean;
|
|
7
|
+
useHistory: any;
|
|
8
|
+
create(): void;
|
|
9
|
+
remove(): void;
|
|
10
|
+
render(element: any): void;
|
|
11
|
+
unmountComponentAtNode(): void;
|
|
12
|
+
historyListener: any;
|
|
13
|
+
hide(): void;
|
|
14
|
+
show(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=render-special.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-special.d.ts","sourceRoot":"","sources":["../../src/js/render-special.js"],"names":[],"mappings":";AAIA;IACE,wCAUC;IATC,2BAAe;IACf,UAAoC;IACpC,gBAAmB;IACnB,gBAA4B;IAQ9B,eAcC;IAED,eAOC;IAYD,2BAGC;IAED,+BAGC;IAnCG,qBAIE;IAaN,aAGC;IAED,aAGC;CAWF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
8
|
+
var _history = require("history");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var hashHistory = (0, _history.createHashHistory)();
|
|
11
|
+
class Render {
|
|
12
|
+
constructor(name, useHistory) {
|
|
13
|
+
this.div = null;
|
|
14
|
+
this.name = name || 'render-special';
|
|
15
|
+
this.hidden = false;
|
|
16
|
+
this.useHistory = useHistory;
|
|
17
|
+
this.create = this.create.bind(this);
|
|
18
|
+
this.remove = this.remove.bind(this);
|
|
19
|
+
this.render = this.render.bind(this);
|
|
20
|
+
this.unmountComponentAtNode = this.unmountComponentAtNode.bind(this);
|
|
21
|
+
}
|
|
22
|
+
create() {
|
|
23
|
+
this.div = document.createElement('div');
|
|
24
|
+
this.div.setAttribute('tool-element', this.name);
|
|
25
|
+
document.body.appendChild(this.div);
|
|
26
|
+
if (this.hidden) this.div.style.display = 'none';else this.div.style.display = '';
|
|
27
|
+
if (this.useHistory) {
|
|
28
|
+
this.historyListener = hashHistory.listen(() => {
|
|
29
|
+
if (this.div) {
|
|
30
|
+
this.unmountComponentAtNode();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
remove() {
|
|
36
|
+
if (typeof this.historyListener === 'function') {
|
|
37
|
+
this.historyListener();
|
|
38
|
+
this.historyListener = null;
|
|
39
|
+
}
|
|
40
|
+
document.body.removeChild(this.div);
|
|
41
|
+
this.div = null;
|
|
42
|
+
}
|
|
43
|
+
hide() {
|
|
44
|
+
this.hidden = true;
|
|
45
|
+
if (this.div) this.div.style.display = 'none';
|
|
46
|
+
}
|
|
47
|
+
show() {
|
|
48
|
+
this.hidden = false;
|
|
49
|
+
if (this.div) this.div.style.display = '';
|
|
50
|
+
}
|
|
51
|
+
render(element) {
|
|
52
|
+
if (!this.div) this.create();
|
|
53
|
+
_reactDom.default.render(element, this.div);
|
|
54
|
+
}
|
|
55
|
+
unmountComponentAtNode() {
|
|
56
|
+
_reactDom.default.unmountComponentAtNode(this.div);
|
|
57
|
+
this.remove();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
var _default = Render;
|
|
61
|
+
exports.default = _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function checkStatus(response: any, t: any): any;
|
|
2
|
+
/**
|
|
3
|
+
* Requests a URL, returning a promise.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} url The URL we want to request
|
|
6
|
+
* @param {object} [options] The options we want to pass to "fetch"
|
|
7
|
+
* @return {object} An object containing either "data" or "err"
|
|
8
|
+
*/
|
|
9
|
+
export default function request(api: any, options?: object | undefined): object;
|
|
10
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/js/request/fetch.js"],"names":[],"mappings":"AAqBA,wDAUC;AAED;;;;;;GAMG;AACH,yEAFY,MAAM,CAgDjB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.checkStatus = checkStatus;
|
|
7
|
+
exports.default = request;
|
|
8
|
+
var _sheinq = require("sheinq");
|
|
9
|
+
var _shineout = require("shineout");
|
|
10
|
+
var _hfcSpace = require("../hfc-space");
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
var codeMessage = {
|
|
15
|
+
200: '服务器成功返回请求的数据',
|
|
16
|
+
201: '新建或修改数据成功。',
|
|
17
|
+
202: '一个请求已经进入后台排队(异步任务)',
|
|
18
|
+
204: '删除数据成功。',
|
|
19
|
+
400: '发出的请求有错误,服务器没有进行新建或修改数据,的操作。',
|
|
20
|
+
401: '用户没有权限(令牌、用户名、密码错误)。',
|
|
21
|
+
403: '用户得到授权,但是访问是被禁止的。',
|
|
22
|
+
404: '发出的请求针对的是不存在的记录,服务器没有进行操作',
|
|
23
|
+
406: '请求的格式不可得。',
|
|
24
|
+
410: '请求的资源被永久删除,且不会再得到的。',
|
|
25
|
+
422: '当创建一个对象时,发生一个验证错误。',
|
|
26
|
+
500: '服务器发生错误,请检查服务器',
|
|
27
|
+
502: '网关错误,请稍后再试',
|
|
28
|
+
503: '服务不可用,服务器暂时过载或维护',
|
|
29
|
+
504: '网关超时'
|
|
30
|
+
};
|
|
31
|
+
function checkStatus(response, t) {
|
|
32
|
+
if (response.status >= 200 && response.status < 300) {
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
var errortext = t(codeMessage[response.status] || response.statusText);
|
|
36
|
+
// Message.info('网络开小差了哦~')
|
|
37
|
+
var error = new Error(errortext);
|
|
38
|
+
error.name = response.status;
|
|
39
|
+
error.response = response;
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Requests a URL, returning a promise.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} url The URL we want to request
|
|
47
|
+
* @param {object} [options] The options we want to pass to "fetch"
|
|
48
|
+
* @return {object} An object containing either "data" or "err"
|
|
49
|
+
*/
|
|
50
|
+
function request(api, options) {
|
|
51
|
+
// 拼接api
|
|
52
|
+
|
|
53
|
+
// 获取翻译函数
|
|
54
|
+
var translateFn = (0, _hfcSpace.getTranslateFn)();
|
|
55
|
+
function t(str) {
|
|
56
|
+
return translateFn ? translateFn(str) : str;
|
|
57
|
+
}
|
|
58
|
+
var newOptions = _objectSpread({}, options);
|
|
59
|
+
if (newOptions.file && newOptions.method === 'GET') {
|
|
60
|
+
newOptions.headers = _objectSpread({
|
|
61
|
+
Accept: 'application/octet-stream',
|
|
62
|
+
'Content-Type': 'application/octet-stream; charset=utf-8'
|
|
63
|
+
}, newOptions.headers);
|
|
64
|
+
return (0, _sheinq.fetch)(api, newOptions).then(res => {
|
|
65
|
+
if (res.body instanceof ReadableStream) return res.blob();
|
|
66
|
+
_shineout.Message.error(t('文件类型错误!'));
|
|
67
|
+
return null;
|
|
68
|
+
}).catch(e => {
|
|
69
|
+
throw e;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (newOptions.method === 'POST' || newOptions.method === 'PUT') {
|
|
73
|
+
newOptions.headers = _objectSpread({
|
|
74
|
+
Accept: 'application/json',
|
|
75
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
76
|
+
}, newOptions.headers);
|
|
77
|
+
newOptions.body = JSON.stringify(newOptions.body);
|
|
78
|
+
}
|
|
79
|
+
return (0, _sheinq.fetch)(api, newOptions).then(response => checkStatus(response, t)).then(response => {
|
|
80
|
+
if (newOptions.method === 'DELETE' || response.status === 204) {
|
|
81
|
+
return response.text();
|
|
82
|
+
}
|
|
83
|
+
return response.json();
|
|
84
|
+
}).catch(e => ({
|
|
85
|
+
code: -109,
|
|
86
|
+
msg: `${e.name} ${e.response}`
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/js/request/request.js"],"names":[],"mappings":"AA2CA,2FAeC;AAED,kFAaC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = postRequest;
|
|
7
|
+
exports.testPostRequest = testPostRequest;
|
|
8
|
+
var _hfcSpace = require("../hfc-space");
|
|
9
|
+
var _fetch = _interopRequireDefault(require("./fetch"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
var CODE = {
|
|
15
|
+
SUCCESS: '0',
|
|
16
|
+
TOKEN_INVALID: '40000',
|
|
17
|
+
INVALID_SPACE: '50000',
|
|
18
|
+
INVALID_CODE: '21102',
|
|
19
|
+
BAN: '121101',
|
|
20
|
+
UN_VALID: '121102',
|
|
21
|
+
NO_FOUND: '121103'
|
|
22
|
+
};
|
|
23
|
+
var checkCode = (result, api, checkCodedisabled) => {
|
|
24
|
+
// 不检测code
|
|
25
|
+
if (checkCodedisabled) {
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
if (result.code === CODE.SUCCESS) return result;
|
|
29
|
+
if ([CODE.TOKEN_INVALID, CODE.INVALID_SPACE, CODE.INVALID_CODE, CODE.BAN, CODE.UN_VALID, CODE.NO_FOUND].includes(result.code)) {
|
|
30
|
+
// 登录失效回调
|
|
31
|
+
(0, _hfcSpace.invokeTokenInvalidCallback)(result);
|
|
32
|
+
// 登录失效也不弹报错了
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 报错提醒全部干掉吧
|
|
37
|
+
// showMessage((result && result.msg) || '报错了接口')
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
function postRequest(api, condition, checkCodedisabled) {
|
|
41
|
+
var requestApi = `https://${(0, _hfcSpace.getOrigin)()}${api}`;
|
|
42
|
+
var body = _objectSpread({}, condition);
|
|
43
|
+
var hfcSpace = (0, _hfcSpace.getHfcSpace)();
|
|
44
|
+
var headers = {
|
|
45
|
+
'hfc-space': hfcSpace,
|
|
46
|
+
'hfc-token': (0, _hfcSpace.getHfcToken)(),
|
|
47
|
+
language: (0, _hfcSpace.getLocalStorage)(`${hfcSpace}-lang`) || 'CN'
|
|
48
|
+
};
|
|
49
|
+
var defaultOptions = {
|
|
50
|
+
credentials: 'include'
|
|
51
|
+
};
|
|
52
|
+
return (0, _fetch.default)(requestApi, _objectSpread({
|
|
53
|
+
method: 'POST',
|
|
54
|
+
body,
|
|
55
|
+
headers
|
|
56
|
+
}, defaultOptions)).then(result => checkCode(result, requestApi, checkCodedisabled));
|
|
57
|
+
}
|
|
58
|
+
function testPostRequest(api, params, result) {
|
|
59
|
+
// eslint-disable-next-line no-console
|
|
60
|
+
console.log('api', api);
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.log('params', params);
|
|
63
|
+
return new Promise(resolve => {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
resolve({
|
|
66
|
+
code: '0',
|
|
67
|
+
info: result
|
|
68
|
+
});
|
|
69
|
+
}, 1000);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default showMessage;
|
|
2
|
+
/**
|
|
3
|
+
* 一般最后一个才能作为默认参数
|
|
4
|
+
* @funcNmae showMessage
|
|
5
|
+
* @param msg string 消息内容
|
|
6
|
+
* @param isSuccess bool 是否显示toast或dialog
|
|
7
|
+
* @param options.time number 消息持续时间,单位毫秒
|
|
8
|
+
* @param options.cb func 浮窗结束或者点击后的回调方法
|
|
9
|
+
* @param options.onClose 点击蒙层的回调方法
|
|
10
|
+
*/
|
|
11
|
+
declare function showMessage(msg: any, isSuccess?: boolean, options?: {
|
|
12
|
+
time: number;
|
|
13
|
+
cb: () => void;
|
|
14
|
+
}): void;
|
|
15
|
+
//# sourceMappingURL=showMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showMessage.d.ts","sourceRoot":"","sources":["../../src/js/showMessage.js"],"names":[],"mappings":";AA6BA;;;;;;;;GAQG;AACH;;;SAwCC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _shineout = require("shineout");
|
|
8
|
+
/**
|
|
9
|
+
* @cn showMessage
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var noop = () => null;
|
|
13
|
+
class Throttle {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.task = {};
|
|
16
|
+
this.push = key => {
|
|
17
|
+
this.task[key] = Date.now();
|
|
18
|
+
};
|
|
19
|
+
this.pop = key => {
|
|
20
|
+
delete this.task[key];
|
|
21
|
+
};
|
|
22
|
+
this.isRunning = key => this.task.hasOwnProperty(key);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
var throttle = new Throttle();
|
|
26
|
+
var defaultOptions = {
|
|
27
|
+
time: 10000,
|
|
28
|
+
cb: () => {}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 一般最后一个才能作为默认参数
|
|
33
|
+
* @funcNmae showMessage
|
|
34
|
+
* @param msg string 消息内容
|
|
35
|
+
* @param isSuccess bool 是否显示toast或dialog
|
|
36
|
+
* @param options.time number 消息持续时间,单位毫秒
|
|
37
|
+
* @param options.cb func 浮窗结束或者点击后的回调方法
|
|
38
|
+
* @param options.onClose 点击蒙层的回调方法
|
|
39
|
+
*/
|
|
40
|
+
var showMessage = function showMessage(msg) {
|
|
41
|
+
var isSuccess = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
42
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOptions;
|
|
43
|
+
var _options$time = options.time,
|
|
44
|
+
time = _options$time === void 0 ? defaultOptions.time : _options$time;
|
|
45
|
+
var _options$cb = options.cb,
|
|
46
|
+
cb = _options$cb === void 0 ? noop : _options$cb,
|
|
47
|
+
onClose = options.onClose;
|
|
48
|
+
time = isSuccess ? 3000 : time;
|
|
49
|
+
var modal;
|
|
50
|
+
var handle = setTimeout(() => {
|
|
51
|
+
throttle.pop(msg);
|
|
52
|
+
if (modal) modal();
|
|
53
|
+
if (cb) cb();
|
|
54
|
+
}, time);
|
|
55
|
+
if (!throttle.isRunning(msg)) {
|
|
56
|
+
throttle.push(msg);
|
|
57
|
+
if (isSuccess) {
|
|
58
|
+
_shineout.Message.success(msg, time / 1000, {
|
|
59
|
+
hideClose: true
|
|
60
|
+
});
|
|
61
|
+
throttle.pop(msg);
|
|
62
|
+
clearTimeout(handle);
|
|
63
|
+
if (cb) cb();
|
|
64
|
+
} else {
|
|
65
|
+
modal = _shineout.Modal.error({
|
|
66
|
+
title: msg,
|
|
67
|
+
maskClosable: true,
|
|
68
|
+
onOk() {
|
|
69
|
+
throttle.pop(msg);
|
|
70
|
+
clearTimeout(handle);
|
|
71
|
+
if (cb) cb();
|
|
72
|
+
},
|
|
73
|
+
onClose() {
|
|
74
|
+
throttle.pop(msg);
|
|
75
|
+
clearTimeout(handle);
|
|
76
|
+
if (onClose) onClose();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var _default = showMessage;
|
|
83
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-immer.d.ts","sourceRoot":"","sources":["../../src/js/state-immer.js"],"names":[],"mappings":";AAGA,2DAMC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _immer = _interopRequireDefault(require("immer"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
var useStateByImmer = defaultState => {
|
|
17
|
+
var _useState = (0, _react.useState)(defaultState),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
value = _useState2[0],
|
|
20
|
+
updater = _useState2[1];
|
|
21
|
+
return [value, newValue => {
|
|
22
|
+
if (typeof newValue === 'function') return updater((0, _immer.default)(newValue));
|
|
23
|
+
return updater((0, _immer.default)(draftValue => Object.assign(draftValue, newValue)));
|
|
24
|
+
}];
|
|
25
|
+
};
|
|
26
|
+
var _default = useStateByImmer;
|
|
27
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timer-executor.d.ts","sourceRoot":"","sources":["../../src/js/timer-executor.js"],"names":[],"mappings":"AAMe,8DA8Bd"}
|