@titaui/pc 1.11.14 → 1.11.17

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 (29) hide show
  1. package/.husky/pre-commit +2 -2
  2. package/lib/components/change-okr-modal/Item.js +1 -1
  3. package/lib/components/dynamic/constant.js +4 -2
  4. package/lib/components/dynamic/dynamic-item/index.js +14 -2
  5. package/lib/components/dynamic/dynamic-list/index.js +1 -9
  6. package/lib/components/icon-button-list/index.css +2 -57
  7. package/lib/components/icon-button-list/index.js +8 -5
  8. package/lib/components/okr-flow/child-node/index.css +60 -15
  9. package/lib/components/okr-flow/child-node/work-node.js +43 -6
  10. package/lib/components/okr-flow/empty/index.css +8 -1
  11. package/lib/components/okr-flow/export-modal/index.js +26 -2
  12. package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
  13. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +16 -10
  14. package/lib/components/okr-flow/images/loading-light.gif +0 -0
  15. package/lib/components/okr-flow/okr-map/index.js +41 -20
  16. package/lib/components/okr-flow/request-apis.js +11 -4
  17. package/lib/components/okr-flow/root-node/index.css +2 -2
  18. package/lib/components/okr-flow/root-node/index.js +1 -1
  19. package/lib/components/okr-flow/utils/index.js +43 -26
  20. package/lib/components/okr-flow/utils/tree-handler.js +14 -3
  21. package/lib/components/okrcase-library/index.css +6 -4
  22. package/lib/components/period-selector/index.js +3 -0
  23. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +6 -1
  24. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +60 -21
  25. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +41 -18
  26. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +10 -5
  27. package/lib/pages/okr-map/number-select/index.css +4 -1
  28. package/lib/pages/okr-map/number-select/index.js +1 -1
  29. package/package.json +1 -1
package/.husky/pre-commit CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  . "$(dirname "$0")/_/husky.sh"
3
- #
4
- npm run lint-staged
3
+
4
+ npm run lint-staged
@@ -166,7 +166,7 @@ var Item = /*#__PURE__*/function (_PureComponent) {
166
166
  return (0, _constant2.getMonth)()[data.yqmnum - 1];
167
167
 
168
168
  case 4:
169
- return "".concat((0, _constant2.getMonth)()[data.yqmnum - 1], "-").concat((0, _constant2.getMonth)()[((data.yqmnum + 1) % 12 || 12) - 1], "\u6708");
169
+ return "".concat((0, _constant2.getMonth)()[data.yqmnum - 1], "-").concat((0, _constant2.getMonth)()[((data.yqmnum + 1) % 12 || 12) - 1]);
170
170
 
171
171
  case 5:
172
172
  return data.yqmnum === 1 ? (0, _getLocale.getLocale)("OKR_MyO_Pop_Firsthalf") : (0, _getLocale.getLocale)("OKR_MyO_Pop_Secondhalf");
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getObjTypeMapText = exports.OkrRiskMapping = exports.ObjectType = exports.EStatusStatus2ClassType = exports.EShareType = exports.EObjType = exports.EFeedType = void 0;
6
+ exports.getObjTypeMapText = exports.PlanReportType = exports.OkrRiskMapping = exports.ObjectType = exports.EStatusStatus2ClassType = exports.EShareType = exports.EObjType = exports.EFeedType = void 0;
7
7
 
8
8
  var _getLocale = require("../../utils/getLocale");
9
9
 
@@ -117,4 +117,6 @@ var EStatusStatus2ClassType = {
117
117
  0: "tu-icon-notstart",
118
118
  5: "tu-icon-jiantou-right"
119
119
  };
120
- exports.EStatusStatus2ClassType = EStatusStatus2ClassType;
120
+ exports.EStatusStatus2ClassType = EStatusStatus2ClassType;
121
+ var PlanReportType = ["titaPlanReport"];
122
+ exports.PlanReportType = PlanReportType;
@@ -39,6 +39,8 @@ var _dynamicProgress = _interopRequireDefault(require("./dynamic-progress"));
39
39
 
40
40
  var _dynamicCreateO = _interopRequireDefault(require("./dynamic-create-o"));
41
41
 
42
+ var _dynamicAiDialy = _interopRequireDefault(require("./dynamic-ai-dialy"));
43
+
42
44
  var _dynamicTask = _interopRequireDefault(require("./dynamic-task"));
43
45
 
44
46
  var _dynamicProject = _interopRequireDefault(require("./dynamic-project"));
@@ -104,7 +106,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
104
106
  var prefix = "titaui-dynamic-item";
105
107
 
106
108
  var DynamicItem = function DynamicItem(_ref) {
107
- var _getBSGlobal;
109
+ var _getBSGlobal, _JSON$parse;
108
110
 
109
111
  var data = _ref.data,
110
112
  onDeleteFeed = _ref.onDeleteFeed,
@@ -154,6 +156,10 @@ var DynamicItem = function DynamicItem(_ref) {
154
156
  var hasRewardBtn = !!((_getBSGlobal = (0, _bsGlobal.getBSGlobal)("WebHead")) !== null && _getBSGlobal !== void 0 && _getBSGlobal.AppHead.find(function (item) {
155
157
  return item.AppId === "950";
156
158
  }));
159
+ var isBiShare = data.shareType === _constant.EShareType.BiShare && data.biId;
160
+
161
+ var isFeedReport = isBiShare && _constant.PlanReportType.includes((_JSON$parse = JSON.parse(data.biId)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.type);
162
+
157
163
  var dynamicContentRef = (0, _react.useRef)();
158
164
  var communicationRef = (0, _react.useRef)();
159
165
 
@@ -393,6 +399,12 @@ var DynamicItem = function DynamicItem(_ref) {
393
399
  }, [feedComments]);
394
400
  return /*#__PURE__*/_react["default"].createElement("div", {
395
401
  className: prefix
402
+ }, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
403
+ condition: isFeedReport
404
+ }, /*#__PURE__*/_react["default"].createElement(_dynamicAiDialy["default"], {
405
+ data: data
406
+ })), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
407
+ condition: !isFeedReport
396
408
  }, /*#__PURE__*/_react["default"].createElement("div", {
397
409
  className: "".concat(prefix, "__content"),
398
410
  ref: dynamicContentRef,
@@ -496,7 +508,7 @@ var DynamicItem = function DynamicItem(_ref) {
496
508
  onReplyChange: handleReply,
497
509
  showUser: true,
498
510
  showDefaultInput: true
499
- }))));
511
+ })))));
500
512
  };
