@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.
- package/lib/components/change-okr-modal/Filter.js +2 -2
- package/lib/components/change-okr-modal/constant.js +4 -4
- package/lib/components/create-okr-modal/kr-items/kr-item-weight.js +1 -1
- package/lib/components/dialog/index.css +7 -1
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +1 -1
- package/lib/components/dynamic/dynamic.css +3 -2
- package/lib/components/dynamic/export-module/index.js +5 -1
- package/lib/components/dynamic/index.js +1 -0
- package/lib/components/dynamic/new-ui.css +3 -2
- package/lib/components/form/form-fields/input/index.css +7 -0
- package/lib/components/form/form-fields/input/index.js +6 -2
- package/lib/components/form/form-fields/textarea/index.css +16 -2
- package/lib/components/form/form-fields/textarea/index.js +5 -4
- package/lib/components/form/index.js +1 -0
- package/lib/components/grid-layout/near-visitors/index.css +3 -2
- package/lib/components/grid-layout/near-visitors/visitor.js +2 -2
- package/lib/components/keyword-search/index.css +71 -0
- package/lib/components/keyword-search/index.js +112 -0
- package/lib/components/nav-top/components/user-message/components/remind/index.css +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +4 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/weight-input.js +3 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +3 -1
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +4 -2
- package/lib/index.js +8 -0
- package/lib/pages/aha2021/index.css +1 -1
- package/lib/pages/aha2021/index.js +2 -2
- package/lib/pages/like-ranking/index.js +3 -3
- package/lib/utils/date-test-change.js +13 -12
- package/package.json +1 -1
- package/src/components/change-okr-modal/Filter.tsx +2 -2
- package/src/components/change-okr-modal/constant.ts +5 -5
- package/src/components/create-okr-modal/kr-items/kr-item-weight.tsx +1 -1
- package/src/components/dialog/index.scss +8 -2
- package/src/components/dynamic/dynamic-item/dynamic-project/index.tsx +1 -1
- package/src/components/dynamic/dynamic.scss +3 -2
- package/src/components/dynamic/export-module/index.tsx +2 -0
- package/src/components/dynamic/index.tsx +2 -0
- package/src/components/dynamic/new-ui.scss +3 -2
- package/src/components/form/form-fields/input/index.scss +7 -0
- package/src/components/form/form-fields/input/index.tsx +9 -1
- package/src/components/form/form-fields/textarea/index.scss +15 -2
- package/src/components/form/form-fields/textarea/index.tsx +3 -2
- package/src/components/form/index.tsx +1 -0
- package/src/components/grid-layout/near-visitors/index.scss +3 -2
- package/src/components/grid-layout/near-visitors/visitor.tsx +2 -2
- package/src/components/keyword-search/index.scss +64 -0
- package/src/components/keyword-search/index.tsx +60 -0
- package/src/components/nav-top/components/user-message/components/remind/index.scss +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.tsx +3 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/weight-input.tsx +2 -1
- package/src/components-v1/userSelector/components/MultiMode/DepartmentTree.tsx +2 -1
- package/src/components-v1/userSelector/components/MultiMode/SubsList.tsx +2 -1
- package/src/index.js +1 -0
- package/src/pages/aha2021/index.scss +1 -1
- package/src/pages/aha2021/index.tsx +2 -2
- package/src/pages/like-ranking/index.tsx +4 -3
- 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
|
-
|
|
148
|
-
let
|
|
149
|
-
|
|
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
|
|
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
|
-
|
|
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 =
|
|
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(
|
|
44
|
+
return getLocale("Pro_page_Int_Justnow");
|
|
42
45
|
}
|
|
43
46
|
if (secondDiff < 60) {
|
|
44
|
-
return `${secondDiff}${getLocale(
|
|
47
|
+
return `${secondDiff}${getLocale("Mood_secago")}`;
|
|
45
48
|
}
|
|
46
49
|
if (secondDiff < 60 * 60) {
|
|
47
|
-
return `${Math.floor(secondDiff / 60)}${getLocale(
|
|
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(
|
|
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
|
|
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
|
|
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 =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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 =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
+
};
|