@titaui/pc 1.11.18 → 1.11.21-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.
Files changed (53) 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 +25 -11
  4. package/lib/components/button/rect-btn/index.js +8 -4
  5. package/lib/components/communication/index.js +30 -29
  6. package/lib/components/create-okr-modal/request-api.js +1 -1
  7. package/lib/components/drawer/headerAction.js +5 -1
  8. package/lib/components/drawer/headerDrop.js +41 -4
  9. package/lib/components/drawer/index.css +44 -0
  10. package/lib/components/drawer/index.js +36 -7
  11. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.css +0 -2
  12. package/lib/components/mblog/index.js +31 -30
  13. package/lib/components/nav-top/index.js +6 -2
  14. package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +16 -4
  15. package/lib/components/okr-detail/base-info/other-infos/principal/index.js +9 -1
  16. package/lib/components/okr-detail/components/header/index.js +9 -3
  17. package/lib/components/okr-detail/components/header/o-name.js +9 -3
  18. package/lib/components/okr-detail/components/o-classify.js +5 -1
  19. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +9 -6
  20. package/lib/components/okr-detail/detail-header/constant.js +53 -0
  21. package/lib/components/okr-detail/detail-header/index.js +12 -1
  22. package/lib/components/okr-detail/helper.js +62 -0
  23. package/lib/components/okr-detail/index.js +21 -2
  24. package/lib/components/okr-detail/okr-list/index.js +8 -3
  25. package/lib/components/okr-detail/request-apis.js +7 -1
  26. package/lib/components/okr-flow/child-node/index.css +2 -1
  27. package/lib/components/okr-flow/export-modal/index.js +2 -2
  28. package/lib/components/okr-flow/okr-map/index.js +2 -2
  29. package/lib/components/okr-flow/utils/index.js +5 -6
  30. package/lib/components/okr-period-selector/select-cycle.js +23 -19
  31. package/lib/components/period-selector/index.css +6 -0
  32. package/lib/components/period-selector/index.js +1 -1
  33. package/lib/components/scroll-container/index.js +423 -0
  34. package/lib/components/scroll-container/style.css +35 -0
  35. package/lib/components/superset-charts/components/chart/index.js +1 -1
  36. package/lib/components/textarea/index.css +120 -0
  37. package/lib/components/textarea/index.js +257 -0
  38. package/lib/index.js +48 -0
  39. package/lib/pages/new-okr-list/header/common.js +52 -0
  40. package/lib/pages/new-okr-list/header/index.css +45 -0
  41. package/lib/pages/new-okr-list/header/index.js +38 -16
  42. package/lib/pages/new-okr-list/header/operate-record.js +124 -0
  43. package/lib/pages/new-okr-list/index.js +3 -1
  44. package/lib/pages/new-okr-list/list/index.js +19 -2
  45. package/lib/pages/new-okr-list/request-api.js +8 -2
  46. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +1 -1
  47. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +2 -2
  48. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +24 -12
  49. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +51 -11
  50. package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +20 -12
  51. package/lib/utils/format-time.js +8 -1
  52. package/lib/utils/open-data.js +5 -1
  53. package/package.json +2 -1
@@ -68,6 +68,4 @@
68
68
  .titaui-dynamic-operation__operate-content {
69
69
  color: #6f7886;
70
70
  white-space: pre-wrap;
71
- display: inline-flex;
72
- align-items: center;
73
71
  }
@@ -99,7 +99,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
99
99
  var atAll = !!contentValue.match(/@\[所有同事:all_members\]/g);
100
100
 
