@titaui/pc 1.9.33 → 1.9.37

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 (57) hide show
  1. package/lib/components/change-okr-modal/Filter.js +2 -2
  2. package/lib/components/change-okr-modal/constant.js +4 -4
  3. package/lib/components/create-okr-modal/kr-items/kr-item-weight.js +1 -1
  4. package/lib/components/dialog/index.css +7 -1
  5. package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +1 -1
  6. package/lib/components/dynamic/dynamic.css +3 -2
  7. package/lib/components/dynamic/export-module/index.js +5 -1
  8. package/lib/components/dynamic/index.js +1 -0
  9. package/lib/components/dynamic/new-ui.css +3 -2
  10. package/lib/components/form/form-fields/input/index.css +7 -0
  11. package/lib/components/form/form-fields/input/index.js +6 -2
  12. package/lib/components/form/form-fields/textarea/index.css +16 -2
  13. package/lib/components/form/form-fields/textarea/index.js +5 -4
  14. package/lib/components/form/index.js +1 -0
  15. package/lib/components/grid-layout/near-visitors/index.css +3 -2
  16. package/lib/components/grid-layout/near-visitors/visitor.js +2 -2
  17. package/lib/components/keyword-search/index.css +71 -0
  18. package/lib/components/keyword-search/index.js +112 -0
  19. package/lib/components/nav-top/components/user-message/components/remind/index.css +1 -1
  20. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +4 -2
  21. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/weight-input.js +3 -1
  22. package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +3 -1
  23. package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +4 -2
  24. package/lib/index.js +8 -0
  25. package/lib/pages/aha2021/index.css +1 -1
  26. package/lib/pages/aha2021/index.js +2 -2
  27. package/lib/pages/like-ranking/index.js +3 -3
  28. package/lib/utils/date-test-change.js +13 -12
  29. package/package.json +1 -1
  30. package/src/components/change-okr-modal/Filter.tsx +2 -2
  31. package/src/components/change-okr-modal/constant.ts +5 -5
  32. package/src/components/create-okr-modal/kr-items/kr-item-weight.tsx +1 -1
  33. package/src/components/dialog/index.scss +8 -2
  34. package/src/components/dynamic/dynamic-item/dynamic-project/index.tsx +1 -1
  35. package/src/components/dynamic/dynamic.scss +3 -2
  36. package/src/components/dynamic/export-module/index.tsx +2 -0
  37. package/src/components/dynamic/index.tsx +2 -0
  38. package/src/components/dynamic/new-ui.scss +3 -2
  39. package/src/components/form/form-fields/input/index.scss +7 -0
  40. package/src/components/form/form-fields/input/index.tsx +9 -1
  41. package/src/components/form/form-fields/textarea/index.scss +15 -2
  42. package/src/components/form/form-fields/textarea/index.tsx +3 -2
  43. package/src/components/form/index.tsx +1 -0
  44. package/src/components/grid-layout/near-visitors/index.scss +3 -2
  45. package/src/components/grid-layout/near-visitors/visitor.tsx +2 -2
  46. package/src/components/keyword-search/index.scss +64 -0
  47. package/src/components/keyword-search/index.tsx +60 -0
  48. package/src/components/nav-top/components/user-message/components/remind/index.scss +1 -1
  49. package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.tsx +3 -2
  50. package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/weight-input.tsx +2 -1
  51. package/src/components-v1/userSelector/components/MultiMode/DepartmentTree.tsx +2 -1
  52. package/src/components-v1/userSelector/components/MultiMode/SubsList.tsx +2 -1
  53. package/src/index.js +1 -0
  54. package/src/pages/aha2021/index.scss +1 -1
  55. package/src/pages/aha2021/index.tsx +2 -2
  56. package/src/pages/like-ranking/index.tsx +4 -3
  57. package/src/utils/date-test-change.ts +72 -31
@@ -144,9 +144,10 @@ const LikeRanking: FC = () => {
144
144
  };
145
145
 
146
146
  const handleLinkToPraiseRaking = () => {
147
- let href = window.location.href;
148
- let url = `${href.split("#")[0]}#dev`;
149
- window.open(url, "self");
147
+ window.history.go(-1)
148
+ // let href = window.location.href;
149
+ // let url = `${href.split("#")[0]}#dynamic`;
150
+ // window.open(url, "self");
150
151
  };
151
152
 
152
153
  return (
@@ -1,27 +1,30 @@
1
- import { getMonth } from "./constant"
2
- import { getLocale, isEn } from "./getLocale"
1
+ import { getMonth } from "./constant";
2
+ import { getLocale, isEn } from "./getLocale";
3
3
 
4
4
  //精确到日期的检测 date为2021/8/26这样的类型,返回距现在几天
5
5
  export const testDateDiff = (date) => {
6
+ const handleDate =
7
+ date.length == 5 ? `${new Date().getFullYear()}/${date}` : date;
8
+ const testTime = Date.parse(
9
+ handleDate.replace(/-/g, "/").split("T").join(" ").split(".")[0]
10
+ );
11
+ const now = Date.now();
6
12
 
7
- const handleDate = date.length == 5 ? `${new Date().getFullYear()}/${date}` : date
8
- const testTime = Date.parse(handleDate.replace(/-/g, '/').split('T').join(' ').split('.')[0])
9
- const now = Date.now()
13
+ const diffDay = Math.floor((now - testTime) / (1000 * 60 * 60 * 24));
10
14
 
11
- const diffDay = Math.floor((now - testTime) / (1000 * 60 * 60 * 24))
12
-
13
- return diffDay
14
- }
15
+ return diffDay;
16
+ };
15
17
 
