@titaui/pc 1.11.13 → 1.11.14-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.husky/pre-commit +2 -2
  2. package/lib/components/dynamic/constant.js +4 -2
  3. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +1 -1
  4. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +1 -1
  5. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +1 -1
  6. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +1 -1
  7. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +1 -1
  8. package/lib/components/dynamic/dynamic-item/index.js +14 -2
  9. package/lib/components/dynamic/dynamic-list/index.js +1 -9
  10. package/lib/components/icon-button-list/index.css +2 -57
  11. package/lib/components/icon-button-list/index.js +8 -5
  12. package/lib/components/okr-flow/child-node/index.css +56 -15
  13. package/lib/components/okr-flow/child-node/work-node.js +22 -4
  14. package/lib/components/okr-flow/empty/index.css +8 -1
  15. package/lib/components/okr-flow/export-modal/index.js +26 -2
  16. package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
  17. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +14 -9
  18. package/lib/components/okr-flow/images/loading-light.gif +0 -0
  19. package/lib/components/okr-flow/okr-map/index.js +32 -14
  20. package/lib/components/okr-flow/request-apis.js +11 -4
  21. package/lib/components/okr-flow/root-node/index.css +2 -2
  22. package/lib/components/okr-flow/utils/index.js +43 -26
  23. package/lib/components/okr-flow/utils/tree-handler.js +14 -3
  24. package/lib/components/okrcase-library/index.css +6 -4
  25. package/lib/components/period-selector/index.js +3 -0
  26. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +6 -1
  27. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +60 -21
  28. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +27 -17
  29. package/lib/pages/okr-map/number-select/index.css +4 -1
  30. package/lib/pages/okr-map/number-select/index.js +1 -1
  31. 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
@@ -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;
@@ -75,7 +75,7 @@ var DynamicKr = function DynamicKr(_ref) {
75
75
  className: "".concat(prefix, "__object-name"),
76
76
  onClick: handleClickOTitle
77
77
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
78
- text: data.obj.objName,
78
+ text: (0, _tools.htmlDecodeByRegExp)(data.obj.objName),
79
79
  isPercent: true
80
80
  })), (0, _getLocale.getLocale)("Mod_skeyresults")));
81
81
  }, []);
@@ -96,7 +96,7 @@ var DynamicMilestone = function DynamicMilestone(_ref) {
96
96
  className: "".concat(prefix, "__object-name"),
97
97
  onClick: handleClickTitle
98
98
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
99
- text: obj.objName,
99
+ text: (0, _tools.htmlDecodeByRegExp)(obj.objName),
100
100
  isPercent: true
101
101
  })), (0, _getLocale.getLocale)("Mod_smilestone")));
102
102
  }, []);
@@ -109,7 +109,7 @@ var DynamicProgress = function DynamicProgress(_ref) {
109
109
  onClick: handleClickOTitle
110
110
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
111
111
  text: /*#__PURE__*/_react["default"].createElement(_searchKeyHandle["default"], {
112
- str: relationParentName,
112
+ str: (0, _tools.htmlDecodeByRegExp)(relationParentName),
113
113
  keyWord: searchKeyWord
114
114
  }),
115
115
  isPercent: true
@@ -95,7 +95,7 @@ var DynamicReply = function DynamicReply(_ref) {
95
95
  className: "".concat(prefix, "__object-name"),
96
96
  onClick: handleClickOTitle
97
97
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
98
- text: data.obj.objName,
98
+ text: (0, _tools.htmlDecodeByRegExp)(data.obj.objName),
99
99
  isPercent: true
100
100
  })), "\u4E0B\u5173\u952E\u6210\u679C\u7684\u590D\u76D8");
101
101
  }
@@ -118,7 +118,7 @@ var DynamicTask = function DynamicTask(_ref) {
118
118
  className: "".concat(prefix, "__object-name"),
119
119
  onClick: handleClickTitle
120
120
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"].Text, {
121
- text: obj.objName,
121
+ text: (0, _mblog.htmlDecodeByRegExp)(obj.objName),
122
122
  isPercent: true
123
123
  })), (0, _getLocale.getLocale)("Mod_stask"));
124
124
  }
