@titaui/pc 1.12.22-beta.1 → 1.12.22-beta.13

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 (52) hide show
  1. package/lib/components/attachments-preview/index.js +6 -2
  2. package/lib/components/color-date-picker/index.css +1 -2
  3. package/lib/components/dialog-upload/index.js +1 -1
  4. package/lib/components/dynamic/components/comments-dialog/img/curEfforts.png +0 -0
  5. package/lib/components/dynamic/components/comments-dialog/img/curGood.png +0 -0
  6. package/lib/components/dynamic/components/comments-dialog/img/curGreat.png +0 -0
  7. package/lib/components/dynamic/components/comments-dialog/img/efforts.png +0 -0
  8. package/lib/components/dynamic/components/comments-dialog/img/good.png +0 -0
  9. package/lib/components/dynamic/components/comments-dialog/img/great.png +0 -0
  10. package/lib/components/dynamic/components/comments-dialog/index.css +33 -3
  11. package/lib/components/dynamic/components/comments-dialog/index.js +18 -7
  12. package/lib/components/dynamic/dynamic-item/components/header/index.js +2 -1
  13. package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +3 -14
  14. package/lib/components/dynamic/dynamic-item/components/schedule/index.js +5 -29
  15. package/lib/components/dynamic/dynamic-item/components/summary-header/index.css +0 -1
  16. package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +95 -48
  17. package/lib/components/dynamic/dynamic-item/components/summary-header/request-api.js +17 -0
  18. package/lib/components/dynamic/dynamic-item/components/task-progress/constant.js +15 -2
  19. package/lib/components/dynamic/dynamic-item/components/task-progress/index.css +41 -31
  20. package/lib/components/dynamic/dynamic-item/components/task-progress/index.js +72 -85
  21. package/lib/components/dynamic/dynamic-item/components/task-progress/interface.js +18 -1
  22. package/lib/components/dynamic/dynamic-item/components/task-progress/render-row.js +80 -0
  23. package/lib/components/dynamic/dynamic-item/components/task-progress/request-api.js +16 -0
  24. package/lib/components/dynamic/dynamic-item/components/task-progress/utils.js +92 -8
  25. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +42 -23
  26. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.css +1 -1
  27. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +42 -65
  28. package/lib/components/dynamic/dynamic-item/index.js +50 -44
  29. package/lib/components/import-modal/import-okr-modal/index.js +2 -1
  30. package/lib/components/import-modal/import-task-modal/search-form.js +4 -1
  31. package/lib/components/import-modal/request-api.js +1 -1
  32. package/lib/components/import-modal/search/task-relation.js +9 -5
  33. package/lib/components/import-modal/tree/okr-tree/index.js +15 -5
  34. package/lib/components/menus/components/search-colleague/index.js +3 -1
  35. package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +15 -11
  36. package/lib/components/menus/export-modules/summary-menus/menus.js +48 -36
  37. package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +2 -2
  38. package/lib/components/picker/components/panels/month-panel/index.js +2 -1
  39. package/lib/components/picker/components/panels/week-panel/index.js +6 -2
  40. package/lib/components/picker/components/panels/week-panel/utils.js +24 -2
  41. package/lib/components/picker/components/panels/week-panel/week-body.js +18 -10
  42. package/lib/components/picker/components/panels/week-panel/week-head.js +9 -7
  43. package/lib/components/picker/picker-panels.js +3 -3
  44. package/lib/components/picker/range-picker/components/select-input/index.js +9 -2
  45. package/lib/components/rate/index.css +3 -3
  46. package/lib/components/textarea/index.css +2 -2
  47. package/lib/components/textarea/index.js +1 -1
  48. package/lib/components/upvote/index.js +10 -4
  49. package/lib/components/write-summary-modal/index.css +1 -0
  50. package/lib/components/write-summary-modal/index.js +7 -6
  51. package/lib/utils/helpers.js +58 -3
  52. package/package.json +2 -2
@@ -45,6 +45,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
45
45
 
46
46
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
47
47
 
48
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
49
+
50
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
51
+
52
+ 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; }
53
+
48
54
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
49
55
 
50
56
  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."); }
@@ -96,37 +102,51 @@ var getRemarkTypeList = function getRemarkTypeList() {
96
102
  };
97
103
 
