@titaui/pc 1.10.82-beta.2 → 1.10.82-beta.20

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 (71) hide show
  1. package/.husky/pre-commit +1 -1
  2. package/lib/components/avatar/name-avatar/index.css +1 -0
  3. package/lib/components/avatar/name-avatar/index.js +22 -13
  4. package/lib/components/button/rect-btn/index.css +25 -11
  5. package/lib/components/button/rect-btn/index.js +8 -4
  6. package/lib/components/create-okr-modal/request-api.js +1 -1
  7. package/lib/components/drawer/index.css +11 -0
  8. package/lib/components/drawer/index.js +31 -6
  9. package/lib/components/drawer-manager/index.js +25 -27
  10. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +12 -3
  11. package/lib/components/dynamic/online-broadcast/data.js +7 -7
  12. package/lib/components/e-priority/index.js +11 -5
  13. package/lib/components/file-list/components/single-file/index.js +11 -11
  14. package/lib/components/icon-button-list/index.css +1 -1
  15. package/lib/components/img-viewer/index.css +7 -0
  16. package/lib/components/img-viewer/index.js +47 -8
  17. package/lib/components/menus/export-modules/demo-menus/menus.js +1 -23
  18. package/lib/components/menus/export-modules/okr-menus/menu-highlight.js +10 -0
  19. package/lib/components/nav-top/index.js +6 -2
  20. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.css +4 -3
  21. package/lib/components/okr-detail/detail-header/constant.js +53 -0
  22. package/lib/components/okr-detail/detail-header/index.js +11 -2
  23. package/lib/components/okr-flow/child-node/index.css +54 -15
  24. package/lib/components/okr-flow/child-node/work-node.js +19 -3
  25. package/lib/components/okr-flow/empty/index.css +8 -1
  26. package/lib/components/okr-flow/export-modal/index.js +26 -2
  27. package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
  28. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +14 -9
  29. package/lib/components/okr-flow/images/loading-light.gif +0 -0
  30. package/lib/components/okr-flow/okr-map/index.js +32 -14
  31. package/lib/components/okr-flow/request-apis.js +11 -4
  32. package/lib/components/okr-flow/root-node/index.css +2 -2
  33. package/lib/components/okr-flow/utils/index.js +43 -26
  34. package/lib/components/okr-flow/utils/tree-handler.js +14 -3
  35. package/lib/components/okr-progress-modal/index.css +16 -15
  36. package/lib/components/okrcase-library/okrcases-components/caseLibrary-main.js +14 -8
  37. package/lib/components/period-selector/index.js +3 -0
  38. package/lib/components/superset-charts/components/chart/index.js +8 -36
  39. package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +8 -0
  40. package/lib/components/survey-model/contact.js +93 -0
  41. package/lib/components/survey-model/index.css +141 -0
  42. package/lib/components/survey-model/index.js +259 -0
  43. package/lib/components/survey-model/instance.js +86 -0
  44. package/lib/components/survey-model/request-api.js +80 -0
  45. package/lib/components/task-relation-modal/index.css +2 -2
  46. package/lib/components/task-relation-modal/tree-node/category-node/index.css +4 -0
  47. package/lib/components/task-relation-modal/tree-node/kr-node/index.css +4 -0
  48. package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +4 -0
  49. package/lib/components/task-relation-modal/tree-node/o-node/index.css +4 -0
  50. package/lib/components/task-relation-modal/tree-node/work-node/index.css +4 -0
  51. package/lib/components/textarea/index.css +120 -0
  52. package/lib/components/textarea/index.js +257 -0
  53. package/lib/components/wechat-btn/index.css +4 -0
  54. package/lib/components/wechat-btn/index.js +134 -38
  55. package/lib/index.js +125 -77
  56. package/lib/pages/new-okr-list/header/common.js +52 -0
  57. package/lib/pages/new-okr-list/header/index.css +45 -0
  58. package/lib/pages/new-okr-list/header/index.js +28 -16
  59. package/lib/pages/new-okr-list/header/operate-record.js +88 -0
  60. package/lib/pages/new-okr-list/index.js +28 -15
  61. package/lib/pages/new-okr-list/list/index.js +19 -2
  62. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +6 -1
  63. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +47 -13
  64. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +27 -17
  65. package/lib/pages/okr-map/number-select/index.css +4 -1
  66. package/lib/pages/okr-map/number-select/index.js +1 -1
  67. package/lib/utils/auth.js +60 -3
  68. package/lib/utils/bs-global.js +14 -2
  69. package/lib/utils/format-time.js +8 -1
  70. package/lib/utils/open-data.js +5 -1
  71. package/package.json +1 -1
