@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
|
@@ -212,9 +212,9 @@ var LikeRanking = function LikeRanking() {
|
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
var handleLinkToPraiseRaking = function handleLinkToPraiseRaking() {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
window.open(url, "self");
|
|
215
|
+
window.history.go(-1); // let href = window.location.href;
|
|
216
|
+
// let url = `${href.split("#")[0]}#dynamic`;
|
|
217
|
+
// window.open(url, "self");
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -12,7 +12,7 @@ var _getLocale = require("./getLocale");
|
|
|
12
12
|
//精确到日期的检测 date为2021/8/26这样的类型,返回距现在几天
|
|
13
13
|
var testDateDiff = function testDateDiff(date) {
|
|
14
14
|
var handleDate = date.length == 5 ? "".concat(new Date().getFullYear(), "/").concat(date) : date;
|
|
15
|
-
var testTime = Date.parse(handleDate.replace(/-/g,
|
|
15
|
+
var testTime = Date.parse(handleDate.replace(/-/g, "/").split("T").join(" ").split(".")[0]);
|
|
16
16
|
var now = Date.now();
|
|
17
17
|
var diffDay = Math.floor((now - testTime) / (1000 * 60 * 60 * 24));
|
|
18
18
|
return diffDay;
|
|
@@ -22,10 +22,11 @@ var testDateDiff = function testDateDiff(date) {
|
|
|
22
22
|
exports.testDateDiff = testDateDiff;
|
|
23
23
|
|
|
24
24
|
var judgeTimeSpaceFromNow = function judgeTimeSpaceFromNow(date) {
|
|
25
|
-
|
|
25
|
+
var withHM = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
26
|
+
if (!date) return (0, _getLocale.getLocale)("OKR_MyO_KRP_Notupdated");
|
|
26
27
|
var months = (0, _constant.getMonth)(); // 兼容safari,safari不支持yy-mm-dd格式,支持yy/mm/dd格式
|
|
27
28
|
|
|
28
|
-
var handleDate = date.length === 5 ? new Date().getFullYear() +
|
|
29
|
+
var handleDate = date.length === 5 ? new Date().getFullYear() + "/" + date : date.replace(/-/g, "/").split("T").join(" ").split(".")[0];
|
|
29
30
|
var timeDateObj = new Date(handleDate);
|
|
30
31
|
var timeMilliSecond = timeDateObj.getTime();
|
|
31
32
|
var timeYear = timeDateObj.getFullYear();
|
|
@@ -40,37 +41,37 @@ var judgeTimeSpaceFromNow = function judgeTimeSpaceFromNow(date) {
|
|
|
40
41
|
var secondDiff = Math.floor((nowMilliSecond - timeMilliSecond) / 1000);
|
|
41
42
|
|
|
42
43
|
if (secondDiff <= 3) {
|
|
43
|
-
return (0, _getLocale.getLocale)(
|
|
44
|
+
return (0, _getLocale.getLocale)("Pro_page_Int_Justnow");
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
if (secondDiff < 60) {
|
|
47
|
-
return "".concat(secondDiff).concat((0, _getLocale.getLocale)(
|
|
48
|
+
return "".concat(secondDiff).concat((0, _getLocale.getLocale)("Mood_secago"));
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
if (secondDiff < 60 * 60) {
|
|
51
|
-
return "".concat(Math.floor(secondDiff / 60)).concat((0, _getLocale.getLocale)(
|
|
52
|
+
return "".concat(Math.floor(secondDiff / 60)).concat((0, _getLocale.getLocale)("Tasks_Tab_MyS_minuteago"));
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
if (secondDiff < 60 * 60 * 24) {
|
|
55
|
-
return "".concat(Math.floor(secondDiff / (60 * 60))).concat((0, _getLocale.getLocale)(
|
|
56
|
+
return "".concat(Math.floor(secondDiff / (60 * 60))).concat((0, _getLocale.getLocale)("Mood_hoursago"));
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
|
|
59
|
-
return "".concat((0, _getLocale.getLocale)(
|
|
60
|
+
return "".concat((0, _getLocale.getLocale)("OKR_MyO_Pr_Text_Yesterday")) + (withHM ? " ".concat((timeHours < 10 ? "0" + timeHours : timeHours) + ":" + (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)) : "");
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
|
|
63
|
-
return "".concat((0, _getLocale.getLocale)(
|
|
64
|
+
return "".concat((0, _getLocale.getLocale)("Mood_2daysago")) + (withHM ? " ".concat((timeHours < 10 ? "0" + timeHours : timeHours) + ":" + (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)) : "");
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
if (timeYear === nowYear) {
|
|
67
68
|
var _dateStr = months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5"));
|
|
68
69
|
|
|
69
|
-
return "".concat(_dateStr
|
|
70
|
+
return "".concat(_dateStr) + (withHM ? " ".concat((timeHours < 10 ? "0" + timeHours : timeHours) + ":" + (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)) : "");
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
var dateStr = (_getLocale.isEn ?
|
|
73
|
-
return "".concat(dateStr
|
|
73
|
+
var dateStr = (_getLocale.isEn ? "" : "".concat(timeYear, "\u5E74")) + months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate) : "".concat(timeDate, "\u65E5")) + (_getLocale.isEn ? ",".concat(timeYear) : "");
|
|
74
|
+
return "".concat(dateStr) + (withHM ? " ".concat((timeHours < 10 ? "0" + timeHours : timeHours) + ":" + (timeMinutes < 10 ? "0" + timeMinutes : timeMinutes)) : "");
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
exports.judgeTimeSpaceFromNow = judgeTimeSpaceFromNow;
|
package/package.json
CHANGED
|
@@ -272,12 +272,12 @@ export default class FilterComp extends PureComponent<Props, State> {
|
|
|
272
272
|
);
|
|
273
273
|
})}
|
|
274
274
|
|
|
275
|
-
<ToolTip title='
|
|
275
|
+
<ToolTip title={getLocale('Tasks_Tab_MyS_Clearselec')} overlayStyle={{ zIndex: 999999 }}>
|
|
276
276
|
<a onClick={this.handleClear}>{getLocale('OKR_MyO_Pop_Clearselected')}</a>
|
|
277
277
|
</ToolTip>
|
|
278
278
|
{!remembered ? (
|
|
279
279
|
<a onClick={() => this.handlerFilterOptions(1)}>
|
|
280
|
-
<ToolTip title='
|
|
280
|
+
<ToolTip title={getLocale('Tasks_Tab_MyS_Nextcondit')} overlayStyle={{ zIndex: 999999 }}>
|
|
281
281
|
<span>{getLocale('OKR_MyO_Butt_Remember')}</span>
|
|
282
282
|
</ToolTip>
|
|
283
283
|
</a>
|
|
@@ -85,33 +85,33 @@ export const getBimonthlyMonthKeyValue = (startMonth) => {
|
|
|
85
85
|
const getNextMonth = (month, step = 1) => (month + step) % 12 || 12;
|
|
86
86
|
let datas: {
|
|
87
87
|
title: string;
|
|
88
|
-
value: string
|
|
88
|
+
value: string;
|
|
89
89
|
}[] = [];
|
|
90
90
|
const monthLang = getMonth();
|
|
91
91
|
if (!isEn) {
|
|
92
92
|
datas.push({
|
|
93
93
|
title: `${start} - ${getNextMonth(start)}月`,
|
|
94
|
-
value:
|
|
94
|
+
value: `4,${start}`,
|
|
95
95
|
});
|
|
96
96
|
while (1) {
|
|
97
97
|
month = getNextMonth(month, 2);
|
|
98
98
|
if (month == start) break;
|
|
99
99
|
datas.push({
|
|
100
100
|
title: `${month} - ${getNextMonth(month)}月`,
|
|
101
|
-
value:
|
|
101
|
+
value: `4,${month}`,
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
} else {
|
|
105
105
|
datas.push({
|
|
106
106
|
title: `${monthLang[start - 1]} - ${monthLang[getNextMonth(start) - 1]}`,
|
|
107
|
-
value:
|
|
107
|
+
value: `4,${start}`,
|
|
108
108
|
});
|
|
109
109
|
while (1) {
|
|
110
110
|
month = getNextMonth(month, 2);
|
|
111
111
|
if (month == start) break;
|
|
112
112
|
datas.push({
|
|
113
113
|
title: `${monthLang[month - 1]} - ${monthLang[getNextMonth(month)-1]}`,
|
|
114
|
-
value:
|
|
114
|
+
value: `4,${month}`,
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -23,7 +23,7 @@ const ErrorContent: FC<{ hasErr: boolean }> = ({ hasErr }) => {
|
|
|
23
23
|
<Fragment>
|
|
24
24
|
{hasErr ? (
|
|
25
25
|
<span className={"kr-weight__error-popup-text-wrapper"}>
|
|
26
|
-
|
|
26
|
+
{getLocale('OKR_MyO_KRP_Please0and100')}
|
|
27
27
|
</span>
|
|
28
28
|
) : null}
|
|
29
29
|
</Fragment>
|
|
@@ -113,8 +113,14 @@ Microsoft YaHei;
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
&-not-allowed {
|
|
116
|
-
background
|
|
116
|
+
background: #93BCFF;
|
|
117
|
+
border-color: #93BCFF;
|
|
117
118
|
cursor: not-allowed;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
background: #93BCFF;
|
|
122
|
+
border-color: #93BCFF;
|
|
123
|
+
}
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
&-loading {
|
|
@@ -173,4 +179,4 @@ Microsoft YaHei;
|
|
|
173
179
|
to {
|
|
174
180
|
transform: rotate(360deg);
|
|
175
181
|
}
|
|
176
|
-
}
|
|
182
|
+
}
|
|
@@ -46,7 +46,7 @@ const DynamicProject: FC<IDynamicItemContentProps> = ({
|
|
|
46
46
|
const renderDesc = useMemo(() => {
|
|
47
47
|
return (
|
|
48
48
|
<Fragment>
|
|
49
|
-
<span className={prefix + "__operate-desc"}>{getLocale('Mod_InChargeof')}{getLocale('
|
|
49
|
+
<span className={prefix + "__operate-desc"}>{getLocale('Mod_InChargeof')}{getLocale('Feed_Set_Project')}</span>
|
|
50
50
|
<span
|
|
51
51
|
className={prefix + "-desc-operate-type"}
|
|
52
52
|
style={{ background: feedTypeColor }}
|
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
}
|
|
134
134
|
&__go-to-top {
|
|
135
135
|
position: fixed;
|
|
136
|
-
bottom:
|
|
137
|
-
right:
|
|
136
|
+
bottom: 128px;
|
|
137
|
+
right: 24px;
|
|
138
138
|
display: flex;
|
|
139
139
|
align-items: center;
|
|
140
140
|
justify-content: center;
|
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
145
145
|
border-radius: 50%;
|
|
146
146
|
cursor: pointer;
|
|
147
|
+
z-index: 1;
|
|
147
148
|
&-img {
|
|
148
149
|
display: inline-block;
|
|
149
150
|
width: 24px;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _DynamicQuickOperation from "../quick-operation";
|
|
2
2
|
import _Dynamic from '../dynamic';
|
|
3
|
+
import _DynamicList from '../dynamic-list';
|
|
3
4
|
import _DynamicItem from '../dynamic-item';
|
|
4
5
|
import _DynamicTopping from '../dynamic-topping';
|
|
5
6
|
import _DynamicLiking from '../dynamic-liking';
|
|
6
7
|
import _DynamicLikeRanking from '../dynamic-like-ranking';
|
|
7
8
|
|
|
8
9
|
export default _Dynamic;
|
|
10
|
+
export const DynamicList = _DynamicList;
|
|
9
11
|
export const DynamicQuickOperation = _DynamicQuickOperation;
|
|
10
12
|
export const DynamicItem = _DynamicItem;
|
|
11
13
|
export const DynamicTopping = _DynamicTopping;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import Dynamic, {
|
|
2
2
|
DynamicQuickOperation,
|
|
3
|
+
DynamicList,
|
|
3
4
|
DynamicItem,
|
|
4
5
|
DynamicTopping,
|
|
5
6
|
DynamicLiking,
|
|
6
7
|
DynamicLikeRanking,
|
|
7
8
|
} from './export-module';
|
|
8
9
|
|
|
10
|
+
Dynamic.List = DynamicList;
|
|
9
11
|
Dynamic.Item = DynamicItem;
|
|
10
12
|
Dynamic.LikeRanking = DynamicLikeRanking;
|
|
11
13
|
Dynamic.Liking = DynamicLiking;
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
}
|
|
133
133
|
&__go-to-top {
|
|
134
134
|
position: fixed;
|
|
135
|
-
bottom:
|
|
136
|
-
right:
|
|
135
|
+
bottom: 128px;
|
|
136
|
+
right: 24px;
|
|
137
137
|
display: flex;
|
|
138
138
|
align-items: center;
|
|
139
139
|
justify-content: center;
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
144
144
|
border-radius: 50%;
|
|
145
145
|
cursor: pointer;
|
|
146
|
+
z-index: 1;
|
|
146
147
|
&-img {
|
|
147
148
|
display: inline-block;
|
|
148
149
|
width: 24px;
|
|
@@ -23,6 +23,7 @@ interface Props {
|
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
layout?: 'column'|'row';
|
|
25
25
|
className?:string;
|
|
26
|
+
tail?: any;
|
|
26
27
|
}
|
|
27
28
|
interface Error {
|
|
28
29
|
name: string;
|
|
@@ -50,6 +51,7 @@ export default forwardRef((props: Props, ref) => {
|
|
|
50
51
|
layout,
|
|
51
52
|
onCheckSuccess,
|
|
52
53
|
className="",
|
|
54
|
+
tail
|
|
53
55
|
} = props;
|
|
54
56
|
|
|
55
57
|
const inputRef = useRef<any>();
|
|
@@ -78,6 +80,7 @@ export default forwardRef((props: Props, ref) => {
|
|
|
78
80
|
|
|
79
81
|
const onInputFocusHandler = () => {
|
|
80
82
|
setHasActive(true);
|
|
83
|
+
if (type && type == 'number') return;
|
|
81
84
|
inputRef.current.setSelectionRange(9999999, 9999999);
|
|
82
85
|
}
|
|
83
86
|
|
|
@@ -144,6 +147,11 @@ export default forwardRef((props: Props, ref) => {
|
|
|
144
147
|
autoComplete='off'
|
|
145
148
|
/>
|
|
146
149
|
</ToolTip>
|
|
150
|
+
{typeof tail == 'string' ? (
|
|
151
|
+
<span className={classNames(`${preCls}__tail`)}>{tail}</span>
|
|
152
|
+
) : (
|
|
153
|
+
tail
|
|
154
|
+
)}
|
|
147
155
|
</div>
|
|
148
156
|
</div>
|
|
149
|
-
})
|
|
157
|
+
})
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
.form-field-textarea {
|
|
2
|
+
&-row{
|
|
3
|
+
display: flex;
|
|
4
|
+
|
|
5
|
+
.form-field-textarea__label{
|
|
6
|
+
margin-top: 7px;
|
|
7
|
+
margin-bottom: unset;
|
|
8
|
+
}
|
|
9
|
+
.form-field-textarea__border{
|
|
10
|
+
margin-left: 16px;
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
2
15
|
&__label {
|
|
3
16
|
height: 22px;
|
|
4
17
|
font-size: 14px;
|
|
@@ -18,8 +31,8 @@
|
|
|
18
31
|
|
|
19
32
|
&__border {
|
|
20
33
|
// display: inline-block;
|
|
21
|
-
padding: 6px;
|
|
22
|
-
border-radius:
|
|
34
|
+
padding: 6px 12px;
|
|
35
|
+
border-radius: 8px;
|
|
23
36
|
transition: all 0.2s;
|
|
24
37
|
border: 1px solid #e9ecf0;
|
|
25
38
|
box-sizing: border-box;
|
|
@@ -45,6 +45,7 @@ export default forwardRef((props: Props, ref) => {
|
|
|
45
45
|
getContainer,
|
|
46
46
|
resizeType = 'none',
|
|
47
47
|
areaHeight,
|
|
48
|
+
layout,
|
|
48
49
|
} = props
|
|
49
50
|
|
|
50
51
|
const [hasError, setHasError] = useState<boolean>(false);
|
|
@@ -107,7 +108,7 @@ export default forwardRef((props: Props, ref) => {
|
|
|
107
108
|
}))
|
|
108
109
|
|
|
109
110
|
return (
|
|
110
|
-
<div className={classNames(preCls)}>
|
|
111
|
+
<div className={classNames(preCls, {[`${preCls}-row`]: layout==='row'})}>
|
|
111
112
|
<div className={classNames(`${preCls}__label`)}>
|
|
112
113
|
<span className={classNames(`${preCls}__label-text`)}>{label}</span>
|
|
113
114
|
{require && <span className={classNames(`${preCls}__label-require`)}>*</span>}
|
|
@@ -137,4 +138,4 @@ export default forwardRef((props: Props, ref) => {
|
|
|
137
138
|
</div>
|
|
138
139
|
</div>
|
|
139
140
|
)
|
|
140
|
-
})
|
|
141
|
+
})
|
|
@@ -75,6 +75,7 @@ const Form = forwardRef((props: Props, ref) => {
|
|
|
75
75
|
return (
|
|
76
76
|
<div className={classNames(preCls, className)}>
|
|
77
77
|
{React.Children.map(children, (child) => {
|
|
78
|
+
if (!child) return null;
|
|
78
79
|
const { name, value } = child.props;
|
|
79
80
|
initFieldsValue(name, value);
|
|
80
81
|
return (
|
|
@@ -15,11 +15,11 @@ interface Props {
|
|
|
15
15
|
export default function Visitor(props: Props) {
|
|
16
16
|
const { iconSrc, name, dateTime, avatarColor, userId } = props;
|
|
17
17
|
|
|
18
|
-
const [visitTime, setVisitTime] = useState(judgeTimeSpaceFromNow(dateTime));
|
|
18
|
+
const [visitTime, setVisitTime] = useState(judgeTimeSpaceFromNow(dateTime, false));
|
|
19
19
|
const toolTipRef = useRef<any>();
|
|
20
20
|
|
|
21
21
|
useEffect(() => {
|
|
22
|
-
setVisitTime(judgeTimeSpaceFromNow(dateTime));
|
|
22
|
+
setVisitTime(judgeTimeSpaceFromNow(dateTime, false));
|
|
23
23
|
}, [dateTime]);
|
|
24
24
|
|
|
25
25
|
return (
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.titaui-keyword-search {
|
|
2
|
+
background: #fff;
|
|
3
|
+
height: 36px;
|
|
4
|
+
padding: 8px;
|
|
5
|
+
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
6
|
+
display: flex;
|
|
7
|
+
border-radius: 18px;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
align-items: center;
|
|
10
|
+
|
|
11
|
+
&--active {
|
|
12
|
+
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1),
|
|
13
|
+
0px 0px 4px 0px rgba(40, 121, 255, 0.3);
|
|
14
|
+
border: 1px solid #2879ff;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__del-icon {
|
|
18
|
+
font-size: 20px;
|
|
19
|
+
color: #89919f;
|
|
20
|
+
margin-right: 4px;
|
|
21
|
+
&:hover {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
color: #f05e5e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
&__search-icon.tu-icon-search {
|
|
27
|
+
font-size: 20px !important;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
&:hover {
|
|
30
|
+
color: #2879ff;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
&__input {
|
|
34
|
+
width: 0;
|
|
35
|
+
input {
|
|
36
|
+
width: 100%;
|
|
37
|
+
border: none;
|
|
38
|
+
}
|
|
39
|
+
animation: shrink 0.1s ease;
|
|
40
|
+
}
|
|
41
|
+
&--active {
|
|
42
|
+
.titaui-keyword-search__input {
|
|
43
|
+
width: 120px;
|
|
44
|
+
margin-right: 12px;
|
|
45
|
+
animation: grow 0.1s ease;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
@keyframes grow {
|
|
50
|
+
0% {
|
|
51
|
+
width: 0;
|
|
52
|
+
}
|
|
53
|
+
100% {
|
|
54
|
+
width: 120px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
@keyframes shrink {
|
|
58
|
+
0% {
|
|
59
|
+
width: 120px;
|
|
60
|
+
}
|
|
61
|
+
100% {
|
|
62
|
+
width: 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
import React, { useState, useRef } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { getLocale } from '../../utils/getLocale';
|
|
5
|
+
import './index.scss';
|
|
6
|
+
|
|
7
|
+
const precls = 'titaui-keyword-search';
|
|
8
|
+
|
|
9
|
+
interface IProps {
|
|
10
|
+
onSearch?: Function;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const KeywordSearch = (props: IProps) => {;
|
|
14
|
+
const { onSearch } = props;
|
|
15
|
+
const inputRef = useRef();
|
|
16
|
+
const [active, setActive] = useState(false);
|
|
17
|
+
const [keyword, setKeyword] = useState('');
|
|
18
|
+
const handleSearchClick = () => {
|
|
19
|
+
if(!active) {
|
|
20
|
+
setActive(true);
|
|
21
|
+
//@ts-ignore
|
|
22
|
+
inputRef?.current?.focus();
|
|
23
|
+
} else {
|
|
24
|
+
handleSearch()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const handleSearch = () => {
|
|
28
|
+
onSearch && onSearch({keyWords:keyword});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const handleOnBlur = (e) => {
|
|
32
|
+
if(!keyword.length) setActive(false);
|
|
33
|
+
}
|
|
34
|
+
const changeValue = (e) =>{
|
|
35
|
+
setKeyword(e.target.value)
|
|
36
|
+
}
|
|
37
|
+
const handleOnKeyDown = (e) => {
|
|
38
|
+
if(e.keyCode == 13) {
|
|
39
|
+
handleSearch();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const clearKeyword = (e) =>{
|
|
43
|
+
setKeyword('')
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return <div className={classnames(precls, {[`${precls}--active`]: active})}>
|
|
47
|
+
<span className={`${precls}__input` }>
|
|
48
|
+
<input value={keyword} onKeyUp={handleOnKeyDown} onChange={changeValue} ref={inputRef} onBlur={handleOnBlur} placeholder={getLocale('Mod_Enterkeywords')} />
|
|
49
|
+
</span>
|
|
50
|
+
{
|
|
51
|
+
keyword.length > 0 &&
|
|
52
|
+
<span className={classnames('tu-icon-cross', `${precls}__del-icon` )} onClick={clearKeyword} />
|
|
53
|
+
}
|
|
54
|
+
<span className={classnames('tu-icon-search', `${precls}__search-icon`)} onClick={handleSearchClick}/>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
export default KeywordSearch;
|
|
60
|
+
|
|
@@ -4,6 +4,7 @@ import Toast from "../../../../../toast";
|
|
|
4
4
|
import DialogConfirm from "../../../../../dialog-confirm";
|
|
5
5
|
import { getRelWorks, updateChildOkrWeight } from "../../../../request-apis";
|
|
6
6
|
import WeightInput from "./weight-input";
|
|
7
|
+
import { getLocale } from "../../../../../../utils/getLocale";
|
|
7
8
|
|
|
8
9
|
import "./index.scss";
|
|
9
10
|
const { CancelButton, SureButton } = DialogConfirm;
|
|
@@ -114,10 +115,10 @@ const EditChildOkrWeight = (props: IProps) => {
|
|
|
114
115
|
{/* @ts-ignore */}
|
|
115
116
|
<span type="title">当前子目标权重合计小于100%,确定要保存吗?</span>
|
|
116
117
|
<CancelButton type="button" onClick={closeDialogConfirm}>
|
|
117
|
-
|
|
118
|
+
{getLocale('Mod_Cancel')}
|
|
118
119
|
</CancelButton>
|
|
119
120
|
<SureButton type="button" onClick={postData}>
|
|
120
|
-
|
|
121
|
+
{getLocale('Mod_Determiness')}
|
|
121
122
|
</SureButton>
|
|
122
123
|
</DialogConfirm>
|
|
123
124
|
</>
|
package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/weight-input.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import classNames from "classnames";
|
|
2
|
+
import { getLocale } from "../../../../../../utils/getLocale";
|
|
2
3
|
import React, { useState } from "react";
|
|
3
4
|
import Tooltip from "../../../../../tooltip";
|
|
4
5
|
import "./index.scss";
|
|
@@ -38,7 +39,7 @@ const WeightInput = (props: IProps) => {
|
|
|
38
39
|
<Tooltip.Error
|
|
39
40
|
overlay={
|
|
40
41
|
<span style={{ color: "#F05E5E" }}>
|
|
41
|
-
|
|
42
|
+
{getLocale('OKR_MyO_KRP_Please0and100')}
|
|
42
43
|
</span>
|
|
43
44
|
}
|
|
44
45
|
placement="top"
|
|
@@ -5,6 +5,7 @@ import UserItem from '../UserItem';
|
|
|
5
5
|
import { TreeHeader, TreeList } from '../../style';
|
|
6
6
|
import { getApiUrl, taker } from '../../../../utils/request-v1';
|
|
7
7
|
import { OpenDepartmentName } from '../../../../utils/open-data';
|
|
8
|
+
import { getLocale } from '../../../../utils/getLocale';
|
|
8
9
|
interface Props {
|
|
9
10
|
tree: Dept;
|
|
10
11
|
level: number;
|
|
@@ -82,7 +83,7 @@ export default class DepartmentTree extends PureComponent<Props, State> {
|
|
|
82
83
|
<OpenDepartmentName name={tree.DepartmentName} id={tree.Id} />
|
|
83
84
|
{/* {tree.DepartmentName} */}
|
|
84
85
|
</span>
|
|
85
|
-
<span>{tree.TotalUserCount}
|
|
86
|
+
<span>{tree.TotalUserCount}{getLocale('Mod_Number')}</span>
|
|
86
87
|
</div>
|
|
87
88
|
{isRootSelect && onSelectDept && <i className='tu-icon-add2' onMouseDown={this.handleSelectDept} />}
|
|
88
89
|
{onDeleteDept && <i className='tu-icon-cross' onMouseDown={this.handleDeleteDept} />}
|
|
@@ -4,6 +4,7 @@ import { getApiUrl, taker } from '../../../../utils/request-v1'
|
|
|
4
4
|
import { getUserInfo } from '../../../../utils/bs-global'
|
|
5
5
|
import { ListHeader, ListWrapper, List, EmptyWrapper, ListEmptyText } from '../../style'
|
|
6
6
|
import UserItem from '../UserItem'
|
|
7
|
+
import { getLocale, isEn } from '../../../../utils/getLocale'
|
|
7
8
|
import PerfectScrollbar from 'react-perfect-scrollbar'
|
|
8
9
|
import 'react-perfect-scrollbar/dist/css/styles.css';
|
|
9
10
|
interface Props {
|
|
@@ -38,7 +39,7 @@ export default class CommonList extends PureComponent<Props,State> {
|
|
|
38
39
|
{
|
|
39
40
|
hasUser &&
|
|
40
41
|
<ListHeader>
|
|
41
|
-
<span
|
|
42
|
+
<span>{getLocale('OKR_MyO_Butt_Subordinate')} {users.length}{getLocale('Mod_Number')}</span>
|
|
42
43
|
<i className="tu-icon-add2" onMouseDown={()=>this.props.onSelect(users)}/>
|
|
43
44
|
</ListHeader>
|
|
44
45
|
}
|
package/src/index.js
CHANGED
|
@@ -43,6 +43,7 @@ export { default as GridLayout } from "./components/grid-layout";
|
|
|
43
43
|
export { default as HelpCard } from "./components/help-card";
|
|
44
44
|
export { default as ImgViewer } from "./components/img-viewer";
|
|
45
45
|
export { default as InvitePeople } from "./components/invite-people";
|
|
46
|
+
export { default as KeywordSearch } from './components/keyword-search';
|
|
46
47
|
export { default as Mblog } from "./components/mblog";
|
|
47
48
|
export { default as Menus } from "./components/menus";
|
|
48
49
|
export { default as NavTop } from "./components/nav-top";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background: #f0f4fa;
|
|
5
|
+
overflow: hidden;
|
|
5
6
|
|
|
6
7
|
&__header {
|
|
7
8
|
height: 54px;
|
|
@@ -45,7 +46,6 @@
|
|
|
45
46
|
display: flex;
|
|
46
47
|
height: calc(100vh - 74px);
|
|
47
48
|
padding: 0 16px;
|
|
48
|
-
overflow: hidden;
|
|
49
49
|
|
|
50
50
|
&-menu {
|
|
51
51
|
position: relative;
|
|
@@ -69,13 +69,13 @@ const PageLayout = (props) => {
|
|
|
69
69
|
align={{ offset: [0, 0] }}
|
|
70
70
|
>
|
|
71
71
|
<div
|
|
72
|
-
className={
|
|
72
|
+
className={`${preCls}__kefu`}
|
|
73
73
|
onClick={onClickKefu}
|
|
74
74
|
/>
|
|
75
75
|
</Tooltip>
|
|
76
76
|
)}
|
|
77
77
|
{isTrial && (
|
|
78
|
-
<div className={
|
|
78
|
+
<div className={`${preCls}__invite`}>
|
|
79
79
|
<InvitePeople />
|
|
80
80
|
</div>
|
|
81
81
|
)}
|