@titaui/pc 1.9.27 → 1.9.31

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 (119) hide show
  1. package/lib/components/common-share/index.css +2 -2
  2. package/lib/components/confidence/index.css +1 -2
  3. package/lib/components/confidence/index.js +3 -3
  4. package/lib/components/create-okr-modal/fields/index.css +1 -0
  5. package/lib/components/create-okr-modal/fields/input-with-err-popup.js +3 -1
  6. package/lib/components/dialog/index.css +21 -0
  7. package/lib/components/dialog/index.js +25 -5
  8. package/lib/components/dialog/loading.png +0 -0
  9. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +1 -0
  10. package/lib/components/dynamic/dynamic-item/dynamic-share-to-dynamic/index.js +3 -1
  11. package/lib/components/grid-layout/commen-components/scroll-tips.js +4 -4
  12. package/lib/components/grid-layout/near-visitors/visitor.js +2 -2
  13. package/lib/components/grid-layout/sub-employee-okr/person-okr.js +2 -2
  14. package/lib/components/grid-page/commen-components/scroll-tips.js +4 -4
  15. package/lib/components/grid-page/near-visitors/visitor.js +2 -2
  16. package/lib/components/help-card/image/liaojie.svg +9 -0
  17. package/lib/components/help-card/index.css +7 -6
  18. package/lib/components/help-card/index.js +1 -1
  19. package/lib/components/hr-header/arrow.png +0 -0
  20. package/lib/components/hr-header/index.css +92 -0
  21. package/lib/components/hr-header/index.js +156 -0
  22. package/lib/components/menus/components/flip-menu-card/index.css +1 -0
  23. package/lib/components/menus/components/flip-menu-card/index.js +8 -0
  24. package/lib/components/menus/export-modules/appraisal-menus/index.js +4 -4
  25. package/lib/components/menus/export-modules/okr-menus/depart-menus/index.js +2 -2
  26. package/lib/components/menus/export-modules/okr-menus/okr-front-menus.js +4 -4
  27. package/lib/components/menus/export-modules/okr-menus/subordinate-menus/index.js +4 -4
  28. package/lib/components/nav-top/components/user-message/components/reply/reply-item.js +1 -1
  29. package/lib/components/nav-top/components/user-own-menu/utils.js +2 -2
  30. package/lib/components/okr-detail/base-info/o-desc/index.js +3 -1
  31. package/lib/components/okr-detail/components/editable-input/index.js +4 -2
  32. package/lib/components/okr-detail/components/header/edit-name.js +3 -1
  33. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -1
  34. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +3 -1
  35. package/lib/components/okr-detail/okr-list/create-kr-item/heart.js +1 -1
  36. package/lib/components/okr-detail/okr-list/create-kr-item/index.js +1 -1
  37. package/lib/components/okr-detail/schedule/components/o-progress/index.js +3 -1
  38. package/lib/components/okr-progress/components/o-progress/index.js +3 -1
  39. package/lib/components/okr-progress-modal/index.js +3 -1
  40. package/lib/components/okr-share/index.css +2 -2
  41. package/lib/components/scrollbar/simplebar/simplebar.js +2 -2
  42. package/lib/components/search-dropdown/index.css +1 -0
  43. package/lib/components/user-selector/export-modules/duties-selector/index.js +5 -3
  44. package/lib/components/user-selector/select-tree/choose-tree/index.js +10 -2
  45. package/lib/components-v1/textarea/index.js +3 -1
  46. package/lib/pages/aha2021/index.css +13 -3
  47. package/lib/pages/aha2021/index.js +24 -20
  48. package/lib/pages/aha2021/kefu.svg +50 -0
  49. package/lib/pages/group-management/tree/group-form/index.js +4 -2
  50. package/lib/pages/home/components/data-list/index.css +26 -11
  51. package/lib/pages/home/components/data-list/index.js +2 -2
  52. package/lib/pages/home/components/data-list/nav-selector/index.js +23 -95
  53. package/lib/pages/home/components/data-list/table/columns/index.js +7 -7
  54. package/lib/pages/home/components/data-list/table/columns/updateTime.js +3 -1
  55. package/lib/pages/home/components/data-list/table/utils-function.js +44 -62
  56. package/lib/pages/home-page-data-list/index.js +2 -2
  57. package/lib/utils/bs-global.js +1 -1
  58. package/lib/utils/date-test-change.js +18 -55
  59. package/lib/utils/i18n-front-translate.js +12 -2
  60. package/package.json +1 -1
  61. package/src/components/common-share/index.scss +2 -2
  62. package/src/components/confidence/index.scss +1 -2
  63. package/src/components/confidence/index.tsx +3 -3
  64. package/src/components/create-okr-modal/fields/index.scss +1 -0
  65. package/src/components/create-okr-modal/fields/input-with-err-popup.tsx +2 -1
  66. package/src/components/dialog/index.js +19 -5
  67. package/src/components/dialog/index.scss +44 -2
  68. package/src/components/dialog/loading.png +0 -0
  69. package/src/components/dynamic/dynamic-item/dynamic-create-o/index.scss +1 -0
  70. package/src/components/dynamic/dynamic-item/dynamic-share-to-dynamic/index.tsx +2 -1
  71. package/src/components/grid-layout/commen-components/scroll-tips.tsx +5 -5
  72. package/src/components/grid-layout/near-visitors/visitor.tsx +3 -3
  73. package/src/components/grid-layout/sub-employee-okr/person-okr.tsx +3 -3
  74. package/src/components/grid-page/commen-components/scroll-tips.tsx +5 -5
  75. package/src/components/grid-page/near-visitors/visitor.tsx +3 -3
  76. package/src/components/help-card/image/liaojie.svg +9 -0
  77. package/src/components/help-card/index.scss +7 -6
  78. package/src/components/help-card/index.tsx +1 -1
  79. package/src/components/hr-header/arrow.png +0 -0
  80. package/src/components/hr-header/index.scss +82 -0
  81. package/src/components/hr-header/index.tsx +117 -0
  82. package/src/components/menus/components/flip-menu-card/index.scss +1 -0
  83. package/src/components/menus/components/flip-menu-card/index.tsx +7 -0
  84. package/src/components/menus/export-modules/appraisal-menus/index.tsx +4 -3
  85. package/src/components/menus/export-modules/okr-menus/depart-menus/index.tsx +2 -1
  86. package/src/components/menus/export-modules/okr-menus/okr-front-menus.tsx +4 -3
  87. package/src/components/menus/export-modules/okr-menus/subordinate-menus/index.tsx +4 -3
  88. package/src/components/nav-top/components/user-message/components/reply/reply-item.tsx +1 -1
  89. package/src/components/nav-top/components/user-own-menu/utils.ts +2 -2
  90. package/src/components/okr-detail/base-info/o-desc/index.tsx +2 -1
  91. package/src/components/okr-detail/components/editable-input/index.tsx +3 -2
  92. package/src/components/okr-detail/components/header/edit-name.tsx +2 -1
  93. package/src/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.tsx +2 -1
  94. package/src/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.tsx +2 -1
  95. package/src/components/okr-detail/okr-list/create-kr-item/heart.js +1 -1
  96. package/src/components/okr-detail/okr-list/create-kr-item/index.tsx +1 -1
  97. package/src/components/okr-detail/schedule/components/o-progress/index.tsx +2 -1
  98. package/src/components/okr-progress/components/o-progress/index.tsx +2 -1
  99. package/src/components/okr-progress-modal/index.tsx +2 -1
  100. package/src/components/okr-share/index.scss +2 -2
  101. package/src/components/scrollbar/simplebar/simplebar.js +2 -1
  102. package/src/components/search-dropdown/index.scss +1 -0
  103. package/src/components/user-selector/export-modules/duties-selector/index.tsx +4 -2
  104. package/src/components/user-selector/select-tree/choose-tree/index.tsx +3 -1
  105. package/src/components-v1/textarea/index.tsx +2 -1
  106. package/src/pages/aha2021/index.scss +13 -3
  107. package/src/pages/aha2021/index.tsx +33 -13
  108. package/src/pages/aha2021/kefu.svg +50 -0
  109. package/src/pages/group-management/tree/group-form/index.js +3 -2
  110. package/src/pages/home/components/data-list/index.scss +22 -9
  111. package/src/pages/home/components/data-list/index.tsx +4 -4
  112. package/src/pages/home/components/data-list/nav-selector/index.tsx +81 -119
  113. package/src/pages/home/components/data-list/table/columns/index.tsx +7 -7
  114. package/src/pages/home/components/data-list/table/columns/updateTime.tsx +5 -4
  115. package/src/pages/home/components/data-list/table/utils-function.ts +113 -105
  116. package/src/pages/home-page-data-list/index.tsx +4 -4
  117. package/src/utils/bs-global.js +1 -1
  118. package/src/utils/date-test-change.ts +18 -57
  119. package/src/utils/i18n-front-translate.ts +8 -0
