@titaui/pc 1.11.4-0 → 1.11.4-0.beta-2

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 (163) hide show
  1. package/lib/components/avatar/text-avatar/index.css +9 -2
  2. package/lib/components/avatar/text-avatar/index.js +34 -9
  3. package/lib/components/button/rect-btn/index.js +7 -7
  4. package/lib/components/change-okr-modal/Item.js +15 -15
  5. package/lib/components/communication/index.js +30 -29
  6. package/lib/components/drawer/index.js +7 -6
  7. package/lib/components/dynamic/constant.js +43 -36
  8. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
  9. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
  10. package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
  11. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
  12. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
  13. package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
  14. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
  15. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
  16. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
  17. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
  18. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +6 -6
  19. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
  20. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
  21. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
  22. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
  23. package/lib/components/dynamic/dynamic-item/index.js +70 -41
  24. package/lib/components/dynamic/dynamic-list/index.js +5 -13
  25. package/lib/components/e-priority/index.js +18 -12
  26. package/lib/components/eReport/eReportShare/index.js +12 -12
  27. package/lib/components/file-list/components/single-file/index.js +11 -11
  28. package/lib/components/form/form-fields/date/index.css +24 -0
  29. package/lib/components/form/form-fields/date/index.js +102 -0
  30. package/lib/components/form/form-fields/input/index.js +10 -10
  31. package/lib/components/form/form-fields/user/index.css +23 -3
  32. package/lib/components/form/form-fields/user/index.js +18 -8
  33. package/lib/components/form/form-fields/user/user-input.js +15 -6
  34. package/lib/components/form/index.js +10 -3
  35. package/lib/components/grid-layout/sub-employee-okr/person-okr.js +11 -5
  36. package/lib/components/icon-button-list/index.css +2 -57
  37. package/lib/components/icon-button-list/index.js +10 -7
  38. package/lib/components/img-viewer/index.css +10 -3
  39. package/lib/components/img-viewer/index.js +57 -18
  40. package/lib/components/mblog/components/MblogContent.js +5 -2
  41. package/lib/components/mblog/index.js +31 -30
  42. package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
  43. package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
  44. package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
  45. package/lib/components/menus/components/menu-tree/index.css +4 -2
  46. package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
  47. package/lib/components/menus/export-modules/interview-menus/constant.js +23 -17
  48. package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +5 -5
  49. package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
  50. package/lib/components/menus/export-modules/interview-menus/index.js +5 -4
  51. package/lib/components/nav-top/components/menu/img/new.svg +30 -0
  52. package/lib/components/nav-top/components/menu/img/wecome-temp.png +0 -0
  53. package/lib/components/nav-top/components/menu/index.css +91 -0
  54. package/lib/components/nav-top/components/menu/index.js +80 -32
  55. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
  56. package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
  57. package/lib/components/nav-top/components/user-message/constant.js +1 -0
  58. package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
  59. package/lib/components/nav-top/components/user-message/index.js +23 -20
  60. package/lib/components/nav-top/request.apis.js +3 -1
  61. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
  62. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +3 -2
  63. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
  64. package/lib/components/okr-detail/detail-header/actions.js +62 -66
  65. package/lib/components/okr-detail/detail-header/index.css +2 -2
  66. package/lib/components/okr-detail/detail-header/index.js +205 -194
  67. package/lib/components/okr-detail/index.js +21 -19
  68. package/lib/components/okr-detail/okr-list/index.js +5 -3
  69. package/lib/components/okr-flow/child-node/index.css +68 -22
  70. package/lib/components/okr-flow/child-node/work-node.js +61 -24
  71. package/lib/components/okr-flow/empty/index.css +8 -1
  72. package/lib/components/okr-flow/export-modal/index.js +108 -21
  73. package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
  74. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
  75. package/lib/components/okr-flow/images/loading-light.gif +0 -0
  76. package/lib/components/okr-flow/okr-map/index.js +43 -22
  77. package/lib/components/okr-flow/request-apis.js +15 -8
  78. package/lib/components/okr-flow/root-node/index.css +2 -2
  79. package/lib/components/okr-flow/root-node/index.js +26 -25
  80. package/lib/components/okr-flow/utils/index.js +45 -29
  81. package/lib/components/okr-flow/utils/tree-handler.js +29 -18
  82. package/lib/components/okrcase-library/index.css +6 -4
  83. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
  84. package/lib/components/pagination/index.css +3 -3
  85. package/lib/components/pagination/select.css +58 -23
  86. package/lib/components/period-selector/index.css +9 -3
  87. package/lib/components/period-selector/index.js +14 -11
  88. package/lib/components/picker/components/panels/date-panel/date-body.js +21 -19
  89. package/lib/components/picker/components/panels/date-panel/date-head.js +29 -8
  90. package/lib/components/picker/components/panels/month-panel/month-body.js +6 -4
  91. package/lib/components/picker/components/picker-trigger/index.css +31 -0
  92. package/lib/components/picker/components/picker-trigger/index.js +24 -15
  93. package/lib/components/picker/picker-panels.js +1 -1
  94. package/lib/components/picker/picker.js +12 -13
  95. package/lib/components/popup/index.js +4 -4
  96. package/lib/components/radio/index.css +9 -9
  97. package/lib/components/scroll-container/index.js +423 -0
  98. package/lib/components/scroll-container/style.css +35 -0
  99. package/lib/components/scrollbar/scroll-mask/index.js +1 -1
  100. package/lib/components/superset-charts/components/chart/index.js +1 -1
  101. package/lib/components/superset-charts/utils/axios.js +5 -13
  102. package/lib/components/survey-model/contact.js +93 -0
  103. package/lib/components/survey-model/index.css +141 -0
  104. package/lib/components/survey-model/index.js +268 -0
  105. package/lib/components/survey-model/instance.js +86 -0
  106. package/lib/components/survey-model/request-api.js +80 -0
  107. package/lib/components/task-relation-modal/index.js +0 -1
  108. package/lib/components/task-tree/helper.js +61 -0
  109. package/lib/components/task-tree/images/P1.svg +15 -0
  110. package/lib/components/task-tree/images/P2.svg +15 -0
  111. package/lib/components/task-tree/images/P3.svg +15 -0
  112. package/lib/components/task-tree/images/P4.svg +15 -0
  113. package/lib/components/task-tree/images/P5.svg +15 -0
  114. package/lib/components/task-tree/images/arrow.svg +9 -0
  115. package/lib/components/task-tree/images/empty-131.png +0 -0
  116. package/lib/components/task-tree/images/followed.svg +33 -0
  117. package/lib/components/task-tree/images/nice.svg +108 -0
  118. package/lib/components/task-tree/images/struc12.png +0 -0
  119. package/lib/components/task-tree/images/struc2.png +0 -0
  120. package/lib/components/task-tree/images/xialat-s.svg +13 -0
  121. package/lib/components/task-tree/index.js +16 -0
  122. package/lib/components/task-tree/precls.js +8 -0
  123. package/lib/components/task-tree/request-apis.js +88 -0
  124. package/lib/components/task-tree/task-item-node/constant.js +45 -0
  125. package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
  126. package/lib/components/task-tree/task-item-node/e-project.js +212 -0
  127. package/lib/components/task-tree/task-item-node/e-status-dropdown.js +114 -0
  128. package/lib/components/task-tree/task-item-node/e-task.js +426 -0
  129. package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
  130. package/lib/components/task-tree/task-item-node/index.css +299 -0
  131. package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
  132. package/lib/components/task-tree/task-tree.css +16 -0
  133. package/lib/components/task-tree/task-tree.js +49 -0
  134. package/lib/components/time-picker/index.css +24 -0
  135. package/lib/components/time-picker/time-picker-selector.js +8 -12
  136. package/lib/components/time-picker/time-picker.js +94 -133
  137. package/lib/components/time-picker/timer-picker-input.js +3 -7
  138. package/lib/components/time-picker/utils.js +13 -2
  139. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
  140. package/lib/components/wechat-btn/index.css +14 -0
  141. package/lib/components/wechat-btn/index.js +338 -0
  142. package/lib/components-v1/radio/radio.js +3 -3
  143. package/lib/components-v1/radio/style/index.css +8 -8
  144. package/lib/index.js +99 -91
  145. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
  146. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
  147. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
  148. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
  149. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
  150. package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
  151. package/lib/pages/okr-map/number-select/index.css +12 -9
  152. package/lib/pages/okr-map/number-select/index.js +3 -3
  153. package/lib/utils/auth.js +65 -8
  154. package/lib/utils/bs-global.js +18 -6
  155. package/lib/utils/open-data.js +63 -43
  156. package/package.json +6 -2
  157. package/.eslintignore +0 -3
  158. package/.eslintrc.js +0 -223
  159. package/.husky/pre-commit +0 -4
  160. package/.prettierignore +0 -31
  161. package/.prettierrc.js +0 -90
  162. package/.vscode/settings.json +0 -5
  163. package/yarn-error.log +0 -22184
