@titaui/pc 1.11.33 → 1.11.35-beta.2

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.
Files changed (123) hide show
  1. package/lib/components/avatar/name-avatar/index.css +1 -0
  2. package/lib/components/avatar/name-avatar/index.js +22 -13
  3. package/lib/components/button/rect-btn/index.css +45 -11
  4. package/lib/components/button/rect-btn/index.js +12 -6
  5. package/lib/components/change-okr-modal/index.js +2 -1
  6. package/lib/components/checkbox/index.css +3 -3
  7. package/lib/components/create-okr-modal/index.js +48 -42
  8. package/lib/components/create-okr-modal/request-api.js +1 -1
  9. package/lib/components/dialog-confirm/index.css +2 -2
  10. package/lib/components/drawer/headerAction.js +5 -1
  11. package/lib/components/drawer/headerDrop.js +42 -4
  12. package/lib/components/drawer/index.css +33 -0
  13. package/lib/components/drawer/index.js +26 -3
  14. package/lib/components/dynamic/dynamic-list/index.js +14 -6
  15. package/lib/components/dynamic/index.js +9 -12
  16. package/lib/components/dynamic/request-api.js +7 -68
  17. package/lib/components/nav-top/index.js +8 -4
  18. package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +20 -4
  19. package/lib/components/okr-detail/base-info/other-infos/principal/index.js +9 -1
  20. package/lib/components/okr-detail/components/header/index.js +10 -3
  21. package/lib/components/okr-detail/components/header/o-name.js +10 -3
  22. package/lib/components/okr-detail/components/o-classify.js +5 -1
  23. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +13 -14
  24. package/lib/components/okr-detail/detail-header/constant.js +53 -0
  25. package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +98 -43
  26. package/lib/components/okr-detail/detail-header/delete-confirm/index.css +55 -0
  27. package/lib/components/okr-detail/detail-header/index.css +11 -0
  28. package/lib/components/okr-detail/detail-header/index.js +228 -234
  29. package/lib/components/okr-detail/helper.js +108 -0
  30. package/lib/components/okr-detail/index.js +21 -4
  31. package/lib/components/okr-detail/okr-list/index.js +8 -3
  32. package/lib/components/okr-detail/request-apis.js +10 -4
  33. package/lib/components/okr-flow/export-modal/index.js +13 -1
  34. package/lib/components/okr-period-selector/index.js +9 -5
  35. package/lib/components/okr-period-selector/select-cycle.js +23 -19
  36. package/lib/components/operation-records/index.js +1 -1
  37. package/lib/components/operation-records/style.js +1 -1
  38. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  39. package/lib/components/task-relation-modal/request-api.js +2 -1
  40. package/lib/components/textarea/index.css +142 -0
  41. package/lib/components/textarea/index.js +259 -0
  42. package/lib/components/time-picker/time-picker.js +37 -93
  43. package/lib/components/toast/index.js +5 -3
  44. package/lib/index.js +40 -0
  45. package/lib/pages/new-okr-list/header/common.js +52 -0
  46. package/lib/pages/new-okr-list/header/index.css +45 -0
  47. package/lib/pages/new-okr-list/header/index.js +38 -16
  48. package/lib/{components/dynamic/dynamic-liking/index.js → pages/new-okr-list/header/operate-record.js} +91 -39
  49. package/lib/pages/new-okr-list/index.js +3 -1
  50. package/lib/pages/new-okr-list/list/index.js +19 -2
  51. package/lib/pages/new-okr-list/request-api.js +8 -2
  52. package/lib/pages/okr-map/unsupport-ie/index.js +3 -5
  53. package/lib/utils/format-time.js +8 -1
  54. package/lib/utils/open-data.js +5 -1
  55. package/package.json +2 -2
  56. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  57. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  58. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  59. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  60. package/lib/components/dynamic/advertise/index.css +0 -21
  61. package/lib/components/dynamic/advertise/index.js +0 -126
  62. package/lib/components/dynamic/advertise/interface.js +0 -5
  63. package/lib/components/dynamic/advertise/util.js +0 -28
  64. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  65. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  66. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  67. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  68. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  69. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  70. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  71. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  72. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  73. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  74. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  75. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  76. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  77. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  78. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  79. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  80. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  81. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  82. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  83. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  84. package/lib/components/dynamic/dynamic-topping/index.js +0 -82
  85. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  86. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  87. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  88. package/lib/components/dynamic/dynamic.css +0 -173
  89. package/lib/components/dynamic/dynamic.js +0 -428
  90. package/lib/components/dynamic/export-module/index.js +0 -37
  91. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  92. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  93. package/lib/components/dynamic/my-team/img/line.png +0 -0
  94. package/lib/components/dynamic/my-team/img/team.png +0 -0
  95. package/lib/components/dynamic/my-team/index.css +0 -184
  96. package/lib/components/dynamic/my-team/index.js +0 -263
  97. package/lib/components/dynamic/my-team/request-api.js +0 -52
  98. package/lib/components/dynamic/my-team/util.js +0 -20
  99. package/lib/components/dynamic/new-ui.css +0 -192
  100. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  101. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  102. package/lib/components/dynamic/online-broadcast/data.js +0 -77
  103. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  104. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  105. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  106. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  107. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  108. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  109. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  110. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  111. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  112. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  113. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  114. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  115. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  116. package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -44
  117. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  118. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  119. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  120. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  121. package/lib/components/dynamic/quick-operation/index.css +0 -51
  122. package/lib/components/dynamic/quick-operation/index.js +0 -120
  123. package/lib/components/okr-detail/detail-header/delete-confirm/style.js +0 -38
