@titaui/pc 1.11.51 → 1.11.52-beta.11

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 (225) hide show
  1. package/lib/components/button/images/blue.svg +21 -0
  2. package/lib/components/button/images/red.svg +21 -0
  3. package/lib/components/button/images/white.svg +19 -0
  4. package/lib/components/button/rect-btn/index.js +3 -3
  5. package/lib/components/change-okr-modal/Item.js +19 -18
  6. package/lib/components/change-okr-modal/styledComponents.js +9 -9
  7. package/lib/components/checkbox/index.css +4 -0
  8. package/lib/components/contact-kefu/index.css +11 -1
  9. package/lib/components/contact-kefu/index.js +10 -4
  10. package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
  11. package/lib/components/create-okr-modal/fields/index.css +14 -3
  12. package/lib/components/create-okr-modal/fields/o-new-name.js +30 -19
  13. package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
  14. package/lib/components/create-okr-modal/index.js +200 -133
  15. package/lib/components/create-okr-modal/kr-items/index.css +23 -13
  16. package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
  17. package/lib/components/create-okr-modal/kr-items/krItem.js +53 -56
  18. package/lib/components/create-okr-modal/style.js +5 -5
  19. package/lib/components/date-picker/BodyItem.js +3 -3
  20. package/lib/components/date-picker/CalendarHeader.js +3 -3
  21. package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
  22. package/lib/components/dynamic/constant.js +1 -1
  23. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +8 -8
  24. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +8 -8
  25. package/lib/components/dynamic/dynamic-list/index.js +14 -7
  26. package/lib/components/dynamic/index.js +9 -12
  27. package/lib/components/dynamic/request-api.js +7 -68
  28. package/lib/components/eReport/eReportLists/reportList.js +3 -3
  29. package/lib/components/emotions-selector/selector-pop.js +3 -3
  30. package/lib/components/ereport-list/index.js +3 -3
  31. package/lib/components/mblog/components/MblogAction.js +3 -3
  32. package/lib/components/menus/export-modules/appraisal-menus/menus.js +11 -9
  33. package/lib/components/nav-top/components/menu/index.js +18 -16
  34. package/lib/components/nav-top/index.js +2 -2
  35. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  36. package/lib/components/okr-detail/components/header/edit-name.js +86 -40
  37. package/lib/components/okr-detail/components/header/index.css +120 -41
  38. package/lib/components/okr-detail/components/header/index.js +36 -46
  39. package/lib/components/okr-detail/components/header/o-classify.js +152 -0
  40. package/lib/components/okr-detail/components/header/o-name.js +7 -5
  41. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
  42. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +58 -4
  43. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +159 -63
  44. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
  45. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
  46. package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
  47. package/lib/components/okr-detail/detail-header/index.js +8 -4
  48. package/lib/components/okr-detail/e-list/index.js +2 -2
  49. package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
  50. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
  51. package/lib/components/okr-detail/request-apis.js +73 -69
  52. package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
  53. package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
  54. package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
  55. package/lib/components/okr-flow/child-node/kr-node.js +3 -1
  56. package/lib/components/okr-flow/child-node/work-node.js +3 -1
  57. package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
  58. package/lib/components/okr-progress/components/o-progress/index.js +3 -1
  59. package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
  60. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
  61. package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
  62. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
  63. package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
  64. package/lib/components/okr-share/common-painter/utils.js +183 -36
  65. package/lib/components/okr-share/index.css +5 -4
  66. package/lib/components/okr-share/pink-card/card.js +3 -3
  67. package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
  68. package/lib/components/okr-share/pink-card/index.js +20 -12
  69. package/lib/components/open-data-painter/index.js +6 -5
  70. package/lib/components/period-selector/interface.js +7 -0
  71. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  72. package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
  73. package/lib/components/rich-editor/models/schema.js +6 -6
  74. package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
  75. package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
  76. package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
  77. package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
  78. package/lib/components/rich-editor/plugins/core/index.js +4 -4
  79. package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
  80. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
  81. package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
  82. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
  83. package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
  84. package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
  85. package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
  86. package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
  87. package/lib/components/rich-editor/react/uiProvider.js +3 -3
  88. package/lib/components/rich-editor/ui/Popup/index.js +3 -3
  89. package/lib/components/search-input/index.css +1 -1
  90. package/lib/components/search-key-handle/index.js +9 -7
  91. package/lib/components/select/Option.js +3 -3
  92. package/lib/components/select-layer/index.css +1 -1
  93. package/lib/components/task-relation-modal/helper.js +139 -2
  94. package/lib/components/task-relation-modal/image/loading.gif +0 -0
  95. package/lib/components/task-relation-modal/index.js +9 -0
  96. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
  97. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +262 -0
  98. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
  99. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
  100. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +129 -0
  101. package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
  102. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
  103. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +185 -0
  104. package/lib/components/task-relation-modal/request-api.js +28 -2
  105. package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
  106. package/lib/components/task-relation-modal/search/principal.js +36 -19
  107. package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
  108. package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
  109. package/lib/components/{dynamic/dynamic-topping/index.js → task-relation-modal/search/task-relation.js} +45 -44
  110. package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
  111. package/lib/components/{dynamic/dynamic-liking/index.js → task-relation-modal/search/work-relation.js} +43 -39
  112. package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
  113. package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
  114. package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
  115. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
  116. package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
  117. package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
  118. package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
  119. package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
  120. package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
  121. package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
  122. package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -12
  123. package/lib/components/task-relation-modal/tree-node/category-node/index.js +1 -3
  124. package/lib/components/task-relation-modal/tree-node/kr-node/index.css +0 -16
  125. package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -10
  126. package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +0 -16
  127. package/lib/components/task-relation-modal/tree-node/milestone-node/index.js +0 -4
  128. package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
  129. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  130. package/lib/components/task-relation-modal/work-relation/index.css +0 -0
  131. package/lib/components/task-relation-modal/work-relation/index.js +256 -0
  132. package/lib/components/tita-chart/errorBoundary/index.js +3 -3
  133. package/lib/components/tooltip/index.js +3 -0
  134. package/lib/components/tooltip/tooltip-rows/index.css +26 -0
  135. package/lib/components/{dynamic/advertise → tooltip/tooltip-rows}/index.js +65 -85
  136. package/lib/components/user-selector/category-selector-panel/index.js +6 -1
  137. package/lib/components/{dynamic/quick-operation/components/create-task/index.js → user-selector/category-selector-panel/subordinate-tree.js} +37 -20
  138. package/lib/components/user-selector/constant.js +10 -2
  139. package/lib/components/user-selector/empty/index.css +5 -0
  140. package/lib/components/user-selector/empty/index.js +9 -3
  141. package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
  142. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +3 -1
  143. package/lib/components/user-selector/images/no-auth.png +0 -0
  144. package/lib/components/user-selector/request-apis.js +28 -9
  145. package/lib/components/user-selector/searched-panel/index.js +21 -7
  146. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
  147. package/lib/components/wechat-btn/index.css +5 -1
  148. package/lib/components-v1/animate/AnimateChild.js +3 -3
  149. package/lib/components-v1/avatar/index.js +3 -3
  150. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
  151. package/lib/components-v1/progress/CircleProgress.js +3 -3
  152. package/lib/components-v1/select/Option.js +3 -3
  153. package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
  154. package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
  155. package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
  156. package/lib/components-v1/userSelector/components/UserItem.js +3 -3
  157. package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
  158. package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
  159. package/lib/utils/open-data.js +213 -65
  160. package/lib/utils/planDataJson.js +11115 -0
  161. package/package.json +3 -2
  162. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  163. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  164. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  165. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  166. package/lib/components/dynamic/advertise/index.css +0 -21
  167. package/lib/components/dynamic/advertise/interface.js +0 -5
  168. package/lib/components/dynamic/advertise/util.js +0 -28
  169. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  170. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  171. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  172. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  173. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  174. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  175. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  176. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  177. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  178. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  179. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  180. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  181. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  182. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  183. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  184. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  185. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  186. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  187. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  188. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  189. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  190. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  191. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  192. package/lib/components/dynamic/dynamic.css +0 -173
  193. package/lib/components/dynamic/dynamic.js +0 -428
  194. package/lib/components/dynamic/export-module/index.js +0 -37
  195. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  196. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  197. package/lib/components/dynamic/my-team/img/line.png +0 -0
  198. package/lib/components/dynamic/my-team/img/team.png +0 -0
  199. package/lib/components/dynamic/my-team/index.css +0 -184
  200. package/lib/components/dynamic/my-team/index.js +0 -263
  201. package/lib/components/dynamic/my-team/request-api.js +0 -52
  202. package/lib/components/dynamic/my-team/util.js +0 -20
  203. package/lib/components/dynamic/new-ui.css +0 -192
  204. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  205. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  206. package/lib/components/dynamic/online-broadcast/data.js +0 -95
  207. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  208. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  209. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  210. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  211. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  212. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  213. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  214. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  215. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  216. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  217. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  218. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  219. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  220. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  221. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  222. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  223. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  224. package/lib/components/dynamic/quick-operation/index.css +0 -51
  225. package/lib/components/dynamic/quick-operation/index.js +0 -120
