@titaui/pc 1.11.52-beta.2 → 1.11.52-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 (138) 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 +31 -20
  13. package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
  14. package/lib/components/create-okr-modal/index.js +197 -132
  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 +54 -57
  18. package/lib/components/create-okr-modal/style.js +5 -5
  19. package/lib/components/drop-selector/index.js +1 -2
  20. package/lib/components/dynamic/components/title/index.js +1 -1
  21. package/lib/components/dynamic/constant.js +1 -1
  22. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
  23. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
  24. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
  25. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
  26. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
  27. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
  28. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
  29. package/lib/components/eReport/eReportLists/reportList.js +29 -30
  30. package/lib/components/eReport/eReportShare/style.js +1 -1
  31. package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
  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/components/user-message/components/inform/inform-item.js +1 -1
  35. package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
  36. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  37. package/lib/components/okr-detail/components/header/edit-name.js +76 -39
  38. package/lib/components/okr-detail/components/header/index.css +122 -41
  39. package/lib/components/okr-detail/components/header/index.js +45 -48
  40. package/lib/components/okr-detail/components/header/o-classify.js +152 -0
  41. package/lib/components/okr-detail/components/header/o-name.js +7 -5
  42. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +81 -43
  43. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
  44. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
  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 +11 -5
  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/okr-list/index.css +9 -0
  52. package/lib/components/okr-detail/okr-list/index.js +25 -25
  53. package/lib/components/okr-detail/request-apis.js +73 -69
  54. package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
  55. package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
  56. package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
  57. package/lib/components/okr-flow/child-node/kr-node.js +3 -1
  58. package/lib/components/okr-flow/child-node/work-node.js +3 -1
  59. package/lib/components/okr-flow/export-modal/index.js +26 -16
  60. package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
  61. package/lib/components/okr-progress/components/o-progress/index.js +3 -1
  62. package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
  63. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
  64. package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
  65. package/lib/components/okr-share/common-painter/utils.js +183 -36
  66. package/lib/components/okr-share/index.css +5 -4
  67. package/lib/components/okr-share/pink-card/card.js +3 -3
  68. package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
  69. package/lib/components/okr-share/pink-card/index.js +20 -12
  70. package/lib/components/open-data-painter/index.js +6 -5
  71. package/lib/components/period-selector/interface.js +7 -0
  72. package/lib/components/progress/circle-progress/index.css +2 -0
  73. package/lib/components/search-input/index.css +1 -1
  74. package/lib/components/search-key-handle/index.js +12 -10
  75. package/lib/components/select-layer/index.css +1 -1
  76. package/lib/components/task-relation-modal/helper.js +139 -2
  77. package/lib/components/task-relation-modal/image/loading.gif +0 -0
  78. package/lib/components/task-relation-modal/index.js +9 -0
  79. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
  80. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +267 -0
  81. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
  82. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
  83. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +131 -0
  84. package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
  85. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
  86. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +191 -0
  87. package/lib/components/task-relation-modal/request-api.js +28 -2
  88. package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
  89. package/lib/components/task-relation-modal/search/principal.js +36 -19
  90. package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
  91. package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
  92. package/lib/components/task-relation-modal/search/task-relation.js +83 -0
  93. package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
  94. package/lib/components/task-relation-modal/search/work-relation.js +83 -0
  95. package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
  96. package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
  97. package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
  98. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
  99. package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
  100. package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
  101. package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
  102. package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
  103. package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
  104. package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
  105. package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -1
  106. package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
  107. package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
  108. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  109. package/lib/components/task-relation-modal/work-relation/index.css +0 -0
  110. package/lib/components/task-relation-modal/work-relation/index.js +256 -0
  111. package/lib/components/task-tree/task-item-node/index.css +2 -2
  112. package/lib/components/tooltip/index.js +3 -0
  113. package/lib/components/tooltip/tooltip-rows/index.css +26 -0
  114. package/lib/components/tooltip/tooltip-rows/index.js +106 -0
  115. package/lib/components/upload/components/uploadedPreview.js +18 -18
  116. package/lib/components/upload/index.js +57 -29
  117. package/lib/components/user-selector/category-selector-panel/index.js +6 -1
  118. package/lib/components/user-selector/category-selector-panel/subordinate-tree.js +61 -0
  119. package/lib/components/user-selector/constant.js +10 -2
  120. package/lib/components/user-selector/empty/index.css +5 -0
  121. package/lib/components/user-selector/empty/index.js +9 -3
  122. package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
  123. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +16 -15
  124. package/lib/components/user-selector/images/no-auth.png +0 -0
  125. package/lib/components/user-selector/request-apis.js +28 -9
  126. package/lib/components/user-selector/searched-panel/index.js +32 -12
  127. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
  128. package/lib/components/wechat-btn/index.css +5 -1
  129. package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
  130. package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
  131. package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
  132. package/lib/pages/new-okr-list/header/index.js +16 -18
  133. package/lib/utils/auth.js +12 -0
  134. package/lib/utils/hooks.js +19 -5
  135. package/lib/utils/open-data.js +214 -66
  136. package/lib/utils/planDataJson.js +11115 -0
  137. package/lib/utils/tita-okr-cycle.js +24 -0
  138. package/package.json +2 -1