501
513
 
502
514
  var _default = DynamicItem;
@@ -11,8 +11,6 @@ var _rcQueueAnim = _interopRequireDefault(require("rc-queue-anim"));
11
11
 
12
12
  var _dynamicItem = _interopRequireDefault(require("../dynamic-item"));
13
13
 
14
- var _dynamicAiDialy = _interopRequireDefault(require("../dynamic-item/dynamic-ai-dialy"));
15
-
16
14
  var _dynamicEmpty = _interopRequireDefault(require("../img/dynamic-empty.png"));
17
15
 
18
16
  var _conditionRender = _interopRequireDefault(require("../../condition-render"));
@@ -21,8 +19,6 @@ var _getLocale = require("../../../utils/getLocale");
21
19
 
22
20
  require("./index.css");
23
21
 
24
- var _constant = require("../constant");
25
-
26
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
23
 
28
24
  // @ts-ignore
@@ -68,14 +64,10 @@ var DynamicList = function DynamicList(_ref) {
68
64
  display: "none"
69
65
  }]
70
66
  }, data.map(function (item) {
71
- var _JSON$parse;
72
-
73
67
  return /*#__PURE__*/_react["default"].createElement("div", {
74
68
  className: "".concat(prefix, "__item-wrapper"),
75
69
  key: item.feedId
76
- }, item.shareType === _constant.EShareType.BiShare && item.biId && ((_JSON$parse = JSON.parse(item.biId)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.type) === "titaPlanReport" ? /*#__PURE__*/_react["default"].createElement(_dynamicAiDialy["default"], {
77
- data: item
78
- }) : /*#__PURE__*/_react["default"].createElement(_dynamicItem["default"], {
70
+ }, /*#__PURE__*/_react["default"].createElement(_dynamicItem["default"], {
79
71
  data: item,
80
72
  onDeleteFeed: handleDeleteFeed,
81
73
  dynamicShareIsShowToping: dynamicShareIsShowToping
@@ -16,7 +16,7 @@
16
16
  height: 30px;
17
17
  margin-left: 10px;
18
18
  border: 1px solid #e6eaef;
19
- border-radius: 4px;
19
+ border-radius: 50%;
20
20
  box-sizing: border-box;
21
21
  cursor: pointer;
22
22
  }
@@ -33,63 +33,8 @@
33
33
  border-color: #2879ff;
34
34
  }
35
35
 
36
- .titaui-icon-button-list__btn:hover .titaui-icon-button-list__btn-icon--export {
37
- background-position: 0 -287px;
38
- }
39
-
40
- .titaui-icon-button-list__btn:hover .titaui-icon-button-list__btn-icon--share {
41
- background-position: 0 -26px;
42
- }
43
-
44
- .titaui-icon-button-list__btn:hover .titaui-icon-button-list__btn-icon--fullscreen {
45
- background-position: 0 -78px;
46
- }
47
-
48
- .titaui-icon-button-list__btn:hover .titaui-icon-button-list__btn-icon--quit-fullscreen {
49
- background-position: 0 -130px;
50
- }
51
-
52
- .titaui-icon-button-list__btn:hover .titaui-icon-button-list__btn-icon--horizontal {
53
- background-position: 0 -182px;
54
- }
55
-
56
- .titaui-icon-button-list__btn:hover .titaui-icon-button-list__btn-icon--vertical {
57
- background-position: 0 -234px;
58
- }
59
-
60
36
  .titaui-icon-button-list__btn-icon {
61
37
  display: inline-block;
62
38
  box-sizing: border-box;
63
- }
64
-
65
- .titaui-icon-button-list__btn-icon--base {
66
- width: 16px;
67
- height: 16px;
68
- background: url("./images/icons-2.png") no-repeat;
69
- background-size: cover;
70
- }
71
-
72
- .titaui-icon-button-list__btn-icon--export {
73
- background-position: 0 -261px;
74
- }
75
-
76
- .titaui-icon-button-list__btn-icon--share {
77
- background-position: 0 0;
78
- }
79
-
80
- .titaui-icon-button-list__btn-icon--fullscreen {
81
- background-position: 0 -52px;
82
- }
83
-
84
- .titaui-icon-button-list__btn-icon--quit-fullscreen {
85
- background-position: 0 -104px;
86
- }
87
-
88
- .titaui-icon-button-list__btn-icon--horizontal {
89
- background-position: 0 -156px;
90
- }
91
-
92
- .titaui-icon-button-list__btn-icon--vertical {
93
- height: 17px;
94
- background-position: 0 -208px;
39
+ font-size: 16px;
95
40
  }
@@ -32,22 +32,25 @@ function _default(props) {
32
32
  }, /*#__PURE__*/_react["default"].createElement("div", {
33
33
  className: (0, _classnames["default"])("".concat(preCls, "__inner"))
34
34
  }, items.map(function (it) {
35
- var _classNames;
36
-
37
35
  var icon = it.icon,
36
+ type = it.type,
38
37
  overlay = it.overlay,
39
38
  _it$placement = it.placement,
40
39
  placement = _it$placement === void 0 ? "top" : _it$placement,
41
40
  _it$trigger = it.trigger,
42
- trigger = _it$trigger === void 0 ? ["hover"] : _it$trigger;
41
+ trigger = _it$trigger === void 0 ? ["hover"] : _it$trigger,
42
+ rotate = it.rotate;
43
43
 
44
44
  var content = /*#__PURE__*/_react["default"].createElement("span", {
45
45
  className: (0, _classnames["default"])("".concat(preCls, "__btn")),
46
46
  onClick: function onClick(e) {
47
- return _onClick(e, icon);
47
+ return _onClick(e, type);
48
48
  }
49
49
  }, /*#__PURE__*/_react["default"].createElement("span", {
50
- className: (0, _classnames["default"])("".concat(preCls, "__btn-icon"), (_classNames = {}, _defineProperty(_classNames, "".concat(preCls, "__btn-icon--base"), true), _defineProperty(_classNames, "".concat(preCls, "__btn-icon--").concat(icon), true), _classNames))
50
+ className: (0, _classnames["default"])("".concat(preCls, "__btn-icon"), _defineProperty({}, "tu-icon-".concat(icon), true)),
51
+ style: rotate ? {
52
+ transform: "rotate(".concat(rotate, "deg)")
53
+ } : {}
51
54
  }));
52
55
 
53
56
  if (overlay) {
@@ -36,16 +36,17 @@
36
36
 
37
37
  .titaui-okr-flow--node {
38
38
  position: relative;
39
- padding: 10px 12px;
40
- width: 320px;
41
- height: 96px;
39
+ padding: 12px 12px;
40
+ width: 340px;
42
41
  background: #ffffff;
43
42
  box-shadow: 0px 4px 10px 0px rgba(127, 145, 180, 0.1);
44
- border-radius: 6px;
43
+ border-radius: 12px;
45
44
  box-sizing: border-box;
46
45
  }
47
46
 
48
47
  .titaui-okr-flow--node__private {
48
+ width: 340px;
49
+ height: 102px;
49
50
  background: url(../images/private-light.png) no-repeat;
50
51
  background-size: contain;
51
52
  }
@@ -75,25 +76,68 @@
75
76
  white-space: unset;
76
77
  }
77
78
 
79
+ .titaui-okr-flow--node-krs {
80
+ margin-top: 12px;
81
+ }
82
+
83
+ .titaui-okr-flow--node-kr {
84
+ cursor: pointer;
85
+ display: flex;
86
+ line-height: 20px;
87
+ font-size: 12px;
88
+ margin-top: 8px;
89
+ }
90
+
91
+ .titaui-okr-flow--node-kr-icon {
92
+ color: rgba(40, 121, 255, 0.6);
93
+ margin-right: 8px;
94
+ }
95
+
96
+ .titaui-okr-flow--node-kr-title {
97
+ flex: 1;
98
+ font-size: 13px;
99
+ font-weight: 400;
100
+ color: #3F4755;
101
+ }
102
+
103
+ .titaui-okr-flow--node-kr-progress {
104
+ width: 32px;
105
+ text-align: right;
106
+ margin-left: 8px;
107
+ white-space: nowrap;
108
+ }
109
+
110
+ .titaui-okr-flow--node-kr-status--normal {
111
+ color: #2879ff;
112
+ }
113
+
114
+ .titaui-okr-flow--node-kr-status--risk {
115
+ color: #f6bd16;
116
+ }
117
+
118
+ .titaui-okr-flow--node-kr-status--expired {
119
+ color: #f05e5e;
120
+ }
121
+
122
+ .titaui-okr-flow--node-kr-status--complete {
123
+ color: #5ad8a6;
124
+ }
125
+
78
126
  .titaui-okr-flow--node-title {
79
127
  max-width: 252px;
80
- height: 44px;
81
128
  margin-right: 54px;
82
- margin-bottom: 8px;
83
- line-height: 22px;
129
+ margin-bottom: 4px;
130
+ line-height: 24px;
84
131
  color: #141c28;
85
132
  font-size: 14px;
86
- overflow: hidden;
87
- text-overflow: ellipsis;
88
- display: -webkit-box;
89
- text-overflow: ellipsis;
90
- -webkit-box-orient: vertical;
91
- -webkit-line-clamp: 2;
133
+ font-weight: 600;
134
+ cursor: pointer;
92
135
  }
93
136
 
94
137
  .titaui-okr-flow--node-desp {
95
138
  font-family: PingFangSC-Regular, PingFang SC;
96
139
  position: relative;
140
+ cursor: pointer;
97
141
  }
98
142
 
99
143
  .titaui-okr-flow--node-right {
@@ -118,7 +162,7 @@
118
162
  overflow: hidden;
119
163
  text-overflow: ellipsis;
120
164
  white-space: nowrap;
121
- line-height: 24px;
165
+ line-height: 20px;
122
166
  max-width: 96px;
123
167
  }
124
168
 
@@ -291,12 +335,13 @@
291
335
  }
292
336
 
293
337
  .titaui-okr-flow--node-status {
338
+ cursor: pointer;
294
339
  position: absolute;
295
340
  right: 0;
296
341
  top: 0;
297
342
  width: 50px;
298
343
  height: 32px;
299
- border-radius: 0 6px 0 20px;
344
+ border-radius: 0 12px 0 20px;
300
345
  font-size: 13px;
301
346
  text-align: center;
302
347
  line-height: 32px;
@@ -31,6 +31,10 @@ var _bsGlobal = require("../../../utils/bs-global");
31
31
 
32
32
  var _getLocale = require("../../../utils/getLocale");
33
33
 
34
+ var _tools = require("../../../utils/tools");
35
+
36
+ var _drawerManager = _interopRequireDefault(require("../../../components/drawer-manager"));
37
+
34
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
39
 
36
40
  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); }
@@ -71,6 +75,7 @@ function WorkNode(_ref) {
71
75
  manualRiskLevel = data.manualRiskLevel,
72
76
  progress = data.progress,
73
77
  okrClassify = data.okrClassify,
78
+ Krs = data.Krs,
74
79
  cycleType = data.cycleType,
75
80
  startDate = data.startDate,
76
81
  endDate = data.endDate,
@@ -92,6 +97,8 @@ function WorkNode(_ref) {
92
97
  imgWidth = _useState6[0],
93
98
  setImgWidth = _useState6[1];
94
99
 
100
+ var bodyr = (0, _react.useRef)();
101
+
95
102
  var getOkrTypeMap = function getOkrTypeMap() {
96
103
  return {
97
104
  1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
@@ -176,6 +183,18 @@ function WorkNode(_ref) {
176
183
  }
177
184
  }, []);
178
185
 
186
+ var openODetail = function openODetail(id) {
187
+ _drawerManager["default"].open("okrDetail", {
188
+ okrId: workId
189
+ });
190
+ };
191
+
192
+ var openKr = function openKr(id) {
193
+ _drawerManager["default"].open("krDetail", {
194
+ krId: id
195
+ });
196
+ };
197
+
179
198
  var getCycleTextByType = function getCycleTextByType() {
180
199
  var cycleType = data.cycleType,
181
200
  yqmnum = data.yqmnum,
@@ -210,18 +229,21 @@ function WorkNode(_ref) {
210
229
  }; // 1:正常 2:有风险 3:过期 4:完成 5:过期完成 ,
211
230
 
212
231
 
213
- var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over"];
232
+ var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over", "normal"];
214
233
  if (!MapOkrVisible) return /*#__PURE__*/_react["default"].createElement("div", {
215
234
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), "".concat(_precls["default"], "--node__private"))
216
235
  });
217
236
  return /*#__PURE__*/_react["default"].createElement("div", {
218
- className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes))
237
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes)),
238
+ ref: bodyr
219
239
  }, /*#__PURE__*/_react["default"].createElement("div", {
220
- className: (0, _classnames["default"])("".concat(_precls["default"], "--node-title"))
221
- }, workName, /*#__PURE__*/_react["default"].createElement(_okrClassify["default"], {
240
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-title")),
241
+ onClick: openODetail
242
+ }, (0, _tools.htmlDecodeByRegExp)(workName), /*#__PURE__*/_react["default"].createElement(_okrClassify["default"], {
222
243
  classify: okrClassify
223
244
  })), /*#__PURE__*/_react["default"].createElement("div", {
224
- className: (0, _classnames["default"])("".concat(_precls["default"], "--node-desp"))
245
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-desp")),
246
+ onClick: openODetail
225
247
  }, /*#__PURE__*/_react["default"].createElement(_creator["default"], {
226
248
  creator: principalUser || {}
227
249
  }), /*#__PURE__*/_react["default"].createElement("div", {
@@ -230,7 +252,22 @@ function WorkNode(_ref) {
230
252
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-type"))
231
253
  }, getOkrTypeMap()[okrType])), /*#__PURE__*/_react["default"].createElement("span", {
232
254
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-cycle"))
233
- }, getCycleTextByType()))), /*#__PURE__*/_react["default"].createElement("span", {
255
+ }, getCycleTextByType()))), !!(Krs !== null && Krs !== void 0 && Krs.length) && /*#__PURE__*/_react["default"].createElement("div", {
256
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-krs"))
257
+ }, Krs.map(function (item, key) {
258
+ return /*#__PURE__*/_react["default"].createElement("div", {
259
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr")),
260
+ onClick: function onClick() {
261
+ return openKr(item.mileStoneId);
262
+ }
263
+ }, /*#__PURE__*/_react["default"].createElement("span", {
264
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-icon"))
265
+ }, "KR", item.SortNum + 1), /*#__PURE__*/_react["default"].createElement("div", {
266
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-title"))
267
+ }, item.mileStoneName), /*#__PURE__*/_react["default"].createElement("div", {
268
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-progress ").concat(_precls["default"], "--node-kr-status--").concat(riskLevelSuffix[item.riskLevel]))
269
+ }, item.progress, "%"));
270
+ })), /*#__PURE__*/_react["default"].createElement("span", {
234
271
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-status"), "".concat(_precls["default"], "--node-status__").concat(riskLevelSuffix[manualRiskLevel]))
235
272
  }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
236
273
  text: "".concat(progress, "%"),
@@ -1,5 +1,12 @@
1
1
  .titaui-okr-flow--empty {
2
- padding-top: 125px;
2
+ width: 200px;
3
+ height: 200px;
4
+ position: absolute;
5
+ left: 0;
6
+ right: 0;
7
+ top: 0;
8
+ bottom: 0;
9
+ margin: auto;
3
10
  text-align: center;
4
11
  }
5
12
 
@@ -33,6 +33,8 @@ var _precls = _interopRequireDefault(require("../precls"));
33
33
 
34
34
  var _getLocale = require("../../../utils/getLocale");
35
35
 
36
+ var _lodash = _interopRequireDefault(require("lodash"));
37
+
36
38
  require("rc-color-picker/assets/index.css");
37
39
 
38
40
  require("./index.css");
@@ -45,6 +47,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
45
47
 
46
48
  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; }
47
49
 
50
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
51
+
52
+ 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."); }
53
+
54
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
55
+
56
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
57
+
48
58
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
49
59
 
50
60
  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); }); }; }
