@titaui/pc 1.16.39-beta.2 → 1.16.39-beta.4

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.
@@ -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
@@ -50,7 +50,7 @@ var surveyMenus = /*#__PURE__*/function () {
50
50
  label: (0, _getLocale.getLocale)('Per_Menu_Title_Label_BasicSettings'),
51
51
  key: "other",
52
52
  type: _index.GROUP_NAME_NODE,
53
- href: "#/",
53
+ href: "",
54
54
  isShow: props.isShowSurveyManage
55
55
  }, {
56
56
  icon: 'setting',
@@ -95,7 +95,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
95
95
  var firstMenuHref = menus[0].data.href;
96
96
  if (firstMenuHref.split('#')[1] === pathname) return; //当前路由与二级菜单第一项相同时直接return
97
97
 
98
- var menusHrefArr = ['/survey/manage', '/survey/my-involved', '/survey/assess-settings'];
98
+ var menusHrefArr = ['/survey/manage', '/survey/my-involved'];
99
99
  var isIncludeMenu = menusHrefArr.find(function (item) {
100
100
  //表示当前路由是否是左侧二级菜单的选项
101
101
  return item.includes(pathname);
@@ -109,7 +109,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
109
109
 
110
110
  if (!isShowMenuItem) {
111
111
  //如果当前路由没有权限展示的话,则跳转到有权限二级路由的第一项
112
- window.location.href = '#/survey/my-involved';
112
+ window.location.href = firstMenuHref;
113
113
  }
114
114
  }, [history.location.pathname, history.location.search]);
115
115
 
@@ -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.39-beta.2",
3
+ "version": "1.16.39-beta.4",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",