@titaui/pc 1.11.52-beta.11 → 1.11.52-beta.14

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 (66) hide show
  1. package/lib/components/date-picker/BodyItem.js +3 -3
  2. package/lib/components/date-picker/CalendarHeader.js +3 -3
  3. package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
  4. package/lib/components/drop-selector/index.js +1 -2
  5. package/lib/components/dynamic/components/title/index.js +3 -1
  6. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +1 -1
  7. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +2 -2
  8. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +1 -1
  9. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +3 -1
  10. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +2 -2
  11. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
  12. package/lib/components/eReport/eReportLists/reportList.js +3 -3
  13. package/lib/components/emotions-selector/selector-pop.js +3 -3
  14. package/lib/components/ereport-list/index.js +3 -3
  15. package/lib/components/mblog/components/MblogAction.js +3 -3
  16. package/lib/components/okr-detail/components/header/edit-name.js +10 -18
  17. package/lib/components/okr-detail/components/header/index.js +14 -7
  18. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +78 -42
  19. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
  20. package/lib/components/okr-detail/okr-list/index.css +9 -0
  21. package/lib/components/okr-flow/export-modal/index.js +26 -16
  22. package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
  23. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
  24. package/lib/components/progress/circle-progress/index.css +2 -0
  25. package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
  26. package/lib/components/rich-editor/models/schema.js +6 -6
  27. package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
  28. package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
  29. package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
  30. package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
  31. package/lib/components/rich-editor/plugins/core/index.js +4 -4
  32. package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
  33. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
  34. package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
  35. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
  36. package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
  37. package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
  38. package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
  39. package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
  40. package/lib/components/rich-editor/react/uiProvider.js +3 -3
  41. package/lib/components/rich-editor/ui/Popup/index.js +3 -3
  42. package/lib/components/select/Option.js +3 -3
  43. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +8 -3
  44. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +4 -2
  45. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +3 -3
  46. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +8 -2
  47. package/lib/components/task-tree/task-item-node/index.css +2 -2
  48. package/lib/components/tita-chart/errorBoundary/index.js +3 -3
  49. package/lib/components/upload/components/uploadedPreview.js +18 -18
  50. package/lib/components/upload/index.js +57 -29
  51. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +14 -15
  52. package/lib/components/user-selector/searched-panel/index.js +12 -6
  53. package/lib/components-v1/animate/AnimateChild.js +3 -3
  54. package/lib/components-v1/avatar/index.js +3 -3
  55. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
  56. package/lib/components-v1/progress/CircleProgress.js +3 -3
  57. package/lib/components-v1/select/Option.js +3 -3
  58. package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
  59. package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
  60. package/lib/components-v1/userSelector/components/UserItem.js +3 -3
  61. package/lib/pages/new-okr-list/header/index.js +16 -18
  62. package/lib/utils/auth.js +12 -0
  63. package/lib/utils/hooks.js +19 -5
  64. package/lib/utils/open-data.js +4 -4
  65. package/lib/utils/tita-okr-cycle.js +24 -0
  66. package/package.json +2 -2
@@ -47,7 +47,7 @@ var BodyItem = /*#__PURE__*/function (_Component) {
47
47
  var _super = _createSuper(BodyItem);
48
48
 
49
49
  function BodyItem() {
50
- var _temp, _this;
50
+ var _this;
51
51
 
52
52
  _classCallCheck(this, BodyItem);
53
53
 
@@ -55,7 +55,7 @@ var BodyItem = /*#__PURE__*/function (_Component) {
55
55
  args[_key] = arguments[_key];
56
56
  }
57
57
 
58
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.getClass = function () {
58
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.getClass = function () {
59
59
  var _this$props = _this.props,
60
60
  isAllowSelect = _this$props.isAllowSelect,
61
61
  date = _this$props.date,
@@ -86,7 +86,7 @@ var BodyItem = /*#__PURE__*/function (_Component) {
86
86
  if (_this.disabled) return;
87
87
 
88
88
  _this.props.onSelectDate((0, _moment["default"])(date.format("YYYY/MM/DD")));
89
- }, _temp));
89
+ }, _assertThisInitialized(_this)));
90
90
  }