@@ -36,18 +36,20 @@
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;
41
+ border: 1px solid #fff;
42
42
  background: #ffffff;
43
43
  box-shadow: 0px 4px 10px 0px rgba(127, 145, 180, 0.1);
44
- border-radius: 6px;
44
+ border-radius: 12px;
45
45
  box-sizing: border-box;
46
46
  }
47
47
 
48
48
  .titaui-okr-flow--node__private {
49
+ width: 340px;
50
+ height: 102px;
49
51
  background: url(../images/private-light.png) no-repeat;
50
- background-size: contain;
52
+ background-size: 340px 102px;
51
53
  }
52
54
 
53
55
  .titaui-okr-flow--node__search {
@@ -56,7 +58,7 @@
56
58
 
57
59
  .titaui-okr-flow--node__kr {
58
60
  border: 1px solid rgba(90, 216, 166, 0.5);
59
- background: #EEFBF6;
61
+ background: #eefbf6;
60
62
  height: 96px;
61
63
  }
62
64
 
@@ -75,25 +77,68 @@
75
77
  white-space: unset;
76
78
  }
77
79
 
80
+ .titaui-okr-flow--node-krs {
81
+ margin-top: 12px;
82
+ }
83
+
84
+ .titaui-okr-flow--node-kr {
85
+ cursor: pointer;
86
+ display: flex;
87
+ line-height: 20px;
88
+ font-size: 12px;
89
+ margin-top: 8px;
90
+ }
91
+
92
+ .titaui-okr-flow--node-kr-icon {
93
+ color: rgba(40, 121, 255, 0.6);
94
+ margin-right: 8px;
95
+ }
96
+
97
+ .titaui-okr-flow--node-kr-title {
98
+ flex: 1;
99
+ font-size: 13px;
100
+ font-weight: 400;
101
+ color: #3f4755;
102
+ }
103
+
104
+ .titaui-okr-flow--node-kr-progress {
105
+ width: 32px;
106
+ text-align: right;
107
+ margin-left: 8px;
108
+ white-space: nowrap;
109
+ }
110
+
111
+ .titaui-okr-flow--node-kr-status--normal {
112
+ color: #2879ff;
113
+ }
114
+
115
+ .titaui-okr-flow--node-kr-status--risk {
116
+ color: #f6bd16;
117
+ }
118
+
119
+ .titaui-okr-flow--node-kr-status--expired {
120
+ color: #f05e5e;
121
+ }
122
+
123
+ .titaui-okr-flow--node-kr-status--complete {
124
+ color: #5ad8a6;
125
+ }
126
+
78
127
  .titaui-okr-flow--node-title {
79
- max-width: 252px;
80
- height: 44px;
128
+ max-width: 270px;
81
129
  margin-right: 54px;
82
- margin-bottom: 8px;
83
- line-height: 22px;
130
+ margin-bottom: 4px;
131
+ line-height: 24px;
84
132
  color: #141c28;
85
133
  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;
134
+ font-weight: 600;
135
+ cursor: pointer;
92
136
  }