@@ -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,20 +76,60 @@
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
+ display: flex;
85
+ line-height: 20px;
86
+ font-size: 12px;
87
+ margin-top: 8px;
88
+ }
89
+
90
+ .titaui-okr-flow--node-kr-icon {
91
+ color: rgba(40, 121, 255, 0.6);
92
+ margin-right: 8px;
93
+ }
94
+
95
+ .titaui-okr-flow--node-kr-title {
96
+ flex: 1;
97
+ font-size: 13px;
98
+ font-weight: 400;
99
+ color: #3F4755;
100
+ }
101
+
102
+ .titaui-okr-flow--node-kr-progress {
103
+ width: 32px;
104
+ text-align: right;
105
+ margin-left: 8px;
106
+ white-space: nowrap;
107
+ }
108
+
109
+ .titaui-okr-flow--node-kr-status--normal {
110
+ color: #2879ff;
111
+ }
112
+
113
+ .titaui-okr-flow--node-kr-status--risk {
114
+ color: #f6bd16;
115
+ }
116
+
117
+ .titaui-okr-flow--node-kr-status--expired {
118
+ color: #f05e5e;
119
+ }
120
+
121
+ .titaui-okr-flow--node-kr-status--complete {
122
+ color: #5ad8a6;
123
+ }
124
+
78
125
  .titaui-okr-flow--node-title {
79
126
  max-width: 252px;
80
- height: 44px;
81
127
  margin-right: 54px;
82
- margin-bottom: 8px;
83
- line-height: 22px;
128
+ margin-bottom: 4px;
129
+ line-height: 24px;
84
130
  color: #141c28;
85
131
  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;
132
+ font-weight: 600;
92
133
  }
93
134
 
94
135
  .titaui-okr-flow--node-desp {
@@ -118,7 +159,7 @@
118
159
  overflow: hidden;
119
160
  text-overflow: ellipsis;
120
161
  white-space: nowrap;
121
- line-height: 24px;
162
+ line-height: 20px;
122
163
  max-width: 96px;
123
164
  }
124
165
 
@@ -296,7 +337,7 @@
296
337
  top: 0;
297
338
  width: 50px;
298
339
  height: 32px;
299
- border-radius: 0 6px 0 20px;
340
+ border-radius: 0 12px 0 20px;
300
341
  font-size: 13px;
301
342
  text-align: center;
302
343
  line-height: 32px;
@@ -31,6 +31,8 @@ var _bsGlobal = require("../../../utils/bs-global");
31
31
 
32
32
  var _getLocale = require("../../../utils/getLocale");
33
33
 
34
+ var _tools = require("../../../utils/tools");
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
37
 
