@titaui/pc 1.16.41 → 1.16.43

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.
@@ -63,7 +63,7 @@ function PublishMblog(_ref) {
63
63
  closeModal = _ref.closeModal,
64
64
  uid = _ref.uid,
65
65
  _ref$defaultContent = _ref.defaultContent,
66
- defaultContent = _ref$defaultContent === void 0 ? (0, _getLocale.getLocale)("OKR_MyO_Popup_ShowmyOKR") : _ref$defaultContent;
66
+ defaultContent = _ref$defaultContent === void 0 ? '' : _ref$defaultContent;
67
67
 
68
68
  var _useState = (0, _react.useState)({
69
69
  url: "",
@@ -228,18 +228,62 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
228
228
  isShowAllCommunicationRecord ? _this.getFeedInfo(feedId, communicationTrackTotal) : _this.getFeedInfo(feedId, commentCount);
229
229
  };
230
230
 
231
- _this.handlerReply = function (submitType, sentData) {
231
+ _this.customSubmitCallback = function (res) {
232
+ var _this$state3 = _this.state,
233
+ communicationTrackList = _this$state3.communicationTrackList,
234
+ isShowAllCommunicationRecord = _this$state3.isShowAllCommunicationRecord,
235
+ communicationTrackTotal = _this$state3.communicationTrackTotal;
232
236
  var _this$props4 = _this.props,
233
237
  feedId = _this$props4.feedId,
234
- commentCount = _this$props4.commentCount,
235
- commentType = _this$props4.commentType,
236
- okrFeedParams = _this$props4.okrFeedParams,
237
- onReplyChange = _this$props4.onReplyChange;
238
- var _this$state3 = _this.state,
239
- isShowReplyToUser = _this$state3.isShowReplyToUser,
240
- replyUserCommentId = _this$state3.replyUserCommentId,
241
- communicationTrackTotal = _this$state3.communicationTrackTotal,
242
- isShowAllCommunicationRecord = _this$state3.isShowAllCommunicationRecord;
238
+ commentCount = _this$props4.commentCount;
239
+
240
+ if (res.Code === 1) {
241
+ _this.setState({
242
+ submitStatus: 1,
243
+ isShowReplyToUser: false,
244
+ isShowDefaultInput: true
245
+ });
246
+
247
+ if (!feedId) {
248
+ _this.setState({
249
+ communicationTrackList: [].concat(_toConsumableArray(communicationTrackList), [res.Data])
250
+ });
251
+
252
+ return;
253
+ }
254
+
255
+ if (isShowAllCommunicationRecord) _this.getFeedInfo(feedId, communicationTrackTotal + 1);else _this.getFeedInfo(feedId, commentCount);
256
+ } else {
257
+ _this.setState({
258
+ submitStatus: 0
259
+ });
260
+ }
261
+ };
262
+
263
+ _this.handlerReply = function (submitType, sentData) {
264
+ var _this$state4 = _this.state,
265
+ isShowReplyToUser = _this$state4.isShowReplyToUser,
266
+ replyUserCommentId = _this$state4.replyUserCommentId,
267
+ communicationTrackTotal = _this$state4.communicationTrackTotal,
268
+ isShowAllCommunicationRecord = _this$state4.isShowAllCommunicationRecord;
269
+ var _this$props5 = _this.props,
270
+ feedId = _this$props5.feedId,
271
+ commentCount = _this$props5.commentCount,
272
+ commentType = _this$props5.commentType,
273
+ okrFeedParams = _this$props5.okrFeedParams,
274
+ onReplyChange = _this$props5.onReplyChange,
275
+ customSubmitHandlerSync = _this$props5.customSubmitHandlerSync,
276
+ customSubmitHandler = _this$props5.customSubmitHandler;
277
+
278
+ if (submitType === 'submit' && customSubmitHandlerSync) {
279
+ customSubmitHandlerSync(sentData).then(_this.customSubmitCallback);
280
+ return;
281
+ }
282
+
283
+ if (submitType === 'submit' && customSubmitHandler) {
284
+ customSubmitHandler(sentData, _this.customSubmitCallback);
285
+ return;
286
+ }
243
287
 
244
288
  if (submitType === 'submit') {
245
289
  // 发送
@@ -333,11 +377,11 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
333
377
  _createClass(Communication, [{
334
378
  key: "componentDidMount",
335
379
  value: function componentDidMount() {
336
- var _this$props5 = this.props,
337
- feedId = _this$props5.feedId,
338
- commentCount = _this$props5.commentCount,
339
- commentType = _this$props5.commentType,
340
- usePropsComment = _this$props5.usePropsComment;
380
+ var _this$props6 = this.props,
381
+ feedId = _this$props6.feedId,
382
+ commentCount = _this$props6.commentCount,
383
+ commentType = _this$props6.commentType,
384
+ usePropsComment = _this$props6.usePropsComment;
341
385
 
342
386
  if ((feedId || commentType === 2) && !usePropsComment) {
343
387
  this.getFeedInfo(feedId, commentCount);
@@ -347,9 +391,9 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
347
391
  key: "componentDidUpdate",
348
392
  value: function componentDidUpdate(prevProps, prevState) {
349
393
  if (prevProps.feedId !== this.props.feedId || prevProps.okrFeedParams !== this.props.okrFeedParams || prevProps.usePropsComment !== this.props.usePropsComment) {
350
- var _this$props6 = this.props,
351
- feedId = _this$props6.feedId,
352
- commentCount = _this$props6.commentCount;
394
+ var _this$props7 = this.props,
395
+ feedId = _this$props7.feedId,
396
+ commentCount = _this$props7.commentCount;
353
397
  this.getFeedInfo(feedId, commentCount);
354
398
  }
355
399
  }
@@ -365,42 +409,42 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
365
409
  value: function render() {
366
410
  var _this2 = this;
367
411
 
368
- var _this$state4 = this.state,
369
- communicationTrackList = _this$state4.communicationTrackList,
370
- communicationTrackTotal = _this$state4.communicationTrackTotal,
371
- isShowAllCommunicationRecord = _this$state4.isShowAllCommunicationRecord,
372
- replyUser = _this$state4.replyUser,
373
- replyUserId = _this$state4.replyUserId,
374
- isShowReplyToUser = _this$state4.isShowReplyToUser,
375
- submitStatus = _this$state4.submitStatus,
376
- isShowPraiseRecordPop = _this$state4.isShowPraiseRecordPop,
377
- praiseObjId = _this$state4.praiseObjId,
378
- isShowDefaultInput = _this$state4.isShowDefaultInput,
379
- needAutoFocus = _this$state4.needAutoFocus;
380
- var _this$props7 = this.props,
381
- feedId = _this$props7.feedId,
382
- className = _this$props7.className,
383
- isShowSendSms = _this$props7.isShowSendSms,
384
- confirmPopAlign = _this$props7.confirmPopAlign,
385
- setTextareaRef = _this$props7.setTextareaRef,
386
- userSelectorPopAlign = _this$props7.userSelectorPopAlign,
387
- emotionsSelectorPopAlign = _this$props7.emotionsSelectorPopAlign,
388
- showAtAll = _this$props7.showAtAll,
389
- atAllTipText = _this$props7.atAllTipText,
390
- atAllValue = _this$props7.atAllValue,
391
- atAllText = _this$props7.atAllText,
392
- commentCount = _this$props7.commentCount,
393
- useCustomMblog = _this$props7.useCustomMblog,
394
- _this$props7$submitTe = _this$props7.submitText,
395
- submitText = _this$props7$submitTe === void 0 ? (0, _getLocale.getLocale)('Mod_Reply') : _this$props7$submitTe,
396
- _this$props7$highLigh = _this$props7.highLightKeyWord,
397
- highLightKeyWord = _this$props7$highLigh === void 0 ? '' : _this$props7$highLigh,
398
- _this$props7$autoFocu = _this$props7.autoFocus,
399
- autoFocus = _this$props7$autoFocu === void 0 ? false : _this$props7$autoFocu,
400
- _this$props7$showUser = _this$props7.showUser,
401
- showUser = _this$props7$showUser === void 0 ? false : _this$props7$showUser,
402
- _this$props7$attachem = _this$props7.attachemntCanSubmit,
403
- attachemntCanSubmit = _this$props7$attachem === void 0 ? true : _this$props7$attachem;
412
+ var _this$state5 = this.state,
413
+ communicationTrackList = _this$state5.communicationTrackList,
414
+ communicationTrackTotal = _this$state5.communicationTrackTotal,
415
+ isShowAllCommunicationRecord = _this$state5.isShowAllCommunicationRecord,
416
+ replyUser = _this$state5.replyUser,
417
+ replyUserId = _this$state5.replyUserId,
418
+ isShowReplyToUser = _this$state5.isShowReplyToUser,
419
+ submitStatus = _this$state5.submitStatus,
420
+ isShowPraiseRecordPop = _this$state5.isShowPraiseRecordPop,
421
+ praiseObjId = _this$state5.praiseObjId,
422
+ isShowDefaultInput = _this$state5.isShowDefaultInput,
423
+ needAutoFocus = _this$state5.needAutoFocus;
424
+ var _this$props8 = this.props,
425
+ feedId = _this$props8.feedId,
426
+ className = _this$props8.className,
427
+ isShowSendSms = _this$props8.isShowSendSms,
428
+ confirmPopAlign = _this$props8.confirmPopAlign,
429
+ setTextareaRef = _this$props8.setTextareaRef,
430
+ userSelectorPopAlign = _this$props8.userSelectorPopAlign,
431
+ emotionsSelectorPopAlign = _this$props8.emotionsSelectorPopAlign,
432
+ showAtAll = _this$props8.showAtAll,
433
+ atAllTipText = _this$props8.atAllTipText,
434
+ atAllValue = _this$props8.atAllValue,
435
+ atAllText = _this$props8.atAllText,
436
+ commentCount = _this$props8.commentCount,
437
+ useCustomMblog = _this$props8.useCustomMblog,
438
+ _this$props8$submitTe = _this$props8.submitText,
439
+ submitText = _this$props8$submitTe === void 0 ? (0, _getLocale.getLocale)('Mod_Reply') : _this$props8$submitTe,
440
+ _this$props8$highLigh = _this$props8.highLightKeyWord,
441
+ highLightKeyWord = _this$props8$highLigh === void 0 ? '' : _this$props8$highLigh,
442
+ _this$props8$autoFocu = _this$props8.autoFocus,
443
+ autoFocus = _this$props8$autoFocu === void 0 ? false : _this$props8$autoFocu,
444
+ _this$props8$showUser = _this$props8.showUser,
445
+ showUser = _this$props8$showUser === void 0 ? false : _this$props8$showUser,
446
+ _this$props8$attachem = _this$props8.attachemntCanSubmit,
447
+ attachemntCanSubmit = _this$props8$attachem === void 0 ? true : _this$props8$attachem;
404
448
  var user = (0, _bsGlobal.getUserInfo)();
405
449
  return /*#__PURE__*/_react["default"].createElement(_style.CommunicationWrapper, {
406
450
  className: "communcation-wrapper ".concat(className)
@@ -217,6 +217,8 @@ var MblogContent = /*#__PURE__*/function (_PureComponent) {
217
217
  editable: true,
218
218
  showToolbar: false,
219
219
  withMentions: true,
220
+ onKeyUp: this._handlerKeyUp,
221
+ onKeyDown: this._handlerKeyDown,
220
222
  initialState: {},
221
223
  onDocChange: this.onChangeEditor,
222
224
  placeholder: placeholderText
@@ -80,7 +80,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
80
80
  commentsTypeKey = _this$props.commentsTypeKey,
81
81
  privateValue = _this$props.privateValue,
82
82
  defaultContent = _this$props.defaultContent;
83
- var localStroageKey = "mblogLocalStroage_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(commentsTypeKey); // 根据commentsTypeKey设置localStroageKey
83
+ var localStroageKey = "mblogLocalStroage1_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(commentsTypeKey); // 根据commentsTypeKey设置localStroageKey
84
84
 
85
85
  var textareaValue = (0, _index.htmlDecodeByRegExp)(localStorage.getItem(localStroageKey) || defaultContent); // 获取本地缓存内容
86
86
 
@@ -224,7 +224,9 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
224
224
  visibility = _this$state.visibility,
225
225
  mentionUsers = _this$state.mentionUsers,
226
226
  richText = _this$state.richText,
227
- pureText = _this$state.pureText;
227
+ pureText = _this$state.pureText,
228
+ isAllowSubmit = _this$state.isAllowSubmit;
229
+ if (!isAllowSubmit) return;
228
230
  var _this$props2 = _this.props,
229
231
  isShowAttachment = _this$props2.isShowAttachment,
230
232
  isShowSendSms = _this$props2.isShowSendSms,
@@ -101,7 +101,7 @@ function PublishMblog(_ref) {
101
101
  }
102
102
  }, /*#__PURE__*/_react["default"].createElement(_mblog["default"], {
103
103
  autoResizing: false,
104
- defaultContent: "\u79C0\u4E00\u79C0\u6211\u7684 OKR",
104
+ defaultContent: "\u3010\u79C0\u4E00\u79C0 OKR\u3011",
105
105
  submitStatus: status,
106
106
  commentsTypeKey: "share-okr".concat(loginUserId).concat(okrId),
107
107
  autoFocus: true,
@@ -76,7 +76,7 @@ var PublishDynamicModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
76
76
  canClose: false
77
77
  });
78
78
 
79
- localStorage.removeItem("mblogLocalStroage_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(isShare ? "share" : "announcement"));
79
+ localStorage.removeItem("mblogLocalStroage1_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(isShare ? "share" : "announcement"));
80
80
  setVisible(false);
81
81
  setSubmitStatus(1);
82
82
 
@@ -104,7 +104,7 @@ var PublishDynamicModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
104
104
  canClose: false
105
105
  });
106
106
 
107
- localStorage.removeItem("mblogLocalStroage_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(isShare ? "share" : "announcement"));
107
+ localStorage.removeItem("mblogLocalStroage1_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(isShare ? "share" : "announcement"));
108
108
  setVisible(false);
109
109
  setSubmitStatus(1);
110
110
  setTimeout(function () {
@@ -7,8 +7,6 @@ exports["default"] = _default;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _openData = require("../../../utils/open-data");
11
-
12
10
  var _getLocale = require("../../../utils/getLocale");
13
11
 
14
12
  require("./index.css");
@@ -20,9 +18,7 @@ function _default() {
20
18
 
21
19
  var role = (_window$BSGlobal$logi = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi === void 0 ? void 0 : _window$BSGlobal$logi.Role;
22
20
  var isManager = role == 4 || role == 2;
23
- var webPath = window.BSGlobal.webPath;
24
- var domain = (0, _openData.isWechat)() ? "work-weixin" : "admin";
25
- var url = "//".concat(domain, ".").concat(webPath, "/").concat((_window$BSGlobal$logi2 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi2 === void 0 ? void 0 : _window$BSGlobal$logi2.Id, "/TmHome#?iTalentFrameType=iframe&iTalentNavId=44281&iTalentFrame=https://").concat(domain, ".").concat(webPath, "/").concat((_window$BSGlobal$logi3 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi3 === void 0 ? void 0 : _window$BSGlobal$logi3.Id, "/indexV2#/groupManage&");
21
+ var url = "//".concat(window.location.host, "/").concat((_window$BSGlobal$logi2 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi2 === void 0 ? void 0 : _window$BSGlobal$logi2.Id, "/TmHome#?iTalentFrameType=iframe&iTalentNavId=44281&iTalentFrame=").concat(window.location.origin, "/").concat((_window$BSGlobal$logi3 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi3 === void 0 ? void 0 : _window$BSGlobal$logi3.Id, "/indexV2#/groupManage&");
26
22
 
27
23
  if (isManager) {
28
24
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -22,19 +22,21 @@ exports.UserTypeNumberEnum = UserTypeNumberEnum;
22
22
  UserTypeNumberEnum[UserTypeNumberEnum["User"] = 1] = "User";
23
23
  UserTypeNumberEnum[UserTypeNumberEnum["AllMembers"] = 2] = "AllMembers";
24
24
  UserTypeNumberEnum[UserTypeNumberEnum["ProjectOrTarget"] = 4] = "ProjectOrTarget";
25
+ UserTypeNumberEnum[UserTypeNumberEnum["Department"] = 15] = "Department";
25
26
  })(UserTypeNumberEnum || (exports.UserTypeNumberEnum = UserTypeNumberEnum = {}));
26
27
 
27
28
  var appendUsers = function appendUsers(users) {
28
29
  return (0, _flatten["default"])(users.map(function (_ref) {
29
30
  var Name = _ref.Name,
30
31
  Id = _ref.Id,
31
- _ref$type = _ref.type,
32
- type = _ref$type === void 0 ? 'user' : _ref$type;
32
+ DepartmentName = _ref.DepartmentName;
33
+ var type = 'user';
34
+ if (DepartmentName) type = 'department';
33
35
  return [{
34
36
  type: 'mention',
35
37
  attrs: {
36
38
  mentionId: Id,
37
- mentionName: Name,
39
+ mentionName: Name || DepartmentName,
38
40
  mentionType: type
39
41
  }
40
42
  }, {
@@ -67,7 +69,8 @@ var usersTypeToNumber = function usersTypeToNumber(mentionUsers) {
67
69
  return _objectSpread(_objectSpread({}, user), {}, {
68
70
  mentionType: {
69
71
  user: UserTypeNumberEnum.User,
70
- all_members: UserTypeNumberEnum.AllMembers
72
+ all_members: UserTypeNumberEnum.AllMembers,
73
+ department: UserTypeNumberEnum.Department
71
74
  }[user.mentionType]
72
75
  });
73
76
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.16.41",
3
+ "version": "1.16.43",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",