@@ -55,4 +55,5 @@
55
55
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
56
56
  color: #6F7886;
57
57
  line-height: 20px;
58
+ margin-left: 4px;
58
59
  }
@@ -58,7 +58,10 @@ var NameAvatar = function NameAvatar(props) {
58
58
  onDelUser = props.onDelUser,
59
59
  _props$textWidth = props.textWidth,
60
60
  textWidth = _props$textWidth === void 0 ? 42 : _props$textWidth,
61
- textClass = props.textClass;
61
+ textClass = props.textClass,
62
+ renderRightTopCmp = props.renderRightTopCmp,
63
+ _props$avatarTips = props.avatarTips,
64
+ avatarTips = _props$avatarTips === void 0 ? '' : _props$avatarTips;
62
65
  var hasAvatar = src && !src.match(/default\w*.jpg$/);
63
66
 
64
67
  var _useState = (0, _react.useState)(false),
@@ -103,7 +106,7 @@ var NameAvatar = function NameAvatar(props) {
103
106
  style: {
104
107
  width: size.width,
105
108
  height: size.width,
106
- verticalAlign: "top"
109
+ verticalAlign: 'top'
107
110
  },
108
111
  src: src
109
112
  });
@@ -120,11 +123,11 @@ var NameAvatar = function NameAvatar(props) {
120
123
  }
121
124
  }, /*#__PURE__*/_react["default"].createElement("div", {
122
125
  style: {
123
- display: "inline-block",
126
+ display: 'inline-block',
124
127
  width: "".concat(size.fontSize, "px"),
125
- margin: "0 auto",
126
- overflow: "hidden",
127
- whiteSpace: "nowrap",
128
+ margin: '0 auto',
129
+ overflow: 'hidden',
130
+ whiteSpace: 'nowrap',
128
131
  fontSize: "".concat(size.fontSize, "px"),
129
132
  lineHeight: "".concat(size.width, "px")
130
133
  }
@@ -134,7 +137,7 @@ var NameAvatar = function NameAvatar(props) {
134
137
  })));
135
138
  }
136
139
 
137
- var cuttedName = "";
140
+ var cuttedName = '';
138
141
  var cuttedNameLen = 0;
139
142
 
140
143
  for (var i = 0, lent = name.length; i < lent; i++) {
@@ -167,11 +170,11 @@ var NameAvatar = function NameAvatar(props) {
167
170
  className: "titaui-pc-avator__name-avatar-container",
168
171
  onMouseEnter: handleMouseEnter,
169
172
  onMouseLeave: handleMouseLeave
170
- }, /*#__PURE__*/_react["default"].createElement("div", {
173
+ }, renderRightTopCmp, /*#__PURE__*/_react["default"].createElement("div", {
171
174
  onClick: handleDelUser,
172
175
  onMouseLeave: handleCloseIconMouseLeave,
173
176
  onMouseEnter: handleCloseIconMouseEnter,
174
- className: "titaui-pc-avator__delete-wrapper ".concat(canDelUser && mouseIsEnterUser ? "titaui-pc-avator--enter" : ""),
177
+ className: "titaui-pc-avator__delete-wrapper ".concat(canDelUser && mouseIsEnterUser ? 'titaui-pc-avator--enter' : ''),
175
178
  style: {
176
179
  left: "".concat(size.width - 14, "px")
177
180
  }
@@ -185,7 +188,10 @@ var NameAvatar = function NameAvatar(props) {
185
188
  onClick: onClick,
186
189
  onMouseEnter: onMouseEnter,
187
190
  onMouseLeave: onMouseLeave
188
- }, hasAvatar ? renderImgAvatar() : renderTextAvatar()), showNameTips && isNameOverflow ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
191
+ }, avatarTips && /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
192
+ overlay: avatarTips,
193
+ placement: "top"
194
+ }, hasAvatar ? renderImgAvatar() : renderTextAvatar()), !avatarTips && (hasAvatar ? renderImgAvatar() : renderTextAvatar())), showNameTips && isNameOverflow ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
189
195
  overlay: /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