@@ -7,6 +7,14 @@ exports.breakLinesForCanvas = breakLinesForCanvas;
7
7
  exports.drawImage = drawImage;
8
8
  exports.drawTextMiddle = drawTextMiddle;
9
9
 
10
+ var _openDataPainter = _interopRequireDefault(require("./openDataPainter"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ 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); } }
15
+
16
+ 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); }); }; }
17
+
10
18
  function drawImage(ctx, url, x, y, width, height) {
11
19
  return new Promise(function (res) {
12
20
  var img = new Image();
@@ -19,30 +27,65 @@ function drawImage(ctx, url, x, y, width, height) {
19
27
  });
20
28
  }
21
29
 
22
- function drawTextMiddle(ctx, text, x, y, lineHeight, maxWidth, textAlign) {
23
- ctx.textBaseline = "middle";
24
-
25
- if (!maxWidth) {
26
- ctx.fillText(text, x, y + lineHeight / 2);
27
- return y + lineHeight;
28
- }
29
-
30
- var lines = breakLinesForCanvas(ctx, text, maxWidth);
31
- lines.forEach(function (l) {
32
- var _ctx$measureText = ctx.measureText(l),
33
- width = _ctx$measureText.width;
34
-
35
- var left = x;
36
-
37
- if (textAlign == "center" && maxWidth) {
38
- console.log(maxWidth, width);
39
- left = (maxWidth - width) / 2 + x;
40
- }
30
+ function drawTextMiddle(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
31
+ return _drawTextMiddle.apply(this, arguments);
32
+ }
41
33
 
42
- ctx.fillText(l, left, y + lineHeight / 2);
43
- y += lineHeight;
44
- });
45
- return y;
34
+ function _drawTextMiddle() {
35
+ _drawTextMiddle = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, text, x, y, lineHeight, maxWidth, textAlign) {
36
+ var lines;
37
+ return regeneratorRuntime.wrap(function _callee$(_context) {
38
+ while (1) {
39
+ switch (_context.prev = _context.next) {
40
+ case 0:
41
+ ctx.textBaseline = 'middle';
42
+
43
+ if (maxWidth) {
44
+ _context.next = 4;
45
+ break;
46
+ }
47
+
48
+ ctx.fillText(text, x, y + lineHeight / 2);
49
+ return _context.abrupt("return", y + lineHeight);
50
+
51
+ case 4:
52
+ _context.next = 6;
53
+ return breakLinesForCanvas(ctx, text, maxWidth, lineHeight);
54
+
55
+ case 6:
56
+ lines = _context.sent;
57
+ lines.forEach(function (l) {
58
+ var width = l.width;
59
+ var left = x;
60
+
61
+ if (textAlign == 'center' && maxWidth) {
62
+ console.log(maxWidth - width);
63
+ console.log('m', maxWidth);
64
+ console.log('w', width);
65
+ left = (maxWidth - width) / 2 + x;
66
+ }
67
+
68
+ l.children.forEach(function (item) {
69
+ if (typeof item == 'string') {
70
+ ctx.fillText(item, left, y + lineHeight / 2);
71
+ left += ctx.measureText(item).width;
72
+ } else {
73
+ item.draw(ctx, left, y);
74
+ left += item.width;
75
+ }
76
+ });
77
+ y += lineHeight;
78
+ });
79
+ return _context.abrupt("return", y);
80
+
81
+ case 9:
82
+ case "end":
83
+ return _context.stop();
84
+ }
85
+ }
86
+ }, _callee);
87
+ }));
88
+ return _drawTextMiddle.apply(this, arguments);
46
89
  }
