@titaui/pc 1.5.78 → 1.5.82
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/index.js +1 -9
- package/lib/components/change-okr/Filter.js +65 -133
- package/lib/components/change-okr/Item.js +0 -6
- package/lib/components/change-okr/filterTab.js +0 -2
- package/lib/components/change-okr/index.js +2 -2
- package/lib/components/checkbox/index.js +3 -4
- package/lib/components/communication/CommunicationRecord.js +161 -116
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.js +28 -53
- package/lib/components/communication/style.js +25 -21
- package/lib/components/dropdown-layer/icon-item.js +3 -5
- package/lib/components/dropdown-layer/index.css +0 -16
- package/lib/components/dropdown-layer/index.js +14 -21
- package/lib/components/emotionsSelector/style.js +1 -1
- package/lib/components/form/form-fields/input/index.css +0 -11
- package/lib/components/form/form-fields/input/index.js +1 -3
- package/lib/components/grid-page/personal-info/index.js +4 -4
- package/lib/components/mblog/components/MblogAction.js +6 -10
- package/lib/components/mblog/index.js +11 -24
- package/lib/components/mblog/style.js +8 -8
- package/lib/components/okr-detail/components/header/index.css +0 -4
- 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 +8 -15
- package/lib/components/okr-flow/child-node/work-node.js +1 -7
- package/lib/components/okr-period-selector/select-cycle.js +151 -139
- package/lib/components/okr-progress-detail/index.css +0 -1
- 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 +4 -149
- package/lib/components/period-selector/components/selector/index.js +38 -103
- package/lib/components/period-selector/components/selector/style.js +9 -23
- package/lib/components/period-selector/index.js +28 -29
- package/lib/components/popup/index.js +1 -3
- package/lib/components/radio/index.css +0 -5
- package/lib/components/radio/radio.js +4 -12
- package/lib/components/table/index.css +1 -0
- package/lib/components/upload/components/uploadedPreview.js +54 -62
- package/lib/components/upload/index.js +57 -89
- package/lib/components/upload/style.js +7 -7
- package/lib/components/upload/type.js +15 -15
- package/lib/components/upvote/index.js +14 -37
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +0 -4
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +24 -50
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +2 -11
- package/lib/components/user-selector/layout/index.css +1 -1
- package/lib/index.js +5 -49
- package/lib/pages/home-page/components/data-list/nav-selector/index.js +0 -18
- package/lib/pages/home-page/components/data-list/table/utils-function.js +3 -6
- package/lib/utils/auth.js +5 -46
- package/lib/utils/bs-global.js +2 -26
- package/lib/utils/tools.js +20 -140
- package/package.json +2 -2
- package/lib/components/avatar/icon-avatar/index.css +0 -15
- package/lib/components/avatar/icon-avatar/index.js +0 -50
- package/lib/components/avatar/num-avatar/index.css +0 -12
- package/lib/components/avatar/num-avatar/index.js +0 -34
- package/lib/components/button/admin-button/default.js +0 -35
- package/lib/components/button/admin-button/drop-down-arrow.js +0 -93
- package/lib/components/button/admin-button/index.css +0 -86
- package/lib/components/button/admin-button/index.js +0 -40
- package/lib/components/button/admin-button/primary.js +0 -33
- package/lib/components/button/admin-button/secondary.js +0 -35
- package/lib/components/button/default-button/index.css +0 -49
- package/lib/components/button/default-button/index.js +0 -51
- package/lib/components/button/export-button/index.css +0 -51
- package/lib/components/button/export-button/index.js +0 -81
- package/lib/components/button/images/daoru.svg +0 -18
- package/lib/components/button/index.js +0 -23
- package/lib/components/button/interface.js +0 -5
- package/lib/components/communication/index.css +0 -63
- package/lib/components/create-okr/animation/check-animation.js +0 -2746
- package/lib/components/create-okr/constant.js +0 -27
- package/lib/components/create-okr/createCycle.js +0 -171
- package/lib/components/create-okr/createSuccessCmp.js +0 -233
- package/lib/components/create-okr/createSuccessCmpWrapper.js +0 -20
- package/lib/components/create-okr/fields/date-cycle.js +0 -98
- package/lib/components/create-okr/fields/index.css +0 -346
- package/lib/components/create-okr/fields/index.js +0 -17
- package/lib/components/create-okr/fields/input-with-err-popup.js +0 -57
- package/lib/components/create-okr/fields/o-new-name.js +0 -197
- package/lib/components/create-okr/fields/okr-case.js +0 -98
- package/lib/components/create-okr/fields/okr-classify.js +0 -51
- package/lib/components/create-okr/fields/okr-create-suggest.js +0 -147
- package/lib/components/create-okr/fields/okr-new-user-selector.js +0 -106
- package/lib/components/create-okr/fields/okr-parent.js +0 -157
- package/lib/components/create-okr/fields/okr-type-detail.js +0 -196
- package/lib/components/create-okr/fields/okr-type.js +0 -131
- package/lib/components/create-okr/fields/okr-visibility-detail.js +0 -224
- package/lib/components/create-okr/fields/okr-visibility.js +0 -169
- package/lib/components/create-okr/img/check-normal.svg +0 -29
- package/lib/components/create-okr/img/check-right.svg +0 -16
- package/lib/components/create-okr/img/check-wrong.svg +0 -29
- package/lib/components/create-okr/img/create-success-head.png +0 -0
- package/lib/components/create-okr/img/create-success-left-quotation.svg +0 -14
- package/lib/components/create-okr/img/create-success-message.svg +0 -1
- package/lib/components/create-okr/img/create-success-right-quotation.svg +0 -14
- package/lib/components/create-okr/img/create-success-shadow.svg +0 -23
- package/lib/components/create-okr/img/example.svg +0 -11
- package/lib/components/create-okr/img/hand.svg +0 -12
- package/lib/components/create-okr/img/kr-add.svg +0 -12
- package/lib/components/create-okr/img/left-quotation.svg +0 -12
- package/lib/components/create-okr/img/light.svg +0 -1
- package/lib/components/create-okr/img/pack-up.js +0 -28
- package/lib/components/create-okr/img/qr-code.png +0 -0
- package/lib/components/create-okr/img/right-quotation.svg +0 -12
- package/lib/components/create-okr/img/shower.png +0 -0
- package/lib/components/create-okr/img/target.svg +0 -19
- package/lib/components/create-okr/img/teach-okr.svg +0 -17
- package/lib/components/create-okr/img/wave.png +0 -0
- package/lib/components/create-okr/img/weight.svg +0 -12
- package/lib/components/create-okr/index.css +0 -446
- package/lib/components/create-okr/index.js +0 -911
- package/lib/components/create-okr/interface.js +0 -5
- package/lib/components/create-okr/kr-items/index.css +0 -180
- package/lib/components/create-okr/kr-items/kr-item-weight.js +0 -194
- package/lib/components/create-okr/kr-items/krDatas.js +0 -299
- package/lib/components/create-okr/kr-items/krItem.js +0 -167
- package/lib/components/create-okr/objectType.js +0 -273
- package/lib/components/create-okr/request-api.js +0 -220
- package/lib/components/create-okr/style.js +0 -100
- package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +0 -124
- package/lib/components/create-okr/utils/helper.js +0 -99
- package/lib/components/create-okr/utils/index.js +0 -23
- package/lib/components/dynamic/components/condition-render/index.js +0 -20
- package/lib/components/dynamic/components/dangerous-html/index.js +0 -22
- package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -78
- package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -192
- package/lib/components/dynamic/components/obj-status/index.css +0 -22
- package/lib/components/dynamic/components/obj-status/index.js +0 -38
- package/lib/components/dynamic/components/percent/index.css +0 -21
- package/lib/components/dynamic/components/percent/index.js +0 -38
- package/lib/components/dynamic/components/title/index.css +0 -35
- package/lib/components/dynamic/components/title/index.js +0 -59
- package/lib/components/dynamic/constant.js +0 -96
- package/lib/components/dynamic/context/index.js +0 -13
- package/lib/components/dynamic/dynamic-item/components/header/index.css +0 -101
- package/lib/components/dynamic/dynamic-item/components/header/index.js +0 -294
- package/lib/components/dynamic/dynamic-item/components/icon/index.css +0 -10
- package/lib/components/dynamic/dynamic-item/components/icon/index.js +0 -35
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +0 -95
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +0 -173
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +0 -54
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +0 -107
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +0 -48
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +0 -89
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +0 -96
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +0 -171
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +0 -67
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +0 -110
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +0 -16
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +0 -111
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +0 -158
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +0 -95
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +0 -215
- package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +0 -16
- package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +0 -91
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +0 -125
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +0 -95
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +0 -192
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +0 -138
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +0 -183
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +0 -153
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +0 -138
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +0 -97
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +0 -207
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +0 -54
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +0 -107
- package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +0 -50
- 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 +0 -111
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +0 -164
- package/lib/components/dynamic/dynamic-item/index.css +0 -128
- package/lib/components/dynamic/dynamic-item/index.js +0 -352
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
- 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 +0 -126
- package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -157
- package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -107
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
- package/lib/components/dynamic/dynamic-liking/index.css +0 -81
- package/lib/components/dynamic/dynamic-liking/index.js +0 -76
- package/lib/components/dynamic/dynamic-liking/item.js +0 -90
- package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
- package/lib/components/dynamic/dynamic-list/index.css +0 -36
- package/lib/components/dynamic/dynamic-list/index.js +0 -61
- package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +0 -16
- package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +0 -30
- package/lib/components/dynamic/dynamic-topping/index.css +0 -130
- package/lib/components/dynamic/dynamic-topping/index.js +0 -78
- package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
- package/lib/components/dynamic/dynamic-topping/item.js +0 -138
- package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/lib/components/dynamic/dynamic.css +0 -204
- package/lib/components/dynamic/dynamic.js +0 -391
- package/lib/components/dynamic/export-module/index.js +0 -33
- package/lib/components/dynamic/img/dynamic-P1.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P2.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P3.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P4.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P5.svg +0 -15
- package/lib/components/dynamic/img/dynamic-delay.svg +0 -17
- package/lib/components/dynamic/img/dynamic-desire.svg +0 -61
- package/lib/components/dynamic/img/dynamic-empty.png +0 -0
- package/lib/components/dynamic/img/dynamic-end.svg +0 -17
- package/lib/components/dynamic/img/dynamic-left-quoto.svg +0 -13
- package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
- package/lib/components/dynamic/img/dynamic-normal.svg +0 -17
- package/lib/components/dynamic/img/dynamic-promise.svg +0 -61
- package/lib/components/dynamic/img/dynamic-reword.svg +0 -24
- package/lib/components/dynamic/img/dynamic-right-quoto.svg +0 -13
- package/lib/components/dynamic/img/dynamic-risk.svg +0 -17
- package/lib/components/dynamic/img/dynamic-submit-delay.svg +0 -16
- package/lib/components/dynamic/img/dynamic-submit-normal.svg +0 -18
- package/lib/components/dynamic/img/dynamic-top.svg +0 -14
- package/lib/components/dynamic/index.js +0 -27
- package/lib/components/dynamic/interface.js +0 -5
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -37
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -37
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -37
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -42
- 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 +0 -51
- package/lib/components/dynamic/quick-operation/index.js +0 -112
- package/lib/components/dynamic/request-api.js +0 -92
- package/lib/components/dynamic/util.js +0 -140
- package/lib/components/file-list/components/single-file/index.css +0 -84
- package/lib/components/file-list/components/single-file/index.js +0 -115
- package/lib/components/file-list/img/new-file-list-doc.svg +0 -1
- package/lib/components/file-list/img/new-file-list-other.svg +0 -1
- package/lib/components/file-list/img/new-file-list-pdf.svg +0 -1
- package/lib/components/file-list/img/new-file-list-ppt.svg +0 -1
- package/lib/components/file-list/img/new-file-list-radio.svg +0 -1
- package/lib/components/file-list/img/new-file-list-video.svg +0 -1
- package/lib/components/file-list/img/new-file-list-xls.svg +0 -1
- package/lib/components/file-list/index.css +0 -5
- package/lib/components/file-list/index.js +0 -61
- package/lib/components/file-list/interface.js +0 -5
- package/lib/components/file-list/util.js +0 -78
- package/lib/components/img-viewer/icon/enlarge.js +0 -30
- package/lib/components/img-viewer/icon/left-rotate.js +0 -46
- package/lib/components/img-viewer/icon/right-rotate.js +0 -44
- package/lib/components/img-viewer/icon/shrink.js +0 -37
- package/lib/components/img-viewer/image/loading.gif +0 -0
- package/lib/components/img-viewer/index.css +0 -155
- package/lib/components/img-viewer/index.js +0 -228
- package/lib/components/img-viewer/interface.js +0 -5
- package/lib/components/img-viewer/util.js +0 -16
- package/lib/components/publish-dynamic-modal/index.js +0 -13
- package/lib/components/publish-dynamic-modal/interface.js +0 -5
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +0 -3
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +0 -191
- package/lib/components/publish-dynamic-modal/requist-api.js +0 -48
- package/lib/components/search-key-handle/index.js +0 -39
- package/lib/components/upload/img/doc.svg +0 -1
- package/lib/components/upload/img/other.svg +0 -1
- package/lib/components/upload/img/pdf.svg +0 -1
- package/lib/components/upload/img/ppt.svg +0 -1
- package/lib/components/upload/img/radio.svg +0 -1
- package/lib/components/upload/img/video.svg +0 -1
- package/lib/components/upload/img/xls.svg +0 -1
- package/lib/components/upload/index.css +0 -26
- package/lib/components/upload/util.js +0 -102
- package/lib/components-v1/buttonv2/ButtonLinked.js +0 -35
- package/lib/components-v1/buttonv2/ButtonOutlined.js +0 -64
- package/lib/components-v1/buttonv2/ButtonRounded.js +0 -101
- package/lib/components-v1/buttonv2/DefaultButton.js +0 -86
- package/lib/components-v1/buttonv2/index.js +0 -37
- package/lib/components-v1/buttonv2/style/style.js +0 -53
- package/lib/components-v1/buttonv2/style/theme.css +0 -3
- package/lib/components-v1/confirm/index.js +0 -158
- package/lib/pages/dynamic/index.css +0 -5
- package/lib/pages/dynamic/index.js +0 -25
- package/lib/pages/like-ranking/column.js +0 -141
- package/lib/pages/like-ranking/filter-buttons/department.js +0 -44
- package/lib/pages/like-ranking/filter-buttons/group.js +0 -34
- package/lib/pages/like-ranking/filter-buttons/index.css +0 -19
- package/lib/pages/like-ranking/filter-buttons/index.js +0 -44
- package/lib/pages/like-ranking/filter-buttons/modular.js +0 -110
- package/lib/pages/like-ranking/filter-buttons/name.js +0 -73
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +0 -27
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +0 -38
- package/lib/pages/like-ranking/filter-buttons/timer.js +0 -56
- 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 +0 -185
- package/lib/pages/like-ranking/index.js +0 -252
- package/lib/pages/like-ranking/mock.js +0 -366
- package/lib/pages/like-ranking/request-api.js +0 -15
- package/lib/utils/format-time.js +0 -161
- package/lib/utils/helpers.js +0 -41
- package/lib/utils/roundWeight.js +0 -105
- package/yarn-error.log +0 -15894
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
|
|
3
|
-
.kr-item-modal-avatar {
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.create-kr-item-wrapper {
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
height: 44px;
|
|
13
|
-
width: 536px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.create-kr-item-wrapper .kr-item__right-block {
|
|
17
|
-
border-bottom: 1px solid #e9ecf0;
|
|
18
|
-
flex: 1;
|
|
19
|
-
display: flex;
|
|
20
|
-
height: 100%;
|
|
21
|
-
align-items: center;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.create-kr-item-wrapper .kr-item__right-block .kr-item__order {
|
|
25
|
-
font-size: 14px;
|
|
26
|
-
font-family: DINAlternate-Bold, DINAlternate;
|
|
27
|
-
font-weight: bold;
|
|
28
|
-
color: #6f7886;
|
|
29
|
-
line-height: 22px;
|
|
30
|
-
margin-right: 8px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.create-kr-item-wrapper .kr-item__right-block .kr-item__input-wrapper {
|
|
34
|
-
flex: 1;
|
|
35
|
-
position: relative;
|
|
36
|
-
display: flex;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.create-kr-item-wrapper .kr-item__right-block .kr-item__input-wrapper .kr-item__input {
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
font-family: PingFangSC-Regular, PingFang SC;
|
|
42
|
-
font-weight: 400;
|
|
43
|
-
color: #6f7886;
|
|
44
|
-
line-height: 22px;
|
|
45
|
-
border: none;
|
|
46
|
-
outline: none;
|
|
47
|
-
flex: 1;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.create-kr-item-wrapper .kr-item__right-block .kr-item__input-wrapper .kr-item__input::placeholder {
|
|
51
|
-
color: #bfc7d5;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.create-kr-item-wrapper .kr-item__right-block .kr-item-right-block__text-mask {
|
|
55
|
-
width: 20px;
|
|
56
|
-
height: 24px;
|
|
57
|
-
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
|
|
58
|
-
position: absolute;
|
|
59
|
-
right: 12px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.create-kr-item-wrapper .kr-item__right-block .kr-item-right-block__white-block {
|
|
63
|
-
width: 12px;
|
|
64
|
-
background: #ffffff;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.create-kr-item-wrapper .kr-item__right-block--error {
|
|
68
|
-
border-bottom: 1px solid #f05e5e;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.create-kr-item-wrapper .kr-item__delete-icon {
|
|
72
|
-
color: #000000;
|
|
73
|
-
font-size: 14px;
|
|
74
|
-
margin-left: 7px;
|
|
75
|
-
margin-right: 8px;
|
|
76
|
-
visibility: hidden;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.create-kr-item-wrapper .kr-item__delete-icon :hover {
|
|
80
|
-
color: #f05e5e;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.create-kr-item-wrapper .kr-item__delete-icon--show {
|
|
84
|
-
visibility: visible;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.create-kr-item-wrapper .kr-item__delete-icon--show:hover {
|
|
88
|
-
color: #f05e5e;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.kr-item-weight {
|
|
92
|
-
width: 73px;
|
|
93
|
-
border-radius: 3px;
|
|
94
|
-
padding: 4px 10px 4px 4px;
|
|
95
|
-
box-sizing: border-box;
|
|
96
|
-
display: flex;
|
|
97
|
-
align-items: center;
|
|
98
|
-
border: 1px solid transparent;
|
|
99
|
-
margin-right: 10px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.kr-item-weight .kr-item-weight__input {
|
|
103
|
-
width: 30px;
|
|
104
|
-
border: none;
|
|
105
|
-
outline: none;
|
|
106
|
-
padding: 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.kr-item-weight .kr-item-weight__icon {
|
|
110
|
-
margin-right: 6px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.kr-item-weight--hover {
|
|
114
|
-
border: 1px solid #e9ecf0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.kr-item-weight--focus {
|
|
118
|
-
border: 1px solid #2879ff;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.kr-item-weight--error {
|
|
122
|
-
border: 1px solid #f05e5e;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.kr-weight__error-popup-text-wrapper {
|
|
126
|
-
color: #f05e5e;
|
|
127
|
-
font-family: -apple-system, BlinkMacSystemFont, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;-apple-system, BlinkMacSystemFont, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
128
|
-
font-size: 12px;
|
|
129
|
-
line-height: 22px;
|
|
130
|
-
display: inline-block;
|
|
131
|
-
background: white;
|
|
132
|
-
padding: 5px 12px;
|
|
133
|
-
box-shadow: 0 4px 12px 0 rgba(127, 145, 180, 0.2);
|
|
134
|
-
position: relative;
|
|
135
|
-
margin-bottom: 10px;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.kr-weight__error-popup-text-wrapper::after {
|
|
139
|
-
content: "";
|
|
140
|
-
display: block;
|
|
141
|
-
border: 6px solid transparent;
|
|
142
|
-
position: absolute;
|
|
143
|
-
border-top-color: #ffffff;
|
|
144
|
-
bottom: -11px;
|
|
145
|
-
left: 50%;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.krs-info {
|
|
149
|
-
display: flex;
|
|
150
|
-
align-items: center;
|
|
151
|
-
justify-content: space-between;
|
|
152
|
-
margin-top: 14px;
|
|
153
|
-
margin-left: 28px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.krs-info .add-kr-btn {
|
|
157
|
-
font-size: 12px;
|
|
158
|
-
font-family: PingFangSC-Regular, PingFang SC;
|
|
159
|
-
font-weight: 400;
|
|
160
|
-
color: #2879ff;
|
|
161
|
-
display: flex;
|
|
162
|
-
align-items: center;
|
|
163
|
-
line-height: 18px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.krs-info .add-kr-btn:hover {
|
|
167
|
-
color: #5c8eff;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.krs-info .add-kr-btn .add-kr-btn__icon {
|
|
171
|
-
margin-right: 4px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.krs-info .krs-info__total-weight {
|
|
175
|
-
font-size: 12px;
|
|
176
|
-
font-family: PingFangSC-Regular, PingFang SC;
|
|
177
|
-
font-weight: 400;
|
|
178
|
-
color: #a4acb9;
|
|
179
|
-
line-height: 18px;
|
|
180
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _popup = _interopRequireDefault(require("../../popup"));
|
|
13
|
-
|
|
14
|
-
var _utils = require("../utils");
|
|
15
|
-
|
|
16
|
-
var _weight = _interopRequireDefault(require("../img/weight.svg"));
|
|
17
|
-
|
|
18
|
-
require("./index.css");
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
|
-
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
|
-
|
|
24
|
-
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
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
-
|
|
34
|
-
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."); }
|
|
35
|
-
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
-
|
|
44
|
-
var ErrorContent = function ErrorContent(_ref) {
|
|
45
|
-
var hasErr = _ref.hasErr;
|
|
46
|
-
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, hasErr ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
47
|
-
className: "kr-weight__error-popup-text-wrapper"
|
|
48
|
-
}, "\u5141\u8BB8\u8F93\u5165 0-100 \u7684\u6570\u5B57\uFF0C\u652F\u6301\u5C0F\u6570\u70B9\u540E\u4E00\u4F4D") : null);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function KrItem(_ref2) {
|
|
52
|
-
var krData = _ref2.krData,
|
|
53
|
-
changeKr = _ref2.changeKr;
|
|
54
|
-
|
|
55
|
-
var _useState = (0, _react.useState)(false),
|
|
56
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
-
weightEditing = _useState2[0],
|
|
58
|
-
setWeightEditing = _useState2[1];
|
|
59
|
-
|
|
60
|
-
var _useState3 = (0, _react.useState)(krData.krWeight + ""),
|
|
61
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
-
editedWeight = _useState4[0],
|
|
63
|
-
setEditedWeight = _useState4[1];
|
|
64
|
-
|
|
65
|
-
var _useState5 = (0, _react.useState)(false),
|
|
66
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
67
|
-
hasErr = _useState6[0],
|
|
68
|
-
setHasErr = _useState6[1];
|
|
69
|
-
|
|
70
|
-
var _useState7 = (0, _react.useState)(""),
|
|
71
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
72
|
-
weightClass = _useState8[0],
|
|
73
|
-
setWeightClass = _useState8[1];
|
|
74
|
-
|
|
75
|
-
var weightRef = (0, _react.useRef)(); // 为了解决 react diff 对象没变值变了导致组件不重新渲染的问题
|
|
76
|
-
|
|
77
|
-
(0, _react.useEffect)(function () {
|
|
78
|
-
setEditedWeight(krData.krWeight + "");
|
|
79
|
-
}, [krData.krWeight]);
|
|
80
|
-
|
|
81
|
-
var onWeightClickHandler = function onWeightClickHandler() {
|
|
82
|
-
setWeightClass("");
|
|
83
|
-
|
|
84
|
-
if (!weightEditing) {
|
|
85
|
-
setEditedWeight(krData.krWeight + "");
|
|
86
|
-
setWeightEditing(true);
|
|
87
|
-
|
|
88
|
-
if (!hasErr) {
|
|
89
|
-
setWeightClass("kr-item-weight--focus");
|
|
90
|
-
} else {
|
|
91
|
-
setWeightClass("kr-item-weight--error");
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
setTimeout(function () {
|
|
95
|
-
weightRef.current && weightRef.current.focus();
|
|
96
|
-
}, 0);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
var onWeightInputBlurHandler = function onWeightInputBlurHandler() {
|
|
101
|
-
if (!(0, _utils.KrWeightValidator)(editedWeight)) {
|
|
102
|
-
setEditedWeight("100");
|
|
103
|
-
setWeightEditing(false);
|
|
104
|
-
} else {
|
|
105
|
-
setWeightEditing(false);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
setHasErr(false);
|
|
109
|
-
setWeightClass("");
|
|
110
|
-
changeKr(_objectSpread(_objectSpread({}, krData), {}, {
|
|
111
|
-
krWeight: !(0, _utils.KrWeightValidator)(editedWeight) ? "100" : editedWeight
|
|
112
|
-
}));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
var onWeightInputKeyDownHandler = function onWeightInputKeyDownHandler(e) {
|
|
116
|
-
if (e.key == "Enter") {
|
|
117
|
-
if (!(0, _utils.KrWeightValidator)(editedWeight)) {
|
|
118
|
-
setWeightEditing(false);
|
|
119
|
-
setEditedWeight("100");
|
|
120
|
-
} else {
|
|
121
|
-
setWeightEditing(false);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
setHasErr(false);
|
|
125
|
-
setWeightClass("");
|
|
126
|
-
changeKr(_objectSpread(_objectSpread({}, krData), {}, {
|
|
127
|
-
krWeight: !(0, _utils.KrWeightValidator)(editedWeight) ? "100" : editedWeight
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var onWeightInputChangeHandler = function onWeightInputChangeHandler(e) {
|
|
133
|
-
if (e.target.value.length > 6) return;
|
|
134
|
-
|
|
135
|
-
if (!(0, _utils.KrWeightValidator)(e.target.value)) {
|
|
136
|
-
setHasErr(true);
|
|
137
|
-
setWeightClass("kr-item-weight--error");
|
|
138
|
-
} else {
|
|
139
|
-
setHasErr(false);
|
|
140
|
-
setWeightClass("kr-item-weight--focus");
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
setEditedWeight(e.target.value);
|
|
144
|
-
changeKr(_objectSpread(_objectSpread({}, krData), {}, {
|
|
145
|
-
krWeight: e.target.value
|
|
146
|
-
}));
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
var handleMouseEnter = function handleMouseEnter() {
|
|
150
|
-
if (!hasErr && !weightEditing) {
|
|
151
|
-
setWeightClass("kr-item-weight--hover");
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
var handleMouseLeave = function handleMouseLeave() {
|
|
156
|
-
if (!hasErr && !weightEditing) {
|
|
157
|
-
setWeightClass("");
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
return (
|
|
162
|
-
/*#__PURE__*/
|
|
163
|
-
// @ts-ignore
|
|
164
|
-
_react["default"].createElement(_popup["default"], {
|
|
165
|
-
popup: /*#__PURE__*/_react["default"].createElement(ErrorContent, {
|
|
166
|
-
hasErr: hasErr && weightEditing
|
|
167
|
-
}),
|
|
168
|
-
popupVisible: true,
|
|
169
|
-
popupPlacement: "top",
|
|
170
|
-
forceRender: true,
|
|
171
|
-
action: ["focus"],
|
|
172
|
-
destroyPopupOnHide: true
|
|
173
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
174
|
-
className: "kr-item-weight ".concat(weightClass),
|
|
175
|
-
onMouseLeave: handleMouseLeave,
|
|
176
|
-
onMouseEnter: handleMouseEnter,
|
|
177
|
-
onClick: onWeightClickHandler
|
|
178
|
-
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
179
|
-
className: "kr-item-weight__icon",
|
|
180
|
-
src: _weight["default"],
|
|
181
|
-
alt: "\u6743\u91CD"
|
|
182
|
-
}), weightEditing ? /*#__PURE__*/_react["default"].createElement("input", {
|
|
183
|
-
className: "kr-item-weight__input",
|
|
184
|
-
ref: weightRef,
|
|
185
|
-
value: editedWeight,
|
|
186
|
-
onBlur: onWeightInputBlurHandler,
|
|
187
|
-
onKeyDown: onWeightInputKeyDownHandler,
|
|
188
|
-
onChange: onWeightInputChangeHandler
|
|
189
|
-
}) : /*#__PURE__*/_react["default"].createElement("span", null, editedWeight), "%"))
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
var _default = KrItem;
|
|
194
|
-
exports["default"] = _default;
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _uuid = _interopRequireDefault(require("uuid"));
|
|
13
|
-
|
|
14
|
-
var _bsGlobal = require("../../../utils/bs-global");
|
|
15
|
-
|
|
16
|
-
var _roundWeight = require("../../../utils/roundWeight");
|
|
17
|
-
|
|
18
|
-
var _krItem = _interopRequireDefault(require("./krItem"));
|
|
19
|
-
|
|
20
|
-
var _requestApi = require("../request-api");
|
|
21
|
-
|
|
22
|
-
var _popDownNotification = require("../../pop-down-notification");
|
|
23
|
-
|
|
24
|
-
var _okrCreateSuggest = require("../fields/okr-create-suggest");
|
|
25
|
-
|
|
26
|
-
var _krAdd = _interopRequireDefault(require("../img/kr-add.svg"));
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
|
-
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); }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
41
|
-
|
|
42
|
-
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."); }
|
|
43
|
-
|
|
44
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
45
|
-
|
|
46
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
|
-
|
|
48
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
|
|
50
|
-
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."); }
|
|
51
|
-
|
|
52
|
-
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); }
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
56
|
-
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; }
|
|
57
|
-
|
|
58
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
|
-
|
|
60
|
-
function KrDatas(props) {
|
|
61
|
-
var krs = props.krs,
|
|
62
|
-
isCustomWeight = props.isCustomWeight,
|
|
63
|
-
wrapperRef = props.wrapperRef,
|
|
64
|
-
setKrDatas = props.setKrDatas,
|
|
65
|
-
krDatas = props.krDatas,
|
|
66
|
-
setIsCustomWeight = props.setIsCustomWeight,
|
|
67
|
-
container = props.container,
|
|
68
|
-
handleKrInputStateChange = props.handleKrInputStateChange,
|
|
69
|
-
setKrsCheckResult = props.setKrsCheckResult,
|
|
70
|
-
krIsValidate = props.krIsValidate,
|
|
71
|
-
setKrIsValidate = props.setKrIsValidate,
|
|
72
|
-
setIsInputContent = props.setIsInputContent;
|
|
73
|
-
var krCheckId = 0;
|
|
74
|
-
|
|
75
|
-
var _useState = (0, _react.useState)(),
|
|
76
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
-
inputKrInfo = _useState2[0],
|
|
78
|
-
setInputKrInfo = _useState2[1];
|
|
79
|
-
|
|
80
|
-
var _useState3 = (0, _react.useState)([]),
|
|
81
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
82
|
-
krsCheckFriendlyResult = _useState4[0],
|
|
83
|
-
setKrsCheckFriendlyResult = _useState4[1]; // 存储每条kr的校验结果,用了统计最后的校验结果
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var timerRef = (0, _react.useRef)();
|
|
87
|
-
var krNameIsEmpty = (0, _react.useRef)(!inputKrInfo || !inputKrInfo.mileStoneName);
|
|
88
|
-
var setting = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting;
|
|
89
|
-
|
|
90
|
-
var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
|
|
91
|
-
Name = _getUserInfo.Name,
|
|
92
|
-
Id = _getUserInfo.Id,
|
|
93
|
-
UserAvatar = _getUserInfo.UserAvatar;
|
|
94
|
-
|
|
95
|
-
var openKrWeight = setting.KrWeight;
|
|
96
|
-
var total = 0;
|
|
97
|
-
|
|
98
|
-
if (isCustomWeight) {
|
|
99
|
-
krs.forEach(function (kr) {
|
|
100
|
-
return total += Number(kr.krWeight);
|
|
101
|
-
}); // total = RoundWeight(total); // 不知道为啥,这样如果自定义了总的超过100了还是会展示total100
|
|
102
|
-
|
|
103
|
-
total = total.toFixed(1);
|
|
104
|
-
} else {
|
|
105
|
-
total = 100;
|
|
106
|
-
} // 添加KR
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
function addKr() {
|
|
110
|
-
setKrIsValidate(false);
|
|
111
|
-
setTimeout(function () {
|
|
112
|
-
if (!wrapperRef.current || krDatas.length < 6) return;
|
|
113
|
-
wrapperRef.current.scrollTop = wrapperRef.current.scrollHeight;
|
|
114
|
-
}, 0);
|
|
115
|
-
|
|
116
|
-
if (!isCustomWeight) {
|
|
117
|
-
setKrDatas([].concat(_toConsumableArray(krDatas.map(function (kr) {
|
|
118
|
-
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
119
|
-
krWeight: (0, _roundWeight.RoundWeight)(100 / (krDatas.length + 1))
|
|
120
|
-
});
|
|
121
|
-
})), [{
|
|
122
|
-
uuid: _uuid["default"].v1(),
|
|
123
|
-
principalId: Id,
|
|
124
|
-
principalName: Name,
|
|
125
|
-
userAvatar: UserAvatar,
|
|
126
|
-
krWeight: (0, _roundWeight.RoundWeight)(100 / (krDatas.length + 1)),
|
|
127
|
-
mileStoneName: "",
|
|
128
|
-
confidenceIndex: 5
|
|
129
|
-
}]));
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
setKrDatas([].concat(_toConsumableArray(krDatas), [{
|
|
134
|
-
uuid: _uuid["default"].v1(),
|
|
135
|
-
principalId: Id,
|
|
136
|
-
principalName: Name,
|
|
137
|
-
userAvatar: UserAvatar,
|
|
138
|
-
krWeight: 0,
|
|
139
|
-
mileStoneName: "",
|
|
140
|
-
confidenceIndex: 5
|
|
141
|
-
}]));
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
var getKrAnalysisInfo = function getKrAnalysisInfo() {
|
|
145
|
-
krCheckId++;
|
|
146
|
-
var tempCheckId = krCheckId;
|
|
147
|
-
(0, _requestApi.getKrAnalysisInfos)({
|
|
148
|
-
text: inputKrInfo.mileStoneName
|
|
149
|
-
}) //@ts-ignore
|
|
150
|
-
.then(function (data) {
|
|
151
|
-
if (tempCheckId !== krCheckId) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
var tempKrCheckResult = _toConsumableArray(krsCheckFriendlyResult);
|
|
156
|
-
|
|
157
|
-
var targetKrIndex = tempKrCheckResult.findIndex(function (kr) {
|
|
158
|
-
return kr.uuid === inputKrInfo.uuid;
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
if (targetKrIndex !== -1) {
|
|
162
|
-
tempKrCheckResult.splice(targetKrIndex, 1, {
|
|
163
|
-
uuid: inputKrInfo.uuid,
|
|
164
|
-
hasNumWords: data.hasNumWords
|
|
165
|
-
});
|
|
166
|
-
} else {
|
|
167
|
-
tempKrCheckResult.push({
|
|
168
|
-
uuid: inputKrInfo.uuid,
|
|
169
|
-
hasNumWords: data.hasNumWords
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (krNameIsEmpty.current) {
|
|
174
|
-
setKrsCheckResult({
|
|
175
|
-
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
176
|
-
friendlyResult: []
|
|
177
|
-
});
|
|
178
|
-
} else {
|
|
179
|
-
setKrsCheckFriendlyResult(tempKrCheckResult);
|
|
180
|
-
setKrsCheckResult({
|
|
181
|
-
finalResult: data.hasNumWords ? _okrCreateSuggest.EOkrCreateSuggestResultType.correct : _okrCreateSuggest.EOkrCreateSuggestResultType.wrong,
|
|
182
|
-
friendlyResult: tempKrCheckResult
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
})["catch"](function (err) {
|
|
186
|
-
_popDownNotification.Toast.Error(err);
|
|
187
|
-
})["finally"](function () {
|
|
188
|
-
setIsInputContent(false);
|
|
189
|
-
});
|
|
190
|
-
}; // 修改KR
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
var changeKr = function changeKr(kr) {
|
|
194
|
-
var index = krDatas.findIndex(function (k) {
|
|
195
|
-
return k.uuid == kr.uuid;
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
if (krDatas[index].krWeight != kr.krWeight) {
|
|
199
|
-
setIsCustomWeight(true);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
var newKrs = _toConsumableArray(krDatas);
|
|
203
|
-
|
|
204
|
-
newKrs[index] = kr;
|
|
205
|
-
setKrDatas(newKrs);
|
|
206
|
-
setInputKrInfo(kr);
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
(0, _react.useEffect)(function () {
|
|
210
|
-
// 防抖
|
|
211
|
-
krNameIsEmpty.current = !inputKrInfo || !inputKrInfo.mileStoneName;
|
|
212
|
-
|
|
213
|
-
if (!inputKrInfo || !inputKrInfo.mileStoneName) {
|
|
214
|
-
setIsInputContent(false);
|
|
215
|
-
setKrsCheckResult({
|
|
216
|
-
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
217
|
-
friendlyResult: []
|
|
218
|
-
});
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if (timerRef.current) {
|
|
223
|
-
clearTimeout(timerRef.current);
|
|
224
|
-
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
229
|
-
return function () {
|
|
230
|
-
clearTimeout(timerRef.current);
|
|
231
|
-
};
|
|
232
|
-
}, [inputKrInfo, setIsInputContent]); // 删除KR
|
|
233
|
-
|
|
234
|
-
var deleteKr = function deleteKr(id) {
|
|
235
|
-
setKrIsValidate(false);
|
|
236
|
-
var newKrDatas = krDatas.filter(function (k) {
|
|
237
|
-
return k.uuid !== id;
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
if (!isCustomWeight && openKrWeight) {
|
|
241
|
-
newKrDatas = newKrDatas.map(function (kr) {
|
|
242
|
-
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
243
|
-
krWeight: (0, _roundWeight.RoundWeight)(100 / newKrDatas.length)
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
setKrDatas(newKrDatas);
|
|
249
|
-
|
|
250
|
-
var tempKrCheckResult = _toConsumableArray(krsCheckFriendlyResult);
|
|
251
|
-
|
|
252
|
-
var targetKrIndex = tempKrCheckResult.findIndex(function (kr) {
|
|
253
|
-
return kr.uuid === inputKrInfo.uuid;
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
if (targetKrIndex !== -1) {
|
|
257
|
-
tempKrCheckResult.splice(targetKrIndex, 1);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
setKrsCheckFriendlyResult(tempKrCheckResult);
|
|
261
|
-
setKrsCheckResult({
|
|
262
|
-
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
263
|
-
friendlyResult: tempKrCheckResult
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
var onKrInputStateChange = (0, _react.useCallback)(function (isFocus, krInfo) {
|
|
268
|
-
setInputKrInfo(krInfo);
|
|
269
|
-
handleKrInputStateChange && handleKrInputStateChange(isFocus);
|
|
270
|
-
}, []);
|
|
271
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, krs.map(function (kr, index) {
|
|
272
|
-
return /*#__PURE__*/_react["default"].createElement(_krItem["default"], {
|
|
273
|
-
key: index,
|
|
274
|
-
krData: kr,
|
|
275
|
-
changeKr: changeKr,
|
|
276
|
-
deleteKr: deleteKr,
|
|
277
|
-
container: container,
|
|
278
|
-
index: index + 1,
|
|
279
|
-
onKrInputStateChange: onKrInputStateChange,
|
|
280
|
-
onAddKr: addKr,
|
|
281
|
-
krIsValidate: krIsValidate,
|
|
282
|
-
setIsInputContent: setIsInputContent
|
|
283
|
-
});
|
|
284
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
285
|
-
className: "krs-info"
|
|
286
|
-
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
287
|
-
className: "add-kr-btn",
|
|
288
|
-
onClick: addKr
|
|
289
|
-
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
290
|
-
className: "add-kr-btn__icon",
|
|
291
|
-
src: _krAdd["default"],
|
|
292
|
-
alt: "\u6DFB\u52A0okr"
|
|
293
|
-
}), "\u6DFB\u52A0 KR"), krs.length > 0 && openKrWeight && /*#__PURE__*/_react["default"].createElement("span", {
|
|
294
|
-
className: "krs-info__total-weight"
|
|
295
|
-
}, "\u603B\u6743\u91CD\uFF1A", total, "%")));
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
var _default = KrDatas;
|
|
299
|
-
exports["default"] = _default;
|