@@ -85,7 +85,18 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
85
85
  isLoading = _useState12[0],
86
86
  setIsLoading = _useState12[1];
87
87
 
88
+ var _useState13 = (0, _react.useState)(0),
89
+ _useState14 = _slicedToArray(_useState13, 2),
90
+ moveX = _useState14[0],
91
+ setMoveX = _useState14[1];
92
+
93
+ var _useState15 = (0, _react.useState)(0),
94
+ _useState16 = _slicedToArray(_useState15, 2),
95
+ moveY = _useState16[0],
96
+ setMoveY = _useState16[1];
97
+
88
98
  var imgRef = (0, _react.useRef)(document.createElement("img"));
99
+ var DragRef = (0, _react.useRef)(document.createElement("div"));
89
100
 
90
101
  var showPreview = function showPreview() {
91
102
  var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
@@ -120,6 +131,31 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
120
131
  setCurrentRotateDeg(currentRotateDeg - 90);
121
132
  };
122
133
 
134
+ var handleMouseDownImg = function handleMouseDownImg(e) {
135
+ e.preventDefault();
136
+ var downX = e.clientX;
137
+ var downY = e.clientY; // 因为这个moveX不闭包的话在拖动的时候他就 一直累加
138
+
139
+ var beforeX = moveX;
140
+ var beforeY = moveY;
141
+
142
+ DragRef.current.onmousemove = function (e1) {
143
+ //获取x和y
144
+ var nx = e1.clientX;
145
+ var ny = e1.clientY; // //计算移动后的左偏移量和顶部的偏移量
146
+
147
+ var nl = nx - downX + beforeX;
148
+ var nt = ny - downY + beforeY;
149
+ setMoveX(nl);
150
+ setMoveY(nt);
151
+ };
152
+ };
153
+
154
+ var handleMouseUpImg = function handleMouseUpImg(e) {
155
+ e.preventDefault();
156
+ DragRef.current.onmousemove = null;
157
+ };
158
+
123
159
  var handleRightRotate = function handleRightRotate() {
124
160
  setCurrentRotateDeg(currentRotateDeg + 90);
125
161
  };
@@ -170,7 +206,10 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
170
206
  className: (0, _classnames["default"])("tu-icon-close", "".concat(prefix, "__header-close")),
171
207
  onClick: hidePreview
