@titaui/pc 1.16.41 → 1.16.43-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.
@@ -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)
@@ -11,7 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _tooltip = _interopRequireDefault(require("../../tooltip"));
13
13
 
14
- var _UserSelectorPop = _interopRequireDefault(require("../../../components-v1/userSelector/UserSelectorPop"));
14
+ var _userSelector = _interopRequireDefault(require("../../user-selector"));
15
15
 
16
16
  var _style = require("../style");
17
17
 
@@ -37,18 +37,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
37
37
 
38
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
39
 
40
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
41
-
42
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
43
-
44
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
45
-
46
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
47
-
48
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
49
-
50
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
51
-
52
40
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
53
41
 
54
42
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -121,6 +109,9 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
121
109
  isSendSms: false
122
110
  });
123
111
  }
112
+ }, _this.onOpenAtSelector = function () {
113
+ _this.refs.atSelector.open(); // 输入@弹出选人组件
114
+
124
115
  }, _assertThisInitialized(_this)));
125
116
  }
126
117
 
@@ -131,7 +122,7 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
131
122
 
132
123
  if (isInputAt) {
133
124
  // @ts-ignore
134
- this.refs.atSelector.handleShowPop(); // 输入@弹出选人组件
125
+ this.refs.atSelector.open(); // 输入@弹出选人组件
135
126
  }
136
127
  } // componentWillReceiveProps(newProps: Props) {
137
128
  // if (newProps.isInputEnterSubmit && newProps.isAllowSubmit) {
@@ -197,16 +188,23 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
197
188
  }, /*#__PURE__*/_react["default"].createElement(_style.LeftBtn, {
198
189
  key: this.props.atText,
199
190
  tips: this.props.atTipText
200
- }, /*#__PURE__*/_react["default"].createElement(_UserSelectorPop["default"], {
191
+ }, /*#__PURE__*/_react["default"].createElement(_userSelector["default"], {
192
+ popupAlign: {
193
+ offset: [-550, -100],
194
+ overflow: {
195
+ adjustX: true,
196
+ adjustY: true
197
+ },
198
+ targetOffset: [0, 0]
199
+ },
201
200
  ref: "atSelector",
202
- stopPropagation: true,
203
- popExtraClassName: "pull-screen-ignore",
204
- align: userSelectorPopAlign,
205
- container: this.context.popContainer,
206
- onSubmit: function onSubmit(users, depts) {
207
- onActionsSelectedUserChange([].concat(_toConsumableArray(users), _toConsumableArray(depts)));
208
- }
209
- }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
201
+ multiple: true,
202
+ onOk: onActionsSelectedUserChange,
203
+ position: "centerRight" // selectNodes={visiableLimitState || {}}
204
+
205
+ }, /*#__PURE__*/_react["default"].createElement("div", {
206
+ onClick: this.onOpenAtSelector
207
+ }, /*#__PURE__*/_react["default"].createElement("span", {
210
208
  className: "btn-txt"
211
209
  }, this.props.atText))))), this.props.isShowAtAll && /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
212
210
  container: function container() {
@@ -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
 
@@ -166,9 +166,14 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
166
166
  }
167
167
  };
168
168
 