98
104
  var EvaluteCard = function EvaluteCard(props) {
105
+ var _user$avatar;
106
+
99
107
  var evaluation = props.evaluation,
100
108
  feedId = props.feedId,
101
109
  publishUser = props.publishUser,
102
110
  canEvaluate = props.canEvaluate;
103
- var value = evaluation.value,
104
- type = evaluation.type,
105
- remark = evaluation.remark,
106
- user = evaluation.user;
107
111
 
108
- var _useState = (0, _react.useState)({
109
- bgc: "rgba(240, 163, 38, 0.12)"
110
- }),
112
+ var _useState = (0, _react.useState)(evaluation),
111
113
  _useState2 = _slicedToArray(_useState, 2),
112
- evaluateContentBgc = _useState2[0],
113
- setEvaluateContentBgc = _useState2[1];
114
+ currentEvalute = _useState2[0],
115
+ setCurrentEvalute = _useState2[1];
114
116
 
115
- var _useState3 = (0, _react.useState)(false),
117
+ var value = currentEvalute.value,
118
+ type = currentEvalute.type,
119
+ remark = currentEvalute.remark,
120
+ user = currentEvalute.user;
121
+
122
+ var _useState3 = (0, _react.useState)({
123
+ bgc: "rgba(240, 163, 38, 0.12)"
124
+ }),
116
125
  _useState4 = _slicedToArray(_useState3, 2),
117
- evaluateVisible = _useState4[0],
118
- setEvaluateVisible = _useState4[1];
126
+ evaluateContentBgc = _useState4[0],
127
+ setEvaluateContentBgc = _useState4[1];
128
+
129
+ var _useState5 = (0, _react.useState)(false),
130
+ _useState6 = _slicedToArray(_useState5, 2),
131
+ evaluateVisible = _useState6[0],
132
+ setEvaluateVisible = _useState6[1];
119
133
 
120
134
  var handleClickEvaluate = function handleClickEvaluate() {
121
135
  setEvaluateVisible(true);
122
136
  };
123
137
 
124
- var handleCloseEvaluateDialog = function handleCloseEvaluateDialog() {
138
+ var handleCloseEvaluateDialog = function handleCloseEvaluateDialog(params) {
139
+ if (params) {
140
+ setCurrentEvalute(_objectSpread(_objectSpread({}, currentEvalute), params));
141
+ }
142
+
125
143
  setEvaluateVisible(false);
126
144
  };
127
145
 
128
146
  (0, _react.useEffect)(function () {
129
147
  if (evaluation) {
148
+ setCurrentEvalute(evaluation);
149
+
130
150
  if (type === 1) {
131
151
  setEvaluateContentBgc({
132
152
  bgc: "rgba(240, 163, 38, 0.12)"
@@ -151,16 +171,15 @@ var EvaluteCard = function EvaluteCard(props) {
151
171
  }, /*#__PURE__*/_react["default"].createElement("div", {
152
172
  className: "".concat(preCls, "__head")
153
173
  }, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
154
- name: user.name,
155
- userId: user.userId,
156
- src: user.avatar.medium,
157
- color: user.avatar.color
174
+ name: (user === null || user === void 0 ? void 0 : user.name) || "",
175
+ userId: (user === null || user === void 0 ? void 0 : user.userId) || "",
176
+ src: (user === null || user === void 0 ? void 0 : (_user$avatar = user.avatar) === null || _user$avatar === void 0 ? void 0 : _user$avatar.medium) || "",
177
+ color: (user === null || user === void 0 ? void 0 : user.avatar.color) || ""
158
178
  }), /*#__PURE__*/_react["default"].createElement("span", {
159
179
  className: "".concat(preCls, "__head-name")
160
- }, user.name), (0, _getLocale.getLocale)("Rep_NewS_EvaluationOF"), type === 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_rate["default"], {
180
+ }, user === null || user === void 0 ? void 0 : user.name), (0, _getLocale.getLocale)("Rep_NewS_EvaluationOF"), type === 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_rate["default"], {
161
181
  defaultValue: Number(value) / 2,
162
- disabled: true,
163
- allowHalf: true
182
+ disabled: true
164
183
  }), /*#__PURE__*/_react["default"].createElement("span", {
165
184
  className: "".concat(preCls, "__head-rate")
166
185
  }, "".concat(value).concat((0, _getLocale.getLocale)("Per_Set_Form_Quantifier_Points")))), type === 2 && getRemarkTypeList().map(function (item) {
@@ -184,7 +203,8 @@ var EvaluteCard = function EvaluteCard(props) {
184
203
  alt: ""
185
204
  });
186
205
  }), canEvaluate && /*#__PURE__*/_react["default"].createElement("div", {
187
- className: "".concat(preCls, "__evalute")
206
+ className: "".concat(preCls, "__evalute"),
207
+ onClick: handleClickEvaluate
188
208
  }, type === 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
189
209
  src: _veryGoodWrite["default"],
190
210
  className: "".concat(preCls, "__evalute-img"),
@@ -201,8 +221,7 @@ var EvaluteCard = function EvaluteCard(props) {
201
221
  className: "".concat(preCls, "__evalute-text"),
202
222
  style: {
203
223
  color: item.textColor
204
- },
205
- onClick: handleClickEvaluate
224
+ }
206
225
  }, "\u4FEE\u6539"));
207
226
  })), /*#__PURE__*/_react["default"].createElement(_commentsDialog["default"], {
208
227
  visible: evaluateVisible,
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  .titaui-dynamic-new-report-item__content {
14
- margin-left: 88px;
14
+ margin-left: 82px;
15
15
  line-height: 24px;
16
16
  word-wrap: break-word;
17
17
  }
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _richEditor = _interopRequireWildcard(require("@titaui/rich-editor"));
15
+
14
16
  var _context = require("../../context");
15
17
 
16
18
  var _summaryHeader = _interopRequireDefault(require("../components/summary-header"));
@@ -29,17 +31,15 @@ var _evalute = _interopRequireDefault(require("./components/evalute"));
29
31
 
30
32
  var _richEditorUpload = _interopRequireDefault(require("../../../rich-editor-upload"));
31
33
 
32
- var _richEditor = _interopRequireDefault(require("../../../rich-editor"));
33
-
34
34
  var _getLocale = require("../../../../utils/getLocale");
35
35
 
36
36
  var _constant = require("./constant");
37
37
 
38
- require("./index.css");
39
-
40
38
  var _util = require("./util");
41
39
 
42
- var _excluded = ["data", "showCollect"];
40
+ require("./index.css");
41
+
42
+ var _excluded = ["data"];
43
43
 
44
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
45
45
 
@@ -80,7 +80,6 @@ var prefix = "titaui-dynamic-new-report-item";
80
80
 
81
81
  var DynamicReply = function DynamicReply(_ref) {
82
82
  var data = _ref.data,
83
- showCollect = _ref.showCollect,
84
83
  restProps = _objectWithoutProperties(_ref, _excluded);
85
84
 
86
85
  var feedId = data.feedId,
@@ -99,37 +98,17 @@ var DynamicReply = function DynamicReply(_ref) {
99
98
  mindImg = _useState2[0],
100
99
  setMindImg = _useState2[1];
101
100
 
102
- var _useState3 = (0, _react.useState)({}),
103
- _useState4 = _slicedToArray(_useState3, 2),
104
- okrTableData = _useState4[0],
105
- setOkrtableData = _useState4[1];
106
-
107
- var _useState5 = (0, _react.useState)({}),
108
- _useState6 = _slicedToArray(_useState5, 2),
109
- taskTableData = _useState6[0],
110
- setTasktableData = _useState6[1];
111
-
112
- var _useState7 = (0, _react.useState)(""),
113
- _useState8 = _slicedToArray(_useState7, 2),
114
- okrTableTitle = _useState8[0],
115
- setOkrtableTitle = _useState8[1];
116
-
117
- var _useState9 = (0, _react.useState)(""),
118
- _useState10 = _slicedToArray(_useState9, 2),
119
- taskTableTitle = _useState10[0],
120
- setTasktableTitle = _useState10[1];
121
-
122
- var _useState11 = (0, _react.useState)(),
123
- _useState12 = _slicedToArray(_useState11, 2),
124
- richTextData = _useState12[0],
125
- setRichTextData = _useState12[1];
126
-
127
101
  var contentRichTextRef = (0, _react.useRef)();
128
102
  var workPlanRichTextRef = (0, _react.useRef)();
129
103
 
130
104
  var _useContext = (0, _react.useContext)(_context.SearchKeyContext),
131
105
  searchKeyWord = _useContext.searchKeyWord;
132
106
 
107
+ var _useState3 = (0, _react.useState)(evaluates || []),
108
+ _useState4 = _slicedToArray(_useState3, 2),
109
+ currentEvalutes = _useState4[0],
110
+ setCurrentEvalutes = _useState4[1];
111
+
133
112
  var renderSuffix = (0, _react.useMemo)(function () {
134
113
  var _classNames, _classNames2;
135
114
 
@@ -149,6 +128,9 @@ var DynamicReply = function DynamicReply(_ref) {
149
128
  className: "".concat(prefix, "__operate-desc")
150
129
  }, reportTextMap[reportType]);
151
130
  }, []);
131
+ (0, _react.useEffect)(function () {
132
+ setCurrentEvalutes(evaluates);
133
+ }, [evaluates]);
152
134
  (0, _react.useEffect)(function () {
153
135
  (0, _tools.highLightWord)({
154
136
  parentDom: contentRichTextRef.current,
@@ -161,26 +143,11 @@ var DynamicReply = function DynamicReply(_ref) {
161
143
  }, [data, searchKeyWord]);
162
144
  (0, _react.useEffect)(function () {
163
145
  if (dailyContent) {
164
- var _dailyContent$filter$, _dailyContent$filter$2, _dailyContent$filter$3, _dailyContent$filter$4, _mindData$, _mindData$2;
146
+ var _mindData$, _mindData$2;
165
147
 
166
148
  var mindData = dailyContent.filter(function (item) {
167
149
  return (item === null || item === void 0 ? void 0 : item.contentType) === 1;
168
150
  });
169
- setOkrtableData(((_dailyContent$filter$ = dailyContent.filter(function (item) {
170
- return (item === null || item === void 0 ? void 0 : item.contentType) === 2;
171
- })[0]) === null || _dailyContent$filter$ === void 0 ? void 0 : _dailyContent$filter$.content) || null);
172
- setOkrtableTitle((_dailyContent$filter$2 = dailyContent.filter(function (item) {
173
- return (item === null || item === void 0 ? void 0 : item.contentType) === 2;
174
- })[0]) === null || _dailyContent$filter$2 === void 0 ? void 0 : _dailyContent$filter$2.title);
175
- setTasktableData(((_dailyContent$filter$3 = dailyContent.filter(function (item) {
176
- return (item === null || item === void 0 ? void 0 : item.contentType) === 3;
177
- })[0]) === null || _dailyContent$filter$3 === void 0 ? void 0 : _dailyContent$filter$3.content) || null);
178
- setTasktableTitle((_dailyContent$filter$4 = dailyContent.filter(function (item) {
179
- return (item === null || item === void 0 ? void 0 : item.contentType) === 3;
180
- })[0]) === null || _dailyContent$filter$4 === void 0 ? void 0 : _dailyContent$filter$4.title);
181
- setRichTextData(dailyContent.filter(function (item) {
182
- return (item === null || item === void 0 ? void 0 : item.contentType) === _constant.dailyContentType.richText;
183
- }));
184
151
 
185
152
  if (typeof ((_mindData$ = mindData[0]) === null || _mindData$ === void 0 ? void 0 : _mindData$.content) === "string" && ((_mindData$2 = mindData[0]) === null || _mindData$2 === void 0 ? void 0 : _mindData$2.content) !== "") {
186
153
  setMindImg(_constant.Motion.filter(function (item) {
@@ -198,8 +165,8 @@ var DynamicReply = function DynamicReply(_ref) {
198
165
  user: publishUser,
199
166
  suffixContent: renderSuffix,
200
167
  showDelete: true,
201
- showCollect: showCollect,
202
- canEvaluate: canEvaluate && evaluates.length === 0
168
+ canEvaluate: canEvaluate && !currentEvalutes,
169
+ setEvaluates: setCurrentEvalutes
203
170
  })), /*#__PURE__*/_react["default"].createElement("div", {
204
171
  className: "".concat(prefix, "__content")
205
172
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -214,30 +181,40 @@ var DynamicReply = function DynamicReply(_ref) {
214
181
  src: mindImg,
215
182
  className: "".concat(prefix, "__content-mind"),
216
183
  alt: ""
217
- })), (richTextData === null || richTextData === void 0 ? void 0 : richTextData.length) !== 0 && (richTextData === null || richTextData === void 0 ? void 0 : richTextData.map(function (item) {
218
- return item.richContent !== "" && typeof item.richContent === "string" && /*#__PURE__*/_react["default"].createElement("div", {
219
- className: "".concat(prefix, "__work")
220
- }, item.title, /*#__PURE__*/_react["default"].createElement(_richEditor["default"].Editor, {
221
- defaultState: JSON.parse(item.richContent),
222
- editable: false
223
- }));
224
- })), okrTableData && /*#__PURE__*/_react["default"].createElement(_okrProgress["default"], {
225
- data: okrTableData,
226
- title: okrTableTitle
227
- }), taskTableData && /*#__PURE__*/_react["default"].createElement(_taskProgress["default"], {
228
- data: taskTableData,
229
- title: taskTableTitle
184
+ })), dailyContent.map(function (item) {
185
+ if (item.contentType === _constant.dailyContentType.richText) {
186
+ return item.richContent !== "" && typeof item.richContent === "string" && /*#__PURE__*/_react["default"].createElement("div", {
187
+ className: "".concat(prefix, "__work")
188
+ }, item.title, /*#__PURE__*/_react["default"].createElement(_richEditor["default"], null, /*#__PURE__*/_react["default"].createElement(_richEditor.EditorComponent, {
189
+ editable: false,
190
+ initialState: JSON.parse(item.richContent)
191
+ })));
192
+ }
193
+
194
+ if (item.contentType === _constant.dailyContentType.okr) {
195
+ return item.content && /*#__PURE__*/_react["default"].createElement(_okrProgress["default"], {
196
+ data: item.content,
197
+ title: item.title
198
+ });
199
+ }
200
+
201
+ if (item.contentType === _constant.dailyContentType.task) {
202
+ return item.content && /*#__PURE__*/_react["default"].createElement(_taskProgress["default"], {
203
+ data: item.content,
204
+ title: item.title
205
+ });
206
+ }
230
207
  }), files.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
231
208
  className: "".concat(prefix, "__upload")
232
209
  }, /*#__PURE__*/_react["default"].createElement(_richEditorUpload["default"], {
233
- text: "\u9644\u4EF6",
210
+ text: (0, _getLocale.getLocale)("Per_Ass_New_Err_Attachment"),
234
211
  files: files,
235
212
  editable: false,
236
213
  enableDelete: false
237
214
  })), /*#__PURE__*/_react["default"].createElement(_remindUserView["default"], {
238
215
  data: atUsers
239
- }), evaluates.length !== 0 && /*#__PURE__*/_react["default"].createElement(_evalute["default"], {
240
- evaluation: evaluates[0],
216
+ }), currentEvalutes && currentEvalutes.length !== 0 && /*#__PURE__*/_react["default"].createElement(_evalute["default"], {
217
+ evaluation: currentEvalutes[0],
241
218
  feedId: feedId,
242
219
  publishUser: publishUser,
243
220
  canEvaluate: canEvaluate
@@ -77,6 +77,8 @@ var _dynamicInterviewShare = _interopRequireDefault(require("./dynamic-interview
77
77
 
78
78
  var _dynamicNewReport = _interopRequireDefault(require("./dynamic-new-report"));
79
79
 
80
+ var _excluded = ["data", "onDeleteFeed", "dynamicShareIsShowToping"];
81
+
80
82
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
81
83
 
82
84
  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); }
@@ -89,6 +91,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
89
91
 
90
92
  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; }
91
93
 
94
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
95
+
92
96
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
93
97
 
94
98
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -109,7 +113,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
109
113
 
110
114
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
111
115
 
112
- var prefix = 'titaui-dynamic-item';
116
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
117
+
118
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
119
+
120
+ var prefix = "titaui-dynamic-item";
113
121
 
114
122
  var DynamicItem = function DynamicItem(_ref) {
115
123
  var _getBSGlobal, _JSON$parse;
@@ -117,7 +125,8 @@ var DynamicItem = function DynamicItem(_ref) {
117
125
  var data = _ref.data,
118
126
  onDeleteFeed = _ref.onDeleteFeed,
119
127
  dynamicShareIsShowToping = _ref.dynamicShareIsShowToping,
120
- showCollect = _ref.showCollect;
128
+ restProps = _objectWithoutProperties(_ref, _excluded);
129
+
121
130
  var feedId = data.feedId,
122
131
  feedComments = data.feedComments,
123
132
  praiseType = data.praiseType,
@@ -164,8 +173,8 @@ var DynamicItem = function DynamicItem(_ref) {
164
173
  isShowAtAll = _useContext.isShowAtAll;
165
174
 
166
175
  var hasDynamicOpereateAuth = new _auth.DynamicManagerAuth().hasAuth();
167
- var hasRewardBtn = !!((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('WebHead')) !== null && _getBSGlobal !== void 0 && _getBSGlobal.AppHead.find(function (item) {
168
- return item.AppId === '950';
176
+ var hasRewardBtn = !!((_getBSGlobal = (0, _bsGlobal.getBSGlobal)("WebHead")) !== null && _getBSGlobal !== void 0 && _getBSGlobal.AppHead.find(function (item) {
177
+ return item.AppId === "950";
169
178
  }));
170
179
  var isBiShare = data.shareType === _constant.EShareType.BiShare && data.biId;
171
180
 
@@ -185,10 +194,10 @@ var DynamicItem = function DynamicItem(_ref) {
185
194
 
186
195
  var handleShowMore = function handleShowMore() {
187
196
  if (data.feedType === _constant.EFeedType.Report && window.titaTracker) {
188
- window.titaTracker('planAction').record({
189
- actionName: '查看日报',
190
- actionGroup: '动态-查看更多',
191
- productName: '动态',
197
+ window.titaTracker("planAction").record({
198
+ actionName: "查看日报",
199
+ actionGroup: "动态-查看更多",
200
+ productName: "动态",
192
201
  feedId: feedId
193
202
  });
194
203
  }
@@ -197,18 +206,18 @@ var DynamicItem = function DynamicItem(_ref) {
197
206
  };
198
207
 
199
208
  var onChangeParse = function onChangeParse(type) {
200
- var _getBSGlobal2 = (0, _bsGlobal.getBSGlobal)('loginUserInfo'),
209
+ var _getBSGlobal2 = (0, _bsGlobal.getBSGlobal)("loginUserInfo"),
201
210
  Id = _getBSGlobal2.Id;
202
211
 
203
212
  var data = _toConsumableArray(praiseData).filter(function (item) {
204
213
  return Number("".concat(item.userId)) !== Number("".concat(Id));
205
214
  });
206
215
 
207
- var actionName = '';
216
+ var actionName = "";
208
217
 
209
218
  if (type) {
210
- var avatar = (0, _bsGlobal.getBSGlobal)('loginUserInfo').UserAvatar;
211
- var name = (0, _bsGlobal.getBSGlobal)('loginUserInfo').Name;
219
+ var avatar = (0, _bsGlobal.getBSGlobal)("loginUserInfo").UserAvatar;
220
+ var name = (0, _bsGlobal.getBSGlobal)("loginUserInfo").Name;
212
221
  avatar.color = avatar.Color;
213
222
  avatar.medium = avatar.Medium;
214
223
  var parseUser = {
@@ -218,17 +227,17 @@ var DynamicItem = function DynamicItem(_ref) {
218
227
  praiseType: type
219
228
  };
220
229
  setPraiseData([parseUser].concat(_toConsumableArray(data)));
221
- actionName = '点赞日报';
230
+ actionName = "点赞日报";
222
231
  } else {
223
232
  setPraiseData(data);
224
- actionName = '取消日报点赞';
233
+ actionName = "取消日报点赞";
225
234
  }
226
235
 
227
236
  if (feedType === _constant.EFeedType.Report && window.titaTracker) {
228
- window.titaTracker('planAction').record({
237
+ window.titaTracker("planAction").record({
229
238
  actionName: actionName,
230
- actionGroup: '动态-日报',
231
- productName: '动态',
239
+ actionGroup: "动态-日报",
240
+ productName: "动态",
232
241
  feedId: feedId
233
242
  });
234
243
  }
@@ -279,21 +288,18 @@ var DynamicItem = function DynamicItem(_ref) {
279
288
  });
280
289
 
281
290
  case _constant.EFeedType.Report:
282
- var newSummary = data.newSummary;
283
-
284
- if (newSummary) {
285
- return /*#__PURE__*/_react["default"].createElement(_dynamicNewReport["default"], {
286
- data: data,
287
- onDeleteFeed: onDeleteFeed,
288
- showCollect: showCollect
289
- });
290
- } else {
291
- return /*#__PURE__*/_react["default"].createElement(_dynamicReport["default"], {
291
+ if (data.newSummary) {
292
+ return /*#__PURE__*/_react["default"].createElement(_dynamicNewReport["default"], _extends({
292
293
  data: data,
293
294
  onDeleteFeed: onDeleteFeed
294
- });
295
+ }, restProps));
295
296
  }
296
297
 
298
+ return /*#__PURE__*/_react["default"].createElement(_dynamicReport["default"], {
299
+ data: data,
300
+ onDeleteFeed: onDeleteFeed
301
+ });
302
+
297
303
  case _constant.EFeedType.Reply:
298
304
  return /*#__PURE__*/_react["default"].createElement(_dynamicReply["default"], {
299
305
  data: data,
@@ -375,7 +381,7 @@ var DynamicItem = function DynamicItem(_ref) {
375
381
 
376
382
  var renderUpvoteCount = function renderUpvoteCount(type, count) {
377
383
  if (count === 0) {
378
- return '';
384
+ return "";
379
385
  }
380
386
 
381
387
  return count || type;
@@ -393,10 +399,10 @@ var DynamicItem = function DynamicItem(_ref) {
393
399
 
394
400
  if (window.util) {
395
401
  if (feedType === _constant.EFeedType.Report && window.titaTracker) {
396
- window.titaTracker('planAction').record({
397
- actionName: '打开打赏弹层',
398
- actionGroup: '动态-日报',
399
- productName: '动态',
402
+ window.titaTracker("planAction").record({
403
+ actionName: "打开打赏弹层",
404
+ actionGroup: "动态-日报",
405
+ productName: "动态",
400
406
  feedId: feedId
401
407
  });
402
408
  }
@@ -410,13 +416,13 @@ var DynamicItem = function DynamicItem(_ref) {
410
416
  var handleReply = function handleReply(_ref2) {
411
417
  var submitType = _ref2.submitType;
412
418
  if (feedType !== _constant.EFeedType.Report) return;
413
- var actionName = submitType === 'delete' ? '删除日报评论' : '评论日报';
419
+ var actionName = submitType === "delete" ? "删除日报评论" : "评论日报";
414
420
 
415
421
  if (window.titaTracker) {
416
- window.titaTracker('planAction').record({
422
+ window.titaTracker("planAction").record({
417
423
  actionName: actionName,
418
- actionGroup: '动态-日报',
419
- productName: '动态',
424
+ actionGroup: "动态-日报",
425
+ productName: "动态",
420
426
  feedId: feedId
421
427
  });
422
428
  }
@@ -444,15 +450,15 @@ var DynamicItem = function DynamicItem(_ref) {
444
450
  className: "".concat(prefix, "__content"),
445
451
  ref: dynamicContentRef,
446
452
  style: {
447
- height: contentIsOverflow && isFold ? '288px' : 'auto'
453
+ height: contentIsOverflow && isFold ? "288px" : "auto"
448
454
  }
449
455
  }, renderContent, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
450
456
  condition: contentIsOverflow && isFold
451
457
  }, /*#__PURE__*/_react["default"].createElement("div", {
452
458
  className: "".concat(prefix, "__content-show-more"),
453
459
  onClick: handleShowMore
454
- }, (0, _getLocale.getLocale)('Tasks_Tab_MyS_Butt_Seemoral'), /*#__PURE__*/_react["default"].createElement("i", {
455
- className: (0, _classnames["default"])('tu-icon-arrow-down', "".concat(prefix, "__icon"))
460
+ }, (0, _getLocale.getLocale)("Tasks_Tab_MyS_Butt_Seemoral"), /*#__PURE__*/_react["default"].createElement("i", {
461
+ className: (0, _classnames["default"])("tu-icon-arrow-down", "".concat(prefix, "__icon"))
456
462
  })))), feedOperations.total > 0 && /*#__PURE__*/_react["default"].createElement(_feedOperate["default"], {
457
463
  feedOperations: feedOperations,
458
464
  data: data
@@ -490,12 +496,12 @@ var DynamicItem = function DynamicItem(_ref) {
490
496
  }, /*#__PURE__*/_react["default"].createElement("div", {
491
497
  className: "".concat(prefix, "__footer-fold"),
492
498
  onClick: handleFold
493
- }, (0, _getLocale.getLocale)('Mod_Fold'), /*#__PURE__*/_react["default"].createElement("i", {
494
- className: (0, _classnames["default"])('tu-icon-arrow-down', "".concat(prefix, "__icon"), "".concat(prefix, "__icon-up"))
499
+ }, (0, _getLocale.getLocale)("Mod_Fold"), /*#__PURE__*/_react["default"].createElement("i", {
500
+ className: (0, _classnames["default"])("tu-icon-arrow-down", "".concat(prefix, "__icon"), "".concat(prefix, "__icon-up"))
495
501
  }))), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
496
502
  condition: hasRewardBtn
497
503
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
498
- overlay: (0, _getLocale.getLocale)('Feed_Approval'),
504
+ overlay: (0, _getLocale.getLocale)("Feed_Approval"),
499
505
  align: {
500
506
  offset: [0, 0]
501
507
  },
@@ -505,7 +511,7 @@ var DynamicItem = function DynamicItem(_ref) {
505
511
  className: (0, _classnames["default"])("".concat(prefix, "__footer-icon"), "".concat(prefix, "__footer-icon-redenvelopes"))
506
512
  }))), /*#__PURE__*/_react["default"].createElement("span", {
507
513
  onClick: handleCommentClick,
508
- className: (0, _classnames["default"])('tu-icon-pinglun-m', "".concat(prefix, "__footer-icon"))
514
+ className: (0, _classnames["default"])("tu-icon-pinglun-m", "".concat(prefix, "__footer-icon"))
509
515
  }, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
510
516
  condition: feedComments.total > 0
511
517
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -78,9 +78,10 @@ function ImportOKRModal(props) {
78
78
  return;
79
79
  }
80
80
 
81
- onOk && onOk(selected);
82
81
  setSelected([]);
82
+ selectedRef.current = [];
83
83
  onCancelHandler();
84
+ onOk && onOk(selected);
84
85
  };
85
86
 
86
87
  var onCancelHandler = function onCancelHandler() {
@@ -70,13 +70,15 @@ function SearchForm(props) {
70
70
  keyWords = _useState6[0],
71
71
  setKeyWords = _useState6[1];
72
72
 
73
- var _useState7 = (0, _react.useState)(0),
73
+ var _useState7 = (0, _react.useState)(1),
74
74
  _useState8 = _slicedToArray(_useState7, 2),
75
75
  relation = _useState8[0],
76
76
  setRelation = _useState8[1];
77
77
 
78
78
  var dilagRef = (0, _react.useRef)(document.createElement('div'));
79
+ var isInitRef = (0, _react.useRef)(true);
79
80
  (0, _react.useEffect)(function () {
81
+ if (isInitRef.current) return;
80
82
  onChange(_objectSpread({
81
83
  status: status,
82
84
  keyWords: keyWords,
@@ -85,6 +87,7 @@ function SearchForm(props) {
85
87
  }, [status, keyWords, cycle, relation]);
86
88
  (0, _react.useEffect)(function () {
87
89
  if (time) {
90
+ isInitRef.current = false;
88
91
  var cycleDate = (0, _helper.getCycleDate)(time);
89
92
  setCycle({
90
93
  annualNum: Number(time.split('/')[0]),
@@ -142,7 +142,7 @@ var planTableTask = function planTableTask(params, pageNum, pageSize) {
142
142
  }
143
143
 
144
144
  if (!relation) {
145
- relation = '1,2,3';
145
+ relation = '1,2';
146
146
  }
147
147
 
148
148
  return (0, _request.rpost)('v2')(url, {
@@ -37,14 +37,18 @@ function Relation(props) {
37
37
  var onChange = props.onChange,
38
38
  initValue = props.initValue;
39
39
 
40
- var _useState = (0, _react.useState)((0, _getLocale.getLocale)("Pro_page_Plan_FullRange")),
40
+ var _useState = (0, _react.useState)((0, _getLocale.getLocale)('OKR_Menu_Title03_Owned')),
41
41
  _useState2 = _slicedToArray(_useState, 2),
42
42
  selectText = _useState2[0],
43
43
  setSelectText = _useState2[1];
44
44
 
45
45
  (0, _react.useEffect)(function () {
46
46
  if (initValue === 0) {
47
- setSelectText((0, _getLocale.getLocale)("Pro_page_Plan_FullRange"));
47
+ setSelectText((0, _getLocale.getLocale)('Pro_page_Plan_FullRange'));
48
+ } else if (initValue === 1) {
49
+ setSelectText((0, _getLocale.getLocale)('OKR_Menu_Title03_Owned'));
50
+ } else if (initValue === 2) {
51
+ setSelectText((0, _getLocale.getLocale)('OKR_Menu_Title_Collaborator'));
48
52
  }
49
53
  }, [initValue]);
50
54
 
@@ -54,13 +58,13 @@ function Relation(props) {
54
58
  };
55
59
 
56
60
  var selectOptions = [{
57
- label: (0, _getLocale.getLocale)("Pro_page_Plan_FullRange"),
61
+ label: (0, _getLocale.getLocale)('Pro_page_Plan_FullRange'),
58
62
  value: 0
59
63
  }, {
60
- label: (0, _getLocale.getLocale)("OKR_Menu_Title03_Owned"),
64
+ label: (0, _getLocale.getLocale)('OKR_Menu_Title03_Owned'),
61
65
  value: 1
62
66
  }, {
63
- label: (0, _getLocale.getLocale)("OKR_Menu_Title_Collaborator"),
67
+ label: (0, _getLocale.getLocale)('OKR_Menu_Title_Collaborator'),
64
68
  value: 2
65
69
  }];
66
70
  return /*#__PURE__*/_react["default"].createElement(_selectLayer["default"], {