@titaui/pc 1.12.7-beta.4 → 1.12.9-beta.1
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/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
- package/lib/components/create-okr-modal/fields/index.css +14 -3
- package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
- package/lib/components/create-okr-modal/fields/okr-case.js +7 -5
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +215 -142
- package/lib/components/create-okr-modal/kr-items/index.css +23 -13
- package/lib/components/create-okr-modal/kr-items/krDatas.js +96 -76
- package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/dynamic/components/title/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/index.js +4 -15
- package/lib/components/eReport/eReportLists/reportList.js +29 -30
- package/lib/components/eReport/eReportShare/style.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
- package/lib/components/menus/components/menu-tree/tree-node/index.css +0 -120
- package/lib/components/menus/components/menu-tree/tree-node/index.js +2 -22
- package/lib/components/menus/i18n.js +0 -8
- package/lib/components/menus/index.js +0 -6
- package/lib/components/nav-top/components/menu/index.js +4 -4
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
- package/lib/components/okr-detail/components/ao-nice/index.css +0 -1
- package/lib/components/okr-detail/components/header/edit-name.js +76 -39
- package/lib/components/okr-detail/components/header/index.css +122 -41
- package/lib/components/okr-detail/components/header/index.js +45 -48
- package/lib/components/{dynamic/dynamic-item/components/progress/components/okr-progress/index.js → okr-detail/components/header/o-classify.js} +84 -152
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/o-progress-update/index.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
- package/lib/components/okr-detail/components/tab-panel-content/index.css +1 -0
- package/lib/components/okr-detail/detail-header/index.js +11 -5
- package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
- package/lib/components/okr-detail/okr-list/index.css +9 -0
- package/lib/components/okr-detail/okr-list/index.js +25 -25
- package/lib/components/okr-detail/request-apis.js +73 -69
- package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
- package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-flow/child-node/kr-node.js +3 -1
- package/lib/components/okr-flow/child-node/work-node.js +3 -1
- package/lib/components/okr-flow/export-modal/color.png +0 -0
- package/lib/components/okr-flow/export-modal/index.css +28 -13
- package/lib/components/okr-flow/export-modal/index.js +57 -14
- package/lib/components/okr-flow/export-modal/trans1.png +0 -0
- package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
- package/lib/components/okr-progress/components/o-progress/index.js +3 -1
- package/lib/components/okr-progress/components/o-progress-update/index.js +2 -2
- package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
- package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
- package/lib/components/okr-share/common-painter/utils.js +187 -36
- package/lib/components/okr-share/index.css +5 -4
- package/lib/components/okr-share/pink-card/card.js +3 -3
- package/lib/components/okr-share/pink-card/drawKrs.js +97 -18
- package/lib/components/okr-share/pink-card/index.js +20 -12
- package/lib/components/open-data-painter/index.js +6 -5
- package/lib/components/period-selector/components/button/style.js +1 -1
- package/lib/components/period-selector/index.css +1 -0
- package/lib/components/period-selector/index.js +7 -2
- package/lib/components/picker/components/picker-trigger/index.js +2 -47
- package/lib/components/picker/picker-panels.js +4 -45
- package/lib/components/picker/picker.js +3 -7
- package/lib/components/search-input/index.js +0 -5
- package/lib/components/search-key-handle/index.js +12 -10
- package/lib/components/select-layer/index.js +22 -8
- package/lib/components/task-relation-modal/helper.js +1 -56
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +1 -4
- package/lib/components/task-relation-modal/okr-relation/request-api.js +2 -6
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +2 -2
- package/lib/components/task-relation-modal/request-api.js +5 -2
- package/lib/components/task-relation-modal/tree/work-tree/index.js +27 -31
- package/lib/components/task-relation-modal/tree/work-tree/search-form.js +22 -3
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/task-relation-modal/tree-node/work-node/index.js +11 -11
- package/lib/components/textarea/index.js +5 -7
- package/lib/components/tooltip/tooltip.js +9 -4
- package/lib/components/upload/components/uploadedPreview.js +17 -17
- package/lib/components/upload/index.js +23 -23
- package/lib/components/user-selector/category-selector-panel/depart-tree.js +3 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +2 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +31 -17
- package/lib/components/user-selector/export-modules/multiple-user-selector--bak/index.css +1 -1
- package/lib/components/user-selector/searched-panel/index.js +4 -4
- package/lib/components/wechat-btn/index.css +5 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/lib/index.js +0 -48
- package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
- package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
- package/lib/pages/new-okr-list/header/index.js +15 -15
- package/lib/utils/bs-global.js +1 -1
- package/lib/utils/constant.js +2 -8
- package/lib/utils/helpers.js +11 -56
- package/lib/utils/hooks.js +5 -5
- package/lib/utils/open-data.js +216 -66
- package/lib/utils/tita-okr-cycle.js +3 -3
- package/package.json +2 -2
- package/lib/components/attachments-preview/index.css +0 -11
- package/lib/components/attachments-preview/index.js +0 -112
- package/lib/components/auto-save/img/failed.svg +0 -17
- package/lib/components/auto-save/img/success.svg +0 -16
- package/lib/components/auto-save/index.css +0 -39
- package/lib/components/auto-save/index.js +0 -78
- package/lib/components/auto-save/interface.js +0 -5
- package/lib/components/color-date-picker/index.css +0 -65
- package/lib/components/color-date-picker/index.js +0 -123
- package/lib/components/color-date-picker/interface.js +0 -14
- package/lib/components/dialog-upload/img/doc.svg +0 -1
- package/lib/components/dialog-upload/img/other.svg +0 -1
- package/lib/components/dialog-upload/img/pdf.svg +0 -1
- package/lib/components/dialog-upload/img/ppt.svg +0 -1
- package/lib/components/dialog-upload/img/radio.svg +0 -1
- package/lib/components/dialog-upload/img/video.svg +0 -1
- package/lib/components/dialog-upload/img/xls.svg +0 -1
- package/lib/components/dialog-upload/index.css +0 -77
- package/lib/components/dialog-upload/index.js +0 -332
- package/lib/components/dialog-upload/type.js +0 -35
- package/lib/components/dialog-upload/uploaded-preview.css +0 -77
- package/lib/components/dialog-upload/uploaded-preview.js +0 -132
- package/lib/components/dialog-upload/util.js +0 -131
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/encourage.js +0 -119
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/APP-shoucang-m.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/ascore.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curEfforts.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curGood.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/curGreat.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/efforts.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/good.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/great.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/halfscore.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/loading.gif +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/score.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/img/top.svg +0 -14
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/index.css +0 -68
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/index.js +0 -118
- package/lib/components/dynamic/dynamic-item/components/comments-dialog/rate.js +0 -143
- package/lib/components/dynamic/dynamic-item/components/header/img/evalute.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/fighting.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/happy.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/long-story.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/header/img/pressure.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.css +0 -170
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +0 -120
- package/lib/components/dynamic/dynamic-item/components/okr-progress/interface.js +0 -5
- package/lib/components/dynamic/dynamic-item/components/okr-progress/request-api.js +0 -10
- package/lib/components/dynamic/dynamic-item/components/okr-progress/utils.js +0 -10
- package/lib/components/dynamic/dynamic-item/components/progress/components/kr-progress/index.css +0 -8
- package/lib/components/dynamic/dynamic-item/components/progress/components/kr-progress/index.js +0 -26
- package/lib/components/dynamic/dynamic-item/components/progress/components/o-progress/index.css +0 -8
- package/lib/components/dynamic/dynamic-item/components/progress/components/o-progress/index.js +0 -26
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/index.css +0 -197
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/request-api.js +0 -20
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/util.js +0 -134
- package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.css +0 -10
- package/lib/components/dynamic/dynamic-item/components/progress/components/task-progress/index.js +0 -60
- package/lib/components/dynamic/dynamic-item/components/progress/index.css +0 -25
- package/lib/components/dynamic/dynamic-item/components/progress/index.js +0 -71
- package/lib/components/dynamic/dynamic-item/components/progress/interface.js +0 -5
- package/lib/components/dynamic/dynamic-item/components/schedule/index.css +0 -31
- package/lib/components/dynamic/dynamic-item/components/schedule/index.js +0 -59
- package/lib/components/dynamic/dynamic-item/components/schedule/interface.js +0 -5
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/evalute.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/fighting.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/happy.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/long-story.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/img/pressure.png +0 -0
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.css +0 -136
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +0 -364
- package/lib/components/dynamic/dynamic-item/components/table-row-o-project/index.css +0 -24
- package/lib/components/dynamic/dynamic-item/components/table-row-o-project/index.js +0 -52
- package/lib/components/dynamic/dynamic-item/components/table-row-o-project/interface.js +0 -5
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +0 -50
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +0 -65
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/interface.js +0 -5
- package/lib/components/dynamic/dynamic-item/components/task-progress/index.css +0 -201
- package/lib/components/dynamic/dynamic-item/components/task-progress/index.js +0 -95
- package/lib/components/dynamic/dynamic-item/components/task-progress/interface.js +0 -5
- package/lib/components/dynamic/dynamic-item/components/task-progress/utils.js +0 -10
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/come-on-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/come-on-small.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/evaluate-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/nice-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/nice-small.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/very-good-big.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/img/very-good-small.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.css +0 -32
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +0 -43
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.css +0 -37
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +0 -79
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/evalute.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/fighting.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/happy.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/long-story.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/img/pressure.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.css +0 -155
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +0 -155
- package/lib/components/import-modal/helper.js +0 -179
- package/lib/components/import-modal/image/loading.gif +0 -0
- package/lib/components/import-modal/import-okr-modal/index.css +0 -18
- package/lib/components/import-modal/import-okr-modal/index.js +0 -132
- package/lib/components/import-modal/import-task-modal/index.css +0 -18
- package/lib/components/import-modal/import-task-modal/index.js +0 -240
- package/lib/components/import-modal/import-task-modal/search-form.js +0 -135
- package/lib/components/import-modal/index.css +0 -30
- package/lib/components/import-modal/index.js +0 -20
- package/lib/components/import-modal/radio.js +0 -62
- package/lib/components/import-modal/request-api.js +0 -204
- package/lib/components/import-modal/search/category-select.js +0 -74
- package/lib/components/import-modal/search/okr-classify-select.js +0 -74
- package/lib/components/import-modal/search/okr-status-select.js +0 -74
- package/lib/components/import-modal/search/okr-type-select.js +0 -87
- package/lib/components/import-modal/search/principal.js +0 -135
- package/lib/components/import-modal/search/relation.js +0 -77
- package/lib/components/import-modal/search/search-dropdown/index.css +0 -50
- package/lib/components/import-modal/search/search-dropdown/index.js +0 -32
- package/lib/components/import-modal/search/task-relation.js +0 -83
- package/lib/components/import-modal/search/task-status-select.js +0 -87
- package/lib/components/import-modal/search/work-relation.js +0 -83
- package/lib/components/import-modal/search/work-status-select.js +0 -74
- package/lib/components/import-modal/tree/okr-tree/index.css +0 -61
- package/lib/components/import-modal/tree/okr-tree/index.js +0 -267
- package/lib/components/import-modal/tree/okr-tree/search-form.js +0 -161
- package/lib/components/import-modal/tree/task-work-tree/index.css +0 -123
- package/lib/components/import-modal/tree/task-work-tree/index.js +0 -187
- package/lib/components/import-modal/tree-node/index.css +0 -0
- package/lib/components/import-modal/tree-node/index.js +0 -51
- package/lib/components/import-modal/tree-node/kr-node/index.css +0 -58
- package/lib/components/import-modal/tree-node/kr-node/index.js +0 -108
- package/lib/components/import-modal/tree-node/milestone-node/index.css +0 -61
- package/lib/components/import-modal/tree-node/milestone-node/index.js +0 -118
- package/lib/components/import-modal/tree-node/o-node/index.css +0 -46
- package/lib/components/import-modal/tree-node/o-node/index.js +0 -138
- package/lib/components/import-modal/tree-node/work-node/index.css +0 -51
- package/lib/components/import-modal/tree-node/work-node/index.js +0 -108
- package/lib/components/menus/components/menu-tree/images/summary-menu/caidan-enjoy.svg +0 -14
- package/lib/components/menus/components/menu-tree/images/summary-menu/my-setup.svg +0 -18
- package/lib/components/menus/components/menu-tree/images/summary-menu/my-zongjie.svg +0 -15
- package/lib/components/menus/components/menu-tree/images/summary-menu/zongjie-s.svg +0 -15
- package/lib/components/menus/components/menu-tree/tree-node/subordinates.js +0 -74
- package/lib/components/menus/components/menu-tree/tree-node/summary-share.js +0 -74
- package/lib/components/menus/export-modules/summary-menus/depart-menus/helper.js +0 -56
- package/lib/components/menus/export-modules/summary-menus/depart-menus/index.css +0 -32
- package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +0 -201
- package/lib/components/menus/export-modules/summary-menus/index.css +0 -9
- package/lib/components/menus/export-modules/summary-menus/index.js +0 -134
- package/lib/components/menus/export-modules/summary-menus/menu-highlight.js +0 -76
- package/lib/components/menus/export-modules/summary-menus/menus.js +0 -199
- package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +0 -199
- package/lib/components/new-confidence/constant.js +0 -53
- package/lib/components/new-confidence/img/1.svg +0 -40
- package/lib/components/new-confidence/img/10.svg +0 -33
- package/lib/components/new-confidence/img/2.svg +0 -40
- package/lib/components/new-confidence/img/3.svg +0 -40
- package/lib/components/new-confidence/img/4.svg +0 -40
- package/lib/components/new-confidence/img/5.svg +0 -40
- package/lib/components/new-confidence/img/6.svg +0 -40
- package/lib/components/new-confidence/img/7.svg +0 -40
- package/lib/components/new-confidence/img/8.svg +0 -40
- package/lib/components/new-confidence/img/9.svg +0 -40
- package/lib/components/new-confidence/index.css +0 -62
- package/lib/components/new-confidence/index.js +0 -115
- package/lib/components/new-confidence/interface.js +0 -5
- package/lib/components/picker/components/panels/week-panel/index.css +0 -42
- package/lib/components/picker/components/panels/week-panel/index.js +0 -49
- package/lib/components/picker/components/panels/week-panel/utils.js +0 -45
- package/lib/components/picker/components/panels/week-panel/week-body.js +0 -79
- package/lib/components/picker/components/panels/week-panel/week-head.js +0 -80
- package/lib/components/rate/index.js +0 -50
- package/lib/components/regulation-setting-item/index.css +0 -33
- package/lib/components/regulation-setting-item/index.js +0 -37
- package/lib/components/rich-editor-at/components/index.css +0 -66
- package/lib/components/rich-editor-at/components/index.js +0 -188
- package/lib/components/rich-editor-at/index.css +0 -40
- package/lib/components/rich-editor-at/index.js +0 -108
- package/lib/components/rich-editor-upload/index.css +0 -11
- package/lib/components/rich-editor-upload/index.js +0 -84
- package/lib/utils/planDataJson.js +0 -11115
|
@@ -9,10 +9,14 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var _richEditor = require("@titaui/rich-editor");
|
|
13
|
+
|
|
12
14
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
13
15
|
|
|
14
16
|
var _titaUi = require("tita-ui");
|
|
15
17
|
|
|
18
|
+
var _scrollbar = _interopRequireDefault(require("../scrollbar"));
|
|
19
|
+
|
|
16
20
|
var _bsGlobal = require("../../utils/bs-global");
|
|
17
21
|
|
|
18
22
|
var _roundWeight = require("../../utils/roundWeight");
|
|
@@ -108,6 +112,13 @@ var initOCheckResult = function initOCheckResult() {
|
|
|
108
112
|
});
|
|
109
113
|
};
|
|
110
114
|
|
|
115
|
+
var DefaultOkrNameData = {
|
|
116
|
+
mentionUsers: [],
|
|
117
|
+
pureText: '',
|
|
118
|
+
pureTextExcludeAt: '',
|
|
119
|
+
richText: undefined
|
|
120
|
+
};
|
|
121
|
+
|
|
111
122
|
function CreateOkrModal(_ref, ref) {
|
|
112
123
|
var initCycle = _ref.initCycle,
|
|
113
124
|
userInfo = _ref.userInfo,
|
|
@@ -123,10 +134,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
123
134
|
_ref$isFromAssess = _ref.isFromAssess,
|
|
124
135
|
isFromAssess = _ref$isFromAssess === void 0 ? false : _ref$isFromAssess;
|
|
125
136
|
|
|
126
|
-
var _useState = (0, _react.useState)(
|
|
137
|
+
var _useState = (0, _react.useState)('initialization'),
|
|
127
138
|
_useState2 = _slicedToArray(_useState, 2),
|
|
128
|
-
|
|
129
|
-
|
|
139
|
+
richEditorStatus = _useState2[0],
|
|
140
|
+
setRichEditorStatus = _useState2[1];
|
|
141
|
+
|
|
142
|
+
var _useState3 = (0, _react.useState)(visible),
|
|
143
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
144
|
+
isVisible = _useState4[0],
|
|
145
|
+
setVisible = _useState4[1]; // @ts-ignore
|
|
130
146
|
|
|
131
147
|
|
|
132
148
|
var userId = BSGlobal.loginUserInfo.Id;
|
|
@@ -140,80 +156,80 @@ function CreateOkrModal(_ref, ref) {
|
|
|
140
156
|
Id = _ref2.Id,
|
|
141
157
|
UserAvatar = _ref2.UserAvatar;
|
|
142
158
|
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
var _useState5 = (0, _react.useState)(DefaultOkrNameData),
|
|
160
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
161
|
+
okrNameData = _useState6[0],
|
|
162
|
+
setOkrNameData = _useState6[1]; // 目标名称
|
|
147
163
|
|
|
148
164
|
|
|
149
|
-
var
|
|
165
|
+
var _useState7 = (0, _react.useState)({
|
|
150
166
|
name: Name,
|
|
151
167
|
id: Id,
|
|
152
168
|
avatar: UserAvatar
|
|
153
169
|
}),
|
|
154
|
-
|
|
155
|
-
user =
|
|
156
|
-
setUser =
|
|
170
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
171
|
+
user = _useState8[0],
|
|
172
|
+
setUser = _useState8[1]; // 负责人
|
|
157
173
|
|
|
158
174
|
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
isCustomWeight =
|
|
162
|
-
setIsCustomWeight =
|
|
175
|
+
var _useState9 = (0, _react.useState)(false),
|
|
176
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
177
|
+
isCustomWeight = _useState10[0],
|
|
178
|
+
setIsCustomWeight = _useState10[1]; // 是否自定义权重
|
|
163
179
|
|
|
164
180
|
|
|
165
|
-
var
|
|
181
|
+
var _useState11 = (0, _react.useState)({
|
|
166
182
|
departmentId: 0,
|
|
167
183
|
departmentName: ''
|
|
168
184
|
}),
|
|
169
|
-
|
|
170
|
-
dept =
|
|
171
|
-
setDept =
|
|
185
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
186
|
+
dept = _useState12[0],
|
|
187
|
+
setDept = _useState12[1]; // 部门信息 用于目标类型为部门时
|
|
172
188
|
|
|
173
189
|
|
|
174
|
-
var
|
|
190
|
+
var _useState13 = (0, _react.useState)({
|
|
175
191
|
groupId: 0,
|
|
176
192
|
groupName: ''
|
|
177
193
|
}),
|
|
178
|
-
|
|
179
|
-
team =
|
|
180
|
-
setTeam =
|
|
194
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
195
|
+
team = _useState14[0],
|
|
196
|
+
setTeam = _useState14[1]; // 团队信息 用于目标类型为团队时
|
|
181
197
|
|
|
182
198
|
|
|
183
|
-
var
|
|
199
|
+
var _useState15 = (0, _react.useState)({
|
|
184
200
|
typeName: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual'),
|
|
185
201
|
typeId: 1
|
|
186
202
|
}),
|
|
187
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
188
|
-
type = _useState14[0],
|
|
189
|
-
setType = _useState14[1]; // 目标类型
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var _useState15 = (0, _react.useState)(initCycle),
|
|
193
203
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
194
|
-
|
|
195
|
-
|
|
204
|
+
type = _useState16[0],
|
|
205
|
+
setType = _useState16[1]; // 目标类型
|
|
196
206
|
|
|
197
207
|
|
|
198
|
-
var _useState17 = (0, _react.useState)(),
|
|
208
|
+
var _useState17 = (0, _react.useState)(initCycle),
|
|
199
209
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
cycle = _useState18[0],
|
|
211
|
+
setCycle = _useState18[1]; // 目标周期信息
|
|
202
212
|
|
|
203
213
|
|
|
204
|
-
var _useState19 = (0, _react.useState)(
|
|
214
|
+
var _useState19 = (0, _react.useState)(),
|
|
205
215
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
206
|
-
|
|
207
|
-
|
|
216
|
+
okrClassify = _useState20[0],
|
|
217
|
+
setOkrClassify = _useState20[1]; // 目标类别
|
|
208
218
|
|
|
209
219
|
|
|
210
|
-
var _useState21 = (0, _react.useState)(
|
|
220
|
+
var _useState21 = (0, _react.useState)(1),
|
|
211
221
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
212
|
-
|
|
213
|
-
|
|
222
|
+
visibility = _useState22[0],
|
|
223
|
+
setVisibility = _useState22[1]; // 可见性
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
var _useState23 = (0, _react.useState)({}),
|
|
227
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
228
|
+
visiableLimit = _useState24[0],
|
|
229
|
+
setVisiableLimit = _useState24[1]; // 可见性指定范围
|
|
214
230
|
|
|
215
231
|
|
|
216
|
-
var
|
|
232
|
+
var _useState25 = (0, _react.useState)([{
|
|
217
233
|
// kr信息
|
|
218
234
|
uuid: _uuid["default"].v1(),
|
|
219
235
|
principalId: Id,
|
|
@@ -221,91 +237,94 @@ function CreateOkrModal(_ref, ref) {
|
|
|
221
237
|
userAvatar: UserAvatar,
|
|
222
238
|
krWeight: 100,
|
|
223
239
|
mileStoneName: '',
|
|
240
|
+
mileStoneNamePureTextExcludeAt: '',
|
|
241
|
+
mileStoneNameRichText: undefined,
|
|
242
|
+
aiteUsers: [],
|
|
224
243
|
confidenceIndex: 5
|
|
225
244
|
}]),
|
|
226
|
-
|
|
227
|
-
krDatas =
|
|
228
|
-
setKrDatas =
|
|
245
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
246
|
+
krDatas = _useState26[0],
|
|
247
|
+
setKrDatas = _useState26[1];
|
|
229
248
|
|
|
230
|
-
var
|
|
249
|
+
var _useState27 = (0, _react.useState)({
|
|
231
250
|
// 对其目标
|
|
232
251
|
parentWorkId: 0,
|
|
233
252
|
parentWorkName: '',
|
|
234
253
|
parentType: 0,
|
|
235
254
|
parentKrId: 0
|
|
236
255
|
}),
|
|
237
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
238
|
-
parent = _useState26[0],
|
|
239
|
-
setParent = _useState26[1];
|
|
240
|
-
|
|
241
|
-
var _useState27 = (0, _react.useState)(false),
|
|
242
256
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
243
|
-
|
|
244
|
-
|
|
257
|
+
parent = _useState28[0],
|
|
258
|
+
setParent = _useState28[1];
|
|
245
259
|
|
|
246
260
|
var _useState29 = (0, _react.useState)(false),
|
|
247
261
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
248
|
-
|
|
249
|
-
|
|
262
|
+
oNameIsInput = _useState30[0],
|
|
263
|
+
setONameIsInput = _useState30[1];
|
|
250
264
|
|
|
251
|
-
var _useState31 = (0, _react.useState)(
|
|
265
|
+
var _useState31 = (0, _react.useState)(false),
|
|
252
266
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
253
|
-
|
|
254
|
-
|
|
267
|
+
krIsInput = _useState32[0],
|
|
268
|
+
setKrIsInput = _useState32[1];
|
|
255
269
|
|
|
256
|
-
var _useState33 = (0, _react.useState)(
|
|
270
|
+
var _useState33 = (0, _react.useState)(initOCheckResult()),
|
|
271
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
272
|
+
oNameCheckResult = _useState34[0],
|
|
273
|
+
setONameCheckResult = _useState34[1];
|
|
274
|
+
|
|
275
|
+
var _useState35 = (0, _react.useState)({
|
|
257
276
|
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
258
277
|
friendlyResult: []
|
|
259
278
|
}),
|
|
260
|
-
_useState34 = _slicedToArray(_useState33, 2),
|
|
261
|
-
krsCheckResult = _useState34[0],
|
|
262
|
-
setKrsCheckResult = _useState34[1];
|
|
263
|
-
|
|
264
|
-
var _useState35 = (0, _react.useState)(false),
|
|
265
279
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
280
|
+
krsCheckResult = _useState36[0],
|
|
281
|
+
setKrsCheckResult = _useState36[1];
|
|
269
282
|
|
|
270
283
|
var _useState37 = (0, _react.useState)(false),
|
|
271
284
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
272
|
-
|
|
273
|
-
|
|
285
|
+
customCloseOSuggest = _useState38[0],
|
|
286
|
+
setCustomCloseOSuggest = _useState38[1]; // 用户点击收起后不再自动弹出
|
|
287
|
+
|
|
274
288
|
|
|
275
|
-
var _useState39 = (0, _react.useState)(),
|
|
289
|
+
var _useState39 = (0, _react.useState)(false),
|
|
276
290
|
_useState40 = _slicedToArray(_useState39, 2),
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
customCloseKrSuggest = _useState40[0],
|
|
292
|
+
setCustomCloseKrSuggest = _useState40[1];
|
|
279
293
|
|
|
280
|
-
var _useState41 = (0, _react.useState)(
|
|
294
|
+
var _useState41 = (0, _react.useState)(),
|
|
281
295
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
282
|
-
|
|
283
|
-
|
|
296
|
+
createdSuccessInfo = _useState42[0],
|
|
297
|
+
setCreatedSuccessInfo = _useState42[1];
|
|
284
298
|
|
|
285
|
-
var _useState43 = (0, _react.useState)(
|
|
299
|
+
var _useState43 = (0, _react.useState)(false),
|
|
286
300
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
287
|
-
|
|
288
|
-
|
|
301
|
+
showCreatedSuccessInfo = _useState44[0],
|
|
302
|
+
setShowCreatedSuccessInfo = _useState44[1];
|
|
289
303
|
|
|
290
|
-
var _useState45 = (0, _react.useState)(
|
|
304
|
+
var _useState45 = (0, _react.useState)(Math.floor(Math.random() * 6)),
|
|
291
305
|
_useState46 = _slicedToArray(_useState45, 2),
|
|
292
|
-
|
|
293
|
-
|
|
306
|
+
tipIndex = _useState46[0],
|
|
307
|
+
setTipIndex = _useState46[1];
|
|
294
308
|
|
|
295
|
-
var _useState47 = (0, _react.useState)(
|
|
309
|
+
var _useState47 = (0, _react.useState)(''),
|
|
296
310
|
_useState48 = _slicedToArray(_useState47, 2),
|
|
297
|
-
|
|
298
|
-
|
|
311
|
+
userAvatarBase64Url = _useState48[0],
|
|
312
|
+
setUserAvatarBase64Url = _useState48[1];
|
|
299
313
|
|
|
300
314
|
var _useState49 = (0, _react.useState)(false),
|
|
301
315
|
_useState50 = _slicedToArray(_useState49, 2),
|
|
302
|
-
|
|
303
|
-
|
|
316
|
+
krIsValidate = _useState50[0],
|
|
317
|
+
setKrIsValidate = _useState50[1];
|
|
304
318
|
|
|
305
319
|
var _useState51 = (0, _react.useState)(false),
|
|
306
320
|
_useState52 = _slicedToArray(_useState51, 2),
|
|
307
|
-
|
|
308
|
-
|
|
321
|
+
isApplyTpl = _useState52[0],
|
|
322
|
+
setIsApplyTpl = _useState52[1];
|
|
323
|
+
|
|
324
|
+
var _useState53 = (0, _react.useState)(false),
|
|
325
|
+
_useState54 = _slicedToArray(_useState53, 2),
|
|
326
|
+
isInputContent = _useState54[0],
|
|
327
|
+
setIsInputContent = _useState54[1];
|
|
309
328
|
|
|
310
329
|
var wrapperRef = (0, _react.useRef)();
|
|
311
330
|
var modalRef = (0, _react.useRef)();
|
|
@@ -338,7 +357,12 @@ function CreateOkrModal(_ref, ref) {
|
|
|
338
357
|
setCase: function setCase(data) {
|
|
339
358
|
var name = data.name,
|
|
340
359
|
subelements = data.subelements;
|
|
341
|
-
|
|
360
|
+
setOkrNameData({
|
|
361
|
+
mentionUsers: [],
|
|
362
|
+
pureText: name,
|
|
363
|
+
pureTextExcludeAt: name,
|
|
364
|
+
richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
|
|
365
|
+
});
|
|
342
366
|
setKrDatas(subelements.map(function (s) {
|
|
343
367
|
return {
|
|
344
368
|
uuid: _uuid["default"].v1(),
|
|
@@ -347,13 +371,21 @@ function CreateOkrModal(_ref, ref) {
|
|
|
347
371
|
userAvatar: UserAvatar,
|
|
348
372
|
krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
|
|
349
373
|
mileStoneName: s.name,
|
|
374
|
+
mileStoneNamePureTextExcludeAt: '',
|
|
375
|
+
mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
|
|
376
|
+
aiteUsers: [],
|
|
350
377
|
confidenceIndex: 5
|
|
351
378
|
};
|
|
352
379
|
}));
|
|
353
380
|
setIsCustomWeight(false);
|
|
354
381
|
},
|
|
355
382
|
setData: function setData(data) {
|
|
356
|
-
|
|
383
|
+
setOkrNameData({
|
|
384
|
+
mentionUsers: [],
|
|
385
|
+
pureText: data.okrName,
|
|
386
|
+
pureTextExcludeAt: data.okrName,
|
|
387
|
+
richText: (0, _richEditor.TitaRichEditorInitTextState)(data.okrName)
|
|
388
|
+
});
|
|
357
389
|
setUser(data.user);
|
|
358
390
|
},
|
|
359
391
|
show: showCreateOkrModal,
|
|
@@ -403,13 +435,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
403
435
|
|
|
404
436
|
var onModalOkHandler = /*#__PURE__*/function () {
|
|
405
437
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
406
|
-
var orkNameLengthValidate, visibilityArea, data, krNum, krTotalLength, krAvarageLength, krMeasurableLength, oHasVtWords, callData, workId;
|
|
438
|
+
var mentionUsers, pureText, pureTextExcludeAt, richText, orkNameLengthValidate, visibilityArea, formData, data, krNum, krTotalLength, krAvarageLength, krMeasurableLength, oHasVtWords, callData, workId;
|
|
407
439
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
408
440
|
while (1) {
|
|
409
441
|
switch (_context.prev = _context.next) {
|
|
410
442
|
case 0:
|
|
411
|
-
|
|
412
|
-
|
|
443
|
+
mentionUsers = okrNameData.mentionUsers, pureText = okrNameData.pureText, pureTextExcludeAt = okrNameData.pureTextExcludeAt, richText = okrNameData.richText;
|
|
444
|
+
|
|
445
|
+
if (pureText) {
|
|
446
|
+
_context.next = 4;
|
|
413
447
|
break;
|
|
414
448
|
}
|
|
415
449
|
|
|
@@ -419,9 +453,9 @@ function CreateOkrModal(_ref, ref) {
|
|
|
419
453
|
|
|
420
454
|
return _context.abrupt("return");
|
|
421
455
|
|
|
422
|
-
case
|
|
423
|
-
if (!(
|
|
424
|
-
_context.next =
|
|
456
|
+
case 4:
|
|
457
|
+
if (!(pureTextExcludeAt.length > 500)) {
|
|
458
|
+
_context.next = 7;
|
|
425
459
|
break;
|
|
426
460
|
}
|
|
427
461
|
|
|
@@ -431,9 +465,9 @@ function CreateOkrModal(_ref, ref) {
|
|
|
431
465
|
|
|
432
466
|
return _context.abrupt("return");
|
|
433
467
|
|
|
434
|
-
case
|
|
468
|
+
case 7:
|
|
435
469
|
if (allKrHasName) {
|
|
436
|
-
_context.next =
|
|
470
|
+
_context.next = 11;
|
|
437
471
|
break;
|
|
438
472
|
}
|
|
439
473
|
|
|
@@ -444,13 +478,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
444
478
|
setKrIsValidate(true);
|
|
445
479
|
return _context.abrupt("return");
|
|
446
480
|
|
|
447
|
-
case
|
|
481
|
+
case 11:
|
|
448
482
|
orkNameLengthValidate = krDatas.filter(function (kr) {
|
|
449
|
-
|
|
483
|
+
var _trim;
|
|
484
|
+
|
|
485
|
+
return ((_trim = (kr.mileStoneNamePureTextExcludeAt || '').trim()) === null || _trim === void 0 ? void 0 : _trim.length) > 500;
|
|
450
486
|
}).length == 0;
|
|
451
487
|
|
|
452
488
|
if (orkNameLengthValidate) {
|
|
453
|
-
_context.next =
|
|
489
|
+
_context.next = 15;
|
|
454
490
|
break;
|
|
455
491
|
}
|
|
456
492
|
|
|
@@ -460,11 +496,11 @@ function CreateOkrModal(_ref, ref) {
|
|
|
460
496
|
|
|
461
497
|
return _context.abrupt("return");
|
|
462
498
|
|
|
463
|
-
case
|
|
499
|
+
case 15:
|
|
464
500
|
setKrIsValidate(false);
|
|
465
501
|
|
|
466
502
|
if (krWeightValid) {
|
|
467
|
-
_context.next =
|
|
503
|
+
_context.next = 19;
|
|
468
504
|
break;
|
|
469
505
|
}
|
|
470
506
|
|
|
@@ -474,27 +510,32 @@ function CreateOkrModal(_ref, ref) {
|
|
|
474
510
|
|
|
475
511
|
return _context.abrupt("return");
|
|
476
512
|
|
|
477
|
-
case
|
|
513
|
+
case 19:
|
|
478
514
|
if (cycle) {
|
|
479
|
-
_context.next =
|
|
515
|
+
_context.next = 21;
|
|
480
516
|
break;
|
|
481
517
|
}
|
|
482
518
|
|
|
483
519
|
return _context.abrupt("return");
|
|
484
520
|
|
|
485
|
-
case
|
|
521
|
+
case 21:
|
|
486
522
|
handleCreatedClose();
|
|
487
523
|
visibilityArea = formatVisiableLimit();
|
|
488
|
-
|
|
489
|
-
return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
524
|
+
formData = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
490
525
|
krInfos: krDatas.map(function (kr) {
|
|
526
|
+
// @ts-ignore
|
|
527
|
+
delete kr.mileStoneNamePureTextExcludeAt;
|
|
491
528
|
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
492
529
|
startDate: cycle.startDate,
|
|
493
530
|
endDate: cycle.endDate
|
|
494
531
|
});
|
|
495
532
|
})
|
|
496
533
|
}, cycle), {}, {
|
|
497
|
-
workName:
|
|
534
|
+
workName: pureText,
|
|
535
|
+
workNameRichText: richText,
|
|
536
|
+
aiteUsers: mentionUsers === null || mentionUsers === void 0 ? void 0 : mentionUsers.map(function (user) {
|
|
537
|
+
return user.mentionId;
|
|
538
|
+
})
|
|
498
539
|
}, parent), {}, {
|
|
499
540
|
workType: 6,
|
|
500
541
|
visibility: visibility,
|
|
@@ -507,13 +548,15 @@ function CreateOkrModal(_ref, ref) {
|
|
|
507
548
|
}]
|
|
508
549
|
}, visibilityArea), {}, {
|
|
509
550
|
CreateFromAssess: isFromAssess
|
|
510
|
-
})
|
|
551
|
+
});
|
|
552
|
+
_context.next = 26;
|
|
553
|
+
return (0, _requestApi.createWidthKr)(formData);
|
|
511
554
|
|
|
512
|
-
case
|
|
555
|
+
case 26:
|
|
513
556
|
data = _context.sent;
|
|
514
557
|
|
|
515
558
|
if (!(data.Code === 0)) {
|
|
516
|
-
_context.next =
|
|
559
|
+
_context.next = 30;
|
|
517
560
|
break;
|
|
518
561
|
}
|
|
519
562
|
|
|
@@ -523,7 +566,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
523
566
|
|
|
524
567
|
return _context.abrupt("return");
|
|
525
568
|
|
|
526
|
-
case
|
|
569
|
+
case 30:
|
|
527
570
|
hideCreateOkrModal();
|
|
528
571
|
|
|
529
572
|
if (onSuccess || !isHiddenCreatedCard) {
|
|
@@ -531,8 +574,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
531
574
|
krNum = krDatas.length;
|
|
532
575
|
krTotalLength = 0;
|
|
533
576
|
krDatas && krDatas.forEach(function (kr) {
|
|
577
|
+
var _kr$mileStoneNamePure;
|
|
578
|
+
|
|
534
579
|
// 计算平均长度要去掉百分号和数字
|
|
535
|
-
krTotalLength += kr.
|
|
580
|
+
krTotalLength += (_kr$mileStoneNamePure = kr.mileStoneNamePureTextExcludeAt) === null || _kr$mileStoneNamePure === void 0 ? void 0 : _kr$mileStoneNamePure.replace(/(%|\d)/g, '').length;
|
|
536
581
|
});
|
|
537
582
|
krAvarageLength = krDatas.length > 0 ? krTotalLength / krDatas.length : 0;
|
|
538
583
|
krMeasurableLength = krsCheckResult.friendlyResult.filter(function (kr) {
|
|
@@ -540,7 +585,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
540
585
|
}).length;
|
|
541
586
|
oHasVtWords = oNameCheckResult[0].result === _okrCreateSuggest.EOkrCreateSuggestResultType.correct;
|
|
542
587
|
callData = data;
|
|
543
|
-
callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(
|
|
588
|
+
callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrNameData.pureTextExcludeAt.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
|
|
544
589
|
newOkrDataRef.current = callData;
|
|
545
590
|
handleOnSuccess();
|
|
546
591
|
} else {
|
|
@@ -553,7 +598,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
553
598
|
|
|
554
599
|
setIsApplyTpl(false);
|
|
555
600
|
|
|
556
|
-
case
|
|
601
|
+
case 33:
|
|
557
602
|
case "end":
|
|
558
603
|
return _context.stop();
|
|
559
604
|
}
|
|
@@ -570,20 +615,33 @@ function CreateOkrModal(_ref, ref) {
|
|
|
570
615
|
var OnOkRApplyTplHandler = function OnOkRApplyTplHandler(data) {
|
|
571
616
|
var name = data.name,
|
|
572
617
|
subelements = data.subelements;
|
|
573
|
-
|
|
574
|
-
setKrDatas(subelements.map(function (s) {
|
|
618
|
+
setOkrNameData(function () {
|
|
575
619
|
return {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
|
|
581
|
-
mileStoneName: s.name,
|
|
582
|
-
confidenceIndex: 5
|
|
620
|
+
mentionUsers: [],
|
|
621
|
+
pureText: name,
|
|
622
|
+
pureTextExcludeAt: name,
|
|
623
|
+
richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
|
|
583
624
|
};
|
|
584
|
-
})
|
|
625
|
+
});
|
|
626
|
+
setKrDatas(function () {
|
|
627
|
+
return subelements.map(function (s) {
|
|
628
|
+
return {
|
|
629
|
+
uuid: _uuid["default"].v1(),
|
|
630
|
+
principalId: Id,
|
|
631
|
+
principalName: Name,
|
|
632
|
+
userAvatar: UserAvatar,
|
|
633
|
+
krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
|
|
634
|
+
mileStoneName: s.name,
|
|
635
|
+
mileStoneNamePureTextExcludeAt: s.name,
|
|
636
|
+
mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
|
|
637
|
+
aiteUsers: [],
|
|
638
|
+
confidenceIndex: 5
|
|
639
|
+
};
|
|
640
|
+
});
|
|
641
|
+
});
|
|
585
642
|
setIsCustomWeight(false);
|
|
586
643
|
setIsApplyTpl(true);
|
|
644
|
+
setRichEditorStatus('refresh');
|
|
587
645
|
};
|
|
588
646
|
|
|
589
647
|
(0, _react.useEffect)(function () {
|
|
@@ -595,9 +653,12 @@ function CreateOkrModal(_ref, ref) {
|
|
|
595
653
|
userAvatar: UserAvatar,
|
|
596
654
|
krWeight: 100,
|
|
597
655
|
mileStoneName: '',
|
|
656
|
+
mileStoneNamePureTextExcludeAt: '',
|
|
657
|
+
mileStoneNameRichText: undefined,
|
|
658
|
+
aiteUsers: [],
|
|
598
659
|
confidenceIndex: 5
|
|
599
660
|
}]);
|
|
600
|
-
|
|
661
|
+
setOkrNameData(DefaultOkrNameData);
|
|
601
662
|
setUser({
|
|
602
663
|
name: Name,
|
|
603
664
|
id: Id,
|
|
@@ -622,6 +683,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
622
683
|
parentKrId: 0
|
|
623
684
|
});
|
|
624
685
|
}
|
|
686
|
+
|
|
687
|
+
return function () {
|
|
688
|
+
return setRichEditorStatus('initialization');
|
|
689
|
+
};
|
|
625
690
|
}, [isVisible]);
|
|
626
691
|
var handleONameSuggestClose = (0, _react.useCallback)(function () {
|
|
627
692
|
setONameIsInput(false);
|
|
@@ -733,7 +798,11 @@ function CreateOkrModal(_ref, ref) {
|
|
|
733
798
|
className: "create-modal__title"
|
|
734
799
|
}, (0, _getLocale.getLocale)('OKR_MyO_Pop_Title_Newobjective')), /*#__PURE__*/_react["default"].createElement(_okrCase["default"], {
|
|
735
800
|
okrTemplateEnabled: true,
|
|
736
|
-
onOkrApply: OnOkRApplyTplHandler
|
|
801
|
+
onOkrApply: OnOkRApplyTplHandler,
|
|
802
|
+
onVisibleChange: function onVisibleChange() {
|
|
803
|
+
setIsApplyTpl(false);
|
|
804
|
+
setRichEditorStatus('initialization');
|
|
805
|
+
}
|
|
737
806
|
}));
|
|
738
807
|
}, []);
|
|
739
808
|
var krCheckFinalResult = (0, _react.useMemo)(function () {
|
|
@@ -841,17 +910,21 @@ function CreateOkrModal(_ref, ref) {
|
|
|
841
910
|
}
|
|
842
911
|
}, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
|
|
843
912
|
ref: wrapperRef
|
|
913
|
+
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
914
|
+
className: "create-modal__wrapper-inner"
|
|
844
915
|
}, /*#__PURE__*/_react["default"].createElement(_oNewName["default"], {
|
|
845
916
|
container: modalRef,
|
|
917
|
+
richEditorStatus: richEditorStatus,
|
|
918
|
+
key: richEditorStatus,
|
|
846
919
|
user: user,
|
|
847
920
|
setUser: setUser,
|
|
848
|
-
|
|
849
|
-
|
|
921
|
+
okrNameData: okrNameData,
|
|
922
|
+
setOkrNameData: setOkrNameData,
|
|
850
923
|
onOInputFocusStateChange: handleOInputFocusStateChange,
|
|
851
924
|
setONameCheckResult: setONameCheckResult,
|
|
852
925
|
setIsInputContent: setIsInputContent
|
|
853
926
|
}), /*#__PURE__*/_react["default"].createElement(_krDatas["default"], {
|
|
854
|
-
|
|
927
|
+
isApplyTpl: isApplyTpl,
|
|
855
928
|
isCustomWeight: isCustomWeight,
|
|
856
929
|
wrapperRef: wrapperRef,
|
|
857
930
|
krDatas: krDatas,
|
|
@@ -901,29 +974,29 @@ function CreateOkrModal(_ref, ref) {
|
|
|
901
974
|
okrClassify: okrClassify,
|
|
902
975
|
setOkrClassify: setOkrClassify,
|
|
903
976
|
isCreateModal: true
|
|
904
|
-
}))),
|
|
977
|
+
}))))), /*#__PURE__*/_react["default"].createElement("img", {
|
|
978
|
+
className: "teach-suggest teach-suggest__o",
|
|
979
|
+
src: _hand["default"],
|
|
980
|
+
onClick: handleShowOSuggest
|
|
981
|
+
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
982
|
+
className: "teach-suggest teach-suggest__kr",
|
|
983
|
+
src: _hand["default"],
|
|
984
|
+
onClick: handleShowKrSuggest
|
|
985
|
+
}), !customCloseOSuggest && oNameIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
|
|
905
986
|
isInput: isInputContent,
|
|
906
987
|
isOSuggest: true,
|
|
907
988
|
descs: (0, _constant.getODesc)(),
|
|
908
989
|
example: (0, _constant.getOExample)(),
|
|
909
990
|
results: oNameCheckResult,
|
|
910
991
|
handleClose: handleONameSuggestClose
|
|
911
|
-
}) : null, /*#__PURE__*/_react["default"].createElement("
|
|
912
|
-
className: "teach-suggest teach-suggest__o",
|
|
913
|
-
src: _hand["default"],
|
|
914
|
-
onClick: handleShowOSuggest
|
|
915
|
-
}), !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
|
|
992
|
+
}) : null, !customCloseKrSuggest && krIsInput ? /*#__PURE__*/_react["default"].createElement(_okrCreateSuggest["default"], {
|
|
916
993
|
isInput: isInputContent,
|
|
917
994
|
isOSuggest: false,
|
|
918
995
|
descs: (0, _constant.getKrDesc)(),
|
|
919
996
|
example: (0, _constant.KrExample)(),
|
|
920
997
|
results: krCheckFinalResult,
|
|
921
998
|
handleClose: handleKrSuggestClose
|
|
922
|
-
}) : null, /*#__PURE__*/_react["default"].createElement("
|
|
923
|
-
className: "teach-suggest teach-suggest__kr",
|
|
924
|
-
src: _hand["default"],
|
|
925
|
-
onClick: handleShowKrSuggest
|
|
926
|
-
})))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
|
|
999
|
+
}) : null))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
|
|
927
1000
|
tipIndex: tipIndex,
|
|
928
1001
|
createdSuccessInfo: createdSuccessInfo,
|
|
929
1002
|
isDownload: false,
|