@@ -88,6 +98,7 @@ var ExportMapModal = function ExportMapModal(props) {
88
98
  setIsExport = _useState6[1];
89
99
 
90
100
  var modalRef = (0, _react.useRef)();
101
+ var virtualElements = (0, _react.useRef)([]);
91
102
  (0, _react.useEffect)(function () {
92
103
  if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
93
104
  if (window.WWOpenData.enableCanvasSharing) {
@@ -236,6 +247,19 @@ var ExportMapModal = function ExportMapModal(props) {
236
247
  setBgColor(colors ? colors.color : "none");
237
248
  };
238
249
 
250
+ var NodeDebug = function NodeDebug() {
251
+ var elements = (0, _reactFlowRenderer.useStoreState)(function (state) {
252
+ return [].concat(_toConsumableArray(state.nodes), _toConsumableArray(state.edges));
253
+ }, _lodash["default"].isEqual);
254
+ var setElements = (0, _reactFlowRenderer.useStoreActions)(function (actions) {
255
+ return actions.setElements;
256
+ });
257
+ var newElements = (0, _utils.getLayoutedElements)(elements, direction);
258
+ virtualElements = newElements;
259
+ setElements(newElements);
260
+ return null;
261
+ };
262
+
239
263
  return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
240
264
  title: (0, _getLocale.getLocale)("OKR_Ali_Exportmap"),
241
265
  noFooterLine: true,
@@ -275,7 +299,7 @@ var ExportMapModal = function ExportMapModal(props) {
275
299
  nodesDraggable: false,
276
300
  nodesConnectable: false,
277
301
  className: (0, _classnames["default"])("".concat(_precls["default"], "__export"), _defineProperty({}, "".concat(_precls["default"], "__dark"), darkTheme)),
278
- elements: (0, _utils.getLayoutedElements)(dataSource, direction),
302
+ elements: dataSource,
279
303
  nodeTypes: _utils.nodeTypes,
280
304
  minZoom: 0.05,
281
305
  zoomOnScroll: false,
@@ -287,7 +311,7 @@ var ExportMapModal = function ExportMapModal(props) {
287
311
  width: "100%",
288
312
  background: bgColor
289
313
  }
290
- }))))));
314
+ }, /*#__PURE__*/_react["default"].createElement(NodeDebug, null)))))));
291
315
  };