172
208
  }))), /*#__PURE__*/_react["default"].createElement("div", {
173
- className: "".concat(prefix, "__body")
209
+ className: "".concat(prefix, "__body"),
210
+ ref: DragRef,
211
+ onMouseDown: handleMouseDownImg,
212
+ onMouseUp: handleMouseUpImg
174
213
  }, /*#__PURE__*/_react["default"].createElement("span", {
175
214
  className: (0, _classnames["default"])("".concat(prefix, "__body-operate-btn"), "".concat(prefix, "__body-operate-btn--left"), _defineProperty({}, "".concat(prefix, "__body-operate-btn--disable"), currentIndex === 0)),
176
215
  onClick: handlePreImgClick
@@ -184,17 +223,17 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
184
223
  })), isLoading && /*#__PURE__*/_react["default"].createElement("div", {
185
224
  className: "".concat(prefix, "__body--loading")
186
225
  }, /*#__PURE__*/_react["default"].createElement("img", {
187
- src: _loading["default"]
188
- })), /*#__PURE__*/_react["default"].createElement("div", {
189
- style: {
190
- transform: "rotate(".concat(currentRotateDeg, "deg)")
191
- }
192
- }, /*#__PURE__*/_react["default"].createElement("img", {
226
+ src: _loading["default"],
227
+ alt: ""
228
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
193
229
  className: "".concat(prefix, "__body-img"),
194
230
  ref: imgRef,
231
+ alt: "",
195
232
  src: (currentImgData === null || currentImgData === void 0 ? void 0 : currentImgData.previewUrl) || (currentImgData === null || currentImgData === void 0 ? void 0 : currentImgData.bigImageUrl),
196
233
  style: {
197
- transform: "scale(".concat(currentScale, ")")
234
+ transform: "scale(".concat(currentScale, ") rotate(").concat(currentRotateDeg, "deg) "),
235
+ left: "".concat(moveX, "px"),
236
+ top: "".concat(moveY, "px")
198
237
  }
199
238
  }))), /*#__PURE__*/_react["default"].createElement("div", {
200
239
  className: "".concat(prefix, "__footer")
@@ -109,29 +109,7 @@ var DemoMenuData = /*#__PURE__*/function () {
109
109
  key: PAGE_DUEDATE_ORDER,
110
110
  href: "#/demofree/recharge/order",
111
111
  isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
112
- } // {
113
- // icon: "",
114
- // label: "续费状态",
115
- // key: PAGE_RECHARGE_STATUS,
116
- // href: "#/demofree/recharge/status",
117
- // isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
118
- // },
119
- // {
120
- // icon: "",
121
- // label: "数据统计",
122
- // key: PAGE_RECHARGE_STATISTICS,
123
- // href: "#/demofree/recharge/statistics",
124
- // isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
125
- // },
126
- ]
127
- }, {
128
- icon: "KH-help",
129
- label: "预约演示报表",
130
- key: "charts",
131
- href: "#/demofree/charts",
132
- isShow: this.isManager === EManagerType.Manager,
133
- children: [],
134
- type: _index.MENU_ITEM_NOE
112
+ }]
135
113
  }];
136
114
  }
137
115
 
@@ -31,6 +31,8 @@ var _default = /*#__PURE__*/function () {
31
31
  cb(_menus.PAGE_MY_PART_OKR);
32
32
  } else if (this.isMyTargetOkr()) {
33
33
  cb(_menus.PAGE_MY_TARGET_OKR);
34
+ } else if (this.isTargetUser()) {
35
+ return null;
34
36
  } else {
35
37
  cb(_menus.PAGE_MY_OWNER_OKR);
36
38
  }
@@ -43,6 +45,8 @@ var _default = /*#__PURE__*/function () {
43
45
  } else if (this.isOkrCases()) {
44
46
  cb(_menus.PAGE_OKR_CASES);
45
47
  }
48
+
49
+ return null;
46
50
  }
47
51
  }, {
48
52
  key: "isMyOkr",
@@ -62,6 +66,12 @@ var _default = /*#__PURE__*/function () {
62
66
  var search = this.history.location.search;
63
67
  return !!search.match(/relation[\s]*?=[\s]*?3/);
64
68
  }
69
+ }, {
70
+ key: "isTargetUser",
71
+ value: function isTargetUser() {
72
+ var search = this.history.location.search;
73
+ return !!search.match(/toUserId[\s]*?=[\d]+/);
74
+ }
65
75
  }, {
66
76
  key: "isOkr",
67
77
  value: function isOkr() {
@@ -15,6 +15,8 @@ var _bsGlobal = require("../../utils/bs-global");
15
15
 
16
16
  var _userOwnMenu = _interopRequireDefault(require("./components/user-own-menu"));
17
17
 
18
+ var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
19
+
18
20
  var _menu = _interopRequireDefault(require("./components/menu"));
19
21
 
20
22
  var _userMessage = _interopRequireDefault(require("./components/user-message"));
@@ -170,5 +172,7 @@ var NavTop = function NavTop() {
170
172
  }, /*#__PURE__*/_react["default"].createElement(_userOwnMenu["default"], null)));
171
173
  };
172
174
 
173
- var _default = NavTop;
174
- exports["default"] = _default;
175
+ var _default = NavTop; // @ts-ignore
176
+
177
+ exports["default"] = _default;
178
+ NavTop.useGlobalValue = _useGlobalValue["default"];
@@ -54,7 +54,7 @@
54
54
  }