101
101
  _this.setState({
102
- isInputAt: contentValue.charAt(start - 1) == "@",
102
+ isInputAt: contentValue.charAt(start - 1) == '@',
103
103
  // isInputEnterSubmit: contentValue === 'isInputEnterSubmit',
104
104
  textareaValue: contentValue,
105
105
  isAllowSubmit: _this.allowSubmit(contentValue),
@@ -111,25 +111,25 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
111
111
  };
112
112
 
113
113
  _this.onActionsTextChange = function (actionValue) {
114
- if (actionValue === "allowSendSMS") {
114
+ if (actionValue === 'allowSendSMS') {
115
115
  return _this.setState({
116
116
  isSendSMS: true
117
117
  });
118
118
  }
119
119
 
120
- if (actionValue === "public") {
120
+ if (actionValue === 'public') {
121
121
  return _this.setState({
122
122
  visibility: 1
123
123
  });
124
124
  }
125
125
 
126
- if (actionValue === "private") {
126
+ if (actionValue === 'private') {
127
127
  return _this.setState({
128
128
  visibility: 2
129
129
  });
130
130
  }
131
131
 
132
- if (actionValue === "department") {
132
+ if (actionValue === 'department') {
133
133
  return _this.setState({
134
134
  visibility: 3
135
135
  });
@@ -172,7 +172,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
172
172
  var _this$refs$textEditor2;
173
173
 
174
174
  var successFilesPath = uploadSuccessFilesPath.filter(function (item) {
175
- return item !== "";
175
+ return item !== '';
176
176
  });
177
177
  var successFilesPathLen = successFilesPath.length; // @ts-ignore
178
178
 
@@ -223,7 +223,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
223
223
  submitStatus = _this$props2.submitStatus;
224
224
  var sentData = {}; // 发送的数据
225
225
 
226
- var FileUrl = uploadSuccessFilesPath.join(","); // 附件链接
226
+ var FileUrl = uploadSuccessFilesPath.join(','); // 附件链接
227
227
 
228
228
  if (isShowAttachment) {
229
229
  // @ts-ignore
@@ -243,10 +243,10 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
243
243
 
244
244
  sentData.Content = (0, _index.htmlEncodeByRegExp)(textareaValue); // @ts-ignore
245
245
 
246
- if (submitType === "submit" && submitStatus !== 2) {
246
+ if (submitType === 'submit' && submitStatus !== 2) {
247
247
  // 发送
248
248
  _this.props.onMblogSubmit(submitType, sentData);
249
- } else if (submitType === "cancel") {
249
+ } else if (submitType === 'cancel') {
250
250
  // 取消
251
251
  _this.props.onMblogSubmit(submitType);
252
252
  }
@@ -323,9 +323,9 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
323
323
  _this.state = {
324
324
  uploadSuccessFilesPath: [],
325
325
  isAllowSubmit: false,
326
- localStroageKey: "",
326
+ localStroageKey: '',
327
327
  // 本地存储key
328
- textareaValue: "",
328
+ textareaValue: '',
329
329
  isSendSMS: false,
330
330
  visibility: 1,
331
331
  isInputAt: false,
@@ -359,7 +359,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
359
359
  if (submitStatus === 1) {
360
360
  // 发送成功,清空内容
361
361
  this.setState({
362
- textareaValue: "",
362
+ textareaValue: '',
363
363
  uploadSuccessFilesPath: [],
364
364
  isSendSMS: false,
365
365
  isAllowSubmit: false
@@ -379,7 +379,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
379
379
  contentClassName = _this$props3.contentClassName,
380
380
  isHasPlaceholder = _this$props3.isHasPlaceholder,
381
381
  _this$props3$placehol = _this$props3.placeholderText,
382
- placeholderText = _this$props3$placehol === void 0 ? "有事需要提醒ta,请@ta" : _this$props3$placehol,
382
+ placeholderText = _this$props3$placehol === void 0 ? '有事需要提醒ta,请@ta' : _this$props3$placehol,
383
383
  maxLength = _this$props3.maxLength,
384
384
  autoResizing = _this$props3.autoResizing,
385
385
  initialTextHeight = _this$props3.initialTextHeight,
@@ -387,36 +387,36 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
387
387
  actionClassName = _this$props3.actionClassName,
388
388
  isShowAttachment = _this$props3.isShowAttachment,
389
389
  _this$props3$attachme = _this$props3.attachmentText,
390
- attachmentText = _this$props3$attachme === void 0 ? (0, _getLocale.getLocale)("Mod_Annexes") : _this$props3$attachme,
390
+ attachmentText = _this$props3$attachme === void 0 ? (0, _getLocale.getLocale)('Mod_Annexes') : _this$props3$attachme,
391
391
  attachmentTipText = _this$props3.attachmentTipText,
392
392
  fileNumLimit = _this$props3.fileNumLimit,
393
393
  attachmentPreviewBox = _this$props3.attachmentPreviewBox,
394
394
  _this$props3$atAllTex = _this$props3.atAllText,
395
- atAllText = _this$props3$atAllTex === void 0 ? (0, _getLocale.getLocale)("Mod_AllColleagues") : _this$props3$atAllTex,
395
+ atAllText = _this$props3$atAllTex === void 0 ? (0, _getLocale.getLocale)('Mod_AllColleagues') : _this$props3$atAllTex,
396
396
  _this$props3$atAllVal = _this$props3.atAllValue,
397
- atAllValue = _this$props3$atAllVal === void 0 ? "@[所有同事:all_members] " : _this$props3$atAllVal,
397
+ atAllValue = _this$props3$atAllVal === void 0 ? '@[所有同事:all_members] ' : _this$props3$atAllVal,
398
398
  _this$props3$atAllTip = _this$props3.atAllTipText,
399
- atAllTipText = _this$props3$atAllTip === void 0 ? (0, _getLocale.getLocale)("OKR_MyO_Popup_Allcolleagues") : _this$props3$atAllTip,
399
+ atAllTipText = _this$props3$atAllTip === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_Popup_Allcolleagues') : _this$props3$atAllTip,
400
400
  isShowAt = _this$props3.isShowAt,
401
401
  showAtAll = _this$props3.showAtAll,
402
402
  _this$props3$atText = _this$props3.atText,
403
- atText = _this$props3$atText === void 0 ? (0, _getLocale.getLocale)("Mod_colleague") : _this$props3$atText,
403
+ atText = _this$props3$atText === void 0 ? (0, _getLocale.getLocale)('Mod_colleague') : _this$props3$atText,
404
404
  _this$props3$atTipTex = _this$props3.atTipText,
405
- atTipText = _this$props3$atTipTex === void 0 ? (0, _getLocale.getLocale)("OKR_MyO_Popup_Butt_Colleagues") : _this$props3$atTipTex,
405
+ atTipText = _this$props3$atTipTex === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_Popup_Butt_Colleagues') : _this$props3$atTipTex,
406
406
  userSelectorPopAlign = _this$props3.userSelectorPopAlign,
407
407
  isShowEmotion = _this$props3.isShowEmotion,
408
408
  _this$props3$emotionT = _this$props3.emotionText,
409
- emotionText = _this$props3$emotionT === void 0 ? (0, _getLocale.getLocale)("Mod_Expressions") : _this$props3$emotionT,
409
+ emotionText = _this$props3$emotionT === void 0 ? (0, _getLocale.getLocale)('Mod_Expressions') : _this$props3$emotionT,
410
410
  emotionTipText = _this$props3.emotionTipText,
411
411
  emotionsSelectorPopAlign = _this$props3.emotionsSelectorPopAlign,
412
412
  isShowSendSms = _this$props3.isShowSendSms,
413
413
  _this$props3$sendSmsT = _this$props3.sendSmsTipText,
414
- sendSmsTipText = _this$props3$sendSmsT === void 0 ? (0, _getLocale.getLocale)("Tasks_Tab_MyS_Thecollenotified") : _this$props3$sendSmsT,
414
+ sendSmsTipText = _this$props3$sendSmsT === void 0 ? (0, _getLocale.getLocale)('Tasks_Tab_MyS_Thecollenotified') : _this$props3$sendSmsT,
415
415
  isShowRange = _this$props3.isShowRange,
416
416
  isShowRangeDropDown = _this$props3.isShowRangeDropDown,
417
417
  isShowBtnCancel = _this$props3.isShowBtnCancel,
418
418
  _this$props3$submitTe = _this$props3.submitText,
419
- submitText = _this$props3$submitTe === void 0 ? (0, _getLocale.getLocale)("Mod_Publish") : _this$props3$submitTe,
419
+ submitText = _this$props3$submitTe === void 0 ? (0, _getLocale.getLocale)('Mod_Publish') : _this$props3$submitTe,
420
420
  setTextareaRef = _this$props3.setTextareaRef,
421
421
  disableRangeSelect = _this$props3.disableRangeSelect,
422
422
  showUser = _this$props3.showUser;
@@ -431,7 +431,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
431
431
  isShowDragMask = _this$state2.isShowDragMask,
432
432
  isAtAll = _this$state2.isAtAll;
433
433
  var fSize = (0, _bsGlobal.getUploadMaxSize)();
434
- var fTip = attachmentTipText || (0, _getLocale.getLocale)("OKR_MyO_KRP_Draganddropu").replace("50MB", "".concat(fSize, "MB"));
434
+ var fTip = attachmentTipText || (0, _getLocale.getLocale)('OKR_MyO_KRP_Draganddropu').replace('50MB', "".concat(fSize, "MB"));
435
435
  var user = (0, _bsGlobal.getUserInfo)();
436
436
  return /*#__PURE__*/_react["default"].createElement("div", {
437
437
  className: prefix
@@ -445,7 +445,8 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
445
445
  },
446
446
  name: user.Name,
447
447
  color: user.UserAvatar.Color,
448
- src: user.UserAvatar.Medium
448
+ src: user.UserAvatar.Medium,
449
+ userId: user.Id
449
450
  })), /*#__PURE__*/_react["default"].createElement(_style.MBlogBox, {
450
451
  className: className,
451
452
  ref: "mblogbox",
@@ -523,7 +524,7 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
523
524
  }
524
525
  }), /*#__PURE__*/_react["default"].createElement(_style.PreviewBox, {
525
526
  id: this.previewid
526
- }), !(0, _platform.isPlatform)("wx") && isShowDragMask && /*#__PURE__*/_react["default"].createElement(_style.DragEffect, {
527
+ }), !(0, _platform.isPlatform)('wx') && isShowDragMask && /*#__PURE__*/_react["default"].createElement(_style.DragEffect, {
527
528
  className: "tu-icon-inbox-upload"
528
529
  })));
529
530
  }
@@ -535,12 +536,12 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
535
536
  exports["default"] = MBlog;
536
537
  MBlog.defaultProps = {
537
538
  // 样式相关
538
- contentClassName: "",
539
+ contentClassName: '',
539
540
  // 输入框class
540
- actionClassName: "",
541
+ actionClassName: '',
541
542
  // 功能栏class
542
543
  // 输入相关
543
- defaultContent: "",
544
+ defaultContent: '',
544
545
  isHasPlaceholder: false,
545
546
  maxLength: 2000,
546
547
  autoFocus: false,
@@ -550,7 +551,7 @@ MBlog.defaultProps = {
550
551
  // 附件
551
552
  isShowAttachment: true,
552
553
  // attachmentTipText: `<p>支持拖拽上传</p><p>单次最多支持上传20个</p><p>每个不超过50MB</p>`,
553
- attachmentTipText: "",
554
+ attachmentTipText: '',
554
555
  fileNumLimit: 20,
555
556
  fileSizeLimit: 50,
556
557
  // @同事
@@ -558,7 +559,7 @@ MBlog.defaultProps = {
558
559
  // @所有同事
559
560
  // @表情
560
561
  isShowEmotion: true,
561
- emotionTipText: "",
562
+ emotionTipText: '',
562
563
  // @按钮相关
563
564
  isShowSendSms: true,
564
565
  isShowRange: true,
@@ -15,6 +15,8 @@ var _bsGlobal = require("../../utils/bs-global");
15
15
 
16
16
  var _userOwnMenu = _interopRequireDefault(require("./components/user-own-menu"));
17
17
 
18
+ var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
19
+
18
20
  var _menu = _interopRequireDefault(require("./components/menu"));
19
21
 
20
22
  var _userMessage = _interopRequireDefault(require("./components/user-message"));
@@ -170,5 +172,7 @@ var NavTop = function NavTop() {
170
172
  }, /*#__PURE__*/_react["default"].createElement(_userOwnMenu["default"], null)));
171
173
  };
172
174
 
173
- var _default = NavTop;
174
- exports["default"] = _default;
175
+ var _default = NavTop; // @ts-ignore
176
+
177
+ exports["default"] = _default;
178
+ NavTop.useGlobalValue = _useGlobalValue["default"];
@@ -13,6 +13,10 @@ var _okrPeriodSelector = _interopRequireDefault(require("../../../../okr-period-
13
13
 
14
14
  var _getLocale = require("../../../../../utils/getLocale");
15
15
 
16
+ var _context = require("../../../context");
17
+
18
+ var _helper = require("../../../helper");
19
+
16
20
  require("./index.css");
17
21
 
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -40,17 +44,25 @@ var DateCycle = function DateCycle(_ref) {
40
44
  _ref$canEdit = _ref.canEdit,
41
45
  canEdit = _ref$canEdit === void 0 ? false : _ref$canEdit;
42
46
 
47
+ var _useContext = (0, _react.useContext)(_context.CommonContext),
48
+ okrInfo = _useContext.okrInfo,
49
+ approvalSetting = _useContext.approvalSetting;
50
+
51
+ var canCycleEdit = canEdit && (0, _helper.getApprovalIsShow)(approvalSetting, "changeOkrTime", okrInfo.applyState);
52
+
43
53
  var _useState = (0, _react.useState)(false),
44
54
  _useState2 = _slicedToArray(_useState, 2),
45
55
  isFocus = _useState2[0],
46
56
  setIsFocus = _useState2[1];
47
57
 
48
58
  var handleButtonFocus = (0, _react.useCallback)(function () {
49
- canEdit && setIsFocus(true);
50
- }, [canEdit]);
59
+ canCycleEdit && setIsFocus(true);
60
+ }, [canCycleEdit]);
51
61
  var handleButtonBlur = (0, _react.useCallback)(function () {
52
62
  setIsFocus(false);
53
63
  }, []);
64
+ console.log('approvalSetting', approvalSetting);
65
+ console.log('okrInfo', okrInfo);
54
66
 
55
67
  var renderClickArea = function renderClickArea(_ref2) {
56
68
  var btnRef = _ref2.btnRef,
@@ -59,7 +71,7 @@ var DateCycle = function DateCycle(_ref) {
59
71
  return /*#__PURE__*/_react["default"].createElement("button", {
60
72
  onFocus: handleButtonFocus,
61
73
  onBlur: handleButtonBlur,
62
- className: "base-info-date-cycle__button ".concat(isFocus ? "base-info-date-cycle__button--focus" : "", " ").concat(!canEdit && "base-info-date-cycle__button--disable"),
74
+ className: "base-info-date-cycle__button ".concat(isFocus ? "base-info-date-cycle__button--focus" : "", " ").concat(!canCycleEdit && "base-info-date-cycle__button--disable"),
63
75
  ref: btnRef,
64
76
  onClick: clickCallback
65
77
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -78,7 +90,7 @@ var DateCycle = function DateCycle(_ref) {
78
90
  cycle: cycle,
79
91
  setCycle: setCycle,
80
92
  okrId: okrId,
81
- canEdit: canEdit,
93
+ canEdit: canCycleEdit,
82
94
  getCycleRange: true
83
95
  }));
84
96
  };
@@ -21,6 +21,10 @@ var _popConfirm = _interopRequireDefault(require("../../../../../components-v1/p
21
21
 
22
22
  var _getLocale = require("../../../../../utils/getLocale");
23
23
 
24
+ var _context2 = require("../../../context");
25
+
26
+ var _helper = require("../../../helper");
27
+
24
28
  require("./index.css");
25
29
 
26
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -60,6 +64,10 @@ var Principal = function Principal(_ref) {
60
64
  selectUser = _useState2[0],
61
65
  setSelectUser = _useState2[1];
62
66
 
67
+ var _useContext = (0, _react.useContext)(_context2.CommonContext),
68
+ okrInfo = _useContext.okrInfo,
69
+ approvalSetting = _useContext.approvalSetting;
70
+
63
71
  var handleSelected = function handleSelected(_ref2) {
64
72
  var _ref3 = _slicedToArray(_ref2, 1),
65
73
  user = _ref3[0];
@@ -114,7 +122,7 @@ var Principal = function Principal(_ref) {
114
122
  }, (0, _getLocale.getLocale)("Mod_Owner")), /*#__PURE__*/_react["default"].createElement("div", {
115
123
  className: "base-info-other-infos__principal-user",
116
124
  ref: selectUserRef
117
- }, canEdit ? /*#__PURE__*/_react["default"].createElement(_popConfirm["default"], {
125
+ }, canEdit && (0, _helper.getApprovalIsShow)(approvalSetting, "changeOkrName", okrInfo.applyState) ? /*#__PURE__*/_react["default"].createElement(_popConfirm["default"], {
118
126
  ref: popConfirmRef,
119
127
  showArrow: false,
120
128
  style: {
@@ -31,6 +31,8 @@ var _progress = _interopRequireDefault(require("../../../progress"));
31
31
 
32
32
  var _utils = require("../../../progress/utils");
33
33
 
34
+ var _helper = require("../../helper");
35
+
34
36
  var _tooltip = _interopRequireDefault(require("../../../tooltip"));
35
37
 
36
38
  var _auth = require("../../../../utils/auth");
@@ -85,6 +87,8 @@ function Header(props) {
85
87
  setGeneralOkrClassify = _useContext.setGeneralOkrClassify,
86
88
  showOkrEvalute = _useContext.showOkrEvalute;
87
89
 
90
+ var commonContext = (0, _react.useContext)(_context.CommonContext);
91
+ var approvalSetting = commonContext.approvalSetting;
88
92
  var showOScore = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$OkrA = _window$BSGlobal.OkrAdvancedSetting) === null || _window$BSGlobal$OkrA === void 0 ? void 0 : (_window$BSGlobal$OkrA2 = _window$BSGlobal$OkrA.KRSetting) === null || _window$BSGlobal$OkrA2 === void 0 ? void 0 : _window$BSGlobal$OkrA2.OScore;
89
93
  var _okrInfo$progressGrow = okrInfo.progressGrow,
90
94
  progressGrow = _okrInfo$progressGrow === void 0 ? 0 : _okrInfo$progressGrow,
@@ -156,7 +160,7 @@ function Header(props) {
156
160
  }, /*#__PURE__*/_react["default"].createElement("div", {
157
161
  className: "".concat(precls, "__avatar")
158
162
  }, /*#__PURE__*/_react["default"].createElement(_oAvatar["default"], {
159
- editable: editable,
163
+ editable: editable && (okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState) !== 1,
160
164
  okrId: okrInfo.workId
161
165
  })), /*#__PURE__*/_react["default"].createElement("div", {
162
166
  className: "".concat(precls, "__content")
@@ -164,7 +168,9 @@ function Header(props) {
164
168
  editable: editable,
165
169
  okrName: okrName,
166
170
  setIsEdit: setIsEdit,
167
- okrStatus: okrInfo.status
171
+ okrStatus: okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.status,
172
+ applyState: okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState,
173
+ approvalSetting: approvalSetting
168
174
  }, /*#__PURE__*/_react["default"].createElement(_oClassify["default"], {
169
175
  editable: editable,
170
176
  okrId: okrInfo.workId,
@@ -187,7 +193,7 @@ function Header(props) {
187
193
  })), /*#__PURE__*/_react["default"].createElement("span", {
188
194
  className: "".concat(precls, "__action-item")
189
195
  }, /*#__PURE__*/_react["default"].createElement(_oCycle["default"], {
190
- editable: editable,
196
+ editable: editable && (0, _helper.getApprovalIsShow)(approvalSetting, "changeOkrTime", okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState),
191
197
  okrId: okrInfo.workId
192
198
  })), /*#__PURE__*/_react["default"].createElement("span", {
193
199
  className: "".concat(precls, "__action-item")
@@ -13,6 +13,8 @@ var _getLocale = require("../../../../utils/getLocale");
13
13
 
14
14
  var _tools = require("../../../../utils/tools");
15
15
 
16
+ var _helper = require("../../helper");
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
18
20
  function OName(props) {
@@ -20,11 +22,15 @@ function OName(props) {
20
22
  okrName = props.okrName,
21
23
  setIsEdit = props.setIsEdit,
22
24
  okrStatus = props.okrStatus,
23
- children = props.children;
25
+ children = props.children,
26
+ approvalSetting = props.approvalSetting,
27
+ applyState = props.applyState;
24
28
 
25
29
  var handleEditClick = function handleEditClick() {
26
- if (editable) {
27
- setIsEdit(true);
30
+ if ((0, _helper.getApprovalIsShow)(approvalSetting, "changeOkrName", applyState)) {
31
+ if (editable) {
32
+ setIsEdit(true);
33
+ }
28
34
  }
29
35
  };
30
36
 
@@ -84,7 +84,11 @@ function OClassify(props) {
84
84
 
85
85
  case 5:
86
86
  res = _context.sent;
87
- onOkrClassifyChange(select);
87
+
88
+ if (onOkrClassifyChange) {
89
+ onOkrClassifyChange(select);
90
+ }
91
+
88
92
  setVisible(false);
89
93
 
90
94
  _toast["default"].Success("修改成功", {
@@ -47,6 +47,8 @@ var _EditKrWightModal = _interopRequireDefault(require("../../../../../edit-kr-w
47
47
 
48
48
  var _okrProgressModal = _interopRequireDefault(require("../../../../../okr-progress-modal"));
49
49
 
50
+ var _helper = require("../../../../helper");
51
+
50
52
  var _getLocale = require("../../../../../../utils/getLocale");
51
53
 
52
54
  require("./index.css");
@@ -98,7 +100,8 @@ function _default(props) {
98
100
 
99
101
  var _useContext = (0, _react.useContext)(_context2.CommonContext),
100
102
  refreshAll = _useContext.refreshAll,
101
- okrInfo = _useContext.okrInfo;
103
+ okrInfo = _useContext.okrInfo,
104
+ approvalSetting = _useContext.approvalSetting;
102
105
 
103
106
  var _useState = (0, _react.useState)(data.confidenceIndex),
104
107
  _useState2 = _slicedToArray(_useState, 2),
@@ -315,7 +318,7 @@ function _default(props) {
315
318
  }, "KR", index + 1), /*#__PURE__*/_react["default"].createElement("span", {
316
319
  className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-title"))
317
320
  }, /*#__PURE__*/_react["default"].createElement(_editableInput["default"], {
318
- editable: krCanEdit,
321
+ editable: krCanEdit && (0, _helper.getApprovalIsShow)(approvalSetting, "changeOkrName", okrInfo.applyState),
319
322
  defaultValue: krName,
320
323
  emptyMessage: "KR\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",
321
324
  onKeyDown: onKrNameChangeHandler,
@@ -329,10 +332,10 @@ function _default(props) {
329
332
  name: user.name,
330
333
  id: user.userId,
331
334
  width: 68,
332
- editable: krCanEdit,
335
+ editable: krCanEdit && okrInfo.applyState !== _helper.EApproveStatus.UnderApproval,
333
336
  onEditUser: onEditUserHandler,
334
337
  nameTips: function nameTips(name) {
335
- return /*#__PURE__*/_react["default"].createElement("span", null, "\u8D1F\u8D23\u4EBA\uFF1A", name);
338
+ return /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_Text_Owner'), name);
336
339
  }
337
340
  })), showKrWeight && /*#__PURE__*/_react["default"].createElement(OkrRowColumn, {
338
341
  width: 60,
@@ -348,7 +351,7 @@ function _default(props) {
348
351
  marginLeft: 16
349
352
  }, /*#__PURE__*/_react["default"].createElement(_rangePickerPop["default"], {
350
353
  data: data,
351
- editable: krCanEdit
354
+ editable: krCanEdit && (0, _helper.getApprovalIsShow)(approvalSetting, 'changeOkrTime', okrInfo.applyState)
352
355
  })), /*#__PURE__*/_react["default"].createElement("div", {
353
356
  className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-actions"))
354
357
  }, showHeart && /*#__PURE__*/_react["default"].createElement("div", {
@@ -377,7 +380,7 @@ function _default(props) {
377
380
  evaluateValue: evaluateValue,
378
381
  setEvaluateValue: onEvaluateChangeHanler,
379
382
  isEvaluate: isEvaluate
380
- })), krCanEdit && /*#__PURE__*/_react["default"].createElement("div", {
383
+ })), krCanEdit && okrInfo.applyState !== _helper.EApproveStatus.UnderApproval && /*#__PURE__*/_react["default"].createElement("div", {
381
384
  className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-delete")),
382
385
  onClick: function onClick() {
383
386
  return setDeleteModalVisible(true);
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getApproveStatusTextMap = exports.ApproveStatusColor = exports.ApproveStatus = void 0;
7
+
8
+ var _getLocale = require("../../../utils/getLocale");
9
+
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
12
+ var ApproveStatus;
13
+ exports.ApproveStatus = ApproveStatus;
14
+
15
+ (function (ApproveStatus) {
16
+ ApproveStatus[ApproveStatus["None"] = 0] = "None";
17
+ ApproveStatus[ApproveStatus["WaitCommit"] = 6] = "WaitCommit";
18
+ ApproveStatus[ApproveStatus["Rejected"] = 3] = "Rejected";
19
+ ApproveStatus[ApproveStatus["UnderApproval"] = 1] = "UnderApproval";
20
+ ApproveStatus[ApproveStatus["ApproveAgree"] = 2] = "ApproveAgree";
21
+ ApproveStatus[ApproveStatus["WithDraw"] = 4] = "WithDraw";
22
+ ApproveStatus[ApproveStatus["Done"] = 5] = "Done";
23
+ })(ApproveStatus || (exports.ApproveStatus = ApproveStatus = {}));
24
+
25
+ var getApproveStatusTextMap = function getApproveStatusTextMap(status) {
26
+ var _ApproveStatusTextMap;
27
+
28
+ var ApproveStatusTextMap = (_ApproveStatusTextMap = {}, _defineProperty(_ApproveStatusTextMap, ApproveStatus.WaitCommit, (0, _getLocale.getLocale)('OKR_MyO_Tobesubmitted')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.Rejected, (0, _getLocale.getLocale)('OKR_MyO_Tobesubmitted')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.UnderApproval, (0, _getLocale.getLocale)('Pro_detail_Approval')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.ApproveAgree, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.WithDraw, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.None, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.Done, ''), _ApproveStatusTextMap);
29
+ return ApproveStatusTextMap[status];
30
+ };
31
+
32
+ exports.getApproveStatusTextMap = getApproveStatusTextMap;
33
+
34
+ var ApproveStatusColor = function ApproveStatusColor(status) {
35
+ var _ApprovalStatusColorM;
36
+
37
+ var ApprovalStatusColorMap = (_ApprovalStatusColorM = {}, _defineProperty(_ApprovalStatusColorM, ApproveStatus.WaitCommit, {
38
+ color: '#F0A326',
39
+ bgColor: 'rgba(240, 163, 38, 0.1)'
40
+ }), _defineProperty(_ApprovalStatusColorM, ApproveStatus.Rejected, {
41
+ color: '#F0A326',
42
+ bgColor: 'rgba(240, 163, 38, 0.1)'
43
+ }), _defineProperty(_ApprovalStatusColorM, ApproveStatus.UnderApproval, {
44
+ color: '#2879FF',
45
+ bgColor: 'rgba(40, 121, 255, 0.1)'
46
+ }), _defineProperty(_ApprovalStatusColorM, ApproveStatus.ApproveAgree, {
47
+ color: '#ffffff',
48
+ bgColor: '#ffffff'
49
+ }), _ApprovalStatusColorM);
50
+ return ApprovalStatusColorMap[status];
51
+ };
52
+
53
+ exports.ApproveStatusColor = ApproveStatusColor;
@@ -29,6 +29,8 @@ var _okrShare = _interopRequireDefault(require("../../okr-share"));
29
29
 
30
30
  var _context7 = require("../context");
31
31
 
32
+ var _constant = require("./constant");
33
+
32
34
  var _deleteConfirm = _interopRequireDefault(require("./delete-confirm/delete-confirm"));
33
35
 
34
36
  var _drawerManager = _interopRequireDefault(require("../../drawer-manager"));
@@ -85,6 +87,8 @@ function OkrDetailHeader(_ref) {
85
87
  var loginUserId = window.BSGlobal.loginUserInfo.Id;
86
88
  var context = (0, _react.useContext)(_context7.GeneralDataContext);
87
89
  var commonContext = (0, _react.useContext)(_context7.CommonContext);
90
+ var approvalSetting = commonContext.approvalSetting;
91
+ var approveStatusColor = (0, _constant.ApproveStatusColor)(detailInfo.applyStatus);
88
92
  var changVisiblity = (0, _react.useCallback)( /*#__PURE__*/function () {
89
93
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(workId, visibility) {
90
94
  var visibilityScope,
@@ -366,8 +370,11 @@ function OkrDetailHeader(_ref) {
366
370
  }
367
371
  }
368
372
 
373
+ (0, _react.useEffect)(function () {}, []);
369
374
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_drawer["default"].Header, {
370
375
  actions: actions,
376
+ approvalSetting: approvalSetting,
377
+ detailInfo: detailInfo,
371
378
  actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
372
379
  id: detailInfo.workId,
373
380
  objType: 62,
@@ -386,7 +393,11 @@ function OkrDetailHeader(_ref) {
386
393
  krId: parent.id
387
394
  });
388
395
  }
389
- }, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null
396
+ }, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null,
397
+ status: {
398
+ title: (0, _constant.getApproveStatusTextMap)(detailInfo.applyStatus),
399
+ color: approveStatusColor
400
+ }
390
401
  }), /*#__PURE__*/_react["default"].createElement(_okrShare["default"], {
391
402
  visible: shareVisible,
392
403
  onClose: closeShareModal,
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getApprovalOpenItem = exports.getApprovalIsShow = exports.EApproveStatus = exports.EApprovalTypes = void 0;
7
+ var EApprovalTypes;
8
+ exports.EApprovalTypes = EApprovalTypes;
9
+
10
+ (function (EApprovalTypes) {
11
+ EApprovalTypes[EApprovalTypes["CreateOkr"] = 53] = "CreateOkr";
12
+ EApprovalTypes[EApprovalTypes["ChangeOkrName"] = 54] = "ChangeOkrName";
13
+ EApprovalTypes[EApprovalTypes["ChangeOkrTime"] = 56] = "ChangeOkrTime";
14
+ EApprovalTypes[EApprovalTypes["DeleteOkr"] = 55] = "DeleteOkr";
15
+ })(EApprovalTypes || (exports.EApprovalTypes = EApprovalTypes = {}));
16
+
17
+ var EApproveStatus;
18
+ exports.EApproveStatus = EApproveStatus;
19
+
20
+ (function (EApproveStatus) {
21
+ EApproveStatus[EApproveStatus["None"] = 0] = "None";
22
+ EApproveStatus[EApproveStatus["WaitCommit"] = 6] = "WaitCommit";
23
+ EApproveStatus[EApproveStatus["Rejected"] = 3] = "Rejected";
24
+ EApproveStatus[EApproveStatus["UnderApproval"] = 1] = "UnderApproval";
25
+ EApproveStatus[EApproveStatus["ApproveAgree"] = 2] = "ApproveAgree";
26
+ EApproveStatus[EApproveStatus["WithDraw"] = 4] = "WithDraw";
27
+ EApproveStatus[EApproveStatus["Done"] = 5] = "Done";
28
+ })(EApproveStatus || (exports.EApproveStatus = EApproveStatus = {}));
29
+
30
+ var getApprovalOpenItem = function getApprovalOpenItem(setting) {
31
+ var result = {
32
+ isOpen: setting.isOpened === 1,
33
+ changeOkrName: false,
34
+ changeOkrTime: false,
35
+ deleteOkr: false,
36
+ createOkr: false
37
+ };
38
+
39
+ if (setting !== null && setting !== void 0 && setting.okrApprovalSettings) {
40
+ setting.okrApprovalSettings.forEach(function (item) {
41
+ if (item.approvalType === EApprovalTypes.ChangeOkrName) {
42
+ result.changeOkrName = true;
43
+ } else if (item.approvalType === EApprovalTypes.ChangeOkrTime) {
44
+ result.changeOkrTime = true;
45
+ } else if (item.approvalType === EApprovalTypes.CreateOkr) {
46
+ result.createOkr = true;
47
+ } else if (item.approvalType === EApprovalTypes.DeleteOkr) {
48
+ result.deleteOkr = true;
49
+ }
50
+ });
51
+ }
52
+
53
+ return result;
54
+ };
55
+
56
+ exports.getApprovalOpenItem = getApprovalOpenItem;
57
+
58
+ var getApprovalIsShow = function getApprovalIsShow(approvalSetting, type, applyState) {
59
+ return !approvalSetting.isOpen || approvalSetting.isOpen && !(approvalSetting !== null && approvalSetting !== void 0 && approvalSetting[type]) || approvalSetting.isOpen && (approvalSetting === null || approvalSetting === void 0 ? void 0 : approvalSetting[type]) && applyState !== EApproveStatus.UnderApproval;
60
+ };
61
+
62
+ exports.getApprovalIsShow = getApprovalIsShow;