36
38
  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 +73,7 @@ function WorkNode(_ref) {
71
73
  manualRiskLevel = data.manualRiskLevel,
72
74
  progress = data.progress,
73
75
  okrClassify = data.okrClassify,
76
+ Krs = data.Krs,
74
77
  cycleType = data.cycleType,
75
78
  startDate = data.startDate,
76
79
  endDate = data.endDate,
@@ -92,6 +95,8 @@ function WorkNode(_ref) {
92
95
  imgWidth = _useState6[0],
93
96
  setImgWidth = _useState6[1];
94
97
 
98
+ var bodyr = (0, _react.useRef)();
99
+
95
100
  var getOkrTypeMap = function getOkrTypeMap() {
96
101
  return {
97
102
  1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
@@ -210,15 +215,16 @@ function WorkNode(_ref) {
210
215
  }; // 1:正常 2:有风险 3:过期 4:完成 5:过期完成 ,
211
216
 
212
217
 
213
- var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over"];
218
+ var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over", "normal"];
214
219
  if (!MapOkrVisible) return /*#__PURE__*/_react["default"].createElement("div", {
215
220
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), "".concat(_precls["default"], "--node__private"))
216
221
  });
217
222
  return /*#__PURE__*/_react["default"].createElement("div", {
218
- className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes))
223
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes)),
224
+ ref: bodyr
219
225
  }, /*#__PURE__*/_react["default"].createElement("div", {
220
226
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-title"))
221
- }, workName, /*#__PURE__*/_react["default"].createElement(_okrClassify["default"], {
227
+ }, (0, _tools.htmlDecodeByRegExp)(workName), /*#__PURE__*/_react["default"].createElement(_okrClassify["default"], {
222
228
  classify: okrClassify
223
229
  })), /*#__PURE__*/_react["default"].createElement("div", {
224
230
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-desp"))
@@ -230,7 +236,19 @@ function WorkNode(_ref) {
230
236
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-type"))
231
237
  }, getOkrTypeMap()[okrType])), /*#__PURE__*/_react["default"].createElement("span", {
232
238
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-cycle"))
233
- }, getCycleTextByType()))), /*#__PURE__*/_react["default"].createElement("span", {
239
+ }, getCycleTextByType()))), !!(Krs !== null && Krs !== void 0 && Krs.length) && /*#__PURE__*/_react["default"].createElement("div", {
240
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-krs"))
241
+ }, Krs.map(function (item, key) {
242
+ return /*#__PURE__*/_react["default"].createElement("div", {
243
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr"))
244
+ }, /*#__PURE__*/_react["default"].createElement("span", {
245
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-icon"))
246
+ }, "KR", item.SortNum + 1), /*#__PURE__*/_react["default"].createElement("div", {
247
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-title"))
248
+ }, item.mileStoneName), /*#__PURE__*/_react["default"].createElement("div", {
249
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-progress ").concat(_precls["default"], "--node-kr-status--").concat(riskLevelSuffix[item.riskLevel]))
250
+ }, item.progress, "%"));
251
+ })), /*#__PURE__*/_react["default"].createElement("span", {
234
252
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-status"), "".concat(_precls["default"], "--node-status__").concat(riskLevelSuffix[manualRiskLevel]))
235
253
  }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
236
254
  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:
@@ -188,19 +191,19 @@ function OkrSearchPanel(props, ref) {
188
191
  }, _callee);
189
192
  }));
190
193
 
191
- return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10) {
194
+ return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11) {
192
195
  return _ref.apply(this, arguments);
193
196
  };
194
197
  }(), 500)).current;
195
198
  var okrFlow = (0, _react.useRef)();
196
199
  (0, _react.useEffect)(function () {
197
200
  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]);
201
+ getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr);
202
+ }, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr]);
200
203
  (0, _react.useEffect)(function () {
201
204
  var data = (0, _treeHandler.transToMapData)(treeNodes, showkr);
202
205
  setDataSource(data.length > 1 ? data : []);
203
- }, [treeNodes, showkr]);
206
+ }, [treeNodes, showkr, showCardKr]);
204
207
 
205
208
  var handleParentExpand = /*#__PURE__*/function () {
206
209
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(node) {
@@ -216,7 +219,8 @@ function OkrSearchPanel(props, ref) {
216
219
  krId: modelType == "kr" ? id : 0,
217
220
  okrId: modelType == "kr" ? data.workId : id,
218
221
  okrIdParent: modelType == "work" ? data.parentId : data.workId,
219
- childRoot: false
222
+ childRoot: false,
223
+ showCardKr: showCardKr ? 1 : 0
220
224
  });
221
225
 
222
226
  case 3:
@@ -249,7 +253,7 @@ function OkrSearchPanel(props, ref) {
249
253
  }, _callee2);
250
254
  }));
251
255
 
252
- return function handleParentExpand(_x11) {
256
+ return function handleParentExpand(_x12) {
253
257
  return _ref2.apply(this, arguments);
254
258
  };
255
259
  }();
@@ -268,6 +272,7 @@ function OkrSearchPanel(props, ref) {
268
272
  okrId: modelType == "work" ? id : data.workId,
269
273
  okrIdParent: 0,
270
274
  childRoot: true,
275
+ showCardKr: showCardKr ? 1 : 0,
271
276
  currentOkrRole: modelType == "kr" ? data.mapkrVisible : data.MapOkrVisible
272
277
  });
273
278
 
@@ -294,7 +299,7 @@ function OkrSearchPanel(props, ref) {
294
299
  }, _callee3);
295
300
  }));
296
301
 
297
- return function handleChildExpand(_x12) {
302
+ return function handleChildExpand(_x13) {
298
303
  return _ref3.apply(this, arguments);
299
304
  };
300
305
  }();