16
18
  //精确到天的检测
17
- export const judgeTimeSpaceFromNow = (date) => {
18
-
19
- if (!date)
20
- return getLocale('OKR_MyO_KRP_Notupdated');
19
+ export const judgeTimeSpaceFromNow = (date, withHM = true) => {
20
+ if (!date) return getLocale("OKR_MyO_KRP_Notupdated");
21
21
 
22
22
  const months = getMonth();
23
23
  // 兼容safari,safari不支持yy-mm-dd格式,支持yy/mm/dd格式
24
- const handleDate = date.length === 5 ? new Date().getFullYear() + '/' + date : date.replace(/-/g, '/').split('T').join(' ').split('.')[0]
24
+ const handleDate =
25
+ date.length === 5
26
+ ? new Date().getFullYear() + "/" + date
27
+ : date.replace(/-/g, "/").split("T").join(" ").split(".")[0];
25
28
  const timeDateObj = new Date(handleDate);
26
29
  const timeMilliSecond = timeDateObj.getTime();
27
30
  const timeYear = timeDateObj.getFullYear();
@@ -30,7 +33,7 @@ export const judgeTimeSpaceFromNow = (date) => {
30
33
  const timeHours = timeDateObj.getHours();
31
34
  const timeMinutes = timeDateObj.getMinutes();
32
35
 
33
- const nowTime = new Date()
36
+ const nowTime = new Date();
34
37
 
35
38
  const nowMilliSecond = nowTime.getTime();
36
39
  const nowYear = nowTime.getFullYear();
@@ -38,32 +41,70 @@ export const judgeTimeSpaceFromNow = (date) => {
38
41
 
39
42
  const secondDiff = Math.floor((nowMilliSecond - timeMilliSecond) / 1000);
40
43
  if (secondDiff <= 3) {
41
- return getLocale('Pro_page_Int_Justnow');
44
+ return getLocale("Pro_page_Int_Justnow");
42
45
  }
43
46
  if (secondDiff < 60) {
44
- return `${secondDiff}${getLocale('Mood_secago')}`;
47
+ return `${secondDiff}${getLocale("Mood_secago")}`;
45
48
  }
46
49
  if (secondDiff < 60 * 60) {
47
- return `${Math.floor(secondDiff / 60)}${getLocale('Tasks_Tab_MyS_minuteago')}`;
50
+ return `${Math.floor(secondDiff / 60)}${getLocale(
51
+ "Tasks_Tab_MyS_minuteago"
52
+ )}`;
48
53
  }
49
54
  if (secondDiff < 60 * 60 * 24) {
50
- return `${Math.floor(secondDiff / (60 * 60))}${getLocale('Mood_hoursago')}`;
55
+ return `${Math.floor(secondDiff / (60 * 60))}${getLocale("Mood_hoursago")}`;
51
56
  }
52
57
  if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
53
- return `${getLocale('OKR_MyO_Pr_Text_Yesterday')} ${timeHours + ":" + timeMinutes}`;
58
+ return (
59
+ `${getLocale("OKR_MyO_Pr_Text_Yesterday")}` +
60
+ (withHM
61
+ ? ` ${
62
+ (timeHours < 10 ? "0" + timeHours : timeHours) +
63
+ ":" +
64
+ (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)
65
+ }`
66
+ : "")
67
+ );
54
68
  }
55
69
  if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
56
- return `${getLocale('Mood_2daysago')} ${timeHours + ":" + timeMinutes}`;
70
+ return (
71
+ `${getLocale("Mood_2daysago")}` +
72
+ (withHM
73
+ ? ` ${
74
+ (timeHours < 10 ? "0" + timeHours : timeHours) +
75
+ ":" +
76
+ (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)
77
+ }`
78
+ : "")
79
+ );
57
80
  }
58
81
  if (timeYear === nowYear) {
59
- const dateStr = months[timeMonth-1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`)
60
- return `${dateStr} ${
61
- timeHours < 10 ? "0" + timeHours : timeHours
62
- }:${timeMinutes < 10 ? "0" + timeMinutes : timeMinutes}`;
82
+ const dateStr =
83
+ months[timeMonth - 1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`);
84
+ return (
85
+ `${dateStr}` +
86
+ (withHM
87
+ ? ` ${
88
+ (timeHours < 10 ? "0" + timeHours : timeHours) +
89
+ ":" +
90
+ (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)
91
+ }`
92
+ : "")
93
+ );
63
94
  }
64
- const dateStr = (isEn ? '' : `${timeYear}年`) + months[timeMonth-1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`) + (isEn ? `,${timeYear}` : '');
65
- return `${dateStr} ${
66
- timeHours < 10 ? "0" + timeHours : timeHours
67
- }:${timeMinutes < 10 ? "0" + timeMinutes : timeMinutes}`;
68
-
69
- }
95
+ const dateStr =
96
+ (isEn ? "" : `${timeYear}年`) +
97
+ months[timeMonth - 1] +
98
+ (isEn ? ` ${timeDate}` : `${timeDate}日`) +
99
+ (isEn ? `,${timeYear}` : "");
100
+ return (
101
+ `${dateStr}` +
102
+ (withHM
103
+ ? ` ${
104
+ (timeHours < 10 ? "0" + timeHours : timeHours) +
105
+ ":" +
106
+ (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)
107
+ }`
108
+ : "")
109
+ );
110
+ };