55
55
 
56
56
  .tita-okrdt-tree__o-child-node-prefix::before {
57
- content: "";
57
+ content: '';
58
58
  width: 9px;
59
59
  height: 12px;
60
60
  background: url(../../images/O.svg) transparent no-repeat 50% 50%;
@@ -73,11 +73,12 @@
73
73
 
74
74
  .child-okrs-weight__content {
75
75
  padding: 10px 32px 8px;
76
+ max-height: 300px;
76
77
  min-height: 90px;
78
+ overflow: auto;
77
79
  box-sizing: border-box;
78
80
  display: flex;
79
81
  flex-direction: column;
80
- justify-content: center;
81
82
  }
82
83
 
83
84
  .child-okrs-weight__item {
@@ -105,7 +106,7 @@
105
106
  }
106
107
 
107
108
  .child-okrs-weight__item-precls:before {
108
- content: "";
109
+ content: '';
109
110
  width: 10px;
110
111
  height: 8px;
111
112
  border-radius: 50%;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getApproveStatusTextMap = exports.ApproveStatusColor = exports.ApproveStatus = void 0;
7
+
8
+ var _getLocale = require("../../../utils/getLocale");
9
+
10
+ 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; }
11
+
12
+ var ApproveStatus;
13
+ exports.ApproveStatus = ApproveStatus;
14
+
15
+ (function (ApproveStatus) {
16
+ ApproveStatus[ApproveStatus["None"] = 0] = "None";
17
+ ApproveStatus[ApproveStatus["WaitCommit"] = 6] = "WaitCommit";
18
+ ApproveStatus[ApproveStatus["Rejected"] = 3] = "Rejected";
19
+ ApproveStatus[ApproveStatus["UnderApproval"] = 1] = "UnderApproval";
20
+ ApproveStatus[ApproveStatus["ApproveAgree"] = 2] = "ApproveAgree";
21
+ ApproveStatus[ApproveStatus["WithDraw"] = 4] = "WithDraw";
22
+ ApproveStatus[ApproveStatus["Done"] = 5] = "Done";
23
+ })(ApproveStatus || (exports.ApproveStatus = ApproveStatus = {}));
24
+
25
+ var getApproveStatusTextMap = function getApproveStatusTextMap(status) {
26
+ var _ApproveStatusTextMap;
27
+
28
+ var ApproveStatusTextMap = (_ApproveStatusTextMap = {}, _defineProperty(_ApproveStatusTextMap, ApproveStatus.WaitCommit, (0, _getLocale.getLocale)('OKR_MyO_Tobesubmitted')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.Rejected, (0, _getLocale.getLocale)('OKR_MyO_Tobesubmitted')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.UnderApproval, (0, _getLocale.getLocale)('Pro_detail_Approval')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.ApproveAgree, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.WithDraw, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.None, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.Done, ''), _ApproveStatusTextMap);
29
+ return ApproveStatusTextMap[status];
30
+ };
31
+
32
+ exports.getApproveStatusTextMap = getApproveStatusTextMap;
33
+
34
+ var ApproveStatusColor = function ApproveStatusColor(status) {
35
+ var _ApprovalStatusColorM;
36
+
37
+ var ApprovalStatusColorMap = (_ApprovalStatusColorM = {}, _defineProperty(_ApprovalStatusColorM, ApproveStatus.WaitCommit, {
38
+ color: '#F0A326',
39
+ bgColor: 'rgba(240, 163, 38, 0.1)'
40
+ }), _defineProperty(_ApprovalStatusColorM, ApproveStatus.Rejected, {
41
+ color: '#F0A326',
42
+ bgColor: 'rgba(240, 163, 38, 0.1)'
43
+ }), _defineProperty(_ApprovalStatusColorM, ApproveStatus.UnderApproval, {
44
+ color: '#2879FF',
45
+ bgColor: 'rgba(40, 121, 255, 0.1)'
46
+ }), _defineProperty(_ApprovalStatusColorM, ApproveStatus.ApproveAgree, {
47
+ color: '#ffffff',
48
+ bgColor: '#ffffff'
49
+ }), _ApprovalStatusColorM);
50
+ return ApprovalStatusColorMap[status];
51
+ };
52
+
53
+ exports.ApproveStatusColor = ApproveStatusColor;
@@ -29,6 +29,8 @@ var _okrShare = _interopRequireDefault(require("../../okr-share"));
29
29
 
30
30
  var _context7 = require("../context");
31
31
 
32
+ var _constant = require("./constant");
33
+
32
34
  var _deleteConfirm = _interopRequireDefault(require("./delete-confirm/delete-confirm"));
33
35
 
34
36
  var _drawerManager = _interopRequireDefault(require("../../drawer-manager"));
@@ -85,6 +87,7 @@ function OkrDetailHeader(_ref) {
85
87
  var loginUserId = window.BSGlobal.loginUserInfo.Id;
86
88
  var context = (0, _react.useContext)(_context7.GeneralDataContext);
87
89
  var commonContext = (0, _react.useContext)(_context7.CommonContext);
90
+ var approveStatusColor = (0, _constant.ApproveStatusColor)(detailInfo.applyStatus);
88
91
  var changVisiblity = (0, _react.useCallback)( /*#__PURE__*/function () {
89
92
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(workId, visibility) {
90
93
  var visibilityScope,
@@ -366,12 +369,14 @@ function OkrDetailHeader(_ref) {
366
369
  }
367
370
  }
368
371
 
372
+ (0, _react.useEffect)(function () {}, []);
369
373
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_drawer["default"].Header, {
370
374
  actions: actions,
371
375
  actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
372
376
  id: detailInfo.workId,
373
377
  objType: 62,
374
- name: detailInfo.workName
378
+ name: detailInfo.workName,
379
+ principalUser: detailInfo.principalUser
375
380
  }),
376
381
  content: parent ? /*#__PURE__*/_react["default"].createElement("span", {
377
382
  className: "okr-detail-head-parent"
@@ -385,7 +390,11 @@ function OkrDetailHeader(_ref) {
385
390
  krId: parent.id
386
391
  });
387
392
  }
388
- }, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null
393
+ }, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null,
394
+ status: {
395
+ title: (0, _constant.getApproveStatusTextMap)(detailInfo.applyStatus),
396
+ color: approveStatusColor
397
+ }
389
398
  }), /*#__PURE__*/_react["default"].createElement(_okrShare["default"], {
390
399
  visible: shareVisible,
391
400
  onClose: closeShareModal,
@@ -36,12 +36,11 @@
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
 
@@ -75,20 +74,60 @@
75
74
  white-space: unset;
76
75
  }
77
76
 
77
+ .titaui-okr-flow--node-krs {
78
+ margin-top: 12px;
79
+ }
80
+
81
+ .titaui-okr-flow--node-kr {
82
+ display: flex;
83
+ line-height: 20px;
84
+ font-size: 12px;
85
+ margin-top: 8px;
86
+ }
87
+
88
+ .titaui-okr-flow--node-kr-icon {
89
+ color: rgba(40, 121, 255, 0.6);
90
+ margin-right: 8px;
91
+ }
92
+
93
+ .titaui-okr-flow--node-kr-title {
94
+ flex: 1;
95
+ font-size: 13px;
96
+ font-weight: 400;
97
+ color: #3F4755;
98
+ }
99
+
100
+ .titaui-okr-flow--node-kr-progress {
101
+ width: 32px;
102
+ text-align: right;
103
+ margin-left: 8px;
104
+ white-space: nowrap;
105
+ }
106
+
107
+ .titaui-okr-flow--node-kr-status--normal {
108
+ color: #2879ff;
109
+ }
110
+
111
+ .titaui-okr-flow--node-kr-status--risk {
112
+ color: #f6bd16;
113
+ }
114
+
115
+ .titaui-okr-flow--node-kr-status--expired {
116
+ color: #f05e5e;
117
+ }
118
+
119
+ .titaui-okr-flow--node-kr-status--complete {
120
+ color: #5ad8a6;
121
+ }
122
+
78
123
  .titaui-okr-flow--node-title {
79
124
  max-width: 252px;
80
- height: 44px;
81
125
  margin-right: 54px;
82
- margin-bottom: 8px;
83
- line-height: 22px;
126
+ margin-bottom: 4px;
127
+ line-height: 24px;
84
128
  color: #141c28;
85
129
  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;
130
+ font-weight: 600;
92
131
  }
93
132
 
94
133
  .titaui-okr-flow--node-desp {
@@ -118,7 +157,7 @@
118
157
  overflow: hidden;
119
158
  text-overflow: ellipsis;
120
159
  white-space: nowrap;
121
- line-height: 24px;
160
+ line-height: 20px;
122
161
  max-width: 96px;
123
162
  }
124
163
 
@@ -296,7 +335,7 @@
296
335
  top: 0;
297
336
  width: 50px;
298
337
  height: 32px;
299
- border-radius: 0 6px 0 20px;
338
+ border-radius: 0 12px 0 20px;
300
339
  font-size: 13px;
301
340
  text-align: center;
302
341
  line-height: 32px;
@@ -71,6 +71,7 @@ function WorkNode(_ref) {
71
71
  manualRiskLevel = data.manualRiskLevel,
72
72
  progress = data.progress,
73
73
  okrClassify = data.okrClassify,
74
+ Krs = data.Krs,
74
75
  cycleType = data.cycleType,
75
76
  startDate = data.startDate,
76
77
  endDate = data.endDate,
@@ -92,6 +93,8 @@ function WorkNode(_ref) {
92
93
  imgWidth = _useState6[0],
93
94
  setImgWidth = _useState6[1];
94
95
 
96
+ var bodyr = (0, _react.useRef)();
97
+
95
98
  var getOkrTypeMap = function getOkrTypeMap() {
96
99
  return {
97
100
  1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
@@ -210,12 +213,13 @@ function WorkNode(_ref) {
210
213
  }; // 1:正常 2:有风险 3:过期 4:完成 5:过期完成 ,
211
214
 
212
215
 
213
- var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over"];
216
+ var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over", "normal"];
214
217
  if (!MapOkrVisible) return /*#__PURE__*/_react["default"].createElement("div", {
215
218
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), "".concat(_precls["default"], "--node__private"))
216
219
  });
217
220
  return /*#__PURE__*/_react["default"].createElement("div", {
218
- className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes))
221
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes)),
222
+ ref: bodyr
219
223
  }, /*#__PURE__*/_react["default"].createElement("div", {
220
224
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-title"))
221
225
  }, workName, /*#__PURE__*/_react["default"].createElement(_okrClassify["default"], {
@@ -230,7 +234,19 @@ function WorkNode(_ref) {
230
234
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-type"))
231
235
  }, getOkrTypeMap()[okrType])), /*#__PURE__*/_react["default"].createElement("span", {
232
236
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-cycle"))
233
- }, getCycleTextByType()))), /*#__PURE__*/_react["default"].createElement("span", {
237
+ }, getCycleTextByType()))), !!(Krs !== null && Krs !== void 0 && Krs.length) && /*#__PURE__*/_react["default"].createElement("div", {
238
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-krs"))
239
+ }, Krs.map(function (item, key) {
240
+ return /*#__PURE__*/_react["default"].createElement("div", {
241
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr"))
242
+ }, /*#__PURE__*/_react["default"].createElement("span", {
243
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-icon"))
244
+ }, "KR", item.SortNum + 1), /*#__PURE__*/_react["default"].createElement("div", {
245
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-title"))
246
+ }, item.mileStoneName), /*#__PURE__*/_react["default"].createElement("div", {
247
+ className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-progress ").concat(_precls["default"], "--node-kr-status--").concat(riskLevelSuffix[item.riskLevel]))
248
+ }, item.progress, "%"));
249
+ })), /*#__PURE__*/_react["default"].createElement("span", {
234
250
  className: (0, _classnames["default"])("".concat(_precls["default"], "--node-status"), "".concat(_precls["default"], "--node-status__").concat(riskLevelSuffix[manualRiskLevel]))
235
251
  }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
236
252
  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
  }();