@titaui/pc 1.5.82 → 1.5.83
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/lib/components/avatar/icon-avatar/index.css +15 -0
- package/lib/components/avatar/icon-avatar/index.js +50 -0
- package/lib/components/avatar/index.js +9 -1
- package/lib/components/avatar/num-avatar/index.css +12 -0
- package/lib/components/avatar/num-avatar/index.js +34 -0
- package/lib/components/button/admin-button/default.js +35 -0
- package/lib/components/button/admin-button/drop-down-arrow.js +93 -0
- package/lib/components/button/admin-button/index.css +86 -0
- package/lib/components/button/admin-button/index.js +40 -0
- package/lib/components/button/admin-button/primary.js +33 -0
- package/lib/components/button/admin-button/secondary.js +35 -0
- package/lib/components/button/default-button/index.css +49 -0
- package/lib/components/button/default-button/index.js +51 -0
- package/lib/components/button/export-button/index.css +51 -0
- package/lib/components/button/export-button/index.js +81 -0
- package/lib/components/button/images/daoru.svg +18 -0
- package/lib/components/button/index.js +23 -0
- package/lib/components/button/interface.js +5 -0
- package/lib/components/change-okr/Filter.js +133 -65
- package/lib/components/change-okr/Item.js +6 -0
- package/lib/components/change-okr/filterTab.js +2 -0
- package/lib/components/change-okr/index.js +2 -2
- package/lib/components/checkbox/index.js +4 -3
- package/lib/components/communication/CommunicationRecord.js +116 -161
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.css +63 -0
- package/lib/components/communication/index.js +53 -28
- package/lib/components/communication/style.js +21 -25
- package/lib/components/create-okr/animation/check-animation.js +2746 -0
- package/lib/components/create-okr/constant.js +27 -0
- package/lib/components/create-okr/createCycle.js +193 -0
- package/lib/components/create-okr/createSuccessCmp.js +233 -0
- package/lib/components/create-okr/createSuccessCmpWrapper.js +20 -0
- package/lib/components/create-okr/fields/date-cycle.js +98 -0
- package/lib/components/create-okr/fields/index.css +346 -0
- package/lib/components/create-okr/fields/index.js +17 -0
- package/lib/components/create-okr/fields/input-with-err-popup.js +57 -0
- package/lib/components/create-okr/fields/o-new-name.js +197 -0
- package/lib/components/create-okr/fields/okr-case.js +98 -0
- package/lib/components/create-okr/fields/okr-classify.js +51 -0
- package/lib/components/create-okr/fields/okr-create-suggest.js +147 -0
- package/lib/components/create-okr/fields/okr-new-user-selector.js +106 -0
- package/lib/components/create-okr/fields/okr-parent.js +157 -0
- package/lib/components/create-okr/fields/okr-type-detail.js +196 -0
- package/lib/components/create-okr/fields/okr-type.js +131 -0
- package/lib/components/create-okr/fields/okr-visibility-detail.js +224 -0
- package/lib/components/create-okr/fields/okr-visibility.js +169 -0
- package/lib/components/create-okr/img/check-normal.svg +29 -0
- package/lib/components/create-okr/img/check-right.svg +16 -0
- package/lib/components/create-okr/img/check-wrong.svg +29 -0
- package/lib/components/create-okr/img/create-success-head.png +0 -0
- package/lib/components/create-okr/img/create-success-left-quotation.svg +14 -0
- package/lib/components/create-okr/img/create-success-message.svg +1 -0
- package/lib/components/create-okr/img/create-success-right-quotation.svg +14 -0
- package/lib/components/create-okr/img/create-success-shadow.svg +23 -0
- package/lib/components/create-okr/img/example.svg +11 -0
- package/lib/components/create-okr/img/hand.svg +12 -0
- package/lib/components/create-okr/img/kr-add.svg +12 -0
- package/lib/components/create-okr/img/left-quotation.svg +12 -0
- package/lib/components/create-okr/img/light.svg +1 -0
- package/lib/components/create-okr/img/pack-up.js +28 -0
- package/lib/components/create-okr/img/qr-code.png +0 -0
- package/lib/components/create-okr/img/right-quotation.svg +12 -0
- package/lib/components/create-okr/img/shower.png +0 -0
- package/lib/components/create-okr/img/target.svg +19 -0
- package/lib/components/create-okr/img/teach-okr.svg +17 -0
- package/lib/components/create-okr/img/wave.png +0 -0
- package/lib/components/create-okr/img/weight.svg +12 -0
- package/lib/components/create-okr/index.css +446 -0
- package/lib/components/create-okr/index.js +911 -0
- package/lib/components/create-okr/interface.js +5 -0
- package/lib/components/create-okr/kr-items/index.css +180 -0
- package/lib/components/create-okr/kr-items/kr-item-weight.js +194 -0
- package/lib/components/create-okr/kr-items/krDatas.js +299 -0
- package/lib/components/create-okr/kr-items/krItem.js +167 -0
- package/lib/components/create-okr/objectType.js +273 -0
- package/lib/components/create-okr/request-api.js +220 -0
- package/lib/components/create-okr/style.js +100 -0
- package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +124 -0
- package/lib/components/create-okr/utils/helper.js +99 -0
- package/lib/components/create-okr/utils/index.js +23 -0
- package/lib/components/dropdown-layer/icon-item.js +5 -3
- package/lib/components/dropdown-layer/index.css +16 -0
- package/lib/components/dropdown-layer/index.js +21 -14
- package/lib/components/dynamic/components/condition-render/index.js +20 -0
- package/lib/components/dynamic/components/dangerous-html/index.js +22 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.css +78 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.js +192 -0
- package/lib/components/dynamic/components/obj-status/index.css +22 -0
- package/lib/components/dynamic/components/obj-status/index.js +38 -0
- package/lib/components/dynamic/components/percent/index.css +21 -0
- package/lib/components/dynamic/components/percent/index.js +38 -0
- package/lib/components/dynamic/components/title/index.css +35 -0
- package/lib/components/dynamic/components/title/index.js +59 -0
- package/lib/components/dynamic/constant.js +97 -0
- package/lib/components/dynamic/context/index.js +13 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.css +101 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.js +299 -0
- package/lib/components/dynamic/dynamic-item/components/icon/index.css +10 -0
- package/lib/components/dynamic/dynamic-item/components/icon/index.js +35 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +173 -0
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +59 -0
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +107 -0
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +48 -0
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +89 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +96 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +171 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +67 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +110 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +111 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +158 -0
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +215 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +91 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +125 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +192 -0
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +138 -0
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +183 -0
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +153 -0
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +138 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +97 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +207 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +59 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +107 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-cancel.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-delay.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-done.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-pause.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-progress.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unaccept.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unstart.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +111 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +164 -0
- package/lib/components/dynamic/dynamic-item/index.css +128 -0
- package/lib/components/dynamic/dynamic-item/index.js +352 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +23 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +126 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.js +157 -0
- package/lib/components/dynamic/dynamic-like-ranking/item.js +107 -0
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +30 -0
- package/lib/components/dynamic/dynamic-liking/index.css +81 -0
- package/lib/components/dynamic/dynamic-liking/index.js +76 -0
- package/lib/components/dynamic/dynamic-liking/item.js +91 -0
- package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
- package/lib/components/dynamic/dynamic-list/index.css +36 -0
- package/lib/components/dynamic/dynamic-list/index.js +61 -0
- package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +16 -0
- package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +30 -0
- package/lib/components/dynamic/dynamic-topping/index.css +148 -0
- package/lib/components/dynamic/dynamic-topping/index.js +80 -0
- package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
- package/lib/components/dynamic/dynamic-topping/item.js +140 -0
- package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/lib/components/dynamic/dynamic.css +204 -0
- package/lib/components/dynamic/dynamic.js +391 -0
- package/lib/components/dynamic/export-module/index.js +33 -0
- package/lib/components/dynamic/img/dynamic-P1.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P2.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P3.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P4.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P5.svg +15 -0
- package/lib/components/dynamic/img/dynamic-delay.svg +17 -0
- package/lib/components/dynamic/img/dynamic-desire.svg +61 -0
- package/lib/components/dynamic/img/dynamic-empty.png +0 -0
- package/lib/components/dynamic/img/dynamic-end.svg +17 -0
- package/lib/components/dynamic/img/dynamic-left-quoto.svg +13 -0
- package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
- package/lib/components/dynamic/img/dynamic-normal.svg +17 -0
- package/lib/components/dynamic/img/dynamic-promise.svg +61 -0
- package/lib/components/dynamic/img/dynamic-reword.svg +24 -0
- package/lib/components/dynamic/img/dynamic-right-quoto.svg +13 -0
- package/lib/components/dynamic/img/dynamic-risk.svg +17 -0
- package/lib/components/dynamic/img/dynamic-submit-delay.svg +16 -0
- package/lib/components/dynamic/img/dynamic-submit-normal.svg +18 -0
- package/lib/components/dynamic/img/dynamic-top.svg +14 -0
- package/lib/components/dynamic/index.js +27 -0
- package/lib/components/dynamic/interface.js +5 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +37 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +37 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +37 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +42 -0
- package/lib/components/dynamic/quick-operation/img/create-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +51 -0
- package/lib/components/dynamic/quick-operation/index.js +112 -0
- package/lib/components/dynamic/request-api.js +92 -0
- package/lib/components/dynamic/util.js +140 -0
- package/lib/components/emotionsSelector/style.js +1 -1
- package/lib/components/file-list/components/single-file/index.css +84 -0
- package/lib/components/file-list/components/single-file/index.js +115 -0
- package/lib/components/file-list/img/new-file-list-doc.svg +1 -0
- package/lib/components/file-list/img/new-file-list-other.svg +1 -0
- package/lib/components/file-list/img/new-file-list-pdf.svg +1 -0
- package/lib/components/file-list/img/new-file-list-ppt.svg +1 -0
- package/lib/components/file-list/img/new-file-list-radio.svg +1 -0
- package/lib/components/file-list/img/new-file-list-video.svg +1 -0
- package/lib/components/file-list/img/new-file-list-xls.svg +1 -0
- package/lib/components/file-list/index.css +5 -0
- package/lib/components/file-list/index.js +61 -0
- package/lib/components/file-list/interface.js +5 -0
- package/lib/components/file-list/util.js +78 -0
- package/lib/components/form/form-fields/input/index.css +11 -0
- package/lib/components/form/form-fields/input/index.js +3 -1
- package/lib/components/grid-page/image/{Assistant.svg → assistant.svg} +0 -0
- package/lib/components/grid-page/image/{Boss.svg → boss.svg} +0 -0
- package/lib/components/grid-page/image/{Default-background.png → default-background.png} +0 -0
- package/lib/components/grid-page/image/{UserManager.svg → userManager.svg} +0 -0
- package/lib/components/grid-page/personal-info/index.js +5 -5
- package/lib/components/img-viewer/icon/enlarge.js +30 -0
- package/lib/components/img-viewer/icon/left-rotate.js +46 -0
- package/lib/components/img-viewer/icon/right-rotate.js +44 -0
- package/lib/components/img-viewer/icon/shrink.js +37 -0
- package/lib/components/img-viewer/image/loading.gif +0 -0
- package/lib/components/img-viewer/index.css +155 -0
- package/lib/components/img-viewer/index.js +228 -0
- package/lib/components/img-viewer/interface.js +5 -0
- package/lib/components/img-viewer/util.js +16 -0
- package/lib/components/mblog/components/MblogAction.js +10 -6
- package/lib/components/mblog/index.js +24 -11
- package/lib/components/mblog/style.js +8 -8
- package/lib/components/okr-detail/components/header/index.css +4 -0
- package/lib/components/okr-detail/components/header/o-cycle.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +15 -8
- package/lib/components/okr-flow/child-node/work-node.js +7 -1
- package/lib/components/okr-period-selector/select-cycle.js +139 -151
- package/lib/components/okr-progress-detail/index.css +1 -0
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +5 -5
- package/lib/components/okr-review/ReviewPop/index.js +4 -4
- package/lib/components/period-selector/common.js +168 -17
- package/lib/components/period-selector/components/selector/index.js +103 -38
- package/lib/components/period-selector/components/selector/style.js +23 -9
- package/lib/components/period-selector/index.js +29 -28
- package/lib/components/popup/index.js +3 -1
- package/lib/components/publish-dynamic-modal/index.js +13 -0
- package/lib/components/publish-dynamic-modal/interface.js +5 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +3 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +191 -0
- package/lib/components/publish-dynamic-modal/requist-api.js +48 -0
- package/lib/components/radio/index.css +5 -0
- package/lib/components/radio/radio.js +12 -4
- package/lib/components/search-key-handle/index.js +39 -0
- package/lib/components/table/index.css +0 -1
- package/lib/components/upload/components/uploadedPreview.js +62 -54
- package/lib/components/upload/img/doc.svg +1 -0
- package/lib/components/upload/img/other.svg +1 -0
- package/lib/components/upload/img/pdf.svg +1 -0
- package/lib/components/upload/img/ppt.svg +1 -0
- package/lib/components/upload/img/radio.svg +1 -0
- package/lib/components/upload/img/video.svg +1 -0
- package/lib/components/upload/img/xls.svg +1 -0
- package/lib/components/upload/index.css +26 -0
- package/lib/components/upload/index.js +89 -57
- package/lib/components/upload/style.js +7 -7
- package/lib/components/upload/type.js +15 -15
- package/lib/components/upload/util.js +102 -0
- package/lib/components/upvote/index.js +37 -14
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +4 -0
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +50 -24
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +11 -2
- package/lib/components/user-selector/layout/index.css +1 -1
- package/lib/components-v1/buttonv2/ButtonLinked.js +35 -0
- package/lib/components-v1/buttonv2/ButtonOutlined.js +64 -0
- package/lib/components-v1/buttonv2/ButtonRounded.js +101 -0
- package/lib/components-v1/buttonv2/DefaultButton.js +86 -0
- package/lib/components-v1/buttonv2/index.js +37 -0
- package/lib/components-v1/buttonv2/style/style.js +53 -0
- package/lib/components-v1/buttonv2/style/theme.css +3 -0
- package/lib/components-v1/confirm/index.js +158 -0
- package/lib/index.js +49 -5
- package/lib/pages/dynamic/index.css +5 -0
- package/lib/pages/dynamic/index.js +25 -0
- package/lib/pages/home-page/components/data-list/nav-selector/index.js +18 -0
- package/lib/pages/home-page/components/data-list/table/utils-function.js +6 -3
- package/lib/pages/like-ranking/column.js +141 -0
- package/lib/pages/like-ranking/filter-buttons/department.js +44 -0
- package/lib/pages/like-ranking/filter-buttons/group.js +34 -0
- package/lib/pages/like-ranking/filter-buttons/index.css +19 -0
- package/lib/pages/like-ranking/filter-buttons/index.js +40 -0
- package/lib/pages/like-ranking/filter-buttons/modular.js +110 -0
- package/lib/pages/like-ranking/filter-buttons/name.js +73 -0
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +27 -0
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +38 -0
- package/lib/pages/like-ranking/filter-buttons/timer.js +56 -0
- package/lib/pages/like-ranking/image/dynamic-empty.png +0 -0
- package/lib/pages/like-ranking/image/loading.gif +0 -0
- package/lib/pages/like-ranking/image/ranking-1.png +0 -0
- package/lib/pages/like-ranking/image/ranking-2.png +0 -0
- package/lib/pages/like-ranking/image/ranking-3.png +0 -0
- package/lib/pages/like-ranking/index.css +185 -0
- package/lib/pages/like-ranking/index.js +252 -0
- package/lib/pages/like-ranking/mock.js +366 -0
- package/lib/pages/like-ranking/request-api.js +15 -0
- package/lib/utils/auth.js +46 -5
- package/lib/utils/bs-global.js +26 -2
- package/lib/utils/format-time.js +161 -0
- package/lib/utils/helpers.js +41 -0
- package/lib/utils/roundWeight.js +105 -0
- package/lib/utils/tools.js +140 -20
- package/package.json +2 -2
|
@@ -3,12 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getQuaterNum = getQuaterNum;
|
|
7
|
+
exports.getDefalutCycle = getDefalutCycle;
|
|
8
|
+
exports.getDateRangeByCycle = exports.computeYearIndex = exports.formatPeriod = exports.dealYearsRange = exports.dealSelectedPeriodData = void 0;
|
|
9
|
+
|
|
10
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
7
19
|
|
|
8
20
|
var dealSelectedPeriodData = function dealSelectedPeriodData(period) {
|
|
9
21
|
var option = {};
|
|
10
|
-
option.cycleType = period ==
|
|
11
|
-
option.yqmNum = period.substring(2) ==
|
|
22
|
+
option.cycleType = period == "-1" ? "-1" : period.substring(0, 1);
|
|
23
|
+
option.yqmNum = period.substring(2) == "" ? "0" : period.substring(2);
|
|
12
24
|
return option;
|
|
13
25
|
};
|
|
14
26
|
|
|
@@ -20,8 +32,8 @@ var dealYearsRange = function dealYearsRange(yearsRange, showAllYears) {
|
|
|
20
32
|
if (yearsRange.length) {
|
|
21
33
|
if (yearsRange.length > 1 && showAllYears) {
|
|
22
34
|
yearsData = [{
|
|
23
|
-
title:
|
|
24
|
-
order: [
|
|
35
|
+
title: "全部年份",
|
|
36
|
+
order: ["-1"],
|
|
25
37
|
checked: false
|
|
26
38
|
}];
|
|
27
39
|
}
|
|
@@ -32,15 +44,15 @@ var dealYearsRange = function dealYearsRange(yearsRange, showAllYears) {
|
|
|
32
44
|
for (var i = startYear; i <= endYear; i++) {
|
|
33
45
|
yearsData.push({
|
|
34
46
|
checked: false,
|
|
35
|
-
order: [i +
|
|
36
|
-
title: i +
|
|
47
|
+
order: [i + ""],
|
|
48
|
+
title: i + ""
|
|
37
49
|
});
|
|
38
50
|
}
|
|
39
51
|
} else {
|
|
40
52
|
var nowYear = new Date().getFullYear();
|
|
41
53
|
yearsData = [{
|
|
42
|
-
title: nowYear +
|
|
43
|
-
order: [nowYear +
|
|
54
|
+
title: nowYear + "",
|
|
55
|
+
order: [nowYear + ""],
|
|
44
56
|
checked: false
|
|
45
57
|
}];
|
|
46
58
|
}
|
|
@@ -51,28 +63,37 @@ var dealYearsRange = function dealYearsRange(yearsRange, showAllYears) {
|
|
|
51
63
|
exports.dealYearsRange = dealYearsRange;
|
|
52
64
|
|
|
53
65
|
var formatPeriod = function formatPeriod(selected) {
|
|
66
|
+
if (!selected) return "";
|
|
54
67
|
var quarter = ["", "第一季度", "第二季度", "第三季度", "第四季度"];
|
|
55
68
|
var cycleDate = "";
|
|
56
|
-
var annualNum = selected.annualNum ==
|
|
69
|
+
var annualNum = selected.annualNum == "-1" ? "全部年份" : selected.annualNum + "年";
|
|
57
70
|
|
|
58
|
-
switch (selected.cycleType) {
|
|
59
|
-
case
|
|
71
|
+
switch ("".concat(selected.cycleType)) {
|
|
72
|
+
case "-1":
|
|
60
73
|
cycleDate = "全部周期";
|
|
61
74
|
break;
|
|
62
75
|
|
|
63
|
-
case
|
|
76
|
+
case "1":
|
|
64
77
|
cycleDate = "年度";
|
|
65
78
|
break;
|
|
66
79
|
|
|
67
|
-
case
|
|
80
|
+
case "2":
|
|
68
81
|
// 季度
|
|
69
82
|
cycleDate = quarter[Number(selected.yqmNum)];
|
|
70
83
|
break;
|
|
71
84
|
|
|
72
|
-
case
|
|
85
|
+
case "3":
|
|
73
86
|
cycleDate = selected.yqmNum + "月";
|
|
74
87
|
break;
|
|
75
88
|
|
|
89
|
+
case "4":
|
|
90
|
+
cycleDate = "".concat(selected.yqmNum, " - ").concat((Number(selected.yqmNum) + 1) % 12, "\u6708");
|
|
91
|
+
break;
|
|
92
|
+
|
|
93
|
+
case "5":
|
|
94
|
+
cycleDate = selected.yqmNum == "1" ? "上半年" : "下半年";
|
|
95
|
+
break;
|
|
96
|
+
|
|
76
97
|
default:
|
|
77
98
|
cycleDate = "自定义";
|
|
78
99
|
}
|
|
@@ -88,7 +109,7 @@ var computeYearIndex = function computeYearIndex(currentYear, yearsData, compute
|
|
|
88
109
|
return Number(item.title) == currentYear;
|
|
89
110
|
});
|
|
90
111
|
|
|
91
|
-
if (computeType ==
|
|
112
|
+
if (computeType == "add") {
|
|
92
113
|
newIndex = currentYearIndex + 1;
|
|
93
114
|
} else {
|
|
94
115
|
newIndex = currentYearIndex - 1;
|
|
@@ -97,4 +118,134 @@ var computeYearIndex = function computeYearIndex(currentYear, yearsData, compute
|
|
|
97
118
|
return newIndex;
|
|
98
119
|
};
|
|
99
120
|
|
|
100
|
-
exports.computeYearIndex = computeYearIndex;
|
|
121
|
+
exports.computeYearIndex = computeYearIndex;
|
|
122
|
+
|
|
123
|
+
var getDateRangeByCycle = function getDateRangeByCycle(cycle) {
|
|
124
|
+
var startMonth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
125
|
+
|
|
126
|
+
if (!cycle) {
|
|
127
|
+
var start = (0, _moment["default"])();
|
|
128
|
+
return {
|
|
129
|
+
startDate: start.format("YYYY/MM/DD"),
|
|
130
|
+
endDate: start.add(1, "M").format("YYYY/MM/DD")
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
switch (cycle.cycleType) {
|
|
135
|
+
case "1":
|
|
136
|
+
{
|
|
137
|
+
var _start = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
startDate: _start.format("YYYY/MM/DD"),
|
|
141
|
+
endDate: _start.add(11, "M").endOf("M").format("YYYY/MM/DD")
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
case "2":
|
|
146
|
+
{
|
|
147
|
+
var yearStart = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
|
|
148
|
+
var quarterStart = yearStart.add((Number(cycle.yqmNum) - 1) * 3, "M");
|
|
149
|
+
return {
|
|
150
|
+
startDate: quarterStart.format("YYYY/MM/DD"),
|
|
151
|
+
endDate: quarterStart.add(2, "M").endOf("M").format("YYYY/MM/DD")
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
case "3":
|
|
156
|
+
{
|
|
157
|
+
return {
|
|
158
|
+
startDate: "".concat(cycle.annualNum, "/").concat(Number(cycle.yqmNum) < 10 ? "0" + cycle.yqmNum : cycle.yqmNum, "/01"),
|
|
159
|
+
endDate: (0, _moment["default"])(cycle.annualNum + "/" + cycle.yqmNum + "/" + 1).add(1, "month").set("date", 0).format("YYYY/MM/DD")
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
case "4":
|
|
164
|
+
{
|
|
165
|
+
var _start2 = (0, _moment["default"])().year(Number(cycle.annualNum)).month(Number(cycle.yqmNum) - 1).date(1);
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
startDate: _start2.format("YYYY/MM/DD"),
|
|
169
|
+
endDate: _start2.add(1, "month").endOf("M").format("YYYY/MM/DD")
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
case "5":
|
|
174
|
+
{
|
|
175
|
+
var _start3 = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
|
|
176
|
+
|
|
177
|
+
if (cycle.yqmNum == "2") _start3.add(6, "M");
|
|
178
|
+
return {
|
|
179
|
+
startDate: _start3.format("YYYY/MM/DD"),
|
|
180
|
+
endDate: _start3.add(5, "month").endOf("M").format("YYYY/MM/DD")
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
default:
|
|
185
|
+
{
|
|
186
|
+
return {
|
|
187
|
+
startDate: (0, _moment["default"])().set("year", Number(cycle.annualNum)).format("YYYY/MM/DD"),
|
|
188
|
+
endDate: (0, _moment["default"])().set("year", Number(cycle.annualNum)).add(30, "day").format("YYYY/MM/DD")
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
exports.getDateRangeByCycle = getDateRangeByCycle;
|
|
195
|
+
|
|
196
|
+
function getQuaterNum(month) {
|
|
197
|
+
var startMonth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
198
|
+
var m = month >= startMonth ? month : month + 12;
|
|
199
|
+
return Math.floor((m - startMonth) / 3) + 1;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function getDefalutCycle(setting) {
|
|
203
|
+
if (setting.isOpenQuarter) {
|
|
204
|
+
var _cycle = {
|
|
205
|
+
annualNum: new Date().getFullYear() + "",
|
|
206
|
+
cycleType: "2",
|
|
207
|
+
yqmNum: "".concat(getQuaterNum(new Date().getMonth() + 1, setting.yearStartMonth))
|
|
208
|
+
};
|
|
209
|
+
return _objectSpread(_objectSpread({}, _cycle), getDateRangeByCycle(_cycle, setting.yearStartMonth));
|
|
210
|
+
} else if (setting.isOpenMonth) {
|
|
211
|
+
var _cycle2 = {
|
|
212
|
+
annualNum: new Date().getFullYear() + "",
|
|
213
|
+
cycleType: "3",
|
|
214
|
+
yqmNum: new Date().getMonth() + 1 + ""
|
|
215
|
+
};
|
|
216
|
+
return _objectSpread(_objectSpread({}, _cycle2), getDateRangeByCycle(_cycle2, setting.yearStartMonth));
|
|
217
|
+
} else if (setting.isOpenBimonthly) {
|
|
218
|
+
var month = new Date().getMonth() + 1;
|
|
219
|
+
|
|
220
|
+
if (setting.yearStartMonth % 2 == 1) {
|
|
221
|
+
month = month - (month % 2 == 1 ? 0 : 1);
|
|
222
|
+
} else {
|
|
223
|
+
month = month - month % 2 || 12;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
var _cycle3 = {
|
|
227
|
+
annualNum: new Date().getFullYear() + "",
|
|
228
|
+
cycleType: "4",
|
|
229
|
+
yqmNum: month + ""
|
|
230
|
+
};
|
|
231
|
+
return _objectSpread(_objectSpread({}, _cycle3), getDateRangeByCycle(_cycle3, setting.yearStartMonth));
|
|
232
|
+
} else if (setting.isOpenHalfYear) {
|
|
233
|
+
var _cycle4 = {
|
|
234
|
+
annualNum: new Date().getFullYear() + "",
|
|
235
|
+
cycleType: "5",
|
|
236
|
+
yqmNum: "1"
|
|
237
|
+
};
|
|
238
|
+
return _objectSpread(_objectSpread({}, _cycle4), getDateRangeByCycle(_cycle4, setting.yearStartMonth));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var cycle = {
|
|
242
|
+
annualNum: new Date().getFullYear() + "",
|
|
243
|
+
cycleType: "1",
|
|
244
|
+
yqmNum: "1"
|
|
245
|
+
};
|
|
246
|
+
return _objectSpread({
|
|
247
|
+
annualNum: new Date().getFullYear() + "",
|
|
248
|
+
cycleType: "1",
|
|
249
|
+
yqmNum: "1"
|
|
250
|
+
}, getDateRangeByCycle(cycle, setting.yearStartMonth));
|
|
251
|
+
}
|
|
@@ -13,16 +13,26 @@ var _common = require("../../common");
|
|
|
13
13
|
|
|
14
14
|
var _mockData = require("../../mockData");
|
|
15
15
|
|
|
16
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
-
|
|
18
16
|
var _style = require("./style");
|
|
19
17
|
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
19
|
|
|
24
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
21
|
|
|
22
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
|
+
|
|
24
|
+
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."); }
|
|
25
|
+
|
|
26
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
27
|
+
|
|
28
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
26
36
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
37
|
|
|
28
38
|
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."); }
|
|
@@ -39,9 +49,11 @@ function PeriodList(_ref) {
|
|
|
39
49
|
var actived = _ref.actived,
|
|
40
50
|
periodData = _ref.periodData,
|
|
41
51
|
onSelected = _ref.onSelected,
|
|
42
|
-
style = _ref.style
|
|
52
|
+
style = _ref.style,
|
|
53
|
+
_ref$size = _ref.size,
|
|
54
|
+
size = _ref$size === void 0 ? "m" : _ref$size;
|
|
43
55
|
|
|
44
|
-
var _useState = (0, _react.useState)([
|
|
56
|
+
var _useState = (0, _react.useState)(["0"]),
|
|
45
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
58
|
activeOrder = _useState2[0],
|
|
47
59
|
setActiveOrder = _useState2[1];
|
|
@@ -53,15 +65,48 @@ function PeriodList(_ref) {
|
|
|
53
65
|
style: style
|
|
54
66
|
}, periodData.map(function (item, index) {
|
|
55
67
|
return /*#__PURE__*/_react["default"].createElement(_style.Item, {
|
|
56
|
-
className: item.order[0] == activeOrder[0] ?
|
|
68
|
+
className: item.order[0] == activeOrder[0] ? "active" : "",
|
|
57
69
|
key: index,
|
|
58
70
|
onClick: function onClick() {
|
|
59
71
|
return onSelected(item.order[0]);
|
|
60
|
-
}
|
|
72
|
+
},
|
|
73
|
+
size: size
|
|
61
74
|
}, item.title);
|
|
75
|
+
}), new Array(6).fill(1).map(function () {
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement(_style.PlaceHolder, {
|
|
77
|
+
size: size
|
|
78
|
+
});
|
|
62
79
|
}));
|
|
63
80
|
}
|
|
64
81
|
|
|
82
|
+
function getDoubleMonthData(startMonth) {
|
|
83
|
+
var start = startMonth % 2 == 1 ? 1 : 2;
|
|
84
|
+
var month = start;
|
|
85
|
+
|
|
86
|
+
var getNextMonth = function getNextMonth(month) {
|
|
87
|
+
var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
88
|
+
return (month + step) % 12 || 12;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var datas = [{
|
|
92
|
+
title: "".concat(start, " - ").concat(getNextMonth(start), "\u6708"),
|
|
93
|
+
order: ["4,".concat(start)],
|
|
94
|
+
checked: false
|
|
95
|
+
}];
|
|
96
|
+
|
|
97
|
+
while (1) {
|
|
98
|
+
month = getNextMonth(month, 2);
|
|
99
|
+
if (month == start) break;
|
|
100
|
+
datas.push({
|
|
101
|
+
title: "".concat(month, " - ").concat(getNextMonth(month), "\u6708"),
|
|
102
|
+
order: ["4,".concat(month)],
|
|
103
|
+
checked: false
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return datas;
|
|
108
|
+
}
|
|
109
|
+
|
|
65
110
|
function Selector(_ref2) {
|
|
66
111
|
var className = _ref2.className,
|
|
67
112
|
onSelected = _ref2.onSelected,
|
|
@@ -71,10 +116,14 @@ function Selector(_ref2) {
|
|
|
71
116
|
showMonth = _ref2.showMonth,
|
|
72
117
|
showQuarter = _ref2.showQuarter,
|
|
73
118
|
showYear = _ref2.showYear,
|
|
119
|
+
showHalfYear = _ref2.showHalfYear,
|
|
120
|
+
showDoubleMonth = _ref2.showDoubleMonth,
|
|
74
121
|
yearsRange = _ref2.yearsRange,
|
|
75
|
-
wrapperStyle = _ref2.wrapperStyle
|
|
122
|
+
wrapperStyle = _ref2.wrapperStyle,
|
|
123
|
+
_ref2$startMonth = _ref2.startMonth,
|
|
124
|
+
startMonth = _ref2$startMonth === void 0 ? 1 : _ref2$startMonth;
|
|
76
125
|
|
|
77
|
-
var _useState3 = (0, _react.useState)(new Date().getFullYear() +
|
|
126
|
+
var _useState3 = (0, _react.useState)(new Date().getFullYear() + ""),
|
|
78
127
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
128
|
annualNum = _useState4[0],
|
|
80
129
|
setAnnualNum = _useState4[1];
|
|
@@ -84,7 +133,7 @@ function Selector(_ref2) {
|
|
|
84
133
|
annualNumIndex = _useState6[0],
|
|
85
134
|
setAnnualNumIndex = _useState6[1];
|
|
86
135
|
|
|
87
|
-
var _useState7 = (0, _react.useState)(
|
|
136
|
+
var _useState7 = (0, _react.useState)("-1"),
|
|
88
137
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
89
138
|
cycleType = _useState8[0],
|
|
90
139
|
setCycleType = _useState8[1];
|
|
@@ -94,7 +143,7 @@ function Selector(_ref2) {
|
|
|
94
143
|
periodData = _useState10[0],
|
|
95
144
|
setPeriodData = _useState10[1];
|
|
96
145
|
|
|
97
|
-
var _useState11 = (0, _react.useState)(
|
|
146
|
+
var _useState11 = (0, _react.useState)("0"),
|
|
98
147
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
99
148
|
yqmNum = _useState12[0],
|
|
100
149
|
setYqmNum = _useState12[1];
|
|
@@ -108,17 +157,18 @@ function Selector(_ref2) {
|
|
|
108
157
|
var yearIndex = (0, _common.computeYearIndex)(Number(annualNum), yearsData, computeType);
|
|
109
158
|
setAnnualNum(yearsData[yearIndex].title);
|
|
110
159
|
setAnnualNumIndex(yearIndex);
|
|
111
|
-
setCycleType(
|
|
112
|
-
setYqmNum(
|
|
160
|
+
setCycleType("");
|
|
161
|
+
setYqmNum("");
|
|
113
162
|
}
|
|
114
163
|
}
|
|
115
164
|
|
|
116
165
|
function handleSelected(period) {
|
|
117
|
-
var selected = {
|
|
166
|
+
var selected = _objectSpread({
|
|
118
167
|
annualNum: annualNum,
|
|
119
168
|
cycleType: (0, _common.dealSelectedPeriodData)(period).cycleType,
|
|
120
169
|
yqmNum: (0, _common.dealSelectedPeriodData)(period).yqmNum
|
|
121
|
-
};
|
|
170
|
+
}, (0, _common.getDateRangeByCycle)((0, _common.dealSelectedPeriodData)(period), startMonth));
|
|
171
|
+
|
|
122
172
|
onSelected(selected);
|
|
123
173
|
}
|
|
124
174
|
|
|
@@ -137,49 +187,64 @@ function Selector(_ref2) {
|
|
|
137
187
|
title: "年度",
|
|
138
188
|
order: ["1"],
|
|
139
189
|
checked: false
|
|
140
|
-
}, showCustom && {
|
|
141
|
-
title: "自定义",
|
|
142
|
-
order: ["0,0"],
|
|
143
|
-
checked: false
|
|
144
190
|
}].filter(function (item) {
|
|
145
191
|
return item;
|
|
146
192
|
});
|
|
193
|
+
|
|
194
|
+
if (showHalfYear) {
|
|
195
|
+
periodDatas.push({
|
|
196
|
+
title: "上半年",
|
|
197
|
+
order: ["5,1"],
|
|
198
|
+
checked: false
|
|
199
|
+
}, {
|
|
200
|
+
title: "下半年",
|
|
201
|
+
order: ["5,2"],
|
|
202
|
+
checked: false
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (showQuarter) {
|
|
207
|
+
periodDatas.push.apply(periodDatas, _toConsumableArray(_mockData.MockQuarter));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (showCustom) {
|
|
211
|
+
periodDatas.push({
|
|
212
|
+
title: "自定义",
|
|
213
|
+
order: ["0,0"],
|
|
214
|
+
checked: false
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
147
218
|
setPeriodData(periodDatas);
|
|
148
219
|
}, [selected, showCustom, showFullCycle, showMonth, showQuarter, showYear]);
|
|
149
220
|
return /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
|
|
150
221
|
className: className,
|
|
151
222
|
style: wrapperStyle
|
|
152
|
-
}, /*#__PURE__*/_react["default"].createElement(_style.Head, null, yearsRange.length > 1 && /*#__PURE__*/_react["default"].createElement(
|
|
153
|
-
className: (0
|
|
154
|
-
'disabled': !(yearsRangeLen > 1 && annualNumIndex != 0)
|
|
155
|
-
}),
|
|
223
|
+
}, /*#__PURE__*/_react["default"].createElement(_style.Head, null, yearsRange.length > 1 && /*#__PURE__*/_react["default"].createElement(_style.Icon, {
|
|
224
|
+
className: "tu-icon-angle-left ".concat(yearsRangeLen > 1 && annualNumIndex != 0 ? "" : "disabled"),
|
|
156
225
|
onClick: function onClick() {
|
|
157
|
-
return setYear(
|
|
226
|
+
return setYear("subtract", yearsRangeLen > 1 && annualNumIndex != 0);
|
|
158
227
|
}
|
|
159
|
-
}), /*#__PURE__*/_react["default"].createElement(_style.Title, null, annualNum), yearsRange.length > 1 && /*#__PURE__*/_react["default"].createElement(
|
|
160
|
-
className: (
|
|
161
|
-
'disabled': !(yearsRangeLen > 1 && annualNumIndex != yearsRangeLen - 1)
|
|
162
|
-
}),
|
|
228
|
+
}), /*#__PURE__*/_react["default"].createElement(_style.Title, null, annualNum), yearsRange.length > 1 && /*#__PURE__*/_react["default"].createElement(_style.Icon, {
|
|
229
|
+
className: "tu-icon-angle-right ".concat(yearsRangeLen > 1 && annualNumIndex != yearsRangeLen - 1 ? "" : "disabled"),
|
|
163
230
|
onClick: function onClick() {
|
|
164
|
-
return setYear(
|
|
231
|
+
return setYear("add", yearsRangeLen > 1 && annualNumIndex != yearsRangeLen - 1);
|
|
165
232
|
}
|
|
166
233
|
})), /*#__PURE__*/_react["default"].createElement(PeriodList, {
|
|
167
|
-
actived: ["".concat(cycleType ==
|
|
234
|
+
actived: ["".concat(cycleType == "-1" ? "-1" : cycleType == "1" ? cycleType : "".concat(cycleType, ",").concat(yqmNum))],
|
|
168
235
|
periodData: periodData,
|
|
169
236
|
onSelected: function onSelected(period) {
|
|
170
237
|
handleSelected(period);
|
|
171
|
-
},
|
|
172
|
-
style: {
|
|
173
|
-
flexWrap: 'nowrap'
|
|
174
238
|
}
|
|
175
|
-
}),
|
|
176
|
-
actived: ["".concat(cycleType ==
|
|
177
|
-
periodData:
|
|
239
|
+
}), showDoubleMonth && /*#__PURE__*/_react["default"].createElement(PeriodList, {
|
|
240
|
+
actived: ["".concat(cycleType == "-1" ? "-1" : cycleType == "1" ? cycleType : "".concat(cycleType, ",").concat(yqmNum))],
|
|
241
|
+
periodData: getDoubleMonthData(startMonth),
|
|
178
242
|
onSelected: function onSelected(period) {
|
|
179
243
|
handleSelected(period);
|
|
180
244
|
}
|
|
181
245
|
}), showMonth && /*#__PURE__*/_react["default"].createElement(PeriodList, {
|
|
182
|
-
actived: ["".concat(cycleType ==
|
|
246
|
+
actived: ["".concat(cycleType == "-1" ? "-1" : cycleType == "1" ? cycleType : "".concat(cycleType, ",").concat(yqmNum))],
|
|
247
|
+
size: "s",
|
|
183
248
|
periodData: _mockData.MockMonth,
|
|
184
249
|
onSelected: function onSelected(period) {
|
|
185
250
|
handleSelected(period);
|
|
@@ -3,36 +3,50 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.Item = exports.List = exports.Icon = exports.Title = exports.Head = exports.Wrapper = void 0;
|
|
6
|
+
exports.PlaceHolder = exports.Item = exports.List = exports.Icon = exports.Title = exports.Head = exports.Wrapper = void 0;
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
14
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
15
|
|
|
16
|
-
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
16
|
+
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 262px;\n box-sizing: border-box;\n min-height: 80px;\n padding: 16px 0px;\n border: 1px solid #f7f8fa;\n border-radius: 4px;\n box-shadow: 0px 4px 12px 0px rgba(127,145,180,0.2); \n background: #ffffff;\n box-sizing: content-box;\n"])));
|
|
17
17
|
|
|
18
18
|
exports.Wrapper = Wrapper;
|
|
19
19
|
|
|
20
|
-
var Head = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
20
|
+
var Head = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 36px;\n margin: 0 20px 8px;\n padding: 8px 15px;\n border-radius: 3px;\n background: #f7f8fa;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n"])));
|
|
21
21
|
|
|
22
22
|
exports.Head = Head;
|
|
23
23
|
|
|
24
|
-
var Title = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
24
|
+
var Title = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n font-size: 14px;\n height: 20px;\n color: #3f4755;\n cursor: default;\n text-align: center;\n\n &:hover {\n color: #3f4755;\n }\n"])));
|
|
25
25
|
|
|
26
26
|
exports.Title = Title;
|
|
27
27
|
|
|
28
|
-
var Icon = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n
|
|
28
|
+
var Icon = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transition: all .3s ease-in;\n color: #3f4755;\n\n &:hover {\n color: #2879ff;\n }\n\n &.disabled {\n color: #bfc7d5;\n cursor: default;\n\n &:hover {\n color: #bfc7d5;\n }\n }\n"])));
|
|
29
29
|
|
|
30
30
|
exports.Icon = Icon;
|
|
31
31
|
|
|
32
|
-
var List = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n
|
|
32
|
+
var List = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n justify-content: space-between;\n padding: 0 11px;\n box-sizing: border-box;\n"])));
|
|
33
33
|
|
|
34
34
|
exports.List = List;
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var getItemWidthBySize = function getItemWidthBySize(size) {
|
|
37
|
+
if (size == 's') return 48;
|
|
38
|
+
if (size == 'm') return 72;
|
|
39
|
+
return 72;
|
|
40
|
+
};
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
var Item = _styledComponents["default"].a(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: ", "px;\n padding: 8px;\n font-size: 12px;\n line-height: 17px;\n transition: all .3s ease-in;\n box-sizing: border-box;\n color: #6f7886;\n cursor: pointer;\n text-align: center;\n white-space: nowrap;\n flex-shrink: 0;\n\n &.active,\n &:hover {\n color: #2879ff;\n }\n\n &:hover {\n background: rgba(240,242,245,0.3);\n }\n"])), function (p) {
|
|
43
|
+
return getItemWidthBySize(p.size);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
exports.Item = Item;
|
|
47
|
+
|
|
48
|
+
var PlaceHolder = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: ", "px;\n height: 0;\n"])), function (p) {
|
|
49
|
+
return getItemWidthBySize(p.size);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
exports.PlaceHolder = PlaceHolder;
|