91
91
 
92
92
  _createClass(BodyItem, [{
@@ -87,7 +87,7 @@ var CalendarHeader = /*#__PURE__*/function (_Component) {
87
87
  var _super = _createSuper(CalendarHeader);
88
88
 
89
89
  function CalendarHeader() {
90
- var _temp, _this;
90
+ var _this;
91
91
 
92
92
  _classCallCheck(this, CalendarHeader);
93
93
 
@@ -95,7 +95,7 @@ var CalendarHeader = /*#__PURE__*/function (_Component) {
95
95
  args[_key] = arguments[_key];
96
96
  }
97
97
 
98
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.setDate = function (func) {
98
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.setDate = function (func) {
99
99
  var date = (0, _moment["default"])(_this.props.date);
100
100
 
101
101
  for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
@@ -113,7 +113,7 @@ var CalendarHeader = /*#__PURE__*/function (_Component) {
113
113
  }
114
114
 
115
115
  return years;
116
- }, _temp));
116
+ }, _assertThisInitialized(_this)));
117
117
  }
118
118
 
119
119
  _createClass(CalendarHeader, [{
@@ -49,7 +49,7 @@ var ConfirmPop = /*#__PURE__*/function (_PureComponent) {
49
49
  var _super = _createSuper(ConfirmPop);
50
50
 
51
51
  function ConfirmPop() {
52
- var _temp, _this;
52
+ var _this;
53
53
 
54
54
  _classCallCheck(this, ConfirmPop);
55
55
 
@@ -57,13 +57,13 @@ var ConfirmPop = /*#__PURE__*/function (_PureComponent) {
57
57
  args[_key] = arguments[_key];
58
58
  }
59
59
 
60
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function () {
60
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function () {
61
61
  // @ts-ignore
62
62
  _this.refs.pop.show(_this.refs.trigger);
63
63
  }, _this.handleHide = function () {
64
64
  // @ts-ignore
65
65
  _this.refs.pop.hide();
66
- }, _temp));
66
+ }, _assertThisInitialized(_this)));
67
67
  }
68
68
 
69
69
  _createClass(ConfirmPop, [{
@@ -156,8 +156,7 @@ function DropSelector(props) {
156
156
  }
157
157
 
158
158
  var handlePopVisibleChange = (0, _react.useCallback)(function (visible) {
159
- console.log('visible' in props);
160
-
159
+ // console.log('visible' in props)
161
160
  if (!('visible' in props)) {
162
161
  setVisible(visible);
163
162
  }
@@ -15,6 +15,8 @@ var _searchKeyHandle = _interopRequireDefault(require("../../../search-key-handl
15
15
 
16
16
  var _context = require("../../context");
17
17
 
18
+ var _openData = require("../../../../utils/open-data");
19
+
18
20
  require("./index.css");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -62,7 +64,7 @@ var DynamicTitle = function DynamicTitle(_ref) {
62
64
  onClick: onTitleClick
63
65
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
64
66
  text: /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
65
- str: content,
67
+ str: (0, _openData.parseString)(content),
66
68
  keyWord: searchKeyWord
67
69
  }),
68
70
  isPercent: true
@@ -91,7 +91,7 @@ var DynamicOperation = function DynamicOperation(_ref) {
91
91
  })
92
92
  })), /*#__PURE__*/_react["default"].createElement("span", {
93
93
  className: "".concat(prefix, "__operate-content")
94
- }, (0, _openData.parseString)((0, _openData.parseHtmlAndTextTag)(content))))), index === 2 && feedOperations.total > 3 && /*#__PURE__*/_react["default"].createElement("div", {
94
+ }, (0, _openData.parseHtmlAndTextTag)(content)))), index === 2 && feedOperations.total > 3 && /*#__PURE__*/_react["default"].createElement("div", {
95
95
  className: "".concat(prefix, "__operate-item")
96
96
  }, /*#__PURE__*/_react["default"].createElement("img", {
97
97
  className: "".concat(prefix, "__operate-icon"),
@@ -133,7 +133,7 @@ var DynamicAlign = function DynamicAlign(_ref) {
133
133
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
134
134
  isPercent: true,
135
135
  text: /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
136
- str: (0, _tools.htmlDecodeByRegExp)(parentObjName),
136
+ str: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(parentObjName)),
137
137
  keyWord: searchKeyWord
138
138
  })
139
139
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -170,7 +170,7 @@ var DynamicAlign = function DynamicAlign(_ref) {
170
170
  }
171
171
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
172
172
  isPercent: true,
173
- text: (0, _tools.htmlDecodeByRegExp)(okrName)
173
+ text: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(okrName))
174
174
  })), /*#__PURE__*/_react["default"].createElement("div", {
175
175
  className: "".concat(prefix, "__obj-other-info")
176
176
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -153,7 +153,7 @@ var DynamicCreateO = function DynamicCreateO(_ref) {
153
153
  onClick: handleClickOTitle
154
154
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
155
155
  text: /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
156
- str: (0, _tools.htmlDecodeByRegExp)(okrName),
156
+ str: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(okrName)),
157
157
  keyWord: searchKeyWord
158
158
  }),