47
90
 
48
91
  function findBreakPoint(text, width, context) {
@@ -68,18 +111,122 @@ function findBreakPoint(text, width, context) {
68
111
  return -1;
69
112
  }
70
113
 
71
- function breakLinesForCanvas(ctx, text, width) {
72
- var result = [];
73
- var breakPoint = 0;
74
-
75
- while ((breakPoint = findBreakPoint(text, width, ctx)) !== -1) {
76
- result.push(text.substr(0, breakPoint));
77
- text = text.substr(breakPoint);
78
- }
79
-
80
- if (text) {
81
- result.push(text);
82
- }
114
+ function breakLinesForCanvas(_x8, _x9, _x10, _x11) {
115
+ return _breakLinesForCanvas.apply(this, arguments);
116
+ }
83
117
 
84
- return result;
118
+ function _breakLinesForCanvas() {
119
+ _breakLinesForCanvas = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ctx, text, width, lineHeight) {
120
+ var reg, strReg, openDatas, matchStr, OpenDataCompoent, commonStrs, result, breakPoint, w, line, i, t, subText, openData;
121
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
122
+ while (1) {
123
+ switch (_context2.prev = _context2.next) {
124
+ case 0:
125
+ reg = /\$(userName|departmentName)\=(.+?)(\s|$)/g;
126
+ strReg = /\$(?:userName|departmentName)\=.+?(?:\s|$)/;
127
+ openDatas = [];
128
+ matchStr = reg.exec(text);
129
+
130
+ case 4:
131
+ if (!(matchStr != null)) {
132
+ _context2.next = 12;
133
+ break;
134
+ }
135
+
136
+ _context2.next = 7;
137
+ return (0, _openDataPainter["default"])(ctx, {
138
+ openId: matchStr[2],
139
+ type: matchStr[1]
140
+ }, lineHeight, width);
141
+
142
+ case 7:
143
+ OpenDataCompoent = _context2.sent;
144
+ openDatas.push(OpenDataCompoent);
145
+ matchStr = reg.exec(text);
146
+ _context2.next = 4;
147
+ break;
148
+
149
+ case 12:
150
+ commonStrs = text.split(strReg);
151
+ result = [];
152
+ breakPoint = 0;
153
+ w = width;
154
+ line = {
155
+ width: 0,
156
+ children: []
157
+ };
158
+ i = 0;
159
+
160
+ case 18:
161
+ if (!(i < commonStrs.length)) {
162
+ _context2.next = 29;
163
+ break;
164
+ }
165
+
166
+ t = commonStrs[i];
167
+
168
+ while ((breakPoint = findBreakPoint(t, w, ctx)) !== -1) {
169
+ subText = t.substring(0, breakPoint);
170
+ line.children.push(subText);
171
+ line.width += ctx.measureText(subText).width;
172
+ t = t.substring(breakPoint);
173
+ result.push(line);
174
+ line = {
175
+ width: 0,
176
+ children: []
177
+ };
178
+ w = width;
179
+ }
180
+
181
+ if (t) {
182
+ w = w - ctx.measureText(t).width;
183
+ line.children.push(t);
184
+ line.width += ctx.measureText(t).width;
185
+ }
186
+
187
+ openData = openDatas[i];
188
+
189
+ if (openData) {
190
+ _context2.next = 25;
191
+ break;
192
+ }
193
+
194
+ return _context2.abrupt("continue", 26);
195
+
196
+ case 25:
197
+ if (w > openData.width) {
198
+ line.children.push(openData);
199
+ line.width += openData.width;
200
+ w = w - openData.width;
201
+ } else {
202
+ if (line.width) {
203
+ result.push(line);
204
+ line = {
205
+ width: 0,
206
+ children: []
207
+ };
208
+ }
209
+
210
+ line.children.push(openData);
211
+ line.width += openData.width;
212
+ w = width - openData.width;
213
+ }
214
+
215
+ case 26:
216
+ i++;
217
+ _context2.next = 18;
218
+ break;
219
+
220
+ case 29:
221
+ if (line.width) result.push(line);
222
+ return _context2.abrupt("return", result);
223
+
224
+ case 31:
225
+ case "end":
226
+ return _context2.stop();
227
+ }
228
+ }
229
+ }, _callee2);
230
+ }));
231
+ return _breakLinesForCanvas.apply(this, arguments);
85
232
  }
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  .okr-share-card::after {
33
- content: "";
33
+ content: '';
34
34
  position: absolute;
35
35
  height: 70px;
36
36
  bottom: 0;
@@ -70,10 +70,11 @@
70
70
  margin-top: 24px;
71
71
  margin-bottom: 28px;
72
72
  text-align: center;
73
+ word-break: break-all;
73
74
  }
