@titaui/pc 1.11.52-beta.13 → 1.11.52-beta.16

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 (32) hide show
  1. package/lib/components/create-okr-modal/fields/o-new-name.js +7 -1
  2. package/lib/components/create-okr-modal/kr-items/krItem.js +7 -1
  3. package/lib/components/drop-selector/index.js +1 -2
  4. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +2 -2
  5. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +2 -2
  6. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
  7. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
  8. package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
  9. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
  10. package/lib/components/okr-detail/components/header/edit-name.js +10 -18
  11. package/lib/components/okr-detail/components/header/index.js +14 -7
  12. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +78 -42
  13. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +7 -0
  14. package/lib/components/okr-detail/detail-header/index.js +3 -1
  15. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +3 -0
  16. package/lib/components/okr-flow/export-modal/index.js +26 -16
  17. package/lib/components/okr-share/common-painter/utils.js +2 -2
  18. package/lib/components/progress/circle-progress/index.css +2 -0
  19. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +8 -3
  20. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +4 -2
  21. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +3 -3
  22. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +8 -2
  23. package/lib/components/task-tree/task-item-node/index.css +2 -2
  24. package/lib/components/upload/components/uploadedPreview.js +18 -18
  25. package/lib/components/upload/index.js +57 -29
  26. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +14 -15
  27. package/lib/components/user-selector/searched-panel/index.js +12 -6
  28. package/lib/pages/new-okr-list/header/index.js +16 -18
  29. package/lib/utils/auth.js +12 -0
  30. package/lib/utils/hooks.js +19 -5
  31. package/lib/utils/tita-okr-cycle.js +24 -0
  32. package/package.json +2 -2
@@ -171,7 +171,11 @@ function ONewName(_ref) {
171
171
  onOInputFocusStateChange(false);
172
172
  }
173
173
  }, []);