159
159
  isPercent: true
@@ -27,6 +27,8 @@ var _constant = require("../../constant");
27
27
 
28
28
  var _getLocale = require("../../../../utils/getLocale");
29
29
 
30
+ var _openData = require("../../../../utils/open-data");
31
+
30
32
  var _utils = require("./utils");
31
33
 
32
34
  var _conditionRender = _interopRequireDefault(require("../../../condition-render"));
@@ -109,7 +111,7 @@ var DynamicProgress = function DynamicProgress(_ref) {
109
111
  onClick: handleClickOTitle
110
112
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
111
113
  text: /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
112
- str: (0, _tools.htmlDecodeByRegExp)(relationParentName),
114
+ str: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(relationParentName)),
113
115
  keyWord: searchKeyWord
114
116
  }),
115
117
  isPercent: true
@@ -176,7 +176,7 @@ var DynamicRelative = function DynamicRelative(_ref) {
176
176
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
177
177
  isPercent: true,
178
178
  text: /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
179
- str: (0, _tools.htmlDecodeByRegExp)(relateObjName),
179
+ str: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(relateObjName)),
180
180
  keyWord: searchKeyWord
181
181
  })
182
182
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -213,7 +213,7 @@ var DynamicRelative = function DynamicRelative(_ref) {
213
213
  }
214
214
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
215
215
  isPercent: true,
216
- text: (0, _tools.htmlDecodeByRegExp)(objName)
216
+ text: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(objName))
217
217
  })), /*#__PURE__*/_react["default"].createElement("div", {
218
218
  className: "".concat(prefix, "__obj-other-info")
219
219
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -29,6 +29,8 @@ var _getLocale = require("../../../../utils/getLocale");
29
29
 
30
30
  var _tools = require("../../../../utils/tools");
31
31
 
32
+ var _openData = require("../../../../utils/open-data");
33
+
32
34
  require("./index.css");
33
35
 
34
36
  var _excluded = ["data"];
@@ -95,7 +97,7 @@ var DynamicReply = function DynamicReply(_ref) {
95
97
  className: "".concat(prefix, "__object-name"),
96
98
  onClick: handleClickOTitle
97
99
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
98
- text: (0, _tools.htmlDecodeByRegExp)(data.obj.objName),
100
+ text: (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(data.obj.objName)),
99
101
  isPercent: true
100
102
  })), "\u4E0B\u5173\u952E\u6210\u679C\u7684\u590D\u76D8");
101
103
  }