74
75
 
75
76
  .okr-share-card .card-okr__name::before, .okr-share-card .card-okr__name::after {
76
- content: "";
77
+ content: '';
77
78
  display: block;
78
79
  position: absolute;
79
80
  width: 16px;
@@ -114,7 +115,7 @@
114
115
  }
115
116
 
116
117
  .okr-share-card .card-kr__item::before {
117
- content: "";
118
+ content: '';
118
119
  position: absolute;
119
120
  width: 6px;
120
121
  height: 6px;
@@ -169,7 +170,7 @@
169
170
  }
170
171
 
171
172
  .okr-share-card__selector .share-card-button.share::after {
172
- content: "";
173
+ content: '';
173
174
  position: absolute;
174
175
  z-index: -1;
175
176
  background: linear-gradient(180deg, #88bcff 0%, #2879ff 100%);
@@ -39,7 +39,7 @@ function Card(_ref) {
39
39
  }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
40
40
  name: data.user.name,
41
41
  id: data.user.userId
42
- }), "\u7684"), (0, _getLocale.getLocale)("Menu_Title_OKRs")), /*#__PURE__*/_react["default"].createElement("div", {
42
+ }), "\u7684"), (0, _getLocale.getLocale)('Menu_Title_OKRs')), /*#__PURE__*/_react["default"].createElement("div", {
43
43
  className: "okr-share-card-user__dept"
44
44
  }, /*#__PURE__*/_react["default"].createElement(_openData.OpenDepartmentName, {
45
45
  name: data.user.departmentName,
@@ -48,10 +48,10 @@ function Card(_ref) {
48
48
  className: "card-okr__content"
49
49
  }, /*#__PURE__*/_react["default"].createElement("div", {
50
50
  className: "card-okr__name"
51
- }, data.okrName), data.krs.map(function (kr) {
51
+ }, (0, _openData.parseString)(data.okrName)), data.krs.map(function (kr) {
52
52
  return /*#__PURE__*/_react["default"].createElement("div", {
53
53
  className: "card-kr__item"
54
- }, kr);
54
+ }, (0, _openData.parseString)(kr));
55
55
  })));
