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
package/lib/style.css
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
.shein-components_systemrobotassistant_renderIconWrapper {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
}
|
|
4
|
+
.shein-components_systemrobotassistant_renderIconWrapper.shein-components_systemrobotassistant_draggableIcon {
|
|
5
|
+
position: fixed;
|
|
6
|
+
}
|
|
7
|
+
.shein-components_systemrobotassistant_iconWrapper {
|
|
8
|
+
position: fixed;
|
|
9
|
+
bottom: 32px;
|
|
10
|
+
right: 32px;
|
|
11
|
+
width: 56px;
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
.shein-components_systemrobotassistant_iconWrapper .shein-components_systemrobotassistant_avatarWrap {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
.shein-components_systemrobotassistant_iconWrapper .shein-components_systemrobotassistant_avatarWrap .shein-components_systemrobotassistant_avatarBorder > img {
|
|
21
|
+
width: 52px;
|
|
22
|
+
height: 52px;
|
|
23
|
+
border-radius: 2px;
|
|
24
|
+
-webkit-user-drag: none;
|
|
25
|
+
}
|
|
26
|
+
.shein-components_systemrobotassistant_iconWrapper .shein-components_systemrobotassistant_avatarWrap > span {
|
|
27
|
+
display: inline-block;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
margin-top: 8px;
|
|
30
|
+
}
|
|
31
|
+
.shein-components_systemrobotassistant_collapseRobotBox {
|
|
32
|
+
width: 30px;
|
|
33
|
+
height: 30px;
|
|
34
|
+
}
|
|
35
|
+
.shein-components_systemrobotassistant_collapseRobotBox .shein-components_systemrobotassistant_collapseIcon {
|
|
36
|
+
font-size: 28px;
|
|
37
|
+
color: #1890FF;
|
|
38
|
+
}
|
|
39
|
+
.shein-components_systemrobotassistant_redDot {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: -12px;
|
|
42
|
+
right: -12px;
|
|
43
|
+
width: 24px;
|
|
44
|
+
height: 24px;
|
|
45
|
+
border-radius: 12px;
|
|
46
|
+
background: red;
|
|
47
|
+
color: #ffffff;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
}
|
|
52
|
+
.shein-components_systemrobotassistant_chatModalWrapper {
|
|
53
|
+
position: fixed;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
width: 440px;
|
|
57
|
+
height: 85vh;
|
|
58
|
+
max-height: 660px;
|
|
59
|
+
background: #ffffff;
|
|
60
|
+
box-shadow: 0px 8px 12px 0px rgba(25, 122, 250, 0.1);
|
|
61
|
+
border: 1px solid #D9D9D9;
|
|
62
|
+
border-radius: 8px;
|
|
63
|
+
word-break: break-all;
|
|
64
|
+
}
|
|
65
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_header {
|
|
66
|
+
position: relative;
|
|
67
|
+
display: flex;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
align-items: center;
|
|
71
|
+
padding: 0 50px 0 20px;
|
|
72
|
+
height: 48px;
|
|
73
|
+
box-shadow: 0px 1px 0px 0px rgba(230, 234, 240, 0.5);
|
|
74
|
+
border-radius: 4px 4px 0px 0px;
|
|
75
|
+
}
|
|
76
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_midlleWrapper {
|
|
77
|
+
height: 100%;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex: 1;
|
|
80
|
+
justify-content: space-around;
|
|
81
|
+
flex-direction: row;
|
|
82
|
+
}
|
|
83
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_tabItem {
|
|
84
|
+
margin-right: 12px;
|
|
85
|
+
flex: 1;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
}
|
|
88
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_tabItem:last-child {
|
|
89
|
+
margin: 0;
|
|
90
|
+
}
|
|
91
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_leftTitle {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
}
|
|
95
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_tabIcon {
|
|
96
|
+
margin-right: 4px;
|
|
97
|
+
}
|
|
98
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_title {
|
|
99
|
+
font-size: 16px;
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
color: #35383d;
|
|
102
|
+
margin-left: 20px;
|
|
103
|
+
}
|
|
104
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_avatarClass {
|
|
105
|
+
width: 55px;
|
|
106
|
+
}
|
|
107
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_suggestion {
|
|
108
|
+
font-size: 12px;
|
|
109
|
+
font-weight: 400;
|
|
110
|
+
color: #FFFFFF;
|
|
111
|
+
}
|
|
112
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_link {
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
font-weight: 400;
|
|
115
|
+
color: #1890FF;
|
|
116
|
+
color: var(--primary-color, #1890FF);
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_link > span {
|
|
120
|
+
margin-right: 2px;
|
|
121
|
+
}
|
|
122
|
+
.shein-components_systemrobotassistant_chatModalWrapper .shein-components_systemrobotassistant_closedIcon {
|
|
123
|
+
position: absolute;
|
|
124
|
+
right: 20px;
|
|
125
|
+
color: #7E848F;
|
|
126
|
+
font-size: 20px;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
.shein-components_systemrobotassistant_chatContentWrapper {
|
|
130
|
+
flex: 1;
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
}
|
|
134
|
+
.shein-components_systemrobotassistant_switch {
|
|
135
|
+
color: #666C7C;
|
|
136
|
+
}
|
|
137
|
+
.shein-components_systemrobotassistant_robotImg {
|
|
138
|
+
width: 64px;
|
|
139
|
+
height: 64px;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
-webkit-user-drag: none;
|
|
142
|
+
box-shadow: 1px 1px 6px 6px rgba(30, 128, 255, 0.1);
|
|
143
|
+
background-image: url('https://assets.dotfashion.cn/unpkg/@shein/static-file@1.0.69/image/pims/help-center/close-eyes.png');
|
|
144
|
+
background-color: #1890FF;
|
|
145
|
+
background-position: center center;
|
|
146
|
+
background-size: cover;
|
|
147
|
+
animation-name: shein-components_systemrobotassistant_robotGif;
|
|
148
|
+
animation-duration: 1.5s;
|
|
149
|
+
animation-timing-function: step-end;
|
|
150
|
+
animation-iteration-count: infinite;
|
|
151
|
+
}
|
|
152
|
+
.shein-components_systemrobotassistant_robotImg.shein-components_systemrobotassistant_expireStatus {
|
|
153
|
+
animation-name: shein-components_systemrobotassistant_none;
|
|
154
|
+
background-image: url('https://assets.dotfashion.cn/unpkg/@shein/static-file@1.0.96/image/hfc/expire-robot.svg');
|
|
155
|
+
box-shadow: unset;
|
|
156
|
+
}
|
|
157
|
+
@keyframes shein-components_systemrobotassistant_robotGif {
|
|
158
|
+
0% {
|
|
159
|
+
background-image: url('https://assets.dotfashion.cn/unpkg/@shein/static-file@1.0.69/image/pims/help-center/open-eyes.png');
|
|
160
|
+
}
|
|
161
|
+
90% {
|
|
162
|
+
background-image: url('https://assets.dotfashion.cn/unpkg/@shein/static-file@1.0.69/image/pims/help-center/close-eyes.png');
|
|
163
|
+
}
|
|
164
|
+
100% {
|
|
165
|
+
background-image: url('https://assets.dotfashion.cn/unpkg/@shein/static-file@1.0.69/image/pims/help-center/open-eyes.png');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
.shein-components_systemrobotassistant_modalMask {
|
|
169
|
+
left: 0;
|
|
170
|
+
top: 0;
|
|
171
|
+
height: 100%;
|
|
172
|
+
width: 100%;
|
|
173
|
+
position: fixed;
|
|
174
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "systemrobotassistant",
|
|
3
|
+
"version": "3.0.8",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"module": "es/index.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"config": {
|
|
8
|
+
"lib": "shein-components"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "npx rct build",
|
|
12
|
+
"test": "npx rct test",
|
|
13
|
+
"doc": "npx rct doc",
|
|
14
|
+
"doc:dev": "npx rct doc --dev",
|
|
15
|
+
"lint": "npx eslint . --ext js,jsx",
|
|
16
|
+
"preinstall": "node src/main.js"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">= 8.0.0"
|
|
20
|
+
},
|
|
21
|
+
"packageManager": "yarn@1.22.9",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@shein/eslint-config": "^1.0.8",
|
|
24
|
+
"@shein/react-component-tool": "^2.1.22",
|
|
25
|
+
"@types/react-dom": "^18.2.7",
|
|
26
|
+
"@types/webpack-sources": "^3.2.0",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
28
|
+
"@typescript-eslint/parser": "^5.48.0",
|
|
29
|
+
"eslint": "^8.31.0",
|
|
30
|
+
"husky": "^1.3.1",
|
|
31
|
+
"lint-staged": "^8.1.3",
|
|
32
|
+
"prop-types": "^15.8.1",
|
|
33
|
+
"react": "^16.8.0",
|
|
34
|
+
"react-dom": "^16.8.0",
|
|
35
|
+
"shineout": "^2.0.4",
|
|
36
|
+
"webpack-sources": "3.2.3"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"prop-types": "*",
|
|
40
|
+
"react": ">=16",
|
|
41
|
+
"react-dom": ">=16",
|
|
42
|
+
"shineout": ">=1"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@shein-bbl/core": "^1.0.0",
|
|
46
|
+
"@shein-components/Ellipsis": "^1.0.27-rc.1",
|
|
47
|
+
"@shein-components/Icon": "^3.1.5",
|
|
48
|
+
"@shein-components/ImagesPreviewer": "^1.5.34",
|
|
49
|
+
"@shein-components/TextButton": "0.0.3",
|
|
50
|
+
"classnames": "^2.3.1",
|
|
51
|
+
"history": "^4.7.2",
|
|
52
|
+
"immer": "^9.0.15",
|
|
53
|
+
"moment": "^2.29.4",
|
|
54
|
+
"react-custom-scrollbars": "^4.2.1",
|
|
55
|
+
"sheinq": "^2.0.8"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/rct.config.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { memo } from 'react'
|
|
2
|
+
import Proptypes from 'prop-types'
|
|
3
|
+
import { toHfc } from '../../js/to-hfc'
|
|
4
|
+
import styles from './style.less'
|
|
5
|
+
|
|
6
|
+
const AnswerItme = memo((props) => {
|
|
7
|
+
const { item, t } = props
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
{item.isHaveAnswer === 0
|
|
11
|
+
? (
|
|
12
|
+
<div>
|
|
13
|
+
<span
|
|
14
|
+
className={styles.otherAnswer}
|
|
15
|
+
>
|
|
16
|
+
{item.answer}
|
|
17
|
+
</span>
|
|
18
|
+
{t('找对接人')}
|
|
19
|
+
{t('寻求帮助')}
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
: (
|
|
23
|
+
<div
|
|
24
|
+
className={styles.answerTitle}
|
|
25
|
+
>
|
|
26
|
+
{t('你问的“{0}?”,找到以下问题:', item.problem)}
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
{
|
|
32
|
+
item.isHaveAnswer !== 0 && item.answerList && item.answerList.map(vo => (
|
|
33
|
+
<div
|
|
34
|
+
key={vo.problemId}
|
|
35
|
+
className={styles.answerContent}
|
|
36
|
+
onClick={() => {
|
|
37
|
+
const url = '/question/answer/'
|
|
38
|
+
const { problemId } = vo
|
|
39
|
+
toHfc(url + problemId)
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
{vo.problemTitle}
|
|
43
|
+
</div>
|
|
44
|
+
))
|
|
45
|
+
}
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
AnswerItme.propTypes = {
|
|
52
|
+
item: Proptypes.shape({
|
|
53
|
+
isHaveAnswer: Proptypes.number,
|
|
54
|
+
problem: Proptypes.string,
|
|
55
|
+
answer: Proptypes.string,
|
|
56
|
+
answerList: Proptypes.arrayOf(Proptypes.shape({
|
|
57
|
+
isHaveAnswer: Proptypes.string,
|
|
58
|
+
problemTitle: Proptypes.string,
|
|
59
|
+
})),
|
|
60
|
+
}),
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export default AnswerItme
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.answerTitle {
|
|
2
|
+
font-size: 14px;
|
|
3
|
+
font-weight: 400;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.answerContent {
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
color: var(--primary-color, #1890FF);
|
|
10
|
+
margin-top: 7px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
color: var(--primary-color, #005AAD);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.otherAnswer {
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
color: #35383D;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.toHfc {
|
|
25
|
+
color: var(--primary-color, #1890FF) ;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.onSeekHlep {
|
|
30
|
+
color: var(--primary-color, #1890FF);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.onDisabled {
|
|
35
|
+
color: #A5ACB8;
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import classnames from 'classnames'
|
|
4
|
+
import { Spin } from 'shineout'
|
|
5
|
+
import Icon from '@shein-components/Icon'
|
|
6
|
+
import styles from './style.less'
|
|
7
|
+
|
|
8
|
+
const cs = classnames.bind(styles)
|
|
9
|
+
|
|
10
|
+
const DataContainer = (props) => {
|
|
11
|
+
const {
|
|
12
|
+
loading, emptyText, className, children,
|
|
13
|
+
} = props
|
|
14
|
+
return (
|
|
15
|
+
<div className={cs(styles.dataContainer, className)}>
|
|
16
|
+
{
|
|
17
|
+
!children || (Array.isArray(children) && !children?.length) ? (
|
|
18
|
+
<div className={styles.emptyCon}>
|
|
19
|
+
<Icon
|
|
20
|
+
name="dataemptying_icon"
|
|
21
|
+
fontSize={200}
|
|
22
|
+
/>
|
|
23
|
+
<div>{emptyText}</div>
|
|
24
|
+
</div>
|
|
25
|
+
) : children
|
|
26
|
+
}
|
|
27
|
+
{
|
|
28
|
+
loading ? (
|
|
29
|
+
<div className={cs(styles.loadingMask)}>
|
|
30
|
+
<Spin size="48px" />
|
|
31
|
+
</div>
|
|
32
|
+
) : null
|
|
33
|
+
}
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
DataContainer.propTypes = {
|
|
39
|
+
loading: PropTypes.bool,
|
|
40
|
+
emptyText: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.element]),
|
|
41
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.element]),
|
|
42
|
+
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default DataContainer
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.dataContainer {
|
|
2
|
+
flex: 1;
|
|
3
|
+
|
|
4
|
+
.emptyCon {
|
|
5
|
+
height: 100%;
|
|
6
|
+
width: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
flex: 1;
|
|
12
|
+
color: var(--primary-color, #1890ff);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.loadingMask {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
background-color: rgba(0, 0, 0, .04);
|
|
26
|
+
z-index: 100;
|
|
27
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import moment from 'moment'
|
|
3
|
+
import classnames from 'classnames'
|
|
4
|
+
import Icon from '@shein-components/Icon'
|
|
5
|
+
import useImmer from '../../js/state-immer'
|
|
6
|
+
import styles from './style.less'
|
|
7
|
+
|
|
8
|
+
const cs = classnames.bind(styles)
|
|
9
|
+
|
|
10
|
+
const defaultState = {
|
|
11
|
+
showData: [],
|
|
12
|
+
// activeDay: '',
|
|
13
|
+
curDate: moment(),
|
|
14
|
+
splitIndex: 0,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const getNextDays = (sourceData, splitIndex) => {
|
|
18
|
+
let index = splitIndex + 3
|
|
19
|
+
let result = sourceData?.slice(index, index + 3)
|
|
20
|
+
const len = sourceData?.length
|
|
21
|
+
if (result?.length < 3 && len > 3) {
|
|
22
|
+
result = sourceData?.slice(len - 3, len)
|
|
23
|
+
index = len - 3
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
data: result,
|
|
27
|
+
index,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const getPrevDays = (sourceData, splitIndex) => {
|
|
32
|
+
let index = splitIndex - 3
|
|
33
|
+
let result = []
|
|
34
|
+
if (index <= 0) {
|
|
35
|
+
index = 0
|
|
36
|
+
result = sourceData?.slice(0, 3)
|
|
37
|
+
} else {
|
|
38
|
+
result = sourceData?.slice(index, splitIndex)
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
data: result,
|
|
42
|
+
index,
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const DaysTab = (props) => {
|
|
47
|
+
const { activeDay, data, t, onChange } = props
|
|
48
|
+
const [state, setState] = useImmer(defaultState)
|
|
49
|
+
const { curDate, showData, splitIndex } = state
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const now = moment()
|
|
53
|
+
setState({
|
|
54
|
+
// activeDay: now.format('YYYY-MM-DD'),
|
|
55
|
+
showData: data?.slice(0, 3),
|
|
56
|
+
curDate: now,
|
|
57
|
+
})
|
|
58
|
+
}, [data])
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className={styles.daysTab}>
|
|
62
|
+
<Icon
|
|
63
|
+
name="arrow-left"
|
|
64
|
+
className={cs(styles.arrowIcon, splitIndex <= 0 && styles.disabledIcon)}
|
|
65
|
+
onClick={() => {
|
|
66
|
+
if (splitIndex <= 0) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
const obj = getPrevDays(data, splitIndex)
|
|
70
|
+
setState({
|
|
71
|
+
showData: obj.data,
|
|
72
|
+
splitIndex: obj.index,
|
|
73
|
+
})
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
<div className={styles.itemWrapper}>
|
|
77
|
+
{
|
|
78
|
+
showData?.map(item => (
|
|
79
|
+
<div
|
|
80
|
+
className={[
|
|
81
|
+
styles.dateItem, activeDay === item.date && styles.active,
|
|
82
|
+
].join(' ')}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
setState({
|
|
85
|
+
activeDay: item.date,
|
|
86
|
+
})
|
|
87
|
+
onChange({ ...item })
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{item.dateStr}
|
|
91
|
+
{item.today ? t('(今天)') : null}
|
|
92
|
+
</div>
|
|
93
|
+
))
|
|
94
|
+
}
|
|
95
|
+
</div>
|
|
96
|
+
<Icon
|
|
97
|
+
name="arrow-right"
|
|
98
|
+
className={cs(styles.arrowIcon, splitIndex + 3 >= data?.length && styles.disabledIcon)}
|
|
99
|
+
onClick={() => {
|
|
100
|
+
if (splitIndex + 3 >= data?.length) {
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
const obj = getNextDays(data, splitIndex)
|
|
104
|
+
setState({
|
|
105
|
+
showData: obj.data,
|
|
106
|
+
splitIndex: obj.index,
|
|
107
|
+
})
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default DaysTab
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@primaryColor: var(--primary-color, #1890FF);
|
|
2
|
+
@grayColor: #7E848F;
|
|
3
|
+
|
|
4
|
+
.daysTab {
|
|
5
|
+
padding: 12px;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: #FFFFFF;
|
|
9
|
+
|
|
10
|
+
.arrowIcon {
|
|
11
|
+
color: @grayColor;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.disabledIcon {
|
|
16
|
+
cursor: not-allowed;
|
|
17
|
+
color: #cccfd6;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.itemWrapper {
|
|
21
|
+
margin: 0 12px;
|
|
22
|
+
// display: grid;
|
|
23
|
+
// grid-template-columns: repeat(auto-fill, minmax(109px, 1fr));
|
|
24
|
+
// grid-column-gap: 8px;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
flex: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dateItem {
|
|
32
|
+
margin-left: 8px;
|
|
33
|
+
width: calc((100% - 16px) / 3);
|
|
34
|
+
height: 32px;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
background: #FFFFFF;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
|
|
42
|
+
&:first-child {
|
|
43
|
+
margin-left: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.active {
|
|
47
|
+
background: #E2F2FF;
|
|
48
|
+
color: @primaryColor;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background: #F3F9FE;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import moment from 'moment'
|
|
2
|
+
|
|
3
|
+
// 获取前n天的日期
|
|
4
|
+
export const getPrevDays = (date, num = 3) => {
|
|
5
|
+
const dates = []
|
|
6
|
+
let day
|
|
7
|
+
for (let i = num; i > 0; i--) {
|
|
8
|
+
day = moment(date).subtract(i, 'days')
|
|
9
|
+
dates.push({
|
|
10
|
+
date: day.format('YYYY-MM-DD'),
|
|
11
|
+
year: day.year(),
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
return dates
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 获取后n天的日期
|
|
18
|
+
export const getNextDays = (date, num = 3) => {
|
|
19
|
+
const dates = []
|
|
20
|
+
let day
|
|
21
|
+
for (let i = 0; i < num; i++) {
|
|
22
|
+
day = moment(date).add(i, 'days')
|
|
23
|
+
dates.push({
|
|
24
|
+
date: day.format('YYYY-MM-DD'),
|
|
25
|
+
year: day.year(),
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
return dates
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 拼接文案
|
|
32
|
+
export const getDayLabel = ({ date, year, curDate }) => {
|
|
33
|
+
const curYear = curDate.year()
|
|
34
|
+
let suffix = ''
|
|
35
|
+
if (moment(curDate).format('YYYY-MM-DD') === moment(date).format('YYYY-MM-DD')) {
|
|
36
|
+
suffix = '(今日)'
|
|
37
|
+
}
|
|
38
|
+
return `${year !== curYear ? `${year}-` : ''}${moment(date).format('MM-DD')}${suffix}`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 获取签n周的日期
|
|
42
|
+
export const getPrevWeeks = (date, num = 3) => {
|
|
43
|
+
const dates = []
|
|
44
|
+
let start
|
|
45
|
+
let end
|
|
46
|
+
for (let i = num; i > 0; i--) {
|
|
47
|
+
start = moment(date).subtract(7 * i, 'days')
|
|
48
|
+
end = moment(start).add(6, 'days')
|
|
49
|
+
const weekIndex = moment(start).isoWeek()
|
|
50
|
+
dates.push({
|
|
51
|
+
start: start.format('YYYY-MM-DD'),
|
|
52
|
+
end: end.format('YYYY-MM-DD'),
|
|
53
|
+
weekIndex,
|
|
54
|
+
year: start.year(),
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
return dates
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 获取后n周的日期
|
|
61
|
+
export const getNextWeeks = (date, num = 3) => {
|
|
62
|
+
const dates = []
|
|
63
|
+
let start
|
|
64
|
+
let end
|
|
65
|
+
for (let i = 0; i < num; i++) {
|
|
66
|
+
start = moment(date).add(7 * (i + 1), 'days')
|
|
67
|
+
end = moment(start).add(6, 'days')
|
|
68
|
+
const weekIndex = moment(start).isoWeek()
|
|
69
|
+
dates.push({
|
|
70
|
+
start: start.format('YYYY-MM-DD'),
|
|
71
|
+
end: end.format('YYYY-MM-DD'),
|
|
72
|
+
weekIndex,
|
|
73
|
+
year: start.year(),
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
return dates
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 拼接文案
|
|
80
|
+
export const getWeekLabel = ({ weekIndex, start, year, curDate }) => {
|
|
81
|
+
const curYear = curDate.year()
|
|
82
|
+
const firstDay = moment(curDate).day(1)
|
|
83
|
+
if (curDate.isoWeek() === weekIndex && year === curYear) return '本周'
|
|
84
|
+
if (firstDay.clone().subtract(7, 'days').format('YYYY-MM-DD') === start) return '上周'
|
|
85
|
+
if (firstDay.clone().add(7, 'days').format('YYYY-MM-DD') === start) return '下周'
|
|
86
|
+
return `${year !== curYear ? year : ''}第${weekIndex}周`
|
|
87
|
+
}
|