@@ -55,7 +55,7 @@ var EReportList = /*#__PURE__*/function (_React$Component) {
55
55
  var _super = _createSuper(EReportList);
56
56
 
57
57
  function EReportList() {
58
- var _temp, _this;
58
+ var _this;
59
59
 
60
60
  _classCallCheck(this, EReportList);
61
61
 
@@ -63,7 +63,7 @@ var EReportList = /*#__PURE__*/function (_React$Component) {
63
63
  args[_key] = arguments[_key];
64
64
  }
65
65
 
66
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.state = {
66
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.state = {
67
67
  selectedPeriodValue: "",
68
68
  showDatePick: false,
69
69
  eReportWeekList: [],
@@ -176,7 +176,7 @@ var EReportList = /*#__PURE__*/function (_React$Component) {
176
176
  return _this.handlerEReportShareSubmit(submitStatus);
177
177
  }
178
178
  })));
179
- }, _temp));
179
+ }, _assertThisInitialized(_this)));
180
180
  }
181
181
 
182
182
  _createClass(EReportList, [{
@@ -47,7 +47,7 @@ var EmotionsSelectorPop = /*#__PURE__*/function (_PureComponent) {
47
47
  var _super = _createSuper(EmotionsSelectorPop);
48
48
 
49
49
  function EmotionsSelectorPop() {
50
- var _temp, _this;
50
+ var _this;
51
51
 
52
52
  _classCallCheck(this, EmotionsSelectorPop);
53
53
 
@@ -55,7 +55,7 @@ var EmotionsSelectorPop = /*#__PURE__*/function (_PureComponent) {
55
55
  args[_key] = arguments[_key];
56
56
  }
57
57
 
58
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function () {
58
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function () {
59
59
  setTimeout(function () {
60
60
  // @ts-ignore
61
61
  _this.refs.pop.show(_this.refs.trigger);
@@ -63,7 +63,7 @@ var EmotionsSelectorPop = /*#__PURE__*/function (_PureComponent) {
63
63
  }, _this.handleHide = function () {
64
64
  // @ts-ignore
65
65
  _this.refs.pop.hide();
66
- }, _temp));
66
+ }, _assertThisInitialized(_this)));
67
67
  }
68
68
 
69
69
  _createClass(EmotionsSelectorPop, [{
@@ -57,7 +57,7 @@ var EReportList = /*#__PURE__*/function (_React$Component) {
57
57
  var _super = _createSuper(EReportList);
58
58
 
59
59
  function EReportList() {
60
- var _temp, _this;
60
+ var _this;
61
61
 
62
62
  _classCallCheck(this, EReportList);
63
63
 
@@ -65,7 +65,7 @@ var EReportList = /*#__PURE__*/function (_React$Component) {
65
65
  args[_key] = arguments[_key];
66
66
  }
67
67
 
68
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.state = {
68
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.state = {
69
69
  selectedPeriodValue: "",
70
70
  showDatePick: false,
71
71
  eReportWeekList: [],
@@ -178,7 +178,7 @@ var EReportList = /*#__PURE__*/function (_React$Component) {
178
178
  return _this.handlerEReportShareSubmit(submitStatus);
179
179
  }
180
180
  })));
181
- }, _temp));
181
+ }, _assertThisInitialized(_this)));
182
182
  }
183
183
 
184
184
  _createClass(EReportList, [{
@@ -83,7 +83,7 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
83
83
  var _super = _createSuper(MblogAction);
84
84
 
85
85
  function MblogAction() {
86
- var _temp, _this;
86
+ var _this;
87
87
 
88
88
  _classCallCheck(this, MblogAction);
89
89
 
@@ -91,7 +91,7 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
91
91
  args[_key] = arguments[_key];
92
92
  }
93
93
 
94
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.state = {
94
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.state = {
95
95
  isSendSms: false,
96
96
  // 是否短信通知
97
97
  isShowConfirmPop: false
@@ -121,7 +121,7 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
121
121
  isSendSms: false
122
122
  });
123
123
  }
124
- }, _temp));
124
+ }, _assertThisInitialized(_this)));
125
125
  }