93
137
 
94
138
  .titaui-okr-flow--node-desp {
95
139
  font-family: PingFangSC-Regular, PingFang SC;
96
140
  position: relative;
141
+ cursor: pointer;
97
142
  }
98
143
 
99
144
  .titaui-okr-flow--node-right {
@@ -118,7 +163,7 @@
118
163
  overflow: hidden;
119
164
  text-overflow: ellipsis;
120
165
  white-space: nowrap;
121
- line-height: 24px;
166
+ line-height: 20px;
122
167
  max-width: 96px;
123
168
  }
124
169
 
@@ -157,7 +202,7 @@
157
202
  line-height: 24px;
158
203
  font-size: 12px;
159
204
  font-family: PingFangSC-Regular, PingFang SC;
160
- color: #6F7886;
205
+ color: #6f7886;
161
206
  }
162
207
 
163
208
  .titaui-okr-flow--node-weight:before {
@@ -179,7 +224,7 @@
179
224
  align-items: center;
180
225
  font-size: 12px;
181
226
  line-height: 24px;
182
- color: #6F7886;
227
+ color: #6f7886;
183
228
  }
184
229
 
185
230
  .titaui-okr-flow--node-progress .t-c-progress-circle {
@@ -291,12 +336,13 @@
291
336
  }