@@ -13,6 +13,8 @@ var _drawerManager = _interopRequireDefault(require("../../../../../components/d
13
13
 
14
14
  var _columns = require("./columns");
15
15
 
16
+ var _periodSelector = _interopRequireDefault(require("../../../../../components/period-selector"));
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
18
20
  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; } } }; }
@@ -25,17 +27,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
25
27
  var cycleFilterModels = function cycleFilterModels(cycleTime) {
26
28
  var res = [{
27
29
  "CptFilterName": "cycle_type",
28
- "CptFilterValue": cycleTime.cycleType === '-1' ? '0,1,2,3,4,5' : cycleTime.cycleType
30
+ "CptFilterValue": cycleTime.cycleType === "-1" ? "0,1,2,3,4,5" : cycleTime.cycleType
29
31
  }];
30
32
 
31
- if (cycleTime.cycleType !== '-1') {
33
+ if (cycleTime.cycleType !== "-1") {
32
34
  res.push({
33
35
  "CptFilterName": "annual_num",
34
36
  "CptFilterValue": cycleTime.yearNum
35
37
  });
36
38
  }
37
39
 
38
- if (cycleTime.cycleType === '2' || cycleTime.cycleType === '3' || cycleTime.cycleType === '4' || cycleTime.cycleType === '5') {
40
+ if (cycleTime.cycleType === "2" || cycleTime.cycleType === "3" || cycleTime.cycleType === "4" || cycleTime.cycleType === "5") {
39
41
  res.push({
40
42
  "CptFilterName": "yqm_num",
41
43
  "CptFilterValue": cycleTime.yqmNum
@@ -47,50 +49,30 @@ var cycleFilterModels = function cycleFilterModels(cycleTime) {
47
49
 
48
50
 
49
51
  var getComponentDataProp = {
50
- 'all': 'allOkr',
51
- 'hadAlign': 'MyParentOkrCount',
52
- 'hadNotAlign': 'MyNoParentOkrCount',
53
- 'hadUpdate': 'allMyProgressCount',
54
- 'hadNotUpdate': 'allMyNoProgressCount',
55
- 'normalOkr': 'MyNormalOkrCount',
56
- 'riskOkr': 'MyRiskOkrCount',
57
- 'dalyOkr': 'MyDlayOkrCount',
58
- 'endOkr': 'MyFinishOkrCount'
52
+ "all": "allOkr",
53
+ "hadAlign": "MyParentOkrCount",
54
+ "hadNotAlign": "MyNoParentOkrCount",
55
+ "hadUpdate": "allMyProgressCount",
56
+ "hadNotUpdate": "allMyNoProgressCount",
57
+ "normalOkr": "MyNormalOkrCount",
58
+ "riskOkr": "MyRiskOkrCount",
59
+ "dalyOkr": "MyDlayOkrCount",
60
+ "endOkr": "MyFinishOkrCount"
59
61
  }; // 周期转换
60
62
 
61
63
  var cycleTimeDisplay = function cycleTimeDisplay(cycleType, annualNum, yqmNum) {
62
- switch (cycleType) {
63
- case 1:
64
- return "".concat(annualNum, "\u5E74");
65
-
66
- case 2:
67
- return "".concat(annualNum, "\u5E74 \u7B2C").concat(numberToWord(yqmNum), "\u5B63\u5EA6");
68
-
69
- case 3:
70
- return "".concat(annualNum, "\u5E74 ").concat(yqmNum, "\u6708");
71
-
72
- case 4:
73
- return "".concat(annualNum, "\u5E74 ").concat(yqmNum, "-").concat((yqmNum + 1) % 12 || 12, "\u6708");
74
-
75
- case 5:
76
- return "".concat(annualNum, "\u5E74 ").concat(yqmNum == 1 ? '上' : '下', "\u534A\u5E74");
77
-
78
- default:
79
- return '-';
80
- }
81
- }; //数字大小写转换
82
-
83
-
84
- var numberToWord = function numberToWord(num) {
85
- var arr = ['一', '二', '三', '四'];
86
- return arr[num - 1];
64
+ return _periodSelector["default"].formatPeriod({
65
+ annualNum: annualNum,
66
+ cycleType: cycleType,
67
+ yqmNum: yqmNum
68
+ });
87
69
  }; //ComponentId转换
88
70
 
89
71
 
90
72
  var ComponentIdMap = {
91
- align: 'Align-OKR-Target',
92
- update: 'OKR-Progress-Display',
93
- target: 'OKR-Target-Display'
73
+ align: "Align-OKR-Target",
74
+ update: "OKR-Progress-Display",
75
+ target: "OKR-Target-Display"
94
76
  };
95
77
 
96
78
  var _default = function _default(source, params) {
@@ -120,7 +102,7 @@ var _default = function _default(source, params) {
120
102
  var item = _step.value;
121
103
  listData.push({
122
104
  columnId: item.workId,
123
- okrType: 'O',
105
+ okrType: "O",
124
106
  okrName: item.workName,
125
107
  cycleTime: cycleTimeDisplay(item.cycleType, item.annualNum, item.yqmnum),
126
108
  userInfo: {
@@ -131,18 +113,18 @@ var _default = function _default(source, params) {
131
113
  },
132
114
  riskLevel: item.manualRiskLevel,
133
115
  progress: item.progress,
134
- typeName: item.parentId > 0 || item.parentKrId > 0 ? (0, _getLocale.getLocale)('OKR_Db_Aligned') : (0, _getLocale.getLocale)('OKR_Db_Unaligned'),
116
+ typeName: item.parentId > 0 || item.parentKrId > 0 ? (0, _getLocale.getLocale)("OKR_Db_Aligned") : (0, _getLocale.getLocale)("OKR_Db_Unaligned"),
135
117
  updateTime: item.lastUpdatedDate,
136
118
  status: item.status,
137
119
  createDate: item.CreateDate,
138
120
  behave: function behave() {
139
- return _drawerManager["default"].open('okrDetail', {
121
+ return _drawerManager["default"].open("okrDetail", {
140
122
  okrId: item.workId
141
123
  });
142
124
  }
143
125
  });
144
126
 
145
- if (item.Krs.length && source !== 'align') {
127
+ if (item.Krs.length && source !== "align") {
146
128
  var _iterator2 = _createForOfIteratorHelper(item.Krs),
147
129
  _step2;
148
130
 
@@ -151,7 +133,7 @@ var _default = function _default(source, params) {
151
133
  var item1 = _step2.value;
152
134
  listData.push({
153
135
  columnId: item1.mileStoneId,
154
- okrType: 'KR',
136
+ okrType: "KR",
155
137
  okrName: item1.mileStoneName,
156
138
  cycleTime: "".concat(item1.startDate.slice(-5), "~").concat(item1.endDate.slice(-5)),
157
139
  userInfo: {
@@ -166,7 +148,7 @@ var _default = function _default(source, params) {
166
148
  updateTime: item1.progressDescriptionDate,
167
149
  createDate: item1.CreateDate,
168
150
  behave: function behave() {
169
- return _drawerManager["default"].open('krDetail', {
151
+ return _drawerManager["default"].open("krDetail", {
170
152
  krId: item1.mileStoneId
171
153
  });
172
154
  }
@@ -201,7 +183,7 @@ var _default = function _default(source, params) {
201
183
  dataTotal: dataTotal
202
184
  });
203
185
  } else {
204
- reject('请求失败');
186
+ reject("请求失败");
205
187
  }
206
188
  });
207
189
  });
@@ -211,15 +193,15 @@ exports["default"] = _default;
211
193
 
212
194
  var getColumsBySource = function getColumsBySource(source) {
213
195
  switch (source) {
214
- case 'align':
196
+ case "align":
215
197
  return _columns.okrAlignColumns;
216
198
  break;
217
199
 
218
- case 'update':
200
+ case "update":
219
201
  return _columns.okrUpdateColumns;
220
202
  break;
221
203
 
222
- case 'target':
204
+ case "target":
223
205
  return _columns.myOkrColumns;
224
206
  break;
225
207
  }
@@ -229,30 +211,30 @@ exports.getColumsBySource = getColumsBySource;
229
211
 
230
212
  var getEmptyBySource = function getEmptyBySource(source) {
231
213
  switch (source) {
232
- case 'align':
214
+ case "align":
233
215
  return {
234
216
  imageSrc: require("../../../image/align-list-empty.png"),
235
- link: 'https://club.tita.com/18150.html',
236
- emptyText: '暂无对齐',
237
- linkText: '如何对齐'
217
+ link: "https://club.tita.com/18150.html",
218
+ emptyText: "暂无对齐",
219
+ linkText: "如何对齐"
238
220
  };
239
221
  break;
240
222
 
241
- case 'update':
223
+ case "update":
242
224
  return {
243
225
  imageSrc: require("../../../image/update-list-empty.png"),
244
- link: 'https://club.tita.com/18179.html',
245
- emptyText: '暂无更新',
246
- linkText: '如何更新'
226
+ link: "https://club.tita.com/18179.html",
227
+ emptyText: "暂无更新",
228
+ linkText: "如何更新"
247
229
  };
248
230
  break;
249
231
 
250
- case 'target':
232
+ case "target":
251
233
  return {
252
234
  imageSrc: require("../../../image/myokr-list-empty.png"),
253
- link: '#okr%2Fmanage',
254
- emptyText: '「暂无 OKR 数据」',
255
- linkText: '去查看'
235
+ link: "#okr%2Fmanage",
236
+ emptyText: "\u300C".concat((0, _getLocale.getLocale)("Tasks_Tab_MyS_NoOKRilable"), "\u300D"),
237
+ linkText: (0, _getLocale.getLocale)('OKR_MyO_Gotoview')
256
238
  };
257
239
  break;
258
240
  }
@@ -53,7 +53,7 @@ var HomePageDataList = function HomePageDataList() {
53
53
 
54
54
 
55
55
  var _useState5 = (0, _react.useState)({
56
- name: (0, _getLocale.getLocale)('OKR_MyO_Butt_AllStates'),
56
+ name: (0, _getLocale.getLocale)('OKR_MyO_Butt_AllStatee'),
57
57
  yearNum: '2021',
58
58
  cycleType: '-1',
59
59
  yqmNum: '0'
@@ -114,7 +114,7 @@ var HomePageDataList = function HomePageDataList() {
114
114
  className: "".concat(preCls, "__header--back")
115
115
  }, /*#__PURE__*/_react["default"].createElement("span", {
116
116
  className: "tu-icon-fanhui"
117
- }), (0, _getLocale.getLocale)('Mod_Back')), /*#__PURE__*/_react["default"].createElement("b", null), source === 'align' && 'OKR 对齐', source === 'update' && 'OKR 更新', source === 'target' && '我的OKR'), /*#__PURE__*/_react["default"].createElement("div", {
117
+ }), (0, _getLocale.getLocale)('Mod_Back')), /*#__PURE__*/_react["default"].createElement("b", null), source === 'align' && (0, _getLocale.getLocale)('HP_OKRAlignment'), source === 'update' && (0, _getLocale.getLocale)('OKR_MyO_OKRUpdate'), source === 'target' && (0, _getLocale.getLocale)('OKR_Menu_Title_MyOKRs')), /*#__PURE__*/_react["default"].createElement("div", {
118
118
  className: "".concat(preCls, "__main")
119
119
  }, /*#__PURE__*/_react["default"].createElement(_navSelector["default"], {
120
120
  source: source,
@@ -56,7 +56,7 @@ var getUploadMaxSize = function getUploadMaxSize() {
56
56
  exports.getUploadMaxSize = getUploadMaxSize;
57
57
 
58
58
  function isWx() {
59
- return getTenantInfo().Source == 860;
59
+ return (getTenantInfo().Source == 860 || getTenantInfo().Source == 964) && getTenantInfo().corpCreateType != 2;
60
60
  }
61
61
  /*
62
62
  *通过AppId,来查询是否开通这个产品
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.testDayChange = exports.testDateDiff = void 0;
6
+ exports.testDateDiff = exports.judgeTimeSpaceFromNow = void 0;
7
+
8
+ var _constant = require("./constant");
7
9
 
8
10
  var _getLocale = require("./getLocale");
9
11
 
@@ -14,56 +16,14 @@ var testDateDiff = function testDateDiff(date) {
14
16
  var now = Date.now();
15
17
  var diffDay = Math.floor((now - testTime) / (1000 * 60 * 60 * 24));
16
18
  return diffDay;
17
- }; // //精确到分的检测
18
- // export const testMinChange = (date) => {
19
- // if (!date)
20
- // return '暂未'
21
- // const now = new Date()
22
- // //兼容传进来 月份/日期
23
- // const date1 = date.length == 5 ? now.getFullYear() + '/' + date : date
24
- // const testTime = new Date(date1)
25
- // if (testTime.getFullYear() === now.getFullYear()) {
26
- // if (now.getMonth() === testTime.getMonth()) {
27
- // const dateDiff = now.getDate() - testTime.getDate()
28
- // switch (dateDiff) {
29
- // case 2:
30
- // return `前天${testTime.getHours()}:${testTime.getMinutes()}`
31
- // break;
32
- // case 1:
33
- // return `昨天${testTime.getHours()}:${testTime.getMinutes()}`
34
- // break;
35
- // case 0:
36
- // const tTime = Date.parse(date)
37
- // const nTime = Date.now()
38
- // const hourDiff = Math.floor((nTime - tTime) / (1000 * 60 * 60))
39
- // if (hourDiff < 1) {
40
- // const minDiff = Math.floor((nTime - tTime) / (1000 * 60))
41
- // if (minDiff < 1) {
42
- // return getLocale('Pro_page_Int_Justnow')
43
- // } else {
44
- // return `${minDiff}分钟前`
45
- // }
46
- // } else {
47
- // return `${hourDiff}小时前`
48
- // }
49
- // break
50
- // default:
51
- // return `${testTime.getMonth() + 1}/${testTime.getDate()} ${testTime.getHours()}:${testTime.getMinutes()}`
52
- // }
53
- // } else {
54
- // return `${testTime.getMonth() + 1}/${testTime.getDate()} ${testTime.getHours()}:${testTime.getMinutes()}`
55
- // }
56
- // } else {
57
- // return `${testTime.getFullYear()}/${testTime.getMonth() + 1}/${testTime.getDate()} ${testTime.getHours()}:${testTime.getMinutes()}`
58
- // }
59
- // }
60
- //精确到天的检测
19
+ }; //精确到天的检测
61
20
 
62
21
 
63
22
  exports.testDateDiff = testDateDiff;
64
23
 
65
- var testDayChange = function testDayChange(date) {
66
- if (!date) return '暂未'; // 兼容safari,safari不支持yy-mm-dd格式,支持yy/mm/dd格式
24
+ var judgeTimeSpaceFromNow = function judgeTimeSpaceFromNow(date) {
25
+ if (!date) return (0, _getLocale.getLocale)('OKR_MyO_KRP_Notupdated');
26
+ var months = (0, _constant.getMonth)(); // 兼容safari,safari不支持yy-mm-dd格式,支持yy/mm/dd格式
67
27
 
68
28
  var handleDate = date.length === 5 ? new Date().getFullYear() + '/' + date : date.replace(/-/g, '/').split('T').join(' ').split('.')[0];
69
29
  var timeDateObj = new Date(handleDate);
@@ -84,30 +44,33 @@ var testDayChange = function testDayChange(date) {
84
44
  }
85
45
 
86
46
  if (secondDiff < 60) {
87
- return "".concat(secondDiff, "\u79D2\u524D");
47
+ return "".concat(secondDiff).concat((0, _getLocale.getLocale)('Mood_secago'));
88
48
  }
89
49
 
90
50
  if (secondDiff < 60 * 60) {
91
- return "".concat(Math.floor(secondDiff / 60), "\u5206\u949F\u524D");
51
+ return "".concat(Math.floor(secondDiff / 60)).concat((0, _getLocale.getLocale)('Tasks_Tab_MyS_minuteago'));
92
52
  }
93
53
 
94
54
  if (secondDiff < 60 * 60 * 24) {
95
- return "".concat(Math.floor(secondDiff / (60 * 60)), "\u5C0F\u65F6\u524D");
55
+ return "".concat(Math.floor(secondDiff / (60 * 60))).concat((0, _getLocale.getLocale)('Mood_hoursago'));
96
56
  }
97
57
 
98
58
  if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
99
- return (0, _getLocale.getLocale)('OKR_MyO_Pr_Text_Yesterday');
59
+ return "".concat((0, _getLocale.getLocale)('OKR_MyO_Pr_Text_Yesterday'), " ").concat(timeHours + ":" + timeMinutes);
100
60
  }
101
61
 
102
62
  if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
103
- return "\u524D\u5929";
63
+ return "".concat((0, _getLocale.getLocale)('Mood_2daysago'), " ").concat(timeHours + ":" + timeMinutes);
104
64
  }
105
65
 
106
66
  if (timeYear === nowYear) {
107
- return "".concat(timeMonth, "\u6708").concat(timeDate, "\u65E5");
67
+ var _dateStr = months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5"));
68
+
69
+ return "".concat(_dateStr, " ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
108
70
  }
109
71
 
110
- return "".concat(timeYear, "\u5E74").concat(timeMonth, "\u6708").concat(timeDate, "\u65E5");
72
+ var dateStr = (_getLocale.isEn ? '' : "".concat(timeYear, "\u5E74")) + months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5")) + (_getLocale.isEn ? ",".concat(timeYear) : '');
73
+ return "".concat(dateStr, " ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
111
74
  };
112
75
 
113
- exports.testDayChange = testDayChange;
76
+ exports.judgeTimeSpaceFromNow = judgeTimeSpaceFromNow;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.i18nLimitCharacters = void 0;
6
+ exports.inputWordTrans = exports.i18nLimitCharacters = void 0;
7
7
 
8
8
  var _getLocale = require("./getLocale");
9
9
 
@@ -15,4 +15,14 @@ var i18nLimitCharacters = function i18nLimitCharacters(length) {
15
15
  }
16
16
  };
17
17
 
18
- exports.i18nLimitCharacters = i18nLimitCharacters;
18
+ exports.i18nLimitCharacters = i18nLimitCharacters;
19
+
20
+ var inputWordTrans = function inputWordTrans(inputValueLength, maxLength) {
21
+ if (_getLocale.isEn) {
22
+ return "Already entered ".concat(inputValueLength, " characters,max ").concat(maxLength, " characters");
23
+ } else {
24
+ return "\u5DF2\u8F93\u5165".concat(inputValueLength, "\u4E2A\u5B57\uFF0C\u6700\u591A\u53EF\u8F93\u5165").concat(maxLength, "\u5B57");
25
+ }
26
+ };
27
+
28
+ exports.inputWordTrans = inputWordTrans;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.9.27",
3
+ "version": "1.9.31",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "src/index.js",
@@ -166,9 +166,9 @@
166
166
  .okr-share-mblog {
167
167
  &__container {
168
168
  width: 480px;
169
- height: 420px;
169
+ min-height: 420px;
170
170
  background-color: #fff;
171
- border-radius: 6px;
171
+ border-radius: 12px;
172
172
  }
173
173
  &__header {
174
174
  height: 58px;
@@ -7,7 +7,6 @@ $text-color: #89919f;
7
7
  justify-content: center;
8
8
  font-size: 12px;
9
9
  line-height: 18px;
10
- width: 53px;
11
10
  &--editable {
12
11
  cursor: pointer;
13
12
  position: relative;
@@ -27,7 +26,7 @@ $text-color: #89919f;
27
26
 
28
27
  &-icon {
29
28
  display: inline-block;
30
- width: 16px;
29
+ min-width: 16px;
31
30
  height: 16px;
32
31
  background: url("./heart.svg") no-repeat;
33
32
  margin-right: 6px;
@@ -46,7 +46,7 @@ const Confidence = (props: IConfidenceProps) => {
46
46
  <span className={classNames(`${popPrecls}-heart`)}>
47
47
  <Heart i={i} confidence={value} />
48
48
  </span>
49
- <span className={`${popPrecls}-score`}>{i}分</span>
49
+ <span className={`${popPrecls}-score`}>{i} {getLocale('Per_Set_Form_Quantifier_Points')}</span>
50
50
  </li>
51
51
  ))}
52
52
  </ul>
@@ -60,7 +60,7 @@ const Confidence = (props: IConfidenceProps) => {
60
60
  })}
61
61
  >
62
62
  <span className="titaui-kr-heart-icon" />
63
- <span className="titaui-kr-heart-text">{value} 分</span>
63
+ <span className="titaui-kr-heart-text">{value} {getLocale('Per_Set_Form_Quantifier_Points')}</span>
64
64
  </div>
65
65
  );
66
66
  }
@@ -73,7 +73,7 @@ const Confidence = (props: IConfidenceProps) => {
73
73
  })}
74
74
  >
75
75
  <span className="titaui-kr-heart-icon" />
76
- <span className="titaui-kr-heart-text">{value} 分</span>
76
+ <span className="titaui-kr-heart-text">{value} {getLocale('Per_Set_Form_Quantifier_Points')}</span>
77
77
  </div>
78
78
  </Popup>
79
79
  </Tooltip>
@@ -135,6 +135,7 @@ $FontFamily: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-seri
135
135
  text-overflow: ellipsis;
136
136
  margin-right: 10px;
137
137
  word-break: keep-all;
138
+ white-space: nowrap;
138
139
  }
139
140
  .user__name--hidden {
140
141
  font-size: 12px;
@@ -1,4 +1,5 @@
1
1
  import React, { FC, Fragment } from "react";
2
+ import { inputWordTrans } from "../../../utils/i18n-front-translate";
2
3
  import Popup from "../../popup";
3
4
  import "./index.scss";
4
5
 
@@ -21,7 +22,7 @@ const StrLengthOverflowError: FC<IErrorPopContentProps> = ({
21
22
  <Fragment>
22
23
  {strLength > maxLength ? (
23
24
  <span className={"error-popup-text-wrapper"}>
24
- {`已输入 ${strLength} 个字,最多可输入 ${maxLength} 个字`}
25
+ {inputWordTrans(strLength, maxLength)}
25
26
  </span>
26
27
  ) : null}
27
28
  </Fragment>
@@ -1,6 +1,7 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import Dialog from 'rc-dialog';
4
+ import loading from './loading.png';
4
5
  import { getLocale } from '../../utils/getLocale'
5
6
 
6
7
  import 'rc-dialog/assets/index.css';
@@ -20,25 +21,38 @@ export default props => {
20
21
  noCloseIcon,
21
22
  noFooterLine,
22
23
  visible,
23
- extraClass=[],
24
+ extraClass = [],
24
25
  extendFooterBtn,
25
26
  disabled = false,
27
+ confirmLoading = false,
26
28
  ...restProps
27
29
  } = props;
28
30
 
31
+ const handleOK = () => {
32
+ if (confirmLoading) return
33
+ onOk && onOk()
34
+ }
35
+
29
36
  const baseFooter = [
30
37
  extendFooterBtn,
31
38
  <span key="cancel" className={classNames(`${preCls}__btn`, `${preCls}__btn-cancel`)} onClick={onCancel}>
32
39
  <span className={classNames(`${preCls}__btn-cancel-text`)}>{cancelText}</span>
33
40
  </span>,
34
- <span key="ok" className={classNames(`${preCls}__btn`, `${preCls}__btn-ok`, {[`${preCls}__btn-ok-not-allowed`]:disabled})} onClick={onOk}>
35
- <span className={classNames(`${preCls}__btn-ok-text`)}>{okText}</span>
41
+ <span key="ok" className={classNames(`${preCls}__btn`, `${preCls}__btn-ok`, { [`${preCls}__btn-ok-not-allowed`]: disabled || confirmLoading })} onClick={handleOK}>
42
+ {confirmLoading ?
43
+ <span className={classNames(`${preCls}__btn-ok-loading`)}>
44
+ <img className={classNames(`${preCls}__btn-ok-loading-icon`)} src={loading} />
45
+ {getLocale('Mod_loading')}
46
+ </span>
47
+ :
48
+ <span className={classNames(`${preCls}__btn-ok-text`)}>{okText}</span>
49
+ }
36
50
  </span>
37
51
  ];
38
52
 
39
53
  return <Dialog
40
54
  visible={visible}
41
- className={classNames(preCls,[...extraClass], {
55
+ className={classNames(preCls, [...extraClass], {
42
56
  [`${preCls}-no-head-line`]: noHeadLine,
43
57
  [`${preCls}-no-footer-line`]: noFooterLine,
44
58
  [`${preCls}-no-close`]: noCloseIcon,
@@ -1,13 +1,23 @@
1
- $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
1
+ $font-family: -apple-system,
2
+ Arial,
3
+ Verdana,
4
+ Helvetica Neue,
5
+ Helvetica,
6
+ sans-serif,
7
+ PingFang SC,
8
+ Microsoft YaHei;
9
+
2
10
  .rc-dialog-close {
3
11
  z-index: 100;
4
12
  }
13
+
5
14
  .rc-dialog-wrap {
6
15
  display: flex;
7
16
  justify-content: center;
8
17
  align-items: center;
9
18
  z-index: 1299 !important;
10
19
  }
20
+
11
21
  .rc-dialog-mask {
12
22
  z-index: 1299 !important;
13
23
  background: rgba(20, 28, 40, 0.7) !important;
@@ -16,6 +26,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
16
26
  .titaui-dialog {
17
27
  border-radius: 24px;
18
28
  overflow: hidden;
29
+
19
30
  &.rc-dialog {
20
31
  display: inline-block;
21
32
  margin: 0;
@@ -49,10 +60,12 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
49
60
  .rc-dialog-header {
50
61
  padding: 18px 32px;
51
62
  }
63
+
52
64
  .rc-dialog-body {
53
65
  // padding: 0 32px 0 32px;
54
66
  padding: 0;
55
67
  }
68
+
56
69
  .rc-dialog-footer {
57
70
  padding: 20px 32px;
58
71
  display: flex;
@@ -72,7 +85,8 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
72
85
  justify-content: center;
73
86
  cursor: pointer;
74
87
  box-sizing: border-box;
75
- & > span {
88
+
89
+ &>span {
76
90
  font-size: 14px;
77
91
  font-family: $font-family;
78
92
  font-weight: 400;
@@ -88,20 +102,36 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
88
102
  border: 1px solid #2879ff;
89
103
  color: #ffffff;
90
104
  transition: 0.2s all;
105
+ user-select: none;
106
+
91
107
  &:hover {
92
108
  border: 1px solid #5c8eff;
93
109
  background: #5c8eff;
94
110
  color: #ffffff;
95
111
  }
112
+
96
113
  &-not-allowed {
114
+ background-color: #5C8EFF;
97
115
  cursor: not-allowed;
98
116
  }
117
+
118
+ &-loading {
119
+ &-icon {
120
+ width: 14px;
121
+ margin-right: 6px;
122
+ animation-name: spin;
123
+ animation-timing-function: linear;
124
+ animation-iteration-count: infinite;
125
+ animation-duration: 1s;
126
+ }
127
+ }
99
128
  }
100
129
 
101
130
  &__btn-cancel {
102
131
  border: 1px solid #DFE3EA;
103
132
  color: #6f7886;
104
133
  transition: 0.2s all;
134
+
105
135
  &:hover {
106
136
  border: 1px solid #2879ff;
107
137
  color: #2879ff;
@@ -114,11 +144,13 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
114
144
  border-bottom: none;
115
145
  }
116
146
  }
147
+
117
148
  .titaui-dialog.titaui-dialog-no-footer-line {
118
149
  .rc-dialog-footer {
119
150
  border-top: none;
120
151
  }
121
152
  }
153
+
122
154
  .titaui-dialog.titaui-dialog-no-close {
123
155
  .rc-dialog-close {
124
156
  display: none;
@@ -130,3 +162,13 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
130
162
  display: none;
131
163
  }
132
164
  }
165
+
166
+ @keyframes spin {
167
+ from {
168
+ transform: rotate(0deg);
169
+ }
170
+
171
+ to {
172
+ transform: rotate(360deg);
173
+ }
174
+ }
@@ -36,6 +36,7 @@
36
36
  line-height: 18px;
37
37
  margin-right: 4px;
38
38
  margin-top: 1px;
39
+ word-break: keep-all;
39
40
  }
40
41
  &-name {
41
42
  font-size: 14px;