56
56
  }
57
57
 
@@ -9,22 +9,97 @@ var _index = require("./index");
9
9
 
10
10
  var _utils = require("../common-painter/utils");
11
11
 
12
- function _default(ctx, krs, y) {
13
- if (!krs || !krs.length) return y;
14
- y += 12;
15
- var lineHeight = 22;
16
- var space = 43;
17
- var dotRadius = 7 / 2;
18
- var dotSpace = 8;
19
- ctx.font = "normal 14px/".concat(lineHeight, "px arial,sans-serif");
20
- krs.forEach(function (kr) {
21
- ctx.beginPath();
22
- ctx.arc(space - dotSpace - dotRadius, y + lineHeight / 2, dotRadius, 0, Math.PI * 2);
23
- ctx.fillStyle = "#FECCC6";
24
- ctx.fill();
25
- ctx.closePath();
26
- ctx.fillStyle = "#3F4755";
27
- y = (0, _utils.drawTextMiddle)(ctx, kr, space, y, lineHeight, _index.pinkCardwidth - space * 2) + 8;
28
- });
29
- return y - 8;
12
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
13
+
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+
18
+ 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); } }
19
+
20
+ 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); }); }; }
21
+
22
+ function _default(_x, _x2, _x3) {
23
+ return _ref.apply(this, arguments);
24
+ }
25
+
26
+ function _ref() {
27
+ _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, krs, y) {
28
+ var lineHeight, space, dotRadius, dotSpace, _iterator, _step, kr;
29
+
30
+ return regeneratorRuntime.wrap(function _callee$(_context) {
31
+ while (1) {
32
+ switch (_context.prev = _context.next) {
33
+ case 0:
34
+ if (!(!krs || !krs.length)) {
35
+ _context.next = 2;
36
+ break;
37
+ }
38
+
39
+ return _context.abrupt("return", y);
40
+
41
+ case 2:
42
+ y += 12;
43
+ lineHeight = 22;
44
+ space = 43;
45
+ dotRadius = 7 / 2;
46
+ dotSpace = 8;
47
+ ctx.font = "normal 14px/".concat(lineHeight, "px arial,sans-serif");
48
+ _iterator = _createForOfIteratorHelper(krs);
49
+ _context.prev = 9;
50
+
51
+ _iterator.s();
52
+
53
+ case 11:
54
+ if ((_step = _iterator.n()).done) {
55
+ _context.next = 25;
56
+ break;
57
+ }
58
+
59
+ kr = _step.value;
60
+ ctx.beginPath();
61
+ ctx.arc(space - dotSpace - dotRadius, y + lineHeight / 2, dotRadius, 0, Math.PI * 2);
62
+ ctx.fillStyle = '#FECCC6';
63
+ ctx.fill();
64
+ ctx.closePath();
65
+ ctx.fillStyle = '#3F4755';
66
+ _context.next = 21;
67
+ return (0, _utils.drawTextMiddle)(ctx, kr, space, y, lineHeight, _index.pinkCardwidth - space * 2);
68
+
69
+ case 21:
70
+ _context.t0 = _context.sent;
71
+ y = _context.t0 + 8;
72
+
73
+ case 23:
74
+ _context.next = 11;
75
+ break;
76
+
77
+ case 25:
78
+ _context.next = 30;
79
+ break;
80
+
81
+ case 27:
82
+ _context.prev = 27;
83
+ _context.t1 = _context["catch"](9);
84
+
85
+ _iterator.e(_context.t1);
86
+
87
+ case 30:
88
+ _context.prev = 30;
89
+
90
+ _iterator.f();
91
+
92
+ return _context.finish(30);
93
+
94
+ case 33:
95
+ return _context.abrupt("return", y - 8);
96
+
97
+ case 34:
98
+ case "end":
99
+ return _context.stop();
100
+ }
101
+ }
102
+ }, _callee, null, [[9, 27, 30, 33]]);
103
+ }));
104
+ return _ref.apply(this, arguments);
30
105
  }