169
- _this.onActionsSelectedUserChange = function (users) {
169
+ _this.onActionsSelectedUserChange = function (_ref3, _ref4, _ref5) {
170
+ var departments = _ref3.departments,
171
+ groups = _ref3.groups,
172
+ users = _ref3.users;
173
+ var isWechat = _ref4.isWechat;
174
+ var selectNodes = _ref5.selectNodes;
170
175
  var editorRef = _this.refs.textEditor.refs.editorRef;
171
- editorRef.append((0, _editor["default"])(users), {
176
+ editorRef.append((0, _editor.appendUserSelectorData)(selectNodes), {
172
177
  insertPos: true
173
178
  });
174
179
  editorRef.focus(); // @ts-ignore
@@ -224,7 +229,9 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
224
229
  visibility = _this$state.visibility,
225
230
  mentionUsers = _this$state.mentionUsers,
226
231
  richText = _this$state.richText,
227
- pureText = _this$state.pureText;
232
+ pureText = _this$state.pureText,
233
+ isAllowSubmit = _this$state.isAllowSubmit;
234
+ if (!isAllowSubmit) return;
228
235
  var _this$props2 = _this.props,
229
236
  isShowAttachment = _this$props2.isShowAttachment,
230
237
  isShowSendSms = _this$props2.isShowSendSms,
@@ -516,20 +523,12 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
516
523
  submitStatus: submitStatus,
517
524
  localStroageKey: localStroageKey,
518
525
  disableRangeSelect: disableRangeSelect || isAtAll,
519
- onActionsTextChange: function onActionsTextChange(actionValue) {
520
- _this2.onActionsTextChange(actionValue);
521
- },
526
+ onActionsTextChange: this.onActionsTextChange,
522
527
  onActionsAllMembersChange: this.onActionsAllMembersChange,
523
528
  onActionsEmotionChange: this.onActionsEmotionChange,
524
- onActionsSelectedUserChange: function onActionsSelectedUserChange(users) {
525
- return _this2.onActionsSelectedUserChange(users);
526
- },
527
- onActionsAttachmentChange: function onActionsAttachmentChange(uploadSuccessFilesPath) {
528
- return _this2.handlerDealAttachemntData(uploadSuccessFilesPath);
529
- },
530
- onActionSubmit: function onActionSubmit(submitType) {
531
- _this2.onActionSubmit(submitType);
532
- }
529
+ onActionsSelectedUserChange: this.onActionsSelectedUserChange,
530
+ onActionsAttachmentChange: this.handlerDealAttachemntData,
531
+ onActionSubmit: this.onActionSubmit
533
532
  }), /*#__PURE__*/_react["default"].createElement(_style.PreviewBox, {
534
533
  id: this.previewid
535
534
  }), !(0, _platform.isPlatform)('wx') && isShowDragMask && /*#__PURE__*/_react["default"].createElement(_style.DragEffect, {
@@ -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", {
@@ -281,7 +281,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
281
281
  users: users,
282
282
  departments: departments,
283
283
  groups: groups
284
- }, wechartOpts);
284
+ }, wechartOpts, {
285
+ selectNodes: selectNodes
286
+ });
285
287
  } else {
286
288
  onSelect(selectNodes, wechartOpts, e);
287
289
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usersTypeToNumber = exports["default"] = exports.appendUsers = exports.appendImgs = exports.UserTypeNumberEnum = void 0;
6
+ exports.usersTypeToNumber = exports["default"] = exports.appendUsers = exports.appendUserSelectorData = exports.appendImgs = exports.UserTypeNumberEnum = void 0;
7
7
 
8
8
  var _flatten = _interopRequireDefault(require("lodash/flatten"));
9
9
 
@@ -22,19 +22,22 @@ 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";
26
+ UserTypeNumberEnum[UserTypeNumberEnum["Group"] = 78] = "Group";
25
27
  })(UserTypeNumberEnum || (exports.UserTypeNumberEnum = UserTypeNumberEnum = {}));
26
28
 
27
29
  var appendUsers = function appendUsers(users) {
28
30
  return (0, _flatten["default"])(users.map(function (_ref) {
29
31
  var Name = _ref.Name,
30
32
  Id = _ref.Id,
31
- _ref$type = _ref.type,
32
- type = _ref$type === void 0 ? 'user' : _ref$type;
33
+ DepartmentName = _ref.DepartmentName;
34
+ var type = 'user';
35
+ if (DepartmentName) type = 'department';
33
36
  return [{
34
37
  type: 'mention',
35
38
  attrs: {
36
39
  mentionId: Id,
37
- mentionName: Name,
40
+ mentionName: Name || DepartmentName,
38
41
  mentionType: type
39
42
  }
40
43
  }, {
@@ -46,6 +49,35 @@ var appendUsers = function appendUsers(users) {
46
49
 
47
50
  exports.appendUsers = appendUsers;
48
51
 
52
+ var userSelectTypeToEditorType = function userSelectTypeToEditorType(type) {
53
+ return {
54
+ person: 'user',
55
+ depart: 'department',
56
+ group: 'group'
57
+ }[type];
58
+ };
59
+
60
+ var appendUserSelectorData = function appendUserSelectorData(selectNodes) {
61
+ return (0, _flatten["default"])(selectNodes.map(function (_ref2) {
62
+ var nodeType = _ref2.nodeType,
63
+ title = _ref2.title,
64
+ id = _ref2.id;
65
+ return [{
66
+ type: 'mention',
67
+ attrs: {
68
+ mentionId: id,
69
+ mentionName: title,
70
+ mentionType: userSelectTypeToEditorType(nodeType)
71
+ }
72
+ }, {
73
+ type: 'text',
74
+ text: ' '
75
+ }];
76
+ }));
77
+ };
78
+
79
+ exports.appendUserSelectorData = appendUserSelectorData;
80
+
49
81
  var appendImgs = function appendImgs(src, name) {
50
82
  return [{
51
83
  type: 'image',
@@ -67,7 +99,8 @@ var usersTypeToNumber = function usersTypeToNumber(mentionUsers) {
67
99
  return _objectSpread(_objectSpread({}, user), {}, {
68
100
  mentionType: {
69
101
  user: UserTypeNumberEnum.User,
70
- all_members: UserTypeNumberEnum.AllMembers
102
+ all_members: UserTypeNumberEnum.AllMembers,
103
+ department: UserTypeNumberEnum.Department
71
104
  }[user.mentionType]
72
105
  });
73
106
  });
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-beta.1",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",