292
337
 
293
338
  .titaui-okr-flow--node-status {
339
+ cursor: pointer;
294
340
  position: absolute;
295
341
  right: 0;
296
342
  top: 0;
297
343
  width: 50px;
298
344
  height: 32px;
299
- border-radius: 0 6px 0 20px;
345
+ border-radius: 0 12px 0 20px;
300
346
  font-size: 13px;
301
347
  text-align: center;
302
348
  line-height: 32px;
@@ -367,7 +413,7 @@
367
413
  }
368
414
 
369
415
  .titaui-okr-flow__dark .titaui-okr-flow--node-status__normal {
370
- color: #1FA7FF;
416
+ color: #1fa7ff;
371
417
  background: #3b4e6e;
372
418
  }
373
419
 
@@ -386,7 +432,7 @@
386
432
  }
387
433
 
388
434
  .titaui-okr-flow__dark .titaui-okr-flow--node-kr-status__normal {
389
- color: #1FA7FF;
435
+ color: #1fa7ff;
390
436
  background: #3b4e6e;
391
437
  }
392
438
 
@@ -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); }
@@ -61,7 +65,7 @@ function WorkNode(_ref) {
61
65
  darkTheme = _ref.darkTheme;
62
66
  var workId = data.workId,
63
67
  _data$workName = data.workName,
64
- workName = _data$workName === void 0 ? "" : _data$workName,
68
+ workName = _data$workName === void 0 ? '' : _data$workName,
65
69
  okrType = data.okrType,
66
70
  departmentId = data.departmentId,
67
71
  departmentName = data.departmentName,
@@ -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,9 +97,11 @@ 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
- 1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
104
+ 1: (0, _getLocale.getLocale)('OKR_MyO_Pop_Individual'),
98
105
  // 2: <OpenDepartmentName id={departmentId} name={departmentName} />,
99
106
  2: /*#__PURE__*/_react["default"].createElement("img", {
100
107
  src: darkTheme ? whiteImg : departUrl,
@@ -103,8 +110,8 @@ function WorkNode(_ref) {
103
110
  },
104
111
  width: imgWidth
105
112
  }),
106
- 3: (0, _getLocale.getLocale)("OKR_MyO_Pop_Company"),
107
- 4: groupName || (0, _getLocale.getLocale)("OKR_MyO_Text_Team")
113
+ 3: (0, _getLocale.getLocale)('OKR_MyO_Pop_Company'),
114
+ 4: groupName || (0, _getLocale.getLocale)('OKR_MyO_Text_Team')
108
115
  };