@@ -50,12 +50,12 @@ function _drawPinkCard() {
50
50
  window.WWOpenData.initCanvas();
51
51
  }
52
52
 
53
- canvas = document.createElement("canvas");
54
- ctx = canvas.getContext("2d");
53
+ canvas = document.createElement('canvas');
54
+ ctx = canvas.getContext('2d');
55
55
  (0, _setSize["default"])(canvas, ctx, pinkCardwidth, pinkCardMaxHeight);
56
56
  ctx.beginPath();
57
57
  ctx.rect(0, 0, pinkCardwidth, pinkCardMaxHeight);
58
- ctx.fillStyle = "#FFF3ED";
58
+ ctx.fillStyle = '#FFF3ED';
59
59
  ctx.fill();
60
60
  ctx.closePath();
61
61
  y = 54;
@@ -88,29 +88,37 @@ function _drawPinkCard() {
88
88
  case 20:
89
89
  y = _context.sent;
90
90
  _context.next = 23;
91
- return (0, _drawQuote["default"])(ctx, y, "left");
91
+ return (0, _drawQuote["default"])(ctx, y, 'left');
92
92
 
93
93
  case 23:
94
94
  y = _context.sent;
95
- y = (0, _drawOKrName["default"])(ctx, shareData.okrName, y);
96
- _context.next = 27;
97
- return (0, _drawQuote["default"])(ctx, y, "right");
95
+ _context.next = 26;
96
+ return (0, _drawOKrName["default"])(ctx, shareData.okrName, y);
98
97
 
99
- case 27:
98
+ case 26:
99
+ y = _context.sent;
100
+ _context.next = 29;
101
+ return (0, _drawQuote["default"])(ctx, y, 'right');
102
+
103
+ case 29:
104
+ y = _context.sent;
105
+ _context.next = 32;
106
+ return (0, _drawKrs["default"])(ctx, shareData.krs, y);
107
+
108
+ case 32:
100
109
  y = _context.sent;
101
- y = (0, _drawKrs["default"])(ctx, shareData.krs, y);
102
110
  height = Math.min(Math.max(y + 143, pinkCardMinHeight), pinkCardMaxHeight);
103
111
  data = ctx.getImageData(0, 0, pinkCardwidth, height);
104
112
  (0, _setSize["default"])(canvas, ctx, pinkCardwidth, height);
105
113
  ctx.putImageData(data, 0, 0);
106
- _context.next = 35;
114
+ _context.next = 39;
107
115
  return (0, _utils.drawImage)(ctx, _images.bottom, 0, height - 128, pinkCardwidth, 128);
108
116
 
109
- case 35:
117
+ case 39:
110
118
  dataUrl = canvas.toDataURL();
111
119
  return _context.abrupt("return", dataUrl);
112
120
 
113
- case 37:
121
+ case 41:
114
122
  case "end":
115
123
  return _context.stop();
116
124
  }