@@ -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";
@@ -7,4 +7,6 @@
7
7
  .titaui-progress-circle .text-content {
8
8
  font-size: 12px;
9
9
  color: #89919f;
10
+ overflow: hidden;
11
+ text-overflow: ellipsis;
10
12
  }
@@ -41,7 +41,7 @@
41
41
  .search-input-box > input {
42
42
  background: #ffffff;
43
43
  border: 1px solid #e9edf0;
44
- border-radius: 5px;
44
+ border-radius: 16px;
45
45
  width: 100%;
46
46
  height: 100%;
47
47
  padding: 0 44px 0 11px;
@@ -5,36 +5,38 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
+ var _openData = require("../../utils/open-data");
9
+
8
10
  var _react = _interopRequireDefault(require("react"));
9
11
 
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
13
 
12
14
  var SearchKeyHandle = function SearchKeyHandle(_ref) {
13
15
  var _ref$str = _ref.str,
14
- str = _ref$str === void 0 ? "" : _ref$str,
16
+ str = _ref$str === void 0 ? '' : _ref$str,
15
17
  _ref$keyWord = _ref.keyWord,
16
- keyWord = _ref$keyWord === void 0 ? "" : _ref$keyWord,
18
+ keyWord = _ref$keyWord === void 0 ? '' : _ref$keyWord,
17
19
  _ref$color = _ref.color,
18
- color = _ref$color === void 0 ? "#F05E5E" : _ref$color;
19
- if (!str || !keyWord) return /*#__PURE__*/_react["default"].createElement("span", null, str);
20
+ color = _ref$color === void 0 ? '#F05E5E' : _ref$color;
21
+ if (!str || !keyWord) return /*#__PURE__*/_react["default"].createElement("span", null, (0, _openData.parseString)(str));
20
22
  var result = str.split(keyWord);
21
23
  return /*#__PURE__*/_react["default"].createElement("span", null, result.map(function (item, index) {
22
24
  if (index !== result.length - 1) {
23
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, item, /*#__PURE__*/_react["default"].createElement("span", {
25
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (0, _openData.parseString)(item), /*#__PURE__*/_react["default"].createElement("span", {
24
26
  style: {
25
27
  color: color
26
28
  }
27
- }, keyWord));
29
+ }, (0, _openData.parseString)(keyWord)));
28
30
  }
29
31
 
30
- return item;
32
+ return (0, _openData.parseString)(item);
31
33
  }));
32
34
  };
33
35
 
34
36
  SearchKeyHandle.defaultProps = {
35
- str: "",
36
- keyWord: "",
37
- color: ""
37
+ str: '',
38
+ keyWord: '',
39
+ color: ''
38
40
  };
39
41
  var _default = SearchKeyHandle;
40
42
  exports["default"] = _default;
@@ -42,7 +42,7 @@
42
42
  box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
43
43
  border: 1px solid #f0f2f5;
44
44
  position: relative;
45
- border-radius: 4px;
45
+ border-radius: 12px;
46
46
  padding: 16px 0;
47
47
  font-weight: 400;
48
48
  width: 100%;