190
196
  name: name,
191
197
  id: userId
@@ -194,14 +200,17 @@ var NameAvatar = function NameAvatar(props) {
194
200
  }, /*#__PURE__*/_react["default"].createElement("span", {
195
201
  className: "titaui-pc-avator__name ".concat(textClass),
196
202
  style: {
197
- width: textWidth
203
+ maxWidth: textWidth
198
204
  }
199
205
  }, /*#__PURE__*/_react["default"].createElement("span", {
200
206
  ref: textRef
201
- }, name))) : /*#__PURE__*/_react["default"].createElement("span", {
207
+ }, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
208
+ name: name,
209
+ id: userId
210
+ })))) : /*#__PURE__*/_react["default"].createElement("span", {
202
211
  className: "titaui-pc-avator__name ".concat(textClass),
203
212
  style: {
204
- width: textWidth
213
+ maxWidth: textWidth
205
214
  }
206
215
  }, /*#__PURE__*/_react["default"].createElement("span", {
207
216
  ref: textRef
@@ -13,7 +13,7 @@
13
13
  align-items: center;
14
14
  justify-content: center;
15
15
  min-width: 64px;
16
- font-size: 13px;
16
+ font-size: 14px;
17
17
  padding: 0 12px;
18
18
  }
19
19
 
@@ -60,21 +60,35 @@
60
60
  background: #5c8eff;
61
61
  }
62
62
 
63
+ .titaui-rect-btn--secondary {
64
+ font-size: 14px;
65
+ font-weight: normal;
66
+ color: #2879ff;
67
+ line-height: 28px;
68
+ background: rgba(40, 121, 255, 0.2);
69
+ margin-right: 16px;
70
+ }
71
+
72
+ .titaui-rect-btn--secondary:hover {
73
+ color: #fff;
74
+ background-color: #2879ff;
75
+ }
76
+
63
77
  .titaui-rect-btn--cancel {
64
- color: #6F7886;
65
- border: 1px solid #DFE3EA;
66
- background: #FFFFFF;
78
+ color: #6f7886;
79
+ border: 1px solid #dfe3ea;
80
+ background: #ffffff;
67
81
  }
68
82
 
69
83
  .titaui-rect-btn--cancel:hover {
70
- color: #2879FF;
71
- border: 1px solid #2879FF;
84
+ color: #2879ff;
85
+ border: 1px solid #2879ff;
72
86
  }
73
87
 
74
88
  .titaui-rect-btn--delete {
75
- background: #FFFFFF;
76
- color: #F05E5E;
77
- border: 1px solid #F05E5E;
89
+ background: #ffffff;
90
+ color: #f05e5e;
91
+ border: 1px solid #f05e5e;
78
92
  }
79
93
 
80
94
  .titaui-rect-btn--delete:hover {
@@ -92,11 +106,31 @@
92
106
  user-select: none;
93
107
  }
94
108
 
109
+ .titaui-rect-btn--disabled:hover .titaui-rect-btn--default:hover {
110
+ background: #fff;
111
+ }
112
+
113
+ .titaui-rect-btn--disabled:hover .titaui-rect-btn--primary:hover {
114
+ background: #2879ff;
115
+ }
116
+
117
+ .titaui-rect-btn--disabled:hover .titaui-rect-btn--secondary:hover {
118
+ background: rgba(40, 121, 255, 0.2);
119
+ }
120
+
121
+ .titaui-rect-btn--disabled:hover .titaui-rect-btn--cancel:hover {
122
+ background: #ffffff;
123
+ }
124
+
125
+ .titaui-rect-btn--disabled:hover .titaui-rect-btn--delete:hover {
126
+ background: #ffffff;
127
+ }
128
+
95
129
  .titaui-rect-btn--primary.titaui-rect-btn--disabled {
96
- background: #93BCFF;
130
+ background: #93bcff;
97
131
  opacity: 1;
98
132
  }
99
133
 
100
134
  .titaui-rect-btn--primary.titaui-rect-btn--disabled:hover {
101
- background: #93BCFF;
135
+ background: #93bcff;
102
136
  }
@@ -34,7 +34,10 @@ function RectBtn(props) {
34
34
  className = _props$className === void 0 ? '' : _props$className,
35
35
  _props$disabled = props.disabled,
36
36
  disabled = _props$disabled === void 0 ? false : _props$disabled,
37
- style = props.style;
37
+ style = props.style,
38
+ children = props.children,
39
+ _props$loading = props.loading,
40
+ loading = _props$loading === void 0 ? false : _props$loading;
38
41
 
39
42
  var renderIcon = function renderIcon() {
40
43
  if (typeof icon === 'string') {
@@ -50,16 +53,19 @@ function RectBtn(props) {
50
53
  }, icon);
51
54
  };
52
55
 
53
- var onClickHandler = function onClickHandler() {
54
- if (disabled) return;
55
- onClick && onClick();
56
+ var onClickHandler = function onClickHandler(e) {
57
+ if (disabled || loading) return;
58
+
59
+ if (onClick) {
60
+ onClick(e);
61
+ }
56
62
  };
57
63
 
58
64
  return /*#__PURE__*/_react["default"].createElement("span", {
59
- className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled), className),
65
+ className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled || loading), className),
60
66
  style: style,
61
67
  onClick: onClickHandler
62
- }, icon && renderIcon(), props.children || text);
68
+ }, icon && renderIcon(), children || text);
63
69
  }