@@ -53,7 +53,7 @@ function _ref() {
53
53
  height: lineHeight,
54
54
  draw: function draw(ctx, x, y) {
55
55
  ctx.save();
56
- ctx.textBaseline = "middle";
56
+ ctx.textBaseline = 'middle';
57
57
  ctx.beginPath();
58
58
  ctx.rect(x, y, actualWidth, lineHeight);
59
59
  ctx.clip();
@@ -76,8 +76,9 @@ function _ref() {
76
76
  var getOpenData = function getOpenData(_ref2) {
77
77
  var id = _ref2.id,
78
78
  name = _ref2.name,
79
- type = _ref2.type;
80
- var openId = (0, _openData.getOpenId)(id, type);
79
+ type = _ref2.type,
80
+ openId = _ref2.openId;
81
+ openId = openId || (0, _openData.getOpenId)(id, type);
81
82
  if (!window.WWOpenData || !openId) return Promise.resolve(name);
82
83
  return new Promise(function (resolve, reject) {
83
84
  window.WWOpenData.prefetch({
@@ -93,7 +94,7 @@ var getOpenData = function getOpenData(_ref2) {
93
94
  if (data && data.items[0]) {
94
95
  resolve(data.items[0].data);
95
96
  } else {
96
- resolve(name);
97
+ resolve(name || '');
97
98
  }
98
99
  });
99
100
  });
@@ -119,7 +120,7 @@ exports.setSize = setSize;
119
120
  var fittingString = function fittingString(_ctx, str, maxWidth) {
120
121
  var strWidth = _ctx.measureText(str).width;
121
122
 
122
- var ellipsis = "";
123
+ var ellipsis = '';
123
124
 
124
125
  var ellipsisWidth = _ctx.measureText(ellipsis).width;
125
126
 
@@ -0,0 +1,7 @@
1
+ // annualNum: "2022" 年份
2
+ // cycleType: "-1" 全部周期
3
+ // endDate: ""
4
+ // startDate: ""
5
+ // yqmNum: "0"
6
+ //
7
+ "use strict";
@@ -41,12 +41,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
41
41
 
42
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
43
 
44
- function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
45
-
46
44
  var prefix = "publish-dynamic-modal";
47
-
48
- var PublishDynamicModal = function PublishDynamicModal(_ref) {
49
- _objectDestructuringEmpty(_ref);
45
+ var PublishDynamicModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
46
+ var onSubmitSuccess = _ref.onSubmitSuccess;
50
47
 
51
48
  var _useState = (0, _react.useState)(false),
52
49
  _useState2 = _slicedToArray(_useState, 2),
@@ -82,10 +79,10 @@ var PublishDynamicModal = function PublishDynamicModal(_ref) {
82
79
  localStorage.removeItem("mblogLocalStroage_".concat((0, _bsGlobal.getUserInfo)().Id, "_commentsTypeKey_").concat(isShare ? "share" : "announcement"));
83
80
  setVisible(false);
84
81
  setSubmitStatus(1);
85
- setTimeout(function () {
86
- // @ts-ignore 跳到我的发布页签
87
- window.setTabsToPublish && window.setTabsToPublish();
88
- }, 2000);
82
+
83
+ if (onSubmitSuccess) {
84
+ onSubmitSuccess();
85
+ }
89
86
  } else {
90
87
  _toast["default"].Error(resp.Message, {
91
88
  canClose: false
@@ -146,6 +143,13 @@ var PublishDynamicModal = function PublishDynamicModal(_ref) {
146
143
  setVisible(true);
147
144
  };
148
145
 
146
+ (0, _react.useImperativeHandle)(ref, function () {
147
+ return {
148
+ hide: hidePublishDynamicModal,
149
+ showShareModal: showPublishShareDynamicModal,
150
+ showAnnouncementModal: showPublishAnnouncementDynamicModal
151
+ };
152
+ });
149
153
  (0, _react.useEffect)(function () {
150
154
  // @ts-ignore
151
155
  window.hidePublishDynamicModal = hidePublishDynamicModal; // @ts-ignore
@@ -188,7 +192,9 @@ var PublishDynamicModal = function PublishDynamicModal(_ref) {
188
192
  ,
189
193
  onMblogSubmit: onMblogSubmit
190
194
  })));
195
+ });
196
+ PublishDynamicModal.defaultProps = {
197
+ onSubmitSuccess: function onSubmitSuccess() {}
191
198
  };
192
-
193
199
  var _default = PublishDynamicModal;
194
200
  exports["default"] = _default;
@@ -45,7 +45,7 @@ var RangeSelectorPop = /*#__PURE__*/function (_PureComponent) {
45
45
  var _super = _createSuper(RangeSelectorPop);
46
46
 
47
47
  function RangeSelectorPop() {
48
- var _this;
48
+ var _temp, _this;
49
49
 
50
50
  _classCallCheck(this, RangeSelectorPop);
51
51
 
@@ -53,7 +53,7 @@ var RangeSelectorPop = /*#__PURE__*/function (_PureComponent) {
53
53
  args[_key] = arguments[_key];
54
54
  }
55
55
 
56
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function () {
56
+ return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function () {
57
57
  var isDisabled = _this.props.isDisabled;
58
58
  if (isDisabled) return; // @ts-ignore
59
59
 
@@ -61,7 +61,7 @@ var RangeSelectorPop = /*#__PURE__*/function (_PureComponent) {
61
61
  }, _this.handleHide = function () {
62
62
  // @ts-ignore
63
63
  _this.refs.pop.hide();
64
- }, _assertThisInitialized(_this)));
64
+ }, _temp));
65
65
  }
66
66
 
67
67
  _createClass(RangeSelectorPop, [{
@@ -46,7 +46,7 @@ var BlockSchema = /*#__PURE__*/function (_BaseSchema) {
46
46
  var _super = _createSuper(BlockSchema);
47
47
 
48
48
  function BlockSchema() {
49
- var _this;
49
+ var _temp, _this;
50
50
 
51
51
  _classCallCheck(this, BlockSchema);
52
52
 
@@ -54,7 +54,7 @@ var BlockSchema = /*#__PURE__*/function (_BaseSchema) {
54
54
  args[_key] = arguments[_key];
55
55
  }
56
56
 
57
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.group = 'block', _this.content = 'inline*', _this.inline = false, _this.defining = true, _this.draggable = false, _this.selectable = false, _assertThisInitialized(_this)));
57
+ return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.group = 'block', _this.content = 'inline*', _this.inline = false, _this.defining = true, _this.draggable = false, _this.selectable = false, _temp));
58
58
  }
59
59
 
60
60
  _createClass(BlockSchema, [{
@@ -75,7 +75,7 @@ var InlineSchema = /*#__PURE__*/function (_BaseSchema2) {
75
75
  var _super2 = _createSuper(InlineSchema);
76
76
 
77
77
  function InlineSchema() {
78
- var _this2;
78
+ var _temp2, _this2;
79
79
 
80
80
  _classCallCheck(this, InlineSchema);
81
81
 
@@ -83,7 +83,7 @@ var InlineSchema = /*#__PURE__*/function (_BaseSchema2) {
83
83
  args[_key2] = arguments[_key2];
84
84
  }
85
85
 
86
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.group = 'inline', _this2.inclusive = true, _assertThisInitialized(_this2)));
86
+ return _possibleConstructorReturn(_this2, (_temp2 = _this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.group = 'inline', _this2.inclusive = true, _temp2));
87
87
  }
88
88
 
89
89
  _createClass(InlineSchema, [{
@@ -104,7 +104,7 @@ var AtomSchema = /*#__PURE__*/function (_BaseSchema3) {
104
104
  var _super3 = _createSuper(AtomSchema);
105
105
 
106
106
  function AtomSchema() {
107
- var _this3;
107
+ var _temp3, _this3;
108
108
 
109
109
  _classCallCheck(this, AtomSchema);
110
110
 
@@ -112,7 +112,7 @@ var AtomSchema = /*#__PURE__*/function (_BaseSchema3) {
112
112
  args[_key3] = arguments[_key3];
113
113
  }
114
114
 
115
- return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.isLeaf = true, _this3.draggable = true, _assertThisInitialized(_this3)));
115
+ return _possibleConstructorReturn(_this3, (_temp3 = _this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.isLeaf = true, _this3.draggable = true, _temp3));
116
116
  }
117
117
 
118
118
  return _createClass(AtomSchema);