292
316
 
293
317
  ExportMapModal.defaultProps = {
@@ -4,12 +4,14 @@
4
4
  display: flex;
5
5
  justify-content: center;
6
6
  align-items: center;
7
+ background: #f0f4fa;
7
8
  }
8
9
 
9
10
  .titaui-okr-flow--loading-img {
10
- width: 162px;
11
+ width: 80px;
11
12
  height: 140px;
12
13
  background: url("../../images/loading-light.gif") no-repeat;
14
+ background-size: 100% auto;
13
15
  }
14
16
 
15
17
  .titaui-okr-flow--loading-img__dark {
@@ -87,6 +87,8 @@ function OkrSearchPanel(props, ref) {
87
87
  showkr = _props$showkr === void 0 ? true : _props$showkr,
88
88
  _props$darkTheme = props.darkTheme,
89
89
  darkTheme = _props$darkTheme === void 0 ? false : _props$darkTheme,
90
+ _props$showCardKr = props.showCardKr,
91
+ showCardKr = _props$showCardKr === void 0 ? false : _props$showCardKr,
90
92
  onNodeClick = props.onNodeClick;
91
93
 
92
94
  var _useState = (0, _react.useState)(true),
@@ -111,7 +113,7 @@ function OkrSearchPanel(props, ref) {
111
113
 
112
114
 
113
115
  var getSearchData = (0, _react.useRef)((0, _helper.debounce)( /*#__PURE__*/function () {
114
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr) {
116
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr) {
115
117
  var _yield$searchOkrs, works, okrIds, nodes, allNodes, subTreeNodes;
116
118
 
117
119
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -155,7 +157,8 @@ function OkrSearchPanel(props, ref) {
155
157
  return (0, _requestApis.expandNodesByLevel)({
156
158
  okrIds: okrIds,
157
159
  level: openLevel - 1,
158
- showKr: showkr ? 0 : 1
160
+ showKr: showkr ? 1 : 0,
161
+ showCardKr: showCardKr ? 1 : 0
159
162
  });
160
163
 
161
164
  case 13:
@@ -173,7 +176,8 @@ function OkrSearchPanel(props, ref) {
173
176
  avatar: {
174
177
  hasAvatar: avatar.HasAvatar || avatar.hasAvatar,
175
178
  color: avatar.Color || avatar.color,
176
- small: avatar.Small || avatar.small
179
+ small: avatar.Small || avatar.small,
180
+ big: avatar.Original || avatar.original || avatar.large || avatar.big || avatar.Large
177
181
  }
178
182
  }, "searchType", searchType),
179
183
  children: subTreeNodes
@@ -188,19 +192,19 @@ function OkrSearchPanel(props, ref) {
188
192
  }, _callee);
189
193
  }));
190
194
 
191
- return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10) {
195
+ return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11) {
192
196
  return _ref.apply(this, arguments);
193
197
  };
194
198
  }(), 500)).current;