126
126
 
127
127
  _createClass(MblogAction, [{
@@ -69,13 +69,9 @@ function EditNameCmp(props) {
69
69
  errorTip = _useState4[0],
70
70
  setErrorTip = _useState4[1];
71
71
 
72
- var _useState5 = (0, _react.useState)({
73
- mentionUsers: [],
74
- pureText: '',
75
- pureTextExcludeAt: '',
76
- richText: okrName,
77
- state: 'normal'
78
- }),
72
+ var _useState5 = (0, _react.useState)(_objectSpread(_objectSpread({}, okrName), {}, {
73
+ editorState: 'normal'
74
+ })),
79
75
  _useState6 = _slicedToArray(_useState5, 2),
80
76
  okrNameData = _useState6[0],
81
77
  setOkrNameData = _useState6[1];
@@ -111,19 +107,15 @@ function EditNameCmp(props) {
111
107
  setEditing(false);
112
108
  setErrorTip('');
113
109
  setOkrNameData(function (prevData) {
114
- return {
115
- mentionUsers: [],
116
- pureText: okrName,
117
- pureTextExcludeAt: okrName,
118
- richText: (0, _richEditor.TitaRichEditorInitTextState)(okrName),
119
- state: prevData.state === 'normal' ? 'reset' : 'normal'
120
- };
110
+ return _objectSpread(_objectSpread({}, okrName), {}, {
111
+ editorState: prevData.editorState === 'normal' ? 'reset' : 'normal'
112
+ });
121
113
  });
122
114
  };
123
115
 
124
116
  var confiremEditHandle = /*#__PURE__*/function () {
125
117
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
126
- var mentionUsers, pureText, pureTextExcludeAt, richText, data;
118
+ var mentionUsers, pureText, richText, data;
127
119
  return regeneratorRuntime.wrap(function _callee$(_context) {
128
120
  while (1) {
129
121
  switch (_context.prev = _context.next) {
@@ -136,9 +128,9 @@ function EditNameCmp(props) {
136
128
  return _context.abrupt("return");
137
129
 
138
130
  case 2:
139
- mentionUsers = okrNameData.mentionUsers, pureText = okrNameData.pureText, pureTextExcludeAt = okrNameData.pureTextExcludeAt, richText = okrNameData.richText;
131
+ mentionUsers = okrNameData.mentionUsers, pureText = okrNameData.pureText, richText = okrNameData.richText;
140
132
 
141
- if (!(okrName == pureTextExcludeAt)) {
133
+ if (!(okrName.pureText == pureText)) {
142
134
  _context.next = 6;
143
135
  break;
144
136
  }
@@ -187,7 +179,7 @@ function EditNameCmp(props) {
187
179
  }, /*#__PURE__*/_react["default"].createElement("div", {
188
180
  className: (0, _classnames["default"])("".concat(prefixCls, "-input"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-input--editable"), editable), _defineProperty(_classNames, "".concat(prefixCls, "-input--editing"), editing), _defineProperty(_classNames, "".concat(prefixCls, "-input--error"), errorTip.length > 0), _classNames))
189
181
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
190
- key: okrNameData.state,
182
+ key: okrNameData.editorState,
191
183
  editable: editable,
192
184
  initialState: okrNameData.richText,
193
185
  manualWrap: true,
@@ -68,12 +68,19 @@ function Header(props) {
68
68
 
69
69
  // 外部取到的 headInfo
70
70
  var okrInfo = props.okrInfo;
71
- var workNameRichText = okrInfo.workNameRichText ? JSON.parse(okrInfo.workNameRichText) : (0, _richEditor.TitaRichEditorInitTextState)(okrInfo.workName);
72
-
73
- var _useState = (0, _react.useState)(workNameRichText),
71
+ var workName = okrInfo.workName,
72
+ workNameRichText = okrInfo.workNameRichText;
73
+ var richText = workNameRichText ? JSON.parse(workNameRichText) : (0, _richEditor.TitaRichEditorInitTextState)(workName);
74
+
75
+ var _useState = (0, _react.useState)({
76
+ mentionsUsers: [],
77
+ pureText: workName,
78
+ pureTextExcludeAt: workName,
79
+ richText: richText
80
+ }),
74
81
  _useState2 = _slicedToArray(_useState, 2),
75
- okrName = _useState2[0],
76
- setOkrName = _useState2[1];
82
+ okrNameData = _useState2[0],
83
+ setOkrNameData = _useState2[1];
77
84
 
78
85
  var _useContext = (0, _react.useContext)(_context.GeneralDataContext),
79
86
  generalPrincipalUser = _useContext.generalPrincipalUser,
@@ -162,9 +169,9 @@ function Header(props) {
162
169
  className: "".concat(precls, "__content")
163
170
  }, /*#__PURE__*/_react["default"].createElement(_editName["default"], {
164
171
  editable: editable,
165
- okrName: okrName,
172
+ okrName: okrNameData,
166
173
  okrId: okrInfo.workId,
167
- setOkrName: setOkrName
174
+ setOkrName: setOkrNameData
168
175
  }), /*#__PURE__*/_react["default"].createElement("section", {
169
176
  className: "".concat(precls, "__action")
170
177
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -21,6 +21,8 @@ var _precls = _interopRequireDefault(require("../../precls"));
21
21
 
22
22
  var _drawerManager = _interopRequireDefault(require("../../../../../drawer-manager"));
23
23
 
24
+ var _taskRelationModal = _interopRequireDefault(require("../../../../../task-relation-modal"));
25
+
24
26
  var _auth = require("../../../../../../utils/auth");
25
27
 
26
28
  var _tooltipText = _interopRequireDefault(require("../../../../../tooltip/tooltip-text"));
@@ -43,10 +45,25 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
43
45
 
44
46
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
45
47
 
46
- var hasProject = (0, _bsGlobal.hasWebHead)("project");
48
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
49
+
50
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
51
+
52
+ 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); }
53
+
54
+ 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; }
55
+
56
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
57
+
58
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
59
+
60
+ var hasProject = (0, _bsGlobal.hasWebHead)('project');
61
+ var RelationTaskModel = _taskRelationModal["default"].RelationTaskModel,
62
+ RelationWorkModel = _taskRelationModal["default"].RelationWorkModel;
63
+ var baseAuth = new _auth.BaseAuth();
47
64
 
48
65
  var EKrNode = function EKrNode(props) {
49
- var _okrInfo$authority;
66
+ var _window, _window$BSGlobal, _window$BSGlobal$Work, _window$BSGlobal$Work2, _okrInfo$authority;
50
67
 
51
68
  var index = props.index,
52
69
  title = props.title,
@@ -62,6 +79,19 @@ var EKrNode = function EKrNode(props) {
62
79
  var _useContext2 = (0, _react.useContext)(_context2.EListContext),
63
80
  refreshEList = _useContext2.refreshEList;
64
81
 
82
+ var _useState = (0, _react.useState)(false),
83
+ _useState2 = _slicedToArray(_useState, 2),
84
+ isShowWork = _useState2[0],
85
+ setIsShowWork = _useState2[1];
86
+
87
+ var _useState3 = (0, _react.useState)(false),
88
+ _useState4 = _slicedToArray(_useState3, 2),
89
+ isShowTask = _useState4[0],
90
+ setIsShowTask = _useState4[1];
91
+
92
+ var onlySuperCreateWork = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$Work = _window$BSGlobal.WorkAdvancedSetting) === null || _window$BSGlobal$Work === void 0 ? void 0 : (_window$BSGlobal$Work2 = _window$BSGlobal$Work.WorkFunctionSetting) === null || _window$BSGlobal$Work2 === void 0 ? void 0 : _window$BSGlobal$Work2.WorkCreate; //开启后,仅超管、目标管理员、老板/助理可创建项目
93
+
94
+ var canCreateWork = baseAuth.isBoss() || baseAuth.isManager() || baseAuth.isWorkManager() || baseAuth.isAssistant() || !onlySuperCreateWork;
65
95
  var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
66
96
  var hasRelativeAuth;
67
97
 
@@ -87,7 +117,7 @@ var EKrNode = function EKrNode(props) {
87
117
  while (1) {
88
118
  switch (_context.prev = _context.next) {
89
119
  case 0:
90
- if (name === "addTask") {
120
+ if (name === 'addTask') {
91
121
  params = {
92
122
  objId: data.workId,
93
123
  objType: 4,
@@ -107,7 +137,7 @@ var EKrNode = function EKrNode(props) {
107
137
  allowObjectOptions: false
108
138
  }
109
139
  }).then(function () {
110
- _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
140
+ _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
111
141
  canClose: false
112
142
  });
113
143
 
@@ -118,7 +148,7 @@ var EKrNode = function EKrNode(props) {
118
148
  okrId: data.workId,
119
149
  krId: data.mileStoneId
120
150
  }).then(function () {
121
- _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
151
+ _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
122
152
  canClose: false
123
153
  });
124
154
 
@@ -139,38 +169,29 @@ var EKrNode = function EKrNode(props) {
139
169
  };
140
170
  }(), []);
141
171
  var openRelatePop = (0, _react.useCallback)(function (name) {
142
- if (name === "relateTask") {
143
- window.openRelateTaskPop(btnRef.current, {
144
- okrId: data.workId,
145
- krId: data.mileStoneId
146
- }).then(function () {
147
- _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
148
- canClose: false
149
- });
150
-
151
- setTimeout(refreshEList, 2000);
152
- })["catch"](function (e) {
153
- _toast["default"].Error(e, {
154
- canClose: false
155
- });
156
- });
172
+ if (name === 'relateTask') {
173
+ setIsShowTask(true);
157
174
  } else {
158
- window.openRelateProjectPop(btnRef.current, {
159
- okrId: data.workId,
160
- krId: data.mileStoneId
161
- }).then(function () {
162
- _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
163
- canClose: false
164
- });
165
-
166
- setTimeout(refreshEList, 2000);
167
- })["catch"](function (e) {
168
- _toast["default"].Error(e.errorMsg, {
169
- canClose: false
170
- });
171
- });
175
+ setIsShowWork(true);
172
176
  }
173
- });
177
+ }, []);
178
+
179
+ var onModelCancel = function onModelCancel() {
180
+ setIsShowTask(false);
181
+ };
182
+
183
+ var onModelWorkCancel = function onModelWorkCancel() {
184
+ setIsShowWork(false);
185
+ };
186
+
187
+ var onModelOk = function onModelOk(data) {
188
+ setTimeout(refreshEList, 2000);
189
+ };
190
+
191
+ var onModelWorkOK = function onModelWorkOK(data) {
192
+ setTimeout(refreshEList, 2000);
193
+ };
194
+
174
195
  return /*#__PURE__*/_react["default"].createElement("div", {
175
196
  key: index,
176
197
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node"))
@@ -182,7 +203,7 @@ var EKrNode = function EKrNode(props) {
182
203
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-title")),
183
204
  onClick: function onClick() {
184
205
  if (data.mileStoneId) {
185
- _drawerManager["default"].open("krDetail", {
206
+ _drawerManager["default"].open('krDetail', {
186
207
  krId: data.mileStoneId
187
208
  });
188
209
  }
@@ -201,32 +222,47 @@ var EKrNode = function EKrNode(props) {
201
222
  ref: btnRef
202
223
  }, /*#__PURE__*/_react["default"].createElement("span", {
203
224
  className: "tu-icon-add1"
204
- }), (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Newlybuild"))
225
+ }), (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Newlybuild'))
205
226
  }, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
206
227
  icon: "tu-icon-Add-renwu",
207
228
  exIconClass: "e-kr-node-layer-icon",
208
229
  name: "addTask"
209
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Addtask"))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
230
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Addtask'))), hasProject && canCreateWork ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
210
231
  icon: "tu-icon-Add-xiangmu",
211
232
  exIconClass: "e-kr-node-layer-icon",
212
233
  name: "addProject"
213
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Addproject"))) : /*#__PURE__*/_react["default"].createElement("span", null)), hasRelation && /*#__PURE__*/_react["default"].createElement(_dropSelector["default"], {
234
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Addproject'))) : /*#__PURE__*/_react["default"].createElement("span", null)), hasRelation && /*#__PURE__*/_react["default"].createElement(_dropSelector["default"], {
214
235
  popupPlacement: "bottomRight",
215
236
  onChange: openRelatePop,
216
237
  trigger: /*#__PURE__*/_react["default"].createElement("span", {
217
238
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-actions-connect"))
218
239
  }, /*#__PURE__*/_react["default"].createElement("span", {
219
240
  className: "tu-icon-guanlian e-kr-node__guanlian-icon"
220
- }), (0, _getLocale.getLocale)("Mod_Associate"))
241
+ }), (0, _getLocale.getLocale)('Mod_Associate'))
221
242
  }, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
222
243
  icon: "tu-icon-GL-renwu",
223
244
  exIconClass: "e-kr-node-layer-icon",
224
245
  name: "relateTask"
225
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_Assotask"))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
246
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Assotask'))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
226
247
  icon: "tu-icon-GL-xiangmu",
227
248
  exIconClass: "e-kr-node-layer-icon",
228
249
  name: "relateProject"
229
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)("OKR_MyO_E_Butt_AssProjects"))) : /*#__PURE__*/_react["default"].createElement("span", null))) : null);
250
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_AssProjects'))) : /*#__PURE__*/_react["default"].createElement("span", null)), isShowTask && /*#__PURE__*/_react["default"].createElement(RelationTaskModel, {
251
+ noScreen: true,
252
+ zIndex: 2400,
253
+ krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
254
+ okrId: data.workId,
255
+ defaultVisible: true,
256
+ onCancel: onModelCancel,
257
+ onRelateSuccess: onModelOk
258
+ }), isShowWork && /*#__PURE__*/_react["default"].createElement(RelationWorkModel, {
259
+ zIndex: 2400,
260
+ krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
261
+ okrId: data.workId,
262
+ defaultVisible: true,
263
+ onCancel: onModelWorkCancel,
264
+ onRelateSuccess: onModelWorkOK
265
+ })) : null);
230
266
  };
231
267
 
232
268
  var _default = EKrNode;
@@ -81,7 +81,7 @@ var EditPop = /*#__PURE__*/function (_PureComponent) {
81
81
  var _super = _createSuper(EditPop);
82
82
 
83
83
  function EditPop() {
84
- var _temp, _this;
84
+ var _this;
85
85
 
86
86
  _classCallCheck(this, EditPop);
87
87
 
@@ -89,7 +89,7 @@ var EditPop = /*#__PURE__*/function (_PureComponent) {
89
89
  args[_key] = arguments[_key];
90
90
  }
91
91
 
92
- return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.state = {
92
+ return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.state = {
93
93
  value: _this.props.value,
94
94
  showError: false,
95
95
  errMsg: "",
@@ -152,7 +152,7 @@ var EditPop = /*#__PURE__*/function (_PureComponent) {
152
152
  errMsg: (0, _i18nFrontTranslate.inputWordTrans)(value.length, maxLength),
153
153
  disable: !!(maxLength && value.length > maxLength && disable)
154
154
  });
155
- }, _temp));
155
+ }, _assertThisInitialized(_this)));
156
156
  }
157
157
 
158
158
  _createClass(EditPop, [{