174
- var handleOnKeyDown = (0, _react.useCallback)(function () {
174
+ var handleOnKeyDown = (0, _react.useCallback)(function (e) {
175
+ if (e.key.toLocaleLowerCase() == 'enter') {
176
+ e.preventDefault();
177
+ }
178
+
175
179
  setIsInputContent(true);
176
180
  }, [setIsInputContent]);
177
181
  var handleOnKeyUp = (0, _react.useCallback)(function (e) {
@@ -198,6 +202,8 @@ function ONewName(_ref) {
198
202
  position: "top"
199
203
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
200
204
  initialState: richText,
205
+ manualWrap: true,
206
+ contentEditable: true,
201
207
  key: richEditorStatus,
202
208
  onDocChange: onChangeHandler,
203
209
  onFocus: handleInputFocus,
@@ -102,7 +102,11 @@ function KrItem(props) {
102
102
  // }
103
103
  // }, [onAddKr])
104
104
 
105
- var handleOnKeyDown = (0, _react.useCallback)(function () {
105
+ var handleOnKeyDown = (0, _react.useCallback)(function (e) {
106
+ if (e.key.toLocaleLowerCase() == 'enter') {
107
+ e.preventDefault();
108
+ }
109
+
106
110
  setIsInputContent(true);
107
111
  }, [setIsInputContent]);
108
112
  var handleOnKeyUp = (0, _react.useCallback)(function (e) {
@@ -140,6 +144,8 @@ function KrItem(props) {
140
144
  position: "top"
141
145
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
142
146
  initialState: mileStoneNameRichText,
147
+ manualWrap: true,
148
+ contentEditable: true,
143
149
  key: krData === null || krData === void 0 ? void 0 : krData.uuid,
144
150
  onDocChange: onKrNameInputChangeHandler,
145
151
  onFocus: handleInputFocus,
@@ -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
  }
@@ -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", {
@@ -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
  }
@@ -29,6 +29,8 @@ var _getLocale = require("../../../../utils/getLocale");
29
29
 
30
30
  var _mblog = require("../../../../utils/mblog");
31
31
 
32
+ var _openData = require("../../../../utils/open-data");
33
+
32
34
  require("./index.css");
33
35
 
34
36
  var _excluded = ["data"];
@@ -118,7 +120,7 @@ var DynamicTask = function DynamicTask(_ref) {
118
120
  className: "".concat(prefix, "__object-name"),
119
121
  onClick: handleClickTitle
120
122
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
121
- text: (0, _mblog.htmlDecodeByRegExp)(obj.objName),
123
+ text: (0, _openData.parseString)((0, _mblog.htmlDecodeByRegExp)(obj.objName)),
122
124
  isPercent: true
123
125
  })), (0, _getLocale.getLocale)('Mod_stask'));
124
126
  }
@@ -27,6 +27,8 @@ var _utils = require("./utils");
27
27
 
28
28
  var _getLocale = require("../../utils/getLocale");
29
29
 
30
+ var _openData = require("../../utils/open-data");
31
+
30
32
  require("./style/style.css");
31
33
 
32
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -110,7 +112,7 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
110
112
 
111
113
  _this.handleOk = function () {
112
114
  if (!_this.state.isValid) {
113
- _toast["default"].Warning("关键成果总权重须等于100%");
115
+ _toast["default"].Warning('关键成果总权重须等于100%');
114
116
 
115
117
  return;
116
118
  }
@@ -126,10 +128,10 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
126
128
  };
127
129
  });
128
130
 
129
- (0, _requestV.taker)((0, _requestV.getApiUrl)(url), "post", data).then(function (res) {
131
+ (0, _requestV.taker)((0, _requestV.getApiUrl)(url), 'post', data).then(function (res) {
130
132
  _this.props.onOk && _this.props.onOk(); // @ts-ignore
131
133
 
132
- window.Talent.app.vent.trigger("updateProgress:Project-Progress-View", {});
134
+ window.Talent.app.vent.trigger('updateProgress:Project-Progress-View', {});
133
135
  });
134
136
  };
135
137
 
@@ -295,7 +297,7 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
295
297
  isValid = _this$state.isValid,
296
298
  isDone = _this$state.isDone;
297
299
  return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
298
- title: (0, _getLocale.getLocale)("OKR_MyO_Text_krweightsetting"),
300
+ title: (0, _getLocale.getLocale)('OKR_MyO_Text_krweightsetting'),
299
301
  noFooterLine: true,
300
302
  visible: !isDone && isShowModal,
301
303
  width: "570px",
@@ -324,19 +326,19 @@ var EditKrWightModal = /*#__PURE__*/function (_Component) {
324
326
  }, /*#__PURE__*/_react["default"].createElement(_style.KrCounter, null, /*#__PURE__*/_react["default"].createElement("div", {
325
327
  className: "kr-counter"
326
328
  }, "KR".concat(index + 1))), /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
327
- title: mileStoneName,
329
+ title: (0, _openData.parseString)(mileStoneName),
328
330
  overlayStyle: mileStoneName.length > 18 ? {
329
331
  zIndex: 99999
330
332
  } : {}
331
- }, /*#__PURE__*/_react["default"].createElement(_style.KrTitle, null, mileStoneName)), /*#__PURE__*/_react["default"].createElement(_style.FormItemWrapper, {
333
+ }, /*#__PURE__*/_react["default"].createElement(_style.KrTitle, null, (0, _openData.parseString)(mileStoneName))), /*#__PURE__*/_react["default"].createElement(_style.FormItemWrapper, {
332
334
  style: {
333
335
  width: 140
334
336
  }
335
- }, /*#__PURE__*/_react["default"].createElement(_style.FormItemLabel, null, (0, _getLocale.getLocale)("OKR_MyO_Text_Weights")), /*#__PURE__*/_react["default"].createElement(_FormItemV["default"], {
337
+ }, /*#__PURE__*/_react["default"].createElement(_style.FormItemLabel, null, (0, _getLocale.getLocale)('OKR_MyO_Text_Weights')), /*#__PURE__*/_react["default"].createElement(_FormItemV["default"], {
336
338
  isDirty: data.isDirty,
337
- errorText: (0, _getLocale.getLocale)("OKR_MyO_KRP_Please0and100")
339
+ errorText: (0, _getLocale.getLocale)('OKR_MyO_KRP_Please0and100')
338
340
  }, /*#__PURE__*/_react["default"].createElement(_Input["default"], {
339
- suffixIcon: (0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_Percentage"),
341
+ suffixIcon: (0, _getLocale.getLocale)('OKR_MyO_Pop_Upd_Percentage'),
340
342
  value: krWeight,
341
343
  onChange: function onChange(value) {
342
344
  return _this4.handleWeightChange(value, feedId);
@@ -260,7 +260,7 @@ function Inform(props) {
260
260
  className: (0, _classnames["default"])("".concat(preCls, "__item-right-content"))
261
261
  }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
262
262
  overlayClassName: "".concat(preCls, "__item-right-content-tooltip"),
263
- text: (0, _openData.parseString)((0, _utils.deleteText)((0, _utils.htmlToText)(item.content))),
263
+ text: (0, _utils.htmlToText)((0, _openData.parseString)((0, _utils.deleteText)(item.content))),
264
264
  isPercent: true,
265
265
  mouseEnterDelay: 0.8
266
266
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -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;
@@ -299,6 +299,11 @@ function _default(props) {
299
299
 
300
300
  var onInputKeyDownHandler = function onInputKeyDownHandler(e) {
301
301
  if (e.keyCode !== 13) return;
302
+
303
+ if (e.key.toLocaleLowerCase() == 'enter') {
304
+ e.preventDefault();
305
+ }
306
+
302
307
  onKrNameChangeHandler();
303
308
  };
304
309
 
@@ -407,6 +412,8 @@ function _default(props) {
407
412
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
408
413
  editable: editing,
409
414
  initialState: krNameData.richText,
415
+ manualWrap: true,
416
+ contentEditable: true,
410
417
  onDocChange: onEditorChange,
411
418
  onBlur: onKrNameChangeHandler,
412
419
  onKeyDown: onInputKeyDownHandler,
@@ -67,6 +67,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
67
67
 
68
68
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
69
69
 
70
+ var StrRreg = /@\$(userName|departmentName)\=(.+?)\$(\s|$)/g;
71
+
70
72
  function OkrDetailHeader(_ref) {
71
73
  var detailInfo = _ref.detailInfo;
72
74
 
@@ -396,7 +398,7 @@ function OkrDetailHeader(_ref) {
396
398
  actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
397
399
  id: detailInfo.workId,
398
400
  objType: 62,
399
- name: detailInfo.workName,
401
+ name: detailInfo.workName.replace(StrRreg, ''),
400
402
  principalUser: detailInfo.principalUser
401
403
  }),
402
404
  content: parent && /*#__PURE__*/_react["default"].createElement("span", {
@@ -172,6 +172,7 @@ function CreateKr(_ref) {
172
172
 
173
173
  var onInputKeyDown = function onInputKeyDown(e) {
174
174
  if (e.key.toLocaleLowerCase() == 'enter' && !pendingRef.current) {
175
+ e.preventDefault();
175
176
  pendingRef.current = true;
176
177
  var mentionUsers = krNameData.mentionUsers,
177
178
  pureText = krNameData.pureText,
@@ -242,6 +243,8 @@ function CreateKr(_ref) {
242
243
  className: (0, _classnames["default"])("".concat(preCls, "__input"))
243
244
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
244
245
  initialState: undefined,
246
+ manualWrap: true,
247
+ contentEditable: true,
245
248
  onDocChange: setKrNameData,
246
249
  onBlur: createKr,
247
250
  onFocus: onFocus,
@@ -201,31 +201,41 @@ var ExportMapModal = function ExportMapModal(props) {
201
201
  }
202
202
 
203
203
  size = size / 1024 / 1024; // @ts-ignore
204
+ // window.titaTracker && window.titaTracker("action").record({
205
+ // actionName: userId+'租户:'+telentId+'我得到了图片大小为:'+size+',路径为'+imgUrl.slice(1,200),
206
+ // actionGroup: 'okr地图图片',
207
+ // productName: 'okr地图导出',
208
+ // });
204
209
 
205
210
  // @ts-ignore
206
- window.titaTracker && window.titaTracker("action").record({
207
- actionName: userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl.slice(1, 200),
208
- actionGroup: 'okr地图图片',
209
- productName: 'okr地图导出'
210
- });
211
+ // window.titaTracker && window.titaTracker("action").record({
212
+ // actionName: userId+'租户:'+telentId+'我得到了图片大小为:'+size+',路径为'+imgUrl.slice(1,200),
213
+ // actionGroup: 'okr地图图片',
214
+ // productName: 'okr地图导出',
215
+ // });
211
216
  Sentry.withScope(function (scope) {
212
- scope.setTag("error-level", "P0");
213
- scope.setTag("error-type", "地图导出-图片生成");
214
- scope.setExtra("userMessage", userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
217
+ scope.setTag('error-level', "P0");
218
+ scope.setTag('error-type', '地图导出-图片生成');
219
+ scope.setExtra('userMessage', userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
215
220
  });
216
221
  (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
217
222
  var image = new Image(); // @ts-ignore
223
+ // window.titaTracker && window.titaTracker("action").record({
224
+ // actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
225
+ // actionGroup: 'okr地图接口',
226
+ // productName: 'okr地图导出',
227
+ // });
218
228
 
219
229
  // @ts-ignore
220
- window.titaTracker && window.titaTracker("action").record({
221
- actionName: userId + '租户:' + telentId + '我获得了地址' + url.Data.obj,
222
- actionGroup: 'okr地图接口',
223
- productName: 'okr地图导出'
224
- });
230
+ // window.titaTracker && window.titaTracker("action").record({
231
+ // actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
232
+ // actionGroup: 'okr地图接口',
233
+ // productName: 'okr地图导出',
234
+ // });
225
235
  Sentry.withScope(function (scope) {
226
- scope.setTag("error-level", "P0");
227
- scope.setTag("error-type", "地图导出-图片地址");
228
- scope.setExtra("userMessage", userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
236
+ scope.setTag('error-level', "P0");
237
+ scope.setTag('error-type', '地图导出-图片地址');
238
+ scope.setExtra('userMessage', userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
229
239
  });
230
240
 
231
241
  _toast["default"].Warning('图片上传成功,准备本地下载', {
@@ -122,8 +122,8 @@ function _breakLinesForCanvas() {
122
122
  while (1) {
123
123
  switch (_context2.prev = _context2.next) {
124
124
  case 0:
125
- reg = /\$(userName|departmentName)\=(.+?)(\s|$)/g;
126
- strReg = /\$(?:userName|departmentName)\=.+?(?:\s|$)/;
125
+ reg = /\$(userName|departmentName)\=(.+?)\$(\s|$)/g;
126
+ strReg = /\$(?:userName|departmentName)\=.+?\$(?:\s|$)/;
127
127
  openDatas = [];
128
128
  matchStr = reg.exec(text);
129
129