109
116
  };
110
117
 
@@ -115,7 +122,7 @@ function WorkNode(_ref) {
115
122
  while (1) {
116
123
  switch (_context.prev = _context.next) {
117
124
  case 0:
118
- name = departmentName || "默认部门";
125
+ name = departmentName || '默认部门';
119
126
 
120
127
  if (!(0, _bsGlobal.isWx)()) {
121
128
  _context.next = 5;
@@ -126,15 +133,15 @@ function WorkNode(_ref) {
126
133
  return (0, _openDataPainter.getOpenData)({
127
134
  id: departmentId,
128
135
  name: departmentName,
129
- type: "departmentName"
136
+ type: 'departmentName'
130
137
  });
131
138
 
132
139
  case 4:
133
140
  name = _context.sent;
134
141
 
135
142
  case 5:
136
- getCanvasImg("white", name);
137
- getCanvasImg("dark", name);
143
+ getCanvasImg('white', name);
144
+ getCanvasImg('dark', name);
138
145
 
139
146
  case 7:
140
147
  case "end":
@@ -150,11 +157,11 @@ function WorkNode(_ref) {
150
157
  }();
151
158
 
152
159
  var getCanvasImg = function getCanvasImg() {
153
- var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "white";
160
+ var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'white';
154
161
  var name = arguments.length > 1 ? arguments[1] : undefined;
155
- var canvas = document.createElement("canvas");
156
- var ctx = canvas.getContext("2d");
157
- var font = "normal 12px/24px -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei";
162
+ var canvas = document.createElement('canvas');
163
+ var ctx = canvas.getContext('2d');
164
+ var font = 'normal 12px/24px -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei';
158
165
  ctx.font = font; // const fitStr = fittingString(ctx, name, 92);
159
166
 
160
167
  var _ctx$measureText = ctx.measureText(name),
@@ -163,11 +170,11 @@ function WorkNode(_ref) {
163
170
  var actualWidth = Math.min(width, 92);
164
171
  (0, _openDataPainter.setSize)(canvas, ctx, actualWidth, 24);
165
172
  setImgWidth(actualWidth);
166
- ctx.textBaseline = "middle";
173
+ ctx.textBaseline = 'middle';
167
174
  ctx.font = font;
168
- ctx.fillStyle = theme == "white" ? "#FFFFFF" : "#6f7886";
175
+ ctx.fillStyle = theme == 'white' ? '#FFFFFF' : '#6f7886';
169
176
  ctx.fillText(name, 0, 12);
170
- theme == "white" ? setWhiteImg(canvas.toDataURL()) : setDepartUrl(canvas.toDataURL());
177
+ theme == 'white' ? setWhiteImg(canvas.toDataURL()) : setDepartUrl(canvas.toDataURL());
171
178
  };
172
179
 
173
180
  (0, _react.useEffect)(function () {
@@ -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,
@@ -187,7 +206,7 @@ function WorkNode(_ref) {
187
206
 
188
207
  switch (cycleTypeCopy) {
189
208
  case 0:
190
- return (0, _getLocale.getLocale)("Mod_Customization");
209
+ return (0, _getLocale.getLocale)('Mod_Customization');
191
210
 
192
211
  case 1:
193
212
  return "".concat(annualNum, "\u5E74");
@@ -202,26 +221,29 @@ function WorkNode(_ref) {
202
221
  return "".concat(yqmnum, "-").concat((yqmnum + 1) % 12 || 12, "\u6708");
203
222
 
204
223
  case 5:
205
- return "".concat(yqmnum == 1 ? "" : "", "\u534A\u5E74");
224
+ return "".concat(yqmnum == 1 ? '' : '', "\u534A\u5E74");
206
225
 
207
226
  case -1:
208
- return KrIndex ? "KR".concat(KrIndex) : "KR";
227
+ return KrIndex ? "KR".concat(KrIndex) : 'KR';
209
228
  }
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,8 +33,12 @@ var _precls = _interopRequireDefault(require("../precls"));
33
33
 
34
34
  var _getLocale = require("../../../utils/getLocale");
35
35
 
36
+ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
37
+
36
38
  require("rc-color-picker/assets/index.css");
37
39
 
40
+ var Sentry = _interopRequireWildcard(require("@sentry/browser"));
41
+
38
42
  require("./index.css");
39
43
 
40
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -45,6 +49,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
45
49
 
46
50
  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
51
 
52
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
53
+
54
+ 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."); }
55
+
56
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
57
+
58
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
59
+
48
60
  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
61
 
50
62
  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); }); }; }
@@ -77,7 +89,7 @@ var ExportMapModal = function ExportMapModal(props) {
77
89
  mapInstance = _useState2[0],
78
90
  setMapInstance = _useState2[1];
79
91
 
80
- var _useState3 = (0, _react.useState)("none"),
92
+ var _useState3 = (0, _react.useState)('none'),
81
93
  _useState4 = _slicedToArray(_useState3, 2),
82
94
  bgColor = _useState4[0],
83
95
  setBgColor = _useState4[1];
@@ -88,6 +100,7 @@ var ExportMapModal = function ExportMapModal(props) {
88
100
  setIsExport = _useState6[1];
89
101
 
90
102
  var modalRef = (0, _react.useRef)();
103
+ var virtualElements = (0, _react.useRef)([]);
91
104
  (0, _react.useEffect)(function () {
92
105
  if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
93
106
  if (window.WWOpenData.enableCanvasSharing) {
@@ -112,12 +125,12 @@ var ExportMapModal = function ExportMapModal(props) {
112
125
  while (1) {
113
126
  switch (_context.prev = _context.next) {
114
127
  case 0:
115
- okrMapRef = document.querySelector(".titaui-okr-flow__export") || document.createElement("div");
128
+ okrMapRef = document.querySelector('.titaui-okr-flow__export') || document.createElement('div');
116
129
  width = okrMapRef.clientWidth; // 获取dom 宽度
117
130
 
118
131
  height = okrMapRef.clientHeight; // 获取dom 高度
119
132
 
120
- canvas = document.createElement("canvas"); // 创建一个canvas节点
133
+ canvas = document.createElement('canvas'); // 创建一个canvas节点
121
134
 
122
135
  scale = 20; // 定义任意放大倍数 支持小数
123
136
 
@@ -144,6 +157,8 @@ var ExportMapModal = function ExportMapModal(props) {
144
157
  };
145
158
  _context.next = 12;
146
159
  return (0, _html2canvas["default"])(okrMapRef, opts).then(function (result) {
160
+ var _window, _window$BSGlobal, _window$BSGlobal$logi, _window2, _window2$BSGlobal, _window2$BSGlobal$ten;
161
+
147
162
  if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
148
163
  if (window.WWOpenData.enableCanvasSharing) {
149
164
  window.WWOpenData.enableCanvasSharing();
@@ -154,36 +169,94 @@ var ExportMapModal = function ExportMapModal(props) {
154
169
  }
155
170
  }
156
171
 
157
- var imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
172
+ var userId = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$logi = _window$BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi === void 0 ? void 0 : _window$BSGlobal$logi.Id;
173
+ var telentId = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$BSGlobal = _window2.BSGlobal) === null || _window2$BSGlobal === void 0 ? void 0 : (_window2$BSGlobal$ten = _window2$BSGlobal.tenantInfo) === null || _window2$BSGlobal$ten === void 0 ? void 0 : _window2$BSGlobal$ten.Id;
174
+ var imgUrl = result.toDataURL('image/png'); // 得到图片的base64编码数据
158
175
 
159
176
  // 得到图片的base64编码数据
160
- (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(",")[1]).then(function (url) {
161
- var image = new Image();
162
- image.setAttribute("crossOrigin", "anonymous");
177
+ _toast["default"].Warning('导出中,请勿关闭弹窗', {
178
+ canClose: true
179
+ });
180
+
181
+ var equalIndex = imgUrl.indexOf('='); // 获取=号下标
182
+
183
+ // 获取=号下标
184
+ var size = 0;
185
+
186
+ if (equalIndex > 0) {
187
+ var str = imgUrl.substring(0, equalIndex); // 去除=号
188
+
189
+ // 去除=号
190
+ var strLength = str.length;
191
+ var fileLength = strLength - strLength / 8 * 2; // 真实的图片byte大小
192
+
193
+ // 真实的图片byte大小
194
+ size = Math.floor(fileLength); // 向下取整
195
+ } else {
196
+ var _strLength = imgUrl.length;
197
+
198
+ var _fileLength = _strLength - _strLength / 8 * 2;
199
+
200
+ size = Math.floor(_fileLength); // 向下取整
201
+ }
202
+
203
+ size = size / 1024 / 1024; // @ts-ignore
204
+
205
+ // @ts-ignore
206
+ window.titaTracker && window.titaTracker("action").record({
207
+ actionName: userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl.slice(1, 200),
208
+ actionGroup: 'okr地图图片',
209
+ productName: 'okr地图导出'
210
+ });
211
+ Sentry.withScope(function (scope) {
212
+ scope.setTag("error-level", "P0");
213
+ scope.setTag("error-type", "地图导出-图片生成");
214
+ scope.setExtra("userMessage", userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
215
+ });
216
+ (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
217
+ var image = new Image(); // @ts-ignore
218
+
219
+ // @ts-ignore
220
+ window.titaTracker && window.titaTracker("action").record({
221
+ actionName: userId + '租户:' + telentId + '我获得了地址' + url.Data.obj,
222
+ actionGroup: 'okr地图接口',
223
+ productName: 'okr地图导出'
224
+ });
225
+ Sentry.withScope(function (scope) {
226
+ scope.setTag("error-level", "P0");
227
+ scope.setTag("error-type", "地图导出-图片地址");
228
+ scope.setExtra("userMessage", userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
229
+ });
230
+
231
+ _toast["default"].Warning('图片上传成功,准备本地下载', {
232
+ canClose: true
233
+ });
234
+
235
+ image.setAttribute('crossOrigin', 'anonymous');
163
236
 
164
237
  image.onload = function () {
165
238
  if (!url.Data.obj) {
166
- _toast["default"].Error("导出失败,请稍后重试", {
239
+ _toast["default"].Error('导出失败,请稍后重试', {
167
240
  canClose: false
168
241
  });
169
242
  }
170
243
 
171
- var a = document.createElement("a"); // 生成一个a元素
244
+ var a = document.createElement('a'); // 生成一个a元素
172
245
 
173
246
  // 生成一个a元素
174
- var event = new MouseEvent("click"); // 创建一个单击事件
247
+ var event = new MouseEvent('click'); // 创建一个单击事件
175
248
 
176
249
  // 创建一个单击事件
177
- a.download = "okr地图"; // 设置图片名称
250
+ a.download = 'okr地图'; // 设置图片名称
178
251
 
179
252
  // 设置图片名称
180
- a.href = url.Data.obj; // 将生成的URL设置为a.href属性
253
+ a.href = url.Data.obj; // 将生成的URL设置为a
181
254
 
182
- // 将生成的URL设置为a.href属性
255
+ // 将生成的URL设置为a
183
256
  a.dispatchEvent(event); // 触发a的单击事件
184
257
 
185
258
  // 触发a的单击事件
186
- _toast["default"].Success("导出成功");
259
+ _toast["default"].Success('导出成功');
187
260
 
188
261
  setIsExport(false);
189
262
 
@@ -217,7 +290,7 @@ var ExportMapModal = function ExportMapModal(props) {
217
290
 
218
291
  var confirmHandler = function confirmHandler() {
219
292
  if (isExport) {
220
- _toast["default"].Warning("正在导出中", {
293
+ _toast["default"].Warning('正在导出中', {
221
294
  canClose: true
222
295
  });
223
296
 
@@ -233,11 +306,24 @@ var ExportMapModal = function ExportMapModal(props) {
233
306
  };
234
307
 
235
308
  var colorChangeHandler = function colorChangeHandler(colors) {
236
- setBgColor(colors ? colors.color : "none");
309
+ setBgColor(colors ? colors.color : 'none');
310
+ };
311
+
312
+ var NodeDebug = function NodeDebug() {
313
+ var elements = (0, _reactFlowRenderer.useStoreState)(function (state) {
314
+ return [].concat(_toConsumableArray(state.nodes), _toConsumableArray(state.edges));
315
+ }, _isEqual["default"]);
316
+ var setElements = (0, _reactFlowRenderer.useStoreActions)(function (actions) {
317
+ return actions.setElements;
318
+ });
319
+ var newElements = (0, _utils.getLayoutedElements)(elements, direction);
320
+ virtualElements = newElements;
321
+ setElements(newElements);
322
+ return null;
237
323
  };
238
324
 
239
325
  return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
240
- title: (0, _getLocale.getLocale)("OKR_Ali_Exportmap"),
326
+ title: (0, _getLocale.getLocale)('OKR_Ali_Exportmap'),
241
327
  noFooterLine: true,
242
328
  visible: visible,
243
329
  width: "1000px",
@@ -245,6 +331,7 @@ var ExportMapModal = function ExportMapModal(props) {
245
331
  onOk: confirmHandler,
246
332
  onCancel: onCloseHandler,
247
333
  ref: modalRef,
334
+ confirmLoading: isExport,
248
335
  className: "export-map-modal titaui-dialog",
249
336
  forceRender: true
250
337
  }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
@@ -253,7 +340,7 @@ var ExportMapModal = function ExportMapModal(props) {
253
340
  style: {
254
341
  marginRight: 10
255
342
  }
256
- }, (0, _getLocale.getLocale)("OKR_Ali_Selectbackground")), /*#__PURE__*/_react["default"].createElement(_rcColorPicker["default"], {
343
+ }, (0, _getLocale.getLocale)('OKR_Ali_Selectbackground')), /*#__PURE__*/_react["default"].createElement(_rcColorPicker["default"], {
257
344
  animation: "slide-up",
258
345
  color: "#FFFFFF",
259
346
  onChange: colorChangeHandler,
@@ -275,7 +362,7 @@ var ExportMapModal = function ExportMapModal(props) {
275
362
  nodesDraggable: false,
276
363
  nodesConnectable: false,
277
364
  className: (0, _classnames["default"])("".concat(_precls["default"], "__export"), _defineProperty({}, "".concat(_precls["default"], "__dark"), darkTheme)),
278
- elements: (0, _utils.getLayoutedElements)(dataSource, direction),
365
+ elements: dataSource,
279
366
  nodeTypes: _utils.nodeTypes,
280
367
  minZoom: 0.05,
281
368
  zoomOnScroll: false,
@@ -284,10 +371,10 @@ var ExportMapModal = function ExportMapModal(props) {
284
371
  paneMoveable: false,
285
372
  style: {
286
373
  height: 600,
287
- width: "100%",
374
+ width: '100%',
288
375
  background: bgColor
289
376
  }
290
- }))))));
377
+ }, /*#__PURE__*/_react["default"].createElement(NodeDebug, null)))))));
291
378
  };
292
379
 
293
380
  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 {