64
70
 
65
71
  var _default = RectBtn;
@@ -564,7 +564,8 @@ var _initialiseProps = function _initialiseProps() {
564
564
  }).join(','),
565
565
  searchKr: okrPopType,
566
566
  // 是否搜索KR:默认为0-不搜索,1-只有对齐目标弹层可以搜索KR
567
- toUserId: toUserId
567
+ toUserId: toUserId,
568
+ includeCreateFailApprovalOkr: false
568
569
  }).then(function (res) {
569
570
  _this4.pending = false;
570
571
  var resData = res && res.Data && res.Data.works || [];
@@ -2,9 +2,9 @@
2
2
  display: inline-block;
3
3
  width: 16px;
4
4
  height: 16px;
5
- background: #FFFFFF;
5
+ background: #ffffff;
6
6
  border-radius: 4px;
7
- border: 1px solid #DFE3EA;
7
+ border: 1px solid #bfc7d5;
8
8
  cursor: pointer;
9
9
  box-sizing: border-box;
10
10
  }
@@ -15,6 +15,6 @@
15
15
  }
16
16
 
17
17
  .titaui-checkbox--disabled {
18
- background-color: #F0F2F5;
18
+ background-color: #f0f2f5;
19
19
  cursor: not-allowed;
20
20
  }