195
199
  var okrFlow = (0, _react.useRef)();
196
200
  (0, _react.useEffect)(function () {
197
201
  if (!annualNum) return;
198
- getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr);
199
- }, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr]);
202
+ getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr);
203
+ }, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr]);
200
204
  (0, _react.useEffect)(function () {
201
205
  var data = (0, _treeHandler.transToMapData)(treeNodes, showkr);
202
206
  setDataSource(data.length > 1 ? data : []);
203
- }, [treeNodes, showkr]);
207
+ }, [treeNodes, showkr, showCardKr]);
204
208
 
205
209
  var handleParentExpand = /*#__PURE__*/function () {
206
210
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(node) {
@@ -216,7 +220,8 @@ function OkrSearchPanel(props, ref) {
216
220
  krId: modelType == "kr" ? id : 0,
217
221
  okrId: modelType == "kr" ? data.workId : id,
218
222
  okrIdParent: modelType == "work" ? data.parentId : data.workId,
219
- childRoot: false
223
+ childRoot: false,
224
+ showCardKr: showCardKr ? 1 : 0
220
225
  });
221
226
 
222
227
  case 3:
@@ -249,7 +254,7 @@ function OkrSearchPanel(props, ref) {
249
254
  }, _callee2);
250
255
  }));
251
256
 
252
- return function handleParentExpand(_x11) {
257
+ return function handleParentExpand(_x12) {
253
258
  return _ref2.apply(this, arguments);
254
259
  };
255
260
  }();
@@ -268,6 +273,7 @@ function OkrSearchPanel(props, ref) {
268
273
  okrId: modelType == "work" ? id : data.workId,
269
274
  okrIdParent: 0,
270
275
  childRoot: true,
276
+ showCardKr: showCardKr ? 1 : 0,
271
277
  currentOkrRole: modelType == "kr" ? data.mapkrVisible : data.MapOkrVisible
272
278
  });
273
279
 
@@ -294,7 +300,7 @@ function OkrSearchPanel(props, ref) {
294
300
  }, _callee3);
295
301
  }));
296
302
 
297
- return function handleChildExpand(_x12) {
303
+ return function handleChildExpand(_x13) {
298
304
  return _ref3.apply(this, arguments);
299
305
  };
300
306
  }();