@@ -117,7 +117,9 @@ function CreateOkrModal(_ref, ref) {
117
117
  _ref$visible = _ref.visible,
118
118
  visible = _ref$visible === void 0 ? false : _ref$visible,
119
119
  _ref$onClose = _ref.onClose,
120
- onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose;
120
+ onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
121
+ _ref$isFromAssess = _ref.isFromAssess,
122
+ isFromAssess = _ref$isFromAssess === void 0 ? false : _ref$isFromAssess;
121
123
 
122
124
  var _useState = (0, _react.useState)(visible),
123
125
  _useState2 = _slicedToArray(_useState, 2),
@@ -126,7 +128,7 @@ function CreateOkrModal(_ref, ref) {
126
128
 
127
129
 
128
130
  var userId = BSGlobal.loginUserInfo.Id;
129
- var setting = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting;
131
+ var setting = (0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting').KRSetting;
130
132
  var openOkrType = setting.OkrTypeSetting;
131
133
  var openClassify = setting.OkrClassify;
132
134
  var openKrWeight = setting.KrWeight;
@@ -136,7 +138,7 @@ function CreateOkrModal(_ref, ref) {
136
138
  Id = _ref2.Id,
137
139
  UserAvatar = _ref2.UserAvatar;
138
140
 
139
- var _useState3 = (0, _react.useState)(""),
141
+ var _useState3 = (0, _react.useState)(''),
140
142
  _useState4 = _slicedToArray(_useState3, 2),
141
143
  okrName = _useState4[0],
142
144
  setOkrName = _useState4[1]; // 目标名称
@@ -160,7 +162,7 @@ function CreateOkrModal(_ref, ref) {
160
162
 
161
163
  var _useState9 = (0, _react.useState)({
162
164
  departmentId: 0,
163
- departmentName: ""
165
+ departmentName: ''
164
166
  }),
165
167
  _useState10 = _slicedToArray(_useState9, 2),
166
168
  dept = _useState10[0],
@@ -169,7 +171,7 @@ function CreateOkrModal(_ref, ref) {
169
171
 
170
172
  var _useState11 = (0, _react.useState)({
171
173
  groupId: 0,
172
- groupName: ""
174
+ groupName: ''
173
175
  }),
174
176
  _useState12 = _slicedToArray(_useState11, 2),
175
177
  team = _useState12[0],
@@ -177,7 +179,7 @@ function CreateOkrModal(_ref, ref) {
177
179
 
178
180
 
179
181
  var _useState13 = (0, _react.useState)({
180
- typeName: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
182
+ typeName: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual'),
181
183
  typeId: 1
182
184
  }),
183
185
  _useState14 = _slicedToArray(_useState13, 2),
@@ -216,7 +218,7 @@ function CreateOkrModal(_ref, ref) {
216
218
  principalName: Name,
217
219
  userAvatar: UserAvatar,
218
220
  krWeight: 100,
219
- mileStoneName: "",
221
+ mileStoneName: '',
220
222
  confidenceIndex: 5
221
223
  }]),
222
224
  _useState24 = _slicedToArray(_useState23, 2),
@@ -226,7 +228,7 @@ function CreateOkrModal(_ref, ref) {
226
228
  var _useState25 = (0, _react.useState)({
227
229
  // 对其目标
228
230
  parentWorkId: 0,
229
- parentWorkName: "",
231
+ parentWorkName: '',
230
232
  parentType: 0,
231
233
  parentKrId: 0
232
234
  }),
@@ -283,7 +285,7 @@ function CreateOkrModal(_ref, ref) {
283
285
  tipIndex = _useState44[0],
284
286
  setTipIndex = _useState44[1];
285
287
 
286
- var _useState45 = (0, _react.useState)(""),
288
+ var _useState45 = (0, _react.useState)(''),
287
289
  _useState46 = _slicedToArray(_useState45, 2),
288
290
  userAvatarBase64Url = _useState46[0],
289
291
  setUserAvatarBase64Url = _useState46[1];
@@ -307,7 +309,7 @@ function CreateOkrModal(_ref, ref) {
307
309
  var modalRef = (0, _react.useRef)();
308
310
  var oInputFoucsRef = (0, _react.useRef)(false);
309
311
  var krInputFoucsRef = (0, _react.useRef)(false);
310
- var downloadDomRef = (0, _react.useRef)(document.createElement("div"));
312
+ var downloadDomRef = (0, _react.useRef)(document.createElement('div'));
311
313
  var newOkrDataRef = (0, _react.useRef)(); // kr权重总计
312
314
 
313
315
  var total = 0;
@@ -351,7 +353,9 @@ function CreateOkrModal(_ref, ref) {
351
353
  setData: function setData(data) {
352
354
  setOkrName(data.okrName);
353
355
  setUser(data.user);
354
- }
356
+ },
357
+ show: showCreateOkrModal,
358
+ hide: hideCreateOkrModal
355
359
  };
356
360
  });
357
361
  var handleOnSuccess = (0, _react.useCallback)(function () {
@@ -363,7 +367,7 @@ function CreateOkrModal(_ref, ref) {
363
367
  setShowCreatedSuccessInfo(true);
364
368
  setTipIndex(Math.floor(Math.random() * 6));
365
369
  } else {
366
- _toast["default"].Success((0, _getLocale.getLocale)("OKR_Db_Success"), {
370
+ _toast["default"].Success((0, _getLocale.getLocale)('OKR_Db_Success'), {
367
371
  duration: 3000
368
372
  });
369
373
 
@@ -407,7 +411,7 @@ function CreateOkrModal(_ref, ref) {
407
411
  break;
408
412
  }
409
413
 
410
- _toast["default"].Error((0, _getLocale.getLocale)("OKR_MyO_Pop_Targetname"), {
414
+ _toast["default"].Error((0, _getLocale.getLocale)('OKR_MyO_Pop_Targetname'), {
411
415
  canClose: false
412
416
  });
413
417
 
@@ -419,7 +423,7 @@ function CreateOkrModal(_ref, ref) {
419
423
  break;
420
424
  }
421
425
 
422
- _toast["default"].Error("目标名称不能超过500字", {
426
+ _toast["default"].Error('目标名称不能超过500字', {
423
427
  canClose: false
424
428
  });
425
429
 
@@ -431,7 +435,7 @@ function CreateOkrModal(_ref, ref) {
431
435
  break;
432
436
  }
433
437
 
434
- _toast["default"].Error("关键成果不能为空", {
438
+ _toast["default"].Error('关键成果不能为空', {
435
439
  canClose: false
436
440
  });
437
441
 
@@ -448,7 +452,7 @@ function CreateOkrModal(_ref, ref) {
448
452
  break;
449
453
  }
450
454
 
451
- _toast["default"].Error("关键成果不能超过500字", {
455
+ _toast["default"].Error('关键成果不能超过500字', {
452
456
  canClose: false
453
457
  });
454
458
 
@@ -462,7 +466,7 @@ function CreateOkrModal(_ref, ref) {
462
466
  break;
463
467
  }
464
468
 
465
- _toast["default"].Error((0, _getLocale.getLocale)("OKR_MyO_Pop_Totalkrnot100"), {
469
+ _toast["default"].Error((0, _getLocale.getLocale)('OKR_MyO_Pop_Totalkrnot100'), {
466
470
  canClose: false
467
471
  });
468
472
 
@@ -480,7 +484,7 @@ function CreateOkrModal(_ref, ref) {
480
484
  handleCreatedClose();
481
485
  visibilityArea = formatVisiableLimit();
482
486
  _context.next = 24;
483
- return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
487
+ return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
484
488
  krInfos: krDatas.map(function (kr) {
485
489
  return _objectSpread(_objectSpread({}, kr), {}, {
486
490
  startDate: cycle.startDate,
@@ -492,14 +496,16 @@ function CreateOkrModal(_ref, ref) {
492
496
  }, parent), {}, {
493
497
  workType: 6,
494
498
  visibility: visibility,
495
- okrClassify: openClassify ? okrClassify : "",
496
- okrType: openOkrType ? type.typeId : ""
499
+ okrClassify: openClassify ? okrClassify : '',
500
+ okrType: openOkrType ? type.typeId : ''
497
501
  }, dept), team), {}, {
498
502
  workRoles: [{
499
503
  roleType: 1,
500
504
  models: [user]
501
505
  }]
502
- }, visibilityArea));
506
+ }, visibilityArea), {}, {
507
+ isFromAssess: isFromAssess
508
+ }));
503
509
 
504
510
  case 24:
505
511
  data = _context.sent;
@@ -509,7 +515,7 @@ function CreateOkrModal(_ref, ref) {
509
515
  break;
510
516
  }
511
517
 
512
- _toast["default"].Error("创建失败,请重试", {
518
+ _toast["default"].Error('创建失败,请重试', {
513
519
  canClose: false
514
520
  });
515
521
 
@@ -524,7 +530,7 @@ function CreateOkrModal(_ref, ref) {
524
530
  krTotalLength = 0;
525
531
  krDatas && krDatas.forEach(function (kr) {
526
532
  // 计算平均长度要去掉百分号和数字
527
- krTotalLength += kr.mileStoneName.replace(/(%|\d)/g, "").length;
533
+ krTotalLength += kr.mileStoneName.replace(/(%|\d)/g, '').length;
528
534
  });
529
535
  krAvarageLength = krDatas.length > 0 ? krTotalLength / krDatas.length : 0;
530
536
  krMeasurableLength = krsCheckResult.friendlyResult.filter(function (kr) {
@@ -532,13 +538,13 @@ function CreateOkrModal(_ref, ref) {
532
538
  }).length;
533
539
  oHasVtWords = oNameCheckResult[0].result === _okrCreateSuggest.EOkrCreateSuggestResultType.correct;
534
540
  callData = data;
535
- callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrName.replace(/(%|\d)/g, "").length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
541
+ callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrName.replace(/(%|\d)/g, '').length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
536
542
  newOkrDataRef.current = callData;
537
543
  handleOnSuccess();
538
544
  } else {
539
545
  workId = data.workId;
540
546
 
541
- _drawerManager["default"].open("okrDetail", {
547
+ _drawerManager["default"].open('okrDetail', {
542
548
  okrId: workId
543
549
  });
544
550
  }
@@ -586,10 +592,10 @@ function CreateOkrModal(_ref, ref) {
586
592
  principalName: Name,
587
593
  userAvatar: UserAvatar,
588
594
  krWeight: 100,
589
- mileStoneName: "",
595
+ mileStoneName: '',
590
596
  confidenceIndex: 5
591
597
  }]);
592
- setOkrName("");
598
+ setOkrName('');
593
599
  setUser({
594
600
  name: Name,
595
601
  id: Id,
@@ -598,10 +604,10 @@ function CreateOkrModal(_ref, ref) {
598
604
  setIsCustomWeight(false);
599
605
  setDept({
600
606
  departmentId: 0,
601
- departmentName: ""
607
+ departmentName: ''
602
608
  });
603
609
  setType({
604
- typeName: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
610
+ typeName: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual'),
605
611
  typeId: 1
606
612
  });
607
613
  setCycle(cycle);
@@ -609,7 +615,7 @@ function CreateOkrModal(_ref, ref) {
609
615
  setVisibility(1);
610
616
  setParent({
611
617
  parentWorkId: 0,
612
- parentWorkName: "",
618
+ parentWorkName: '',
613
619
  parentType: 0,
614
620
  parentKrId: 0
615
621
  });
@@ -723,7 +729,7 @@ function CreateOkrModal(_ref, ref) {
723
729
  var ModalTitle = (0, _react.useMemo)(function () {
724
730
  return /*#__PURE__*/_react["default"].createElement(_style.Line, null, /*#__PURE__*/_react["default"].createElement("span", {
725
731
  className: "create-modal__title"
726
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_Title_Newobjective")), /*#__PURE__*/_react["default"].createElement(_okrCase["default"], {
732
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_Title_Newobjective')), /*#__PURE__*/_react["default"].createElement(_okrCase["default"], {
727
733
  okrTemplateEnabled: true,
728
734
  onOkrApply: OnOkRApplyTplHandler
729
735
  }));
@@ -765,7 +771,7 @@ function CreateOkrModal(_ref, ref) {
765
771
 
766
772
  setShowCreatedSuccessInfo(false);
767
773
 
768
- _drawerManager["default"].open("okrDetail", {
774
+ _drawerManager["default"].open('okrDetail', {
769
775
  okrId: workId
770
776
  });
771
777
 
@@ -784,10 +790,10 @@ function CreateOkrModal(_ref, ref) {
784
790
 
785
791
  var trackAction = function trackAction() {
786
792
  // @ts-ignore
787
- window.titaTracker && window.titaTracker("action").record({
788
- actionName: "点击【教你写OKR】",
789
- actionGroup: (0, _getLocale.getLocale)("OKR_MyO_Collr_Butt_CreatOKR"),
790
- productName: (0, _getLocale.getLocale)("Menu_Title_OKRs")
793
+ window.titaTracker && window.titaTracker('action').record({
794
+ actionName: '点击【教你写OKR】',
795
+ actionGroup: (0, _getLocale.getLocale)('OKR_MyO_Collr_Butt_CreatOKR'),
796
+ productName: (0, _getLocale.getLocale)('Menu_Title_OKRs')
791
797
  });
792
798
  };
793
799
 
@@ -797,7 +803,7 @@ function CreateOkrModal(_ref, ref) {
797
803
  }
798
804
  return /*#__PURE__*/_react["default"].createElement("a", {
799
805
  className: "teact-write-okr",
800
- href: (0, _helpers.isDingDing)() ? "https://wiki.tita.com/pages/viewpage.action?pageId=15696093" : "https://docs.tita.com/question/okr-write/",
806
+ href: (0, _helpers.isDingDing)() ? 'https://wiki.tita.com/pages/viewpage.action?pageId=15696093' : 'https://docs.tita.com/question/okr-write/',
801
807
  target: "_blank",
802
808
  onClick: trackAction,
803
809
  rel: "noreferrer"
@@ -806,7 +812,7 @@ function CreateOkrModal(_ref, ref) {
806
812
  src: _teachOkr["default"]
807
813
  }), /*#__PURE__*/_react["default"].createElement("span", {
808
814
  className: "teact-write-okr__text"
809
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_TeachwriteOKR")));
815
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_TeachwriteOKR')));
810
816
  }, []);
811
817
  (0, _react.useEffect)(function () {
812
818
  // @ts-ignore
@@ -820,8 +826,8 @@ function CreateOkrModal(_ref, ref) {
820
826
  mask: true,
821
827
  centered: true,
822
828
  onOk: onModalOkHandler,
823
- okText: (0, _getLocale.getLocale)("OKR_MyO_Pop_Createnow"),
824
- cancelText: (0, _getLocale.getLocale)("Mod_Cancel"),
829
+ okText: (0, _getLocale.getLocale)('OKR_MyO_Pop_Createnow'),
830
+ cancelText: (0, _getLocale.getLocale)('Mod_Cancel'),
825
831
  title: ModalTitle,
826
832
  visible: isVisible,
827
833
  onCancel: hideCreateOkrModal,
@@ -829,7 +835,7 @@ function CreateOkrModal(_ref, ref) {
829
835
  footerLeftContent: renderFooterTeachWriteOKr,
830
836
  zIndex: 1200,
831
837
  bodyStyle: {
832
- flexBasis: "auto"
838
+ flexBasis: 'auto'
833
839
  }
834
840
  }, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
835
841
  ref: wrapperRef
@@ -857,7 +863,7 @@ function CreateOkrModal(_ref, ref) {
857
863
  setIsInputContent: setIsInputContent
858
864
  }), /*#__PURE__*/_react["default"].createElement("div", {
859
865
  className: "create-modal__title-line"
860
- }, /*#__PURE__*/_react["default"].createElement(_style.BlueBar, null), (0, _getLocale.getLocale)("Per_Ass_New_Appr_detail_moreS")), /*#__PURE__*/_react["default"].createElement("div", {
866
+ }, /*#__PURE__*/_react["default"].createElement(_style.BlueBar, null), (0, _getLocale.getLocale)('Per_Ass_New_Appr_detail_moreS')), /*#__PURE__*/_react["default"].createElement("div", {
861
867
  className: "space-between-row"
862
868
  }, /*#__PURE__*/_react["default"].createElement(_okrParent["default"], {
863
869
  parent: parent,
@@ -46,7 +46,7 @@ var createWidthKr = /*#__PURE__*/function () {
46
46
  while (1) {
47
47
  switch (_context.prev = _context.next) {
48
48
  case 0:
49
- url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/work/createWithKr");
49
+ url = "".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/createWithKr");
50
50
  _context.next = 3;
51
51
  return _axios["default"].post(url, _objectSpread({
52
52
  workType: 6
@@ -33,13 +33,13 @@
33
33
 
34
34
  .titaui-dialog-confirm__btn-cancel {
35
35
  background: #ffffff;
36
- border: 1px solid #dfe3ea;
36
+ border: 1px solid #dfe3ea !important;
37
37
  color: #6f7886;
38
38
  }
39
39
 
40
40
  .titaui-dialog-confirm__btn-cancel:hover {
41
41
  color: #2879ff;
42
- border: 1px solid #2879ff;
42
+ border: 1px solid #2879ff !important;
43
43
  }
44
44
 
45
45
  .titaui-dialog-confirm__btn-cancel-text {
@@ -49,7 +49,9 @@ function HeaderAction(_ref) {
49
49
  _onClick = _ref.onClick,
50
50
  className = _ref.className,
51
51
  title = _ref.title,
52
- children = _ref.children;
52
+ children = _ref.children,
53
+ approvalSetting = _ref.approvalSetting,
54
+ detailInfo = _ref.detailInfo;
53
55
 
54
56
  var _useState = (0, _react.useState)(false),
55
57
  _useState2 = _slicedToArray(_useState, 2),
@@ -99,6 +101,8 @@ function HeaderAction(_ref) {
99
101
  if (children && children.length > 0) {
100
102
  content = /*#__PURE__*/_react["default"].createElement(_headerDrop["default"], {
101
103
  visible: dropVisible,
104
+ detailInfo: detailInfo,
105
+ approvalSetting: approvalSetting,
102
106
  onVisibleChange: function onVisibleChange(visible) {
103
107
  active.current = visible;
104
108
  !visible && setDropVisible(false);